vkd3d-shader/hlsl: Fix floating point literals matching.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Giovanni Mascellani <gmascellani@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2022-02-08 09:52:15 +03:00 committed by Alexandre Julliard
parent 73e27ced37
commit a4ca091888
2 changed files with 14 additions and 1 deletions

View File

@ -192,7 +192,7 @@ row_major {return KW_ROW_MAJOR; }
yylval->floatval = atof(yytext);
return C_FLOAT;
}
[0-9]+([eE][+-]?[0-9]+)?[h|H|f|F] {
[0-9]+[eE][+-]?[0-9]+[h|H|f|F]? {
yylval->floatval = atof(yytext);
return C_FLOAT;
}

View File

@ -33,3 +33,16 @@ float4 main() : sv_target
[test]
draw quad
probe all rgba (1.0, 2.0, 3.0, 4.0) 4
[pixel shader]
float4 main() : sv_target
{
float4 aa = { 1e1, 1e-1, 1., 2.f };
float4 bb = { .1, .1e1, .2f, 1.e-1f };
return aa + bb;
}
[test]
draw quad
probe all rgba (10.1, 1.1, 1.2, 2.1) 4