#171 closed defect (fixed)
GL extension loading slightly incorrect on Linux
Reported by: | Philip Taylor | Owned by: | ben |
---|---|---|---|
Priority: | Nice to Have | Milestone: | Alpha 14 |
Component: | Core engine | Keywords: | glext simple linux |
Cc: | Patch: |
Description
ogl.cpp does:
p##nameARB = NULL; if(oglHaveVersion(version)) *(void**)&p##nameARB = SDL_GL_GetProcAddress(#nameCore); if(!p##nameARB) /* use the ARB name if the driver lied about what version it supports */ *(void**)&p##nameARB = SDL_GL_GetProcAddress(#nameARB);
But glXGetProcAddress never returns NULL. In the case where "the driver lied about what version it supports", it will still return a non-NULL function pointer, which will crash when it is called, even if there would have been a valid function pointer when we used the ARB name.
(NVIDIA's OpenGL implementation is different, and does (when I test it) return NULL for functions that it doesn't have. But the xorg-x11 implementation only returns NULL for non-existent glX* functions or for names not starting with "gl", and it returns non-NULL for any arbitrary gl[^X]* name.)
Hopefully it doesn't actually matter for us, since ogl.cpp seems to be the only place where we're testing the NULLness of the function pointers, and since ogl.cpp should still work correctly as long as the driver reports its GL version correctly (which it should). So I don't think there's anything we should actually do, except be aware of the issue.
Change History (9)
comment:1 by , 15 years ago
Keywords: | glext simple added |
---|
comment:2 by , 14 years ago
Milestone: | Release → Unclassified |
---|
comment:4 by , 14 years ago
Milestone: | → Backlog |
---|
comment:5 by , 12 years ago
“So I don't think there's anything we should actually do, except be aware of the issue.”
Does that mean this issue can be closed?
comment:6 by , 11 years ago
We could add a comment that for xorg/x11 it will never return NULL. So we can't catch the "lied about what version it supports". But this should not happen at all.
The game would then just crash at execution of the returned function. We should get a backtrace to something graphic related... if we get those, we should investigate ;)
Just looked into other games and they do it the same way...
comment:7 by , 11 years ago
Keywords: | linux added |
---|
comment:9 by , 11 years ago
Milestone: | Backlog → Alpha 14 |
---|
Milestone Release deleted