Jump to content
  • Advertisement
Sign in to follow this  
_zed

Compiled GLSL shaders

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

Advertisement
Short answer: You can't.
Long answer: You can't compile GLSL, because it's done inside the driver and the output will be depend on a specific GPU architecture. So if it would be possible, the compiled code would only run on your GPU.

Share this post


Link to post
Share on other sites
Ok. How many program objects can I create with glCreateProgramObjectARB? Can I compile many different shaders and then install with glUseProgramObjectARB?

Share this post


Link to post
Share on other sites
Quote:

Long answer: You can't compile GLSL, because it's done inside the driver and the output will be depend on a specific GPU architecture. So if it would be possible, the compiled code would only run on your GPU.


You technically might be able to compile it and get the results through the 3DLabs offline compiler, the problem might be as you referred, it's specifically optimized for the GPU that compiled it.

Share this post


Link to post
Share on other sites
Even Longer Answer;
Nvidia do allow you to get back the compiled GLSL shader via a call specific to their drivers. However this is for debugging only as the code is potentially optermised specifical for the card that was in the system it was compiled for. While it might potentialy be able to be loaded back via the ARB assembler interface again I wouldnt count on it working (certainly on ATI hardware) or providing acceptable results even on NV hardware.
I say again debug ONLY.

As for the number of program objects, well I guess in theory you could create as many as you want, there might be an ARB_MAX_PROGRAMS varible, but I dont see it as being likely.

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!