HLSL: Grammar: Recognize { } style initializers for composites.

This commit is contained in:
John Kessenich 2016-07-01 19:58:06 -06:00
parent b0a63f578a
commit 073542416c
4 changed files with 303 additions and 97 deletions

View file

@ -1,4 +1,5 @@
float4 a1 = float4(1, 0.5, 0, 1), b1 = float4(2.0, 2.5, 2.1, 2.2);
float4 a1i = {1, 0.5, 0, 1}, b1i = {2.0, 2.5, 2.1, 2.2};
float a2 = 0.2, b2;
float a3, b3 = 0.3;
float a4, b4 = 0.4, c4;
@ -7,6 +8,17 @@ float a5 = 0.5, b5, c5 = 1.5;
float4 ShaderFunction(float4 input) : COLOR0
{
float4 a2 = float4(0.2, 0.3, 0.4, 0.5);
struct S1 {
float f;
int i;
};
struct S2 {
int j;
float g;
S1 s1;
};
S2 s2i = { 9, a5, { (a3,a4), 12} }, s2 = S2(9, a5, S1((a3,a4), 12));
float a8 = (a2, b2), a9 = a5;
return input * a1;
}