mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-23 23:32:44 +01:00
vk_query_cache: Wait before reading queries
This commit is contained in:
parent
a515036604
commit
56c47951c5
1 changed files with 2 additions and 9 deletions
|
@ -114,17 +114,10 @@ void HostCounter::EndQuery() {
|
||||||
}
|
}
|
||||||
|
|
||||||
u64 HostCounter::BlockingQuery() const {
|
u64 HostCounter::BlockingQuery() const {
|
||||||
auto& scheduler{cache.GetScheduler()};
|
cache.GetScheduler().Wait(tick);
|
||||||
if (tick >= scheduler.CurrentTick()) {
|
|
||||||
scheduler.Flush();
|
|
||||||
// This may not be necessary, but it's better to play it safe and assume drivers don't
|
|
||||||
// support wait before signal on vkGetQueryPoolResults
|
|
||||||
scheduler.WaitWorker();
|
|
||||||
}
|
|
||||||
u64 data;
|
u64 data;
|
||||||
const VkResult query_result = cache.GetDevice().GetLogical().GetQueryResults(
|
const VkResult query_result = cache.GetDevice().GetLogical().GetQueryResults(
|
||||||
query.first, query.second, 1, sizeof(data), &data, sizeof(data),
|
query.first, query.second, 1, sizeof(data), &data, sizeof(data), VK_QUERY_RESULT_64_BIT);
|
||||||
VK_QUERY_RESULT_64_BIT | VK_QUERY_RESULT_WAIT_BIT);
|
|
||||||
|
|
||||||
switch (query_result) {
|
switch (query_result) {
|
||||||
case VK_SUCCESS:
|
case VK_SUCCESS:
|
||||||
|
|
Loading…
Reference in a new issue