diff --git a/src/graphics/gl/cache.rs b/src/graphics/gl/cache.rs index ca194d00..11293161 100644 --- a/src/graphics/gl/cache.rs +++ b/src/graphics/gl/cache.rs @@ -133,6 +133,12 @@ impl GlCache { pub fn clear_vertex_attributes(&mut self) { for attr_index in 0..MAX_VERTEX_ATTRIBUTES { let cached_attr = &mut self.attributes[attr_index]; + + if cached_attr.is_some() { + unsafe { + glDisableVertexAttribArray(attr_index as GLuint) + }; + } *cached_attr = None; } }