mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-12 21:10:42 +00:00
Fix D3D11.5 fence creation
* Casting directly to void * from the wrong type will cause vtable mismatches
This commit is contained in:
@@ -60,7 +60,7 @@ HRESULT STDMETHODCALLTYPE WrappedID3DUserDefinedAnnotation::QueryInterface(REFII
|
||||
{
|
||||
if(riid == __uuidof(ID3DUserDefinedAnnotation))
|
||||
{
|
||||
*ppvObject = (void *)(ID3DUserDefinedAnnotation *)this;
|
||||
*ppvObject = (ID3DUserDefinedAnnotation *)this;
|
||||
AddRef();
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -1024,7 +1024,7 @@ HRESULT WrappedID3D11Device::CreateFence(UINT64 InitialValue, D3D11_FENCE_FLAG F
|
||||
|
||||
WrappedID3D11Fence *wrapped = new WrappedID3D11Fence(ret, this);
|
||||
|
||||
*ppFence = (void *)wrapped;
|
||||
*ppFence = (ID3D11Fence *)wrapped;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
@@ -1051,7 +1051,7 @@ HRESULT WrappedID3D11Device::OpenSharedFence(HANDLE hFence, REFIID riid, void **
|
||||
|
||||
WrappedID3D11Fence *wrapped = new WrappedID3D11Fence(ret, this);
|
||||
|
||||
*ppFence = (void *)wrapped;
|
||||
*ppFence = (ID3D11Fence *)wrapped;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -364,6 +364,8 @@ ResourceId GetIDForDeviceChild(ID3D11DeviceChild *ptr)
|
||||
return ((WrappedID3D11CommandList *)ptr)->GetResourceID();
|
||||
if(WrappedID3DDeviceContextState::IsAlloc(ptr))
|
||||
return ((WrappedID3DDeviceContextState *)ptr)->GetResourceID();
|
||||
if(WrappedID3D11Fence::IsAlloc(ptr))
|
||||
return ((WrappedID3D11Fence *)ptr)->GetResourceID();
|
||||
|
||||
RDCERR("Unknown type for ptr 0x%p", ptr);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user