Rework inReadableOrder() as a recursive descent.
Add a test for unreachable merge block. Update test results with the new order: mainly delaying merge blocks and removing unreachable ones.
This commit is contained in:
19
Test/baseResults/spv.always-discard.frag.out
Executable file → Normal file
19
Test/baseResults/spv.always-discard.frag.out
Executable file → Normal file
@@ -110,23 +110,4 @@ Linked fragment stage:
|
||||
Branch 49
|
||||
49: Label
|
||||
Kill
|
||||
69: Label
|
||||
70: 6(float) Load 36(radius)
|
||||
72: 46(bool) FOrdGreaterThanEqual 70 71
|
||||
SelectionMerge 74 None
|
||||
BranchConditional 72 73 74
|
||||
73: Label
|
||||
75: 6(float) Load 36(radius)
|
||||
77: 6(float) ExtInst 1(GLSL.std.450) 26(Pow) 75 76
|
||||
78: 6(float) FDiv 77 27
|
||||
79: 6(float) ExtInst 1(GLSL.std.450) 4(FAbs) 78
|
||||
80: 7(fvec4) Load 15(color)
|
||||
81: 7(fvec4) CompositeConstruct 79 79 79 79
|
||||
82: 7(fvec4) FSub 80 81
|
||||
Store 15(color) 82
|
||||
Branch 74
|
||||
74: Label
|
||||
83: 7(fvec4) Load 15(color)
|
||||
Store 59(gl_FragColor) 83
|
||||
Return
|
||||
FunctionEnd
|
||||
|
||||
6
Test/baseResults/spv.do-while-continue-break.vert.out
Executable file → Normal file
6
Test/baseResults/spv.do-while-continue-break.vert.out
Executable file → Normal file
@@ -81,9 +81,6 @@ Linked vertex stage:
|
||||
28: Label
|
||||
Store 30(B) 19
|
||||
Branch 10
|
||||
32: Label
|
||||
Store 33(C) 26
|
||||
Branch 29
|
||||
29: Label
|
||||
34: 6(int) Load 8(i)
|
||||
36: 14(bool) IEqual 34 35
|
||||
@@ -92,9 +89,6 @@ Linked vertex stage:
|
||||
37: Label
|
||||
Store 39(D) 40
|
||||
Branch 11
|
||||
41: Label
|
||||
Store 42(E) 43
|
||||
Branch 38
|
||||
38: Label
|
||||
Store 44(F) 45
|
||||
Branch 10
|
||||
|
||||
6
Test/baseResults/spv.for-continue-break.vert.out
Executable file → Normal file
6
Test/baseResults/spv.for-continue-break.vert.out
Executable file → Normal file
@@ -70,9 +70,6 @@ Linked vertex stage:
|
||||
27: 6(int) IAdd 26 18
|
||||
Store 8(i) 27
|
||||
Branch 10
|
||||
28: Label
|
||||
Store 29(C) 18
|
||||
Branch 24
|
||||
24: Label
|
||||
30: 6(int) Load 8(i)
|
||||
32: 6(int) SMod 30 31
|
||||
@@ -82,9 +79,6 @@ Linked vertex stage:
|
||||
34: Label
|
||||
Store 36(D) 18
|
||||
Branch 11
|
||||
37: Label
|
||||
Store 38(E) 18
|
||||
Branch 35
|
||||
35: Label
|
||||
Store 39(F) 40
|
||||
41: 6(int) Load 8(i)
|
||||
|
||||
47
Test/baseResults/spv.merge-unreachable.frag.out
Normal file
47
Test/baseResults/spv.merge-unreachable.frag.out
Normal file
@@ -0,0 +1,47 @@
|
||||
spv.merge-unreachable.frag
|
||||
Warning, version 450 is not yet complete; most version-specific features are present, but some are missing.
|
||||
|
||||
|
||||
Linked fragment stage:
|
||||
|
||||
|
||||
// Module Version 10000
|
||||
// Generated by (magic number): 80001
|
||||
// Id's are bound by 25
|
||||
|
||||
Capability Shader
|
||||
1: ExtInstImport "GLSL.std.450"
|
||||
MemoryModel Logical GLSL450
|
||||
EntryPoint Fragment 4 "main" 9
|
||||
ExecutionMode 4 OriginLowerLeft
|
||||
Source GLSL 450
|
||||
Name 4 "main"
|
||||
Name 9 "v"
|
||||
Decorate 9(v) Location 1
|
||||
2: TypeVoid
|
||||
3: TypeFunction 2
|
||||
6: TypeFloat 32
|
||||
7: TypeVector 6(float) 4
|
||||
8: TypePointer Input 7(fvec4)
|
||||
9(v): 8(ptr) Variable Input
|
||||
11: 6(float) Constant 1036831949
|
||||
12: 6(float) Constant 1045220557
|
||||
13: 6(float) Constant 1050253722
|
||||
14: 6(float) Constant 1053609165
|
||||
15: 7(fvec4) ConstantComposite 11 12 13 14
|
||||
16: TypeBool
|
||||
17: TypeVector 16(bool) 4
|
||||
4(main): 2 Function None 3
|
||||
5: Label
|
||||
10: 7(fvec4) Load 9(v)
|
||||
18: 17(bvec4) FOrdEqual 10 15
|
||||
19: 16(bool) All 18
|
||||
SelectionMerge 21 None
|
||||
BranchConditional 19 20 23
|
||||
20: Label
|
||||
Kill
|
||||
23: Label
|
||||
Return
|
||||
21: Label
|
||||
Return
|
||||
FunctionEnd
|
||||
@@ -106,6 +106,11 @@ Linked fragment stage:
|
||||
Switch 65 68
|
||||
case 1: 66
|
||||
case 2: 67
|
||||
68: Label
|
||||
80: 6(float) Load 73(x)
|
||||
81: 6(float) ExtInst 1(GLSL.std.450) 15(Tan) 80
|
||||
Store 71(f) 81
|
||||
Branch 69
|
||||
66: Label
|
||||
74: 6(float) Load 73(x)
|
||||
75: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 74
|
||||
@@ -116,17 +121,19 @@ Linked fragment stage:
|
||||
78: 6(float) ExtInst 1(GLSL.std.450) 14(Cos) 77
|
||||
Store 71(f) 78
|
||||
Branch 69
|
||||
68: Label
|
||||
80: 6(float) Load 73(x)
|
||||
81: 6(float) ExtInst 1(GLSL.std.450) 15(Tan) 80
|
||||
Store 71(f) 81
|
||||
Branch 69
|
||||
69: Label
|
||||
83: 9(int) Load 60(c)
|
||||
SelectionMerge 87 None
|
||||
Switch 83 86
|
||||
case 1: 84
|
||||
case 2: 85
|
||||
86: Label
|
||||
97: 6(float) Load 73(x)
|
||||
98: 6(float) ExtInst 1(GLSL.std.450) 15(Tan) 97
|
||||
99: 6(float) Load 71(f)
|
||||
100: 6(float) FAdd 99 98
|
||||
Store 71(f) 100
|
||||
Branch 87
|
||||
84: Label
|
||||
88: 6(float) Load 73(x)
|
||||
89: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 88
|
||||
@@ -141,13 +148,6 @@ Linked fragment stage:
|
||||
95: 6(float) FAdd 94 93
|
||||
Store 71(f) 95
|
||||
Branch 87
|
||||
86: Label
|
||||
97: 6(float) Load 73(x)
|
||||
98: 6(float) ExtInst 1(GLSL.std.450) 15(Tan) 97
|
||||
99: 6(float) Load 71(f)
|
||||
100: 6(float) FAdd 99 98
|
||||
Store 71(f) 100
|
||||
Branch 87
|
||||
87: Label
|
||||
102: 9(int) Load 60(c)
|
||||
SelectionMerge 105 None
|
||||
@@ -174,6 +174,13 @@ Linked fragment stage:
|
||||
Switch 117 120
|
||||
case 1: 118
|
||||
case 2: 119
|
||||
120: Label
|
||||
148: 6(float) Load 73(x)
|
||||
149: 6(float) ExtInst 1(GLSL.std.450) 15(Tan) 148
|
||||
150: 6(float) Load 71(f)
|
||||
151: 6(float) FAdd 150 149
|
||||
Store 71(f) 151
|
||||
Branch 121
|
||||
118: Label
|
||||
122: 6(float) Load 73(x)
|
||||
123: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 122
|
||||
@@ -207,13 +214,6 @@ Linked fragment stage:
|
||||
Branch 131
|
||||
131: Label
|
||||
Branch 121
|
||||
120: Label
|
||||
148: 6(float) Load 73(x)
|
||||
149: 6(float) ExtInst 1(GLSL.std.450) 15(Tan) 148
|
||||
150: 6(float) Load 71(f)
|
||||
151: 6(float) FAdd 150 149
|
||||
Store 71(f) 151
|
||||
Branch 121
|
||||
121: Label
|
||||
Store 153(i) 154
|
||||
Branch 155
|
||||
@@ -228,6 +228,13 @@ Linked fragment stage:
|
||||
Switch 162 165
|
||||
case 1: 163
|
||||
case 2: 164
|
||||
165: Label
|
||||
196: 6(float) Load 73(x)
|
||||
197: 6(float) ExtInst 1(GLSL.std.450) 15(Tan) 196
|
||||
198: 6(float) Load 71(f)
|
||||
199: 6(float) FAdd 198 197
|
||||
Store 71(f) 199
|
||||
Branch 166
|
||||
163: Label
|
||||
167: 6(float) Load 73(x)
|
||||
168: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 167
|
||||
@@ -265,13 +272,6 @@ Linked fragment stage:
|
||||
193: 6(float) FAdd 192 191
|
||||
Store 71(f) 193
|
||||
Branch 166
|
||||
165: Label
|
||||
196: 6(float) Load 73(x)
|
||||
197: 6(float) ExtInst 1(GLSL.std.450) 15(Tan) 196
|
||||
198: 6(float) Load 71(f)
|
||||
199: 6(float) FAdd 198 197
|
||||
Store 71(f) 199
|
||||
Branch 166
|
||||
166: Label
|
||||
201: 6(float) Load 71(f)
|
||||
203: 160(bool) FOrdLessThan 201 202
|
||||
@@ -331,10 +331,10 @@ Linked fragment stage:
|
||||
SelectionMerge 254 None
|
||||
Switch 251 253
|
||||
case 0: 252
|
||||
252: Label
|
||||
Branch 254
|
||||
253: Label
|
||||
Branch 254
|
||||
252: Label
|
||||
Branch 254
|
||||
254: Label
|
||||
258: 9(int) Load 60(c)
|
||||
SelectionMerge 260 None
|
||||
|
||||
6
Test/baseResults/spv.while-continue-break.vert.out
Executable file → Normal file
6
Test/baseResults/spv.while-continue-break.vert.out
Executable file → Normal file
@@ -60,9 +60,6 @@ Linked vertex stage:
|
||||
23: Label
|
||||
Store 25(B) 20
|
||||
Branch 10
|
||||
26: Label
|
||||
Store 27(C) 20
|
||||
Branch 24
|
||||
24: Label
|
||||
28: 6(int) Load 8(i)
|
||||
30: 6(int) SMod 28 29
|
||||
@@ -72,9 +69,6 @@ Linked vertex stage:
|
||||
32: Label
|
||||
Store 25(B) 20
|
||||
Branch 11
|
||||
34: Label
|
||||
Store 27(C) 20
|
||||
Branch 33
|
||||
33: Label
|
||||
35: 6(int) Load 8(i)
|
||||
36: 6(int) IAdd 35 18
|
||||
|
||||
7
Test/spv.merge-unreachable.frag
Normal file
7
Test/spv.merge-unreachable.frag
Normal file
@@ -0,0 +1,7 @@
|
||||
#version 450
|
||||
layout(location=1) in highp vec4 v;
|
||||
void main (void)
|
||||
{
|
||||
if (v == vec4(0.1,0.2,0.3,0.4)) discard;
|
||||
else return;
|
||||
}
|
||||
@@ -57,6 +57,7 @@ spv.loopsArtificial.frag
|
||||
spv.matFun.vert
|
||||
spv.matrix.frag
|
||||
spv.matrix2.frag
|
||||
spv.merge-unreachable.frag
|
||||
spv.newTexture.frag
|
||||
spv.nonSquare.vert
|
||||
spv.Operations.frag
|
||||
|
||||
Reference in New Issue
Block a user