diff options
Diffstat (limited to 'mesalib/src/glsl/ir_constant_expression.cpp')
-rw-r--r-- | mesalib/src/glsl/ir_constant_expression.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/mesalib/src/glsl/ir_constant_expression.cpp b/mesalib/src/glsl/ir_constant_expression.cpp index bf019b955..a67470bf3 100644 --- a/mesalib/src/glsl/ir_constant_expression.cpp +++ b/mesalib/src/glsl/ir_constant_expression.cpp @@ -395,6 +395,7 @@ ir_expression::constant_expression_value(struct hash_table *variable_context) case ir_binop_lshift: case ir_binop_rshift: case ir_binop_vector_extract: + case ir_triop_csel: case ir_triop_bitfield_extract: break; @@ -1399,6 +1400,13 @@ ir_expression::constant_expression_value(struct hash_table *variable_context) break; } + case ir_triop_csel: + for (unsigned c = 0; c < components; c++) { + data.u[c] = op[0]->value.b[c] ? op[1]->value.u[c] + : op[2]->value.u[c]; + } + break; + case ir_triop_vector_insert: { const unsigned idx = op[2]->value.u[0]; @@ -1840,7 +1848,7 @@ ir_function_signature::constant_expression_value(exec_list *actual_parameters, s * "Function calls to user-defined functions (non-built-in functions) * cannot be used to form constant expressions." */ - if (!this->is_builtin) + if (!this->is_builtin()) return NULL; /* |