Fixes to the Optimizer's handling of merging of osg::Geometry
This commit is contained in:
@@ -123,11 +123,11 @@ public:
|
||||
_extensions->glVertexAttrib4fv( _index, v.ptr() );
|
||||
}
|
||||
|
||||
const Geometry::Extensions *_extensions;
|
||||
const Array* _attribcoords;
|
||||
const IndexArray* _indices;
|
||||
GLboolean _normalized;
|
||||
unsigned int _index;
|
||||
unsigned int _index;
|
||||
GLboolean _normalized;
|
||||
const Geometry::Extensions* _extensions;
|
||||
const Array* _attribcoords;
|
||||
const IndexArray* _indices;
|
||||
};
|
||||
|
||||
class DrawTexCoord : public osg::Referenced, public osg::ConstValueVisitor
|
||||
@@ -1681,10 +1681,12 @@ bool Geometry::verifyBindings() const
|
||||
if (_normalArray->getNumElements()!=1) return false;
|
||||
break;
|
||||
case(BIND_PER_PRIMITIVE_SET):
|
||||
case(BIND_PER_PRIMITIVE):
|
||||
if (!_normalArray.valid()) return false;
|
||||
if (_normalArray->getNumElements()!=_primitives.size()) return false;
|
||||
break;
|
||||
case(BIND_PER_PRIMITIVE):
|
||||
if (!_normalArray.valid()) return false;
|
||||
break;
|
||||
case(BIND_PER_VERTEX):
|
||||
if (_vertexArray.valid())
|
||||
{
|
||||
@@ -1705,10 +1707,12 @@ bool Geometry::verifyBindings() const
|
||||
if (_colorArray->getNumElements()!=1) return false;
|
||||
break;
|
||||
case(BIND_PER_PRIMITIVE_SET):
|
||||
case(BIND_PER_PRIMITIVE):
|
||||
if (!_colorArray.valid()) return false;
|
||||
if (_colorArray->getNumElements()!=_primitives.size()) return false;
|
||||
break;
|
||||
case(BIND_PER_PRIMITIVE):
|
||||
if (!_colorArray.valid()) return false;
|
||||
break;
|
||||
case(BIND_PER_VERTEX):
|
||||
if (_vertexArray.valid())
|
||||
{
|
||||
@@ -1780,7 +1784,6 @@ void Geometry::computeCorrectBindingsAndArraySizes()
|
||||
}
|
||||
break;
|
||||
case(BIND_PER_PRIMITIVE_SET):
|
||||
case(BIND_PER_PRIMITIVE):
|
||||
if (!_normalArray.valid())
|
||||
{
|
||||
_normalBinding = BIND_OFF;
|
||||
@@ -1796,6 +1799,8 @@ void Geometry::computeCorrectBindingsAndArraySizes()
|
||||
_normalArray->erase(_normalArray->begin()+_primitives.size(),_normalArray->end());
|
||||
}
|
||||
break;
|
||||
case(BIND_PER_PRIMITIVE):
|
||||
break;
|
||||
case(BIND_PER_VERTEX):
|
||||
if (!_normalArray.valid())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user