summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2010-08-27 12:00:29 -0700
committerEric Anholt <[email protected]>2010-08-27 12:02:15 -0700
commit0435cb348aaa8f2d8163a38517a098e27a81adef (patch)
tree95d36def29660f282b7864fc165073c1b9863993 /src
parent83e3a2d97095d0ef062f210673eb23031fe1cb9a (diff)
i965: Fix swizzling in vector splitting for the new FS backend.
We weren't smearing a component of a split RHS out to reach an unsplit LHS's writemask, so gl_FragColor (always unsplit) would often get uninitialized values. Fixes: glsl-algebraic-add-add-1 (and probably many others).
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp b/src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp
index d4da86b3b06..00d5c202485 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_vector_splitting.cpp
@@ -281,6 +281,9 @@ ir_vector_splitting_visitor::visit_leave(ir_assignment *ir)
if (rhs) {
new_rhs = new(mem_ctx) ir_dereference_variable(rhs->components[i]);
+ /* If we're writing into a writemask, smear it out to that channel. */
+ if (!lhs)
+ new_rhs = new(mem_ctx) ir_swizzle(new_rhs, i, i, i, i, i + 1);
} else {
new_rhs = new(mem_ctx) ir_swizzle(ir->rhs->clone(mem_ctx, NULL),
i, i, i, i, 1);