7#include <Common/assertion.h>
24 std::size_t numWorkers,
28 std::size_t numWorkers,
30 std::size_t slicedAxis);
33 std::size_t m_slicedAxis;
34 std::size_t m_numScheduled;
35 std::size_t m_sideLength;
37 void scheduleOne(
WorkUnit* out_workUnit)
override;
46 , m_slicedAxis (math::constant::X_AXIS)
52 const std::size_t numWorkers,
58 math::constant::Y_AXIS)
62 const std::size_t numWorkers,
64 const std::size_t slicedAxis)
68 , m_slicedAxis (slicedAxis)
70 , m_sideLength (static_cast<
std::size_t>(m_totalWorkUnit.getRegion().getExtents()[slicedAxis]))
73inline void StripeScheduler::scheduleOne(
WorkUnit*
const out_workUnit)
75 PH_ASSERT(out_workUnit);
82 auto [minVertex, maxVertex] = stripRegion.
getVertices();
83 minVertex[m_slicedAxis] +=
static_cast<int64
>(sideRange.first);
84 maxVertex[m_slicedAxis] -=
static_cast<int64
>(m_sideLength - sideRange.second);
93 *out_workUnit = WorkUnit();
Definition StripeScheduler.h:19
StripeScheduler()
Definition StripeScheduler.h:42
A manager that distributes a fixed amount of work to workers.
Definition WorkScheduler.h:21
WorkUnit m_totalWorkUnit
Definition WorkScheduler.h:55
std::size_t m_numWorkers
Definition WorkScheduler.h:54
Represents some amount of work.
Definition WorkUnit.h:17
Region getRegion() const
Definition WorkUnit.h:72
std::size_t getDepth() const
Definition WorkUnit.h:77
std::pair< TVector2< T >, TVector2< T > > getVertices() const
Definition TAABB2D.ipp:132
TAABB2D & setVertices(std::pair< TVector2< T >, TVector2< T > > minMaxVertices)
Definition TAABB2D.ipp:111
Miscellaneous math utilities.
std::pair< std::size_t, std::size_t > ith_evenly_divided_range(const std::size_t rangeIndex, const std::size_t totalSize, const std::size_t numDivisions)
Gets the i-th evenly divided range.
Definition math.h:379
The root for all renderer implementations.
Definition EEngineProject.h:6