diff options
| author | 2024-01-07 05:33:43 +0100 | |
|---|---|---|
| committer | 2024-01-18 21:12:30 -0500 | |
| commit | 23430e67724d803184b6a861e4bcb3cac0e38cb0 (patch) | |
| tree | 5d0b3dfc7175434f66d0dfb32f1d0bfa597013c4 /src | |
| parent | SMMU: Fix Right Shift UB. (diff) | |
| download | yuzu-23430e67724d803184b6a861e4bcb3cac0e38cb0.tar.gz yuzu-23430e67724d803184b6a861e4bcb3cac0e38cb0.tar.xz yuzu-23430e67724d803184b6a861e4bcb3cac0e38cb0.zip | |
Core: Eliminate core/memory dependancies.
Diffstat (limited to 'src')
21 files changed, 46 insertions, 54 deletions
diff --git a/src/core/device_memory_manager.h b/src/core/device_memory_manager.h index cc9fd023f..6311e9ece 100644 --- a/src/core/device_memory_manager.h +++ b/src/core/device_memory_manager.h | |||
| @@ -15,6 +15,10 @@ | |||
| 15 | 15 | ||
| 16 | namespace Core { | 16 | namespace Core { |
| 17 | 17 | ||
| 18 | constexpr size_t DEVICE_PAGEBITS = 12ULL; | ||
| 19 | constexpr size_t DEVICE_PAGESIZE = 1ULL << DEVICE_PAGEBITS; | ||
| 20 | constexpr size_t DEVICE_PAGEMASK = DEVICE_PAGESIZE - 1ULL; | ||
| 21 | |||
| 18 | class DeviceMemory; | 22 | class DeviceMemory; |
| 19 | 23 | ||
| 20 | namespace Memory { | 24 | namespace Memory { |
diff --git a/src/core/gpu_dirty_memory_manager.h b/src/core/gpu_dirty_memory_manager.h index f1abf4f83..cc8fc176f 100644 --- a/src/core/gpu_dirty_memory_manager.h +++ b/src/core/gpu_dirty_memory_manager.h | |||
| @@ -10,7 +10,7 @@ | |||
| 10 | #include <utility> | 10 | #include <utility> |
| 11 | #include <vector> | 11 | #include <vector> |
| 12 | 12 | ||
| 13 | #include "core/memory.h" | 13 | #include "core/device_memory_manager.h" |
| 14 | 14 | ||
| 15 | namespace Core { | 15 | namespace Core { |
| 16 | 16 | ||
| @@ -80,7 +80,7 @@ private: | |||
| 80 | u32 mask; | 80 | u32 mask; |
| 81 | }; | 81 | }; |
| 82 | 82 | ||
| 83 | constexpr static size_t page_bits = Memory::YUZU_PAGEBITS - 1; | 83 | constexpr static size_t page_bits = DEVICE_PAGEBITS - 1; |
| 84 | constexpr static size_t page_size = 1ULL << page_bits; | 84 | constexpr static size_t page_size = 1ULL << page_bits; |
| 85 | constexpr static size_t page_mask = page_size - 1; | 85 | constexpr static size_t page_mask = page_size - 1; |
| 86 | 86 | ||
diff --git a/src/tests/video_core/memory_tracker.cpp b/src/tests/video_core/memory_tracker.cpp index 618793668..0e559a590 100644 --- a/src/tests/video_core/memory_tracker.cpp +++ b/src/tests/video_core/memory_tracker.cpp | |||
| @@ -24,9 +24,8 @@ constexpr VAddr c = 16 * HIGH_PAGE_SIZE; | |||
| 24 | class RasterizerInterface { | 24 | class RasterizerInterface { |
| 25 | public: | 25 | public: |
| 26 | void UpdatePagesCachedCount(VAddr addr, u64 size, int delta) { | 26 | void UpdatePagesCachedCount(VAddr addr, u64 size, int delta) { |
| 27 | const u64 page_start{addr >> Core::Memory::YUZU_PAGEBITS}; | 27 | const u64 page_start{addr >> Core::DEVICE_PAGEBITS}; |
| 28 | const u64 page_end{(addr + size + Core::Memory::YUZU_PAGESIZE - 1) >> | 28 | const u64 page_end{(addr + size + Core::DEVICE_PAGESIZE - 1) >> Core::DEVICE_PAGEBITS}; |
| 29 | Core::Memory::YUZU_PAGEBITS}; | ||
| 30 | for (u64 page = page_start; page < page_end; ++page) { | 29 | for (u64 page = page_start; page < page_end; ++page) { |
| 31 | int& value = page_table[page]; | 30 | int& value = page_table[page]; |
| 32 | value += delta; | 31 | value += delta; |
| @@ -40,7 +39,7 @@ public: | |||
| 40 | } | 39 | } |
| 41 | 40 | ||
| 42 | [[nodiscard]] int Count(VAddr addr) const noexcept { | 41 | [[nodiscard]] int Count(VAddr addr) const noexcept { |
| 43 | const auto it = page_table.find(addr >> Core::Memory::YUZU_PAGEBITS); | 42 | const auto it = page_table.find(addr >> Core::DEVICE_PAGEBITS); |
| 44 | return it == page_table.end() ? 0 : it->second; | 43 | return it == page_table.end() ? 0 : it->second; |
| 45 | } | 44 | } |
| 46 | 45 | ||
diff --git a/src/video_core/buffer_cache/buffer_cache.h b/src/video_core/buffer_cache/buffer_cache.h index 5325a715a..b4bf369d1 100644 --- a/src/video_core/buffer_cache/buffer_cache.h +++ b/src/video_core/buffer_cache/buffer_cache.h | |||
| @@ -13,7 +13,7 @@ | |||
| 13 | 13 | ||
| 14 | namespace VideoCommon { | 14 | namespace VideoCommon { |
| 15 | 15 | ||
| 16 | using Core::Memory::YUZU_PAGESIZE; | 16 | using Core::DEVICE_PAGESIZE; |
| 17 | 17 | ||
| 18 | template <class P> | 18 | template <class P> |
| 19 | BufferCache<P>::BufferCache(Tegra::MaxwellDeviceMemoryManager& device_memory_, Runtime& runtime_) | 19 | BufferCache<P>::BufferCache(Tegra::MaxwellDeviceMemoryManager& device_memory_, Runtime& runtime_) |
| @@ -120,8 +120,8 @@ void BufferCache<P>::CachedWriteMemory(DAddr device_addr, u64 size) { | |||
| 120 | if (!is_dirty) { | 120 | if (!is_dirty) { |
| 121 | return; | 121 | return; |
| 122 | } | 122 | } |
| 123 | DAddr aligned_start = Common::AlignDown(device_addr, YUZU_PAGESIZE); | 123 | DAddr aligned_start = Common::AlignDown(device_addr, DEVICE_PAGESIZE); |
| 124 | DAddr aligned_end = Common::AlignUp(device_addr + size, YUZU_PAGESIZE); | 124 | DAddr aligned_end = Common::AlignUp(device_addr + size, DEVICE_PAGESIZE); |
| 125 | if (!IsRegionGpuModified(aligned_start, aligned_end - aligned_start)) { | 125 | if (!IsRegionGpuModified(aligned_start, aligned_end - aligned_start)) { |
| 126 | WriteMemory(device_addr, size); | 126 | WriteMemory(device_addr, size); |
| 127 | return; | 127 | return; |
| @@ -151,9 +151,8 @@ std::optional<VideoCore::RasterizerDownloadArea> BufferCache<P>::GetFlushArea(DA | |||
| 151 | u64 size) { | 151 | u64 size) { |
| 152 | std::optional<VideoCore::RasterizerDownloadArea> area{}; | 152 | std::optional<VideoCore::RasterizerDownloadArea> area{}; |
| 153 | area.emplace(); | 153 | area.emplace(); |
| 154 | DAddr device_addr_start_aligned = Common::AlignDown(device_addr, Core::Memory::YUZU_PAGESIZE); | 154 | DAddr device_addr_start_aligned = Common::AlignDown(device_addr, Core::DEVICE_PAGESIZE); |
| 155 | DAddr device_addr_end_aligned = | 155 | DAddr device_addr_end_aligned = Common::AlignUp(device_addr + size, Core::DEVICE_PAGESIZE); |
| 156 | Common::AlignUp(device_addr + size, Core::Memory::YUZU_PAGESIZE); | ||
| 157 | area->start_address = device_addr_start_aligned; | 156 | area->start_address = device_addr_start_aligned; |
| 158 | area->end_address = device_addr_end_aligned; | 157 | area->end_address = device_addr_end_aligned; |
| 159 | if (memory_tracker.IsRegionPreflushable(device_addr, size)) { | 158 | if (memory_tracker.IsRegionPreflushable(device_addr, size)) { |
| @@ -1354,10 +1353,10 @@ typename BufferCache<P>::OverlapResult BufferCache<P>::ResolveOverlaps(DAddr dev | |||
| 1354 | int stream_score = 0; | 1353 | int stream_score = 0; |
| 1355 | bool has_stream_leap = false; | 1354 | bool has_stream_leap = false; |
| 1356 | auto expand_begin = [&](DAddr add_value) { | 1355 | auto expand_begin = [&](DAddr add_value) { |
| 1357 | static constexpr DAddr min_page = CACHING_PAGESIZE + Core::Memory::YUZU_PAGESIZE; | 1356 | static constexpr DAddr min_page = CACHING_PAGESIZE + Core::DEVICE_PAGESIZE; |
| 1358 | if (add_value > begin - min_page) { | 1357 | if (add_value > begin - min_page) { |
| 1359 | begin = min_page; | 1358 | begin = min_page; |
| 1360 | device_addr = Core::Memory::YUZU_PAGESIZE; | 1359 | device_addr = Core::DEVICE_PAGESIZE; |
| 1361 | return; | 1360 | return; |
| 1362 | } | 1361 | } |
| 1363 | begin -= add_value; | 1362 | begin -= add_value; |
| @@ -1587,8 +1586,8 @@ bool BufferCache<P>::InlineMemory(DAddr dest_address, size_t copy_size, | |||
| 1587 | if (!is_dirty) { | 1586 | if (!is_dirty) { |
| 1588 | return false; | 1587 | return false; |
| 1589 | } | 1588 | } |
| 1590 | DAddr aligned_start = Common::AlignDown(dest_address, YUZU_PAGESIZE); | 1589 | DAddr aligned_start = Common::AlignDown(dest_address, DEVICE_PAGESIZE); |
| 1591 | DAddr aligned_end = Common::AlignUp(dest_address + copy_size, YUZU_PAGESIZE); | 1590 | DAddr aligned_end = Common::AlignUp(dest_address + copy_size, DEVICE_PAGESIZE); |
| 1592 | if (!IsRegionGpuModified(aligned_start, aligned_end - aligned_start)) { | 1591 | if (!IsRegionGpuModified(aligned_start, aligned_end - aligned_start)) { |
| 1593 | return false; | 1592 | return false; |
| 1594 | } | 1593 | } |
| @@ -1786,7 +1785,7 @@ Binding BufferCache<P>::StorageBufferBinding(GPUVAddr ssbo_addr, u32 cbuf_index, | |||
| 1786 | ASSERT_MSG(device_addr, "Unaligned storage buffer address not found for cbuf index {}", | 1785 | ASSERT_MSG(device_addr, "Unaligned storage buffer address not found for cbuf index {}", |
| 1787 | cbuf_index); | 1786 | cbuf_index); |
| 1788 | // The end address used for size calculation does not need to be aligned | 1787 | // The end address used for size calculation does not need to be aligned |
| 1789 | const DAddr cpu_end = Common::AlignUp(*device_addr + size, Core::Memory::YUZU_PAGESIZE); | 1788 | const DAddr cpu_end = Common::AlignUp(*device_addr + size, Core::DEVICE_PAGESIZE); |
| 1790 | 1789 | ||
| 1791 | const Binding binding{ | 1790 | const Binding binding{ |
| 1792 | .device_addr = *aligned_device_addr, | 1791 | .device_addr = *aligned_device_addr, |
diff --git a/src/video_core/buffer_cache/buffer_cache_base.h b/src/video_core/buffer_cache/buffer_cache_base.h index 4074003e4..80dbb81e7 100644 --- a/src/video_core/buffer_cache/buffer_cache_base.h +++ b/src/video_core/buffer_cache/buffer_cache_base.h | |||
| @@ -449,8 +449,8 @@ private: | |||
| 449 | } | 449 | } |
| 450 | 450 | ||
| 451 | static bool IsRangeGranular(DAddr device_addr, size_t size) { | 451 | static bool IsRangeGranular(DAddr device_addr, size_t size) { |
| 452 | return (device_addr & ~Core::Memory::YUZU_PAGEMASK) == | 452 | return (device_addr & ~Core::DEVICE_PAGEMASK) == |
| 453 | ((device_addr + size) & ~Core::Memory::YUZU_PAGEMASK); | 453 | ((device_addr + size) & ~Core::DEVICE_PAGEMASK); |
| 454 | } | 454 | } |
| 455 | 455 | ||
| 456 | void RunGarbageCollector(); | 456 | void RunGarbageCollector(); |
diff --git a/src/video_core/buffer_cache/word_manager.h b/src/video_core/buffer_cache/word_manager.h index 1ca333b32..3db9d8b42 100644 --- a/src/video_core/buffer_cache/word_manager.h +++ b/src/video_core/buffer_cache/word_manager.h | |||
| @@ -13,12 +13,12 @@ | |||
| 13 | #include "common/common_funcs.h" | 13 | #include "common/common_funcs.h" |
| 14 | #include "common/common_types.h" | 14 | #include "common/common_types.h" |
| 15 | #include "common/div_ceil.h" | 15 | #include "common/div_ceil.h" |
| 16 | #include "core/memory.h" | 16 | #include "video_core/host1x/gpu_device_memory_manager.h" |
| 17 | 17 | ||
| 18 | namespace VideoCommon { | 18 | namespace VideoCommon { |
| 19 | 19 | ||
| 20 | constexpr u64 PAGES_PER_WORD = 64; | 20 | constexpr u64 PAGES_PER_WORD = 64; |
| 21 | constexpr u64 BYTES_PER_PAGE = Core::Memory::YUZU_PAGESIZE; | 21 | constexpr u64 BYTES_PER_PAGE = Core::DEVICE_PAGESIZE; |
| 22 | constexpr u64 BYTES_PER_WORD = PAGES_PER_WORD * BYTES_PER_PAGE; | 22 | constexpr u64 BYTES_PER_WORD = PAGES_PER_WORD * BYTES_PER_PAGE; |
| 23 | 23 | ||
| 24 | enum class Type { | 24 | enum class Type { |
diff --git a/src/video_core/engines/maxwell_3d.cpp b/src/video_core/engines/maxwell_3d.cpp index 95ba4f76c..a94e1f043 100644 --- a/src/video_core/engines/maxwell_3d.cpp +++ b/src/video_core/engines/maxwell_3d.cpp | |||
| @@ -9,7 +9,6 @@ | |||
| 9 | #include "common/settings.h" | 9 | #include "common/settings.h" |
| 10 | #include "core/core.h" | 10 | #include "core/core.h" |
| 11 | #include "core/core_timing.h" | 11 | #include "core/core_timing.h" |
| 12 | #include "core/memory.h" | ||
| 13 | #include "video_core/dirty_flags.h" | 12 | #include "video_core/dirty_flags.h" |
| 14 | #include "video_core/engines/draw_manager.h" | 13 | #include "video_core/engines/draw_manager.h" |
| 15 | #include "video_core/engines/maxwell_3d.h" | 14 | #include "video_core/engines/maxwell_3d.h" |
diff --git a/src/video_core/engines/maxwell_dma.cpp b/src/video_core/engines/maxwell_dma.cpp index 4bf461fb0..2ebd21fc5 100644 --- a/src/video_core/engines/maxwell_dma.cpp +++ b/src/video_core/engines/maxwell_dma.cpp | |||
| @@ -8,7 +8,6 @@ | |||
| 8 | #include "common/polyfill_ranges.h" | 8 | #include "common/polyfill_ranges.h" |
| 9 | #include "common/settings.h" | 9 | #include "common/settings.h" |
| 10 | #include "core/core.h" | 10 | #include "core/core.h" |
| 11 | #include "core/memory.h" | ||
| 12 | #include "video_core/engines/maxwell_3d.h" | 11 | #include "video_core/engines/maxwell_3d.h" |
| 13 | #include "video_core/engines/maxwell_dma.h" | 12 | #include "video_core/engines/maxwell_dma.h" |
| 14 | #include "video_core/guest_memory.h" | 13 | #include "video_core/guest_memory.h" |
diff --git a/src/video_core/memory_manager.cpp b/src/video_core/memory_manager.cpp index b18b44e42..a52f8e486 100644 --- a/src/video_core/memory_manager.cpp +++ b/src/video_core/memory_manager.cpp | |||
| @@ -606,14 +606,14 @@ bool MemoryManager::IsGranularRange(GPUVAddr gpu_addr, std::size_t size) const { | |||
| 606 | const std::size_t page{(page_index & big_page_mask) + size}; | 606 | const std::size_t page{(page_index & big_page_mask) + size}; |
| 607 | return page <= big_page_size; | 607 | return page <= big_page_size; |
| 608 | } | 608 | } |
| 609 | const std::size_t page{(gpu_addr & Core::Memory::YUZU_PAGEMASK) + size}; | 609 | const std::size_t page{(gpu_addr & Core::DEVICE_PAGEMASK) + size}; |
| 610 | return page <= Core::Memory::YUZU_PAGESIZE; | 610 | return page <= Core::DEVICE_PAGESIZE; |
| 611 | } | 611 | } |
| 612 | if (GetEntry<false>(gpu_addr) != EntryType::Mapped) { | 612 | if (GetEntry<false>(gpu_addr) != EntryType::Mapped) { |
| 613 | return false; | 613 | return false; |
| 614 | } | 614 | } |
| 615 | const std::size_t page{(gpu_addr & Core::Memory::YUZU_PAGEMASK) + size}; | 615 | const std::size_t page{(gpu_addr & Core::DEVICE_PAGEMASK) + size}; |
| 616 | return page <= Core::Memory::YUZU_PAGESIZE; | 616 | return page <= Core::DEVICE_PAGESIZE; |
| 617 | } | 617 | } |
| 618 | 618 | ||
| 619 | bool MemoryManager::IsContinuousRange(GPUVAddr gpu_addr, std::size_t size) const { | 619 | bool MemoryManager::IsContinuousRange(GPUVAddr gpu_addr, std::size_t size) const { |
diff --git a/src/video_core/memory_manager.h b/src/video_core/memory_manager.h index eb00918fc..c5255f36c 100644 --- a/src/video_core/memory_manager.h +++ b/src/video_core/memory_manager.h | |||
| @@ -15,7 +15,6 @@ | |||
| 15 | #include "common/range_map.h" | 15 | #include "common/range_map.h" |
| 16 | #include "common/scratch_buffer.h" | 16 | #include "common/scratch_buffer.h" |
| 17 | #include "common/virtual_buffer.h" | 17 | #include "common/virtual_buffer.h" |
| 18 | #include "core/memory.h" | ||
| 19 | #include "video_core/cache_types.h" | 18 | #include "video_core/cache_types.h" |
| 20 | #include "video_core/host1x/gpu_device_memory_manager.h" | 19 | #include "video_core/host1x/gpu_device_memory_manager.h" |
| 21 | #include "video_core/pte_kind.h" | 20 | #include "video_core/pte_kind.h" |
diff --git a/src/video_core/query_cache.h b/src/video_core/query_cache.h index b01d843e4..4861b123a 100644 --- a/src/video_core/query_cache.h +++ b/src/video_core/query_cache.h | |||
| @@ -18,7 +18,6 @@ | |||
| 18 | 18 | ||
| 19 | #include "common/assert.h" | 19 | #include "common/assert.h" |
| 20 | #include "common/settings.h" | 20 | #include "common/settings.h" |
| 21 | #include "core/memory.h" | ||
| 22 | #include "video_core/control/channel_state_cache.h" | 21 | #include "video_core/control/channel_state_cache.h" |
| 23 | #include "video_core/engines/maxwell_3d.h" | 22 | #include "video_core/engines/maxwell_3d.h" |
| 24 | #include "video_core/host1x/gpu_device_memory_manager.h" | 23 | #include "video_core/host1x/gpu_device_memory_manager.h" |
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 @@ | |||
| 15 | #include "common/logging/log.h" | 15 | #include "common/logging/log.h" |
| 16 | #include "common/scope_exit.h" | 16 | #include "common/scope_exit.h" |
| 17 | #include "common/settings.h" | 17 | #include "common/settings.h" |
| 18 | #include "core/memory.h" | ||
| 19 | #include "video_core/engines/maxwell_3d.h" | 18 | #include "video_core/engines/maxwell_3d.h" |
| 20 | #include "video_core/gpu.h" | 19 | #include "video_core/gpu.h" |
| 21 | #include "video_core/host1x/gpu_device_memory_manager.h" | 20 | #include "video_core/host1x/gpu_device_memory_manager.h" |
| @@ -253,8 +252,8 @@ void QueryCacheBase<Traits>::CounterReport(GPUVAddr addr, QueryType counter_type | |||
| 253 | query_location.stream_id.Assign(static_cast<u32>(streamer_id)); | 252 | query_location.stream_id.Assign(static_cast<u32>(streamer_id)); |
| 254 | query_location.query_id.Assign(static_cast<u32>(new_query_id)); | 253 | query_location.query_id.Assign(static_cast<u32>(new_query_id)); |
| 255 | const auto gen_caching_indexing = [](VAddr cur_addr) { | 254 | const auto gen_caching_indexing = [](VAddr cur_addr) { |
| 256 | return std::make_pair<u64, u32>(cur_addr >> Core::Memory::YUZU_PAGEBITS, | 255 | return std::make_pair<u64, u32>(cur_addr >> Core::DEVICE_PAGEBITS, |
| 257 | static_cast<u32>(cur_addr & Core::Memory::YUZU_PAGEMASK)); | 256 | static_cast<u32>(cur_addr & Core::DEVICE_PAGEMASK)); |
| 258 | }; | 257 | }; |
| 259 | u8* pointer = impl->device_memory.template GetPointer<u8>(cpu_addr); | 258 | u8* pointer = impl->device_memory.template GetPointer<u8>(cpu_addr); |
| 260 | u8* pointer_timestamp = impl->device_memory.template GetPointer<u8>(cpu_addr + 8); | 259 | 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 | |||
| 325 | template <typename Traits> | 324 | template <typename Traits> |
| 326 | void QueryCacheBase<Traits>::UnregisterPending() { | 325 | void QueryCacheBase<Traits>::UnregisterPending() { |
| 327 | const auto gen_caching_indexing = [](VAddr cur_addr) { | 326 | const auto gen_caching_indexing = [](VAddr cur_addr) { |
| 328 | return std::make_pair<u64, u32>(cur_addr >> Core::Memory::YUZU_PAGEBITS, | 327 | return std::make_pair<u64, u32>(cur_addr >> Core::DEVICE_PAGEBITS, |
| 329 | static_cast<u32>(cur_addr & Core::Memory::YUZU_PAGEMASK)); | 328 | static_cast<u32>(cur_addr & Core::DEVICE_PAGEMASK)); |
| 330 | }; | 329 | }; |
| 331 | std::scoped_lock lock(cache_mutex); | 330 | std::scoped_lock lock(cache_mutex); |
| 332 | for (QueryLocation loc : impl->pending_unregister) { | 331 | for (QueryLocation loc : impl->pending_unregister) { |
| @@ -390,7 +389,7 @@ bool QueryCacheBase<Traits>::AccelerateHostConditionalRendering() { | |||
| 390 | } | 389 | } |
| 391 | VAddr cpu_addr = *cpu_addr_opt; | 390 | VAddr cpu_addr = *cpu_addr_opt; |
| 392 | std::scoped_lock lock(cache_mutex); | 391 | std::scoped_lock lock(cache_mutex); |
| 393 | auto it1 = cached_queries.find(cpu_addr >> Core::Memory::YUZU_PAGEBITS); | 392 | auto it1 = cached_queries.find(cpu_addr >> Core::DEVICE_PAGEBITS); |
| 394 | if (it1 == cached_queries.end()) { | 393 | if (it1 == cached_queries.end()) { |
| 395 | return VideoCommon::LookupData{ | 394 | return VideoCommon::LookupData{ |
| 396 | .address = cpu_addr, | 395 | .address = cpu_addr, |
| @@ -398,10 +397,10 @@ bool QueryCacheBase<Traits>::AccelerateHostConditionalRendering() { | |||
| 398 | }; | 397 | }; |
| 399 | } | 398 | } |
| 400 | auto& sub_container = it1->second; | 399 | auto& sub_container = it1->second; |
| 401 | auto it_current = sub_container.find(cpu_addr & Core::Memory::YUZU_PAGEMASK); | 400 | auto it_current = sub_container.find(cpu_addr & Core::DEVICE_PAGEMASK); |
| 402 | 401 | ||
| 403 | if (it_current == sub_container.end()) { | 402 | if (it_current == sub_container.end()) { |
| 404 | auto it_current_2 = sub_container.find((cpu_addr & Core::Memory::YUZU_PAGEMASK) + 4); | 403 | auto it_current_2 = sub_container.find((cpu_addr & Core::DEVICE_PAGEMASK) + 4); |
| 405 | if (it_current_2 == sub_container.end()) { | 404 | if (it_current_2 == sub_container.end()) { |
| 406 | return VideoCommon::LookupData{ | 405 | return VideoCommon::LookupData{ |
| 407 | .address = cpu_addr, | 406 | .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 @@ | |||
| 13 | #include "common/assert.h" | 13 | #include "common/assert.h" |
| 14 | #include "common/bit_field.h" | 14 | #include "common/bit_field.h" |
| 15 | #include "common/common_types.h" | 15 | #include "common/common_types.h" |
| 16 | #include "core/memory.h" | ||
| 17 | #include "video_core/control/channel_state_cache.h" | 16 | #include "video_core/control/channel_state_cache.h" |
| 18 | #include "video_core/host1x/gpu_device_memory_manager.h" | 17 | #include "video_core/host1x/gpu_device_memory_manager.h" |
| 19 | #include "video_core/query_cache/query_base.h" | 18 | #include "video_core/query_cache/query_base.h" |
| @@ -123,10 +122,10 @@ protected: | |||
| 123 | const u64 addr_begin = addr; | 122 | const u64 addr_begin = addr; |
| 124 | const u64 addr_end = addr_begin + size; | 123 | const u64 addr_end = addr_begin + size; |
| 125 | 124 | ||
| 126 | const u64 page_end = addr_end >> Core::Memory::YUZU_PAGEBITS; | 125 | const u64 page_end = addr_end >> Core::DEVICE_PAGEBITS; |
| 127 | std::scoped_lock lock(cache_mutex); | 126 | std::scoped_lock lock(cache_mutex); |
| 128 | for (u64 page = addr_begin >> Core::Memory::YUZU_PAGEBITS; page <= page_end; ++page) { | 127 | for (u64 page = addr_begin >> Core::DEVICE_PAGEBITS; page <= page_end; ++page) { |
| 129 | const u64 page_start = page << Core::Memory::YUZU_PAGEBITS; | 128 | const u64 page_start = page << Core::DEVICE_PAGEBITS; |
| 130 | const auto in_range = [page_start, addr_begin, addr_end](const u32 query_location) { | 129 | const auto in_range = [page_start, addr_begin, addr_end](const u32 query_location) { |
| 131 | const u64 cache_begin = page_start + query_location; | 130 | const u64 cache_begin = page_start + query_location; |
| 132 | const u64 cache_end = cache_begin + sizeof(u32); | 131 | const u64 cache_end = cache_begin + sizeof(u32); |
diff --git a/src/video_core/renderer_null/null_rasterizer.cpp b/src/video_core/renderer_null/null_rasterizer.cpp index 11b93fdc9..abfabb65b 100644 --- a/src/video_core/renderer_null/null_rasterizer.cpp +++ b/src/video_core/renderer_null/null_rasterizer.cpp | |||
| @@ -2,7 +2,6 @@ | |||
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | 3 | ||
| 4 | #include "common/alignment.h" | 4 | #include "common/alignment.h" |
| 5 | #include "core/memory.h" | ||
| 6 | #include "video_core/control/channel_state.h" | 5 | #include "video_core/control/channel_state.h" |
| 7 | #include "video_core/host1x/host1x.h" | 6 | #include "video_core/host1x/host1x.h" |
| 8 | #include "video_core/memory_manager.h" | 7 | #include "video_core/memory_manager.h" |
| @@ -55,8 +54,8 @@ bool RasterizerNull::OnCPUWrite(PAddr addr, u64 size) { | |||
| 55 | void RasterizerNull::OnCacheInvalidation(PAddr addr, u64 size) {} | 54 | void RasterizerNull::OnCacheInvalidation(PAddr addr, u64 size) {} |
| 56 | VideoCore::RasterizerDownloadArea RasterizerNull::GetFlushArea(PAddr addr, u64 size) { | 55 | VideoCore::RasterizerDownloadArea RasterizerNull::GetFlushArea(PAddr addr, u64 size) { |
| 57 | VideoCore::RasterizerDownloadArea new_area{ | 56 | VideoCore::RasterizerDownloadArea new_area{ |
| 58 | .start_address = Common::AlignDown(addr, Core::Memory::YUZU_PAGESIZE), | 57 | .start_address = Common::AlignDown(addr, Core::DEVICE_PAGESIZE), |
| 59 | .end_address = Common::AlignUp(addr + size, Core::Memory::YUZU_PAGESIZE), | 58 | .end_address = Common::AlignUp(addr + size, Core::DEVICE_PAGESIZE), |
| 60 | .preemtive = true, | 59 | .preemtive = true, |
| 61 | }; | 60 | }; |
| 62 | return new_area; | 61 | return new_area; |
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index 71b748c74..d5354ef2d 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp | |||
| @@ -526,8 +526,8 @@ VideoCore::RasterizerDownloadArea RasterizerOpenGL::GetFlushArea(DAddr addr, u64 | |||
| 526 | } | 526 | } |
| 527 | } | 527 | } |
| 528 | VideoCore::RasterizerDownloadArea new_area{ | 528 | VideoCore::RasterizerDownloadArea new_area{ |
| 529 | .start_address = Common::AlignDown(addr, Core::Memory::YUZU_PAGESIZE), | 529 | .start_address = Common::AlignDown(addr, Core::DEVICE_PAGESIZE), |
| 530 | .end_address = Common::AlignUp(addr + size, Core::Memory::YUZU_PAGESIZE), | 530 | .end_address = Common::AlignUp(addr + size, Core::DEVICE_PAGESIZE), |
| 531 | .preemtive = true, | 531 | .preemtive = true, |
| 532 | }; | 532 | }; |
| 533 | return new_area; | 533 | return new_area; |
diff --git a/src/video_core/renderer_opengl/renderer_opengl.cpp b/src/video_core/renderer_opengl/renderer_opengl.cpp index 821a045ad..b75376fdb 100644 --- a/src/video_core/renderer_opengl/renderer_opengl.cpp +++ b/src/video_core/renderer_opengl/renderer_opengl.cpp | |||
| @@ -15,7 +15,6 @@ | |||
| 15 | #include "common/telemetry.h" | 15 | #include "common/telemetry.h" |
| 16 | #include "core/core_timing.h" | 16 | #include "core/core_timing.h" |
| 17 | #include "core/frontend/emu_window.h" | 17 | #include "core/frontend/emu_window.h" |
| 18 | #include "core/memory.h" | ||
| 19 | #include "core/telemetry_session.h" | 18 | #include "core/telemetry_session.h" |
| 20 | #include "video_core/host_shaders/ffx_a_h.h" | 19 | #include "video_core/host_shaders/ffx_a_h.h" |
| 21 | #include "video_core/host_shaders/ffx_fsr1_h.h" | 20 | #include "video_core/host_shaders/ffx_fsr1_h.h" |
diff --git a/src/video_core/renderer_vulkan/pipeline_helper.h b/src/video_core/renderer_vulkan/pipeline_helper.h index 71c783709..850c34a3a 100644 --- a/src/video_core/renderer_vulkan/pipeline_helper.h +++ b/src/video_core/renderer_vulkan/pipeline_helper.h | |||
| @@ -12,7 +12,6 @@ | |||
| 12 | #include "shader_recompiler/shader_info.h" | 12 | #include "shader_recompiler/shader_info.h" |
| 13 | #include "video_core/renderer_vulkan/vk_texture_cache.h" | 13 | #include "video_core/renderer_vulkan/vk_texture_cache.h" |
| 14 | #include "video_core/renderer_vulkan/vk_update_descriptor.h" | 14 | #include "video_core/renderer_vulkan/vk_update_descriptor.h" |
| 15 | #include "video_core/texture_cache/texture_cache.h" | ||
| 16 | #include "video_core/texture_cache/types.h" | 15 | #include "video_core/texture_cache/types.h" |
| 17 | #include "video_core/vulkan_common/vulkan_device.h" | 16 | #include "video_core/vulkan_common/vulkan_device.h" |
| 18 | 17 | ||
diff --git a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp index f2fd2670f..ec6b3a4b0 100644 --- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp +++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp | |||
| @@ -19,6 +19,7 @@ | |||
| 19 | #include "video_core/renderer_vulkan/vk_texture_cache.h" | 19 | #include "video_core/renderer_vulkan/vk_texture_cache.h" |
| 20 | #include "video_core/renderer_vulkan/vk_update_descriptor.h" | 20 | #include "video_core/renderer_vulkan/vk_update_descriptor.h" |
| 21 | #include "video_core/shader_notify.h" | 21 | #include "video_core/shader_notify.h" |
| 22 | #include "video_core/texture_cache/texture_cache.h" | ||
| 22 | #include "video_core/vulkan_common/vulkan_device.h" | 23 | #include "video_core/vulkan_common/vulkan_device.h" |
| 23 | 24 | ||
| 24 | #if defined(_MSC_VER) && defined(NDEBUG) | 25 | #if defined(_MSC_VER) && defined(NDEBUG) |
diff --git a/src/video_core/renderer_vulkan/vk_query_cache.cpp b/src/video_core/renderer_vulkan/vk_query_cache.cpp index 522f92dae..7cbc9c73c 100644 --- a/src/video_core/renderer_vulkan/vk_query_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_query_cache.cpp | |||
| @@ -13,7 +13,6 @@ | |||
| 13 | 13 | ||
| 14 | #include "common/bit_util.h" | 14 | #include "common/bit_util.h" |
| 15 | #include "common/common_types.h" | 15 | #include "common/common_types.h" |
| 16 | #include "core/memory.h" | ||
| 17 | #include "video_core/engines/draw_manager.h" | 16 | #include "video_core/engines/draw_manager.h" |
| 18 | #include "video_core/host1x/gpu_device_memory_manager.h" | 17 | #include "video_core/host1x/gpu_device_memory_manager.h" |
| 19 | #include "video_core/query_cache/query_cache.h" | 18 | #include "video_core/query_cache/query_cache.h" |
| @@ -1482,8 +1481,8 @@ void QueryCacheRuntime::SyncValues(std::span<SyncValuesType> values, VkBuffer ba | |||
| 1482 | for (auto& sync_val : values) { | 1481 | for (auto& sync_val : values) { |
| 1483 | total_size += sync_val.size; | 1482 | total_size += sync_val.size; |
| 1484 | bool found = false; | 1483 | bool found = false; |
| 1485 | DAddr base = Common::AlignDown(sync_val.address, Core::Memory::YUZU_PAGESIZE); | 1484 | DAddr base = Common::AlignDown(sync_val.address, Core::DEVICE_PAGESIZE); |
| 1486 | DAddr base_end = base + Core::Memory::YUZU_PAGESIZE; | 1485 | DAddr base_end = base + Core::DEVICE_PAGESIZE; |
| 1487 | for (size_t i = 0; i < impl->little_cache.size(); i++) { | 1486 | for (size_t i = 0; i < impl->little_cache.size(); i++) { |
| 1488 | const auto set_found = [&] { | 1487 | const auto set_found = [&] { |
| 1489 | impl->redirect_cache.push_back(i); | 1488 | impl->redirect_cache.push_back(i); |
diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index 874927311..5bf41b81f 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp | |||
| @@ -553,8 +553,8 @@ VideoCore::RasterizerDownloadArea RasterizerVulkan::GetFlushArea(DAddr addr, u64 | |||
| 553 | } | 553 | } |
| 554 | } | 554 | } |
| 555 | VideoCore::RasterizerDownloadArea new_area{ | 555 | VideoCore::RasterizerDownloadArea new_area{ |
| 556 | .start_address = Common::AlignDown(addr, Core::Memory::YUZU_PAGESIZE), | 556 | .start_address = Common::AlignDown(addr, Core::DEVICE_PAGESIZE), |
| 557 | .end_address = Common::AlignUp(addr + size, Core::Memory::YUZU_PAGESIZE), | 557 | .end_address = Common::AlignUp(addr + size, Core::DEVICE_PAGESIZE), |
| 558 | .preemtive = true, | 558 | .preemtive = true, |
| 559 | }; | 559 | }; |
| 560 | return new_area; | 560 | return new_area; |
diff --git a/src/video_core/texture_cache/util.cpp b/src/video_core/texture_cache/util.cpp index 96f04b6c8..1a6f0d1ad 100644 --- a/src/video_core/texture_cache/util.cpp +++ b/src/video_core/texture_cache/util.cpp | |||
| @@ -20,7 +20,6 @@ | |||
| 20 | #include "common/div_ceil.h" | 20 | #include "common/div_ceil.h" |
| 21 | #include "common/scratch_buffer.h" | 21 | #include "common/scratch_buffer.h" |
| 22 | #include "common/settings.h" | 22 | #include "common/settings.h" |
| 23 | #include "core/memory.h" | ||
| 24 | #include "video_core/compatible_formats.h" | 23 | #include "video_core/compatible_formats.h" |
| 25 | #include "video_core/engines/maxwell_3d.h" | 24 | #include "video_core/engines/maxwell_3d.h" |
| 26 | #include "video_core/guest_memory.h" | 25 | #include "video_core/guest_memory.h" |