diff options
author | Brian Paul <[email protected]> | 2003-03-01 01:50:20 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2003-03-01 01:50:20 +0000 |
commit | 27558a160a9fe91745728d7626995cd88f8fe339 (patch) | |
tree | 0b8cbbd49d418f5ef9f10d3d721c3d4e9e925c3d /src/mesa/swrast/s_nvfragprog.c | |
parent | 4e50ab5f70582f4e362c4572b22a4c3f87c71a14 (diff) |
Killed mmath.[ch]. Moved low-level functions/assembly code into imports.[ch]
Moved type conversion and interpolation macros into macros.h
Updated all the files that used to include mmath.h
Diffstat (limited to 'src/mesa/swrast/s_nvfragprog.c')
-rw-r--r-- | src/mesa/swrast/s_nvfragprog.c | 32 |
1 files changed, 9 insertions, 23 deletions
diff --git a/src/mesa/swrast/s_nvfragprog.c b/src/mesa/swrast/s_nvfragprog.c index 738c78274ef..97f65c04794 100644 --- a/src/mesa/swrast/s_nvfragprog.c +++ b/src/mesa/swrast/s_nvfragprog.c @@ -1,4 +1,4 @@ -/* $Id: s_nvfragprog.c,v 1.4 2003/02/25 19:29:43 brianp Exp $ */ +/* $Id: s_nvfragprog.c,v 1.5 2003/03/01 01:50:26 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -31,7 +31,6 @@ #include "context.h" #include "nvfragprog.h" #include "macros.h" -#include "mmath.h" #include "s_nvfragprog.h" @@ -47,7 +46,7 @@ fetch_texel( GLcontext *ctx, const GLfloat texcoord[4], GLuint unit, const GLfloat *lambda = NULL; GLchan rgba[4]; SWcontext *swrast = SWRAST_CONTEXT(ctx); - const struct gl_texture_object *texObj; + const struct gl_texture_object *texObj = NULL; switch (targetIndex) { case TEXTURE_1D_INDEX: @@ -147,20 +146,7 @@ fetch_vector1( const struct fp_src_register *source, const struct fp_machine *machine, GLfloat result[4] ) { - const GLfloat *src; - - /* - if (source->RelAddr) { - GLint reg = source->Register + machine->AddressReg; - if (reg < VP_PROG_REG_START || reg > VP_PROG_REG_END) - src = zero; - else - src = machine->Registers[reg]; - } - else - */ - - src = machine->Registers[source->Register]; + const GLfloat *src = machine->Registers[source->Register]; result[0] = src[source->Swizzle[0]]; @@ -300,7 +286,7 @@ execute_program(GLcontext *ctx, const struct fragment_program *program) { GLfloat a[4], result[4]; fetch_vector1( &inst->SrcReg[0], machine, a ); - result[0] = result[1] = result[2] = result[3] = cos(a[0]); + result[0] = result[1] = result[2] = result[3] = _mesa_cos(a[0]); store_vector4( inst, machine, result ); } break; @@ -363,7 +349,7 @@ execute_program(GLcontext *ctx, const struct fragment_program *program) GLfloat a[4], result[4]; fetch_vector1( &inst->SrcReg[0], machine, a ); result[0] = result[1] = result[2] = result[3] = - (GLfloat) pow(2.0, a[0]); + (GLfloat) _mesa_pow(2.0, a[0]); store_vector4( inst, machine, result ); } break; @@ -419,7 +405,7 @@ execute_program(GLcontext *ctx, const struct fragment_program *program) a[1] = 0.0F; result[0] = 1.0F; result[1] = a[0]; - result[2] = (a[0] > 0.0) ? pow(2.0, a[3]) : 0.0F; + result[2] = (a[0] > 0.0) ? _mesa_pow(2.0, a[3]) : 0.0F; result[3] = 1.0F; store_vector4( inst, machine, result ); } @@ -561,7 +547,7 @@ execute_program(GLcontext *ctx, const struct fragment_program *program) fetch_vector1( &inst->SrcReg[0], machine, a ); fetch_vector1( &inst->SrcReg[1], machine, b ); result[0] = result[1] = result[2] = result[3] - = pow(a[0], b[0]); + = _mesa_pow(a[0], b[0]); store_vector4( inst, machine, result ); } break; @@ -597,7 +583,7 @@ execute_program(GLcontext *ctx, const struct fragment_program *program) GLfloat a[4], result[4]; fetch_vector1( &inst->SrcReg[0], machine, a ); result[0] = result[1] = result[2] = result[3] - = 1.0F / GL_SQRT(a[0]); + = 1.0F / SQRTF(a[0]); store_vector4( inst, machine, result ); } break; @@ -647,7 +633,7 @@ execute_program(GLcontext *ctx, const struct fragment_program *program) { GLfloat a[4], result[4]; fetch_vector1( &inst->SrcReg[0], machine, a ); - result[0] = result[1] = result[2] = result[3] = sin(a[0]); + result[0] = result[1] = result[2] = result[3] = _mesa_sin(a[0]); store_vector4( inst, machine, result ); } break; |