* Called by the owner (Scene) to start simulating the task graph. * Dispatch all tasks with refCount == 1 */
| 205 | * Dispatch all tasks with refCount == 1 |
| 206 | */ |
| 207 | void PxTaskMgr::startSimulation() |
| 208 | { |
| 209 | PX_ASSERT( mCpuDispatcher ); |
| 210 | |
| 211 | /* Handle empty task graph */ |
| 212 | if( mPendingTasks == 0 ) |
| 213 | { |
| 214 | |
| 215 | return; |
| 216 | } |
| 217 | |
| 218 | for( PxTaskID i = 0 ; i < mTaskTable.size() ; i++ ) |
| 219 | { |
| 220 | if( mTaskTable[ i ].mType == PxTaskType::TT_COMPLETED ) |
| 221 | { |
| 222 | continue; |
| 223 | } |
| 224 | if( !shdfnd::atomicDecrement( &mTaskTable[ i ].mRefCount ) ) |
| 225 | { |
| 226 | mStartDispatch.pushBack(i); |
| 227 | } |
| 228 | } |
| 229 | for( uint32_t i=0; i<mStartDispatch.size(); ++i) |
| 230 | { |
| 231 | dispatchTask( mStartDispatch[i] ); |
| 232 | } |
| 233 | //mStartDispatch.resize(0); |
| 234 | mStartDispatch.forceSize_Unsafe(0); |
| 235 | } |
| 236 | |
| 237 | void PxTaskMgr::stopSimulation() |
| 238 | { |
no test coverage detected