mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 00:58:05 +02:00
ir_constant_expression: Add support for the "greaterThanEqual" builtin.
This commit is contained in:
parent
7f042b9812
commit
557827340a
1 changed files with 16 additions and 1 deletions
|
|
@ -910,7 +910,22 @@ ir_call::constant_expression_value()
|
|||
}
|
||||
}
|
||||
} else if (strcmp(callee, "greaterThanEqual") == 0) {
|
||||
return NULL; /* FINISHME: implement this */
|
||||
assert(op[0]->type->is_vector() && op[1] && op[1]->type->is_vector());
|
||||
for (unsigned c = 0; c < op[0]->type->components(); c++) {
|
||||
switch (op[0]->type->base_type) {
|
||||
case GLSL_TYPE_UINT:
|
||||
data.b[c] = op[0]->value.u[c] >= op[1]->value.u[c];
|
||||
break;
|
||||
case GLSL_TYPE_INT:
|
||||
data.b[c] = op[0]->value.i[c] >= op[1]->value.i[c];
|
||||
break;
|
||||
case GLSL_TYPE_FLOAT:
|
||||
data.b[c] = op[0]->value.f[c] >= op[1]->value.f[c];
|
||||
break;
|
||||
default:
|
||||
assert(!"Should not get here.");
|
||||
}
|
||||
}
|
||||
} else if (strcmp(callee, "inversesqrt") == 0) {
|
||||
expr = new(mem_ctx) ir_expression(ir_unop_rsq, type, op[0], NULL);
|
||||
} else if (strcmp(callee, "length") == 0) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue