use _mesa_copy_instructions()
This commit is contained in:
@@ -1545,8 +1545,7 @@ _mesa_parse_nv_fragment_program(GLcontext *ctx, GLenum dstTarget,
|
|||||||
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glLoadProgramNV");
|
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glLoadProgramNV");
|
||||||
return; /* out of memory */
|
return; /* out of memory */
|
||||||
}
|
}
|
||||||
_mesa_memcpy(newInst, instBuffer,
|
_mesa_copy_instructions(newInst, instBuffer, parseState.numInst);
|
||||||
parseState.numInst * sizeof(struct prog_instruction));
|
|
||||||
|
|
||||||
/* install the program */
|
/* install the program */
|
||||||
program->Base.Target = target;
|
program->Base.Target = target;
|
||||||
|
@@ -1378,8 +1378,7 @@ _mesa_parse_nv_vertex_program(GLcontext *ctx, GLenum dstTarget,
|
|||||||
_mesa_free(programString);
|
_mesa_free(programString);
|
||||||
return; /* out of memory */
|
return; /* out of memory */
|
||||||
}
|
}
|
||||||
_mesa_memcpy(newInst, instBuffer,
|
_mesa_copy_instructions(newInst, instBuffer, parseState.numInst);
|
||||||
parseState.numInst * sizeof(struct prog_instruction));
|
|
||||||
|
|
||||||
/* install the program */
|
/* install the program */
|
||||||
program->Base.Target = target;
|
program->Base.Target = target;
|
||||||
|
@@ -342,8 +342,8 @@ _mesa_clone_program(GLcontext *ctx, const struct gl_program *prog)
|
|||||||
_mesa_delete_program(ctx, clone);
|
_mesa_delete_program(ctx, clone);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
memcpy(clone->Instructions, prog->Instructions,
|
_mesa_copy_instructions(clone->Instructions, prog->Instructions,
|
||||||
prog->NumInstructions * sizeof(struct prog_instruction));
|
prog->NumInstructions);
|
||||||
clone->InputsRead = prog->InputsRead;
|
clone->InputsRead = prog->InputsRead;
|
||||||
clone->OutputsWritten = prog->OutputsWritten;
|
clone->OutputsWritten = prog->OutputsWritten;
|
||||||
memcpy(clone->TexturesUsed, prog->TexturesUsed, sizeof(prog->TexturesUsed));
|
memcpy(clone->TexturesUsed, prog->TexturesUsed, sizeof(prog->TexturesUsed));
|
||||||
|
@@ -150,8 +150,7 @@ _mesa_append_fog_code(GLcontext *ctx, struct gl_fragment_program *fprog)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Copy orig instructions into new instruction buffer */
|
/* Copy orig instructions into new instruction buffer */
|
||||||
_mesa_memcpy(newInst, fprog->Base.Instructions,
|
_mesa_copy_instructions(newInst, fprog->Base.Instructions, origLen);
|
||||||
origLen * sizeof(struct prog_instruction));
|
|
||||||
|
|
||||||
/* PARAM fogParamsRefOpt = internal optimized fog params; */
|
/* PARAM fogParamsRefOpt = internal optimized fog params; */
|
||||||
fogPRefOpt
|
fogPRefOpt
|
||||||
|
Reference in New Issue
Block a user