Skip to content

Commit 4e4a54d

Browse files
fix the exclusive scan
1 parent f55bf33 commit 4e4a54d

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

examples_tests/48.ArithmeticUnitTest/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ int main()
295295
for (uint32_t i=0u; i<BUFFER_DWORD_COUNT; i++)
296296
{
297297
// TODO: use random numbers, but right now I need to see whats going on in order to debug
298-
inputData[i] = i;// randGenerator();
298+
inputData[i] = randGenerator();
299299
}
300300
}
301301
auto gpuinputDataBuffer = driver->createFilledDeviceLocalGPUBufferOnDedMem(kBufferSize, inputData);

include/irr/builtin/glsl/workgroup/ballot.glsl

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -228,10 +228,7 @@ uint irr_glsl_workgroupBallotFindMSB();
228228
if (gl_LocalInvocationIndex<lastInvocation) \
229229
_IRR_GLSL_SCRATCH_SHARED_DEFINED_[gl_LocalInvocationIndex+1u] = firstLevelScan; \
230230
barrier(); \
231-
if (gl_LocalInvocationIndex<lastInvocation) \
232-
return gl_LocalInvocationIndex!=0u ? CONV(_IRR_GLSL_SCRATCH_SHARED_DEFINED_[gl_LocalInvocationIndex]):IDENTITY; \
233-
else \
234-
return IDENTITY; \
231+
return any(bvec2(gl_LocalInvocationIndex!=0u,gl_LocalInvocationIndex<=lastInvocation)) ? CONV(_IRR_GLSL_SCRATCH_SHARED_DEFINED_[gl_LocalInvocationIndex]):IDENTITY; \
235232
} \
236233
else \
237234
return CONV(firstLevelScan);

0 commit comments

Comments
 (0)