|| (aBits & Graphic3d_RenderingParams::PerfCounters_Points) != 0;
const Standard_Boolean toCountElems = (aBits & Graphic3d_RenderingParams::PerfCounters_GroupArrays) != 0 || toCountTris || toCountMem;
const Standard_Boolean toCountGroups = (aBits & Graphic3d_RenderingParams::PerfCounters_Groups) != 0 || toCountElems;
- const Standard_Boolean toCountStructs = (aBits & Graphic3d_RenderingParams::PerfCounters_Structures) != 0 || toCountGroups;
-
- if (toCountStructs)
+ const Standard_Boolean toCountStructs = (aBits & Graphic3d_RenderingParams::PerfCounters_Structures) != 0
+ || (aBits & Graphic3d_RenderingParams::PerfCounters_Layers) != 0 || toCountGroups;
+
+ myCountersTmp[Counter_NbLayers] = theWorkspace->View()->LayerList().Layers().Size();
+ if (toCountStructs
+ || (aBits & Graphic3d_RenderingParams::PerfCounters_Layers) != 0)
{
- myCountersTmp[Counter_NbLayers] = theWorkspace->View()->LayerList().Layers().Size();
+ const Standard_Integer aViewId = theWorkspace->View()->Identification();
for (OpenGl_SequenceOfLayers::Iterator aLayerIter (theWorkspace->View()->LayerList().Layers()); aLayerIter.More(); aLayerIter.Next())
{
const Handle(OpenGl_Layer)& aLayer = aLayerIter.Value();
myCountersTmp[Counter_NbStructsNotCulled] += aLayer->NbStructuresNotCulled();
if (toCountGroups)
{
- updateStructures (aLayer->CullableStructuresBVH().Structures(), toCountStructs, toCountTris, toCountMem);
- updateStructures (aLayer->CullableTrsfPersStructuresBVH().Structures(), toCountStructs, toCountTris, toCountMem);
- updateStructures (aLayer->NonCullableStructures(), toCountStructs, toCountTris, toCountMem);
+ updateStructures (aViewId, aLayer->CullableStructuresBVH().Structures(), toCountElems, toCountTris, toCountMem);
+ updateStructures (aViewId, aLayer->CullableTrsfPersStructuresBVH().Structures(), toCountElems, toCountTris, toCountMem);
+ updateStructures (aViewId, aLayer->NonCullableStructures(), toCountElems, toCountTris, toCountMem);
}
}
}
// function : updateStructures
// purpose :
// =======================================================================
-void OpenGl_FrameStats::updateStructures (const OpenGl_IndexedMapOfStructure& theStructures,
+void OpenGl_FrameStats::updateStructures (Standard_Integer theViewId,
+ const OpenGl_IndexedMapOfStructure& theStructures,
Standard_Boolean theToCountElems,
Standard_Boolean theToCountTris,
Standard_Boolean theToCountMem)
for (OpenGl_IndexedMapOfStructure::Iterator aStructIter (theStructures); aStructIter.More(); aStructIter.Next())
{
const OpenGl_Structure* aStruct = aStructIter.Value();
- if (aStruct->IsCulled())
+ if (aStruct->IsCulled()
+ || !aStruct->IsVisible (theViewId))
{
if (theToCountMem)
{
protected:
//! Updates counters for structures.
- Standard_EXPORT virtual void updateStructures (const OpenGl_IndexedMapOfStructure& theStructures,
+ Standard_EXPORT virtual void updateStructures (Standard_Integer theViewId,
+ const OpenGl_IndexedMapOfStructure& theStructures,
Standard_Boolean theToCountElems,
Standard_Boolean theToCountTris,
Standard_Boolean theToCountMem);
// function : UpdateCulling
// purpose :
// =======================================================================
-void OpenGl_Layer::UpdateCulling (const OpenGl_BVHTreeSelector& theSelector,
+void OpenGl_Layer::UpdateCulling (const Standard_Integer theViewId,
+ const OpenGl_BVHTreeSelector& theSelector,
const Standard_Boolean theToTraverse)
{
updateBVH();
const OpenGl_Structure* aStruct = isTrsfPers
? myBVHPrimitivesTrsfPers.GetStructureById (aIdx)
: myBVHPrimitives.GetStructureById (aIdx);
- aStruct->MarkAsNotCulled();
- ++myNbStructuresNotCulled;
+ if (aStruct->IsVisible (theViewId))
+ {
+ aStruct->MarkAsNotCulled();
+ ++myNbStructuresNotCulled;
+ }
if (aHead < 0)
{
break;
void OpenGl_LayerList::UpdateCulling (const Handle(OpenGl_Workspace)& theWorkspace,
const Standard_Boolean theToDrawImmediate)
{
+ const Standard_Integer aViewId = theWorkspace->View()->Identification();
const OpenGl_BVHTreeSelector& aSelector = theWorkspace->View()->BVHTreeSelector();
for (OpenGl_IndexedLayerIterator anIts (myLayers); anIts.More(); anIts.Next())
{
continue;
}
- aLayer.UpdateCulling (aSelector, theWorkspace->IsCullingEnabled());
+ aLayer.UpdateCulling (aViewId, aSelector, theWorkspace->IsCullingEnabled());
}
}