7#include <Common/assertion.h>
25 std::size_t numWorkers,
30 std::size_t numWorkers,
40 void scheduleOne(
WorkUnit* out_workUnit)
override;
55 const std::size_t numWorkers,
64 std::max(math::
fast_sqrt(static_cast<float>(numWorkers)), 1.0f))))
68 const std::size_t numWorkers,
75 m_spiralScheduler(numWorkers, totalWorkUnit, spiralTileSize),
76 m_numGridCells (numGridCells),
80inline void SpiralGridScheduler::scheduleOne(
WorkUnit*
const out_workUnit)
82 PH_ASSERT(out_workUnit);
84 if(!m_currentGrid.
schedule(out_workUnit))
87 if(m_spiralScheduler.
schedule(&parentWorkUnit))
94 m_currentGrid.
schedule(out_workUnit);
95 PH_ASSERT_GT(out_workUnit->
getVolume(), 0);
99 *out_workUnit = WorkUnit();
Definition GridScheduler.h:20
Definition SpiralGridScheduler.h:20
SpiralGridScheduler()
Definition SpiralGridScheduler.h:45
Definition SpiralScheduler.h:21
A manager that distributes a fixed amount of work to workers.
Definition WorkScheduler.h:21
bool schedule(WorkUnit *out_workUnit)
Get some amount of work.
Definition WorkScheduler.h:85
Represents some amount of work.
Definition WorkUnit.h:17
std::size_t getVolume() const
Definition WorkUnit.h:82
T product() const
Definition TArithmeticArrayBase.ipp:358
Miscellaneous math utilities.
float fast_sqrt(const float x)
Computes sqrt(x) in a fast but approximative way.
Definition math.h:436
The root for all renderer implementations.
Definition EEngineProject.h:6