summaryrefslogtreecommitdiffstats
path: root/src/video_core/query_cache.h
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2023-12-25 07:32:16 +0100
committerLiam <byteslice@airmail.cc>2024-01-19 03:12:30 +0100
commit0a2536a0df1f4aea406f2132d3edda0430acc9d1 (patch)
treec0ad53890581c9c7e180c5ccb3b66e3c63e3ba64 /src/video_core/query_cache.h
parentSMMU: Implement backing CPU page protect/unprotect (diff)
downloadyuzu-0a2536a0df1f4aea406f2132d3edda0430acc9d1.tar
yuzu-0a2536a0df1f4aea406f2132d3edda0430acc9d1.tar.gz
yuzu-0a2536a0df1f4aea406f2132d3edda0430acc9d1.tar.bz2
yuzu-0a2536a0df1f4aea406f2132d3edda0430acc9d1.tar.lz
yuzu-0a2536a0df1f4aea406f2132d3edda0430acc9d1.tar.xz
yuzu-0a2536a0df1f4aea406f2132d3edda0430acc9d1.tar.zst
yuzu-0a2536a0df1f4aea406f2132d3edda0430acc9d1.zip
Diffstat (limited to 'src/video_core/query_cache.h')
-rw-r--r--src/video_core/query_cache.h29
1 files changed, 16 insertions, 13 deletions
diff --git a/src/video_core/query_cache.h b/src/video_core/query_cache.h
index a64404ce4..b01d843e4 100644
--- a/src/video_core/query_cache.h
+++ b/src/video_core/query_cache.h
@@ -21,6 +21,7 @@
#include "core/memory.h"
#include "video_core/control/channel_state_cache.h"
#include "video_core/engines/maxwell_3d.h"
+#include "video_core/host1x/gpu_device_memory_manager.h"
#include "video_core/memory_manager.h"
#include "video_core/rasterizer_interface.h"
#include "video_core/texture_cache/slot_vector.h"
@@ -102,18 +103,19 @@ template <class QueryCache, class CachedQuery, class CounterStream, class HostCo
class QueryCacheLegacy : public VideoCommon::ChannelSetupCaches<VideoCommon::ChannelInfo> {
public:
explicit QueryCacheLegacy(VideoCore::RasterizerInterface& rasterizer_,
- Core::Memory::Memory& cpu_memory_)
+ Tegra::MaxwellDeviceMemoryManager& device_memory_)
: rasterizer{rasterizer_},
// Use reinterpret_cast instead of static_cast as workaround for
// UBSan bug (https://github.com/llvm/llvm-project/issues/59060)
- cpu_memory{cpu_memory_}, streams{{
- {CounterStream{reinterpret_cast<QueryCache&>(*this),
- VideoCore::QueryType::SamplesPassed}},
- {CounterStream{reinterpret_cast<QueryCache&>(*this),
- VideoCore::QueryType::PrimitivesGenerated}},
- {CounterStream{reinterpret_cast<QueryCache&>(*this),
- VideoCore::QueryType::TfbPrimitivesWritten}},
- }} {
+ device_memory{device_memory_},
+ streams{{
+ {CounterStream{reinterpret_cast<QueryCache&>(*this),
+ VideoCore::QueryType::SamplesPassed}},
+ {CounterStream{reinterpret_cast<QueryCache&>(*this),
+ VideoCore::QueryType::PrimitivesGenerated}},
+ {CounterStream{reinterpret_cast<QueryCache&>(*this),
+ VideoCore::QueryType::TfbPrimitivesWritten}},
+ }} {
(void)slot_async_jobs.insert(); // Null value
}
@@ -322,13 +324,14 @@ private:
local_lock.unlock();
if (timestamp) {
u64 timestamp_value = *timestamp;
- cpu_memory.WriteBlockUnsafe(address + sizeof(u64), &timestamp_value, sizeof(u64));
- cpu_memory.WriteBlockUnsafe(address, &value, sizeof(u64));
+ device_memory.WriteBlockUnsafe(address + sizeof(u64), &timestamp_value,
+ sizeof(u64));
+ device_memory.WriteBlockUnsafe(address, &value, sizeof(u64));
rasterizer.InvalidateRegion(address, sizeof(u64) * 2,
VideoCommon::CacheType::NoQueryCache);
} else {
u32 small_value = static_cast<u32>(value);
- cpu_memory.WriteBlockUnsafe(address, &small_value, sizeof(u32));
+ device_memory.WriteBlockUnsafe(address, &small_value, sizeof(u32));
rasterizer.InvalidateRegion(address, sizeof(u32),
VideoCommon::CacheType::NoQueryCache);
}
@@ -342,7 +345,7 @@ private:
SlotVector<AsyncJob> slot_async_jobs;
VideoCore::RasterizerInterface& rasterizer;
- Core::Memory::Memory& cpu_memory;
+ Tegra::MaxwellDeviceMemoryManager& device_memory;
mutable std::recursive_mutex mutex;