aboutsummaryrefslogtreecommitdiff
path: root/src/video_core/buffer_cache/buffer_cache.h
diff options
context:
space:
mode:
authorarades79 <scravers@protonmail.com>2023-02-11 13:28:03 -0500
committerarades79 <scravers@protonmail.com>2023-02-14 12:33:11 -0500
commit45e13b03f372230dbf780f3fa87dd88f388af605 (patch)
tree555593e7e5016b6ba2a777d7417ada244abce458 /src/video_core/buffer_cache/buffer_cache.h
parent5f5a6e4b2e541e86c0bfdb99e3acfbbebe89a5d3 (diff)
add static lifetime to constexpr values to force compile time evaluation where possible
Signed-off-by: arades79 <scravers@protonmail.com>
Diffstat (limited to 'src/video_core/buffer_cache/buffer_cache.h')
-rw-r--r--src/video_core/buffer_cache/buffer_cache.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/video_core/buffer_cache/buffer_cache.h b/src/video_core/buffer_cache/buffer_cache.h
index 627917ab6..b650d0e59 100644
--- a/src/video_core/buffer_cache/buffer_cache.h
+++ b/src/video_core/buffer_cache/buffer_cache.h
@@ -890,8 +890,8 @@ void BufferCache<P>::CommitAsyncFlushesHigh() {
buffer_id,
});
// Align up to avoid cache conflicts
- constexpr u64 align = 8ULL;
- constexpr u64 mask = ~(align - 1ULL);
+ constexpr static u64 align = 8ULL;
+ constexpr static u64 mask = ~(align - 1ULL);
total_size_bytes += (new_size + align - 1) & mask;
largest_copy = std::max(largest_copy, new_size);
};
@@ -1843,8 +1843,8 @@ void BufferCache<P>::DownloadBufferMemory(Buffer& buffer, VAddr cpu_addr, u64 si
.size = new_size,
});
// Align up to avoid cache conflicts
- constexpr u64 align = 256ULL;
- constexpr u64 mask = ~(align - 1ULL);
+ constexpr static u64 align = 256ULL;
+ constexpr static u64 mask = ~(align - 1ULL);
total_size_bytes += (new_size + align - 1) & mask;
largest_copy = std::max(largest_copy, new_size);
};