mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-14 05:50:51 +00:00
Add handling for D3D12.1 - D3D12.3 interface UUIDs in queries
This commit is contained in:
@@ -195,17 +195,7 @@ public:
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE GetDevice(REFIID riid, _COM_Outptr_opt_ void **ppvDevice)
|
||||
{
|
||||
if(riid == __uuidof(ID3D12Device) && ppvDevice)
|
||||
{
|
||||
*ppvDevice = (ID3D12Device *)m_pDevice;
|
||||
m_pDevice->AddRef();
|
||||
}
|
||||
else if(riid != __uuidof(ID3D12Device))
|
||||
{
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
|
||||
return E_INVALIDARG;
|
||||
return m_pDevice->GetDevice(riid, ppvDevice);
|
||||
}
|
||||
|
||||
//////////////////////////////
|
||||
|
||||
@@ -217,17 +217,7 @@ public:
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE GetDevice(REFIID riid, _COM_Outptr_opt_ void **ppvDevice)
|
||||
{
|
||||
if(riid == __uuidof(ID3D12Device) && ppvDevice)
|
||||
{
|
||||
*ppvDevice = (ID3D12Device *)m_pDevice;
|
||||
m_pDevice->AddRef();
|
||||
}
|
||||
else if(riid != __uuidof(ID3D12Device))
|
||||
{
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
|
||||
return E_INVALIDARG;
|
||||
return m_pDevice->GetDevice(riid, ppvDevice);
|
||||
}
|
||||
|
||||
//////////////////////////////
|
||||
|
||||
@@ -896,6 +896,18 @@ HRESULT STDMETHODCALLTYPE WrappedID3D12GraphicsCommandList2::QueryInterface(REFI
|
||||
AddRef();
|
||||
return S_OK;
|
||||
}
|
||||
else if(riid == __uuidof(ID3D12GraphicsCommandList1))
|
||||
{
|
||||
*ppvObject = (ID3D12GraphicsCommandList1 *)this;
|
||||
AddRef();
|
||||
return S_OK;
|
||||
}
|
||||
else if(riid == __uuidof(ID3D12GraphicsCommandList2))
|
||||
{
|
||||
*ppvObject = (ID3D12GraphicsCommandList2 *)this;
|
||||
AddRef();
|
||||
return S_OK;
|
||||
}
|
||||
else if(riid == __uuidof(ID3D12CommandList))
|
||||
{
|
||||
*ppvObject = (ID3D12CommandList *)this;
|
||||
|
||||
@@ -86,7 +86,8 @@ ULONG STDMETHODCALLTYPE DummyID3D12DebugDevice::Release()
|
||||
HRESULT STDMETHODCALLTYPE DummyID3D12DebugDevice::QueryInterface(REFIID riid, void **ppvObject)
|
||||
{
|
||||
if(riid == __uuidof(ID3D12InfoQueue) || riid == __uuidof(ID3D12DebugDevice) ||
|
||||
riid == __uuidof(ID3D12Device))
|
||||
riid == __uuidof(ID3D12Device) || riid == __uuidof(ID3D12Device1) ||
|
||||
riid == __uuidof(ID3D12Device2) || riid == __uuidof(ID3D12Device3))
|
||||
return m_pDevice->QueryInterface(riid, ppvObject);
|
||||
|
||||
if(riid == __uuidof(IUnknown))
|
||||
@@ -116,7 +117,8 @@ ULONG STDMETHODCALLTYPE WrappedID3D12DebugDevice::Release()
|
||||
HRESULT STDMETHODCALLTYPE WrappedID3D12DebugDevice::QueryInterface(REFIID riid, void **ppvObject)
|
||||
{
|
||||
if(riid == __uuidof(ID3D12InfoQueue) || riid == __uuidof(ID3D12DebugDevice) ||
|
||||
riid == __uuidof(ID3D12Device))
|
||||
riid == __uuidof(ID3D12Device) || riid == __uuidof(ID3D12Device1) ||
|
||||
riid == __uuidof(ID3D12Device2) || riid == __uuidof(ID3D12Device3))
|
||||
return m_pDevice->QueryInterface(riid, ppvObject);
|
||||
|
||||
if(riid == __uuidof(IUnknown))
|
||||
|
||||
@@ -517,11 +517,24 @@ public:
|
||||
// interface for DXGI
|
||||
virtual IUnknown *GetRealIUnknown() { return GetReal(); }
|
||||
virtual IID GetBackbufferUUID() { return __uuidof(ID3D12Resource); }
|
||||
virtual bool IsDeviceUUID(REFIID iid) { return iid == __uuidof(ID3D12Device) ? true : false; }
|
||||
virtual bool IsDeviceUUID(REFIID iid)
|
||||
{
|
||||
if(iid == __uuidof(ID3D12Device) || iid == __uuidof(ID3D12Device1) ||
|
||||
iid == __uuidof(ID3D12Device2) || iid == __uuidof(ID3D12Device3))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
virtual IUnknown *GetDeviceInterface(REFIID iid)
|
||||
{
|
||||
if(iid == __uuidof(ID3D12Device))
|
||||
return (ID3D12Device *)this;
|
||||
else if(iid == __uuidof(ID3D12Device1))
|
||||
return (ID3D12Device1 *)this;
|
||||
else if(iid == __uuidof(ID3D12Device2))
|
||||
return (ID3D12Device2 *)this;
|
||||
else if(iid == __uuidof(ID3D12Device3))
|
||||
return (ID3D12Device3 *)this;
|
||||
|
||||
RDCERR("Requested unknown device interface %s", ToStr(iid).c_str());
|
||||
|
||||
@@ -541,6 +554,36 @@ public:
|
||||
void Unmap(ID3D12Resource *Resource, UINT Subresource, byte *mapPtr,
|
||||
const D3D12_RANGE *pWrittenRange);
|
||||
|
||||
// helper for ID3D12DeviceChild implementations to use
|
||||
HRESULT GetDevice(REFIID riid, _COM_Outptr_opt_ void **ppvDevice)
|
||||
{
|
||||
if(!ppvDevice)
|
||||
return E_INVALIDARG;
|
||||
|
||||
if(riid == __uuidof(ID3D12Device))
|
||||
{
|
||||
*ppvDevice = (ID3D12Device *)this;
|
||||
this->AddRef();
|
||||
}
|
||||
else if(riid == __uuidof(ID3D12Device1))
|
||||
{
|
||||
*ppvDevice = (ID3D12Device1 *)this;
|
||||
this->AddRef();
|
||||
}
|
||||
else if(riid == __uuidof(ID3D12Device2))
|
||||
{
|
||||
*ppvDevice = (ID3D12Device2 *)this;
|
||||
this->AddRef();
|
||||
}
|
||||
else if(riid == __uuidof(ID3D12Device3))
|
||||
{
|
||||
*ppvDevice = (ID3D12Device3 *)this;
|
||||
this->AddRef();
|
||||
}
|
||||
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
|
||||
IMPLEMENT_FUNCTION_THREAD_SERIALISED(void, MapDataWrite, ID3D12Resource *Resource,
|
||||
UINT Subresource, byte *mapPtr, D3D12_RANGE range);
|
||||
IMPLEMENT_FUNCTION_THREAD_SERIALISED(void, WriteToSubresource, ID3D12Resource *Resource,
|
||||
|
||||
@@ -302,17 +302,7 @@ public:
|
||||
|
||||
virtual HRESULT STDMETHODCALLTYPE GetDevice(REFIID riid, _COM_Outptr_opt_ void **ppvDevice)
|
||||
{
|
||||
if(riid == __uuidof(ID3D12Device) && ppvDevice)
|
||||
{
|
||||
*ppvDevice = (ID3D12Device *)m_pDevice;
|
||||
m_pDevice->AddRef();
|
||||
}
|
||||
else if(riid != __uuidof(ID3D12Device))
|
||||
{
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
|
||||
return E_INVALIDARG;
|
||||
return m_pDevice->GetDevice(riid, ppvDevice);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user