diff options
Diffstat (limited to 'shaders/ui.vert')
| -rw-r--r-- | shaders/ui.vert | 18 |
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);
}
|
