Skip to content

Commit 847afc7

Browse files
committed
hal/vulkan: Only decrement counter for raw shaders
The counter is decremented for raw and intermediate shaders but only incremented for raw shaders, this lead to a negative counter value and did not represent the number of allocated shaders.
1 parent 24a05fe commit 847afc7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

wgpu-hal/src/vulkan/device.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1954,11 +1954,11 @@ impl crate::Device for super::Device {
19541954
match module {
19551955
super::ShaderModule::Raw(raw) => {
19561956
unsafe { self.shared.raw.destroy_shader_module(raw, None) };
1957+
1958+
self.counters.shader_modules.sub(1);
19571959
}
19581960
super::ShaderModule::Intermediate { .. } => {}
19591961
}
1960-
1961-
self.counters.shader_modules.sub(1);
19621962
}
19631963

19641964
unsafe fn create_render_pipeline(

0 commit comments

Comments
 (0)