diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2021-11-14 20:55:52 +0100 |
---|---|---|
committer | Fernando Sahmkow <fsahmkow27@gmail.com> | 2022-10-06 21:00:52 +0200 |
commit | feb49c822d9cabc5bc7be9eab1f2bf4ba460176a (patch) | |
tree | 678c58e7fb8e41f5a04e309df9d196320d11de99 /src/video_core | |
parent | NVDRV: Update copyright notices. (diff) | |
download | yuzu-feb49c822d9cabc5bc7be9eab1f2bf4ba460176a.tar yuzu-feb49c822d9cabc5bc7be9eab1f2bf4ba460176a.tar.gz yuzu-feb49c822d9cabc5bc7be9eab1f2bf4ba460176a.tar.bz2 yuzu-feb49c822d9cabc5bc7be9eab1f2bf4ba460176a.tar.lz yuzu-feb49c822d9cabc5bc7be9eab1f2bf4ba460176a.tar.xz yuzu-feb49c822d9cabc5bc7be9eab1f2bf4ba460176a.tar.zst yuzu-feb49c822d9cabc5bc7be9eab1f2bf4ba460176a.zip |
Diffstat (limited to 'src/video_core')
-rw-r--r-- | src/video_core/memory_manager.cpp | 10 | ||||
-rw-r--r-- | src/video_core/memory_manager.h | 3 |
2 files changed, 9 insertions, 4 deletions
diff --git a/src/video_core/memory_manager.cpp b/src/video_core/memory_manager.cpp index 9e946d448..fc68bcc73 100644 --- a/src/video_core/memory_manager.cpp +++ b/src/video_core/memory_manager.cpp @@ -71,18 +71,22 @@ void MemoryManager::BindRasterizer(VideoCore::RasterizerInterface* rasterizer_) rasterizer = rasterizer_; } -GPUVAddr MemoryManager::Map(VAddr cpu_addr, GPUVAddr gpu_addr, std::size_t size) { +GPUVAddr MemoryManager::Map(GPUVAddr gpu_addr, VAddr cpu_addr, std::size_t size) { return PageTableOp<EntryType::Mapped>(gpu_addr, cpu_addr, size); } +GPUVAddr MemoryManager::MapSparse(GPUVAddr gpu_addr, std::size_t size) { + return PageTableOp<EntryType::Reserved>(gpu_addr, 0, size); +} + GPUVAddr MemoryManager::MapAllocate(VAddr cpu_addr, std::size_t size, std::size_t align) { - return Map(cpu_addr, *FindFreeRange(size, align), size); + return Map(*FindFreeRange(size, align), cpu_addr, size); } GPUVAddr MemoryManager::MapAllocate32(VAddr cpu_addr, std::size_t size) { const std::optional<GPUVAddr> gpu_addr = FindFreeRange(size, 1, true); ASSERT(gpu_addr); - return Map(cpu_addr, *gpu_addr, size); + return Map(*gpu_addr, cpu_addr, size); } void MemoryManager::Unmap(GPUVAddr gpu_addr, std::size_t size) { diff --git a/src/video_core/memory_manager.h b/src/video_core/memory_manager.h index 0a763fd19..b8878476a 100644 --- a/src/video_core/memory_manager.h +++ b/src/video_core/memory_manager.h @@ -88,7 +88,8 @@ public: std::vector<std::pair<GPUVAddr, std::size_t>> GetSubmappedRange(GPUVAddr gpu_addr, std::size_t size) const; - [[nodiscard]] GPUVAddr Map(VAddr cpu_addr, GPUVAddr gpu_addr, std::size_t size); + GPUVAddr Map(GPUVAddr gpu_addr, VAddr cpu_addr, std::size_t size); + GPUVAddr MapSparse(GPUVAddr gpu_addr, std::size_t size); [[nodiscard]] GPUVAddr MapAllocate(VAddr cpu_addr, std::size_t size, std::size_t align); [[nodiscard]] GPUVAddr MapAllocate32(VAddr cpu_addr, std::size_t size); [[nodiscard]] std::optional<GPUVAddr> AllocateFixed(GPUVAddr gpu_addr, std::size_t size); |