summaryrefslogtreecommitdiffstats
path: root/src/mesa/swrast
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2004-03-29 16:01:18 +0000
committerKeith Whitwell <[email protected]>2004-03-29 16:01:18 +0000
commiteeb5eeb2a62627d2a547f6739105c1418caf6d9d (patch)
treee64305a3ea183aefd422cdfe3c07999afe6a417c /src/mesa/swrast
parent292fa335d68ba82184e46b2dce87091f85e29e46 (diff)
Accomodate ARB_fp XPD opcode separately from NV_fp's X2D.
Diffstat (limited to 'src/mesa/swrast')
-rw-r--r--src/mesa/swrast/s_nvfragprog.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/mesa/swrast/s_nvfragprog.c b/src/mesa/swrast/s_nvfragprog.c
index 4083581ab05..127cc4f0b4d 100644
--- a/src/mesa/swrast/s_nvfragprog.c
+++ b/src/mesa/swrast/s_nvfragprog.c
@@ -1233,6 +1233,18 @@ execute_program( GLcontext *ctx,
store_vector4( inst, machine, result );
}
break;
+ case FP_OPCODE_XPD: /* cross product */
+ {
+ GLfloat a[4], b[4], result[4];
+ fetch_vector4( ctx, &inst->SrcReg[0], machine, program, a );
+ fetch_vector4( ctx, &inst->SrcReg[1], machine, program, b );
+ result[0] = a[1] * b[2] - a[2] * b[1];
+ result[1] = a[2] * b[0] - a[0] * b[2];
+ result[2] = a[0] * b[1] - a[1] * b[0];
+ result[3] = 1.0;
+ store_vector4( inst, machine, result );
+ }
+ break;
case FP_OPCODE_X2D: /* 2-D matrix transform */
{
GLfloat a[4], b[4], c[4], result[4];