Question

I am using Visual Studio 2013 but running under Visual Studio 2010 compiler.

I am running Windows 8 in bootcamp on a Macbook Pro with intel iris pro 5200 graphics.

I have a very simple vertex and fragment shader, I am just displaying simple primitives in a window but I am getting warnings in console stating..

OpenGL Debug Output: Source(Shader Comiler), type(Other), Priority(Medium), GLSL compile warning(s) for shader 3, "": WARNING: -1:65535: #version : version number deprecated in OGL 3.0 forward compatible context driver

Anyone have any idea how to get rid of these annoying errors..?

Vertex Shader Code:

#version 330 core

uniform mat4 modelMatrix;
uniform mat4 viewMatrix;
uniform mat4 projMatrix;

in  vec3 position;
in  vec2 texCoord;
in  vec4 colour;

out Vertex  {
    vec2 texCoord;
    vec4 colour;
} OUT;



void main(void) {
    gl_Position     = (projMatrix * viewMatrix * modelMatrix) * vec4(position, 1.0);

    OUT.texCoord    = texCoord;
    OUT.colour      = colour;
}

Frag Shader code

#version 330 core

in Vertex   {
    vec2 texCoord;
    vec4 colour;
} IN;

out vec4 color;

void main() {   
    color= IN.colour;

    //color= vec4(1,1,1,1);
}
Was it helpful?

Solution

I always knew Intel drivers were bad, but this is ridiculous. The #version directive is NOT deprecated in GL 3.0. In fact it is more important than ever beginning with GL 3.2, because in addition to the number you can also specify core (default) or compatibility.

Nevertheless, that is not an actual error. It is an invalid warning, and having OpenGL debug output setup is why you keep seeing it. You can ignore it. AMD seems to be the only vendor that uses debug output in a useful way. NV almost never outputs anything, opting instead to crash... and Intel appears to be spouting nonsense.

It is possible that what the driver is really trying to tell you is that you have an OpenGL 3.0 context and you are using a GLSL 3.30 shader. If that is the case, this has got to be the stupidest way I have ever seen of doing that.

Have you tried #version 130 instead? If you do this, the interface blocks (e.g. in Vertex { ...) should generate parse errors, but it would at least rule out the only interpretation of this warning that makes any sense.


There is another possibility, that makes a lot more sense in the end. The debug output mentions this is related to shader object #3. While there is no guarantee that shader names are assigned sequentially beginning with 0, this is usually the case. You have only shown a total of 2 shaders here, #3 would imply the 4th shader your software loaded.

Are you certain that these are the shaders causing the problem?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top