Просмотр исходного кода

glgsg: Mark SSBO unbound from all binding points upon deletion

Fixes a consistency issue where the buffer might not be rebound properly

Backport of 86d0376054173b993a3d329a36fb7e994a12b880
rdb 2 недель назад
Родитель
Сommit
225eb9b34d
2 измененных файлов с 7 добавлено и 0 удалено
  1. 1 0
      doc/ReleaseNotes
  2. 6 0
      panda/src/glstuff/glGraphicsStateGuardian_src.cxx

+ 1 - 0
doc/ReleaseNotes

@@ -12,6 +12,7 @@ This maintenance release fixes some minor defects and stability issues.
 * Fix use-after-free in collision system with transform cache disabled (#1733)
 * Egg: Add limited forward compatibility for metallic-roughness textures
 * OpenGL: fix error blitting depth texture on macOS (#1719)
+* OpenGL: fix SSBO not being rebound if deleted and recreated immediately
 * OpenGL: fix SSBO support not being detected in certain situations
 * GLSL: Add p3d_MetallicRoughnessTexture input mapped to M_metallic_roughness
 * X11: Add config variable to enable detection of autorepeat key events (#1735)

+ 6 - 0
panda/src/glstuff/glGraphicsStateGuardian_src.cxx

@@ -6837,6 +6837,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();