aboutsummaryrefslogtreecommitdiff
path: root/src/video_core/query_cache/query_cache.h
diff options
context:
space:
mode:
authorShinmegumi <shinmegumi@eden-emu.dev>2025-07-26 18:12:54 +0200
committercrueter <crueter@eden-emu.dev>2025-07-26 18:12:54 +0200
commitb1f3b568fbbcb41e3fbe3f86f3ba039f050efb15 (patch)
treed9afa941f74818798ced1977935bfc5ed72da6c5 /src/video_core/query_cache/query_cache.h
parentc7c2ed7b46b82ce1fe85a45b32a8fe9de72d3abb (diff)
[vk] Fix query cache leak on missed sync (#131)
Provided by community member, elementary-particle. Submitted as PR by MaranBR. Fixed issues: 1. The queue cache forgot to put the host query into unregister queue if they weren't synced. This will block all the banks from freeing causing a major leak. 2. SamplesQueryCounter is not aligned with renderpass begin/end. This creates invalid queries. 3. Conditional rendering is not turned on/off at the correct location making them invalid. Co-authored-by: Maufeat <sahyno1996@gmail.com> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/131 Co-authored-by: Shinmegumi <shinmegumi@eden-emu.dev> Co-committed-by: Shinmegumi <shinmegumi@eden-emu.dev>
Diffstat (limited to 'src/video_core/query_cache/query_cache.h')
-rw-r--r--src/video_core/query_cache/query_cache.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/video_core/query_cache/query_cache.h b/src/video_core/query_cache/query_cache.h
index 08b7790555..6e084cc079 100644
--- a/src/video_core/query_cache/query_cache.h
+++ b/src/video_core/query_cache/query_cache.h
@@ -1,3 +1,6 @@
+// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
+// SPDX-License-Identifier: GPL-3.0-or-later
+
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
@@ -115,8 +118,8 @@ struct QueryCacheBase<Traits>::QueryCacheBaseImpl {
QueryCacheBaseImpl(QueryCacheBase<Traits>* owner_, VideoCore::RasterizerInterface& rasterizer_,
Tegra::MaxwellDeviceMemoryManager& device_memory_, RuntimeType& runtime_,
Tegra::GPU& gpu_)
- : owner{owner_}, rasterizer{rasterizer_},
- device_memory{device_memory_}, runtime{runtime_}, gpu{gpu_} {
+ : owner{owner_}, rasterizer{rasterizer_}, device_memory{device_memory_}, runtime{runtime_},
+ gpu{gpu_} {
streamer_mask = 0;
for (size_t i = 0; i < static_cast<size_t>(QueryType::MaxQueryTypes); i++) {
streamers[i] = runtime.GetStreamerInterface(static_cast<QueryType>(i));
@@ -267,7 +270,11 @@ void QueryCacheBase<Traits>::CounterReport(GPUVAddr addr, QueryType counter_type
return;
}
if (False(query_base->flags & QueryFlagBits::IsFinalValueSynced)) [[unlikely]] {
- ASSERT(false);
+ LOG_ERROR(HW_GPU,
+ "Query report value not synchronized. Consider increasing GPU accuracy.");
+ if (!is_synced) [[likely]] {
+ impl->pending_unregister.push_back(query_location);
+ }
return;
}
query_base->value += streamer->GetAmendValue();
@@ -370,8 +377,6 @@ void QueryCacheBase<Traits>::NotifySegment(bool resume) {
if (resume) {
impl->runtime.ResumeHostConditionalRendering();
} else {
- CounterClose(VideoCommon::QueryType::ZPassPixelCount64);
- CounterClose(VideoCommon::QueryType::StreamingByteCount);
impl->runtime.PauseHostConditionalRendering();
}
}