Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--intern/opensubdiv/internal/opensubdiv_evaluator_internal.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/intern/opensubdiv/internal/opensubdiv_evaluator_internal.cc b/intern/opensubdiv/internal/opensubdiv_evaluator_internal.cc
index 595df3eaa75..d593518405f 100644
--- a/intern/opensubdiv/internal/opensubdiv_evaluator_internal.cc
+++ b/intern/opensubdiv/internal/opensubdiv_evaluator_internal.cc
@@ -34,6 +34,7 @@
#include <opensubdiv/osd/cpuVertexBuffer.h>
#include <opensubdiv/osd/mesh.h>
#include <opensubdiv/osd/types.h>
+#include <opensubdiv/version.h>
#include "MEM_guardedalloc.h"
@@ -52,6 +53,13 @@ using OpenSubdiv::Far::StencilTable;
using OpenSubdiv::Far::StencilTableFactory;
using OpenSubdiv::Far::TopologyRefiner;
+// TODO(sergey): Remove after official requirement bump for OSD version.
+#if OPENSUBDIV_VERSION_NUMBER >= 30200
+# define OPENSUBDIV_HAS_FVAR_EVALUATION
+#else
+# undef OPENSUBDIV_HAS_FVAR_EVALUATION
+#endif
+
namespace opensubdiv_capi {
namespace {
@@ -652,6 +660,7 @@ OpenSubdiv_EvaluatorInternal* openSubdiv_createEvaluatorInternal(
StencilTableFactory::Create(*refiner, varying_stencil_options);
// Face warying stencil.
const StencilTable* face_varying_stencils = NULL;
+#ifdef OPENSUBDIV_HAS_FVAR_EVALUATION
if (has_face_varying_data) {
StencilTableFactory::Options face_varying_stencil_options;
face_varying_stencil_options.generateOffsets = true;
@@ -664,6 +673,7 @@ OpenSubdiv_EvaluatorInternal* openSubdiv_createEvaluatorInternal(
face_varying_stencils =
StencilTableFactory::Create(*refiner, face_varying_stencil_options);
}
+#endif
// Generate bi-cubic patch table for the limit surface.
// TODO(sergey): Ideally we would want to expose end-cap settings via
// C-API to make it more generic. Currently it matches old Blender's
@@ -694,6 +704,7 @@ OpenSubdiv_EvaluatorInternal* openSubdiv_createEvaluatorInternal(
delete varying_stencils;
varying_stencils = table;
}
+#ifdef OPENSUBDIV_HAS_FVAR_EVALUATION
const StencilTable* local_point_face_varying_stencil_table =
patch_table->GetLocalPointFaceVaryingStencilTable();
if (local_point_face_varying_stencil_table != NULL) {
@@ -705,6 +716,7 @@ OpenSubdiv_EvaluatorInternal* openSubdiv_createEvaluatorInternal(
delete face_varying_stencils;
face_varying_stencils = table;
}
+#endif
// Create OpenSubdiv's CPU side evaluator.
// TODO(sergey): Make it possible to use different evaluators.
opensubdiv_capi::CpuEvalOutput* eval_output =