diff --git a/ash/src/vk/definitions.rs b/ash/src/vk/definitions.rs index 2987558..4fb1406 100644 --- a/ash/src/vk/definitions.rs +++ b/ash/src/vk/definitions.rs @@ -5672,8 +5672,17 @@ impl<'a> PipelineMultisampleStateCreateInfoBuilder<'a> { self.inner.min_sample_shading = min_sample_shading; self } + #[doc = r" Sets `p_sample_mask` to `null` if the slice is empty. The mask will"] + #[doc = r" be treated as if it has all bits set to `1`."] + #[doc = r""] + #[doc = r" See "] + #[doc = r" for more details."] pub fn sample_mask(mut self, sample_mask: &'a [SampleMask]) -> Self { - self.inner.p_sample_mask = sample_mask.as_ptr() as *const SampleMask; + self.inner.p_sample_mask = if sample_mask.is_empty() { + std::ptr::null() + } else { + sample_mask.as_ptr() as *const SampleMask + }; self } pub fn alpha_to_coverage_enable(mut self, alpha_to_coverage_enable: bool) -> Self { diff --git a/generator/src/lib.rs b/generator/src/lib.rs index 77fe6cd..5583129 100644 --- a/generator/src/lib.rs +++ b/generator/src/lib.rs @@ -1788,8 +1788,17 @@ pub fn derive_setters( if name == "pSampleMask" { return Some(quote!{ + /// Sets `p_sample_mask` to `null` if the slice is empty. The mask will + /// be treated as if it has all bits set to `1`. + /// + /// See + /// for more details. pub fn sample_mask(mut self, sample_mask: &'a [SampleMask]) -> Self { - self.inner.p_sample_mask = sample_mask.as_ptr() as *const SampleMask; + self.inner.p_sample_mask = if sample_mask.is_empty() { + std::ptr::null() + } else { + sample_mask.as_ptr() as *const SampleMask + }; self } });