diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2023-08-24 03:58:59 +0200 |
---|---|---|
committer | Fernando Sahmkow <fsahmkow27@gmail.com> | 2023-09-23 23:05:30 +0200 |
commit | 57d8cd6c40bbadeb30e7a4792267061cbad4d446 (patch) | |
tree | 4ed8c078eee5983e875e5104cf0ff61242964185 /src/video_core/renderer_vulkan/vk_query_cache.cpp | |
parent | Query Cache: Fix behavior in Normal Accuracy (diff) | |
download | yuzu-57d8cd6c40bbadeb30e7a4792267061cbad4d446.tar yuzu-57d8cd6c40bbadeb30e7a4792267061cbad4d446.tar.gz yuzu-57d8cd6c40bbadeb30e7a4792267061cbad4d446.tar.bz2 yuzu-57d8cd6c40bbadeb30e7a4792267061cbad4d446.tar.lz yuzu-57d8cd6c40bbadeb30e7a4792267061cbad4d446.tar.xz yuzu-57d8cd6c40bbadeb30e7a4792267061cbad4d446.tar.zst yuzu-57d8cd6c40bbadeb30e7a4792267061cbad4d446.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/renderer_vulkan/vk_query_cache.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/video_core/renderer_vulkan/vk_query_cache.cpp b/src/video_core/renderer_vulkan/vk_query_cache.cpp index 2cc007716..a32da3ba3 100644 --- a/src/video_core/renderer_vulkan/vk_query_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_query_cache.cpp @@ -181,7 +181,8 @@ public: }); rasterizer->SyncOperation(std::move(func)); accumulation_since_last_sync = false; - last_accumulation_checkpoint = std::min(last_accumulation_checkpoint, num_slots_used); + first_accumulation_checkpoint = std::min(first_accumulation_checkpoint, num_slots_used); + last_accumulation_checkpoint = std::max(last_accumulation_checkpoint, num_slots_used); } void CloseCounter() override { @@ -285,7 +286,9 @@ public: resolve_buffers.push_back(intermediary_buffer_index); queries_prefix_scan_pass->Run(*accumulation_buffer, *buffers[intermediary_buffer_index], *buffers[resolve_buffer_index], num_slots_used, - std::min(last_accumulation_checkpoint, num_slots_used)); + std::min(first_accumulation_checkpoint, num_slots_used), + last_accumulation_checkpoint); + } else { scheduler.RequestOutsideRenderPassOperationContext(); scheduler.Record([buffer = *accumulation_buffer](vk::CommandBuffer cmdbuf) { @@ -298,7 +301,8 @@ public: rasterizer->SyncOperation(std::move(func)); AbandonCurrentQuery(); num_slots_used = 0; - last_accumulation_checkpoint = std::numeric_limits<size_t>::max(); + first_accumulation_checkpoint = std::numeric_limits<size_t>::max(); + last_accumulation_checkpoint = 0; accumulation_since_last_sync = has_multi_queries; pending_sync.clear(); } @@ -506,7 +510,7 @@ private: template <bool is_resolve> size_t ObtainBuffer(size_t num_needed) { - const size_t log_2 = std::max<size_t>(6U, Common::Log2Ceil64(num_needed)); + const size_t log_2 = std::max<size_t>(11U, Common::Log2Ceil64(num_needed)); if constexpr (is_resolve) { if (resolve_table[log_2] != 0) { return resolve_table[log_2] - 1; @@ -563,6 +567,7 @@ private: VkQueryPool current_query_pool; size_t current_query_id; size_t num_slots_used{}; + size_t first_accumulation_checkpoint{}; size_t last_accumulation_checkpoint{}; bool accumulation_since_last_sync{}; VideoCommon::HostQueryBase* current_query; |