From a05a6550370e67e0d28b41f9879c2291283392aa Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Sun, 5 Jun 2022 02:22:51 +1000 Subject: [PATCH] HostDisplay: Create swap chain in CreateRenderDevice() for D3D Fixes starting in exclusive fullscreen mode in Qt. --- pcsx2/Frontend/D3D11HostDisplay.cpp | 7 ++++--- pcsx2/Frontend/D3D12HostDisplay.cpp | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/pcsx2/Frontend/D3D11HostDisplay.cpp b/pcsx2/Frontend/D3D11HostDisplay.cpp index e438bf374c..7fa2cf5faf 100644 --- a/pcsx2/Frontend/D3D11HostDisplay.cpp +++ b/pcsx2/Frontend/D3D11HostDisplay.cpp @@ -320,14 +320,15 @@ bool D3D11HostDisplay::CreateRenderDevice(const WindowInfo& wi, std::string_view m_window_info = wi; m_vsync_mode = vsync; + + if (m_window_info.type != WindowInfo::Type::Surfaceless && !CreateSwapChain(nullptr)) + return false; + return true; } bool D3D11HostDisplay::InitializeRenderDevice(std::string_view shader_cache_directory, bool debug_device) { - if (m_window_info.type != WindowInfo::Type::Surfaceless && !CreateSwapChain(nullptr)) - return false; - return true; } diff --git a/pcsx2/Frontend/D3D12HostDisplay.cpp b/pcsx2/Frontend/D3D12HostDisplay.cpp index 6aaed9b476..31134b3d58 100644 --- a/pcsx2/Frontend/D3D12HostDisplay.cpp +++ b/pcsx2/Frontend/D3D12HostDisplay.cpp @@ -191,14 +191,15 @@ bool D3D12HostDisplay::CreateRenderDevice(const WindowInfo& wi, std::string_view } m_window_info = wi; + + if (m_window_info.type != WindowInfo::Type::Surfaceless && !CreateSwapChain(nullptr)) + return false; + return true; } bool D3D12HostDisplay::InitializeRenderDevice(std::string_view shader_cache_directory, bool debug_device) { - if (m_window_info.type != WindowInfo::Type::Surfaceless && !CreateSwapChain(nullptr)) - return false; - return true; }