mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
D3DCommon: Fallback to base CreateSwapChain on failure
It appears that some older drivers do not support CreateSwapChainForHwnd, resulting in DXGI_ERROR_INVALID_CALL. For these cases, fall back to the base CreateSwapChain() from DXGI 1.0. In theory this should also let us run on Win7 without the platform update, but in reality we require the newer shader compiler so this probably won't work regardless. Also any hardware of this vintage is unlikely to run Dolphin well.
This commit is contained in:
@ -17,7 +17,7 @@ namespace D3DCommon
|
||||
class SwapChain
|
||||
{
|
||||
public:
|
||||
SwapChain(const WindowSystemInfo& wsi, IDXGIFactory2* dxgi_factory, IUnknown* d3d_device);
|
||||
SwapChain(const WindowSystemInfo& wsi, IDXGIFactory* dxgi_factory, IUnknown* d3d_device);
|
||||
virtual ~SwapChain();
|
||||
|
||||
// Sufficient buffers for triple buffering.
|
||||
@ -26,7 +26,7 @@ public:
|
||||
// Returns true if the stereo mode is quad-buffering.
|
||||
static bool WantsStereo();
|
||||
|
||||
IDXGISwapChain1* GetDXGISwapChain() const { return m_swap_chain.Get(); }
|
||||
IDXGISwapChain* GetDXGISwapChain() const { return m_swap_chain.Get(); }
|
||||
AbstractTextureFormat GetFormat() const { return m_texture_format; }
|
||||
u32 GetWidth() const { return m_width; }
|
||||
u32 GetHeight() const { return m_height; }
|
||||
@ -57,8 +57,8 @@ protected:
|
||||
virtual void DestroySwapChainBuffers() = 0;
|
||||
|
||||
WindowSystemInfo m_wsi;
|
||||
Microsoft::WRL::ComPtr<IDXGIFactory2> m_dxgi_factory;
|
||||
Microsoft::WRL::ComPtr<IDXGISwapChain1> m_swap_chain;
|
||||
Microsoft::WRL::ComPtr<IDXGIFactory> m_dxgi_factory;
|
||||
Microsoft::WRL::ComPtr<IDXGISwapChain> m_swap_chain;
|
||||
Microsoft::WRL::ComPtr<IUnknown> m_d3d_device;
|
||||
AbstractTextureFormat m_texture_format = AbstractTextureFormat::RGBA8;
|
||||
|
||||
|
Reference in New Issue
Block a user