mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-29 21:30:53 +00:00
Fix incorrect casting of forward declared ID3D11Device. Refs #316
* After clang-format re-arranged headers, the definition of WrappedID3D11Device was no longer visible from d3d11_context.h, but instead just the pre-declared "class WrappedID3D11Device;" * This meant the function didn't correctly upcast to the right parent type and left the return value with the wrong vtable which would crash
This commit is contained in:
@@ -210,6 +210,12 @@ WrappedID3D11DeviceContext::~WrappedID3D11DeviceContext()
|
||||
RenderDoc::Inst().GetCrashHandler()->UnregisterMemoryRegion(this);
|
||||
}
|
||||
|
||||
void WrappedID3D11DeviceContext::GetDevice(ID3D11Device **ppDevice)
|
||||
{
|
||||
*ppDevice = (ID3D11Device *)m_pDevice;
|
||||
(*ppDevice)->AddRef();
|
||||
}
|
||||
|
||||
const char *WrappedID3D11DeviceContext::GetChunkName(D3D11ChunkType idx)
|
||||
{
|
||||
return m_pDevice->GetChunkName(idx);
|
||||
|
||||
@@ -359,11 +359,7 @@ public:
|
||||
return m_pRealContext->GetPrivateData(Name, pDataSize, pData);
|
||||
}
|
||||
|
||||
virtual void STDMETHODCALLTYPE GetDevice(ID3D11Device **ppDevice)
|
||||
{
|
||||
*ppDevice = (ID3D11Device *)m_pDevice;
|
||||
(*ppDevice)->AddRef();
|
||||
}
|
||||
virtual void STDMETHODCALLTYPE GetDevice(ID3D11Device **ppDevice);
|
||||
|
||||
//////////////////////////////
|
||||
// implement ID3D11DeviceContext
|
||||
|
||||
Reference in New Issue
Block a user