1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-03-03 16:29:15 +01:00

[dxvk] Soften error reporting from the presenter

This commit is contained in:
Philip Rebohle 2025-01-16 10:27:36 +01:00 committed by Philip Rebohle
parent 43838d3df8
commit ad11509e83
2 changed files with 19 additions and 2 deletions

View File

@ -86,7 +86,7 @@ namespace dxvk {
VkResult vr = recreateSwapChain();
if (vr != VK_SUCCESS)
return vr;
return softError(vr);
PresenterSync sync = m_semaphores.at(m_frameIndex);
@ -95,7 +95,7 @@ namespace dxvk {
sync.acquire, VK_NULL_HANDLE, &m_imageIndex);
if (m_acquireStatus < 0)
return m_acquireStatus;
return softError(m_acquireStatus);
}
// Update HDR metadata after a successful acquire. We know
@ -951,4 +951,18 @@ namespace dxvk {
}
}
VkResult Presenter::softError(
VkResult vr) {
// Don't return these as an error state to the caller. The app can't
// do much anyway, so just pretend that we don't have a valid swap
// chain and move on. An alternative would be to handle errors in a
// loop, however this may also not be desireable since it could stall
// the app indefinitely in case the surface is in a weird state.
if (vr == VK_ERROR_SURFACE_LOST_KHR || vr == VK_ERROR_OUT_OF_DATE_KHR)
return VK_NOT_READY;
return vr;
}
}

View File

@ -304,6 +304,9 @@ namespace dxvk {
void runFrameThread();
static VkResult softError(
VkResult vr);
};
}