yuzu-emu
/
yuzu-mainline
Archived
1
0
Fork 0

video_core: renderer_vulkan: vk_query_cache: Avoid shutdown crash in QueryPool::Reserve.

This commit is contained in:
bunnei 2022-09-10 23:59:34 -07:00
parent 1baedfa12c
commit d00245d444
1 changed files with 4 additions and 3 deletions

View File

@ -59,11 +59,12 @@ void QueryPool::Reserve(std::pair<VkQueryPool, u32> query) {
std::find_if(pools.begin(), pools.end(), [query_pool = query.first](vk::QueryPool& pool) { std::find_if(pools.begin(), pools.end(), [query_pool = query.first](vk::QueryPool& pool) {
return query_pool == *pool; return query_pool == *pool;
}); });
ASSERT(it != std::end(pools));
if (it != std::end(pools)) {
const std::ptrdiff_t pool_index = std::distance(std::begin(pools), it); const std::ptrdiff_t pool_index = std::distance(std::begin(pools), it);
usage[pool_index * GROW_STEP + static_cast<std::ptrdiff_t>(query.second)] = false; usage[pool_index * GROW_STEP + static_cast<std::ptrdiff_t>(query.second)] = false;
} }
}
QueryCache::QueryCache(VideoCore::RasterizerInterface& rasterizer_, const Device& device_, QueryCache::QueryCache(VideoCore::RasterizerInterface& rasterizer_, const Device& device_,
Scheduler& scheduler_) Scheduler& scheduler_)