mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-10-17 01:39:20 +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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user