vkd3d-shader/hlsl: Handle error expressions in unary expressions.

This commit is contained in:
Elizabeth Figura 2024-08-29 12:48:23 -05:00 committed by Henri Verbeet
parent 7e3231c749
commit 43b714d896
Notes: Henri Verbeet 2024-09-23 15:55:59 +02:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1071

View File

@ -1710,12 +1710,18 @@ static struct hlsl_ir_node *add_unary_arithmetic_expr(struct hlsl_ctx *ctx, stru
{
struct hlsl_ir_node *args[HLSL_MAX_OPERANDS] = {arg};
if (arg->data_type->class == HLSL_CLASS_ERROR)
return arg;
return add_expr(ctx, block, op, args, arg->data_type, loc);
}
static struct hlsl_ir_node *add_unary_bitwise_expr(struct hlsl_ctx *ctx, struct hlsl_block *block,
enum hlsl_ir_expr_op op, struct hlsl_ir_node *arg, const struct vkd3d_shader_location *loc)
{
if (arg->data_type->class == HLSL_CLASS_ERROR)
return arg;
check_integer_type(ctx, arg);
return add_unary_arithmetic_expr(ctx, block, op, arg, loc);
@ -1727,6 +1733,9 @@ static struct hlsl_ir_node *add_unary_logical_expr(struct hlsl_ctx *ctx, struct
struct hlsl_ir_node *args[HLSL_MAX_OPERANDS] = {0};
struct hlsl_type *bool_type;
if (arg->data_type->class == HLSL_CLASS_ERROR)
return arg;
bool_type = hlsl_get_numeric_type(ctx, arg->data_type->class, HLSL_TYPE_BOOL,
arg->data_type->dimx, arg->data_type->dimy);