Jump to content

  • Log In with Google      Sign In   
  • Create Account


ES 2.0 glShaderBinary/glShaderSource


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 hdxpete   Members   -  Reputation: 467

Like
0Likes
Like

Posted 28 May 2013 - 10:50 PM

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?

 

 



Sponsor:

#2 Cornstalks   Crossbones+   -  Reputation: 6974

Like
0Likes
Like

Posted 28 May 2013 - 11:34 PM

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).


[ I was ninja'd 71 times before I stopped counting a long time ago ] [ f.k.a. MikeTacular ] [ My Blog ] [ SWFer: Gaplessly looped MP3s in your Flash games ]

#3 hdxpete   Members   -  Reputation: 467

Like
0Likes
Like

Posted 28 May 2013 - 11:49 PM

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


Edited by hdxpete, 29 May 2013 - 12:01 AM.





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS