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

This commit is contained in:
Elizabeth Figura 2024-08-29 12:48:23 -05:00 committed by Henri Verbeet
parent d95962068a
commit eeb7bbe3c5
Notes: Henri Verbeet 2024-10-17 17:39:41 +02:00
Approved-by: Francisco Casas (@fcasas)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1185

View File

@ -5435,6 +5435,14 @@ static bool add_ternary(struct hlsl_ctx *ctx, struct hlsl_block *block,
struct hlsl_type *cond_type = cond->data_type;
struct hlsl_type *common_type;
if (cond->data_type->class == HLSL_CLASS_ERROR
|| first->data_type->class == HLSL_CLASS_ERROR
|| second->data_type->class == HLSL_CLASS_ERROR)
{
block->value = ctx->error_instr;
return true;
}
if (cond_type->class > HLSL_CLASS_LAST_NUMERIC)
{
struct vkd3d_string_buffer *string;