From e7241a921407ae79e0767956127f7ed501c5eeb1 Mon Sep 17 00:00:00 2001 From: Tim Foley Date: Sun, 23 Jul 2017 19:52:14 -0700 Subject: Fixup for the glslang bug workaround There was a bug where the intialization expression for a variable was being lowered after the declaration was added to the output code, so that any sub-expressions that get hoisted out actually get computed *after* the original variable. This obviously led to downstream compilation failure. I've updated the test case to stress this scenario. --- tests/rewriter/glslang-bug-988-workaround.frag | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'tests/rewriter') diff --git a/tests/rewriter/glslang-bug-988-workaround.frag b/tests/rewriter/glslang-bug-988-workaround.frag index 8c9692aed..578b49236 100644 --- a/tests/rewriter/glslang-bug-988-workaround.frag +++ b/tests/rewriter/glslang-bug-988-workaround.frag @@ -25,7 +25,8 @@ out vec4 result; void main() { - result = doIt(foo); + vec4 r = doIt(foo); + result = r; } #else @@ -52,7 +53,8 @@ out vec4 result; void main() { Foo SLANG_tmp_0 = foo; - result = doIt(SLANG_tmp_0); + vec4 r = doIt(SLANG_tmp_0); + result = r; } #endif -- cgit v1.2.3