mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-02-07 16:54:14 +01:00
[dxvk] Error out on surface creation again
Unless it's NATIVE_WINDOW_IN_USE. Should fix a regression where D3D swapchain creation would succeed on out-of-memory errors.
This commit is contained in:
parent
c52a68a5be
commit
863591275c
@ -30,16 +30,20 @@ namespace dxvk {
|
|||||||
? VK_FULL_SCREEN_EXCLUSIVE_ALLOWED_EXT
|
? VK_FULL_SCREEN_EXCLUSIVE_ALLOWED_EXT
|
||||||
: VK_FULL_SCREEN_EXCLUSIVE_DISALLOWED_EXT;
|
: VK_FULL_SCREEN_EXCLUSIVE_DISALLOWED_EXT;
|
||||||
|
|
||||||
|
// Create Vulkan surface immediately if possible, but ignore
|
||||||
|
// certain errors since the app window may still be in use in
|
||||||
|
// some way at this point, e.g. by a different device.
|
||||||
|
if (!desc.deferSurfaceCreation) {
|
||||||
|
VkResult vr = createSurface();
|
||||||
|
|
||||||
|
if (vr != VK_SUCCESS && vr != VK_ERROR_NATIVE_WINDOW_IN_USE_KHR)
|
||||||
|
throw DxvkError(str::format("Failed to create Vulkan surface, ", vr));
|
||||||
|
}
|
||||||
|
|
||||||
// If a frame signal was provided, launch thread that synchronizes
|
// If a frame signal was provided, launch thread that synchronizes
|
||||||
// with present operations and periodically signals the event
|
// with present operations and periodically signals the event
|
||||||
if (m_device->features().khrPresentWait.presentWait && m_signal != nullptr)
|
if (m_device->features().khrPresentWait.presentWait && m_signal != nullptr)
|
||||||
m_frameThread = dxvk::thread([this] { runFrameThread(); });
|
m_frameThread = dxvk::thread([this] { runFrameThread(); });
|
||||||
|
|
||||||
// Create Vulkan surface immediately if possible, but ignore
|
|
||||||
// failures since the app window may still be in use in some
|
|
||||||
// way at this point, e.g. by a different device.
|
|
||||||
if (!desc.deferSurfaceCreation)
|
|
||||||
createSurface();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user