diff options
author | Brian <brian@nostromo.localnet.net> | 2007-01-28 19:01:35 -0700 |
---|---|---|
committer | Brian <brian@nostromo.localnet.net> | 2007-01-28 19:01:35 -0700 |
commit | 7aece10039ad4786d7f85d61ec8614b9f287ea23 (patch) | |
tree | 72c005e9ea30183d8ef8024fbd9974db723e40bb /src/mesa/swrast/s_fragprog.c | |
parent | f94e4f216f56a12b9ea9150950b65e0e24794950 (diff) |
noise functions
Diffstat (limited to 'src/mesa/swrast/s_fragprog.c')
-rw-r--r-- | src/mesa/swrast/s_fragprog.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src/mesa/swrast/s_fragprog.c b/src/mesa/swrast/s_fragprog.c index 74250b3592..ab1e586f35 100644 --- a/src/mesa/swrast/s_fragprog.c +++ b/src/mesa/swrast/s_fragprog.c @@ -32,6 +32,7 @@ #include "s_fragprog.h" #include "s_span.h" +#include "slang_library_noise.h" /* See comments below for info about this */ @@ -1133,6 +1134,50 @@ execute_program( GLcontext *ctx, } } break; + case OPCODE_NOISE1: + { + GLfloat a[4], result[4]; + fetch_vector1( ctx, &inst->SrcReg[0], machine, program, a ); + result[0] = + result[1] = + result[2] = + result[3] = _slang_library_noise1(a[0]); + store_vector4( inst, machine, result ); + } + break; + case OPCODE_NOISE2: + { + GLfloat a[4], result[4]; + fetch_vector4( ctx, &inst->SrcReg[0], machine, program, a ); + result[0] = + result[1] = + result[2] = + result[3] = _slang_library_noise2(a[0], a[1]); + store_vector4( inst, machine, result ); + } + break; + case OPCODE_NOISE3: + { + GLfloat a[4], result[4]; + fetch_vector4( ctx, &inst->SrcReg[0], machine, program, a ); + result[0] = + result[1] = + result[2] = + result[3] = _slang_library_noise3(a[0], a[1], a[2]); + store_vector4( inst, machine, result ); + } + break; + case OPCODE_NOISE4: + { + GLfloat a[4], result[4]; + fetch_vector4( ctx, &inst->SrcReg[0], machine, program, a ); + result[0] = + result[1] = + result[2] = + result[3] = _slang_library_noise4(a[0], a[1], a[2], a[3]); + store_vector4( inst, machine, result ); + } + break; case OPCODE_NOP: break; case OPCODE_PK2H: /* pack two 16-bit floats in one 32-bit float */ |