kazan 0.3.9+1.4.359

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    pub type VkPhysicalDeviceShaderTileImageFeaturesEXT =
        PhysicalDeviceShaderTileImageFeaturesEXT<'static>;
    pub type VkPhysicalDeviceShaderTileImagePropertiesEXT =
        PhysicalDeviceShaderTileImagePropertiesEXT<'static>;
    impl PhysicalDeviceShaderTileImageFeaturesEXT<'_> {
        #[inline]
        pub unsafe fn drop_lifetime_for_ffi(&self) -> &VkPhysicalDeviceShaderTileImageFeaturesEXT {
            unsafe { core::mem::transmute(self) }
        }
    }
    impl PhysicalDeviceShaderTileImagePropertiesEXT<'_> {
        #[inline]
        pub unsafe fn drop_lifetime_for_ffi(
            &self,
        ) -> &VkPhysicalDeviceShaderTileImagePropertiesEXT {
            unsafe { core::mem::transmute(self) }
        }
    }
}