浏览代码

sokol_gfx.h gl: fix pipeline state cache problem in compute passes with storage attachments

Andre Weissflog 4 月之前
父节点
当前提交
4bd3433188
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      sokol_gfx.h

+ 5 - 0
sokol_gfx.h

@@ -9773,6 +9773,11 @@ _SOKOL_PRIVATE void _sg_gl_begin_pass(const sg_pass* pass) {
 
     // early out if this a compute pass
     if (pass->compute) {
+        // first pipeline in pass needs to re-apply storage attachments
+        if (_sg.cur_pass.atts && _sg.cur_pass.atts->cmn.has_storage_attachments) {
+            _sg.gl.cache.cur_pipeline = 0;
+            _sg.gl.cache.cur_pipeline_id.id = SG_INVALID_ID;
+        }
         return;
     }