浏览代码

Merge branch 'danielchasehooper-master'

Andre Weissflog 1 年之前
父节点
当前提交
d98010b3c8
共有 2 个文件被更改,包括 9 次插入2 次删除
  1. 7 0
      CHANGELOG.md
  2. 2 2
      sokol_gfx.h

+ 7 - 0
CHANGELOG.md

@@ -1,5 +1,12 @@
 ## Updates
 
+### 27-Feb-2024:
+
+- Merged PR https://github.com/floooh/sokol/pull/1001, this is a small fix for GLES3 to avoid
+  calling glInvalidateFramebuffer() on non-existing depth/stencil surfaces.
+
+  Many thanks to @danielchasehooper!
+
 #### 26-Feb-2024:
 
 - Minor fix in sokol_imgui.h: The drawing code now detects and skips the special

+ 2 - 2
sokol_gfx.h

@@ -8679,10 +8679,10 @@ _SOKOL_PRIVATE void _sg_gl_end_pass(void) {
                 invalidate_atts[att_index++] = (GLenum)(GL_COLOR_ATTACHMENT0 + i);
             }
         }
-        if (_sg.gl.depth_store_action == SG_STOREACTION_DONTCARE) {
+        if ((_sg.gl.depth_store_action == SG_STOREACTION_DONTCARE) && (_sg.gl.cur_pass->cmn.ds_att.image_id.id != SG_INVALID_ID)) {
             invalidate_atts[att_index++] = GL_DEPTH_ATTACHMENT;
         }
-        if (_sg.gl.stencil_store_action == SG_STOREACTION_DONTCARE) {
+        if ((_sg.gl.stencil_store_action == SG_STOREACTION_DONTCARE) && (_sg.gl.cur_pass->cmn.ds_att.image_id.id != SG_INVALID_ID)) {
             invalidate_atts[att_index++] = GL_STENCIL_ATTACHMENT;
         }
         if (att_index > 0) {