summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/r300/radeon_program_pair.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/drivers/dri/r300/radeon_program_pair.c')
-rw-r--r--src/mesa/drivers/dri/r300/radeon_program_pair.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/r300/radeon_program_pair.c b/src/mesa/drivers/dri/r300/radeon_program_pair.c
index 4307994d74..5ad50d2863 100644
--- a/src/mesa/drivers/dri/r300/radeon_program_pair.c
+++ b/src/mesa/drivers/dri/r300/radeon_program_pair.c
@@ -305,6 +305,8 @@ static void classify_instruction(struct pair_state *s,
switch(inst->Opcode) {
case OPCODE_ADD:
case OPCODE_CMP:
+ case OPCODE_DDX:
+ case OPCODE_DDY:
case OPCODE_FRC:
case OPCODE_MAD:
case OPCODE_MAX:
@@ -673,8 +675,6 @@ static int alloc_pair_source(struct pair_state *s, struct radeon_pair_instructio
return candidate;
}
-
-
/**
* Fill the given ALU instruction's opcodes and source operands into the given pair,
* if possible.
@@ -704,6 +704,14 @@ static GLboolean fill_instruction_into_pair(struct pair_state *s, struct radeon_
int nargs = _mesa_num_inst_src_regs(inst->Opcode);
int i;
+ /* Special case for DDX/DDY (MDH/MDV). */
+ if (inst->Opcode == OPCODE_DDX || inst->Opcode == OPCODE_DDY) {
+ if (pair->RGB.Src[0].Used || pair->Alpha.Src[0].Used)
+ return GL_FALSE;
+ else
+ nargs++;
+ }
+
for(i = 0; i < nargs; ++i) {
int source;
if (pairinst->NeedRGB && !pairinst->IsTranscendent) {