Implement ID2D1Shader.LoadDispatchData generator

このコミットが含まれているのは:
Sergio Pedri committed 2022-04-24 21:03:46 +02:00
1 親 2212b8716d
コミット e68861e679
7ファイル変更
+432 -33

検索条件に一致するファイルはありません

-8
ファイルの表示
@@ -9,15 +9,11 @@ namespace ComputeSharp.D2D1Interop.SourceGenerators.Models;
/// A model representing gathered info on a shader dispatch data.
/// </summary>
/// <param name="Hierarchy">The hierarchy data for the shader.</param>
/// <param name="Type">The shader interface type.</param>
/// <param name="FieldInfos">The description on shader instance fields.</param>
/// <param name="ResourceCount">The total number of captured resources.</param>
/// <param name="Root32BitConstantCount">The size of the shader root signature, in 32 bit constants.</param>
internal sealed record DispatchDataInfo(
HierarchyInfo Hierarchy,
Type Type,
ImmutableArray<FieldInfo> FieldInfos,
int ResourceCount,
int Root32BitConstantCount)
{
/// <summary>
@@ -50,9 +46,7 @@ internal sealed record DispatchDataInfo(
return
HierarchyInfo.Comparer.Default.Equals(x.Hierarchy, y.Hierarchy) &&
x.Type == y.Type &&
x.FieldInfos.SequenceEqual(y.FieldInfos, FieldInfo.Comparer.Default) &&
x.ResourceCount == y.ResourceCount &&
x.Root32BitConstantCount == y.Root32BitConstantCount;
}
@@ -62,9 +56,7 @@ internal sealed record DispatchDataInfo(
HashCode hashCode = default;
hashCode.Add(HierarchyInfo.Comparer.Default.GetHashCode(obj.Hierarchy));
hashCode.Add(obj.Type);
hashCode.AddRange(obj.FieldInfos, FieldInfo.Comparer.Default);
hashCode.Add(obj.ResourceCount);
hashCode.Add(obj.Root32BitConstantCount);
return hashCode.ToHashCode();