diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-03-14 02:26:48 +0100 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-03-14 02:26:48 +0100 |
commit | 835a3d09c67eb5a028e5594f64490135b7b423a4 (patch) | |
tree | d40a11e2c7223f31f795fa147b99a45a8112cd64 /src | |
parent | astc: Use common types instead of stdint.h integer types (diff) | |
download | yuzu-835a3d09c67eb5a028e5594f64490135b7b423a4.tar yuzu-835a3d09c67eb5a028e5594f64490135b7b423a4.tar.gz yuzu-835a3d09c67eb5a028e5594f64490135b7b423a4.tar.bz2 yuzu-835a3d09c67eb5a028e5594f64490135b7b423a4.tar.lz yuzu-835a3d09c67eb5a028e5594f64490135b7b423a4.tar.xz yuzu-835a3d09c67eb5a028e5594f64490135b7b423a4.tar.zst yuzu-835a3d09c67eb5a028e5594f64490135b7b423a4.zip |
Diffstat (limited to 'src')
-rw-r--r-- | src/video_core/textures/astc.cpp | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/video_core/textures/astc.cpp b/src/video_core/textures/astc.cpp index dcfab4dad..aba47a0e8 100644 --- a/src/video_core/textures/astc.cpp +++ b/src/video_core/textures/astc.cpp @@ -25,6 +25,19 @@ #include "video_core/textures/astc.h" +namespace { + +/// Count the number of bits set in a number. +constexpr u32 Popcnt(u32 n) { + u32 c = 0; + for (; n; c++) { + n &= n - 1; + } + return c; +} + +} // Anonymous namespace + class InputBitStream { public: explicit InputBitStream(const unsigned char* ptr, int start_offset = 0) @@ -212,15 +225,6 @@ public: return totalBits; } - // Count the number of bits set in a number. - static inline u32 Popcnt(u32 n) { - u32 c; - for (c = 0; n; c++) { - n &= n - 1; - } - return c; - } - // Returns a new instance of this struct that corresponds to the // can take no more than maxval values static IntegerEncodedValue CreateEncoding(u32 maxVal) { |