Move `data/shaders` to `data/shaders/glsl` Move `data/hlsl` to `data/shaders/hlsl` Fix up shader paths in the cpp files to point to the new glsl location. `data/shaders/hlsl/compile.py` still overwrites the glsl .spv files (for now). Issue: #723
30 lines
No EOL
486 B
Text
30 lines
No EOL
486 B
Text
#version 450
|
|
|
|
struct Particle
|
|
{
|
|
vec4 pos;
|
|
vec4 vel;
|
|
};
|
|
|
|
// Binding 0 : Position storage buffer
|
|
layout(std140, binding = 0) buffer Pos
|
|
{
|
|
Particle particles[ ];
|
|
};
|
|
|
|
layout (local_size_x = 256) in;
|
|
|
|
layout (binding = 1) uniform UBO
|
|
{
|
|
float deltaT;
|
|
int particleCount;
|
|
} ubo;
|
|
|
|
void main()
|
|
{
|
|
int index = int(gl_GlobalInvocationID);
|
|
vec4 position = particles[index].pos;
|
|
vec4 velocity = particles[index].vel;
|
|
position += ubo.deltaT * velocity;
|
|
particles[index].pos = position;
|
|
} |