noise functions

This commit is contained in:
Brian
2007-01-28 19:01:35 -07:00
parent f94e4f216f
commit 7aece10039
9 changed files with 214 additions and 139 deletions

View File

@@ -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 */