Commit bfd9c4f1 authored by Jan Möbius's avatar Jan Möbius

Merge branch 'InstancingDeclFix' into 'master'

disable instancing when deactivating a vertex declaration

deactivate() should reset all attributes to the default non-instanced state. Otherwise attributes stay instanced and this can break the vertex layout.

See merge request !70
parents 68e8a121 f2431647
Pipeline #894 passed with stage
......@@ -486,8 +486,16 @@ void VertexDeclaration::deactivateShaderPipeline( GLSL::Program* _prog ) const
int loc = _prog->getAttributeLocation(pElem->shaderInputName_);
if (loc != -1)
{
glDisableVertexAttribArray(loc);
if (supportsInstancedArrays() && pElem->divisor_)
{
#ifdef GL_ARB_instanced_arrays
glVertexAttribDivisor(loc, 0);
#endif
}
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment