Mesa (master): nvfx: fix nv30 vertex program scalar opcodes

Luca Barbieri lb at kemper.freedesktop.org
Thu Aug 5 16:28:53 PDT 2010


Module: Mesa
Branch: master
Commit: bf5ee5aa4f065b6e17a4cc9cd2e539c4290ff98c
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=bf5ee5aa4f065b6e17a4cc9cd2e539c4290ff98c

Author: Luca Barbieri <luca at luca-barbieri.com>
Date:   Fri Aug  6 00:58:48 2010 +0200

nvfx: fix nv30 vertex program scalar opcodes

Apparently they have always been broken, even before unification.

Fixes a lot of stuff, starting from morph3d and lighting in teapot
with textures disabled.

---

 src/gallium/drivers/nvfx/nvfx_vertprog.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/src/gallium/drivers/nvfx/nvfx_vertprog.c b/src/gallium/drivers/nvfx/nvfx_vertprog.c
index 80b98b6..24d9846 100644
--- a/src/gallium/drivers/nvfx/nvfx_vertprog.c
+++ b/src/gallium/drivers/nvfx/nvfx_vertprog.c
@@ -299,7 +299,13 @@ nvfx_vp_arith(struct nvfx_context* nvfx, struct nvfx_vpc *vpc, int slot, int op,
 		  (3 << NVFX_VP(INST_COND_SWZ_W_SHIFT)));
 
 	if(!nvfx->is_nv4x) {
-		hw[1] |= (op << NV30_VP_INST_VEC_OPCODE_SHIFT);
+		if(slot == 0)
+			hw[1] |= (op << NV30_VP_INST_VEC_OPCODE_SHIFT);
+		else
+		{
+			hw[0] |= ((op >> 4) << NV30_VP_INST_SCA_OPCODEH_SHIFT);
+			hw[1] |= ((op & 0xf) << NV30_VP_INST_SCA_OPCODEL_SHIFT);
+		}
 //		hw[3] |= NVFX_VP(INST_SCA_DEST_TEMP_MASK);
 //		hw[3] |= (mask << NVFX_VP(INST_VEC_WRITEMASK_SHIFT));
 



More information about the mesa-commit mailing list