From f63b44c9ca9799c7108a8d36cd616aa9c91d790c Mon Sep 17 00:00:00 2001 From: xbzk Date: Tue, 17 Feb 2026 22:18:39 -0300 Subject: [PATCH] payload based fence sync --- src/video_core/query_cache/query_cache.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/video_core/query_cache/query_cache.h b/src/video_core/query_cache/query_cache.h index 3aeeb8dcab..47890abfcf 100644 --- a/src/video_core/query_cache/query_cache.h +++ b/src/video_core/query_cache/query_cache.h @@ -260,7 +260,8 @@ void QueryCacheBase::CounterReport(GPUVAddr addr, QueryType counter_type }; u8* pointer = impl->device_memory.template GetPointer(cpu_addr); u8* pointer_timestamp = impl->device_memory.template GetPointer(cpu_addr + 8); - bool is_synced = !Settings::IsGPULevelHigh() && is_fence; + const bool is_payload = counter_type == QueryType::Payload; + const bool is_synced = !(Settings::getDebugKnobAt(0) && is_payload) && !Settings::IsGPULevelHigh() && is_fence; std::function operation([this, is_synced, streamer, query_base = query, query_location, pointer, pointer_timestamp] { if (True(query_base->flags & QueryFlagBits::IsInvalidated)) { @@ -292,9 +293,15 @@ void QueryCacheBase::CounterReport(GPUVAddr addr, QueryType counter_type } }); if (is_fence) { - impl->rasterizer.SignalFence(std::move(operation)); + if (Settings::getDebugKnobAt(0) && is_payload) { + impl->rasterizer.SyncOperation(std::move(operation)); + std::function noop([] {}); + impl->rasterizer.SignalFence(std::move(noop)); + } else { + impl->rasterizer.SignalFence(std::move(operation)); + } } else { - if (!Settings::IsGPULevelHigh() && counter_type == QueryType::Payload) { + if (!Settings::IsGPULevelHigh() && is_payload) { if (has_timestamp) { u64 timestamp = impl->gpu.GetTicks(); u64 value = static_cast(payload);