Skip to content

Commit b889b60

Browse files
committed
use 1D workgroup dispatch
1 parent 773733d commit b889b60

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

31_HLSLPathTracer/app_resources/glsl/common.glsl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,13 @@ layout(set = 2, binding = 2) uniform usampler2D scramblebuf;
1616
layout(set=0, binding=0, rgba16f) uniform image2D outImage;
1717

1818
#ifndef _NBL_GLSL_WORKGROUP_SIZE_
19-
#define _NBL_GLSL_WORKGROUP_SIZE_ 32
20-
layout(local_size_x=_NBL_GLSL_WORKGROUP_SIZE_, local_size_y=_NBL_GLSL_WORKGROUP_SIZE_, local_size_z=1) in;
19+
#define _NBL_GLSL_WORKGROUP_SIZE_ 256
20+
layout(local_size_x=_NBL_GLSL_WORKGROUP_SIZE_, local_size_y=1, local_size_z=1) in;
2121
#endif
2222

2323
ivec2 getCoordinates() {
24-
return ivec2(gl_GlobalInvocationID.xy);
24+
ivec2 imageSize = imageSize(outImage);
25+
return ivec2(gl_GlobalInvocationID.x % imageSize.x, gl_GlobalInvocationID.x / imageSize.x);
2526
}
2627

2728
vec2 getTexCoords() {

0 commit comments

Comments
 (0)