SPV: Implement all matrix operators {+,-,*,/} for {matrix,scalar,vector}.
This commit is contained in:
@@ -3,4 +3,284 @@ spv.matrix.frag
|
||||
Linked fragment stage:
|
||||
|
||||
|
||||
Missing functionality: Composite comparison of non-vectors
|
||||
// Module Version 10000
|
||||
// Generated by (magic number): 80001
|
||||
// Id's are bound by 240
|
||||
|
||||
Capability Shader
|
||||
1: ExtInstImport "GLSL.std.450"
|
||||
MemoryModel Logical GLSL450
|
||||
EntryPoint Fragment 4 "main" 12 14 28 148 140 166
|
||||
ExecutionMode 4 OriginLowerLeft
|
||||
Source GLSL 130
|
||||
Name 4 "main"
|
||||
Name 10 "sum34"
|
||||
Name 12 "m1"
|
||||
Name 14 "m2"
|
||||
Name 28 "f"
|
||||
Name 138 "sum3"
|
||||
Name 140 "v4"
|
||||
Name 145 "sum4"
|
||||
Name 148 "v3"
|
||||
Name 153 "m43"
|
||||
Name 158 "m4"
|
||||
Name 166 "color"
|
||||
2: TypeVoid
|
||||
3: TypeFunction 2
|
||||
6: TypeFloat 32
|
||||
7: TypeVector 6(float) 4
|
||||
8: TypeMatrix 7(fvec4) 3
|
||||
9: TypePointer Function 8
|
||||
11: TypePointer Input 8
|
||||
12(m1): 11(ptr) Variable Input
|
||||
14(m2): 11(ptr) Variable Input
|
||||
27: TypePointer Input 6(float)
|
||||
28(f): 27(ptr) Variable Input
|
||||
81: 6(float) Constant 1065353216
|
||||
136: TypeVector 6(float) 3
|
||||
137: TypePointer Function 136(fvec3)
|
||||
139: TypePointer Input 7(fvec4)
|
||||
140(v4): 139(ptr) Variable Input
|
||||
144: TypePointer Function 7(fvec4)
|
||||
147: TypePointer Input 136(fvec3)
|
||||
148(v3): 147(ptr) Variable Input
|
||||
151: TypeMatrix 136(fvec3) 4
|
||||
152: TypePointer Function 151
|
||||
156: TypeMatrix 7(fvec4) 4
|
||||
157: TypePointer Function 156
|
||||
165: TypePointer Output 7(fvec4)
|
||||
166(color): 165(ptr) Variable Output
|
||||
187: 6(float) Constant 0
|
||||
4(main): 2 Function None 3
|
||||
5: Label
|
||||
10(sum34): 9(ptr) Variable Function
|
||||
138(sum3): 137(ptr) Variable Function
|
||||
145(sum4): 144(ptr) Variable Function
|
||||
153(m43): 152(ptr) Variable Function
|
||||
158(m4): 157(ptr) Variable Function
|
||||
13: 8 Load 12(m1)
|
||||
15: 8 Load 14(m2)
|
||||
16: 7(fvec4) CompositeExtract 13 0
|
||||
17: 7(fvec4) CompositeExtract 15 0
|
||||
18: 7(fvec4) FSub 16 17
|
||||
19: 7(fvec4) CompositeExtract 13 1
|
||||
20: 7(fvec4) CompositeExtract 15 1
|
||||
21: 7(fvec4) FSub 19 20
|
||||
22: 7(fvec4) CompositeExtract 13 2
|
||||
23: 7(fvec4) CompositeExtract 15 2
|
||||
24: 7(fvec4) FSub 22 23
|
||||
25: 8 CompositeConstruct 18 21 24
|
||||
Store 10(sum34) 25
|
||||
26: 8 Load 12(m1)
|
||||
29: 6(float) Load 28(f)
|
||||
30: 8 MatrixTimesScalar 26 29
|
||||
31: 8 Load 10(sum34)
|
||||
32: 7(fvec4) CompositeExtract 31 0
|
||||
33: 7(fvec4) CompositeExtract 30 0
|
||||
34: 7(fvec4) FAdd 32 33
|
||||
35: 7(fvec4) CompositeExtract 31 1
|
||||
36: 7(fvec4) CompositeExtract 30 1
|
||||
37: 7(fvec4) FAdd 35 36
|
||||
38: 7(fvec4) CompositeExtract 31 2
|
||||
39: 7(fvec4) CompositeExtract 30 2
|
||||
40: 7(fvec4) FAdd 38 39
|
||||
41: 8 CompositeConstruct 34 37 40
|
||||
Store 10(sum34) 41
|
||||
42: 6(float) Load 28(f)
|
||||
43: 8 Load 12(m1)
|
||||
44: 8 MatrixTimesScalar 43 42
|
||||
45: 8 Load 10(sum34)
|
||||
46: 7(fvec4) CompositeExtract 45 0
|
||||
47: 7(fvec4) CompositeExtract 44 0
|
||||
48: 7(fvec4) FAdd 46 47
|
||||
49: 7(fvec4) CompositeExtract 45 1
|
||||
50: 7(fvec4) CompositeExtract 44 1
|
||||
51: 7(fvec4) FAdd 49 50
|
||||
52: 7(fvec4) CompositeExtract 45 2
|
||||
53: 7(fvec4) CompositeExtract 44 2
|
||||
54: 7(fvec4) FAdd 52 53
|
||||
55: 8 CompositeConstruct 48 51 54
|
||||
Store 10(sum34) 55
|
||||
56: 8 Load 12(m1)
|
||||
57: 8 Load 14(m2)
|
||||
58: 7(fvec4) CompositeExtract 56 0
|
||||
59: 7(fvec4) CompositeExtract 57 0
|
||||
60: 7(fvec4) FMul 58 59
|
||||
61: 7(fvec4) CompositeExtract 56 1
|
||||
62: 7(fvec4) CompositeExtract 57 1
|
||||
63: 7(fvec4) FMul 61 62
|
||||
64: 7(fvec4) CompositeExtract 56 2
|
||||
65: 7(fvec4) CompositeExtract 57 2
|
||||
66: 7(fvec4) FMul 64 65
|
||||
67: 8 CompositeConstruct 60 63 66
|
||||
68: 8 Load 10(sum34)
|
||||
69: 7(fvec4) CompositeExtract 68 0
|
||||
70: 7(fvec4) CompositeExtract 67 0
|
||||
71: 7(fvec4) FDiv 69 70
|
||||
72: 7(fvec4) CompositeExtract 68 1
|
||||
73: 7(fvec4) CompositeExtract 67 1
|
||||
74: 7(fvec4) FDiv 72 73
|
||||
75: 7(fvec4) CompositeExtract 68 2
|
||||
76: 7(fvec4) CompositeExtract 67 2
|
||||
77: 7(fvec4) FDiv 75 76
|
||||
78: 8 CompositeConstruct 71 74 77
|
||||
Store 10(sum34) 78
|
||||
79: 8 Load 12(m1)
|
||||
80: 6(float) Load 28(f)
|
||||
82: 6(float) FDiv 81 80
|
||||
83: 8 MatrixTimesScalar 79 82
|
||||
84: 8 Load 10(sum34)
|
||||
85: 7(fvec4) CompositeExtract 84 0
|
||||
86: 7(fvec4) CompositeExtract 83 0
|
||||
87: 7(fvec4) FAdd 85 86
|
||||
88: 7(fvec4) CompositeExtract 84 1
|
||||
89: 7(fvec4) CompositeExtract 83 1
|
||||
90: 7(fvec4) FAdd 88 89
|
||||
91: 7(fvec4) CompositeExtract 84 2
|
||||
92: 7(fvec4) CompositeExtract 83 2
|
||||
93: 7(fvec4) FAdd 91 92
|
||||
94: 8 CompositeConstruct 87 90 93
|
||||
Store 10(sum34) 94
|
||||
95: 6(float) Load 28(f)
|
||||
96: 8 Load 12(m1)
|
||||
97: 7(fvec4) CompositeConstruct 95 95 95 95
|
||||
98: 7(fvec4) CompositeExtract 96 0
|
||||
99: 7(fvec4) FDiv 97 98
|
||||
100: 7(fvec4) CompositeExtract 96 1
|
||||
101: 7(fvec4) FDiv 97 100
|
||||
102: 7(fvec4) CompositeExtract 96 2
|
||||
103: 7(fvec4) FDiv 97 102
|
||||
104: 8 CompositeConstruct 99 101 103
|
||||
105: 8 Load 10(sum34)
|
||||
106: 7(fvec4) CompositeExtract 105 0
|
||||
107: 7(fvec4) CompositeExtract 104 0
|
||||
108: 7(fvec4) FAdd 106 107
|
||||
109: 7(fvec4) CompositeExtract 105 1
|
||||
110: 7(fvec4) CompositeExtract 104 1
|
||||
111: 7(fvec4) FAdd 109 110
|
||||
112: 7(fvec4) CompositeExtract 105 2
|
||||
113: 7(fvec4) CompositeExtract 104 2
|
||||
114: 7(fvec4) FAdd 112 113
|
||||
115: 8 CompositeConstruct 108 111 114
|
||||
Store 10(sum34) 115
|
||||
116: 6(float) Load 28(f)
|
||||
117: 8 Load 10(sum34)
|
||||
118: 7(fvec4) CompositeConstruct 116 116 116 116
|
||||
119: 7(fvec4) CompositeExtract 117 0
|
||||
120: 7(fvec4) FAdd 119 118
|
||||
121: 7(fvec4) CompositeExtract 117 1
|
||||
122: 7(fvec4) FAdd 121 118
|
||||
123: 7(fvec4) CompositeExtract 117 2
|
||||
124: 7(fvec4) FAdd 123 118
|
||||
125: 8 CompositeConstruct 120 122 124
|
||||
Store 10(sum34) 125
|
||||
126: 6(float) Load 28(f)
|
||||
127: 8 Load 10(sum34)
|
||||
128: 7(fvec4) CompositeConstruct 126 126 126 126
|
||||
129: 7(fvec4) CompositeExtract 127 0
|
||||
130: 7(fvec4) FSub 129 128
|
||||
131: 7(fvec4) CompositeExtract 127 1
|
||||
132: 7(fvec4) FSub 131 128
|
||||
133: 7(fvec4) CompositeExtract 127 2
|
||||
134: 7(fvec4) FSub 133 128
|
||||
135: 8 CompositeConstruct 130 132 134
|
||||
Store 10(sum34) 135
|
||||
141: 7(fvec4) Load 140(v4)
|
||||
142: 8 Load 14(m2)
|
||||
143: 136(fvec3) VectorTimesMatrix 141 142
|
||||
Store 138(sum3) 143
|
||||
146: 8 Load 14(m2)
|
||||
149: 136(fvec3) Load 148(v3)
|
||||
150: 7(fvec4) MatrixTimesVector 146 149
|
||||
Store 145(sum4) 150
|
||||
154: 8 Load 10(sum34)
|
||||
155: 151 Transpose 154
|
||||
Store 153(m43) 155
|
||||
159: 8 Load 12(m1)
|
||||
160: 151 Load 153(m43)
|
||||
161: 156 MatrixTimesMatrix 159 160
|
||||
Store 158(m4) 161
|
||||
162: 7(fvec4) Load 140(v4)
|
||||
163: 156 Load 158(m4)
|
||||
164: 7(fvec4) VectorTimesMatrix 162 163
|
||||
Store 145(sum4) 164
|
||||
167: 7(fvec4) Load 145(sum4)
|
||||
Store 166(color) 167
|
||||
168: 8 Load 10(sum34)
|
||||
169: 7(fvec4) CompositeConstruct 81 81 81 81
|
||||
170: 7(fvec4) CompositeExtract 168 0
|
||||
171: 7(fvec4) FAdd 170 169
|
||||
172: 7(fvec4) CompositeExtract 168 1
|
||||
173: 7(fvec4) FAdd 172 169
|
||||
174: 7(fvec4) CompositeExtract 168 2
|
||||
175: 7(fvec4) FAdd 174 169
|
||||
176: 8 CompositeConstruct 171 173 175
|
||||
Store 10(sum34) 176
|
||||
177: 8 Load 10(sum34)
|
||||
178: 7(fvec4) CompositeConstruct 81 81 81 81
|
||||
179: 7(fvec4) CompositeExtract 177 0
|
||||
180: 7(fvec4) FSub 179 178
|
||||
181: 7(fvec4) CompositeExtract 177 1
|
||||
182: 7(fvec4) FSub 181 178
|
||||
183: 7(fvec4) CompositeExtract 177 2
|
||||
184: 7(fvec4) FSub 183 178
|
||||
185: 8 CompositeConstruct 180 182 184
|
||||
Store 10(sum34) 185
|
||||
186: 6(float) Load 28(f)
|
||||
188: 7(fvec4) CompositeConstruct 186 187 187 187
|
||||
189: 7(fvec4) CompositeConstruct 187 186 187 187
|
||||
190: 7(fvec4) CompositeConstruct 187 187 186 187
|
||||
191: 8 CompositeConstruct 188 189 190
|
||||
192: 8 Load 10(sum34)
|
||||
193: 7(fvec4) CompositeExtract 192 0
|
||||
194: 7(fvec4) CompositeExtract 191 0
|
||||
195: 7(fvec4) FAdd 193 194
|
||||
196: 7(fvec4) CompositeExtract 192 1
|
||||
197: 7(fvec4) CompositeExtract 191 1
|
||||
198: 7(fvec4) FAdd 196 197
|
||||
199: 7(fvec4) CompositeExtract 192 2
|
||||
200: 7(fvec4) CompositeExtract 191 2
|
||||
201: 7(fvec4) FAdd 199 200
|
||||
202: 8 CompositeConstruct 195 198 201
|
||||
Store 10(sum34) 202
|
||||
203: 136(fvec3) Load 148(v3)
|
||||
204: 6(float) Load 28(f)
|
||||
205: 136(fvec3) Load 148(v3)
|
||||
206: 6(float) Load 28(f)
|
||||
207: 136(fvec3) Load 148(v3)
|
||||
208: 6(float) Load 28(f)
|
||||
209: 6(float) CompositeExtract 203 0
|
||||
210: 6(float) CompositeExtract 203 1
|
||||
211: 6(float) CompositeExtract 203 2
|
||||
212: 6(float) CompositeExtract 205 0
|
||||
213: 6(float) CompositeExtract 205 1
|
||||
214: 6(float) CompositeExtract 205 2
|
||||
215: 6(float) CompositeExtract 207 0
|
||||
216: 6(float) CompositeExtract 207 1
|
||||
217: 6(float) CompositeExtract 207 2
|
||||
218: 7(fvec4) CompositeConstruct 209 210 211 204
|
||||
219: 7(fvec4) CompositeConstruct 212 213 214 206
|
||||
220: 7(fvec4) CompositeConstruct 215 216 217 208
|
||||
221: 8 CompositeConstruct 218 219 220
|
||||
222: 8 Load 10(sum34)
|
||||
223: 7(fvec4) CompositeExtract 222 0
|
||||
224: 7(fvec4) CompositeExtract 221 0
|
||||
225: 7(fvec4) FAdd 223 224
|
||||
226: 7(fvec4) CompositeExtract 222 1
|
||||
227: 7(fvec4) CompositeExtract 221 1
|
||||
228: 7(fvec4) FAdd 226 227
|
||||
229: 7(fvec4) CompositeExtract 222 2
|
||||
230: 7(fvec4) CompositeExtract 221 2
|
||||
231: 7(fvec4) FAdd 229 230
|
||||
232: 8 CompositeConstruct 225 228 231
|
||||
Store 10(sum34) 232
|
||||
233: 136(fvec3) Load 138(sum3)
|
||||
234: 151 Load 153(m43)
|
||||
235: 7(fvec4) VectorTimesMatrix 233 234
|
||||
236: 7(fvec4) Load 145(sum4)
|
||||
237: 7(fvec4) FAdd 235 236
|
||||
238: 7(fvec4) Load 166(color)
|
||||
239: 7(fvec4) FAdd 238 237
|
||||
Store 166(color) 239
|
||||
Return
|
||||
FunctionEnd
|
||||
|
||||
Reference in New Issue
Block a user