diff --git a/wgpu-hal/src/vulkan/device.rs b/wgpu-hal/src/vulkan/device.rs index 1d229635317..8174d6cb2b7 100644 --- a/wgpu-hal/src/vulkan/device.rs +++ b/wgpu-hal/src/vulkan/device.rs @@ -1954,11 +1954,11 @@ impl crate::Device for super::Device { match module { super::ShaderModule::Raw(raw) => { unsafe { self.shared.raw.destroy_shader_module(raw, None) }; + + self.counters.shader_modules.sub(1); } super::ShaderModule::Intermediate { .. } => {} } - - self.counters.shader_modules.sub(1); } unsafe fn create_render_pipeline(