diff --git a/vulkan-rs/src/descriptorpool.rs b/vulkan-rs/src/descriptorpool.rs index 5a837cc..06e970f 100644 --- a/vulkan-rs/src/descriptorpool.rs +++ b/vulkan-rs/src/descriptorpool.rs @@ -72,7 +72,7 @@ impl DescriptorPoolBuilder { pub struct DescriptorPool { device: Arc, descriptor_pool: VkDescriptorPool, - descriptor_set_layout: Arc, + pub(crate) descriptor_set_layout: Arc, } impl DescriptorPool { diff --git a/vulkan-rs/src/descriptorset.rs b/vulkan-rs/src/descriptorset.rs index a4ef432..f010512 100644 --- a/vulkan-rs/src/descriptorset.rs +++ b/vulkan-rs/src/descriptorset.rs @@ -266,6 +266,22 @@ impl DescriptorSet { pub fn update(&self, writes: &[DescriptorWrite]) -> Result<()> { debug_assert!(!writes.is_empty()); + #[cfg(debug_assertions)] + { + for (i, binding) in self + .pool + .descriptor_set_layout + .bindings() + .iter() + .enumerate() + { + if let Some(write) = writes.get(i) { + assert_eq!(write.binding, binding.binding); + assert_eq!(write.descriptor_type, binding.desc_type); + } + } + } + let mut vk_writes = Vec::new(); let mut handles_lock = self.handles.lock().unwrap();