Moved GraphicsCostEstimator from osgUtil into core OSG library
This commit is contained in:
@@ -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