mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-30 18:40:13 +01:00
glsl: Add IR builder support for generating return statements.
We use "ret" as the function name since "return" is a C++ keyword, and "ir_return" is already a class name. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Paul Berry <stereotype441@gmail.com>
This commit is contained in:
parent
f72a8498e7
commit
d716b3376c
2 changed files with 9 additions and 0 deletions
|
|
@ -76,6 +76,13 @@ assign(deref lhs, operand rhs, operand condition)
|
|||
return assign(lhs, rhs, condition, (1 << lhs.val->type->vector_elements) - 1);
|
||||
}
|
||||
|
||||
ir_return *
|
||||
ret(operand retval)
|
||||
{
|
||||
void *mem_ctx = ralloc_parent(retval.val);
|
||||
return new(mem_ctx) ir_return(retval.val);
|
||||
}
|
||||
|
||||
ir_swizzle *
|
||||
swizzle(operand a, int swizzle, int components)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -125,6 +125,8 @@ ir_assignment *assign(deref lhs, operand rhs, int writemask);
|
|||
ir_assignment *assign(deref lhs, operand rhs, operand condition);
|
||||
ir_assignment *assign(deref lhs, operand rhs, operand condition, int writemask);
|
||||
|
||||
ir_return *ret(operand retval);
|
||||
|
||||
ir_expression *expr(ir_expression_operation op, operand a);
|
||||
ir_expression *expr(ir_expression_operation op, operand a, operand b);
|
||||
ir_expression *expr(ir_expression_operation op, operand a, operand b, operand c);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue