Merge pull request #2976 from jeremy-lunarg/hayes-fix-2975
[platform/upstream/glslang.git] / Test / GL_ARB_fragment_coord_conventions.vert
1 #version 140
2
3 #extension GL_ARB_fragment_coord_conventions: require
4 #extension GL_ARB_explicit_attrib_location : enable
5
6
7 #if !defined GL_ARB_fragment_coord_conventions
8 #  error GL_ARB_fragment_coord_conventions is not defined
9 #elif GL_ARB_fragment_coord_conventions != 1
10 #  error GL_ARB_fragment_coord_conventions is not equal to 1
11 #endif
12
13
14 layout (location = 0) in vec4 pos;
15 out vec4 i;
16
17 uniform float gtf_windowWidth;
18 uniform float gtf_windowHeight;
19 uniform float n;
20 uniform float f;
21
22 void main()
23 {
24   gl_Position = pos;
25   i = vec4((pos.x+1.0)*0.5*gtf_windowWidth, (pos.y+1.0)*0.5*gtf_windowHeight, (f-n)*0.5*pos.z + (f+n)*0.5, pos.w);
26 }
27