d3d12: Fix unneeeded vectors
This commit is contained in:
@@ -79,28 +79,12 @@ void D3D12GSRender::ResourceStorage::Reset()
|
|||||||
m_frameFinishedFence = nullptr;
|
m_frameFinishedFence = nullptr;
|
||||||
m_frameFinishedHandle = 0;
|
m_frameFinishedHandle = 0;
|
||||||
|
|
||||||
for (auto &tmp : m_inUseConstantsBuffers)
|
|
||||||
SAFE_RELEASE(std::get<2>(tmp));
|
|
||||||
for (auto &tmp : m_inUseVertexIndexBuffers)
|
|
||||||
SAFE_RELEASE(std::get<2>(tmp));
|
|
||||||
for (auto &tmp : m_inUseTextureUploadBuffers)
|
|
||||||
SAFE_RELEASE(std::get<2>(tmp));
|
|
||||||
for (auto &tmp : m_inUseTexture2D)
|
|
||||||
SAFE_RELEASE(std::get<2>(tmp));
|
|
||||||
m_inUseConstantsBuffers.clear();
|
|
||||||
m_inUseVertexIndexBuffers.clear();
|
|
||||||
m_inUseTextureUploadBuffers.clear();
|
|
||||||
m_inUseTexture2D.clear();
|
|
||||||
|
|
||||||
m_commandAllocator->Reset();
|
m_commandAllocator->Reset();
|
||||||
m_textureUploadCommandAllocator->Reset();
|
m_textureUploadCommandAllocator->Reset();
|
||||||
m_downloadCommandAllocator->Reset();
|
m_downloadCommandAllocator->Reset();
|
||||||
for (ID3D12GraphicsCommandList *gfxCommandList : m_inflightCommandList)
|
for (ID3D12GraphicsCommandList *gfxCommandList : m_inflightCommandList)
|
||||||
gfxCommandList->Release();
|
gfxCommandList->Release();
|
||||||
m_inflightCommandList.clear();
|
m_inflightCommandList.clear();
|
||||||
for (ID3D12Resource *vertexBuffer : m_inflightResources)
|
|
||||||
vertexBuffer->Release();
|
|
||||||
m_inflightResources.clear();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void D3D12GSRender::ResourceStorage::Init(ID3D12Device *device)
|
void D3D12GSRender::ResourceStorage::Init(ID3D12Device *device)
|
||||||
@@ -138,19 +122,8 @@ void D3D12GSRender::ResourceStorage::Init(ID3D12Device *device)
|
|||||||
void D3D12GSRender::ResourceStorage::Release()
|
void D3D12GSRender::ResourceStorage::Release()
|
||||||
{
|
{
|
||||||
// NOTE: Should be released only if no command are in flight !
|
// NOTE: Should be released only if no command are in flight !
|
||||||
for (auto &tmp : m_inUseConstantsBuffers)
|
|
||||||
SAFE_RELEASE(std::get<2>(tmp));
|
|
||||||
for (auto &tmp : m_inUseVertexIndexBuffers)
|
|
||||||
SAFE_RELEASE(std::get<2>(tmp));
|
|
||||||
for (auto &tmp : m_inUseTextureUploadBuffers)
|
|
||||||
SAFE_RELEASE(std::get<2>(tmp));
|
|
||||||
for (auto &tmp : m_inUseTexture2D)
|
|
||||||
SAFE_RELEASE(std::get<2>(tmp));
|
|
||||||
|
|
||||||
m_constantsBufferDescriptorsHeap->Release();
|
m_constantsBufferDescriptorsHeap->Release();
|
||||||
m_scaleOffsetDescriptorHeap->Release();
|
m_scaleOffsetDescriptorHeap->Release();
|
||||||
for (auto &tmp : m_inflightResources)
|
|
||||||
tmp->Release();
|
|
||||||
m_textureDescriptorsHeap->Release();
|
m_textureDescriptorsHeap->Release();
|
||||||
m_samplerDescriptorHeap->Release();
|
m_samplerDescriptorHeap->Release();
|
||||||
for (auto &tmp : m_inflightCommandList)
|
for (auto &tmp : m_inflightCommandList)
|
||||||
|
|||||||
@@ -299,13 +299,6 @@ private:
|
|||||||
ID3D12CommandAllocator *m_downloadCommandAllocator;
|
ID3D12CommandAllocator *m_downloadCommandAllocator;
|
||||||
std::list<ID3D12GraphicsCommandList *> m_inflightCommandList;
|
std::list<ID3D12GraphicsCommandList *> m_inflightCommandList;
|
||||||
|
|
||||||
std::vector<ID3D12Resource *> m_inflightResources;
|
|
||||||
|
|
||||||
std::vector<std::tuple<size_t, size_t, ID3D12Resource *> > m_inUseConstantsBuffers;
|
|
||||||
std::vector<std::tuple<size_t, size_t, ID3D12Resource *> > m_inUseVertexIndexBuffers;
|
|
||||||
std::vector<std::tuple<size_t, size_t, ID3D12Resource *> > m_inUseTextureUploadBuffers;
|
|
||||||
std::vector<std::tuple<size_t, size_t, ID3D12Resource *> > m_inUseTexture2D;
|
|
||||||
|
|
||||||
// Constants storage
|
// Constants storage
|
||||||
ID3D12DescriptorHeap *m_constantsBufferDescriptorsHeap;
|
ID3D12DescriptorHeap *m_constantsBufferDescriptorsHeap;
|
||||||
size_t m_constantsBufferIndex;
|
size_t m_constantsBufferIndex;
|
||||||
|
|||||||
Reference in New Issue
Block a user