diff options
| author | 2020-06-17 12:22:09 +0100 | |
|---|---|---|
| committer | 2020-06-18 15:47:43 +0100 | |
| commit | 8ae715454157f4fdc615ee45b914dfa274c3e702 (patch) | |
| tree | f93b7cc9ff1ee745f4eb250c2e31951f0b846332 /src | |
| parent | Merge pull request #4092 from Morph1984/image-bindings (diff) | |
| download | yuzu-8ae715454157f4fdc615ee45b914dfa274c3e702.tar.gz yuzu-8ae715454157f4fdc615ee45b914dfa274c3e702.tar.xz yuzu-8ae715454157f4fdc615ee45b914dfa274c3e702.zip | |
Rename PAGE_SHIFT to PAGE_BITS
macOS header files #define PAGE_SHIFT
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/query_cache.h | 10 | ||||
| -rw-r--r-- | src/video_core/shader_cache.h | 10 |
2 files changed, 10 insertions, 10 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; |
diff --git a/src/video_core/shader_cache.h b/src/video_core/shader_cache.h index a23c23886..2dd270e99 100644 --- a/src/video_core/shader_cache.h +++ b/src/video_core/shader_cache.h | |||
| @@ -19,7 +19,7 @@ namespace VideoCommon { | |||
| 19 | 19 | ||
| 20 | template <class T> | 20 | template <class T> |
| 21 | class ShaderCache { | 21 | class ShaderCache { |
| 22 | static constexpr u64 PAGE_SHIFT = 14; | 22 | static constexpr u64 PAGE_BITS = 14; |
| 23 | 23 | ||
| 24 | struct Entry { | 24 | struct Entry { |
| 25 | VAddr addr_start; | 25 | VAddr addr_start; |
| @@ -87,8 +87,8 @@ protected: | |||
| 87 | const VAddr addr_end = addr + size; | 87 | const VAddr addr_end = addr + size; |
| 88 | Entry* const entry = NewEntry(addr, addr_end, data.get()); | 88 | Entry* const entry = NewEntry(addr, addr_end, data.get()); |
| 89 | 89 | ||
| 90 | const u64 page_end = addr_end >> PAGE_SHIFT; | 90 | const u64 page_end = addr_end >> PAGE_BITS; |
| 91 | for (u64 page = addr >> PAGE_SHIFT; page <= page_end; ++page) { | 91 | for (u64 page = addr >> PAGE_BITS; page <= page_end; ++page) { |
| 92 | invalidation_cache[page].push_back(entry); | 92 | invalidation_cache[page].push_back(entry); |
| 93 | } | 93 | } |
| 94 | 94 | ||
| @@ -108,8 +108,8 @@ private: | |||
| 108 | /// @pre invalidation_mutex is locked | 108 | /// @pre invalidation_mutex is locked |
| 109 | void InvalidatePagesInRegion(VAddr addr, std::size_t size) { | 109 | void InvalidatePagesInRegion(VAddr addr, std::size_t size) { |
| 110 | const VAddr addr_end = addr + size; | 110 | const VAddr addr_end = addr + size; |
| 111 | const u64 page_end = addr_end >> PAGE_SHIFT; | 111 | const u64 page_end = addr_end >> PAGE_BITS; |
| 112 | for (u64 page = addr >> PAGE_SHIFT; page <= page_end; ++page) { | 112 | for (u64 page = addr >> PAGE_BITS; page <= page_end; ++page) { |
| 113 | const auto it = invalidation_cache.find(page); | 113 | const auto it = invalidation_cache.find(page); |
| 114 | if (it == invalidation_cache.end()) { | 114 | if (it == invalidation_cache.end()) { |
| 115 | continue; | 115 | continue; |