Skip to content

Commit

Permalink
InstancerTest : Add perf test for encapsulated rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
danieldresser-ie authored and johnhaddon committed Sep 26, 2024
1 parent 360e8d7 commit 796d790
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions python/GafferSceneTest/InstancerTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3112,6 +3112,16 @@ def testChildNamesPerfWithPrototypesAndIds( self ):
nodes["instancer"]["out"].childNames( "/plane/instances/sphere" )
nodes["instancer"]["out"].childNames( "/plane/instances/cube" )

@GafferTest.TestRunner.PerformanceTestMethod()
def testEncapsulatedRenderPerf( self ):
nodes = self.initSimpleInstancer( withPrototypes = True, withIds = False )
nodes["instancer"]["encapsulateInstanceGroups"].setValue( True )

renderer = GafferScene.Private.IECoreScenePreview.CapturingRenderer( GafferScene.Private.IECoreScenePreview.Renderer.RenderType.Batch )

with GafferTest.TestRunner.PerformanceScope() :
nodes["instancer"]["out"].object( "/plane/instances/sphere" ).render( renderer )
nodes["instancer"]["out"].object( "/plane/instances/cube" ).render( renderer )

if __name__ == "__main__":
unittest.main()

0 comments on commit 796d790

Please sign in to comment.