From 7b1e95a0515f50b74886cba05db0518b1864d179 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sun, 7 Mar 2021 18:32:04 +0200 Subject: [PATCH] Add another variation of a partially unused interface block I discovered a case where the compiler behaves incorrectly so recording it here. --- .../partially_unused_interface_block.glsl | 25 ++++++++++++++++--- 1 file changed, 21 insertions(+), 4 deletions(-) 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; } */ -- 2.45.2