Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 02cba9a8abd78987686050966b765f4cf47a6905
      
https://github.com/WebKit/WebKit/commit/02cba9a8abd78987686050966b765f4cf47a6905
  Author: Mike Wyrzykowski <[email protected]>
  Date:   2024-11-24 (Sun, 24 Nov 2024)

  Changed paths:
    M Source/WebGPU/WebGPU/BindableResource.h
    M Source/WebGPU/WebGPU/Buffer.h
    M Source/WebGPU/WebGPU/Buffer.mm
    M Source/WebGPU/WebGPU/Device.mm
    M Source/WebGPU/WebGPU/HardwareCapabilities.mm
    M Source/WebGPU/WebGPU/Queue.h
    M Source/WebGPU/WebGPU/RenderBundleEncoder.mm
    M Source/WebGPU/WebGPU/RenderPassEncoder.h
    M Source/WebGPU/WebGPU/RenderPassEncoder.mm

  Log Message:
  -----------
  [WebGPU] https://threejs.org/examples/?q=bat#webgpu_mesh_batch is slow with 
10k instances
https://bugs.webkit.org/show_bug.cgi?id=283225
rdar://140017948

Reviewed by Tadeu Zagallo.

We previously maintained a single cache per drawIndex call which allowed 
repeated
calls to drawIndexed to skip validation provided the index buffer contents did 
not change.

This heavily penalized drawIndexed calls where a single index buffer was used 
across
multiple draw calls with different offsets into the index buffer.

Fix this by caching the calls which are known to be valid, directly going to 
the DIP
path when the call is known to be safe. The cache is cleared when the index 
buffer
is mutated in any fashion.

This allows us to increase the instance count to 20k with realtime performance, 
previously
it was 0-1fps on this sample at 10k instances and caused device lost due to 
performance
on some devices.

Testing: CTS and existing tests ensuring zero out of bounds reads continue to 
pass.

* Source/WebGPU/WebGPU/Buffer.h:
(WebGPU::Buffer::didReadOOB const):
(WebGPU::Buffer::didReadOOB):
* Source/WebGPU/WebGPU/Buffer.mm:
(WebGPU::Buffer::Buffer):
(WebGPU::makeKey):
(WebGPU::makeValue):
(WebGPU::Buffer::canSkipDrawIndexedValidation const):
(WebGPU::Buffer::drawIndexedValidated):
(WebGPU::Buffer::indirectBufferInvalidated):
* Source/WebGPU/WebGPU/Device.mm:
* Source/WebGPU/WebGPU/Queue.h:
* Source/WebGPU/WebGPU/RenderBundleEncoder.mm:
(WebGPU::makeRenderBundleICBWithResources):
(WebGPU::RenderBundleEncoder::drawIndexed):
* Source/WebGPU/WebGPU/RenderPassEncoder.h:
* Source/WebGPU/WebGPU/RenderPassEncoder.mm:
(WebGPU::RenderPassEncoder::clampIndexBufferToValidValues):
(WebGPU::RenderPassEncoder::executeBundles):

Canonical link: https://commits.webkit.org/287050@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to