diff options
author | Oliver McFadden <[email protected]> | 2008-03-02 06:28:53 +0000 |
---|---|---|
committer | Oliver McFadden <[email protected]> | 2008-03-02 06:35:44 +0000 |
commit | e239871d5b28c05eceae91a748d36ea3ff4e5f18 (patch) | |
tree | 1428b90aafb81ab68b6ab9e0699ddabe11ed3766 | |
parent | c30cc5904dc61c27ea7a4ebf5928c53bca6a7b1d (diff) |
r300: Corrected a bug with the MAD instruction.
The PVS_VECTOR_OPCODE macro should be modified to support macro instructions,
too.
-rw-r--r-- | src/mesa/drivers/dri/r300/r300_reg.h | 6 | ||||
-rw-r--r-- | src/mesa/drivers/dri/r300/r300_vertprog.c | 10 |
2 files changed, 12 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/r300/r300_reg.h b/src/mesa/drivers/dri/r300/r300_reg.h index b059c1671dc..0614c8b2e06 100644 --- a/src/mesa/drivers/dri/r300/r300_reg.h +++ b/src/mesa/drivers/dri/r300/r300_reg.h @@ -2480,6 +2480,12 @@ enum { }; enum { + /* R3XX */ + PVS_MACRO_OP_2CLK_MADD = 0, + PVS_MACRO_OP_2CLK_M2X_ADD = 1, +}; + +enum { PVS_SRC_REG_TEMPORARY = 0, /* Intermediate Storage */ PVS_SRC_REG_INPUT = 1, /* Input Vertex Storage */ PVS_SRC_REG_CONSTANT = 2, /* Constant State Storage */ diff --git a/src/mesa/drivers/dri/r300/r300_vertprog.c b/src/mesa/drivers/dri/r300/r300_vertprog.c index e0d81d07952..8aa1a1c8164 100644 --- a/src/mesa/drivers/dri/r300/r300_vertprog.c +++ b/src/mesa/drivers/dri/r300/r300_vertprog.c @@ -555,10 +555,12 @@ static GLuint *t_opcode_log(struct r300_vertex_program *vp, struct prog_instruct static GLuint *t_opcode_mad(struct r300_vertex_program *vp, struct prog_instruction *vpi, GLuint * inst, struct prog_src_register src[3]) { - inst[0] = PVS_VECTOR_OPCODE(VE_MULTIPLY_ADD, - t_dst_index(vp, &vpi->DstReg), - t_dst_mask(vpi->DstReg.WriteMask), - t_dst_class(vpi->DstReg.File)); + /* FIXME */ + inst[0] = (((PVS_MACRO_OP_2CLK_MADD & PVS_DST_OPCODE_MASK) << PVS_DST_OPCODE_SHIFT) | + ((1 & PVS_DST_MACRO_INST_MASK) << PVS_DST_MACRO_INST_SHIFT) | + ((t_dst_index(vp, &vpi->DstReg) & PVS_DST_OFFSET_MASK) << PVS_DST_OFFSET_SHIFT) | + ((t_dst_mask(vpi->DstReg.WriteMask) & 0xf) << PVS_DST_WE_X_SHIFT) | + ((t_dst_class(vpi->DstReg.File) & PVS_DST_REG_TYPE_MASK) << PVS_DST_REG_TYPE_SHIFT)); inst[1] = t_src(vp, &src[0]); inst[2] = t_src(vp, &src[1]); inst[3] = t_src(vp, &src[2]); |