40 std::lock_guard<std::mutex> Lock(
Mutex);
43 for (
auto Cmd : NewCommands)
49 assert(
Fences.count(Fence) == 0);
66 std::unique_lock<std::mutex> Lock(
Mutex);
80 if (
Fences.count((
bool *)Cmd))
83 *((
bool *)Cmd) =
true;
109 std::unique_lock<std::mutex> Lock(
Mutex);
void run(Device &Dev) const
Run this command on Dev.
void submit(const std::vector< Command * > &NewCommands, volatile bool *Fence=nullptr)
Submit a batch of commands to the queue.
std::condition_variable StateChanged
Condition variable to signal when queue state has changed.
This file declares the Device class.
Device & Dev
The device that this queue will execute work on.
std::queue< Command * > Commands
The queue of pending commands.
void notifyFenceSignaled()
Notify the device that a fence was signaled.
volatile bool Running
Flag to signal whether the queue thread is active.
~Queue()
Destroy the queue.
This class is a base class for all commands.
void run()
Entry point for background queue thread.
void waitIdle()
Wait until all commands in the queue have completed.
This file declares the Queue class.
A Device instance encapsulates properties and state for the virtual device.
std::set< volatile bool * > Fences
A set of pending fences.
This file declares the Command base class and its subclasses.
std::mutex Mutex
Mutex used to guard queue updates.
Queue(Device &Dev)
Create a queue for the specified device.