From e83a7a13e2adcff01af341800ac52f7c27b44484 Mon Sep 17 00:00:00 2001 From: Birh Burh Date: Sun, 2 Feb 2025 04:15:10 +0100 Subject: [PATCH] call glDisableVertexAttribArray when delete buffer --- src/graphics/gl/cache.rs | 6 ++++++ 1 file changed, 6 insertions(+) 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; } }