Skip to content

Commit

Permalink
[dxvk] Error out on surface creation again
Browse files Browse the repository at this point in the history
Unless it's NATIVE_WINDOW_IN_USE. Should fix a regression where
D3D swapchain creation would succeed on out-of-memory errors.
  • Loading branch information
doitsujin committed Jan 20, 2025
1 parent c52a68a commit d5ab1f6
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/dxvk/dxvk_presenter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,14 @@ namespace dxvk {
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();
// 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 swap chain, ", vr));
}
}


Expand Down

0 comments on commit d5ab1f6

Please sign in to comment.