diff options
author | Brian <brian@yutani.localnet.net> | 2007-01-17 15:54:14 -0700 |
---|---|---|
committer | Brian <brian@yutani.localnet.net> | 2007-01-17 15:54:14 -0700 |
commit | 0bad236cfbaabfc0ed4f20088e64fa89f81934ce (patch) | |
tree | d4a05aed1680f8837fb2f1719f0f46cb34333593 /src/mesa/swrast/s_fragprog.c | |
parent | 46a924124895a99b4028138c0e5997e0648b626c (diff) |
Added OPCODE_INT to convert 4 floats to 4 ints.
Diffstat (limited to 'src/mesa/swrast/s_fragprog.c')
-rw-r--r-- | src/mesa/swrast/s_fragprog.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/mesa/swrast/s_fragprog.c b/src/mesa/swrast/s_fragprog.c index 83a50c7451..b842b49616 100644 --- a/src/mesa/swrast/s_fragprog.c +++ b/src/mesa/swrast/s_fragprog.c @@ -888,6 +888,17 @@ execute_program( GLcontext *ctx, store_vector4( inst, machine, result ); } break; + case OPCODE_INT: /* float to int */ + { + GLfloat a[4], result[4]; + fetch_vector4( ctx, &inst->SrcReg[0], machine, program, a ); + result[0] = (GLfloat) (GLint) a[0]; + result[1] = (GLfloat) (GLint) a[1]; + result[2] = (GLfloat) (GLint) a[2]; + result[3] = (GLfloat) (GLint) a[3]; + store_vector4( inst, machine, result ); + } + break; case OPCODE_KIL_NV: /* NV_f_p only */ { const GLuint swizzle = inst->DstReg.CondSwizzle; |