summaryrefslogtreecommitdiffstats
path: root/src/video_core
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2023-08-22 17:44:03 +0200
committerFernando Sahmkow <fsahmkow27@gmail.com>2023-09-23 23:05:30 +0200
commitbf0d6b8806b7367a17bbeb2bb59f4bcba1fb1375 (patch)
tree2012a0e626ed675a2962e843693fc93be899fede /src/video_core
parentQuery Cache: Simplify Prefix Sum compute shader (diff)
downloadyuzu-bf0d6b8806b7367a17bbeb2bb59f4bcba1fb1375.tar
yuzu-bf0d6b8806b7367a17bbeb2bb59f4bcba1fb1375.tar.gz
yuzu-bf0d6b8806b7367a17bbeb2bb59f4bcba1fb1375.tar.bz2
yuzu-bf0d6b8806b7367a17bbeb2bb59f4bcba1fb1375.tar.lz
yuzu-bf0d6b8806b7367a17bbeb2bb59f4bcba1fb1375.tar.xz
yuzu-bf0d6b8806b7367a17bbeb2bb59f4bcba1fb1375.tar.zst
yuzu-bf0d6b8806b7367a17bbeb2bb59f4bcba1fb1375.zip
Diffstat (limited to 'src/video_core')
-rw-r--r--src/video_core/query_cache/query_cache.h13
-rw-r--r--src/video_core/renderer_vulkan/vk_query_cache.cpp10
2 files changed, 23 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
u8* pointer = impl->cpu_memory.GetPointer(cpu_addr);
u8* pointer_timestamp = impl->cpu_memory.GetPointer(cpu_addr + 8);
bool is_synced = !Settings::IsGPULevelHigh() && is_fence;
+
std::function<void()> operation([this, is_synced, streamer, query_base = query, query_location,
pointer, pointer_timestamp] {
if (True(query_base->flags & QueryFlagBits::IsInvalidated)) {
@@ -285,6 +286,18 @@ void QueryCacheBase<Traits>::CounterReport(GPUVAddr addr, QueryType counter_type
if (is_fence) {
impl->rasterizer.SignalFence(std::move(operation));
} else {
+ if (!Settings::IsGPULevelHigh() && counter_type == QueryType::Payload) {
+ if (has_timestamp) {
+ u64 timestamp = impl->gpu.GetTicks();
+ u64 value = static_cast<u64>(payload);
+ std::memcpy(pointer_timestamp, &timestamp, sizeof(timestamp));
+ std::memcpy(pointer, &value, sizeof(value));
+ } else {
+ std::memcpy(pointer, &payload, sizeof(payload));
+ }
+ streamer->Free(new_query_id);
+ return;
+ }
impl->rasterizer.SyncOperation(std::move(operation));
}
if (is_synced) {
diff --git a/src/video_core/renderer_vulkan/vk_query_cache.cpp b/src/video_core/renderer_vulkan/vk_query_cache.cpp
index 825e1a72e..2cc007716 100644
--- a/src/video_core/renderer_vulkan/vk_query_cache.cpp
+++ b/src/video_core/renderer_vulkan/vk_query_cache.cpp
@@ -1365,6 +1365,11 @@ bool QueryCacheRuntime::HostConditionalRenderingCompareValues(VideoCommon::Looku
return false;
}
+ const bool is_gpu_high = Settings::IsGPULevelHigh();
+ if (!is_gpu_high && impl->device.GetDriverID() == VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS) {
+ return true;
+ }
+
for (size_t i = 0; i < 2; i++) {
is_null[i] = !is_in_ac[i] && check_value(objects[i]->address);
}
@@ -1376,6 +1381,11 @@ bool QueryCacheRuntime::HostConditionalRenderingCompareValues(VideoCommon::Looku
return true;
}
}
+
+ if (!is_gpu_high) {
+ return true;
+ }
+
if (!is_in_bc[0] && !is_in_bc[1]) {
// Both queries are in query cache, it's best to just flush.
return true;