Games Task Scheduler (GTS)
A multi-processor scheduling framework for games engines
gts::ParallelWavefront Class Reference

A construct that maps a parallel-wavefront behavior to a MicroScheduler. More...

#include <ParallelWavefront.h>

Public Member Functions

GTS_INLINE ParallelWavefront (MicroScheduler &scheduler, uint32_t priority=0)
 Creates a ParallelWavefront object bound to the specified 'scheduler'. All parallel-wavefront operations will be scheduled with the specified 'priority'.
 
template<typename TFunc , typename TPartitioner , template< typename... > class TRange, class... TArgs>
GTS_INLINE void operator() (TRange< TArgs... > const &range, TFunc wavefrontFunc, TPartitioner partitioner, void *pUserData)
 Applies the given function 'wavefrontFunc' to the specified iteration 'range'. More...
 

Detailed Description

A construct that maps a parallel-wavefront behavior to a MicroScheduler.

Todo:

Implement 3D version.

Cleanup and Optimize

Member Function Documentation

◆ operator()()

template<typename TFunc , typename TPartitioner , template< typename... > class TRange, class... TArgs>
GTS_INLINE void gts::ParallelWavefront::operator() ( TRange< TArgs... > const &  range,
TFunc  wavefrontFunc,
TPartitioner  partitioner,
void *  pUserData 
)
inline

Applies the given function 'wavefrontFunc' to the specified iteration 'range'.

Parameters
rangeAn iteration range.
wavefrontFuncThe wavefront function to apply to each range block. Signature:
void(*)(TRange& range, void* pUserData, TaskContext const&);
partitionerThe partitioning algorithmic that will subdivided range.
pUserDataOptional user data that will be passed into func.