diff options
author | Rodrigo Locatti <reinuseslisp@airmail.cc> | 2020-06-16 03:29:32 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-16 03:29:32 +0200 |
commit | 0bd9bc7201568f1c1f6f0a0c425cff6229ffc597 (patch) | |
tree | 7a398409a2e8a03a4bf5246ac5bda06a6d7ef823 /src/video_core/buffer_cache/buffer_block.h | |
parent | Merge pull request #4085 from ReinUsesLisp/gcc-times (diff) | |
parent | buffer_cache: Avoid passing references of shared pointers and misc style changes (diff) | |
download | yuzu-0bd9bc7201568f1c1f6f0a0c425cff6229ffc597.tar yuzu-0bd9bc7201568f1c1f6f0a0c425cff6229ffc597.tar.gz yuzu-0bd9bc7201568f1c1f6f0a0c425cff6229ffc597.tar.bz2 yuzu-0bd9bc7201568f1c1f6f0a0c425cff6229ffc597.tar.lz yuzu-0bd9bc7201568f1c1f6f0a0c425cff6229ffc597.tar.xz yuzu-0bd9bc7201568f1c1f6f0a0c425cff6229ffc597.tar.zst yuzu-0bd9bc7201568f1c1f6f0a0c425cff6229ffc597.zip |
Diffstat (limited to 'src/video_core/buffer_cache/buffer_block.h')
-rw-r--r-- | src/video_core/buffer_cache/buffer_block.h | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/src/video_core/buffer_cache/buffer_block.h b/src/video_core/buffer_cache/buffer_block.h index e35ee0b67..e64170e66 100644 --- a/src/video_core/buffer_cache/buffer_block.h +++ b/src/video_core/buffer_cache/buffer_block.h @@ -15,48 +15,47 @@ namespace VideoCommon { class BufferBlock { public: - bool Overlaps(const VAddr start, const VAddr end) const { + bool Overlaps(VAddr start, VAddr end) const { return (cpu_addr < end) && (cpu_addr_end > start); } - bool IsInside(const VAddr other_start, const VAddr other_end) const { + bool IsInside(VAddr other_start, VAddr other_end) const { return cpu_addr <= other_start && other_end <= cpu_addr_end; } - std::size_t GetOffset(const VAddr in_addr) { + std::size_t Offset(VAddr in_addr) const { return static_cast<std::size_t>(in_addr - cpu_addr); } - VAddr GetCpuAddr() const { + VAddr CpuAddr() const { return cpu_addr; } - VAddr GetCpuAddrEnd() const { + VAddr CpuAddrEnd() const { return cpu_addr_end; } - void SetCpuAddr(const VAddr new_addr) { + void SetCpuAddr(VAddr new_addr) { cpu_addr = new_addr; cpu_addr_end = new_addr + size; } - std::size_t GetSize() const { + std::size_t Size() const { return size; } - void SetEpoch(u64 new_epoch) { - epoch = new_epoch; + u64 Epoch() const { + return epoch; } - u64 GetEpoch() { - return epoch; + void SetEpoch(u64 new_epoch) { + epoch = new_epoch; } protected: - explicit BufferBlock(VAddr cpu_addr, const std::size_t size) : size{size} { - SetCpuAddr(cpu_addr); + explicit BufferBlock(VAddr cpu_addr_, std::size_t size_) : size{size_} { + SetCpuAddr(cpu_addr_); } - ~BufferBlock() = default; private: VAddr cpu_addr{}; |