summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2009-02-24 08:32:01 -0700
committerBrian Paul <[email protected]>2009-02-24 08:32:01 -0700
commitd5c06bb81248cd652dcbacf2460d72d263a584b5 (patch)
treeb3f0e98c44587d067a6e295ae36ec39d0508f9e5
parent9d5aa36239a691474c51f042a678549e2c31e2b7 (diff)
glsl: yet another swizzled expression fix
This fixes swizzled conditional expressions such "(b ? p : q).x" (cherry picked from master, commit 00f0b05d5f14256213f744c3b8e4ce82611e0ba1)
-rw-r--r--src/mesa/shader/slang/slang_emit.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/mesa/shader/slang/slang_emit.c b/src/mesa/shader/slang/slang_emit.c
index db78dbeef6b..80ccc79eb9b 100644
--- a/src/mesa/shader/slang/slang_emit.c
+++ b/src/mesa/shader/slang/slang_emit.c
@@ -1838,8 +1838,11 @@ emit_swizzle(slang_emit_info *emitInfo, slang_ir_node *n)
inst = emit(emitInfo, n->Children[0]);
- assert(n->Children[0]->Store == n->Store->Parent);
- assert(n->Store->Parent);
+ if (!n->Store->Parent) {
+ /* this covers a case such as "(b ? p : q).x" */
+ n->Store->Parent = n->Children[0]->Store;
+ assert(n->Store->Parent);
+ }
{
const GLuint swizzle = n->Store->Swizzle;