1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-03 13:24:20 +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(
IDXGIVkPresentDevice* pDevice)
: m_device(pDevice) {
D3D11DXGIDevice* pContainer,
D3D11Device* pDevice)
: m_container(pContainer), m_device(pDevice) {
}
@ -1741,17 +1742,12 @@ namespace dxvk {
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 {
// 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(
pFactory, presenter.ptr(), hWnd, &desc, &fsDesc));
return S_OK;
@ -1775,7 +1771,7 @@ namespace dxvk {
m_d3d11Device (this, FeatureLevel, FeatureFlags),
m_d3d11Presenter(this, &m_d3d11Device),
m_d3d11Interop (this, &m_d3d11Device),
m_wineFactory (&m_d3d11Presenter),
m_wineFactory (this, &m_d3d11Device),
m_frameLatencyCap(m_d3d11Device.GetOptions()->maxFrameLatency) {
for (uint32_t i = 0; i < m_frameEvents.size(); i++)
m_frameEvents[i] = new DxvkEvent();

View File

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