diff options
| author | 2020-12-07 04:57:40 -0300 | |
|---|---|---|
| committer | 2020-12-07 04:57:40 -0300 | |
| 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.gz yuzu-3ef35207c1f03cfb0de75f511566582d587db084.tar.xz yuzu-3ef35207c1f03cfb0de75f511566582d587db084.zip | |
Merge pull request #5160 from lioncash/buffer-header
buffer_block: Remove unnecessary includes
| -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 @@ | |||
| 4 | 4 | ||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| 7 | #include <unordered_set> | ||
| 8 | #include <utility> | ||
| 9 | |||
| 10 | #include "common/alignment.h" | ||
| 11 | #include "common/common_types.h" | 7 | #include "common/common_types.h" |
| 12 | #include "video_core/gpu.h" | ||
| 13 | 8 | ||
| 14 | namespace VideoCommon { | 9 | namespace VideoCommon { |
| 15 | 10 | ||
| 16 | class BufferBlock { | 11 | class BufferBlock { |
| 17 | public: | 12 | public: |
| 18 | bool Overlaps(VAddr start, VAddr end) const { | 13 | [[nodiscard]] bool Overlaps(VAddr start, VAddr end) const { |
| 19 | return (cpu_addr < end) && (cpu_addr_end > start); | 14 | return (cpu_addr < end) && (cpu_addr_end > start); |
| 20 | } | 15 | } |
| 21 | 16 | ||
| 22 | bool IsInside(VAddr other_start, VAddr other_end) const { | 17 | [[nodiscard]] bool IsInside(VAddr other_start, VAddr other_end) const { |
| 23 | return cpu_addr <= other_start && other_end <= cpu_addr_end; | 18 | return cpu_addr <= other_start && other_end <= cpu_addr_end; |
| 24 | } | 19 | } |
| 25 | 20 | ||
| 26 | std::size_t Offset(VAddr in_addr) const { | 21 | [[nodiscard]] std::size_t Offset(VAddr in_addr) const { |
| 27 | return static_cast<std::size_t>(in_addr - cpu_addr); | 22 | return static_cast<std::size_t>(in_addr - cpu_addr); |
| 28 | } | 23 | } |
| 29 | 24 | ||
| 30 | VAddr CpuAddr() const { | 25 | [[nodiscard]] VAddr CpuAddr() const { |
| 31 | return cpu_addr; | 26 | return cpu_addr; |
| 32 | } | 27 | } |
| 33 | 28 | ||
| 34 | VAddr CpuAddrEnd() const { | 29 | [[nodiscard]] VAddr CpuAddrEnd() const { |
| 35 | return cpu_addr_end; | 30 | return cpu_addr_end; |
| 36 | } | 31 | } |
| 37 | 32 | ||
| @@ -40,11 +35,11 @@ public: | |||
| 40 | cpu_addr_end = new_addr + size; | 35 | cpu_addr_end = new_addr + size; |
| 41 | } | 36 | } |
| 42 | 37 | ||
| 43 | std::size_t Size() const { | 38 | [[nodiscard]] std::size_t Size() const { |
| 44 | return size; | 39 | return size; |
| 45 | } | 40 | } |
| 46 | 41 | ||
| 47 | u64 Epoch() const { | 42 | [[nodiscard]] u64 Epoch() const { |
| 48 | return epoch; | 43 | return epoch; |
| 49 | } | 44 | } |
| 50 | 45 | ||