summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r300/r300_state_shader.c
diff options
context:
space:
mode:
authorCorbin Simpson <[email protected]>2009-03-11 15:05:52 -0700
committerCorbin Simpson <[email protected]>2009-03-11 15:23:09 -0700
commitcec2170632a664da273c0e80ad1ead5cd43667a3 (patch)
tree6fe7bfc18d1b271dbd8085d6b4ef6666daa1c1ea /src/gallium/drivers/r300/r300_state_shader.c
parentc4c1774bbb08022846eefd14df683c7644f5e421 (diff)
r300-gallium: r500-fs: More texture fixes.
Diffstat (limited to 'src/gallium/drivers/r300/r300_state_shader.c')
-rw-r--r--src/gallium/drivers/r300/r300_state_shader.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/gallium/drivers/r300/r300_state_shader.c b/src/gallium/drivers/r300/r300_state_shader.c
index 7629bfb1f43..db84dbdc4ea 100644
--- a/src/gallium/drivers/r300/r300_state_shader.c
+++ b/src/gallium/drivers/r300/r300_state_shader.c
@@ -133,6 +133,14 @@ static uint32_t r500_rgba_swiz(struct tgsi_full_src_register* reg)
}
}
+static uint32_t r500_strq_swiz(struct tgsi_full_src_register* reg)
+{
+ return reg->SrcRegister.SwizzleX |
+ (reg->SrcRegister.SwizzleY << 2) |
+ (reg->SrcRegister.SwizzleZ << 4) |
+ (reg->SrcRegister.SwizzleW << 6);
+}
+
static INLINE uint32_t r500_rgb_swiz(struct tgsi_full_src_register* reg)
{
/* Only the first 9 bits... */
@@ -184,16 +192,19 @@ static INLINE void r500_emit_tex(struct r500_fragment_shader* fs,
int i = fs->instruction_count;
fs->instructions[i].inst0 = R500_INST_TYPE_TEX |
+ R500_TEX_WMASK(dst->DstRegister.WriteMask) |
R500_INST_TEX_SEM_WAIT;
fs->instructions[i].inst1 = R500_TEX_ID(0) |
R500_TEX_SEM_ACQUIRE | R500_TEX_IGNORE_UNCOVERED |
R500_TEX_INST_PROJ;
fs->instructions[i].inst2 =
R500_TEX_SRC_ADDR(r300_fs_src(assembler, &src->SrcRegister)) |
- R500_SWIZ_TEX_STRQ(r500_rgba_swiz(src)) |
+ R500_SWIZ_TEX_STRQ(r500_strq_swiz(src)) |
R500_TEX_DST_ADDR(r300_fs_dst(assembler, &dst->DstRegister)) |
R500_TEX_DST_R_SWIZ_R | R500_TEX_DST_G_SWIZ_G |
R500_TEX_DST_B_SWIZ_B | R500_TEX_DST_A_SWIZ_A;
+
+ fs->instruction_count++;
}
static void r500_fs_instruction(struct r500_fragment_shader* fs,