diff options
author | Lioncash <mathew1800@gmail.com> | 2018-10-18 18:55:27 +0200 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2018-10-18 18:57:02 +0200 |
commit | d27f4a4928f493f9e7a2987ad93e6be918b70f6c (patch) | |
tree | 9b5c2faf236744707520c788dc4cdfde68c7e045 /src/common/alignment.h | |
parent | Merge pull request #1510 from lioncash/xci (diff) | |
download | yuzu-d27f4a4928f493f9e7a2987ad93e6be918b70f6c.tar yuzu-d27f4a4928f493f9e7a2987ad93e6be918b70f6c.tar.gz yuzu-d27f4a4928f493f9e7a2987ad93e6be918b70f6c.tar.bz2 yuzu-d27f4a4928f493f9e7a2987ad93e6be918b70f6c.tar.lz yuzu-d27f4a4928f493f9e7a2987ad93e6be918b70f6c.tar.xz yuzu-d27f4a4928f493f9e7a2987ad93e6be918b70f6c.tar.zst yuzu-d27f4a4928f493f9e7a2987ad93e6be918b70f6c.zip |
Diffstat (limited to 'src/common/alignment.h')
-rw-r--r-- | src/common/alignment.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/common/alignment.h b/src/common/alignment.h index 225770fab..b3f103c07 100644 --- a/src/common/alignment.h +++ b/src/common/alignment.h @@ -19,4 +19,10 @@ constexpr T AlignDown(T value, std::size_t size) { return static_cast<T>(value - value % size); } +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; +} + } // namespace Common |