Memory allocation with std430 qualifier
问题 I'm using the compute shader bound with a SSAO. And I use the following structure in the compute shader: struct Particle { vec4 pAnds; vec3 velocity; float lifespan; float age; }; layout (std430, binding = 0) buffer members_in { Particle particle[]; } input_data; yet it seems that the memory block allocated for each of these data structure is not equal to (4 + 3 + 1 + 1) * 4. And I also tried another one: struct Particle { vec4 pAnds; vec3 velocity; float lifespan; }; This time it worked fine