aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2009-06-24 16:04:33 -0600
committerBrian Paul <[email protected]>2009-06-26 13:16:33 -0600
commit5951ab311db1e716cada3ada87187e50d4434ee4 (patch)
treeb71b68ac29dd964f52c9aea306d5c8dc86bfc8ac
parente5b53c071bf664931f7553e2a9f5ccd96b2c09cb (diff)
glsl: added slang_operation_free_children()
-rw-r--r--src/mesa/shader/slang/slang_compile_operation.c14
-rw-r--r--src/mesa/shader/slang/slang_compile_operation.h3
2 files changed, 17 insertions, 0 deletions
diff --git a/src/mesa/shader/slang/slang_compile_operation.c b/src/mesa/shader/slang/slang_compile_operation.c
index b75fd073afd..48586c2d96d 100644
--- a/src/mesa/shader/slang/slang_compile_operation.c
+++ b/src/mesa/shader/slang/slang_compile_operation.c
@@ -200,6 +200,20 @@ slang_operation_delete(slang_operation *oper)
}
+void
+slang_operation_free_children(slang_operation *oper)
+{
+ GLuint i;
+ for (i = 0; i < slang_oper_num_children(oper); i++) {
+ slang_operation *child = slang_oper_child(oper, i);
+ slang_operation_destruct(child);
+ }
+ _slang_free(oper->children);
+ oper->children = NULL;
+ oper->num_children = 0;
+}
+
+
slang_operation *
slang_operation_grow(GLuint *numChildren, slang_operation **children)
{
diff --git a/src/mesa/shader/slang/slang_compile_operation.h b/src/mesa/shader/slang/slang_compile_operation.h
index 06b452d3d9c..d75965c2355 100644
--- a/src/mesa/shader/slang/slang_compile_operation.h
+++ b/src/mesa/shader/slang/slang_compile_operation.h
@@ -150,6 +150,9 @@ slang_operation_new(GLuint count);
extern void
slang_operation_delete(slang_operation *oper);
+extern void
+slang_operation_free_children(slang_operation *oper);
+
extern slang_operation *
slang_operation_grow(GLuint *numChildren, slang_operation **children);