diff options
Diffstat (limited to 'render')
-rw-r--r-- | render/vulkan/shaders/common.vert | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/render/vulkan/shaders/common.vert b/render/vulkan/shaders/common.vert index fa31d26c..c6175d24 100644 --- a/render/vulkan/shaders/common.vert +++ b/render/vulkan/shaders/common.vert @@ -10,16 +10,9 @@ layout(push_constant, row_major) uniform UBO { layout(location = 0) out vec2 uv; -// 4 outlining points and uv coords -const vec2[] values = { - {0, 0}, - {1, 0}, - {1, 1}, - {0, 1}, -}; - void main() { - vec2 pos = values[gl_VertexIndex % 4]; + vec2 pos = vec2(float((gl_VertexIndex + 1) & 2) * 0.5f, + float(gl_VertexIndex & 2) * 0.5f); uv = data.uv_offset + pos * data.uv_size; gl_Position = data.proj * vec4(pos, 0.0, 1.0); } |