Kaynağa Gözat

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

Andre Weissflog 4 ay önce
ebeveyn
işleme
4bd3433188
1 değiştirilmiş dosya ile 5 ekleme ve 0 silme
  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;
     }