Commit 124f567f authored by Chris Forbes's avatar Chris Forbes

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: default avatarChris Forbes <chrisf@ijw.co.nz>
Reviewed-by: default avatarIan Romanick <ian.d.romanick@intel.com>
Reviewed-by: default avatarKenneth Graunke <kenneth@whitecape.org>
parent 81a156d0
......@@ -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)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment