HLSL: Fix #903: Don't short-circuit && or ||.

This commit is contained in:
John Kessenich 2017-05-24 16:44:47 -06:00
parent 6e2295d340
commit 84cc15f0d0
4 changed files with 256 additions and 294 deletions

View File

@ -5361,8 +5361,7 @@ bool TGlslangToSpvTraverser::isTrivialLeaf(const glslang::TIntermTyped* node)
} }
// A node is trivial if it is a single operation with no side effects. // A node is trivial if it is a single operation with no side effects.
// Vector results seem ill-defined, currently classifying them as trivial too, // HLSL (and/or vectors) are always trivial, as it does not short circuit.
// to avoid scalar bool-based control-flow logic.
// Otherwise, error on the side of saying non-trivial. // Otherwise, error on the side of saying non-trivial.
// Return true if trivial. // Return true if trivial.
bool TGlslangToSpvTraverser::isTrivial(const glslang::TIntermTyped* node) bool TGlslangToSpvTraverser::isTrivial(const glslang::TIntermTyped* node)
@ -5370,8 +5369,8 @@ bool TGlslangToSpvTraverser::isTrivial(const glslang::TIntermTyped* node)
if (node == nullptr) if (node == nullptr)
return false; return false;
// count vectors as trivial // count non scalars as trivial, as well as anything coming from HLSL
if (node->getType().isVector()) if (! node->getType().isScalarOrVec1() || glslangIntermediate->getSource() == glslang::EShSourceHlsl)
return true; return true;
// symbols and constants are trivial // symbols and constants are trivial

View File

@ -335,12 +335,12 @@ gl_FragCoord origin is upper left
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 80001 // Generated by (magic number): 80001
// Id's are bound by 145 // Id's are bound by 140
Capability Shader Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 143 EntryPoint Fragment 4 "main" 138
ExecutionMode 4 OriginUpperLeft ExecutionMode 4 OriginUpperLeft
Source HLSL 500 Source HLSL 500
Name 4 "main" Name 4 "main"
@ -352,17 +352,17 @@ gl_FragCoord origin is upper left
MemberName 16($Global) 2 "condf1" MemberName 16($Global) 2 "condf1"
MemberName 16($Global) 3 "condi1" MemberName 16($Global) 3 "condi1"
Name 18 "" Name 18 ""
Name 93 "f" Name 88 "f"
Name 106 "i" Name 101 "i"
Name 126 "g" Name 121 "g"
Name 143 "@entryPointOutput" Name 138 "@entryPointOutput"
MemberDecorate 16($Global) 0 Offset 0 MemberDecorate 16($Global) 0 Offset 0
MemberDecorate 16($Global) 1 Offset 4 MemberDecorate 16($Global) 1 Offset 4
MemberDecorate 16($Global) 2 Offset 8 MemberDecorate 16($Global) 2 Offset 8
MemberDecorate 16($Global) 3 Offset 12 MemberDecorate 16($Global) 3 Offset 12
Decorate 16($Global) Block Decorate 16($Global) Block
Decorate 18 DescriptorSet 0 Decorate 18 DescriptorSet 0
Decorate 143(@entryPointOutput) Location 0 Decorate 138(@entryPointOutput) Location 0
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeFloat 32 6: TypeFloat 32
@ -388,25 +388,25 @@ gl_FragCoord origin is upper left
53: 6(float) Constant 1077936128 53: 6(float) Constant 1077936128
57: 15(int) Constant 3 57: 15(int) Constant 3
64: 6(float) Constant 1082130432 64: 6(float) Constant 1082130432
88: 6(float) Constant 1084227584 83: 6(float) Constant 1084227584
92: TypePointer Function 6(float) 87: TypePointer Function 6(float)
105: TypePointer Function 15(int) 100: TypePointer Function 15(int)
130: 6(float) Constant 1088421888 125: 6(float) Constant 1088421888
131: 6(float) Constant 1090519040 126: 6(float) Constant 1090519040
142: TypePointer Output 7(fvec4) 137: TypePointer Output 7(fvec4)
143(@entryPointOutput): 142(ptr) Variable Output 138(@entryPointOutput): 137(ptr) Variable Output
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
144: 7(fvec4) FunctionCall 9(@main() 139: 7(fvec4) FunctionCall 9(@main()
Store 143(@entryPointOutput) 144 Store 138(@entryPointOutput) 139
Return Return
FunctionEnd FunctionEnd
9(@main(): 7(fvec4) Function None 8 9(@main(): 7(fvec4) Function None 8
10: Label 10: Label
12(a): 11(ptr) Variable Function 12(a): 11(ptr) Variable Function
93(f): 92(ptr) Variable Function 88(f): 87(ptr) Variable Function
106(i): 105(ptr) Variable Function 101(i): 100(ptr) Variable Function
126(g): 92(ptr) Variable Function 121(g): 87(ptr) Variable Function
Store 12(a) 14 Store 12(a) 14
21: 20(ptr) AccessChain 18 19 21: 20(ptr) AccessChain 18 19
22: 15(int) Load 21 22: 15(int) Load 21
@ -455,98 +455,87 @@ gl_FragCoord origin is upper left
68: 20(ptr) AccessChain 18 19 68: 20(ptr) AccessChain 18 19
69: 15(int) Load 68 69: 15(int) Load 68
70: 23(bool) INotEqual 69 25 70: 23(bool) INotEqual 69 25
SelectionMerge 72 None 71: 35(ptr) AccessChain 18 34
BranchConditional 70 71 72 72: 6(float) Load 71
71: Label 73: 15(int) ConvertFToS 72
73: 35(ptr) AccessChain 18 34 74: 23(bool) INotEqual 73 25
74: 6(float) Load 73 75: 23(bool) LogicalAnd 70 74
75: 15(int) ConvertFToS 74 76: 35(ptr) AccessChain 18 46
76: 23(bool) INotEqual 75 25 77: 6(float) Load 76
Branch 72 78: 23(bool) FOrdNotEqual 77 38
72: Label 79: 23(bool) LogicalOr 75 78
77: 23(bool) Phi 70 62 76 71 SelectionMerge 81 None
78: 23(bool) LogicalNot 77 BranchConditional 79 80 81
SelectionMerge 80 None
BranchConditional 78 79 80
79: Label
81: 35(ptr) AccessChain 18 46
82: 6(float) Load 81
83: 23(bool) FOrdNotEqual 82 38
Branch 80
80: Label 80: Label
84: 23(bool) Phi 77 72 83 79 82: 7(fvec4) Load 12(a)
SelectionMerge 86 None 84: 7(fvec4) CompositeConstruct 83 83 83 83
BranchConditional 84 85 86 85: 7(fvec4) FAdd 82 84
85: Label ReturnValue 85
87: 7(fvec4) Load 12(a) 81: Label
89: 7(fvec4) CompositeConstruct 88 88 88 88 89: 35(ptr) AccessChain 18 34
90: 7(fvec4) FAdd 87 89 90: 6(float) Load 89
ReturnValue 90 Store 88(f) 90
86: Label Branch 91
94: 35(ptr) AccessChain 18 34 91: Label
95: 6(float) Load 94 LoopMerge 93 94 None
Store 93(f) 95 Branch 95
Branch 96 95: Label
96: Label 96: 6(float) Load 88(f)
LoopMerge 98 99 None 97: 23(bool) FOrdNotEqual 96 38
Branch 100 BranchConditional 97 92 93
100: Label 92: Label
101: 6(float) Load 93(f) 98: 6(float) Load 88(f)
102: 23(bool) FOrdNotEqual 101 38 99: 6(float) FSub 98 30
BranchConditional 102 97 98 Store 88(f) 99
97: Label Branch 94
103: 6(float) Load 93(f) 94: Label
104: 6(float) FSub 103 30 Branch 91
Store 93(f) 104 93: Label
Branch 99 102: 20(ptr) AccessChain 18 19
99: Label 103: 15(int) Load 102
Branch 96 Store 101(i) 103
98: Label Branch 104
107: 20(ptr) AccessChain 18 19 104: Label
108: 15(int) Load 107 LoopMerge 106 107 None
Store 106(i) 108 Branch 105
Branch 109 105: Label
109: Label 108: 15(int) Load 101(i)
LoopMerge 111 112 None 109: 15(int) ISub 108 19
Branch 110 Store 101(i) 109
110: Label Branch 107
113: 15(int) Load 106(i) 107: Label
114: 15(int) ISub 113 19 110: 15(int) Load 101(i)
Store 106(i) 114 111: 23(bool) INotEqual 110 25
BranchConditional 111 104 106
106: Label
Branch 112 Branch 112
112: Label 112: Label
115: 15(int) Load 106(i) LoopMerge 114 115 None
116: 23(bool) INotEqual 115 25 Branch 116
BranchConditional 116 109 111 116: Label
111: Label 117: 15(int) Load 101(i)
Branch 117 118: 23(bool) INotEqual 117 25
117: Label BranchConditional 118 113 114
LoopMerge 119 120 None 113: Label
Branch 121 119: 15(int) Load 101(i)
121: Label 120: 15(int) ISub 119 19
122: 15(int) Load 106(i) Store 101(i) 120
123: 23(bool) INotEqual 122 25 Branch 115
BranchConditional 123 118 119 115: Label
118: Label Branch 112
124: 15(int) Load 106(i) 114: Label
125: 15(int) ISub 124 19 122: 35(ptr) AccessChain 18 34
Store 106(i) 125 123: 6(float) Load 122
Branch 120 124: 23(bool) FOrdNotEqual 123 38
120: Label 127: 6(float) Select 124 125 126
Branch 117 Store 121(g) 127
119: Label 128: 6(float) Load 121(g)
127: 35(ptr) AccessChain 18 34 129: 7(fvec4) Load 12(a)
128: 6(float) Load 127 130: 7(fvec4) CompositeConstruct 128 128 128 128
129: 23(bool) FOrdNotEqual 128 38 131: 7(fvec4) FAdd 129 130
132: 6(float) Select 129 130 131 Store 12(a) 131
Store 126(g) 132 132: 7(fvec4) Load 12(a)
133: 6(float) Load 126(g) 133: 7(fvec4) CompositeConstruct 30 30 30 30
134: 7(fvec4) Load 12(a) 134: 7(fvec4) FSub 132 133
135: 7(fvec4) CompositeConstruct 133 133 133 133 ReturnValue 134
136: 7(fvec4) FAdd 134 135
Store 12(a) 136
137: 7(fvec4) Load 12(a)
138: 7(fvec4) CompositeConstruct 30 30 30 30
139: 7(fvec4) FSub 137 138
ReturnValue 139
FunctionEnd FunctionEnd

View File

@ -173,34 +173,34 @@ gl_FragCoord origin is upper left
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 80001 // Generated by (magic number): 80001
// Id's are bound by 91 // Id's are bound by 85
Capability Shader Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 89 EntryPoint Fragment 4 "main" 83
ExecutionMode 4 OriginUpperLeft ExecutionMode 4 OriginUpperLeft
Source HLSL 500 Source HLSL 500
Name 4 "main" Name 4 "main"
Name 11 "test1(f1;" Name 11 "test1(f1;"
Name 10 "v" Name 10 "v"
Name 15 "@main(" Name 15 "@main("
Name 22 "@finitetmp" Name 20 "@finitetmp"
Name 36 "@finitetmp" Name 32 "@finitetmp"
Name 39 "$Global" Name 35 "$Global"
MemberName 39($Global) 0 "f" MemberName 35($Global) 0 "f"
MemberName 39($Global) 1 "f2" MemberName 35($Global) 1 "f2"
MemberName 39($Global) 2 "f3" MemberName 35($Global) 2 "f3"
Name 41 "" Name 37 ""
Name 57 "@finitetmp" Name 51 "@finitetmp"
Name 71 "@finitetmp" Name 65 "@finitetmp"
Name 89 "@entryPointOutput" Name 83 "@entryPointOutput"
MemberDecorate 39($Global) 0 Offset 0 MemberDecorate 35($Global) 0 Offset 0
MemberDecorate 39($Global) 1 Offset 4 MemberDecorate 35($Global) 1 Offset 4
MemberDecorate 39($Global) 2 Offset 16 MemberDecorate 35($Global) 2 Offset 16
Decorate 39($Global) Block Decorate 35($Global) Block
Decorate 41 DescriptorSet 0 Decorate 37 DescriptorSet 0
Decorate 89(@entryPointOutput) Location 0 Decorate 83(@entryPointOutput) Location 0
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeFloat 32 6: TypeFloat 32
@ -209,100 +209,85 @@ gl_FragCoord origin is upper left
9: TypeFunction 8(bool) 7(ptr) 9: TypeFunction 8(bool) 7(ptr)
13: TypeVector 6(float) 4 13: TypeVector 6(float) 4
14: TypeFunction 13(fvec4) 14: TypeFunction 13(fvec4)
37: TypeVector 6(float) 2 33: TypeVector 6(float) 2
38: TypeVector 6(float) 3 34: TypeVector 6(float) 3
39($Global): TypeStruct 6(float) 37(fvec2) 38(fvec3) 35($Global): TypeStruct 6(float) 33(fvec2) 34(fvec3)
40: TypePointer Uniform 39($Global) 36: TypePointer Uniform 35($Global)
41: 40(ptr) Variable Uniform 37: 36(ptr) Variable Uniform
42: TypeInt 32 1 38: TypeInt 32 1
43: 42(int) Constant 0 39: 38(int) Constant 0
44: TypePointer Uniform 6(float) 40: TypePointer Uniform 6(float)
56: TypePointer Function 37(fvec2) 50: TypePointer Function 33(fvec2)
58: 42(int) Constant 1 52: 38(int) Constant 1
59: TypePointer Uniform 37(fvec2) 53: TypePointer Uniform 33(fvec2)
63: TypeVector 8(bool) 2 57: TypeVector 8(bool) 2
70: TypePointer Function 38(fvec3) 64: TypePointer Function 34(fvec3)
72: 42(int) Constant 2 66: 38(int) Constant 2
73: TypePointer Uniform 38(fvec3) 67: TypePointer Uniform 34(fvec3)
77: TypeVector 8(bool) 3 71: TypeVector 8(bool) 3
84: 6(float) Constant 0 78: 6(float) Constant 0
85: 13(fvec4) ConstantComposite 84 84 84 84 79: 13(fvec4) ConstantComposite 78 78 78 78
88: TypePointer Output 13(fvec4) 82: TypePointer Output 13(fvec4)
89(@entryPointOutput): 88(ptr) Variable Output 83(@entryPointOutput): 82(ptr) Variable Output
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
90: 13(fvec4) FunctionCall 15(@main() 84: 13(fvec4) FunctionCall 15(@main()
Store 89(@entryPointOutput) 90 Store 83(@entryPointOutput) 84
Return Return
FunctionEnd FunctionEnd
11(test1(f1;): 8(bool) Function None 9 11(test1(f1;): 8(bool) Function None 9
10(v): 7(ptr) FunctionParameter 10(v): 7(ptr) FunctionParameter
12: Label 12: Label
22(@finitetmp): 7(ptr) Variable Function 20(@finitetmp): 7(ptr) Variable Function
17: 6(float) Load 10(v) 17: 6(float) Load 10(v)
18: 8(bool) IsNan 17 18: 8(bool) IsNan 17
19: 8(bool) LogicalNot 18 19: 8(bool) LogicalNot 18
SelectionMerge 21 None 21: 6(float) Load 10(v)
BranchConditional 19 20 21 Store 20(@finitetmp) 21
20: Label 22: 6(float) Load 20(@finitetmp)
23: 6(float) Load 10(v) 23: 8(bool) IsNan 22
Store 22(@finitetmp) 23 24: 8(bool) LogicalNot 23
24: 6(float) Load 22(@finitetmp) 25: 6(float) Load 20(@finitetmp)
25: 8(bool) IsNan 24 26: 8(bool) IsInf 25
26: 8(bool) LogicalNot 25 27: 8(bool) LogicalNot 26
SelectionMerge 28 None 28: 8(bool) LogicalAnd 24 27
BranchConditional 26 27 28 29: 8(bool) LogicalAnd 19 28
27: Label ReturnValue 29
29: 6(float) Load 22(@finitetmp)
30: 8(bool) IsInf 29
31: 8(bool) LogicalNot 30
Branch 28
28: Label
32: 8(bool) Phi 26 20 31 27
Branch 21
21: Label
33: 8(bool) Phi 19 12 32 28
ReturnValue 33
FunctionEnd FunctionEnd
15(@main(): 13(fvec4) Function None 14 15(@main(): 13(fvec4) Function None 14
16: Label 16: Label
36(@finitetmp): 7(ptr) Variable Function 32(@finitetmp): 7(ptr) Variable Function
57(@finitetmp): 56(ptr) Variable Function 51(@finitetmp): 50(ptr) Variable Function
71(@finitetmp): 70(ptr) Variable Function 65(@finitetmp): 64(ptr) Variable Function
45: 44(ptr) AccessChain 41 43 41: 40(ptr) AccessChain 37 39
46: 6(float) Load 45 42: 6(float) Load 41
Store 36(@finitetmp) 46 Store 32(@finitetmp) 42
47: 6(float) Load 36(@finitetmp) 43: 6(float) Load 32(@finitetmp)
48: 8(bool) IsNan 47 44: 8(bool) IsNan 43
49: 8(bool) LogicalNot 48 45: 8(bool) LogicalNot 44
SelectionMerge 51 None 46: 6(float) Load 32(@finitetmp)
BranchConditional 49 50 51 47: 8(bool) IsInf 46
50: Label 48: 8(bool) LogicalNot 47
52: 6(float) Load 36(@finitetmp) 49: 8(bool) LogicalAnd 45 48
53: 8(bool) IsInf 52 54: 53(ptr) AccessChain 37 52
54: 8(bool) LogicalNot 53 55: 33(fvec2) Load 54
Branch 51 Store 51(@finitetmp) 55
51: Label 56: 33(fvec2) Load 51(@finitetmp)
55: 8(bool) Phi 49 16 54 50 58: 57(bvec2) IsNan 56
60: 59(ptr) AccessChain 41 58 59: 57(bvec2) LogicalNot 58
61: 37(fvec2) Load 60 60: 33(fvec2) Load 51(@finitetmp)
Store 57(@finitetmp) 61 61: 57(bvec2) IsInf 60
62: 37(fvec2) Load 57(@finitetmp) 62: 57(bvec2) LogicalNot 61
64: 63(bvec2) IsNan 62 63: 57(bvec2) LogicalAnd 59 62
65: 63(bvec2) LogicalNot 64 68: 67(ptr) AccessChain 37 66
66: 37(fvec2) Load 57(@finitetmp) 69: 34(fvec3) Load 68
67: 63(bvec2) IsInf 66 Store 65(@finitetmp) 69
68: 63(bvec2) LogicalNot 67 70: 34(fvec3) Load 65(@finitetmp)
69: 63(bvec2) LogicalAnd 65 68 72: 71(bvec3) IsNan 70
74: 73(ptr) AccessChain 41 72 73: 71(bvec3) LogicalNot 72
75: 38(fvec3) Load 74 74: 34(fvec3) Load 65(@finitetmp)
Store 71(@finitetmp) 75 75: 71(bvec3) IsInf 74
76: 38(fvec3) Load 71(@finitetmp) 76: 71(bvec3) LogicalNot 75
78: 77(bvec3) IsNan 76 77: 71(bvec3) LogicalAnd 73 76
79: 77(bvec3) LogicalNot 78 ReturnValue 79
80: 38(fvec3) Load 71(@finitetmp)
81: 77(bvec3) IsInf 80
82: 77(bvec3) LogicalNot 81
83: 77(bvec3) LogicalAnd 79 82
ReturnValue 85
FunctionEnd FunctionEnd

View File

@ -129,106 +129,95 @@ gl_FragCoord origin is upper left
// Module Version 10000 // Module Version 10000
// Generated by (magic number): 80001 // Generated by (magic number): 80001
// Id's are bound by 62 // Id's are bound by 57
Capability Shader Capability Shader
1: ExtInstImport "GLSL.std.450" 1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450 MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 59 EntryPoint Fragment 4 "main" 54
ExecutionMode 4 OriginUpperLeft ExecutionMode 4 OriginUpperLeft
Source HLSL 500 Source HLSL 500
Name 4 "main" Name 4 "main"
Name 8 "PS_OUTPUT" Name 8 "PS_OUTPUT"
MemberName 8(PS_OUTPUT) 0 "Color" MemberName 8(PS_OUTPUT) 0 "Color"
Name 10 "@main(" Name 10 "@main("
Name 15 "$Global" Name 14 "$Global"
MemberName 15($Global) 0 "ival" MemberName 14($Global) 0 "ival"
MemberName 15($Global) 1 "ival4" MemberName 14($Global) 1 "ival4"
MemberName 15($Global) 2 "fval" MemberName 14($Global) 2 "fval"
MemberName 15($Global) 3 "fval4" MemberName 14($Global) 3 "fval4"
Name 17 "" Name 16 ""
Name 50 "psout" Name 45 "psout"
Name 59 "Color" Name 54 "Color"
MemberDecorate 15($Global) 0 Offset 0 MemberDecorate 14($Global) 0 Offset 0
MemberDecorate 15($Global) 1 Offset 16 MemberDecorate 14($Global) 1 Offset 16
MemberDecorate 15($Global) 2 Offset 32 MemberDecorate 14($Global) 2 Offset 32
MemberDecorate 15($Global) 3 Offset 48 MemberDecorate 14($Global) 3 Offset 48
Decorate 15($Global) Block Decorate 14($Global) Block
Decorate 17 DescriptorSet 0 Decorate 16 DescriptorSet 0
Decorate 59(Color) Location 0 Decorate 54(Color) Location 0
2: TypeVoid 2: TypeVoid
3: TypeFunction 2 3: TypeFunction 2
6: TypeFloat 32 6: TypeFloat 32
7: TypeVector 6(float) 4 7: TypeVector 6(float) 4
8(PS_OUTPUT): TypeStruct 7(fvec4) 8(PS_OUTPUT): TypeStruct 7(fvec4)
9: TypeFunction 8(PS_OUTPUT) 9: TypeFunction 8(PS_OUTPUT)
12: TypeBool 12: TypeInt 32 1
13: TypeInt 32 1 13: TypeVector 12(int) 4
14: TypeVector 13(int) 4 14($Global): TypeStruct 12(int) 13(ivec4) 6(float) 7(fvec4)
15($Global): TypeStruct 13(int) 14(ivec4) 6(float) 7(fvec4) 15: TypePointer Uniform 14($Global)
16: TypePointer Uniform 15($Global) 16: 15(ptr) Variable Uniform
17: 16(ptr) Variable Uniform 17: 12(int) Constant 0
18: 13(int) Constant 0 18: TypePointer Uniform 12(int)
19: TypePointer Uniform 13(int) 21: TypeBool
22: TypeInt 32 0 22: TypeInt 32 0
23: 22(int) Constant 0 23: 22(int) Constant 0
27: 13(int) Constant 2 25: 12(int) Constant 2
28: TypePointer Uniform 6(float) 26: TypePointer Uniform 6(float)
49: TypePointer Function 8(PS_OUTPUT) 44: TypePointer Function 8(PS_OUTPUT)
51: 6(float) Constant 1065353216 46: 6(float) Constant 1065353216
52: 7(fvec4) ConstantComposite 51 51 51 51 47: 7(fvec4) ConstantComposite 46 46 46 46
53: TypePointer Function 7(fvec4) 48: TypePointer Function 7(fvec4)
58: TypePointer Output 7(fvec4) 53: TypePointer Output 7(fvec4)
59(Color): 58(ptr) Variable Output 54(Color): 53(ptr) Variable Output
4(main): 2 Function None 3 4(main): 2 Function None 3
5: Label 5: Label
60:8(PS_OUTPUT) FunctionCall 10(@main() 55:8(PS_OUTPUT) FunctionCall 10(@main()
61: 7(fvec4) CompositeExtract 60 0 56: 7(fvec4) CompositeExtract 55 0
Store 59(Color) 61 Store 54(Color) 56
Return Return
FunctionEnd FunctionEnd
10(@main():8(PS_OUTPUT) Function None 9 10(@main():8(PS_OUTPUT) Function None 9
11: Label 11: Label
50(psout): 49(ptr) Variable Function 45(psout): 44(ptr) Variable Function
20: 19(ptr) AccessChain 17 18 19: 18(ptr) AccessChain 16 17
21: 13(int) Load 20 20: 12(int) Load 19
24: 12(bool) INotEqual 21 23 24: 21(bool) INotEqual 20 23
SelectionMerge 26 None 27: 26(ptr) AccessChain 16 25
BranchConditional 24 25 26 28: 6(float) Load 27
25: Label 29: 12(int) ConvertFToS 28
29: 28(ptr) AccessChain 17 27 30: 21(bool) INotEqual 29 23
30: 6(float) Load 29 31: 21(bool) LogicalAnd 24 30
31: 13(int) ConvertFToS 30 SelectionMerge 33 None
32: 12(bool) INotEqual 31 23 BranchConditional 31 32 33
Branch 26 32: Label
26: Label Branch 33
33: 12(bool) Phi 24 11 32 25 33: Label
SelectionMerge 35 None 34: 18(ptr) AccessChain 16 17
BranchConditional 33 34 35 35: 12(int) Load 34
34: Label 36: 21(bool) INotEqual 35 23
Branch 35 37: 26(ptr) AccessChain 16 25
35: Label 38: 6(float) Load 37
36: 19(ptr) AccessChain 17 18 39: 12(int) ConvertFToS 38
37: 13(int) Load 36 40: 21(bool) INotEqual 39 23
38: 12(bool) INotEqual 37 23 41: 21(bool) LogicalOr 36 40
39: 12(bool) LogicalNot 38 SelectionMerge 43 None
SelectionMerge 41 None BranchConditional 41 42 43
BranchConditional 39 40 41 42: Label
40: Label Branch 43
42: 28(ptr) AccessChain 17 27 43: Label
43: 6(float) Load 42 49: 48(ptr) AccessChain 45(psout) 17
44: 13(int) ConvertFToS 43 Store 49 47
45: 12(bool) INotEqual 44 23 50:8(PS_OUTPUT) Load 45(psout)
Branch 41 ReturnValue 50
41: Label
46: 12(bool) Phi 38 35 45 40
SelectionMerge 48 None
BranchConditional 46 47 48
47: Label
Branch 48
48: Label
54: 53(ptr) AccessChain 50(psout) 18
Store 54 52
55:8(PS_OUTPUT) Load 50(psout)
ReturnValue 55
FunctionEnd FunctionEnd