mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-19 22:11:01 +01:00
17 lines
410 B
GLSL
17 lines
410 B
GLSL
#version 450
|
|
|
|
layout(location = 0) out vec2 v_TexCoord;
|
|
|
|
void main() {
|
|
vec2 tc = vec2(0.0);
|
|
switch(gl_VertexIndex) {
|
|
case 0: tc = vec2(1.0, 0.0); break;
|
|
case 1: tc = vec2(1.0, 1.0); break;
|
|
case 2: tc = vec2(0.0, 0.0); break;
|
|
case 3: tc = vec2(0.0, 1.0); break;
|
|
}
|
|
v_TexCoord = tc;
|
|
vec2 pos = tc * 2.0 - 1.0;
|
|
gl_Position = vec4(pos.x, -pos.y, 0.5, 1.0);
|
|
}
|