[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [61357] trunk/lib/win64_vc12: OpenSubdiv for msvc 2013 65bit

Sergey Sharybin sergey.vfx at gmail.com
Thu May 15 13:54:58 CEST 2014


Revision: 61357
          https://developer.blender.org/rBL61357
Author:   sergey
Date:     2014-05-15 11:54:57 +0000 (Thu, 15 May 2014)
Log Message:
-----------
OpenSubdiv for msvc 2013 65bit

Ships only CPU and GLSL, no CUDA and OpenCL because of
portability issues.

Others libs better be built when we've got portable
CUDA and OpenCL, but this would take a while.

Added Paths:
-----------
    trunk/lib/win64_vc12/opensubdiv/
    trunk/lib/win64_vc12/opensubdiv/include/
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/far/
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/far/bilinearSubdivisionTablesFactory.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/far/catmarkSubdivisionTablesFactory.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/far/dispatcher.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/far/kernelBatch.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/far/kernelBatchFactory.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/far/loopSubdivisionTablesFactory.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/far/mesh.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/far/meshFactory.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/far/patchMap.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/far/patchParam.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/far/patchTables.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/far/patchTablesFactory.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/far/stencilTables.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/far/stencilTablesFactory.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/far/subdivisionTables.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/far/subdivisionTablesFactory.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/far/vertexEditTables.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/far/vertexEditTablesFactory.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/hbr/
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/hbr/allocator.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/hbr/bilinear.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/hbr/catmark.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/hbr/cornerEdit.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/hbr/creaseEdit.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/hbr/face.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/hbr/faceEdit.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/hbr/fvarData.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/hbr/fvarEdit.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/hbr/halfedge.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/hbr/hierarchicalEdit.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/hbr/holeEdit.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/hbr/loop.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/hbr/mesh.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/hbr/subdivision.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/hbr/vertex.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/hbr/vertexEdit.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/osd/
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/osd/computeController.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/osd/cpuComputeContext.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/osd/cpuComputeController.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/osd/cpuEvalLimitContext.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/osd/cpuEvalLimitController.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/osd/cpuEvalStencilsContext.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/osd/cpuEvalStencilsController.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/osd/cpuGLVertexBuffer.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/osd/cpuSmoothNormalContext.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/osd/cpuSmoothNormalController.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/osd/cpuVertexBuffer.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/osd/drawContext.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/osd/drawRegistry.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/osd/error.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/osd/evalLimitContext.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/osd/glDrawContext.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/osd/glDrawRegistry.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/osd/glMesh.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/osd/glVertexBuffer.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/osd/glslComputeContext.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/osd/glslComputeController.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/osd/glslKernelBundle.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/osd/glslTransformFeedbackComputeContext.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/osd/glslTransformFeedbackComputeController.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/osd/glslTransformFeedbackKernelBundle.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/osd/mesh.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/osd/nonCopyable.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/osd/ompComputeController.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/osd/ompEvalStencilsController.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/osd/ompKernel.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/osd/ompSmoothNormalController.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/osd/opengl.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/osd/vertex.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/osd/vertexDescriptor.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/osdutil/
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/osdutil/adaptiveEvaluator.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/osdutil/batch.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/osdutil/drawController.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/osdutil/drawItem.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/osdutil/evaluator_capi.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/osdutil/mesh.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/osdutil/multiMeshFactory.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/osdutil/patchPartitioner.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/osdutil/refiner.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/osdutil/topology.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/osdutil/uniformEvaluator.h
    trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/version.h
    trunk/lib/win64_vc12/opensubdiv/lib/
    trunk/lib/win64_vc12/opensubdiv/lib/osdCPU.lib
    trunk/lib/win64_vc12/opensubdiv/lib/osdCPU_d.lib
    trunk/lib/win64_vc12/opensubdiv/lib/osdGPU.lib
    trunk/lib/win64_vc12/opensubdiv/lib/osdGPU_d.lib
    trunk/lib/win64_vc12/opensubdiv/lib/osdutil.lib
    trunk/lib/win64_vc12/opensubdiv/lib/osdutil_d.lib
    trunk/lib/win64_vc12/opensubdiv/readme.txt

Added: trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/far/bilinearSubdivisionTablesFactory.h
===================================================================
--- trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/far/bilinearSubdivisionTablesFactory.h	                        (rev 0)
+++ trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/far/bilinearSubdivisionTablesFactory.h	2014-05-15 11:54:57 UTC (rev 61357)
@@ -0,0 +1,199 @@
+//
+//   Copyright 2013 Pixar
+//
+//   Licensed under the Apache License, Version 2.0 (the "Apache License")
+//   with the following modification; you may not use this file except in
+//   compliance with the Apache License and the following modification to it:
+//   Section 6. Trademarks. is deleted and replaced with:
+//
+//   6. Trademarks. This License does not grant permission to use the trade
+//      names, trademarks, service marks, or product names of the Licensor
+//      and its affiliates, except as required to comply with Section 4(c) of
+//      the License and to reproduce the content of the NOTICE file.
+//
+//   You may obtain a copy of the Apache License at
+//
+//       http://www.apache.org/licenses/LICENSE-2.0
+//
+//   Unless required by applicable law or agreed to in writing, software
+//   distributed under the Apache License with the above modification is
+//   distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+//   KIND, either express or implied. See the Apache License for the specific
+//   language governing permissions and limitations under the Apache License.
+//
+
+#ifndef FAR_BILINEAR_SUBDIVISION_TABLES_FACTORY_H
+#define FAR_BILINEAR_SUBDIVISION_TABLES_FACTORY_H
+
+#include "../version.h"
+
+#include "../far/subdivisionTables.h"
+#include "../far/meshFactory.h"
+#include "../far/subdivisionTablesFactory.h"
+
+#include <cassert>
+#include <vector>
+
+namespace OpenSubdiv {
+namespace OPENSUBDIV_VERSION {
+
+template <class T, class U> class FarMeshFactory;
+
+/// \brief A specialized factory for bilinear FarSubdivisionTables
+///
+/// Separating the factory allows us to isolate Far data structures from Hbr dependencies.
+///
+template <class T, class U> class FarBilinearSubdivisionTablesFactory {
+protected:
+    template <class X, class Y> friend class FarMeshFactory;
+
+    /// \brief Creates a FarSubdivisiontables instance.
+    ///
+    /// @param meshFactory  a valid FarMeshFactory instance
+    ///
+    /// @param batches      a vector of Kernel refinement batches : the factory 
+    ///                     will reserve and append refinement tasks
+    ///
+    static FarSubdivisionTables * Create( FarMeshFactory<T,U> * meshFactory, FarKernelBatchVector *batches );
+};
+
+// This factory walks the Hbr vertices and accumulates the weights and adjacency
+// (valance) information specific to the bilinear subdivision scheme. The results
+// are stored in a FarSubdivisionTable
+template <class T, class U> FarSubdivisionTables * 
+FarBilinearSubdivisionTablesFactory<T,U>::Create( FarMeshFactory<T,U> * meshFactory, FarKernelBatchVector * batches ) {
+
+    assert( meshFactory );
+     
+    int maxlevel = meshFactory->GetMaxLevel();
+    
+    std::vector<int> & remap = meshFactory->getRemappingTable();
+    
+    FarSubdivisionTablesFactory<T,U> tablesFactory( meshFactory->GetHbrMesh(),  maxlevel, remap );
+
+    FarSubdivisionTables * result = new FarSubdivisionTables(maxlevel, FarSubdivisionTables::BILINEAR);
+
+    // Allocate memory for the indexing tables
+    result->_F_ITa.resize(tablesFactory.GetNumFaceVerticesTotal(maxlevel)*2);
+    result->_F_IT.resize(tablesFactory.GetFaceVertsValenceSum());
+
+    result->_E_IT.resize(tablesFactory.GetNumEdgeVerticesTotal(maxlevel)*2);
+
+    result->_V_ITa.resize((tablesFactory.GetNumVertexVerticesTotal(maxlevel)
+                           - tablesFactory.GetNumVertexVerticesTotal(0))); // subtract corase cage vertices
+
+    // Prepare batch table
+    batches->reserve(maxlevel*5);
+
+    int vertexOffset = 0;
+    int F_IT_offset = 0;
+    int faceTableOffset = 0;
+    int edgeTableOffset = 0;
+    int vertTableOffset = 0;
+
+    int * F_ITa = result->_F_ITa.empty() ? 0 : &result->_F_ITa[0];
+    unsigned int * F_IT = result->_F_IT.empty() ? 0 : &result->_F_IT[0];
+    int * E_IT = result->_E_IT.empty() ? 0 : &result->_E_IT[0];
+    int * V_ITa = result->_V_ITa.empty() ? 0 : &result->_V_ITa[0];
+
+    for (int level=1; level<=maxlevel; ++level) {
+
+        // pointer to the first vertex corresponding to this level
+        vertexOffset = tablesFactory._faceVertIdx[level];
+        result->_vertsOffsets[level] = vertexOffset;
+
+        // Face vertices
+        // "For each vertex, gather all the vertices from the parent face."
+        int nFaceVertices = (int)tablesFactory._faceVertsList[level].size();
+        if (nFaceVertices > 0)
+            batches->push_back(FarKernelBatch( FarKernelBatch::BILINEAR_FACE_VERTEX,
+                                               level,
+                                               /*tableIndex=*/0,
+                                               /*start=*/0,
+                                               /*end=*/nFaceVertices,
+                                               faceTableOffset,
+                                               vertexOffset) );
+        vertexOffset += nFaceVertices;
+        faceTableOffset += nFaceVertices;
+
+        for (int i=0; i < nFaceVertices; ++i) {
+
+            HbrVertex<T> * v = tablesFactory._faceVertsList[level][i];
+            assert(v);
+
+            HbrFace<T> * f=v->GetParentFace();
+            assert(f);
+
+            int valence = f->GetNumVertices();
+
+            F_ITa[2*i+0] = F_IT_offset;
+            F_ITa[2*i+1] = valence;
+
+            for (int j=0; j<valence; ++j)
+                F_IT[F_IT_offset++] = remap[f->GetVertex(j)->GetID()];
+        }
+        F_ITa += nFaceVertices*2;
+
+        // Edge vertices
+
+        // "Average the end-points of the parent edge"
+        int nEdgeVertices = (int)tablesFactory._edgeVertsList[level].size();
+        if (nEdgeVertices > 0)
+            batches->push_back(FarKernelBatch( FarKernelBatch::BILINEAR_EDGE_VERTEX,
+                                               level,
+                                               /*tableIndex=*/0,
+                                               /*start=*/0,
+                                               /*end=*/nEdgeVertices,
+                                               edgeTableOffset,
+                                               vertexOffset) );
+        vertexOffset += nEdgeVertices;
+        edgeTableOffset += nEdgeVertices;
+        for (int i=0; i < nEdgeVertices; ++i) {
+
+            HbrVertex<T> * v = tablesFactory._edgeVertsList[level][i];
+            assert(v);
+            HbrHalfedge<T> * e = v->GetParentEdge();
+            assert(e);
+
+            // get the indices 2 vertices from the parent edge
+            E_IT[2*i+0] = remap[e->GetOrgVertex()->GetID()];
+            E_IT[2*i+1] = remap[e->GetDestVertex()->GetID()];
+
+        }
+        E_IT += nEdgeVertices*2;
+
+        // Vertex vertices
+
+        // "Pass down the parent vertex"
+        int nVertVertices = (int)tablesFactory._vertVertsList[level].size();
+        batches->push_back(FarKernelBatch( FarKernelBatch::BILINEAR_VERT_VERTEX,
+                                           level,
+                                           /*tableIndex=*/0,
+                                           /*start=*/0,
+                                           /*end=*/nVertVertices,
+                                           vertTableOffset,
+                                           vertexOffset));
+        vertexOffset += nVertVertices;
+        vertTableOffset += nVertVertices;
+        
+        for (int i=0; i < nVertVertices; ++i) {
+
+            HbrVertex<T> * v = tablesFactory._vertVertsList[level][i],
+                         * pv = v->GetParentVertex();
+            assert(v and pv);
+
+            V_ITa[i] = remap[pv->GetID()];
+
+        }
+        V_ITa += nVertVertices;
+    }
+    result->_vertsOffsets[maxlevel+1] = vertexOffset;
+    return result;
+}
+
+} // end namespace OPENSUBDIV_VERSION
+using namespace OPENSUBDIV_VERSION;
+
+} // end namespace OpenSubdiv
+
+#endif /* FAR_BILINEAR_SUBDIVISION_TABLES_FACTORY_H */

Added: trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/far/catmarkSubdivisionTablesFactory.h
===================================================================
--- trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/far/catmarkSubdivisionTablesFactory.h	                        (rev 0)
+++ trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/far/catmarkSubdivisionTablesFactory.h	2014-05-15 11:54:57 UTC (rev 61357)
@@ -0,0 +1,347 @@
+//
+//   Copyright 2013 Pixar
+//
+//   Licensed under the Apache License, Version 2.0 (the "Apache License")
+//   with the following modification; you may not use this file except in
+//   compliance with the Apache License and the following modification to it:
+//   Section 6. Trademarks. is deleted and replaced with:
+//
+//   6. Trademarks. This License does not grant permission to use the trade
+//      names, trademarks, service marks, or product names of the Licensor
+//      and its affiliates, except as required to comply with Section 4(c) of
+//      the License and to reproduce the content of the NOTICE file.
+//
+//   You may obtain a copy of the Apache License at
+//
+//       http://www.apache.org/licenses/LICENSE-2.0
+//
+//   Unless required by applicable law or agreed to in writing, software
+//   distributed under the Apache License with the above modification is
+//   distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+//   KIND, either express or implied. See the Apache License for the specific
+//   language governing permissions and limitations under the Apache License.
+//
+
+#ifndef FAR_CATMARK_SUBDIVISION_TABLES_FACTORY_H
+#define FAR_CATMARK_SUBDIVISION_TABLES_FACTORY_H
+
+#include <cassert>
+#include <vector>
+
+#include "../version.h"
+
+#include "../far/subdivisionTables.h"
+#include "../far/meshFactory.h"
+#include "../far/kernelBatchFactory.h"
+#include "../far/subdivisionTablesFactory.h"
+
+namespace OpenSubdiv {
+namespace OPENSUBDIV_VERSION {
+
+template <class T, class U> class FarMeshFactory;
+
+/// \brief A specialized factory for catmark FarSubdivisionTables
+///

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list