Moved GraphicsCostEstimator from osgUtil into core OSG library
This commit is contained in:
@@ -79,6 +79,7 @@ SET(LIB_PUBLIC_HEADERS
|
||||
${HEADER_PATH}/GLBeginEndAdapter
|
||||
${HEADER_PATH}/GLObjects
|
||||
${HEADER_PATH}/GLU
|
||||
${HEADER_PATH}/GraphicsCostEstimator
|
||||
${HEADER_PATH}/GraphicsContext
|
||||
${HEADER_PATH}/GraphicsThread
|
||||
${HEADER_PATH}/Group
|
||||
@@ -251,6 +252,7 @@ ADD_LIBRARY(${LIB_NAME}
|
||||
GLObjects.cpp
|
||||
GLStaticLibrary.h
|
||||
GLStaticLibrary.cpp
|
||||
GraphicsCostEstimator.cpp
|
||||
GraphicsContext.cpp
|
||||
GraphicsThread.cpp
|
||||
Group.cpp
|
||||
|
||||
@@ -11,10 +11,15 @@
|
||||
* OpenSceneGraph Public License for more details.
|
||||
*/
|
||||
|
||||
#include <osgUtil/GraphicsCostEstimator>
|
||||
#include <osg/GraphicsCostEstimator>
|
||||
|
||||
#include <osg/RenderInfo>
|
||||
#include <osg/Geometry>
|
||||
#include <osg/Texture>
|
||||
#include <osg/Program>
|
||||
#include <osg/Geode>
|
||||
|
||||
namespace osgUtil
|
||||
namespace osg
|
||||
{
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -18,7 +18,6 @@ SET(LIB_PUBLIC_HEADERS
|
||||
${HEADER_PATH}/EdgeCollector
|
||||
${HEADER_PATH}/Export
|
||||
${HEADER_PATH}/GLObjectsVisitor
|
||||
${HEADER_PATH}/GraphicsCostEstimator
|
||||
${HEADER_PATH}/HalfWayMapGenerator
|
||||
${HEADER_PATH}/HighlightMapGenerator
|
||||
${HEADER_PATH}/IntersectionVisitor
|
||||
@@ -63,7 +62,6 @@ ADD_LIBRARY(${LIB_NAME}
|
||||
DrawElementTypeSimplifier.cpp
|
||||
EdgeCollector.cpp
|
||||
GLObjectsVisitor.cpp
|
||||
GraphicsCostEstimator.cpp
|
||||
HalfWayMapGenerator.cpp
|
||||
HighlightMapGenerator.cpp
|
||||
IntersectionVisitor.cpp
|
||||
|
||||
@@ -214,7 +214,7 @@ IncrementalCompileOperation::CompileDrawableOp::CompileDrawableOp(osg::Drawable*
|
||||
|
||||
double IncrementalCompileOperation::CompileDrawableOp::estimatedTimeForCompile(CompileInfo& compileInfo) const
|
||||
{
|
||||
GraphicsCostEstimator* gce = compileInfo.incrementalCompileOperation->getGraphicsCostEstimator();
|
||||
osg::GraphicsCostEstimator* gce = compileInfo.graphicsCostEstimator;
|
||||
osg::Geometry* geometry = _drawable->asGeometry();
|
||||
if (gce && geometry)
|
||||
{
|
||||
@@ -237,7 +237,7 @@ IncrementalCompileOperation::CompileTextureOp::CompileTextureOp(osg::Texture* te
|
||||
|
||||
double IncrementalCompileOperation::CompileTextureOp::estimatedTimeForCompile(CompileInfo& compileInfo) const
|
||||
{
|
||||
GraphicsCostEstimator* gce = compileInfo.incrementalCompileOperation->getGraphicsCostEstimator();
|
||||
osg::GraphicsCostEstimator* gce = compileInfo.graphicsCostEstimator;
|
||||
if (gce) return gce->estimateCompileCost(_texture.get()).first;
|
||||
else return 0.0;
|
||||
}
|
||||
@@ -272,7 +272,7 @@ IncrementalCompileOperation::CompileProgramOp::CompileProgramOp(osg::Program* pr
|
||||
|
||||
double IncrementalCompileOperation::CompileProgramOp::estimatedTimeForCompile(CompileInfo& compileInfo) const
|
||||
{
|
||||
GraphicsCostEstimator* gce = compileInfo.incrementalCompileOperation->getGraphicsCostEstimator();
|
||||
osg::GraphicsCostEstimator* gce = compileInfo.graphicsCostEstimator;
|
||||
if (gce) return gce->estimateCompileCost(_program.get()).first;
|
||||
else return 0.0;
|
||||
}
|
||||
@@ -288,6 +288,7 @@ IncrementalCompileOperation::CompileInfo::CompileInfo(osg::GraphicsContext* cont
|
||||
{
|
||||
setState(context->getState());
|
||||
incrementalCompileOperation = ico;
|
||||
graphicsCostEstimator = ico->getGraphicsCostEstimator();
|
||||
}
|
||||
|
||||
|
||||
@@ -443,7 +444,7 @@ IncrementalCompileOperation::IncrementalCompileOperation():
|
||||
_maximumNumOfObjectsToCompilePerFrame = atoi(ptr);
|
||||
}
|
||||
|
||||
_graphicsCostEstimator = new GraphicsCostEstimator;
|
||||
_graphicsCostEstimator = new osg::GraphicsCostEstimator;
|
||||
|
||||
// assignForceTextureDownloadGeometry();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user