diff options
author | Chris Forbes <chrisf@ijw.co.nz> | 2013-07-24 07:21:22 +1200 |
---|---|---|
committer | Carl Worth <cworth@cworth.org> | 2013-07-30 12:45:36 -0700 |
commit | f437513bed58749b812f1f773631eca3c70ec673 (patch) | |
tree | 45e1dd253eddd384ea9c65baea3a0a4c33ed3d45 | |
parent | 6b6f29eb202c1e2f1a1b4fc3c4ac2456314842f1 (diff) |
i965/vs: Fix flaky texture swizzling
If any component used the ZERO or ONE swizzle, its corresponding member
in the `swizzle` array would never be initialized. We *mostly* got away
with this, except when that memory happened to contain a value that
clobbered another channel when combined using BRW_SWIZZLE4().
NOTE: This is a candidate for stable branches.
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 124f567f1d575eaea98a6ae1d0a4687b8fb5bba2)
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp index a0b5c8c1814..86f9a33a7d7 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp +++ b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp @@ -2285,7 +2285,7 @@ vec4_visitor::swizzle_result(ir_texture *ir, src_reg orig_val, int sampler) } int zero_mask = 0, one_mask = 0, copy_mask = 0; - int swizzle[4]; + int swizzle[4] = {0}; for (int i = 0; i < 4; i++) { switch (GET_SWZ(s, i)) { |