Skip to content

Commit 644061c

Browse files
FrancescoC-unitysebastienlagarde
authored andcommitted
Workaround for GetKernelThreadGroupSizes returning wrong data #760
1 parent cc93c2d commit 644061c

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

com.unity.render-pipelines.high-definition/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
138138
- Fix spelling and grammatical errors in material samples
139139
- Fixed issues with scene view and transparent motion vectors.
140140
- Pre-warm the RTHandle system to reduce the amount of memory allocations and the total memory needed at all points.
141+
- Workaround an issue caused by GetKernelThreadGroupSizes failing to retrieve correct group size.
141142

142143
### Changed
143144
- Rejecting history for ray traced reflections based on a threshold evaluated on the neighborhood of the sampled history.

com.unity.render-pipelines.high-definition/Runtime/PostProcessing/PostProcessSystem.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2228,7 +2228,11 @@ void DoColorGrading(CommandBuffer cmd, ComputeShader cs, int kernel)
22282228

22292229
// Generate the lut
22302230
// See the note about Metal & Intel in LutBuilder3D.compute
2231-
builderCS.GetKernelThreadGroupSizes(builderKernel, out uint threadX, out uint threadY, out uint threadZ);
2231+
// GetKernelThreadGroupSizes is currently broken on some binary versions.
2232+
//builderCS.GetKernelThreadGroupSizes(builderKernel, out uint threadX, out uint threadY, out uint threadZ);
2233+
uint threadX = 4;
2234+
uint threadY = 4;
2235+
uint threadZ = 4;
22322236
cmd.DispatchCompute(builderCS, builderKernel,
22332237
(int)((m_LutSize + threadX - 1u) / threadX),
22342238
(int)((m_LutSize + threadY - 1u) / threadY),

com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/LutBuilder3D.compute

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ float3 Tonemap(float3 colorLinear)
234234
// allow anything higher than 256 threads. We'll use 4x4x4 then.
235235
// Ultimately it would nice to expose `maxTotalThreadsPerThreadgroup` for Metal...
236236
// Source: https://developer.apple.com/metal/Metal-Feature-Set-Tables.pdf
237+
// It is important to keep this in sync with the group-size declared in PostProcessSystem.cs
237238
[numthreads(4,4,4)]
238239
void MAIN(uint3 dispatchThreadId : SV_DispatchThreadID)
239240
{

0 commit comments

Comments
 (0)