[osg-users] OSG and NVX_gpu_memory_info
Robert Osfield
robert.osfield at gmail.com
Wed Sep 30 01:05:32 PDT 2015
HI Garth,
I'd use a RealizerOperation. Have a look at the osgvolume example to an
example of using a RealizerOperation to get information from the graphics
context.
Robert.
On 30 September 2015 at 03:49, Garth D <garthy_gso at entropicsoftware.com>
wrote:
> Hi all,
>
> I was wondering if anyone has been successful in using the
> NVX_gpu_memory_info extension with OpenSceneGraph, and the best place to
> call glGetIntegerv to get the associated values.
>
> Details on the extension here:
> https://www.opengl.org/registry/specs/NVX/gpu_memory_info.txt
>
> I'm using Linux, OSG 3.2.1, and a card that supports the
> NVX_gpu_memory_info extension.
>
> I have tried querying the current and total memory using
> GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX and
> GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX, and in each case but one, the
> values reported back are zero.
>
> The only success I have had thus far has been querying the values via an
> osg::Operation set with ViewerBase::setRealizeOperation() on my viewer
> (osg::Viewer). The values returned appear to be correct. This allows me to
> get the correct values *once* at the start of the program. Unfortunately I
> need to query them periodically, and I have been unable to do this.
>
> So far, I have tried hooking the calls into:
> - An osg::Camera::DrawHandler, set via
> osg::Camera::setInitialDrawCallback().
> - An osg::Node::NodeHandler, hooked into the root node via
> osg::Node::setUpdateCallback.
> - An osg::Drawable::DrawCallback, hooked into a dummy chain off the root
> of: osg::Node -> osg::Geode -> osg::Geometry (osg::Drawable), via
> osg::Drawable::setDrawCallback.
> - An osg::Drawable::CullCallback , hooked into a dummy chain off the root
> of: osg::Node -> osg::Geode -> osg::Geometry (osg::Drawable), via
> osg::Drawable::setCullCallback.
> - An osg::Camera::DrawHandler, set via
> osg::Camera::setFinalDrawCallback(). Only partly-tested due to a
> race-condition that occurs in my code, but appears to fail.
>
> I have experimented with osg::GraphicsContext::makeCurrent() with each.
>
> Can anyone suggest a better place to hook these calls into? Or
> alternatively confirm that they have the extension working with one of the
> above, so I can change or experiment with my existing setup to try to make
> it work?
>
> Cheers,
> Garth
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20150930/854f5094/attachment-0003.htm>
More information about the osg-users
mailing list