From e6013cfc58112a8867a5cb8e4456fd48c2b719a6 Mon Sep 17 00:00:00 2001 From: Bryan Bernhart Date: Thu, 25 Aug 2022 11:51:00 -0700 Subject: [PATCH] Move ResidencyList::Begin/End into private section. Avoids requiring to be apart of the public interface of ResidencyList. --- src/gpgmm/d3d12/ResidencyListD3D12.h | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/gpgmm/d3d12/ResidencyListD3D12.h b/src/gpgmm/d3d12/ResidencyListD3D12.h index 30a46fdc7..dbccf430d 100644 --- a/src/gpgmm/d3d12/ResidencyListD3D12.h +++ b/src/gpgmm/d3d12/ResidencyListD3D12.h @@ -23,18 +23,20 @@ namespace gpgmm::d3d12 { class Heap; + class JSONSerializer; + class ResidencyManager; - /** \brief Represents a list of heaps which will be "made resident" when executing a + /** \brief Represents a list of heaps which will be "made resident" upon executing a command-list. A residency list helps track heaps for residency which will be referenced together by a command-list. The application uses a ResidencyList by inserting heaps, by calling ResourceAllocation::GetMemory, into the list. Once ResidencyManager::ExecuteCommandLists is - called, the list can be reset or cleared for the next frame. + called, the list can be reset or cleared for the next frame or compute job. - Without a ResidencyList, the application would need to manually ResidencyManager::LockHeap and - ResidencyManager::UnlockHeap each heap before and after ResidencyManager::ExecuteCommandLists, - respectively. + Without ResidencyList, the application would need to call ResidencyManager::LockHeap and + ResidencyManager::UnlockHeap for each heap before and after every GPU command or command-list + being executed. */ class GPGMM_EXPORT ResidencyList final { public: @@ -60,12 +62,15 @@ namespace gpgmm::d3d12 { */ HRESULT Reset(); + private: + friend JSONSerializer; + friend ResidencyManager; + using UnderlyingType = std::vector; UnderlyingType::const_iterator begin() const; UnderlyingType::const_iterator end() const; - private: const char* GetTypename() const; UnderlyingType mList;