diff options
author | Chad Versace <[email protected]> | 2013-01-11 15:53:11 -0800 |
---|---|---|
committer | Chad Versace <[email protected]> | 2013-01-24 21:24:10 -0800 |
commit | f859e4fbd1424a5f4ba6ff01c1e896034cc7815f (patch) | |
tree | 14a1768e0370b4e13377011a10601d8faccdcb6d /src/glsl/ir_builder.h | |
parent | a32bc53029414ec952c9adcb21da52c021687f08 (diff) |
glsl/ir_builder: Add helpers for making if-statements
Add two overloaded variants of
ir_if *if_tree()
The new functions allow one to chain together if-trees within a single C++
expression that resembles a real if-statement.
Reviewed-by: Ian Romanick <[email protected]>
Signed-off-by: Chad Versace <[email protected]>
Diffstat (limited to 'src/glsl/ir_builder.h')
-rw-r--r-- | src/glsl/ir_builder.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/glsl/ir_builder.h b/src/glsl/ir_builder.h index 82e37628ec7..690ac74ebcd 100644 --- a/src/glsl/ir_builder.h +++ b/src/glsl/ir_builder.h @@ -174,4 +174,10 @@ ir_swizzle *swizzle_xy(operand a); ir_swizzle *swizzle_xyz(operand a); ir_swizzle *swizzle_xyzw(operand a); +ir_if *if_tree(operand condition, + ir_instruction *then_branch); +ir_if *if_tree(operand condition, + ir_instruction *then_branch, + ir_instruction *else_branch); + } /* namespace ir_builder */ |