Mesa (master): r600g: fix TXD when shadowing is enabled.

Dave Airlie airlied at kemper.freedesktop.org
Wed Jun 15 05:55:30 UTC 2011


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

Author: Mike Kaplinskiy <mike.kaplinskiy at gmai.com>
Date:   Wed Jun 15 15:54:21 2011 +1000

r600g: fix TXD when shadowing is enabled.

Mike had actually done a lot of the TXD support in a patch in bug
37476 which I see now, I'll add the bits of his work that I didn't think
to add to my work.

Signed-off-by: Dave Airlie <airlied at redhat.com>

---

 src/gallium/drivers/r600/r600_shader.c |   16 +++++++++++++---
 src/gallium/drivers/r600/r600d.h       |    7 ++++---
 2 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c
index 9a0df23..4a08887 100644
--- a/src/gallium/drivers/r600/r600_shader.c
+++ b/src/gallium/drivers/r600/r600_shader.c
@@ -2001,9 +2001,19 @@ static int tgsi_tex(struct r600_shader_ctx *ctx)
 	}
 
 	opcode = ctx->inst_info->r600_opcode;
-	if (opcode == SQ_TEX_INST_SAMPLE &&
-	    (inst->Texture.Texture == TGSI_TEXTURE_SHADOW1D || inst->Texture.Texture == TGSI_TEXTURE_SHADOW2D))
-		opcode = SQ_TEX_INST_SAMPLE_C;
+	if (inst->Texture.Texture == TGSI_TEXTURE_SHADOW1D || inst->Texture.Texture == TGSI_TEXTURE_SHADOW2D) {
+		switch (opcode) {
+		case SQ_TEX_INST_SAMPLE:
+			opcode = SQ_TEX_INST_SAMPLE_C;
+			break;
+		case SQ_TEX_INST_SAMPLE_L:
+			opcode = SQ_TEX_INST_SAMPLE_C_L;
+			break;
+		case SQ_TEX_INST_SAMPLE_G:
+			opcode = SQ_TEX_INST_SAMPLE_C_G;
+			break;
+		}
+	}
 
 	memset(&tex, 0, sizeof(struct r600_bc_tex));
 	tex.inst = opcode;
diff --git a/src/gallium/drivers/r600/r600d.h b/src/gallium/drivers/r600/r600d.h
index 95672b1..6373572 100644
--- a/src/gallium/drivers/r600/r600d.h
+++ b/src/gallium/drivers/r600/r600d.h
@@ -3465,13 +3465,14 @@
 #define SQ_TEX_INST_LD 0x03
 #define SQ_TEX_INST_GET_GRADIENTS_H 0x7
 #define SQ_TEX_INST_GET_GRADIENTS_V 0x8
+#define SQ_TEX_INST_SET_GRADIENTS_H 0xB
+#define SQ_TEX_INST_SET_GRADIENTS_V 0xC
 
 #define SQ_TEX_INST_SAMPLE 0x10
 #define SQ_TEX_INST_SAMPLE_L 0x11
 #define SQ_TEX_INST_SAMPLE_G 0x14
 #define SQ_TEX_INST_SAMPLE_C 0x18
-
-#define SQ_TEX_INST_SET_GRADIENTS_H 0xB
-#define SQ_TEX_INST_SET_GRADIENTS_V 0xC
+#define SQ_TEX_INST_SAMPLE_C_L 0x19
+#define SQ_TEX_INST_SAMPLE_C_G 0x1C
 
 #endif




More information about the mesa-commit mailing list