Reuse loads generated for repeated function arguments

This commit is contained in:
Jeff Bolz 2024-05-31 11:46:03 -05:00 committed by arcady-lunarg
parent 0e311906b9
commit 6a8b2b2439
11 changed files with 9106 additions and 9441 deletions

View file

@ -2,7 +2,7 @@ spv.newTexture.frag
Validation failed
// Module Version 10000
// Generated by (magic number): 8000b
// Id's are bound by 284
// Id's are bound by 278
Capability Shader
Capability SampledRect
@ -10,7 +10,7 @@ Validation failed
Capability ImageQuery
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 17 26 29 55 81 84 92 253 283
EntryPoint Fragment 4 "main" 17 26 29 55 81 84 92 247 277
ExecutionMode 4 OriginUpperLeft
Source GLSL 430
Name 4 "main"
@ -29,21 +29,21 @@ Validation failed
Name 92 "ic2D"
Name 102 "sr"
Name 128 "sCube"
Name 139 "s2DArrayShadow"
Name 167 "iv"
Name 171 "is2D"
Name 208 "is3D"
Name 220 "isCube"
Name 232 "is2DArray"
Name 243 "iv2"
Name 247 "sCubeShadow"
Name 253 "FragData"
Name 265 "is2Dms"
Name 269 "us2D"
Name 273 "us3D"
Name 277 "usCube"
Name 281 "us2DArray"
Name 283 "ic4D"
Name 137 "s2DArrayShadow"
Name 162 "iv"
Name 166 "is2D"
Name 202 "is3D"
Name 214 "isCube"
Name 226 "is2DArray"
Name 237 "iv2"
Name 241 "sCubeShadow"
Name 247 "FragData"
Name 259 "is2Dms"
Name 263 "us2D"
Name 267 "us3D"
Name 271 "usCube"
Name 275 "us2DArray"
Name 277 "ic4D"
Decorate 13(s2D) DescriptorSet 0
Decorate 13(s2D) Binding 0
Decorate 17(c2D) Location 1
@ -68,31 +68,31 @@ Validation failed
Decorate 102(sr) Binding 1
Decorate 128(sCube) DescriptorSet 0
Decorate 128(sCube) Binding 3
Decorate 139(s2DArrayShadow) DescriptorSet 0
Decorate 139(s2DArrayShadow) Binding 8
Decorate 171(is2D) DescriptorSet 0
Decorate 171(is2D) Binding 9
Decorate 208(is3D) DescriptorSet 0
Decorate 208(is3D) Binding 10
Decorate 220(isCube) DescriptorSet 0
Decorate 220(isCube) Binding 11
Decorate 232(is2DArray) DescriptorSet 0
Decorate 232(is2DArray) Binding 12
Decorate 247(sCubeShadow) DescriptorSet 0
Decorate 247(sCubeShadow) Binding 4
Decorate 253(FragData) Location 0
Decorate 265(is2Dms) DescriptorSet 0
Decorate 265(is2Dms) Binding 0
Decorate 269(us2D) DescriptorSet 0
Decorate 269(us2D) Binding 0
Decorate 273(us3D) DescriptorSet 0
Decorate 273(us3D) Binding 0
Decorate 277(usCube) DescriptorSet 0
Decorate 277(usCube) Binding 0
Decorate 281(us2DArray) DescriptorSet 0
Decorate 281(us2DArray) Binding 0
Decorate 283(ic4D) Flat
Decorate 283(ic4D) Location 7
Decorate 137(s2DArrayShadow) DescriptorSet 0
Decorate 137(s2DArrayShadow) Binding 8
Decorate 166(is2D) DescriptorSet 0
Decorate 166(is2D) Binding 9
Decorate 202(is3D) DescriptorSet 0
Decorate 202(is3D) Binding 10
Decorate 214(isCube) DescriptorSet 0
Decorate 214(isCube) Binding 11
Decorate 226(is2DArray) DescriptorSet 0
Decorate 226(is2DArray) Binding 12
Decorate 241(sCubeShadow) DescriptorSet 0
Decorate 241(sCubeShadow) Binding 4
Decorate 247(FragData) Location 0
Decorate 259(is2Dms) DescriptorSet 0
Decorate 259(is2Dms) Binding 0
Decorate 263(us2D) DescriptorSet 0
Decorate 263(us2D) Binding 0
Decorate 267(us3D) DescriptorSet 0
Decorate 267(us3D) Binding 0
Decorate 271(usCube) DescriptorSet 0
Decorate 271(usCube) Binding 0
Decorate 275(us2DArray) DescriptorSet 0
Decorate 275(us2DArray) Binding 0
Decorate 277(ic4D) Flat
Decorate 277(ic4D) Location 7
2: TypeVoid
3: TypeFunction 2
6: TypeFloat 32
@ -153,66 +153,66 @@ Validation failed
126: TypeSampledImage 125
127: TypePointer UniformConstant 126
128(sCube): 127(ptr) Variable UniformConstant
136: TypeImage 6(float) 2D depth array sampled format:Unknown
137: TypeSampledImage 136
138: TypePointer UniformConstant 137
139(s2DArrayShadow): 138(ptr) Variable UniformConstant
146: 32(int) Constant 0
165: TypeVector 67(int) 4
166: TypePointer Function 165(ivec4)
168: TypeImage 67(int) 2D sampled format:Unknown
169: TypeSampledImage 168
170: TypePointer UniformConstant 169
171(is2D): 170(ptr) Variable UniformConstant
205: TypeImage 67(int) 3D sampled format:Unknown
206: TypeSampledImage 205
207: TypePointer UniformConstant 206
208(is3D): 207(ptr) Variable UniformConstant
211: 6(float) Constant 1082549862
217: TypeImage 67(int) Cube sampled format:Unknown
218: TypeSampledImage 217
219: TypePointer UniformConstant 218
220(isCube): 219(ptr) Variable UniformConstant
229: TypeImage 67(int) 2D array sampled format:Unknown
230: TypeSampledImage 229
231: TypePointer UniformConstant 230
232(is2DArray): 231(ptr) Variable UniformConstant
242: TypePointer Function 68(ivec2)
244: TypeImage 6(float) Cube depth sampled format:Unknown
245: TypeSampledImage 244
246: TypePointer UniformConstant 245
247(sCubeShadow): 246(ptr) Variable UniformConstant
249: 67(int) Constant 2
252: TypePointer Output 7(fvec4)
253(FragData): 252(ptr) Variable Output
257: 6(float) Constant 0
262: TypeImage 67(int) 2D multi-sampled sampled format:Unknown
263: TypeSampledImage 262
264: TypePointer UniformConstant 263
265(is2Dms): 264(ptr) Variable UniformConstant
266: TypeImage 32(int) 2D sampled format:Unknown
267: TypeSampledImage 266
268: TypePointer UniformConstant 267
269(us2D): 268(ptr) Variable UniformConstant
270: TypeImage 32(int) 3D sampled format:Unknown
271: TypeSampledImage 270
272: TypePointer UniformConstant 271
273(us3D): 272(ptr) Variable UniformConstant
274: TypeImage 32(int) Cube sampled format:Unknown
275: TypeSampledImage 274
276: TypePointer UniformConstant 275
277(usCube): 276(ptr) Variable UniformConstant
278: TypeImage 32(int) 2D array sampled format:Unknown
279: TypeSampledImage 278
280: TypePointer UniformConstant 279
281(us2DArray): 280(ptr) Variable UniformConstant
282: TypePointer Input 165(ivec4)
283(ic4D): 282(ptr) Variable Input
134: TypeImage 6(float) 2D depth array sampled format:Unknown
135: TypeSampledImage 134
136: TypePointer UniformConstant 135
137(s2DArrayShadow): 136(ptr) Variable UniformConstant
143: 32(int) Constant 0
160: TypeVector 67(int) 4
161: TypePointer Function 160(ivec4)
163: TypeImage 67(int) 2D sampled format:Unknown
164: TypeSampledImage 163
165: TypePointer UniformConstant 164
166(is2D): 165(ptr) Variable UniformConstant
199: TypeImage 67(int) 3D sampled format:Unknown
200: TypeSampledImage 199
201: TypePointer UniformConstant 200
202(is3D): 201(ptr) Variable UniformConstant
205: 6(float) Constant 1082549862
211: TypeImage 67(int) Cube sampled format:Unknown
212: TypeSampledImage 211
213: TypePointer UniformConstant 212
214(isCube): 213(ptr) Variable UniformConstant
223: TypeImage 67(int) 2D array sampled format:Unknown
224: TypeSampledImage 223
225: TypePointer UniformConstant 224
226(is2DArray): 225(ptr) Variable UniformConstant
236: TypePointer Function 68(ivec2)
238: TypeImage 6(float) Cube depth sampled format:Unknown
239: TypeSampledImage 238
240: TypePointer UniformConstant 239
241(sCubeShadow): 240(ptr) Variable UniformConstant
243: 67(int) Constant 2
246: TypePointer Output 7(fvec4)
247(FragData): 246(ptr) Variable Output
251: 6(float) Constant 0
256: TypeImage 67(int) 2D multi-sampled sampled format:Unknown
257: TypeSampledImage 256
258: TypePointer UniformConstant 257
259(is2Dms): 258(ptr) Variable UniformConstant
260: TypeImage 32(int) 2D sampled format:Unknown
261: TypeSampledImage 260
262: TypePointer UniformConstant 261
263(us2D): 262(ptr) Variable UniformConstant
264: TypeImage 32(int) 3D sampled format:Unknown
265: TypeSampledImage 264
266: TypePointer UniformConstant 265
267(us3D): 266(ptr) Variable UniformConstant
268: TypeImage 32(int) Cube sampled format:Unknown
269: TypeSampledImage 268
270: TypePointer UniformConstant 269
271(usCube): 270(ptr) Variable UniformConstant
272: TypeImage 32(int) 2D array sampled format:Unknown
273: TypeSampledImage 272
274: TypePointer UniformConstant 273
275(us2DArray): 274(ptr) Variable UniformConstant
276: TypePointer Input 160(ivec4)
277(ic4D): 276(ptr) Variable Input
4(main): 2 Function None 3
5: Label
9(v): 8(ptr) Variable Function
167(iv): 166(ptr) Variable Function
243(iv2): 242(ptr) Variable Function
162(iv): 161(ptr) Variable Function
237(iv2): 236(ptr) Variable Function
14: 11 Load 13(s2D)
18: 15(fvec2) Load 17(c2D)
19: 7(fvec4) ImageSampleImplicitLod 14 18
@ -289,121 +289,115 @@ Validation failed
Store 9(v) 124
129: 126 Load 128(sCube)
130: 53(fvec3) Load 55(c3D)
131: 53(fvec3) Load 55(c3D)
132: 53(fvec3) Load 55(c3D)
133: 7(fvec4) ImageSampleExplicitLod 129 130 Grad 131 132
134: 7(fvec4) Load 9(v)
135: 7(fvec4) FAdd 134 133
Store 9(v) 135
140: 137 Load 139(s2DArrayShadow)
141: 7(fvec4) Load 26(c4D)
142: 15(fvec2) Load 17(c2D)
143: 15(fvec2) Load 17(c2D)
144: 6(float) CompositeExtract 141 3
145: 6(float) ImageSampleDrefExplicitLod 140 141 144 Grad ConstOffset 142 143 70
147: 34(ptr) AccessChain 9(v) 146
148: 6(float) Load 147
149: 6(float) FAdd 148 145
150: 34(ptr) AccessChain 9(v) 146
Store 150 149
151: 40 Load 42(s3D)
152: 7(fvec4) Load 26(c4D)
153: 53(fvec3) Load 55(c3D)
154: 53(fvec3) Load 55(c3D)
155: 7(fvec4) ImageSampleProjExplicitLod 151 152 Grad 153 154
156: 7(fvec4) Load 9(v)
157: 7(fvec4) FAdd 156 155
Store 9(v) 157
158: 11 Load 13(s2D)
159: 53(fvec3) Load 55(c3D)
160: 15(fvec2) Load 17(c2D)
161: 15(fvec2) Load 17(c2D)
162: 7(fvec4) ImageSampleProjExplicitLod 158 159 Grad ConstOffset 160 161 70
163: 7(fvec4) Load 9(v)
164: 7(fvec4) FAdd 163 162
Store 9(v) 164
172: 169 Load 171(is2D)
173: 15(fvec2) Load 17(c2D)
174: 165(ivec4) ImageSampleImplicitLod 172 173
Store 167(iv) 174
175: 165(ivec4) Load 167(iv)
176: 7(fvec4) ConvertSToF 175
177: 7(fvec4) Load 9(v)
178: 7(fvec4) FAdd 177 176
Store 9(v) 178
179: 169 Load 171(is2D)
180: 7(fvec4) Load 26(c4D)
181: 6(float) CompositeExtract 180 3
182: 7(fvec4) CompositeInsert 181 180 2
183: 165(ivec4) ImageSampleProjImplicitLod 179 182 ConstOffset 70
Store 167(iv) 183
184: 165(ivec4) Load 167(iv)
185: 7(fvec4) ConvertSToF 184
186: 7(fvec4) Load 9(v)
187: 7(fvec4) FAdd 186 185
Store 9(v) 187
188: 169 Load 171(is2D)
189: 53(fvec3) Load 55(c3D)
190: 6(float) Load 29(c1D)
191: 165(ivec4) ImageSampleProjExplicitLod 188 189 Lod 190
Store 167(iv) 191
192: 165(ivec4) Load 167(iv)
193: 7(fvec4) ConvertSToF 192
194: 7(fvec4) Load 9(v)
195: 7(fvec4) FAdd 194 193
Store 9(v) 195
196: 169 Load 171(is2D)
197: 53(fvec3) Load 55(c3D)
198: 15(fvec2) Load 17(c2D)
199: 15(fvec2) Load 17(c2D)
200: 165(ivec4) ImageSampleProjExplicitLod 196 197 Grad 198 199
Store 167(iv) 200
201: 165(ivec4) Load 167(iv)
202: 7(fvec4) ConvertSToF 201
203: 7(fvec4) Load 9(v)
204: 7(fvec4) FAdd 203 202
Store 9(v) 204
209: 206 Load 208(is3D)
210: 53(fvec3) Load 55(c3D)
212: 165(ivec4) ImageSampleImplicitLod 209 210 Bias 211
Store 167(iv) 212
213: 165(ivec4) Load 167(iv)
214: 7(fvec4) ConvertSToF 213
215: 7(fvec4) Load 9(v)
216: 7(fvec4) FAdd 215 214
Store 9(v) 216
221: 218 Load 220(isCube)
222: 53(fvec3) Load 55(c3D)
223: 6(float) Load 29(c1D)
224: 165(ivec4) ImageSampleExplicitLod 221 222 Lod 223
Store 167(iv) 224
225: 165(ivec4) Load 167(iv)
226: 7(fvec4) ConvertSToF 225
227: 7(fvec4) Load 9(v)
228: 7(fvec4) FAdd 227 226
Store 9(v) 228
233: 230 Load 232(is2DArray)
234: 79(ivec3) Load 81(ic3D)
235: 67(int) Load 84(ic1D)
236: 229 Image 233
237: 165(ivec4) ImageFetch 236 234 Lod 235
Store 167(iv) 237
238: 165(ivec4) Load 167(iv)
239: 7(fvec4) ConvertSToF 238
240: 7(fvec4) Load 9(v)
241: 7(fvec4) FAdd 240 239
Store 9(v) 241
248: 245 Load 247(sCubeShadow)
250: 244 Image 248
251: 68(ivec2) ImageQuerySizeLod 250 249
Store 243(iv2) 251
254: 7(fvec4) Load 9(v)
255: 68(ivec2) Load 243(iv2)
256: 15(fvec2) ConvertSToF 255
258: 6(float) CompositeExtract 256 0
259: 6(float) CompositeExtract 256 1
260: 7(fvec4) CompositeConstruct 258 259 257 257
261: 7(fvec4) FAdd 254 260
Store 253(FragData) 261
131: 7(fvec4) ImageSampleExplicitLod 129 130 Grad 130 130
132: 7(fvec4) Load 9(v)
133: 7(fvec4) FAdd 132 131
Store 9(v) 133
138: 135 Load 137(s2DArrayShadow)
139: 7(fvec4) Load 26(c4D)
140: 15(fvec2) Load 17(c2D)
141: 6(float) CompositeExtract 139 3
142: 6(float) ImageSampleDrefExplicitLod 138 139 141 Grad ConstOffset 140 140 70
144: 34(ptr) AccessChain 9(v) 143
145: 6(float) Load 144
146: 6(float) FAdd 145 142
147: 34(ptr) AccessChain 9(v) 143
Store 147 146
148: 40 Load 42(s3D)
149: 7(fvec4) Load 26(c4D)
150: 53(fvec3) Load 55(c3D)
151: 7(fvec4) ImageSampleProjExplicitLod 148 149 Grad 150 150
152: 7(fvec4) Load 9(v)
153: 7(fvec4) FAdd 152 151
Store 9(v) 153
154: 11 Load 13(s2D)
155: 53(fvec3) Load 55(c3D)
156: 15(fvec2) Load 17(c2D)
157: 7(fvec4) ImageSampleProjExplicitLod 154 155 Grad ConstOffset 156 156 70
158: 7(fvec4) Load 9(v)
159: 7(fvec4) FAdd 158 157
Store 9(v) 159
167: 164 Load 166(is2D)
168: 15(fvec2) Load 17(c2D)
169: 160(ivec4) ImageSampleImplicitLod 167 168
Store 162(iv) 169
170: 160(ivec4) Load 162(iv)
171: 7(fvec4) ConvertSToF 170
172: 7(fvec4) Load 9(v)
173: 7(fvec4) FAdd 172 171
Store 9(v) 173
174: 164 Load 166(is2D)
175: 7(fvec4) Load 26(c4D)
176: 6(float) CompositeExtract 175 3
177: 7(fvec4) CompositeInsert 176 175 2
178: 160(ivec4) ImageSampleProjImplicitLod 174 177 ConstOffset 70
Store 162(iv) 178
179: 160(ivec4) Load 162(iv)
180: 7(fvec4) ConvertSToF 179
181: 7(fvec4) Load 9(v)
182: 7(fvec4) FAdd 181 180
Store 9(v) 182
183: 164 Load 166(is2D)
184: 53(fvec3) Load 55(c3D)
185: 6(float) Load 29(c1D)
186: 160(ivec4) ImageSampleProjExplicitLod 183 184 Lod 185
Store 162(iv) 186
187: 160(ivec4) Load 162(iv)
188: 7(fvec4) ConvertSToF 187
189: 7(fvec4) Load 9(v)
190: 7(fvec4) FAdd 189 188
Store 9(v) 190
191: 164 Load 166(is2D)
192: 53(fvec3) Load 55(c3D)
193: 15(fvec2) Load 17(c2D)
194: 160(ivec4) ImageSampleProjExplicitLod 191 192 Grad 193 193
Store 162(iv) 194
195: 160(ivec4) Load 162(iv)
196: 7(fvec4) ConvertSToF 195
197: 7(fvec4) Load 9(v)
198: 7(fvec4) FAdd 197 196
Store 9(v) 198
203: 200 Load 202(is3D)
204: 53(fvec3) Load 55(c3D)
206: 160(ivec4) ImageSampleImplicitLod 203 204 Bias 205
Store 162(iv) 206
207: 160(ivec4) Load 162(iv)
208: 7(fvec4) ConvertSToF 207
209: 7(fvec4) Load 9(v)
210: 7(fvec4) FAdd 209 208
Store 9(v) 210
215: 212 Load 214(isCube)
216: 53(fvec3) Load 55(c3D)
217: 6(float) Load 29(c1D)
218: 160(ivec4) ImageSampleExplicitLod 215 216 Lod 217
Store 162(iv) 218
219: 160(ivec4) Load 162(iv)
220: 7(fvec4) ConvertSToF 219
221: 7(fvec4) Load 9(v)
222: 7(fvec4) FAdd 221 220
Store 9(v) 222
227: 224 Load 226(is2DArray)
228: 79(ivec3) Load 81(ic3D)
229: 67(int) Load 84(ic1D)
230: 223 Image 227
231: 160(ivec4) ImageFetch 230 228 Lod 229
Store 162(iv) 231
232: 160(ivec4) Load 162(iv)
233: 7(fvec4) ConvertSToF 232
234: 7(fvec4) Load 9(v)
235: 7(fvec4) FAdd 234 233
Store 9(v) 235
242: 239 Load 241(sCubeShadow)
244: 238 Image 242
245: 68(ivec2) ImageQuerySizeLod 244 243
Store 237(iv2) 245
248: 7(fvec4) Load 9(v)
249: 68(ivec2) Load 237(iv2)
250: 15(fvec2) ConvertSToF 249
252: 6(float) CompositeExtract 250 0
253: 6(float) CompositeExtract 250 1
254: 7(fvec4) CompositeConstruct 252 253 251 251
255: 7(fvec4) FAdd 248 254
Store 247(FragData) 255
Return
FunctionEnd