mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-18 02:52:10 +01:00
[dxgi] Fixed swap chain issue in ResizeTargets
This commit is contained in:
parent
77ca0a84b7
commit
fadcac5a8e
@ -241,14 +241,25 @@ namespace dxvk {
|
||||
/ pNewTargetParameters->RefreshRate.Denominator;
|
||||
displayMode.driverdata = nullptr;
|
||||
|
||||
// TODO test mode change flag
|
||||
|
||||
if (SDL_SetWindowDisplayMode(m_window, &displayMode)) {
|
||||
throw DxvkError(str::format(
|
||||
Logger::err(str::format(
|
||||
"DxgiSwapChain::ResizeTarget: Failed to set display mode:\n",
|
||||
SDL_GetError()));
|
||||
return DXGI_ERROR_DRIVER_INTERNAL_ERROR;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
try {
|
||||
m_presenter->recreateSwapchain(
|
||||
m_desc.BufferDesc.Width,
|
||||
m_desc.BufferDesc.Height,
|
||||
m_desc.BufferDesc.Format);
|
||||
return S_OK;
|
||||
} catch (const DxvkError& err) {
|
||||
Logger::err(err.message());
|
||||
return DXGI_ERROR_DRIVER_INTERNAL_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -54,6 +54,9 @@ public:
|
||||
if (FAILED(m_device->CreateRenderTargetView(m_buffer.ptr(), nullptr, &m_bufferView)))
|
||||
throw DxvkError("Failed to create render target view");
|
||||
|
||||
if (FAILED(m_swapChain->ResizeTarget(&swapDesc.BufferDesc)))
|
||||
throw DxvkError("Failed to resize window");
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user