1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-31 14:52:11 +01:00

[dxgi] Implemented DxgiSwapChain interface queries

This commit is contained in:
Philip Rebohle 2017-11-26 14:02:08 +01:00
parent f924931d2d
commit f3a37068bb
2 changed files with 15 additions and 7 deletions

View File

@ -8,19 +8,26 @@ namespace dxvk {
DxgiSwapChain::DxgiSwapChain( DxgiSwapChain::DxgiSwapChain(
DxgiFactory* factory, DxgiFactory* factory,
IUnknown* pDevice, IUnknown* pDevice,
DXGI_SWAP_CHAIN_DESC* pDesc) { DXGI_SWAP_CHAIN_DESC* pDesc)
TRACE(this, factory, pDevice); : m_factory (factory),
m_desc (*pDesc) {
if (FAILED(pDevice->QueryInterface(__uuidof(IDXVKDevice),
reinterpret_cast<void**>(&m_device))))
throw DxvkError("DxgiSwapChain::DxgiSwapChain: Invalid device");
} }
DxgiSwapChain::~DxgiSwapChain() { DxgiSwapChain::~DxgiSwapChain() {
TRACE(this);
} }
HRESULT DxgiSwapChain::QueryInterface(REFIID riid, void** ppvObject) { HRESULT DxgiSwapChain::QueryInterface(REFIID riid, void** ppvObject) {
COM_QUERY_IFACE(riid, ppvObject, IUnknown); COM_QUERY_IFACE(riid, ppvObject, IUnknown);
COM_QUERY_IFACE(riid, ppvObject, IDXGIObject); COM_QUERY_IFACE(riid, ppvObject, IDXGIObject);
COM_QUERY_IFACE(riid, ppvObject, IDXGIDeviceSubObject);
COM_QUERY_IFACE(riid, ppvObject, IDXGISwapChain); COM_QUERY_IFACE(riid, ppvObject, IDXGISwapChain);
Logger::warn("DxgiSwapChain::QueryInterface: Unknown interface query"); Logger::warn("DxgiSwapChain::QueryInterface: Unknown interface query");
@ -29,14 +36,12 @@ namespace dxvk {
HRESULT DxgiSwapChain::GetParent(REFIID riid, void** ppParent) { HRESULT DxgiSwapChain::GetParent(REFIID riid, void** ppParent) {
Logger::err("DxgiSwapChain::GetParent: Not implemented"); return m_factory->QueryInterface(riid, ppParent);
return E_NOTIMPL;
} }
HRESULT DxgiSwapChain::GetDevice(REFIID riid, void** ppDevice) { HRESULT DxgiSwapChain::GetDevice(REFIID riid, void** ppDevice) {
Logger::err("DxgiSwapChain::GetDevice: Not implemented"); return m_device->QueryInterface(riid, ppDevice);
return E_NOTIMPL;
} }

View File

@ -73,7 +73,10 @@ namespace dxvk {
private: private:
Com<DxgiFactory> m_factory;
Com<IDXVKDevice> m_device;
DXGI_SWAP_CHAIN_DESC m_desc;
}; };