Allocate the arena, releasing any previous buffer.
- Parameters
-
| slot_bytes | Bytes each slot holds |
| usage | Buffer usage, which must be host visible |
| slots | Initial slot count |
- Returns
- True if the buffer is allocated and mapped
Definition at line 35 of file SlotMachine.cpp.
36{
38
39 if (!buffer_service() ||
slot_bytes == 0 || slots == 0) {
41 "SlotArena needs a buffer service, a slot size and at least one slot");
42 return false;
43 }
44
48
51 for (size_t i = 0; i < slots; ++i) {
52 m_uses.push_back(std::make_shared<std::atomic<uint32_t>>(0));
53 }
54
56
59 "SlotArena buffer is not host visible");
61 return false;
62 }
63
64 return true;
65}
#define MF_ERROR(comp, ctx,...)
void release()
Release the buffer once the work submitted so far completes.
std::vector< std::shared_ptr< std::atomic< uint32_t > > > m_uses
size_t slot_bytes() const noexcept
std::shared_ptr< Buffers::VKBuffer > m_buffer
@ BufferManagement
Buffer Management (Buffers::BufferManager, creating buffers).
@ Portal
High-level user-facing API layer.
References MayaFlux::Journal::BufferManagement, m_buffer, m_slot_bytes, m_stride, m_usage, m_uses, MF_ERROR, MayaFlux::Journal::Portal, release(), and slot_bytes().