mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-11-21 16:46:41 -08:00
vkd3d-shader: Fold negations of constant integers.
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com> Signed-off-by: Matteo Bruni <mbruni@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
b956efcaa4
commit
ae3df158d8
@ -401,6 +401,11 @@ static bool fold_constants(struct hlsl_ctx *ctx, struct hlsl_ir_node *instr, voi
|
|||||||
{
|
{
|
||||||
switch (expr->op)
|
switch (expr->op)
|
||||||
{
|
{
|
||||||
|
case HLSL_IR_UNOP_NEG:
|
||||||
|
for (i = 0; i < instr->data_type->dimx; ++i)
|
||||||
|
res->value.u[i] = -arg1->value.u[i];
|
||||||
|
break;
|
||||||
|
|
||||||
case HLSL_IR_BINOP_ADD:
|
case HLSL_IR_BINOP_ADD:
|
||||||
for (i = 0; i < instr->data_type->dimx; ++i)
|
for (i = 0; i < instr->data_type->dimx; ++i)
|
||||||
res->value.u[i] = arg1->value.u[i] + arg2->value.u[i];
|
res->value.u[i] = arg1->value.u[i] + arg2->value.u[i];
|
||||||
|
Loading…
Reference in New Issue
Block a user