From e26579b0ec78b059545eb13ec33bd618edc3fe28 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 28 Feb 2008 17:59:44 +0000 Subject: [PATCH] Moved the delete operations to before of the compile operations to ensure that delete operations don't get pushed out by allocations --- src/osgViewer/Renderer.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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();