HLSL: Fix #954: Track/access subsets of flattened multi-level aggregates.

Works in conjuction with d1be754 to represent and modify a partially
dereferenced multi-level flattened aggregate.
This commit is contained in:
John Kessenich
2017-10-04 13:27:43 -06:00
parent 86a82bb955
commit 700bdeb742
7 changed files with 513 additions and 23 deletions

24
Test/hlsl.flattenSubset2.frag Executable file
View File

@@ -0,0 +1,24 @@
struct Nested { float y; Texture2D texNested; };
struct A { Nested n; float x; };
struct B { Nested n; Texture2D tex; };
Texture2D someTex;
float4 main(float4 vpos : VPOS) : COLOR0
{
A a1, a2;
B b;
// Assignment of nested structs to nested structs
a1.n = a2.n;
b .n = a1.n;
// Assignment of nested struct to standalone
Nested n = b.n;
// Assignment to nestested struct members
a2.n.texNested = someTex;
a1.n.y = 1.0;
return float4(0,0,0,0);
}