From: Brian Paul Date: Wed, 21 Apr 2004 17:51:21 +0000 (+0000) Subject: only init temp regs to zero if executing NV fragment program X-Git-Tag: 062012170305~24596 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6164ae2b5a7ad00181aa2a80634e80e58c8c3fb6;p=profile%2Fivi%2Fmesa.git only init temp regs to zero if executing NV fragment program --- diff --git a/src/mesa/swrast/s_nvfragprog.c b/src/mesa/swrast/s_nvfragprog.c index 6529022f..f679ca6 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)) {