mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-02-20 19:54:19 +01:00
[dxgi] Query window size before creating presenter
Otherwise we may pass a size of zero to the presenter.
This commit is contained in:
parent
66bcc4b3d8
commit
e4d3357e55
@ -23,13 +23,6 @@ namespace dxvk {
|
||||
m_stats.SyncQPCTime.QuadPart = 0;
|
||||
m_stats.SyncGPUTime.QuadPart = 0;
|
||||
|
||||
// Create presenter, which also serves as an interface to the device
|
||||
if (FAILED(CreatePresenter(pDevice, &m_presenter)))
|
||||
throw DxvkError("DXGI: Failed to create presenter");
|
||||
|
||||
if (FAILED(m_presenter->GetAdapter(__uuidof(IDXGIAdapter), reinterpret_cast<void**>(&m_adapter))))
|
||||
throw DxvkError("DXGI: Failed to get adapter for present device");
|
||||
|
||||
// Adjust initial back buffer size. If zero, these
|
||||
// shall be set to the current window size.
|
||||
const VkExtent2D windowSize = GetWindowSize();
|
||||
@ -37,6 +30,13 @@ namespace dxvk {
|
||||
if (m_desc.Width == 0) m_desc.Width = windowSize.width;
|
||||
if (m_desc.Height == 0) m_desc.Height = windowSize.height;
|
||||
|
||||
// Create presenter, which also serves as an interface to the device
|
||||
if (FAILED(CreatePresenter(pDevice, &m_presenter)))
|
||||
throw DxvkError("DXGI: Failed to create presenter");
|
||||
|
||||
if (FAILED(m_presenter->GetAdapter(__uuidof(IDXGIAdapter), reinterpret_cast<void**>(&m_adapter))))
|
||||
throw DxvkError("DXGI: Failed to get adapter for present device");
|
||||
|
||||
// Set initial window mode and fullscreen state
|
||||
if (!m_descFs.Windowed && FAILED(EnterFullscreenMode(nullptr)))
|
||||
throw DxvkError("DXGI: Failed to set initial fullscreen state");
|
||||
|
Loading…
x
Reference in New Issue
Block a user