Skip to content

ifdefs around #pragma dxc in shader throws boost preprocess error #932

@keptsecret

Description

@keptsecret

#include-ing these files in your shader causes a boost preprocessor error when compiling the shader in NSC

[ERROR]: boost::wave::preprocess_exception exception caught. warning: unbalanced #if/#endif in include file

due to the ifdefs around each #pragma dxc call

#ifdef __HLSL_VERSION
#pragma dxc diagnostic push
#pragma dxc diagnostic ignored "-Wliteral-range"
#endif
const T thresholds[4] = { 0, 5e4, 1e36, 1e305 }; // threshold values gotten from testing when the function returns nan/inf
#ifdef __HLSL_VERSION
#pragma dxc diagnostic pop
#endif

#ifdef __HLSL_VERSION
#pragma dxc diagnostic push
#pragma dxc diagnostic ignored "-Wliteral-range"
#endif
const T thresholds[4] = { 0, 2e4, 1e6, 1e15 }; // threshold values gotten from testing when the function returns nan/inf/1
#ifdef __HLSL_VERSION
#pragma dxc diagnostic pop
#endif

assert(x >= T(0.999) && y >= T(0.999));
#ifdef __HLSL_VERSION
#pragma dxc diagnostic push
#pragma dxc diagnostic ignored "-Wliteral-range"
#endif
const T thresholds[4] = { 0, 5e5, 1e6, 1e15 }; // threshold values gotten from testing when the function returns nan/inf/1
#ifdef __HLSL_VERSION
#pragma dxc diagnostic pop
#endif
if (x+y > thresholds[mpl::find_lsb_v<sizeof(T)>])
return T(0.0);

Will comment them out for now and link temp fix commit to this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions