Skip to content
This repository was archived by the owner on Nov 30, 2020. It is now read-only.

Commit 50443b4

Browse files
committed
Fixed parallel reduction in auto exposure
1 parent 658a9c2 commit 50443b4

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

PostProcessing/Shaders/Builtins/AutoExposure.compute

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,24 +52,14 @@ void MAIN(uint2 groupThreadId : SV_GroupThreadID)
5252

5353
// Parallel reduction to find the max value
5454
UNITY_UNROLL
55-
for (uint i = HISTOGRAM_BINS >> 1u; i > 32u; i >>= 1u)
55+
for (uint i = HISTOGRAM_BINS >> 1u; i > 0u; i >>= 1u)
5656
{
5757
if (thread_id < i)
5858
gs_pyramid[thread_id] = max(gs_pyramid[thread_id], gs_pyramid[thread_id + i]);
5959

6060
GroupMemoryBarrierWithGroupSync();
6161
}
6262

63-
if (thread_id < 32u)
64-
{
65-
gs_pyramid[thread_id] = max(gs_pyramid[thread_id], gs_pyramid[thread_id + 32]);
66-
gs_pyramid[thread_id] = max(gs_pyramid[thread_id], gs_pyramid[thread_id + 16]);
67-
gs_pyramid[thread_id] = max(gs_pyramid[thread_id], gs_pyramid[thread_id + 8]);
68-
gs_pyramid[thread_id] = max(gs_pyramid[thread_id], gs_pyramid[thread_id + 4]);
69-
gs_pyramid[thread_id] = max(gs_pyramid[thread_id], gs_pyramid[thread_id + 2]);
70-
gs_pyramid[thread_id] = max(gs_pyramid[thread_id], gs_pyramid[thread_id + 1]);
71-
}
72-
7363
GroupMemoryBarrierWithGroupSync();
7464

7565
if (thread_id == 0u)

0 commit comments

Comments
 (0)