light/data/test_assets/sprite.vert
light7734 a2efc487c4
Some checks reported errors
continuous-integration/drone/push Build was killed
wip: convert from include style to module import style :D
2025-11-14 16:04:37 +03:30

36 lines
576 B
GLSL

#version 450 core
layout(push_constant) uniform pc
{
mat4 view_projection;
};
struct VertexData
{
vec3 position;
vec3 color;
};
// readonly SSBO containing the vertex data
layout(set = 0, binding = 0, std430) readonly buffer vertex_data {
VertexData data[];
};
vec3 position(int idx)
{
return data[idx].position;
}
vec3 color(int idx)
{
return data[idx].color;
}
layout(location = 0) out vec3 out_frag_color;
void main()
{
gl_Position = view_projection * vec4(position(gl_VertexIndex), 1.0);
out_frag_color = color(gl_VertexIndex);
}