summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_vulkan/vk_query_cache.cpp
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2020-12-05 17:40:14 +0100
committerLioncash <mathew1800@gmail.com>2020-12-05 22:02:23 +0100
commitf95602f15207851b849c57e2a2dd313a087b2493 (patch)
treeed6122ab0a30de177acb2a59dffc8109232870ec /src/video_core/renderer_vulkan/vk_query_cache.cpp
parentMerge pull request #5133 from lioncash/video-shadow2 (diff)
downloadyuzu-f95602f15207851b849c57e2a2dd313a087b2493.tar
yuzu-f95602f15207851b849c57e2a2dd313a087b2493.tar.gz
yuzu-f95602f15207851b849c57e2a2dd313a087b2493.tar.bz2
yuzu-f95602f15207851b849c57e2a2dd313a087b2493.tar.lz
yuzu-f95602f15207851b849c57e2a2dd313a087b2493.tar.xz
yuzu-f95602f15207851b849c57e2a2dd313a087b2493.tar.zst
yuzu-f95602f15207851b849c57e2a2dd313a087b2493.zip
Diffstat (limited to '')
-rw-r--r--src/video_core/renderer_vulkan/vk_query_cache.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/video_core/renderer_vulkan/vk_query_cache.cpp b/src/video_core/renderer_vulkan/vk_query_cache.cpp
index 6fa071737..038760de3 100644
--- a/src/video_core/renderer_vulkan/vk_query_cache.cpp
+++ b/src/video_core/renderer_vulkan/vk_query_cache.cpp
@@ -69,12 +69,10 @@ void QueryPool::Reserve(std::pair<VkQueryPool, u32> query) {
VKQueryCache::VKQueryCache(VideoCore::RasterizerInterface& rasterizer_,
Tegra::Engines::Maxwell3D& maxwell3d_, Tegra::MemoryManager& gpu_memory_,
const VKDevice& device_, VKScheduler& scheduler_)
- : QueryCacheBase<VKQueryCache, CachedQuery, CounterStream, HostCounter>{rasterizer_, maxwell3d_,
- gpu_memory_},
- device{device_}, scheduler{scheduler_}, query_pools{
- QueryPool{device_, scheduler_,
- QueryType::SamplesPassed},
- } {}
+ : QueryCacheBase{rasterizer_, maxwell3d_, gpu_memory_}, device{device_}, scheduler{scheduler_},
+ query_pools{
+ QueryPool{device_, scheduler_, QueryType::SamplesPassed},
+ } {}
VKQueryCache::~VKQueryCache() {
// TODO(Rodrigo): This is a hack to destroy all HostCounter instances before the base class
@@ -97,8 +95,8 @@ void VKQueryCache::Reserve(QueryType type, std::pair<VkQueryPool, u32> query) {
HostCounter::HostCounter(VKQueryCache& cache_, std::shared_ptr<HostCounter> dependency_,
QueryType type_)
- : HostCounterBase<VKQueryCache, HostCounter>{std::move(dependency_)}, cache{cache_},
- type{type_}, query{cache_.AllocateQuery(type_)}, tick{cache_.Scheduler().CurrentTick()} {
+ : HostCounterBase{std::move(dependency_)}, cache{cache_}, type{type_},
+ query{cache_.AllocateQuery(type_)}, tick{cache_.Scheduler().CurrentTick()} {
const vk::Device* logical = &cache_.Device().GetLogical();
cache_.Scheduler().Record([logical, query = query](vk::CommandBuffer cmdbuf) {
logical->ResetQueryPoolEXT(query.first, query.second, 1);
@@ -119,18 +117,20 @@ u64 HostCounter::BlockingQuery() const {
if (tick >= cache.Scheduler().CurrentTick()) {
cache.Scheduler().Flush();
}
+
u64 data;
- const VkResult result = cache.Device().GetLogical().GetQueryResults(
+ const VkResult query_result = cache.Device().GetLogical().GetQueryResults(
query.first, query.second, 1, sizeof(data), &data, sizeof(data),
VK_QUERY_RESULT_64_BIT | VK_QUERY_RESULT_WAIT_BIT);
- switch (result) {
+
+ switch (query_result) {
case VK_SUCCESS:
return data;
case VK_ERROR_DEVICE_LOST:
cache.Device().ReportLoss();
[[fallthrough]];
default:
- throw vk::Exception(result);
+ throw vk::Exception(query_result);
}
}