upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/runtime/src
diff options
context:
space:
mode:
authorkingzzim7-create <275977600+kingzzim7-create@users.noreply.github.com>2026-11-23 04:50:37 +0500
committerkingzzim7-create <275977600+kingzzim7-create@users.noreply.github.com>2026-11-23 04:50:37 +0500
commite5f08f06bfdb23fd27fa6174f1fa17b1b20aafcb (patch)
tree27f6d211e780069d7979ffffee2f553af24e2c08 /runtime/src
parentaa2988cc555bad7ecd508b48a702adbb32fe7c95 (diff)
uav_clear.h: discard frexp's mantissa explicitly (fixes MSVC C4834)
Diffstat (limited to 'runtime/src')
-rw-r--r--runtime/src/uav_clear.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/runtime/src/uav_clear.h b/runtime/src/uav_clear.h
index 226868475..b73ec50e1 100644
--- a/runtime/src/uav_clear.h
+++ b/runtime/src/uav_clear.h
@@ -203,7 +203,7 @@ inline std::uint32_t to_rgb9e5(float r, float g, float b) {
203 const float max_c = std::max(r, std::max(g, b)); 203 const float max_c = std::max(r, std::max(g, b));
204 if (max_c == 0.0f) return 0u; 204 if (max_c == 0.0f) return 0u;
205 int exp_raw = 0; 205 int exp_raw = 0;
206 std::frexp(max_c, &exp_raw); // floor(log2(max_c)) == exp_raw - 1 206 (void)std::frexp(max_c, &exp_raw); // floor(log2(max_c)) == exp_raw - 1
207 int exp_shared = std::max(0, exp_raw + 15); 207 int exp_shared = std::max(0, exp_raw + 15);
208 double denom = std::ldexp(1.0, exp_shared - 24); // 2^(exp_shared - 15 - 9) 208 double denom = std::ldexp(1.0, exp_shared - 24); // 2^(exp_shared - 15 - 9)
209 const int max_m = static_cast<int>(std::floor(double(max_c) / denom + 0.5)); 209 const int max_m = static_cast<int>(std::floor(double(max_c) / denom + 0.5));