vkd3d-shader/hlsl: Return an "error" expression when constructing an arithmetic expression from incompatible types.

This commit is contained in:
Elizabeth Figura
2024-09-12 21:42:46 -05:00
committed by Henri Verbeet
parent c43e5c8eb5
commit 7e3231c749
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
3 changed files with 24 additions and 1 deletions

View File

@@ -1756,7 +1756,11 @@ static struct hlsl_ir_node *add_binary_arithmetic_expr(struct hlsl_ctx *ctx, str
struct hlsl_ir_node *args[HLSL_MAX_OPERANDS] = {0};
struct hlsl_type *common_type;
common_type = get_common_numeric_type(ctx, arg1, arg2, loc);
if (!(common_type = get_common_numeric_type(ctx, arg1, arg2, loc)))
{
block->value = ctx->error_instr;
return block->value;
}
if (!(args[0] = add_implicit_conversion(ctx, block, arg1, common_type, loc)))
return NULL;