<div dir="ltr"><div><div><div>HI Garth,<br><br></div>Sorry for the typo, the setRealizeOperation is what I was referring to.<br><br></div>If you want to check periodically then just use a Camera::DrawCallback attached to the main camera attached to the GraphicsContext/Window of interest.  This will be called every frame, but within this callback you could have your own check to see if the GL calls are required for that frame.<br><br></div>Robert.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On 30 September 2015 at 10:56, Garth D <span dir="ltr"><<a href="mailto:garthy_gso@entropicsoftware.com" target="_blank">garthy_gso@entropicsoftware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Hi Robert,<br>
<br>
Thanks for having a look at things and for the suggestion.<br>
<br>
On 30/09/15 17:35, Robert Osfield wrote:> HI Garth,<span class=""><br>
> I'd use a RealizerOperation.  Have a look at the osgvolume example to an<br>
> example of using a RealizerOperation to get information from the graphics<br>
> context.<br>
<br></span>
I was unfortunately unable to solve the problem. Here is what I tried:<br>
<br>
I checked the osgvolume.cpp source for 3.2.1 and 3.4.0, but did not find a RealizerOperation in either.<br>
<br>
I did notice that osgvolume does also use viewer.setRealizeOperation() for TestSupportOperation, defined earlier. Is this what you are referring to? Assuming yes: This is the way I was able to successfully query the information once only at the start of the program. Unfortunately I need to query the information periodically, ie. over the course of the program, rather than just at initialisation. Unless I am mistaken, the target of setRealizeOperation is only called the one time, on viewer realization. Is this right? If so: Is there a corresponding call that I can use to attach an osg::Operation or similar to in order to make the required calls periodically? If not: Is there a way to indicate that the operation should be repeatedly called?<br>
<br>
Or is there another part of osgvolume.cpp that I should be looking at? The only glGet* call in the file is in TestSupportOperation, which is set using setRealizeOperation(), so I think I am looking in the right place?<br>
<br>
I'll continue to experiment. Thanks again for the suggestion. Is there anything else I should try?<br>
<br>
Cheers,<br>
Garth<div class="HOEnZb"><div class="h5"><br>
<br>
><br>
> Robert.<br>
><br>
> On 30 September 2015 at 03:49, Garth D <<a href="mailto:garthy_gso@entropicsoftware.com" target="_blank">garthy_gso@entropicsoftware.com</a>><br>
> wrote:<br>
><br>
>> Hi all,<br>
>><br>
>> I was wondering if anyone has been successful in using the<br>
>> NVX_gpu_memory_info extension with OpenSceneGraph, and the best place to<br>
>> call glGetIntegerv to get the associated values.<br>
>><br>
>> Details on the extension here:<br>
>> <a href="https://www.opengl.org/registry/specs/NVX/gpu_memory_info.txt" rel="noreferrer" target="_blank">https://www.opengl.org/registry/specs/NVX/gpu_memory_info.txt</a><br>
>><br>
>> I'm using Linux, OSG 3.2.1, and a card that supports the<br>
>> NVX_gpu_memory_info extension.<br>
>><br>
>> I have tried querying the current and total memory using<br>
>> GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX and<br>
>> GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX, and in each case but one, the<br>
>> values reported back are zero.<br>
>><br>
>> The only success I have had thus far has been querying the values via an<br>
>> osg::Operation set with ViewerBase::setRealizeOperation() on my viewer<br>
>> (osg::Viewer). The values returned appear to be correct. This allows me to<br>
>> get the correct values *once* at the start of the program. Unfortunately I<br>
>> need to query them periodically, and I have been unable to do this.<br>
>><br>
>> So far, I have tried hooking the calls into:<br>
>> - An osg::Camera::DrawHandler, set via<br>
>> osg::Camera::setInitialDrawCallback().<br>
>> - An osg::Node::NodeHandler, hooked into the root node via<br>
>> osg::Node::setUpdateCallback.<br>
>> - An osg::Drawable::DrawCallback, hooked into a dummy chain off the root<br>
>> of: osg::Node -> osg::Geode -> osg::Geometry (osg::Drawable), via<br>
>> osg::Drawable::setDrawCallback.<br>
>> - An osg::Drawable::CullCallback , hooked into a dummy chain off the root<br>
>> of: osg::Node -> osg::Geode -> osg::Geometry (osg::Drawable), via<br>
>> osg::Drawable::setCullCallback.<br>
>> - An osg::Camera::DrawHandler, set via<br>
>> osg::Camera::setFinalDrawCallback(). Only partly-tested due to a<br>
>> race-condition that occurs in my code, but appears to fail.<br>
>><br>
>> I have experimented with osg::GraphicsContext::makeCurrent() with each.<br>
>><br>
>> Can anyone suggest a better place to hook these calls into? Or<br>
>> alternatively confirm that they have the extension working with one of the<br>
>> above, so I can change or experiment with my existing setup to try to make<br>
>> it work?<br>
>><br>
>> Cheers,<br>
>> Garth<br>
>> _______________________________________________<br>
>> osg-users mailing list<br>
>> <a href="mailto:osg-users@lists.openscenegraph.org" target="_blank">osg-users@lists.openscenegraph.org</a><br>
>> <a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a><br>
>><br>
><br>
><br>
><br>
> _______________________________________________<br>
> osg-users mailing list<br>
> <a href="mailto:osg-users@lists.openscenegraph.org" target="_blank">osg-users@lists.openscenegraph.org</a><br>
> <a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a><br>
><br>
<br>
_______________________________________________<br>
osg-users mailing list<br>
<a href="mailto:osg-users@lists.openscenegraph.org" target="_blank">osg-users@lists.openscenegraph.org</a><br>
<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a><br>
</div></div></blockquote></div><br></div>