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,49 +2,54 @@ hlsl.aliasOpaque.frag
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 81
// Id's are bound by 87
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 57
EntryPoint Fragment 4 "main" 62
ExecutionMode 4 OriginUpperLeft
Source HLSL 500
Name 4 "main"
Name 37 "gss2"
Name 39 "gss"
Name 43 "gtex"
Name 57 "@entryPointOutput"
Decorate 37(gss2) DescriptorSet 0
Decorate 39(gss) DescriptorSet 0
Decorate 43(gtex) DescriptorSet 0
Decorate 57(@entryPointOutput) Location 0
Name 9 "OS"
MemberName 9(OS) 0 "ss"
MemberName 9(OS) 1 "a"
MemberName 9(OS) 2 "tex"
Name 44 "gss2"
Name 47 "gss"
Name 51 "gtex"
Name 62 "@entryPointOutput"
Decorate 44(gss2) DescriptorSet 0
Decorate 47(gss) DescriptorSet 0
Decorate 51(gtex) DescriptorSet 0
Decorate 62(@entryPointOutput) Location 0
2: TypeVoid
3: TypeFunction 2
6: TypeSampler
8: TypeFloat 32
10: TypeImage 8(float) 2D sampled format:Unknown
12: TypeVector 8(float) 4
25: TypeSampledImage 10
27: TypeVector 8(float) 2
28: 8(float) Constant 1045220557
29: 8(float) Constant 1050253722
30: 27(fvec2) ConstantComposite 28 29
36: TypePointer UniformConstant 6
37(gss2): 36(ptr) Variable UniformConstant
39(gss): 36(ptr) Variable UniformConstant
42: TypePointer UniformConstant 10
43(gtex): 42(ptr) Variable UniformConstant
46: 8(float) Constant 1077936128
56: TypePointer Output 12(fvec4)
57(@entryPointOutput): 56(ptr) Variable Output
7: TypeFloat 32
8: TypeImage 7(float) 2D sampled format:Unknown
9(OS): TypeStruct 6 7(float) 8
11: TypeVector 7(float) 4
32: TypeSampledImage 8
34: TypeVector 7(float) 2
35: 7(float) Constant 1045220557
36: 7(float) Constant 1050253722
37: 34(fvec2) ConstantComposite 35 36
43: TypePointer UniformConstant 6
44(gss2): 43(ptr) Variable UniformConstant
47(gss): 43(ptr) Variable UniformConstant
50: TypePointer UniformConstant 8
51(gtex): 50(ptr) Variable UniformConstant
54: 7(float) Constant 1077936128
61: TypePointer Output 11(fvec4)
62(@entryPointOutput): 61(ptr) Variable Output
4(main): 2 Function None 3
5: Label
68: 6 Load 39(gss)
69: 10 Load 43(gtex)
78: 25 SampledImage 69 68
79: 12(fvec4) ImageSampleImplicitLod 78 30
80: 12(fvec4) VectorTimesScalar 79 46
Store 57(@entryPointOutput) 80
70: 6 Load 47(gss)
72: 8 Load 51(gtex)
84: 32 SampledImage 72 70
85: 11(fvec4) ImageSampleImplicitLod 84 37
86: 11(fvec4) VectorTimesScalar 85 54
Store 62(@entryPointOutput) 86
Return
FunctionEnd