From 8ea712526d2fc352baddfaff3f09e605dc9fcdbe Mon Sep 17 00:00:00 2001 From: Turanszki Janos Date: Fri, 9 Nov 2018 21:35:05 +0000 Subject: [PATCH] just tweaked some load balancing constants --- WickedEngine/wiPhysicsEngine_Bullet.cpp | 6 ++++-- WickedEngine/wiSceneSystem.cpp | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/WickedEngine/wiPhysicsEngine_Bullet.cpp b/WickedEngine/wiPhysicsEngine_Bullet.cpp index f22a2de52..e24c0e04a 100644 --- a/WickedEngine/wiPhysicsEngine_Bullet.cpp +++ b/WickedEngine/wiPhysicsEngine_Bullet.cpp @@ -10,6 +10,8 @@ #include "BulletSoftBody/btSoftRigidDynamicsWorld.h" #include "BulletSoftBody/btSoftBodyRigidBodyCollisionConfiguration.h" +#include + using namespace std; using namespace wiECS; using namespace wiSceneSystem; @@ -18,7 +20,7 @@ using namespace wiSceneSystem; namespace wiPhysicsEngine { bool ENABLED = true; - wiSpinLock physicsLock; + std::mutex physicsLock; btVector3 gravity(0, -10, 0); int softbodyIterationCount = 5; @@ -316,7 +318,7 @@ namespace wiPhysicsEngine btVector3 wind = btVector3(weather.windDirection.x, weather.windDirection.y, weather.windDirection.z); // System will register rigidbodies to objects, and update physics engine state for kinematics: - wiJobSystem::Dispatch((uint32_t)rigidbodies.GetCount(), 8, [&](JobDispatchArgs args) { + wiJobSystem::Dispatch((uint32_t)rigidbodies.GetCount(), 256, [&](JobDispatchArgs args) { RigidBodyPhysicsComponent& physicscomponent = rigidbodies[args.jobIndex]; Entity entity = rigidbodies.GetEntity(args.jobIndex); diff --git a/WickedEngine/wiSceneSystem.cpp b/WickedEngine/wiSceneSystem.cpp index a3a6f0066..408e3097a 100644 --- a/WickedEngine/wiSceneSystem.cpp +++ b/WickedEngine/wiSceneSystem.cpp @@ -1334,7 +1334,7 @@ namespace wiSceneSystem } - const uint32_t small_subtask_groupsize = 64; + const uint32_t small_subtask_groupsize = 1024; void RunPreviousFrameTransformUpdateSystem( const ComponentManager& transforms,