summaryrefslogtreecommitdiff
path: root/src/common/div_ceil.h
diff options
context:
space:
mode:
authorGravatar Morph2023-01-29 19:52:38 -0500
committerGravatar GitHub2023-01-29 19:52:38 -0500
commit5f4647df7da58aa22be21dd26cfa6de7c5f106c9 (patch)
tree4bbcaee76bde35ddc6eff9a1c639866cf278b353 /src/common/div_ceil.h
parentMerge pull request #9699 from ameerj/texture-pass-desc (diff)
parentMove to Clang Format 15 (diff)
downloadyuzu-5f4647df7da58aa22be21dd26cfa6de7c5f106c9.tar.gz
yuzu-5f4647df7da58aa22be21dd26cfa6de7c5f106c9.tar.xz
yuzu-5f4647df7da58aa22be21dd26cfa6de7c5f106c9.zip
Merge pull request #9705 from behunin/patch-1
Move to Clang Format 15
Diffstat (limited to 'src/common/div_ceil.h')
-rw-r--r--src/common/div_ceil.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/common/div_ceil.h b/src/common/div_ceil.h
index eebc279c2..c12477d42 100644
--- a/src/common/div_ceil.h
+++ b/src/common/div_ceil.h
@@ -10,14 +10,14 @@ namespace Common {
10 10
11/// Ceiled integer division. 11/// Ceiled integer division.
12template <typename N, typename D> 12template <typename N, typename D>
13requires std::is_integral_v<N> && std::is_unsigned_v<D> 13 requires std::is_integral_v<N> && std::is_unsigned_v<D>
14[[nodiscard]] constexpr N DivCeil(N number, D divisor) { 14[[nodiscard]] constexpr N DivCeil(N number, D divisor) {
15 return static_cast<N>((static_cast<D>(number) + divisor - 1) / divisor); 15 return static_cast<N>((static_cast<D>(number) + divisor - 1) / divisor);
16} 16}
17 17
18/// Ceiled integer division with logarithmic divisor in base 2 18/// Ceiled integer division with logarithmic divisor in base 2
19template <typename N, typename D> 19template <typename N, typename D>
20requires std::is_integral_v<N> && std::is_unsigned_v<D> 20 requires std::is_integral_v<N> && std::is_unsigned_v<D>
21[[nodiscard]] constexpr N DivCeilLog2(N value, D alignment_log2) { 21[[nodiscard]] constexpr N DivCeilLog2(N value, D alignment_log2) {
22 return static_cast<N>((static_cast<D>(value) + (D(1) << alignment_log2) - 1) >> alignment_log2); 22 return static_cast<N>((static_cast<D>(value) + (D(1) << alignment_log2) - 1) >> alignment_log2);
23} 23}