diff --git a/backends/vulkan/runtime/graph/ops/glsl/conv2d_pw.glsl b/backends/vulkan/runtime/graph/ops/glsl/conv2d_pw.glsl index a5a2097cd50..f72c487fa78 100644 --- a/backends/vulkan/runtime/graph/ops/glsl/conv2d_pw.glsl +++ b/backends/vulkan/runtime/graph/ops/glsl/conv2d_pw.glsl @@ -33,7 +33,9 @@ ${layout_declare_ubo(8, "float", "out_min", "float", "out_max")} layout(local_size_x_id = 0, local_size_y_id = 1, local_size_z_id = 2) in; // shared memory to hold calculated positions, this would reduce register usage thus improving performance. -shared ivec2 pos_shared[gl_WorkGroupSize.x * gl_WorkGroupSize.y * gl_WorkGroupSize.z * TILE_SIZE * TILE_SIZE]; +// 64 is the number of threads in the local wg +$num_shared = 64 * TILE_SIZE * TILE_SIZE +shared ivec2 pos_shared[${num_shared}]; /* * Computes a 2D pointwise convolution of an NxN output tile. Calculating an