Browse Source

GL: properly destroy a mesh VAO.

Whoops, this got silently omitted during the massive refactor in
f7a6d79aa0 (Nov 23). Buffers *do* get
destroyed, VAOs not. If you got sudden GPU memory usage issues after a
recent Magnum update, this was why.
pull/168/head
Vladimír Vondruš 2 years ago
parent
commit
b1ba1f076d
  1. 2
      doc/changelog.dox
  2. 2
      src/Magnum/GL/Mesh.cpp

2
doc/changelog.dox

@ -1035,6 +1035,8 @@ See also:
@ref GL::Buffer::bind() call as affecting also the regular binding point, @ref GL::Buffer::bind() call as affecting also the regular binding point,
leading to wrong buffer object being used for data upload etc. in certain leading to wrong buffer object being used for data upload etc. in certain
cases on platforms without DSA extensions. cases on platforms without DSA extensions.
- A large refactor of @ref GL::Mesh internals caused VAOs to no longer be
correctly deleted on destruction (see [mosra/magnum#632](https://github.com/mosra/magnum/issues/632))
- @ref GL::Context move constructor was not marked @cpp noexcept @ce by - @ref GL::Context move constructor was not marked @cpp noexcept @ce by
accident and it was also not really moving everything properly, especially accident and it was also not really moving everything properly, especially
when delayed creation was done on the moved-to object when delayed creation was done on the moved-to object

2
src/Magnum/GL/Mesh.cpp

@ -344,6 +344,8 @@ Mesh::~Mesh() {
/* Remove current vao from the state */ /* Remove current vao from the state */
GLuint& current = Context::current().state().mesh.currentVAO; GLuint& current = Context::current().state().mesh.currentVAO;
if(current == _id) current = 0; if(current == _id) current = 0;
Context::current().state().mesh.destroyImplementation(*this);
} }
Mesh::Mesh(Mesh&& other) noexcept: _id(other._id), _primitive(other._primitive), _flags{other._flags}, _countSet{other._countSet}, _count(other._count), _baseVertex{other._baseVertex}, _instanceCount{other._instanceCount}, Mesh::Mesh(Mesh&& other) noexcept: _id(other._id), _primitive(other._primitive), _flags{other._flags}, _countSet{other._countSet}, _count(other._count), _baseVertex{other._baseVertex}, _instanceCount{other._instanceCount},

Loading…
Cancel
Save