OpenGLRenderer: Fix buffer destruction not removing VAOs referencing it
This commit is contained in:
parent
7e65f4b544
commit
6162a805e4
|
|
@ -61,7 +61,7 @@ namespace Nz::GL
|
|||
OpenGLVaoCache& operator=(OpenGLVaoCache&&) = delete;
|
||||
|
||||
private:
|
||||
void NotifyBufferDestruction(GLuint buffer);
|
||||
void NotifyBufferDestruction(GLuint buffer) const;
|
||||
|
||||
mutable std::unordered_map<OpenGLVaoSetup, std::unique_ptr<VertexArray>, OpenGLVaoSetupHasher> m_vertexArrays;
|
||||
Context& m_context;
|
||||
|
|
|
|||
|
|
@ -58,6 +58,8 @@ namespace Nz::GL
|
|||
if (boundBuffer == buffer)
|
||||
boundBuffer = 0;
|
||||
}
|
||||
|
||||
m_vaoCache.NotifyBufferDestruction(buffer);
|
||||
}
|
||||
|
||||
inline void Context::NotifyFramebufferDestruction(GLuint fbo) const
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ namespace Nz::GL
|
|||
return *(it->second);
|
||||
}
|
||||
|
||||
void OpenGLVaoCache::NotifyBufferDestruction(GLuint buffer)
|
||||
void OpenGLVaoCache::NotifyBufferDestruction(GLuint buffer) const
|
||||
{
|
||||
for (auto it = m_vertexArrays.begin(); it != m_vertexArrays.end();)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue