diff options
Diffstat (limited to 'shaders/api-test-ui.vert')
| -rw-r--r-- | shaders/api-test-ui.vert | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/shaders/api-test-ui.vert b/shaders/api-test-ui.vert index 3b6d0b5..8dd05a8 100644 --- a/shaders/api-test-ui.vert +++ b/shaders/api-test-ui.vert @@ -4,18 +4,19 @@ struct vertex { vec2 pos;
vec2 uv;
uint color;
- uint[3] padding;
+ uint padding;
};
layout(buffer_reference) readonly buffer vertices {
vertex vertices[];
};
-// layout(set = 1, binding = 0) uniform parameters {
-// vertices vertex_buffer;
-// vec2 scale;
-// vec2 translate;
-// } params;
+layout(set = 2, binding = 0) uniform parameters {
+ vertices vertex_buffer;
+ vec2 scale;
+ vec2 translate;
+ uint texture_index;
+} params;
out gl_PerVertex {
vec4 gl_Position;
@@ -28,13 +29,13 @@ layout(location = 0) out struct { void main() {
- // vertex v = params.vertex_buffer.vertices[gl_VertexIndex];
+ vertex v = params.vertex_buffer.vertices[gl_VertexIndex];
- // Out.color = unpackUnorm4x8(v.color);
- // Out.uv = v.uv;
+ Out.color = unpackUnorm4x8(v.color);
+ Out.uv = v.uv;
- // gl_Position = vec4(v.pos * params.scale + params.translate, 0.0, 1.0);
+ gl_Position = vec4(v.pos * params.scale + params.translate, 0.0, 1.0);
- vec2 pos[3] = vec2[3]( vec2(-0.7, 0.7), vec2(0.7, 0.7), vec2(0.0, -0.7) );
- gl_Position = vec4(pos[gl_VertexIndex], 0.0, 1.0);
+ // vec2 pos[3] = vec2[3]( vec2(-0.7, 0.7), vec2(0.7, 0.7), vec2(0.0, -0.7) );
+ // gl_Position = vec4(pos[gl_VertexIndex], 1.0, 1.0);
}
|
