Reputation: 17708
I am using a (very) low-end graphics adapter (intel g31).
I am writing an OpenGL program that uses VBOs and shaders (GLSL 1.2). The program compiles flawlessly but then when it calls glLinkProgram()
, an exception is thrown:
Unhandled exception at 0x1027101A (ig4icd32.dll) in Test.exe: 0xC0000005: Access violation reading location 0x00000000.
I used glew's glewinfo.exe and OpenGL Extensions Viewer to see whether glLinkProgram()
exists -- and it does exists. Also other closely related functions (glCreateProgram()
, glCreateShader()
, glCompileShader()
, etc.) works and works as intended.
What could be the actual source of the problem? Is it a problem or a bug of glew? Is it a problem of my driver?
I have set glewExperimental
to GL_TRUE
which solved many of my other problems.
EDIT: I have also used glLinkProgramARB()
and produces the same error as above.
Upvotes: 2
Views: 1448
Reputation: 1
I had the same problem on an Intel mobile 4 express chipset, the shader compiled just fine, but an exception where thrown when linking the actual program, even with trivial vertex or fragment shaders. I didn't use glew, and in my program the glLinkProgram was called in this way:
((PFNGLLINKPROGRAMPROC)wglGetProcAddress("glLinkProgram"))(p);
Then I solved this issue by firstly getting the pointer, and then calling the actual function. I don't know why it works in this way.
PFNGLLINKPROGRAMPROC glLinkProgram = ((PFNGLLINKPROGRAMPROC)wglGetProcAddress("glLinkProgram"));
glLinkProgram(p);
I try to better debug the first statement, so to find the reason of the program crashing.
Upvotes: 0
Reputation: 474316
Given that ig4icd32.dll is Intel's driver, and that's where it's crashing, I'm guessing that Intel's driver is crashing.
It shouldn't do that, but don't feel bad. Intel's pretty well known for bad OpenGL drivers. Best to avoid them wherever possible.
Upvotes: 2