From a7a09ac5ef25bed2df44f1d19951e3e0e5d77b63 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Fri, 11 Nov 2022 18:56:40 -0600 Subject: [PATCH] vkd3d-shader/hlsl: Pass hlsl_constant_value and hlsl_type pointers to fold_bit_xor(). --- libs/vkd3d-shader/hlsl_constant_ops.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/libs/vkd3d-shader/hlsl_constant_ops.c b/libs/vkd3d-shader/hlsl_constant_ops.c index 9fa2acd5..6dab6741 100644 --- a/libs/vkd3d-shader/hlsl_constant_ops.c +++ b/libs/vkd3d-shader/hlsl_constant_ops.c @@ -464,26 +464,26 @@ static bool fold_min(struct hlsl_ctx *ctx, struct hlsl_constant_value *dst, cons return true; } -static bool fold_bit_xor(struct hlsl_ctx *ctx, struct hlsl_ir_constant *dst, - struct hlsl_ir_constant *src1, struct hlsl_ir_constant *src2) +static bool fold_bit_xor(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); assert(type == src2->node.data_type->base_type); - for (k = 0; k < dst->node.data_type->dimx; ++k) + for (k = 0; k < dst_type->dimx; ++k) { switch (type) { 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 bit xor for type %s.\n", debug_hlsl_type(ctx, dst->node.data_type)); + FIXME("Fold bit xor for type %s.\n", debug_hlsl_type(ctx, dst_type)); return false; } } @@ -617,7 +617,7 @@ bool hlsl_fold_constant_exprs(struct hlsl_ctx *ctx, struct hlsl_ir_node *instr, break; case HLSL_OP2_BIT_XOR: - success = fold_bit_xor(ctx, res, arg1, arg2); + success = fold_bit_xor(ctx, &res->value, instr->data_type, arg1, arg2); break; case HLSL_OP2_BIT_AND: