Mesa (gallium-0.2): nv50: fill image unit index in TEX varients

Ben Skeggs darktama at kemper.freedesktop.org
Mon Jan 5 22:05:49 UTC 2009


Module: Mesa
Branch: gallium-0.2
Commit: cd5d3fde13e424373feac9098453ed0ca7f6e4eb
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=cd5d3fde13e424373feac9098453ed0ca7f6e4eb

Author: Ben Skeggs <skeggsb at gmail.com>
Date:   Mon Jan  5 16:04:41 2009 +1100

nv50: fill image unit index in TEX varients

---

 src/gallium/drivers/nv50/nv50_program.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/nv50/nv50_program.c b/src/gallium/drivers/nv50/nv50_program.c
index 8414d06..d66e1d0 100644
--- a/src/gallium/drivers/nv50/nv50_program.c
+++ b/src/gallium/drivers/nv50/nv50_program.c
@@ -934,7 +934,7 @@ nv50_program_tx_insn(struct nv50_pc *pc, const union tgsi_full_token *tok)
 {
 	const struct tgsi_full_instruction *inst = &tok->FullInstruction;
 	struct nv50_reg *rdst[4], *dst[4], *src[3][4], *temp;
-	unsigned mask, sat;
+	unsigned mask, sat, unit;
 	int i, c;
 
 	mask = inst->FullDstRegisters[0].DstRegister.WriteMask;
@@ -948,8 +948,13 @@ nv50_program_tx_insn(struct nv50_pc *pc, const union tgsi_full_token *tok)
 	}
 
 	for (i = 0; i < inst->Instruction.NumSrcRegs; i++) {
+		struct tgsi_full_src_register *fs = &inst->FullSrcRegisters[i];
+
+		if (fs->SrcRegister.File == TGSI_FILE_SAMPLER)
+			unit = fs->SrcRegister.Index;
+
 		for (c = 0; c < 4; c++)
-			src[i][c] = tgsi_src(pc, c, &inst->FullSrcRegisters[i]);
+			src[i][c] = tgsi_src(pc, c, fs);
 	}
 
 	if (sat) {
@@ -1198,6 +1203,7 @@ nv50_program_tx_insn(struct nv50_pc *pc, const union tgsi_full_token *tok)
 
 		e = exec(pc);
 		e->inst[0] = 0xf6400000;
+		e->inst[0] |= (unit << 9);
 		set_long(pc, e);
 		e->inst[1] |= 0x0000c004;
 		set_dst(pc, t[0], e);




More information about the mesa-commit mailing list