Mesa (master): r300-gallium: vs: Add MAD.

Corbin Simpson csimpson at kemper.freedesktop.org
Tue Apr 7 06:38:30 UTC 2009


Module: Mesa
Branch: master
Commit: 799f43f2e01be8b3143c44fbd45485220174febd
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=799f43f2e01be8b3143c44fbd45485220174febd

Author: Corbin Simpson <MostAwesomeDude at gmail.com>
Date:   Mon Apr  6 23:36:34 2009 -0700

r300-gallium: vs: Add MAD.

---

 src/gallium/drivers/r300/r300_state_tcl.c |    7 +++++++
 src/gallium/drivers/r300/r300_state_tcl.h |    2 ++
 2 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_state_tcl.c b/src/gallium/drivers/r300/r300_state_tcl.c
index 24e522c..44365f5 100644
--- a/src/gallium/drivers/r300/r300_state_tcl.c
+++ b/src/gallium/drivers/r300/r300_state_tcl.c
@@ -121,6 +121,8 @@ static uint32_t r300_vs_op(unsigned op)
         case TGSI_OPCODE_MOV:
         case TGSI_OPCODE_SWZ:
             return R300_VE_ADD;
+        case TGSI_OPCODE_MAD:
+            return R300_PVS_DST_MACRO_INST | R300_PVS_MACRO_OP_2CLK_MADD;
         default:
             break;
     }
@@ -198,6 +200,11 @@ static void r300_vs_instruction(struct r300_vertex_shader* vs,
                     &inst->FullDstRegisters[0], inst->Instruction.Opcode,
                     2);
             break;
+        case TGSI_OPCODE_MAD:
+            r300_vs_emit_inst(vs, assembler, inst->FullSrcRegisters,
+                    &inst->FullDstRegisters[0], inst->Instruction.Opcode,
+                    3);
+            break;
         case TGSI_OPCODE_END:
             break;
         default:
diff --git a/src/gallium/drivers/r300/r300_state_tcl.h b/src/gallium/drivers/r300/r300_state_tcl.h
index cbad1c3..3d10e24 100644
--- a/src/gallium/drivers/r300/r300_state_tcl.h
+++ b/src/gallium/drivers/r300/r300_state_tcl.h
@@ -34,6 +34,8 @@
 #define R300_PVS_DST_OPCODE(x)   ((x) << 0)
 #   define R300_VE_MULTIPLY               2
 #   define R300_VE_ADD                    3
+#define R300_PVS_DST_MACRO_INST    (1 << 7)
+#   define R300_PVS_MACRO_OP_2CLK_MADD    0
 #define R300_PVS_DST_REG_TYPE(x) ((x) << 8)
 #   define R300_PVS_DST_REG_TEMPORARY     0
 #   define R300_PVS_DST_REG_A0            1




More information about the mesa-commit mailing list