summaryrefslogtreecommitdiff
path: root/src/mesa/shader/prog_instruction.c
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2008-04-07 11:15:23 -0600
committerBrian <brian.paul@tungstengraphics.com>2008-04-07 11:23:43 -0600
commitf3bd7bf5c913d2a58d424e995b4d441e402bd62b (patch)
tree5f21229b703a7bb18b096df1906ed812957cf8c9 /src/mesa/shader/prog_instruction.c
parenta8a5376406cabf5aa6a44f7d37f5f8abbb4adf56 (diff)
mesa: added _mesa_free_instructions()
Diffstat (limited to 'src/mesa/shader/prog_instruction.c')
-rw-r--r--src/mesa/shader/prog_instruction.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/mesa/shader/prog_instruction.c b/src/mesa/shader/prog_instruction.c
index 066129037a..bea5d0551e 100644
--- a/src/mesa/shader/prog_instruction.c
+++ b/src/mesa/shader/prog_instruction.c
@@ -119,6 +119,23 @@ _mesa_copy_instructions(struct prog_instruction *dest,
/**
+ * Free an array of instructions
+ */
+void
+_mesa_free_instructions(struct prog_instruction *inst, GLuint count)
+{
+ GLuint i;
+ for (i = 0; i < count; i++) {
+ if (inst[i].Data)
+ _mesa_free(inst[i].Data);
+ if (inst[i].Comment)
+ _mesa_free((char *) inst[i].Comment);
+ }
+ _mesa_free(inst);
+}
+
+
+/**
* Basic info about each instruction
*/
struct instruction_info