Sign in to follow this  

Compiled GLSL shaders

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

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

This topic is 4839 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this