The Vulkan subgroup tutorial mentions:
If you specify a workgroup size that is less than the subgroup size, you are guaranteed to have inactive invocations within the subgroup.
Now assume you you have a maxComputeWorkGroupSize of 1024 and a subGroupSize of 64. If you want to apply a filter to an image you'd probably go for a 2D invocation. Therefore you would end up with a work group size of 32, since 32 * 32 * 1 = 1024. Now your work group size is smaller than your sub group size.
So my question is, would it be prefereable to use an 1D work group size of 64 instead (and extract the respective x and y coordinate from the now "bigger" GlobalInvocationID.x) ?
maxComputeWorkGroupSizeis dimensional;subGroupSizeis not. The latter is a flat count of invocations. It does not care about the arrangement of those invocations in a work group.How a multidimensional work group gets split into subgroups is implementation-defined. In your case, the implementation could put every 32x2 invocations in the work group to be in the same subgroup. But it could also split it up by 2x32. Or every 8x8 block. Or something else.