Files
ld58/code/vulkan/shaders/basic.vert
James Bulman 2c67896cf2 Made navmesh compile on Windows
Small updates to remove warnings
Testing nonuniform descriptor access in shader
2025-10-05 01:31:39 +01:00

32 lines
549 B
GLSL

#version 460 core
#extension GL_EXT_scalar_block_layout : enable
struct Vertex {
vec4 p;
vec2 uv;
uint c;
uint pad;
};
layout(binding = 0, scalar)
readonly buffer Vertices {
Vertex vtx[];
};
layout(location = 0) out vec2 frag_uv;
layout(location = 1) out vec4 frag_c;
layout(location = 2) out flat uint idx;
void main() {
Vertex v = vtx[gl_VertexIndex];
gl_Position = v.p;
frag_uv = v.uv;
frag_c = vec4((v.c >> 24) & 0xFF, (v.c >> 16) & 0xFF, (v.c >> 8) & 0xFF, (v.c >> 0) & 0xFF) / 255.0f;
frag_c = frag_c.abgr;
idx = v.pad;
}