From fc0896b50b8458a503eac8945dbb1f3e29b08990 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 23 Jun 2009 17:07:12 -0600 Subject: glsl: added slang_operation_insert_child() --- src/mesa/shader/slang/slang_compile_operation.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/mesa/shader/slang/slang_compile_operation.c') diff --git a/src/mesa/shader/slang/slang_compile_operation.c b/src/mesa/shader/slang/slang_compile_operation.c index 730cc06912..b75fd073af 100644 --- a/src/mesa/shader/slang/slang_compile_operation.c +++ b/src/mesa/shader/slang/slang_compile_operation.c @@ -265,6 +265,26 @@ slang_operation_insert(GLuint *numElements, slang_operation **array, } +/** + * Add/insert new child into given node at given position. + * \return pointer to the new child node + */ +slang_operation * +slang_operation_insert_child(slang_operation *oper, GLuint pos) +{ + slang_operation *newOp; + + newOp = slang_operation_insert(&oper->num_children, + &oper->children, + pos); + if (newOp) { + newOp->locals->outer_scope = oper->locals; + } + + return newOp; +} + + void _slang_operation_swap(slang_operation *oper0, slang_operation *oper1) { -- cgit v1.2.3