I'm trying to solve a run-time error since a lot of time (around three or four months?)
The crash point is at glDrawElements, a SegFault, and the binary code shows access to a null pointer (in the latest AMD drivers' dlls).
The crash doesn't happen every time, but I have the perfect testcase:
This time it happened on the first frame.
The current OpenGL state is:
Frames Drawn: 2 --First Frame Empty, Loading goes on the Second frame
glUseProgram calls: 1 --One shader program has been bound througout the executable
glCreateProgram calls: 1 --One shader program is alive
glGetUniformName calls: 1 --One Uniform Name has been tracked for all shader programs
glUniform* calls: 1 --One Uniform has been set
glBindVertexArray calls: 3 --Three VAOs have been bound
glGenVertexArrays calls: 1 --One VAO has been created
glBindBuffer calls: 16 --Uniform Buffers adds 8 calls
glGenBuffer calls: 6 --Uniform Buffers adds 4 calls
Texture State:
- No textures bound --Aware of this: No texture used in the shader
Bound VAO ID:
- 1 --The only alive VAO is bound
VAO States:
-> VAO ID 1 --It's in a good state
--> ARRAY_BUFFER: 5
--> ELEMENT_ARRAY_BUFFER: 6
Texture Slot Bound:
- TEXTURE0 --Unused yet
Alive VBOs:
-> 1, 2, 3, 4, 5, 6 --1 to 4 are Uniform Buffers. All used VBOs are alive.
Buffered VBOs:
-> 1, 2, 3, 4, 5, 6 --All of them are buffered
Alive Shader Programs:
-> 3 --The only shader program
Bound Shader Program:
-> 3 --It is bound
Alive Textures:
-> None --Aware: No textures loaded
Shader Uniform States:
-> Program 3 --The only shader program
--> Uniform Location 85 --uniform sampler2D Textures[TEXCOUNT];
---> Buffered --as expected, set to 0,1,2,3,4,5,6,7 but unused.
|
The crash only seems to happen on a glDrawElements call.
glDrawArrays is always clean, from the first to the last vertex.
Element Indices are checked beforehand and are correct.
Most of the times, the model is drawn correctly and many times, too.
If the application crashes, it crashes the first time an object is drawn (I only have a single object, so it can't be a single object being the problem).
The testcase consists of the model (and associated textures and shaders) being reloaded every frame.
Freed or not, the application receives the crash anyways.
Does anybody have an idea where should I look at to solve this problem?