rhi: metal: Fix offscreen frame command completion wait
Does what 711c55b632
did for
Vulkan, i.e. removes the there-is-more-than-one-swapchain
condition.
Fixes: QTBUG-109971
Pick-to: 6.5 6.4 6.2
Change-Id: If631748c50482389a3ef894823a1aaf1ebb38bee
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
This commit is contained in:
parent
8352756d27
commit
2305f8af9f
@ -2335,15 +2335,13 @@ QRhi::FrameOpResult QRhiMetal::beginOffscreenFrame(QRhiCommandBuffer **cb, QRhi:
|
||||
Q_UNUSED(flags);
|
||||
|
||||
currentFrameSlot = (currentFrameSlot + 1) % QMTL_FRAMES_IN_FLIGHT;
|
||||
if (swapchains.count() > 1) {
|
||||
for (QMetalSwapChain *sc : std::as_const(swapchains)) {
|
||||
// wait+signal is the general pattern to ensure the commands for a
|
||||
// given frame slot have completed (if sem is 1, we go 0 then 1; if
|
||||
// sem is 0 we go -1, block, completion increments to 0, then us to 1)
|
||||
dispatch_semaphore_t sem = sc->d->sem[currentFrameSlot];
|
||||
dispatch_semaphore_wait(sem, DISPATCH_TIME_FOREVER);
|
||||
dispatch_semaphore_signal(sem);
|
||||
}
|
||||
for (QMetalSwapChain *sc : std::as_const(swapchains)) {
|
||||
// wait+signal is the general pattern to ensure the commands for a
|
||||
// given frame slot have completed (if sem is 1, we go 0 then 1; if
|
||||
// sem is 0 we go -1, block, completion increments to 0, then us to 1)
|
||||
dispatch_semaphore_t sem = sc->d->sem[currentFrameSlot];
|
||||
dispatch_semaphore_wait(sem, DISPATCH_TIME_FOREVER);
|
||||
dispatch_semaphore_signal(sem);
|
||||
}
|
||||
|
||||
d->ofr.active = true;
|
||||
|
Loading…
Reference in New Issue
Block a user