Blender V5.3
gpu_shader_shared_exponent.bsl.hh File Reference

Go to the source code of this file.

Classes

struct  rgb9e5_t

Macros

#define RGB9E5_EXPONENT_BITS   5
#define RGB9E5_MANTISSA_BITS   9
#define RGB9E5_EXP_BIAS   15
#define RGB9E5_MAX_VALID_BIASED_EXP   31
#define MAX_RGB9E5_EXP   (RGB9E5_MAX_VALID_BIASED_EXP - RGB9E5_EXP_BIAS)
#define RGB9E5_MANTISSA_VALUES   (1 << RGB9E5_MANTISSA_BITS)
#define MAX_RGB9E5_MANTISSA   (RGB9E5_MANTISSA_VALUES - 1)

Functions

int rgb9e5_floor_log2 (float x)
float rgb9e5_exponent_factor (int exponent)
rgb9e5_t rgb9e5_from_float3 (float3 color)
uint rgb9e5_encode (float3 color)
float3 rgb9e5_decode (uint data)

Macro Definition Documentation

◆ MAX_RGB9E5_EXP

#define MAX_RGB9E5_EXP   (RGB9E5_MAX_VALID_BIASED_EXP - RGB9E5_EXP_BIAS)

Definition at line 23 of file gpu_shader_shared_exponent.bsl.hh.

◆ MAX_RGB9E5_MANTISSA

#define MAX_RGB9E5_MANTISSA   (RGB9E5_MANTISSA_VALUES - 1)

Definition at line 25 of file gpu_shader_shared_exponent.bsl.hh.

Referenced by rgb9e5_decode(), and rgb9e5_from_float3().

◆ RGB9E5_EXP_BIAS

#define RGB9E5_EXP_BIAS   15

Definition at line 20 of file gpu_shader_shared_exponent.bsl.hh.

Referenced by rgb9e5_exponent_factor(), and rgb9e5_from_float3().

◆ RGB9E5_EXPONENT_BITS

#define RGB9E5_EXPONENT_BITS   5

Software implementation of encoding and decoding of shared exponent texture as described by the OpenGL extension EXT_texture_shared_exponent Appendix https://registry.khronos.org/OpenGL/extensions/EXT/EXT_texture_shared_exponent.txt

This allows to read and write the RGB9_E5 format in a R32UI texture without explicit support on the hardware for this type. However, filtering is not supported in this case.

Definition at line 18 of file gpu_shader_shared_exponent.bsl.hh.

◆ RGB9E5_MANTISSA_BITS

#define RGB9E5_MANTISSA_BITS   9

◆ RGB9E5_MANTISSA_VALUES

#define RGB9E5_MANTISSA_VALUES   (1 << RGB9E5_MANTISSA_BITS)

Definition at line 24 of file gpu_shader_shared_exponent.bsl.hh.

◆ RGB9E5_MAX_VALID_BIASED_EXP

#define RGB9E5_MAX_VALID_BIASED_EXP   31

Definition at line 21 of file gpu_shader_shared_exponent.bsl.hh.

Function Documentation

◆ rgb9e5_decode()

◆ rgb9e5_encode()

◆ rgb9e5_exponent_factor()

float rgb9e5_exponent_factor ( int exponent)

◆ rgb9e5_floor_log2()

int rgb9e5_floor_log2 ( float x)

Definition at line 27 of file gpu_shader_shared_exponent.bsl.hh.

References floatBitsToInt, rgb9e5_floor_log2(), and x.

Referenced by rgb9e5_floor_log2(), and rgb9e5_from_float3().

◆ rgb9e5_from_float3()