From 86d0376054173b993a3d329a36fb7e994a12b880 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 22 Dec 2025 22:20:57 +0100 Subject: [PATCH] glgsg: Mark SSBO unbound from all binding points upon deletion Fixes a consistency issue where the buffer might not be rebound properly --- panda/src/glstuff/glGraphicsStateGuardian_src.cxx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index ec5ca7ad2c..034b5e5434 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -7692,6 +7692,12 @@ release_shader_buffer(BufferContext *bc) { _current_sbuffer_index = 0; } + for (GLuint &index : _current_sbuffer_base) { + if (index == gbc->_index) { + index = 0; + } + } + _glDeleteBuffers(1, &gbc->_index); report_my_gl_errors(); @@ -7731,6 +7737,12 @@ release_shader_buffers(const pvector &contexts) { _current_sbuffer_index = 0; } + for (GLuint &index : _current_sbuffer_base) { + if (index == gbc->_index) { + index = 0; + } + } + if (debug) { GLCAT.debug() << "deleting shader buffer " << gbc->_index << "\n";