summaryrefslogtreecommitdiffstats
path: root/src/mesa/swrast
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/swrast')
-rw-r--r--src/mesa/swrast/s_fragprog.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/mesa/swrast/s_fragprog.c b/src/mesa/swrast/s_fragprog.c
index 74250b3592c..ab1e586f353 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 */