Today ATI released Catalyst 9.1 driver with full OpenGL 3.0 context. I thought maybe it’s time to move my code to 3.0 context. Tried to install new Catalyst and all I can say - I’m very disappointed.
If I don’t use WGL_ARB_create_context then all is ok - OGL 2.1 works fine. But if I try to create 3.0 context (it doesn’t matter forward compatible or not) things gets “interesting”:
glGetString(GL_VERSION) crashes somewhere in atioglxx.dll file. glGetInteger(GL_MAJOR/MINOR_VERSION) works fine - returns 3.0
glGetStringi(GL_EXTENSIONS, 1) returns NULL (also with any other valid extension number as second argument)
glGetString(GL_SHADING_LANGUAGE_VERSION) in forward compatible context returns “1.20” instead of “1.30”
I’m afraid to imagine what else there is broken if even simple things like getting version does not work…
As I said - in OGL 2.1 everything works fine. If I skip WGL_ARB_create_context part and use context returned from wglCreateContext then everything runs fine:
glGetString(GL_EXTENSIONS) returns normal string.
Also glGetStringi(GL_EXTENSIONS, i) returns correct string values where i=0…glGetIntegerv(GL_NUM_EXTENSIONS)-1
Depth Buffer Bits = 24
Maximum Texture Coordinates = 16
Maximum Texture Units = 16
Maximum Vertex Texture Units = 16
Maximum Vertex Attributes = 16
Max Texture units on this card = 8
Max Texture size on this card = 8192
Max Renderbuffer size on this card = 8192
Max 3D texture size on this card = 8192
Max Cubemap texture size on this card = 8192
Max Uniform Variables on this card = 512
Max Varying Variables on this card = 68
Max Vertices on this card = 2147483647
Max Indices on this card = 16777215
Max ViewPort width size = 8192
Max ViewPort height size = 8192
MultiSample Buffers = 0
MultiSample Samples = 0
Vendor ATI Technologies Inc.
Renderer ATI Radeon HD 3600 Series
OpenGL version = 2.1.8395 Release
In full context such empty fragment shader works fine without error message
I’m using empty fragment shader with shadow map rendering (using only depth attachment for FBO) in OGL2. Works fine till now. Is this really illegal?
Ok, how about this fragment shader?
in vec3 fragment_color;
out vec3 color;
void main()
{
color = fragment_color;
}
Same error message.
Also with following vertex shader:
in vec3 vertex_position;
in vec3 vertex_color;
out vec3 fragment_color;
void main()
{
gl_Position = vec4(vertex_position, 1.0);
fragment_color = vertex_color;
}
same error message.
Note that these two shaders works fine with full GL3 context.
For the shader problem, try defining GLSL version 1.30 in the shader. That seems to of fixed the compile errors I was getting. Kind of strange though, hopefully they fix these problems with their next release.
Hmm, adding #version 130 helps.
With following fragment shader:
#version 130
in vec3 fragment_color;
out vec3 screen_color;
void main()
{
screen_color = fragment_color;
}
I am getting following error:
Fragment shader compile error:
Fragment shader failed to compile with the following errors:
ERROR: 0:2: '' : Declaration must include a precision qualifier or the default precision must have been previously declared.
ERROR: 0:3: '' : Declaration must include a precision qualifier or the default precision must have been previously declared.
ERROR: compilation errors. No code generated.
I changed shader to:
#version 130
precision mediump float;
in vec3 fragment_color;
out vec3 screen_color;
void main()
{
screen_color = fragment_color;
}
Then everything compiles and links fine (after adding same precision to vertex shader) Thanks rpggamer! I assumed that GL3 forward compatible context by default expects GLSL version 1.30, but I guess you can expect many strange things from ATI
Now when shader program compiles and links fine, I’m getting next error - glBindBuffer(GL_ARRAY_BUFFER, id) generates GL_INVALID_OPERATION error in forward compatbile context. It doesn’t matter if VAO is bound or not. id is generated correctly with glGenBuffers. Any suggestions here?
Even glBindBuffer(GL_ARRAY_BUFFER, 0) generates same GL_INVALID_OPERATION.