diff options
| author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-05-16 18:07:03 -0300 |
|---|---|---|
| committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-05-21 16:02:54 -0300 |
| commit | 3b0baf746ea6863d38d90521abba95303f321bf3 (patch) | |
| tree | 5c3b648e083919099f15a45f6e592efcd6e7bac3 /src/video_core/buffer_cache/map_interval.h | |
| parent | 599274e3f0d97c36b31016ba63dcc300d0cf8f6a (diff) | |
buffer_cache: Remove shared pointers
Removing shared pointers is a first step to be able to use intrusive
objects and keep allocations close to one another in memory.
Diffstat (limited to 'src/video_core/buffer_cache/map_interval.h')
| -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; |
