diff options
| author | 2019-07-05 13:39:13 -0400 | |
|---|---|---|
| committer | 2019-07-05 13:39:13 -0400 | |
| commit | 772c86a260eb446b0fe4232b0a50666511bef25c (patch) | |
| tree | 013d92268c06454c93565c83eff2b79b56a00839 /src/common/alignment.h | |
| parent | Merge pull request #2669 from FearlessTobi/move-cpujit-setting (diff) | |
| parent | texture_cache: Address Feedback (diff) | |
| download | yuzu-772c86a260eb446b0fe4232b0a50666511bef25c.tar.gz yuzu-772c86a260eb446b0fe4232b0a50666511bef25c.tar.xz yuzu-772c86a260eb446b0fe4232b0a50666511bef25c.zip | |
Merge pull request #2601 from FernandoS27/texture_cache
Implement a new Texture Cache
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 d94a2291f..617b14d9b 100644 --- a/src/common/alignment.h +++ b/src/common/alignment.h | |||
| @@ -20,6 +20,12 @@ constexpr T AlignDown(T value, std::size_t size) { | |||
| 20 | } | 20 | } |
| 21 | 21 | ||
| 22 | template <typename T> | 22 | template <typename T> |
| 23 | constexpr T AlignBits(T value, std::size_t align) { | ||
| 24 | static_assert(std::is_unsigned_v<T>, "T must be an unsigned value."); | ||
| 25 | return static_cast<T>((value + ((1ULL << align) - 1)) >> align << align); | ||
| 26 | } | ||
| 27 | |||
| 28 | template <typename T> | ||
| 23 | constexpr bool Is4KBAligned(T value) { | 29 | constexpr bool Is4KBAligned(T value) { |
| 24 | static_assert(std::is_unsigned_v<T>, "T must be an unsigned value."); | 30 | static_assert(std::is_unsigned_v<T>, "T must be an unsigned value."); |
| 25 | return (value & 0xFFF) == 0; | 31 | return (value & 0xFFF) == 0; |