diff --git a/Gems/PhysX/Code/Tests/Benchmarks/PhysXCharactersBenchmarks.cpp b/Gems/PhysX/Code/Tests/Benchmarks/PhysXCharactersBenchmarks.cpp index 200cbeafde..cd9e3c0395 100644 --- a/Gems/PhysX/Code/Tests/Benchmarks/PhysXCharactersBenchmarks.cpp +++ b/Gems/PhysX/Code/Tests/Benchmarks/PhysXCharactersBenchmarks.cpp @@ -85,8 +85,7 @@ namespace PhysX::Benchmarks class PhysXCharactersBenchmarkFixture : public PhysX::Benchmarks::PhysXBaseBenchmarkFixture { - public: - virtual void SetUp([[maybe_unused]] const ::benchmark::State& state) override + void internalSetUp() { PhysX::Benchmarks::PhysXBaseBenchmarkFixture::SetUpInternal(); //need to get the Physics::System to be able to spawn the rigid bodies @@ -95,12 +94,31 @@ namespace PhysX::Benchmarks m_terrainEntity = PhysX::TestUtils::CreateFlatTestTerrain(m_testSceneHandle, CharacterConstants::TerrainSize, CharacterConstants::TerrainSize); } - virtual void TearDown([[maybe_unused]] const ::benchmark::State& state) override + void internalTearDown() { m_terrainEntity = nullptr; PhysX::Benchmarks::PhysXBaseBenchmarkFixture::TearDownInternal(); } + public: + void SetUp(const benchmark::State&) override + { + internalSetUp(); + } + void SetUp(benchmark::State&) override + { + internalSetUp(); + } + + void TearDown(const benchmark::State&) override + { + internalTearDown(); + } + void TearDown(benchmark::State&) override + { + internalTearDown(); + } + protected: // PhysXBaseBenchmarkFixture Overrides ... AzPhysics::SceneConfiguration GetDefaultSceneConfiguration() override diff --git a/Gems/PhysX/Code/Tests/Benchmarks/PhysXCharactersRagdollBenchmarks.cpp b/Gems/PhysX/Code/Tests/Benchmarks/PhysXCharactersRagdollBenchmarks.cpp index 8febfcddfc..c82d222e80 100644 --- a/Gems/PhysX/Code/Tests/Benchmarks/PhysXCharactersRagdollBenchmarks.cpp +++ b/Gems/PhysX/Code/Tests/Benchmarks/PhysXCharactersRagdollBenchmarks.cpp @@ -70,8 +70,7 @@ namespace PhysX::Benchmarks class PhysXCharactersRagdollBenchmarkFixture : public PhysX::Benchmarks::PhysXBaseBenchmarkFixture { - public: - virtual void SetUp([[maybe_unused]] const ::benchmark::State& state) override + void internalSetUp() { PhysX::Benchmarks::PhysXBaseBenchmarkFixture::SetUpInternal(); //need to get the Physics::System to be able to spawn the rigid bodies @@ -80,12 +79,31 @@ namespace PhysX::Benchmarks m_terrainEntity = PhysX::TestUtils::CreateFlatTestTerrain(m_testSceneHandle, RagdollConstants::TerrainSize, RagdollConstants::TerrainSize); } - virtual void TearDown([[maybe_unused]] const ::benchmark::State& state) override + void internalTearDown() { m_terrainEntity = nullptr; PhysX::Benchmarks::PhysXBaseBenchmarkFixture::TearDownInternal(); } + public: + void SetUp(const benchmark::State&) override + { + internalSetUp(); + } + void SetUp(benchmark::State&) override + { + internalSetUp(); + } + + void TearDown(const benchmark::State&) override + { + internalTearDown(); + } + void TearDown(benchmark::State&) override + { + internalTearDown(); + } + protected: // PhysXBaseBenchmarkFixture Overrides ... AzPhysics::SceneConfiguration GetDefaultSceneConfiguration() override diff --git a/Gems/PhysX/Code/Tests/Benchmarks/PhysXJointBenchmarks.cpp b/Gems/PhysX/Code/Tests/Benchmarks/PhysXJointBenchmarks.cpp index 17468b5cc6..df714d7143 100644 --- a/Gems/PhysX/Code/Tests/Benchmarks/PhysXJointBenchmarks.cpp +++ b/Gems/PhysX/Code/Tests/Benchmarks/PhysXJointBenchmarks.cpp @@ -184,17 +184,36 @@ namespace PhysX::Benchmarks : public PhysXBaseBenchmarkFixture { public: - virtual void SetUp([[maybe_unused]] const ::benchmark::State &state) override + void internalSetUp() { PhysXBaseBenchmarkFixture::SetUpInternal(); } - virtual void TearDown([[maybe_unused]] const ::benchmark::State &state) override + void internalTearDown() { PhysXBaseBenchmarkFixture::TearDownInternal(); } protected: + public: + void SetUp(const benchmark::State&) override + { + internalSetUp(); + } + void SetUp(benchmark::State&) override + { + internalSetUp(); + } + + void TearDown(const benchmark::State&) override + { + internalTearDown(); + } + void TearDown(benchmark::State&) override + { + internalTearDown(); + } + // PhysXBaseBenchmarkFixture Interface --------- AzPhysics::SceneConfiguration GetDefaultSceneConfiguration() override { diff --git a/Gems/PhysX/Code/Tests/Benchmarks/PhysXRigidBodyBenchmarks.cpp b/Gems/PhysX/Code/Tests/Benchmarks/PhysXRigidBodyBenchmarks.cpp index 0117e9737b..58cbd0da23 100644 --- a/Gems/PhysX/Code/Tests/Benchmarks/PhysXRigidBodyBenchmarks.cpp +++ b/Gems/PhysX/Code/Tests/Benchmarks/PhysXRigidBodyBenchmarks.cpp @@ -136,8 +136,8 @@ namespace PhysX::Benchmarks class PhysXRigidbodyBenchmarkFixture : public PhysXBaseBenchmarkFixture { - public: - virtual void SetUp([[maybe_unused]] const ::benchmark::State &state) override + protected: + virtual void internalSetUp() { PhysXBaseBenchmarkFixture::SetUpInternal(); //need to get the Physics::System to be able to spawn the rigid bodies @@ -146,11 +146,29 @@ namespace PhysX::Benchmarks m_terrainEntity = PhysX::TestUtils::CreateFlatTestTerrain(m_testSceneHandle, RigidBodyConstants::TerrainSize, RigidBodyConstants::TerrainSize); } - virtual void TearDown([[maybe_unused]] const ::benchmark::State &state) override + virtual void internalTearDown() { m_terrainEntity = nullptr; PhysXBaseBenchmarkFixture::TearDownInternal(); } + public: + void SetUp(const benchmark::State&) override + { + internalSetUp(); + } + void SetUp(benchmark::State&) override + { + internalSetUp(); + } + + void TearDown(const benchmark::State&) override + { + internalTearDown(); + } + void TearDown(benchmark::State&) override + { + internalTearDown(); + } protected: // PhysXBaseBenchmarkFixture Interface --------- @@ -312,10 +330,9 @@ namespace PhysX::Benchmarks class PhysXRigidbodyCollisionsBenchmarkFixture : public PhysXRigidbodyBenchmarkFixture { - public: - void SetUp(const ::benchmark::State& state) override + void internalSetUp() override { - PhysXRigidbodyBenchmarkFixture::SetUp(state); + PhysXRigidbodyBenchmarkFixture::internalSetUp(); m_collisionBeginCount = 0; m_collisionPersistCount = 0; @@ -346,11 +363,30 @@ namespace PhysX::Benchmarks m_defaultScene->RegisterSceneCollisionEventHandler(m_onSceneCollisionHandler); } - void TearDown(const ::benchmark::State& state) override + void internalTearDown() override { m_onSceneCollisionHandler.Disconnect(); - PhysXRigidbodyBenchmarkFixture::TearDown(state); + PhysXRigidbodyBenchmarkFixture::internalTearDown(); + } + + public: + void SetUp(const benchmark::State&) override + { + internalSetUp(); + } + void SetUp(benchmark::State&) override + { + internalSetUp(); + } + + void TearDown(const benchmark::State&) override + { + internalTearDown(); + } + void TearDown(benchmark::State&) override + { + internalTearDown(); } protected: diff --git a/Gems/PhysX/Code/Tests/Benchmarks/PhysXSceneQueryBenchmarks.cpp b/Gems/PhysX/Code/Tests/Benchmarks/PhysXSceneQueryBenchmarks.cpp index 4a6cbae99b..9a8a28a85e 100644 --- a/Gems/PhysX/Code/Tests/Benchmarks/PhysXSceneQueryBenchmarks.cpp +++ b/Gems/PhysX/Code/Tests/Benchmarks/PhysXSceneQueryBenchmarks.cpp @@ -47,14 +47,12 @@ namespace PhysX::Benchmarks , public PhysX::GenericPhysicsFixture { - public: - //! Spawns box entities in unique locations in 1/8 of sphere with all non-negative dimensions between radii[2, max radius]. //! Accepts 2 parameters from \state. //! //! \state.range(0) - number of box entities to spawn //! \state.range(1) - max radius - void SetUp(const ::benchmark::State& state) override + void internalSetUp(const ::benchmark::State& state) { PhysX::GenericPhysicsFixture::SetUpInternal(); @@ -100,13 +98,32 @@ namespace PhysX::Benchmarks } } - void TearDown([[maybe_unused]] const ::benchmark::State& state) override + void internalTearDown() { m_boxes.clear(); m_entities.clear(); PhysX::GenericPhysicsFixture::TearDownInternal(); } + public: + void SetUp(const benchmark::State& state) override + { + internalSetUp(state); + } + void SetUp(benchmark::State& state) override + { + internalSetUp(state); + } + + void TearDown(const benchmark::State&) override + { + internalTearDown(); + } + void TearDown(benchmark::State&) override + { + internalTearDown(); + } + protected: std::vector m_entities; std::vector m_boxes;