Jump to content
  • Advertisement
Sign in to follow this  
Erkokite

Custom preprocessor directives in HLSL

This topic is 4004 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
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!