summaryrefslogtreecommitdiffstats
path: root/src/common
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2019-05-10 09:17:48 +0200
committerReinUsesLisp <reinuseslisp@airmail.cc>2019-06-21 02:36:12 +0200
commit345e73f2feb0701e3c3099d002a1c21fb524eae4 (patch)
treec8c934dfec804d04a29f8ee27124274f5f999fb8 /src/common
parenttexture_cache: Change internal cache from lists to vectors (diff)
downloadyuzu-345e73f2feb0701e3c3099d002a1c21fb524eae4.tar
yuzu-345e73f2feb0701e3c3099d002a1c21fb524eae4.tar.gz
yuzu-345e73f2feb0701e3c3099d002a1c21fb524eae4.tar.bz2
yuzu-345e73f2feb0701e3c3099d002a1c21fb524eae4.tar.lz
yuzu-345e73f2feb0701e3c3099d002a1c21fb524eae4.tar.xz
yuzu-345e73f2feb0701e3c3099d002a1c21fb524eae4.tar.zst
yuzu-345e73f2feb0701e3c3099d002a1c21fb524eae4.zip
Diffstat (limited to 'src/common')
-rw-r--r--src/common/alignment.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/common/alignment.h b/src/common/alignment.h
index d94a2291f..3379a6967 100644
--- a/src/common/alignment.h
+++ b/src/common/alignment.h
@@ -20,6 +20,11 @@ constexpr T AlignDown(T value, std::size_t size) {
}
template <typename T>
+constexpr T AlignBits(T value, T align) {
+ return (value + ((1 << align) - 1)) >> align << align;
+}
+
+template <typename T>
constexpr bool Is4KBAligned(T value) {
static_assert(std::is_unsigned_v<T>, "T must be an unsigned value.");
return (value & 0xFFF) == 0;