Blender V5.3
gpu_shader_utildefines.bsl.hh File Reference

Go to the source code of this file.

Macros

#define FLT_11_MAX   uintBitsToFloat(0x477E0000)
#define FLT_10_MAX   uintBitsToFloat(0x477C0000)
#define FLT_11_11_10_MAX   float3(FLT_11_MAX, FLT_11_MAX, FLT_10_MAX)
#define UNPACK2(a)
#define UNPACK3(a)
#define UNPACK4(a)
#define in_range_inclusive(val, min_v, max_v)
#define in_range_exclusive(val, min_v, max_v)
#define in_texture_range(texel, tex)
#define in_image_range(texel, tex)
#define weighted_sum(val0, val1, val2, val3, weights)

Functions

bool flag_test (uint flag, uint val)
bool flag_test (int flag, uint val)
bool flag_test (int flag, int val)
void set_flag_from_test (uint &value, bool test, uint flag)
void set_flag_from_test (int &value, bool test, int flag)
bool bitmask64_test (uint2 bitmask, uint bit_index)
uint packUvec2x16 (uint2 a)
uint2 unpackUvec2x16 (uint a)
uint packUvec4x8 (uint4 a)
uint4 unpackUvec4x8 (uint a)
int floatBitsToOrderedInt (float value)
float orderedIntBitsToFloat (int int_value)

Macro Definition Documentation

◆ FLT_10_MAX

#define FLT_10_MAX   uintBitsToFloat(0x477C0000)

Definition at line 10 of file gpu_shader_utildefines.bsl.hh.

◆ FLT_11_11_10_MAX

◆ FLT_11_MAX

#define FLT_11_MAX   uintBitsToFloat(0x477E0000)

Definition at line 9 of file gpu_shader_utildefines.bsl.hh.

◆ in_image_range

#define in_image_range ( texel,
tex )
Value:
(all(greaterThanEqual(texel, int2(0))) && all(lessThan(texel, imageSize(tex).xy)))
VecBase< bool, D > greaterThanEqual(VecOp< T, D >, VecOp< T, D >) RET
bool all(VecOp< bool, D >) RET
VecBase< bool, D > lessThan(VecOp< T, D >, VecOp< T, D >) RET
IMG_TEMPLATE SizeVec imageSize(const T &) RET

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

Referenced by eevee::raytracing::denoise::DenoiseTemporal::local_statistics_get(), eevee::raytracing::denoise::spatial_main(), eevee::raytracing::denoise::temporal_main(), and eevee::raytracing::tile_compact().

◆ in_range_exclusive

#define in_range_exclusive ( val,
min_v,
max_v )
Value:
(all(greaterThan(val, min_v)) && all(lessThan(val, max_v)))
VecBase< bool, D > greaterThan(VecOp< T, D >, VecOp< T, D >) RET

Definition at line 19 of file gpu_shader_utildefines.bsl.hh.

Referenced by eevee::raytracing::denoise::DenoiseTemporal::variance_history_sample().

◆ in_range_inclusive

#define in_range_inclusive ( val,
min_v,
max_v )
Value:
(all(greaterThanEqual(val, min_v)) && all(lessThanEqual(val, max_v)))
VecBase< bool, D > lessThanEqual(VecOp< T, D >, VecOp< T, D >) RET

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

Referenced by eevee::shadow::usage::tag_usage_opaque(), and eevee::shadow::tilemap_init_main().

◆ in_texture_range

#define in_texture_range ( texel,
tex )

◆ UNPACK2

#define UNPACK2 ( a)
Value:
(a)[0], (a)[1]

Definition at line 13 of file gpu_shader_utildefines.bsl.hh.

◆ UNPACK3

#define UNPACK3 ( a)
Value:
(a)[0], (a)[1], (a)[2]

Definition at line 14 of file gpu_shader_utildefines.bsl.hh.

◆ UNPACK4

#define UNPACK4 ( a)
Value:
(a)[0], (a)[1], (a)[2], (a)[3]

Definition at line 15 of file gpu_shader_utildefines.bsl.hh.

◆ weighted_sum

#define weighted_sum ( val0,
val1,
val2,
val3,
weights )
Value:
((val0 * weights[0] + val1 * weights[1] + val2 * weights[2] + val3 * weights[3]) * safe_rcp(weights[0] + weights[1] + weights[2] + weights[3]))
float safe_rcp(float a)

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

Referenced by blender::nodes::node_composite_kuwahara_cc::ConvertKuwaharaOperation::execute_anisotropic_cpu().

Function Documentation

◆ bitmask64_test()

bool bitmask64_test ( uint2 bitmask,
uint bit_index )

Return true if the bit inside bitmask at bit_index is set high. Assume the lower bits are inside first component of bitmask,

Definition at line 62 of file gpu_shader_utildefines.bsl.hh.

References bitmask64_test(), flag_test(), uint2::x, and uint2::y.

Referenced by bitmask64_test(), eevee::light::light_linking_affects_receiver(), and eevee::shadow::ViewVisibility::shadow_linking_affects_caster().

◆ flag_test() [1/3]

bool flag_test ( int flag,
int val )

Definition at line 34 of file gpu_shader_utildefines.bsl.hh.

References flag_test().

◆ flag_test() [2/3]

bool flag_test ( int flag,
uint val )

Definition at line 30 of file gpu_shader_utildefines.bsl.hh.

References flag_test().

◆ flag_test() [3/3]

◆ floatBitsToOrderedInt()

int floatBitsToOrderedInt ( float value)

◆ orderedIntBitsToFloat()

◆ packUvec2x16()

uint packUvec2x16 ( uint2 a)

Pack two 16-bit uint into one 32-bit uint.

Definition at line 71 of file gpu_shader_utildefines.bsl.hh.

References packUvec2x16(), uint2::x, and uint2::y.

Referenced by packUvec2x16(), eevee::subsurface::setup_main(), and eevee::raytracing::tile_compact().

◆ packUvec4x8()

uint packUvec4x8 ( uint4 a)

Pack four 8-bit uint into one 32-bit uint.

Definition at line 84 of file gpu_shader_utildefines.bsl.hh.

References packUvec4x8(), uint4::w, uint4::x, uint4::y, and uint4::z.

Referenced by packUvec4x8(), and eevee::shadow::rendermap_finalize_main().

◆ set_flag_from_test() [1/2]

void set_flag_from_test ( int & value,
bool test,
int flag )

Definition at line 48 of file gpu_shader_utildefines.bsl.hh.

References set_flag_from_test().

◆ set_flag_from_test() [2/2]

void set_flag_from_test ( uint & value,
bool test,
uint flag )

◆ unpackUvec2x16()

◆ unpackUvec4x8()

uint4 unpackUvec4x8 ( uint a)

Definition at line 89 of file gpu_shader_utildefines.bsl.hh.

References unpackUvec4x8().

Referenced by unpackUvec4x8().