Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions src/gpgmm/d3d12/HeapD3D12.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,14 +166,7 @@ namespace gpgmm::d3d12 {

\return Error HRESULT if the specified interface was not represented by the
heap.

\deprecated Use ComPtr<Heap::As instead of Heap::As.
*/
template <typename T>
HRESULT As(Microsoft::WRL::Details::ComPtrRef<ComPtr<T>> ptr) const {
return mPageable.As(ptr);
}

HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void** ppvObject) override;

/** \brief Determine if the heap is resident or not.
Expand Down
35 changes: 0 additions & 35 deletions src/gpgmm/d3d12/ResidencyListD3D12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,39 +52,4 @@ namespace gpgmm::d3d12 {
return "ResidencyList";
}

ResidencySet::ResidencySet() {
GPGMM_TRACE_EVENT_OBJECT_NEW(this);
}

ResidencySet::~ResidencySet() {
GPGMM_TRACE_EVENT_OBJECT_DESTROY(this);
}

HRESULT ResidencySet::Insert(Heap* pHeap) {
if (pHeap == nullptr) {
return E_INVALIDARG;
}
if (mSet.insert(pHeap).second) {
return S_OK;
}
return S_FALSE;
}

HRESULT ResidencySet::Reset() {
mSet.clear();
return S_OK;
}

ResidencySet::UnderlyingType::iterator ResidencySet::begin() const {
return mSet.begin();
}

ResidencySet::UnderlyingType::iterator ResidencySet::end() const {
return mSet.end();
}

const char* ResidencySet::GetTypename() const {
return "ResidencySet";
}

} // namespace gpgmm::d3d12
56 changes: 3 additions & 53 deletions src/gpgmm/d3d12/ResidencyListD3D12.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include "gpgmm/d3d12/d3d12_platform.h"
#include "include/gpgmm_export.h"

#include <set>
#include <vector>

namespace gpgmm::d3d12 {
Expand All @@ -28,7 +27,7 @@ namespace gpgmm::d3d12 {
/** \brief Represents a list of heaps which will be "made resident" when executing a
command-list.

A residency set helps track heaps for residency which will be referenced together by a
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.
Expand All @@ -55,9 +54,9 @@ namespace gpgmm::d3d12 {
*/
HRESULT Add(Heap* pHeap);

/** \brief Reset this residency set.
/** \brief Reset this residency list.

Removes all heaps from the set so the set can be re-used.
Removes all heaps from the list so the list can be re-used.
*/
HRESULT Reset();

Expand All @@ -72,55 +71,6 @@ namespace gpgmm::d3d12 {
UnderlyingType mList;
};

/** \brief Represents a set of heaps which will be "made resident" when executing a
command-list.

A residency set helps track heaps for residency which will be referenced together by a
command-list. The application uses a ResidencySet by inserting heaps, by calling
ResourceAllocation::GetMemory, into the set. Once ResidencyManager::ExecuteCommandLists is
called, the set can be reset or cleared for the next frame.

Without a ResidencySet, the application would need to manually ResidencyManager::LockHeap and
ResidencyManager::UnlockHeap each heap before and after ResidencyManager::ExecuteCommandLists,
respectively.

\deprecated Use ResidencyList instead of ResidencySet.
*/
class GPGMM_EXPORT ResidencySet final {
public:
/** \brief Create a residency set or collection of heaps to manage together for residency.
*/
ResidencySet();
~ResidencySet();

ResidencySet(const ResidencySet&) = default;
ResidencySet& operator=(const ResidencySet&) = default;

/** \brief Insert heap into this residency set.

@param pHeap A pointer to Heap about to be inserted.

\return S_OK if heap was inserted or S_FALSE if heap was already inserted, else error.
*/
HRESULT Insert(Heap* pHeap);

/** \brief Reset this residency set.

Removes all heaps from the set so the set can be re-used.
*/
HRESULT Reset();

using UnderlyingType = std::set<Heap*>;

UnderlyingType::iterator begin() const;
UnderlyingType::iterator end() const;

private:
const char* GetTypename() const;

UnderlyingType mSet;
};

} // namespace gpgmm::d3d12

#endif
24 changes: 0 additions & 24 deletions src/gpgmm/d3d12/ResidencyManagerD3D12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -565,30 +565,6 @@ namespace gpgmm::d3d12 {
return S_OK;
}

/** \brief Execute command lists using residency managed heaps.
*
\deprecated use ResidencyList instead of ResidencySet
*/
HRESULT ResidencyManager::ExecuteCommandLists(ID3D12CommandQueue* pQueue,
ID3D12CommandList* const* ppCommandLists,
ResidencySet* const* ppResidencySets,
uint32_t count) {
ResidencyList residencyList;

// TODO: support multiple command lists.
if (count > 1) {
return E_NOTIMPL;
}

for (Heap* heap : *ppResidencySets[0]) {
residencyList.Add(heap);
}

ResidencyList* residencyListPtr = &residencyList;

return ExecuteCommandLists(pQueue, ppCommandLists, &residencyListPtr, count);
}

// Given a list of heaps that are pending usage, this function will estimate memory needed,
// evict resources until enough space is available, then make resident any heaps scheduled for
// usage.
Expand Down
17 changes: 0 additions & 17 deletions src/gpgmm/d3d12/ResidencyManagerD3D12.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ namespace gpgmm::d3d12 {
class Fence;
class Heap;
class ResidencyList;
class ResidencySet;
class ResourceAllocator;

/** \struct RESIDENCY_DESC
Expand Down Expand Up @@ -193,22 +192,6 @@ namespace gpgmm::d3d12 {
ResidencyList* const* ppResidencyLists,
uint32_t count);

/** \brief Execute command lists using residency managed heaps.

Submits an array of command lists and residency sets for the specified command queue.

@param pQueue The command queue to submit to.
@param ppCommandLists The array of ID3D12CommandList command lists to be executed.
@param ppResidencySets The array of ResidencySet residency sets to make resident.
@param count The size of commandLists and residencyLists arrays.

\deprecated Use ResidencyList instead of ResidencySet.
*/
HRESULT ExecuteCommandLists(ID3D12CommandQueue* pQueue,
ID3D12CommandList* const* ppCommandLists,
ResidencySet* const* ppResidencySets,
uint32_t count);

/** \brief Sets video memory reservation.

A reservation is the lowest amount of physical memory the application need to continue
Expand Down