From: Dave Airlie Date: Wed, 19 Apr 2006 23:15:51 +0000 (+0000) Subject: SrcReg->Swizzle is always initialized to SWIZZLE_NOOP, and if the program X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b5d76b68588c3be2a6b73f80e41a169716463644;p=mesa.git SrcReg->Swizzle is always initialized to SWIZZLE_NOOP, and if the program specifies a 2/3/4-compontent swizzle suffix, SrcReg->Swizzles is just ORed against the new component values, without resetting it first. Attached patch makes tests/vptest2 pass. From Tilam Sauerbeck bug 6673 --- diff --git a/src/mesa/shader/nvvertparse.c b/src/mesa/shader/nvvertparse.c index 71d5116b3ef..a7e062c61cb 100644 --- a/src/mesa/shader/nvvertparse.c +++ b/src/mesa/shader/nvvertparse.c @@ -699,6 +699,9 @@ Parse_SwizzleSrcReg(struct parse_state *parseState, struct prog_src_register *sr else { /* 2, 3 or 4-component swizzle */ GLint k; + + srcReg->Swizzle = 0; + for (k = 0; token[k] && k < 5; k++) { if (token[k] == 'x') srcReg->Swizzle |= 0 << (k*3);