mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-14 02:31:12 +00:00
Add convenience overload of GetResIDFromAddr just returning the id
This commit is contained in:
@@ -1213,13 +1213,8 @@ void WrappedID3D12GraphicsCommandList::IASetIndexBuffer(const D3D12_INDEX_BUFFER
|
||||
|
||||
m_ListRecord->AddChunk(scope.Get());
|
||||
if(pView)
|
||||
{
|
||||
ResourceId id;
|
||||
UINT64 offs = 0;
|
||||
WrappedID3D12Resource::GetResIDFromAddr(pView->BufferLocation, id, offs);
|
||||
|
||||
m_ListRecord->MarkResourceFrameReferenced(id, eFrameRef_Read);
|
||||
}
|
||||
m_ListRecord->MarkResourceFrameReferenced(
|
||||
WrappedID3D12Resource::GetResIDFromAddr(pView->BufferLocation), eFrameRef_Read);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1276,13 +1271,8 @@ void WrappedID3D12GraphicsCommandList::IASetVertexBuffers(UINT StartSlot, UINT N
|
||||
|
||||
m_ListRecord->AddChunk(scope.Get());
|
||||
for(UINT i = 0; i < NumViews; i++)
|
||||
{
|
||||
ResourceId id;
|
||||
UINT64 offs = 0;
|
||||
WrappedID3D12Resource::GetResIDFromAddr(pViews[i].BufferLocation, id, offs);
|
||||
|
||||
m_ListRecord->MarkResourceFrameReferenced(id, eFrameRef_Read);
|
||||
}
|
||||
m_ListRecord->MarkResourceFrameReferenced(
|
||||
WrappedID3D12Resource::GetResIDFromAddr(pViews[i].BufferLocation), eFrameRef_Read);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -492,6 +492,17 @@ public:
|
||||
offs = addr - it->start;
|
||||
}
|
||||
|
||||
// overload to just return the id in case the offset isn't needed
|
||||
static ResourceId GetResIDFromAddr(D3D12_GPU_VIRTUAL_ADDRESS addr)
|
||||
{
|
||||
ResourceId id;
|
||||
UINT64 offs;
|
||||
|
||||
GetResIDFromAddr(addr, id, offs);
|
||||
|
||||
return id;
|
||||
}
|
||||
|
||||
enum
|
||||
{
|
||||
TypeEnum = Resource_Resource,
|
||||
|
||||
Reference in New Issue
Block a user