diff options
author | tcmal <me@aria.rip> | 2024-08-25 17:44:22 +0100 |
---|---|---|
committer | tcmal <me@aria.rip> | 2024-08-25 17:44:22 +0100 |
commit | b688a25810840c5ebf4bf2c18bbdae52c62f6b4d (patch) | |
tree | 923c81d1be62d1344694306d5fb8728841620b6f /stockton-render/src/draw/ui/data/stockton.vert | |
parent | bf9573764c695e65b1504419fafb76ccabb0322b (diff) |
feat(render): WIP eGUI integration
Diffstat (limited to 'stockton-render/src/draw/ui/data/stockton.vert')
-rw-r--r-- | stockton-render/src/draw/ui/data/stockton.vert | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/stockton-render/src/draw/ui/data/stockton.vert b/stockton-render/src/draw/ui/data/stockton.vert index 1dd9477..7447fec 100644 --- a/stockton-render/src/draw/ui/data/stockton.vert +++ b/stockton-render/src/draw/ui/data/stockton.vert @@ -1,11 +1,26 @@ #version 450 -vec2 positions[3] = vec2[]( - vec2(0.0, -0.5), - vec2(0.5, 0.5), - vec2(-0.5, 0.5) -); +layout (push_constant) uniform PushConsts { + vec2 screen_size; +} push; + +layout(location = 0) in vec2 pos; +layout (location = 1) in vec2 uv; +layout (location = 2) in int col; // rgba of u8s + +out gl_PerVertex { + vec4 gl_Position; +}; +layout (location = 1) out vec2 frag_uv; +layout (location = 2) out int frag_col; void main() { - gl_Position = vec4(positions[gl_VertexIndex], 0.0, 1.0); + gl_Position = vec4( + ((pos.x / push.screen_size.x) * 2.0) - 1.0, + ((pos.y / push.screen_size.y) * 2.0) - 1.0, + 0.0, + 1.0 + ); + frag_uv = uv; + frag_col = col; } |