diff options
| author | 2022-08-18 16:28:55 -0700 | |
|---|---|---|
| committer | 2022-08-19 16:08:40 -0700 | |
| commit | 14e9de6678dab47625826006f001d5e94dfb2716 (patch) | |
| tree | ddb17512c52f678de96abf6dedf33a02b6a497ec /src/video_core/rasterizer_accelerated.cpp | |
| parent | Merge pull request #8685 from FearlessTobi/multiplayer-part2 (diff) | |
| download | yuzu-14e9de6678dab47625826006f001d5e94dfb2716.tar.gz yuzu-14e9de6678dab47625826006f001d5e94dfb2716.tar.xz yuzu-14e9de6678dab47625826006f001d5e94dfb2716.zip | |
code: dodge PAGE_SIZE #define
Some header files, specifically for OSX and Musl libc define PAGE_SIZE to be a number
This is great except in yuzu we're using PAGE_SIZE as a variable
Specific example
`static constexpr u64 PAGE_SIZE = u64(1) << PAGE_BITS;`
PAGE_SIZE PAGE_BITS PAGE_MASK are all similar variables.
Simply deleted the underscores, and then added YUZU_ prefix
Might be worth noting that there are multiple uses in different classes/namespaces
This list may not be exhaustive
Core::Memory 12 bits (4096)
QueryCacheBase 12 bits
ShaderCache 14 bits (16384)
TextureCache 20 bits (1048576, or 1MB)
Fixes #8779
Diffstat (limited to 'src/video_core/rasterizer_accelerated.cpp')
| -rw-r--r-- | src/video_core/rasterizer_accelerated.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/video_core/rasterizer_accelerated.cpp b/src/video_core/rasterizer_accelerated.cpp index 87a29e144..4a197d65d 100644 --- a/src/video_core/rasterizer_accelerated.cpp +++ b/src/video_core/rasterizer_accelerated.cpp | |||
| @@ -24,8 +24,8 @@ void RasterizerAccelerated::UpdatePagesCachedCount(VAddr addr, u64 size, int del | |||
| 24 | u64 cache_bytes = 0; | 24 | u64 cache_bytes = 0; |
| 25 | 25 | ||
| 26 | std::atomic_thread_fence(std::memory_order_acquire); | 26 | std::atomic_thread_fence(std::memory_order_acquire); |
| 27 | const u64 page_end = Common::DivCeil(addr + size, PAGE_SIZE); | 27 | const u64 page_end = Common::DivCeil(addr + size, YUZU_PAGESIZE); |
| 28 | for (u64 page = addr >> PAGE_BITS; page != page_end; ++page) { | 28 | for (u64 page = addr >> YUZU_PAGEBITS; page != page_end; ++page) { |
| 29 | std::atomic_uint16_t& count = cached_pages.at(page >> 2).Count(page); | 29 | std::atomic_uint16_t& count = cached_pages.at(page >> 2).Count(page); |
| 30 | 30 | ||
| 31 | if (delta > 0) { | 31 | if (delta > 0) { |
| @@ -44,26 +44,27 @@ void RasterizerAccelerated::UpdatePagesCachedCount(VAddr addr, u64 size, int del | |||
| 44 | if (uncache_bytes == 0) { | 44 | if (uncache_bytes == 0) { |
| 45 | uncache_begin = page; | 45 | uncache_begin = page; |
| 46 | } | 46 | } |
| 47 | uncache_bytes += PAGE_SIZE; | 47 | uncache_bytes += YUZU_PAGESIZE; |
| 48 | } else if (uncache_bytes > 0) { | 48 | } else if (uncache_bytes > 0) { |
| 49 | cpu_memory.RasterizerMarkRegionCached(uncache_begin << PAGE_BITS, uncache_bytes, false); | 49 | cpu_memory.RasterizerMarkRegionCached(uncache_begin << YUZU_PAGEBITS, uncache_bytes, |
| 50 | false); | ||
| 50 | uncache_bytes = 0; | 51 | uncache_bytes = 0; |
| 51 | } | 52 | } |
| 52 | if (count.load(std::memory_order::relaxed) == 1 && delta > 0) { | 53 | if (count.load(std::memory_order::relaxed) == 1 && delta > 0) { |
| 53 | if (cache_bytes == 0) { | 54 | if (cache_bytes == 0) { |
| 54 | cache_begin = page; | 55 | cache_begin = page; |
| 55 | } | 56 | } |
| 56 | cache_bytes += PAGE_SIZE; | 57 | cache_bytes += YUZU_PAGESIZE; |
| 57 | } else if (cache_bytes > 0) { | 58 | } else if (cache_bytes > 0) { |
| 58 | cpu_memory.RasterizerMarkRegionCached(cache_begin << PAGE_BITS, cache_bytes, true); | 59 | cpu_memory.RasterizerMarkRegionCached(cache_begin << YUZU_PAGEBITS, cache_bytes, true); |
| 59 | cache_bytes = 0; | 60 | cache_bytes = 0; |
| 60 | } | 61 | } |
| 61 | } | 62 | } |
| 62 | if (uncache_bytes > 0) { | 63 | if (uncache_bytes > 0) { |
| 63 | cpu_memory.RasterizerMarkRegionCached(uncache_begin << PAGE_BITS, uncache_bytes, false); | 64 | cpu_memory.RasterizerMarkRegionCached(uncache_begin << YUZU_PAGEBITS, uncache_bytes, false); |
| 64 | } | 65 | } |
| 65 | if (cache_bytes > 0) { | 66 | if (cache_bytes > 0) { |
| 66 | cpu_memory.RasterizerMarkRegionCached(cache_begin << PAGE_BITS, cache_bytes, true); | 67 | cpu_memory.RasterizerMarkRegionCached(cache_begin << YUZU_PAGEBITS, cache_bytes, true); |
| 67 | } | 68 | } |
| 68 | } | 69 | } |
| 69 | 70 | ||