]> git.tdb.fi Git - libs/gl.git/blob - tests/glsl/uniform_location_allocation.glsl
Check the flat qualifier from the correct member
[libs/gl.git] / tests / glsl / uniform_location_allocation.glsl
1 #pragma MSP stage(vertex)
2 uniform mat4 mvp;
3 uniform sampler2D heightmap;
4 layout(location=0) in vec2 position;
5 layout(location=1) in vec2 texcoord;
6 void main()
7 {
8         gl_Position = mvp*vec4(position, texture(heightmap, texcoord).r, 1.0);
9         passthrough;
10 }
11
12 #pragma MSP stage(fragment)
13 layout(location=0) uniform sampler2D heightmap;
14 uniform vec4 color;
15 out vec4 frag_color;
16 void main()
17 {
18         frag_color = color*vec4(texture(heightmap, texcoord).rrr, 1.0);
19 }
20
21 // Target API: OpenGL
22
23 /* Expected output: vertex
24 layout(location=1) uniform mat4 mvp;
25 layout(location=0, binding=16) uniform sampler2D heightmap;
26 layout(location=0) in vec2 position;
27 layout(location=1) in vec2 texcoord;
28 layout(location=0) out vec2 _vs_out_texcoord;
29 void main()
30 {
31   gl_Position = mvp*vec4(position, texture(heightmap, texcoord).r, 1.0);
32   _vs_out_texcoord = texcoord;
33   gl_Position.z = gl_Position.z*2.0-gl_Position.w;
34 }
35 */
36
37 /* Expected output: fragment
38 layout(location=0, binding=16) uniform sampler2D heightmap;
39 layout(location=5) uniform vec4 color;
40 layout(location=0) out vec4 frag_color;
41 layout(location=0) in vec2 _vs_out_texcoord;
42 void main()
43 {
44   frag_color = color*vec4(texture(heightmap, _vs_out_texcoord).rrr, 1.0);
45 }
46 */