HLSL: Stop flattening non-IO structs containing opaques.

This makes struct returns from functions work, but breaks
structs containing arrays, due to limitations in subsequent
transforms in spirv-opt. This is expected to be fixed soon.
This commit is contained in:
John Kessenich
2017-11-16 16:03:18 -07:00
parent 471bfed062
commit dc005fb083
18 changed files with 1610 additions and 1419 deletions

View File

@@ -2,37 +2,43 @@ hlsl.partialFlattenMixed.vert
WARNING: AST will form illegal SPIR-V; need to transform to legalize
// Module Version 10000
// Generated by (magic number): 80002
// Id's are bound by 31
// Id's are bound by 36
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Vertex 4 "main" 27 30
EntryPoint Vertex 4 "main" 32 35
Source HLSL 500
Name 4 "main"
Name 20 "tex"
Name 27 "pos"
Name 30 "@entryPointOutput"
Decorate 20(tex) DescriptorSet 0
Decorate 27(pos) Location 0
Decorate 30(@entryPointOutput) BuiltIn Position
Name 18 "Packed"
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
3: TypeFunction 2
6: TypeFloat 32
7: TypeVector 6(float) 4
13: TypeImage 6(float) 2D sampled format:Unknown
14: TypeInt 32 0
15: 14(int) Constant 2
16: TypeArray 13 15
19: TypePointer UniformConstant 16
20(tex): 19(ptr) Variable UniformConstant
26: TypePointer Input 7(fvec4)
27(pos): 26(ptr) Variable Input
29: TypePointer Output 7(fvec4)
30(@entryPointOutput): 29(ptr) Variable Output
13: TypeInt 32 1
14: TypeImage 6(float) 2D sampled format:Unknown
15: TypeInt 32 0
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)
35(@entryPointOutput): 34(ptr) Variable Output
4(main): 2 Function None 3
5: Label
28: 7(fvec4) Load 27(pos)
Store 30(@entryPointOutput) 28
33: 7(fvec4) Load 32(pos)
Store 35(@entryPointOutput) 33
Return
FunctionEnd