Fix D3D11.5 fence creation

* Casting directly to void * from the wrong type will cause vtable mismatches
This commit is contained in:
baldurk
2018-11-13 18:30:43 +00:00
parent 785e9a98fc
commit e1d0275b70
3 changed files with 5 additions and 3 deletions
+1 -1
View File
@@ -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);