Don't emit debug instructions before an OpPhi

Nonsemantic instructions aren't allowed before an OpPhi, so don't emit
line and debug scope instructions when the instruction being emitted is
an OpPhi.
This commit is contained in:
Arcady Goldmints-Orlov 2024-07-22 17:20:14 -04:00 committed by arcady-lunarg
parent 74d448cc15
commit 592aed9c20
3 changed files with 228 additions and 224 deletions

View file

@ -1,5 +1,4 @@
spv.debuginfo.glsl.comp
Validation failed
// Module Version 10000
// Generated by (magic number): 8000b
// Id's are bound by 975
@ -283,18 +282,18 @@ void main()
Name 383 "param"
Name 387 "param"
Name 389 "param"
Name 426 "param"
Name 430 "param"
Name 432 "param"
Name 464 "param"
Name 468 "param"
Name 470 "param"
Name 510 "param"
Name 514 "param"
Name 516 "param"
Name 552 "param"
Name 556 "param"
Name 558 "param"
Name 425 "param"
Name 429 "param"
Name 431 "param"
Name 463 "param"
Name 467 "param"
Name 469 "param"
Name 509 "param"
Name 513 "param"
Name 515 "param"
Name 551 "param"
Name 555 "param"
Name 557 "param"
Name 575 "f"
Name 624 "sphereDist"
Name 675 "PushConsts"
@ -482,14 +481,14 @@ void main()
370: 7(int) Constant 107
378: 7(int) Constant 108
398: 7(int) Constant 111
419: 7(int) Constant 112
425: 73(int) Constant 6
418: 7(int) Constant 112
424: 73(int) Constant 6
441: 7(int) Constant 115
458: 7(int) Constant 116
457: 7(int) Constant 116
479: 7(int) Constant 119
504: 7(int) Constant 120
503: 7(int) Constant 120
525: 7(int) Constant 123
546: 7(int) Constant 124
545: 7(int) Constant 124
564: 73(int) Constant 3
568: 7(int) Constant 127
578: 7(int) Constant 130
@ -567,18 +566,18 @@ void main()
383(param): 21(ptr) Variable Function
387(param): 21(ptr) Variable Function
389(param): 24(ptr) Variable Function
426(param): 21(ptr) Variable Function
430(param): 21(ptr) Variable Function
432(param): 24(ptr) Variable Function
464(param): 21(ptr) Variable Function
468(param): 21(ptr) Variable Function
470(param): 24(ptr) Variable Function
510(param): 21(ptr) Variable Function
514(param): 21(ptr) Variable Function
516(param): 24(ptr) Variable Function
552(param): 21(ptr) Variable Function
556(param): 21(ptr) Variable Function
558(param): 24(ptr) Variable Function
425(param): 21(ptr) Variable Function
429(param): 21(ptr) Variable Function
431(param): 24(ptr) Variable Function
463(param): 21(ptr) Variable Function
467(param): 21(ptr) Variable Function
469(param): 24(ptr) Variable Function
509(param): 21(ptr) Variable Function
513(param): 21(ptr) Variable Function
515(param): 24(ptr) Variable Function
551(param): 21(ptr) Variable Function
555(param): 21(ptr) Variable Function
557(param): 24(ptr) Variable Function
575(f): 21(ptr) Variable Function
624(sphereDist): 21(ptr) Variable Function
697(normal): 21(ptr) Variable Function
@ -808,34 +807,34 @@ void main()
411: 166(bool) ULessThan 406 410
Branch 402
402: Label
413: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 23(DebugScope) 55
412: 166(bool) Phi 400 374 411 401
SelectionMerge 415 None
BranchConditional 412 414 415
414: Label
417: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 23(DebugScope) 55
418: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 103(DebugLine) 35 419 419 12 12
416: 7(int) Load 139(index)
420: 148(ptr) AccessChain 101(params) 147 12
421: 73(int) Load 420
422: 7(int) Bitcast 421
423: 7(int) IAdd 416 422
424: 7(int) ISub 423 39
427: 231(ptr) AccessChain 200 203 424 203
428: 71(fvec4) Load 427
429: 19(fvec3) VectorShuffle 428 428 0 1 2
Store 426(param) 429
431: 19(fvec3) Load 261(pos)
Store 430(param) 431
433: 105(ptr) AccessChain 101(params) 425
434: 16(float) Load 433
Store 432(param) 434
435: 19(fvec3) FunctionCall 31(springForce(vf3;vf3;f1;) 426(param) 430(param) 432(param)
436: 19(fvec3) Load 247(force)
437: 19(fvec3) FAdd 436 435
Store 247(force) 437
Branch 415
415: Label
437: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 23(DebugScope) 55
SelectionMerge 414 None
BranchConditional 412 413 414
413: Label
416: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 23(DebugScope) 55
417: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 103(DebugLine) 35 418 418 12 12
415: 7(int) Load 139(index)
419: 148(ptr) AccessChain 101(params) 147 12
420: 73(int) Load 419
421: 7(int) Bitcast 420
422: 7(int) IAdd 415 421
423: 7(int) ISub 422 39
426: 231(ptr) AccessChain 200 203 423 203
427: 71(fvec4) Load 426
428: 19(fvec3) VectorShuffle 427 427 0 1 2
Store 425(param) 428
430: 19(fvec3) Load 261(pos)
Store 429(param) 430
432: 105(ptr) AccessChain 101(params) 424
433: 16(float) Load 432
Store 431(param) 433
434: 19(fvec3) FunctionCall 31(springForce(vf3;vf3;f1;) 425(param) 429(param) 431(param)
435: 19(fvec3) Load 247(force)
436: 19(fvec3) FAdd 435 434
Store 247(force) 436
Branch 414
414: Label
439: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 23(DebugScope) 55
440: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 103(DebugLine) 35 441 441 12 12
438: 137(ptr) AccessChain 125(id) 12
@ -851,34 +850,34 @@ void main()
450: 166(bool) UGreaterThan 449 12
Branch 445
445: Label
452: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 23(DebugScope) 55
451: 166(bool) Phi 443 415 450 444
SelectionMerge 454 None
BranchConditional 451 453 454
453: Label
456: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 23(DebugScope) 55
457: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 103(DebugLine) 35 458 458 12 12
455: 7(int) Load 139(index)
459: 148(ptr) AccessChain 101(params) 147 12
460: 73(int) Load 459
461: 7(int) Bitcast 460
462: 7(int) ISub 455 461
463: 7(int) ISub 462 39
465: 231(ptr) AccessChain 200 203 463 203
466: 71(fvec4) Load 465
467: 19(fvec3) VectorShuffle 466 466 0 1 2
Store 464(param) 467
469: 19(fvec3) Load 261(pos)
Store 468(param) 469
471: 105(ptr) AccessChain 101(params) 425
472: 16(float) Load 471
Store 470(param) 472
473: 19(fvec3) FunctionCall 31(springForce(vf3;vf3;f1;) 464(param) 468(param) 470(param)
474: 19(fvec3) Load 247(force)
475: 19(fvec3) FAdd 474 473
Store 247(force) 475
Branch 454
454: Label
451: 166(bool) Phi 443 414 450 444
475: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 23(DebugScope) 55
SelectionMerge 453 None
BranchConditional 451 452 453
452: Label
455: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 23(DebugScope) 55
456: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 103(DebugLine) 35 457 457 12 12
454: 7(int) Load 139(index)
458: 148(ptr) AccessChain 101(params) 147 12
459: 73(int) Load 458
460: 7(int) Bitcast 459
461: 7(int) ISub 454 460
462: 7(int) ISub 461 39
464: 231(ptr) AccessChain 200 203 462 203
465: 71(fvec4) Load 464
466: 19(fvec3) VectorShuffle 465 465 0 1 2
Store 463(param) 466
468: 19(fvec3) Load 261(pos)
Store 467(param) 468
470: 105(ptr) AccessChain 101(params) 424
471: 16(float) Load 470
Store 469(param) 471
472: 19(fvec3) FunctionCall 31(springForce(vf3;vf3;f1;) 463(param) 467(param) 469(param)
473: 19(fvec3) Load 247(force)
474: 19(fvec3) FAdd 473 472
Store 247(force) 474
Branch 453
453: Label
477: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 23(DebugScope) 55
478: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 103(DebugLine) 35 479 479 12 12
476: 137(ptr) AccessChain 125(id) 12
@ -902,34 +901,34 @@ void main()
496: 166(bool) ULessThan 491 495
Branch 487
487: Label
498: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 23(DebugScope) 55
497: 166(bool) Phi 485 454 496 486
SelectionMerge 500 None
BranchConditional 497 499 500
499: Label
502: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 23(DebugScope) 55
503: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 103(DebugLine) 35 504 504 12 12
501: 7(int) Load 139(index)
505: 148(ptr) AccessChain 101(params) 147 12
506: 73(int) Load 505
507: 7(int) Bitcast 506
508: 7(int) IAdd 501 507
509: 7(int) IAdd 508 39
511: 231(ptr) AccessChain 200 203 509 203
512: 71(fvec4) Load 511
513: 19(fvec3) VectorShuffle 512 512 0 1 2
Store 510(param) 513
515: 19(fvec3) Load 261(pos)
Store 514(param) 515
517: 105(ptr) AccessChain 101(params) 425
518: 16(float) Load 517
Store 516(param) 518
519: 19(fvec3) FunctionCall 31(springForce(vf3;vf3;f1;) 510(param) 514(param) 516(param)
520: 19(fvec3) Load 247(force)
521: 19(fvec3) FAdd 520 519
Store 247(force) 521
Branch 500
500: Label
497: 166(bool) Phi 485 453 496 486
521: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 23(DebugScope) 55
SelectionMerge 499 None
BranchConditional 497 498 499
498: Label
501: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 23(DebugScope) 55
502: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 103(DebugLine) 35 503 503 12 12
500: 7(int) Load 139(index)
504: 148(ptr) AccessChain 101(params) 147 12
505: 73(int) Load 504
506: 7(int) Bitcast 505
507: 7(int) IAdd 500 506
508: 7(int) IAdd 507 39
510: 231(ptr) AccessChain 200 203 508 203
511: 71(fvec4) Load 510
512: 19(fvec3) VectorShuffle 511 511 0 1 2
Store 509(param) 512
514: 19(fvec3) Load 261(pos)
Store 513(param) 514
516: 105(ptr) AccessChain 101(params) 424
517: 16(float) Load 516
Store 515(param) 517
518: 19(fvec3) FunctionCall 31(springForce(vf3;vf3;f1;) 509(param) 513(param) 515(param)
519: 19(fvec3) Load 247(force)
520: 19(fvec3) FAdd 519 518
Store 247(force) 520
Branch 499
499: Label
523: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 23(DebugScope) 55
524: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 103(DebugLine) 35 525 525 12 12
522: 137(ptr) AccessChain 125(id) 12
@ -949,34 +948,34 @@ void main()
538: 166(bool) UGreaterThan 537 12
Branch 533
533: Label
540: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 23(DebugScope) 55
539: 166(bool) Phi 531 500 538 532
SelectionMerge 542 None
BranchConditional 539 541 542
541: Label
544: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 23(DebugScope) 55
545: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 103(DebugLine) 35 546 546 12 12
543: 7(int) Load 139(index)
547: 148(ptr) AccessChain 101(params) 147 12
548: 73(int) Load 547
549: 7(int) Bitcast 548
550: 7(int) ISub 543 549
551: 7(int) IAdd 550 39
553: 231(ptr) AccessChain 200 203 551 203
554: 71(fvec4) Load 553
555: 19(fvec3) VectorShuffle 554 554 0 1 2
Store 552(param) 555
557: 19(fvec3) Load 261(pos)
Store 556(param) 557
559: 105(ptr) AccessChain 101(params) 425
560: 16(float) Load 559
Store 558(param) 560
561: 19(fvec3) FunctionCall 31(springForce(vf3;vf3;f1;) 552(param) 556(param) 558(param)
562: 19(fvec3) Load 247(force)
563: 19(fvec3) FAdd 562 561
Store 247(force) 563
Branch 542
542: Label
539: 166(bool) Phi 531 499 538 532
563: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 23(DebugScope) 55
SelectionMerge 541 None
BranchConditional 539 540 541
540: Label
543: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 23(DebugScope) 55
544: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 103(DebugLine) 35 545 545 12 12
542: 7(int) Load 139(index)
546: 148(ptr) AccessChain 101(params) 147 12
547: 73(int) Load 546
548: 7(int) Bitcast 547
549: 7(int) ISub 542 548
550: 7(int) IAdd 549 39
552: 231(ptr) AccessChain 200 203 550 203
553: 71(fvec4) Load 552
554: 19(fvec3) VectorShuffle 553 553 0 1 2
Store 551(param) 554
556: 19(fvec3) Load 261(pos)
Store 555(param) 556
558: 105(ptr) AccessChain 101(params) 424
559: 16(float) Load 558
Store 557(param) 559
560: 19(fvec3) FunctionCall 31(springForce(vf3;vf3;f1;) 551(param) 555(param) 557(param)
561: 19(fvec3) Load 247(force)
562: 19(fvec3) FAdd 561 560
Store 247(force) 562
Branch 541
541: Label
566: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 23(DebugScope) 55
567: 4 ExtInst 1(NonSemantic.Shader.DebugInfo.100) 103(DebugLine) 35 568 568 12 12
565: 105(ptr) AccessChain 101(params) 564