17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-17 03:59:19 +02:00

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.
This commit is contained in:
maj00r
2026-09-23 01:03:01 +02:00
committed by GitHub
parent 95f41f069f
commit b1bdd42178

View File

@@ -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);
}