#![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_dynamic_rendering";
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;
pub type PipelineRenderingCreateInfoKHR<'a> = PipelineRenderingCreateInfo<'a>;
pub type RenderingInfoKHR<'a> = RenderingInfo<'a>;
pub type RenderingAttachmentInfoKHR<'a> = RenderingAttachmentInfo<'a>;
pub type PhysicalDeviceDynamicRenderingFeaturesKHR<'a> =
PhysicalDeviceDynamicRenderingFeatures<'a>;
pub type CommandBufferInheritanceRenderingInfoKHR<'a> =
CommandBufferInheritanceRenderingInfo<'a>;
pub type RenderingFlagsKHR = RenderingFlags;
pub type PFN_vkCmdBeginRenderingKHR = PFN_vkCmdBeginRendering;
pub type PFN_vkCmdEndRenderingKHR = PFN_vkCmdEndRendering;
}
#[cfg(feature = "ffi")]
pub(super) mod ffi {
#![allow(non_camel_case_types)]
use super::defs::*;
pub type VkPipelineRenderingCreateInfoKHR = PipelineRenderingCreateInfoKHR<'static>;
pub type VkRenderingInfoKHR = RenderingInfoKHR<'static>;
pub type VkRenderingAttachmentInfoKHR = RenderingAttachmentInfoKHR<'static>;
pub type VkPhysicalDeviceDynamicRenderingFeaturesKHR =
PhysicalDeviceDynamicRenderingFeaturesKHR<'static>;
pub type VkCommandBufferInheritanceRenderingInfoKHR =
CommandBufferInheritanceRenderingInfoKHR<'static>;
pub type VkRenderingFlagsKHR = RenderingFlagsKHR;
}
pub struct DeviceFn {
cmd_begin_rendering: PFN_vkCmdBeginRendering,
cmd_end_rendering: PFN_vkCmdEndRendering,
}
impl LoadDeviceFn for DeviceFn {
unsafe fn load_with(
load: impl Fn(&CStr) -> Option<PFN_vkVoidFunction>,
) -> core::result::Result<Self, MissingEntryPointError> {
unsafe {
Ok(Self {
cmd_begin_rendering: transmute(
load(c"vkCmdBeginRenderingKHR").ok_or(MissingEntryPointError)?,
),
cmd_end_rendering: transmute(
load(c"vkCmdEndRenderingKHR").ok_or(MissingEntryPointError)?,
),
})
}
}
}
impl DeviceFn {
#[inline]
pub unsafe fn cmd_begin_rendering(
&self,
command_buffer: CommandBuffer,
rendering_info: &RenderingInfo<'_>,
) {
unsafe { (self.cmd_begin_rendering)(command_buffer, rendering_info) }
}
#[inline]
pub unsafe fn cmd_end_rendering(&self, command_buffer: CommandBuffer) {
unsafe { (self.cmd_end_rendering)(command_buffer) }
}
}