mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-15 17:30:32 +01:00
glsl: added slang_operation_add_children() and slang_oper_child() helpers
This commit is contained in:
parent
c20bb48d3a
commit
c4fd947bee
2 changed files with 25 additions and 0 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -161,4 +161,15 @@ extern void
|
|||
_slang_operation_swap(slang_operation *oper0, slang_operation *oper1);
|
||||
|
||||
|
||||
extern void
|
||||
slang_operation_add_children(slang_operation *oper, GLuint num_children);
|
||||
|
||||
static INLINE slang_operation *
|
||||
slang_oper_child(slang_operation *oper, GLuint child)
|
||||
{
|
||||
assert(child < oper->num_children);
|
||||
return &oper->children[child];
|
||||
}
|
||||
|
||||
|
||||
#endif /* SLANG_COMPILE_OPERATION_H */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue