diff options
| author | Andre Weissflog <floooh@gmail.com> | 2025-05-02 14:57:30 +0200 |
|---|---|---|
| committer | Andre Weissflog <floooh@gmail.com> | 2025-05-02 14:57:30 +0200 |
| commit | b44a975bb6bc0ea4dbcb2dcbdb62d61a224e548f (patch) | |
| tree | 2ef4d3d358f770ab34e5a543284ac57a03a326cd | |
| parent | fd623fb9d5078b96b79534a5b2bea858d9dbe54e (diff) | |
sokol_gfx.h wgpu: clear storage attachments binding if not used
| -rw-r--r-- | sokol_gfx.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sokol_gfx.h b/sokol_gfx.h index 85d37d06..64aef41e 100644 --- a/sokol_gfx.h +++ b/sokol_gfx.h @@ -16868,6 +16868,7 @@ _SOKOL_PRIVATE void _sg_wgpu_begin_compute_pass(const sg_pass* pass) { // clear initial bindings wgpuComputePassEncoderSetBindGroup(_sg.wgpu.cpass_enc, _SG_WGPU_UB_BINDGROUP_INDEX, _sg.wgpu.empty_bind_group, 0, 0); wgpuComputePassEncoderSetBindGroup(_sg.wgpu.cpass_enc, _SG_WGPU_IMG_SMP_SBUF_BINDGROUP_INDEX, _sg.wgpu.empty_bind_group, 0, 0); + wgpuComputePassEncoderSetBindGroup(_sg.wgpu.cpass_enc, _SG_WGPU_SIMG_BINDGROUP_INDEX, _sg.wgpu.empty_bind_group, 0, 0); _sg_stats_add(wgpu.bindings.num_set_bindgroup, 1); } @@ -17068,6 +17069,9 @@ _SOKOL_PRIVATE void _sg_wgpu_apply_pipeline(_sg_pipeline_t* pip) { } else { _SG_ERROR(WGPU_CREATEBINDGROUP_FAILED); } + } else { + // no storage attachment bindings, clear bindgroup slot + wgpuComputePassEncoderSetBindGroup(_sg.wgpu.cpass_enc, _SG_WGPU_SIMG_BINDGROUP_INDEX, _sg.wgpu.empty_bind_group, 0, 0); } } else { SOKOL_ASSERT(!_sg.cur_pass.is_compute); |