From 0dbafcc316a1f9b721c56f8cb4f4ec005ce6c1f3 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 28 Sep 2012 16:36:42 +0000 Subject: [PATCH] From Leigh Stivers, "We had this problem which shows up with nVidia's latest Quadro driver, 305.93 - and older drivers when the nVidia's setting "Thread Optimization" was turned on, running Windows 7. The symptom, is that after creating a first view and using it, and then creating a second view, the first view will never render anything but black. What happens is this: A view is created, and then the viewers thread is created and runs. The setReleaseContextAtEndOfFrameHint is true. To create a second view, the viewer is setDone(true), and we wait for the thread exit. At this point, inside the ViewerBase::RenderingTraversals code, there are places where it reads "if(_done) return;" The problem, is that it won't reach the code that will releaseContext(). Apparently, this driver won't let any other thread to makeCurrent(), if another thread (dead or not) has ownership. So when the Viewers is re-started, the first view won't be able to use the gc. The change attached (against rev 13153) corrects this." --- src/osgViewer/ViewerBase.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/osgViewer/ViewerBase.cpp b/src/osgViewer/ViewerBase.cpp index b917afb00..2442fbae5 100644 --- a/src/osgViewer/ViewerBase.cpp +++ b/src/osgViewer/ViewerBase.cpp @@ -807,10 +807,9 @@ void ViewerBase::renderingTraversals() } for(itr = contexts.begin(); - itr != contexts.end(); + itr != contexts.end() && !_done; ++itr) { - if (_done) return; if (!((*itr)->getGraphicsThread()) && (*itr)->valid()) { doneMakeCurrentInThisThread = true; @@ -825,11 +824,9 @@ void ViewerBase::renderingTraversals() if (_endRenderingDispatchBarrier.valid()) _endRenderingDispatchBarrier->block(); for(itr = contexts.begin(); - itr != contexts.end(); + itr != contexts.end() && !_done; ++itr) { - if (_done) return; - if (!((*itr)->getGraphicsThread()) && (*itr)->valid()) { doneMakeCurrentInThisThread = true;