mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-22 14:52:18 +01:00
c5deedef2d
Helps decouple the D3D11 module from the DXGI implementation. This also allows us to clean up D3D11 device creation, which is much needed. Based on zzhiyi/dxvk@fa441937f1 Co-authored-by: Zhiyi Zhang <zzhang@codeweavers.com>
52 lines
1.1 KiB
C++
52 lines
1.1 KiB
C++
#include "d3d11_device.h"
|
|
#include "d3d11_present.h"
|
|
|
|
namespace dxvk {
|
|
|
|
D3D11PresentDevice::D3D11PresentDevice(
|
|
D3D11DXGIDevice* pContainer,
|
|
D3D11Device* pDevice)
|
|
: m_container (pContainer),
|
|
m_device (pDevice) {
|
|
|
|
}
|
|
|
|
|
|
D3D11PresentDevice::~D3D11PresentDevice() {
|
|
|
|
}
|
|
|
|
|
|
ULONG STDMETHODCALLTYPE D3D11PresentDevice::AddRef() {
|
|
return m_container->AddRef();
|
|
}
|
|
|
|
|
|
ULONG STDMETHODCALLTYPE D3D11PresentDevice::Release() {
|
|
return m_container->Release();
|
|
}
|
|
|
|
|
|
HRESULT STDMETHODCALLTYPE D3D11PresentDevice::QueryInterface(REFIID riid, void** ppvObject) {
|
|
return m_container->QueryInterface(riid, ppvObject);
|
|
}
|
|
|
|
|
|
HRESULT STDMETHODCALLTYPE D3D11PresentDevice::CreateSwapChainForHwnd(
|
|
HWND hWnd,
|
|
const DXGI_SWAP_CHAIN_DESC1* pDesc,
|
|
IDXGIVkSwapChain** ppSwapChain) {
|
|
InitReturnPtr(ppSwapChain);
|
|
|
|
try {
|
|
*ppSwapChain = ref(new D3D11SwapChain(
|
|
m_container, m_device, hWnd, pDesc));
|
|
return S_OK;
|
|
} catch (const DxvkError& e) {
|
|
Logger::err(e.message());
|
|
return E_FAIL;
|
|
}
|
|
}
|
|
|
|
}
|