I have Vulkan compute shader in HSLS language. In the beginning I set local_size (work group size) as:
layout (local_size_x = 32, local_size_y = 32, local_size_z = 1) in;
So there are 32×32=1024 threads in my work group. Then I need to dispatch the shader with size grid size. For example to process 2048×1024 image by this shader I need grid size of 64×32. At present I have to hard code local_size both in shader GLSL code (to run) and in C++ code (to calc grid size). Which is not quite error-prone. How could I get local_size from shader module / pipeline?
I have found vkGetShaderInfoAMD function, but it just crashes on nVidia card. Also AMD in its name it not very promising.