Mesa (master): gallium: try and update r300 and nv drivers for tgsi changes

Keith Whitwell keithw at kemper.freedesktop.org
Tue Dec 1 06:43:34 PST 2009


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

Author: Keith Whitwell <keithw at vmware.com>
Date:   Tue Nov 24 14:09:24 2009 +0000

gallium: try and update r300 and nv drivers for tgsi changes

It would be nice if these drivers built under the linux-debug header
so that these types of interface changes can be minimally propogated
into those drivers by people without the hardware.  They don't have to
generate a working driver -- though a command-dumping winsys would be
an excellent for regression checking.

---

 src/gallium/drivers/i915/i915_fpc_translate.c  |    5 ++---
 src/gallium/drivers/llvmpipe/lp_bld_tgsi_soa.c |    2 +-
 src/gallium/drivers/nv20/nv20_vertprog.c       |    2 +-
 src/gallium/drivers/nv30/nv30_fragprog.c       |    2 +-
 src/gallium/drivers/nv30/nv30_vertprog.c       |    2 +-
 src/gallium/drivers/nv40/nv40_fragprog.c       |    2 +-
 src/gallium/drivers/nv40/nv40_vertprog.c       |    2 +-
 src/gallium/drivers/nv50/nv50_program.c        |   10 +++++-----
 src/gallium/drivers/r300/r300_tgsi_to_rc.c     |    7 ++++---
 9 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/src/gallium/drivers/i915/i915_fpc_translate.c b/src/gallium/drivers/i915/i915_fpc_translate.c
index a96ba8f..f255499 100644
--- a/src/gallium/drivers/i915/i915_fpc_translate.c
+++ b/src/gallium/drivers/i915/i915_fpc_translate.c
@@ -229,12 +229,11 @@ src_vector(struct i915_fp_compile *p,
       src = negate(src, n, n, n, n);
    }
 
-   /* no abs() or post-abs negation */
+   /* no abs() */
 #if 0
    /* XXX assertions disabled to allow arbfplight.c to run */
    /* XXX enable these assertions, or fix things */
-   assert(!source->SrcRegisterExtMod.Absolute);
-   assert(!source->SrcRegisterExtMod.Negate);
+   assert(!source->SrcRegister.Absolute);
 #endif
    return src;
 }
diff --git a/src/gallium/drivers/llvmpipe/lp_bld_tgsi_soa.c b/src/gallium/drivers/llvmpipe/lp_bld_tgsi_soa.c
index 64027de..b2234ef 100644
--- a/src/gallium/drivers/llvmpipe/lp_bld_tgsi_soa.c
+++ b/src/gallium/drivers/llvmpipe/lp_bld_tgsi_soa.c
@@ -326,7 +326,7 @@ emit_tex( struct lp_build_tgsi_soa_context *bld,
    unsigned num_coords;
    unsigned i;
 
-   switch (inst->InstructionExtTexture.Texture) {
+   switch (inst->InstructionTexture.Texture) {
    case TGSI_TEXTURE_1D:
       num_coords = 1;
       break;
diff --git a/src/gallium/drivers/nv20/nv20_vertprog.c b/src/gallium/drivers/nv20/nv20_vertprog.c
index 388245e..48df356 100644
--- a/src/gallium/drivers/nv20/nv20_vertprog.c
+++ b/src/gallium/drivers/nv20/nv20_vertprog.c
@@ -273,7 +273,7 @@ tgsi_src(struct nv20_vpc *vpc, const struct tgsi_full_src_register *fsrc) {
 		break;
 	}
 
-	src.abs = fsrc->SrcRegisterExtMod.Absolute;
+	src.abs = fsrc->SrcRegister.Absolute;
 	src.negate = fsrc->SrcRegister.Negate;
 	src.swz[0] = fsrc->SrcRegister.SwizzleX;
 	src.swz[1] = fsrc->SrcRegister.SwizzleY;
diff --git a/src/gallium/drivers/nv30/nv30_fragprog.c b/src/gallium/drivers/nv30/nv30_fragprog.c
index 0ce702d..eb978b6 100644
--- a/src/gallium/drivers/nv30/nv30_fragprog.c
+++ b/src/gallium/drivers/nv30/nv30_fragprog.c
@@ -268,7 +268,7 @@ tgsi_src(struct nv30_fpc *fpc, const struct tgsi_full_src_register *fsrc)
 		break;
 	}
 
-	src.abs = fsrc->SrcRegisterExtMod.Absolute;
+	src.abs = fsrc->SrcRegister.Absolute;
 	src.negate = fsrc->SrcRegister.Negate;
 	src.swz[0] = fsrc->SrcRegister.SwizzleX;
 	src.swz[1] = fsrc->SrcRegister.SwizzleY;
diff --git a/src/gallium/drivers/nv30/nv30_vertprog.c b/src/gallium/drivers/nv30/nv30_vertprog.c
index 14a5c02..b04fb22 100644
--- a/src/gallium/drivers/nv30/nv30_vertprog.c
+++ b/src/gallium/drivers/nv30/nv30_vertprog.c
@@ -273,7 +273,7 @@ tgsi_src(struct nv30_vpc *vpc, const struct tgsi_full_src_register *fsrc) {
 		break;
 	}
 
-	src.abs = fsrc->SrcRegisterExtMod.Absolute;
+	src.abs = fsrc->SrcRegister.Absolute;
 	src.negate = fsrc->SrcRegister.Negate;
 	src.swz[0] = fsrc->SrcRegister.SwizzleX;
 	src.swz[1] = fsrc->SrcRegister.SwizzleY;
diff --git a/src/gallium/drivers/nv40/nv40_fragprog.c b/src/gallium/drivers/nv40/nv40_fragprog.c
index 9927750..dbbb736 100644
--- a/src/gallium/drivers/nv40/nv40_fragprog.c
+++ b/src/gallium/drivers/nv40/nv40_fragprog.c
@@ -279,7 +279,7 @@ tgsi_src(struct nv40_fpc *fpc, const struct tgsi_full_src_register *fsrc)
 		break;
 	}
 
-	src.abs = fsrc->SrcRegisterExtMod.Absolute;
+	src.abs = fsrc->SrcRegister.Absolute;
 	src.negate = fsrc->SrcRegister.Negate;
 	src.swz[0] = fsrc->SrcRegister.SwizzleX;
 	src.swz[1] = fsrc->SrcRegister.SwizzleY;
diff --git a/src/gallium/drivers/nv40/nv40_vertprog.c b/src/gallium/drivers/nv40/nv40_vertprog.c
index 31dae24..df9cb22 100644
--- a/src/gallium/drivers/nv40/nv40_vertprog.c
+++ b/src/gallium/drivers/nv40/nv40_vertprog.c
@@ -313,7 +313,7 @@ tgsi_src(struct nv40_vpc *vpc, const struct tgsi_full_src_register *fsrc) {
 		break;
 	}
 
-	src.abs = fsrc->SrcRegisterExtMod.Absolute;
+	src.abs = fsrc->SrcRegister.Absolute;
 	src.negate = fsrc->SrcRegister.Negate;
 	src.swz[0] = fsrc->SrcRegister.SwizzleX;
 	src.swz[1] = fsrc->SrcRegister.SwizzleY;
diff --git a/src/gallium/drivers/nv50/nv50_program.c b/src/gallium/drivers/nv50/nv50_program.c
index bf50982..e40e37d 100644
--- a/src/gallium/drivers/nv50/nv50_program.c
+++ b/src/gallium/drivers/nv50/nv50_program.c
@@ -1575,10 +1575,10 @@ nv50_tgsi_src_mask(const struct tgsi_full_instruction *insn, int c)
 	case TGSI_OPCODE_TEX:
 	case TGSI_OPCODE_TXP:
 	{
-		const struct tgsi_instruction_ext_texture *tex;
+		const struct tgsi_instruction_texture *tex;
 
-		assert(insn->Instruction.Extended);
-		tex = &insn->InstructionExtTexture;
+		assert(insn->Instruction.Texture);
+		tex = &insn->InstructionTexture;
 
 		mask = 0x7;
 		if (insn->Instruction.Opcode == TGSI_OPCODE_TXP)
@@ -2181,11 +2181,11 @@ nv50_program_tx_insn(struct nv50_pc *pc,
 		break;
 	case TGSI_OPCODE_TEX:
 		emit_tex(pc, dst, mask, src[0], unit,
-			 inst->InstructionExtTexture.Texture, FALSE);
+			 inst->InstructionTexture.Texture, FALSE);
 		break;
 	case TGSI_OPCODE_TXP:
 		emit_tex(pc, dst, mask, src[0], unit,
-			 inst->InstructionExtTexture.Texture, TRUE);
+			 inst->InstructionTexture.Texture, TRUE);
 		break;
 	case TGSI_OPCODE_TRUNC:
 		for (c = 0; c < 4; c++) {
diff --git a/src/gallium/drivers/r300/r300_tgsi_to_rc.c b/src/gallium/drivers/r300/r300_tgsi_to_rc.c
index 589f198..25a634e 100644
--- a/src/gallium/drivers/r300/r300_tgsi_to_rc.c
+++ b/src/gallium/drivers/r300/r300_tgsi_to_rc.c
@@ -208,11 +208,11 @@ static void transform_srcreg(
     dst->Swizzle |= tgsi_util_get_full_src_register_swizzle(src, 1) << 3;
     dst->Swizzle |= tgsi_util_get_full_src_register_swizzle(src, 2) << 6;
     dst->Swizzle |= tgsi_util_get_full_src_register_swizzle(src, 3) << 9;
-    dst->Abs = src->SrcRegisterExtMod.Absolute;
+    dst->Abs = src->SrcRegister.Absolute;
     dst->Negate = src->SrcRegister.Negate ? RC_MASK_XYZW : 0;
 }
 
-static void transform_texture(struct rc_instruction * dst, struct tgsi_instruction_ext_texture src)
+static void transform_texture(struct rc_instruction * dst, struct tgsi_instruction_texture src)
 {
     switch(src.Texture) {
         case TGSI_TEXTURE_1D:
@@ -268,7 +268,8 @@ static void transform_instruction(struct tgsi_to_rc * ttr, struct tgsi_full_inst
     }
 
     /* Texturing. */
-    transform_texture(dst, src->InstructionExtTexture);
+    if (src->Instruction.Texture)
+       transform_texture(dst, src->InstructionTexture);
 }
 
 static void handle_immediate(struct tgsi_to_rc * ttr, struct tgsi_full_immediate * imm)



More information about the mesa-commit mailing list