Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 282946c99a9fd53e71c89aab62d7fa76a474c23a
      
https://github.com/WebKit/WebKit/commit/282946c99a9fd53e71c89aab62d7fa76a474c23a
  Author: Mike Wyrzykowski <mwyrzykow...@apple.com>
  Date:   2025-08-06 (Wed, 06 Aug 2025)

  Changed paths:
    M Source/WebGPU/WebGPU/CommandEncoder.mm
    M Source/WebGPU/WebGPU/QuerySet.h
    M Source/WebGPU/WebGPU/QuerySet.mm

  Log Message:
  -----------
  [WebGPU] After 32 timestamp queries are created, subsequent query sets may 
fail to create
https://bugs.webkit.org/show_bug.cgi?id=296646
rdar://157045167

Reviewed by Dan Glastonbury.

Metal has a per-process limit of 32 MTLCounterSampleBuffers
as documented at https://developer.apple.com/metal/Metal-Feature-Set-Tables.pdf

Several sites or a single site could easily surprass this limit.

However, we can create MTLCounterSampleBuffer instances of size 32kb, but
generally only 16 bytes can be used per render pass. So we can sub-divide
the thirty-two 32kb buffers into 65k 'seperate' counter sample buffers.

Increasing the limit from 32 -> 65536 considerably mitigates the issue.

Tests: existing timestamp CTS tests continue to pass.

* Source/WebGPU/WebGPU/CommandEncoder.mm:
(WebGPU::timestampWriteIndex):
(WebGPU::CommandEncoder::beginComputePass):
(WebGPU::CommandEncoder::beginRenderPass):
(WebGPU::CommandEncoder::resolveQuerySet):
* Source/WebGPU/WebGPU/QuerySet.h:
(WebGPU::QuerySet::create):
(WebGPU::QuerySet::counterSampleBuffer const):
* Source/WebGPU/WebGPU/QuerySet.mm:
(WebGPU::Device::createQuerySet):
(WebGPU::QuerySet::QuerySet):
(WebGPU::QuerySet::~QuerySet):
(WebGPU::QuerySet::isValid const):
(WebGPU::QuerySet::destroy):
(WebGPU::QuerySet::setCommandEncoder const):
(WebGPU::QuerySet::counterSampleBufferWithOffset const):
(WebGPU::QuerySet::destroyQuerySet):
(WebGPU::QuerySet::counterSampleBufferWithOffset):
(WebGPU::QuerySet::createContainersIfNeeded):

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



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

Reply via email to