A lightweight background submission system used by Lysa to build and submit GPU command lists asynchronously. It owns a worker thread that drains a queue of recorded commands and submits them to the appropriate Vireo submit queue (transfer or graphic), allowing asset uploads and simple GPU work to happen without stalling the main thread.
Typical usage:
- Call beginCommand() to acquire a command list for a specific CommandType.
- Record GPU work (e.g., copies, barriers) on the returned command list.
- Call endCommand() to enqueue the work; optionally set immediate=true to trigger an immediate submit when appropriate.
- The internal worker thread will batch and submit pending commands.
Thread-safety:
- Public methods are thread-safe unless otherwise specified. Internals are protected via mutexes. Commands and temporary buffers are tracked per command list to avoid premature destruction.
|
| | AsyncQueue (const std::shared_ptr< vireo::Vireo > &vireo, const std::shared_ptr< vireo::SubmitQueue > &transferQueue, const std::shared_ptr< vireo::SubmitQueue > &graphicQueue) |
| |
| void | cleanup () |
| |
| Command | beginCommand (vireo::CommandType commandType, const std::source_location &location=std::source_location::current ()) |
| |
| void | endCommand (const Command &command, bool immediate=false) |
| |
| void | submitCommands () |
| |
| std::shared_ptr< vireo::Buffer > | createBuffer (const Command &command, vireo::BufferType type, size_t instanceSize, uint32 instanceCount) |
| |
| | AsyncQueue (const AsyncQueue &) = delete |
| |
| AsyncQueue & | operator= (const AsyncQueue &) = delete |
| |