summaryrefslogtreecommitdiff
path: root/src/mesa/shader/slang/slang_compile_operation.c
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2009-06-18 14:11:59 -0600
committerBrian Paul <brianp@vmware.com>2009-06-26 13:16:32 -0600
commitc4fd947beedbd1e2f8fdaf4ead3b2a8249bd239e (patch)
treea91ed38a44855e2053c016f399c787ef208aa0f0 /src/mesa/shader/slang/slang_compile_operation.c
parentc20bb48d3a897fd616bf4c7d4eb67ea34475985d (diff)
glsl: added slang_operation_add_children() and slang_oper_child() helpers
Diffstat (limited to 'src/mesa/shader/slang/slang_compile_operation.c')
-rw-r--r--src/mesa/shader/slang/slang_compile_operation.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/mesa/shader/slang/slang_compile_operation.c b/src/mesa/shader/slang/slang_compile_operation.c
index e650616880..310a46b645 100644
--- a/src/mesa/shader/slang/slang_compile_operation.c
+++ b/src/mesa/shader/slang/slang_compile_operation.c
@@ -272,3 +272,17 @@ _slang_operation_swap(slang_operation *oper0, slang_operation *oper1)
}
+void
+slang_operation_add_children(slang_operation *oper, GLuint num_children)
+{
+ GLuint i;
+ assert(oper->num_children == 0);
+ assert(oper->children == NULL);
+ oper->num_children = num_children;
+ oper->children = slang_operation_new(num_children);
+ for (i = 0; i < num_children; i++) {
+ oper->children[i].locals = _slang_variable_scope_new(oper->locals);
+ }
+}
+
+