[Bf-blender-cvs] [30fa31b8656] opensubdiv_compare: OpenSubdiv: Completely disable topology verification

Sergey Sharybin noreply at git.blender.org
Tue May 26 11:13:25 CEST 2020


Commit: 30fa31b865653343bc847a5269fe82e4f61d8f77
Author: Sergey Sharybin
Date:   Tue May 19 10:26:23 2020 +0200
Branches: opensubdiv_compare
https://developer.blender.org/rB30fa31b865653343bc847a5269fe82e4f61d8f77

OpenSubdiv: Completely disable topology verification

Previously it was enabled for debug builds, now it is to be enabled
explicitly.

The reason for this is to reduce overhead when debugging other areas
which might involve subdivision surface. When conversion is to be
debugged set this manually in the code.

===================================================================

M	intern/opensubdiv/CMakeLists.txt
D	intern/opensubdiv/internal/opensubdiv_internal.h
M	intern/opensubdiv/internal/topology/topology_refiner_capi.cc
M	intern/opensubdiv/internal/topology/topology_refiner_factory.cc

===================================================================

diff --git a/intern/opensubdiv/CMakeLists.txt b/intern/opensubdiv/CMakeLists.txt
index 6c8275b5b60..5b5aebd88b8 100644
--- a/intern/opensubdiv/CMakeLists.txt
+++ b/intern/opensubdiv/CMakeLists.txt
@@ -80,7 +80,6 @@ if(WITH_OPENSUBDIV)
 
     internal/opensubdiv_converter_internal.h
     internal/opensubdiv_evaluator_internal.h
-    internal/opensubdiv_internal.h
     internal/opensubdiv_util.h
   )
 
diff --git a/intern/opensubdiv/internal/opensubdiv_internal.h b/intern/opensubdiv/internal/opensubdiv_internal.h
deleted file mode 100644
index 1ddf199c013..00000000000
--- a/intern/opensubdiv/internal/opensubdiv_internal.h
+++ /dev/null
@@ -1,30 +0,0 @@
-// Copyright 2015 Blender Foundation. All rights reserved.
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software Foundation,
-// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-//
-// Author: Sergey Sharybin
-
-#ifndef OPENSUBDIV_INTERNAL_H_
-#define OPENSUBDIV_INTERNAL_H_
-
-// Perform full topology validation when exporting it to OpenSubdiv.
-#ifdef NDEBUG
-// Never do for release builds.
-#  undef OPENSUBDIV_VALIDATE_TOPOLOGY
-#else
-#  define OPENSUBDIV_VALIDATE_TOPOLOGY
-#endif
-
-#endif  // OPENSUBDIV_INTERNAL_H_
diff --git a/intern/opensubdiv/internal/topology/topology_refiner_capi.cc b/intern/opensubdiv/internal/topology/topology_refiner_capi.cc
index 36a6ed16b16..0363c874344 100644
--- a/intern/opensubdiv/internal/topology/topology_refiner_capi.cc
+++ b/intern/opensubdiv/internal/topology/topology_refiner_capi.cc
@@ -21,7 +21,6 @@
 #include "MEM_guardedalloc.h"
 #include "internal/base/edge_map.h"
 #include "internal/opensubdiv_converter_internal.h"
-#include "internal/opensubdiv_internal.h"
 #include "internal/opensubdiv_util.h"
 #include "internal/topology/topology_refiner_impl.h"
 
diff --git a/intern/opensubdiv/internal/topology/topology_refiner_factory.cc b/intern/opensubdiv/internal/topology/topology_refiner_factory.cc
index 2e86a39fb51..05e4759c983 100644
--- a/intern/opensubdiv/internal/topology/topology_refiner_factory.cc
+++ b/intern/opensubdiv/internal/topology/topology_refiner_factory.cc
@@ -28,7 +28,6 @@
 #include <opensubdiv/far/topologyRefinerFactory.h>
 
 #include "internal/opensubdiv_converter_internal.h"
-#include "internal/opensubdiv_internal.h"
 #include "internal/opensubdiv_util.h"
 #include "opensubdiv_converter_capi.h"
 
@@ -293,9 +292,11 @@ TopologyRefinerFactoryType::Options getTopologyRefinerOptions(OpenSubdiv_Convert
 
   const SchemeType scheme_type = getSchemeTypeFromCAPI(converter->getSchemeType(converter));
   TopologyRefinerFactoryType::Options topology_options(scheme_type, sdc_options);
-#ifdef OPENSUBDIV_VALIDATE_TOPOLOGY
-  topology_options.validateFullTopology = true;
-#endif
+
+  // NOTE: When debugging topology conversion related functionality it is helpful to set this
+  // to truth. In all other cases leave it at false. so debugging of other areas is not affected
+  // by performance penalty happening in this module.
+  topology_options.validateFullTopology = false;
 
   return topology_options;
 }



More information about the Bf-blender-cvs mailing list