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,48 +2,48 @@ hlsl.flattenOpaqueInitMix.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 100
// Id's are bound by 80
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Vertex 4 "main" 68
EntryPoint Vertex 4 "main" 57
Source HLSL 500
Name 4 "main"
Name 34 "FxaaTex"
MemberName 34(FxaaTex) 0 "smpl"
MemberName 34(FxaaTex) 1 "tex"
MemberName 34(FxaaTex) 2 "f"
Name 38 "g_tInputTexture_sampler"
Name 41 "g_tInputTexture"
Name 68 "@entryPointOutput"
Decorate 38(g_tInputTexture_sampler) DescriptorSet 0
Decorate 41(g_tInputTexture) DescriptorSet 0
Decorate 68(@entryPointOutput) Location 0
Name 9 "FxaaTex"
MemberName 9(FxaaTex) 0 "smpl"
MemberName 9(FxaaTex) 1 "tex"
MemberName 9(FxaaTex) 2 "f"
Name 44 "g_tInputTexture_sampler"
Name 47 "g_tInputTexture"
Name 57 "@entryPointOutput"
Decorate 44(g_tInputTexture_sampler) DescriptorSet 0
Decorate 47(g_tInputTexture) DescriptorSet 0
Decorate 57(@entryPointOutput) Location 0
2: TypeVoid
3: TypeFunction 2
6: TypeSampler
8: TypeFloat 32
9: TypeImage 8(float) 2D sampled format:Unknown
12: TypeVector 8(float) 4
24: TypeSampledImage 9
28: TypeVector 8(float) 2
30: 8(float) Constant 0
34(FxaaTex): TypeStruct 6 9 8(float)
37: TypePointer UniformConstant 6
38(g_tInputTexture_sampler): 37(ptr) Variable UniformConstant
40: TypePointer UniformConstant 9
41(g_tInputTexture): 40(ptr) Variable UniformConstant
43: 8(float) Constant 1056964608
67: TypePointer Output 12(fvec4)
68(@entryPointOutput): 67(ptr) Variable Output
7: TypeFloat 32
8: TypeImage 7(float) 2D sampled format:Unknown
9(FxaaTex): TypeStruct 6 8 7(float)
11: TypeVector 7(float) 4
28: TypeSampledImage 8
36: TypeVector 7(float) 2
38: 7(float) Constant 0
43: TypePointer UniformConstant 6
44(g_tInputTexture_sampler): 43(ptr) Variable UniformConstant
46: TypePointer UniformConstant 8
47(g_tInputTexture): 46(ptr) Variable UniformConstant
49: 7(float) Constant 1056964608
56: TypePointer Output 11(fvec4)
57(@entryPointOutput): 56(ptr) Variable Output
4(main): 2 Function None 3
5: Label
79: 6 Load 38(g_tInputTexture_sampler)
80: 9 Load 41(g_tInputTexture)
95: 24 SampledImage 80 79
98: 28(fvec2) CompositeConstruct 43 43
99: 12(fvec4) ImageSampleExplicitLod 95 98 Lod 30
Store 68(@entryPointOutput) 99
63: 6 Load 44(g_tInputTexture_sampler)
64: 8 Load 47(g_tInputTexture)
73: 28 SampledImage 64 63
78: 36(fvec2) CompositeConstruct 49 49
79: 11(fvec4) ImageSampleExplicitLod 73 78 Lod 38
Store 57(@entryPointOutput) 79
Return
FunctionEnd