diff options
author | Brian Paul <[email protected]> | 2009-06-23 17:07:12 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2009-06-26 13:16:33 -0600 |
commit | fc0896b50b8458a503eac8945dbb1f3e29b08990 (patch) | |
tree | 5473a0fc7897d3b8c92a9ea4b1e54551e30a043e /src/mesa/shader | |
parent | f4b1a69b7d53d88e12d9baac419b48bbf8e32989 (diff) |
glsl: added slang_operation_insert_child()
Diffstat (limited to 'src/mesa/shader')
-rw-r--r-- | src/mesa/shader/slang/slang_compile_operation.c | 20 | ||||
-rw-r--r-- | src/mesa/shader/slang/slang_compile_operation.h | 3 |
2 files changed, 23 insertions, 0 deletions
diff --git a/src/mesa/shader/slang/slang_compile_operation.c b/src/mesa/shader/slang/slang_compile_operation.c index 730cc069129..b75fd073afd 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) { diff --git a/src/mesa/shader/slang/slang_compile_operation.h b/src/mesa/shader/slang/slang_compile_operation.h index b701d9a957c..c69078b0070 100644 --- a/src/mesa/shader/slang/slang_compile_operation.h +++ b/src/mesa/shader/slang/slang_compile_operation.h @@ -157,6 +157,9 @@ extern slang_operation * slang_operation_insert(GLuint *numChildren, slang_operation **children, GLuint pos); +extern slang_operation * +slang_operation_insert_child(slang_operation *oper, GLuint pos); + extern void _slang_operation_swap(slang_operation *oper0, slang_operation *oper1); |