_mesa_error(ctx, GL_OUT_OF_MEMORY, "glLoadProgramNV");
return; /* out of memory */
}
- _mesa_memcpy(newInst, instBuffer,
- parseState.numInst * sizeof(struct prog_instruction));
+ _mesa_copy_instructions(newInst, instBuffer, parseState.numInst);
/* install the program */
program->Base.Target = target;
_mesa_free(programString);
return; /* out of memory */
}
- _mesa_memcpy(newInst, instBuffer,
- parseState.numInst * sizeof(struct prog_instruction));
+ _mesa_copy_instructions(newInst, instBuffer, parseState.numInst);
/* install the program */
program->Base.Target = target;
_mesa_delete_program(ctx, clone);
return NULL;
}
- memcpy(clone->Instructions, prog->Instructions,
- prog->NumInstructions * sizeof(struct prog_instruction));
+ _mesa_copy_instructions(clone->Instructions, prog->Instructions,
+ prog->NumInstructions);
clone->InputsRead = prog->InputsRead;
clone->OutputsWritten = prog->OutputsWritten;
memcpy(clone->TexturesUsed, prog->TexturesUsed, sizeof(prog->TexturesUsed));
}
/* Copy orig instructions into new instruction buffer */
- _mesa_memcpy(newInst, fprog->Base.Instructions,
- origLen * sizeof(struct prog_instruction));
+ _mesa_copy_instructions(newInst, fprog->Base.Instructions, origLen);
/* PARAM fogParamsRefOpt = internal optimized fog params; */
fogPRefOpt