Module: Mesa Branch: gallium-mesa-7.4 Commit: d5c06bb81248cd652dcbacf2460d72d263a584b5 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=d5c06bb81248cd652dcbacf2460d72d263a584b5
Author: Brian Paul <[email protected]> Date: Tue Feb 24 08:32:01 2009 -0700 glsl: yet another swizzled expression fix This fixes swizzled conditional expressions such "(b ? p : q).x" (cherry picked from master, commit 00f0b05d5f14256213f744c3b8e4ce82611e0ba1) --- src/mesa/shader/slang/slang_emit.c | 7 +++++-- 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 db78dbe..80ccc79 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; _______________________________________________ mesa-commit mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/mesa-commit
