diff --git a/src/osgViewer/Renderer.cpp b/src/osgViewer/Renderer.cpp index 8903abbd7..3a88a6166 100644 --- a/src/osgViewer/Renderer.cpp +++ b/src/osgViewer/Renderer.cpp @@ -390,10 +390,6 @@ void Renderer::draw() _availableQueue.add(sceneView); double availableTime = 0.004; // 4 ms - if (databasePager && databasePager->requiresExternalCompileGLObjects(sceneView->getState()->getContextID())) - { - databasePager->compileGLObjects(*(sceneView->getState()), availableTime); - } if (compileThread) { @@ -404,6 +400,11 @@ void Renderer::draw() sceneView->flushDeletedGLObjects(availableTime); } + if (databasePager && databasePager->requiresExternalCompileGLObjects(sceneView->getState()->getContextID())) + { + databasePager->compileGLObjects(*(sceneView->getState()), availableTime); + } + if (acquireGPUStats) { endQuery();