From f1d04cd76681a3b8d37bc1a06b7ab36350087135 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Sat, 24 May 2008 11:30:57 -0700 Subject: [PATCH] r5xx: Consolidate FP tex insts. They're all the same, really. --- src/mesa/drivers/dri/r300/r500_fragprog.c | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r500_fragprog.c b/src/mesa/drivers/dri/r300/r500_fragprog.c index 5dc674c5779..482f9d55e77 100644 --- a/src/mesa/drivers/dri/r300/r500_fragprog.c +++ b/src/mesa/drivers/dri/r300/r500_fragprog.c @@ -237,7 +237,7 @@ static GLuint make_dest(struct r500_fragment_program *fp, struct prog_dst_regist } static void emit_tex(struct r500_fragment_program *fp, - struct prog_instruction *fpi, int opcode, int dest, int counter) + struct prog_instruction *fpi, int dest, int counter) { int hwsrc, hwdest; GLuint mask; @@ -260,7 +260,7 @@ static void emit_tex(struct r500_fragment_program *fp, if (fpi->TexSrcTarget == TEXTURE_RECT_INDEX) fp->inst[counter].inst1 |= R500_TEX_UNSCALED; - switch (opcode) { + switch (fpi->Opcode) { case OPCODE_KIL: fp->inst[counter].inst1 |= R500_TEX_INST_TEXKILL; break; @@ -274,7 +274,7 @@ static void emit_tex(struct r500_fragment_program *fp, fp->inst[counter].inst1 |= R500_TEX_INST_PROJ; break; default: - ERROR("emit_tex can't handle opcode %x\n", opcode); + ERROR("emit_tex can't handle opcode %x\n", fpi->Opcode); } fp->inst[counter].inst2 = R500_TEX_SRC_ADDR(hwsrc) @@ -579,9 +579,6 @@ static GLboolean parse_program(struct r500_fragment_program *fp) fp->inst[counter].inst5 = R500_ALU_RGBA_OP_FRC | R500_ALU_RGBA_ADDRD(dest); break; - case OPCODE_KIL: - emit_tex(fp, fpi, OPCODE_KIL, dest, counter); - break; case OPCODE_LG2: src[0] = make_src(fp, fpi->SrcReg[0]); emit_alu(fp, counter, fpi); @@ -1017,18 +1014,11 @@ static GLboolean parse_program(struct r500_fragment_program *fp) emit_alu(fp, counter, fpi); emit_mov(fp, counter, fpi->SrcReg[0], dest); break; + case OPCODE_KIL: case OPCODE_TEX: - emit_tex(fp, fpi, OPCODE_TEX, dest, counter); - if (fpi->DstReg.File == PROGRAM_OUTPUT) - counter++; - break; case OPCODE_TXB: - emit_tex(fp, fpi, OPCODE_TXB, dest, counter); - if (fpi->DstReg.File == PROGRAM_OUTPUT) - counter++; - break; case OPCODE_TXP: - emit_tex(fp, fpi, OPCODE_TXP, dest, counter); + emit_tex(fp, fpi, dest, counter); if (fpi->DstReg.File == PROGRAM_OUTPUT) counter++; break; -- 2.30.2