light/data/test_assets/triangle.vert

27 lines
478 B
GLSL
Raw Normal View History

2025-10-01 17:32:38 +03:30
#version 450 core
layout(push_constant) uniform pc {
mat4 view_projection;
};
struct VertexData
{
vec3 position;
vec3 color;
};
2025-10-01 17:32:38 +03:30
layout(std140, set = 0, binding = 0) readonly buffer Vertices {
VertexData vertices[];
} ssbo_vertices;
2025-10-01 17:32:38 +03:30
layout(location = 0) out vec3 out_frag_color;
void main()
{
VertexData vertex = ssbo_vertices.vertices[gl_VertexIndex];
gl_Position = view_projection * vec4(vertex.position, 1.0);
out_frag_color = vertex.color;
2025-10-01 17:32:38 +03:30
}