[osg-users] Pass an osg::Texture2D to CUDA driver api

Robert Osfield robert.osfield at gmail.com
Wed Jun 15 07:35:25 PDT 2016


Hi Philipp

On 15 June 2016 at 14:48, Philipp Meyer <philipp.meyer at fh-bielefeld.de> wrote:
> figured it out.
> One needs to use
>
>
> Code:
> viewer->setReleaseContextAtEndOfFrameHint(false);
>
>
>
> to prevent the context from getting released after a frame is rendered.
> That way, its resources, like textures, can still be accessed after the frame completes.

I don't have CUDA experience so can't comment on this specifically.

On the OSG side the setReleaseContextAtEndOfFrameHint() is only useful
in when you have a single graphics context and are running your
application SingleThreaded.

There will be other ways to integrate CUDA rather than via the main
loop.  You should be able to create a custom GraphicsOperation and
attach this to a GraphicsWidnow or Camera draw callback to invoke the
CUDA side from within a thread that has the graphics context current.

Robert.



More information about the osg-users mailing list