diff options
author | Rodrigo Locatti <reinuseslisp@airmail.cc> | 2020-12-07 08:57:40 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-07 08:57:40 +0100 |
commit | 3ef35207c1f03cfb0de75f511566582d587db084 (patch) | |
tree | 97f4a13530a49e517105139da56f8e703d98f991 | |
parent | Merge pull request #5158 from lioncash/video-fmt (diff) | |
parent | buffer_block: Mark interface as nodiscard where applicable (diff) | |
download | yuzu-3ef35207c1f03cfb0de75f511566582d587db084.tar yuzu-3ef35207c1f03cfb0de75f511566582d587db084.tar.gz yuzu-3ef35207c1f03cfb0de75f511566582d587db084.tar.bz2 yuzu-3ef35207c1f03cfb0de75f511566582d587db084.tar.lz yuzu-3ef35207c1f03cfb0de75f511566582d587db084.tar.xz yuzu-3ef35207c1f03cfb0de75f511566582d587db084.tar.zst yuzu-3ef35207c1f03cfb0de75f511566582d587db084.zip |
-rw-r--r-- | src/video_core/buffer_cache/buffer_block.h | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/src/video_core/buffer_cache/buffer_block.h b/src/video_core/buffer_cache/buffer_block.h index e64170e66..e9306194a 100644 --- a/src/video_core/buffer_cache/buffer_block.h +++ b/src/video_core/buffer_cache/buffer_block.h @@ -4,34 +4,29 @@ #pragma once -#include <unordered_set> -#include <utility> - -#include "common/alignment.h" #include "common/common_types.h" -#include "video_core/gpu.h" namespace VideoCommon { class BufferBlock { public: - bool Overlaps(VAddr start, VAddr end) const { + [[nodiscard]] bool Overlaps(VAddr start, VAddr end) const { return (cpu_addr < end) && (cpu_addr_end > start); } - bool IsInside(VAddr other_start, VAddr other_end) const { + [[nodiscard]] bool IsInside(VAddr other_start, VAddr other_end) const { return cpu_addr <= other_start && other_end <= cpu_addr_end; } - std::size_t Offset(VAddr in_addr) const { + [[nodiscard]] std::size_t Offset(VAddr in_addr) const { return static_cast<std::size_t>(in_addr - cpu_addr); } - VAddr CpuAddr() const { + [[nodiscard]] VAddr CpuAddr() const { return cpu_addr; } - VAddr CpuAddrEnd() const { + [[nodiscard]] VAddr CpuAddrEnd() const { return cpu_addr_end; } @@ -40,11 +35,11 @@ public: cpu_addr_end = new_addr + size; } - std::size_t Size() const { + [[nodiscard]] std::size_t Size() const { return size; } - u64 Epoch() const { + [[nodiscard]] u64 Epoch() const { return epoch; } |