Module: vkd3d Branch: master Commit: b74a5460341090a9c485e7d73a75596326e25d54 URL: https://gitlab.winehq.org/wine/vkd3d/-/commit/b74a5460341090a9c485e7d73a7559...
Author: Zebediah Figura zfigura@codeweavers.com Date: Mon Sep 26 19:13:29 2022 -0500
vkd3d-shader/hlsl: Use hlsl_new_constant() in more places.
---
libs/vkd3d-shader/hlsl_constant_ops.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/libs/vkd3d-shader/hlsl_constant_ops.c b/libs/vkd3d-shader/hlsl_constant_ops.c index 7ca63a3e..858f020c 100644 --- a/libs/vkd3d-shader/hlsl_constant_ops.c +++ b/libs/vkd3d-shader/hlsl_constant_ops.c @@ -526,9 +526,8 @@ bool hlsl_fold_constant_exprs(struct hlsl_ctx *ctx, struct hlsl_ir_node *instr, if (expr->operands[1].node) arg2 = hlsl_ir_constant(expr->operands[1].node);
- if (!(res = hlsl_alloc(ctx, sizeof(*res)))) + if (!(res = hlsl_new_constant(ctx, instr->data_type, &instr->loc))) return false; - init_node(&res->node, HLSL_IR_CONSTANT, instr->data_type, instr->loc);
switch (expr->op) { @@ -611,9 +610,8 @@ bool hlsl_fold_constant_swizzles(struct hlsl_ctx *ctx, struct hlsl_ir_node *inst return false; value = hlsl_ir_constant(swizzle->val.node);
- if (!(res = hlsl_alloc(ctx, sizeof(*res)))) + if (!(res = hlsl_new_constant(ctx, instr->data_type, &instr->loc))) return false; - init_node(&res->node, HLSL_IR_CONSTANT, instr->data_type, instr->loc);
swizzle_bits = swizzle->swizzle; for (i = 0; i < swizzle->node.data_type->dimx; ++i)