Commit 9af4ec6
committed
[WebGPU] small writeBuffer copies re-trigger index validation unnecessarily
https://bugs.webkit.org/show_bug.cgi?id=291497
rdar://149172455
Reviewed by Tadeu Zagallo.
GPUQueue.writeBuffer on an index buffer would require re-validation
of draw calls, this is suboptimal when the indices in the writeBuffer
call are within the same range as previous values.
clampIndexBufferToValidValues was previously >5% of samples in some traces.
Test: no regression to CTS or validation regression suites.
* Source/WebGPU/WebGPU/Buffer.h:
* Source/WebGPU/WebGPU/Buffer.mm:
(WebGPU::Buffer::indirectBufferInvalidated):
(WebGPU::Buffer::needsIndexValidation):
* Source/WebGPU/WebGPU/Queue.mm:
(WebGPU::maxIndexValueSlow):
(WebGPU::maxIndexValue):
(WebGPU::Queue::writeBuffer):
Canonical link: https://commits.webkit.org/294070@main1 parent 9a7661e commit 9af4ec6
3 files changed
+78
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
| 133 | + | |
133 | 134 | | |
134 | 135 | | |
135 | 136 | | |
| |||
166 | 167 | | |
167 | 168 | | |
168 | 169 | | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
169 | 173 | | |
170 | 174 | | |
171 | 175 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
424 | 424 | | |
425 | 425 | | |
426 | 426 | | |
| 427 | + | |
427 | 428 | | |
428 | 429 | | |
429 | 430 | | |
| |||
701 | 702 | | |
702 | 703 | | |
703 | 704 | | |
| 705 | + | |
704 | 706 | | |
705 | 707 | | |
706 | 708 | | |
707 | 709 | | |
708 | 710 | | |
709 | 711 | | |
710 | 712 | | |
| 713 | + | |
711 | 714 | | |
712 | 715 | | |
713 | 716 | | |
| |||
722 | 725 | | |
723 | 726 | | |
724 | 727 | | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
725 | 743 | | |
726 | 744 | | |
727 | 745 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
| |||
464 | 465 | | |
465 | 466 | | |
466 | 467 | | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
467 | 512 | | |
468 | 513 | | |
469 | 514 | | |
| |||
472 | 517 | | |
473 | 518 | | |
474 | 519 | | |
475 | | - | |
| 520 | + | |
| 521 | + | |
476 | 522 | | |
477 | 523 | | |
478 | 524 | | |
| |||
487 | 533 | | |
488 | 534 | | |
489 | 535 | | |
490 | | - | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
491 | 545 | | |
492 | 546 | | |
493 | 547 | | |
| |||
0 commit comments