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

View File

@@ -1,65 +1,73 @@
hlsl.flattenOpaque.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 144
// Id's are bound by 185
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 97
EntryPoint Fragment 4 "main" 120
ExecutionMode 4 OriginUpperLeft
Source HLSL 500
Name 4 "main"
Name 7 "os"
MemberName 7(os) 0 "s2D"
Name 23 "os2"
MemberName 23(os2) 0 "s2D"
MemberName 23(os2) 1 "tex"
Name 38 "tex"
Name 70 "s.s2D"
Name 79 "s2.s2D"
Name 80 "s2.tex"
Name 97 "@entryPointOutput"
Name 82 "s.s2D"
Name 97 "s2.s2D"
Name 100 "s2.tex"
Name 120 "@entryPointOutput"
Decorate 38(tex) DescriptorSet 0
Decorate 70(s.s2D) DescriptorSet 0
Decorate 79(s2.s2D) DescriptorSet 0
Decorate 80(s2.tex) DescriptorSet 0
Decorate 97(@entryPointOutput) Location 0
Decorate 82(s.s2D) DescriptorSet 0
Decorate 97(s2.s2D) DescriptorSet 0
Decorate 100(s2.tex) DescriptorSet 0
Decorate 120(@entryPointOutput) Location 0
2: TypeVoid
3: TypeFunction 2
6: TypeSampler
8: TypeFloat 32
9: TypeVector 8(float) 4
14: TypeVector 8(float) 2
21: TypeImage 8(float) 2D sampled format:Unknown
37: TypePointer UniformConstant 21
7(os): TypeStruct 6
9: TypeFloat 32
10: TypeVector 9(float) 4
15: TypeVector 9(float) 2
22: TypeImage 9(float) 2D sampled format:Unknown
23(os2): TypeStruct 6 22
37: TypePointer UniformConstant 22
38(tex): 37(ptr) Variable UniformConstant
41: TypeSampledImage 21
43: 8(float) Constant 1045220557
44: 8(float) Constant 1050253722
45: 14(fvec2) ConstantComposite 43 44
69: TypePointer UniformConstant 6
70(s.s2D): 69(ptr) Variable UniformConstant
79(s2.s2D): 69(ptr) Variable UniformConstant
80(s2.tex): 37(ptr) Variable UniformConstant
96: TypePointer Output 9(fvec4)
97(@entryPointOutput): 96(ptr) Variable Output
45: TypeSampledImage 22
47: 9(float) Constant 1045220557
48: 9(float) Constant 1050253722
49: 15(fvec2) ConstantComposite 47 48
81: TypePointer UniformConstant 6
82(s.s2D): 81(ptr) Variable UniformConstant
97(s2.s2D): 81(ptr) Variable UniformConstant
100(s2.tex): 37(ptr) Variable UniformConstant
119: TypePointer Output 10(fvec4)
120(@entryPointOutput): 119(ptr) Variable Output
4(main): 2 Function None 3
5: Label
109: 6 Load 70(s.s2D)
123: 21 Load 38(tex)
125: 41 SampledImage 123 109
126: 9(fvec4) ImageSampleImplicitLod 125 45
111: 6 Load 70(s.s2D)
128: 21 Load 38(tex)
130: 41 SampledImage 128 111
132: 9(fvec4) ImageSampleImplicitLod 130 45
113: 9(fvec4) FAdd 126 132
114: 6 Load 79(s2.s2D)
115: 21 Load 80(s2.tex)
136: 41 SampledImage 115 114
137: 9(fvec4) ImageSampleImplicitLod 136 45
117: 9(fvec4) FAdd 113 137
118: 6 Load 79(s2.s2D)
119: 21 Load 80(s2.tex)
141: 41 SampledImage 119 118
143: 9(fvec4) ImageSampleImplicitLod 141 45
121: 9(fvec4) FAdd 117 143
Store 97(@entryPointOutput) 121
134: 6 Load 82(s.s2D)
158: 22 Load 38(tex)
161: 45 SampledImage 158 134
162: 10(fvec4) ImageSampleImplicitLod 161 49
138: 6 Load 82(s.s2D)
164: 22 Load 38(tex)
167: 45 SampledImage 164 138
169: 10(fvec4) ImageSampleImplicitLod 167 49
142: 10(fvec4) FAdd 162 169
143: 6 Load 97(s2.s2D)
145: 22 Load 100(s2.tex)
175: 45 SampledImage 145 143
176: 10(fvec4) ImageSampleImplicitLod 175 49
149: 10(fvec4) FAdd 142 176
150: 6 Load 97(s2.s2D)
152: 22 Load 100(s2.tex)
182: 45 SampledImage 152 150
184: 10(fvec4) ImageSampleImplicitLod 182 49
156: 10(fvec4) FAdd 149 184
Store 120(@entryPointOutput) 156
Return
FunctionEnd

View File

@@ -2,57 +2,56 @@ hlsl.flattenOpaqueInit.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 176
// Id's are bound by 134
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Vertex 4 "main" 99
EntryPoint Vertex 4 "main" 80
Source HLSL 500
Name 4 "main"
Name 17 "FxaaTex"
MemberName 17(FxaaTex) 0 "smpl"
MemberName 17(FxaaTex) 1 "tex"
Name 38 "g_tInputTexture_sampler"
Name 42 "g_tInputTexture"
Name 99 "@entryPointOutput"
Decorate 38(g_tInputTexture_sampler) DescriptorSet 0
Decorate 42(g_tInputTexture) DescriptorSet 0
Decorate 99(@entryPointOutput) Location 0
Name 9 "FxaaTex"
MemberName 9(FxaaTex) 0 "smpl"
MemberName 9(FxaaTex) 1 "tex"
Name 43 "g_tInputTexture_sampler"
Name 47 "g_tInputTexture"
Name 80 "@entryPointOutput"
Decorate 43(g_tInputTexture_sampler) DescriptorSet 0
Decorate 47(g_tInputTexture) DescriptorSet 0
Decorate 80(@entryPointOutput) Location 0
2: TypeVoid
3: TypeFunction 2
6: TypeSampler
8: TypeFloat 32
9: TypeImage 8(float) 2D sampled format:Unknown
11: TypeVector 8(float) 4
17(FxaaTex): TypeStruct 6 9
26: TypeSampledImage 9
28: TypeVector 8(float) 2
29: 8(float) Constant 1050253722
30: 8(float) Constant 1053609165
31: 28(fvec2) ConstantComposite 29 30
32: 8(float) Constant 0
37: TypePointer UniformConstant 6
38(g_tInputTexture_sampler): 37(ptr) Variable UniformConstant
41: TypePointer UniformConstant 9
42(g_tInputTexture): 41(ptr) Variable UniformConstant
98: TypePointer Output 11(fvec4)
99(@entryPointOutput): 98(ptr) Variable Output
175: 17(FxaaTex) Undef
7: TypeFloat 32
8: TypeImage 7(float) 2D sampled format:Unknown
9(FxaaTex): TypeStruct 6 8
11: TypeVector 7(float) 4
31: TypeSampledImage 8
33: TypeVector 7(float) 2
34: 7(float) Constant 1050253722
35: 7(float) Constant 1053609165
36: 33(fvec2) ConstantComposite 34 35
37: 7(float) Constant 0
42: TypePointer UniformConstant 6
43(g_tInputTexture_sampler): 42(ptr) Variable UniformConstant
46: TypePointer UniformConstant 8
47(g_tInputTexture): 46(ptr) Variable UniformConstant
79: TypePointer Output 11(fvec4)
80(@entryPointOutput): 79(ptr) Variable Output
4(main): 2 Function None 3
5: Label
117: 6 Load 38(g_tInputTexture_sampler)
118: 9 Load 42(g_tInputTexture)
148: 26 SampledImage 118 117
149: 11(fvec4) ImageSampleExplicitLod 148 31 Lod 32
172: 6 CompositeExtract 175 0
174: 9 CompositeExtract 175 1
160: 26 SampledImage 174 172
161: 11(fvec4) ImageSampleExplicitLod 160 31 Lod 32
136: 11(fvec4) FAdd 149 161
165: 26 SampledImage 118 117
166: 11(fvec4) ImageSampleExplicitLod 165 31 Lod 32
143: 11(fvec4) FAdd 136 166
Store 99(@entryPointOutput) 143
90: 6 Load 43(g_tInputTexture_sampler)
91: 8 Load 47(g_tInputTexture)
111: 31 SampledImage 91 90
112: 11(fvec4) ImageSampleExplicitLod 111 36 Lod 37
115: 6 Load 43(g_tInputTexture_sampler)
117: 8 Load 47(g_tInputTexture)
125: 31 SampledImage 117 115
126: 11(fvec4) ImageSampleExplicitLod 125 36 Lod 37
99: 11(fvec4) FAdd 112 126
132: 31 SampledImage 91 90
133: 11(fvec4) ImageSampleExplicitLod 132 36 Lod 37
104: 11(fvec4) FAdd 99 133
Store 80(@entryPointOutput) 104
Return
FunctionEnd

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

View File

@@ -2,47 +2,67 @@ hlsl.flattenSubset.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 85
// Id's are bound by 66
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 54 57
EntryPoint Fragment 4 "main" 47 50
ExecutionMode 4 OriginUpperLeft
Source HLSL 500
Name 4 "main"
Name 17 "samp"
Name 41 "tex"
Name 54 "vpos"
Name 57 "@entryPointOutput"
Decorate 17(samp) DescriptorSet 0
Decorate 41(tex) DescriptorSet 0
Decorate 54(vpos) Location 0
Decorate 57(@entryPointOutput) Location 0
Name 15 "S0"
MemberName 15(S0) 0 "x"
MemberName 15(S0) 1 "y"
MemberName 15(S0) 2 "ss"
Name 16 "S1"
MemberName 16(S1) 0 "b"
MemberName 16(S1) 1 "samplerState"
MemberName 16(S1) 2 "s0"
MemberName 16(S1) 3 "a"
Name 21 "samp"
Name 25 "S2"
MemberName 25(S2) 0 "a1"
MemberName 25(S2) 1 "a2"
MemberName 25(S2) 2 "a3"
MemberName 25(S2) 3 "a4"
MemberName 25(S2) 4 "a5"
MemberName 25(S2) 5 "resources"
Name 33 "tex"
Name 47 "vpos"
Name 50 "@entryPointOutput"
Decorate 21(samp) DescriptorSet 0
Decorate 33(tex) DescriptorSet 0
Decorate 47(vpos) Location 0
Decorate 50(@entryPointOutput) Location 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypeVector 6(float) 4
13: TypeSampler
16: TypePointer UniformConstant 13
17(samp): 16(ptr) Variable UniformConstant
39: TypeImage 6(float) 2D sampled format:Unknown
40: TypePointer UniformConstant 39
41(tex): 40(ptr) Variable UniformConstant
44: TypeSampledImage 39
46: TypeVector 6(float) 2
47: 6(float) Constant 1056964608
48: 46(fvec2) ConstantComposite 47 47
53: TypePointer Input 7(fvec4)
54(vpos): 53(ptr) Variable Input
56: TypePointer Output 7(fvec4)
57(@entryPointOutput): 56(ptr) Variable Output
14: TypeInt 32 1
15(S0): TypeStruct 14(int) 14(int) 13
16(S1): TypeStruct 6(float) 13 15(S0) 14(int)
20: TypePointer UniformConstant 13
21(samp): 20(ptr) Variable UniformConstant
25(S2): TypeStruct 14(int) 14(int) 14(int) 14(int) 14(int) 16(S1)
31: TypeImage 6(float) 2D sampled format:Unknown
32: TypePointer UniformConstant 31
33(tex): 32(ptr) Variable UniformConstant
37: TypeSampledImage 31
39: TypeVector 6(float) 2
40: 6(float) Constant 1056964608
41: 39(fvec2) ConstantComposite 40 40
46: TypePointer Input 7(fvec4)
47(vpos): 46(ptr) Variable Input
49: TypePointer Output 7(fvec4)
50(@entryPointOutput): 49(ptr) Variable Output
4(main): 2 Function None 3
5: Label
74: 13 Load 17(samp)
81: 39 Load 41(tex)
83: 44 SampledImage 81 74
84: 7(fvec4) ImageSampleImplicitLod 83 48
Store 57(@entryPointOutput) 84
57: 13 Load 21(samp)
61: 31 Load 33(tex)
64: 37 SampledImage 61 57
65: 7(fvec4) ImageSampleImplicitLod 64 41
Store 50(@entryPointOutput) 65
Return
FunctionEnd

View File

@@ -2,36 +2,48 @@ hlsl.flattenSubset2.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 44
// Id's are bound by 53
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 40 43
EntryPoint Fragment 4 "main" 49 52
ExecutionMode 4 OriginUpperLeft
Source HLSL 500
Name 4 "main"
Name 31 "someTex"
Name 40 "vpos"
Name 43 "@entryPointOutput"
Decorate 31(someTex) DescriptorSet 0
Decorate 40(vpos) Location 0
Decorate 43(@entryPointOutput) Location 0
Name 14 "Nested"
MemberName 14(Nested) 0 "y"
MemberName 14(Nested) 1 "texNested"
Name 15 "A"
MemberName 15(A) 0 "n"
MemberName 15(A) 1 "x"
Name 25 "B"
MemberName 25(B) 0 "n"
MemberName 25(B) 1 "tex"
Name 36 "someTex"
Name 49 "vpos"
Name 52 "@entryPointOutput"
Decorate 36(someTex) DescriptorSet 0
Decorate 49(vpos) Location 0
Decorate 52(@entryPointOutput) Location 0
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypeVector 6(float) 4
17: TypeImage 6(float) 2D sampled format:Unknown
30: TypePointer UniformConstant 17
31(someTex): 30(ptr) Variable UniformConstant
34: 6(float) Constant 0
35: 7(fvec4) ConstantComposite 34 34 34 34
39: TypePointer Input 7(fvec4)
40(vpos): 39(ptr) Variable Input
42: TypePointer Output 7(fvec4)
43(@entryPointOutput): 42(ptr) Variable Output
13: TypeImage 6(float) 2D sampled format:Unknown
14(Nested): TypeStruct 6(float) 13
15(A): TypeStruct 14(Nested) 6(float)
25(B): TypeStruct 14(Nested) 13
35: TypePointer UniformConstant 13
36(someTex): 35(ptr) Variable UniformConstant
43: 6(float) Constant 0
44: 7(fvec4) ConstantComposite 43 43 43 43
48: TypePointer Input 7(fvec4)
49(vpos): 48(ptr) Variable Input
51: TypePointer Output 7(fvec4)
52(@entryPointOutput): 51(ptr) Variable Output
4(main): 2 Function None 3
5: Label
Store 43(@entryPointOutput) 35
Store 52(@entryPointOutput) 44
Return
FunctionEnd

View File

@@ -2,90 +2,108 @@ hlsl.partialFlattenLocal.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 148
// Id's are bound by 132
Capability Shader
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Vertex 4 "main" 90 93
EntryPoint Vertex 4 "main" 83 86
Source HLSL 500
Name 4 "main"
Name 17 "tex"
Name 90 "pos"
Name 93 "@entryPointOutput"
Decorate 17(tex) DescriptorSet 0
Decorate 90(pos) Location 0
Decorate 93(@entryPointOutput) BuiltIn Position
Name 22 "Packed"
MemberName 22(Packed) 0 "tex"
MemberName 22(Packed) 1 "pos"
MemberName 22(Packed) 2 "uv"
MemberName 22(Packed) 3 "x"
MemberName 22(Packed) 4 "n"
Name 27 "tex"
Name 83 "pos"
Name 86 "@entryPointOutput"
Decorate 27(tex) DescriptorSet 0
Decorate 83(pos) Location 0
Decorate 86(@entryPointOutput) BuiltIn Position
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
7: TypeVector 6(float) 4
13: TypeImage 6(float) 2D sampled format:Unknown
16: TypePointer UniformConstant 13
17(tex): 16(ptr) Variable UniformConstant
19: TypeVector 6(float) 3
20: TypeInt 32 0
21: 20(int) Constant 3
22: TypeArray 19(fvec3) 21
23: TypePointer Function 22
25: TypeInt 32 1
26: 25(int) Constant 0
27: 6(float) Constant 0
28: 19(fvec3) ConstantComposite 27 27 27
29: TypePointer Function 19(fvec3)
31: TypeVector 6(float) 2
32: 20(int) Constant 2
33: TypeArray 31(fvec2) 32
34: TypePointer Function 33
36: 6(float) Constant 1065353216
37: 31(fvec2) ConstantComposite 27 36
38: TypePointer Function 31(fvec2)
52: 25(int) Constant 1
53: TypeBool
89: TypePointer Input 7(fvec4)
90(pos): 89(ptr) Variable Input
92: TypePointer Output 7(fvec4)
93(@entryPointOutput): 92(ptr) Variable Output
14: TypeVector 6(float) 3
15: TypeInt 32 0
16: 15(int) Constant 3
17: TypeArray 14(fvec3) 16
18: TypeVector 6(float) 2
19: 15(int) Constant 2
20: TypeArray 18(fvec2) 19
21: TypeInt 32 1
22(Packed): TypeStruct 13 17 20 6(float) 21(int)
23: TypePointer Function 22(Packed)
25: 21(int) Constant 0
26: TypePointer UniformConstant 13
27(tex): 26(ptr) Variable UniformConstant
29: TypePointer Function 13
31: 21(int) Constant 1
32: 6(float) Constant 0
33: 14(fvec3) ConstantComposite 32 32 32
34: TypePointer Function 14(fvec3)
36: 21(int) Constant 2
37: 6(float) Constant 1065353216
38: 18(fvec2) ConstantComposite 32 37
39: TypePointer Function 18(fvec2)
41: 21(int) Constant 3
42: TypePointer Function 6(float)
44: 21(int) Constant 4
45: TypePointer Function 21(int)
54: TypeBool
82: TypePointer Input 7(fvec4)
83(pos): 82(ptr) Variable Input
85: TypePointer Output 7(fvec4)
86(@entryPointOutput): 85(ptr) Variable Output
4(main): 2 Function None 3
5: Label
98: 23(ptr) Variable Function
99: 34(ptr) Variable Function
91: 7(fvec4) Load 90(pos)
110: 29(ptr) AccessChain 98 26
Store 110 28
111: 38(ptr) AccessChain 99 26
Store 111 37
Branch 112
112: Label
147: 25(int) Phi 26 5 131 114
LoopMerge 113 114 None
Branch 115
115: Label
117: 53(bool) SLessThan 147 52
BranchConditional 117 118 113
118: Label
121: 38(ptr) AccessChain 99 147
122: 31(fvec2) Load 121
123: 29(ptr) AccessChain 98 147
124: 19(fvec3) Load 123
125: 31(fvec2) VectorShuffle 124 124 0 1
126: 31(fvec2) FAdd 125 122
127: 29(ptr) AccessChain 98 147
128: 19(fvec3) Load 127
129: 19(fvec3) VectorShuffle 128 126 3 4 2
Store 127 129
Branch 114
114: Label
131: 25(int) IAdd 147 52
Branch 112
113: Label
133: 22 Load 98
146: 19(fvec3) CompositeExtract 133 0
140: 6(float) CompositeExtract 146 0
141: 6(float) CompositeExtract 146 1
142: 6(float) CompositeExtract 146 2
143: 7(fvec4) CompositeConstruct 140 141 142 27
144: 7(fvec4) FAdd 91 143
Store 93(@entryPointOutput) 144
90: 23(ptr) Variable Function
84: 7(fvec4) Load 83(pos)
94: 13 Load 27(tex)
95: 29(ptr) AccessChain 90 25
Store 95 94
96: 34(ptr) AccessChain 90 31 25
Store 96 33
97: 39(ptr) AccessChain 90 36 25
Store 97 38
98: 42(ptr) AccessChain 90 41
Store 98 37
99: 45(ptr) AccessChain 90 44
Store 99 41
Branch 100
100: Label
131: 21(int) Phi 25 5 119 102
LoopMerge 101 102 None
Branch 103
103: Label
105: 54(bool) SLessThan 131 31
BranchConditional 105 106 101
106: Label
109: 39(ptr) AccessChain 90 36 131
110: 18(fvec2) Load 109
111: 34(ptr) AccessChain 90 31 131
112: 14(fvec3) Load 111
113: 18(fvec2) VectorShuffle 112 112 0 1
114: 18(fvec2) FAdd 113 110
115: 34(ptr) AccessChain 90 31 131
116: 14(fvec3) Load 115
117: 14(fvec3) VectorShuffle 116 114 3 4 2
Store 115 117
Branch 102
102: Label
119: 21(int) IAdd 131 31
Branch 100
101: Label
120: 22(Packed) Load 90
130: 14(fvec3) CompositeExtract 120 1 0
124: 6(float) CompositeExtract 130 0
125: 6(float) CompositeExtract 130 1
126: 6(float) CompositeExtract 130 2
127: 7(fvec4) CompositeConstruct 124 125 126 32
128: 7(fvec4) FAdd 84 127
Store 86(@entryPointOutput) 128
Return
FunctionEnd

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