mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-03-13 19:29:14 +01:00
[d3d11] Move QueryInterface to D3D11CommonContext
This commit is contained in:
parent
4af974768a
commit
10345d0063
@ -32,46 +32,6 @@ namespace dxvk {
|
||||
}
|
||||
|
||||
|
||||
HRESULT STDMETHODCALLTYPE D3D11DeviceContext::QueryInterface(REFIID riid, void** ppvObject) {
|
||||
if (ppvObject == nullptr)
|
||||
return E_POINTER;
|
||||
|
||||
*ppvObject = nullptr;
|
||||
|
||||
if (riid == __uuidof(IUnknown)
|
||||
|| riid == __uuidof(ID3D11DeviceChild)
|
||||
|| riid == __uuidof(ID3D11DeviceContext)
|
||||
|| riid == __uuidof(ID3D11DeviceContext1)
|
||||
|| riid == __uuidof(ID3D11DeviceContext2)
|
||||
|| riid == __uuidof(ID3D11DeviceContext3)
|
||||
|| riid == __uuidof(ID3D11DeviceContext4)) {
|
||||
*ppvObject = ref(this);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
if (riid == __uuidof(ID3D11VkExtContext)
|
||||
|| riid == __uuidof(ID3D11VkExtContext1)) {
|
||||
*ppvObject = ref(&m_contextExt);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
if (riid == __uuidof(ID3DUserDefinedAnnotation)
|
||||
|| riid == __uuidof(IDXVKUserDefinedAnnotation)) {
|
||||
*ppvObject = ref(&m_annotation);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
if (riid == __uuidof(ID3D10Multithread)) {
|
||||
*ppvObject = ref(&m_multithread);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
Logger::warn("D3D11DeviceContext::QueryInterface: Unknown interface query");
|
||||
Logger::warn(str::format(riid));
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
|
||||
|
||||
void STDMETHODCALLTYPE D3D11DeviceContext::DiscardResource(ID3D11Resource* pResource) {
|
||||
D3D10DeviceLock lock = LockContext();
|
||||
|
||||
|
@ -32,10 +32,6 @@ namespace dxvk {
|
||||
DxvkCsChunkFlags CsFlags);
|
||||
~D3D11DeviceContext();
|
||||
|
||||
HRESULT STDMETHODCALLTYPE QueryInterface(
|
||||
REFIID riid,
|
||||
void** ppvObject);
|
||||
|
||||
void STDMETHODCALLTYPE DiscardResource(ID3D11Resource *pResource);
|
||||
|
||||
void STDMETHODCALLTYPE DiscardView(ID3D11View* pResourceView);
|
||||
|
@ -20,6 +20,47 @@ namespace dxvk {
|
||||
}
|
||||
|
||||
|
||||
template<typename ContextType>
|
||||
HRESULT STDMETHODCALLTYPE D3D11CommonContext<ContextType>::QueryInterface(REFIID riid, void** ppvObject) {
|
||||
if (ppvObject == nullptr)
|
||||
return E_POINTER;
|
||||
|
||||
*ppvObject = nullptr;
|
||||
|
||||
if (riid == __uuidof(IUnknown)
|
||||
|| riid == __uuidof(ID3D11DeviceChild)
|
||||
|| riid == __uuidof(ID3D11DeviceContext)
|
||||
|| riid == __uuidof(ID3D11DeviceContext1)
|
||||
|| riid == __uuidof(ID3D11DeviceContext2)
|
||||
|| riid == __uuidof(ID3D11DeviceContext3)
|
||||
|| riid == __uuidof(ID3D11DeviceContext4)) {
|
||||
*ppvObject = ref(this);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
if (riid == __uuidof(ID3D11VkExtContext)
|
||||
|| riid == __uuidof(ID3D11VkExtContext1)) {
|
||||
*ppvObject = ref(&m_contextExt);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
if (riid == __uuidof(ID3DUserDefinedAnnotation)
|
||||
|| riid == __uuidof(IDXVKUserDefinedAnnotation)) {
|
||||
*ppvObject = ref(&m_annotation);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
if (riid == __uuidof(ID3D10Multithread)) {
|
||||
*ppvObject = ref(&m_multithread);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
Logger::warn("D3D11DeviceContext::QueryInterface: Unknown interface query");
|
||||
Logger::warn(str::format(riid));
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
|
||||
|
||||
template<typename ContextType>
|
||||
void STDMETHODCALLTYPE D3D11CommonContext<ContextType>::UpdateSubresource(
|
||||
ID3D11Resource* pDstResource,
|
||||
|
@ -64,6 +64,10 @@ namespace dxvk {
|
||||
|
||||
~D3D11CommonContext();
|
||||
|
||||
HRESULT STDMETHODCALLTYPE QueryInterface(
|
||||
REFIID riid,
|
||||
void** ppvObject);
|
||||
|
||||
void STDMETHODCALLTYPE UpdateSubresource(
|
||||
ID3D11Resource* pDstResource,
|
||||
UINT DstSubresource,
|
||||
|
@ -57,7 +57,7 @@ namespace dxvk {
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
return D3D11DeviceContext::QueryInterface(riid, ppvObject);
|
||||
return D3D11CommonContext<D3D11ImmediateContext>::QueryInterface(riid, ppvObject);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user