Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
glslang
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
glslang
Commits
84cc15f0
Commit
84cc15f0
authored
May 24, 2017
by
John Kessenich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
HLSL: Fix #903: Don't short-circuit && or ||.
parent
6e2295d3
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
256 additions
and
294 deletions
+256
-294
GlslangToSpv.cpp
SPIRV/GlslangToSpv.cpp
+3
-4
hlsl.implicitBool.frag.out
Test/baseResults/hlsl.implicitBool.frag.out
+100
-111
hlsl.isfinite.frag.out
Test/baseResults/hlsl.isfinite.frag.out
+86
-101
hlsl.logical.binary.frag.out
Test/baseResults/hlsl.logical.binary.frag.out
+67
-78
No files found.
SPIRV/GlslangToSpv.cpp
View file @
84cc15f0
...
@@ -5361,8 +5361,7 @@ bool TGlslangToSpvTraverser::isTrivialLeaf(const glslang::TIntermTyped* node)
...
@@ -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)
...
@@ -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
...
...
Test/baseResults/hlsl.implicitBool.frag.out
View file @
84cc15f0
...
@@ -335,12 +335,12 @@ gl_FragCoord origin is upper left
...
@@ -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 14
5
// Id's are bound by 14
0
Capability Shader
Capability Shader
1: ExtInstImport "GLSL.std.450"
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 1
43
EntryPoint Fragment 4 "main" 1
38
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
...
@@ -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 10
6
"i"
Name 10
1
"i"
Name 12
6
"g"
Name 12
1
"g"
Name 1
43
"@entryPointOutput"
Name 1
38
"@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 1
43
(@entryPointOutput) Location 0
Decorate 1
38
(@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
...
@@ -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
8
8
: 6(float) Constant 1084227584
8
3
: 6(float) Constant 1084227584
92
: TypePointer Function 6(float)
87
: TypePointer Function 6(float)
10
5
: TypePointer Function 15(int)
10
0
: TypePointer Function 15(int)
1
30
: 6(float) Constant 1088421888
1
25
: 6(float) Constant 1088421888
1
31
: 6(float) Constant 1090519040
1
26
: 6(float) Constant 1090519040
1
42
: TypePointer Output 7(fvec4)
1
37
: TypePointer Output 7(fvec4)
1
43(@entryPointOutput): 142
(ptr) Variable Output
1
38(@entryPointOutput): 137
(ptr) Variable Output
4(main): 2 Function None 3
4(main): 2 Function None 3
5: Label
5: Label
1
44
: 7(fvec4) FunctionCall 9(@main()
1
39
: 7(fvec4) FunctionCall 9(@main()
Store 1
43(@entryPointOutput) 144
Store 1
38(@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
10
6(i): 105
(ptr) Variable Function
10
1(i): 100
(ptr) Variable Function
12
6(g): 92
(ptr) Variable Function
12
1(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
...
@@ -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
80: Label
BranchConditional 78 79 80
82: 7(fvec4) Load 12(a)
79: Label
84: 7(fvec4) CompositeConstruct 83 83 83 83
81: 35(ptr) AccessChain 18 46
85: 7(fvec4) FAdd 82 84
82: 6(float) Load 81
ReturnValue 85
83: 23(bool) FOrdNotEqual 82 38
81: Label
Branch 80
89: 35(ptr) AccessChain 18 34
80: Label
90: 6(float) Load 89
84: 23(bool) Phi 77 72 83 79
Store 88(f) 90
SelectionMerge 86 None
Branch 91
BranchConditional 84 85 86
91: Label
85: Label
LoopMerge 93 94 None
87: 7(fvec4) Load 12(a)
Branch 95
89: 7(fvec4) CompositeConstruct 88 88 88 88
95: Label
90: 7(fvec4) FAdd 87 89
96: 6(float) Load 88(f)
ReturnValue 90
97: 23(bool) FOrdNotEqual 96 38
86: Label
BranchConditional 97 92 93
94: 35(ptr) AccessChain 18 34
92: Label
95: 6(float) Load 94
98: 6(float) Load 88(f)
Store 93(f) 95
99: 6(float) FSub 98 30
Branch 96
Store 88(f) 99
96: Label
Branch 94
LoopMerge 98 99 None
94: Label
Branch 100
Branch 91
100: Label
93: Label
101: 6(float) Load 93(f)
102: 20(ptr) AccessChain 18 19
102: 23(bool) FOrdNotEqual 101 38
103: 15(int) Load 102
BranchConditional 102 97 98
Store 101(i) 103
97: Label
Branch 104
103: 6(float) Load 93(f)
104: Label
104: 6(float) FSub 103 30
LoopMerge 106 107 None
Store 93(f) 104
Branch 105
Branch 99
105: Label
99: Label
108: 15(int) Load 101(i)
Branch 96
109: 15(int) ISub 108 19
98: Label
Store 101(i) 109
107: 20(ptr) AccessChain 18 19
Branch 107
108: 15(int) Load 107
107: Label
Store 106(i) 108
110: 15(int) Load 101(i)
Branch 109
111: 23(bool) INotEqual 110 25
109: Label
BranchConditional 111 104 106
LoopMerge 111 112 None
106: Label
Branch 110
110: Label
113: 15(int) Load 106(i)
114: 15(int) ISub 113 19
Store 106(i) 114
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
Test/baseResults/hlsl.isfinite.frag.out
View file @
84cc15f0
...
@@ -173,34 +173,34 @@ gl_FragCoord origin is upper left
...
@@ -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" 8
9
EntryPoint Fragment 4 "main" 8
3
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 2
2
"@finitetmp"
Name 2
0
"@finitetmp"
Name 3
6
"@finitetmp"
Name 3
2
"@finitetmp"
Name 3
9
"$Global"
Name 3
5
"$Global"
MemberName 3
9
($Global) 0 "f"
MemberName 3
5
($Global) 0 "f"
MemberName 3
9
($Global) 1 "f2"
MemberName 3
5
($Global) 1 "f2"
MemberName 3
9
($Global) 2 "f3"
MemberName 3
5
($Global) 2 "f3"
Name
41
""
Name
37
""
Name 5
7
"@finitetmp"
Name 5
1
"@finitetmp"
Name
71
"@finitetmp"
Name
65
"@finitetmp"
Name 8
9
"@entryPointOutput"
Name 8
3
"@entryPointOutput"
MemberDecorate 3
9
($Global) 0 Offset 0
MemberDecorate 3
5
($Global) 0 Offset 0
MemberDecorate 3
9
($Global) 1 Offset 4
MemberDecorate 3
5
($Global) 1 Offset 4
MemberDecorate 3
9
($Global) 2 Offset 16
MemberDecorate 3
5
($Global) 2 Offset 16
Decorate 3
9
($Global) Block
Decorate 3
5
($Global) Block
Decorate
41
DescriptorSet 0
Decorate
37
DescriptorSet 0
Decorate 8
9
(@entryPointOutput) Location 0
Decorate 8
3
(@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
...
@@ -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)
3
7
: TypeVector 6(float) 2
3
3
: TypeVector 6(float) 2
3
8
: TypeVector 6(float) 3
3
4
: TypeVector 6(float) 3
3
9($Global): TypeStruct 6(float) 37(fvec2) 38
(fvec3)
3
5($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
4
4
: TypePointer Uniform 6(float)
4
0
: TypePointer Uniform 6(float)
5
6: TypePointer Function 37
(fvec2)
5
0: TypePointer Function 33
(fvec2)
5
8: 42
(int) Constant 1
5
2: 38
(int) Constant 1
5
9: TypePointer Uniform 37
(fvec2)
5
3: 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)
7
7
: TypeVector 8(bool) 3
7
1
: 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
8
8
: TypePointer Output 13(fvec4)
8
2
: TypePointer Output 13(fvec4)
8
9(@entryPointOutput): 88
(ptr) Variable Output
8
3(@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 8
9(@entryPointOutput) 90
Store 8
3(@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
2
2
(@finitetmp): 7(ptr) Variable Function
2
0
(@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
Test/baseResults/hlsl.logical.binary.frag.out
View file @
84cc15f0
...
@@ -129,106 +129,95 @@ gl_FragCoord origin is upper left
...
@@ -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" 5
9
EntryPoint Fragment 4 "main" 5
4
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 1
5
"$Global"
Name 1
4
"$Global"
MemberName 1
5
($Global) 0 "ival"
MemberName 1
4
($Global) 0 "ival"
MemberName 1
5
($Global) 1 "ival4"
MemberName 1
4
($Global) 1 "ival4"
MemberName 1
5
($Global) 2 "fval"
MemberName 1
4
($Global) 2 "fval"
MemberName 1
5
($Global) 3 "fval4"
MemberName 1
4
($Global) 3 "fval4"
Name 1
7
""
Name 1
6
""
Name
50
"psout"
Name
45
"psout"
Name 5
9
"Color"
Name 5
4
"Color"
MemberDecorate 1
5
($Global) 0 Offset 0
MemberDecorate 1
4
($Global) 0 Offset 0
MemberDecorate 1
5
($Global) 1 Offset 16
MemberDecorate 1
4
($Global) 1 Offset 16
MemberDecorate 1
5
($Global) 2 Offset 32
MemberDecorate 1
4
($Global) 2 Offset 32
MemberDecorate 1
5
($Global) 3 Offset 48
MemberDecorate 1
4
($Global) 3 Offset 48
Decorate 1
5
($Global) Block
Decorate 1
4
($Global) Block
Decorate 1
7
DescriptorSet 0
Decorate 1
6
DescriptorSet 0
Decorate 5
9
(Color) Location 0
Decorate 5
4
(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: Type
Bool
12: Type
Int 32 1
13: Type
Int 32 1
13: Type
Vector 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: 1
6(ptr) Variable Uniform
17: 1
2(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
2
7: 13
(int) Constant 2
2
5: 12
(int) Constant 2
2
8
: TypePointer Uniform 6(float)
2
6
: TypePointer Uniform 6(float)
4
9
: TypePointer Function 8(PS_OUTPUT)
4
4
: 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)
5
8
: TypePointer Output 7(fvec4)
5
3
: TypePointer Output 7(fvec4)
5
9(Color): 58
(ptr) Variable Output
5
4(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 5
9(Color) 61
Store 5
4(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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment