1
0
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:
Philip Rebohle 2017-12-05 15:24:58 +01:00
parent 77ca0a84b7
commit fadcac5a8e
2 changed files with 16 additions and 2 deletions

View File

@ -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;
}
}

View File

@ -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");
}