[Bf-blender-cvs] [669f2f0] master: OpenSubdiv: Remove partitioned mesh interface

Sergey Sharybin noreply at git.blender.org
Tue Aug 25 15:14:58 CEST 2015


Commit: 669f2f008860af8fb9a9aaafcd26c4e153f429a0
Author: Sergey Sharybin
Date:   Tue Aug 25 15:10:06 2015 +0200
Branches: master
https://developer.blender.org/rB669f2f008860af8fb9a9aaafcd26c4e153f429a0

OpenSubdiv: Remove partitioned mesh interface

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.

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

M	intern/opensubdiv/CMakeLists.txt
M	intern/opensubdiv/opensubdiv_capi.cc
M	intern/opensubdiv/opensubdiv_capi.h
M	intern/opensubdiv/opensubdiv_gpu_capi.cc
D	intern/opensubdiv/opensubdiv_partitioned.h

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

diff --git a/intern/opensubdiv/CMakeLists.txt b/intern/opensubdiv/CMakeLists.txt
index fceaeb9..a4dfe33 100644
--- a/intern/opensubdiv/CMakeLists.txt
+++ b/intern/opensubdiv/CMakeLists.txt
@@ -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)
diff --git a/intern/opensubdiv/opensubdiv_capi.cc b/intern/opensubdiv/opensubdiv_capi.cc
index 23146fc..0192c3a 100644
--- a/intern/opensubdiv/opensubdiv_capi.cc
+++ b/intern/opensubdiv/opensubdiv_capi.cc
@@ -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(
diff --git a/intern/opensubdiv/opensubdiv_capi.h b/intern/opensubdiv/opensubdiv_capi.h
index c09d032..0103952 100644
--- a/intern/opensubdiv/opensubdiv_capi.h
+++ b/intern/opensubdiv/opensubdiv_capi.h
@@ -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,
diff --git a/intern/opensubdiv/opensubdiv_gpu_capi.cc b/intern/opensubdiv/opensubdiv_gpu_capi.cc
index 803265d..7a57f50 100644
--- a/intern/opensubdiv/opensubdiv_gpu_capi.cc
+++ b/intern/opensubdiv/opensubdiv_gpu_capi.cc
@@ -47,11 +47,8 @@
 #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
index 7394a83..0000000
--- a/intern/opensubdiv/opensubdiv_partitioned.h
+++ /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__ */




More information about the Bf-blender-cvs mailing list