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