mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-12-05 01:24:14 +01:00
[d3d11] Implement IDXGIVkSwapChainFactory for D3D11
This commit is contained in:
parent
580dd5cf4a
commit
aca67f64da
@ -2972,6 +2972,52 @@ namespace dxvk {
|
||||
|
||||
|
||||
|
||||
DXGIVkSwapChainFactory::DXGIVkSwapChainFactory(
|
||||
D3D11DXGIDevice* pContainer,
|
||||
D3D11Device* pDevice)
|
||||
: m_container(pContainer), m_device(pDevice) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
ULONG STDMETHODCALLTYPE DXGIVkSwapChainFactory::AddRef() {
|
||||
return m_device->AddRef();
|
||||
}
|
||||
|
||||
|
||||
ULONG STDMETHODCALLTYPE DXGIVkSwapChainFactory::Release() {
|
||||
return m_device->Release();
|
||||
}
|
||||
|
||||
|
||||
HRESULT STDMETHODCALLTYPE DXGIVkSwapChainFactory::QueryInterface(
|
||||
REFIID riid,
|
||||
void** ppvObject) {
|
||||
return m_device->QueryInterface(riid, ppvObject);
|
||||
}
|
||||
|
||||
|
||||
HRESULT STDMETHODCALLTYPE DXGIVkSwapChainFactory::CreateSwapChain(
|
||||
HWND hWnd,
|
||||
const DXGI_SWAP_CHAIN_DESC1* pDesc,
|
||||
IDXGIVkSwapChain** ppSwapChain) {
|
||||
InitReturnPtr(ppSwapChain);
|
||||
|
||||
try {
|
||||
Com<D3D11SwapChain> presenter = new D3D11SwapChain(
|
||||
m_container, m_device, hWnd, pDesc);
|
||||
|
||||
*ppSwapChain = presenter.ref();
|
||||
return S_OK;
|
||||
} catch (const DxvkError& e) {
|
||||
Logger::err(e.message());
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
WineDXGISwapChainFactory::WineDXGISwapChainFactory(
|
||||
D3D11DXGIDevice* pContainer,
|
||||
D3D11Device* pDevice)
|
||||
@ -3097,6 +3143,7 @@ namespace dxvk {
|
||||
m_d3d11Interop (this, &m_d3d11Device),
|
||||
m_d3d11Video (this, &m_d3d11Device),
|
||||
m_metaDevice (this),
|
||||
m_dxvkFactory (this, &m_d3d11Device),
|
||||
m_wineFactory (this, &m_d3d11Device) {
|
||||
|
||||
}
|
||||
@ -3157,6 +3204,11 @@ namespace dxvk {
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
if (riid == __uuidof(IDXGIVkSwapChainFactory)) {
|
||||
*ppvObject = ref(&m_dxvkFactory);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
if (riid == __uuidof(IWineDXGISwapChainFactory)) {
|
||||
*ppvObject = ref(&m_wineFactory);
|
||||
return S_OK;
|
||||
|
@ -690,6 +690,38 @@ namespace dxvk {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* \brief DXVK swap chain factory
|
||||
*/
|
||||
class DXGIVkSwapChainFactory : public IDXGIVkSwapChainFactory {
|
||||
|
||||
public:
|
||||
|
||||
DXGIVkSwapChainFactory(
|
||||
D3D11DXGIDevice* pContainer,
|
||||
D3D11Device* pDevice);
|
||||
|
||||
ULONG STDMETHODCALLTYPE AddRef();
|
||||
|
||||
ULONG STDMETHODCALLTYPE Release();
|
||||
|
||||
HRESULT STDMETHODCALLTYPE QueryInterface(
|
||||
REFIID riid,
|
||||
void** ppvObject);
|
||||
|
||||
HRESULT STDMETHODCALLTYPE CreateSwapChain(
|
||||
HWND hWnd,
|
||||
const DXGI_SWAP_CHAIN_DESC1* pDesc,
|
||||
IDXGIVkSwapChain** ppSwapChain);
|
||||
|
||||
private:
|
||||
|
||||
D3D11DXGIDevice* m_container;
|
||||
D3D11Device* m_device;
|
||||
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* \brief DXGI swap chain factory
|
||||
*/
|
||||
@ -851,6 +883,7 @@ namespace dxvk {
|
||||
D3D11VideoDevice m_d3d11Video;
|
||||
DXGIDXVKDevice m_metaDevice;
|
||||
|
||||
DXGIVkSwapChainFactory m_dxvkFactory;
|
||||
WineDXGISwapChainFactory m_wineFactory;
|
||||
|
||||
uint32_t m_frameLatency = DefaultFrameLatency;
|
||||
|
Loading…
Reference in New Issue
Block a user