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

Method resolveRow

physx/source/task/src/TaskManager.cpp:434–480  ·  view source on GitHub ↗

* A task has completed, decrement all dependencies and submit tasks * that are ready to run. Signal simulation end if ther are no more * pending tasks. */

Source from the content-addressed store, hash-verified

432 * pending tasks.
433 */
434bool PxTaskMgr::resolveRow( PxTaskID taskID, bool gpuGroupStart )
435{
436 int depRow = mTaskTable[ taskID ].mStartDep;
437
438 uint32_t streamIndex = 0;
439 bool syncRequired = false;
440 if( mTaskTable[ taskID ].mTask )
441 {
442 streamIndex = mTaskTable[ taskID ].mTask->mStreamIndex;
443 }
444
445 while( depRow != EOL )
446 {
447 PxTaskDepTableRow& row = mDepTable[ uint32_t(depRow) ];
448 PxTaskTableRow& dtt = mTaskTable[ row.mTaskID ];
449
450 // pass stream index to (up to one) dependent GPU task
451 if( dtt.mTask && dtt.mType == PxTaskType::TT_GPU && streamIndex )
452 {
453 if( dtt.mTask->mStreamIndex )
454 {
455 PX_ASSERT( dtt.mTask->mStreamIndex != streamIndex );
456 dtt.mTask->mPreSyncRequired = true;
457 }
458 else if( syncRequired )
459 {
460 dtt.mTask->mPreSyncRequired = true;
461 }
462 else
463 {
464 dtt.mTask->mStreamIndex = streamIndex;
465 /* only one forward task gets to use this stream */
466 syncRequired = true;
467 }
468 }
469
470 if( !shdfnd::atomicDecrement( &dtt.mRefCount ) )
471 {
472 gpuGroupStart |= dispatchTask( row.mTaskID, gpuGroupStart );
473 }
474
475 depRow = row.mNextDep;
476 }
477
478 shdfnd::atomicDecrement( &mPendingTasks );
479 return gpuGroupStart;
480}
481
482/*
483 * Submit a ready task to its appropriate dispatcher.

Callers

nothing calls this directly

Calls 1

atomicDecrementFunction · 0.50

Tested by

no test coverage detected