From b1bdd4217818ba82521015968ee18901a4a14cda Mon Sep 17 00:00:00 2001 From: maj00r <73280030+maj00r@users.noreply.github.com> Date: Wed, 23 Sep 2026 01:03:01 +0200 Subject: [PATCH] Forget a buffer's bindings when it is deleted (#182) The binding tracker kept the name of a deleted buffer. When gl handed that name to a new buffer, the tracker took it for already bound and skipped the bind, so a new vao was left without its index buffer and the nvidia driver read indices from a null pointer. --- gl/buffer.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gl/buffer.cpp b/gl/buffer.cpp index 8b8bd486..b80cee3e 100644 --- a/gl/buffer.cpp +++ b/gl/buffer.cpp @@ -58,6 +58,11 @@ gl::buffer::buffer() gl::buffer::~buffer() { + // forget the bindings of this buffer; gl can hand its name to a new buffer, + // which the tracker would then treat as already bound and skip the bind + for (auto &point : binding_points) + if (point == *this) + point = 0; glDeleteBuffers(1, *this); }