diff options
author | liamwhite <liamwhite@users.noreply.github.com> | 2023-03-23 15:00:19 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-23 15:00:19 +0100 |
commit | c41a4baf06efe935f08331bc6f8ff6d80dc088f5 (patch) | |
tree | a6580d41bd440b240b2f60db38fdeec60fca2eff /src/core/device_memory.h | |
parent | Merge pull request #9962 from Kelebek1/disable_srgb (diff) | |
parent | kernel: use KTypedAddress for addresses (diff) | |
download | yuzu-c41a4baf06efe935f08331bc6f8ff6d80dc088f5.tar yuzu-c41a4baf06efe935f08331bc6f8ff6d80dc088f5.tar.gz yuzu-c41a4baf06efe935f08331bc6f8ff6d80dc088f5.tar.bz2 yuzu-c41a4baf06efe935f08331bc6f8ff6d80dc088f5.tar.lz yuzu-c41a4baf06efe935f08331bc6f8ff6d80dc088f5.tar.xz yuzu-c41a4baf06efe935f08331bc6f8ff6d80dc088f5.tar.zst yuzu-c41a4baf06efe935f08331bc6f8ff6d80dc088f5.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/device_memory.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/core/device_memory.h b/src/core/device_memory.h index 90510733c..13388b73e 100644 --- a/src/core/device_memory.h +++ b/src/core/device_memory.h @@ -3,8 +3,8 @@ #pragma once -#include "common/common_types.h" #include "common/host_memory.h" +#include "common/typed_address.h" namespace Core { @@ -25,20 +25,22 @@ public: DeviceMemory(const DeviceMemory&) = delete; template <typename T> - PAddr GetPhysicalAddr(const T* ptr) const { + Common::PhysicalAddress GetPhysicalAddr(const T* ptr) const { return (reinterpret_cast<uintptr_t>(ptr) - reinterpret_cast<uintptr_t>(buffer.BackingBasePointer())) + DramMemoryMap::Base; } template <typename T> - T* GetPointer(PAddr addr) { - return reinterpret_cast<T*>(buffer.BackingBasePointer() + (addr - DramMemoryMap::Base)); + T* GetPointer(Common::PhysicalAddress addr) { + return reinterpret_cast<T*>(buffer.BackingBasePointer() + + (GetInteger(addr) - DramMemoryMap::Base)); } template <typename T> - const T* GetPointer(PAddr addr) const { - return reinterpret_cast<T*>(buffer.BackingBasePointer() + (addr - DramMemoryMap::Base)); + const T* GetPointer(Common::PhysicalAddress addr) const { + return reinterpret_cast<T*>(buffer.BackingBasePointer() + + (GetInteger(addr) - DramMemoryMap::Base)); } Common::HostMemory buffer; |