Skip to content

Commit f297ece

Browse files
committed
Cleanups for the new command pool system.
2 parents 4548341 + 8839b72 commit f297ece

9 files changed

+307
-387
lines changed

include/nbl/asset/ICommandBuffer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ class NBL_API ICommandBuffer
211211

212212
E_LEVEL getLevel() const { return m_level; }
213213

214-
// hm now i think having begin(), reset() and end() as command buffer API is a little weird
214+
// hm now i think having an ICPUCommandBuffer is weird, maybe we should have a rendergraph
215215

216216
virtual bool begin(core::bitflag<E_USAGE> flags, const SInheritanceInfo* inheritanceInfo = nullptr) = 0;
217217
virtual bool reset(core::bitflag<E_RESET_FLAGS> flags) = 0;

include/nbl/video/IGPUCommandBuffer.h

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -256,9 +256,8 @@ class NBL_API IGPUCommandBuffer :
256256
m_resetCheckedStamp = m_cmdpool->getResetCounter();
257257
m_state = ES_INITIAL;
258258

259-
m_segmentListHeadItr.cmd = nullptr;
260-
m_segmentListHeadItr.segment = nullptr;
261-
m_segmentListTail = nullptr;
259+
m_commandList.head = nullptr;
260+
m_commandList.tail = nullptr;
262261

263262
checkForParentPoolReset_impl();
264263

@@ -267,19 +266,25 @@ class NBL_API IGPUCommandBuffer :
267266

268267
inline void releaseResourcesBackToPool()
269268
{
270-
m_cmdpool->deleteCommandSegmentList(m_segmentListHeadItr, m_segmentListTail);
269+
deleteCommandList();
271270
releaseResourcesBackToPool_impl();
272271
}
273272

273+
inline void deleteCommandList()
274+
{
275+
m_cmdpool->m_commandListPool.deleteList(m_commandList.head);
276+
m_commandList.head = nullptr;
277+
m_commandList.tail = nullptr;
278+
}
279+
274280
uint64_t m_resetCheckedStamp = 0;
275281

276282
// This bound descriptor set record doesn't include the descriptor sets whose layout has _any_ one of its bindings
277283
// created with IGPUDescriptorSetLayout::SBinding::E_CREATE_FLAGS::ECF_UPDATE_AFTER_BIND_BIT
278284
// or IGPUDescriptorSetLayout::SBinding::E_CREATE_FLAGS::ECF_UPDATE_UNUSED_WHILE_PENDING_BIT.
279285
core::unordered_map<const IGPUDescriptorSet*, uint64_t> m_boundDescriptorSetsRecord;
280286

281-
IGPUCommandPool::CCommandSegment::Iterator m_segmentListHeadItr = {};
282-
IGPUCommandPool::CCommandSegment* m_segmentListTail = nullptr;
287+
IGPUCommandPool::CCommandSegmentListPool::SCommandSegmentList m_commandList;
283288
};
284289

285290
}

0 commit comments

Comments
 (0)