summaryrefslogtreecommitdiff
path: root/src/mesa/tnl
diff options
context:
space:
mode:
authorBrian <brian@yutani.localnet.net>2007-01-17 15:54:14 -0700
committerBrian <brian@yutani.localnet.net>2007-01-17 15:54:14 -0700
commit0bad236cfbaabfc0ed4f20088e64fa89f81934ce (patch)
treed4a05aed1680f8837fb2f1719f0f46cb34333593 /src/mesa/tnl
parent46a924124895a99b4028138c0e5997e0648b626c (diff)
Added OPCODE_INT to convert 4 floats to 4 ints.
Diffstat (limited to 'src/mesa/tnl')
-rw-r--r--src/mesa/tnl/t_vb_arbprogram.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/mesa/tnl/t_vb_arbprogram.c b/src/mesa/tnl/t_vb_arbprogram.c
index 906fd3f1e8..5773f0f627 100644
--- a/src/mesa/tnl/t_vb_arbprogram.c
+++ b/src/mesa/tnl/t_vb_arbprogram.c
@@ -338,6 +338,17 @@ static void do_FRC( struct arb_vp_machine *m, union instruction op )
result[3] = arg0[3] - FLOORF(arg0[3]);
}
+static void do_INT( struct arb_vp_machine *m, union instruction op )
+{
+ GLfloat *result = m->File[0][op.alu.dst];
+ const GLfloat *arg0 = m->File[op.alu.file0][op.alu.idx0];
+
+ result[0] = (GLfloat) (GLint) arg0[0];
+ result[1] = (GLfloat) (GLint) arg0[1];
+ result[2] = (GLfloat) (GLint) arg0[2];
+ result[3] = (GLfloat) (GLint) arg0[3];
+}
+
/* High precision log base 2:
*/
static void do_LG2( struct arb_vp_machine *m, union instruction op )
@@ -665,6 +676,7 @@ _tnl_disassem_vba_insn( union instruction op )
case OPCODE_EXP:
case OPCODE_FLR:
case OPCODE_FRC:
+ case OPCODE_INT:
case OPCODE_LG2:
case OPCODE_LIT:
case OPCODE_LOG:
@@ -739,6 +751,7 @@ static void (* const opcode_func[MAX_OPCODE+3])(struct arb_vp_machine *, union i
do_EXP,
do_FLR,
do_FRC,
+ do_INT,
do_NOP,/*KIL*/
do_NOP,/*KIL_NV*/
do_LG2,
@@ -1458,6 +1471,10 @@ static GLboolean init_vertex_program( GLcontext *ctx,
const GLuint size = VB->Size;
GLuint i;
+ /* spot checks to be sure the opcode table is correct */
+ assert(opcode_func[OPCODE_SGE] == do_SGE);
+ assert(opcode_func[OPCODE_XPD] == do_XPD);
+
stage->privatePtr = _mesa_calloc(sizeof(*m));
m = ARB_VP_MACHINE(stage);
if (!m)