kazan 0.3.9+1.4.359

Vulkan bindings for Rust
Documentation
//! <https://registry.khronos.org/vulkan/specs/latest/man/html/VK_QCOM_image_processing2.html>
#![allow(unused_imports)]
use crate::{vk::Result as VkResult, vk::*, *};
use core::ffi::{CStr, c_char, c_int, c_void};
use core::mem::transmute;
use core::ptr;

pub const EXTENSION_NAME: &CStr = c"VK_QCOM_image_processing2";

pub(super) mod defs {
    #![allow(non_camel_case_types, unused_imports)]
    use crate::{vk::*, *};
    use core::ffi::{CStr, c_char, c_int, c_void};
    use core::fmt;
    use core::marker::PhantomData;
    use core::ptr;

    /// <https://registry.khronos.org/vulkan/specs/latest/man/html/VkPhysicalDeviceImageProcessing2FeaturesQCOM.html>
    #[repr(C)]
    #[derive(Copy, Clone)]
    #[must_use]
    pub struct PhysicalDeviceImageProcessing2FeaturesQCOM<'a> {
        pub s_type: StructureType,
        pub p_next: *mut c_void,
        pub texture_block_match2: Bool32,
        pub _marker: PhantomData<&'a ()>,
    }

    #[cfg(feature = "debug")]
    impl fmt::Debug for PhysicalDeviceImageProcessing2FeaturesQCOM<'_> {
        fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
            f.debug_struct("PhysicalDeviceImageProcessing2FeaturesQCOM")
                .field("s_type", &self.s_type)
                .field("p_next", &self.p_next)
                .field("texture_block_match2", &self.texture_block_match2)
                .finish()
        }
    }

    unsafe impl<'a> TaggedStructure<'a> for PhysicalDeviceImageProcessing2FeaturesQCOM<'a> {
        const STRUCTURE_TYPE: StructureType =
            StructureType::PHYSICAL_DEVICE_IMAGE_PROCESSING_2_FEATURES_QCOM;
    }

    unsafe impl Extends<PhysicalDeviceFeatures2<'_>>
        for PhysicalDeviceImageProcessing2FeaturesQCOM<'_>
    {
    }
    unsafe impl Extends<DeviceCreateInfo<'_>> for PhysicalDeviceImageProcessing2FeaturesQCOM<'_> {}

    impl Default for PhysicalDeviceImageProcessing2FeaturesQCOM<'_> {
        fn default() -> Self {
            Self {
                s_type: Self::STRUCTURE_TYPE,
                p_next: ptr::null_mut(),
                texture_block_match2: Default::default(),
                _marker: PhantomData,
            }
        }
    }

    impl<'a> PhysicalDeviceImageProcessing2FeaturesQCOM<'a> {
        #[inline]
        pub fn texture_block_match2(mut self, texture_block_match2: bool) -> Self {
            self.texture_block_match2 = texture_block_match2.into();
            self
        }
    }

    /// <https://registry.khronos.org/vulkan/specs/latest/man/html/VkPhysicalDeviceImageProcessing2PropertiesQCOM.html>
    #[repr(C)]
    #[derive(Copy, Clone)]
    #[must_use]
    pub struct PhysicalDeviceImageProcessing2PropertiesQCOM<'a> {
        pub s_type: StructureType,
        pub p_next: *mut c_void,
        pub max_block_match_window: Extent2D,
        pub _marker: PhantomData<&'a ()>,
    }

    #[cfg(feature = "debug")]
    impl fmt::Debug for PhysicalDeviceImageProcessing2PropertiesQCOM<'_> {
        fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
            f.debug_struct("PhysicalDeviceImageProcessing2PropertiesQCOM")
                .field("s_type", &self.s_type)
                .field("p_next", &self.p_next)
                .field("max_block_match_window", &self.max_block_match_window)
                .finish()
        }
    }

    unsafe impl<'a> TaggedStructure<'a> for PhysicalDeviceImageProcessing2PropertiesQCOM<'a> {
        const STRUCTURE_TYPE: StructureType =
            StructureType::PHYSICAL_DEVICE_IMAGE_PROCESSING_2_PROPERTIES_QCOM;
    }

    unsafe impl Extends<PhysicalDeviceProperties2<'_>>
        for PhysicalDeviceImageProcessing2PropertiesQCOM<'_>
    {
    }

    impl Default for PhysicalDeviceImageProcessing2PropertiesQCOM<'_> {
        fn default() -> Self {
            Self {
                s_type: Self::STRUCTURE_TYPE,
                p_next: ptr::null_mut(),
                max_block_match_window: Default::default(),
                _marker: PhantomData,
            }
        }
    }

    impl<'a> PhysicalDeviceImageProcessing2PropertiesQCOM<'a> {
        #[inline]
        pub fn max_block_match_window(mut self, max_block_match_window: Extent2D) -> Self {
            self.max_block_match_window = max_block_match_window;
            self
        }
    }

    /// <https://registry.khronos.org/vulkan/specs/latest/man/html/VkSamplerBlockMatchWindowCreateInfoQCOM.html>
    #[repr(C)]
    #[derive(Copy, Clone)]
    #[must_use]
    pub struct SamplerBlockMatchWindowCreateInfoQCOM<'a> {
        pub s_type: StructureType,
        pub p_next: *const c_void,
        pub window_extent: Extent2D,
        pub window_compare_mode: BlockMatchWindowCompareModeQCOM,
        pub _marker: PhantomData<&'a ()>,
    }

    #[cfg(feature = "debug")]
    impl fmt::Debug for SamplerBlockMatchWindowCreateInfoQCOM<'_> {
        fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
            f.debug_struct("SamplerBlockMatchWindowCreateInfoQCOM")
                .field("s_type", &self.s_type)
                .field("p_next", &self.p_next)
                .field("window_extent", &self.window_extent)
                .field("window_compare_mode", &self.window_compare_mode)
                .finish()
        }
    }

    unsafe impl<'a> TaggedStructure<'a> for SamplerBlockMatchWindowCreateInfoQCOM<'a> {
        const STRUCTURE_TYPE: StructureType =
            StructureType::SAMPLER_BLOCK_MATCH_WINDOW_CREATE_INFO_QCOM;
    }

    unsafe impl Extends<SamplerCreateInfo<'_>> for SamplerBlockMatchWindowCreateInfoQCOM<'_> {}

    impl Default for SamplerBlockMatchWindowCreateInfoQCOM<'_> {
        fn default() -> Self {
            Self {
                s_type: Self::STRUCTURE_TYPE,
                p_next: ptr::null(),
                window_extent: Default::default(),
                window_compare_mode: Default::default(),
                _marker: PhantomData,
            }
        }
    }

    impl<'a> SamplerBlockMatchWindowCreateInfoQCOM<'a> {
        #[inline]
        pub fn window_extent(mut self, window_extent: Extent2D) -> Self {
            self.window_extent = window_extent;
            self
        }

        #[inline]
        pub fn window_compare_mode(
            mut self,
            window_compare_mode: BlockMatchWindowCompareModeQCOM,
        ) -> Self {
            self.window_compare_mode = window_compare_mode;
            self
        }
    }

    /// <https://registry.khronos.org/vulkan/specs/latest/man/html/VkBlockMatchWindowCompareModeQCOM.html>
    #[repr(transparent)]
    #[derive(Copy, Clone, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
    pub struct BlockMatchWindowCompareModeQCOM(i32);

    impl BlockMatchWindowCompareModeQCOM {
        #[inline]
        pub const fn from_raw(x: i32) -> Self {
            Self(x)
        }
        #[inline]
        pub const fn as_raw(self) -> i32 {
            self.0
        }

        pub const MIN_QCOM: Self = Self(0);
        pub const MAX_QCOM: Self = Self(1);
    }

    impl fmt::Debug for BlockMatchWindowCompareModeQCOM {
        fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
            let name = match *self {
                Self::MIN_QCOM => Some("MIN_QCOM"),
                Self::MAX_QCOM => Some("MAX_QCOM"),
                _ => None,
            };
            if let Some(name) = name {
                f.write_str(name)
            } else {
                self.0.fmt(f)
            }
        }
    }
}

#[cfg(feature = "ffi")]
pub(super) mod ffi {
    #![allow(non_camel_case_types)]
    use super::defs::*;

    pub type VkPhysicalDeviceImageProcessing2FeaturesQCOM =
        PhysicalDeviceImageProcessing2FeaturesQCOM<'static>;
    pub type VkPhysicalDeviceImageProcessing2PropertiesQCOM =
        PhysicalDeviceImageProcessing2PropertiesQCOM<'static>;
    pub type VkSamplerBlockMatchWindowCreateInfoQCOM =
        SamplerBlockMatchWindowCreateInfoQCOM<'static>;
    pub type VkBlockMatchWindowCompareModeQCOM = BlockMatchWindowCompareModeQCOM;
    impl PhysicalDeviceImageProcessing2FeaturesQCOM<'_> {
        #[inline]
        pub unsafe fn drop_lifetime_for_ffi(
            &self,
        ) -> &VkPhysicalDeviceImageProcessing2FeaturesQCOM {
            unsafe { core::mem::transmute(self) }
        }
    }
    impl PhysicalDeviceImageProcessing2PropertiesQCOM<'_> {
        #[inline]
        pub unsafe fn drop_lifetime_for_ffi(
            &self,
        ) -> &VkPhysicalDeviceImageProcessing2PropertiesQCOM {
            unsafe { core::mem::transmute(self) }
        }
    }
    impl SamplerBlockMatchWindowCreateInfoQCOM<'_> {
        #[inline]
        pub unsafe fn drop_lifetime_for_ffi(&self) -> &VkSamplerBlockMatchWindowCreateInfoQCOM {
            unsafe { core::mem::transmute(self) }
        }
    }
}