diff --git a/renderdoc/driver/d3d12/d3d12_resources.h b/renderdoc/driver/d3d12/d3d12_resources.h index 36be694a2..5a04dd1bb 100644 --- a/renderdoc/driver/d3d12/d3d12_resources.h +++ b/renderdoc/driver/d3d12/d3d12_resources.h @@ -129,14 +129,17 @@ public: AddRef(); return S_OK; } - if(riid == __uuidof(NestedType)) + else if(riid == __uuidof(NestedType)) { *ppvObject = (NestedType *)this; AddRef(); return S_OK; } - if(riid == __uuidof(NestedType1) && m_pReal) + else if(riid == __uuidof(NestedType1)) { + if(!m_pReal) + return E_NOINTERFACE; + // check that the real interface supports this NestedType1 *dummy = NULL; HRESULT check = m_pReal->QueryInterface(riid, (void **)&dummy); @@ -150,8 +153,11 @@ public: AddRef(); return S_OK; } - if(riid == __uuidof(NestedType2) && m_pReal) + else if(riid == __uuidof(NestedType2)) { + if(!m_pReal) + return E_NOINTERFACE; + // check that the real interface supports this NestedType2 *dummy = NULL; HRESULT check = m_pReal->QueryInterface(riid, (void **)&dummy); @@ -165,13 +171,32 @@ public: AddRef(); return S_OK; } - if(riid == __uuidof(ID3D12Object)) + else if(riid == __uuidof(ID3D12Pageable)) + { + // not all child classes support this, so check it on the real interface + if(!m_pReal) + return E_NOINTERFACE; + + // check that the real interface supports this + ID3D12Pageable *dummy = NULL; + HRESULT check = m_pReal->QueryInterface(riid, (void **)&dummy); + + SAFE_RELEASE(dummy); + + if(FAILED(check)) + return check; + + *ppvObject = (ID3D12Pageable *)this; + AddRef(); + return S_OK; + } + else if(riid == __uuidof(ID3D12Object)) { *ppvObject = (ID3D12DeviceChild *)this; AddRef(); return S_OK; } - if(riid == __uuidof(ID3D12DeviceChild)) + else if(riid == __uuidof(ID3D12DeviceChild)) { *ppvObject = (ID3D12DeviceChild *)this; AddRef();