mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-01-28 13:05:02 -08:00
vkd3d-shader/hlsl: Use hlsl_new_constant() in more places.
This commit is contained in:
parent
f8da100052
commit
b74a546034
Notes:
Alexandre Julliard
2022-10-18 00:13:00 +02:00
Approved-by: Giovanni Mascellani (@giomasce) Approved-by: Henri Verbeet (@hverbeet) Approved-by: Alexandre Julliard (@julliard) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/22
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user