summaryrefslogtreecommitdiffstats
path: root/src/video_core/buffer_cache/buffer_block.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/video_core/buffer_cache/buffer_block.h')
-rw-r--r--src/video_core/buffer_cache/buffer_block.h42
1 files changed, 17 insertions, 25 deletions
diff --git a/src/video_core/buffer_cache/buffer_block.h b/src/video_core/buffer_cache/buffer_block.h
index 4b9193182..e35ee0b67 100644
--- a/src/video_core/buffer_cache/buffer_block.h
+++ b/src/video_core/buffer_cache/buffer_block.h
@@ -15,37 +15,29 @@ namespace VideoCommon {
class BufferBlock {
public:
- bool Overlaps(const CacheAddr start, const CacheAddr end) const {
- return (cache_addr < end) && (cache_addr_end > start);
+ bool Overlaps(const VAddr start, const VAddr end) const {
+ return (cpu_addr < end) && (cpu_addr_end > start);
}
- bool IsInside(const CacheAddr other_start, const CacheAddr other_end) const {
- return cache_addr <= other_start && other_end <= cache_addr_end;
+ bool IsInside(const VAddr other_start, const VAddr other_end) const {
+ return cpu_addr <= other_start && other_end <= cpu_addr_end;
}
- u8* GetWritableHostPtr() const {
- return FromCacheAddr(cache_addr);
+ std::size_t GetOffset(const VAddr in_addr) {
+ return static_cast<std::size_t>(in_addr - cpu_addr);
}
- u8* GetWritableHostPtr(std::size_t offset) const {
- return FromCacheAddr(cache_addr + offset);
+ VAddr GetCpuAddr() const {
+ return cpu_addr;
}
- std::size_t GetOffset(const CacheAddr in_addr) {
- return static_cast<std::size_t>(in_addr - cache_addr);
+ VAddr GetCpuAddrEnd() const {
+ return cpu_addr_end;
}
- CacheAddr GetCacheAddr() const {
- return cache_addr;
- }
-
- CacheAddr GetCacheAddrEnd() const {
- return cache_addr_end;
- }
-
- void SetCacheAddr(const CacheAddr new_addr) {
- cache_addr = new_addr;
- cache_addr_end = new_addr + size;
+ void SetCpuAddr(const VAddr new_addr) {
+ cpu_addr = new_addr;
+ cpu_addr_end = new_addr + size;
}
std::size_t GetSize() const {
@@ -61,14 +53,14 @@ public:
}
protected:
- explicit BufferBlock(CacheAddr cache_addr, const std::size_t size) : size{size} {
- SetCacheAddr(cache_addr);
+ explicit BufferBlock(VAddr cpu_addr, const std::size_t size) : size{size} {
+ SetCpuAddr(cpu_addr);
}
~BufferBlock() = default;
private:
- CacheAddr cache_addr{};
- CacheAddr cache_addr_end{};
+ VAddr cpu_addr{};
+ VAddr cpu_addr_end{};
std::size_t size{};
u64 epoch{};
};