From: Corbin Simpson Date: Mon, 18 May 2009 04:40:16 +0000 (-0700) Subject: r300-gallium: r500-fs: DDX and DDY support. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9569221563fd0e9fba564126d61bf3786cf74715;p=mesa.git r300-gallium: r500-fs: DDX and DDY support. Oh, look, GLSL instructions. I wonder what I'll do next. --- diff --git a/src/gallium/drivers/r300/r300_state_shader.c b/src/gallium/drivers/r300/r300_state_shader.c index 0871aed2b48..ed99c76c158 100644 --- a/src/gallium/drivers/r300/r300_state_shader.c +++ b/src/gallium/drivers/r300/r300_state_shader.c @@ -215,6 +215,10 @@ static INLINE uint32_t r500_rgba_op(unsigned op) case TGSI_OPCODE_RSQ: case TGSI_OPCODE_SIN: return R500_ALU_RGBA_OP_SOP; + case TGSI_OPCODE_DDX: + return R500_ALU_RGBA_OP_MDH; + case TGSI_OPCODE_DDY: + return R500_ALU_RGBA_OP_MDV; case TGSI_OPCODE_FRC: return R500_ALU_RGBA_OP_FRC; case TGSI_OPCODE_DP3: @@ -254,6 +258,10 @@ static INLINE uint32_t r500_alpha_op(unsigned op) return R500_ALPHA_OP_FRC; case TGSI_OPCODE_SIN: return R500_ALPHA_OP_SIN; + case TGSI_OPCODE_DDX: + return R500_ALPHA_OP_MDH; + case TGSI_OPCODE_DDY: + return R500_ALPHA_OP_MDV; case TGSI_OPCODE_DP3: case TGSI_OPCODE_DP4: case TGSI_OPCODE_DPH: @@ -480,6 +488,8 @@ static void r500_fs_instruction(struct r500_fragment_shader* fs, inst->FullSrcRegisters[0].SrcRegister.SwizzleW = inst->FullSrcRegisters[0].SrcRegister.SwizzleX; /* Fall through */ + case TGSI_OPCODE_DDX: + case TGSI_OPCODE_DDY: case TGSI_OPCODE_FRC: r500_emit_maths(fs, assembler, inst->FullSrcRegisters, &inst->FullDstRegisters[0], inst->Instruction.Opcode, 1);