Skip to content
Snippets Groups Projects
Commit ae3df158 authored by Elizabeth Figura's avatar Elizabeth Figura Committed by Alexandre Julliard
Browse files

vkd3d-shader: Fold negations of constant integers.

parent b956efca
No related branches found
No related tags found
No related merge requests found
......@@ -401,6 +401,11 @@ static bool fold_constants(struct hlsl_ctx *ctx, struct hlsl_ir_node *instr, voi
{
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:
for (i = 0; i < instr->data_type->dimx; ++i)
res->value.u[i] = arg1->value.u[i] + arg2->value.u[i];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment