diff options
author | Matt Turner <[email protected]> | 2013-08-19 10:45:46 -0700 |
---|---|---|
committer | Matt Turner <[email protected]> | 2013-09-09 15:01:08 -0700 |
commit | 7aaa38728f93bfb69573e0d866f24e8cb41836f0 (patch) | |
tree | f4de2a2d80ac24087c37dea60b37fe41d9745644 /src/glsl/ir_validate.cpp | |
parent | 60850b7b9fbb9827d6841dbd4a4cd9b1e3554d45 (diff) |
glsl: Add conditional-select IR.
It's a ?: that operates per-component on vectors. Will be used in
upcoming lowering pass for ldexp and the implementation of frexp.
csel(selector, a, b):
per-component result = selector ? a : b
Reviewed-by: Kenneth Graunke <[email protected]>
Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/glsl/ir_validate.cpp')
-rw-r--r-- | src/glsl/ir_validate.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/glsl/ir_validate.cpp b/src/glsl/ir_validate.cpp index 37f26febe55..ae3f09daf43 100644 --- a/src/glsl/ir_validate.cpp +++ b/src/glsl/ir_validate.cpp @@ -529,6 +529,13 @@ ir_validate::visit_leave(ir_expression *ir) assert(ir->operands[2]->type == ir->operands[0]->type || ir->operands[2]->type == glsl_type::float_type); break; + case ir_triop_csel: + assert(ir->operands[0]->type->base_type == GLSL_TYPE_BOOL); + assert(ir->type->vector_elements == ir->operands[0]->type->vector_elements); + assert(ir->type == ir->operands[1]->type); + assert(ir->type == ir->operands[2]->type); + break; + case ir_triop_bfi: assert(ir->operands[0]->type->is_integer()); assert(ir->operands[1]->type == ir->operands[2]->type); |