diff --git a/Inflate/InflateGpuShaders.cs b/Inflate/InflateGpuShaders.cs index 0863e1f..72a4a93 100644 --- a/Inflate/InflateGpuShaders.cs +++ b/Inflate/InflateGpuShaders.cs @@ -234,7 +234,7 @@ internal readonly partial struct CoarseNeighborShader( } } -[ThreadGroupSize(DefaultThreadGroupSizes.XY)] +[ThreadGroupSize(InflateSettings.RowGroupWidth, InflateSettings.RowGroupHeight, 1)] [GeneratedComputeShaderDescriptor] internal readonly partial struct ResidualShader( ReadWriteBuffer potential, @@ -283,7 +283,7 @@ internal readonly partial struct ResidualShader( } } -[ThreadGroupSize(DefaultThreadGroupSizes.XY)] +[ThreadGroupSize(InflateSettings.RowGroupWidth, InflateSettings.RowGroupHeight, 1)] [GeneratedComputeShaderDescriptor] internal readonly partial struct RestrictResidualShader( ReadWriteBuffer residual, @@ -407,7 +407,7 @@ internal readonly partial struct CoarseSolveShader( } } -[ThreadGroupSize(DefaultThreadGroupSizes.XY)] +[ThreadGroupSize(InflateSettings.RowGroupWidth, InflateSettings.RowGroupHeight, 1)] [GeneratedComputeShaderDescriptor] internal readonly partial struct ProlongShader( ReadWriteBuffer potential, @@ -631,7 +631,7 @@ internal readonly partial struct CorrectionScaleShader( } } -[ThreadGroupSize(DefaultThreadGroupSizes.XY)] +[ThreadGroupSize(InflateSettings.RowGroupWidth, InflateSettings.RowGroupHeight, 1)] [GeneratedComputeShaderDescriptor] internal readonly partial struct GaussSeidelShader( ReadWriteBuffer mask, diff --git a/Inflate/InflateSettings.cs b/Inflate/InflateSettings.cs index 0e8bfba..4fe4e2c 100644 --- a/Inflate/InflateSettings.cs +++ b/Inflate/InflateSettings.cs @@ -10,6 +10,8 @@ internal static class InflateSettings public const float CoverageThreshold = 0.5f; public const uint CoarseSolidCount = 3u; public const uint CoarsePairCount = 2u; + public const int RowGroupWidth = 32; + public const int RowGroupHeight = 2; public const int CorrectionGroupSize = 8; public const int CorrectionGroupThreads = CorrectionGroupSize * CorrectionGroupSize; public const int CorrectionReduceThreads = 256;