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>2015-08-05 16:11:50 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2015-08-05 16:11:50 +0300
commit11bfeb45ce1b1cdb95e6cd4a4ec4efae2b5184e0 (patch)
tree03bc23094f44fe50ff516be3dcd087296db5a7cb /source/blender/blenkernel/intern/subsurf_ccg.c
parent6146fdc7b03020871f0019768e9a044d577bd1fc (diff)
OpenSubdiv: Completely avoid possible access to non-existing CPU data
Make it so CCGDM reports 0 number of geometry when it uses GPU backend for drawing. This screws up a bit statistics in info header and requires to have some special handle of CCGDM in the drawing code, but makes it so non of the areas will try to access non-existing geometry.
Diffstat (limited to 'source/blender/blenkernel/intern/subsurf_ccg.c')
-rw-r--r--source/blender/blenkernel/intern/subsurf_ccg.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c
index 617bf70c081..9971a9ef141 100644
--- a/source/blender/blenkernel/intern/subsurf_ccg.c
+++ b/source/blender/blenkernel/intern/subsurf_ccg.c
@@ -4850,3 +4850,25 @@ void subsurf_calculate_limit_positions(Mesh *me, float (*r_positions)[3])
dm->release(dm);
}
+
+bool subsurf_has_edges(DerivedMesh *dm)
+{
+ CCGDerivedMesh *ccgdm = (CCGDerivedMesh *) dm;
+#ifdef WITH_OPENSUBDIV
+ if (ccgdm->useGpuBackend) {
+ return true;
+ }
+#endif
+ return dm->getNumEdges(dm) != 0;
+}
+
+bool subsurf_has_faces(DerivedMesh *dm)
+{
+ CCGDerivedMesh *ccgdm = (CCGDerivedMesh *) dm;
+#ifdef WITH_OPENSUBDIV
+ if (ccgdm->useGpuBackend) {
+ return true;
+ }
+#endif
+ return dm->getNumPolys(dm) != 0;
+}