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:
authorSergey Sharybin <sergey.vfx@gmail.com>2018-07-16 13:55:39 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2018-07-16 13:55:39 +0300
commite1423391621dcc72e55144541cb26b540698edba (patch)
treea8876e5fa028f39ed8f6224099cd69cca5a3d997 /intern/opensubdiv
parent775c4eb903ef7ed23e734a2412b96d1bf2126e8f (diff)
Fix compilation with older OpenSubdiv libraries
Only fixes compilation error, the functionality will be limited. Currently we don't care that much, since all the work is done in the branch anyway. Later on when we'll know which fixes we need to apply on top of latest OpenSubdiv library we will call a library upgrade.
Diffstat (limited to 'intern/opensubdiv')
-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 =