summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorChris Forbes <[email protected]>2013-07-24 07:21:22 +1200
committerChris Forbes <[email protected]>2013-07-27 06:34:29 +1200
commit124f567f1d575eaea98a6ae1d0a4687b8fb5bba2 (patch)
tree3aefea5238d53081d9b2fcfd834720177f7bb643 /src/mesa
parent81a156d099b5c224d4a528b66a80e25626ed65bc (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 <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp2
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 3eb43a87750..1d86b33e8e8 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
@@ -2506,7 +2506,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)) {