mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-12-01 16:24:12 +01:00
[dxgi] Query device interface from the presenter
Removes the coupling between IDXGISwapChain and IDXGIDevice. This is necessary because D3D12 devices don't support IDXGIDevice.
This commit is contained in:
parent
7b9726fd93
commit
589229f4ca
@ -73,6 +73,13 @@ namespace dxvk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
HRESULT STDMETHODCALLTYPE D3D11SwapChain::GetDevice(
|
||||||
|
REFIID riid,
|
||||||
|
void** ppDevice) {
|
||||||
|
return m_parent->QueryInterface(riid, ppDevice);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
HRESULT STDMETHODCALLTYPE D3D11SwapChain::GetImage(
|
HRESULT STDMETHODCALLTYPE D3D11SwapChain::GetImage(
|
||||||
UINT BufferId,
|
UINT BufferId,
|
||||||
REFIID riid,
|
REFIID riid,
|
||||||
|
@ -40,6 +40,10 @@ namespace dxvk {
|
|||||||
HRESULT STDMETHODCALLTYPE GetDesc(
|
HRESULT STDMETHODCALLTYPE GetDesc(
|
||||||
DXGI_SWAP_CHAIN_DESC1* pDesc);
|
DXGI_SWAP_CHAIN_DESC1* pDesc);
|
||||||
|
|
||||||
|
HRESULT STDMETHODCALLTYPE GetDevice(
|
||||||
|
REFIID riid,
|
||||||
|
void** ppDevice);
|
||||||
|
|
||||||
HRESULT STDMETHODCALLTYPE GetImage(
|
HRESULT STDMETHODCALLTYPE GetImage(
|
||||||
UINT BufferId,
|
UINT BufferId,
|
||||||
REFIID riid,
|
REFIID riid,
|
||||||
|
@ -29,6 +29,10 @@ IDXGIVkSwapChain : public IUnknown {
|
|||||||
|
|
||||||
virtual HRESULT STDMETHODCALLTYPE GetDesc(
|
virtual HRESULT STDMETHODCALLTYPE GetDesc(
|
||||||
DXGI_SWAP_CHAIN_DESC1* pDesc) = 0;
|
DXGI_SWAP_CHAIN_DESC1* pDesc) = 0;
|
||||||
|
|
||||||
|
virtual HRESULT STDMETHODCALLTYPE GetDevice(
|
||||||
|
REFIID riid,
|
||||||
|
void** ppDevice) = 0;
|
||||||
|
|
||||||
virtual HRESULT STDMETHODCALLTYPE GetImage(
|
virtual HRESULT STDMETHODCALLTYPE GetImage(
|
||||||
UINT BufferId,
|
UINT BufferId,
|
||||||
|
@ -35,7 +35,6 @@ namespace dxvk {
|
|||||||
if (FAILED(device->GetAdapter(&adapter)))
|
if (FAILED(device->GetAdapter(&adapter)))
|
||||||
throw DxvkError("DXGI: DxgiSwapChain: Failed to retrieve adapter");
|
throw DxvkError("DXGI: DxgiSwapChain: Failed to retrieve adapter");
|
||||||
|
|
||||||
m_device = static_cast<DxgiDevice*>(device.ptr());
|
|
||||||
m_adapter = static_cast<DxgiAdapter*>(adapter.ptr());
|
m_adapter = static_cast<DxgiAdapter*>(adapter.ptr());
|
||||||
|
|
||||||
// Initialize frame statistics
|
// Initialize frame statistics
|
||||||
@ -93,7 +92,7 @@ namespace dxvk {
|
|||||||
|
|
||||||
|
|
||||||
HRESULT STDMETHODCALLTYPE DxgiSwapChain::GetDevice(REFIID riid, void** ppDevice) {
|
HRESULT STDMETHODCALLTYPE DxgiSwapChain::GetDevice(REFIID riid, void** ppDevice) {
|
||||||
return m_device->QueryInterface(riid, ppDevice);
|
return m_presenter->GetDevice(riid, ppDevice);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -136,7 +136,6 @@ namespace dxvk {
|
|||||||
|
|
||||||
Com<DxgiFactory> m_factory;
|
Com<DxgiFactory> m_factory;
|
||||||
Com<DxgiAdapter> m_adapter;
|
Com<DxgiAdapter> m_adapter;
|
||||||
Com<DxgiDevice> m_device;
|
|
||||||
|
|
||||||
HWND m_window;
|
HWND m_window;
|
||||||
DXGI_SWAP_CHAIN_DESC1 m_desc;
|
DXGI_SWAP_CHAIN_DESC1 m_desc;
|
||||||
|
Loading…
Reference in New Issue
Block a user