[Mesa-dev] [PATCH 13/13] r600g: fix shadow samplers with rectangle textures

Marek Olšák maraeo at gmail.com
Mon Sep 5 14:44:15 PDT 2011


---
 src/gallium/drivers/r600/r600_shader.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c
index b7dbb92..09b26fa 100644
--- a/src/gallium/drivers/r600/r600_shader.c
+++ b/src/gallium/drivers/r600/r600_shader.c
@@ -2112,6 +2112,7 @@ static int tgsi_tex(struct r600_shader_ctx *ctx)
 	opcode = ctx->inst_info->r600_opcode;
 	if (inst->Texture.Texture == TGSI_TEXTURE_SHADOW1D ||
 	    inst->Texture.Texture == TGSI_TEXTURE_SHADOW2D ||
+	    inst->Texture.Texture == TGSI_TEXTURE_SHADOWRECT ||
 	    inst->Texture.Texture == TGSI_TEXTURE_SHADOW1D_ARRAY ||
 	    inst->Texture.Texture == TGSI_TEXTURE_SHADOW2D_ARRAY) {
 		switch (opcode) {
@@ -2161,18 +2162,20 @@ static int tgsi_tex(struct r600_shader_ctx *ctx)
 		tex.src_sel_w = 1;
 	}
 
-	if (inst->Texture.Texture != TGSI_TEXTURE_RECT) {
+	if (inst->Texture.Texture != TGSI_TEXTURE_RECT &&
+	    inst->Texture.Texture != TGSI_TEXTURE_SHADOWRECT) {
 		tex.coord_type_x = 1;
 		tex.coord_type_y = 1;
-		tex.coord_type_z = 1;
-		tex.coord_type_w = 1;
 	}
+	tex.coord_type_z = 1;
+	tex.coord_type_w = 1;
 
 	/* Put the depth for comparison in W.
 	 * TGSI_TEXTURE_SHADOW2D_ARRAY already has the depth in W.
 	 * Some instructions expect the depth in Z. */
 	if ((inst->Texture.Texture == TGSI_TEXTURE_SHADOW1D ||
 	     inst->Texture.Texture == TGSI_TEXTURE_SHADOW2D ||
+	     inst->Texture.Texture == TGSI_TEXTURE_SHADOWRECT ||
 	     inst->Texture.Texture == TGSI_TEXTURE_SHADOW1D_ARRAY) &&
 	    opcode != SQ_TEX_INST_SAMPLE_C_L &&
 	    opcode != SQ_TEX_INST_SAMPLE_C_LB) {
-- 
1.7.4.1



More information about the mesa-dev mailing list