From b44a975bb6bc0ea4dbcb2dcbdb62d61a224e548f Mon Sep 17 00:00:00 2001 From: Andre Weissflog Date: Fri, 2 May 2025 14:57:30 +0200 Subject: sokol_gfx.h wgpu: clear storage attachments binding if not used --- sokol_gfx.h | 4 ++++ 1 file changed, 4 insertions(+) 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); -- cgit v1.2.3