Discussion:
[osg-users] setGLExtensionFuncPtr priority
Julien Valentin
2018-08-25 19:55:27 UTC
Permalink
Hi,
I just found the cause of a recurring malfunction in osgbindlesstext under nux:
it seams non suffixed procaddr are malfunctionning
setGLExtensionFuncPtr(glGetTextureHandle, "glGetTextureHandle", "glGetTextureHandleARB","glGetTextureHandleNV", validContext);

"glGetTextureHandle" give a valid adress but fails at use.

i fix it moving non ARB suffixed procname at the end :
setGLExtensionFuncPtr(glGetTextureHandle, "glGetTextureHandleARB","glGetTextureHandleNV", "glGetTextureHandle", validContext);

It seams reasonnable fix but would like confirmatoin as it is sure a weird driver behavior

Thank you!

Cheers,
Julien

------------------------
Twirling twirling twirling toward freedom

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=74596#74596
Robert Osfield
2018-08-26 08:23:34 UTC
Permalink
Hi Juilen,

This sounds like a driver bug. What OS/hardware/drivers are you using?

It would be worth printing out the address returned for each the
"glGetTextureHandle", "glGetTextureHandleARB","glGetTextureHandleNV"
variants to see what is being returned, this might gives some clues
that could help the driver developers track down the issue.

Robert.
On Sat, 25 Aug 2018 at 21:30, Julien Valentin
Post by Julien Valentin
Hi,
it seams non suffixed procaddr are malfunctionning
setGLExtensionFuncPtr(glGetTextureHandle, "glGetTextureHandle", "glGetTextureHandleARB","glGetTextureHandleNV", validContext);
"glGetTextureHandle" give a valid adress but fails at use.
setGLExtensionFuncPtr(glGetTextureHandle, "glGetTextureHandleARB","glGetTextureHandleNV", "glGetTextureHandle", validContext);
It seams reasonnable fix but would like confirmatoin as it is sure a weird driver behavior
Thank you!
Cheers,
Julien
------------------------
Twirling twirling twirling toward freedom
------------------
http://forum.openscenegraph.org/viewtopic.php?p=74596#74596
_______________________________________________
osg-users mailing list
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Julien Valentin
2018-08-26 15:12:07 UTC
Permalink
My plateform is Ubuntu LTS with Nvidia proprietary driver
I noticed the bug come and go when update my system (Lately, it comes back when updating to 18.04 with nvidia-390)


I write out adresses, they indeed differs:

Code:
glGetTextureHandleARB:0x7ffff2d8c4a0
glIsTextureHandleResidentARB:0x7ffff2d8e1e0
glMakeTextureHandleResidentARB:0x7ffff2d8ea40

glGetTextureHandle:0x7fffe2f622e0
glIsTextureHandleResident:0x7fffe2f62360
glMakeTextureHandleResident:0x7fffe2f62320



If you know a proper way to contact nvdia driver support for linux...

Cheers
Post by Robert Osfield
Hi Juilen,
This sounds like a driver bug. What OS/hardware/drivers are you using?
It would be worth printing out the address returned for each the
"glGetTextureHandle", "glGetTextureHandleARB","glGetTextureHandleNV"
variants to see what is being returned, this might gives some clues
that could help the driver developers track down the issue.
Robert.
On Sat, 25 Aug 2018 at 21:30, Julien Valentin
Post by Julien Valentin
Hi,
it seams non suffixed procaddr are malfunctionning
setGLExtensionFuncPtr(glGetTextureHandle, "glGetTextureHandle", "glGetTextureHandleARB","glGetTextureHandleNV", validContext);
"glGetTextureHandle" give a valid adress but fails at use.
setGLExtensionFuncPtr(glGetTextureHandle, "glGetTextureHandleARB","glGetTextureHandleNV", "glGetTextureHandle", validContext);
It seams reasonnable fix but would like confirmatoin as it is sure a weird driver behavior
Thank you!
Cheers,
Julien
------------------------
Twirling twirling twirling toward freedom
------------------
http://forum.openscenegraph.org/viewtopic.php?p=74596#74596
_______________________________________________
osg-users mailing list
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
------------------
Post generated by Mail2Forum
------------------------
Twirling twirling twirling toward freedom

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=74600#74600
Robert Osfield
2018-08-26 18:10:19 UTC
Permalink
Hi Julien.

On Sun, 26 Aug 2018 at 16:29, Julien Valentin
Post by Julien Valentin
My plateform is Ubuntu LTS with Nvidia proprietary driver
I noticed the bug come and go when update my system (Lately, it comes back when updating to 18.04 with nvidia-390)
I have Kubuntu 18.04 + Nvidia 390.48 on my system so I'll see if I can
reproduce the issue.

To reproduce the problem do I simply as running osgbindlesstext?
Post by Julien Valentin
If you know a proper way to contact nvdia driver support for linux...
Good question, not one I have an answer for I'm afraid. NVidia have a
forum, and if you register as a developer you might get info on how to
log bugs, I haven't jumped tried this myself though. Hopefully others
can pitch in.

When presenting bugs they'll probably want a small test program to
reproduce the issue. An OSG example might do but might well be a bit
too large a dependency to pull in.

Perhaps a first step is create a small OSG example that illustrates
the problem, have a couple of test different systems/drivers out to
see what pattern emerges about what works and what doesn't.

Cheers,
Robert.
Julien Valentin
2018-08-26 19:10:43 UTC
Permalink
yes osgbindlesstext example should fail on your arch as on mine:
black textured disaplyed
Post by Robert Osfield
Hi Julien.
On Sun, 26 Aug 2018 at 16:29, Julien Valentin
Post by Julien Valentin
My plateform is Ubuntu LTS with Nvidia proprietary driver
I noticed the bug come and go when update my system (Lately, it comes back when updating to 18.04 with nvidia-390)
I have Kubuntu 18.04 + Nvidia 390.48 on my system so I'll see if I can
reproduce the issue.
To reproduce the problem do I simply as running osgbindlesstext?
------------------------
Twirling twirling twirling toward freedom

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=74602#74602
Voerman, L.
2018-08-27 08:29:30 UTC
Permalink
Hi Julien, Robert,
searching around I can find that ARB_bindless_texture
<https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_bindless_texture.txt>
and NV_bindless_texture
<https://www.khronos.org/registry/OpenGL/extensions/NV/NV_bindless_texture.txt>
are
similar, but not the same,
near the end of the ARB version is the remark:


NV_bindless_texture didn't require any shader changes to make
uniforms usable with UniformHandleui64{v}, but ARB_bindless_texture
requires

these declarations.

I guess this might explain the black textures. I can't find any note
of core promotion, or a function prototype for glGetTextureHandle (no
NV no ARB), so I would not call a driver bug if it does something not
entirely as expected.

Regards, Laurens.
Post by Julien Valentin
black textured disaplyed
Post by Robert Osfield
Hi Julien.
On Sun, 26 Aug 2018 at 16:29, Julien Valentin
Post by Julien Valentin
My plateform is Ubuntu LTS with Nvidia proprietary driver
I noticed the bug come and go when update my system (Lately, it comes
back when updating to 18.04 with nvidia-390)
Post by Robert Osfield
I have Kubuntu 18.04 + Nvidia 390.48 on my system so I'll see if I can
reproduce the issue.
To reproduce the problem do I simply as running osgbindlesstext?
------------------------
Twirling twirling twirling toward freedom
------------------
http://forum.openscenegraph.org/viewtopic.php?p=74602#74602
_______________________________________________
osg-users mailing list
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Julien Valentin
2018-08-27 11:55:01 UTC
Permalink
Thank for your answer but there aren't any relation with this driver issue:
-osgbinlesstext include ARB_bindless_texture (perhaps there incompitibiliites due to the use of uint64 but for nv all is good)
-osgbinlesstext don't rely on UniformHandleui64
-AFAIK osgbindless has never get problem under win32 so it's really a driver bug
Hi Julien, Robert,searching around I can find that ARB_bindless_texture (https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_bindless_texture.txt) and NV_bindless_texture (https://www.khronos.org/registry/OpenGL/extensions/NV/NV_bindless_texture.txt) are similar, but not the same,
 
NV_bindless_texture didn't require any shader changes to make uniforms usable with UniformHandleui64{v}, but ARB_bindless_texture requires these declarations.I guess this might explain the black textures. I can't find any note of core promotion, or a function prototype for glGetTextureHandle (no NV no ARB), so I would not call a driver bug if it does something not entirely as expected.Regards, Laurens.
black textured disaplyed
Post by Robert Osfield
Hi Julien.
On Sun, 26 Aug 2018 at 16:29, Julien Valentin
Post by Julien Valentin
My plateform is Ubuntu LTS with Nvidia proprietary driver
I noticed the bug come and go when update my system (Lately, it comes back when updating to 18.04 with nvidia-390)
I have Kubuntu 18.04 + Nvidia 390.48 on my system so I'll see if I can
reproduce the issue.
To reproduce the problem do I simply as running osgbindlesstext?
 
------------------------
Twirling twirling twirling toward freedom
------------------
http://forum.openscenegraph.org/viewtopic.php?p=74602#74602 (http://forum.openscenegraph.org/viewtopic.php?p=74602#74602)
_______________________________________________
osg-users mailing list
()
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org)
------------------
Post generated by Mail2Forum
------------------------
Twirling twirling twirling toward freedom

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=74604#74604
Voerman, L.
2018-08-27 15:43:55 UTC
Permalink
Hi Julien,
on my windows system (win 10 / nvidia driver 388.13 / geforce gtx 1080)

0x0000000000000000 glGetTextureHandle
0x00000000672f2a30 glGetTextureHandleARB
0x00000000672f2ab0 glGetTextureHandleNV

I think using glGetTextureHandle is not according to spec.
Laurens.
Post by Julien Valentin
-osgbinlesstext include ARB_bindless_texture (perhaps there
incompitibiliites due to the use of uint64 but for nv all is good)
-osgbinlesstext don't rely on UniformHandleui64
-AFAIK osgbindless has never get problem under win32 so it's really a driver bug
Hi Julien, Robert,searching around I can find that ARB_bindless_texture (
https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_bindless_texture.txt) and NV_bindless_texture
(
https://www.khronos.org/registry/OpenGL/extensions/NV/NV_bindless_texture.txt) are
similar, but not the same,
Post by Voerman, L.
NV_bindless_texture didn't require any shader changes to make
uniforms usable with UniformHandleui64{v}, but ARB_bindless_texture
requires these declarations.I guess this might explain the black
textures. I can't find any note of core promotion, or a function prototype
for glGetTextureHandle (no NV no ARB), so I would not call a driver bug if
it does something not entirely as expected.Regards, Laurens.
Post by Voerman, L.
black textured disaplyed
Post by Robert Osfield
Hi Julien.
On Sun, 26 Aug 2018 at 16:29, Julien Valentin
Post by Julien Valentin
My plateform is Ubuntu LTS with Nvidia proprietary driver
I noticed the bug come and go when update my system (Lately, it
comes back when updating to 18.04 with nvidia-390)
Post by Voerman, L.
Post by Robert Osfield
I have Kubuntu 18.04 + Nvidia 390.48 on my system so I'll see if I
can
Post by Voerman, L.
Post by Robert Osfield
reproduce the issue.
To reproduce the problem do I simply as running osgbindlesstext?
------------------------
Twirling twirling twirling toward freedom
------------------
http://forum.openscenegraph.org/viewtopic.php?p=74602#74602 (
http://forum.openscenegraph.org/viewtopic.php?p=74602#74602)
Post by Voerman, L.
_______________________________________________
osg-users mailing list
()
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
(http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
)
------------------
Post generated by Mail2Forum
------------------------
Twirling twirling twirling toward freedom
------------------
http://forum.openscenegraph.org/viewtopic.php?p=74604#74604
_______________________________________________
osg-users mailing list
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Robert Osfield
2018-08-28 11:10:24 UTC
Permalink
In my testing here on my Kubuntu 18.04 I've found the
glGetProcAddressARB and getGetProcAddress functions were returning non
NULL values for invalid function names. This looks like a driver bug
to me, one that has potentially for affect far more than just the
glGetTextureHandle usage. dlsym works reliably and has always has
been there as a fallback so I've simply removed the
getGetProcAddressARB code for linux:

https://github.com/openscenegraph/OpenSceneGraph/commit/ec4b618b7aaaa487579b95685d807fdb58aa1e8f

With this the extension set up is now working fine for me, and
osgbindlesstext works again, so I've merged this fix into master, 3.6
and 3.6-TexStorage.

I haven't tested any other OS's yet so would appreciate others testing
out once of these three branches.

Cheers,
Robert

Julien Valentin
2018-08-27 18:29:26 UTC
Permalink
Voerman
Please, read the original problem and the example before randomly citing specs.
The problem concerns linux nvidia propriétary driver (not win32)
I admit I misnamed this thread but it's not a reason for acting in a such 'Mr-I-know-all" fashion:
How can you say there's something wrong in using glGetTextureHandle whereas the exampleosgbindlesstext should work on your plateform?

This is exactly the type of behavior I can't stand from guys naming themself "professionnal".
Hi Julien,on my windows system (win 10 / nvidia driver 388.13 / geforce gtx 1080)
0x0000000000000000  glGetTextureHandle
0x00000000672f2a30  glGetTextureHandleARB
0x00000000672f2ab0  glGetTextureHandleNV
I think using glGetTextureHandle is not according to spec.
Laurens.
Post by Julien Valentin
-osgbinlesstext include ARB_bindless_texture (perhaps there incompitibiliites due to the use of uint64 but for nv all is good)
-osgbinlesstext don't rely on UniformHandleui64
-AFAIK osgbindless has never get problem under win32 so it's really a driver bug
Hi Julien, Robert,searching around I can find that ARB_bindless_texture (https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_bindless_texture.txt (https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_bindless_texture.txt)) and NV_bindless_texture (https://www.khronos.org/registry/OpenGL/extensions/NV/NV_bindless_texture.txt (https://www.khronos.org/registry/OpenGL/extensions/NV/NV_bindless_texture.txt)) are similar, but not the same,
 
         NV_bindless_texture didn't require any shader changes to make uniforms usable with UniformHandleui64{v}, but ARB_bindless_texture requires        these declarations.I guess this might explain the black textures. I can't find any note of core promotion, or a function prototype for glGetTextureHandle (no NV no ARB), so I would not call a driver bug if it does something not entirely as expected.Regards, Laurens.
black textured disaplyed
Post by Robert Osfield
Hi Julien.
On Sun, 26 Aug 2018 at 16:29, Julien Valentin
Post by Julien Valentin
My plateform is Ubuntu LTS with Nvidia proprietary driver
I noticed the bug come and go when update my system (Lately, it comes back when updating to 18.04 with nvidia-390)
I have Kubuntu 18.04 + Nvidia 390.48 on my system so I'll see if I can
reproduce the issue.
To reproduce the problem do I simply as running osgbindlesstext?
 
------------------------
Twirling twirling twirling toward freedom
------------------
http://forum.openscenegraph.org/viewtopic.php?p=74602#74602 (http://forum.openscenegraph.org/viewtopic.php?p=74602#74602) (http://forum.openscenegraph.org/viewtopic.php?p=74602#74602 (http://forum.openscenegraph.org/viewtopic.php?p=74602#74602))
_______________________________________________
osg-users mailing list
  ()
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org) (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org))
  ------------------
Post generated by Mail2Forum
------------------------
Twirling twirling twirling toward freedom
------------------
http://forum.openscenegraph.org/viewtopic.php?p=74604#74604 (http://forum.openscenegraph.org/viewtopic.php?p=74604#74604)
_______________________________________________
osg-users mailing list
()
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org)
------------------
Post generated by Mail2Forum
------------------------
Twirling twirling twirling toward freedom

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=74606#74606
Voerman, L.
2018-08-28 07:17:26 UTC
Permalink
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.
Regards, Laurens.
Post by Julien Valentin
Voerman
Please, read the original problem and the example before randomly citing specs.
The problem concerns linux nvidia propriétary driver (not win32)
I admit I misnamed this thread but it's not a reason for acting in a such
How can you say there's something wrong in using glGetTextureHandle
whereas the exampleosgbindlesstext should work on your plateform?
This is exactly the type of behavior I can't stand from guys naming
themself "professionnal".
Hi Julien,on my windows system (win 10 / nvidia driver 388.13 / geforce
gtx 1080)
0x0000000000000000 glGetTextureHandle
0x00000000672f2a30 glGetTextureHandleARB
0x00000000672f2ab0 glGetTextureHandleNV
I think using glGetTextureHandle is not according to spec.
Laurens.
Post by Julien Valentin
Thank for your answer but there aren't any relation with this driver
-osgbinlesstext include ARB_bindless_texture (perhaps there
incompitibiliites due to the use of uint64 but for nv all is good)
Post by Julien Valentin
-osgbinlesstext don't rely on UniformHandleui64
-AFAIK osgbindless has never get problem under win32 so it's really a
driver bug
Post by Julien Valentin
Hi Julien, Robert,searching around I can find that
ARB_bindless_texture (
https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_bindless_texture.txt
(
https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_bindless_texture.txt)) and NV_bindless_texture
(
https://www.khronos.org/registry/OpenGL/extensions/NV/NV_bindless_texture.txt
(
https://www.khronos.org/registry/OpenGL/extensions/NV/NV_bindless_texture.txt)) are
similar, but not the same,
Post by Julien Valentin
Post by Voerman, L.
NV_bindless_texture didn't require any shader changes to
make uniforms usable with UniformHandleui64{v}, but ARB_bindless_texture
requires these declarations.I guess this might explain the black
textures. I can't find any note of core promotion, or a function prototype
for glGetTextureHandle (no NV no ARB), so I would not call a driver bug if
it does something not entirely as expected.Regards, Laurens.
Post by Julien Valentin
Post by Voerman, L.
black textured disaplyed
Post by Robert Osfield
Hi Julien.
On Sun, 26 Aug 2018 at 16:29, Julien Valentin
Post by Julien Valentin
My plateform is Ubuntu LTS with Nvidia proprietary driver
I noticed the bug come and go when update my system (Lately,
it comes back when updating to 18.04 with nvidia-390)
Post by Julien Valentin
Post by Voerman, L.
Post by Robert Osfield
I have Kubuntu 18.04 + Nvidia 390.48 on my system so I'll see if
I can
Post by Julien Valentin
Post by Voerman, L.
Post by Robert Osfield
reproduce the issue.
To reproduce the problem do I simply as running osgbindlesstext?
------------------------
Twirling twirling twirling toward freedom
------------------
http://forum.openscenegraph.org/viewtopic.php?p=74602#74602 (
http://forum.openscenegraph.org/viewtopic.php?p=74602#74602) (
http://forum.openscenegraph.org/viewtopic.php?p=74602#74602 (
http://forum.openscenegraph.org/viewtopic.php?p=74602#74602))
Post by Julien Valentin
Post by Voerman, L.
_______________________________________________
osg-users mailing list
()
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
(http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org)
(http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
(http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
))
Post by Julien Valentin
------------------
Post generated by Mail2Forum
------------------------
Twirling twirling twirling toward freedom
------------------
http://forum.openscenegraph.org/viewtopic.php?p=74604#74604 (
http://forum.openscenegraph.org/viewtopic.php?p=74604#74604)
Post by Julien Valentin
_______________________________________________
osg-users mailing list
()
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
(http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
)
------------------
Post generated by Mail2Forum
------------------------
Twirling twirling twirling toward freedom
------------------
http://forum.openscenegraph.org/viewtopic.php?p=74606#74606
_______________________________________________
osg-users mailing list
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Robert Osfield
2018-08-28 08:01:09 UTC
Permalink
Post by Voerman, L.
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.
Robert Osfield
2018-08-28 08:56:46 UTC
Permalink
We are entering a bit of twilight zone.... to
osg::getGLExtensionFuncPtr() I added the follow debug output to the
linux code path:

static GetProcAddressARBProc s_glXGetProcAddressARB =
convertPointerType<GetProcAddressARBProc, void*>(dlsym(0,
"glXGetProcAddressARB"));
if (s_glXGetProcAddressARB)
{
OSG_NOTICE<<" s_glXGetProcAddressARB("<<funcName<<") =
"<<(s_glXGetProcAddressARB)(funcName)<<std::endl;
OSG_NOTICE<<"
convertPointerType(s_glXGetProcAddressARB("<<funcName<<")) =
"<<convertPointerType<void*,
__GLXextFuncPtr>((s_glXGetProcAddressARB)(funcName))<<std::endl;
OSG_NOTICE<<" dlsym(0, "<<funcName<<") = "<<dlsym(0,
funcName)<<std::endl;

return convertPointerType<void*,
__GLXextFuncPtr>((s_glXGetProcAddressARB)(funcName));
}

And the output I get is:
$ osgbindlesstext | grep glGetTexture
s_glXGetProcAddressARB(glGetTextureHandle) = 1
convertPointerType(s_glXGetProcAddressARB(glGetTextureHandle)) =
convertPointerType(0x7fe1e11bf2e0) 0x7fe1e11bf2e0
dlsym(0, glGetTextureHandle) = 0
getGLExtensionFuncPtr(glGetTextureHandle)
s_glXGetProcAddressARB(glGetTextureHandle) = 1
convertPointerType(s_glXGetProcAddressARB(glGetTextureHandle)) =
convertPointerType(0x7fe1e11bf2e0) 0x7fe1e11bf2e0
dlsym(0, glGetTextureHandle) = 0
getGLExtensionFuncPtr(glGetTextureHandleARB)
s_glXGetProcAddressARB(glGetTextureHandleARB) = 1
convertPointerType(s_glXGetProcAddressARB(glGetTextureHandleARB))
= convertPointerType(0x7fe1f27674a0) 0x7fe1f27674a0
dlsym(0, glGetTextureHandleARB) = 0x7fe1f3e7a4a0
getGLExtensionFuncPtr(glGetTextureHandleNV)
s_glXGetProcAddressARB(glGetTextureHandleNV) = 1
convertPointerType(s_glXGetProcAddressARB(glGetTextureHandleNV)) =
convertPointerType(0x7fe1f27674c0) 0x7fe1f27674c0
dlsym(0, glGetTextureHandleNV) = 0x7fe1f3e7a4c0
getGLExtensionFuncPtr(glGetTextureHandleIMG)
s_glXGetProcAddressARB(glGetTextureHandleIMG) = 1
convertPointerType(s_glXGetProcAddressARB(glGetTextureHandleIMG))
= convertPointerType(0x7fe1e11bf380) 0x7fe1e11bf380
dlsym(0, glGetTextureHandleIMG) = 0
getGLExtensionFuncPtr(glGetTextureHandleFrog)
s_glXGetProcAddressARB(glGetTextureHandleFrog) = 1
convertPointerType(s_glXGetProcAddressARB(glGetTextureHandleFrog))
= convertPointerType(0x7fe1e11bf3a0) 0x7fe1e11bf3a0
dlsym(0, glGetTextureHandleFrog) = 0
getGLExtensionFuncPtr(glGetTextureHandleCat)
s_glXGetProcAddressARB(glGetTextureHandleCat) = 1
convertPointerType(s_glXGetProcAddressARB(glGetTextureHandleCat))
= convertPointerType(0x7fe1e11bf3c0) 0x7fe1e11bf3c0
dlsym(0, glGetTextureHandleCat) = 0

So dlsym is working as expected but the s_glXGetProcAddressARB usage
is problematic when the pointer should be NULL. More digging to do...

Robert.
Voerman, L.
2018-08-28 10:59:44 UTC
Permalink
Hi Robert,
maybe this helps: glXGetProcAddressNeverReturnsNULL
<https://dri.freedesktop.org/wiki/glXGetProcAddressNeverReturnsNULL/>
The text in the link states that the nvidia libGL does return NULL, but
that is evidently not true anymore.
I get a pointer for s_glXGetProcAddressARB("RandomString") on debian 9.5 /
nvidia driver 387.22

Regards, Laurens.
Post by Robert Osfield
We are entering a bit of twilight zone.... to
osg::getGLExtensionFuncPtr() I added the follow debug output to the
static GetProcAddressARBProc s_glXGetProcAddressARB =
convertPointerType<GetProcAddressARBProc, void*>(dlsym(0,
"glXGetProcAddressARB"));
if (s_glXGetProcAddressARB)
{
OSG_NOTICE<<" s_glXGetProcAddressARB("<<funcName<<") =
"<<(s_glXGetProcAddressARB)(funcName)<<std::endl;
OSG_NOTICE<<"
convertPointerType(s_glXGetProcAddressARB("<<funcName<<")) =
"<<convertPointerType<void*,
__GLXextFuncPtr>((s_glXGetProcAddressARB)(funcName))<<std::endl;
OSG_NOTICE<<" dlsym(0, "<<funcName<<") = "<<dlsym(0,
funcName)<<std::endl;
return convertPointerType<void*,
__GLXextFuncPtr>((s_glXGetProcAddressARB)(funcName));
}
$ osgbindlesstext | grep glGetTexture
s_glXGetProcAddressARB(glGetTextureHandle) = 1
convertPointerType(s_glXGetProcAddressARB(glGetTextureHandle)) =
convertPointerType(0x7fe1e11bf2e0) 0x7fe1e11bf2e0
dlsym(0, glGetTextureHandle) = 0
getGLExtensionFuncPtr(glGetTextureHandle)
s_glXGetProcAddressARB(glGetTextureHandle) = 1
convertPointerType(s_glXGetProcAddressARB(glGetTextureHandle)) =
convertPointerType(0x7fe1e11bf2e0) 0x7fe1e11bf2e0
dlsym(0, glGetTextureHandle) = 0
getGLExtensionFuncPtr(glGetTextureHandleARB)
s_glXGetProcAddressARB(glGetTextureHandleARB) = 1
convertPointerType(s_glXGetProcAddressARB(glGetTextureHandleARB))
= convertPointerType(0x7fe1f27674a0) 0x7fe1f27674a0
dlsym(0, glGetTextureHandleARB) = 0x7fe1f3e7a4a0
getGLExtensionFuncPtr(glGetTextureHandleNV)
s_glXGetProcAddressARB(glGetTextureHandleNV) = 1
convertPointerType(s_glXGetProcAddressARB(glGetTextureHandleNV)) =
convertPointerType(0x7fe1f27674c0) 0x7fe1f27674c0
dlsym(0, glGetTextureHandleNV) = 0x7fe1f3e7a4c0
getGLExtensionFuncPtr(glGetTextureHandleIMG)
s_glXGetProcAddressARB(glGetTextureHandleIMG) = 1
convertPointerType(s_glXGetProcAddressARB(glGetTextureHandleIMG))
= convertPointerType(0x7fe1e11bf380) 0x7fe1e11bf380
dlsym(0, glGetTextureHandleIMG) = 0
getGLExtensionFuncPtr(glGetTextureHandleFrog)
s_glXGetProcAddressARB(glGetTextureHandleFrog) = 1
convertPointerType(s_glXGetProcAddressARB(glGetTextureHandleFrog))
= convertPointerType(0x7fe1e11bf3a0) 0x7fe1e11bf3a0
dlsym(0, glGetTextureHandleFrog) = 0
getGLExtensionFuncPtr(glGetTextureHandleCat)
s_glXGetProcAddressARB(glGetTextureHandleCat) = 1
convertPointerType(s_glXGetProcAddressARB(glGetTextureHandleCat))
= convertPointerType(0x7fe1e11bf3c0) 0x7fe1e11bf3c0
dlsym(0, glGetTextureHandleCat) = 0
So dlsym is working as expected but the s_glXGetProcAddressARB usage
is problematic when the pointer should be NULL. More digging to do...
Robert.
_______________________________________________
osg-users mailing list
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Loading...