vkd3d-shader/hlsl: Add support for ternary operator.

This commit is contained in:
Nikolay Sivov
2023-04-03 23:15:00 +02:00
committed by Alexandre Julliard
parent 725d408974
commit c190c184ce
Notes: Alexandre Julliard 2023-04-06 22:23:07 +02:00
Approved-by: Zebediah Figura (@zfigura)
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/139
3 changed files with 26 additions and 1 deletions

View File

@@ -5743,7 +5743,16 @@ conditional_expr:
logicor_expr
| logicor_expr '?' expr ':' assignment_expr
{
hlsl_fixme(ctx, &@$, "Ternary operator.");
struct hlsl_ir_node *cond = node_from_list($1), *first = node_from_list($3), *second = node_from_list($5);
list_move_tail($1, $3);
list_move_tail($1, $5);
vkd3d_free($3);
vkd3d_free($5);
if (!hlsl_add_conditional(ctx, $1, cond, first, second))
YYABORT;
$$ = $1;
}
assignment_expr: