diff options
Diffstat (limited to 'src/video_core/query_cache.h')
| -rw-r--r-- | src/video_core/query_cache.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/video_core/query_cache.h b/src/video_core/query_cache.h index 2f75f8801..e12dab899 100644 --- a/src/video_core/query_cache.h +++ b/src/video_core/query_cache.h | |||
| @@ -220,8 +220,8 @@ private: | |||
| 220 | return cache_begin < addr_end && addr_begin < cache_end; | 220 | return cache_begin < addr_end && addr_begin < cache_end; |
| 221 | }; | 221 | }; |
| 222 | 222 | ||
| 223 | const u64 page_end = addr_end >> PAGE_SHIFT; | 223 | const u64 page_end = addr_end >> PAGE_BITS; |
| 224 | for (u64 page = addr_begin >> PAGE_SHIFT; page <= page_end; ++page) { | 224 | for (u64 page = addr_begin >> PAGE_BITS; page <= page_end; ++page) { |
| 225 | const auto& it = cached_queries.find(page); | 225 | const auto& it = cached_queries.find(page); |
| 226 | if (it == std::end(cached_queries)) { | 226 | if (it == std::end(cached_queries)) { |
| 227 | continue; | 227 | continue; |
| @@ -242,14 +242,14 @@ private: | |||
| 242 | /// Registers the passed parameters as cached and returns a pointer to the stored cached query. | 242 | /// Registers the passed parameters as cached and returns a pointer to the stored cached query. |
| 243 | CachedQuery* Register(VideoCore::QueryType type, VAddr cpu_addr, u8* host_ptr, bool timestamp) { | 243 | CachedQuery* Register(VideoCore::QueryType type, VAddr cpu_addr, u8* host_ptr, bool timestamp) { |
| 244 | rasterizer.UpdatePagesCachedCount(cpu_addr, CachedQuery::SizeInBytes(timestamp), 1); | 244 | rasterizer.UpdatePagesCachedCount(cpu_addr, CachedQuery::SizeInBytes(timestamp), 1); |
| 245 | const u64 page = static_cast<u64>(cpu_addr) >> PAGE_SHIFT; | 245 | const u64 page = static_cast<u64>(cpu_addr) >> PAGE_BITS; |
| 246 | return &cached_queries[page].emplace_back(static_cast<QueryCache&>(*this), type, cpu_addr, | 246 | return &cached_queries[page].emplace_back(static_cast<QueryCache&>(*this), type, cpu_addr, |
| 247 | host_ptr); | 247 | host_ptr); |
| 248 | } | 248 | } |
| 249 | 249 | ||
| 250 | /// Tries to a get a cached query. Returns nullptr on failure. | 250 | /// Tries to a get a cached query. Returns nullptr on failure. |
| 251 | CachedQuery* TryGet(VAddr addr) { | 251 | CachedQuery* TryGet(VAddr addr) { |
| 252 | const u64 page = static_cast<u64>(addr) >> PAGE_SHIFT; | 252 | const u64 page = static_cast<u64>(addr) >> PAGE_BITS; |
| 253 | const auto it = cached_queries.find(page); | 253 | const auto it = cached_queries.find(page); |
| 254 | if (it == std::end(cached_queries)) { | 254 | if (it == std::end(cached_queries)) { |
| 255 | return nullptr; | 255 | return nullptr; |
| @@ -268,7 +268,7 @@ private: | |||
| 268 | } | 268 | } |
| 269 | 269 | ||
| 270 | static constexpr std::uintptr_t PAGE_SIZE = 4096; | 270 | static constexpr std::uintptr_t PAGE_SIZE = 4096; |
| 271 | static constexpr unsigned PAGE_SHIFT = 12; | 271 | static constexpr unsigned PAGE_BITS = 12; |
| 272 | 272 | ||
| 273 | Core::System& system; | 273 | Core::System& system; |
| 274 | VideoCore::RasterizerInterface& rasterizer; | 274 | VideoCore::RasterizerInterface& rasterizer; |