Jump to content
  • Advertisement
Sign in to follow this  
xerzi

Vulkan SPIR-V Macro Compiling

This topic is 1267 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

There's no Vulkan subforum yet so..

 

I believe the Spir-v specification has been released, i was wondering if there was any sort of feature that would allow for shaders that use macros (in GLSL) to change the functionality of the shader. In most cases it would pretty much be a "static if" statement that just choose which block of code to run. Is there anything in the specification that complements this? Or would i essentially need to compile all variants of my shader and create an archive file to store and retrieve them appropriately?

Share this post


Link to post
Share on other sites
Advertisement

There's no runtime conditional compilation stuff in SPIR-V. You would create all variants, or use static/uniform/coherent branching to select. 

Share this post


Link to post
Share on other sites

Errr... SPIR-V is not a language, it's an IR/IL that aims to be simple to reduce the chance or driver errors. Such functionality you describe would be implemented by the compiler that produces the SPIR-V; as it is pointless to burden the driver with that.
You can come up with your own language that compiles into SPIR-V if you want.

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!