From: Zebediah Figura zfigura@codeweavers.com
--- libs/vkd3d-shader/hlsl_constant_ops.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/libs/vkd3d-shader/hlsl_constant_ops.c b/libs/vkd3d-shader/hlsl_constant_ops.c index 24ebbf8d..015b2222 100644 --- a/libs/vkd3d-shader/hlsl_constant_ops.c +++ b/libs/vkd3d-shader/hlsl_constant_ops.c @@ -222,10 +222,10 @@ static bool fold_add(struct hlsl_ctx *ctx, struct hlsl_constant_value *dst, cons return true; }
-static bool fold_mul(struct hlsl_ctx *ctx, struct hlsl_ir_constant *dst, - struct hlsl_ir_constant *src1, struct hlsl_ir_constant *src2) +static bool fold_mul(struct hlsl_ctx *ctx, struct hlsl_constant_value *dst, const struct hlsl_type *dst_type, + const struct hlsl_ir_constant *src1, const struct hlsl_ir_constant *src2) { - enum hlsl_base_type type = dst->node.data_type->base_type; + enum hlsl_base_type type = dst_type->base_type; unsigned int k;
assert(type == src1->node.data_type->base_type); @@ -237,20 +237,20 @@ static bool fold_mul(struct hlsl_ctx *ctx, struct hlsl_ir_constant *dst, { case HLSL_TYPE_FLOAT: case HLSL_TYPE_HALF: - dst->value.u[k].f = src1->value.u[k].f * src2->value.u[k].f; + dst->u[k].f = src1->value.u[k].f * src2->value.u[k].f; break;
case HLSL_TYPE_DOUBLE: - dst->value.u[k].d = src1->value.u[k].d * src2->value.u[k].d; + dst->u[k].d = src1->value.u[k].d * src2->value.u[k].d; break;
case HLSL_TYPE_INT: case HLSL_TYPE_UINT: - dst->value.u[k].u = src1->value.u[k].u * src2->value.u[k].u; + dst->u[k].u = src1->value.u[k].u * src2->value.u[k].u; break;
default: - FIXME("Fold multiplication for type %s.\n", debug_hlsl_type(ctx, dst->node.data_type)); + FIXME("Fold multiplication for type %s.\n", debug_hlsl_type(ctx, dst_type)); return false; } } @@ -592,7 +592,7 @@ bool hlsl_fold_constant_exprs(struct hlsl_ctx *ctx, struct hlsl_ir_node *instr, break;
case HLSL_OP2_MUL: - success = fold_mul(ctx, res, arg1, arg2); + success = fold_mul(ctx, &res->value, instr->data_type, arg1, arg2); break;
case HLSL_OP2_NEQUAL: