From 9a8f6e0edb6df225c58520eca981fc0ef2e1d0a4 Mon Sep 17 00:00:00 2001 From: Francisco Casas Date: Thu, 16 Nov 2023 12:06:40 -0300 Subject: [PATCH] vkd3d-shader/hlsl: Parse integers with the 'u' postfix. --- libs/vkd3d-shader/hlsl.l | 6 +++--- tests/hlsl/initializer-numeric.shader_test | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/libs/vkd3d-shader/hlsl.l b/libs/vkd3d-shader/hlsl.l index 0e5f2bb6..c3570990 100644 --- a/libs/vkd3d-shader/hlsl.l +++ b/libs/vkd3d-shader/hlsl.l @@ -203,15 +203,15 @@ while {return KW_WHILE; } yylval->floatval = atof(yytext); return C_FLOAT; } -0x[0-9a-fA-F]+ { +0x[0-9a-fA-F]+[uU]? { yylval->intval = vkd3d_parse_integer(yytext); return C_INTEGER; } -0[0-7]+ { +0[0-7]+[uU]? { yylval->intval = vkd3d_parse_integer(yytext); return C_INTEGER; } -[0-9]+ { +[0-9]+[uU]? { yylval->intval = vkd3d_parse_integer(yytext); return C_INTEGER; } diff --git a/tests/hlsl/initializer-numeric.shader_test b/tests/hlsl/initializer-numeric.shader_test index d480b9d1..81d19d06 100644 --- a/tests/hlsl/initializer-numeric.shader_test +++ b/tests/hlsl/initializer-numeric.shader_test @@ -48,7 +48,7 @@ draw quad probe all rgba (10.1, 1.1, 1.2, 2.1) 4 -[pixel shader todo] +[pixel shader] float4 main() : sv_target { float4 aa = { 3U, 0xfau, 020u, -1u}; @@ -56,14 +56,14 @@ float4 main() : sv_target } [test] -todo(sm<6) draw quad +draw quad todo(sm<6) probe all rgba (3.0, 250.0, 16.0, 4.2949673e+009) 4 [require] shader model < 6.0 -[pixel shader todo] +[pixel shader] float4 main() : sv_target { // 3000000000 is -1294967296 when it doesn't have the 'u' suffix, except in SM6. @@ -72,5 +72,5 @@ float4 main() : sv_target } [test] -todo draw quad +draw quad todo probe all rgba (-1294967296.0, 3000000000.0, 0.0, 0.0) 4