X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=vs.vert;h=61ad91a7cfd53c2ca962a7a28796bfff6461dfa7;hb=c49945ed13f2f58ed6f9ac2a4c4f6618e5d16b51;hp=a8bf48e4832c5aec737939852b5c77393819e120;hpb=23ac2e109b1f6abd1830420e47bfc3ffaf97b7df;p=nageru diff --git a/vs.vert b/vs.vert index a8bf48e..61ad91a 100644 --- a/vs.vert +++ b/vs.vert @@ -1,8 +1,8 @@ #version 450 core +#extension GL_ARB_shader_viewport_layer_array : require -in vec2 position; -in vec2 texcoord; -out vec2 tc; +layout(location=0) in vec2 position; +out vec3 tc; void main() { @@ -13,5 +13,8 @@ void main() // 0.000 0.000 -2.000 -1.000 // 0.000 0.000 0.000 1.000 gl_Position = vec4(2.0 * position.x - 1.0, 2.0 * position.y - 1.0, -1.0, 1.0); - tc = texcoord; + tc.xy = position; + tc.z = gl_InstanceID; + + gl_Layer = gl_InstanceID; }