25 #ifndef FAR_KERNELBATCH_DISPATCHER_H
26 #define FAR_KERNELBATCH_DISPATCHER_H
28 #include "../version.h"
30 #include "../far/kernelBatch.h"
31 #include "../far/stencilTables.h"
35 namespace OpenSubdiv {
36 namespace OPENSUBDIV_VERSION {
69 template <
class CONTROLLER,
class CONTEXT>
static void Apply(
70 CONTROLLER *controller, CONTEXT *context,
KernelBatchVector const & batches,
int maxlevel);
83 template <
class CONTROLLER,
class CONTEXT>
static bool ApplyKernel(
84 CONTROLLER *controller, CONTEXT *context,
KernelBatch const &batch);
103 template <
class CONTROLLER,
class CONTEXT>
bool
117 controller->ApplyStencilTableKernel(batch, context);
128 template <
class CONTROLLER,
class CONTEXT>
void
132 for (
int i = 0; i < (int)batches.size(); ++i) {
136 if (maxlevel>=0 and batch.
level>=maxlevel) {
144 template <
class CONTEXT>
void
146 KernelBatch const &batch, CONTEXT *context)
const {
148 StencilTables const * stencilTables = context->GetStencilTables();
149 assert(stencilTables);
151 typename CONTEXT::VertexType *vsrc = &context->GetVertices().at(0),
160 using namespace OPENSUBDIV_VERSION;
static bool ApplyKernel(CONTROLLER *controller, CONTEXT *context, KernelBatch const &batch)
Launches the processing of a kernel batch returns true if the batch is handled, otherwise returns fal...
A GP Compute Kernel descriptor.
Table of subdivision stencils.
std::vector< KernelBatch > KernelBatchVector
int GetNumControlVertices() const
void UpdateValues(T const *controlValues, T *values, int start=-1, int end=-1) const
Updates point values based on the control values.
Far default controller implementation.
void ApplyStencilTableKernel(KernelBatch const &batch, CONTEXT *context) const
static void Apply(CONTROLLER *controller, CONTEXT *context, KernelBatchVector const &batches, int maxlevel)
Launches the processing of a vector of kernel batches this is a convenient API for controllers which ...
Subdivision refinement encapsulation layer.