Fixed d3d11 and gl mesh wrappers to be

consistent wrt the MeshInterface API.
This commit is contained in:
David G. Yu 2014-10-23 13:45:57 -07:00
parent 6cc24d32fd
commit b11d5e22f0
2 changed files with 11 additions and 11 deletions

View File

@ -65,14 +65,14 @@ public:
_drawContext(0),
_d3d11DeviceContext(d3d11DeviceContext)
{
D3D11MeshInterface::refineMesh(*_refiner, level, bits.test(MeshAdaptive));
D3D11MeshInterface::refineMesh(*_refiner, level, bits.test(MeshAdaptive), bits.test(MeshUseSingleCreasePatch));
int numElements =
initializeVertexBuffers(numVertexElements, numVaryingElements, bits);
initializeComputeContext(numVertexElements, numVaryingElements);
initializeDrawContext(numElements, bits);
initializeDrawContext(numElements, level, bits);
}
Mesh(ComputeController * computeController,
@ -193,11 +193,11 @@ private:
delete varyingStencils;
}
void initializeDrawContext(int numElements, MeshBitset bits) {
void initializeDrawContext(int numElements, int level, MeshBitset bits) {
assert(_refiner and _vertexBuffer);
Far::PatchTablesFactory::Options options;
Far::PatchTablesFactory::Options options(level);
options.generateFVarTables = bits.test(MeshFVarData);
_patchTables = Far::PatchTablesFactory::Create(*_refiner, options);
@ -272,14 +272,14 @@ public:
_drawContext(0),
_d3d11DeviceContext(d3d11DeviceContext)
{
D3D11MeshInterface::refineMesh(*_refiner, level, bits.test(MeshAdaptive));
D3D11MeshInterface::refineMesh(*_refiner, level, bits.test(MeshAdaptive), bits.test(MeshUseSingleCreasePatch));
int numElements =
initializeVertexBuffers(numVertexElements, numVaryingElements, bits);
initializeComputeContext(numVertexElements, numVaryingElements);
initializeDrawContext(numElements, bits);
initializeDrawContext(numElements, level, bits);
}
Mesh(ComputeController * computeController,
@ -399,11 +399,11 @@ private:
delete varyingStencils;
}
void initializeDrawContext(int numElements, MeshBitset bits) {
void initializeDrawContext(int numElements, int level, MeshBitset bits) {
assert(_refiner and _vertexBuffer);
Far::PatchTablesFactory::Options options;
Far::PatchTablesFactory::Options options(level);
options.generateFVarTables = bits.test(MeshFVarData);
_patchTables = Far::PatchTablesFactory::Create(*_refiner, options);

View File

@ -287,7 +287,7 @@ public:
initializeComputeContext(numVertexElements, numVaryingElements);
initializeDrawContext(numElements, bits);
initializeDrawContext(numElements, level, bits);
}
Mesh(ComputeController * computeController,
@ -413,11 +413,11 @@ private:
delete varyingStencils;
}
void initializeDrawContext(int numElements, MeshBitset bits) {
void initializeDrawContext(int numElements, int level, MeshBitset bits) {
assert(_refiner and _vertexBuffer);
Far::PatchTablesFactory::Options options;
Far::PatchTablesFactory::Options options(level);
options.generateFVarTables = bits.test(MeshFVarData);
_patchTables = Far::PatchTablesFactory::Create(*_refiner);