D3D12 placed resources keep a refcount on their heap

This commit is contained in:
baldurk
2021-11-05 12:12:11 +00:00
parent bb3343786b
commit a769f3e253
2 changed files with 7 additions and 1 deletions
@@ -136,6 +136,8 @@ ID3D12DeviceChild *Unwrap(ID3D12DeviceChild *ptr)
WrappedID3D12Resource::~WrappedID3D12Resource()
{
SAFE_RELEASE(m_Heap);
// perform an implicit unmap on release
if(GetResourceRecord())
{
+5 -1
View File
@@ -938,7 +938,11 @@ public:
return this;
}
void SetHeap(ID3D12Heap *heap) { m_Heap = (WrappedID3D12Heap *)heap; }
void SetHeap(ID3D12Heap *heap)
{
m_Heap = (WrappedID3D12Heap *)heap;
SAFE_ADDREF(m_Heap);
}
static void RefBuffers(D3D12ResourceManager *rm);
static rdcarray<ID3D12Resource *> AddRefBuffersBeforeCapture(D3D12ResourceManager *rm);