[webkit-changes] [WebKit/WebKit] e0a82d: [WebGPU] MTLCounterTimestamps are not always retai...
mwyrzykowski
noreply at github.com
Wed Feb 5 19:03:24 PST 2025
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: e0a82ddfa60ac8ac327d645c214d092c792d0937
https://github.com/WebKit/WebKit/commit/e0a82ddfa60ac8ac327d645c214d092c792d0937
Author: Mike Wyrzykowski <mwyrzykowski at apple.com>
Date: 2025-02-05 (Wed, 05 Feb 2025)
Changed paths:
A LayoutTests/fast/webgpu/nocrash/fuzz-286956-expected.txt
A LayoutTests/fast/webgpu/nocrash/fuzz-286956.html
M Source/WebGPU/WebGPU/CommandBuffer.h
M Source/WebGPU/WebGPU/CommandBuffer.mm
M Source/WebGPU/WebGPU/CommandEncoder.h
M Source/WebGPU/WebGPU/CommandEncoder.mm
M Source/WebGPU/WebGPU/Device.h
M Source/WebGPU/WebGPU/Queue.h
M Source/WebGPU/WebGPU/Queue.mm
M Source/WebGPU/WebGPU/RenderPassEncoder.mm
Log Message:
-----------
[WebGPU] MTLCounterTimestamps are not always retained for the lifetime of the MTLCommandBuffer
https://bugs.webkit.org/show_bug.cgi?id=286956
rdar://144077005
Reviewed by Tadeu Zagallo.
To workaround rdar://143905417 we must retain MTLCounterSampleBuffer
instances until the MTLCommandBuffer's dealloc method runs.
Prior attempt largely ensured this but missed the case when the MTLCommandBuffer
is retained after CommandEncoder's destructor already ran.
Address this by manually retaining the MTLCounterSampleBuffer from
CommandEncoder's destructor.
* LayoutTests/fast/webgpu/nocrash/fuzz-286956-expected.txt: Added.
* LayoutTests/fast/webgpu/nocrash/fuzz-286956.html: Added.
Add regression test.
* Source/WebGPU/WebGPU/CommandBuffer.h:
* Source/WebGPU/WebGPU/CommandBuffer.mm:
(WebGPU::CommandBuffer::retainEncoderForOneUpdateLoop):
(WebGPU::CommandBuffer::~CommandBuffer):
(WebGPU::CommandBuffer::makeInvalid):
(WebGPU::CommandBuffer::makeInvalidDueToCommit):
* Source/WebGPU/WebGPU/CommandEncoder.h:
* Source/WebGPU/WebGPU/CommandEncoder.mm:
(WebGPU::CommandEncoder::retainTimestampsForOneUpdateLoop):
(WebGPU::CommandEncoder::~CommandEncoder):
(WebGPU::CommandEncoder::discardCommandBuffer):
* Source/WebGPU/WebGPU/Queue.h:
* Source/WebGPU/WebGPU/Queue.mm:
(WebGPU::Queue::retainTimestampsForOneUpdate):
Manually retain the MTLCounterSampleBuffer until -[MTLCommandBuffer dealloc] runs.
Canonical link: https://commits.webkit.org/289905@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