فهرست منبع

Don't invalidate the depth stencil framebuffer when the current pass doesn't have a depth or stencil attachment.

Daniel Hooper 1 سال پیش
والد
کامیت
8baf8db6e7
1فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  1. 2 2
      sokol_gfx.h

+ 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);
                 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 != 0) {
             invalidate_atts[att_index++] = GL_DEPTH_ATTACHMENT;
             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 != 0) {
             invalidate_atts[att_index++] = GL_STENCIL_ATTACHMENT;
             invalidate_atts[att_index++] = GL_STENCIL_ATTACHMENT;
         }
         }
         if (att_index > 0) {
         if (att_index > 0) {