mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-26 17:10:11 +01:00
glsl: Implement constant expr evaluation for bitwise-not
Implement by adding a case to ir_expression::constant_expression_value() for ir_unop_bit_not.
This commit is contained in:
parent
5c4c36f7f3
commit
90a8b792c0
1 changed files with 15 additions and 0 deletions
|
|
@ -100,6 +100,21 @@ ir_expression::constant_expression_value()
|
|||
}
|
||||
|
||||
switch (this->operation) {
|
||||
case ir_unop_bit_not:
|
||||
switch (op[0]->type->base_type) {
|
||||
case GLSL_TYPE_INT:
|
||||
for (unsigned c = 0; c < components; c++)
|
||||
data.i[c] = ~ op[0]->value.i[c];
|
||||
break;
|
||||
case GLSL_TYPE_UINT:
|
||||
for (unsigned c = 0; c < components; c++)
|
||||
data.u[c] = ~ op[0]->value.u[c];
|
||||
break;
|
||||
default:
|
||||
assert(0);
|
||||
}
|
||||
break;
|
||||
|
||||
case ir_unop_logic_not:
|
||||
assert(op[0]->type->base_type == GLSL_TYPE_BOOL);
|
||||
for (unsigned c = 0; c < op[0]->type->components(); c++)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue