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.vert
// Module Version 10000
// Generated by (magic number): 8000b
// Id's are bound by 512
// Id's are bound by 513
Capability Shader
Extension "SPV_KHR_non_semantic_info"
1: ExtInstImport "NonSemantic.Shader.DebugInfo.100"
3: ExtInstImport "GLSL.std.450"
MemoryModel Logical GLSL450
EntryPoint Vertex 6 "main" 461 464 468 471 474 477 481 485 493 497 500 503 506 509
EntryPoint Vertex 6 "main" 462 465 469 472 475 478 482 486 494 498 501 504 507 510
2: String ""
9: String "float"
12: String "uint"
@ -88,23 +88,23 @@ spv.debuginfo.hlsl.vert
Name 339 "locPos"
Name 353 "pos"
Name 419 "lPos"
Name 459 "input"
Name 461 "input.Pos"
Name 464 "input.Normal"
Name 468 "input.UV"
Name 471 "input.Color"
Name 474 "input.instancePos"
Name 477 "input.instanceRot"
Name 481 "input.instanceScale"
Name 485 "input.instanceTexIndex"
Name 488 "flattenTemp"
Name 489 "param"
Name 493 "@entryPointOutput.Pos"
Name 497 "@entryPointOutput.Normal"
Name 500 "@entryPointOutput.Color"
Name 503 "@entryPointOutput.UV"
Name 506 "@entryPointOutput.ViewVec"
Name 509 "@entryPointOutput.LightVec"
Name 460 "input"
Name 462 "input.Pos"
Name 465 "input.Normal"
Name 469 "input.UV"
Name 472 "input.Color"
Name 475 "input.instancePos"
Name 478 "input.instanceRot"
Name 482 "input.instanceScale"
Name 486 "input.instanceTexIndex"
Name 489 "flattenTemp"
Name 490 "param"
Name 494 "@entryPointOutput.Pos"
Name 498 "@entryPointOutput.Normal"
Name 501 "@entryPointOutput.Color"
Name 504 "@entryPointOutput.UV"
Name 507 "@entryPointOutput.ViewVec"
Name 510 "@entryPointOutput.LightVec"
MemberDecorate 143(UBO) 0 RowMajor
MemberDecorate 143(UBO) 0 MatrixStride 16
MemberDecorate 143(UBO) 0 Offset 0
@ -118,20 +118,20 @@ spv.debuginfo.hlsl.vert
MemberDecorate 159(ubo) 0 Offset 0
Decorate 166 Binding 0
Decorate 166 DescriptorSet 0
Decorate 461(input.Pos) Location 0
Decorate 464(input.Normal) Location 1
Decorate 468(input.UV) Location 2
Decorate 471(input.Color) Location 3
Decorate 474(input.instancePos) Location 4
Decorate 477(input.instanceRot) Location 5
Decorate 481(input.instanceScale) Location 6
Decorate 485(input.instanceTexIndex) Location 7
Decorate 493(@entryPointOutput.Pos) BuiltIn Position
Decorate 497(@entryPointOutput.Normal) Location 0
Decorate 500(@entryPointOutput.Color) Location 1
Decorate 503(@entryPointOutput.UV) Location 2
Decorate 506(@entryPointOutput.ViewVec) Location 3
Decorate 509(@entryPointOutput.LightVec) Location 4
Decorate 462(input.Pos) Location 0
Decorate 465(input.Normal) Location 1
Decorate 469(input.UV) Location 2
Decorate 472(input.Color) Location 3
Decorate 475(input.instancePos) Location 4
Decorate 478(input.instanceRot) Location 5
Decorate 482(input.instanceScale) Location 6
Decorate 486(input.instanceTexIndex) Location 7
Decorate 494(@entryPointOutput.Pos) BuiltIn Position
Decorate 498(@entryPointOutput.Normal) Location 0
Decorate 501(@entryPointOutput.Color) Location 1
Decorate 504(@entryPointOutput.UV) Location 2
Decorate 507(@entryPointOutput.ViewVec) Location 3
Decorate 510(@entryPointOutput.LightVec) Location 4
4: TypeVoid
5: TypeFunction 4
8: TypeFloat 32
@ -302,77 +302,77 @@ spv.debuginfo.hlsl.vert
442: 11(int) Constant 109
449: 11(int) Constant 110
455: 11(int) Constant 111
460: TypePointer Input 18(fvec3)
461(input.Pos): 460(ptr) Variable Input
464(input.Normal): 460(ptr) Variable Input
467: TypePointer Input 20(fvec2)
468(input.UV): 467(ptr) Variable Input
471(input.Color): 460(ptr) Variable Input
474(input.instancePos): 460(ptr) Variable Input
477(input.instanceRot): 460(ptr) Variable Input
480: TypePointer Input 8(float)
481(input.instanceScale): 480(ptr) Variable Input
484: TypePointer Input 23(int)
485(input.instanceTexIndex): 484(ptr) Variable Input
492: TypePointer Output 59(fvec4)
493(@entryPointOutput.Pos): 492(ptr) Variable Output
496: TypePointer Output 18(fvec3)
497(@entryPointOutput.Normal): 496(ptr) Variable Output
500(@entryPointOutput.Color): 496(ptr) Variable Output
503(@entryPointOutput.UV): 496(ptr) Variable Output
506(@entryPointOutput.ViewVec): 496(ptr) Variable Output
509(@entryPointOutput.LightVec): 496(ptr) Variable Output
461: TypePointer Input 18(fvec3)
462(input.Pos): 461(ptr) Variable Input
465(input.Normal): 461(ptr) Variable Input
468: TypePointer Input 20(fvec2)
469(input.UV): 468(ptr) Variable Input
472(input.Color): 461(ptr) Variable Input
475(input.instancePos): 461(ptr) Variable Input
478(input.instanceRot): 461(ptr) Variable Input
481: TypePointer Input 8(float)
482(input.instanceScale): 481(ptr) Variable Input
485: TypePointer Input 23(int)
486(input.instanceTexIndex): 485(ptr) Variable Input
493: TypePointer Output 59(fvec4)
494(@entryPointOutput.Pos): 493(ptr) Variable Output
497: TypePointer Output 18(fvec3)
498(@entryPointOutput.Normal): 497(ptr) Variable Output
501(@entryPointOutput.Color): 497(ptr) Variable Output
504(@entryPointOutput.UV): 497(ptr) Variable Output
507(@entryPointOutput.ViewVec): 497(ptr) Variable Output
510(@entryPointOutput.LightVec): 497(ptr) Variable Output
6(main): 4 Function None 5
7: Label
459(input): 56(ptr) Variable Function
488(flattenTemp): 89(ptr) Variable Function
489(param): 56(ptr) Variable Function
462: 18(fvec3) Load 461(input.Pos)
463: 103(ptr) AccessChain 459(input) 169
Store 463 462
465: 18(fvec3) Load 464(input.Normal)
466: 103(ptr) AccessChain 459(input) 324
Store 466 465
469: 20(fvec2) Load 468(input.UV)
470: 110(ptr) AccessChain 459(input) 101
Store 470 469
472: 18(fvec3) Load 471(input.Color)
473: 103(ptr) AccessChain 459(input) 102
Store 473 472
475: 18(fvec3) Load 474(input.instancePos)
476: 103(ptr) AccessChain 459(input) 296
Store 476 475
478: 18(fvec3) Load 477(input.instanceRot)
479: 103(ptr) AccessChain 459(input) 134
Store 479 478
482: 8(float) Load 481(input.instanceScale)
483: 126(ptr) AccessChain 459(input) 361
Store 483 482
486: 23(int) Load 485(input.instanceTexIndex)
487: 117(ptr) AccessChain 459(input) 116
Store 487 486
490: 27(VSInput) Load 459(input)
Store 489(param) 490
491:61(VSOutput) FunctionCall 78(@main(struct-VSInput-vf3-vf3-vf2-vf3-vf3-vf3-f1-i11;) 489(param)
Store 488(flattenTemp) 491
494: 321(ptr) AccessChain 488(flattenTemp) 169
495: 59(fvec4) Load 494
Store 493(@entryPointOutput.Pos) 495
498: 103(ptr) AccessChain 488(flattenTemp) 324
499: 18(fvec3) Load 498
Store 497(@entryPointOutput.Normal) 499
501: 103(ptr) AccessChain 488(flattenTemp) 101
502: 18(fvec3) Load 501
Store 500(@entryPointOutput.Color) 502
504: 103(ptr) AccessChain 488(flattenTemp) 102
505: 18(fvec3) Load 504
Store 503(@entryPointOutput.UV) 505
507: 103(ptr) AccessChain 488(flattenTemp) 296
508: 18(fvec3) Load 507
Store 506(@entryPointOutput.ViewVec) 508
510: 103(ptr) AccessChain 488(flattenTemp) 134
511: 18(fvec3) Load 510
Store 509(@entryPointOutput.LightVec) 511
460(input): 56(ptr) Variable Function
489(flattenTemp): 89(ptr) Variable Function
490(param): 56(ptr) Variable Function
463: 18(fvec3) Load 462(input.Pos)
464: 103(ptr) AccessChain 460(input) 169
Store 464 463
466: 18(fvec3) Load 465(input.Normal)
467: 103(ptr) AccessChain 460(input) 324
Store 467 466
470: 20(fvec2) Load 469(input.UV)
471: 110(ptr) AccessChain 460(input) 101
Store 471 470
473: 18(fvec3) Load 472(input.Color)
474: 103(ptr) AccessChain 460(input) 102
Store 474 473
476: 18(fvec3) Load 475(input.instancePos)
477: 103(ptr) AccessChain 460(input) 296
Store 477 476
479: 18(fvec3) Load 478(input.instanceRot)
480: 103(ptr) AccessChain 460(input) 134
Store 480 479
483: 8(float) Load 482(input.instanceScale)
484: 126(ptr) AccessChain 460(input) 361
Store 484 483
487: 23(int) Load 486(input.instanceTexIndex)
488: 117(ptr) AccessChain 460(input) 116
Store 488 487
491: 27(VSInput) Load 460(input)
Store 490(param) 491
492:61(VSOutput) FunctionCall 78(@main(struct-VSInput-vf3-vf3-vf2-vf3-vf3-vf3-f1-i11;) 490(param)
Store 489(flattenTemp) 492
495: 321(ptr) AccessChain 489(flattenTemp) 169
496: 59(fvec4) Load 495
Store 494(@entryPointOutput.Pos) 496
499: 103(ptr) AccessChain 489(flattenTemp) 324
500: 18(fvec3) Load 499
Store 498(@entryPointOutput.Normal) 500
502: 103(ptr) AccessChain 489(flattenTemp) 101
503: 18(fvec3) Load 502
Store 501(@entryPointOutput.Color) 503
505: 103(ptr) AccessChain 489(flattenTemp) 102
506: 18(fvec3) Load 505
Store 504(@entryPointOutput.UV) 506
508: 103(ptr) AccessChain 489(flattenTemp) 296
509: 18(fvec3) Load 508
Store 507(@entryPointOutput.ViewVec) 509
511: 103(ptr) AccessChain 489(flattenTemp) 134
512: 18(fvec3) Load 511
Store 510(@entryPointOutput.LightVec) 512
Return
FunctionEnd
78(@main(struct-VSInput-vf3-vf3-vf2-vf3-vf3-vf3-f1-i11;):61(VSOutput) Function None 75