aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/r300
diff options
context:
space:
mode:
authorTom Stellard <[email protected]>2011-03-18 11:06:47 -0700
committerTom Stellard <[email protected]>2011-03-18 12:04:20 -0700
commit9d2ef284bb3ec419b8f53f56bff7f6dd5492ee4c (patch)
treee4e4a09b04d6c2f652389dc77f885dfc4dd6603d /src/mesa/drivers/dri/r300
parent8042d751debb7a8375e8bc587189fea9a5a8371d (diff)
r300/compiler: Use a 4-bit writemask in pair instructions
We now use a 4-bit writemask for all instruction types, which makes it easier to write generic helper functions to manipulte writemasks. NOTE: This is a candidate for the 7.10 branch.
Diffstat (limited to 'src/mesa/drivers/dri/r300')
-rw-r--r--src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c3
-rw-r--r--src/mesa/drivers/dri/r300/compiler/radeon_pair_translate.c2
-rw-r--r--src/mesa/drivers/dri/r300/compiler/radeon_program_pair.h2
3 files changed, 4 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c b/src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c
index 301b4446693..2f8d6e4d04b 100644
--- a/src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c
+++ b/src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c
@@ -259,7 +259,8 @@ static void emit_paired(struct r300_fragment_program_compiler *c, struct rc_pair
}
code->inst[ip].inst0 |= R500_INST_TEX_SEM_WAIT;
- code->inst[ip].inst0 |= (inst->RGB.WriteMask << 11) | (inst->Alpha.WriteMask << 14);
+ code->inst[ip].inst0 |= (inst->RGB.WriteMask << 11);
+ code->inst[ip].inst0 |= inst->Alpha.WriteMask ? 1 << 14 : 0;
code->inst[ip].inst0 |= (inst->RGB.OutputWriteMask << 15) | (inst->Alpha.OutputWriteMask << 18);
if (inst->Nop) {
code->inst[ip].inst0 |= R500_INST_NOP;
diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_pair_translate.c b/src/mesa/drivers/dri/r300/compiler/radeon_pair_translate.c
index 9e03eb1aca8..fed3a3f7642 100644
--- a/src/mesa/drivers/dri/r300/compiler/radeon_pair_translate.c
+++ b/src/mesa/drivers/dri/r300/compiler/radeon_pair_translate.c
@@ -289,7 +289,7 @@ static void set_pair_instruction(struct r300_fragment_program_compiler *c,
}
if (needalpha) {
- pair->Alpha.WriteMask |= GET_BIT(inst->DstReg.WriteMask, 3);
+ pair->Alpha.WriteMask |= (GET_BIT(inst->DstReg.WriteMask, 3) << 3);
if (pair->Alpha.WriteMask) {
pair->Alpha.DestIndex = inst->DstReg.Index;
}
diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_program_pair.h b/src/mesa/drivers/dri/r300/compiler/radeon_program_pair.h
index 6708b16d29a..d1a435fc530 100644
--- a/src/mesa/drivers/dri/r300/compiler/radeon_program_pair.h
+++ b/src/mesa/drivers/dri/r300/compiler/radeon_program_pair.h
@@ -71,7 +71,7 @@ struct rc_pair_instruction_arg {
struct rc_pair_sub_instruction {
unsigned int Opcode:8;
unsigned int DestIndex:RC_REGISTER_INDEX_BITS;
- unsigned int WriteMask:3;
+ unsigned int WriteMask:4;
unsigned int Target:2;
unsigned int OutputWriteMask:3;
unsigned int DepthWriteMask:1;