quakeforge/libs/video/renderer/vulkan/shader/sprite_depth.vert
Bill Currie 36e0d857a2 [vulkan] Create the non-C side of the sprite pipeline
This adds the shaders and the pipeline specs. I'm not sure that the
deferred rendering side of the render pass is appropriate, but I thought
I'd give it a go, since quake sprites are really cutoff rather than
translucent.
2021-12-24 06:45:13 +09:00

31 lines
518 B
GLSL

#version 450
layout (set = 0, binding = 0) uniform Matrices {
mat4 Projection3d;
mat4 View;
mat4 Sky;
mat4 Projection2d;
};
layout (set = 1, binding = 0) buffer Vertices {
vec4 xyuv[];
};
layout (push_constant) uniform PushConstants {
mat4 Model;
int frame;
};
layout (location = 0) out vec2 st;
void
main (void)
{
vec4 v = xyuv[frame * 4 + gl_VertexIndex];
vec4 pos = vec4 (0, 0, 0, 1);
pos += v.x * Model[1] + v.y * Model[2];
gl_Position = Projection3d * (View * pos);
st = v.zw;
}