summaryrefslogtreecommitdiffstats
path: root/src/video_core/query_cache
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2024-01-07 05:33:43 +0100
committerLiam <byteslice@airmail.cc>2024-01-19 03:12:30 +0100
commit23430e67724d803184b6a861e4bcb3cac0e38cb0 (patch)
tree5d0b3dfc7175434f66d0dfb32f1d0bfa597013c4 /src/video_core/query_cache
parentSMMU: Fix Right Shift UB. (diff)
downloadyuzu-23430e67724d803184b6a861e4bcb3cac0e38cb0.tar
yuzu-23430e67724d803184b6a861e4bcb3cac0e38cb0.tar.gz
yuzu-23430e67724d803184b6a861e4bcb3cac0e38cb0.tar.bz2
yuzu-23430e67724d803184b6a861e4bcb3cac0e38cb0.tar.lz
yuzu-23430e67724d803184b6a861e4bcb3cac0e38cb0.tar.xz
yuzu-23430e67724d803184b6a861e4bcb3cac0e38cb0.tar.zst
yuzu-23430e67724d803184b6a861e4bcb3cac0e38cb0.zip
Diffstat (limited to 'src/video_core/query_cache')
-rw-r--r--src/video_core/query_cache/query_cache.h15
-rw-r--r--src/video_core/query_cache/query_cache_base.h7
2 files changed, 10 insertions, 12 deletions
diff --git a/src/video_core/query_cache/query_cache.h b/src/video_core/query_cache/query_cache.h
index b5e90cf8c..08b779055 100644
--- a/src/video_core/query_cache/query_cache.h
+++ b/src/video_core/query_cache/query_cache.h
@@ -15,7 +15,6 @@
#include "common/logging/log.h"
#include "common/scope_exit.h"
#include "common/settings.h"
-#include "core/memory.h"
#include "video_core/engines/maxwell_3d.h"
#include "video_core/gpu.h"
#include "video_core/host1x/gpu_device_memory_manager.h"
@@ -253,8 +252,8 @@ void QueryCacheBase<Traits>::CounterReport(GPUVAddr addr, QueryType counter_type
query_location.stream_id.Assign(static_cast<u32>(streamer_id));
query_location.query_id.Assign(static_cast<u32>(new_query_id));
const auto gen_caching_indexing = [](VAddr cur_addr) {
- return std::make_pair<u64, u32>(cur_addr >> Core::Memory::YUZU_PAGEBITS,
- static_cast<u32>(cur_addr & Core::Memory::YUZU_PAGEMASK));
+ return std::make_pair<u64, u32>(cur_addr >> Core::DEVICE_PAGEBITS,
+ static_cast<u32>(cur_addr & Core::DEVICE_PAGEMASK));
};
u8* pointer = impl->device_memory.template GetPointer<u8>(cpu_addr);
u8* pointer_timestamp = impl->device_memory.template GetPointer<u8>(cpu_addr + 8);
@@ -325,8 +324,8 @@ void QueryCacheBase<Traits>::CounterReport(GPUVAddr addr, QueryType counter_type
template <typename Traits>
void QueryCacheBase<Traits>::UnregisterPending() {
const auto gen_caching_indexing = [](VAddr cur_addr) {
- return std::make_pair<u64, u32>(cur_addr >> Core::Memory::YUZU_PAGEBITS,
- static_cast<u32>(cur_addr & Core::Memory::YUZU_PAGEMASK));
+ return std::make_pair<u64, u32>(cur_addr >> Core::DEVICE_PAGEBITS,
+ static_cast<u32>(cur_addr & Core::DEVICE_PAGEMASK));
};
std::scoped_lock lock(cache_mutex);
for (QueryLocation loc : impl->pending_unregister) {
@@ -390,7 +389,7 @@ bool QueryCacheBase<Traits>::AccelerateHostConditionalRendering() {
}
VAddr cpu_addr = *cpu_addr_opt;
std::scoped_lock lock(cache_mutex);
- auto it1 = cached_queries.find(cpu_addr >> Core::Memory::YUZU_PAGEBITS);
+ auto it1 = cached_queries.find(cpu_addr >> Core::DEVICE_PAGEBITS);
if (it1 == cached_queries.end()) {
return VideoCommon::LookupData{
.address = cpu_addr,
@@ -398,10 +397,10 @@ bool QueryCacheBase<Traits>::AccelerateHostConditionalRendering() {
};
}
auto& sub_container = it1->second;
- auto it_current = sub_container.find(cpu_addr & Core::Memory::YUZU_PAGEMASK);
+ auto it_current = sub_container.find(cpu_addr & Core::DEVICE_PAGEMASK);
if (it_current == sub_container.end()) {
- auto it_current_2 = sub_container.find((cpu_addr & Core::Memory::YUZU_PAGEMASK) + 4);
+ auto it_current_2 = sub_container.find((cpu_addr & Core::DEVICE_PAGEMASK) + 4);
if (it_current_2 == sub_container.end()) {
return VideoCommon::LookupData{
.address = cpu_addr,
diff --git a/src/video_core/query_cache/query_cache_base.h b/src/video_core/query_cache/query_cache_base.h
index 3c820b5f2..c12fb75ef 100644
--- a/src/video_core/query_cache/query_cache_base.h
+++ b/src/video_core/query_cache/query_cache_base.h
@@ -13,7 +13,6 @@
#include "common/assert.h"
#include "common/bit_field.h"
#include "common/common_types.h"
-#include "core/memory.h"
#include "video_core/control/channel_state_cache.h"
#include "video_core/host1x/gpu_device_memory_manager.h"
#include "video_core/query_cache/query_base.h"
@@ -123,10 +122,10 @@ protected:
const u64 addr_begin = addr;
const u64 addr_end = addr_begin + size;
- const u64 page_end = addr_end >> Core::Memory::YUZU_PAGEBITS;
+ const u64 page_end = addr_end >> Core::DEVICE_PAGEBITS;
std::scoped_lock lock(cache_mutex);
- for (u64 page = addr_begin >> Core::Memory::YUZU_PAGEBITS; page <= page_end; ++page) {
- const u64 page_start = page << Core::Memory::YUZU_PAGEBITS;
+ for (u64 page = addr_begin >> Core::DEVICE_PAGEBITS; page <= page_end; ++page) {
+ const u64 page_start = page << Core::DEVICE_PAGEBITS;
const auto in_range = [page_start, addr_begin, addr_end](const u32 query_location) {
const u64 cache_begin = page_start + query_location;
const u64 cache_end = cache_begin + sizeof(u32);