![]() |
Lysa
0.0
Lysa 3D Engine
|
Base class for all GPU memory arrays
Inheritance diagram for MemoryArray:Classes | |
| struct | RetiredBlock |
Public Member Functions | |
| MemoryBlock | alloc (size_t instanceCount) |
| void | free (const MemoryBlock &bloc) |
| void | retire (const MemoryBlock &bloc, std::vector< std::weak_ptr< const void >> guards) |
| void | collectRetired () |
| void | copyTo (const vireo::CommandList &commandList, const MemoryArray &destination) |
| auto | getBuffer () const |
| virtual | ~MemoryArray () |
| MemoryArray (MemoryArray &) = delete | |
| MemoryArray & | operator= (MemoryArray &) = delete |
Protected Member Functions | |
| void | freeUnlocked (const MemoryBlock &bloc) |
| MemoryArray (const std::shared_ptr< vireo::Vireo > &vireo, size_t instanceSize, size_t instanceCount, vireo::BufferType bufferType, const std::string &name) | |
Protected Attributes | |
| const std::shared_ptr< vireo::Vireo > | vireo |
| const std::string | name |
| const size_t | instanceSize |
| std::shared_ptr< vireo::Buffer > | buffer |
| std::list< MemoryBlock > | freeBlocs |
| std::mutex | mutex |
| std::vector< RetiredBlock > | retiredBlocks |
|
virtual |
|
delete |
|
protected |
| MemoryBlock alloc | ( | size_t | instanceCount | ) |
Allocate a new GPU memory block
| instanceCount | Number of resources instances stored in this memory block |
| void collectRetired | ( | ) |
Reclaim retired allocations whose GPU users have completed.
| void copyTo | ( | const vireo::CommandList & | commandList, |
| const MemoryArray & | destination | ||
| ) |
Copy the entire content of this memory array to another GPU memory array
| commandList | Command list used for the copy operation |
| destination | Destination GPU memory array |
| void free | ( | const MemoryBlock & | bloc | ) |
Free a previously allocated GPU memory block
| bloc | Allocated memory block |
|
protected |
|
inline |
Returns the GPU memory buffer allocated for the entire array
|
delete |
| void retire | ( | const MemoryBlock & | bloc, |
| std::vector< std::weak_ptr< const void >> | guards | ||
| ) |
Retire an allocation until all supplied GPU frame leases expire.
|
protected |
|
protected |
|
protected |
|
mutableprotected |
|
protected |
|
protected |
|
protected |