floooh / sokol

minimal cross-platform standalone C headers
https://floooh.github.io/sokol-html5
zlib License
6.53k stars 467 forks source link

[webgpu] Bindgroups cache breaks down with init/uninit pattern. #1066

Open floooh opened 1 week ago

floooh commented 1 week ago

When a sokol-gfx resource is re-created via the uninit/init calls (so the same sokol-gfx handle is used for a different underlying resource) the BindsGroup cache needs to be invalidated, otherwise WebGPU will rightfully complain about a 'destroyed resource' being submitted.

To reproduce: remove the .wgpu_disable_bindgroups_cache = true in the dyntex3d-sapp sample.