Sergey Sharybin
2015-11-10 06:58:02 UTC
Revision: 61559
https://developer.blender.org/rBL61559
Author: sergey
Date: 2015-11-10 06:58:01 +0000 (Tue, 10 Nov 2015)
Log Message:
-----------
Win 64: Update OpenSubdiv to cf7135e
Modified Paths:
--------------
trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/far/stencilTable.h
trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/osd/ompEvaluator.h
trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/osd/opengl.h
trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/sdc/loopScheme.h
trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/version.h
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/readme.txt
Modified: trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/far/stencilTable.h
===================================================================
--- trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/far/stencilTable.h 2015-11-07 08:19:13 UTC (rev 61558)
+++ trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/far/stencilTable.h 2015-11-10 06:58:01 UTC (rev 61559)
@@ -205,6 +205,9 @@
// Resize the table arrays (factory helper)
void resize(int nstencils, int nelems);
+ // Reserves the table arrays (factory helper)
+ void reserve(int nstencils, int nelems);
+
protected:
StencilTable() : _numControlVertices(0) {}
StencilTable(int numControlVerts)
@@ -212,8 +215,12 @@
{ }
friend class StencilTableFactory;
+ friend class PatchTableFactory;
// XXX: temporarily, GregoryBasis class will go away.
friend class GregoryBasis;
+ // XXX: needed to call reserve().
+ friend class EndCapBSplineBasisPatchFactory;
+ friend class EndCapGregoryBasisPatchFactory;
int _numControlVertices; // number of control vertices
@@ -297,6 +304,12 @@
public:
+ /// \brief Returns a LimitStencil at index i in the table
+ LimitStencil GetLimitStencil(Index i) const;
+
+ /// \brief Returns the limit stencil at index i in the table
+ LimitStencil operator[] (Index index) const;
+
/// \brief Returns the 'u' derivative stencil interpolation weights
std::vector<float> const & GetDuWeights() const {
return _duWeights;
@@ -399,6 +412,13 @@
_weights.resize(nelems);
}
+inline void
+StencilTable::reserve(int nstencils, int nelems) {
+ _sizes.reserve(nstencils);
+ _indices.reserve(nelems);
+ _weights.reserve(nelems);
+}
+
// Returns a Stencil at index i in the table
inline Stencil
StencilTable::GetStencil(Index i) const {
@@ -423,7 +443,26 @@
_dvWeights.resize(nelems);
}
+// Returns a LimitStencil at index i in the table
+inline LimitStencil
+LimitStencilTable::GetLimitStencil(Index i) const {
+ assert((not GetOffsets().empty()) and i<(int)GetOffsets().size());
+ Index ofs = GetOffsets()[i];
+
+ return LimitStencil( const_cast<int *>(&GetSizes()[i]),
+ const_cast<Index *>(&GetControlIndices()[ofs]),
+ const_cast<float *>(&GetWeights()[ofs]),
+ const_cast<float *>(&GetDuWeights()[ofs]),
+ const_cast<float *>(&GetDvWeights()[ofs]) );
+}
+
+inline LimitStencil
+LimitStencilTable::operator[] (Index index) const {
+ return GetLimitStencil(index);
+}
+
+
} // end namespace Far
} // end namespace OPENSUBDIV_VERSION
Modified: trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/osd/ompEvaluator.h
===================================================================
--- trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/osd/ompEvaluator.h 2015-11-07 08:19:13 UTC (rev 61558)
+++ trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/osd/ompEvaluator.h 2015-11-10 06:58:01 UTC (rev 61559)
@@ -79,6 +79,9 @@
(void)instance; // unused
(void)deviceContext; // unused
+ if (stencilTable->GetNumStencils() == 0)
+ return false;
+
return EvalStencils(srcBuffer->BindCpuBuffer(), srcDesc,
dstBuffer->BindCpuBuffer(), dstDesc,
&stencilTable->GetSizes()[0],
Modified: trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/osd/opengl.h
===================================================================
--- trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/osd/opengl.h 2015-11-07 08:19:13 UTC (rev 61558)
+++ trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/osd/opengl.h 2015-11-10 06:58:01 UTC (rev 61559)
@@ -40,7 +40,7 @@
#include <GLES2/gl2.h>
#else
#if defined(_WIN32)
- #define W32_LEAN_AND_MEAN
+ #define WIN32_LEAN_AND_MEAN
#include <windows.h>
#endif
#if defined(OSD_USES_GLEW)
Modified: trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/sdc/loopScheme.h
===================================================================
--- trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/sdc/loopScheme.h 2015-11-07 08:19:13 UTC (rev 61558)
+++ trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/sdc/loopScheme.h 2015-11-10 06:58:01 UTC (rev 61559)
@@ -489,8 +489,8 @@
double theta = M_PI / (interiorEdgeCount + 1);
- Weight cWeight = -3.0f * std::sin(theta);
- Weight eWeightCoeff = -3.0f * (2.0f * std::cos(theta) - 2.0f);
+ Weight cWeight = -3.0f * (Weight) std::sin(theta);
+ Weight eWeightCoeff = -3.0f * (2.0f * (Weight) std::cos(theta) - 2.0f);
tan2Mask.VertexWeight(0) = 0.0f;
@@ -498,7 +498,7 @@
tan2Mask.EdgeWeight(creaseEnds[1]) = cWeight;
for (int i = 1; i <= interiorEdgeCount; ++i) {
- tan2Mask.EdgeWeight(creaseEnds[0] + i) = eWeightCoeff * std::sin(i * theta);
+ tan2Mask.EdgeWeight(creaseEnds[0] + i) = eWeightCoeff * (Weight) std::sin(i * theta);
}
} else if (interiorEdgeCount == 1) {
// See notes above regarding scale factor of 3.0:
@@ -566,8 +566,8 @@
Weight alpha = (Weight) (2.0f * M_PI / valence);
for (int i = 0; i < valence; ++i) {
double alphaI = alpha * i;
- tan1Mask.EdgeWeight(i) = std::cos(alphaI);
- tan2Mask.EdgeWeight(i) = std::sin(alphaI);
+ tan1Mask.EdgeWeight(i) = (Weight) std::cos(alphaI);
+ tan2Mask.EdgeWeight(i) = (Weight) std::sin(alphaI);
}
}
}
Modified: trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/version.h
===================================================================
--- trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/version.h 2015-11-07 08:19:13 UTC (rev 61558)
+++ trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/version.h 2015-11-10 06:58:01 UTC (rev 61559)
@@ -25,7 +25,7 @@
#ifndef OPENSUBDIV3_VERSION_H
#define OPENSUBDIV3_VERSION_H
-#define OPENSUBDIV_VERSION v3_0_0
+#define OPENSUBDIV_VERSION v3_0_3
namespace OpenSubdiv {
namespace OPENSUBDIV_VERSION {
Modified: trunk/lib/win64_vc12/opensubdiv/lib/osdCPU.lib
===================================================================
(Binary files differ)
Modified: trunk/lib/win64_vc12/opensubdiv/lib/osdCPU_d.lib
===================================================================
(Binary files differ)
Modified: trunk/lib/win64_vc12/opensubdiv/lib/osdGPU.lib
===================================================================
(Binary files differ)
Modified: trunk/lib/win64_vc12/opensubdiv/lib/osdGPU_d.lib
===================================================================
(Binary files differ)
Modified: trunk/lib/win64_vc12/opensubdiv/readme.txt
===================================================================
--- trunk/lib/win64_vc12/opensubdiv/readme.txt 2015-11-07 08:19:13 UTC (rev 61558)
+++ trunk/lib/win64_vc12/opensubdiv/readme.txt 2015-11-10 06:58:01 UTC (rev 61559)
@@ -1,4 +1,4 @@
-This is OpenSubdiv hash 5f393db from official repository
+This is OpenSubdiv hash cf7135e from official repository
See https://github.com/PixarAnimationStudios/OpenSubdiv/tree/dev
https://developer.blender.org/rBL61559
Author: sergey
Date: 2015-11-10 06:58:01 +0000 (Tue, 10 Nov 2015)
Log Message:
-----------
Win 64: Update OpenSubdiv to cf7135e
Modified Paths:
--------------
trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/far/stencilTable.h
trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/osd/ompEvaluator.h
trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/osd/opengl.h
trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/sdc/loopScheme.h
trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/version.h
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/readme.txt
Modified: trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/far/stencilTable.h
===================================================================
--- trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/far/stencilTable.h 2015-11-07 08:19:13 UTC (rev 61558)
+++ trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/far/stencilTable.h 2015-11-10 06:58:01 UTC (rev 61559)
@@ -205,6 +205,9 @@
// Resize the table arrays (factory helper)
void resize(int nstencils, int nelems);
+ // Reserves the table arrays (factory helper)
+ void reserve(int nstencils, int nelems);
+
protected:
StencilTable() : _numControlVertices(0) {}
StencilTable(int numControlVerts)
@@ -212,8 +215,12 @@
{ }
friend class StencilTableFactory;
+ friend class PatchTableFactory;
// XXX: temporarily, GregoryBasis class will go away.
friend class GregoryBasis;
+ // XXX: needed to call reserve().
+ friend class EndCapBSplineBasisPatchFactory;
+ friend class EndCapGregoryBasisPatchFactory;
int _numControlVertices; // number of control vertices
@@ -297,6 +304,12 @@
public:
+ /// \brief Returns a LimitStencil at index i in the table
+ LimitStencil GetLimitStencil(Index i) const;
+
+ /// \brief Returns the limit stencil at index i in the table
+ LimitStencil operator[] (Index index) const;
+
/// \brief Returns the 'u' derivative stencil interpolation weights
std::vector<float> const & GetDuWeights() const {
return _duWeights;
@@ -399,6 +412,13 @@
_weights.resize(nelems);
}
+inline void
+StencilTable::reserve(int nstencils, int nelems) {
+ _sizes.reserve(nstencils);
+ _indices.reserve(nelems);
+ _weights.reserve(nelems);
+}
+
// Returns a Stencil at index i in the table
inline Stencil
StencilTable::GetStencil(Index i) const {
@@ -423,7 +443,26 @@
_dvWeights.resize(nelems);
}
+// Returns a LimitStencil at index i in the table
+inline LimitStencil
+LimitStencilTable::GetLimitStencil(Index i) const {
+ assert((not GetOffsets().empty()) and i<(int)GetOffsets().size());
+ Index ofs = GetOffsets()[i];
+
+ return LimitStencil( const_cast<int *>(&GetSizes()[i]),
+ const_cast<Index *>(&GetControlIndices()[ofs]),
+ const_cast<float *>(&GetWeights()[ofs]),
+ const_cast<float *>(&GetDuWeights()[ofs]),
+ const_cast<float *>(&GetDvWeights()[ofs]) );
+}
+
+inline LimitStencil
+LimitStencilTable::operator[] (Index index) const {
+ return GetLimitStencil(index);
+}
+
+
} // end namespace Far
} // end namespace OPENSUBDIV_VERSION
Modified: trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/osd/ompEvaluator.h
===================================================================
--- trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/osd/ompEvaluator.h 2015-11-07 08:19:13 UTC (rev 61558)
+++ trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/osd/ompEvaluator.h 2015-11-10 06:58:01 UTC (rev 61559)
@@ -79,6 +79,9 @@
(void)instance; // unused
(void)deviceContext; // unused
+ if (stencilTable->GetNumStencils() == 0)
+ return false;
+
return EvalStencils(srcBuffer->BindCpuBuffer(), srcDesc,
dstBuffer->BindCpuBuffer(), dstDesc,
&stencilTable->GetSizes()[0],
Modified: trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/osd/opengl.h
===================================================================
--- trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/osd/opengl.h 2015-11-07 08:19:13 UTC (rev 61558)
+++ trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/osd/opengl.h 2015-11-10 06:58:01 UTC (rev 61559)
@@ -40,7 +40,7 @@
#include <GLES2/gl2.h>
#else
#if defined(_WIN32)
- #define W32_LEAN_AND_MEAN
+ #define WIN32_LEAN_AND_MEAN
#include <windows.h>
#endif
#if defined(OSD_USES_GLEW)
Modified: trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/sdc/loopScheme.h
===================================================================
--- trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/sdc/loopScheme.h 2015-11-07 08:19:13 UTC (rev 61558)
+++ trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/sdc/loopScheme.h 2015-11-10 06:58:01 UTC (rev 61559)
@@ -489,8 +489,8 @@
double theta = M_PI / (interiorEdgeCount + 1);
- Weight cWeight = -3.0f * std::sin(theta);
- Weight eWeightCoeff = -3.0f * (2.0f * std::cos(theta) - 2.0f);
+ Weight cWeight = -3.0f * (Weight) std::sin(theta);
+ Weight eWeightCoeff = -3.0f * (2.0f * (Weight) std::cos(theta) - 2.0f);
tan2Mask.VertexWeight(0) = 0.0f;
@@ -498,7 +498,7 @@
tan2Mask.EdgeWeight(creaseEnds[1]) = cWeight;
for (int i = 1; i <= interiorEdgeCount; ++i) {
- tan2Mask.EdgeWeight(creaseEnds[0] + i) = eWeightCoeff * std::sin(i * theta);
+ tan2Mask.EdgeWeight(creaseEnds[0] + i) = eWeightCoeff * (Weight) std::sin(i * theta);
}
} else if (interiorEdgeCount == 1) {
// See notes above regarding scale factor of 3.0:
@@ -566,8 +566,8 @@
Weight alpha = (Weight) (2.0f * M_PI / valence);
for (int i = 0; i < valence; ++i) {
double alphaI = alpha * i;
- tan1Mask.EdgeWeight(i) = std::cos(alphaI);
- tan2Mask.EdgeWeight(i) = std::sin(alphaI);
+ tan1Mask.EdgeWeight(i) = (Weight) std::cos(alphaI);
+ tan2Mask.EdgeWeight(i) = (Weight) std::sin(alphaI);
}
}
}
Modified: trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/version.h
===================================================================
--- trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/version.h 2015-11-07 08:19:13 UTC (rev 61558)
+++ trunk/lib/win64_vc12/opensubdiv/include/opensubdiv/version.h 2015-11-10 06:58:01 UTC (rev 61559)
@@ -25,7 +25,7 @@
#ifndef OPENSUBDIV3_VERSION_H
#define OPENSUBDIV3_VERSION_H
-#define OPENSUBDIV_VERSION v3_0_0
+#define OPENSUBDIV_VERSION v3_0_3
namespace OpenSubdiv {
namespace OPENSUBDIV_VERSION {
Modified: trunk/lib/win64_vc12/opensubdiv/lib/osdCPU.lib
===================================================================
(Binary files differ)
Modified: trunk/lib/win64_vc12/opensubdiv/lib/osdCPU_d.lib
===================================================================
(Binary files differ)
Modified: trunk/lib/win64_vc12/opensubdiv/lib/osdGPU.lib
===================================================================
(Binary files differ)
Modified: trunk/lib/win64_vc12/opensubdiv/lib/osdGPU_d.lib
===================================================================
(Binary files differ)
Modified: trunk/lib/win64_vc12/opensubdiv/readme.txt
===================================================================
--- trunk/lib/win64_vc12/opensubdiv/readme.txt 2015-11-07 08:19:13 UTC (rev 61558)
+++ trunk/lib/win64_vc12/opensubdiv/readme.txt 2015-11-10 06:58:01 UTC (rev 61559)
@@ -1,4 +1,4 @@
-This is OpenSubdiv hash 5f393db from official repository
+This is OpenSubdiv hash cf7135e from official repository
See https://github.com/PixarAnimationStudios/OpenSubdiv/tree/dev