Sanitize debug source location tracking for implicit branch and return

This patch tries to attach debug location of a branch/return instruction to its predecessor or the closing brace. If none could be found, no debug info should be emitted.
This commit is contained in:
Qingyuan Zheng 2024-08-26 03:53:07 +00:00 committed by arcady-lunarg
parent b1fac200c4
commit a496a34b43
30 changed files with 4713 additions and 4253 deletions

View file

@ -1,14 +1,14 @@
spv.debuginfo.hlsl.tese
// Module Version 10000
// Generated by (magic number): 8000b
// Id's are bound by 477
// Id's are bound by 478
Capability Tessellation
Extension "SPV_KHR_non_semantic_info"
1: ExtInstImport "NonSemantic.Shader.DebugInfo.100"
3: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint TessellationEvaluation 6 "main" 368 383 392 401 408 414 454 458 462 465 468 471 474
EntryPoint TessellationEvaluation 6 "main" 369 384 393 402 409 415 455 459 463 466 469 472 475
ExecutionMode 6 Quads
2: String ""
9: String "float"
@ -102,25 +102,25 @@ spv.debuginfo.hlsl.tese
Name 297 "ubo"
MemberName 297(ubo) 0 "ubo"
Name 303 ""
Name 366 "input"
Name 368 "input.TessLevelOuter"
Name 383 "input.TessLevelInner"
Name 390 "TessCoord"
Name 392 "TessCoord"
Name 398 "patch"
Name 401 "patch.Pos"
Name 408 "patch.Normal"
Name 414 "patch.UV"
Name 446 "flattenTemp"
Name 448 "param"
Name 450 "param"
Name 454 "@entryPointOutput.Pos"
Name 458 "@entryPointOutput.Normal"
Name 462 "@entryPointOutput.UV"
Name 465 "@entryPointOutput.ViewVec"
Name 468 "@entryPointOutput.LightVec"
Name 471 "@entryPointOutput.EyePos"
Name 474 "@entryPointOutput.WorldPos"
Name 367 "input"
Name 369 "input.TessLevelOuter"
Name 384 "input.TessLevelInner"
Name 391 "TessCoord"
Name 393 "TessCoord"
Name 399 "patch"
Name 402 "patch.Pos"
Name 409 "patch.Normal"
Name 415 "patch.UV"
Name 447 "flattenTemp"
Name 449 "param"
Name 451 "param"
Name 455 "@entryPointOutput.Pos"
Name 459 "@entryPointOutput.Normal"
Name 463 "@entryPointOutput.UV"
Name 466 "@entryPointOutput.ViewVec"
Name 469 "@entryPointOutput.LightVec"
Name 472 "@entryPointOutput.EyePos"
Name 475 "@entryPointOutput.WorldPos"
Decorate 241(displacementMapTexture) Binding 1
Decorate 241(displacementMapTexture) DescriptorSet 0
Decorate 253(displacementMapSampler) Binding 1
@ -142,22 +142,22 @@ spv.debuginfo.hlsl.tese
MemberDecorate 297(ubo) 0 Offset 0
Decorate 303 Binding 0
Decorate 303 DescriptorSet 0
Decorate 368(input.TessLevelOuter) BuiltIn TessLevelOuter
Decorate 368(input.TessLevelOuter) Patch
Decorate 383(input.TessLevelInner) BuiltIn TessLevelInner
Decorate 383(input.TessLevelInner) Patch
Decorate 392(TessCoord) BuiltIn TessCoord
Decorate 392(TessCoord) Patch
Decorate 401(patch.Pos) BuiltIn Position
Decorate 408(patch.Normal) Location 0
Decorate 414(patch.UV) Location 1
Decorate 454(@entryPointOutput.Pos) BuiltIn Position
Decorate 458(@entryPointOutput.Normal) Location 0
Decorate 462(@entryPointOutput.UV) Location 1
Decorate 465(@entryPointOutput.ViewVec) Location 2
Decorate 468(@entryPointOutput.LightVec) Location 3
Decorate 471(@entryPointOutput.EyePos) Location 4
Decorate 474(@entryPointOutput.WorldPos) Location 5
Decorate 369(input.TessLevelOuter) BuiltIn TessLevelOuter
Decorate 369(input.TessLevelOuter) Patch
Decorate 384(input.TessLevelInner) BuiltIn TessLevelInner
Decorate 384(input.TessLevelInner) Patch
Decorate 393(TessCoord) BuiltIn TessCoord
Decorate 393(TessCoord) Patch
Decorate 402(patch.Pos) BuiltIn Position
Decorate 409(patch.Normal) Location 0
Decorate 415(patch.UV) Location 1
Decorate 455(@entryPointOutput.Pos) BuiltIn Position
Decorate 459(@entryPointOutput.Normal) Location 0
Decorate 463(@entryPointOutput.UV) Location 1
Decorate 466(@entryPointOutput.ViewVec) Location 2
Decorate 469(@entryPointOutput.LightVec) Location 3
Decorate 472(@entryPointOutput.EyePos) Location 4
Decorate 475(@entryPointOutput.WorldPos) Location 5
4: TypeVoid
5: TypeFunction 4
8: TypeFloat 32
@ -330,148 +330,148 @@ spv.debuginfo.hlsl.tese
351: 124(int) Constant 5
354: 11(int) Constant 92
362: 11(int) Constant 93
367: TypePointer Input 19
368(input.TessLevelOuter): 367(ptr) Variable Input
369: TypePointer Input 8(float)
382: TypePointer Input 22
383(input.TessLevelInner): 382(ptr) Variable Input
391: TypePointer Input 49(fvec3)
392(TessCoord): 391(ptr) Variable Input
397: TypePointer Function 65
399: TypeArray 47(fvec4) 18
400: TypePointer Input 399
401(patch.Pos): 400(ptr) Variable Input
402: TypePointer Input 47(fvec4)
406: TypeArray 49(fvec3) 18
407: TypePointer Input 406
408(patch.Normal): 407(ptr) Variable Input
412: TypeArray 43(fvec2) 18
413: TypePointer Input 412
414(patch.UV): 413(ptr) Variable Input
415: TypePointer Input 43(fvec2)
453: TypePointer Output 47(fvec4)
454(@entryPointOutput.Pos): 453(ptr) Variable Output
457: TypePointer Output 49(fvec3)
458(@entryPointOutput.Normal): 457(ptr) Variable Output
461: TypePointer Output 43(fvec2)
462(@entryPointOutput.UV): 461(ptr) Variable Output
465(@entryPointOutput.ViewVec): 457(ptr) Variable Output
468(@entryPointOutput.LightVec): 457(ptr) Variable Output
471(@entryPointOutput.EyePos): 457(ptr) Variable Output
474(@entryPointOutput.WorldPos): 457(ptr) Variable Output
368: TypePointer Input 19
369(input.TessLevelOuter): 368(ptr) Variable Input
370: TypePointer Input 8(float)
383: TypePointer Input 22
384(input.TessLevelInner): 383(ptr) Variable Input
392: TypePointer Input 49(fvec3)
393(TessCoord): 392(ptr) Variable Input
398: TypePointer Function 65
400: TypeArray 47(fvec4) 18
401: TypePointer Input 400
402(patch.Pos): 401(ptr) Variable Input
403: TypePointer Input 47(fvec4)
407: TypeArray 49(fvec3) 18
408: TypePointer Input 407
409(patch.Normal): 408(ptr) Variable Input
413: TypeArray 43(fvec2) 18
414: TypePointer Input 413
415(patch.UV): 414(ptr) Variable Input
416: TypePointer Input 43(fvec2)
454: TypePointer Output 47(fvec4)
455(@entryPointOutput.Pos): 454(ptr) Variable Output
458: TypePointer Output 49(fvec3)
459(@entryPointOutput.Normal): 458(ptr) Variable Output
462: TypePointer Output 43(fvec2)
463(@entryPointOutput.UV): 462(ptr) Variable Output
466(@entryPointOutput.ViewVec): 458(ptr) Variable Output
469(@entryPointOutput.LightVec): 458(ptr) Variable Output
472(@entryPointOutput.EyePos): 458(ptr) Variable Output
475(@entryPointOutput.WorldPos): 458(ptr) Variable Output
6(main): 4 Function None 5
7: Label
366(input): 40(ptr) Variable Function
390(TessCoord): 45(ptr) Variable Function
398(patch): 397(ptr) Variable Function
446(flattenTemp): 105(ptr) Variable Function
448(param): 40(ptr) Variable Function
450(param): 45(ptr) Variable Function
370: 369(ptr) AccessChain 368(input.TessLevelOuter) 127
371: 8(float) Load 370
372: 132(ptr) AccessChain 366(input) 127 127
Store 372 371
373: 369(ptr) AccessChain 368(input.TessLevelOuter) 130
374: 8(float) Load 373
375: 132(ptr) AccessChain 366(input) 127 130
Store 375 374
376: 369(ptr) AccessChain 368(input.TessLevelOuter) 128
377: 8(float) Load 376
378: 132(ptr) AccessChain 366(input) 127 128
Store 378 377
379: 369(ptr) AccessChain 368(input.TessLevelOuter) 144
380: 8(float) Load 379
381: 132(ptr) AccessChain 366(input) 127 144
Store 381 380
384: 369(ptr) AccessChain 383(input.TessLevelInner) 127
385: 8(float) Load 384
386: 132(ptr) AccessChain 366(input) 130 127
Store 386 385
387: 369(ptr) AccessChain 383(input.TessLevelInner) 130
388: 8(float) Load 387
389: 132(ptr) AccessChain 366(input) 130 130
Store 389 388
393: 49(fvec3) Load 392(TessCoord)
394: 8(float) CompositeExtract 393 0
395: 8(float) CompositeExtract 393 1
396: 43(fvec2) CompositeConstruct 394 395
Store 390(TessCoord) 396
403: 402(ptr) AccessChain 401(patch.Pos) 127
404: 47(fvec4) Load 403
405: 195(ptr) AccessChain 398(patch) 127 127
Store 405 404
409: 391(ptr) AccessChain 408(patch.Normal) 127
410: 49(fvec3) Load 409
411: 160(ptr) AccessChain 398(patch) 127 130
Store 411 410
416: 415(ptr) AccessChain 414(patch.UV) 127
417: 43(fvec2) Load 416
418: 45(ptr) AccessChain 398(patch) 127 128
Store 418 417
419: 402(ptr) AccessChain 401(patch.Pos) 130
420: 47(fvec4) Load 419
421: 195(ptr) AccessChain 398(patch) 130 127
Store 421 420
422: 391(ptr) AccessChain 408(patch.Normal) 130
423: 49(fvec3) Load 422
424: 160(ptr) AccessChain 398(patch) 130 130
Store 424 423
425: 415(ptr) AccessChain 414(patch.UV) 130
426: 43(fvec2) Load 425
427: 45(ptr) AccessChain 398(patch) 130 128
Store 427 426
428: 402(ptr) AccessChain 401(patch.Pos) 128
429: 47(fvec4) Load 428
430: 195(ptr) AccessChain 398(patch) 128 127
Store 430 429
431: 391(ptr) AccessChain 408(patch.Normal) 128
432: 49(fvec3) Load 431
433: 160(ptr) AccessChain 398(patch) 128 130
Store 433 432
434: 415(ptr) AccessChain 414(patch.UV) 128
435: 43(fvec2) Load 434
436: 45(ptr) AccessChain 398(patch) 128 128
Store 436 435
437: 402(ptr) AccessChain 401(patch.Pos) 144
438: 47(fvec4) Load 437
439: 195(ptr) AccessChain 398(patch) 144 127
Store 439 438
440: 391(ptr) AccessChain 408(patch.Normal) 144
441: 49(fvec3) Load 440
442: 160(ptr) AccessChain 398(patch) 144 130
Store 442 441
443: 415(ptr) AccessChain 414(patch.UV) 144
444: 43(fvec2) Load 443
445: 45(ptr) AccessChain 398(patch) 144 128
Store 445 444
447: 65 Load 398(patch)
449:24(ConstantsHSOutput) Load 366(input)
Store 448(param) 449
451: 43(fvec2) Load 390(TessCoord)
Store 450(param) 451
452:67(DSOutput) FunctionCall 88(@main(struct-ConstantsHSOutput-f1[4]-f1[2]1;vf2;struct-HSOutput-vf4-vf3-vf21[4];) 448(param) 450(param) 447
Store 446(flattenTemp) 452
455: 195(ptr) AccessChain 446(flattenTemp) 127
456: 47(fvec4) Load 455
Store 454(@entryPointOutput.Pos) 456
459: 160(ptr) AccessChain 446(flattenTemp) 130
460: 49(fvec3) Load 459
Store 458(@entryPointOutput.Normal) 460
463: 45(ptr) AccessChain 446(flattenTemp) 128
464: 43(fvec2) Load 463
Store 462(@entryPointOutput.UV) 464
466: 160(ptr) AccessChain 446(flattenTemp) 144
467: 49(fvec3) Load 466
Store 465(@entryPointOutput.ViewVec) 467
469: 160(ptr) AccessChain 446(flattenTemp) 305
470: 49(fvec3) Load 469
Store 468(@entryPointOutput.LightVec) 470
472: 160(ptr) AccessChain 446(flattenTemp) 351
473: 49(fvec3) Load 472
Store 471(@entryPointOutput.EyePos) 473
475: 160(ptr) AccessChain 446(flattenTemp) 345
476: 49(fvec3) Load 475
Store 474(@entryPointOutput.WorldPos) 476
367(input): 40(ptr) Variable Function
391(TessCoord): 45(ptr) Variable Function
399(patch): 398(ptr) Variable Function
447(flattenTemp): 105(ptr) Variable Function
449(param): 40(ptr) Variable Function
451(param): 45(ptr) Variable Function
371: 370(ptr) AccessChain 369(input.TessLevelOuter) 127
372: 8(float) Load 371
373: 132(ptr) AccessChain 367(input) 127 127
Store 373 372
374: 370(ptr) AccessChain 369(input.TessLevelOuter) 130
375: 8(float) Load 374
376: 132(ptr) AccessChain 367(input) 127 130
Store 376 375
377: 370(ptr) AccessChain 369(input.TessLevelOuter) 128
378: 8(float) Load 377
379: 132(ptr) AccessChain 367(input) 127 128
Store 379 378
380: 370(ptr) AccessChain 369(input.TessLevelOuter) 144
381: 8(float) Load 380
382: 132(ptr) AccessChain 367(input) 127 144
Store 382 381
385: 370(ptr) AccessChain 384(input.TessLevelInner) 127
386: 8(float) Load 385
387: 132(ptr) AccessChain 367(input) 130 127
Store 387 386
388: 370(ptr) AccessChain 384(input.TessLevelInner) 130
389: 8(float) Load 388
390: 132(ptr) AccessChain 367(input) 130 130
Store 390 389
394: 49(fvec3) Load 393(TessCoord)
395: 8(float) CompositeExtract 394 0
396: 8(float) CompositeExtract 394 1
397: 43(fvec2) CompositeConstruct 395 396
Store 391(TessCoord) 397
404: 403(ptr) AccessChain 402(patch.Pos) 127
405: 47(fvec4) Load 404
406: 195(ptr) AccessChain 399(patch) 127 127
Store 406 405
410: 392(ptr) AccessChain 409(patch.Normal) 127
411: 49(fvec3) Load 410
412: 160(ptr) AccessChain 399(patch) 127 130
Store 412 411
417: 416(ptr) AccessChain 415(patch.UV) 127
418: 43(fvec2) Load 417
419: 45(ptr) AccessChain 399(patch) 127 128
Store 419 418
420: 403(ptr) AccessChain 402(patch.Pos) 130
421: 47(fvec4) Load 420
422: 195(ptr) AccessChain 399(patch) 130 127
Store 422 421
423: 392(ptr) AccessChain 409(patch.Normal) 130
424: 49(fvec3) Load 423
425: 160(ptr) AccessChain 399(patch) 130 130
Store 425 424
426: 416(ptr) AccessChain 415(patch.UV) 130
427: 43(fvec2) Load 426
428: 45(ptr) AccessChain 399(patch) 130 128
Store 428 427
429: 403(ptr) AccessChain 402(patch.Pos) 128
430: 47(fvec4) Load 429
431: 195(ptr) AccessChain 399(patch) 128 127
Store 431 430
432: 392(ptr) AccessChain 409(patch.Normal) 128
433: 49(fvec3) Load 432
434: 160(ptr) AccessChain 399(patch) 128 130
Store 434 433
435: 416(ptr) AccessChain 415(patch.UV) 128
436: 43(fvec2) Load 435
437: 45(ptr) AccessChain 399(patch) 128 128
Store 437 436
438: 403(ptr) AccessChain 402(patch.Pos) 144
439: 47(fvec4) Load 438
440: 195(ptr) AccessChain 399(patch) 144 127
Store 440 439
441: 392(ptr) AccessChain 409(patch.Normal) 144
442: 49(fvec3) Load 441
443: 160(ptr) AccessChain 399(patch) 144 130
Store 443 442
444: 416(ptr) AccessChain 415(patch.UV) 144
445: 43(fvec2) Load 444
446: 45(ptr) AccessChain 399(patch) 144 128
Store 446 445
448: 65 Load 399(patch)
450:24(ConstantsHSOutput) Load 367(input)
Store 449(param) 450
452: 43(fvec2) Load 391(TessCoord)
Store 451(param) 452
453:67(DSOutput) FunctionCall 88(@main(struct-ConstantsHSOutput-f1[4]-f1[2]1;vf2;struct-HSOutput-vf4-vf3-vf21[4];) 449(param) 451(param) 448
Store 447(flattenTemp) 453
456: 195(ptr) AccessChain 447(flattenTemp) 127
457: 47(fvec4) Load 456
Store 455(@entryPointOutput.Pos) 457
460: 160(ptr) AccessChain 447(flattenTemp) 130
461: 49(fvec3) Load 460
Store 459(@entryPointOutput.Normal) 461
464: 45(ptr) AccessChain 447(flattenTemp) 128
465: 43(fvec2) Load 464
Store 463(@entryPointOutput.UV) 465
467: 160(ptr) AccessChain 447(flattenTemp) 144
468: 49(fvec3) Load 467
Store 466(@entryPointOutput.ViewVec) 468
470: 160(ptr) AccessChain 447(flattenTemp) 305
471: 49(fvec3) Load 470
Store 469(@entryPointOutput.LightVec) 471
473: 160(ptr) AccessChain 447(flattenTemp) 351
474: 49(fvec3) Load 473
Store 472(@entryPointOutput.EyePos) 474
476: 160(ptr) AccessChain 447(flattenTemp) 345
477: 49(fvec3) Load 476
Store 475(@entryPointOutput.WorldPos) 477
Return
FunctionEnd
88(@main(struct-ConstantsHSOutput-f1[4]-f1[2]1;vf2;struct-HSOutput-vf4-vf3-vf21[4];):67(DSOutput) Function None 83