summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorOliver McFadden <[email protected]>2007-03-15 20:55:30 +0000
committerOliver McFadden <[email protected]>2007-03-15 20:55:30 +0000
commit0c25d9ab198f79afee23ec1bf8ac61c4cd801d3a (patch)
treee5938f5e0d74d9446481540fe4194bb0eff71aae /src/mesa/drivers
parent1195caa2745de4d16ddbd46eeb4f527a78c5eb63 (diff)
r300: Added _mesa_copy_instructions.
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/r300/r300_fragprog.c2
-rw-r--r--src/mesa/drivers/dri/r300/r300_vertprog.c9
2 files changed, 6 insertions, 5 deletions
diff --git a/src/mesa/drivers/dri/r300/r300_fragprog.c b/src/mesa/drivers/dri/r300/r300_fragprog.c
index e05abdb7c61..251fd260821 100644
--- a/src/mesa/drivers/dri/r300/r300_fragprog.c
+++ b/src/mesa/drivers/dri/r300/r300_fragprog.c
@@ -1853,7 +1853,7 @@ static void insert_wpos(struct gl_program *prog)
fpi[i].SrcReg[2].Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_ZERO);
i++;
- _mesa_memcpy(&fpi[i], prog->Instructions, prog->NumInstructions * sizeof(struct prog_instruction));
+ _mesa_copy_instructions (&fpi[i], prog->Instructions, prog->NumInstructions);
free(prog->Instructions);
diff --git a/src/mesa/drivers/dri/r300/r300_vertprog.c b/src/mesa/drivers/dri/r300/r300_vertprog.c
index 0c43270d757..092ebb1140e 100644
--- a/src/mesa/drivers/dri/r300/r300_vertprog.c
+++ b/src/mesa/drivers/dri/r300/r300_vertprog.c
@@ -946,7 +946,7 @@ static void position_invariant(struct gl_program *prog)
#endif
}
- _mesa_memcpy(&vpi[i], prog->Instructions, prog->NumInstructions * sizeof(struct prog_instruction));
+ _mesa_copy_instructions (&vpi[i], prog->Instructions, prog->NumInstructions);
free(prog->Instructions);
@@ -969,10 +969,11 @@ static void insert_wpos(struct r300_vertex_program *vp,
vpi = _mesa_alloc_instructions (prog->NumInstructions + 2);
_mesa_init_instructions (vpi, prog->NumInstructions + 2);
/* all but END */
- _mesa_memcpy(vpi, prog->Instructions, (prog->NumInstructions - 1) * sizeof(struct prog_instruction));
+ _mesa_copy_instructions (vpi, prog->Instructions, prog->NumInstructions - 1);
/* END */
- _mesa_memcpy(&vpi[prog->NumInstructions + 1], &prog->Instructions[prog->NumInstructions - 1],
- sizeof(struct prog_instruction));
+ _mesa_copy_instructions (&vpi[prog->NumInstructions + 1],
+ &prog->Instructions[prog->NumInstructions - 1],
+ 1);
vpi_insert = &vpi[prog->NumInstructions - 1];
vpi_insert[i].Opcode = OPCODE_MOV;