diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-05-16 23:07:03 +0200 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-05-21 21:02:54 +0200 |
commit | 3b0baf746ea6863d38d90521abba95303f321bf3 (patch) | |
tree | 5c3b648e083919099f15a45f6e592efcd6e7bac3 /src/video_core/buffer_cache/map_interval.h | |
parent | buffer_cache: Minor style changes (diff) | |
download | yuzu-3b0baf746ea6863d38d90521abba95303f321bf3.tar yuzu-3b0baf746ea6863d38d90521abba95303f321bf3.tar.gz yuzu-3b0baf746ea6863d38d90521abba95303f321bf3.tar.bz2 yuzu-3b0baf746ea6863d38d90521abba95303f321bf3.tar.lz yuzu-3b0baf746ea6863d38d90521abba95303f321bf3.tar.xz yuzu-3b0baf746ea6863d38d90521abba95303f321bf3.tar.zst yuzu-3b0baf746ea6863d38d90521abba95303f321bf3.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/buffer_cache/map_interval.h | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/src/video_core/buffer_cache/map_interval.h b/src/video_core/buffer_cache/map_interval.h index 1e77012d9..ad4db0135 100644 --- a/src/video_core/buffer_cache/map_interval.h +++ b/src/video_core/buffer_cache/map_interval.h @@ -9,30 +9,32 @@ namespace VideoCommon { -struct MapIntervalBase { - constexpr explicit MapIntervalBase(VAddr start, VAddr end, GPUVAddr gpu_addr) noexcept +struct MapInterval { + constexpr explicit MapInterval() noexcept = default; + + constexpr explicit MapInterval(VAddr start, VAddr end, GPUVAddr gpu_addr) noexcept : start{start}, end{end}, gpu_addr{gpu_addr} {} - constexpr bool IsInside(const VAddr other_start, const VAddr other_end) const noexcept { + constexpr bool IsInside(VAddr other_start, VAddr other_end) const noexcept { return (start <= other_start && other_end <= end); } - constexpr void MarkAsModified(bool is_modified_, u64 ticks_) noexcept { - is_modified = is_modified_; - ticks = ticks_; - } - - constexpr bool operator==(const MapIntervalBase& rhs) const noexcept { + constexpr bool operator==(const MapInterval& rhs) const noexcept { return start == rhs.start && end == rhs.end; } - constexpr bool operator!=(const MapIntervalBase& rhs) const noexcept { + constexpr bool operator!=(const MapInterval& rhs) const noexcept { return !operator==(rhs); } - VAddr start; - VAddr end; - GPUVAddr gpu_addr; + constexpr void MarkAsModified(bool is_modified_, u64 ticks_) noexcept { + is_modified = is_modified_; + ticks = ticks_; + } + + VAddr start = 0; + VAddr end = 0; + GPUVAddr gpu_addr = 0; VAddr cpu_addr = 0; u64 ticks = 0; bool is_written = false; |