In a compute shader I have a struct for a particle:
struct Particle {
float delta;
float start_posx;
float start_posy;
float start_posz;
float restart;
uint max_textures;
float max_lifetime;
};
Now I want to use this struct in an SSBO:
layout (std430, binding = 12) buffer particleBlock {
Particle particles[];
};
I am assuming my particles in the ssbo are tightly packed, because all struct members are size of 4. If I set alignment to 16:
layout (std430, binding = 12) buffer particleBlock {
layout(align = 16) Particle particles[];
};
will particles[1] be at offset 32? I'm not sure how this align works for arrays and this doesn't seem to work for me.