Commit 68e4141b by Chris Forbes

Wait on query being available, not !active.

These are not quite equivalent -- it is possible that we will start waiting before the query begins. Tests: dEQP-VK.query_pool.occlusion_query.get_results_conservative* Change-Id: I66fbe389b5329fbf34ff78cf3cea1078339b2b10 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/30728Tested-by: 's avatarChris Forbes <chrisforbes@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com> Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com>
parent a2457f79
...@@ -75,7 +75,7 @@ namespace vk ...@@ -75,7 +75,7 @@ namespace vk
std::unique_lock<std::mutex> mutexLock(query.mutex); std::unique_lock<std::mutex> mutexLock(query.mutex);
if(flags & VK_QUERY_RESULT_WAIT_BIT) // Must wait for query to finish if(flags & VK_QUERY_RESULT_WAIT_BIT) // Must wait for query to finish
{ {
query.condition.wait(mutexLock, [&query] { return query.state != Query::ACTIVE; }); query.condition.wait(mutexLock, [&query] { return query.state == Query::FINISHED; });
} }
bool writeResult = true; bool writeResult = true;
...@@ -158,8 +158,6 @@ namespace vk ...@@ -158,8 +158,6 @@ namespace vk
{ {
std::unique_lock<std::mutex> mutexLock(pool[i].mutex); std::unique_lock<std::mutex> mutexLock(pool[i].mutex);
ASSERT(pool[i].state != Query::ACTIVE);
pool[i].state = Query::UNAVAILABLE; pool[i].state = Query::UNAVAILABLE;
pool[i].data = 0; pool[i].data = 0;
} }
......
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