mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-12 13:00:32 +00:00
Don't cast command list/queue to TrackedResource - not inherited
This commit is contained in:
@@ -68,13 +68,6 @@ TrackedResource *GetTracked(ID3D12DeviceChild *ptr)
|
||||
|
||||
ALL_D3D12_TYPES;
|
||||
|
||||
if(WrappedID3D12GraphicsCommandList::IsAlloc(ptr))
|
||||
return (TrackedResource *)(WrappedID3D12GraphicsCommandList *)ptr;
|
||||
if(WrappedID3D12CommandQueue::IsAlloc(ptr))
|
||||
return (TrackedResource *)(WrappedID3D12CommandQueue *)ptr;
|
||||
|
||||
RDCERR("Unknown type of ptr 0x%p", ptr);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -109,7 +102,16 @@ ResourceId GetResID(ID3D12DeviceChild *ptr)
|
||||
TrackedResource *res = GetTracked(ptr);
|
||||
|
||||
if(res == NULL)
|
||||
{
|
||||
if(WrappedID3D12GraphicsCommandList::IsAlloc(ptr))
|
||||
return ((WrappedID3D12GraphicsCommandList *)ptr)->GetResourceID();
|
||||
if(WrappedID3D12CommandQueue::IsAlloc(ptr))
|
||||
return ((WrappedID3D12CommandQueue *)ptr)->GetResourceID();
|
||||
|
||||
RDCERR("Unknown type of ptr 0x%p", ptr);
|
||||
|
||||
return ResourceId();
|
||||
}
|
||||
|
||||
return res->GetResourceID();
|
||||
}
|
||||
@@ -123,7 +125,16 @@ D3D12ResourceRecord *GetRecord(ID3D12DeviceChild *ptr)
|
||||
TrackedResource *res = GetTracked(ptr);
|
||||
|
||||
if(res == NULL)
|
||||
{
|
||||
if(WrappedID3D12GraphicsCommandList::IsAlloc(ptr))
|
||||
return ((WrappedID3D12GraphicsCommandList *)ptr)->GetResourceRecord();
|
||||
if(WrappedID3D12CommandQueue::IsAlloc(ptr))
|
||||
return ((WrappedID3D12CommandQueue *)ptr)->GetResourceRecord();
|
||||
|
||||
RDCERR("Unknown type of ptr 0x%p", ptr);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return res->GetResourceRecord();
|
||||
}
|
||||
|
||||
@@ -647,11 +647,6 @@ typename UnwrapHelper<iface>::Outer *GetWrapped(iface *obj)
|
||||
return wrapped;
|
||||
}
|
||||
|
||||
// this function identifies the type by IsAlloc() and returns
|
||||
// the pointer to the TrackedResource interface for fetching ID
|
||||
// or record
|
||||
TrackedResource *GetTracked(ID3D12DeviceChild *ptr);
|
||||
|
||||
template <typename ifaceptr>
|
||||
ifaceptr Unwrap(ifaceptr obj)
|
||||
{
|
||||
@@ -679,7 +674,7 @@ D3D12ResourceRecord *GetRecord(ifaceptr obj)
|
||||
return GetWrapped(obj)->GetResourceRecord();
|
||||
}
|
||||
|
||||
// specialisations that use the GetTracked() function to fetch the ID
|
||||
// specialisations that use the IsAlloc() function to identify the real type
|
||||
template <>
|
||||
ResourceId GetResID(ID3D12DeviceChild *ptr);
|
||||
template <>
|
||||
|
||||
Reference in New Issue
Block a user