From 295da33cdfc5e4ed02e57bb4d06f9a9f5eaaa0e4 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 24 Jun 2016 16:05:07 +0100 Subject: [PATCH] Fixed compute of numProcessors --- src/osgViewer/CompositeViewer.cpp | 2 +- src/osgViewer/Viewer.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/osgViewer/CompositeViewer.cpp b/src/osgViewer/CompositeViewer.cpp index bbcf24bd5..6ec168f6a 100644 --- a/src/osgViewer/CompositeViewer.cpp +++ b/src/osgViewer/CompositeViewer.cpp @@ -654,7 +654,7 @@ void CompositeViewer::realize() if (osg::DisplaySettings::instance()->getCompileContextsHint()) { - int numProcessors = osg::minimum(1, OpenThreads::GetNumberOfProcessors()); + int numProcessors = osg::maximum(1, OpenThreads::GetNumberOfProcessors()); int processNum = 0; for(unsigned int i=0; i<= osg::GraphicsContext::getMaxContextID(); ++i) diff --git a/src/osgViewer/Viewer.cpp b/src/osgViewer/Viewer.cpp index 7fe4bc366..fab1c9919 100644 --- a/src/osgViewer/Viewer.cpp +++ b/src/osgViewer/Viewer.cpp @@ -596,7 +596,7 @@ void Viewer::realize() if (osg::DisplaySettings::instance()->getCompileContextsHint()) { - int numProcessors = osg::minimum(1, OpenThreads::GetNumberOfProcessors()); + int numProcessors = osg::maximum(1, OpenThreads::GetNumberOfProcessors()); int processNum = 0; for(unsigned int i=0; i<= osg::GraphicsContext::getMaxContextID(); ++i)