Remove symbols from IShaderGenerator pipeline
このコミットが含まれているのは:
1 親
9eac3c779d
コミット
a205efe6fa
9ファイル変更
+283
-203
検索条件に一致するファイルはありません
@@ -3,21 +3,18 @@ using System.Collections.Generic;
|
||||
using System.Collections.Immutable;
|
||||
using ComputeSharp.SourceGeneration.Extensions;
|
||||
using ComputeSharp.SourceGeneration.Helpers;
|
||||
using ComputeSharp.SourceGeneration.Models;
|
||||
|
||||
namespace ComputeSharp.SourceGenerators.Models;
|
||||
|
||||
/// <summary>
|
||||
/// 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,
|
||||
ShaderType Type,
|
||||
ImmutableArray<FieldInfo> FieldInfos,
|
||||
int ResourceCount,
|
||||
int Root32BitConstantCount)
|
||||
@@ -36,7 +33,6 @@ internal sealed record DispatchDataInfo(
|
||||
/// <inheritdoc/>
|
||||
protected override void AddToHashCode(ref HashCode hashCode, DispatchDataInfo obj)
|
||||
{
|
||||
hashCode.Add(obj.Hierarchy);
|
||||
hashCode.Add(obj.Type);
|
||||
hashCode.AddRange(obj.FieldInfos);
|
||||
hashCode.Add(obj.ResourceCount);
|
||||
@@ -47,7 +43,6 @@ internal sealed record DispatchDataInfo(
|
||||
protected override bool AreEqual(DispatchDataInfo x, DispatchDataInfo y)
|
||||
{
|
||||
return
|
||||
x.Hierarchy == y.Hierarchy &&
|
||||
x.Type == y.Type &&
|
||||
x.FieldInfos.SequenceEqual(y.FieldInfos) &&
|
||||
x.ResourceCount == y.ResourceCount &&
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Immutable;
|
||||
using ComputeSharp.SourceGeneration.Extensions;
|
||||
using ComputeSharp.SourceGeneration.Helpers;
|
||||
using ComputeSharp.SourceGeneration.Models;
|
||||
|
||||
namespace ComputeSharp.SourceGenerators.Models;
|
||||
|
||||
/// <summary>
|
||||
/// A model representing all necessary info for a full generation pass for a shader.
|
||||
/// </summary>
|
||||
/// <param name="Hierarchy">The hierarchy info for the shader type.</param>
|
||||
/// <param name="DispatchId">The gathered dispatch id for the shader type.</param>
|
||||
/// <param name="DispatchData">The gathered shader dispatch data.</param>
|
||||
/// <param name="DispatchMetadata">The gathered shader dispatch metadata.</param>
|
||||
/// <param name="HlslShaderSource">The processed HLSL source for the shader.</param>
|
||||
/// <param name="ThreadIds">The thread ids for the shader, if compilation is requested.</param>
|
||||
/// <param name="Diagnostcs">The discovered diagnostics, if any.</param>
|
||||
internal sealed record ShaderInfo(
|
||||
HierarchyInfo Hierarchy,
|
||||
DispatchIdInfo DispatchId,
|
||||
DispatchDataInfo DispatchData,
|
||||
DispatchMetadataInfo DispatchMetadata,
|
||||
HlslShaderSourceInfo HlslShaderSource,
|
||||
ThreadIdsInfo ThreadIds,
|
||||
ImmutableArray<DiagnosticInfo> Diagnostcs)
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public bool Equals(ShaderInfo? obj) => Comparer.Default.Equals(this, obj);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override int GetHashCode() => Comparer.Default.GetHashCode(this);
|
||||
|
||||
/// <summary>
|
||||
/// An <see cref="IEqualityComparer{T}"/> implementation for <see cref="ShaderInfo"/>.
|
||||
/// </summary>
|
||||
private sealed class Comparer : Comparer<ShaderInfo, Comparer>
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
protected override void AddToHashCode(ref HashCode hashCode, ShaderInfo obj)
|
||||
{
|
||||
hashCode.Add(obj.Hierarchy);
|
||||
hashCode.Add(obj.DispatchId);
|
||||
hashCode.Add(obj.DispatchData);
|
||||
hashCode.Add(obj.DispatchMetadata);
|
||||
hashCode.Add(obj.HlslShaderSource);
|
||||
hashCode.Add(obj.ThreadIds);
|
||||
hashCode.AddRange(obj.Diagnostcs);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
protected override bool AreEqual(ShaderInfo x, ShaderInfo y)
|
||||
{
|
||||
return
|
||||
x.Hierarchy == y.Hierarchy &&
|
||||
x.DispatchId == y.DispatchId &&
|
||||
x.DispatchData == y.DispatchData &&
|
||||
x.DispatchMetadata == y.DispatchMetadata &&
|
||||
x.HlslShaderSource == y.HlslShaderSource &&
|
||||
x.ThreadIds == y.ThreadIds &&
|
||||
x.Diagnostcs.SequenceEqual(y.Diagnostcs);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
namespace ComputeSharp.SourceGenerators.Models;
|
||||
|
||||
/// <summary>
|
||||
/// Indicates a type of shader being processed.
|
||||
/// </summary>
|
||||
public enum ShaderType
|
||||
{
|
||||
/// <summary>
|
||||
/// A compute shader.
|
||||
/// </summary>
|
||||
ComputeShader,
|
||||
|
||||
/// <summary>
|
||||
/// A pixel shader.
|
||||
/// </summary>
|
||||
PixelShader
|
||||
}
|
||||
新しいイシューから参照
ユーザーをブロックする