MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/PhysX / startSimulation

Method startSimulation

physx/source/task/src/TaskManager.cpp:219–258  ·  view source on GitHub ↗

* Called by the owner (Scene) to start simulating the task graph. * Dispatch all tasks with refCount == 1 */

Source from the content-addressed store, hash-verified

217 * Dispatch all tasks with refCount == 1
218 */
219void PxTaskMgr::startSimulation()
220{
221 PX_ASSERT( mCpuDispatcher );
222
223 if( mGpuDispatcher )
224 {
225 mGpuDispatcher->startSimulation();
226 }
227
228 /* Handle empty task graph */
229 if( mPendingTasks == 0 )
230 {
231
232 return;
233 }
234
235 bool gpuDispatch = false;
236 for( PxTaskID i = 0 ; i < mTaskTable.size() ; i++ )
237 {
238 if( mTaskTable[ i ].mType == PxTaskType::TT_COMPLETED )
239 {
240 continue;
241 }
242 if( !shdfnd::atomicDecrement( &mTaskTable[ i ].mRefCount ) )
243 {
244 mStartDispatch.pushBack(i);
245 }
246 }
247 for( uint32_t i=0; i<mStartDispatch.size(); ++i)
248 {
249 gpuDispatch |= dispatchTask( mStartDispatch[i], gpuDispatch );
250 }
251 //mStartDispatch.resize(0);
252 mStartDispatch.forceSize_Unsafe(0);
253
254 if( mGpuDispatcher && gpuDispatch )
255 {
256 mGpuDispatcher->finishGroup();
257 }
258}
259
260void PxTaskMgr::stopSimulation()
261{

Callers 4

concurrentVehicleUpdatesFunction · 0.80
simulateOrCollideMethod · 0.80
sceneQueriesUpdateMethod · 0.80

Calls 4

atomicDecrementFunction · 0.50
sizeMethod · 0.45
pushBackMethod · 0.45
forceSize_UnsafeMethod · 0.45

Tested by

no test coverage detected