diff options
author | arades79 <scravers@protonmail.com> | 2023-02-11 19:28:03 +0100 |
---|---|---|
committer | arades79 <scravers@protonmail.com> | 2023-02-14 18:33:11 +0100 |
commit | 45e13b03f372230dbf780f3fa87dd88f388af605 (patch) | |
tree | 555593e7e5016b6ba2a777d7417ada244abce458 /src/video_core/engines/sw_blitter/converter.cpp | |
parent | Merge pull request #9795 from Kelebek1/biquad_fix (diff) | |
download | yuzu-45e13b03f372230dbf780f3fa87dd88f388af605.tar yuzu-45e13b03f372230dbf780f3fa87dd88f388af605.tar.gz yuzu-45e13b03f372230dbf780f3fa87dd88f388af605.tar.bz2 yuzu-45e13b03f372230dbf780f3fa87dd88f388af605.tar.lz yuzu-45e13b03f372230dbf780f3fa87dd88f388af605.tar.xz yuzu-45e13b03f372230dbf780f3fa87dd88f388af605.tar.zst yuzu-45e13b03f372230dbf780f3fa87dd88f388af605.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/engines/sw_blitter/converter.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/video_core/engines/sw_blitter/converter.cpp b/src/video_core/engines/sw_blitter/converter.cpp index 2419b5632..11674c748 100644 --- a/src/video_core/engines/sw_blitter/converter.cpp +++ b/src/video_core/engines/sw_blitter/converter.cpp @@ -694,16 +694,16 @@ private: }; const auto force_to_fp16 = [](f32 base_value) { u32 tmp = Common::BitCast<u32>(base_value); - constexpr size_t fp32_mantissa_bits = 23; - constexpr size_t fp16_mantissa_bits = 10; - constexpr size_t mantissa_mask = + constexpr static size_t fp32_mantissa_bits = 23; + constexpr static size_t fp16_mantissa_bits = 10; + constexpr static size_t mantissa_mask = ~((1ULL << (fp32_mantissa_bits - fp16_mantissa_bits)) - 1ULL); tmp = tmp & static_cast<u32>(mantissa_mask); // TODO: force the exponent within the range of half float. Not needed in UNORM / SNORM return Common::BitCast<f32>(tmp); }; const auto from_fp_n = [&sign_extend](u32 base_value, size_t bits, size_t mantissa) { - constexpr size_t fp32_mantissa_bits = 23; + constexpr static size_t fp32_mantissa_bits = 23; size_t shift_towards = fp32_mantissa_bits - mantissa; const u32 new_value = static_cast<u32>(sign_extend(base_value, bits) << shift_towards) & (~(1U << 31)); @@ -770,7 +770,7 @@ private: component_mask[which_component]; }; const auto to_fp_n = [](f32 base_value, size_t bits, size_t mantissa) { - constexpr size_t fp32_mantissa_bits = 23; + constexpr static size_t fp32_mantissa_bits = 23; u32 tmp_value = Common::BitCast<u32>(std::max(base_value, 0.0f)); size_t shift_towards = fp32_mantissa_bits - mantissa; return tmp_value >> shift_towards; |