mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-01-28 13:05:02 -08:00
vkd3d-shader/hlsl: Check types when folding constants.
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com> Signed-off-by: Francisco Casas <fcasas@codeweavers.com> Signed-off-by: Zebediah Figura <zfigura@codeweavers.com> Signed-off-by: Matteo Bruni <mbruni@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
bc7c89bc1f
commit
4739cf1d33
@ -236,10 +236,17 @@ bool hlsl_fold_constants(struct hlsl_ctx *ctx, struct hlsl_ir_node *instr, void
|
||||
return false;
|
||||
expr = hlsl_ir_expr(instr);
|
||||
|
||||
if (instr->data_type->type > HLSL_CLASS_VECTOR)
|
||||
return false;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(expr->operands); ++i)
|
||||
{
|
||||
if (expr->operands[i].node && expr->operands[i].node->type != HLSL_IR_CONSTANT)
|
||||
return false;
|
||||
if (expr->operands[i].node)
|
||||
{
|
||||
if (expr->operands[i].node->type != HLSL_IR_CONSTANT)
|
||||
return false;
|
||||
assert(expr->operands[i].node->data_type->type <= HLSL_CLASS_VECTOR);
|
||||
}
|
||||
}
|
||||
arg1 = hlsl_ir_constant(expr->operands[0].node);
|
||||
if (expr->operands[1].node)
|
||||
|
Loading…
x
Reference in New Issue
Block a user