OpenSubdiv: Remove partitioned mesh interface
authorSergey Sharybin <sergey.vfx@gmail.com>
Tue, 25 Aug 2015 13:10:06 +0000 (15:10 +0200)
committerSergey Sharybin <sergey.vfx@gmail.com>
Tue, 25 Aug 2015 13:12:12 +0000 (15:12 +0200)
It's hopefully no longer needed, at least not needed for as long as
single ptex face corresponds to a single patch which should be always
correct for uniform subdivisions as far as i know.

intern/opensubdiv/CMakeLists.txt
intern/opensubdiv/opensubdiv_capi.cc
intern/opensubdiv/opensubdiv_capi.h
intern/opensubdiv/opensubdiv_gpu_capi.cc
intern/opensubdiv/opensubdiv_partitioned.h [deleted file]

index fceaeb94af9f4e877b6904bc39ba9a8ba8fd94fe..a4dfe33972864491d20660702234353475e2e0aa 100644 (file)
@@ -47,7 +47,6 @@ set(SRC
        opensubdiv_device_context_cuda.h
        opensubdiv_device_context_opencl.h
        opensubdiv_intern.h
-       opensubdiv_partitioned.h
 )
 
 if(WITH_SUBSURF_WERROR)
index 23146fcfc5d7a4a7a4c21acb325903ef86b807ef..0192c3aa3988fb953be603f89e8e56b19d548649 100644 (file)
@@ -68,7 +68,6 @@
 #include <opensubdiv/far/stencilTable.h>
 
 #include "opensubdiv_intern.h"
-#include "opensubdiv_partitioned.h"
 
 #include "MEM_guardedalloc.h"
 
@@ -80,22 +79,22 @@ using OpenSubdiv::Osd::MeshBitset;
 using OpenSubdiv::Far::StencilTable;
 using OpenSubdiv::Osd::GLPatchTable;
 
-using OpenSubdiv::Osd::PartitionedMesh;
+using OpenSubdiv::Osd::Mesh;
 
 /* CPU backend */
 using OpenSubdiv::Osd::CpuGLVertexBuffer;
 using OpenSubdiv::Osd::CpuEvaluator;
-typedef PartitionedMesh<CpuGLVertexBuffer,
-                        StencilTable,
-                        CpuEvaluator,
-                        GLPatchTable> OsdCpuMesh;
+typedef Mesh<CpuGLVertexBuffer,
+             StencilTable,
+             CpuEvaluator,
+             GLPatchTable> OsdCpuMesh;
 
 #ifdef OPENSUBDIV_HAS_OPENMP
 using OpenSubdiv::Osd::OmpEvaluator;
-typedef PartitionedMesh<CpuGLVertexBuffer,
-                        StencilTable,
-                        OmpEvaluator,
-                        GLPatchTable> OsdOmpMesh;
+typedef Mesh<CpuGLVertexBuffer,
+             StencilTable,
+             OmpEvaluator,
+             GLPatchTable> OsdOmpMesh;
 #endif  /* OPENSUBDIV_HAS_OPENMP */
 
 #ifdef OPENSUBDIV_HAS_OPENCL
@@ -103,11 +102,11 @@ using OpenSubdiv::Osd::CLEvaluator;
 using OpenSubdiv::Osd::CLGLVertexBuffer;
 using OpenSubdiv::Osd::CLStencilTable;
 /* TODO(sergey): Use CLDeviceCOntext similar to OSD examples? */
-typedef PartitionedMesh<CLGLVertexBuffer,
-                        CLStencilTable,
-                        CLEvaluator,
-                        GLPatchTable,
-                        CLDeviceContext> OsdCLMesh;
+typedef Mesh<CLGLVertexBuffer,
+             CLStencilTable,
+             CLEvaluator,
+             GLPatchTable,
+             CLDeviceContext> OsdCLMesh;
 static CLDeviceContext g_clDeviceContext;
 #endif  /* OPENSUBDIV_HAS_OPENCL */
 
@@ -115,10 +114,10 @@ static CLDeviceContext g_clDeviceContext;
 using OpenSubdiv::Osd::CudaEvaluator;
 using OpenSubdiv::Osd::CudaGLVertexBuffer;
 using OpenSubdiv::Osd::CudaStencilTable;
-typedef PartitionedMesh<CudaGLVertexBuffer,
-                        CudaStencilTable,
-                        CudaEvaluator,
-                        GLPatchTable> OsdCudaMesh;
+typedef Mesh<CudaGLVertexBuffer,
+             CudaStencilTable,
+             CudaEvaluator,
+             GLPatchTable> OsdCudaMesh;
 static CudaDeviceContext g_cudaDeviceContext;
 #endif  /* OPENSUBDIV_HAS_CUDA */
 
@@ -126,20 +125,20 @@ static CudaDeviceContext g_cudaDeviceContext;
 using OpenSubdiv::Osd::GLXFBEvaluator;
 using OpenSubdiv::Osd::GLStencilTableTBO;
 using OpenSubdiv::Osd::GLVertexBuffer;
-typedef PartitionedMesh<GLVertexBuffer,
-                        GLStencilTableTBO,
-                        GLXFBEvaluator,
-                        GLPatchTable> OsdGLSLTransformFeedbackMesh;
+typedef Mesh<GLVertexBuffer,
+             GLStencilTableTBO,
+             GLXFBEvaluator,
+             GLPatchTable> OsdGLSLTransformFeedbackMesh;
 #endif  /* OPENSUBDIV_HAS_GLSL_TRANSFORM_FEEDBACK */
 
 #ifdef OPENSUBDIV_HAS_GLSL_COMPUTE
 using OpenSubdiv::Osd::GLComputeEvaluator;
 using OpenSubdiv::Osd::GLStencilTableSSBO;
 using OpenSubdiv::Osd::GLVertexBuffer;
-typedef PartitionedMesh<GLVertexBuffer,
-                        GLStencilTableSSBO,
-                        GLComputeEvaluator,
-                        GLPatchTable> OsdGLSLComputeMesh;
+typedef Mesh<GLVertexBuffer,
+             GLStencilTableSSBO,
+             GLComputeEvaluator,
+             GLPatchTable> OsdGLSLComputeMesh;
 #endif
 
 struct OpenSubdiv_GLMesh *openSubdiv_createOsdGLMeshFromTopologyRefiner(
index c09d03262649b5d1a326e513b5ee436ba2baf6c8..0103952ec0c0ba1499f2b690eb8b437dd9bf6c16 100644 (file)
@@ -132,7 +132,7 @@ void openSubdiv_evaluateVarying(OpenSubdiv_EvaluatorDescr *evaluator_descr,
 void openSubdiv_osdGLMeshDisplayPrepare(int use_osd_glsl,
                                         int active_uv_index);
 
-/* Draw patches which corresponds to a given partition. */
+/* Draw specified patches. */
 void openSubdiv_osdGLMeshDisplay(OpenSubdiv_GLMesh *gl_mesh,
                                  int fill_quads,
                                  int start_patch,
index 803265dbe28d77fd7421627e41d15961a985235a..7a57f50d6235fc1abcfec20197e21ce668a8d16e 100644 (file)
 #include <opensubdiv/osd/cpuGLVertexBuffer.h>
 #include <opensubdiv/osd/cpuEvaluator.h>
 
-#include "opensubdiv_partitioned.h"
-
 //using OpenSubdiv::FarPatchTables;
 using OpenSubdiv::Osd::GLMeshInterface;
-//sing OpenSubdiv::PartitionedGLMeshInterface;
 
 extern "C" char datatoc_gpu_shader_opensubd_display_glsl[];
 
@@ -301,7 +298,7 @@ GLuint linkProgram(const char *define)
        return program;
 }
 
-void bindProgram(PartitionedGLMeshInterface * /*mesh*/,
+void bindProgram(GLMeshInterface * /*mesh*/,
                  int program)
 {
        glUseProgram(program);
@@ -467,7 +464,7 @@ void openSubdiv_osdGLMeshDisplayPrepare(int use_osd_glsl,
        }
 }
 
-static GLuint preapre_patchDraw(PartitionedGLMeshInterface *mesh,
+static GLuint preapre_patchDraw(GLMeshInterface *mesh,
                                 bool fill_quads)
 {
        GLint program = 0;
@@ -575,7 +572,7 @@ static void finish_patchDraw(bool fill_quads)
        }
 }
 
-static void draw_partition_patches_range(PartitionedGLMeshInterface *mesh,
+static void draw_partition_patches_range(GLMeshInterface *mesh,
                                          GLuint program,
                                          int start_patch,
                                          int num_patches)
@@ -611,7 +608,7 @@ static void draw_partition_patches_range(PartitionedGLMeshInterface *mesh,
     }
 }
 
-static void draw_all_patches(PartitionedGLMeshInterface *mesh,
+static void draw_all_patches(GLMeshInterface *mesh,
                              GLuint program)
 {
        const OpenSubdiv::Osd::PatchArrayVector& patches =
@@ -635,8 +632,8 @@ void openSubdiv_osdGLMeshDisplay(OpenSubdiv_GLMesh *gl_mesh,
                                  int start_patch,
                                  int num_patches)
 {
-       PartitionedGLMeshInterface *mesh =
-               (PartitionedGLMeshInterface *)(gl_mesh->descriptor);
+       GLMeshInterface *mesh =
+               (GLMeshInterface *)(gl_mesh->descriptor);
 
        /* Make sure all global invariants are initialized. */
        openSubdiv_osdGLDisplayInit();
diff --git a/intern/opensubdiv/opensubdiv_partitioned.h b/intern/opensubdiv/opensubdiv_partitioned.h
deleted file mode 100644 (file)
index 7394a83..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * 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.
- *
- * The Original Code is Copyright (C) 2013 Blender Foundation.
- * All rights reserved.
- *
- * Contributor(s): Sergey Sharybin
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef __OPENSUBDIV_PATITIONED_H__
-#define __OPENSUBDIV_PATITIONED_H__
-
-#include <opensubdiv/osd/glMesh.h>
-#include <opensubdiv/osd/cpuEvaluator.h>
-#include <opensubdiv/osd/glVertexBuffer.h>
-
-namespace OpenSubdiv {
-namespace OPENSUBDIV_VERSION {
-namespace Osd {
-
-/* TODO(sergey): Re-implement partitioning. */
-
-#if 0
-template <class PATCH_TABLE>
-class PartitionedMeshInterface : public MeshInterface<PATCH_TABLE> {
-       typedef PATCH_TABLE PatchTable;
-       typedef typename PatchTable::VertexBufferBinding VertexBufferBinding;
-
-public:
-};
-
-typedef PartitionedMeshInterface<GLPatchTable> PartitionedGLMeshInterface;
-
-#endif
-
-#if 0
-template <typename VERTEX_BUFFER,
-          typename STENCIL_TABLE,
-          typename EVALUATOR,
-          typename PATCH_TABLE,
-          typename DEVICE_CONTEXT = void>
-class PartitionedMesh : public Mesh<VERTEX_BUFFER,
-                                    STENCIL_TABLE,
-                                    EVALUATOR,
-                                    PATCH_TABLE,
-                                    DEVICE_CONTEXT>
-{
-};
-#endif
-
-#define PartitionedGLMeshInterface GLMeshInterface
-#define PartitionedMesh Mesh
-
-}  /* namespace Osd */
-}  /* namespace OPENSUBDIV_VERSION */
-
-using namespace OPENSUBDIV_VERSION;
-
-}  /* namespace OpenSubdiv */
-
-#endif  /* __OPENSUBDIV_PATITIONED_H__ */