tests/manual/rhi/shared/texture.vert
raw| 1 | #version 440 |
| 2 | |
| 3 | layout(location = 0) in vec4 position; |
| 4 | layout(location = 1) in vec2 texcoord; |
| 5 | |
| 6 | layout(location = 0) out vec2 v_texcoord; |
| 7 | |
| 8 | layout(std140, binding = 0) uniform buf { |
| 9 | mat4 mvp; |
| 10 | int flip; |
| 11 | } ubuf; |
| 12 | |
| 13 | out gl_PerVertex { vec4 gl_Position; }; |
| 14 | |
| 15 | void main() |
| 16 | { |
| 17 | v_texcoord = vec2(texcoord.x, texcoord.y); |
| 18 | if (ubuf.flip != 0) |
| 19 | v_texcoord.y = 1.0 - v_texcoord.y; |
| 20 | gl_Position = ubuf.mvp * position; |
| 21 | } |