This is not so much something that doesn’t work but rather something that does work when I have read in various places it should not and seen tutorials/code by people who compared to me are not noobs in terms of graphics…
Reason I get worried is that it makes me think it’s something I got lucky with (driver support) but could go wrong if done on different hardware.
ok, so it has been said that vkCmdDrawIndexedIndirect seems to lack the count and for drawing one still has to have a loop over the buffer or use some extension or have support of Vulkan 1.2 or so ( vkCmdDrawIndexedIndirectCount).
yet I can use the command with a 0 offset and walk all the draw commands in the buffer (using the drawcount parameter). that said I can fill the buffer to with draw commands and the relevant info to do instanced drawing of all my objects sorted my meshes.
what I needed, however, was gl_DrawIDARB and GL_ARB_shader_draw_parameters on the shader side and VK_KHR_shader_draw_parameters on the vulkan code side, to be able to extract my indices/offsets into other SSBOs.
now I “believe” that with glsl version 460 I can use gl_DrawID, not sure if I have to require a higher vulkan api version as well, these are things that I find really hard to get some info about, especially on the shader side, things get renamed, promoted, etc. but the lack of good info I find makes it hard to architect your code - shading is my weak spot anyhow.
ok, lot of rambling, so I was wondering if I can rely on such a solution to work fairly well across hardware, and is it generally better to require higher glsl versions, or rely on extensions, are there a lot of hardware dependencies with version differences or can I hope that by and large it’s about driver implementation to support them, same goes for the Vulkan API, can I safely “hope” most setups will support a certain version.
while I don’t want/need guarantees for things to work, I do want to build something that I myself can use on different hardware/GPUs that is not totally outdated, so I aim for the greatest common divisor in a sense.