Added a call to disable all vertex attrib arrays when none are present

on an osg::Geometry.
This commit is contained in:
Robert Osfield
2003-09-01 11:23:29 +00:00
parent 144ac14b07
commit 0ebf005ac1

View File

@@ -940,7 +940,8 @@ void Geometry::drawImplementation(State& state) const
typedef std::map< Geometry::AttributeBinding, DrawVertexAttribList> DrawVertexAttribMap;
DrawVertexAttribMap drawVertexAttribMap;
bool handleVertexAttributes = (!_vertexAttribList.empty() && extensions->isVertexProgramSupported());
bool vertexVertexAttributesSupported = extensions->isVertexProgramSupported();
bool handleVertexAttributes = (!_vertexAttribList.empty() && vertexVertexAttributesSupported);
bool usingVertexBufferObjects = _useVertexBufferObjects && state.isVertexBufferObjectSupported();
@@ -1134,6 +1135,11 @@ void Geometry::drawImplementation(State& state) const
}
}
state.disableVertexAttribPointersAboveAndIncluding( index );
}
else if (vertexVertexAttributesSupported)
{
state.disableVertexAttribPointersAboveAndIncluding( 0 );
}
@@ -1216,6 +1222,11 @@ void Geometry::drawImplementation(State& state) const
}
}
state.disableVertexAttribPointersAboveAndIncluding( index );
}
else if (vertexVertexAttributesSupported)
{
state.disableVertexAttribPointersAboveAndIncluding( 0 );
}
}