diff --git a/src/ComputeSharp.SourceGenerators/IShaderGenerator.CreateBuildHlslSourceMethod.Syntax.cs b/src/ComputeSharp.SourceGenerators/IShaderGenerator.CreateBuildHlslSourceMethod.Syntax.cs
index ec8aefcf..1453de43 100644
--- a/src/ComputeSharp.SourceGenerators/IShaderGenerator.CreateBuildHlslSourceMethod.Syntax.cs
+++ b/src/ComputeSharp.SourceGenerators/IShaderGenerator.CreateBuildHlslSourceMethod.Syntax.cs
@@ -26,7 +26,7 @@ partial class IShaderGenerator
writer.WriteLine("hlslSource =");
writer.IncreaseIndent();
writer.WriteLine("\"\"\"");
- writer.Write(info.HlslShaderSource.HlslSource, isMultiline: true);
+ writer.Write(info.HlslSource, isMultiline: true);
writer.WriteLine("\"\"\";");
writer.DecreaseIndent();
}
diff --git a/src/ComputeSharp.SourceGenerators/IShaderGenerator.CreateBuildHlslSourceMethod.cs b/src/ComputeSharp.SourceGenerators/IShaderGenerator.CreateBuildHlslSourceMethod.cs
index 80ab5c6c..92d1d182 100644
--- a/src/ComputeSharp.SourceGenerators/IShaderGenerator.CreateBuildHlslSourceMethod.cs
+++ b/src/ComputeSharp.SourceGenerators/IShaderGenerator.CreateBuildHlslSourceMethod.cs
@@ -7,7 +7,6 @@ using ComputeSharp.SourceGeneration.Helpers;
using ComputeSharp.SourceGeneration.Mappings;
using ComputeSharp.SourceGeneration.Models;
using ComputeSharp.SourceGeneration.SyntaxRewriters;
-using ComputeSharp.SourceGenerators.Models;
using ComputeSharp.SourceGenerators.SyntaxRewriters;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
@@ -32,16 +31,23 @@ partial class IShaderGenerator
/// The input object currently in use.
/// The node to process.
/// The for .
- /// The info on the shader thread count size to use.
+ /// The thread ids value for the X axis.
+ /// The thread ids value for the Y axis.
+ /// The thread ids value for the Z axis.
/// Indicates whether the current shader uses an implicit texture.
- /// The resulting info on the processed shader.
- public static HlslShaderSourceInfo GetInfo(
+ /// Whether or not the static sampler is used.
+ /// The resulting HLSL source for the current shader.
+ public static void GetInfo(
ImmutableArrayBuilder diagnostics,
Compilation compilation,
StructDeclarationSyntax structDeclaration,
INamedTypeSymbol structDeclarationSymbol,
- ThreadIdsInfo threadIds,
- out bool isImplicitTextureUsed)
+ int threadsX,
+ int threadsY,
+ int threadsZ,
+ out bool isImplicitTextureUsed,
+ out bool isSamplerUsed,
+ out string hlslSource)
{
// Detect invalid properties
DetectAndReportInvalidPropertyDeclarations(diagnostics, structDeclarationSymbol);
@@ -65,7 +71,7 @@ partial class IShaderGenerator
string? implicitTextureType = isComputeShader ? null : HlslKnownTypes.GetMappedNameForPixelShaderType(pixelShaderSymbol!);
(ImmutableArray<(string MetadataName, string Name, string HlslType)> resourceFields, ImmutableArray<(string Name, string HlslType)> valueFields) = GetInstanceFields(diagnostics, structDeclarationSymbol, discoveredTypes, isComputeShader);
ImmutableArray<(string Name, string Type, int? Count)> sharedBuffers = GetSharedBuffers(diagnostics, structDeclarationSymbol, discoveredTypes);
- (string entryPoint, ImmutableArray<(string Signature, string Definition)> processedMethods, bool isSamplerUsed) = GetProcessedMethods(diagnostics, structDeclaration, structDeclarationSymbol, semanticModelProvider, discoveredTypes, staticMethods, instanceMethods, constantDefinitions, isComputeShader);
+ (string entryPoint, ImmutableArray<(string Signature, string Definition)> processedMethods, isSamplerUsed) = GetProcessedMethods(diagnostics, structDeclaration, structDeclarationSymbol, semanticModelProvider, discoveredTypes, staticMethods, instanceMethods, constantDefinitions, isComputeShader);
(string, string)? implicitSamplerField = isSamplerUsed ? ("SamplerState", "__sampler") : default((string, string)?);
ImmutableArray<(string Name, string TypeDeclaration, string? Assignment)> staticFields = GetStaticFields(diagnostics, semanticModelProvider, structDeclaration, structDeclarationSymbol, discoveredTypes, constantDefinitions);
@@ -77,8 +83,10 @@ partial class IShaderGenerator
isImplicitTextureUsed = implicitTextureType is not null;
// Get the HLSL source data with the intermediate info
- return GetHlslSourceInfo(
- threadIds,
+ hlslSource = GetHlslSourceInfo(
+ threadsX,
+ threadsY,
+ threadsZ,
definedConstants,
declaredTypes,
resourceFields,
@@ -544,7 +552,9 @@ partial class IShaderGenerator
///
/// Produces the series of statements to build the current HLSL source.
///
- /// The info on the shader thread count size to use.
+ /// The thread ids value for the X axis.
+ /// The thread ids value for the Y axis.
+ /// The thread ids value for the Z axis.
/// The sequence of defined constants for the shader.
/// The sequence of declared types used by the shader.
/// The sequence of resource instance fields for the current shader.
@@ -556,9 +566,11 @@ partial class IShaderGenerator
/// The type of the implicit target texture, if present.
/// Whether the static sampler is used by the shader.
/// The body of the entry point of the shader.
- /// The series of statements to build the HLSL source to compile to execute the current shader.
- private static HlslShaderSourceInfo GetHlslSourceInfo(
- ThreadIdsInfo threadIds,
+ /// The HLSL source for the current shader.
+ private static string GetHlslSourceInfo(
+ int threadsX,
+ int threadsY,
+ int threadsZ,
ImmutableArray<(string Name, string Value)> definedConstants,
ImmutableArray<(string Name, string Definition)> declaredTypes,
ImmutableArray<(string MetadataName, string Name, string HlslType)> resourceFields,
@@ -578,11 +590,6 @@ partial class IShaderGenerator
hlslBuilder.Add('\n');
}
- void AppendLine(string text)
- {
- hlslBuilder.AddRange(text.AsSpan());
- }
-
void AppendLineAndLF(string text)
{
hlslBuilder.AddRange(text.AsSpan());
@@ -613,12 +620,9 @@ partial class IShaderGenerator
// Group size constants
AppendLF();
- AppendLine("#define __GroupSize__get_X ");
- AppendLineAndLF(threadIds.X.ToString());
- AppendLine("#define __GroupSize__get_Y ");
- AppendLineAndLF(threadIds.Y.ToString());
- AppendLine("#define __GroupSize__get_Z ");
- AppendLineAndLF(threadIds.Z.ToString());
+ AppendLineAndLF($"#define __GroupSize__get_X {threadsX}");
+ AppendLineAndLF($"#define __GroupSize__get_Y {threadsY}");
+ AppendLineAndLF($"#define __GroupSize__get_Z {threadsZ}");
// Define declarations
foreach ((string name, string value) in definedConstants)
@@ -740,9 +744,7 @@ partial class IShaderGenerator
AppendLineAndLF("[NumThreads(__GroupSize__get_X, __GroupSize__get_Y, __GroupSize__get_Z)]");
AppendLineAndLF(executeMethod);
- string hlslSource = FlushText();
-
- return new(hlslSource, isSamplerUsed);
+ return FlushText();
}
}
}
\ No newline at end of file
diff --git a/src/ComputeSharp.SourceGenerators/IShaderGenerator.CreateLoadBytecodeMethod.Syntax.cs b/src/ComputeSharp.SourceGenerators/IShaderGenerator.CreateLoadBytecodeMethod.Syntax.cs
index a2bf243c..1fef76ce 100644
--- a/src/ComputeSharp.SourceGenerators/IShaderGenerator.CreateLoadBytecodeMethod.Syntax.cs
+++ b/src/ComputeSharp.SourceGenerators/IShaderGenerator.CreateLoadBytecodeMethod.Syntax.cs
@@ -31,7 +31,7 @@ partial class IShaderGenerator
}
// Check that the [numthreads] values match
- writer.WriteLine($"if (threadsX == {info.ThreadIds.X} && threadsY == {info.ThreadIds.Y} && threadsZ == {info.ThreadIds.Z})");
+ writer.WriteLine($"if (threadsX == {info.ThreadsX} && threadsY == {info.ThreadsY} && threadsZ == {info.ThreadsZ})");
using (writer.WriteBlock())
{
diff --git a/src/ComputeSharp.SourceGenerators/IShaderGenerator.CreateLoadBytecodeMethod.cs b/src/ComputeSharp.SourceGenerators/IShaderGenerator.CreateLoadBytecodeMethod.cs
index 22451587..dd4774c0 100644
--- a/src/ComputeSharp.SourceGenerators/IShaderGenerator.CreateLoadBytecodeMethod.cs
+++ b/src/ComputeSharp.SourceGenerators/IShaderGenerator.CreateLoadBytecodeMethod.cs
@@ -11,7 +11,6 @@ using ComputeSharp.Shaders.Translation;
using ComputeSharp.SourceGeneration.Extensions;
using ComputeSharp.SourceGeneration.Helpers;
using ComputeSharp.SourceGeneration.Models;
-using ComputeSharp.SourceGenerators.Models;
using Microsoft.CodeAnalysis;
using TerraFX.Interop.DirectX;
using TerraFX.Interop.Windows;
@@ -39,12 +38,15 @@ partial class IShaderGenerator
///
/// The collection of produced instances.
/// The input instance to process.
- /// Indicates whether or not dynamic shaders are supported.
- /// The thread ids for the precompiled shader, if available.
- public static ThreadIdsInfo GetInfo(
+ /// The thread ids value for the X axis.
+ /// The thread ids value for the Y axis.
+ /// The thread ids value for the Z axis.
+ public static void GetInfo(
ImmutableArrayBuilder diagnostics,
INamedTypeSymbol structDeclarationSymbol,
- bool supportsDynamicShaders)
+ out int threadsX,
+ out int threadsY,
+ out int threadsZ)
{
// Try to get the attribute that controls shader precompilation (has to be present when ComputeSharp.Dynamic is not referenced)
if (!structDeclarationSymbol.TryGetAttributeWithFullyQualifiedMetadataName(typeof(EmbeddedBytecodeAttribute).FullName, out AttributeData? attribute))
@@ -52,12 +54,10 @@ partial class IShaderGenerator
// Emit the diagnostics if dynamic shaders are not supported
diagnostics.Add(MissingEmbeddedBytecodeAttributeWhenDynamicShaderCompilationIsNotSupported, structDeclarationSymbol, structDeclarationSymbol);
- return new(true, 0, 0, 0);
- }
+ threadsX = threadsY = threadsZ = 0;
- int threadsX;
- int threadsY;
- int threadsZ;
+ return;
+ }
// Check for a dispatch axis argument first
if (attribute.ConstructorArguments.Length == 1)
@@ -81,7 +81,9 @@ partial class IShaderGenerator
{
diagnostics.Add(InvalidEmbeddedBytecodeDispatchAxis, structDeclarationSymbol, structDeclarationSymbol);
- return new(true, 0, 0, 0);
+ threadsX = threadsY = threadsZ = 0;
+
+ return;
}
}
else if (
@@ -96,7 +98,9 @@ partial class IShaderGenerator
// Failed to validate the thread number arguments
diagnostics.Add(InvalidEmbeddedBytecodeThreadIds, structDeclarationSymbol, structDeclarationSymbol);
- return new(true, 0, 0, 0);
+ threadsX = threadsY = threadsZ = 0;
+
+ return;
}
else
{
@@ -104,31 +108,19 @@ partial class IShaderGenerator
threadsY = explicitThreadsY;
threadsZ = explicitThreadsZ;
}
-
- // Ensure the bytecode generation is disabled if any errors are present. This step is done last to ensure that
- // all available diagnostics are still emitted correctly before reaching this point, instead of being disabled.
- if (diagnostics.Count > 0)
- {
- return new(true, 0, 0, 0);
- }
-
- return new(false, threadsX, threadsY, threadsZ);
}
///
/// Gets the instance for the input shader info.
///
- /// The input instance to process.
/// The generated HLSL source code (ignoring captured delegates, if present).
+ /// Whether compilation is enabled.
/// The used to cancel the operation, if needed.
/// The instance for the current shader.
- public static unsafe HlslBytecodeInfo GetBytecode(
- ThreadIdsInfo threadIds,
- string hlslSource,
- CancellationToken token)
+ public static unsafe HlslBytecodeInfo GetBytecode(string hlslSource, bool isCompilationEnabled, CancellationToken token)
{
// Skip even attempting to compile if compilation is disabled (see comments in D2D1 generator)
- if (threadIds.IsDefault)
+ if (!isCompilationEnabled)
{
return HlslBytecodeInfo.Missing.Instance;
}
diff --git a/src/ComputeSharp.SourceGenerators/IShaderGenerator.CreateLoadDispatchDataMethod.Syntax.cs b/src/ComputeSharp.SourceGenerators/IShaderGenerator.CreateLoadDispatchDataMethod.Syntax.cs
index ebf5a4f3..ee7c1249 100644
--- a/src/ComputeSharp.SourceGenerators/IShaderGenerator.CreateLoadDispatchDataMethod.Syntax.cs
+++ b/src/ComputeSharp.SourceGenerators/IShaderGenerator.CreateLoadDispatchDataMethod.Syntax.cs
@@ -24,9 +24,9 @@ partial class IShaderGenerator
using (writer.WriteBlock())
{
- int numberOfResources = info.DispatchMetadata.ResourceDescriptors.Length;
+ int numberOfResources = info.ResourceDescriptors.Length;
- writer.WriteLine($"global::System.Span span0 = stackalloc uint[{info.DispatchData.Root32BitConstantCount}];");
+ writer.WriteLine($"global::System.Span span0 = stackalloc uint[{info.Root32BitConstantCount}];");
writer.WriteLineIf($"global::System.Span span1 = stackalloc ulong[{numberOfResources}];", numberOfResources > 0);
writer.WriteLine("ref uint r0 = ref span0[0];");
writer.WriteLineIf("ref ulong r1 = ref span1[0];", numberOfResources > 0);
@@ -34,10 +34,10 @@ partial class IShaderGenerator
// Append the statements for the dispatch ranges
writer.WriteLine("span0[0] = (uint)x;");
writer.WriteLine("span0[1] = (uint)y;");
- writer.WriteLineIf("span0[2] = (uint)z;", !info.DispatchData.IsPixelShaderLike);
+ writer.WriteLineIf("span0[2] = (uint)z;", !info.IsPixelShaderLike);
// Generate loading statements for each captured field
- foreach (FieldInfo fieldInfo in info.DispatchData.FieldInfos)
+ foreach (FieldInfo fieldInfo in info.Fields)
{
switch (fieldInfo)
{
diff --git a/src/ComputeSharp.SourceGenerators/IShaderGenerator.CreateLoadDispatchMetadataMethod.Syntax.cs b/src/ComputeSharp.SourceGenerators/IShaderGenerator.CreateLoadDispatchMetadataMethod.Syntax.cs
index f94ae950..2faed681 100644
--- a/src/ComputeSharp.SourceGenerators/IShaderGenerator.CreateLoadDispatchMetadataMethod.Syntax.cs
+++ b/src/ComputeSharp.SourceGenerators/IShaderGenerator.CreateLoadDispatchMetadataMethod.Syntax.cs
@@ -26,7 +26,7 @@ partial class IShaderGenerator
using (writer.WriteBlock())
{
// Compute the total number of resources
- int totalResourcesCount = info.DispatchMetadata.ResourceDescriptors.Length;
+ int totalResourcesCount = info.ResourceDescriptors.Length;
writer.WriteLine("global::System.Span span0 = stackalloc byte[5];");
writer.WriteLine($"global::System.Span span1 = stackalloc global::ComputeSharp.__Internals.ResourceDescriptor[{totalResourcesCount}];");
@@ -34,11 +34,11 @@ partial class IShaderGenerator
writer.WriteLine("ref global::ComputeSharp.__Internals.ResourceDescriptor r1 = ref span1[0];");
// Write the serialized shader metadata
- writer.WriteLine($"global::System.Runtime.CompilerServices.Unsafe.WriteUnaligned(ref global::System.Runtime.CompilerServices.Unsafe.Add(ref r0, 0), {info.DispatchMetadata.Root32BitConstantCount});");
- writer.WriteLine($"global::System.Runtime.CompilerServices.Unsafe.WriteUnaligned(ref global::System.Runtime.CompilerServices.Unsafe.Add(ref r0, 4), {info.DispatchMetadata.IsSamplerUsed.ToString(CultureInfo.InvariantCulture).ToLowerInvariant()});");
+ writer.WriteLine($"global::System.Runtime.CompilerServices.Unsafe.WriteUnaligned(ref global::System.Runtime.CompilerServices.Unsafe.Add(ref r0, 0), {info.Root32BitConstantCount});");
+ writer.WriteLine($"global::System.Runtime.CompilerServices.Unsafe.WriteUnaligned(ref global::System.Runtime.CompilerServices.Unsafe.Add(ref r0, 4), {info.IsSamplerUsed.ToString(CultureInfo.InvariantCulture).ToLowerInvariant()});");
// Populate the sequence of resource descriptors
- foreach (ResourceDescriptor descriptor in info.DispatchMetadata.ResourceDescriptors)
+ foreach (ResourceDescriptor descriptor in info.ResourceDescriptors)
{
writer.WriteLine($"global::ComputeSharp.__Internals.ResourceDescriptor.Create({descriptor.TypeId}, {descriptor.RegisterOffset}, out global::System.Runtime.CompilerServices.Unsafe.Add(ref r1, {descriptor.Offset}));");
}
diff --git a/src/ComputeSharp.SourceGenerators/IShaderGenerator.CreateLoadDispatchMetadataMethod.cs b/src/ComputeSharp.SourceGenerators/IShaderGenerator.CreateLoadDispatchMetadataMethod.cs
index 6822c017..96fe4ebf 100644
--- a/src/ComputeSharp.SourceGenerators/IShaderGenerator.CreateLoadDispatchMetadataMethod.cs
+++ b/src/ComputeSharp.SourceGenerators/IShaderGenerator.CreateLoadDispatchMetadataMethod.cs
@@ -21,7 +21,7 @@ partial class IShaderGenerator
/// Whether the static sampler is used by the shader.
/// The sequence of captured fields for the shader.
/// The metadata info for the shader.
- public static DispatchMetadataInfo GetInfo(
+ public static ImmutableArray GetInfo(
int root32BitConstantCount,
bool isImplicitTextureUsed,
bool isSamplerUsed,
@@ -57,10 +57,7 @@ partial class IShaderGenerator
}
}
- return new(
- root32BitConstantCount,
- isSamplerUsed,
- descriptors.ToImmutable());
+ return descriptors.ToImmutable();
}
}
}
\ No newline at end of file
diff --git a/src/ComputeSharp.SourceGenerators/IShaderGenerator.cs b/src/ComputeSharp.SourceGenerators/IShaderGenerator.cs
index 92a4c5f0..acc3d723 100644
--- a/src/ComputeSharp.SourceGenerators/IShaderGenerator.cs
+++ b/src/ComputeSharp.SourceGenerators/IShaderGenerator.cs
@@ -65,34 +65,43 @@ public sealed partial class IShaderGenerator : IIncrementalGenerator
token.ThrowIfCancellationRequested();
// TryGetBytecode() info
- ThreadIdsInfo threadIds = LoadBytecode.GetInfo(
+ LoadBytecode.GetInfo(
diagnostics,
typeSymbol,
- false);
+ out int threadsX,
+ out int threadsY,
+ out int threadsZ);
token.ThrowIfCancellationRequested();
// BuildHlslSource() info
- HlslShaderSourceInfo hlslSourceInfo = BuildHlslSource.GetInfo(
+ BuildHlslSource.GetInfo(
diagnostics,
context.SemanticModel.Compilation,
typeDeclaration,
typeSymbol,
- threadIds,
- out bool isImplicitTextureUsed);
+ threadsX,
+ threadsY,
+ threadsZ,
+ out bool isImplicitTextureUsed,
+ out bool isSamplerUsed,
+ out string hlslSource);
token.ThrowIfCancellationRequested();
// GetDispatchMetadata() info
- DispatchMetadataInfo dispatchMetadataInfo = LoadDispatchMetadata.GetInfo(
+ ImmutableArray resourceDescriptors = LoadDispatchMetadata.GetInfo(
root32BitConstantCount,
isImplicitTextureUsed,
- hlslSourceInfo.IsSamplerUsed,
+ isSamplerUsed,
fieldInfos);
token.ThrowIfCancellationRequested();
- HlslBytecodeInfo hlslInfo = LoadBytecode.GetBytecode(threadIds, hlslSourceInfo.HlslSource, token);
+ // Like for D2D1 shaders, disable compilation if any errors are present
+ bool isCompilationEnabled = diagnostics.WrittenSpan.IsEmpty;
+
+ HlslBytecodeInfo hlslInfo = LoadBytecode.GetBytecode(hlslSource, isCompilationEnabled, token);
token.ThrowIfCancellationRequested();
@@ -107,15 +116,16 @@ public sealed partial class IShaderGenerator : IIncrementalGenerator
return new ShaderInfo(
Hierarchy: hierarchyInfo,
- DispatchData: new DispatchDataInfo(
- isPixelShaderLike,
- fieldInfos,
- resourceCount,
- root32BitConstantCount),
- DispatchMetadata: dispatchMetadataInfo,
- HlslShaderSource: hlslSourceInfo,
+ ThreadsX: threadsX,
+ ThreadsY: threadsY,
+ ThreadsZ: threadsZ,
+ IsPixelShaderLike: isPixelShaderLike,
+ IsSamplerUsed: isSamplerUsed,
+ Fields: fieldInfos,
+ ResourceDescriptors: resourceDescriptors,
+ Root32BitConstantCount: root32BitConstantCount,
+ HlslSource: hlslSource,
HlslInfo: hlslInfo,
- ThreadIds: threadIds,
Diagnostcs: diagnostics.ToImmutable());
})
.Where(static item => item is not null)!;
diff --git a/src/ComputeSharp.SourceGenerators/Models/DispatchDataInfo.cs b/src/ComputeSharp.SourceGenerators/Models/DispatchDataInfo.cs
deleted file mode 100644
index e07d16e8..00000000
--- a/src/ComputeSharp.SourceGenerators/Models/DispatchDataInfo.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-using ComputeSharp.SourceGeneration.Helpers;
-
-namespace ComputeSharp.SourceGenerators.Models;
-
-///
-/// A model representing gathered info on a shader dispatch data.
-///
-/// Whether the compute shader is "pixel shader like", ie. outputting a pixel into a target texture.
-/// The description on shader instance fields.
-/// The total number of captured resources.
-/// The size of the shader root signature, in 32 bit constants.
-internal sealed record DispatchDataInfo(
- bool IsPixelShaderLike,
- EquatableArray FieldInfos,
- int ResourceCount,
- int Root32BitConstantCount);
\ No newline at end of file
diff --git a/src/ComputeSharp.SourceGenerators/Models/DispatchMetadataInfo.cs b/src/ComputeSharp.SourceGenerators/Models/DispatchMetadataInfo.cs
deleted file mode 100644
index 1cba4ce6..00000000
--- a/src/ComputeSharp.SourceGenerators/Models/DispatchMetadataInfo.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-using ComputeSharp.SourceGeneration.Helpers;
-
-namespace ComputeSharp.SourceGenerators.Models;
-
-///
-/// A model containing info on shader dispatch metadata.
-///
-/// The size of the shader root signature, in 32 bit constants.
-/// Whether or not the static sampler is used.
-/// The sequence of resource descriptors for the shader.
-internal sealed record DispatchMetadataInfo(int Root32BitConstantCount, bool IsSamplerUsed, EquatableArray ResourceDescriptors);
\ No newline at end of file
diff --git a/src/ComputeSharp.SourceGenerators/Models/HlslShaderSourceInfo.cs b/src/ComputeSharp.SourceGenerators/Models/HlslShaderSourceInfo.cs
deleted file mode 100644
index e0220a50..00000000
--- a/src/ComputeSharp.SourceGenerators/Models/HlslShaderSourceInfo.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-namespace ComputeSharp.SourceGenerators.Models;
-
-///
-/// A model for extracted info on a processed HLSL shader.
-///
-/// The HLSL source for the shader.
-/// Whether or not the static sampler is used.
-internal sealed record HlslShaderSourceInfo(string HlslSource, bool IsSamplerUsed);
\ No newline at end of file
diff --git a/src/ComputeSharp.SourceGenerators/Models/ShaderInfo.cs b/src/ComputeSharp.SourceGenerators/Models/ShaderInfo.cs
index 65c72ef5..6f593b31 100644
--- a/src/ComputeSharp.SourceGenerators/Models/ShaderInfo.cs
+++ b/src/ComputeSharp.SourceGenerators/Models/ShaderInfo.cs
@@ -7,17 +7,27 @@ namespace ComputeSharp.SourceGenerators.Models;
/// A model representing all necessary info for a full generation pass for a shader.
///
/// The hierarchy info for the shader type.
-/// The gathered shader dispatch data.
-/// The gathered shader dispatch metadata.
-/// The processed HLSL source for the shader.
+/// The thread ids value for the X axis.
+/// The thread ids value for the Y axis.
+/// The thread ids value for the Z axis.
+/// Whether the compute shader is "pixel shader like", ie. outputting a pixel into a target texture.
+/// Whether or not the static sampler is used.
+/// The description on shader instance fields.
+/// The sequence of resource descriptors for the shader.
+/// The size of the shader root signature, in 32 bit constants.
+/// The HLSL source for the shader.
/// The value with processed info on the shader.
-/// The thread ids for the shader, if compilation is requested.
/// The discovered diagnostics, if any.
internal sealed record ShaderInfo(
HierarchyInfo Hierarchy,
- DispatchDataInfo DispatchData,
- DispatchMetadataInfo DispatchMetadata,
- HlslShaderSourceInfo HlslShaderSource,
+ int ThreadsX,
+ int ThreadsY,
+ int ThreadsZ,
+ bool IsPixelShaderLike,
+ bool IsSamplerUsed,
+ EquatableArray Fields,
+ EquatableArray ResourceDescriptors,
+ int Root32BitConstantCount,
+ string HlslSource,
HlslBytecodeInfo HlslInfo,
- ThreadIdsInfo ThreadIds,
EquatableArray Diagnostcs);
\ No newline at end of file
diff --git a/src/ComputeSharp.SourceGenerators/Models/ThreadIdsInfo.cs b/src/ComputeSharp.SourceGenerators/Models/ThreadIdsInfo.cs
deleted file mode 100644
index aae33b3d..00000000
--- a/src/ComputeSharp.SourceGenerators/Models/ThreadIdsInfo.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-namespace ComputeSharp.SourceGenerators.Models;
-
-///
-/// A model representing gathered info on a embedded thread ids.
-///
-/// Whether the values are discarded.
-/// The thread ids value for the X axis.
-/// The thread ids value for the Y axis.
-/// The thread ids value for the Z axis.
-internal sealed record ThreadIdsInfo(bool IsDefault, int X, int Y, int Z);
\ No newline at end of file