[osg-users] setGLExtensionFuncPtr priority
Robert Osfield
robert.osfield at gmail.com
Tue Aug 28 01:01:09 PDT 2018
On Tue, 28 Aug 2018 at 08:24, Voerman, L. <l.voerman at rug.nl> wrote:
> HI Julien,
> I cannot find a specification for the function with the name "glGetTextureHandle", and I think that might explain why you get unexpected results on linux. The windows driver does not provide this function, so osg falls back to glGetTextureHandleARB. Your linux system seems to provide a function with the name "glGetTextureHandle", but while confusing I would not call that a bug.
I just a grep on my Kubuntu 18.04/NVidia1060/ systems' includes for
glGetTextureHandle:
usr/include$ grep -r glGetTextureHandle .
./GL/glcorearb.h:GLAPI GLuint64 APIENTRY glGetTextureHandleARB (GLuint texture);
./GL/glcorearb.h:GLAPI GLuint64 APIENTRY glGetTextureHandleNV (GLuint texture);
./GL/glew.h:#define glGetTextureHandleARB
GLEW_GET_FUN(__glewGetTextureHandleARB)
./GL/glew.h:#define glGetTextureHandleNV GLEW_GET_FUN(__glewGetTextureHandleNV)
./GL/glext.h:GLAPI GLuint64 APIENTRY glGetTextureHandleARB (GLuint texture);
./GL/glext.h:GLAPI GLuint64 APIENTRY glGetTextureHandleNV (GLuint texture);
./GL/gl_mangle.h:#define glGetTextureHandleARB
MANGLE(GetTextureHandleARB)
./GL/gl_mangle.h:#define glGetTextureHandleNV
MANGLE(GetTextureHandleNV)
./x86_64-linux-gnu/qt5/QtGui/qopenglext.h:GLAPI GLuint64 APIENTRY
glGetTextureHandleARB (GLuint texture);
./x86_64-linux-gnu/qt5/QtGui/qopenglext.h:GLAPI GLuint64 APIENTRY
glGetTextureHandleNV (GLuint texture);
./x86_64-linux-gnu/qt5/QtGui/qopengles2ext.h:GL_APICALL GLuint64
GL_APIENTRY glGetTextureHandleIMG (GLuint texture);
./x86_64-linux-gnu/qt5/QtGui/qopengles2ext.h:GL_APICALL GLuint64
GL_APIENTRY glGetTextureHandleNV (GLuint texture);
./x86_64-linux-gnu/qt5/QtOpenGLExtensions/qopenglextensions.h:
GLuint64 glGetTextureHandleNV(GLuint texture);
./x86_64-linux-gnu/qt5/QtOpenGLExtensions/qopenglextensions.h:inline
GLuint64 QOpenGLExtension_NV_bindless_texture::glGetTextureHandleNV(GLuint
texture)
./GLES2/gl2ext.h:GL_APICALL GLuint64 GL_APIENTRY glGetTextureHandleIMG
(GLuint texture);
./GLES2/gl2ext.h:GL_APICALL GLuint64 GL_APIENTRY glGetTextureHandleNV
(GLuint texture);
So no public entry for glGetTextureHandle. As a further test I added
to src/osg/GLExtensions.cpp:
OSG_NOTICE<<"getGLExtensionFuncPtr(glGetTextureHandle)
"<<getGLExtensionFuncPtr("glGetTextureHandle")<<std::endl;
OSG_NOTICE<<"getGLExtensionFuncPtr(glGetTextureHandleARB)
"<<getGLExtensionFuncPtr("glGetTextureHandleARB")<<std::endl;
OSG_NOTICE<<"getGLExtensionFuncPtr(glGetTextureHandleNV)
"<<getGLExtensionFuncPtr("glGetTextureHandleNV")<<std::endl;
OSG_NOTICE<<"getGLExtensionFuncPtr(glGetTextureHandleIMG)
"<<getGLExtensionFuncPtr("glGetTextureHandleIMG")<<std::endl;
OSG_NOTICE<<"getGLExtensionFuncPtr(glGetTextureHandleFrog)
"<<getGLExtensionFuncPtr("glGetTextureHandleFrog")<<std::endl;
OSG_NOTICE<<"getGLExtensionFuncPtr(glGetTextureHandleCat)
"<<getGLExtensionFuncPtr("glGetTextureHandleCat")<<std::endl;
And this is what I got:
void StateSet::setGlobalDefaults() ShaderPipeline disabled.
void StateSet::setGlobalDefaults() ShaderPipeline disabled.
getGLExtensionFuncPtr(glGetTextureHandle) 0x7f1ca3e402e0
getGLExtensionFuncPtr(glGetTextureHandleARB) 0x7f1cb86c44a0
getGLExtensionFuncPtr(glGetTextureHandleNV) 0x7f1cb86c44c0
getGLExtensionFuncPtr(glGetTextureHandleIMG) 0x7f1ca3e40380
getGLExtensionFuncPtr(glGetTextureHandleFrog) 0x7f1ca3e403a0
getGLExtensionFuncPtr(glGetTextureHandleCat) 0x7f1ca3e403c0
So Frog and Cat aren't reporting NULL's which is rather odd, could our
getGLExtensionFuncPtr function being buggy on my system?
My GL driver is:
OpenGL core profile version string: 4.6.0 NVIDIA 390.48
Will do some more digging.
Robert.
More information about the osg-users
mailing list