From eeb5eeb2a62627d2a547f6739105c1418caf6d9d Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Mon, 29 Mar 2004 16:01:18 +0000 Subject: Accomodate ARB_fp XPD opcode separately from NV_fp's X2D. --- src/mesa/swrast/s_nvfragprog.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/mesa/swrast') diff --git a/src/mesa/swrast/s_nvfragprog.c b/src/mesa/swrast/s_nvfragprog.c index 4083581ab0..127cc4f0b4 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]; -- cgit v1.2.3