From: Mikko Rasa Date: Sun, 7 Mar 2021 16:32:04 +0000 (+0200) Subject: Add another variation of a partially unused interface block X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=7b1e95a0515f50b74886cba05db0518b1864d179;p=libs%2Fgl.git Add another variation of a partially unused interface block I discovered a case where the compiler behaves incorrectly so recording it here. --- diff --git a/tests/glsl/partially_unused_interface_block.glsl b/tests/glsl/partially_unused_interface_block.glsl index 82b8b1da..240ddcfa 100644 --- a/tests/glsl/partially_unused_interface_block.glsl +++ b/tests/glsl/partially_unused_interface_block.glsl @@ -1,3 +1,9 @@ +uniform GlobalValues +{ + vec4 tint; + vec2 scale; +}; + #pragma MSP stage(vertex) layout(location=0) in vec4 position; layout(location=1) in vec4 color; @@ -8,7 +14,7 @@ out VertexOut } vs_out; void main() { - vs_out.texcoord = position.xy*0.5+0.5; + vs_out.texcoord = position.xy*scale*0.5+0.5; vs_out.color = color; gl_Position = position; } @@ -17,10 +23,16 @@ void main() layout(location=0) out vec4 frag_color; void main() { - frag_color = vs_out.color; + scale = vec2(1.0); + frag_color = vs_out.color*tint; } /* Expected output: vertex +uniform GlobalValues +{ + vec4 tint; + vec2 scale; +}; layout(location=0) in vec4 position; layout(location=1) in vec4 color; out VertexOut @@ -30,13 +42,18 @@ out VertexOut } vs_out; void main() { - vs_out.texcoord = position.xy*0.5+0.5; + vs_out.texcoord = position.xy*scale*0.5+0.5; vs_out.color = color; gl_Position = position; } */ /* Expected output: fragment +uniform GlobalValues +{ + vec4 tint; + vec2 scale; +}; layout(location=0) out vec4 frag_color; in VertexOut { @@ -45,6 +62,6 @@ in VertexOut } vs_out; void main() { - frag_color = vs_out.color; + frag_color = vs_out.color*tint; } */