diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-06-09 23:27:59 +0200 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-06-09 23:30:49 +0200 |
commit | 6508cdd00351e51c7d5867c00da60781c133ade8 (patch) | |
tree | 4d86ffb3c43a37418235df2d980252bc9b3660b3 /src/video_core/buffer_cache/buffer_block.h | |
parent | Merge pull request #4040 from ReinUsesLisp/nv-transform-feedback (diff) | |
download | yuzu-6508cdd00351e51c7d5867c00da60781c133ade8.tar yuzu-6508cdd00351e51c7d5867c00da60781c133ade8.tar.gz yuzu-6508cdd00351e51c7d5867c00da60781c133ade8.tar.bz2 yuzu-6508cdd00351e51c7d5867c00da60781c133ade8.tar.lz yuzu-6508cdd00351e51c7d5867c00da60781c133ade8.tar.xz yuzu-6508cdd00351e51c7d5867c00da60781c133ade8.tar.zst yuzu-6508cdd00351e51c7d5867c00da60781c133ade8.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{}; |