Jump to content
  • Advertisement
Sign in to follow this  
hdxpete

OpenGL ES 2.0 glShaderBinary/glShaderSource

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

Ok, it just dawned onto me now that glShaderSource may not be supported on a platform (from what i've seen it always is) it also seems glShaderBinary is optional, also openGL doesn't have a way for you to generate your shader binary offline.

 

I would like to be a defensive programmer here however...

it seems i have to rely on glShaderSource being supported on a system. am i correct here?

 

if god forbid glShaderSource and glShaderBinary are unsupported on a ES 2.0 chip, how exactly am i suppose to generate a shader and/or load it onto the card?

 

 

Share this post


Link to post
Share on other sites
Advertisement

The docs say:

Shader compiler support is optional, and thus must be queried before use by calling glGet with argument GL_SHADER_COMPILER. glShaderSource, glCompileShader, glGetShaderPrecisionFormat, and glReleaseShaderCompiler will each generate GL_INVALID_OPERATION on implementations that do not support a shader compiler. Such implementations instead offer the glShaderBinary alternative for supplying a pre-compiled shader binary.

 

Which to me says that if it doesn't support glShaderSource, then you can safely fall back to glShaderBinary. If glShaderBinary is not supported, then you can safely fall back to glShaderSource. I don't think a valid implementation can offer no support for either (they must, as far as I'm aware, support at least one, if not both).

Share this post


Link to post
Share on other sites

Cornstalks, appreciate the answer. i didn't see that line. my eyes must have glossed over it. thxs.

Edited by hdxpete

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!