vkd3d-shader/hlsl: Discern between signed and unsigned ints when parsing.

This commit is contained in:
Francisco Casas
2023-11-16 15:32:16 -03:00
committed by Alexandre Julliard
parent 1ee9e23e00
commit 4e1bf5e163
Notes: Alexandre Julliard 2023-11-22 22:49:11 +01: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/478
3 changed files with 27 additions and 5 deletions

View File

@@ -4975,6 +4975,7 @@ static void check_duplicated_switch_cases(struct hlsl_ctx *ctx, const struct hls
%token <floatval> C_FLOAT
%token <intval> C_INTEGER
%token <intval> C_UNSIGNED
%token <intval> PRE_LINE
%type <list> type_specs
@@ -6709,6 +6710,15 @@ primary_expr:
if (!($$ = make_block(ctx, c)))
YYABORT;
}
| C_UNSIGNED
{
struct hlsl_ir_node *c;
if (!(c = hlsl_new_uint_constant(ctx, $1, &@1)))
YYABORT;
if (!($$ = make_block(ctx, c)))
YYABORT;
}
| boolean
{
struct hlsl_ir_node *c;