diff options
author | Rodrigo Locatti <reinuseslisp@airmail.cc> | 2020-04-09 22:59:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-09 22:59:21 +0200 |
commit | 36f607217fa9172d2e1b76e327fdb03b0498ae4d (patch) | |
tree | 523309af11b2e7f47f3f6060fad1d86e9d446206 /src/video_core/buffer_cache/buffer_block.h | |
parent | Merge pull request #3601 from ReinUsesLisp/some-shader-encodings (diff) | |
parent | VkRasterizer: Eliminate Legacy code. (diff) | |
download | yuzu-36f607217fa9172d2e1b76e327fdb03b0498ae4d.tar yuzu-36f607217fa9172d2e1b76e327fdb03b0498ae4d.tar.gz yuzu-36f607217fa9172d2e1b76e327fdb03b0498ae4d.tar.bz2 yuzu-36f607217fa9172d2e1b76e327fdb03b0498ae4d.tar.lz yuzu-36f607217fa9172d2e1b76e327fdb03b0498ae4d.tar.xz yuzu-36f607217fa9172d2e1b76e327fdb03b0498ae4d.tar.zst yuzu-36f607217fa9172d2e1b76e327fdb03b0498ae4d.zip |
Diffstat (limited to 'src/video_core/buffer_cache/buffer_block.h')
-rw-r--r-- | src/video_core/buffer_cache/buffer_block.h | 42 |
1 files changed, 17 insertions, 25 deletions
diff --git a/src/video_core/buffer_cache/buffer_block.h b/src/video_core/buffer_cache/buffer_block.h index 4b9193182..e35ee0b67 100644 --- a/src/video_core/buffer_cache/buffer_block.h +++ b/src/video_core/buffer_cache/buffer_block.h @@ -15,37 +15,29 @@ namespace VideoCommon { class BufferBlock { public: - bool Overlaps(const CacheAddr start, const CacheAddr end) const { - return (cache_addr < end) && (cache_addr_end > start); + bool Overlaps(const VAddr start, const VAddr end) const { + return (cpu_addr < end) && (cpu_addr_end > start); } - bool IsInside(const CacheAddr other_start, const CacheAddr other_end) const { - return cache_addr <= other_start && other_end <= cache_addr_end; + bool IsInside(const VAddr other_start, const VAddr other_end) const { + return cpu_addr <= other_start && other_end <= cpu_addr_end; } - u8* GetWritableHostPtr() const { - return FromCacheAddr(cache_addr); + std::size_t GetOffset(const VAddr in_addr) { + return static_cast<std::size_t>(in_addr - cpu_addr); } - u8* GetWritableHostPtr(std::size_t offset) const { - return FromCacheAddr(cache_addr + offset); + VAddr GetCpuAddr() const { + return cpu_addr; } - std::size_t GetOffset(const CacheAddr in_addr) { - return static_cast<std::size_t>(in_addr - cache_addr); + VAddr GetCpuAddrEnd() const { + return cpu_addr_end; } - CacheAddr GetCacheAddr() const { - return cache_addr; - } - - CacheAddr GetCacheAddrEnd() const { - return cache_addr_end; - } - - void SetCacheAddr(const CacheAddr new_addr) { - cache_addr = new_addr; - cache_addr_end = new_addr + size; + void SetCpuAddr(const VAddr new_addr) { + cpu_addr = new_addr; + cpu_addr_end = new_addr + size; } std::size_t GetSize() const { @@ -61,14 +53,14 @@ public: } protected: - explicit BufferBlock(CacheAddr cache_addr, const std::size_t size) : size{size} { - SetCacheAddr(cache_addr); + explicit BufferBlock(VAddr cpu_addr, const std::size_t size) : size{size} { + SetCpuAddr(cpu_addr); } ~BufferBlock() = default; private: - CacheAddr cache_addr{}; - CacheAddr cache_addr_end{}; + VAddr cpu_addr{}; + VAddr cpu_addr_end{}; std::size_t size{}; u64 epoch{}; }; |