25 #ifndef OSD_CPU_EVAL_LIMIT_CONTROLLER_H
26 #define OSD_CPU_EVAL_LIMIT_CONTROLLER_H
28 #include "../version.h"
30 #include "../osd/cpuEvalLimitContext.h"
31 #include "../osd/vertexDescriptor.h"
33 namespace OpenSubdiv {
34 namespace OPENSUBDIV_VERSION {
83 template<
class INPUT_BUFFER,
class OUTPUT_BUFFER>
86 OUTPUT_BUFFER *outdQu=0,
87 OUTPUT_BUFFER *outdQv=0 ) {
88 _currentBindState.vertexData.inDesc = iDesc;
89 _currentBindState.vertexData.in = inQ ? inQ->BindCpuBuffer() : 0;
91 _currentBindState.vertexData.outDesc = oDesc;
92 _currentBindState.vertexData.out = outQ ? outQ->BindCpuBuffer() : 0;
93 _currentBindState.vertexData.outDu = outdQu ? outdQu->BindCpuBuffer() : 0;
94 _currentBindState.vertexData.outDv = outdQv ? outdQv->BindCpuBuffer() : 0;
107 template<
class INPUT_BUFFER,
class OUTPUT_BUFFER>
110 _currentBindState.varyingData.inDesc = iDesc;
111 _currentBindState.varyingData.in = inQ ? inQ->BindCpuBuffer() : 0;
113 _currentBindState.varyingData.outDesc = oDesc;
114 _currentBindState.varyingData.out = outQ ? outQ->BindCpuBuffer() : 0;
130 template<
class OUTPUT_BUFFER>
133 _currentBindState.facevaryingData.inDesc = iDesc;
135 _currentBindState.facevaryingData.outDesc = oDesc;
136 _currentBindState.facevaryingData.out = outQ ? outQ->BindCpuBuffer() : 0;
166 float * outDQV )
const;
184 unsigned int index )
const {
188 int n = _EvalLimitSample( coords, context, index );
194 _currentBindState.Reset();
257 int _EvalLimitSample(
EvalCoords const & coords,
259 unsigned int index )
const;
270 facevaryingData.Reset();
273 VertexData vertexData;
274 VaryingData varyingData;
275 FacevaryingData facevaryingData;
278 BindState _currentBindState;
284 using namespace OPENSUBDIV_VERSION;
void BindVaryingBuffers(VertexBufferDescriptor const &iDesc, INPUT_BUFFER *inQ, VertexBufferDescriptor const &oDesc, OUTPUT_BUFFER *outQ)
Binds the varying-interpolated data streams.
CpuEvalLimitController()
Constructor.
CPU controler for limit surface evaluation.
int EvalLimitSample(EvalCoords const &coords, CpuEvalLimitContext *context, unsigned int index) const
Vertex interpolation of samples at the limit.
VertexBufferDescriptor outDesc
Describes vertex elements in interleaved data buffers.
void Reset()
Resets the descriptor to default.
VertexBufferDescriptor outDesc
~CpuEvalLimitController()
Destructor.
Coordinates set on a limit surface.
void BindFacevaryingBuffers(VertexBufferDescriptor const &iDesc, VertexBufferDescriptor const &oDesc, OUTPUT_BUFFER *outQ)
Binds the face-varying-interpolated data streams.
VertexBufferDescriptor inDesc
VertexBufferDescriptor inDesc
int EvalLimitSample(EvalCoords const &coord, CpuEvalLimitContext *context, VertexBufferDescriptor const &outDesc, float *outQ, float *outDQU, float *outDQV) const
Vertex interpolation of a single sample at the limit.
void BindVertexBuffers(VertexBufferDescriptor const &iDesc, INPUT_BUFFER *inQ, VertexBufferDescriptor const &oDesc, OUTPUT_BUFFER *outQ, OUTPUT_BUFFER *outdQu=0, OUTPUT_BUFFER *outdQv=0)
Binds control vertex data buffer.
VertexBufferDescriptor outDesc
VertexBufferDescriptor inDesc