From be0f0cf5936013753285c22d39b9dfedd682922b Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Fri, 27 Oct 2023 21:03:31 +0200 Subject: [PATCH] Rename DispatchAxis to DefaultThreadGroupSizes --- .../Blas/BlasHelpers.cs | 2 +- .../Dispatching/DispatchingBenchmark.cs | 2 +- .../HlslBokehBlurProcessor.Implementation.cs | 8 ++-- ...lslGaussianBlurProcessor.Implementation.cs | 4 +- .../MultiplyByTwo.cs | 2 +- samples/ComputeSharp.Sample/Program.cs | 2 +- .../ColorfulInfinity.cs | 2 +- .../ContouredLayers.cs | 2 +- .../ExtrudedTruchetPattern.cs | 2 +- .../FourColorGradient.cs | 2 +- .../FractalTiling.cs | 2 +- .../HelloWorld.cs | 2 +- .../MengerJourney.cs | 2 +- .../Octagrams.cs | 2 +- .../ProteanClouds.cs | 2 +- .../PyramidPattern.cs | 2 +- .../TerracedHills.cs | 2 +- .../TriangleGridContouring.cs | 2 +- .../TwoTiledTruchet.cs | 2 +- ...uteShaderDescriptorGenerator.NumThreads.cs | 20 ++++---- .../ComputeSharp.SourceGenerators.csproj | 2 +- .../Diagnostics/DiagnosticDescriptors.cs | 12 ++--- .../Enums/DefaultThreadGroupSizes.cs} | 21 +++++---- .../Attributes/ThreadGroupSizeAttribute.cs | 28 +++++------ tests/ComputeSharp.Dxc.NuGet/Program.cs | 2 +- tests/ComputeSharp.NuGet/Program.cs | 2 +- tests/ComputeSharp.Pix.NuGet/Program.cs | 2 +- .../DeviceDisposalTests.cs | 4 +- .../Program.cs | 2 +- .../ShaderDataLoaderTests.cs | 14 +++--- .../DiagnosticsTests.cs | 6 +-- tests/ComputeSharp.Tests/BufferTests.cs | 8 ++-- .../ComputeSharp.Tests/ComputeContextTests.cs | 24 +++++----- tests/ComputeSharp.Tests/DispatchTests.cs | 12 ++--- tests/ComputeSharp.Tests/IPixelShaderTests.cs | 2 +- .../ComputeSharp.Tests/InitializationTests.cs | 2 +- .../ResourceDimensionsTests.g.cs | 46 +++++++++---------- .../ResourceDimensionsTests.tt | 2 +- .../ComputeSharp.Tests/ShaderCompilerTests.cs | 40 ++++++++-------- .../ComputeSharp.Tests/ShaderMembersTests.cs | 8 ++-- .../ComputeSharp.Tests/ShaderRewriterTests.cs | 26 +++++------ .../Shaders/Compute/ColorfulInfinity.cs | 2 +- .../Shaders/Compute/ContouredLayers.cs | 2 +- .../Shaders/Compute/ExtrudedTruchetPattern.cs | 2 +- .../Shaders/Compute/FourColorGradient.cs | 2 +- .../Shaders/Compute/FractalTiling.cs | 2 +- .../Shaders/Compute/HelloWorld.cs | 2 +- .../Shaders/Compute/MengerJourney.cs | 2 +- .../Shaders/Compute/Octagrams.cs | 2 +- .../Shaders/Compute/ProteanClouds.cs | 2 +- .../Shaders/Compute/PyramidPattern.cs | 2 +- .../Shaders/Compute/TerracedHills.cs | 2 +- .../Shaders/Compute/TriangleGridContouring.cs | 2 +- .../Shaders/Compute/TwoTiledTruchet.cs | 2 +- .../Texture1DTests.Pixels.cs | 2 +- .../Texture1DTests.Pixels.g.cs | 14 +++--- .../Texture1DTests.Pixels.tt | 2 +- tests/ComputeSharp.Tests/Texture1DTests.cs | 4 +- .../Texture2DTests.Pixels.cs | 4 +- .../Texture2DTests.Pixels.g.cs | 14 +++--- .../Texture2DTests.Pixels.tt | 2 +- tests/ComputeSharp.Tests/Texture2DTests.cs | 4 +- .../Texture3DTests.Pixels.g.cs | 14 +++--- .../Texture3DTests.Pixels.tt | 2 +- tests/ComputeSharp.Tests/Texture3DTests.cs | 4 +- .../ThreadGroupSizeTests.cs | 6 +-- 66 files changed, 216 insertions(+), 213 deletions(-) rename src/ComputeSharp/Core/{Dispatch/DispatchAxis.cs => Attributes/Enums/DefaultThreadGroupSizes.cs} (93%) diff --git a/samples/ComputeSharp.Benchmark/Blas/BlasHelpers.cs b/samples/ComputeSharp.Benchmark/Blas/BlasHelpers.cs index 83802fdc..5bdaa721 100644 --- a/samples/ComputeSharp.Benchmark/Blas/BlasHelpers.cs +++ b/samples/ComputeSharp.Benchmark/Blas/BlasHelpers.cs @@ -81,7 +81,7 @@ internal static partial class BlasHelpers /// Kernel for . /// [AutoConstructor] - [ThreadGroupSize(DispatchAxis.XYZ)] + [ThreadGroupSize(DefaultThreadGroupSizes.XYZ)] [GeneratedComputeShaderDescriptor] public readonly partial struct FullyConnectedForwardKernel : IComputeShader { diff --git a/samples/ComputeSharp.Benchmark/Dispatching/DispatchingBenchmark.cs b/samples/ComputeSharp.Benchmark/Dispatching/DispatchingBenchmark.cs index 2367e252..ac0c92ac 100644 --- a/samples/ComputeSharp.Benchmark/Dispatching/DispatchingBenchmark.cs +++ b/samples/ComputeSharp.Benchmark/Dispatching/DispatchingBenchmark.cs @@ -109,7 +109,7 @@ public partial class DispatchingBenchmark : IDisposable } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] internal readonly partial struct TestShader : IComputeShader { diff --git a/samples/ComputeSharp.ImageProcessing/Processors/HlslBokehBlurProcessor.Implementation.cs b/samples/ComputeSharp.ImageProcessing/Processors/HlslBokehBlurProcessor.Implementation.cs index 938f9fa5..2fe83d30 100644 --- a/samples/ComputeSharp.ImageProcessing/Processors/HlslBokehBlurProcessor.Implementation.cs +++ b/samples/ComputeSharp.ImageProcessing/Processors/HlslBokehBlurProcessor.Implementation.cs @@ -308,7 +308,7 @@ public sealed partial class HlslBokehBlurProcessor /// Kernel for the vertical convolution pass. /// [AutoConstructor] - [ThreadGroupSize(DispatchAxis.XY)] + [ThreadGroupSize(DefaultThreadGroupSizes.XY)] [GeneratedComputeShaderDescriptor] internal readonly partial struct VerticalConvolutionProcessor : IComputeShader { @@ -347,7 +347,7 @@ public sealed partial class HlslBokehBlurProcessor /// Kernel for the horizontal convolution pass. /// [AutoConstructor] - [ThreadGroupSize(DispatchAxis.XY)] + [ThreadGroupSize(DefaultThreadGroupSizes.XY)] [GeneratedComputeShaderDescriptor] internal readonly partial struct HorizontalConvolutionAndAccumulatePartialsProcessor : IComputeShader { @@ -388,7 +388,7 @@ public sealed partial class HlslBokehBlurProcessor /// Kernel for the gamma highlight pass. /// [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] internal readonly partial struct GammaHighlightProcessor : IComputeShader { @@ -414,7 +414,7 @@ public sealed partial class HlslBokehBlurProcessor /// Kernel for the inverse gamma highlight pass. /// [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] internal readonly partial struct InverseGammaHighlightProcessor : IComputeShader { diff --git a/samples/ComputeSharp.ImageProcessing/Processors/HlslGaussianBlurProcessor.Implementation.cs b/samples/ComputeSharp.ImageProcessing/Processors/HlslGaussianBlurProcessor.Implementation.cs index 120ec09a..289269dc 100644 --- a/samples/ComputeSharp.ImageProcessing/Processors/HlslGaussianBlurProcessor.Implementation.cs +++ b/samples/ComputeSharp.ImageProcessing/Processors/HlslGaussianBlurProcessor.Implementation.cs @@ -118,7 +118,7 @@ public sealed partial class HlslGaussianBlurProcessor /// Kernel for the vertical convolution pass. /// [AutoConstructor] - [ThreadGroupSize(DispatchAxis.XY)] + [ThreadGroupSize(DefaultThreadGroupSizes.XY)] [GeneratedComputeShaderDescriptor] internal readonly partial struct VerticalConvolutionProcessor : IComputeShader { @@ -152,7 +152,7 @@ public sealed partial class HlslGaussianBlurProcessor /// Kernel for the horizontal convolution pass. /// [AutoConstructor] - [ThreadGroupSize(DispatchAxis.XY)] + [ThreadGroupSize(DefaultThreadGroupSizes.XY)] [GeneratedComputeShaderDescriptor] internal readonly partial struct HorizontalConvolutionProcessor : IComputeShader { diff --git a/samples/ComputeSharp.Sample.FSharp.Shaders/MultiplyByTwo.cs b/samples/ComputeSharp.Sample.FSharp.Shaders/MultiplyByTwo.cs index a2e8e723..081a7a3e 100644 --- a/samples/ComputeSharp.Sample.FSharp.Shaders/MultiplyByTwo.cs +++ b/samples/ComputeSharp.Sample.FSharp.Shaders/MultiplyByTwo.cs @@ -4,7 +4,7 @@ namespace ComputeSharp.Sample.FSharp.Shaders; /// A sample shader thaat just multiplies items in a buffer by two. /// [AutoConstructor] -[ThreadGroupSize(DispatchAxis.X)] +[ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] public readonly partial struct MultiplyByTwo : IComputeShader { diff --git a/samples/ComputeSharp.Sample/Program.cs b/samples/ComputeSharp.Sample/Program.cs index 549b604c..4afda9c0 100644 --- a/samples/ComputeSharp.Sample/Program.cs +++ b/samples/ComputeSharp.Sample/Program.cs @@ -24,7 +24,7 @@ Formatting.PrintMatrix(array, 10, 10, "AFTER"); /// The sample kernel that multiples all items by two. /// [AutoConstructor] -[ThreadGroupSize(DispatchAxis.X)] +[ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] internal readonly partial struct MultiplyByTwo : IComputeShader { diff --git a/samples/ComputeSharp.SwapChain.Shaders.Shared/ColorfulInfinity.cs b/samples/ComputeSharp.SwapChain.Shaders.Shared/ColorfulInfinity.cs index 2fd399c2..6ab6b07a 100644 --- a/samples/ComputeSharp.SwapChain.Shaders.Shared/ColorfulInfinity.cs +++ b/samples/ComputeSharp.SwapChain.Shaders.Shared/ColorfulInfinity.cs @@ -7,7 +7,7 @@ namespace ComputeSharp.SwapChain.Shaders; /// License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. /// [AutoConstructor] -[ThreadGroupSize(DispatchAxis.XY)] +[ThreadGroupSize(DefaultThreadGroupSizes.XY)] [GeneratedComputeShaderDescriptor] internal readonly partial struct ColorfulInfinity : IComputeShader { diff --git a/samples/ComputeSharp.SwapChain.Shaders.Shared/ContouredLayers.cs b/samples/ComputeSharp.SwapChain.Shaders.Shared/ContouredLayers.cs index ecd5147f..9f795bc1 100644 --- a/samples/ComputeSharp.SwapChain.Shaders.Shared/ContouredLayers.cs +++ b/samples/ComputeSharp.SwapChain.Shaders.Shared/ContouredLayers.cs @@ -6,7 +6,7 @@ namespace ComputeSharp.SwapChain.Shaders; /// Created by Shane. /// [AutoConstructor] -[ThreadGroupSize(DispatchAxis.XY)] +[ThreadGroupSize(DefaultThreadGroupSizes.XY)] [GeneratedComputeShaderDescriptor] internal readonly partial struct ContouredLayers : IComputeShader { diff --git a/samples/ComputeSharp.SwapChain.Shaders.Shared/ExtrudedTruchetPattern.cs b/samples/ComputeSharp.SwapChain.Shaders.Shared/ExtrudedTruchetPattern.cs index b6b91bf3..ec060b65 100644 --- a/samples/ComputeSharp.SwapChain.Shaders.Shared/ExtrudedTruchetPattern.cs +++ b/samples/ComputeSharp.SwapChain.Shaders.Shared/ExtrudedTruchetPattern.cs @@ -6,7 +6,7 @@ namespace ComputeSharp.SwapChain.Shaders; /// Created by Shane. /// [AutoConstructor] -[ThreadGroupSize(DispatchAxis.XY)] +[ThreadGroupSize(DefaultThreadGroupSizes.XY)] [GeneratedComputeShaderDescriptor] internal readonly partial struct ExtrudedTruchetPattern : IComputeShader { diff --git a/samples/ComputeSharp.SwapChain.Shaders.Shared/FourColorGradient.cs b/samples/ComputeSharp.SwapChain.Shaders.Shared/FourColorGradient.cs index c52107d5..a94a8283 100644 --- a/samples/ComputeSharp.SwapChain.Shaders.Shared/FourColorGradient.cs +++ b/samples/ComputeSharp.SwapChain.Shaders.Shared/FourColorGradient.cs @@ -7,7 +7,7 @@ namespace ComputeSharp.SwapChain.Shaders; /// License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. /// [AutoConstructor] -[ThreadGroupSize(DispatchAxis.XY)] +[ThreadGroupSize(DefaultThreadGroupSizes.XY)] [GeneratedComputeShaderDescriptor] internal readonly partial struct FourColorGradient : IComputeShader { diff --git a/samples/ComputeSharp.SwapChain.Shaders.Shared/FractalTiling.cs b/samples/ComputeSharp.SwapChain.Shaders.Shared/FractalTiling.cs index 228200e9..145c2a91 100644 --- a/samples/ComputeSharp.SwapChain.Shaders.Shared/FractalTiling.cs +++ b/samples/ComputeSharp.SwapChain.Shaders.Shared/FractalTiling.cs @@ -7,7 +7,7 @@ namespace ComputeSharp.SwapChain.Shaders; /// License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. /// [AutoConstructor] -[ThreadGroupSize(DispatchAxis.XY)] +[ThreadGroupSize(DefaultThreadGroupSizes.XY)] [GeneratedComputeShaderDescriptor] internal readonly partial struct FractalTiling : IComputeShader { diff --git a/samples/ComputeSharp.SwapChain.Shaders.Shared/HelloWorld.cs b/samples/ComputeSharp.SwapChain.Shaders.Shared/HelloWorld.cs index b9ce775a..43ee5e87 100644 --- a/samples/ComputeSharp.SwapChain.Shaders.Shared/HelloWorld.cs +++ b/samples/ComputeSharp.SwapChain.Shaders.Shared/HelloWorld.cs @@ -5,7 +5,7 @@ namespace ComputeSharp.SwapChain.Shaders; /// Ported from . /// [AutoConstructor] -[ThreadGroupSize(DispatchAxis.XY)] +[ThreadGroupSize(DefaultThreadGroupSizes.XY)] [GeneratedComputeShaderDescriptor] internal readonly partial struct HelloWorld : IComputeShader { diff --git a/samples/ComputeSharp.SwapChain.Shaders.Shared/MengerJourney.cs b/samples/ComputeSharp.SwapChain.Shaders.Shared/MengerJourney.cs index 45ce3ca2..022237aa 100644 --- a/samples/ComputeSharp.SwapChain.Shaders.Shared/MengerJourney.cs +++ b/samples/ComputeSharp.SwapChain.Shaders.Shared/MengerJourney.cs @@ -6,7 +6,7 @@ namespace ComputeSharp.SwapChain.Shaders; /// Created by Syntopia. /// [AutoConstructor] -[ThreadGroupSize(DispatchAxis.XY)] +[ThreadGroupSize(DefaultThreadGroupSizes.XY)] [GeneratedComputeShaderDescriptor] internal readonly partial struct MengerJourney : IComputeShader { diff --git a/samples/ComputeSharp.SwapChain.Shaders.Shared/Octagrams.cs b/samples/ComputeSharp.SwapChain.Shaders.Shared/Octagrams.cs index 40eac1c1..b43b0191 100644 --- a/samples/ComputeSharp.SwapChain.Shaders.Shared/Octagrams.cs +++ b/samples/ComputeSharp.SwapChain.Shaders.Shared/Octagrams.cs @@ -6,7 +6,7 @@ namespace ComputeSharp.SwapChain.Shaders; /// Created by whisky_shusuky. /// [AutoConstructor] -[ThreadGroupSize(DispatchAxis.XY)] +[ThreadGroupSize(DefaultThreadGroupSizes.XY)] [GeneratedComputeShaderDescriptor] internal readonly partial struct Octagrams : IComputeShader { diff --git a/samples/ComputeSharp.SwapChain.Shaders.Shared/ProteanClouds.cs b/samples/ComputeSharp.SwapChain.Shaders.Shared/ProteanClouds.cs index 9a58860f..b928d66d 100644 --- a/samples/ComputeSharp.SwapChain.Shaders.Shared/ProteanClouds.cs +++ b/samples/ComputeSharp.SwapChain.Shaders.Shared/ProteanClouds.cs @@ -7,7 +7,7 @@ namespace ComputeSharp.SwapChain.Shaders; /// License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. /// [AutoConstructor] -[ThreadGroupSize(DispatchAxis.XY)] +[ThreadGroupSize(DefaultThreadGroupSizes.XY)] [GeneratedComputeShaderDescriptor] internal readonly partial struct ProteanClouds : IComputeShader { diff --git a/samples/ComputeSharp.SwapChain.Shaders.Shared/PyramidPattern.cs b/samples/ComputeSharp.SwapChain.Shaders.Shared/PyramidPattern.cs index c950e157..8c5d0956 100644 --- a/samples/ComputeSharp.SwapChain.Shaders.Shared/PyramidPattern.cs +++ b/samples/ComputeSharp.SwapChain.Shaders.Shared/PyramidPattern.cs @@ -7,7 +7,7 @@ namespace ComputeSharp.SwapChain.Shaders; /// Created by Shane. /// [AutoConstructor] -[ThreadGroupSize(DispatchAxis.XY)] +[ThreadGroupSize(DefaultThreadGroupSizes.XY)] [GeneratedComputeShaderDescriptor] internal readonly partial struct PyramidPattern : IComputeShader { diff --git a/samples/ComputeSharp.SwapChain.Shaders.Shared/TerracedHills.cs b/samples/ComputeSharp.SwapChain.Shaders.Shared/TerracedHills.cs index 3117de1c..d84390a7 100644 --- a/samples/ComputeSharp.SwapChain.Shaders.Shared/TerracedHills.cs +++ b/samples/ComputeSharp.SwapChain.Shaders.Shared/TerracedHills.cs @@ -6,7 +6,7 @@ namespace ComputeSharp.SwapChain.Shaders; /// Created by Shane. /// [AutoConstructor] -[ThreadGroupSize(DispatchAxis.XY)] +[ThreadGroupSize(DefaultThreadGroupSizes.XY)] [GeneratedComputeShaderDescriptor] internal readonly partial struct TerracedHills : IComputeShader { diff --git a/samples/ComputeSharp.SwapChain.Shaders.Shared/TriangleGridContouring.cs b/samples/ComputeSharp.SwapChain.Shaders.Shared/TriangleGridContouring.cs index 8976de4f..4aeee763 100644 --- a/samples/ComputeSharp.SwapChain.Shaders.Shared/TriangleGridContouring.cs +++ b/samples/ComputeSharp.SwapChain.Shaders.Shared/TriangleGridContouring.cs @@ -6,7 +6,7 @@ namespace ComputeSharp.SwapChain.Shaders; /// Created by Shane. /// [AutoConstructor] -[ThreadGroupSize(DispatchAxis.XY)] +[ThreadGroupSize(DefaultThreadGroupSizes.XY)] [GeneratedComputeShaderDescriptor] internal readonly partial struct TriangleGridContouring : IComputeShader { diff --git a/samples/ComputeSharp.SwapChain.Shaders.Shared/TwoTiledTruchet.cs b/samples/ComputeSharp.SwapChain.Shaders.Shared/TwoTiledTruchet.cs index 290c3c2d..7106bd51 100644 --- a/samples/ComputeSharp.SwapChain.Shaders.Shared/TwoTiledTruchet.cs +++ b/samples/ComputeSharp.SwapChain.Shaders.Shared/TwoTiledTruchet.cs @@ -6,7 +6,7 @@ namespace ComputeSharp.SwapChain.Shaders; /// Created by Shane. /// [AutoConstructor] -[ThreadGroupSize(DispatchAxis.XY)] +[ThreadGroupSize(DefaultThreadGroupSizes.XY)] [GeneratedComputeShaderDescriptor] internal readonly partial struct TwoTiledTruchet : IComputeShader { diff --git a/src/ComputeSharp.SourceGenerators/ComputeShaderDescriptorGenerator.NumThreads.cs b/src/ComputeSharp.SourceGenerators/ComputeShaderDescriptorGenerator.NumThreads.cs index 19be21d9..42ceda0b 100644 --- a/src/ComputeSharp.SourceGenerators/ComputeShaderDescriptorGenerator.NumThreads.cs +++ b/src/ComputeSharp.SourceGenerators/ComputeShaderDescriptorGenerator.NumThreads.cs @@ -46,24 +46,24 @@ partial class ComputeShaderDescriptorGenerator // Check for a dispatch axis argument first if (attribute.ConstructorArguments.Length == 1) { - int dispatchAxis = (int)attribute.ConstructorArguments[0].Value!; + int defaultSize = (int)attribute.ConstructorArguments[0].Value!; - (threadsX, threadsY, threadsZ) = (DispatchAxis)dispatchAxis switch + (threadsX, threadsY, threadsZ) = (DefaultThreadGroupSizes)defaultSize switch { - DispatchAxis.X => (64, 1, 1), - DispatchAxis.Y => (1, 64, 1), - DispatchAxis.Z => (1, 1, 64), - DispatchAxis.XY => (8, 8, 1), - DispatchAxis.XZ => (8, 1, 8), - DispatchAxis.YZ => (1, 8, 8), - DispatchAxis.XYZ => (4, 4, 4), + DefaultThreadGroupSizes.X => (64, 1, 1), + DefaultThreadGroupSizes.Y => (1, 64, 1), + DefaultThreadGroupSizes.Z => (1, 1, 64), + DefaultThreadGroupSizes.XY => (8, 8, 1), + DefaultThreadGroupSizes.XZ => (8, 1, 8), + DefaultThreadGroupSizes.YZ => (1, 8, 8), + DefaultThreadGroupSizes.XYZ => (4, 4, 4), _ => (0, 0, 0) }; // Validate the dispatch axis argument if ((threadsX, threadsY, threadsZ) is (0, 0, 0)) { - diagnostics.Add(InvalidThreadGroupSizeAttributeDefaultThreadGroupSize, structDeclarationSymbol, structDeclarationSymbol); + diagnostics.Add(InvalidThreadGroupSizeAttributeDefaultThreadGroupSizes, structDeclarationSymbol, structDeclarationSymbol); threadsX = threadsY = threadsZ = 0; isCompilationEnabled = false; diff --git a/src/ComputeSharp.SourceGenerators/ComputeSharp.SourceGenerators.csproj b/src/ComputeSharp.SourceGenerators/ComputeSharp.SourceGenerators.csproj index 70ef81ae..fd677c13 100644 --- a/src/ComputeSharp.SourceGenerators/ComputeSharp.SourceGenerators.csproj +++ b/src/ComputeSharp.SourceGenerators/ComputeSharp.SourceGenerators.csproj @@ -60,9 +60,9 @@ + - diff --git a/src/ComputeSharp.SourceGenerators/Diagnostics/DiagnosticDescriptors.cs b/src/ComputeSharp.SourceGenerators/Diagnostics/DiagnosticDescriptors.cs index 7d25fa44..158b37e3 100644 --- a/src/ComputeSharp.SourceGenerators/Diagnostics/DiagnosticDescriptors.cs +++ b/src/ComputeSharp.SourceGenerators/Diagnostics/DiagnosticDescriptors.cs @@ -654,19 +654,19 @@ partial class DiagnosticDescriptors helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); /// - /// Gets a for an embedded bytecode shader with an invalid dispatch axis value. + /// Gets a for shaders shader with an invalid DefaultThreadGroupSizes value. /// - /// Format: "The shader of type {0} is using an invalid DefaultThreadGroupSize value in its [ThreadGroupSize] attribute". + /// Format: "The shader of type {0} is using an invalid DefaultThreadGroupSizes value in its [ThreadGroupSize] attribute". /// /// - public static readonly DiagnosticDescriptor InvalidThreadGroupSizeAttributeDefaultThreadGroupSize = new( + public static readonly DiagnosticDescriptor InvalidThreadGroupSizeAttributeDefaultThreadGroupSizes = new( id: "CMPS0048", - title: "Invalid DefaultThreadGroupSize value for [ThreadGroupSize] use", - messageFormat: "The shader of type {0} is using an invalid DefaultThreadGroupSize value in its [ThreadGroupSize] attribute", + title: "Invalid DefaultThreadGroupSizes value for [ThreadGroupSize] use", + messageFormat: "The shader of type {0} is using an invalid DefaultThreadGroupSizes value in its [ThreadGroupSize] attribute", category: "ComputeSharp.Shaders", defaultSeverity: DiagnosticSeverity.Error, isEnabledByDefault: true, - description: "The DefaultThreadGroupSize value for [ThreadGroupSize] attributes have to be valid.", + description: "The DefaultThreadGroupSizes value for [ThreadGroupSize] attributes have to be valid.", helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); /// diff --git a/src/ComputeSharp/Core/Dispatch/DispatchAxis.cs b/src/ComputeSharp/Core/Attributes/Enums/DefaultThreadGroupSizes.cs similarity index 93% rename from src/ComputeSharp/Core/Dispatch/DispatchAxis.cs rename to src/ComputeSharp/Core/Attributes/Enums/DefaultThreadGroupSizes.cs index 25faa3fe..fec96df0 100644 --- a/src/ComputeSharp/Core/Dispatch/DispatchAxis.cs +++ b/src/ComputeSharp/Core/Attributes/Enums/DefaultThreadGroupSizes.cs @@ -1,9 +1,12 @@ +using System; + namespace ComputeSharp; /// -/// A to be used with to indicate the dispatch axis to precompile a shader for. +/// A to be used with to more easily set default values for the thread group size. /// -public enum DispatchAxis +[Flags] +public enum DefaultThreadGroupSizes { /// /// Indicates a shader dispatch only along the X axis. @@ -11,7 +14,7 @@ public enum DispatchAxis /// /// This applies to using or . /// - X, + X = 1 << 0, /// /// Indicates a shader dispatch only along the Y axis. @@ -20,7 +23,7 @@ public enum DispatchAxis /// This applies to using or , /// but only as long as the input dispatch size on both the X and Z axes is 1. Using any other combination will not be able to leverage the precompiled shader bytecode. /// - Y, + Y = 1 << 1, /// /// Indicates a shader dispatch only along the Z axis. @@ -29,7 +32,7 @@ public enum DispatchAxis /// This applies to using or , /// but only as long as the input dispatch size on both the X and Y axes is 1. Using any other combination will not be able to leverage the precompiled shader bytecode. /// - Z, + Z = 1 << 2, /// /// Indicates a shader dispatch along the X and Y axes. @@ -39,7 +42,7 @@ public enum DispatchAxis /// , , /// or . /// - XY, + XY = X | Y, /// /// Indicates a shader dispatch along the X and Z axes. @@ -48,7 +51,7 @@ public enum DispatchAxis /// This applies to using or , /// but only as long as the input dispatch size on the Y axis 1. Using any other combination will not be able to leverage the precompiled shader bytecode. /// - XZ, + XZ = X | Z, /// /// Indicates a shader dispatch along the Y and Z axes. @@ -57,7 +60,7 @@ public enum DispatchAxis /// This applies to using or , /// but only as long as the input dispatch size on the X axis 1. Using any other combination will not be able to leverage the precompiled shader bytecode. /// - YZ, + YZ = Y | Z, /// /// Indicates a shader dispatch along the X, Y and Z axes. @@ -65,5 +68,5 @@ public enum DispatchAxis /// /// This applies to using or . /// - XYZ + XYZ = X | Y | Z } \ No newline at end of file diff --git a/src/ComputeSharp/Core/Attributes/ThreadGroupSizeAttribute.cs b/src/ComputeSharp/Core/Attributes/ThreadGroupSizeAttribute.cs index b03b8298..c45b8280 100644 --- a/src/ComputeSharp/Core/Attributes/ThreadGroupSizeAttribute.cs +++ b/src/ComputeSharp/Core/Attributes/ThreadGroupSizeAttribute.cs @@ -8,7 +8,7 @@ namespace ComputeSharp; /// This attribute can be used to annotate shader types as follows: /// /// // A compute shader that is dispatched on a target buffer -/// [ThreadGroupSize(DispatchAxis.X)] +/// [ThreadGroupSize(DefaultThreadGroupSizes.X)] /// struct MyShader : IComputeShader /// { /// } @@ -16,14 +16,14 @@ namespace ComputeSharp; /// Or similarly, for a pixel-like compute shader: /// /// // A compute shader that is dispatched on a target texture -/// [ThreadGroupSize(DispatchAxis.XY)] +/// [ThreadGroupSize(DefaultThreadGroupSizes.XY)] /// struct MyShader : IComputeShader<float4> /// { /// } /// /// /// -/// Using is an easier way to precompile shaders when dispatching them over known dimensions. For more +/// Using is an easier way to precompile shaders when dispatching them over known dimensions. For more /// fine grained control over the thread size values when dispatching, use . /// /// @@ -33,20 +33,20 @@ public sealed class ThreadGroupSizeAttribute : Attribute /// /// Creates a new instance with the specified parameters. /// - /// The target dispatch axes for the shader to run. - public ThreadGroupSizeAttribute(DispatchAxis dispatchAxis) + /// The default thread group size to use. + public ThreadGroupSizeAttribute(DefaultThreadGroupSizes size) { #if !SOURCE_GENERATOR - (ThreadsX, ThreadsY, ThreadsZ) = dispatchAxis switch + (ThreadsX, ThreadsY, ThreadsZ) = size switch { - DispatchAxis.X => (64, 1, 1), - DispatchAxis.Y => (1, 64, 1), - DispatchAxis.Z => (1, 1, 64), - DispatchAxis.XY => (8, 8, 1), - DispatchAxis.XZ => (8, 1, 8), - DispatchAxis.YZ => (1, 8, 8), - DispatchAxis.XYZ => (4, 4, 4), - _ => default(ArgumentException).Throw<(int, int, int)>(nameof(dispatchAxis)) + DefaultThreadGroupSizes.X => (64, 1, 1), + DefaultThreadGroupSizes.Y => (1, 64, 1), + DefaultThreadGroupSizes.Z => (1, 1, 64), + DefaultThreadGroupSizes.XY => (8, 8, 1), + DefaultThreadGroupSizes.XZ => (8, 1, 8), + DefaultThreadGroupSizes.YZ => (1, 8, 8), + DefaultThreadGroupSizes.XYZ => (4, 4, 4), + _ => default(ArgumentException).Throw<(int, int, int)>(nameof(size)) }; #endif } diff --git a/tests/ComputeSharp.Dxc.NuGet/Program.cs b/tests/ComputeSharp.Dxc.NuGet/Program.cs index 4f849666..0274e8b8 100644 --- a/tests/ComputeSharp.Dxc.NuGet/Program.cs +++ b/tests/ComputeSharp.Dxc.NuGet/Program.cs @@ -34,7 +34,7 @@ Trace.Assert(shaderInfo.BoundResourceCount == 2); /// A sample kernel that requires dynamic compilation, as it's not precompiled. /// [AutoConstructor] -[ThreadGroupSize(DispatchAxis.X)] +[ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] internal readonly partial struct MultiplyByTwo : IComputeShader { diff --git a/tests/ComputeSharp.NuGet/Program.cs b/tests/ComputeSharp.NuGet/Program.cs index b5a8ea11..48fd9a52 100644 --- a/tests/ComputeSharp.NuGet/Program.cs +++ b/tests/ComputeSharp.NuGet/Program.cs @@ -25,7 +25,7 @@ for (int i = 0; i < array.Length; i++) /// /// A sample kernel that is precompiled. /// -[ThreadGroupSize(DispatchAxis.X)] +[ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] [AutoConstructor] internal readonly partial struct MultiplyByTwo : IComputeShader diff --git a/tests/ComputeSharp.Pix.NuGet/Program.cs b/tests/ComputeSharp.Pix.NuGet/Program.cs index ff553c82..0cd931e5 100644 --- a/tests/ComputeSharp.Pix.NuGet/Program.cs +++ b/tests/ComputeSharp.Pix.NuGet/Program.cs @@ -31,7 +31,7 @@ for (int i = 0; i < array.Length; i++) /// /// A sample kernel that is precompiled. /// -[ThreadGroupSize(DispatchAxis.X)] +[ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] [AutoConstructor] internal readonly partial struct MultiplyByTwo : IComputeShader diff --git a/tests/ComputeSharp.Tests.DeviceLost/DeviceDisposalTests.cs b/tests/ComputeSharp.Tests.DeviceLost/DeviceDisposalTests.cs index 704dc169..cfe5a76c 100644 --- a/tests/ComputeSharp.Tests.DeviceLost/DeviceDisposalTests.cs +++ b/tests/ComputeSharp.Tests.DeviceLost/DeviceDisposalTests.cs @@ -143,7 +143,7 @@ public partial class DeviceDisposalTests Assert.AreEqual(1u, GraphicsDeviceHelper.GetD3D12DeviceRefCount(d3D12Device)); } - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] [AutoConstructor] internal readonly partial struct InitializeShader : IComputeShader @@ -177,7 +177,7 @@ public partial class DeviceDisposalTests Assert.AreEqual(1u, GraphicsDeviceHelper.GetD3D12DeviceRefCount(d3D12Device)); } - [ThreadGroupSize(DispatchAxis.XY)] + [ThreadGroupSize(DefaultThreadGroupSizes.XY)] [GeneratedComputeShaderDescriptor] internal partial struct HelloWorldShader : IComputeShader { diff --git a/tests/ComputeSharp.Tests.GlobalStatements/Program.cs b/tests/ComputeSharp.Tests.GlobalStatements/Program.cs index 6c450499..db039501 100644 --- a/tests/ComputeSharp.Tests.GlobalStatements/Program.cs +++ b/tests/ComputeSharp.Tests.GlobalStatements/Program.cs @@ -22,7 +22,7 @@ if (!numbers.SequenceEqual(result)) Console.WriteLine("Test passed successfully!"); [AutoConstructor] -[ThreadGroupSize(DispatchAxis.X)] +[ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] public readonly partial struct ApplyFunctionShader : IComputeShader { diff --git a/tests/ComputeSharp.Tests.Internals/ShaderDataLoaderTests.cs b/tests/ComputeSharp.Tests.Internals/ShaderDataLoaderTests.cs index 4a924fab..f28a526f 100644 --- a/tests/ComputeSharp.Tests.Internals/ShaderDataLoaderTests.cs +++ b/tests/ComputeSharp.Tests.Internals/ShaderDataLoaderTests.cs @@ -12,7 +12,7 @@ namespace ComputeSharp.Tests.Internals; public partial class ShaderDataLoaderTests { [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] public partial struct CapturedResourceShader : IComputeShader { @@ -48,7 +48,7 @@ public partial class ShaderDataLoaderTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] public partial struct MultipleResourcesAndPrimitivesShader : IComputeShader { @@ -94,7 +94,7 @@ public partial class ShaderDataLoaderTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] public partial struct ScalarAndVectorTypesShader : IComputeShader { @@ -145,7 +145,7 @@ public partial class ShaderDataLoaderTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] public partial struct ScalarVectorAndMatrixTypesShader : IComputeShader { @@ -231,7 +231,7 @@ public partial class ShaderDataLoaderTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] public partial struct FlatCustomTypeShader : IComputeShader { @@ -323,7 +323,7 @@ public partial class ShaderDataLoaderTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] public partial struct NestedCustomTypesShader : IComputeShader { @@ -415,7 +415,7 @@ public partial class ShaderDataLoaderTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] public partial struct AmbiguousNamesShader : IComputeShader { diff --git a/tests/ComputeSharp.Tests.SourceGenerators/DiagnosticsTests.cs b/tests/ComputeSharp.Tests.SourceGenerators/DiagnosticsTests.cs index ca27af93..94af76a2 100644 --- a/tests/ComputeSharp.Tests.SourceGenerators/DiagnosticsTests.cs +++ b/tests/ComputeSharp.Tests.SourceGenerators/DiagnosticsTests.cs @@ -1242,7 +1242,7 @@ public class DiagnosticsTests namespace MyFancyApp.Sample; - [ThreadGroupSize(DispatchAxis.XYZ | DispatchAxis.Y)] + [ThreadGroupSize(default)] [GeneratedComputeShaderDescriptor] public partial struct MyShader : IComputeShader { @@ -1266,7 +1266,7 @@ public class DiagnosticsTests namespace MyFancyApp.Sample; - [ThreadGroupSize((DispatchAxis)243712)] + [ThreadGroupSize((DefaultThreadGroupSizes)243712)] [GeneratedComputeShaderDescriptor] public partial struct MyShader : IComputeShader { @@ -1290,7 +1290,7 @@ public class DiagnosticsTests namespace MyFancyApp.Sample; - [ThreadGroupSize((DispatchAxis)(-289))] + [ThreadGroupSize((DefaultThreadGroupSizes)(-289))] [GeneratedComputeShaderDescriptor] public partial struct MyShader : IComputeShader { diff --git a/tests/ComputeSharp.Tests/BufferTests.cs b/tests/ComputeSharp.Tests/BufferTests.cs index 81774a63..7ada4fc4 100644 --- a/tests/ComputeSharp.Tests/BufferTests.cs +++ b/tests/ComputeSharp.Tests/BufferTests.cs @@ -278,7 +278,7 @@ public partial class BufferTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] internal readonly partial struct ConstantBufferKernel : IComputeShader { @@ -308,7 +308,7 @@ public partial class BufferTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] internal readonly partial struct ReadOnlyBufferKernel : IComputeShader { @@ -338,7 +338,7 @@ public partial class BufferTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] internal readonly partial struct ReadWriteBufferKernel : IComputeShader { @@ -375,7 +375,7 @@ public partial class BufferTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] public readonly partial struct DoublePrecisionSupportShader : IComputeShader { diff --git a/tests/ComputeSharp.Tests/ComputeContextTests.cs b/tests/ComputeSharp.Tests/ComputeContextTests.cs index 20842884..b86e04ef 100644 --- a/tests/ComputeSharp.Tests/ComputeContextTests.cs +++ b/tests/ComputeSharp.Tests/ComputeContextTests.cs @@ -1294,7 +1294,7 @@ public partial class ComputeContextTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] internal readonly partial struct OffsetComputeShader : IComputeShader { @@ -1309,7 +1309,7 @@ public partial class ComputeContextTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.XY)] + [ThreadGroupSize(DefaultThreadGroupSizes.XY)] [GeneratedComputeShaderDescriptor] internal readonly partial struct ClearPixelShader : IComputeShader { @@ -1321,7 +1321,7 @@ public partial class ComputeContextTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.XY)] + [ThreadGroupSize(DefaultThreadGroupSizes.XY)] [GeneratedComputeShaderDescriptor] internal readonly partial struct ColorPixelShader : IComputeShader { @@ -1335,7 +1335,7 @@ public partial class ComputeContextTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.XY)] + [ThreadGroupSize(DefaultThreadGroupSizes.XY)] [GeneratedComputeShaderDescriptor] internal readonly partial struct LinearSampling2DPixelShader : IComputeShader { @@ -1349,7 +1349,7 @@ public partial class ComputeContextTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.XYZ)] + [ThreadGroupSize(DefaultThreadGroupSizes.XYZ)] [GeneratedComputeShaderDescriptor] internal readonly partial struct LinearSampling3DComputeShader : IComputeShader { @@ -1369,7 +1369,7 @@ public partial class ComputeContextTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.XY)] + [ThreadGroupSize(DefaultThreadGroupSizes.XY)] [GeneratedComputeShaderDescriptor] internal readonly partial struct LinearSamplingFromNormalized2DPixelShader : IComputeShader { @@ -1383,7 +1383,7 @@ public partial class ComputeContextTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.XY)] + [ThreadGroupSize(DefaultThreadGroupSizes.XY)] [GeneratedComputeShaderDescriptor] internal readonly partial struct CopyToOutputPixelShader : IComputeShader { @@ -1397,7 +1397,7 @@ public partial class ComputeContextTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.XY)] + [ThreadGroupSize(DefaultThreadGroupSizes.XY)] [GeneratedComputeShaderDescriptor] internal readonly partial struct InvertPixelShader : IComputeShader { @@ -1411,7 +1411,7 @@ public partial class ComputeContextTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.XYZ)] + [ThreadGroupSize(DefaultThreadGroupSizes.XYZ)] [GeneratedComputeShaderDescriptor] internal readonly partial struct LinearSamplingFromNormalized3DComputeShader : IComputeShader { @@ -1431,7 +1431,7 @@ public partial class ComputeContextTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.XY)] + [ThreadGroupSize(DefaultThreadGroupSizes.XY)] [GeneratedComputeShaderDescriptor] internal readonly partial struct Dotted2DPixelShader : IComputeShader { @@ -1461,7 +1461,7 @@ public partial class ComputeContextTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.XYZ)] + [ThreadGroupSize(DefaultThreadGroupSizes.XYZ)] [GeneratedComputeShaderDescriptor] internal readonly partial struct Dotted3DPixelShader : IComputeShader { @@ -1491,7 +1491,7 @@ public partial class ComputeContextTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.XY)] + [ThreadGroupSize(DefaultThreadGroupSizes.XY)] [GeneratedComputeShaderDescriptor] internal readonly partial struct ConvertToNonNormalized2DShader : IComputeShader { diff --git a/tests/ComputeSharp.Tests/DispatchTests.cs b/tests/ComputeSharp.Tests/DispatchTests.cs index 1577c192..fddb8c41 100644 --- a/tests/ComputeSharp.Tests/DispatchTests.cs +++ b/tests/ComputeSharp.Tests/DispatchTests.cs @@ -57,7 +57,7 @@ public partial class DispatchTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.XYZ)] + [ThreadGroupSize(DefaultThreadGroupSizes.XYZ)] [GeneratedComputeShaderDescriptor] internal readonly partial struct ThreadIdsShader : IComputeShader { @@ -113,7 +113,7 @@ public partial class DispatchTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.XYZ)] + [ThreadGroupSize(DefaultThreadGroupSizes.XYZ)] [GeneratedComputeShaderDescriptor] internal readonly partial struct ThreadIdsNormalizedShader : IComputeShader { @@ -156,7 +156,7 @@ public partial class DispatchTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.XYZ)] + [ThreadGroupSize(DefaultThreadGroupSizes.XYZ)] [GeneratedComputeShaderDescriptor] internal readonly partial struct GroupIdsShader : IComputeShader { @@ -255,7 +255,7 @@ public partial class DispatchTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.XYZ)] + [ThreadGroupSize(DefaultThreadGroupSizes.XYZ)] [GeneratedComputeShaderDescriptor] internal readonly partial struct DispatchSizeShader : IComputeShader { @@ -296,7 +296,7 @@ public partial class DispatchTests } } - [ThreadGroupSize(DispatchAxis.XY)] + [ThreadGroupSize(DefaultThreadGroupSizes.XY)] [GeneratedComputeShaderDescriptor] internal readonly partial struct DispatchPixelShader : IComputeShader { @@ -327,7 +327,7 @@ public partial class DispatchTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] internal readonly partial struct FixedGroupSharedPixelShader : IComputeShader { diff --git a/tests/ComputeSharp.Tests/IPixelShaderTests.cs b/tests/ComputeSharp.Tests/IPixelShaderTests.cs index df914546..9bb23915 100644 --- a/tests/ComputeSharp.Tests/IPixelShaderTests.cs +++ b/tests/ComputeSharp.Tests/IPixelShaderTests.cs @@ -35,7 +35,7 @@ public partial class IPixelShaderTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.XY)] + [ThreadGroupSize(DefaultThreadGroupSizes.XY)] [GeneratedComputeShaderDescriptor] internal readonly partial struct EarlyReturnShader : IComputeShader { diff --git a/tests/ComputeSharp.Tests/InitializationTests.cs b/tests/ComputeSharp.Tests/InitializationTests.cs index 0c791838..b14c4d22 100644 --- a/tests/ComputeSharp.Tests/InitializationTests.cs +++ b/tests/ComputeSharp.Tests/InitializationTests.cs @@ -73,7 +73,7 @@ public partial class InitializationTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] internal readonly partial struct SampleShader : IComputeShader { diff --git a/tests/ComputeSharp.Tests/ResourceDimensionsTests.g.cs b/tests/ComputeSharp.Tests/ResourceDimensionsTests.g.cs index bf0c3c6f..40bd5e21 100644 --- a/tests/ComputeSharp.Tests/ResourceDimensionsTests.g.cs +++ b/tests/ComputeSharp.Tests/ResourceDimensionsTests.g.cs @@ -29,7 +29,7 @@ public partial class ResourceDimensionsTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] internal readonly partial struct ReadOnlyBuffer_T1_AsReadOnlyBufferShader : IComputeShader { @@ -63,7 +63,7 @@ public partial class ResourceDimensionsTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] internal readonly partial struct ReadWriteBuffer_T1_AsReadWriteBufferShader : IComputeShader { @@ -97,7 +97,7 @@ public partial class ResourceDimensionsTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] internal readonly partial struct ReadOnlyTexture1D_T1_AsReadOnlyTexture1DShader : IComputeShader { @@ -131,7 +131,7 @@ public partial class ResourceDimensionsTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] internal readonly partial struct ReadWriteTexture1D_T1_AsReadWriteTexture1DShader : IComputeShader { @@ -169,7 +169,7 @@ public partial class ResourceDimensionsTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] internal readonly partial struct ReadWriteTexture1D_T1_AsIReadOnlyTexture1DShader : IComputeShader { @@ -203,7 +203,7 @@ public partial class ResourceDimensionsTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] internal readonly partial struct ReadOnlyTexture1D_T2_AsReadOnlyTexture1DShader : IComputeShader { @@ -237,7 +237,7 @@ public partial class ResourceDimensionsTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] internal readonly partial struct ReadOnlyTexture1D_T2_AsIReadOnlyNormalizedTexture1DShader : IComputeShader { @@ -271,7 +271,7 @@ public partial class ResourceDimensionsTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] internal readonly partial struct ReadWriteTexture1D_T2_AsReadWriteTexture1DShader : IComputeShader { @@ -305,7 +305,7 @@ public partial class ResourceDimensionsTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] internal readonly partial struct ReadWriteTexture1D_T2_AsIReadWriteNormalizedTexture1DShader : IComputeShader { @@ -339,7 +339,7 @@ public partial class ResourceDimensionsTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] internal readonly partial struct ReadOnlyTexture2D_T1_AsReadOnlyTexture2DShader : IComputeShader { @@ -374,7 +374,7 @@ public partial class ResourceDimensionsTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] internal readonly partial struct ReadWriteTexture2D_T1_AsReadWriteTexture2DShader : IComputeShader { @@ -413,7 +413,7 @@ public partial class ResourceDimensionsTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] internal readonly partial struct ReadWriteTexture2D_T1_AsIReadOnlyTexture2DShader : IComputeShader { @@ -448,7 +448,7 @@ public partial class ResourceDimensionsTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] internal readonly partial struct ReadOnlyTexture2D_T2_AsReadOnlyTexture2DShader : IComputeShader { @@ -483,7 +483,7 @@ public partial class ResourceDimensionsTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] internal readonly partial struct ReadOnlyTexture2D_T2_AsIReadOnlyNormalizedTexture2DShader : IComputeShader { @@ -518,7 +518,7 @@ public partial class ResourceDimensionsTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] internal readonly partial struct ReadWriteTexture2D_T2_AsReadWriteTexture2DShader : IComputeShader { @@ -553,7 +553,7 @@ public partial class ResourceDimensionsTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] internal readonly partial struct ReadWriteTexture2D_T2_AsIReadWriteNormalizedTexture2DShader : IComputeShader { @@ -588,7 +588,7 @@ public partial class ResourceDimensionsTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] internal readonly partial struct ReadOnlyTexture3D_T1_AsReadOnlyTexture3DShader : IComputeShader { @@ -624,7 +624,7 @@ public partial class ResourceDimensionsTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] internal readonly partial struct ReadWriteTexture3D_T1_AsReadWriteTexture3DShader : IComputeShader { @@ -664,7 +664,7 @@ public partial class ResourceDimensionsTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] internal readonly partial struct ReadWriteTexture3D_T1_AsIReadOnlyTexture3DShader : IComputeShader { @@ -700,7 +700,7 @@ public partial class ResourceDimensionsTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] internal readonly partial struct ReadOnlyTexture3D_T2_AsReadOnlyTexture3DShader : IComputeShader { @@ -736,7 +736,7 @@ public partial class ResourceDimensionsTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] internal readonly partial struct ReadOnlyTexture3D_T2_AsIReadOnlyNormalizedTexture3DShader : IComputeShader { @@ -772,7 +772,7 @@ public partial class ResourceDimensionsTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] internal readonly partial struct ReadWriteTexture3D_T2_AsReadWriteTexture3DShader : IComputeShader { @@ -808,7 +808,7 @@ public partial class ResourceDimensionsTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] internal readonly partial struct ReadWriteTexture3D_T2_AsIReadWriteNormalizedTexture3DShader : IComputeShader { diff --git a/tests/ComputeSharp.Tests/ResourceDimensionsTests.tt b/tests/ComputeSharp.Tests/ResourceDimensionsTests.tt index c427d5cc..b55a6209 100644 --- a/tests/ComputeSharp.Tests/ResourceDimensionsTests.tt +++ b/tests/ComputeSharp.Tests/ResourceDimensionsTests.tt @@ -132,7 +132,7 @@ foreach (var pair in typesMap) } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] internal readonly partial struct <#=testMethodName#>Shader : IComputeShader { diff --git a/tests/ComputeSharp.Tests/ShaderCompilerTests.cs b/tests/ComputeSharp.Tests/ShaderCompilerTests.cs index 5ddbaf15..0115bac2 100644 --- a/tests/ComputeSharp.Tests/ShaderCompilerTests.cs +++ b/tests/ComputeSharp.Tests/ShaderCompilerTests.cs @@ -34,7 +34,7 @@ namespace ComputeSharp.Tests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] public readonly partial struct ReservedKeywordsShader : IComputeShader { @@ -71,7 +71,7 @@ namespace ComputeSharp.Tests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] public readonly partial struct ReservedKeywordsInCustomTypesShader : IComputeShader { @@ -100,7 +100,7 @@ namespace ComputeSharp.Tests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] public readonly partial struct ReservedKeywordsFromHlslTypesAndBuiltInValuesShader : IComputeShader { @@ -143,7 +143,7 @@ namespace ComputeSharp.Tests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] public readonly partial struct ReservedKeywordsPrecompiledShader : IComputeShader { @@ -181,7 +181,7 @@ namespace ComputeSharp.Tests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] public readonly partial struct SpecialTypeAsReturnTypeShader : IComputeShader { @@ -204,7 +204,7 @@ namespace ComputeSharp.Tests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] public readonly partial struct LocalFunctionInExternalMethodsShader : IComputeShader { @@ -237,7 +237,7 @@ namespace ComputeSharp.Tests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] public readonly partial struct CapturedNestedStructTypeShader : IComputeShader { @@ -258,7 +258,7 @@ namespace ComputeSharp.Tests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] public readonly partial struct ExternalStructTypeShader : IComputeShader { @@ -281,7 +281,7 @@ namespace ComputeSharp.Tests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] public readonly partial struct OutOfOrderMethodsShader : IComputeShader { @@ -318,7 +318,7 @@ namespace ComputeSharp.Tests Assert.AreEqual(info.BoundResourceCount, 2u); } - [ThreadGroupSize(DispatchAxis.XY)] + [ThreadGroupSize(DefaultThreadGroupSizes.XY)] [GeneratedComputeShaderDescriptor] public readonly partial struct StatelessPixelShader : IComputeShader { @@ -330,7 +330,7 @@ namespace ComputeSharp.Tests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] public readonly partial struct LoopWithVarCounterShader : IComputeShader { @@ -361,7 +361,7 @@ namespace ComputeSharp.Tests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] public readonly partial struct DoublePrecisionSupportShader : IComputeShader { @@ -382,7 +382,7 @@ namespace ComputeSharp.Tests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] internal readonly partial struct FieldAccessWithThisExpressionShader : IComputeShader { @@ -410,7 +410,7 @@ namespace ComputeSharp.Tests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] internal readonly partial struct ComputeShaderWithInheritedShaderInterfaceShader : IMyBaseShader { @@ -445,7 +445,7 @@ namespace ComputeSharp.Tests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] internal readonly partial struct PixelShaderWithInheritedShaderInterfaceShader : IMyBaseShader { @@ -495,7 +495,7 @@ namespace ComputeSharp.Tests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] internal readonly partial struct StructInstanceMethodsShader : IComputeShader { @@ -530,7 +530,7 @@ namespace ComputeSharp.Tests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] internal readonly partial struct PixelShaderWithScopedParameterInMethodsShader : IComputeShader { @@ -579,7 +579,7 @@ namespace ComputeSharp.Tests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [CompileOptions(CompileOptions.Default | CompileOptions.StripReflectionData)] [GeneratedComputeShaderDescriptor] internal readonly partial struct ShaderWithStrippedReflectionData1 : IComputeShader @@ -594,7 +594,7 @@ namespace ComputeSharp.Tests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [CompileOptions(CompileOptions.Default)] [GeneratedComputeShaderDescriptor] internal readonly partial struct ShaderWithStrippedReflectionData2 : IComputeShader @@ -617,7 +617,7 @@ namespace ExternalNamespace public partial class ShaderCompilerTestsInExternalNamespace { [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] public readonly partial struct UserDefinedTypeShader : IComputeShader { diff --git a/tests/ComputeSharp.Tests/ShaderMembersTests.cs b/tests/ComputeSharp.Tests/ShaderMembersTests.cs index a210f292..94f8bafc 100644 --- a/tests/ComputeSharp.Tests/ShaderMembersTests.cs +++ b/tests/ComputeSharp.Tests/ShaderMembersTests.cs @@ -31,7 +31,7 @@ public partial class ShaderMembersTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] internal readonly partial struct StaticConstantsShader : IComputeShader { @@ -72,7 +72,7 @@ public partial class ShaderMembersTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] internal readonly partial struct GlobalVariableShader : IComputeShader { @@ -108,7 +108,7 @@ public partial class ShaderMembersTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] internal readonly partial struct BoolInstanceFieldsShader : IComputeShader { @@ -173,7 +173,7 @@ public partial class ShaderMembersTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] internal readonly partial struct BoolInstanceFieldInCustomStructShader : IComputeShader { diff --git a/tests/ComputeSharp.Tests/ShaderRewriterTests.cs b/tests/ComputeSharp.Tests/ShaderRewriterTests.cs index b9e01564..c0c30d32 100644 --- a/tests/ComputeSharp.Tests/ShaderRewriterTests.cs +++ b/tests/ComputeSharp.Tests/ShaderRewriterTests.cs @@ -52,7 +52,7 @@ public partial class ShaderRewriterTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] internal readonly partial struct NanAndInfiniteShader : IComputeShader { @@ -114,7 +114,7 @@ public partial class ShaderRewriterTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] internal readonly partial struct ModAndComparisonOperatorsShader : IComputeShader { @@ -177,7 +177,7 @@ public partial class ShaderRewriterTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] internal readonly partial struct BitwiseOperatorsShader : IComputeShader { @@ -231,7 +231,7 @@ public partial class ShaderRewriterTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] internal readonly partial struct BooleanOperatorsShader : IComputeShader { @@ -282,7 +282,7 @@ public partial class ShaderRewriterTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] internal readonly partial struct ToBooleanConversionIntrinsicsShader : IComputeShader { @@ -367,7 +367,7 @@ public partial class ShaderRewriterTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] internal readonly partial struct FromBooleanConversionIntrinsicsShader : IComputeShader { @@ -451,7 +451,7 @@ public partial class ShaderRewriterTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] internal readonly partial struct ConstantsInShaderConstantFieldsShader : IComputeShader { @@ -530,7 +530,7 @@ public partial class ShaderRewriterTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] internal readonly partial struct DoubleConstantsInShaderConstantFieldsShader : IComputeShader { @@ -593,7 +593,7 @@ public partial class ShaderRewriterTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] internal readonly partial struct InterlockedOperationsShader : IComputeShader { @@ -639,7 +639,7 @@ public partial class ShaderRewriterTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] internal readonly partial struct GlslStyleMulOperatorsShader : IComputeShader { @@ -781,7 +781,7 @@ public partial class ShaderRewriterTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] internal readonly partial struct CustomStructTypeShader : IComputeShader { @@ -820,7 +820,7 @@ public partial class ShaderRewriterTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] internal readonly partial struct MiscHlslIntrinsicsShader : IComputeShader { @@ -864,7 +864,7 @@ public partial class ShaderRewriterTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] internal readonly partial struct ReadonlyModifierInMethodsShader : IComputeShader { diff --git a/tests/ComputeSharp.Tests/Shaders/Compute/ColorfulInfinity.cs b/tests/ComputeSharp.Tests/Shaders/Compute/ColorfulInfinity.cs index 05ae01b8..847aedcf 100644 --- a/tests/ComputeSharp.Tests/Shaders/Compute/ColorfulInfinity.cs +++ b/tests/ComputeSharp.Tests/Shaders/Compute/ColorfulInfinity.cs @@ -9,7 +9,7 @@ namespace ComputeSharp.SwapChain.Shaders.Compute; /// License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. /// [AutoConstructor] -[ThreadGroupSize(DispatchAxis.XY)] +[ThreadGroupSize(DefaultThreadGroupSizes.XY)] [GeneratedComputeShaderDescriptor] internal readonly partial struct ColorfulInfinity : IComputeShader { diff --git a/tests/ComputeSharp.Tests/Shaders/Compute/ContouredLayers.cs b/tests/ComputeSharp.Tests/Shaders/Compute/ContouredLayers.cs index 2b136abb..fb202c87 100644 --- a/tests/ComputeSharp.Tests/Shaders/Compute/ContouredLayers.cs +++ b/tests/ComputeSharp.Tests/Shaders/Compute/ContouredLayers.cs @@ -8,7 +8,7 @@ namespace ComputeSharp.SwapChain.Shaders.Compute; /// Created by Shane. /// [AutoConstructor] -[ThreadGroupSize(DispatchAxis.XY)] +[ThreadGroupSize(DefaultThreadGroupSizes.XY)] [GeneratedComputeShaderDescriptor] internal readonly partial struct ContouredLayers : IComputeShader { diff --git a/tests/ComputeSharp.Tests/Shaders/Compute/ExtrudedTruchetPattern.cs b/tests/ComputeSharp.Tests/Shaders/Compute/ExtrudedTruchetPattern.cs index 051047c0..b86c839b 100644 --- a/tests/ComputeSharp.Tests/Shaders/Compute/ExtrudedTruchetPattern.cs +++ b/tests/ComputeSharp.Tests/Shaders/Compute/ExtrudedTruchetPattern.cs @@ -8,7 +8,7 @@ namespace ComputeSharp.SwapChain.Shaders.Compute; /// Created by Shane. /// [AutoConstructor] -[ThreadGroupSize(DispatchAxis.XY)] +[ThreadGroupSize(DefaultThreadGroupSizes.XY)] [GeneratedComputeShaderDescriptor] internal readonly partial struct ExtrudedTruchetPattern : IComputeShader { diff --git a/tests/ComputeSharp.Tests/Shaders/Compute/FourColorGradient.cs b/tests/ComputeSharp.Tests/Shaders/Compute/FourColorGradient.cs index 955291ec..bba9d409 100644 --- a/tests/ComputeSharp.Tests/Shaders/Compute/FourColorGradient.cs +++ b/tests/ComputeSharp.Tests/Shaders/Compute/FourColorGradient.cs @@ -9,7 +9,7 @@ namespace ComputeSharp.SwapChain.Shaders.Compute; /// License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. /// [AutoConstructor] -[ThreadGroupSize(DispatchAxis.XY)] +[ThreadGroupSize(DefaultThreadGroupSizes.XY)] [GeneratedComputeShaderDescriptor] internal readonly partial struct FourColorGradient : IComputeShader { diff --git a/tests/ComputeSharp.Tests/Shaders/Compute/FractalTiling.cs b/tests/ComputeSharp.Tests/Shaders/Compute/FractalTiling.cs index 66d669a8..0b07b6ea 100644 --- a/tests/ComputeSharp.Tests/Shaders/Compute/FractalTiling.cs +++ b/tests/ComputeSharp.Tests/Shaders/Compute/FractalTiling.cs @@ -9,7 +9,7 @@ namespace ComputeSharp.SwapChain.Shaders.Compute; /// License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. /// [AutoConstructor] -[ThreadGroupSize(DispatchAxis.XY)] +[ThreadGroupSize(DefaultThreadGroupSizes.XY)] [GeneratedComputeShaderDescriptor] internal readonly partial struct FractalTiling : IComputeShader { diff --git a/tests/ComputeSharp.Tests/Shaders/Compute/HelloWorld.cs b/tests/ComputeSharp.Tests/Shaders/Compute/HelloWorld.cs index acb84bd6..5cbb4fde 100644 --- a/tests/ComputeSharp.Tests/Shaders/Compute/HelloWorld.cs +++ b/tests/ComputeSharp.Tests/Shaders/Compute/HelloWorld.cs @@ -7,7 +7,7 @@ namespace ComputeSharp.SwapChain.Shaders.Compute; /// Ported from . /// [AutoConstructor] -[ThreadGroupSize(DispatchAxis.XY)] +[ThreadGroupSize(DefaultThreadGroupSizes.XY)] [GeneratedComputeShaderDescriptor] internal readonly partial struct HelloWorld : IComputeShader { diff --git a/tests/ComputeSharp.Tests/Shaders/Compute/MengerJourney.cs b/tests/ComputeSharp.Tests/Shaders/Compute/MengerJourney.cs index 6f5b05a9..054689b1 100644 --- a/tests/ComputeSharp.Tests/Shaders/Compute/MengerJourney.cs +++ b/tests/ComputeSharp.Tests/Shaders/Compute/MengerJourney.cs @@ -8,7 +8,7 @@ namespace ComputeSharp.SwapChain.Shaders.Compute; /// Created by Syntopia. /// [AutoConstructor] -[ThreadGroupSize(DispatchAxis.XY)] +[ThreadGroupSize(DefaultThreadGroupSizes.XY)] [GeneratedComputeShaderDescriptor] internal readonly partial struct MengerJourney : IComputeShader { diff --git a/tests/ComputeSharp.Tests/Shaders/Compute/Octagrams.cs b/tests/ComputeSharp.Tests/Shaders/Compute/Octagrams.cs index 2a09e7e8..574060a8 100644 --- a/tests/ComputeSharp.Tests/Shaders/Compute/Octagrams.cs +++ b/tests/ComputeSharp.Tests/Shaders/Compute/Octagrams.cs @@ -8,7 +8,7 @@ namespace ComputeSharp.SwapChain.Shaders.Compute; /// Created by whisky_shusuky. /// [AutoConstructor] -[ThreadGroupSize(DispatchAxis.XY)] +[ThreadGroupSize(DefaultThreadGroupSizes.XY)] [GeneratedComputeShaderDescriptor] internal readonly partial struct Octagrams : IComputeShader { diff --git a/tests/ComputeSharp.Tests/Shaders/Compute/ProteanClouds.cs b/tests/ComputeSharp.Tests/Shaders/Compute/ProteanClouds.cs index c74875fc..4241bad0 100644 --- a/tests/ComputeSharp.Tests/Shaders/Compute/ProteanClouds.cs +++ b/tests/ComputeSharp.Tests/Shaders/Compute/ProteanClouds.cs @@ -9,7 +9,7 @@ namespace ComputeSharp.SwapChain.Shaders.Compute; /// License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. /// [AutoConstructor] -[ThreadGroupSize(DispatchAxis.XY)] +[ThreadGroupSize(DefaultThreadGroupSizes.XY)] [GeneratedComputeShaderDescriptor] internal readonly partial struct ProteanClouds : IComputeShader { diff --git a/tests/ComputeSharp.Tests/Shaders/Compute/PyramidPattern.cs b/tests/ComputeSharp.Tests/Shaders/Compute/PyramidPattern.cs index 2cde94e2..24a92020 100644 --- a/tests/ComputeSharp.Tests/Shaders/Compute/PyramidPattern.cs +++ b/tests/ComputeSharp.Tests/Shaders/Compute/PyramidPattern.cs @@ -9,7 +9,7 @@ namespace ComputeSharp.SwapChain.Shaders.Compute; /// Created by Shane. /// [AutoConstructor] -[ThreadGroupSize(DispatchAxis.XY)] +[ThreadGroupSize(DefaultThreadGroupSizes.XY)] [GeneratedComputeShaderDescriptor] internal readonly partial struct PyramidPattern : IComputeShader { diff --git a/tests/ComputeSharp.Tests/Shaders/Compute/TerracedHills.cs b/tests/ComputeSharp.Tests/Shaders/Compute/TerracedHills.cs index c9b5ca5b..0b20757c 100644 --- a/tests/ComputeSharp.Tests/Shaders/Compute/TerracedHills.cs +++ b/tests/ComputeSharp.Tests/Shaders/Compute/TerracedHills.cs @@ -6,7 +6,7 @@ namespace ComputeSharp.SwapChain.Shaders.Compute; /// Created by Shane. /// [AutoConstructor] -[ThreadGroupSize(DispatchAxis.XY)] +[ThreadGroupSize(DefaultThreadGroupSizes.XY)] [GeneratedComputeShaderDescriptor] internal readonly partial struct TerracedHills : IComputeShader { diff --git a/tests/ComputeSharp.Tests/Shaders/Compute/TriangleGridContouring.cs b/tests/ComputeSharp.Tests/Shaders/Compute/TriangleGridContouring.cs index cdcee935..49451496 100644 --- a/tests/ComputeSharp.Tests/Shaders/Compute/TriangleGridContouring.cs +++ b/tests/ComputeSharp.Tests/Shaders/Compute/TriangleGridContouring.cs @@ -8,7 +8,7 @@ namespace ComputeSharp.SwapChain.Shaders.Compute; /// Created by Shane. /// [AutoConstructor] -[ThreadGroupSize(DispatchAxis.XY)] +[ThreadGroupSize(DefaultThreadGroupSizes.XY)] [GeneratedComputeShaderDescriptor] internal readonly partial struct TriangleGridContouring : IComputeShader { diff --git a/tests/ComputeSharp.Tests/Shaders/Compute/TwoTiledTruchet.cs b/tests/ComputeSharp.Tests/Shaders/Compute/TwoTiledTruchet.cs index 4cd2f3a0..d52ad008 100644 --- a/tests/ComputeSharp.Tests/Shaders/Compute/TwoTiledTruchet.cs +++ b/tests/ComputeSharp.Tests/Shaders/Compute/TwoTiledTruchet.cs @@ -8,7 +8,7 @@ namespace ComputeSharp.SwapChain.Shaders.Compute; /// Created by Shane. /// [AutoConstructor] -[ThreadGroupSize(DispatchAxis.XY)] +[ThreadGroupSize(DefaultThreadGroupSizes.XY)] [GeneratedComputeShaderDescriptor] internal readonly partial struct TwoTiledTruchet : IComputeShader { diff --git a/tests/ComputeSharp.Tests/Texture1DTests.Pixels.cs b/tests/ComputeSharp.Tests/Texture1DTests.Pixels.cs index effb61a3..7d342f2a 100644 --- a/tests/ComputeSharp.Tests/Texture1DTests.Pixels.cs +++ b/tests/ComputeSharp.Tests/Texture1DTests.Pixels.cs @@ -89,7 +89,7 @@ partial class Texture1DTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] public readonly partial struct SamplingComputeShader : IComputeShader { diff --git a/tests/ComputeSharp.Tests/Texture1DTests.Pixels.g.cs b/tests/ComputeSharp.Tests/Texture1DTests.Pixels.g.cs index 845ec9c2..b3b43a6c 100644 --- a/tests/ComputeSharp.Tests/Texture1DTests.Pixels.g.cs +++ b/tests/ComputeSharp.Tests/Texture1DTests.Pixels.g.cs @@ -69,7 +69,7 @@ partial class Texture1DTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] internal readonly partial struct Shader_Unorm_Bgra32_Float4 : IComputeShader { @@ -83,7 +83,7 @@ partial class Texture1DTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] internal readonly partial struct Shader_Unorm_R16_float : IComputeShader { @@ -97,7 +97,7 @@ partial class Texture1DTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] internal readonly partial struct Shader_Unorm_R8_float : IComputeShader { @@ -111,7 +111,7 @@ partial class Texture1DTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] internal readonly partial struct Shader_Unorm_Rg16_Float2 : IComputeShader { @@ -125,7 +125,7 @@ partial class Texture1DTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] internal readonly partial struct Shader_Unorm_Rg32_Float2 : IComputeShader { @@ -139,7 +139,7 @@ partial class Texture1DTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] internal readonly partial struct Shader_Unorm_Rgba32_Float4 : IComputeShader { @@ -153,7 +153,7 @@ partial class Texture1DTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] internal readonly partial struct Shader_Unorm_Rgba64_Float4 : IComputeShader { diff --git a/tests/ComputeSharp.Tests/Texture1DTests.Pixels.tt b/tests/ComputeSharp.Tests/Texture1DTests.Pixels.tt index 8d345a43..166dc413 100644 --- a/tests/ComputeSharp.Tests/Texture1DTests.Pixels.tt +++ b/tests/ComputeSharp.Tests/Texture1DTests.Pixels.tt @@ -65,7 +65,7 @@ foreach (var (t, tPixel) in EnumerateTypes()) #> [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] internal readonly partial struct Shader_Unorm_<#=t#>_<#=tPixel#> : IComputeShader { diff --git a/tests/ComputeSharp.Tests/Texture1DTests.cs b/tests/ComputeSharp.Tests/Texture1DTests.cs index f58fc695..8e32f92e 100644 --- a/tests/ComputeSharp.Tests/Texture1DTests.cs +++ b/tests/ComputeSharp.Tests/Texture1DTests.cs @@ -363,7 +363,7 @@ public partial class Texture1DTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] internal readonly partial struct ReadOnlyTexture1DKernel : IComputeShader { @@ -395,7 +395,7 @@ public partial class Texture1DTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] internal readonly partial struct ReadWriteTexture1DKernel : IComputeShader { diff --git a/tests/ComputeSharp.Tests/Texture2DTests.Pixels.cs b/tests/ComputeSharp.Tests/Texture2DTests.Pixels.cs index 2f92f602..e1aa9b44 100644 --- a/tests/ComputeSharp.Tests/Texture2DTests.Pixels.cs +++ b/tests/ComputeSharp.Tests/Texture2DTests.Pixels.cs @@ -72,7 +72,7 @@ partial class Texture2DTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.XY)] + [ThreadGroupSize(DefaultThreadGroupSizes.XY)] [GeneratedComputeShaderDescriptor] public readonly partial struct SamplingComputeShader : IComputeShader { @@ -107,7 +107,7 @@ partial class Texture2DTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.XY)] + [ThreadGroupSize(DefaultThreadGroupSizes.XY)] [GeneratedComputeShaderDescriptor] public readonly partial struct SamplingPixelShader : IComputeShader { diff --git a/tests/ComputeSharp.Tests/Texture2DTests.Pixels.g.cs b/tests/ComputeSharp.Tests/Texture2DTests.Pixels.g.cs index e6466ce2..935f637c 100644 --- a/tests/ComputeSharp.Tests/Texture2DTests.Pixels.g.cs +++ b/tests/ComputeSharp.Tests/Texture2DTests.Pixels.g.cs @@ -69,7 +69,7 @@ partial class Texture2DTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.XY)] + [ThreadGroupSize(DefaultThreadGroupSizes.XY)] [GeneratedComputeShaderDescriptor] internal readonly partial struct Shader_Unorm_Bgra32_Float4 : IComputeShader { @@ -83,7 +83,7 @@ partial class Texture2DTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.XY)] + [ThreadGroupSize(DefaultThreadGroupSizes.XY)] [GeneratedComputeShaderDescriptor] internal readonly partial struct Shader_Unorm_R16_float : IComputeShader { @@ -97,7 +97,7 @@ partial class Texture2DTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.XY)] + [ThreadGroupSize(DefaultThreadGroupSizes.XY)] [GeneratedComputeShaderDescriptor] internal readonly partial struct Shader_Unorm_R8_float : IComputeShader { @@ -111,7 +111,7 @@ partial class Texture2DTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.XY)] + [ThreadGroupSize(DefaultThreadGroupSizes.XY)] [GeneratedComputeShaderDescriptor] internal readonly partial struct Shader_Unorm_Rg16_Float2 : IComputeShader { @@ -125,7 +125,7 @@ partial class Texture2DTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.XY)] + [ThreadGroupSize(DefaultThreadGroupSizes.XY)] [GeneratedComputeShaderDescriptor] internal readonly partial struct Shader_Unorm_Rg32_Float2 : IComputeShader { @@ -139,7 +139,7 @@ partial class Texture2DTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.XY)] + [ThreadGroupSize(DefaultThreadGroupSizes.XY)] [GeneratedComputeShaderDescriptor] internal readonly partial struct Shader_Unorm_Rgba32_Float4 : IComputeShader { @@ -153,7 +153,7 @@ partial class Texture2DTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.XY)] + [ThreadGroupSize(DefaultThreadGroupSizes.XY)] [GeneratedComputeShaderDescriptor] internal readonly partial struct Shader_Unorm_Rgba64_Float4 : IComputeShader { diff --git a/tests/ComputeSharp.Tests/Texture2DTests.Pixels.tt b/tests/ComputeSharp.Tests/Texture2DTests.Pixels.tt index 82e30167..fd35df6a 100644 --- a/tests/ComputeSharp.Tests/Texture2DTests.Pixels.tt +++ b/tests/ComputeSharp.Tests/Texture2DTests.Pixels.tt @@ -65,7 +65,7 @@ foreach (var (t, tPixel) in EnumerateTypes()) #> [AutoConstructor] - [ThreadGroupSize(DispatchAxis.XY)] + [ThreadGroupSize(DefaultThreadGroupSizes.XY)] [GeneratedComputeShaderDescriptor] internal readonly partial struct Shader_Unorm_<#=t#>_<#=tPixel#> : IComputeShader { diff --git a/tests/ComputeSharp.Tests/Texture2DTests.cs b/tests/ComputeSharp.Tests/Texture2DTests.cs index 0b10ab3e..ba5eb826 100644 --- a/tests/ComputeSharp.Tests/Texture2DTests.cs +++ b/tests/ComputeSharp.Tests/Texture2DTests.cs @@ -428,7 +428,7 @@ public partial class Texture2DTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.XY)] + [ThreadGroupSize(DefaultThreadGroupSizes.XY)] [GeneratedComputeShaderDescriptor] internal readonly partial struct ReadOnlyTexture2DKernel : IComputeShader { @@ -460,7 +460,7 @@ public partial class Texture2DTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.XY)] + [ThreadGroupSize(DefaultThreadGroupSizes.XY)] [GeneratedComputeShaderDescriptor] internal readonly partial struct ReadWriteTexture2DKernel : IComputeShader { diff --git a/tests/ComputeSharp.Tests/Texture3DTests.Pixels.g.cs b/tests/ComputeSharp.Tests/Texture3DTests.Pixels.g.cs index b0ceb805..3804382f 100644 --- a/tests/ComputeSharp.Tests/Texture3DTests.Pixels.g.cs +++ b/tests/ComputeSharp.Tests/Texture3DTests.Pixels.g.cs @@ -69,7 +69,7 @@ partial class Texture3DTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.XYZ)] + [ThreadGroupSize(DefaultThreadGroupSizes.XYZ)] [GeneratedComputeShaderDescriptor] internal readonly partial struct Shader_Unorm_Bgra32_Float4 : IComputeShader { @@ -83,7 +83,7 @@ partial class Texture3DTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.XYZ)] + [ThreadGroupSize(DefaultThreadGroupSizes.XYZ)] [GeneratedComputeShaderDescriptor] internal readonly partial struct Shader_Unorm_R16_float : IComputeShader { @@ -97,7 +97,7 @@ partial class Texture3DTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.XYZ)] + [ThreadGroupSize(DefaultThreadGroupSizes.XYZ)] [GeneratedComputeShaderDescriptor] internal readonly partial struct Shader_Unorm_R8_float : IComputeShader { @@ -111,7 +111,7 @@ partial class Texture3DTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.XYZ)] + [ThreadGroupSize(DefaultThreadGroupSizes.XYZ)] [GeneratedComputeShaderDescriptor] internal readonly partial struct Shader_Unorm_Rg16_Float2 : IComputeShader { @@ -125,7 +125,7 @@ partial class Texture3DTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.XYZ)] + [ThreadGroupSize(DefaultThreadGroupSizes.XYZ)] [GeneratedComputeShaderDescriptor] internal readonly partial struct Shader_Unorm_Rg32_Float2 : IComputeShader { @@ -139,7 +139,7 @@ partial class Texture3DTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.XYZ)] + [ThreadGroupSize(DefaultThreadGroupSizes.XYZ)] [GeneratedComputeShaderDescriptor] internal readonly partial struct Shader_Unorm_Rgba32_Float4 : IComputeShader { @@ -153,7 +153,7 @@ partial class Texture3DTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.XYZ)] + [ThreadGroupSize(DefaultThreadGroupSizes.XYZ)] [GeneratedComputeShaderDescriptor] internal readonly partial struct Shader_Unorm_Rgba64_Float4 : IComputeShader { diff --git a/tests/ComputeSharp.Tests/Texture3DTests.Pixels.tt b/tests/ComputeSharp.Tests/Texture3DTests.Pixels.tt index 056bea10..efa61669 100644 --- a/tests/ComputeSharp.Tests/Texture3DTests.Pixels.tt +++ b/tests/ComputeSharp.Tests/Texture3DTests.Pixels.tt @@ -65,7 +65,7 @@ foreach (var (t, tPixel) in EnumerateTypes()) #> [AutoConstructor] - [ThreadGroupSize(DispatchAxis.XYZ)] + [ThreadGroupSize(DefaultThreadGroupSizes.XYZ)] [GeneratedComputeShaderDescriptor] internal readonly partial struct Shader_Unorm_<#=t#>_<#=tPixel#> : IComputeShader { diff --git a/tests/ComputeSharp.Tests/Texture3DTests.cs b/tests/ComputeSharp.Tests/Texture3DTests.cs index b93c81b3..5bddce59 100644 --- a/tests/ComputeSharp.Tests/Texture3DTests.cs +++ b/tests/ComputeSharp.Tests/Texture3DTests.cs @@ -533,7 +533,7 @@ public partial class Texture3DTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.XYZ)] + [ThreadGroupSize(DefaultThreadGroupSizes.XYZ)] [GeneratedComputeShaderDescriptor] internal readonly partial struct ReadOnlyTexture3DKernel : IComputeShader { @@ -565,7 +565,7 @@ public partial class Texture3DTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.XYZ)] + [ThreadGroupSize(DefaultThreadGroupSizes.XYZ)] [GeneratedComputeShaderDescriptor] internal readonly partial struct ReadWriteTexture3DKernel : IComputeShader { diff --git a/tests/ComputeSharp.Tests/ThreadGroupSizeTests.cs b/tests/ComputeSharp.Tests/ThreadGroupSizeTests.cs index c4e1d5d7..1e1edc3b 100644 --- a/tests/ComputeSharp.Tests/ThreadGroupSizeTests.cs +++ b/tests/ComputeSharp.Tests/ThreadGroupSizeTests.cs @@ -23,7 +23,7 @@ public partial class ThreadGroupSizeTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.X)] + [ThreadGroupSize(DefaultThreadGroupSizes.X)] [GeneratedComputeShaderDescriptor] internal readonly partial struct DispatchXShader : IComputeShader { @@ -36,7 +36,7 @@ public partial class ThreadGroupSizeTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.XY)] + [ThreadGroupSize(DefaultThreadGroupSizes.XY)] [GeneratedComputeShaderDescriptor] internal readonly partial struct DispatchXYShader : IComputeShader { @@ -49,7 +49,7 @@ public partial class ThreadGroupSizeTests } [AutoConstructor] - [ThreadGroupSize(DispatchAxis.XYZ)] + [ThreadGroupSize(DefaultThreadGroupSizes.XYZ)] [GeneratedComputeShaderDescriptor] internal readonly partial struct DispatchXYZShader : IComputeShader {