Posted by
Sven Gothel on
Nov 21, 2011; 2:32pm
URL: https://forum.jogamp.org/invalid-shader-version-number-tp3519333p3524873.html
On Monday, November 21, 2011 03:12:29 PM gmseed [via jogamp] wrote:
>
> Hi
>
> I'll admit that I don't understand fully your comments but based on what
> you've said how does anyone go out and buy a desktop/laptop to develop
> opengl using vertex shaders?
>
> I have a desktop running a 7 year old WinXP/Nvidia Quadro/OpenGL 2.1/GLSL
> version 1.20 that runs the program fine and a laptop purchased a few months
> ago wunning Win7/ATI Radeon/OpenGL3/GLSL version 3.3 that doesn't run the
> program.
>
> How could anyone predict or expect this? And how can anyone develop code for
> such scenarios?
As I said, you just cannot assume that something maybe supported,
if the spec doesn't guarantee it.
Check the GLSL spec .. you can also use preprocessor commands
for diff GLSL versions .. and you may use 'require' statements etc.
There is a guaranteed GLSL language version for each GL profile,
check the wikipedia pages. If you get more .. well, nice, but not guaranteed.
> it could be that the underlying context you have
> created actually is a GL 3 backward compatible one .. even if created w/
> the traditional non ARB context creation code. This is usally true w/
> NVidia.
This means, that you might have retrieved a GL3 backward compatible context,
even though you have asked for GL2 only. The GL spec allows it.
The driver may allow you to use the highest supported version.
You may query the avail GLSL version:
-
http://www.opengl.org/sdk/docs/man/xhtml/glGetString.xml - GL_SHADING_LANGUAGE_VERSION
It's also best to match the GLSL version w/ the intended GL context version,
maybe even reduce it if allowed.
After you made a few recursions w/ diff drivers and check the spec,
you will see that it is possible with some disciplin.
Check our GLSL examples .. they pass all unit tests currently.
~Sven