From 669f2f008860af8fb9a9aaafcd26c4e153f429a0 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Tue, 25 Aug 2015 15:10:06 +0200 Subject: 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. --- intern/opensubdiv/CMakeLists.txt | 1 - intern/opensubdiv/opensubdiv_capi.cc | 53 ++++++++++---------- intern/opensubdiv/opensubdiv_capi.h | 2 +- intern/opensubdiv/opensubdiv_gpu_capi.cc | 15 +++--- intern/opensubdiv/opensubdiv_partitioned.h | 77 ------------------------------ 5 files changed, 33 insertions(+), 115 deletions(-) delete mode 100644 intern/opensubdiv/opensubdiv_partitioned.h (limited to 'intern/opensubdiv') diff --git a/intern/opensubdiv/CMakeLists.txt b/intern/opensubdiv/CMakeLists.txt index fceaeb94af9..a4dfe339728 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 23146fcfc5d..0192c3aa398 100644 --- a/intern/opensubdiv/opensubdiv_capi.cc +++ b/intern/opensubdiv/opensubdiv_capi.cc @@ -68,7 +68,6 @@ #include #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 OsdCpuMesh; +typedef Mesh OsdCpuMesh; #ifdef OPENSUBDIV_HAS_OPENMP using OpenSubdiv::Osd::OmpEvaluator; -typedef PartitionedMesh OsdOmpMesh; +typedef Mesh 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 OsdCLMesh; +typedef Mesh 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 OsdCudaMesh; +typedef Mesh 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 OsdGLSLTransformFeedbackMesh; +typedef Mesh 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 OsdGLSLComputeMesh; +typedef Mesh OsdGLSLComputeMesh; #endif struct OpenSubdiv_GLMesh *openSubdiv_createOsdGLMeshFromTopologyRefiner( diff --git a/intern/opensubdiv/opensubdiv_capi.h b/intern/opensubdiv/opensubdiv_capi.h index c09d0326264..0103952ec0c 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 803265dbe28..7a57f50d623 100644 --- a/intern/opensubdiv/opensubdiv_gpu_capi.cc +++ b/intern/opensubdiv/opensubdiv_gpu_capi.cc @@ -47,11 +47,8 @@ #include #include -#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 7394a83cd0a..00000000000 --- 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 -#include -#include - -namespace OpenSubdiv { -namespace OPENSUBDIV_VERSION { -namespace Osd { - -/* TODO(sergey): Re-implement partitioning. */ - -#if 0 -template -class PartitionedMeshInterface : public MeshInterface { - typedef PATCH_TABLE PatchTable; - typedef typename PatchTable::VertexBufferBinding VertexBufferBinding; - -public: -}; - -typedef PartitionedMeshInterface PartitionedGLMeshInterface; - -#endif - -#if 0 -template -class PartitionedMesh : public Mesh -{ -}; -#endif - -#define PartitionedGLMeshInterface GLMeshInterface -#define PartitionedMesh Mesh - -} /* namespace Osd */ -} /* namespace OPENSUBDIV_VERSION */ - -using namespace OPENSUBDIV_VERSION; - -} /* namespace OpenSubdiv */ - -#endif /* __OPENSUBDIV_PATITIONED_H__ */ -- cgit v1.2.3