diff options
author | Maciej Cencora <m.cencora@gmail.com> | 2009-07-11 15:09:20 +0200 |
---|---|---|
committer | Maciej Cencora <m.cencora@gmail.com> | 2009-07-13 19:28:13 +0200 |
commit | 4eff323731b0d65e1f2817e96435807418d833cc (patch) | |
tree | 751c6d0402adaa8104a11e9769ddd26a1592d534 | |
parent | 4efb9f053c84fbdced373cc62fe06b3158b59015 (diff) | |
download | external_mesa3d-4eff323731b0d65e1f2817e96435807418d833cc.zip external_mesa3d-4eff323731b0d65e1f2817e96435807418d833cc.tar.gz external_mesa3d-4eff323731b0d65e1f2817e96435807418d833cc.tar.bz2 |
r300: hw can handle per component negations in vertex shaders
Reported-by: Nicolai Haehnle <nhaehnle@gmail.com>
-rw-r--r-- | src/mesa/drivers/dri/r300/r300_vertprog.c | 27 |
1 files changed, 2 insertions, 25 deletions
diff --git a/src/mesa/drivers/dri/r300/r300_vertprog.c b/src/mesa/drivers/dri/r300/r300_vertprog.c index fb94eea..ea8d25d 100644 --- a/src/mesa/drivers/dri/r300/r300_vertprog.c +++ b/src/mesa/drivers/dri/r300/r300_vertprog.c @@ -1388,32 +1388,9 @@ static int translateSUB(struct gl_program *prog, int pos) static int translateSWZ(struct gl_program *prog, int pos) { - struct prog_instruction *inst; - GLuint orig_negate, orig_writemask; - - inst = &prog->Instructions[pos]; - orig_negate = inst->SrcReg[0].Negate; - orig_writemask = inst->DstReg.WriteMask; - - inst->Opcode = OPCODE_MOV; + prog->Instructions[pos].Opcode = OPCODE_MOV; - /* If all relevant components are either negated or not negated at the same time, we are ok. - */ - if ((orig_negate & orig_writemask) == 0 || (orig_negate & orig_writemask) == (NEGATE_XYZW & orig_writemask)) - return 0; - - _mesa_insert_instructions(prog, pos + 1, 1); - - inst = &prog->Instructions[pos]; - inst->DstReg.WriteMask = orig_writemask & (orig_negate ^ NEGATE_XYZW); - inst->SrcReg[0].Negate = NEGATE_NONE; - ++inst; - - *inst = *(inst-1); - inst->DstReg.WriteMask = orig_writemask & orig_negate; - inst->SrcReg[0].Negate = NEGATE_XYZW; - - return 1; + return 0; } static int translateXPD(struct gl_program *prog, int pos) |