LWJGL Forum

Programming => OpenGL => Topic started by: Dr. Dirk on November 30, 2013, 16:14:29

Title: Set uniform binding
Post by: Dr. Dirk on November 30, 2013, 16:14:29
Dear LWJGl community.
I am unable to set a specific location to my uniforms.
layout (binding = 2) uniform sampler2D baz;
returns the following error log: ERROR: 0:5: 'binding' : syntax error syntax error

So I assume this function has not been ported, am I correct?

Using version 400 core, however tried all others too.

Specifying a binding to a uniform block returns same error.

layout (std140, binding = 2) uniform TransformBlock


I am learning openGL through the newest version of the superbible, and many of the shaders do not work in our java environment. But this binding thing annoys me the most.

Regards :)
Title: Re: Set uniform binding
Post by: spasi on November 30, 2013, 16:40:13
The binding & offset layout qualifiers were added in GLSL 4.20. Make sure your driver supports OpenGL 4.2 and you use the correct preprocessor directive (#version 420).

Please note that LWJGL has not "ported" anything GLSL related. The GLSL compiler is provided by the GPU driver and has nothing to do with the Java environment.
Title: Re: Set uniform binding
Post by: Dr. Dirk on November 30, 2013, 17:18:57
Thank you for the quick answer.

I got the most ridiculous problem 'GL_ARB_separate_shader_objects' is not supported. Which made no sense to me, because I run GTX with the latest driver. However, I had my main graphics card turned off for programs like eclipse, so my integrated GPU Intel HD something was running, and this GPU driver was outdated :P

I am glad I asked, and again thank you for the answer.