Re: [osg-users] Making sure I am completely freeing up OSG shader-related resources

2010-11-19 Thread Fred Smith
I am not surprised this message has been left unanswered as it is not rocket 
science to release shader objects.

It might be a bug, or at least a very unfortunate behavior, in the AMD Catalyst 
drivers, see:

JVM won't die after shader compile
http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflatNumber=286315page=1

Long delay in wglDeleteContext on application exit
http://forums.amd.com/devforum/messageview.cfm?catid=392threadid=141999enterthread=y

Cheers,
Fred

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=33863#33863





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Making sure I am completely freeing up OSG shader-related resources

2010-10-29 Thread Fred Smith
Hi,

I'm in a situation in which my Win32 process takes a lot of time to exit, 
something like 15-20 seconds. This happens as soon as I attach shaders to my 
geode.

Something I want to do first is to make sure I release OSG shader-related 
resources completely before exiting the application.

Here is my code to use shaders then release them:


Code:
Geode *geode;
Program *program = new Program();
Shader *vs = new Shader(...);
Shader *fs = new Shader(...);
program-addShader(vs);
program-addShader(fs);
geode-getOrCreateStateSet()-setAttributeAndMode(program, StateSet::ON);

[...]

// To free up resources I do:
geode-setStateSet(new StateSet());
// obviously release all references to program, fs and vs here

// I expect that, at this point, all shader-related stuff for OSG is gone




Is this good enough?

Cheers,
Fred

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=33252#33252





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org