From c5d25c85093f089cc58c520785844fc021a09612 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Sun, 17 Aug 2008 14:06:47 -0700 Subject: r5xx: Add DDX and DDY instructions. Signed-off-by: Corbin Simpson --- src/mesa/drivers/dri/r300/radeon_program_pair.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/mesa/drivers/dri/r300/radeon_program_pair.c') 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) { -- cgit v1.2.3