aboutsummaryrefslogtreecommitdiffstats
path: root/shaders/ui.vert
diff options
context:
space:
mode:
authorladevieq <ladevie.quentin@gmail.com>2021-08-09 22:41:03 +0200
committerladevieq <ladevie.quentin@gmail.com>2021-08-09 22:41:03 +0200
commit8c1e26e552556e36a5c1fecd9558d9ab9dd3d454 (patch)
tree554af62f3bd3fb237c07de55dfad1da7dac30592 /shaders/ui.vert
parent03fdcb0341d35bb99fccb2e155ee967f932c9961 (diff)
Bindless graphics pipeline
Diffstat (limited to 'shaders/ui.vert')
-rw-r--r--shaders/ui.vert18
1 files changed, 11 insertions, 7 deletions
diff --git a/shaders/ui.vert b/shaders/ui.vert
index c935357..dd71ef6 100644
--- a/shaders/ui.vert
+++ b/shaders/ui.vert
@@ -1,17 +1,21 @@
-struct Vertex {
+#extension GL_EXT_buffer_reference : require
+
+struct vertex {
vec2 pos;
vec2 uv;
uint color;
+ uint[3] padding;
};
-layout(set = 0, binding = 0) uniform Vertices {
- Vertex vertices[158];
+layout(buffer_reference) readonly buffer vertices {
+ vertex vertices[];
};
-layout(set = 0, binding = 1) uniform UiTransforms {
+layout(push_constant) uniform constants {
+ layout(offset = 32) vertices vertex_buffer;
vec2 scale;
vec2 translate;
-};
+} consts;
out gl_PerVertex {
vec4 gl_Position;
@@ -24,10 +28,10 @@ layout(location = 0) out struct {
void main() {
- Vertex v = vertices[gl_VertexIndex];
+ vertex v = consts.vertex_buffer.vertices[gl_VertexIndex];
Out.color = unpackUnorm4x8(v.color);
Out.uv = v.uv;
- gl_Position = vec4(v.pos * scale + translate, 0.0, 1.0);
+ gl_Position = vec4(v.pos * consts.scale + consts.translate, 0.0, 1.0);
}