diff options
author | Brian Paul <brian.paul@tungstengraphics.com> | 2004-04-21 17:51:21 +0000 |
---|---|---|
committer | Brian Paul <brian.paul@tungstengraphics.com> | 2004-04-21 17:51:21 +0000 |
commit | 6164ae2b5a7ad00181aa2a80634e80e58c8c3fb6 (patch) | |
tree | 2f4ebee9ae247cbba240d8f57ccd81e1a5ac8e6c /src/mesa/swrast | |
parent | c45b7364dab6c3daebc1f1d8d11124af4129074a (diff) |
only init temp regs to zero if executing NV fragment program
Diffstat (limited to 'src/mesa/swrast')
-rw-r--r-- | src/mesa/swrast/s_nvfragprog.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/mesa/swrast/s_nvfragprog.c b/src/mesa/swrast/s_nvfragprog.c index 6529022fe9..f679ca67a2 100644 --- a/src/mesa/swrast/s_nvfragprog.c +++ b/src/mesa/swrast/s_nvfragprog.c @@ -478,9 +478,11 @@ init_machine_deriv( GLcontext *ctx, /* copy existing machine */ _mesa_memcpy(dMachine, machine, sizeof(struct fp_machine)); - /* Clear temporary registers */ - _mesa_bzero( (void*) machine->Temporaries, - MAX_NV_FRAGMENT_PROGRAM_TEMPS * 4 * sizeof(GLfloat)); + if (program->Base.Target == GL_FRAGMENT_PROGRAM_NV) { + /* Clear temporary registers (undefined for ARB_f_p) */ + _mesa_bzero( (void*) machine->Temporaries, + MAX_NV_FRAGMENT_PROGRAM_TEMPS * 4 * sizeof(GLfloat)); + } /* Add derivatives */ if (program->InputsRead & (1 << FRAG_ATTRIB_WPOS)) { @@ -1307,9 +1309,11 @@ init_machine( GLcontext *ctx, struct fp_machine *machine, if (ctx->FragmentProgram.CallbackEnabled) inputsRead = ~0; - /* Clear temporary registers */ - _mesa_bzero(machine->Temporaries, - MAX_NV_FRAGMENT_PROGRAM_TEMPS * 4 * sizeof(GLfloat)); + if (program->Base.Target == GL_FRAGMENT_PROGRAM_NV) { + /* Clear temporary registers (undefined for ARB_f_p) */ + _mesa_bzero(machine->Temporaries, + MAX_NV_FRAGMENT_PROGRAM_TEMPS * 4 * sizeof(GLfloat)); + } /* Load input registers */ if (inputsRead & (1 << FRAG_ATTRIB_WPOS)) { |