summaryrefslogtreecommitdiff
path: root/src/mesa/shader/prog_instruction.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2008-05-14 12:37:07 -0600
committerBrian Paul <brian.paul@tungstengraphics.com>2008-05-14 12:37:07 -0600
commit450136d368ce7a08cf25992c79b51f51f8a9bb7c (patch)
treee9270ba192cb73feb576cad5c7afc7011db92658 /src/mesa/shader/prog_instruction.c
parent57e222d6e5ef5744491d093475e1136aedf81810 (diff)
mesa: added _mesa_free_instructions()
cherry-picked from gallium-0.1
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 d6b5652a27..329fec3bac 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