diff options
author | marha <marha@users.sourceforge.net> | 2010-04-02 14:47:58 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2010-04-02 14:47:58 +0000 |
commit | 7933658107276f9d5491f8736a743cf8f8bbd5f2 (patch) | |
tree | f2893a761364e7abc9d934e9c5427e5cf5190c7a /mesalib/src/mesa/swrast/s_fragprog.c | |
parent | 83fa9a9811e2c18cffd83a020757f7fb51ffddaa (diff) | |
download | vcxsrv-7933658107276f9d5491f8736a743cf8f8bbd5f2.tar.gz vcxsrv-7933658107276f9d5491f8736a743cf8f8bbd5f2.tar.bz2 vcxsrv-7933658107276f9d5491f8736a743cf8f8bbd5f2.zip |
Updated to following packages:
mesa-7.8
Diffstat (limited to 'mesalib/src/mesa/swrast/s_fragprog.c')
-rw-r--r-- | mesalib/src/mesa/swrast/s_fragprog.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/mesalib/src/mesa/swrast/s_fragprog.c b/mesalib/src/mesa/swrast/s_fragprog.c index a22d34415..7c1de62e8 100644 --- a/mesalib/src/mesa/swrast/s_fragprog.c +++ b/mesalib/src/mesa/swrast/s_fragprog.c @@ -25,7 +25,6 @@ #include "main/glheader.h" #include "main/colormac.h" #include "main/context.h" -#include "main/texstate.h" #include "shader/prog_instruction.h" #include "s_fragprog.h" @@ -145,10 +144,19 @@ init_machine(GLcontext *ctx, struct gl_program_machine *machine, const struct gl_fragment_program *program, const SWspan *span, GLuint col) { + GLfloat *wpos = span->array->attribs[FRAG_ATTRIB_WPOS][col]; + if (program->Base.Target == GL_FRAGMENT_PROGRAM_NV) { /* Clear temporary registers (undefined for ARB_f_p) */ - _mesa_bzero(machine->Temporaries, - MAX_PROGRAM_TEMPS * 4 * sizeof(GLfloat)); + memset(machine->Temporaries, 0, MAX_PROGRAM_TEMPS * 4 * sizeof(GLfloat)); + } + + /* ARB_fragment_coord_conventions */ + if (program->OriginUpperLeft) + wpos[1] = ctx->DrawBuffer->Height - 1 - wpos[1]; + if (!program->PixelCenterInteger) { + wpos[0] += 0.5F; + wpos[1] += 0.5F; } /* Setup pointer to input attributes */ @@ -163,7 +171,7 @@ init_machine(GLcontext *ctx, struct gl_program_machine *machine, /* if running a GLSL program (not ARB_fragment_program) */ if (ctx->Shader.CurrentProgram) { /* Store front/back facing value */ - machine->Attribs[FRAG_ATTRIB_FACE][col][0] = 1.0 - span->facing; + machine->Attribs[FRAG_ATTRIB_FACE][col][0] = 1.0F - span->facing; } machine->CurElement = col; |