Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions include/nbl/builtin/hlsl/bxdf/common.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -941,14 +941,15 @@ struct beta
{
assert(x >= T(0.999) && y >= T(0.999));

#ifdef __HLSL_VERSION
// currently throws a boost preprocess error, see: https://github.com/Devsh-Graphics-Programming/Nabla/issues/932
// #ifdef __HLSL_VERSION
#pragma dxc diagnostic push
#pragma dxc diagnostic ignored "-Wliteral-range"
#endif
// #endif
const T thresholds[4] = { 0, 5e5, 1e6, 1e15 }; // threshold values gotten from testing when the function returns nan/inf/1
#ifdef __HLSL_VERSION
// #ifdef __HLSL_VERSION
#pragma dxc diagnostic pop
#endif
// #endif
if (x+y > thresholds[mpl::find_lsb_v<sizeof(T)>])
return T(0.0);

Expand Down
18 changes: 10 additions & 8 deletions include/nbl/builtin/hlsl/tgmath/impl.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -539,14 +539,15 @@ struct l2gamma_helper<T NBL_PARTIAL_REQ_BOT(concepts::FloatingPointScalar<T>) >
// implementation derived from Numerical Recipes in C, transformed for log2
static T __call(T x)
{
#ifdef __HLSL_VERSION
// currently throws a boost preprocess error, see: https://github.com/Devsh-Graphics-Programming/Nabla/issues/932
// #ifdef __HLSL_VERSION
#pragma dxc diagnostic push
#pragma dxc diagnostic ignored "-Wliteral-range"
#endif
// #endif
const T thresholds[4] = { 0, 5e4, 1e36, 1e305 }; // threshold values gotten from testing when the function returns nan/inf
#ifdef __HLSL_VERSION
// #ifdef __HLSL_VERSION
#pragma dxc diagnostic pop
#endif
// #endif
if (x > thresholds[mpl::find_lsb_v<sizeof(T)>])
return bit_cast<T>(numeric_limits<T>::infinity);

Expand Down Expand Up @@ -588,14 +589,15 @@ struct beta_helper<T NBL_PARTIAL_REQ_BOT(concepts::FloatingPointScalar<T>) >
// implementation from Numerical Recipes in C, 2nd ed.
static T __call(T v1, T v2)
{
#ifdef __HLSL_VERSION
// currently throws a boost preprocess error, see: https://github.com/Devsh-Graphics-Programming/Nabla/issues/932
// #ifdef __HLSL_VERSION
#pragma dxc diagnostic push
#pragma dxc diagnostic ignored "-Wliteral-range"
#endif
// #endif
const T thresholds[4] = { 0, 2e4, 1e6, 1e15 }; // threshold values gotten from testing when the function returns nan/inf/1
#ifdef __HLSL_VERSION
// #ifdef __HLSL_VERSION
#pragma dxc diagnostic pop
#endif
// #endif
if (v1+v2 > thresholds[mpl::find_lsb_v<sizeof(T)>])
return T(0.0);

Expand Down
Loading