I need an SDL3 GLSL Cheatsheet

Howdy folks, I’m trying out the new GPU API. So far it actually all reads pretty straightforward and seems very nice.

I’m having some problems with some of the numbers used in these layout sections. From what I can gather, this isn’t so much an SDL3 thing as it is a Vulkan/SPIRV thing, but it seems some of these numbers (set, binding) are mapped internally in SDL3, and I’m having trouble making sense of what they are.

After a few hours of fiddling, here’s what I think I know.

  • (set = 1) seems to be mapped to the vertex shader’s UBO
  • (set = 3) seems to be mapped to the fragment shader’s UBO
  • not really sure what these bindings do
  • and I’m also unsure what the slot_index in either of the PushGPUXXXUniformData functions do. (though the combination in this screenshot works)
  • there also seems to be some amount of struct padding inside the UBO that I’ve discovered, where it seems to be maybe 16B aligned, and two vec3’s in the same UBO will have 4B of padding between them.

Is there any kind of cheatsheet for these. Or maybe someone who’s more familiar about this realm of shader development can enlighten me.

Code is here, if anyone should like to look at it.