1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-04 07:24:15 +01:00

[d3d11] Move D3D11 presenter creation to WineDXGISwapChainFactory

This commit is contained in:
Philip Rebohle 2019-02-11 19:54:01 +01:00
parent 9f8c1d08a6
commit fd445f7b4d
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 13 additions and 15 deletions

View File

@ -1686,8 +1686,9 @@ namespace dxvk {
WineDXGISwapChainFactory::WineDXGISwapChainFactory( WineDXGISwapChainFactory::WineDXGISwapChainFactory(
IDXGIVkPresentDevice* pDevice) D3D11DXGIDevice* pContainer,
: m_device(pDevice) { D3D11Device* pDevice)
: m_container(pContainer), m_device(pDevice) {
} }
@ -1741,17 +1742,12 @@ namespace dxvk {
fsDesc.Windowed = TRUE; fsDesc.Windowed = TRUE;
} }
// Create presenter for the device
Com<IDXGIVkSwapChain> presenter;
HRESULT hr = m_device->CreateSwapChainForHwnd(
hWnd, &desc, &presenter);
if (FAILED(hr))
return hr;
try { try {
// Create actual swap chain object // Create presenter for the device
Com<D3D11SwapChain> presenter = new D3D11SwapChain(
m_container, m_device, hWnd, &desc);
// Create the actual swap chain
*ppSwapChain = ref(new DxgiSwapChain( *ppSwapChain = ref(new DxgiSwapChain(
pFactory, presenter.ptr(), hWnd, &desc, &fsDesc)); pFactory, presenter.ptr(), hWnd, &desc, &fsDesc));
return S_OK; return S_OK;
@ -1775,7 +1771,7 @@ namespace dxvk {
m_d3d11Device (this, FeatureLevel, FeatureFlags), m_d3d11Device (this, FeatureLevel, FeatureFlags),
m_d3d11Presenter(this, &m_d3d11Device), m_d3d11Presenter(this, &m_d3d11Device),
m_d3d11Interop (this, &m_d3d11Device), m_d3d11Interop (this, &m_d3d11Device),
m_wineFactory (&m_d3d11Presenter), m_wineFactory (this, &m_d3d11Device),
m_frameLatencyCap(m_d3d11Device.GetOptions()->maxFrameLatency) { m_frameLatencyCap(m_d3d11Device.GetOptions()->maxFrameLatency) {
for (uint32_t i = 0; i < m_frameEvents.size(); i++) for (uint32_t i = 0; i < m_frameEvents.size(); i++)
m_frameEvents[i] = new DxvkEvent(); m_frameEvents[i] = new DxvkEvent();

View File

@ -396,7 +396,8 @@ namespace dxvk {
public: public:
WineDXGISwapChainFactory( WineDXGISwapChainFactory(
IDXGIVkPresentDevice* pDevice); D3D11DXGIDevice* pContainer,
D3D11Device* pDevice);
ULONG STDMETHODCALLTYPE AddRef(); ULONG STDMETHODCALLTYPE AddRef();
@ -416,7 +417,8 @@ namespace dxvk {
private: private:
IDXGIVkPresentDevice* m_device; D3D11DXGIDevice* m_container;
D3D11Device* m_device;
}; };