#version 450 struct Particle { vec2 position; vec2 velocity; vec4 color; }; layout (binding = 0) uniform ParameterUBO { float deltaTime; } ubo; layout(std140, binding = 2) readonly buffer ParticleSSBOIn { Particle particlesIn[ ]; }; layout(std140, binding = 3) buffer ParticleSSBOOut { Particle particlesOut[ ]; }; layout (local_size_x = 256, local_size_y = 1, local_size_z = 1) in; void main() { uint index = gl_GlobalInvocationID.x; Particle particleIn = particlesIn[index]; particlesOut[index].position = particleIn.position + particleIn.velocity.xy * ubo.deltaTime; particlesOut[index].velocity = particleIn.velocity; }