[webkit-changes] [WebKit/WebKit] 49f0ed: [WebGPU] Large indirect draw calls should trigger ...

mwyrzykowski noreply at github.com
Mon Dec 23 14:00:16 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 49f0ede27a9accfa0761059074ff63d17a0cefba
      https://github.com/WebKit/WebKit/commit/49f0ede27a9accfa0761059074ff63d17a0cefba
  Author: Mike Wyrzykowski <mwyrzykowski at apple.com>
  Date:   2024-12-23 (Mon, 23 Dec 2024)

  Changed paths:
    A LayoutTests/fast/webgpu/nocrash/fuzz-284937-expected.txt
    A LayoutTests/fast/webgpu/nocrash/fuzz-284937.html
    M Source/WebGPU/WebGPU/BindGroup.mm
    M Source/WebGPU/WebGPU/Buffer.mm
    M Source/WebGPU/WebGPU/Device.h
    M Source/WebGPU/WebGPU/Device.mm
    M Source/WebGPU/WebGPU/RenderBundleEncoder.mm
    M Source/WebGPU/WebGPU/RenderPassEncoder.h
    M Source/WebGPU/WebGPU/RenderPassEncoder.mm
    M Source/WebGPU/WebGPU/ShaderModule.mm

  Log Message:
  -----------
  [WebGPU] Large indirect draw calls should trigger device lost
https://bugs.webkit.org/show_bug.cgi?id=284937
rdar://141433630

Reviewed by Dan Glastonbury.

Sending very large (vertex or index) * instance counts to drawIndirect
or drawIndexedIndirect would lead to an unresponsive device, command
buffer errors, or other unfortunate perceived device behavior.

Limit draw calls to reasonable numbers, trigger device lost when
too complex.

* Source/WebGPU/WebGPU/BindGroup.mm:
(WebGPU::Device::createExternalTextureFromPixelBuffer const):
* Source/WebGPU/WebGPU/Device.h:
(WebGPU::Device::maxVerticesPerDrawCall const):
* Source/WebGPU/WebGPU/Device.mm:
(WebGPU::computeMaxCountForDevice):
Use reasonable limits based on GPU family.

(WebGPU::Device::Device):
* Source/WebGPU/WebGPU/RenderBundleEncoder.mm:
(WebGPU::RenderBundleEncoder::drawIndirect):
* Source/WebGPU/WebGPU/RenderPassEncoder.h:
* Source/WebGPU/WebGPU/RenderPassEncoder.mm:
(WebGPU::RenderPassEncoder::draw):
(WebGPU::RenderPassEncoder::clampIndirectBufferToValidValues):
(WebGPU::RenderPassEncoder::drawIndexed):
(WebGPU::RenderPassEncoder::drawIndirect):

* Source/WebGPU/WebGPU/ShaderModule.mm:
(WebGPU::ShaderModule::getCompilationInfo):
Assertion noticed in debug running test. It should not be an
assertion since calling getCompilationInfo() on an invalid
GPUShaderModule would trigger this, rather we should report
an empty message.

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



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list