diff options
author | Brian Paul <brianp@vmware.com> | 2009-06-24 16:04:33 -0600 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2009-06-24 16:04:33 -0600 |
commit | 799a197d99563a2fe4b7e965c0da93248501644b (patch) | |
tree | 0fbbf6211ade4274225bfa07d86beafef37c0f84 | |
parent | 3803b05593c6602fc4832307e3f9b0f4b3a9bebd (diff) |
glsl: added slang_operation_free_children()
-rw-r--r-- | src/mesa/shader/slang/slang_compile_operation.c | 14 | ||||
-rw-r--r-- | src/mesa/shader/slang/slang_compile_operation.h | 3 |
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 b75fd073af..48586c2d96 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 06b452d3d9..d75965c235 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); |