Skip to content

Commit

Permalink
[WebGPU] MTLCaptureManager stops capturing frame too soon
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=262940>
<radar://116716543>

Reviewed by Dan Glastonbury.

We want to end capture after queue calls submit as there may
be multiple command buffers.

* Source/WebGPU/WebGPU/Queue.mm:
(WebGPU::Queue::commitMTLCommandBuffer):
(WebGPU::Queue::submit):

Canonical link: https://commits.webkit.org/269132@main
  • Loading branch information
mwyrzykowski committed Oct 10, 2023
1 parent 3403223 commit 2e77657
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Source/WebGPU/WebGPU/Queue.mm
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,6 @@

[commandBuffer commit];
++m_submittedCommandBufferCount;

if ([MTLCaptureManager sharedCaptureManager].isCapturing)
[[MTLCaptureManager sharedCaptureManager] stopCapture];
}

void Queue::submit(Vector<std::reference_wrapper<const CommandBuffer>>&& commands)
Expand All @@ -175,6 +172,9 @@

for (auto commandBuffer : commands)
commitMTLCommandBuffer(commandBuffer.get().commandBuffer());

if ([MTLCaptureManager sharedCaptureManager].isCapturing)
[[MTLCaptureManager sharedCaptureManager] stopCapture];
}

static bool validateWriteBufferInitial(size_t size)
Expand Down

0 comments on commit 2e77657

Please sign in to comment.