void Ext::DefaultCpuDispatcher::runTask(PxBaseTask& task)
{
#ifdef PX_PROFILE
	task.runProfiled();
#else
	task.run();
#endif
}
예제 #2
0
void CpuWorkerThread::execute()
{
	mThreadId = getId();

	while (!quitIsSignalled())
	{
		mOwner->resetWakeSignal();

		PxBaseTask* task = TaskQueueHelper::fetchTask(mLocalJobList, mQueueEntryPool);

		if (!task)
		{
			task = mOwner->getJob();
		}

		if (!task)
		{
			task = mOwner->stealJob();
		}

		if (task)
		{
#if PHYSX_PROFILE_SDK
			if (mPvdBinding!=NULL)
			{
				task->runProfiled();
			}
			else
			{
				task->run();
			}
#else
			task->run();
#endif
			task->release();
		}
		else
		{
			mOwner->waitForWork();
		}
	}

	quit();
};
예제 #3
0
void FPhysXCPUDispatcherSingleThread::submitTask( PxBaseTask& Task ) 
{
	SCOPE_CYCLE_COUNTER(STAT_PhysXSingleThread);
	check(IsInGameThread());

	TaskStack.Push(&Task);
	if (TaskStack.Num() > 1)
	{
		return;
	}
	Task.run();
	Task.release();
	while (TaskStack.Num() > 1)
	{
		PxBaseTask& ChildTask = *TaskStack.Pop();
		ChildTask.run();
		ChildTask.release();
	}
	verify(&Task == TaskStack.Pop() && !TaskStack.Num());
}