diff options
| author | 2023-08-22 17:44:03 +0200 | |
|---|---|---|
| committer | 2023-09-23 23:05:30 +0200 | |
| commit | bf0d6b8806b7367a17bbeb2bb59f4bcba1fb1375 (patch) | |
| tree | 2012a0e626ed675a2962e843693fc93be899fede /src/video_core/query_cache | |
| parent | Query Cache: Simplify Prefix Sum compute shader (diff) | |
| download | yuzu-bf0d6b8806b7367a17bbeb2bb59f4bcba1fb1375.tar.gz yuzu-bf0d6b8806b7367a17bbeb2bb59f4bcba1fb1375.tar.xz yuzu-bf0d6b8806b7367a17bbeb2bb59f4bcba1fb1375.zip | |
Query Cache: Fix behavior in Normal Accuracy
Diffstat (limited to 'src/video_core/query_cache')
| -rw-r--r-- | src/video_core/query_cache/query_cache.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/video_core/query_cache/query_cache.h b/src/video_core/query_cache/query_cache.h index 4b89b5bf6..78b42b518 100644 --- a/src/video_core/query_cache/query_cache.h +++ b/src/video_core/query_cache/query_cache.h | |||
| @@ -256,6 +256,7 @@ void QueryCacheBase<Traits>::CounterReport(GPUVAddr addr, QueryType counter_type | |||
| 256 | u8* pointer = impl->cpu_memory.GetPointer(cpu_addr); | 256 | u8* pointer = impl->cpu_memory.GetPointer(cpu_addr); |
| 257 | u8* pointer_timestamp = impl->cpu_memory.GetPointer(cpu_addr + 8); | 257 | u8* pointer_timestamp = impl->cpu_memory.GetPointer(cpu_addr + 8); |
| 258 | bool is_synced = !Settings::IsGPULevelHigh() && is_fence; | 258 | bool is_synced = !Settings::IsGPULevelHigh() && is_fence; |
| 259 | |||
| 259 | std::function<void()> operation([this, is_synced, streamer, query_base = query, query_location, | 260 | std::function<void()> operation([this, is_synced, streamer, query_base = query, query_location, |
| 260 | pointer, pointer_timestamp] { | 261 | pointer, pointer_timestamp] { |
| 261 | if (True(query_base->flags & QueryFlagBits::IsInvalidated)) { | 262 | if (True(query_base->flags & QueryFlagBits::IsInvalidated)) { |
| @@ -285,6 +286,18 @@ void QueryCacheBase<Traits>::CounterReport(GPUVAddr addr, QueryType counter_type | |||
| 285 | if (is_fence) { | 286 | if (is_fence) { |
| 286 | impl->rasterizer.SignalFence(std::move(operation)); | 287 | impl->rasterizer.SignalFence(std::move(operation)); |
| 287 | } else { | 288 | } else { |
| 289 | if (!Settings::IsGPULevelHigh() && counter_type == QueryType::Payload) { | ||
| 290 | if (has_timestamp) { | ||
| 291 | u64 timestamp = impl->gpu.GetTicks(); | ||
| 292 | u64 value = static_cast<u64>(payload); | ||
| 293 | std::memcpy(pointer_timestamp, ×tamp, sizeof(timestamp)); | ||
| 294 | std::memcpy(pointer, &value, sizeof(value)); | ||
| 295 | } else { | ||
| 296 | std::memcpy(pointer, &payload, sizeof(payload)); | ||
| 297 | } | ||
| 298 | streamer->Free(new_query_id); | ||
| 299 | return; | ||
| 300 | } | ||
| 288 | impl->rasterizer.SyncOperation(std::move(operation)); | 301 | impl->rasterizer.SyncOperation(std::move(operation)); |
| 289 | } | 302 | } |
| 290 | if (is_synced) { | 303 | if (is_synced) { |