Add convenience overload of GetResIDFromAddr just returning the id

This commit is contained in:
baldurk
2016-08-06 18:31:45 +02:00
parent 7095c663a2
commit 910940bbae
2 changed files with 15 additions and 14 deletions
@@ -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);
}
}
+11
View File
@@ -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,