From 6164ae2b5a7ad00181aa2a80634e80e58c8c3fb6 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 21 Apr 2004 17:51:21 +0000 Subject: [PATCH] only init temp regs to zero if executing NV fragment program --- src/mesa/swrast/s_nvfragprog.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/mesa/swrast/s_nvfragprog.c b/src/mesa/swrast/s_nvfragprog.c index 6529022fe93..f679ca67a2a 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)) { -- 2.30.2