kazan 0.3.9+1.4.359

Vulkan bindings for Rust
Documentation
//! <https://registry.khronos.org/vulkan/specs/latest/man/html/VK_EXT_graphics_pipeline_library.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_EXT_graphics_pipeline_library";

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/VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT.html>
    #[repr(C)]
    #[derive(Copy, Clone)]
    #[must_use]
    pub struct PhysicalDeviceGraphicsPipelineLibraryFeaturesEXT<'a> {
        pub s_type: StructureType,
        pub p_next: *mut c_void,
        pub graphics_pipeline_library: Bool32,
        pub _marker: PhantomData<&'a ()>,
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    unsafe impl Extends<GraphicsPipelineCreateInfo<'_>> for GraphicsPipelineLibraryCreateInfoEXT<'_> {}

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

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

    /// <https://registry.khronos.org/vulkan/specs/latest/man/html/VkGraphicsPipelineLibraryFlagsEXT.html>
    #[repr(transparent)]
    #[derive(Copy, Clone, PartialEq, Eq, Hash)]
    pub struct GraphicsPipelineLibraryFlagsEXT(Flags);
    vk_bitflags_wrapped!(
        GraphicsPipelineLibraryFlagsEXT,
        Flags,
        GraphicsPipelineLibraryFlagBitsEXT
    );

    impl fmt::Debug for GraphicsPipelineLibraryFlagsEXT {
        fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
            const KNOWN: &[(Flags, &str)] = &[
                (
                    GraphicsPipelineLibraryFlagBitsEXT::VERTEX_INPUT_INTERFACE_EXT.0,
                    "VERTEX_INPUT_INTERFACE_EXT",
                ),
                (
                    GraphicsPipelineLibraryFlagBitsEXT::PRE_RASTERIZATION_SHADERS_EXT.0,
                    "PRE_RASTERIZATION_SHADERS_EXT",
                ),
                (
                    GraphicsPipelineLibraryFlagBitsEXT::FRAGMENT_SHADER_EXT.0,
                    "FRAGMENT_SHADER_EXT",
                ),
                (
                    GraphicsPipelineLibraryFlagBitsEXT::FRAGMENT_OUTPUT_INTERFACE_EXT.0,
                    "FRAGMENT_OUTPUT_INTERFACE_EXT",
                ),
            ];
            debug_flags(f, KNOWN, self.0)
        }
    }

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

    impl GraphicsPipelineLibraryFlagBitsEXT {
        pub const VERTEX_INPUT_INTERFACE_EXT: Self = Self(1 << 0);
        pub const PRE_RASTERIZATION_SHADERS_EXT: Self = Self(1 << 1);
        pub const FRAGMENT_SHADER_EXT: Self = Self(1 << 2);
        pub const FRAGMENT_OUTPUT_INTERFACE_EXT: Self = Self(1 << 3);
    }

    impl fmt::Debug for GraphicsPipelineLibraryFlagBitsEXT {
        fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
            let name = match *self {
                Self::VERTEX_INPUT_INTERFACE_EXT => Some("VERTEX_INPUT_INTERFACE_EXT"),
                Self::PRE_RASTERIZATION_SHADERS_EXT => Some("PRE_RASTERIZATION_SHADERS_EXT"),
                Self::FRAGMENT_SHADER_EXT => Some("FRAGMENT_SHADER_EXT"),
                Self::FRAGMENT_OUTPUT_INTERFACE_EXT => Some("FRAGMENT_OUTPUT_INTERFACE_EXT"),
                _ => 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 VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT =
        PhysicalDeviceGraphicsPipelineLibraryFeaturesEXT<'static>;
    pub type VkPhysicalDeviceGraphicsPipelineLibraryPropertiesEXT =
        PhysicalDeviceGraphicsPipelineLibraryPropertiesEXT<'static>;
    pub type VkGraphicsPipelineLibraryCreateInfoEXT = GraphicsPipelineLibraryCreateInfoEXT<'static>;
    pub type VkGraphicsPipelineLibraryFlagsEXT = GraphicsPipelineLibraryFlagsEXT;
    pub type VkGraphicsPipelineLibraryFlagBitsEXT = GraphicsPipelineLibraryFlagBitsEXT;
    impl PhysicalDeviceGraphicsPipelineLibraryFeaturesEXT<'_> {
        #[inline]
        pub unsafe fn drop_lifetime_for_ffi(
            &self,
        ) -> &VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT {
            unsafe { core::mem::transmute(self) }
        }
    }
    impl PhysicalDeviceGraphicsPipelineLibraryPropertiesEXT<'_> {
        #[inline]
        pub unsafe fn drop_lifetime_for_ffi(
            &self,
        ) -> &VkPhysicalDeviceGraphicsPipelineLibraryPropertiesEXT {
            unsafe { core::mem::transmute(self) }
        }
    }
    impl GraphicsPipelineLibraryCreateInfoEXT<'_> {
        #[inline]
        pub unsafe fn drop_lifetime_for_ffi(&self) -> &VkGraphicsPipelineLibraryCreateInfoEXT {
            unsafe { core::mem::transmute(self) }
        }
    }
}