* Submit a ready task to its appropriate dispatcher. */
| 421 | * Submit a ready task to its appropriate dispatcher. |
| 422 | */ |
| 423 | void PxTaskMgr::dispatchTask( PxTaskID taskID ) |
| 424 | { |
| 425 | LOCK(); // todo: reader lock necessary? |
| 426 | PxTaskTableRow& tt = mTaskTable[ taskID ]; |
| 427 | |
| 428 | // prevent re-submission |
| 429 | if( tt.mType == PxTaskType::TT_COMPLETED ) |
| 430 | { |
| 431 | mErrorCallback.reportError(PxErrorCode::eDEBUG_WARNING, "PxTask dispatched twice", __FILE__, __LINE__); |
| 432 | return; |
| 433 | } |
| 434 | |
| 435 | switch ( tt.mType ) |
| 436 | { |
| 437 | case PxTaskType::TT_CPU: |
| 438 | mCpuDispatcher->submitTask( *tt.mTask ); |
| 439 | break; |
| 440 | case PxTaskType::TT_NOT_PRESENT: |
| 441 | /* No task registered with this taskID, resolve its dependencies */ |
| 442 | PX_ASSERT(!tt.mTask); |
| 443 | //shdfnd::getFoundation().error(PX_INFO, "unregistered task resolved"); |
| 444 | resolveRow( taskID ); |
| 445 | break; |
| 446 | case PxTaskType::TT_COMPLETED: |
| 447 | default: |
| 448 | mErrorCallback.reportError(PxErrorCode::eDEBUG_WARNING, "Unknown task type", __FILE__, __LINE__); |
| 449 | resolveRow( taskID ); |
| 450 | break; |
| 451 | } |
| 452 | |
| 453 | tt.mType = PxTaskType::TT_COMPLETED; |
| 454 | } |
| 455 | |
| 456 | }// end physx namespace |
nothing calls this directly
no test coverage detected