summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/r300/radeon_program_pair.c
diff options
context:
space:
mode:
authorCorbin Simpson <MostAwesomeDude@gmail.com>2008-08-17 14:06:47 -0700
committerCorbin Simpson <MostAwesomeDude@gmail.com>2008-08-17 22:36:17 -0700
commitc5d25c85093f089cc58c520785844fc021a09612 (patch)
tree24c6fcf35f15820096b7b25b26417bdc93f17435 /src/mesa/drivers/dri/r300/radeon_program_pair.c
parentb7ff70e16a5bd468c76b75c2b557897a827fae73 (diff)
r5xx: Add DDX and DDY instructions.
Signed-off-by: Corbin Simpson <MostAwesomeDude@gmail.com>
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) {