mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-15 13:57:57 -07:00
9316e25652
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.
45 lines
1.1 KiB
C++
45 lines
1.1 KiB
C++
// Copyright 2019 Dolphin Emulator Project
|
|
// Licensed under GPLv2+
|
|
// Refer to the license.txt file included.
|
|
|
|
#pragma once
|
|
|
|
#include <d3d11.h>
|
|
#include <dxgi.h>
|
|
#include <memory>
|
|
#include <vector>
|
|
|
|
#include "Common/CommonTypes.h"
|
|
#include "Common/WindowSystemInfo.h"
|
|
#include "VideoBackends/D3D/D3DBase.h"
|
|
#include "VideoBackends/D3DCommon/SwapChain.h"
|
|
#include "VideoCommon/TextureConfig.h"
|
|
|
|
namespace DX11
|
|
{
|
|
class DXTexture;
|
|
class DXFramebuffer;
|
|
|
|
class SwapChain : public D3DCommon::SwapChain
|
|
{
|
|
public:
|
|
SwapChain(const WindowSystemInfo& wsi, IDXGIFactory* dxgi_factory, ID3D11Device* d3d_device);
|
|
~SwapChain();
|
|
|
|
static std::unique_ptr<SwapChain> Create(const WindowSystemInfo& wsi);
|
|
|
|
DXTexture* GetTexture() const { return m_texture.get(); }
|
|
DXFramebuffer* GetFramebuffer() const { return m_framebuffer.get(); }
|
|
|
|
protected:
|
|
bool CreateSwapChainBuffers() override;
|
|
void DestroySwapChainBuffers() override;
|
|
|
|
private:
|
|
// The runtime takes care of renaming the buffers.
|
|
std::unique_ptr<DXTexture> m_texture;
|
|
std::unique_ptr<DXFramebuffer> m_framebuffer;
|
|
};
|
|
|
|
} // namespace DX11
|