• Advertisement
Sign in to follow this  

Custom preprocessor directives in HLSL

This topic is 3733 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Is it possible to define a custom preprocessor directive in HLSL? For example, let's say I wanted to make something like:
#CUSTOM_PREPROCESSOR

Can I define a setting in the compiler to execute a certain macro when the given directive is found in a file?

Share this post


Link to post
Share on other sites
Advertisement
FoxHunter2 is correct if you only want conditional compilation of c-style constants, but for anything more elaborate (like true macros or pragmas) you're out of luck with the standard HLSL compiler.

I'm sure there will be other regular text parsing/processing tools that can offer this functionality if you really need it. Ultimately the C/C++ compilers tend to run this stuff as a pre-processing pass before sending it on to the real compiler...

hth
Jack

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement