Loading...
Searching...
No Matches
glXFBEvaluator.h
Go to the documentation of this file.
//
// Copyright 2015 Pixar
//
// Licensed under the Apache License, Version 2.0 (the "Apache License")
// with the following modification; you may not use this file except in
// compliance with the Apache License and the following modification to it:
// Section 6. Trademarks. is deleted and replaced with:
//
// 6. Trademarks. This License does not grant permission to use the trade
// names, trademarks, service marks, or product names of the Licensor
// and its affiliates, except as required to comply with Section 4(c) of
// the License and to reproduce the content of the NOTICE file.
//
// You may obtain a copy of the Apache License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the Apache License with the above modification is
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the Apache License for the specific
// language governing permissions and limitations under the Apache License.
//
#ifndef OPENSUBDIV3_OSD_GL_XFB_EVALUATOR_H
#define OPENSUBDIV3_OSD_GL_XFB_EVALUATOR_H
#include "../version.h"
#include "../osd/opengl.h"
#include "../osd/types.h"
#include "../osd/bufferDescriptor.h"
namespace OpenSubdiv {
namespace OPENSUBDIV_VERSION {
namespace Far {
class PatchTable;
class StencilTable;
class LimitStencilTable;
}
namespace Osd {
class GLStencilTableTBO {
public:
static GLStencilTableTBO *Create(
Far::StencilTable const *stencilTable, void *deviceContext = NULL) {
(void)deviceContext; // unused
return new GLStencilTableTBO(stencilTable);
}
static GLStencilTableTBO *Create(
Far::LimitStencilTable const *limitStencilTable,
void *deviceContext = NULL) {
(void)deviceContext; // unused
return new GLStencilTableTBO(limitStencilTable);
}
explicit GLStencilTableTBO(Far::StencilTable const *stencilTable);
explicit GLStencilTableTBO(Far::LimitStencilTable const *limitStencilTable);
~GLStencilTableTBO();
// interfaces needed for GLSLTransformFeedbackKernel
GLuint GetSizesTexture() const { return _sizes; }
GLuint GetOffsetsTexture() const { return _offsets; }
GLuint GetIndicesTexture() const { return _indices; }
GLuint GetWeightsTexture() const { return _weights; }
GLuint GetDuWeightsTexture() const { return _duWeights; }
GLuint GetDvWeightsTexture() const { return _dvWeights; }
GLuint GetDuuWeightsTexture() const { return _duuWeights; }
GLuint GetDuvWeightsTexture() const { return _duvWeights; }
GLuint GetDvvWeightsTexture() const { return _dvvWeights; }
int GetNumStencils() const { return _numStencils; }
private:
GLuint _sizes;
GLuint _offsets;
GLuint _indices;
GLuint _weights;
GLuint _duWeights;
GLuint _dvWeights;
GLuint _duuWeights;
GLuint _duvWeights;
GLuint _dvvWeights;
int _numStencils;
};
// ---------------------------------------------------------------------------
class GLXFBEvaluator {
public:
typedef bool Instantiatable;
template <typename DEVICE_CONTEXT>
static GLXFBEvaluator *Create(BufferDescriptor const &srcDesc,
BufferDescriptor const &dstDesc,
BufferDescriptor const &duDesc,
BufferDescriptor const &dvDesc,
DEVICE_CONTEXT deviceContext) {
bool interleavedDerivativeBuffers = deviceContext
? deviceContext->AreInterleavedDerivativeBuffers()
: false;
return Create(srcDesc, dstDesc, duDesc, dvDesc,
interleavedDerivativeBuffers);
}
static GLXFBEvaluator *Create(BufferDescriptor const &srcDesc,
BufferDescriptor const &dstDesc,
BufferDescriptor const &duDesc,
BufferDescriptor const &dvDesc,
void * deviceContext) {
(void)deviceContext; // not used
return Create(srcDesc, dstDesc, duDesc, dvDesc);
}
static GLXFBEvaluator * Create(BufferDescriptor const &srcDesc,
BufferDescriptor const &dstDesc,
BufferDescriptor const &duDesc,
BufferDescriptor const &dvDesc,
bool interleavedDerivativeBuffers = false) {
GLXFBEvaluator *instance = new GLXFBEvaluator(interleavedDerivativeBuffers);
if (instance->Compile(srcDesc, dstDesc, duDesc, dvDesc))
return instance;
delete instance;
return NULL;
}
template <typename DEVICE_CONTEXT>
static GLXFBEvaluator *Create(BufferDescriptor const &srcDesc,
BufferDescriptor const &dstDesc,
BufferDescriptor const &duDesc,
BufferDescriptor const &dvDesc,
BufferDescriptor const &duuDesc,
BufferDescriptor const &duvDesc,
BufferDescriptor const &dvvDesc,
DEVICE_CONTEXT deviceContext) {
bool interleavedDerivativeBuffers = deviceContext
? deviceContext->AreInterleavedDerivativeBuffers()
: false;
return Create(srcDesc, dstDesc, duDesc, dvDesc,
duuDesc, duvDesc, dvvDesc,
interleavedDerivativeBuffers);
}
static GLXFBEvaluator *Create(BufferDescriptor const &srcDesc,
BufferDescriptor const &dstDesc,
BufferDescriptor const &duDesc,
BufferDescriptor const &dvDesc,
BufferDescriptor const &duuDesc,
BufferDescriptor const &duvDesc,
BufferDescriptor const &dvvDesc,
void * deviceContext) {
(void)deviceContext; // not used
return Create(srcDesc, dstDesc, duDesc, dvDesc,
duuDesc, duvDesc, dvvDesc);
}
static GLXFBEvaluator * Create(BufferDescriptor const &srcDesc,
BufferDescriptor const &dstDesc,
BufferDescriptor const &duDesc,
BufferDescriptor const &dvDesc,
BufferDescriptor const &duuDesc,
BufferDescriptor const &duvDesc,
BufferDescriptor const &dvvDesc,
bool interleavedDerivativeBuffers = false) {
GLXFBEvaluator *instance = new GLXFBEvaluator(interleavedDerivativeBuffers);
if (instance->Compile(srcDesc, dstDesc, duDesc, dvDesc,
duuDesc, duvDesc, dvvDesc))
return instance;
delete instance;
return NULL;
}
GLXFBEvaluator(bool interleavedDerivativeBuffers = false);
~GLXFBEvaluator();
template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
static bool EvalStencils(
SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
STENCIL_TABLE const *stencilTable,
GLXFBEvaluator const *instance,
void * deviceContext = NULL) {
if (instance) {
return instance->EvalStencils(srcBuffer, srcDesc,
dstBuffer, dstDesc,
stencilTable);
} else {
// Create an instance on demand (slow)
(void)deviceContext; // unused
instance = Create(srcDesc, dstDesc,
BufferDescriptor(),
BufferDescriptor());
if (instance) {
bool r = instance->EvalStencils(srcBuffer, srcDesc,
dstBuffer, dstDesc,
stencilTable);
delete instance;
return r;
}
return false;
}
}
template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
static bool EvalStencils(
SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
STENCIL_TABLE const *stencilTable,
GLXFBEvaluator const *instance,
void * deviceContext = NULL) {
if (instance) {
return instance->EvalStencils(srcBuffer, srcDesc,
dstBuffer, dstDesc,
duBuffer, duDesc,
dvBuffer, dvDesc,
stencilTable);
} else {
// Create an instance on demand (slow)
(void)deviceContext; // unused
instance = Create(srcDesc, dstDesc, duDesc, dvDesc);
if (instance) {
bool r = instance->EvalStencils(srcBuffer, srcDesc,
dstBuffer, dstDesc,
duBuffer, duDesc,
dvBuffer, dvDesc,
stencilTable);
delete instance;
return r;
}
return false;
}
}
template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
static bool EvalStencils(
SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
STENCIL_TABLE const *stencilTable,
GLXFBEvaluator const *instance,
void * deviceContext = NULL) {
if (instance) {
return instance->EvalStencils(srcBuffer, srcDesc,
dstBuffer, dstDesc,
duBuffer, duDesc,
dvBuffer, dvDesc,
duuBuffer, duuDesc,
duvBuffer, duvDesc,
dvvBuffer, dvvDesc,
stencilTable);
} else {
// Create an instance on demand (slow)
(void)deviceContext; // unused
instance = Create(srcDesc, dstDesc,
duDesc, dvDesc,
duuDesc, duvDesc, dvvDesc);
if (instance) {
bool r = instance->EvalStencils(srcBuffer, srcDesc,
dstBuffer, dstDesc,
duBuffer, duDesc,
dvBuffer, dvDesc,
duuBuffer, duuDesc,
duvBuffer, duvDesc,
dvvBuffer, dvvDesc,
stencilTable);
delete instance;
return r;
}
return false;
}
}
template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
bool EvalStencils(
SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
STENCIL_TABLE const *stencilTable) const {
return EvalStencils(srcBuffer->BindVBO(), srcDesc,
dstBuffer->BindVBO(), dstDesc,
0, BufferDescriptor(),
0, BufferDescriptor(),
stencilTable->GetSizesTexture(),
stencilTable->GetOffsetsTexture(),
stencilTable->GetIndicesTexture(),
stencilTable->GetWeightsTexture(),
0,
0,
/* start = */ 0,
/* end = */ stencilTable->GetNumStencils());
}
template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
bool EvalStencils(
SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
STENCIL_TABLE const *stencilTable) const {
return EvalStencils(srcBuffer->BindVBO(), srcDesc,
dstBuffer->BindVBO(), dstDesc,
duBuffer->BindVBO(), duDesc,
dvBuffer->BindVBO(), dvDesc,
stencilTable->GetSizesTexture(),
stencilTable->GetOffsetsTexture(),
stencilTable->GetIndicesTexture(),
stencilTable->GetWeightsTexture(),
stencilTable->GetDuWeightsTexture(),
stencilTable->GetDvWeightsTexture(),
/* start = */ 0,
/* end = */ stencilTable->GetNumStencils());
}
template <typename SRC_BUFFER, typename DST_BUFFER, typename STENCIL_TABLE>
bool EvalStencils(
SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
STENCIL_TABLE const *stencilTable) const {
return EvalStencils(srcBuffer->BindVBO(), srcDesc,
dstBuffer->BindVBO(), dstDesc,
duBuffer->BindVBO(), duDesc,
dvBuffer->BindVBO(), dvDesc,
duuBuffer->BindVBO(), duuDesc,
duvBuffer->BindVBO(), duvDesc,
dvvBuffer->BindVBO(), dvvDesc,
stencilTable->GetSizesTexture(),
stencilTable->GetOffsetsTexture(),
stencilTable->GetIndicesTexture(),
stencilTable->GetWeightsTexture(),
stencilTable->GetDuWeightsTexture(),
stencilTable->GetDvWeightsTexture(),
stencilTable->GetDuuWeightsTexture(),
stencilTable->GetDuvWeightsTexture(),
stencilTable->GetDvvWeightsTexture(),
/* start = */ 0,
/* end = */ stencilTable->GetNumStencils());
}
bool EvalStencils(GLuint srcBuffer, BufferDescriptor const &srcDesc,
GLuint dstBuffer, BufferDescriptor const &dstDesc,
GLuint duBuffer, BufferDescriptor const &duDesc,
GLuint dvBuffer, BufferDescriptor const &dvDesc,
GLuint sizesBuffer,
GLuint offsetsBuffer,
GLuint indicesBuffer,
GLuint weightsBuffer,
GLuint duWeightsBuffer,
GLuint dvWeightsBuffer,
int start,
int end) const;
bool EvalStencils(GLuint srcBuffer, BufferDescriptor const &srcDesc,
GLuint dstBuffer, BufferDescriptor const &dstDesc,
GLuint duBuffer, BufferDescriptor const &duDesc,
GLuint dvBuffer, BufferDescriptor const &dvDesc,
GLuint duuBuffer, BufferDescriptor const &duuDesc,
GLuint duvBuffer, BufferDescriptor const &duvDesc,
GLuint dvvBuffer, BufferDescriptor const &dvvDesc,
GLuint sizesBuffer,
GLuint offsetsBuffer,
GLuint indicesBuffer,
GLuint weightsBuffer,
GLuint duWeightsBuffer,
GLuint dvWeightsBuffer,
GLuint duuWeightsBuffer,
GLuint duvWeightsBuffer,
GLuint dvvWeightsBuffer,
int start,
int end) const;
template <typename SRC_BUFFER, typename DST_BUFFER,
typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
static bool EvalPatches(
SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
int numPatchCoords,
PATCHCOORD_BUFFER *patchCoords,
PATCH_TABLE *patchTable,
GLXFBEvaluator const *instance,
void * deviceContext = NULL) {
if (instance) {
return instance->EvalPatches(srcBuffer, srcDesc,
dstBuffer, dstDesc,
numPatchCoords, patchCoords,
patchTable);
} else {
// Create an instance on demand (slow)
(void)deviceContext; // unused
instance = Create(srcDesc, dstDesc,
BufferDescriptor(),
BufferDescriptor());
if (instance) {
bool r = instance->EvalPatches(srcBuffer, srcDesc,
dstBuffer, dstDesc,
numPatchCoords, patchCoords,
patchTable);
delete instance;
return r;
}
return false;
}
}
template <typename SRC_BUFFER, typename DST_BUFFER,
typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
static bool EvalPatches(
SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
int numPatchCoords,
PATCHCOORD_BUFFER *patchCoords,
PATCH_TABLE *patchTable,
GLXFBEvaluator const *instance,
void * deviceContext = NULL) {
if (instance) {
return instance->EvalPatches(srcBuffer, srcDesc,
dstBuffer, dstDesc,
duBuffer, duDesc,
dvBuffer, dvDesc,
numPatchCoords, patchCoords,
patchTable);
} else {
// Create an instance on demand (slow)
(void)deviceContext; // unused
instance = Create(srcDesc, dstDesc, duDesc, dvDesc);
if (instance) {
bool r = instance->EvalPatches(srcBuffer, srcDesc,
dstBuffer, dstDesc,
duBuffer, duDesc,
dvBuffer, dvDesc,
numPatchCoords, patchCoords,
patchTable);
delete instance;
return r;
}
return false;
}
}
template <typename SRC_BUFFER, typename DST_BUFFER,
typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
static bool EvalPatches(
SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
int numPatchCoords,
PATCHCOORD_BUFFER *patchCoords,
PATCH_TABLE *patchTable,
GLXFBEvaluator const *instance,
void * deviceContext = NULL) {
if (instance) {
return instance->EvalPatches(srcBuffer, srcDesc,
dstBuffer, dstDesc,
duBuffer, duDesc,
dvBuffer, dvDesc,
duuBuffer, duuDesc,
duvBuffer, duvDesc,
dvvBuffer, dvvDesc,
numPatchCoords, patchCoords,
patchTable);
} else {
// Create an instance on demand (slow)
(void)deviceContext; // unused
instance = Create(srcDesc, dstDesc,
duDesc, dvDesc,
duuDesc, duvDesc, dvvDesc);
if (instance) {
bool r = instance->EvalPatches(srcBuffer, srcDesc,
dstBuffer, dstDesc,
duBuffer, duDesc,
dvBuffer, dvDesc,
duuBuffer, duuDesc,
duvBuffer, duvDesc,
dvvBuffer, dvvDesc,
numPatchCoords, patchCoords,
patchTable);
delete instance;
return r;
}
return false;
}
}
template <typename SRC_BUFFER, typename DST_BUFFER,
typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
bool EvalPatches(
SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
int numPatchCoords,
PATCHCOORD_BUFFER *patchCoords,
PATCH_TABLE *patchTable) const {
return EvalPatches(srcBuffer->BindVBO(), srcDesc,
dstBuffer->BindVBO(), dstDesc,
0, BufferDescriptor(),
0, BufferDescriptor(),
numPatchCoords,
patchCoords->BindVBO(),
patchTable->GetPatchArrays(),
patchTable->GetPatchIndexTextureBuffer(),
patchTable->GetPatchParamTextureBuffer());
}
template <typename SRC_BUFFER, typename DST_BUFFER,
typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
bool EvalPatches(
SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
int numPatchCoords,
PATCHCOORD_BUFFER *patchCoords,
PATCH_TABLE *patchTable) const {
return EvalPatches(srcBuffer->BindVBO(), srcDesc,
dstBuffer->BindVBO(), dstDesc,
duBuffer->BindVBO(), duDesc,
dvBuffer->BindVBO(), dvDesc,
numPatchCoords,
patchCoords->BindVBO(),
patchTable->GetPatchArrays(),
patchTable->GetPatchIndexTextureBuffer(),
patchTable->GetPatchParamTextureBuffer());
}
template <typename SRC_BUFFER, typename DST_BUFFER,
typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
bool EvalPatches(
SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
int numPatchCoords,
PATCHCOORD_BUFFER *patchCoords,
PATCH_TABLE *patchTable) const {
return EvalPatches(srcBuffer->BindVBO(), srcDesc,
dstBuffer->BindVBO(), dstDesc,
duBuffer->BindVBO(), duDesc,
dvBuffer->BindVBO(), dvDesc,
duuBuffer->BindVBO(), duuDesc,
duvBuffer->BindVBO(), duvDesc,
dvvBuffer->BindVBO(), dvvDesc,
numPatchCoords,
patchCoords->BindVBO(),
patchTable->GetPatchArrays(),
patchTable->GetPatchIndexTextureBuffer(),
patchTable->GetPatchParamTextureBuffer());
}
bool EvalPatches(GLuint srcBuffer, BufferDescriptor const &srcDesc,
GLuint dstBuffer, BufferDescriptor const &dstDesc,
GLuint duBuffer, BufferDescriptor const &duDesc,
GLuint dvBuffer, BufferDescriptor const &dvDesc,
int numPatchCoords,
GLuint patchCoordsBuffer,
const PatchArrayVector &patchArrays,
GLuint patchIndexBuffer,
GLuint patchParamsBuffer) const;
bool EvalPatches(GLuint srcBuffer, BufferDescriptor const &srcDesc,
GLuint dstBuffer, BufferDescriptor const &dstDesc,
GLuint duBuffer, BufferDescriptor const &duDesc,
GLuint dvBuffer, BufferDescriptor const &dvDesc,
GLuint duuBuffer, BufferDescriptor const &duuDesc,
GLuint duvBuffer, BufferDescriptor const &duvDesc,
GLuint dvvBuffer, BufferDescriptor const &dvvDesc,
int numPatchCoords,
GLuint patchCoordsBuffer,
const PatchArrayVector &patchArrays,
GLuint patchIndexBuffer,
GLuint patchParamsBuffer) const;
template <typename SRC_BUFFER, typename DST_BUFFER,
typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
static bool EvalPatchesVarying(
SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
int numPatchCoords,
PATCHCOORD_BUFFER *patchCoords,
PATCH_TABLE *patchTable,
GLXFBEvaluator const *instance,
void * deviceContext = NULL) {
if (instance) {
return instance->EvalPatchesVarying(
srcBuffer, srcDesc,
dstBuffer, dstDesc,
numPatchCoords, patchCoords,
patchTable);
} else {
// Create an instance on demand (slow)
(void)deviceContext; // unused
instance = Create(srcDesc, dstDesc,
BufferDescriptor(),
BufferDescriptor());
if (instance) {
bool r = instance->EvalPatchesVarying(
srcBuffer, srcDesc,
dstBuffer, dstDesc,
numPatchCoords, patchCoords,
patchTable);
delete instance;
return r;
}
return false;
}
}
template <typename SRC_BUFFER, typename DST_BUFFER,
typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
bool EvalPatchesVarying(
SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
int numPatchCoords,
PATCHCOORD_BUFFER *patchCoords,
PATCH_TABLE *patchTable) const {
return EvalPatches(srcBuffer->BindVBO(), srcDesc,
dstBuffer->BindVBO(), dstDesc,
0, BufferDescriptor(),
0, BufferDescriptor(),
numPatchCoords,
patchCoords->BindVBO(),
patchTable->GetVaryingPatchArrays(),
patchTable->GetVaryingPatchIndexTextureBuffer(),
patchTable->GetPatchParamTextureBuffer());
}
template <typename SRC_BUFFER, typename DST_BUFFER,
typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
static bool EvalPatchesVarying(
SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
int numPatchCoords,
PATCHCOORD_BUFFER *patchCoords,
PATCH_TABLE *patchTable,
GLXFBEvaluator const *instance,
void * deviceContext = NULL) {
if (instance) {
return instance->EvalPatchesVarying(
srcBuffer, srcDesc,
dstBuffer, dstDesc,
duBuffer, duDesc,
dvBuffer, dvDesc,
numPatchCoords, patchCoords,
patchTable);
} else {
// Create an instance on demand (slow)
(void)deviceContext; // unused
instance = Create(srcDesc, dstDesc,
duDesc, dvDesc);
if (instance) {
bool r = instance->EvalPatchesVarying(
srcBuffer, srcDesc,
dstBuffer, dstDesc,
duBuffer, duDesc,
dvBuffer, dvDesc,
numPatchCoords, patchCoords,
patchTable);
delete instance;
return r;
}
return false;
}
}
template <typename SRC_BUFFER, typename DST_BUFFER,
typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
bool EvalPatchesVarying(
SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
int numPatchCoords,
PATCHCOORD_BUFFER *patchCoords,
PATCH_TABLE *patchTable) const {
return EvalPatches(srcBuffer->BindVBO(), srcDesc,
dstBuffer->BindVBO(), dstDesc,
duBuffer->BindVBO(), duDesc,
dvBuffer->BindVBO(), dvDesc,
numPatchCoords,
patchCoords->BindVBO(),
patchTable->GetVaryingPatchArrays(),
patchTable->GetVaryingPatchIndexTextureBuffer(),
patchTable->GetPatchParamTextureBuffer());
}
template <typename SRC_BUFFER, typename DST_BUFFER,
typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
static bool EvalPatchesVarying(
SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
int numPatchCoords,
PATCHCOORD_BUFFER *patchCoords,
PATCH_TABLE *patchTable,
GLXFBEvaluator const *instance,
void * deviceContext = NULL) {
if (instance) {
return instance->EvalPatchesVarying(
srcBuffer, srcDesc,
dstBuffer, dstDesc,
duBuffer, duDesc,
dvBuffer, dvDesc,
duuBuffer, duuDesc,
duvBuffer, duvDesc,
dvvBuffer, dvvDesc,
numPatchCoords, patchCoords,
patchTable);
} else {
// Create an instance on demand (slow)
(void)deviceContext; // unused
instance = Create(srcDesc, dstDesc,
duDesc, dvDesc,
duuDesc, duvDesc, dvvDesc);
if (instance) {
bool r = instance->EvalPatchesVarying(
srcBuffer, srcDesc,
dstBuffer, dstDesc,
duBuffer, duDesc,
dvBuffer, dvDesc,
duuBuffer, duuDesc,
duvBuffer, duvDesc,
dvvBuffer, dvvDesc,
numPatchCoords, patchCoords,
patchTable);
delete instance;
return r;
}
return false;
}
}
template <typename SRC_BUFFER, typename DST_BUFFER,
typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
bool EvalPatchesVarying(
SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
int numPatchCoords,
PATCHCOORD_BUFFER *patchCoords,
PATCH_TABLE *patchTable) const {
return EvalPatches(srcBuffer->BindVBO(), srcDesc,
dstBuffer->BindVBO(), dstDesc,
duBuffer->BindVBO(), duDesc,
dvBuffer->BindVBO(), dvDesc,
duuBuffer->BindVBO(), duuDesc,
duvBuffer->BindVBO(), duvDesc,
dvvBuffer->BindVBO(), dvvDesc,
numPatchCoords,
patchCoords->BindVBO(),
patchTable->GetVaryingPatchArrays(),
patchTable->GetVaryingPatchIndexTextureBuffer(),
patchTable->GetPatchParamTextureBuffer());
}
template <typename SRC_BUFFER, typename DST_BUFFER,
typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
static bool EvalPatchesFaceVarying(
SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
int numPatchCoords,
PATCHCOORD_BUFFER *patchCoords,
PATCH_TABLE *patchTable,
int fvarChannel,
GLXFBEvaluator const *instance,
void * deviceContext = NULL) {
if (instance) {
return instance->EvalPatchesFaceVarying(
srcBuffer, srcDesc,
dstBuffer, dstDesc,
numPatchCoords, patchCoords,
patchTable, fvarChannel);
} else {
// Create an instance on demand (slow)
(void)deviceContext; // unused
instance = Create(srcDesc, dstDesc,
BufferDescriptor(),
BufferDescriptor());
if (instance) {
bool r = instance->EvalPatchesFaceVarying(
srcBuffer, srcDesc,
dstBuffer, dstDesc,
numPatchCoords, patchCoords,
patchTable, fvarChannel);
delete instance;
return r;
}
return false;
}
}
template <typename SRC_BUFFER, typename DST_BUFFER,
typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
bool EvalPatchesFaceVarying(
SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
int numPatchCoords,
PATCHCOORD_BUFFER *patchCoords,
PATCH_TABLE *patchTable,
int fvarChannel = 0) const {
return EvalPatches(srcBuffer->BindVBO(), srcDesc,
dstBuffer->BindVBO(), dstDesc,
0, BufferDescriptor(),
0, BufferDescriptor(),
numPatchCoords,
patchCoords->BindVBO(),
patchTable->GetFVarPatchArrays(fvarChannel),
patchTable->GetFVarPatchIndexTextureBuffer(fvarChannel),
patchTable->GetFVarPatchParamTextureBuffer(fvarChannel));
}
template <typename SRC_BUFFER, typename DST_BUFFER,
typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
static bool EvalPatchesFaceVarying(
SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
int numPatchCoords,
PATCHCOORD_BUFFER *patchCoords,
PATCH_TABLE *patchTable,
int fvarChannel,
GLXFBEvaluator const *instance,
void * deviceContext = NULL) {
if (instance) {
return instance->EvalPatchesFaceVarying(
srcBuffer, srcDesc,
dstBuffer, dstDesc,
duBuffer, duDesc,
dvBuffer, dvDesc,
numPatchCoords, patchCoords,
patchTable, fvarChannel);
} else {
// Create an instance on demand (slow)
(void)deviceContext; // unused
instance = Create(srcDesc, dstDesc,
duDesc, dvDesc);
if (instance) {
bool r = instance->EvalPatchesFaceVarying(
srcBuffer, srcDesc,
dstBuffer, dstDesc,
duBuffer, duDesc,
dvBuffer, dvDesc,
numPatchCoords, patchCoords,
patchTable, fvarChannel);
delete instance;
return r;
}
return false;
}
}
template <typename SRC_BUFFER, typename DST_BUFFER,
typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
bool EvalPatchesFaceVarying(
SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
int numPatchCoords,
PATCHCOORD_BUFFER *patchCoords,
PATCH_TABLE *patchTable,
int fvarChannel = 0) const {
return EvalPatches(srcBuffer->BindVBO(), srcDesc,
dstBuffer->BindVBO(), dstDesc,
duBuffer->BindVBO(), duDesc,
dvBuffer->BindVBO(), dvDesc,
numPatchCoords,
patchCoords->BindVBO(),
patchTable->GetFVarPatchArrays(fvarChannel),
patchTable->GetFVarPatchIndexTextureBuffer(fvarChannel),
patchTable->GetFVarPatchParamTextureBuffer(fvarChannel));
}
template <typename SRC_BUFFER, typename DST_BUFFER,
typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
static bool EvalPatchesFaceVarying(
SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
int numPatchCoords,
PATCHCOORD_BUFFER *patchCoords,
PATCH_TABLE *patchTable,
int fvarChannel,
GLXFBEvaluator const *instance,
void * deviceContext = NULL) {
if (instance) {
return instance->EvalPatchesFaceVarying(
srcBuffer, srcDesc,
dstBuffer, dstDesc,
duBuffer, duDesc,
dvBuffer, dvDesc,
duuBuffer, duuDesc,
duvBuffer, duvDesc,
dvvBuffer, dvvDesc,
numPatchCoords, patchCoords,
patchTable, fvarChannel);
} else {
// Create an instance on demand (slow)
(void)deviceContext; // unused
instance = Create(srcDesc, dstDesc,
duDesc, dvDesc,
duuDesc, duvDesc, dvvDesc);
if (instance) {
bool r = instance->EvalPatchesFaceVarying(
srcBuffer, srcDesc,
dstBuffer, dstDesc,
duBuffer, duDesc,
dvBuffer, dvDesc,
duuBuffer, duuDesc,
duvBuffer, duvDesc,
dvvBuffer, dvvDesc,
numPatchCoords, patchCoords,
patchTable, fvarChannel);
delete instance;
return r;
}
return false;
}
}
template <typename SRC_BUFFER, typename DST_BUFFER,
typename PATCHCOORD_BUFFER, typename PATCH_TABLE>
bool EvalPatchesFaceVarying(
SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc,
DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc,
DST_BUFFER *duBuffer, BufferDescriptor const &duDesc,
DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc,
DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc,
DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc,
DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc,
int numPatchCoords,
PATCHCOORD_BUFFER *patchCoords,
PATCH_TABLE *patchTable,
int fvarChannel = 0) const {
return EvalPatches(srcBuffer->BindVBO(), srcDesc,
dstBuffer->BindVBO(), dstDesc,
duBuffer->BindVBO(), duDesc,
dvBuffer->BindVBO(), dvDesc,
duuBuffer->BindVBO(), duuDesc,
duvBuffer->BindVBO(), duvDesc,
dvvBuffer->BindVBO(), dvvDesc,
numPatchCoords,
patchCoords->BindVBO(),
patchTable->GetFVarPatchArrays(fvarChannel),
patchTable->GetFVarPatchIndexTextureBuffer(fvarChannel),
patchTable->GetFVarPatchParamTextureBuffer(fvarChannel));
}
bool Compile(BufferDescriptor const &srcDesc,
BufferDescriptor const &dstDesc,
BufferDescriptor const &duDesc = BufferDescriptor(),
BufferDescriptor const &dvDesc = BufferDescriptor(),
BufferDescriptor const &duuDesc = BufferDescriptor(),
BufferDescriptor const &duvDesc = BufferDescriptor(),
BufferDescriptor const &dvvDesc = BufferDescriptor());
static void Synchronize(void *kernel);
private:
GLuint _srcBufferTexture;
GLuint _patchArraysUBO;
bool _interleavedDerivativeBuffers;
struct _StencilKernel {
_StencilKernel();
~_StencilKernel();
bool Compile(BufferDescriptor const &srcDesc,
BufferDescriptor const &dstDesc,
BufferDescriptor const &duDesc,
BufferDescriptor const &dvDesc,
BufferDescriptor const &duuDesc,
BufferDescriptor const &duvDesc,
BufferDescriptor const &dvvDesc,
bool interleavedDerivativeBuffers);
GLuint program;
GLint uniformSrcBufferTexture;
GLint uniformSrcOffset; // src buffer offset (in elements)
GLint uniformSizesTexture;
GLint uniformOffsetsTexture;
GLint uniformIndicesTexture;
GLint uniformWeightsTexture;
GLint uniformDuWeightsTexture;
GLint uniformDvWeightsTexture;
GLint uniformDuuWeightsTexture;
GLint uniformDuvWeightsTexture;
GLint uniformDvvWeightsTexture;
GLint uniformStart; // range
GLint uniformEnd;
} _stencilKernel;
struct _PatchKernel {
_PatchKernel();
~_PatchKernel();
bool Compile(BufferDescriptor const &srcDesc,
BufferDescriptor const &dstDesc,
BufferDescriptor const &duDesc,
BufferDescriptor const &dvDesc,
BufferDescriptor const &duuDesc,
BufferDescriptor const &duvDesc,
BufferDescriptor const &dvvDesc,
bool interleavedDerivativeBuffers);
GLuint program;
GLint uniformSrcBufferTexture;
GLint uniformSrcOffset; // src buffer offset (in elements)
GLint uniformPatchArraysUBOBinding;
GLint uniformPatchParamTexture;
GLint uniformPatchIndexTexture;
} _patchKernel;
};
} // end namespace Osd
} // end namespace OPENSUBDIV_VERSION
using namespace OPENSUBDIV_VERSION;
} // end namespace OpenSubdiv
#endif // OPENSUBDIV3_OSD_GL_XFB_EVALUATOR_H
bufferDescriptor.h
opengl.h
OpenSubdiv
Definition limits.h:32
OpenSubdiv::OPENSUBDIV_VERSION
Definition limits.h:33
OpenSubdiv::OPENSUBDIV_VERSION::Far
Definition refinerSurfaceFactory.h:36
OpenSubdiv::OPENSUBDIV_VERSION::Osd
Definition bufferDescriptor.h:34
OpenSubdiv::OPENSUBDIV_VERSION::Osd::PatchArrayVector
std::vector< PatchArray > PatchArrayVector
Definition types.h:132
OpenSubdiv::OPENSUBDIV_VERSION::Far::PatchTable
Container for arrays of parametric patches.
Definition patchTable.h:55
OpenSubdiv::OPENSUBDIV_VERSION::Far::StencilTable
Stencil table class wrapping the template for compatibility.
Definition stencilTable.h:273
OpenSubdiv::OPENSUBDIV_VERSION::Far::LimitStencilTable
Limit stencil table class wrapping the template for compatibility.
Definition stencilTable.h:583
OpenSubdiv::OPENSUBDIV_VERSION::Osd::BufferDescriptor
BufferDescriptor is a struct which describes buffer elements in interleaved data buffers....
Definition bufferDescriptor.h:61
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableTBO::GetSizesTexture
GLuint GetSizesTexture() const
Definition glXFBEvaluator.h:72
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableTBO::Create
static GLStencilTableTBO * Create(Far::StencilTable const *stencilTable, void *deviceContext=NULL)
Definition glXFBEvaluator.h:54
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableTBO::GetDvvWeightsTexture
GLuint GetDvvWeightsTexture() const
Definition glXFBEvaluator.h:80
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableTBO::GetNumStencils
int GetNumStencils() const
Definition glXFBEvaluator.h:81
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableTBO::GetDuvWeightsTexture
GLuint GetDuvWeightsTexture() const
Definition glXFBEvaluator.h:79
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableTBO::GetDuuWeightsTexture
GLuint GetDuuWeightsTexture() const
Definition glXFBEvaluator.h:78
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableTBO::GetIndicesTexture
GLuint GetIndicesTexture() const
Definition glXFBEvaluator.h:74
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableTBO::~GLStencilTableTBO
~GLStencilTableTBO()
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableTBO::GLStencilTableTBO
GLStencilTableTBO(Far::StencilTable const *stencilTable)
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableTBO::GLStencilTableTBO
GLStencilTableTBO(Far::LimitStencilTable const *limitStencilTable)
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableTBO::GetWeightsTexture
GLuint GetWeightsTexture() const
Definition glXFBEvaluator.h:75
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableTBO::Create
static GLStencilTableTBO * Create(Far::LimitStencilTable const *limitStencilTable, void *deviceContext=NULL)
Definition glXFBEvaluator.h:60
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableTBO::GetDvWeightsTexture
GLuint GetDvWeightsTexture() const
Definition glXFBEvaluator.h:77
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableTBO::GetDuWeightsTexture
GLuint GetDuWeightsTexture() const
Definition glXFBEvaluator.h:76
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLStencilTableTBO::GetOffsetsTexture
GLuint GetOffsetsTexture() const
Definition glXFBEvaluator.h:73
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalPatchesVarying
bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition glXFBEvaluator.h:1287
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::Create
static GLXFBEvaluator * Create(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc, bool interleavedDerivativeBuffers=false)
Definition glXFBEvaluator.h:126
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalStencils
bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, STENCIL_TABLE const *stencilTable) const
Generic stencil function.
Definition glXFBEvaluator.h:506
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::GLXFBEvaluator
GLXFBEvaluator(bool interleavedDerivativeBuffers=false)
Constructor.
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalStencils
bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, STENCIL_TABLE const *stencilTable) const
Generic stencil function.
Definition glXFBEvaluator.h:575
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::Instantiatable
bool Instantiatable
Definition glXFBEvaluator.h:100
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalPatches
bool EvalPatches(GLuint srcBuffer, BufferDescriptor const &srcDesc, GLuint dstBuffer, BufferDescriptor const &dstDesc, GLuint duBuffer, BufferDescriptor const &duDesc, GLuint dvBuffer, BufferDescriptor const &dvDesc, GLuint duuBuffer, BufferDescriptor const &duuDesc, GLuint duvBuffer, BufferDescriptor const &duvDesc, GLuint dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, GLuint patchCoordsBuffer, const PatchArrayVector &patchArrays, GLuint patchIndexBuffer, GLuint patchParamsBuffer) const
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalStencils
static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, STENCIL_TABLE const *stencilTable, GLXFBEvaluator const *instance, void *deviceContext=NULL)
Generic static stencil function. This function has a same signature as other device kernels have so t...
Definition glXFBEvaluator.h:396
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalPatches
bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable) const
Generic limit eval function with derivatives. This function has a same signature as other device kern...
Definition glXFBEvaluator.h:1144
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::Create
static GLXFBEvaluator * Create(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc, BufferDescriptor const &duuDesc, BufferDescriptor const &duvDesc, BufferDescriptor const &dvvDesc, bool interleavedDerivativeBuffers=false)
Definition glXFBEvaluator.h:170
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::Create
static GLXFBEvaluator * Create(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc, void *deviceContext)
Specialization to allow creation without a device context.
Definition glXFBEvaluator.h:117
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalStencils
static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, STENCIL_TABLE const *stencilTable, GLXFBEvaluator const *instance, void *deviceContext=NULL)
Generic static stencil function. This function has a same signature as other device kernels have so t...
Definition glXFBEvaluator.h:306
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalPatchesVarying
static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, GLXFBEvaluator const *instance, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition glXFBEvaluator.h:1351
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalStencils
bool EvalStencils(GLuint srcBuffer, BufferDescriptor const &srcDesc, GLuint dstBuffer, BufferDescriptor const &dstDesc, GLuint duBuffer, BufferDescriptor const &duDesc, GLuint dvBuffer, BufferDescriptor const &dvDesc, GLuint duuBuffer, BufferDescriptor const &duuDesc, GLuint duvBuffer, BufferDescriptor const &duvDesc, GLuint dvvBuffer, BufferDescriptor const &dvvDesc, GLuint sizesBuffer, GLuint offsetsBuffer, GLuint indicesBuffer, GLuint weightsBuffer, GLuint duWeightsBuffer, GLuint dvWeightsBuffer, GLuint duuWeightsBuffer, GLuint duvWeightsBuffer, GLuint dvvWeightsBuffer, int start, int end) const
Dispatch the GLSL XFB kernel on on GPU asynchronously returns false if the kernel hasn't been compile...
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalPatches
static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, GLXFBEvaluator const *instance, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition glXFBEvaluator.h:843
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::Create
static GLXFBEvaluator * Create(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc, BufferDescriptor const &duuDesc, BufferDescriptor const &duvDesc, BufferDescriptor const &dvvDesc, DEVICE_CONTEXT deviceContext)
Generic creator template.
Definition glXFBEvaluator.h:140
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::Create
static GLXFBEvaluator * Create(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc, DEVICE_CONTEXT deviceContext)
Generic creator template.
Definition glXFBEvaluator.h:104
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::Synchronize
static void Synchronize(void *kernel)
Wait the dispatched kernel finishes.
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalPatchesVarying
static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, GLXFBEvaluator const *instance, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition glXFBEvaluator.h:1227
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalPatchesVarying
bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition glXFBEvaluator.h:1617
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalPatchesFaceVarying
bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel=0) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition glXFBEvaluator.h:1889
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalPatches
static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, GLXFBEvaluator const *instance, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition glXFBEvaluator.h:765
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalPatchesFaceVarying
static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, GLXFBEvaluator const *instance, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition glXFBEvaluator.h:1809
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalPatches
bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition glXFBEvaluator.h:1016
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalPatches
static bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, GLXFBEvaluator const *instance, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition glXFBEvaluator.h:943
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalPatches
bool EvalPatches(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable) const
Generic limit eval function with derivatives. This function has a same signature as other device kern...
Definition glXFBEvaluator.h:1070
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalStencils
bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE const *stencilTable) const
Generic stencil function.
Definition glXFBEvaluator.h:457
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalPatches
bool EvalPatches(GLuint srcBuffer, BufferDescriptor const &srcDesc, GLuint dstBuffer, BufferDescriptor const &dstDesc, GLuint duBuffer, BufferDescriptor const &duDesc, GLuint dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, GLuint patchCoordsBuffer, const PatchArrayVector &patchArrays, GLuint patchIndexBuffer, GLuint patchParamsBuffer) const
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::Create
static GLXFBEvaluator * Create(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc, BufferDescriptor const &dvDesc, BufferDescriptor const &duuDesc, BufferDescriptor const &duvDesc, BufferDescriptor const &dvvDesc, void *deviceContext)
Specialization to allow creation without a device context.
Definition glXFBEvaluator.h:157
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalPatchesFaceVarying
bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel=0) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition glXFBEvaluator.h:2084
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalPatchesVarying
static bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, GLXFBEvaluator const *instance, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition glXFBEvaluator.h:1512
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalStencils
bool EvalStencils(GLuint srcBuffer, BufferDescriptor const &srcDesc, GLuint dstBuffer, BufferDescriptor const &dstDesc, GLuint duBuffer, BufferDescriptor const &duDesc, GLuint dvBuffer, BufferDescriptor const &dvDesc, GLuint sizesBuffer, GLuint offsetsBuffer, GLuint indicesBuffer, GLuint weightsBuffer, GLuint duWeightsBuffer, GLuint dvWeightsBuffer, int start, int end) const
Dispatch the GLSL XFB kernel on on GPU asynchronously returns false if the kernel hasn't been compile...
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalPatchesFaceVarying
static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, GLXFBEvaluator const *instance, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition glXFBEvaluator.h:1679
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalStencils
static bool EvalStencils(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, STENCIL_TABLE const *stencilTable, GLXFBEvaluator const *instance, void *deviceContext=NULL)
Generic static stencil function. This function has a same signature as other device kernels have so t...
Definition glXFBEvaluator.h:238
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::~GLXFBEvaluator
~GLXFBEvaluator()
Destructor. note that the GL context must be made current.
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::Compile
bool Compile(BufferDescriptor const &srcDesc, BufferDescriptor const &dstDesc, BufferDescriptor const &duDesc=BufferDescriptor(), BufferDescriptor const &dvDesc=BufferDescriptor(), BufferDescriptor const &duuDesc=BufferDescriptor(), BufferDescriptor const &duvDesc=BufferDescriptor(), BufferDescriptor const &dvvDesc=BufferDescriptor())
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalPatchesVarying
bool EvalPatchesVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition glXFBEvaluator.h:1428
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalPatchesFaceVarying
bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel=0) const
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition glXFBEvaluator.h:1742
OpenSubdiv::OPENSUBDIV_VERSION::Osd::GLXFBEvaluator::EvalPatchesFaceVarying
static bool EvalPatchesFaceVarying(SRC_BUFFER *srcBuffer, BufferDescriptor const &srcDesc, DST_BUFFER *dstBuffer, BufferDescriptor const &dstDesc, DST_BUFFER *duBuffer, BufferDescriptor const &duDesc, DST_BUFFER *dvBuffer, BufferDescriptor const &dvDesc, DST_BUFFER *duuBuffer, BufferDescriptor const &duuDesc, DST_BUFFER *duvBuffer, BufferDescriptor const &duvDesc, DST_BUFFER *dvvBuffer, BufferDescriptor const &dvvDesc, int numPatchCoords, PATCHCOORD_BUFFER *patchCoords, PATCH_TABLE *patchTable, int fvarChannel, GLXFBEvaluator const *instance, void *deviceContext=NULL)
Generic limit eval function. This function has a same signature as other device kernels have so that ...
Definition glXFBEvaluator.h:1976
types.h