HLSL Legalization: Add scalar replacement

This allow for propagation through structs with dynamically indexed
arrays. This supports recent removal of non-io struct flattening.
This commit is contained in:
GregF
2017-12-21 10:55:57 -07:00
parent 3b2dc1a756
commit e0639287df
7 changed files with 33 additions and 57 deletions

View File

@@ -2,7 +2,7 @@ hlsl.partialFlattenMixed.vert
WARNING: AST will form illegal SPIR-V; need to transform to legalize
// Module Version 10000
// Generated by (magic number): 80003
// Id's are bound by 36
// Id's are bound by 45
Capability Shader
1: ExtInstImport "GLSL.std.450"
@@ -14,10 +14,8 @@ WARNING: AST will form illegal SPIR-V; need to transform to legalize
MemberName 18(Packed) 0 "a"
MemberName 18(Packed) 1 "membTex"
MemberName 18(Packed) 2 "b"
Name 23 "tex"
Name 32 "pos"
Name 35 "@entryPointOutput"
Decorate 23(tex) DescriptorSet 0
Decorate 32(pos) Location 0
Decorate 35(@entryPointOutput) BuiltIn Position
2: TypeVoid
@@ -30,8 +28,6 @@ WARNING: AST will form illegal SPIR-V; need to transform to legalize
16: 15(int) Constant 2
17: TypeArray 14 16
18(Packed): TypeStruct 13(int) 17 13(int)
22: TypePointer UniformConstant 17
23(tex): 22(ptr) Variable UniformConstant
31: TypePointer Input 7(fvec4)
32(pos): 31(ptr) Variable Input
34: TypePointer Output 7(fvec4)