18#define RGB9E5_EXPONENT_BITS 5
19#define RGB9E5_MANTISSA_BITS 9
20#define RGB9E5_EXP_BIAS 15
21#define RGB9E5_MAX_VALID_BIASED_EXP 31
23#define MAX_RGB9E5_EXP (RGB9E5_MAX_VALID_BIASED_EXP - RGB9E5_EXP_BIAS)
24#define RGB9E5_MANTISSA_VALUES (1 << RGB9E5_MANTISSA_BITS)
25#define MAX_RGB9E5_MANTISSA (RGB9E5_MANTISSA_VALUES - 1)
33 return biased_exponent - 127;
49 constexpr float max_rgb9e5 =
float(0xFF80u);
50 color =
clamp(color, 0.0f, max_rgb9e5);
52 float max_component =
max(
max(color.r, color.g), color.b);
56 int maxm = int(max_component / denom + 0.5f);
63 result.exp_shared = uint(exp_shared);
64 result.mantissa =
uint3(color / denom + 0.5f);
73 return result.mantissa.r | result.mantissa.g | result.mantissa.b | result.exp_shared;
VecBase< int, D > floatBitsToInt(VecOp< float, D >) RET
constexpr T clamp(T, U, U) RET
rgb9e5_t rgb9e5_from_float3(float3 color)
#define MAX_RGB9E5_MANTISSA
uint rgb9e5_encode(float3 color)
float3 rgb9e5_decode(uint data)
#define RGB9E5_MANTISSA_BITS
float rgb9e5_exponent_factor(int exponent)
int rgb9e5_floor_log2(float x)
VecBase< uint32_t, 3 > uint3
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float