summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2009-02-23 17:43:43 -0700
committerBrian Paul <brianp@vmware.com>2009-02-23 17:43:43 -0700
commit00f0b05d5f14256213f744c3b8e4ce82611e0ba1 (patch)
tree2a43fc26587c876fcd4df1477574213d379d2a94 /src
parentf24ec991906e04ea6dc4f950b1f49dfda95f3f18 (diff)
glsl: yet another swizzled expression fix
This fixes swizzled conditional expressions such "(b ? p : q).x"
Diffstat (limited to 'src')
-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 adb3bde9c4..6a47585c7a 100644
--- a/src/mesa/shader/slang/slang_emit.c
+++ b/src/mesa/shader/slang/slang_emit.c
@@ -1857,8 +1857,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;