kazan 0.3.9+1.4.359

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

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/VkLineRasterizationModeKHR.html>
    pub type LineRasterizationModeKHR = LineRasterizationMode;
    /// <https://registry.khronos.org/vulkan/specs/latest/man/html/VkPhysicalDeviceLineRasterizationFeaturesKHR.html>
    pub type PhysicalDeviceLineRasterizationFeaturesKHR<'a> =
        PhysicalDeviceLineRasterizationFeatures<'a>;
    /// <https://registry.khronos.org/vulkan/specs/latest/man/html/VkPhysicalDeviceLineRasterizationPropertiesKHR.html>
    pub type PhysicalDeviceLineRasterizationPropertiesKHR<'a> =
        PhysicalDeviceLineRasterizationProperties<'a>;
    /// <https://registry.khronos.org/vulkan/specs/latest/man/html/VkPipelineRasterizationLineStateCreateInfoKHR.html>
    pub type PipelineRasterizationLineStateCreateInfoKHR<'a> =
        PipelineRasterizationLineStateCreateInfo<'a>;
    pub type PFN_vkCmdSetLineStippleKHR = PFN_vkCmdSetLineStipple;
}

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

    pub type VkLineRasterizationModeKHR = LineRasterizationModeKHR;
    pub type VkPhysicalDeviceLineRasterizationFeaturesKHR =
        PhysicalDeviceLineRasterizationFeaturesKHR<'static>;
    pub type VkPhysicalDeviceLineRasterizationPropertiesKHR =
        PhysicalDeviceLineRasterizationPropertiesKHR<'static>;
    pub type VkPipelineRasterizationLineStateCreateInfoKHR =
        PipelineRasterizationLineStateCreateInfoKHR<'static>;
}

pub struct DeviceFn {
    cmd_set_line_stipple: PFN_vkCmdSetLineStipple,
}

impl LoadDeviceFn for DeviceFn {
    unsafe fn load_with(
        load: impl Fn(&CStr) -> Option<PFN_vkVoidFunction>,
    ) -> core::result::Result<Self, MissingEntryPointError> {
        unsafe {
            Ok(Self {
                cmd_set_line_stipple: transmute(
                    load(c"vkCmdSetLineStippleKHR").ok_or(MissingEntryPointError)?,
                ),
            })
        }
    }
}

impl DeviceFn {
    /// <https://registry.khronos.org/vulkan/specs/latest/man/html/vkCmdSetLineStippleKHR.html>
    #[inline]
    pub unsafe fn cmd_set_line_stipple(
        &self,
        command_buffer: CommandBuffer,
        line_stipple_factor: u32,
        line_stipple_pattern: u16,
    ) {
        unsafe {
            (self.cmd_set_line_stipple)(command_buffer, line_stipple_factor, line_stipple_pattern)
        }
    }
}