summaryrefslogtreecommitdiffstats
path: root/src/mesa/shader
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/shader
parent1195caa2745de4d16ddbd46eeb4f527a78c5eb63 (diff)
r300: Added _mesa_copy_instructions.
Diffstat (limited to 'src/mesa/shader')
-rw-r--r--src/mesa/shader/program.c14
-rw-r--r--src/mesa/shader/program.h3
2 files changed, 17 insertions, 0 deletions
diff --git a/src/mesa/shader/program.c b/src/mesa/shader/program.c
index 490f9194457..3d5f648191a 100644
--- a/src/mesa/shader/program.c
+++ b/src/mesa/shader/program.c
@@ -1480,6 +1480,20 @@ _mesa_realloc_instructions(struct prog_instruction *oldInst,
return newInst;
}
+/**
+ * Copy an narray of program instructions.
+ * \param dest pointer to destination.
+ * \param src pointer to source.
+ * \param n number of instructions to copy.
+ * \return pointer to destination.
+ */
+struct prog_instruction *
+_mesa_copy_instructions(struct prog_instruction *dest,
+ const struct prog_instruction *src, GLuint n)
+{
+ return _mesa_memcpy (dest, src, n * sizeof (struct prog_instruction));
+}
+
/**
* Basic info about each instruction
diff --git a/src/mesa/shader/program.h b/src/mesa/shader/program.h
index 5b5d134f6da..6f5013df358 100644
--- a/src/mesa/shader/program.h
+++ b/src/mesa/shader/program.h
@@ -128,6 +128,9 @@ extern struct prog_instruction *
_mesa_realloc_instructions(struct prog_instruction *oldInst,
GLuint numOldInst, GLuint numNewInst);
+extern struct prog_instruction *
+_mesa_copy_instructions(struct prog_instruction *dest,
+ const struct prog_instruction *src, GLuint n);
/**
* Used for describing GL state referenced from inside ARB vertex and