diff options
author | Brian <[email protected]> | 2007-03-22 09:11:26 -0600 |
---|---|---|
committer | Brian <[email protected]> | 2007-03-22 09:11:26 -0600 |
commit | 12229f119d754715e0315846fdd8d6e9213e8edf (patch) | |
tree | 53f9f61f76f80685f6cb6ad9e8297292a4be7a4f /src/mesa/shader | |
parent | 1bf81e3c5d65b636658d11072f4f027f5c499396 (diff) |
use _mesa_copy_instructions()
Diffstat (limited to 'src/mesa/shader')
-rw-r--r-- | src/mesa/shader/nvfragparse.c | 3 | ||||
-rw-r--r-- | src/mesa/shader/nvvertparse.c | 3 | ||||
-rw-r--r-- | src/mesa/shader/program.c | 4 | ||||
-rw-r--r-- | src/mesa/shader/programopt.c | 3 |
4 files changed, 5 insertions, 8 deletions
diff --git a/src/mesa/shader/nvfragparse.c b/src/mesa/shader/nvfragparse.c index c46d8aa0833..ffa7ba4701b 100644 --- a/src/mesa/shader/nvfragparse.c +++ b/src/mesa/shader/nvfragparse.c @@ -1545,8 +1545,7 @@ _mesa_parse_nv_fragment_program(GLcontext *ctx, GLenum dstTarget, _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; diff --git a/src/mesa/shader/nvvertparse.c b/src/mesa/shader/nvvertparse.c index 0bc0c055dad..ac96d4a60ed 100644 --- a/src/mesa/shader/nvvertparse.c +++ b/src/mesa/shader/nvvertparse.c @@ -1378,8 +1378,7 @@ _mesa_parse_nv_vertex_program(GLcontext *ctx, GLenum dstTarget, _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; diff --git a/src/mesa/shader/program.c b/src/mesa/shader/program.c index ae26c3cc14e..c1606acb1a7 100644 --- a/src/mesa/shader/program.c +++ b/src/mesa/shader/program.c @@ -342,8 +342,8 @@ _mesa_clone_program(GLcontext *ctx, const struct gl_program *prog) _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)); diff --git a/src/mesa/shader/programopt.c b/src/mesa/shader/programopt.c index d427ee38f81..f1d8ce30654 100644 --- a/src/mesa/shader/programopt.c +++ b/src/mesa/shader/programopt.c @@ -150,8 +150,7 @@ _mesa_append_fog_code(GLcontext *ctx, struct gl_fragment_program *fprog) } /* 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 |