mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-04 02:40:11 +01:00
ir_constant_expression: Add support for the "outerProduct" builtin.
This commit is contained in:
parent
5d255e24b2
commit
7ddee6a535
1 changed files with 8 additions and 1 deletions
|
|
@ -1043,7 +1043,14 @@ ir_call::constant_expression_value()
|
|||
}
|
||||
}
|
||||
} else if (strcmp(callee, "outerProduct") == 0) {
|
||||
return NULL; /* FINISHME: implement this */
|
||||
assert(op[0]->type->is_vector() && op[1]->type->is_vector());
|
||||
const unsigned m = op[0]->type->vector_elements;
|
||||
const unsigned n = op[1]->type->vector_elements;
|
||||
for (unsigned j = 0; j < n; j++) {
|
||||
for (unsigned i = 0; i < m; i++) {
|
||||
data.f[i+m*j] = op[0]->value.f[i] * op[1]->value.f[j];
|
||||
}
|
||||
}
|
||||
} else if (strcmp(callee, "pow") == 0) {
|
||||
expr = new(mem_ctx) ir_expression(ir_binop_pow, type, op[0], op[1]);
|
||||
} else if (strcmp(callee, "radians") == 0) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue