Commit ab1e2b49 by Chris Forbes

Unbreak some synchronization edge cases

- Renderer fence signaling only really worked for work in the same submission. If the fence was submitted standalone later, there would be no renderer work tagged with this fence, and so no ordering. - Get rid of old uncounted fence operations. This is a landmine. Bug: b/132897411 Test: dEQP-VK.api.copy_and_blit.* Test: dEQP-VK.binding_model.* Test: dEQP-VK.query_pool.* Test: dEQP-VK.api.object_management.* Test: dEQP-VK.memory.pipeline* Change-Id: I9050b96d111a6c348c5675724c8017c483c06182 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/31188Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com> Tested-by: 's avatarChris Forbes <chrisforbes@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
parent 6cf65f67
...@@ -60,14 +60,6 @@ public: ...@@ -60,14 +60,6 @@ public:
} }
} }
void signal()
{
std::unique_lock<std::mutex> lock(mutex);
status = VK_SUCCESS;
lock.unlock();
condition.notify_all();
}
void reset() void reset()
{ {
std::unique_lock<std::mutex> lock(mutex); std::unique_lock<std::mutex> lock(mutex);
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include "VkQueue.hpp" #include "VkQueue.hpp"
#include "VkSemaphore.hpp" #include "VkSemaphore.hpp"
#include "WSI/VkSwapchainKHR.hpp" #include "WSI/VkSwapchainKHR.hpp"
#include "Device/Renderer.hpp"
#include <cstring> #include <cstring>
...@@ -151,6 +152,9 @@ void Queue::submitQueue(const Task& task) ...@@ -151,6 +152,9 @@ void Queue::submitQueue(const Task& task)
if(task.fence) if(task.fence)
{ {
// TODO: fix renderer signaling so that work submitted separately from (but before) a fence
// is guaranteed complete by the time the fence signals.
renderer->synchronize();
task.fence->done(); task.fence->done();
} }
} }
...@@ -188,9 +192,6 @@ VkResult Queue::waitIdle() ...@@ -188,9 +192,6 @@ VkResult Queue::waitIdle()
fence.wait(); fence.wait();
// Wait for all draw operations to complete, if any
renderer->synchronize();
garbageCollect(); garbageCollect();
return VK_SUCCESS; return VK_SUCCESS;
......
...@@ -193,7 +193,8 @@ VkResult SwapchainKHR::getNextImage(uint64_t timeout, VkSemaphore semaphore, VkF ...@@ -193,7 +193,8 @@ VkResult SwapchainKHR::getNextImage(uint64_t timeout, VkSemaphore semaphore, VkF
if(fence) if(fence)
{ {
vk::Cast(fence)->signal(); vk::Cast(fence)->add();
vk::Cast(fence)->done();
} }
return VK_SUCCESS; return VK_SUCCESS;
......
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