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.sparseTextureClamp.frag
Validation failed
// Module Version 10000
// Generated by (magic number): 8000b
// Id's are bound by 360
// Id's are bound by 344
Capability Shader
Capability SampledRect
@ -11,7 +11,7 @@ Validation failed
Capability SampledCubeArray
1: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Fragment 4 "main" 33 36 51 95 345
EntryPoint Fragment 4 "main" 33 36 51 95 329
ExecutionMode 4 OriginUpperLeft
Source GLSL 450
SourceExtension "GL_ARB_sparse_texture_clamp"
@ -35,11 +35,11 @@ Validation failed
Name 154 "us2DRect"
Name 161 "ResType"
Name 170 "s2DArrayShadow"
Name 218 "sCubeShadow"
Name 235 "usCubeArray"
Name 286 "s2DRectShadow"
Name 305 "is2DArray"
Name 345 "outColor"
Name 216 "sCubeShadow"
Name 232 "usCubeArray"
Name 276 "s2DRectShadow"
Name 294 "is2DArray"
Name 329 "outColor"
Decorate 29(s2D) DescriptorSet 0
Decorate 29(s2D) Binding 0
Decorate 33(c2) Location 0
@ -58,15 +58,15 @@ Validation failed
Decorate 154(us2DRect) Binding 10
Decorate 170(s2DArrayShadow) DescriptorSet 0
Decorate 170(s2DArrayShadow) Binding 4
Decorate 218(sCubeShadow) DescriptorSet 0
Decorate 218(sCubeShadow) Binding 3
Decorate 235(usCubeArray) DescriptorSet 0
Decorate 235(usCubeArray) Binding 9
Decorate 286(s2DRectShadow) DescriptorSet 0
Decorate 286(s2DRectShadow) Binding 5
Decorate 305(is2DArray) DescriptorSet 0
Decorate 305(is2DArray) Binding 8
Decorate 345(outColor) Location 0
Decorate 216(sCubeShadow) DescriptorSet 0
Decorate 216(sCubeShadow) Binding 3
Decorate 232(usCubeArray) DescriptorSet 0
Decorate 232(usCubeArray) Binding 9
Decorate 276(s2DRectShadow) DescriptorSet 0
Decorate 276(s2DRectShadow) Binding 5
Decorate 294(is2DArray) DescriptorSet 0
Decorate 294(is2DArray) Binding 8
Decorate 329(outColor) Location 0
2: TypeVoid
3: TypeFunction 2
6: TypeInt 32 1
@ -139,37 +139,37 @@ Validation failed
173: 6(int) Constant 5
174: 157(ivec2) ConstantComposite 173 173
176: 20(int) Constant 2
215: TypeImage 10(float) Cube depth sampled format:Unknown
216: TypeSampledImage 215
217: TypePointer UniformConstant 216
218(sCubeShadow): 217(ptr) Variable UniformConstant
224: 20(int) Constant 1
232: TypeImage 20(int) Cube array sampled format:Unknown
233: TypeSampledImage 232
234: TypePointer UniformConstant 233
235(usCubeArray): 234(ptr) Variable UniformConstant
283: TypeImage 10(float) Rect depth sampled format:Unknown
284: TypeSampledImage 283
285: TypePointer UniformConstant 284
286(s2DRectShadow): 285(ptr) Variable UniformConstant
291: 6(int) Constant 6
292: 157(ivec2) ConstantComposite 291 291
294: 20(int) Constant 3
302: TypeImage 6(int) 2D array sampled format:Unknown
303: TypeSampledImage 302
304: TypePointer UniformConstant 303
305(is2DArray): 304(ptr) Variable UniformConstant
310: 157(ivec2) ConstantComposite 143 143
344: TypePointer Output 11(fvec4)
345(outColor): 344(ptr) Variable Output
347: TypeBool
213: TypeImage 10(float) Cube depth sampled format:Unknown
214: TypeSampledImage 213
215: TypePointer UniformConstant 214
216(sCubeShadow): 215(ptr) Variable UniformConstant
221: 20(int) Constant 1
229: TypeImage 20(int) Cube array sampled format:Unknown
230: TypeSampledImage 229
231: TypePointer UniformConstant 230
232(usCubeArray): 231(ptr) Variable UniformConstant
273: TypeImage 10(float) Rect depth sampled format:Unknown
274: TypeSampledImage 273
275: TypePointer UniformConstant 274
276(s2DRectShadow): 275(ptr) Variable UniformConstant
280: 6(int) Constant 6
281: 157(ivec2) ConstantComposite 280 280
283: 20(int) Constant 3
291: TypeImage 6(int) 2D array sampled format:Unknown
292: TypeSampledImage 291
293: TypePointer UniformConstant 292
294(is2DArray): 293(ptr) Variable UniformConstant
298: 157(ivec2) ConstantComposite 143 143
328: TypePointer Output 11(fvec4)
329(outColor): 328(ptr) Variable Output
331: TypeBool
4(main): 2 Function None 3
5: Label
8(resident): 7(ptr) Variable Function
13(texel): 12(ptr) Variable Function
18(itexel): 17(ptr) Variable Function
23(utexel): 22(ptr) Variable Function
349: 12(ptr) Variable Function
333: 12(ptr) Variable Function
Store 8(resident) 9
Store 13(texel) 15
Store 18(itexel) 19
@ -325,158 +325,142 @@ Validation failed
Store 204 203
205: 45 Load 47(s3D)
206: 49(fvec3) Load 51(c3)
207: 49(fvec3) Load 51(c3)
208: 49(fvec3) Load 51(c3)
209: 10(float) Load 36(lodClamp)
210: 38(ResType) ImageSparseSampleExplicitLod 205 206 Grad MinLod 207 208 209
211: 11(fvec4) CompositeExtract 210 1
Store 13(texel) 211
212: 6(int) CompositeExtract 210 0
213: 6(int) Load 8(resident)
214: 6(int) BitwiseOr 213 212
Store 8(resident) 214
219: 216 Load 218(sCubeShadow)
220: 11(fvec4) Load 95(c4)
221: 49(fvec3) Load 51(c3)
222: 49(fvec3) Load 51(c3)
223: 10(float) Load 36(lodClamp)
225: 80(ptr) AccessChain 13(texel) 224
226: 10(float) CompositeExtract 220 3
227: 83(ResType) ImageSparseSampleDrefExplicitLod 219 220 226 Grad MinLod 221 222 223
228: 10(float) CompositeExtract 227 1
Store 225 228
229: 6(int) CompositeExtract 227 0
230: 6(int) Load 8(resident)
231: 6(int) BitwiseOr 230 229
Store 8(resident) 231
236: 233 Load 235(usCubeArray)
237: 11(fvec4) Load 95(c4)
238: 49(fvec3) Load 51(c3)
239: 49(fvec3) Load 51(c3)
240: 10(float) Load 36(lodClamp)
241:161(ResType) ImageSparseSampleExplicitLod 236 237 Grad MinLod 238 239 240
242: 21(ivec4) CompositeExtract 241 1
Store 23(utexel) 242
243: 6(int) CompositeExtract 241 0
244: 6(int) Load 8(resident)
245: 6(int) BitwiseOr 244 243
Store 8(resident) 245
246: 45 Load 47(s3D)
247: 49(fvec3) Load 51(c3)
248: 49(fvec3) Load 51(c3)
249: 49(fvec3) Load 51(c3)
250: 10(float) Load 36(lodClamp)
251: 11(fvec4) ImageSampleExplicitLod 246 247 Grad MinLod 248 249 250
252: 11(fvec4) Load 13(texel)
253: 11(fvec4) FAdd 252 251
Store 13(texel) 253
254: 216 Load 218(sCubeShadow)
255: 11(fvec4) Load 95(c4)
256: 49(fvec3) Load 51(c3)
257: 49(fvec3) Load 51(c3)
258: 10(float) Load 36(lodClamp)
259: 10(float) CompositeExtract 255 3
260: 10(float) ImageSampleDrefExplicitLod 254 255 259 Grad MinLod 256 257 258
261: 80(ptr) AccessChain 13(texel) 224
262: 10(float) Load 261
263: 10(float) FAdd 262 260
264: 80(ptr) AccessChain 13(texel) 224
Store 264 263
265: 233 Load 235(usCubeArray)
266: 11(fvec4) Load 95(c4)
267: 49(fvec3) Load 51(c3)
268: 49(fvec3) Load 51(c3)
269: 10(float) Load 36(lodClamp)
270: 21(ivec4) ImageSampleExplicitLod 265 266 Grad MinLod 267 268 269
271: 21(ivec4) Load 23(utexel)
272: 21(ivec4) IAdd 271 270
Store 23(utexel) 272
273: 27 Load 29(s2D)
274: 31(fvec2) Load 33(c2)
275: 31(fvec2) Load 33(c2)
276: 31(fvec2) Load 33(c2)
277: 10(float) Load 36(lodClamp)
278: 38(ResType) ImageSparseSampleExplicitLod 273 274 Grad ConstOffset MinLod 275 276 174 277
279: 11(fvec4) CompositeExtract 278 1
Store 13(texel) 279
280: 6(int) CompositeExtract 278 0
281: 6(int) Load 8(resident)
282: 6(int) BitwiseOr 281 280
Store 8(resident) 282
287: 284 Load 286(s2DRectShadow)
288: 49(fvec3) Load 51(c3)
289: 31(fvec2) Load 33(c2)
290: 31(fvec2) Load 33(c2)
293: 10(float) Load 36(lodClamp)
295: 80(ptr) AccessChain 13(texel) 294
296: 10(float) CompositeExtract 288 2
297: 83(ResType) ImageSparseSampleDrefExplicitLod 287 288 296 Grad ConstOffset MinLod 289 290 292 293
298: 10(float) CompositeExtract 297 1
Store 295 298
299: 6(int) CompositeExtract 297 0
300: 6(int) Load 8(resident)
301: 6(int) BitwiseOr 300 299
Store 8(resident) 301
306: 303 Load 305(is2DArray)
307: 49(fvec3) Load 51(c3)
308: 31(fvec2) Load 33(c2)
309: 31(fvec2) Load 33(c2)
311: 10(float) Load 36(lodClamp)
312: 67(ResType) ImageSparseSampleExplicitLod 306 307 Grad ConstOffset MinLod 308 309 310 311
313: 16(ivec4) CompositeExtract 312 1
Store 18(itexel) 313
314: 6(int) CompositeExtract 312 0
315: 6(int) Load 8(resident)
316: 6(int) BitwiseOr 315 314
Store 8(resident) 316
317: 27 Load 29(s2D)
318: 31(fvec2) Load 33(c2)
319: 31(fvec2) Load 33(c2)
320: 31(fvec2) Load 33(c2)
321: 10(float) Load 36(lodClamp)
322: 11(fvec4) ImageSampleExplicitLod 317 318 Grad ConstOffset MinLod 319 320 174 321
323: 11(fvec4) Load 13(texel)
324: 11(fvec4) FAdd 323 322
Store 13(texel) 324
325: 284 Load 286(s2DRectShadow)
326: 49(fvec3) Load 51(c3)
327: 31(fvec2) Load 33(c2)
328: 31(fvec2) Load 33(c2)
329: 10(float) Load 36(lodClamp)
330: 10(float) CompositeExtract 326 2
331: 10(float) ImageSampleDrefExplicitLod 325 326 330 Grad ConstOffset MinLod 327 328 292 329
332: 80(ptr) AccessChain 13(texel) 294
333: 10(float) Load 332
334: 10(float) FAdd 333 331
335: 80(ptr) AccessChain 13(texel) 294
Store 335 334
336: 303 Load 305(is2DArray)
337: 49(fvec3) Load 51(c3)
338: 31(fvec2) Load 33(c2)
339: 31(fvec2) Load 33(c2)
340: 10(float) Load 36(lodClamp)
341: 16(ivec4) ImageSampleExplicitLod 336 337 Grad ConstOffset MinLod 338 339 310 340
342: 16(ivec4) Load 18(itexel)
343: 16(ivec4) IAdd 342 341
Store 18(itexel) 343
346: 6(int) Load 8(resident)
348: 347(bool) ImageSparseTexelsResident 346
SelectionMerge 351 None
BranchConditional 348 350 353
350: Label
352: 11(fvec4) Load 13(texel)
Store 349 352
Branch 351
353: Label
354: 16(ivec4) Load 18(itexel)
355: 11(fvec4) ConvertSToF 354
356: 21(ivec4) Load 23(utexel)
357: 11(fvec4) ConvertUToF 356
358: 11(fvec4) FAdd 355 357
Store 349 358
Branch 351
351: Label
359: 11(fvec4) Load 349
Store 345(outColor) 359
207: 10(float) Load 36(lodClamp)
208: 38(ResType) ImageSparseSampleExplicitLod 205 206 Grad MinLod 206 206 207
209: 11(fvec4) CompositeExtract 208 1
Store 13(texel) 209
210: 6(int) CompositeExtract 208 0
211: 6(int) Load 8(resident)
212: 6(int) BitwiseOr 211 210
Store 8(resident) 212
217: 214 Load 216(sCubeShadow)
218: 11(fvec4) Load 95(c4)
219: 49(fvec3) Load 51(c3)
220: 10(float) Load 36(lodClamp)
222: 80(ptr) AccessChain 13(texel) 221
223: 10(float) CompositeExtract 218 3
224: 83(ResType) ImageSparseSampleDrefExplicitLod 217 218 223 Grad MinLod 219 219 220
225: 10(float) CompositeExtract 224 1
Store 222 225
226: 6(int) CompositeExtract 224 0
227: 6(int) Load 8(resident)
228: 6(int) BitwiseOr 227 226
Store 8(resident) 228
233: 230 Load 232(usCubeArray)
234: 11(fvec4) Load 95(c4)
235: 49(fvec3) Load 51(c3)
236: 10(float) Load 36(lodClamp)
237:161(ResType) ImageSparseSampleExplicitLod 233 234 Grad MinLod 235 235 236
238: 21(ivec4) CompositeExtract 237 1
Store 23(utexel) 238
239: 6(int) CompositeExtract 237 0
240: 6(int) Load 8(resident)
241: 6(int) BitwiseOr 240 239
Store 8(resident) 241
242: 45 Load 47(s3D)
243: 49(fvec3) Load 51(c3)
244: 10(float) Load 36(lodClamp)
245: 11(fvec4) ImageSampleExplicitLod 242 243 Grad MinLod 243 243 244
246: 11(fvec4) Load 13(texel)
247: 11(fvec4) FAdd 246 245
Store 13(texel) 247
248: 214 Load 216(sCubeShadow)
249: 11(fvec4) Load 95(c4)
250: 49(fvec3) Load 51(c3)
251: 10(float) Load 36(lodClamp)
252: 10(float) CompositeExtract 249 3
253: 10(float) ImageSampleDrefExplicitLod 248 249 252 Grad MinLod 250 250 251
254: 80(ptr) AccessChain 13(texel) 221
255: 10(float) Load 254
256: 10(float) FAdd 255 253
257: 80(ptr) AccessChain 13(texel) 221
Store 257 256
258: 230 Load 232(usCubeArray)
259: 11(fvec4) Load 95(c4)
260: 49(fvec3) Load 51(c3)
261: 10(float) Load 36(lodClamp)
262: 21(ivec4) ImageSampleExplicitLod 258 259 Grad MinLod 260 260 261
263: 21(ivec4) Load 23(utexel)
264: 21(ivec4) IAdd 263 262
Store 23(utexel) 264
265: 27 Load 29(s2D)
266: 31(fvec2) Load 33(c2)
267: 10(float) Load 36(lodClamp)
268: 38(ResType) ImageSparseSampleExplicitLod 265 266 Grad ConstOffset MinLod 266 266 174 267
269: 11(fvec4) CompositeExtract 268 1
Store 13(texel) 269
270: 6(int) CompositeExtract 268 0
271: 6(int) Load 8(resident)
272: 6(int) BitwiseOr 271 270
Store 8(resident) 272
277: 274 Load 276(s2DRectShadow)
278: 49(fvec3) Load 51(c3)
279: 31(fvec2) Load 33(c2)
282: 10(float) Load 36(lodClamp)
284: 80(ptr) AccessChain 13(texel) 283
285: 10(float) CompositeExtract 278 2
286: 83(ResType) ImageSparseSampleDrefExplicitLod 277 278 285 Grad ConstOffset MinLod 279 279 281 282
287: 10(float) CompositeExtract 286 1
Store 284 287
288: 6(int) CompositeExtract 286 0
289: 6(int) Load 8(resident)
290: 6(int) BitwiseOr 289 288
Store 8(resident) 290
295: 292 Load 294(is2DArray)
296: 49(fvec3) Load 51(c3)
297: 31(fvec2) Load 33(c2)
299: 10(float) Load 36(lodClamp)
300: 67(ResType) ImageSparseSampleExplicitLod 295 296 Grad ConstOffset MinLod 297 297 298 299
301: 16(ivec4) CompositeExtract 300 1
Store 18(itexel) 301
302: 6(int) CompositeExtract 300 0
303: 6(int) Load 8(resident)
304: 6(int) BitwiseOr 303 302
Store 8(resident) 304
305: 27 Load 29(s2D)
306: 31(fvec2) Load 33(c2)
307: 10(float) Load 36(lodClamp)
308: 11(fvec4) ImageSampleExplicitLod 305 306 Grad ConstOffset MinLod 306 306 174 307
309: 11(fvec4) Load 13(texel)
310: 11(fvec4) FAdd 309 308
Store 13(texel) 310
311: 274 Load 276(s2DRectShadow)
312: 49(fvec3) Load 51(c3)
313: 31(fvec2) Load 33(c2)
314: 10(float) Load 36(lodClamp)
315: 10(float) CompositeExtract 312 2
316: 10(float) ImageSampleDrefExplicitLod 311 312 315 Grad ConstOffset MinLod 313 313 281 314
317: 80(ptr) AccessChain 13(texel) 283
318: 10(float) Load 317
319: 10(float) FAdd 318 316
320: 80(ptr) AccessChain 13(texel) 283
Store 320 319
321: 292 Load 294(is2DArray)
322: 49(fvec3) Load 51(c3)
323: 31(fvec2) Load 33(c2)
324: 10(float) Load 36(lodClamp)
325: 16(ivec4) ImageSampleExplicitLod 321 322 Grad ConstOffset MinLod 323 323 298 324
326: 16(ivec4) Load 18(itexel)
327: 16(ivec4) IAdd 326 325
Store 18(itexel) 327
330: 6(int) Load 8(resident)
332: 331(bool) ImageSparseTexelsResident 330
SelectionMerge 335 None
BranchConditional 332 334 337
334: Label
336: 11(fvec4) Load 13(texel)
Store 333 336
Branch 335
337: Label
338: 16(ivec4) Load 18(itexel)
339: 11(fvec4) ConvertSToF 338
340: 21(ivec4) Load 23(utexel)
341: 11(fvec4) ConvertUToF 340
342: 11(fvec4) FAdd 339 341
Store 333 342
Branch 335
335: Label
343: 11(fvec4) Load 333
Store 329(outColor) 343
Return
FunctionEnd