vkd3d-shader/hlsl: Handle scalar values in ternaries.

This commit is contained in:
Zebediah Figura
2024-01-16 18:14:30 -06:00
committed by Alexandre Julliard
parent 11112798c8
commit 275901557c
Notes: Alexandre Julliard 2024-01-18 23:20:41 +01: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/571
2 changed files with 9 additions and 4 deletions

View File

@@ -4115,6 +4115,11 @@ static bool add_ternary(struct hlsl_ctx *ctx, struct hlsl_block *block,
if (!(cond = add_implicit_conversion(ctx, block, cond, cond_type, &cond->loc)))
return false;
}
else if (common_type->dimx == 1 && common_type->dimy == 1)
{
common_type = hlsl_get_numeric_type(ctx, cond_type->class,
common_type->base_type, cond_type->dimx, cond_type->dimy);
}
if (!(first = add_implicit_conversion(ctx, block, first, common_type, &first->loc)))
return false;