Commit 8546d4e7 by Ben Clayton

VkQueue: Use a sw::WaitGroup for waitIdle()

Don't (ab)use vk::Fence for its start() finish() events. sw::WaitGroup shares the same interface, so use that. Allows vk::Fence to have its destructor deleted again. Bug: b/133127573 Change-Id: I747ea6965bf85343c720235083b309d8b855a950 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/31684Tested-by: 's avatarBen Clayton <bclayton@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com> Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com>
parent bd0ab1be
...@@ -75,6 +75,7 @@ public: ...@@ -75,6 +75,7 @@ public:
private: private:
Fence(const Fence&) = delete; Fence(const Fence&) = delete;
~Fence() = delete;
Fence& operator = (const Fence&) = delete; Fence& operator = (const Fence&) = delete;
sw::WaitGroup wg; sw::WaitGroup wg;
......
...@@ -183,14 +183,14 @@ void Queue::taskLoop() ...@@ -183,14 +183,14 @@ void Queue::taskLoop()
VkResult Queue::waitIdle() VkResult Queue::waitIdle()
{ {
// Wait for task queue to flush. // Wait for task queue to flush.
vk::Fence fence; sw::WaitGroup wg;
fence.start(); wg.add();
Task task; Task task;
task.events = &fence; task.events = &wg;
pending.put(task); pending.put(task);
fence.wait(); wg.wait();
garbageCollect(); garbageCollect();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment