vkd3d-shader/hlsl: Declare vars individually when parsing regular declarations.

In a declaration with multiple variables, the variables must be created
before the initializer of the next variable is parsed. This is required
for initializers such as:

    float a = 1, b = a, c = b + 1;

A requisite for this is that the type information is parsed in the same
rule as the first variable (as a variable_def_typed) so it is
immediately available to declare the first variable. Then, the next
untyped variable declaration is parsed, and the type from the first
variable can be used to declare the second, before the third is parsed,
and so on.
This commit is contained in:
Francisco Casas
2023-06-26 15:38:10 -04:00
committed by Alexandre Julliard
parent a34cf2e64e
commit 62c891b796
Notes: Alexandre Julliard 2023-07-04 23:25:04 +02:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Zebediah Figura (@zfigura)
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/250
2 changed files with 62 additions and 21 deletions

View File

@ -1,4 +1,4 @@
[pixel shader todo]
[pixel shader]
float4 main() : sv_target
{
float a = 2.0, b = a + 1.0, c = b;
@ -7,7 +7,7 @@ float4 main() : sv_target
}
[test]
todo draw quad
draw quad
probe all rgba (2, 3, 3, 0)