Re: glCreateShader(GL_TESS_CONTROL_SHADER) causes glGetError()=INVALID_ENUM

Brian Paul <[email protected]>
Newsgroups gmane.comp.video.mesa3d.user
Message-ID <[email protected]>
On 08/18/2014 04:31 PM, patrick keshishian wrote:
> Greetings,
>
> This is my first post here, and I'm totally green with Mesa/
> OpenGL. So, I'm not certain if this is the proper list for my
> question(s). Feel free to direct me elsewhere in that case.
> I was hoping to lurk for some time before posting, but the
> list seems pretty quiet.
>
> I'm trying to wrap my head around all the terminology,
> different libraries, versions, etc. It's all a bit overwhelming
> to a newbie.
>
> With that introduction ...
>
> Is it expected that GLenum types are defined for "future"
> versions GL versions? e.g., GL_TESS_CONTROL_SHADER
> and GL_TESS_EVALUATION_SHADER require GL 4.0, yet,
> are defined in GL/glext.h.

There's lots of stuff defined in glext.h that won't be available in any 
particular OpenGL driver.


> This leads to confusion, when the source code making
> use of said GLenum compiles, but fails at runtime.
>
> Or am I completely confused and doing things the way
> not meant to be done?
>
> Appreciate any direction/advice from seasoned folks.

There's lots of vendors/versions of OpenGL.  You could build an OpenGL 
app that works fine on your system with a certain GPU/driver but fail 
miserably on another platform because it has a different GPU/driver and, 
thus, a different feature set.

So, OpenGL apps need to check at runtime what version of GL and which GL 
extensions are available.  This is typically done by calling 
glGetString(GL_VERSION), glGetString(GL_EXTENSIONS) and 
glXGetProcAddress().  This is all well-documented elsewhere (try looking 
for an OpenGL FAQ).

In the particular case above, tessellation shaders aren't available 
unless you have OpenGL 4.0 or the GL_ARB_tessellation_shader extension. 
  Mesa has neither yet.

-Brian
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.