Vendor dependencies for 0.3.0 release

This commit is contained in:
2025-09-27 10:29:08 -05:00
parent 0c8d39d483
commit 82ab7f317b
26803 changed files with 16134934 additions and 0 deletions

2765
vendor/ash/src/device.rs vendored Normal file

File diff suppressed because it is too large Load Diff

404
vendor/ash/src/entry.rs vendored Normal file
View File

@@ -0,0 +1,404 @@
use crate::instance::Instance;
#[cfg(doc)]
use crate::khr;
use crate::prelude::*;
use crate::vk;
use crate::RawPtr;
use alloc::vec::Vec;
use core::ffi;
use core::fmt;
use core::mem;
use core::ptr;
#[cfg(feature = "loaded")]
use libloading::Library;
/// Holds the Vulkan functions independent of a particular instance
#[derive(Clone)]
pub struct Entry {
static_fn: crate::StaticFn,
entry_fn_1_0: crate::EntryFnV1_0,
entry_fn_1_1: crate::EntryFnV1_1,
#[cfg(feature = "loaded")]
_lib_guard: Option<alloc::sync::Arc<Library>>,
}
/// Vulkan core 1.0
impl Entry {
/// Load default Vulkan library for the current platform
///
/// Prefer this over [`linked()`][Self::linked()] when your application can gracefully handle
/// environments that lack Vulkan support, and when the build environment might not have Vulkan
/// development packages installed (e.g. the Vulkan SDK, or Ubuntu's `libvulkan-dev`).
///
/// # Safety
///
/// `dlopen`ing native libraries is inherently unsafe. The safety guidelines
/// for [`Library::new()`] and [`Library::get()`] apply here.
///
/// No Vulkan functions loaded directly or indirectly from this [`Entry`]
/// may be called after it is [dropped][drop()].
///
/// # Example
///
/// ```no_run
/// use ash::{vk, Entry};
/// # fn main() -> Result<(), Box<dyn std::error::Error>> {
/// let entry = unsafe { Entry::load()? };
/// let app_info = vk::ApplicationInfo {
/// api_version: vk::make_api_version(0, 1, 0, 0),
/// ..Default::default()
/// };
/// let create_info = vk::InstanceCreateInfo {
/// p_application_info: &app_info,
/// ..Default::default()
/// };
/// let instance = unsafe { entry.create_instance(&create_info, None)? };
/// # Ok(()) }
/// ```
#[cfg(feature = "loaded")]
#[cfg_attr(docsrs, doc(cfg(feature = "loaded")))]
pub unsafe fn load() -> Result<Self, LoadingError> {
#[cfg(windows)]
const LIB_PATH: &str = "vulkan-1.dll";
#[cfg(all(
unix,
not(any(
target_os = "macos",
target_os = "ios",
target_os = "android",
target_os = "fuchsia"
))
))]
const LIB_PATH: &str = "libvulkan.so.1";
#[cfg(any(target_os = "android", target_os = "fuchsia"))]
const LIB_PATH: &str = "libvulkan.so";
#[cfg(any(target_os = "macos", target_os = "ios"))]
const LIB_PATH: &str = "libvulkan.dylib";
Self::load_from(LIB_PATH)
}
/// Load entry points from a Vulkan loader linked at compile time
///
/// Compared to [`load()`][Self::load()], this is infallible, but requires that the build
/// environment have Vulkan development packages installed (e.g. the Vulkan SDK, or Ubuntu's
/// `libvulkan-dev`), and prevents the resulting binary from starting in environments that do not
/// support Vulkan.
///
/// Note that instance/device functions are still fetched via `vkGetInstanceProcAddr` and
/// `vkGetDeviceProcAddr` for maximum performance.
///
/// Any Vulkan function acquired directly or indirectly from this [`Entry`] may be called after it
/// is [dropped][drop()].
///
/// # Example
///
/// ```no_run
/// use ash::{vk, Entry};
/// # fn main() -> Result<(), Box<dyn std::error::Error>> {
/// let entry = Entry::linked();
/// let app_info = vk::ApplicationInfo {
/// api_version: vk::make_api_version(0, 1, 0, 0),
/// ..Default::default()
/// };
/// let create_info = vk::InstanceCreateInfo {
/// p_application_info: &app_info,
/// ..Default::default()
/// };
/// let instance = unsafe { entry.create_instance(&create_info, None)? };
/// # Ok(()) }
/// ```
#[cfg(feature = "linked")]
#[cfg_attr(docsrs, doc(cfg(feature = "linked")))]
pub fn linked() -> Self {
// Sound because we're linking to Vulkan, which provides a vkGetInstanceProcAddr that has
// defined behavior in this use.
unsafe {
Self::from_static_fn(crate::StaticFn {
get_instance_proc_addr: vkGetInstanceProcAddr,
})
}
}
/// Load Vulkan library at `path`
///
/// # Safety
///
/// `dlopen`ing native libraries is inherently unsafe. The safety guidelines
/// for [`Library::new()`] and [`Library::get()`] apply here.
///
/// No Vulkan functions loaded directly or indirectly from this [`Entry`]
/// may be called after it is [dropped][drop()].
#[cfg(feature = "loaded")]
#[cfg_attr(docsrs, doc(cfg(feature = "loaded")))]
pub unsafe fn load_from(path: impl AsRef<std::ffi::OsStr>) -> Result<Self, LoadingError> {
let lib = Library::new(path)
.map_err(LoadingError::LibraryLoadFailure)
.map(alloc::sync::Arc::new)?;
let static_fn = crate::StaticFn::load_checked(|name| {
lib.get(name.to_bytes_with_nul())
.map(|symbol| *symbol)
.unwrap_or(ptr::null_mut())
})?;
Ok(Self {
_lib_guard: Some(lib),
..Self::from_static_fn(static_fn)
})
}
/// Load entry points based on an already-loaded [`crate::StaticFn`]
///
/// # Safety
///
/// `static_fn` must contain valid function pointers that comply with the semantics specified
/// by Vulkan 1.0, which must remain valid for at least the lifetime of the returned [`Entry`].
pub unsafe fn from_static_fn(static_fn: crate::StaticFn) -> Self {
let load_fn = move |name: &ffi::CStr| {
mem::transmute((static_fn.get_instance_proc_addr)(
vk::Instance::null(),
name.as_ptr(),
))
};
Self::from_parts_1_1(
static_fn,
crate::EntryFnV1_0::load(load_fn),
crate::EntryFnV1_1::load(load_fn),
)
}
#[inline]
pub fn from_parts_1_1(
static_fn: crate::StaticFn,
entry_fn_1_0: crate::EntryFnV1_0,
entry_fn_1_1: crate::EntryFnV1_1,
) -> Self {
Self {
static_fn,
entry_fn_1_0,
entry_fn_1_1,
#[cfg(feature = "loaded")]
_lib_guard: None,
}
}
#[inline]
pub fn fp_v1_0(&self) -> &crate::EntryFnV1_0 {
&self.entry_fn_1_0
}
#[inline]
pub fn static_fn(&self) -> &crate::StaticFn {
&self.static_fn
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkEnumerateInstanceVersion.html>
///
/// # Example
///
/// ```no_run
/// # use ash::{Entry, vk};
/// # fn main() -> Result<(), Box<dyn std::error::Error>> {
/// let entry = Entry::linked();
/// match unsafe { entry.try_enumerate_instance_version() }? {
/// // Vulkan 1.1+
/// Some(version) => {
/// let major = vk::version_major(version);
/// let minor = vk::version_minor(version);
/// let patch = vk::version_patch(version);
/// },
/// // Vulkan 1.0
/// None => {},
/// }
/// # Ok(()) }
/// ```
#[inline]
pub unsafe fn try_enumerate_instance_version(&self) -> VkResult<Option<u32>> {
let enumerate_instance_version: Option<vk::PFN_vkEnumerateInstanceVersion> = {
let name = ffi::CStr::from_bytes_with_nul_unchecked(b"vkEnumerateInstanceVersion\0");
mem::transmute((self.static_fn.get_instance_proc_addr)(
vk::Instance::null(),
name.as_ptr(),
))
};
if let Some(enumerate_instance_version) = enumerate_instance_version {
let mut api_version = mem::MaybeUninit::uninit();
(enumerate_instance_version)(api_version.as_mut_ptr())
.assume_init_on_success(api_version)
.map(Some)
} else {
Ok(None)
}
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCreateInstance.html>
///
/// # Safety
///
/// The resulting [`Instance`] and any function-pointer objects (e.g. [`Device`][crate::Device]
/// and extensions like [`khr::swapchain::Device`]) loaded from it may not be used after
/// this [`Entry`] object is dropped, unless it was crated using [`Entry::linked()`] or
/// [`Entry::from_parts_1_1()`].
///
/// [`Instance`] does _not_ implement [drop][drop()] semantics and can only be destroyed via
/// [`destroy_instance()`][Instance::destroy_instance()].
#[inline]
pub unsafe fn create_instance(
&self,
create_info: &vk::InstanceCreateInfo<'_>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<Instance> {
let mut instance = mem::MaybeUninit::uninit();
let instance = (self.entry_fn_1_0.create_instance)(
create_info,
allocation_callbacks.as_raw_ptr(),
instance.as_mut_ptr(),
)
.assume_init_on_success(instance)?;
Ok(Instance::load(&self.static_fn, instance))
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkEnumerateInstanceLayerProperties.html>
#[inline]
pub unsafe fn enumerate_instance_layer_properties(&self) -> VkResult<Vec<vk::LayerProperties>> {
read_into_uninitialized_vector(|count, data| {
(self.entry_fn_1_0.enumerate_instance_layer_properties)(count, data)
})
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkEnumerateInstanceExtensionProperties.html>
#[inline]
pub unsafe fn enumerate_instance_extension_properties(
&self,
layer_name: Option<&ffi::CStr>,
) -> VkResult<Vec<vk::ExtensionProperties>> {
read_into_uninitialized_vector(|count, data| {
(self.entry_fn_1_0.enumerate_instance_extension_properties)(
layer_name.map_or(ptr::null(), |str| str.as_ptr()),
count,
data,
)
})
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetInstanceProcAddr.html>
#[inline]
pub unsafe fn get_instance_proc_addr(
&self,
instance: vk::Instance,
p_name: *const ffi::c_char,
) -> vk::PFN_vkVoidFunction {
(self.static_fn.get_instance_proc_addr)(instance, p_name)
}
}
/// Vulkan core 1.1
impl Entry {
#[inline]
pub fn fp_v1_1(&self) -> &crate::EntryFnV1_1 {
&self.entry_fn_1_1
}
#[deprecated = "This function is unavailable and therefore panics on Vulkan 1.0, please use `try_enumerate_instance_version()` instead"]
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkEnumerateInstanceVersion.html>
///
/// Please use [`try_enumerate_instance_version()`][Self::try_enumerate_instance_version()] instead.
#[inline]
pub unsafe fn enumerate_instance_version(&self) -> VkResult<u32> {
let mut api_version = mem::MaybeUninit::uninit();
(self.entry_fn_1_1.enumerate_instance_version)(api_version.as_mut_ptr())
.assume_init_on_success(api_version)
}
}
#[cfg(feature = "linked")]
#[cfg_attr(docsrs, doc(cfg(feature = "linked")))]
impl Default for Entry {
#[inline]
fn default() -> Self {
Self::linked()
}
}
impl crate::StaticFn {
pub fn load_checked<F>(mut _f: F) -> Result<Self, MissingEntryPoint>
where
F: FnMut(&ffi::CStr) -> *const ffi::c_void,
{
Ok(Self {
get_instance_proc_addr: unsafe {
let cname = ffi::CStr::from_bytes_with_nul_unchecked(b"vkGetInstanceProcAddr\0");
let val = _f(cname);
if val.is_null() {
return Err(MissingEntryPoint);
} else {
mem::transmute(val)
}
},
})
}
}
#[derive(Clone, Debug)]
pub struct MissingEntryPoint;
impl fmt::Display for MissingEntryPoint {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "Cannot load `vkGetInstanceProcAddr` symbol from library")
}
}
#[cfg(feature = "std")] // TODO: implement when error_in_core is stabilized
impl std::error::Error for MissingEntryPoint {}
#[cfg(feature = "linked")]
extern "system" {
fn vkGetInstanceProcAddr(
instance: vk::Instance,
name: *const ffi::c_char,
) -> vk::PFN_vkVoidFunction;
}
#[cfg(feature = "loaded")]
mod loaded {
use super::*;
#[derive(Debug)]
#[cfg_attr(docsrs, doc(cfg(feature = "loaded")))]
pub enum LoadingError {
LibraryLoadFailure(libloading::Error),
MissingEntryPoint(MissingEntryPoint),
}
impl fmt::Display for LoadingError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Self::LibraryLoadFailure(err) => fmt::Display::fmt(err, f),
Self::MissingEntryPoint(err) => fmt::Display::fmt(err, f),
}
}
}
#[cfg(feature = "std")]
impl std::error::Error for LoadingError {
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
Some(match self {
Self::LibraryLoadFailure(err) => err,
Self::MissingEntryPoint(err) => err,
})
}
}
impl From<MissingEntryPoint> for LoadingError {
fn from(err: MissingEntryPoint) -> Self {
Self::MissingEntryPoint(err)
}
}
}
#[cfg(feature = "loaded")]
pub use self::loaded::*;

View File

@@ -0,0 +1,24 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_AMD_buffer_marker.html>
use crate::vk;
impl crate::amd::buffer_marker::Device {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdWriteBufferMarkerAMD.html>
#[inline]
pub unsafe fn cmd_write_buffer_marker(
&self,
command_buffer: vk::CommandBuffer,
pipeline_stage: vk::PipelineStageFlags,
dst_buffer: vk::Buffer,
dst_offset: vk::DeviceSize,
marker: u32,
) {
(self.fp.cmd_write_buffer_marker_amd)(
command_buffer,
pipeline_stage,
dst_buffer,
dst_offset,
marker,
)
}
}

2
vendor/ash/src/extensions/amd/mod.rs vendored Normal file
View File

@@ -0,0 +1,2 @@
pub mod buffer_marker;
pub mod shader_info;

View File

@@ -0,0 +1,68 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_AMD_shader_info.html>
use crate::prelude::*;
use crate::vk;
use alloc::vec::Vec;
use core::mem;
impl crate::amd::shader_info::Device {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetShaderInfoAMD.html> with [`vk::ShaderInfoTypeAMD::STATISTICS`]
#[inline]
pub unsafe fn get_shader_info_statistics(
&self,
pipeline: vk::Pipeline,
shader_stage: vk::ShaderStageFlags,
) -> VkResult<vk::ShaderStatisticsInfoAMD> {
let mut info = mem::MaybeUninit::<vk::ShaderStatisticsInfoAMD>::uninit();
let mut size = mem::size_of_val(&info);
(self.fp.get_shader_info_amd)(
self.handle,
pipeline,
shader_stage,
vk::ShaderInfoTypeAMD::STATISTICS,
&mut size,
info.as_mut_ptr().cast(),
)
.result()?;
assert_eq!(size, mem::size_of_val(&info));
Ok(info.assume_init())
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetShaderInfoAMD.html> with [`vk::ShaderInfoTypeAMD::BINARY`]
#[inline]
pub unsafe fn get_shader_info_binary(
&self,
pipeline: vk::Pipeline,
shader_stage: vk::ShaderStageFlags,
) -> VkResult<Vec<u8>> {
read_into_uninitialized_vector(|count, data: *mut u8| {
(self.fp.get_shader_info_amd)(
self.handle,
pipeline,
shader_stage,
vk::ShaderInfoTypeAMD::BINARY,
count,
data.cast(),
)
})
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetShaderInfoAMD.html> with [`vk::ShaderInfoTypeAMD::DISASSEMBLY`]
#[inline]
pub unsafe fn get_shader_info_disassembly(
&self,
pipeline: vk::Pipeline,
shader_stage: vk::ShaderStageFlags,
) -> VkResult<Vec<u8>> {
read_into_uninitialized_vector(|count, data: *mut u8| {
(self.fp.get_shader_info_amd)(
self.handle,
pipeline,
shader_stage,
vk::ShaderInfoTypeAMD::DISASSEMBLY,
count,
data.cast(),
)
})
}
}

1
vendor/ash/src/extensions/amdx/mod.rs vendored Normal file
View File

@@ -0,0 +1 @@
pub mod shader_enqueue;

View File

@@ -0,0 +1,112 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_AMDX_shader_enqueue.html>
use crate::prelude::*;
use crate::vk;
use crate::RawPtr;
use alloc::vec::Vec;
use core::mem;
impl crate::amdx::shader_enqueue::Device {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCreateExecutionGraphPipelinesAMDX.html>
///
/// Pipelines are created and returned as described for [Multiple Pipeline Creation].
///
/// [Multiple Pipeline Creation]: https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#pipelines-multiple
#[inline]
pub unsafe fn create_execution_graph_pipelines(
&self,
pipeline_cache: vk::PipelineCache,
create_infos: &[vk::ExecutionGraphPipelineCreateInfoAMDX<'_>],
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> Result<Vec<vk::Pipeline>, (Vec<vk::Pipeline>, vk::Result)> {
let mut pipelines = Vec::with_capacity(create_infos.len());
let err_code = (self.fp.create_execution_graph_pipelines_amdx)(
self.handle,
pipeline_cache,
create_infos.len() as u32,
create_infos.as_ptr(),
allocation_callbacks.as_raw_ptr(),
pipelines.as_mut_ptr(),
);
pipelines.set_len(create_infos.len());
match err_code {
vk::Result::SUCCESS => Ok(pipelines),
_ => Err((pipelines, err_code)),
}
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetExecutionGraphPipelineScratchSizeAMDX.html>
#[inline]
pub unsafe fn get_execution_graph_pipeline_scratch_size(
&self,
execution_graph: vk::Pipeline,
size_info: &mut vk::ExecutionGraphPipelineScratchSizeAMDX<'_>,
) -> VkResult<()> {
(self.fp.get_execution_graph_pipeline_scratch_size_amdx)(
self.handle,
execution_graph,
size_info,
)
.result()
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetExecutionGraphPipelineNodeIndexAMDX.html>
#[inline]
pub unsafe fn get_execution_graph_pipeline_node_index(
&self,
execution_graph: vk::Pipeline,
node_info: &vk::PipelineShaderStageNodeCreateInfoAMDX<'_>,
) -> VkResult<u32> {
let mut node_index = mem::MaybeUninit::uninit();
(self.fp.get_execution_graph_pipeline_node_index_amdx)(
self.handle,
execution_graph,
node_info,
node_index.as_mut_ptr(),
)
.assume_init_on_success(node_index)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdInitializeGraphScratchMemoryAMDX.html>
#[inline]
pub unsafe fn cmd_initialize_graph_scratch_memory(
&self,
command_buffer: vk::CommandBuffer,
scratch: vk::DeviceAddress,
) {
(self.fp.cmd_initialize_graph_scratch_memory_amdx)(command_buffer, scratch)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdDispatchGraphAMDX.html>
#[inline]
pub unsafe fn cmd_dispatch_graph(
&self,
command_buffer: vk::CommandBuffer,
scratch: vk::DeviceAddress,
count_info: &vk::DispatchGraphCountInfoAMDX,
) {
(self.fp.cmd_dispatch_graph_amdx)(command_buffer, scratch, count_info)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdDispatchGraphIndirectAMDX.html>
#[inline]
pub unsafe fn cmd_dispatch_graph_indirect(
&self,
command_buffer: vk::CommandBuffer,
scratch: vk::DeviceAddress,
count_info: &vk::DispatchGraphCountInfoAMDX,
) {
(self.fp.cmd_dispatch_graph_indirect_amdx)(command_buffer, scratch, count_info)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdDispatchGraphIndirectCountAMDX.html>
#[inline]
pub unsafe fn cmd_dispatch_graph_indirect_count(
&self,
command_buffer: vk::CommandBuffer,
scratch: vk::DeviceAddress,
count_info: vk::DeviceAddress,
) {
(self.fp.cmd_dispatch_graph_indirect_count_amdx)(command_buffer, scratch, count_info)
}
}

View File

@@ -0,0 +1,29 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_ANDROID_external_memory_android_hardware_buffer.html>
use crate::prelude::*;
use crate::vk;
use core::mem;
impl crate::android::external_memory_android_hardware_buffer::Device {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetAndroidHardwareBufferPropertiesANDROID.html>
#[inline]
pub unsafe fn get_android_hardware_buffer_properties(
&self,
buffer: *const vk::AHardwareBuffer,
properties: &mut vk::AndroidHardwareBufferPropertiesANDROID<'_>,
) -> VkResult<()> {
(self.fp.get_android_hardware_buffer_properties_android)(self.handle, buffer, properties)
.result()
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetMemoryAndroidHardwareBufferANDROID.html>
#[inline]
pub unsafe fn get_memory_android_hardware_buffer(
&self,
info: &vk::MemoryGetAndroidHardwareBufferInfoANDROID<'_>,
) -> VkResult<*mut vk::AHardwareBuffer> {
let mut buffer = mem::MaybeUninit::uninit();
(self.fp.get_memory_android_hardware_buffer_android)(self.handle, info, buffer.as_mut_ptr())
.assume_init_on_success(buffer)
}
}

View File

@@ -0,0 +1 @@
pub mod external_memory_android_hardware_buffer;

View File

@@ -0,0 +1,31 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_acquire_drm_display.html>
use crate::prelude::*;
use crate::vk;
use core::mem;
impl crate::ext::acquire_drm_display::Instance {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkAcquireDrmDisplayEXT.html>
#[inline]
pub unsafe fn acquire_drm_display(
&self,
physical_device: vk::PhysicalDevice,
drm_fd: i32,
display: vk::DisplayKHR,
) -> VkResult<()> {
(self.fp.acquire_drm_display_ext)(physical_device, drm_fd, display).result()
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetDrmDisplayEXT.html>
#[inline]
pub unsafe fn get_drm_display(
&self,
physical_device: vk::PhysicalDevice,
drm_fd: i32,
connector_id: u32,
) -> VkResult<vk::DisplayKHR> {
let mut display = mem::MaybeUninit::uninit();
(self.fp.get_drm_display_ext)(physical_device, drm_fd, connector_id, display.as_mut_ptr())
.assume_init_on_success(display)
}
}

View File

@@ -0,0 +1,14 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_buffer_device_address.html>
use crate::vk;
impl crate::ext::buffer_device_address::Device {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetBufferDeviceAddressEXT.html>
#[inline]
pub unsafe fn get_buffer_device_address(
&self,
info: &vk::BufferDeviceAddressInfoEXT<'_>,
) -> vk::DeviceAddress {
(self.fp.get_buffer_device_address_ext)(self.handle, info)
}
}

View File

@@ -0,0 +1,47 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_calibrated_timestamps.html>
use crate::prelude::*;
use crate::vk;
use alloc::vec::Vec;
use core::mem;
impl crate::ext::calibrated_timestamps::Device {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetCalibratedTimestampsEXT.html>
///
/// Returns a tuple containing `(timestamps, max_deviation)`
#[inline]
pub unsafe fn get_calibrated_timestamps(
&self,
info: &[vk::CalibratedTimestampInfoEXT<'_>],
) -> VkResult<(Vec<u64>, u64)> {
let mut timestamps = Vec::with_capacity(info.len());
let mut max_deviation = mem::MaybeUninit::uninit();
let max_deviation = (self.fp.get_calibrated_timestamps_ext)(
self.handle,
info.len() as u32,
info.as_ptr(),
timestamps.as_mut_ptr(),
max_deviation.as_mut_ptr(),
)
.assume_init_on_success(max_deviation)?;
timestamps.set_len(info.len());
Ok((timestamps, max_deviation))
}
}
impl crate::ext::calibrated_timestamps::Instance {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceCalibrateableTimeDomainsEXT.html>
#[inline]
pub unsafe fn get_physical_device_calibrateable_time_domains(
&self,
physical_device: vk::PhysicalDevice,
) -> VkResult<Vec<vk::TimeDomainEXT>> {
read_into_uninitialized_vector(|count, data| {
(self.fp.get_physical_device_calibrateable_time_domains_ext)(
physical_device,
count,
data,
)
})
}
}

41
vendor/ash/src/extensions/ext/debug_marker.rs vendored Executable file
View File

@@ -0,0 +1,41 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_debug_marker.html>
use crate::prelude::*;
use crate::vk;
impl crate::ext::debug_marker::Device {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkDebugMarkerSetObjectNameEXT.html>
#[inline]
pub unsafe fn debug_marker_set_object_name(
&self,
name_info: &vk::DebugMarkerObjectNameInfoEXT<'_>,
) -> VkResult<()> {
(self.fp.debug_marker_set_object_name_ext)(self.handle, name_info).result()
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdDebugMarkerBeginEXT.html>
#[inline]
pub unsafe fn cmd_debug_marker_begin(
&self,
command_buffer: vk::CommandBuffer,
marker_info: &vk::DebugMarkerMarkerInfoEXT<'_>,
) {
(self.fp.cmd_debug_marker_begin_ext)(command_buffer, marker_info);
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdDebugMarkerEndEXT.html>
#[inline]
pub unsafe fn cmd_debug_marker_end(&self, command_buffer: vk::CommandBuffer) {
(self.fp.cmd_debug_marker_end_ext)(command_buffer);
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdDebugMarkerInsertEXT.html>
#[inline]
pub unsafe fn cmd_debug_marker_insert(
&self,
command_buffer: vk::CommandBuffer,
marker_info: &vk::DebugMarkerMarkerInfoEXT<'_>,
) {
(self.fp.cmd_debug_marker_insert_ext)(command_buffer, marker_info);
}
}

39
vendor/ash/src/extensions/ext/debug_report.rs vendored Executable file
View File

@@ -0,0 +1,39 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_debug_report.html>
use crate::prelude::*;
use crate::vk;
use crate::RawPtr;
use core::mem;
impl crate::ext::debug_report::Instance {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkDestroyDebugReportCallbackEXT.html>
#[inline]
pub unsafe fn destroy_debug_report_callback(
&self,
debug: vk::DebugReportCallbackEXT,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) {
(self.fp.destroy_debug_report_callback_ext)(
self.handle,
debug,
allocation_callbacks.as_raw_ptr(),
);
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCreateDebugReportCallbackEXT.html>
#[inline]
pub unsafe fn create_debug_report_callback(
&self,
create_info: &vk::DebugReportCallbackCreateInfoEXT<'_>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<vk::DebugReportCallbackEXT> {
let mut debug_cb = mem::MaybeUninit::uninit();
(self.fp.create_debug_report_callback_ext)(
self.handle,
create_info,
allocation_callbacks.as_raw_ptr(),
debug_cb.as_mut_ptr(),
)
.assume_init_on_success(debug_cb)
}
}

123
vendor/ash/src/extensions/ext/debug_utils.rs vendored Executable file
View File

@@ -0,0 +1,123 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_debug_utils.html>
use crate::prelude::*;
use crate::vk;
use crate::RawPtr;
use core::mem;
impl crate::ext::debug_utils::Device {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkSetDebugUtilsObjectNameEXT.html>
#[inline]
pub unsafe fn set_debug_utils_object_name(
&self,
name_info: &vk::DebugUtilsObjectNameInfoEXT<'_>,
) -> VkResult<()> {
(self.fp.set_debug_utils_object_name_ext)(self.handle, name_info).result()
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkSetDebugUtilsObjectTagEXT.html>
#[inline]
pub unsafe fn set_debug_utils_object_tag(
&self,
tag_info: &vk::DebugUtilsObjectTagInfoEXT<'_>,
) -> VkResult<()> {
(self.fp.set_debug_utils_object_tag_ext)(self.handle, tag_info).result()
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdBeginDebugUtilsLabelEXT.html>
#[inline]
pub unsafe fn cmd_begin_debug_utils_label(
&self,
command_buffer: vk::CommandBuffer,
label: &vk::DebugUtilsLabelEXT<'_>,
) {
(self.fp.cmd_begin_debug_utils_label_ext)(command_buffer, label);
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdEndDebugUtilsLabelEXT.html>
#[inline]
pub unsafe fn cmd_end_debug_utils_label(&self, command_buffer: vk::CommandBuffer) {
(self.fp.cmd_end_debug_utils_label_ext)(command_buffer);
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdInsertDebugUtilsLabelEXT.html>
#[inline]
pub unsafe fn cmd_insert_debug_utils_label(
&self,
command_buffer: vk::CommandBuffer,
label: &vk::DebugUtilsLabelEXT<'_>,
) {
(self.fp.cmd_insert_debug_utils_label_ext)(command_buffer, label);
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkQueueBeginDebugUtilsLabelEXT.html>
#[inline]
pub unsafe fn queue_begin_debug_utils_label(
&self,
queue: vk::Queue,
label: &vk::DebugUtilsLabelEXT<'_>,
) {
(self.fp.queue_begin_debug_utils_label_ext)(queue, label);
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkQueueEndDebugUtilsLabelEXT.html>
#[inline]
pub unsafe fn queue_end_debug_utils_label(&self, queue: vk::Queue) {
(self.fp.queue_end_debug_utils_label_ext)(queue);
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkQueueInsertDebugUtilsLabelEXT.html>
#[inline]
pub unsafe fn queue_insert_debug_utils_label(
&self,
queue: vk::Queue,
label: &vk::DebugUtilsLabelEXT<'_>,
) {
(self.fp.queue_insert_debug_utils_label_ext)(queue, label);
}
}
impl crate::ext::debug_utils::Instance {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCreateDebugUtilsMessengerEXT.html>
#[inline]
pub unsafe fn create_debug_utils_messenger(
&self,
create_info: &vk::DebugUtilsMessengerCreateInfoEXT<'_>,
allocator: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<vk::DebugUtilsMessengerEXT> {
let mut messenger = mem::MaybeUninit::uninit();
(self.fp.create_debug_utils_messenger_ext)(
self.handle,
create_info,
allocator.as_raw_ptr(),
messenger.as_mut_ptr(),
)
.assume_init_on_success(messenger)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkDestroyDebugUtilsMessengerEXT.html>
#[inline]
pub unsafe fn destroy_debug_utils_messenger(
&self,
messenger: vk::DebugUtilsMessengerEXT,
allocator: Option<&vk::AllocationCallbacks<'_>>,
) {
(self.fp.destroy_debug_utils_messenger_ext)(self.handle, messenger, allocator.as_raw_ptr());
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkSubmitDebugUtilsMessageEXT.html>
#[inline]
pub unsafe fn submit_debug_utils_message(
&self,
message_severity: vk::DebugUtilsMessageSeverityFlagsEXT,
message_types: vk::DebugUtilsMessageTypeFlagsEXT,
callback_data: &vk::DebugUtilsMessengerCallbackDataEXT<'_>,
) {
(self.fp.submit_debug_utils_message_ext)(
self.handle,
message_severity,
message_types,
callback_data,
);
}
}

View File

@@ -0,0 +1,181 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_descriptor_buffer.html>
use crate::prelude::*;
use crate::vk;
use core::mem;
impl crate::ext::descriptor_buffer::Device {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetDescriptorSetLayoutSizeEXT.html>
#[inline]
pub unsafe fn get_descriptor_set_layout_size(
&self,
layout: vk::DescriptorSetLayout,
) -> vk::DeviceSize {
let mut count = mem::MaybeUninit::uninit();
(self.fp.get_descriptor_set_layout_size_ext)(self.handle, layout, count.as_mut_ptr());
count.assume_init()
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetDescriptorSetLayoutBindingOffsetEXT.html>
#[inline]
pub unsafe fn get_descriptor_set_layout_binding_offset(
&self,
layout: vk::DescriptorSetLayout,
binding: u32,
) -> vk::DeviceSize {
let mut offset = mem::MaybeUninit::uninit();
(self.fp.get_descriptor_set_layout_binding_offset_ext)(
self.handle,
layout,
binding,
offset.as_mut_ptr(),
);
offset.assume_init()
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetDescriptorEXT.html>
#[inline]
pub unsafe fn get_descriptor(
&self,
descriptor_info: &vk::DescriptorGetInfoEXT<'_>,
descriptor: &mut [u8],
) {
(self.fp.get_descriptor_ext)(
self.handle,
descriptor_info,
descriptor.len(),
descriptor.as_mut_ptr().cast(),
)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdBindDescriptorBuffersEXT.html>
#[inline]
pub unsafe fn cmd_bind_descriptor_buffers(
&self,
command_buffer: vk::CommandBuffer,
binding_info: &[vk::DescriptorBufferBindingInfoEXT<'_>],
) {
(self.fp.cmd_bind_descriptor_buffers_ext)(
command_buffer,
binding_info.len() as u32,
binding_info.as_ptr(),
)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetDescriptorBufferOffsetsEXT.html>
#[inline]
pub unsafe fn cmd_set_descriptor_buffer_offsets(
&self,
command_buffer: vk::CommandBuffer,
pipeline_bind_point: vk::PipelineBindPoint,
layout: vk::PipelineLayout,
first_set: u32,
buffer_indices: &[u32],
offsets: &[vk::DeviceSize],
) {
assert_eq!(buffer_indices.len(), offsets.len());
(self.fp.cmd_set_descriptor_buffer_offsets_ext)(
command_buffer,
pipeline_bind_point,
layout,
first_set,
buffer_indices.len() as u32,
buffer_indices.as_ptr(),
offsets.as_ptr(),
)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdBindDescriptorBufferEmbeddedSamplersEXT.html>
#[inline]
pub unsafe fn cmd_bind_descriptor_buffer_embedded_samplers(
&self,
command_buffer: vk::CommandBuffer,
pipeline_bind_point: vk::PipelineBindPoint,
layout: vk::PipelineLayout,
set: u32,
) {
(self.fp.cmd_bind_descriptor_buffer_embedded_samplers_ext)(
command_buffer,
pipeline_bind_point,
layout,
set,
)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetBufferOpaqueCaptureDescriptorDataEXT.html>
#[inline]
pub unsafe fn get_buffer_opaque_capture_descriptor_data(
&self,
info: &vk::BufferCaptureDescriptorDataInfoEXT<'_>,
data: &mut [u8],
) -> VkResult<()> {
(self.fp.get_buffer_opaque_capture_descriptor_data_ext)(
self.handle,
info,
data.as_mut_ptr().cast(),
)
.result()
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetImageOpaqueCaptureDescriptorDataEXT.html>
#[inline]
pub unsafe fn get_image_opaque_capture_descriptor_data(
&self,
info: &vk::ImageCaptureDescriptorDataInfoEXT<'_>,
data: &mut [u8],
) -> VkResult<()> {
(self.fp.get_image_opaque_capture_descriptor_data_ext)(
self.handle,
info,
data.as_mut_ptr().cast(),
)
.result()
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetImageViewOpaqueCaptureDescriptorDataEXT.html>
#[inline]
pub unsafe fn get_image_view_opaque_capture_descriptor_data(
&self,
info: &vk::ImageViewCaptureDescriptorDataInfoEXT<'_>,
data: &mut [u8],
) -> VkResult<()> {
(self.fp.get_image_view_opaque_capture_descriptor_data_ext)(
self.handle,
info,
data.as_mut_ptr().cast(),
)
.result()
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetSamplerOpaqueCaptureDescriptorDataEXT.html>
#[inline]
pub unsafe fn get_sampler_opaque_capture_descriptor_data(
&self,
info: &vk::SamplerCaptureDescriptorDataInfoEXT<'_>,
data: &mut [u8],
) -> VkResult<()> {
(self.fp.get_sampler_opaque_capture_descriptor_data_ext)(
self.handle,
info,
data.as_mut_ptr().cast(),
)
.result()
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT.html>
#[inline]
pub unsafe fn get_acceleration_structure_opaque_capture_descriptor_data(
&self,
info: &vk::AccelerationStructureCaptureDescriptorDataInfoEXT<'_>,
data: &mut [u8],
) -> VkResult<()> {
(self
.fp
.get_acceleration_structure_opaque_capture_descriptor_data_ext)(
self.handle,
info,
data.as_mut_ptr().cast(),
)
.result()
}
}

View File

@@ -0,0 +1,173 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_extended_dynamic_state.html>
use crate::vk;
use core::ptr;
impl crate::ext::extended_dynamic_state::Device {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetCullModeEXT.html>
#[inline]
pub unsafe fn cmd_set_cull_mode(
&self,
command_buffer: vk::CommandBuffer,
cull_mode: vk::CullModeFlags,
) {
(self.fp.cmd_set_cull_mode_ext)(command_buffer, cull_mode)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetFrontFaceEXT.html>
#[inline]
pub unsafe fn cmd_set_front_face(
&self,
command_buffer: vk::CommandBuffer,
front_face: vk::FrontFace,
) {
(self.fp.cmd_set_front_face_ext)(command_buffer, front_face)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetPrimitiveTopologyEXT.html>
#[inline]
pub unsafe fn cmd_set_primitive_topology(
&self,
command_buffer: vk::CommandBuffer,
primitive_topology: vk::PrimitiveTopology,
) {
(self.fp.cmd_set_primitive_topology_ext)(command_buffer, primitive_topology)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetViewportWithCountEXT.html>
#[inline]
pub unsafe fn cmd_set_viewport_with_count(
&self,
command_buffer: vk::CommandBuffer,
viewports: &[vk::Viewport],
) {
(self.fp.cmd_set_viewport_with_count_ext)(
command_buffer,
viewports.len() as u32,
viewports.as_ptr(),
)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetScissorWithCountEXT.html>
#[inline]
pub unsafe fn cmd_set_scissor_with_count(
&self,
command_buffer: vk::CommandBuffer,
scissors: &[vk::Rect2D],
) {
(self.fp.cmd_set_scissor_with_count_ext)(
command_buffer,
scissors.len() as u32,
scissors.as_ptr(),
)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdBindVertexBuffers2EXT.html>
#[inline]
pub unsafe fn cmd_bind_vertex_buffers2(
&self,
command_buffer: vk::CommandBuffer,
first_binding: u32,
buffers: &[vk::Buffer],
offsets: &[vk::DeviceSize],
sizes: Option<&[vk::DeviceSize]>,
strides: Option<&[vk::DeviceSize]>,
) {
assert_eq!(offsets.len(), buffers.len());
let p_sizes = if let Some(sizes) = sizes {
assert_eq!(sizes.len(), buffers.len());
sizes.as_ptr()
} else {
ptr::null()
};
let p_strides = if let Some(strides) = strides {
assert_eq!(strides.len(), buffers.len());
strides.as_ptr()
} else {
ptr::null()
};
(self.fp.cmd_bind_vertex_buffers2_ext)(
command_buffer,
first_binding,
buffers.len() as u32,
buffers.as_ptr(),
offsets.as_ptr(),
p_sizes,
p_strides,
)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetDepthTestEnableEXT.html>
#[inline]
pub unsafe fn cmd_set_depth_test_enable(
&self,
command_buffer: vk::CommandBuffer,
depth_test_enable: bool,
) {
(self.fp.cmd_set_depth_test_enable_ext)(command_buffer, depth_test_enable.into())
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetDepthWriteEnableEXT.html>
#[inline]
pub unsafe fn cmd_set_depth_write_enable(
&self,
command_buffer: vk::CommandBuffer,
depth_write_enable: bool,
) {
(self.fp.cmd_set_depth_write_enable_ext)(command_buffer, depth_write_enable.into())
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetDepthCompareOpEXT.html>
#[inline]
pub unsafe fn cmd_set_depth_compare_op(
&self,
command_buffer: vk::CommandBuffer,
depth_compare_op: vk::CompareOp,
) {
(self.fp.cmd_set_depth_compare_op_ext)(command_buffer, depth_compare_op)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetDepthBoundsTestEnableEXT.html>
#[inline]
pub unsafe fn cmd_set_depth_bounds_test_enable(
&self,
command_buffer: vk::CommandBuffer,
depth_bounds_test_enable: bool,
) {
(self.fp.cmd_set_depth_bounds_test_enable_ext)(
command_buffer,
depth_bounds_test_enable.into(),
)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetStencilTestEnableEXT.html>
#[inline]
pub unsafe fn cmd_set_stencil_test_enable(
&self,
command_buffer: vk::CommandBuffer,
stencil_test_enable: bool,
) {
(self.fp.cmd_set_stencil_test_enable_ext)(command_buffer, stencil_test_enable.into())
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetStencilOpEXT.html>
#[inline]
pub unsafe fn cmd_set_stencil_op(
&self,
command_buffer: vk::CommandBuffer,
face_mask: vk::StencilFaceFlags,
fail_op: vk::StencilOp,
pass_op: vk::StencilOp,
depth_fail_op: vk::StencilOp,
compare_op: vk::CompareOp,
) {
(self.fp.cmd_set_stencil_op_ext)(
command_buffer,
face_mask,
fail_op,
pass_op,
depth_fail_op,
compare_op,
)
}
}

View File

@@ -0,0 +1,61 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_extended_dynamic_state2.html>
use crate::vk;
impl crate::ext::extended_dynamic_state2::Device {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetPatchControlPointsEXT.html>
#[inline]
pub unsafe fn cmd_set_patch_control_points(
&self,
command_buffer: vk::CommandBuffer,
patch_control_points: u32,
) {
(self.fp.cmd_set_patch_control_points_ext)(command_buffer, patch_control_points)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetRasterizerDiscardEnableEXT.html>
#[inline]
pub unsafe fn cmd_set_rasterizer_discard_enable(
&self,
command_buffer: vk::CommandBuffer,
rasterizer_discard_enable: bool,
) {
(self.fp.cmd_set_rasterizer_discard_enable_ext)(
command_buffer,
rasterizer_discard_enable.into(),
)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetDepthBiasEnableEXT.html>
#[inline]
pub unsafe fn cmd_set_depth_bias_enable(
&self,
command_buffer: vk::CommandBuffer,
depth_bias_enable: bool,
) {
(self.fp.cmd_set_depth_bias_enable_ext)(command_buffer, depth_bias_enable.into())
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetLogicOpEXT.html>
#[inline]
pub unsafe fn cmd_set_logic_op(
&self,
command_buffer: vk::CommandBuffer,
logic_op: vk::LogicOp,
) {
(self.fp.cmd_set_logic_op_ext)(command_buffer, logic_op)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetPrimitiveRestartEnableEXT.html>
#[inline]
pub unsafe fn cmd_set_primitive_restart_enable(
&self,
command_buffer: vk::CommandBuffer,
primitive_restart_enable: bool,
) {
(self.fp.cmd_set_primitive_restart_enable_ext)(
command_buffer,
primitive_restart_enable.into(),
)
}
}

View File

@@ -0,0 +1,385 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_extended_dynamic_state3.html>
use crate::vk;
impl crate::ext::extended_dynamic_state3::Device {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetTessellationDomainOriginEXT.html>
#[inline]
pub unsafe fn cmd_set_tessellation_domain_origin(
&self,
command_buffer: vk::CommandBuffer,
domain_origin: vk::TessellationDomainOrigin,
) {
(self.fp.cmd_set_tessellation_domain_origin_ext)(command_buffer, domain_origin)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetDepthClampEnableEXT.html>
#[inline]
pub unsafe fn cmd_set_depth_clamp_enable(
&self,
command_buffer: vk::CommandBuffer,
depth_clamp_enable: bool,
) {
(self.fp.cmd_set_depth_clamp_enable_ext)(command_buffer, depth_clamp_enable.into())
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetPolygonModeEXT.html>
#[inline]
pub unsafe fn cmd_set_polygon_mode(
&self,
command_buffer: vk::CommandBuffer,
polygon_mode: vk::PolygonMode,
) {
(self.fp.cmd_set_polygon_mode_ext)(command_buffer, polygon_mode)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetRasterizationSamplesEXT.html>
#[inline]
pub unsafe fn cmd_set_rasterization_samples(
&self,
command_buffer: vk::CommandBuffer,
rasterization_samples: vk::SampleCountFlags,
) {
(self.fp.cmd_set_rasterization_samples_ext)(command_buffer, rasterization_samples)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetSampleMaskEXT.html>
#[inline]
pub unsafe fn cmd_set_sample_mask(
&self,
command_buffer: vk::CommandBuffer,
samples: vk::SampleCountFlags,
sample_mask: &[vk::SampleMask],
) {
assert!(
samples.as_raw().is_power_of_two(),
"Only one SampleCount bit must be set"
);
assert_eq!((samples.as_raw() as usize + 31) / 32, sample_mask.len());
(self.fp.cmd_set_sample_mask_ext)(command_buffer, samples, sample_mask.as_ptr())
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetAlphaToCoverageEnableEXT.html>
#[inline]
pub unsafe fn cmd_set_alpha_to_coverage_enable(
&self,
command_buffer: vk::CommandBuffer,
alpha_to_coverage_enable: bool,
) {
(self.fp.cmd_set_alpha_to_coverage_enable_ext)(
command_buffer,
alpha_to_coverage_enable.into(),
)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetAlphaToOneEnableEXT.html>
#[inline]
pub unsafe fn cmd_set_alpha_to_one_enable(
&self,
command_buffer: vk::CommandBuffer,
alpha_to_one_enable: bool,
) {
(self.fp.cmd_set_alpha_to_one_enable_ext)(command_buffer, alpha_to_one_enable.into())
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetLogicOpEnableEXT.html>
#[inline]
pub unsafe fn cmd_set_logic_op_enable(
&self,
command_buffer: vk::CommandBuffer,
logic_op_enable: bool,
) {
(self.fp.cmd_set_logic_op_enable_ext)(command_buffer, logic_op_enable.into())
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetColorBlendEnableEXT.html>
#[inline]
pub unsafe fn cmd_set_color_blend_enable(
&self,
command_buffer: vk::CommandBuffer,
first_attachment: u32,
color_blend_enables: &[vk::Bool32],
) {
(self.fp.cmd_set_color_blend_enable_ext)(
command_buffer,
first_attachment,
color_blend_enables.len() as u32,
color_blend_enables.as_ptr(),
)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetColorBlendEquationEXT.html>
#[inline]
pub unsafe fn cmd_set_color_blend_equation(
&self,
command_buffer: vk::CommandBuffer,
first_attachment: u32,
color_blend_equations: &[vk::ColorBlendEquationEXT],
) {
(self.fp.cmd_set_color_blend_equation_ext)(
command_buffer,
first_attachment,
color_blend_equations.len() as u32,
color_blend_equations.as_ptr(),
)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetColorWriteMaskEXT.html>
#[inline]
pub unsafe fn cmd_set_color_write_mask(
&self,
command_buffer: vk::CommandBuffer,
first_attachment: u32,
color_write_masks: &[vk::ColorComponentFlags],
) {
(self.fp.cmd_set_color_write_mask_ext)(
command_buffer,
first_attachment,
color_write_masks.len() as u32,
color_write_masks.as_ptr(),
)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetRasterizationStreamEXT.html>
#[inline]
pub unsafe fn cmd_set_rasterization_stream(
&self,
command_buffer: vk::CommandBuffer,
rasterization_stream: u32,
) {
(self.fp.cmd_set_rasterization_stream_ext)(command_buffer, rasterization_stream)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetConservativeRasterizationModeEXT.html>
#[inline]
pub unsafe fn cmd_set_conservative_rasterization_mode(
&self,
command_buffer: vk::CommandBuffer,
conservative_rasterization_mode: vk::ConservativeRasterizationModeEXT,
) {
(self.fp.cmd_set_conservative_rasterization_mode_ext)(
command_buffer,
conservative_rasterization_mode,
)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetExtraPrimitiveOverestimationSizeEXT.html>
#[inline]
pub unsafe fn cmd_set_extra_primitive_overestimation_size(
&self,
command_buffer: vk::CommandBuffer,
extra_primitive_overestimation_size: f32,
) {
(self.fp.cmd_set_extra_primitive_overestimation_size_ext)(
command_buffer,
extra_primitive_overestimation_size,
)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetDepthClipEnableEXT.html>
#[inline]
pub unsafe fn cmd_set_depth_clip_enable(
&self,
command_buffer: vk::CommandBuffer,
depth_clip_enable: bool,
) {
(self.fp.cmd_set_depth_clip_enable_ext)(command_buffer, depth_clip_enable.into())
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetSampleLocationsEnableEXT.html>
#[inline]
pub unsafe fn cmd_set_sample_locations_enable(
&self,
command_buffer: vk::CommandBuffer,
sample_locations_enable: bool,
) {
(self.fp.cmd_set_sample_locations_enable_ext)(
command_buffer,
sample_locations_enable.into(),
)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetColorBlendAdvancedEXT.html>
#[inline]
pub unsafe fn cmd_set_color_blend_advanced(
&self,
command_buffer: vk::CommandBuffer,
first_attachment: u32,
color_blend_advanced: &[vk::ColorBlendAdvancedEXT],
) {
(self.fp.cmd_set_color_blend_advanced_ext)(
command_buffer,
first_attachment,
color_blend_advanced.len() as u32,
color_blend_advanced.as_ptr(),
)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetProvokingVertexModeEXT.html>
#[inline]
pub unsafe fn cmd_set_provoking_vertex_mode(
&self,
command_buffer: vk::CommandBuffer,
provoking_vertex_mode: vk::ProvokingVertexModeEXT,
) {
(self.fp.cmd_set_provoking_vertex_mode_ext)(command_buffer, provoking_vertex_mode)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetLineRasterizationModeEXT.html>
#[inline]
pub unsafe fn cmd_set_line_rasterization_mode(
&self,
command_buffer: vk::CommandBuffer,
line_rasterization_mode: vk::LineRasterizationModeEXT,
) {
(self.fp.cmd_set_line_rasterization_mode_ext)(command_buffer, line_rasterization_mode)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetLineStippleEnableEXT.html>
#[inline]
pub unsafe fn cmd_set_line_stipple_enable(
&self,
command_buffer: vk::CommandBuffer,
stippled_line_enable: bool,
) {
(self.fp.cmd_set_line_stipple_enable_ext)(command_buffer, stippled_line_enable.into())
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetDepthClipNegativeOneToOneEXT.html>
#[inline]
pub unsafe fn cmd_set_depth_clip_negative_one_to_one(
&self,
command_buffer: vk::CommandBuffer,
negative_one_to_one: bool,
) {
(self.fp.cmd_set_depth_clip_negative_one_to_one_ext)(
command_buffer,
negative_one_to_one.into(),
)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetViewportWScalingEnableNV.html>
#[inline]
pub unsafe fn cmd_set_viewport_w_scaling_enable_nv(
&self,
command_buffer: vk::CommandBuffer,
viewport_w_scaling_enable: bool,
) {
(self.fp.cmd_set_viewport_w_scaling_enable_nv)(
command_buffer,
viewport_w_scaling_enable.into(),
)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetViewportSwizzleNV.html>
#[inline]
pub unsafe fn cmd_set_viewport_swizzle_nv(
&self,
command_buffer: vk::CommandBuffer,
first_attachment: u32,
viewport_swizzles: &[vk::ViewportSwizzleNV],
) {
(self.fp.cmd_set_viewport_swizzle_nv)(
command_buffer,
first_attachment,
viewport_swizzles.len() as u32,
viewport_swizzles.as_ptr(),
)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetCoverageToColorEnableNV.html>
#[inline]
pub unsafe fn cmd_set_coverage_to_color_enable_nv(
&self,
command_buffer: vk::CommandBuffer,
coverage_to_color_enable: bool,
) {
(self.fp.cmd_set_coverage_to_color_enable_nv)(
command_buffer,
coverage_to_color_enable.into(),
)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetCoverageToColorLocationNV.html>
#[inline]
pub unsafe fn cmd_set_coverage_to_color_location_nv(
&self,
command_buffer: vk::CommandBuffer,
coverage_to_color_location: u32,
) {
(self.fp.cmd_set_coverage_to_color_location_nv)(command_buffer, coverage_to_color_location)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetCoverageModulationModeNV.html>
#[inline]
pub unsafe fn cmd_set_coverage_modulation_mode_nv(
&self,
command_buffer: vk::CommandBuffer,
coverage_modulation_mode: vk::CoverageModulationModeNV,
) {
(self.fp.cmd_set_coverage_modulation_mode_nv)(command_buffer, coverage_modulation_mode)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetCoverageModulationTableEnableNV.html>
#[inline]
pub unsafe fn cmd_set_coverage_modulation_table_enable_nv(
&self,
command_buffer: vk::CommandBuffer,
coverage_modulation_table_enable: bool,
) {
(self.fp.cmd_set_coverage_modulation_table_enable_nv)(
command_buffer,
coverage_modulation_table_enable.into(),
)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetCoverageModulationTableNV.html>
#[inline]
pub unsafe fn cmd_set_coverage_modulation_table_nv(
&self,
command_buffer: vk::CommandBuffer,
coverage_modulation_table: &[f32],
) {
(self.fp.cmd_set_coverage_modulation_table_nv)(
command_buffer,
coverage_modulation_table.len() as u32,
coverage_modulation_table.as_ptr(),
)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetShadingRateImageEnableNV.html>
#[inline]
pub unsafe fn cmd_set_shading_rate_image_enable_nv(
&self,
command_buffer: vk::CommandBuffer,
shading_rate_image_enable: bool,
) {
(self.fp.cmd_set_shading_rate_image_enable_nv)(
command_buffer,
shading_rate_image_enable.into(),
)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetRepresentativeFragmentTestEnableNV.html>
#[inline]
pub unsafe fn cmd_set_representative_fragment_test_enable_nv(
&self,
command_buffer: vk::CommandBuffer,
representative_fragment_test_enable: bool,
) {
(self.fp.cmd_set_representative_fragment_test_enable_nv)(
command_buffer,
representative_fragment_test_enable.into(),
)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetCoverageReductionModeNV.html>
#[inline]
pub unsafe fn cmd_set_coverage_reduction_mode_nv(
&self,
command_buffer: vk::CommandBuffer,
coverage_reduction_mode: vk::CoverageReductionModeNV,
) {
(self.fp.cmd_set_coverage_reduction_mode_nv)(command_buffer, coverage_reduction_mode)
}
}

View File

@@ -0,0 +1,60 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_full_screen_exclusive.html>
use crate::prelude::*;
use crate::vk;
use alloc::vec::Vec;
use core::mem;
impl crate::ext::full_screen_exclusive::Device {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkAcquireFullScreenExclusiveModeEXT.html>
#[inline]
pub unsafe fn acquire_full_screen_exclusive_mode(
&self,
swapchain: vk::SwapchainKHR,
) -> VkResult<()> {
(self.fp.acquire_full_screen_exclusive_mode_ext)(self.handle, swapchain).result()
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkReleaseFullScreenExclusiveModeEXT.html>
#[inline]
pub unsafe fn release_full_screen_exclusive_mode(
&self,
swapchain: vk::SwapchainKHR,
) -> VkResult<()> {
(self.fp.release_full_screen_exclusive_mode_ext)(self.handle, swapchain).result()
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetDeviceGroupSurfacePresentModes2EXT.html>
#[inline]
pub unsafe fn get_device_group_surface_present_modes2(
&self,
surface_info: &vk::PhysicalDeviceSurfaceInfo2KHR<'_>,
) -> VkResult<vk::DeviceGroupPresentModeFlagsKHR> {
let mut present_modes = mem::MaybeUninit::uninit();
(self.fp.get_device_group_surface_present_modes2_ext)(
self.handle,
surface_info,
present_modes.as_mut_ptr(),
)
.assume_init_on_success(present_modes)
}
}
impl crate::ext::full_screen_exclusive::Instance {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceSurfacePresentModes2EXT.html>
#[inline]
pub unsafe fn get_physical_device_surface_present_modes2(
&self,
physical_device: vk::PhysicalDevice,
surface_info: &vk::PhysicalDeviceSurfaceInfo2KHR<'_>,
) -> VkResult<Vec<vk::PresentModeKHR>> {
read_into_uninitialized_vector(|count, data| {
(self.fp.get_physical_device_surface_present_modes2_ext)(
physical_device,
surface_info,
count,
data,
)
})
}
}

View File

@@ -0,0 +1,21 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_hdr_metadata.html>
use crate::vk;
impl crate::ext::hdr_metadata::Device {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkSetHdrMetadataEXT.html>
#[inline]
pub unsafe fn set_hdr_metadata(
&self,
swapchains: &[vk::SwapchainKHR],
metadata: &[vk::HdrMetadataEXT<'_>],
) {
assert_eq!(swapchains.len(), metadata.len());
(self.fp.set_hdr_metadata_ext)(
self.handle,
swapchains.len() as u32,
swapchains.as_ptr(),
metadata.as_ptr(),
)
}
}

View File

@@ -0,0 +1,25 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_headless_surface.html>
use crate::prelude::*;
use crate::vk;
use crate::RawPtr;
use core::mem;
impl crate::ext::headless_surface::Instance {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCreateHeadlessSurfaceEXT.html>
#[inline]
pub unsafe fn create_headless_surface(
&self,
create_info: &vk::HeadlessSurfaceCreateInfoEXT<'_>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<vk::SurfaceKHR> {
let mut surface = mem::MaybeUninit::uninit();
(self.fp.create_headless_surface_ext)(
self.handle,
create_info,
allocation_callbacks.as_raw_ptr(),
surface.as_mut_ptr(),
)
.assume_init_on_success(surface)
}
}

View File

@@ -0,0 +1,69 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_host_image_copy.html>
use crate::prelude::*;
use crate::vk;
#[cfg(doc)]
use crate::{ext, khr};
impl crate::ext::host_image_copy::Device {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCopyMemoryToImageEXT.html>
#[inline]
pub unsafe fn copy_memory_to_image(
&self,
copy_memory_to_image_info: &vk::CopyMemoryToImageInfoEXT<'_>,
) -> VkResult<()> {
(self.fp.copy_memory_to_image_ext)(self.handle, copy_memory_to_image_info).result()
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCopyImageToMemoryEXT.html>
#[inline]
pub unsafe fn copy_image_to_memory(
&self,
copy_image_to_memory_info: &vk::CopyImageToMemoryInfoEXT<'_>,
) -> VkResult<()> {
(self.fp.copy_image_to_memory_ext)(self.handle, copy_image_to_memory_info).result()
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCopyImageToImageEXT.html>
#[inline]
pub unsafe fn copy_image_to_image(
&self,
copy_image_to_image_info: &vk::CopyImageToImageInfoEXT<'_>,
) -> VkResult<()> {
(self.fp.copy_image_to_image_ext)(self.handle, copy_image_to_image_info).result()
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkTransitionImageLayoutEXT.html>
#[inline]
pub unsafe fn transition_image_layout(
&self,
transitions: &[vk::HostImageLayoutTransitionInfoEXT<'_>],
) -> VkResult<()> {
(self.fp.transition_image_layout_ext)(
self.handle,
transitions.len() as u32,
transitions.as_ptr(),
)
.result()
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetImageSubresourceLayout2EXT.html>
///
/// Also available as [`khr::maintenance5::Device::get_image_subresource_layout2()`]
/// when [`VK_KHR_maintenance5`] is enabled.
///
/// Also available as [`ext::image_compression_control::Device::get_image_subresource_layout2()`]
/// when [`VK_EXT_image_compression_control`] is enabled.
///
/// [`VK_KHR_maintenance5`]: https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_maintenance5.html
/// [`VK_EXT_image_compression_control`]: https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_image_compression_control.html
#[inline]
pub unsafe fn get_image_subresource_layout2(
&self,
image: vk::Image,
subresource: &vk::ImageSubresource2EXT<'_>,
layout: &mut vk::SubresourceLayout2EXT<'_>,
) {
(self.fp.get_image_subresource_layout2_ext)(self.handle, image, subresource, layout)
}
}

View File

@@ -0,0 +1,27 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_image_compression_control.html>
use crate::vk;
#[cfg(doc)]
use crate::{ext, khr};
impl crate::ext::image_compression_control::Device {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetImageSubresourceLayout2EXT.html>
///
/// Also available as [`khr::maintenance5::Device::get_image_subresource_layout2()`]
/// when [`VK_KHR_maintenance5`] is enabled.
///
/// Also available as [`ext::host_image_copy::Device::get_image_subresource_layout2()`]
/// when [`VK_EXT_host_image_copy`] is enabled.
///
/// [`VK_KHR_maintenance5`]: https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_maintenance5.html
/// [`VK_EXT_host_image_copy`]: https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_host_image_copy.html
#[inline]
pub unsafe fn get_image_subresource_layout2(
&self,
image: vk::Image,
subresource: &vk::ImageSubresource2EXT<'_>,
layout: &mut vk::SubresourceLayout2EXT<'_>,
) {
(self.fp.get_image_subresource_layout2_ext)(self.handle, image, subresource, layout)
}
}

View File

@@ -0,0 +1,17 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_image_drm_format_modifier.html>
use crate::prelude::*;
use crate::vk;
impl crate::ext::image_drm_format_modifier::Device {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetImageDrmFormatModifierPropertiesEXT.html>
#[inline]
pub unsafe fn get_image_drm_format_modifier_properties(
&self,
image: vk::Image,
properties: &mut vk::ImageDrmFormatModifierPropertiesEXT<'_>,
) -> VkResult<()> {
(self.fp.get_image_drm_format_modifier_properties_ext)(self.handle, image, properties)
.result()
}
}

View File

@@ -0,0 +1,70 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_mesh_shader.html>
use crate::vk;
impl crate::ext::mesh_shader::Device {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdDrawMeshTasksEXT.html>
#[inline]
pub unsafe fn cmd_draw_mesh_tasks(
&self,
command_buffer: vk::CommandBuffer,
group_count_x: u32,
group_count_y: u32,
group_count_z: u32,
) {
(self.fp.cmd_draw_mesh_tasks_ext)(
command_buffer,
group_count_x,
group_count_y,
group_count_z,
)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdDrawMeshTasksIndirectEXT.html>
///
/// `buffer` contains `draw_count` [`vk::DrawMeshTasksIndirectCommandEXT`] structures starting at `offset` in bytes, holding the draw parameters.
#[inline]
pub unsafe fn cmd_draw_mesh_tasks_indirect(
&self,
command_buffer: vk::CommandBuffer,
buffer: vk::Buffer,
offset: vk::DeviceSize,
draw_count: u32,
stride: u32,
) {
(self.fp.cmd_draw_mesh_tasks_indirect_ext)(
command_buffer,
buffer,
offset,
draw_count,
stride,
)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdDrawMeshTasksIndirectCountEXT.html>
///
/// `buffer` contains a maximum of `max_draw_count` [`vk::DrawMeshTasksIndirectCommandEXT`] structures starting at `offset` in bytes, holding the draw parameters.
/// `count_buffer` is the buffer containing the draw count, starting at `count_buffer_offset` in bytes.
/// The actual number of executed draw calls is the minimum of the count specified in `count_buffer` and `max_draw_count`.
#[inline]
pub unsafe fn cmd_draw_mesh_tasks_indirect_count(
&self,
command_buffer: vk::CommandBuffer,
buffer: vk::Buffer,
offset: vk::DeviceSize,
count_buffer: vk::Buffer,
count_buffer_offset: vk::DeviceSize,
max_draw_count: u32,
stride: u32,
) {
(self.fp.cmd_draw_mesh_tasks_indirect_count_ext)(
command_buffer,
buffer,
offset,
count_buffer,
count_buffer_offset,
max_draw_count,
stride,
)
}
}

View File

@@ -0,0 +1,25 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_metal_surface.html>
use crate::prelude::*;
use crate::vk;
use crate::RawPtr;
use core::mem;
impl crate::ext::metal_surface::Instance {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCreateMetalSurfaceEXT.html>
#[inline]
pub unsafe fn create_metal_surface(
&self,
create_info: &vk::MetalSurfaceCreateInfoEXT<'_>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<vk::SurfaceKHR> {
let mut surface = mem::MaybeUninit::uninit();
(self.fp.create_metal_surface_ext)(
self.handle,
create_info,
allocation_callbacks.as_raw_ptr(),
surface.as_mut_ptr(),
)
.assume_init_on_success(surface)
}
}

27
vendor/ash/src/extensions/ext/mod.rs vendored Normal file
View File

@@ -0,0 +1,27 @@
pub mod acquire_drm_display;
pub mod buffer_device_address;
pub mod calibrated_timestamps;
#[deprecated(note = "Please use the [DebugUtils](struct.DebugUtils.html) extension instead.")]
pub mod debug_marker;
#[deprecated(note = "Please use the [DebugUtils](struct.DebugUtils.html) extension instead.")]
pub mod debug_report;
pub mod debug_utils;
pub mod descriptor_buffer;
pub mod extended_dynamic_state;
pub mod extended_dynamic_state2;
pub mod extended_dynamic_state3;
pub mod full_screen_exclusive;
pub mod hdr_metadata;
pub mod headless_surface;
pub mod host_image_copy;
pub mod image_compression_control;
pub mod image_drm_format_modifier;
pub mod mesh_shader;
pub mod metal_surface;
pub mod pipeline_properties;
pub mod private_data;
pub mod sample_locations;
pub mod shader_object;
pub mod swapchain_maintenance1;
pub mod tooling_info;
pub mod vertex_input_dynamic_state;

View File

@@ -0,0 +1,21 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_pipeline_properties.html>
use crate::prelude::*;
use crate::vk;
impl crate::ext::pipeline_properties::Device {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetPipelinePropertiesEXT.html>
#[inline]
pub unsafe fn get_pipeline_properties(
&self,
pipeline_info: &vk::PipelineInfoEXT<'_>,
pipeline_properties: &mut impl crate::ext::pipeline_properties::GetPipelinePropertiesEXTParamPipelineProperties,
) -> VkResult<()> {
(self.fp.get_pipeline_properties_ext)(
self.handle,
pipeline_info,
<*mut _>::cast(pipeline_properties),
)
.result()
}
}

View File

@@ -0,0 +1,75 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_private_data.html>
use crate::prelude::*;
use crate::vk;
use crate::RawPtr;
use core::mem;
impl crate::ext::private_data::Device {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCreatePrivateDataSlotEXT.html>
#[inline]
pub unsafe fn create_private_data_slot(
&self,
create_info: &vk::PrivateDataSlotCreateInfoEXT<'_>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<vk::PrivateDataSlotEXT> {
let mut private_data_slot = mem::MaybeUninit::uninit();
(self.fp.create_private_data_slot_ext)(
self.handle,
create_info,
allocation_callbacks.as_raw_ptr(),
private_data_slot.as_mut_ptr(),
)
.assume_init_on_success(private_data_slot)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkDestroyPrivateDataSlotEXT.html>
#[inline]
pub unsafe fn destroy_private_data_slot(
&self,
private_data_slot: vk::PrivateDataSlotEXT,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) {
(self.fp.destroy_private_data_slot_ext)(
self.handle,
private_data_slot,
allocation_callbacks.as_raw_ptr(),
)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkSetPrivateDataEXT.html>
#[inline]
pub unsafe fn set_private_data<T: vk::Handle>(
&self,
object: T,
private_data_slot: vk::PrivateDataSlotEXT,
data: u64,
) -> VkResult<()> {
(self.fp.set_private_data_ext)(
self.handle,
T::TYPE,
object.as_raw(),
private_data_slot,
data,
)
.result()
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetPrivateDataEXT.html>
#[inline]
pub unsafe fn get_private_data<T: vk::Handle>(
&self,
object: T,
private_data_slot: vk::PrivateDataSlotEXT,
) -> u64 {
let mut data = mem::MaybeUninit::uninit();
(self.fp.get_private_data_ext)(
self.handle,
T::TYPE,
object.as_raw(),
private_data_slot,
data.as_mut_ptr(),
);
data.assume_init()
}
}

View File

@@ -0,0 +1,32 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_sample_locations.html>
use crate::vk;
impl crate::ext::sample_locations::Device {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetSampleLocationsEXT.html>
#[inline]
pub unsafe fn cmd_set_sample_locations(
&self,
command_buffer: vk::CommandBuffer,
sample_locations_info: &vk::SampleLocationsInfoEXT<'_>,
) {
(self.fp.cmd_set_sample_locations_ext)(command_buffer, sample_locations_info)
}
}
impl crate::ext::sample_locations::Instance {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceMultisamplePropertiesEXT.html>
#[inline]
pub unsafe fn get_physical_device_multisample_properties(
&self,
physical_device: vk::PhysicalDevice,
samples: vk::SampleCountFlags,
multisample_properties: &mut vk::MultisamplePropertiesEXT<'_>,
) {
(self.fp.get_physical_device_multisample_properties_ext)(
physical_device,
samples,
multisample_properties,
)
}
}

View File

@@ -0,0 +1,701 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_shader_object.html>
use crate::prelude::*;
use crate::vk;
use crate::RawPtr;
use alloc::vec::Vec;
use core::ptr;
impl crate::ext::shader_object::Device {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCreateShadersEXT.html>
///
/// When this function returns, whether or not it succeeds, it is guaranteed that every returned
/// element is either [`vk::ShaderEXT::null()`] or a valid [`vk::ShaderEXT`] handle.
///
/// This means that whenever shader creation fails, the application can determine which shader
/// the returned error pertains to by locating the first [`vk::Handle::is_null()`] element
/// in the returned [`Vec`]. It also means that an application can reliably clean up from a
/// failed call by iterating over the returned [`Vec`] and destroying every element that is not
/// [`vk::Handle::is_null()`].
#[inline]
pub unsafe fn create_shaders(
&self,
create_infos: &[vk::ShaderCreateInfoEXT<'_>],
allocator: Option<&vk::AllocationCallbacks<'_>>,
) -> Result<Vec<vk::ShaderEXT>, (Vec<vk::ShaderEXT>, vk::Result)> {
let mut shaders = Vec::with_capacity(create_infos.len());
let err_code = (self.fp.create_shaders_ext)(
self.handle,
create_infos.len() as u32,
create_infos.as_ptr(),
allocator.as_raw_ptr(),
shaders.as_mut_ptr(),
);
shaders.set_len(create_infos.len());
match err_code {
vk::Result::SUCCESS => Ok(shaders),
_ => Err((shaders, err_code)),
}
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkDestroyShaderEXT.html>
#[inline]
pub unsafe fn destroy_shader(
&self,
shader: vk::ShaderEXT,
allocator: Option<&vk::AllocationCallbacks<'_>>,
) {
(self.fp.destroy_shader_ext)(self.handle, shader, allocator.as_raw_ptr())
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetShaderBinaryDataEXT.html>
#[inline]
pub unsafe fn get_shader_binary_data(&self, shader: vk::ShaderEXT) -> VkResult<Vec<u8>> {
read_into_uninitialized_vector(|count, data: *mut u8| {
(self.fp.get_shader_binary_data_ext)(self.handle, shader, count, data.cast())
})
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdBindShadersEXT.html>
#[inline]
pub unsafe fn cmd_bind_shaders(
&self,
command_buffer: vk::CommandBuffer,
stages: &[vk::ShaderStageFlags],
shaders: &[vk::ShaderEXT],
) {
assert_eq!(stages.len(), shaders.len());
(self.fp.cmd_bind_shaders_ext)(
command_buffer,
stages.len() as u32,
stages.as_ptr(),
shaders.as_ptr(),
)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetVertexInputEXT.html>
#[inline]
pub unsafe fn cmd_set_vertex_input(
&self,
command_buffer: vk::CommandBuffer,
vertex_binding_descriptions: &[vk::VertexInputBindingDescription2EXT<'_>],
vertex_attribute_descriptions: &[vk::VertexInputAttributeDescription2EXT<'_>],
) {
(self.fp.cmd_set_vertex_input_ext)(
command_buffer,
vertex_binding_descriptions.len() as u32,
vertex_binding_descriptions.as_ptr(),
vertex_attribute_descriptions.len() as u32,
vertex_attribute_descriptions.as_ptr(),
)
}
// --- extended_dynamic_state functions ---
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetCullModeEXT.html>
#[inline]
pub unsafe fn cmd_set_cull_mode(
&self,
command_buffer: vk::CommandBuffer,
cull_mode: vk::CullModeFlags,
) {
(self.fp.cmd_set_cull_mode_ext)(command_buffer, cull_mode)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetFrontFaceEXT.html>
#[inline]
pub unsafe fn cmd_set_front_face(
&self,
command_buffer: vk::CommandBuffer,
front_face: vk::FrontFace,
) {
(self.fp.cmd_set_front_face_ext)(command_buffer, front_face)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetPrimitiveTopologyEXT.html>
#[inline]
pub unsafe fn cmd_set_primitive_topology(
&self,
command_buffer: vk::CommandBuffer,
primitive_topology: vk::PrimitiveTopology,
) {
(self.fp.cmd_set_primitive_topology_ext)(command_buffer, primitive_topology)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetViewportWithCountEXT.html>
#[inline]
pub unsafe fn cmd_set_viewport_with_count(
&self,
command_buffer: vk::CommandBuffer,
viewports: &[vk::Viewport],
) {
(self.fp.cmd_set_viewport_with_count_ext)(
command_buffer,
viewports.len() as u32,
viewports.as_ptr(),
)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetScissorWithCountEXT.html>
#[inline]
pub unsafe fn cmd_set_scissor_with_count(
&self,
command_buffer: vk::CommandBuffer,
scissors: &[vk::Rect2D],
) {
(self.fp.cmd_set_scissor_with_count_ext)(
command_buffer,
scissors.len() as u32,
scissors.as_ptr(),
)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdBindVertexBuffers2EXT.html>
#[inline]
pub unsafe fn cmd_bind_vertex_buffers2(
&self,
command_buffer: vk::CommandBuffer,
first_binding: u32,
buffers: &[vk::Buffer],
offsets: &[vk::DeviceSize],
sizes: Option<&[vk::DeviceSize]>,
strides: Option<&[vk::DeviceSize]>,
) {
assert_eq!(offsets.len(), buffers.len());
let p_sizes = if let Some(sizes) = sizes {
assert_eq!(sizes.len(), buffers.len());
sizes.as_ptr()
} else {
ptr::null()
};
let p_strides = if let Some(strides) = strides {
assert_eq!(strides.len(), buffers.len());
strides.as_ptr()
} else {
ptr::null()
};
(self.fp.cmd_bind_vertex_buffers2_ext)(
command_buffer,
first_binding,
buffers.len() as u32,
buffers.as_ptr(),
offsets.as_ptr(),
p_sizes,
p_strides,
)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetDepthTestEnableEXT.html>
#[inline]
pub unsafe fn cmd_set_depth_test_enable(
&self,
command_buffer: vk::CommandBuffer,
depth_test_enable: bool,
) {
(self.fp.cmd_set_depth_test_enable_ext)(command_buffer, depth_test_enable.into())
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetDepthWriteEnableEXT.html>
#[inline]
pub unsafe fn cmd_set_depth_write_enable(
&self,
command_buffer: vk::CommandBuffer,
depth_write_enable: bool,
) {
(self.fp.cmd_set_depth_write_enable_ext)(command_buffer, depth_write_enable.into())
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetDepthCompareOpEXT.html>
#[inline]
pub unsafe fn cmd_set_depth_compare_op(
&self,
command_buffer: vk::CommandBuffer,
depth_compare_op: vk::CompareOp,
) {
(self.fp.cmd_set_depth_compare_op_ext)(command_buffer, depth_compare_op)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetDepthBoundsTestEnableEXT.html>
#[inline]
pub unsafe fn cmd_set_depth_bounds_test_enable(
&self,
command_buffer: vk::CommandBuffer,
depth_bounds_test_enable: bool,
) {
(self.fp.cmd_set_depth_bounds_test_enable_ext)(
command_buffer,
depth_bounds_test_enable.into(),
)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetStencilTestEnableEXT.html>
#[inline]
pub unsafe fn cmd_set_stencil_test_enable(
&self,
command_buffer: vk::CommandBuffer,
stencil_test_enable: bool,
) {
(self.fp.cmd_set_stencil_test_enable_ext)(command_buffer, stencil_test_enable.into())
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetStencilOpEXT.html>
#[inline]
pub unsafe fn cmd_set_stencil_op(
&self,
command_buffer: vk::CommandBuffer,
face_mask: vk::StencilFaceFlags,
fail_op: vk::StencilOp,
pass_op: vk::StencilOp,
depth_fail_op: vk::StencilOp,
compare_op: vk::CompareOp,
) {
(self.fp.cmd_set_stencil_op_ext)(
command_buffer,
face_mask,
fail_op,
pass_op,
depth_fail_op,
compare_op,
)
}
// --- extended_dynamic_state2 functions ---
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetPatchControlPointsEXT.html>
#[inline]
pub unsafe fn cmd_set_patch_control_points(
&self,
command_buffer: vk::CommandBuffer,
patch_control_points: u32,
) {
(self.fp.cmd_set_patch_control_points_ext)(command_buffer, patch_control_points)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetRasterizerDiscardEnableEXT.html>
#[inline]
pub unsafe fn cmd_set_rasterizer_discard_enable(
&self,
command_buffer: vk::CommandBuffer,
rasterizer_discard_enable: bool,
) {
(self.fp.cmd_set_rasterizer_discard_enable_ext)(
command_buffer,
rasterizer_discard_enable.into(),
)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetDepthBiasEnableEXT.html>
#[inline]
pub unsafe fn cmd_set_depth_bias_enable(
&self,
command_buffer: vk::CommandBuffer,
depth_bias_enable: bool,
) {
(self.fp.cmd_set_depth_bias_enable_ext)(command_buffer, depth_bias_enable.into())
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetLogicOpEXT.html>
#[inline]
pub unsafe fn cmd_set_logic_op(
&self,
command_buffer: vk::CommandBuffer,
logic_op: vk::LogicOp,
) {
(self.fp.cmd_set_logic_op_ext)(command_buffer, logic_op)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetPrimitiveRestartEnableEXT.html>
#[inline]
pub unsafe fn cmd_set_primitive_restart_enable(
&self,
command_buffer: vk::CommandBuffer,
primitive_restart_enable: bool,
) {
(self.fp.cmd_set_primitive_restart_enable_ext)(
command_buffer,
primitive_restart_enable.into(),
)
}
// --- extended_dynamic_state3 functions ---
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetTessellationDomainOriginEXT.html>
#[inline]
pub unsafe fn cmd_set_tessellation_domain_origin(
&self,
command_buffer: vk::CommandBuffer,
domain_origin: vk::TessellationDomainOrigin,
) {
(self.fp.cmd_set_tessellation_domain_origin_ext)(command_buffer, domain_origin)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetDepthClampEnableEXT.html>
#[inline]
pub unsafe fn cmd_set_depth_clamp_enable(
&self,
command_buffer: vk::CommandBuffer,
depth_clamp_enable: bool,
) {
(self.fp.cmd_set_depth_clamp_enable_ext)(command_buffer, depth_clamp_enable.into())
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetPolygonModeEXT.html>
#[inline]
pub unsafe fn cmd_set_polygon_mode(
&self,
command_buffer: vk::CommandBuffer,
polygon_mode: vk::PolygonMode,
) {
(self.fp.cmd_set_polygon_mode_ext)(command_buffer, polygon_mode)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetRasterizationSamplesEXT.html>
#[inline]
pub unsafe fn cmd_set_rasterization_samples(
&self,
command_buffer: vk::CommandBuffer,
rasterization_samples: vk::SampleCountFlags,
) {
(self.fp.cmd_set_rasterization_samples_ext)(command_buffer, rasterization_samples)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetSampleMaskEXT.html>
#[inline]
pub unsafe fn cmd_set_sample_mask(
&self,
command_buffer: vk::CommandBuffer,
samples: vk::SampleCountFlags,
sample_mask: &[vk::SampleMask],
) {
assert!(
samples.as_raw().is_power_of_two(),
"Only one SampleCount bit must be set"
);
assert_eq!((samples.as_raw() as usize + 31) / 32, sample_mask.len());
(self.fp.cmd_set_sample_mask_ext)(command_buffer, samples, sample_mask.as_ptr())
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetAlphaToCoverageEnableEXT.html>
#[inline]
pub unsafe fn cmd_set_alpha_to_coverage_enable(
&self,
command_buffer: vk::CommandBuffer,
alpha_to_coverage_enable: bool,
) {
(self.fp.cmd_set_alpha_to_coverage_enable_ext)(
command_buffer,
alpha_to_coverage_enable.into(),
)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetAlphaToOneEnableEXT.html>
#[inline]
pub unsafe fn cmd_set_alpha_to_one_enable(
&self,
command_buffer: vk::CommandBuffer,
alpha_to_one_enable: bool,
) {
(self.fp.cmd_set_alpha_to_one_enable_ext)(command_buffer, alpha_to_one_enable.into())
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetLogicOpEnableEXT.html>
#[inline]
pub unsafe fn cmd_set_logic_op_enable(
&self,
command_buffer: vk::CommandBuffer,
logic_op_enable: bool,
) {
(self.fp.cmd_set_logic_op_enable_ext)(command_buffer, logic_op_enable.into())
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetColorBlendEnableEXT.html>
#[inline]
pub unsafe fn cmd_set_color_blend_enable(
&self,
command_buffer: vk::CommandBuffer,
first_attachment: u32,
color_blend_enables: &[vk::Bool32],
) {
(self.fp.cmd_set_color_blend_enable_ext)(
command_buffer,
first_attachment,
color_blend_enables.len() as u32,
color_blend_enables.as_ptr(),
)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetColorBlendEquationEXT.html>
#[inline]
pub unsafe fn cmd_set_color_blend_equation(
&self,
command_buffer: vk::CommandBuffer,
first_attachment: u32,
color_blend_equations: &[vk::ColorBlendEquationEXT],
) {
(self.fp.cmd_set_color_blend_equation_ext)(
command_buffer,
first_attachment,
color_blend_equations.len() as u32,
color_blend_equations.as_ptr(),
)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetColorWriteMaskEXT.html>
#[inline]
pub unsafe fn cmd_set_color_write_mask(
&self,
command_buffer: vk::CommandBuffer,
first_attachment: u32,
color_write_masks: &[vk::ColorComponentFlags],
) {
(self.fp.cmd_set_color_write_mask_ext)(
command_buffer,
first_attachment,
color_write_masks.len() as u32,
color_write_masks.as_ptr(),
)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetRasterizationStreamEXT.html>
#[inline]
pub unsafe fn cmd_set_rasterization_stream(
&self,
command_buffer: vk::CommandBuffer,
rasterization_stream: u32,
) {
(self.fp.cmd_set_rasterization_stream_ext)(command_buffer, rasterization_stream)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetConservativeRasterizationModeEXT.html>
#[inline]
pub unsafe fn cmd_set_conservative_rasterization_mode(
&self,
command_buffer: vk::CommandBuffer,
conservative_rasterization_mode: vk::ConservativeRasterizationModeEXT,
) {
(self.fp.cmd_set_conservative_rasterization_mode_ext)(
command_buffer,
conservative_rasterization_mode,
)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetExtraPrimitiveOverestimationSizeEXT.html>
#[inline]
pub unsafe fn cmd_set_extra_primitive_overestimation_size(
&self,
command_buffer: vk::CommandBuffer,
extra_primitive_overestimation_size: f32,
) {
(self.fp.cmd_set_extra_primitive_overestimation_size_ext)(
command_buffer,
extra_primitive_overestimation_size,
)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetDepthClipEnableEXT.html>
#[inline]
pub unsafe fn cmd_set_depth_clip_enable(
&self,
command_buffer: vk::CommandBuffer,
depth_clip_enable: bool,
) {
(self.fp.cmd_set_depth_clip_enable_ext)(command_buffer, depth_clip_enable.into())
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetSampleLocationsEnableEXT.html>
#[inline]
pub unsafe fn cmd_set_sample_locations_enable(
&self,
command_buffer: vk::CommandBuffer,
sample_locations_enable: bool,
) {
(self.fp.cmd_set_sample_locations_enable_ext)(
command_buffer,
sample_locations_enable.into(),
)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetColorBlendAdvancedEXT.html>
#[inline]
pub unsafe fn cmd_set_color_blend_advanced(
&self,
command_buffer: vk::CommandBuffer,
first_attachment: u32,
color_blend_advanced: &[vk::ColorBlendAdvancedEXT],
) {
(self.fp.cmd_set_color_blend_advanced_ext)(
command_buffer,
first_attachment,
color_blend_advanced.len() as u32,
color_blend_advanced.as_ptr(),
)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetProvokingVertexModeEXT.html>
#[inline]
pub unsafe fn cmd_set_provoking_vertex_mode(
&self,
command_buffer: vk::CommandBuffer,
provoking_vertex_mode: vk::ProvokingVertexModeEXT,
) {
(self.fp.cmd_set_provoking_vertex_mode_ext)(command_buffer, provoking_vertex_mode)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetLineRasterizationModeEXT.html>
#[inline]
pub unsafe fn cmd_set_line_rasterization_mode(
&self,
command_buffer: vk::CommandBuffer,
line_rasterization_mode: vk::LineRasterizationModeEXT,
) {
(self.fp.cmd_set_line_rasterization_mode_ext)(command_buffer, line_rasterization_mode)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetLineStippleEnableEXT.html>
#[inline]
pub unsafe fn cmd_set_line_stipple_enable(
&self,
command_buffer: vk::CommandBuffer,
stippled_line_enable: bool,
) {
(self.fp.cmd_set_line_stipple_enable_ext)(command_buffer, stippled_line_enable.into())
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetDepthClipNegativeOneToOneEXT.html>
#[inline]
pub unsafe fn cmd_set_depth_clip_negative_one_to_one(
&self,
command_buffer: vk::CommandBuffer,
negative_one_to_one: bool,
) {
(self.fp.cmd_set_depth_clip_negative_one_to_one_ext)(
command_buffer,
negative_one_to_one.into(),
)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetViewportWScalingEnableNV.html>
#[inline]
pub unsafe fn cmd_set_viewport_w_scaling_enable_nv(
&self,
command_buffer: vk::CommandBuffer,
viewport_w_scaling_enable: bool,
) {
(self.fp.cmd_set_viewport_w_scaling_enable_nv)(
command_buffer,
viewport_w_scaling_enable.into(),
)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetViewportSwizzleNV.html>
#[inline]
pub unsafe fn cmd_set_viewport_swizzle_nv(
&self,
command_buffer: vk::CommandBuffer,
first_attachment: u32,
viewport_swizzles: &[vk::ViewportSwizzleNV],
) {
(self.fp.cmd_set_viewport_swizzle_nv)(
command_buffer,
first_attachment,
viewport_swizzles.len() as u32,
viewport_swizzles.as_ptr(),
)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetCoverageToColorEnableNV.html>
#[inline]
pub unsafe fn cmd_set_coverage_to_color_enable_nv(
&self,
command_buffer: vk::CommandBuffer,
coverage_to_color_enable: bool,
) {
(self.fp.cmd_set_coverage_to_color_enable_nv)(
command_buffer,
coverage_to_color_enable.into(),
)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetCoverageToColorLocationNV.html>
#[inline]
pub unsafe fn cmd_set_coverage_to_color_location_nv(
&self,
command_buffer: vk::CommandBuffer,
coverage_to_color_location: u32,
) {
(self.fp.cmd_set_coverage_to_color_location_nv)(command_buffer, coverage_to_color_location)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetCoverageModulationModeNV.html>
#[inline]
pub unsafe fn cmd_set_coverage_modulation_mode_nv(
&self,
command_buffer: vk::CommandBuffer,
coverage_modulation_mode: vk::CoverageModulationModeNV,
) {
(self.fp.cmd_set_coverage_modulation_mode_nv)(command_buffer, coverage_modulation_mode)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetCoverageModulationTableEnableNV.html>
#[inline]
pub unsafe fn cmd_set_coverage_modulation_table_enable_nv(
&self,
command_buffer: vk::CommandBuffer,
coverage_modulation_table_enable: bool,
) {
(self.fp.cmd_set_coverage_modulation_table_enable_nv)(
command_buffer,
coverage_modulation_table_enable.into(),
)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetCoverageModulationTableNV.html>
#[inline]
pub unsafe fn cmd_set_coverage_modulation_table_nv(
&self,
command_buffer: vk::CommandBuffer,
coverage_modulation_table: &[f32],
) {
(self.fp.cmd_set_coverage_modulation_table_nv)(
command_buffer,
coverage_modulation_table.len() as u32,
coverage_modulation_table.as_ptr(),
)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetShadingRateImageEnableNV.html>
#[inline]
pub unsafe fn cmd_set_shading_rate_image_enable_nv(
&self,
command_buffer: vk::CommandBuffer,
shading_rate_image_enable: bool,
) {
(self.fp.cmd_set_shading_rate_image_enable_nv)(
command_buffer,
shading_rate_image_enable.into(),
)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetRepresentativeFragmentTestEnableNV.html>
#[inline]
pub unsafe fn cmd_set_representative_fragment_test_enable_nv(
&self,
command_buffer: vk::CommandBuffer,
representative_fragment_test_enable: bool,
) {
(self.fp.cmd_set_representative_fragment_test_enable_nv)(
command_buffer,
representative_fragment_test_enable.into(),
)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetCoverageReductionModeNV.html>
#[inline]
pub unsafe fn cmd_set_coverage_reduction_mode_nv(
&self,
command_buffer: vk::CommandBuffer,
coverage_reduction_mode: vk::CoverageReductionModeNV,
) {
(self.fp.cmd_set_coverage_reduction_mode_nv)(command_buffer, coverage_reduction_mode)
}
}

View File

@@ -0,0 +1,15 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_swapchain_maintenance1.html>
use crate::prelude::*;
use crate::vk;
impl crate::ext::swapchain_maintenance1::Device {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkReleaseSwapchainImagesEXT.html>
#[inline]
pub unsafe fn release_swapchain_images(
&self,
release_info: &vk::ReleaseSwapchainImagesInfoEXT<'_>,
) -> VkResult<()> {
(self.fp.release_swapchain_images_ext)(self.handle, release_info).result()
}
}

View File

@@ -0,0 +1,18 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_tooling_info.html>
use crate::prelude::*;
use crate::vk;
use alloc::vec::Vec;
impl crate::ext::tooling_info::Instance {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceToolPropertiesEXT.html>
#[inline]
pub unsafe fn get_physical_device_tool_properties(
&self,
physical_device: vk::PhysicalDevice,
) -> VkResult<Vec<vk::PhysicalDeviceToolPropertiesEXT<'_>>> {
read_into_defaulted_vector(|count, data| {
(self.fp.get_physical_device_tool_properties_ext)(physical_device, count, data)
})
}
}

View File

@@ -0,0 +1,22 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_vertex_input_dynamic_state.html>
use crate::vk;
impl crate::ext::vertex_input_dynamic_state::Device {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetVertexInputEXT.html>
#[inline]
pub unsafe fn cmd_set_vertex_input(
&self,
command_buffer: vk::CommandBuffer,
vertex_binding_descriptions: &[vk::VertexInputBindingDescription2EXT<'_>],
vertex_attribute_descriptions: &[vk::VertexInputAttributeDescription2EXT<'_>],
) {
(self.fp.cmd_set_vertex_input_ext)(
command_buffer,
vertex_binding_descriptions.len() as u32,
vertex_binding_descriptions.as_ptr(),
vertex_attribute_descriptions.len() as u32,
vertex_attribute_descriptions.as_ptr(),
)
}
}

View File

@@ -0,0 +1,30 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_GOOGLE_display_timing.html>
use crate::prelude::*;
use crate::vk;
use alloc::vec::Vec;
use core::mem;
impl crate::google::display_timing::Device {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetPastPresentationTimingGOOGLE.html>
#[inline]
pub unsafe fn get_past_presentation_timing(
&self,
swapchain: vk::SwapchainKHR,
) -> VkResult<Vec<vk::PastPresentationTimingGOOGLE>> {
read_into_uninitialized_vector(|count, data| {
(self.fp.get_past_presentation_timing_google)(self.handle, swapchain, count, data)
})
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetRefreshCycleDurationGOOGLE.html>
#[inline]
pub unsafe fn get_refresh_cycle_duration(
&self,
swapchain: vk::SwapchainKHR,
) -> VkResult<vk::RefreshCycleDurationGOOGLE> {
let mut properties = mem::MaybeUninit::uninit();
(self.fp.get_refresh_cycle_duration_google)(self.handle, swapchain, properties.as_mut_ptr())
.assume_init_on_success(properties)
}
}

View File

@@ -0,0 +1 @@
pub mod display_timing;

View File

@@ -0,0 +1,276 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_acceleration_structure.html>
use crate::prelude::*;
use crate::vk;
use crate::RawPtr;
use alloc::vec::Vec;
use core::mem;
impl crate::khr::acceleration_structure::Device {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCreateAccelerationStructureKHR.html>
#[inline]
pub unsafe fn create_acceleration_structure(
&self,
create_info: &vk::AccelerationStructureCreateInfoKHR<'_>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<vk::AccelerationStructureKHR> {
let mut accel_struct = mem::MaybeUninit::uninit();
(self.fp.create_acceleration_structure_khr)(
self.handle,
create_info,
allocation_callbacks.as_raw_ptr(),
accel_struct.as_mut_ptr(),
)
.assume_init_on_success(accel_struct)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkDestroyAccelerationStructureKHR.html>
#[inline]
pub unsafe fn destroy_acceleration_structure(
&self,
accel_struct: vk::AccelerationStructureKHR,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) {
(self.fp.destroy_acceleration_structure_khr)(
self.handle,
accel_struct,
allocation_callbacks.as_raw_ptr(),
);
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdBuildAccelerationStructuresKHR.html>
#[inline]
pub unsafe fn cmd_build_acceleration_structures(
&self,
command_buffer: vk::CommandBuffer,
infos: &[vk::AccelerationStructureBuildGeometryInfoKHR<'_>],
build_range_infos: &[&[vk::AccelerationStructureBuildRangeInfoKHR]],
) {
assert_eq!(infos.len(), build_range_infos.len());
let build_range_infos = build_range_infos
.iter()
.zip(infos.iter())
.map(|(range_info, info)| {
assert_eq!(range_info.len(), info.geometry_count as usize);
range_info.as_ptr()
})
.collect::<Vec<_>>();
(self.fp.cmd_build_acceleration_structures_khr)(
command_buffer,
infos.len() as _,
infos.as_ptr(),
build_range_infos.as_ptr(),
);
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdBuildAccelerationStructuresIndirectKHR.html>
#[inline]
pub unsafe fn cmd_build_acceleration_structures_indirect(
&self,
command_buffer: vk::CommandBuffer,
infos: &[vk::AccelerationStructureBuildGeometryInfoKHR<'_>],
indirect_device_addresses: &[vk::DeviceAddress],
indirect_strides: &[u32],
max_primitive_counts: &[&[u32]],
) {
assert_eq!(infos.len(), indirect_device_addresses.len());
assert_eq!(infos.len(), indirect_strides.len());
assert_eq!(infos.len(), max_primitive_counts.len());
let max_primitive_counts = max_primitive_counts
.iter()
.zip(infos.iter())
.map(|(cnt, info)| {
assert_eq!(cnt.len(), info.geometry_count as usize);
cnt.as_ptr()
})
.collect::<Vec<_>>();
(self.fp.cmd_build_acceleration_structures_indirect_khr)(
command_buffer,
infos.len() as _,
infos.as_ptr(),
indirect_device_addresses.as_ptr(),
indirect_strides.as_ptr(),
max_primitive_counts.as_ptr(),
);
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkBuildAccelerationStructuresKHR.html>
#[inline]
pub unsafe fn build_acceleration_structures(
&self,
deferred_operation: vk::DeferredOperationKHR,
infos: &[vk::AccelerationStructureBuildGeometryInfoKHR<'_>],
build_range_infos: &[&[vk::AccelerationStructureBuildRangeInfoKHR]],
) -> VkResult<()> {
assert_eq!(infos.len(), build_range_infos.len());
let build_range_infos = build_range_infos
.iter()
.zip(infos.iter())
.map(|(range_info, info)| {
assert_eq!(range_info.len(), info.geometry_count as usize);
range_info.as_ptr()
})
.collect::<Vec<_>>();
(self.fp.build_acceleration_structures_khr)(
self.handle,
deferred_operation,
infos.len() as _,
infos.as_ptr(),
build_range_infos.as_ptr(),
)
.result()
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCopyAccelerationStructureKHR.html>
#[inline]
pub unsafe fn copy_acceleration_structure(
&self,
deferred_operation: vk::DeferredOperationKHR,
info: &vk::CopyAccelerationStructureInfoKHR<'_>,
) -> VkResult<()> {
(self.fp.copy_acceleration_structure_khr)(self.handle, deferred_operation, info).result()
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCopyAccelerationStructureToMemoryKHR.html>
#[inline]
pub unsafe fn copy_acceleration_structure_to_memory(
&self,
deferred_operation: vk::DeferredOperationKHR,
info: &vk::CopyAccelerationStructureToMemoryInfoKHR<'_>,
) -> VkResult<()> {
(self.fp.copy_acceleration_structure_to_memory_khr)(self.handle, deferred_operation, info)
.result()
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCopyMemoryToAccelerationStructureKHR.html>
#[inline]
pub unsafe fn copy_memory_to_acceleration_structure(
&self,
deferred_operation: vk::DeferredOperationKHR,
info: &vk::CopyMemoryToAccelerationStructureInfoKHR<'_>,
) -> VkResult<()> {
(self.fp.copy_memory_to_acceleration_structure_khr)(self.handle, deferred_operation, info)
.result()
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkWriteAccelerationStructuresPropertiesKHR.html>
#[inline]
pub unsafe fn write_acceleration_structures_properties(
&self,
acceleration_structures: &[vk::AccelerationStructureKHR],
query_type: vk::QueryType,
data: &mut [u8],
stride: usize,
) -> VkResult<()> {
(self.fp.write_acceleration_structures_properties_khr)(
self.handle,
acceleration_structures.len() as _,
acceleration_structures.as_ptr(),
query_type,
data.len(),
data.as_mut_ptr().cast(),
stride,
)
.result()
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdCopyAccelerationStructureKHR.html>
#[inline]
pub unsafe fn cmd_copy_acceleration_structure(
&self,
command_buffer: vk::CommandBuffer,
info: &vk::CopyAccelerationStructureInfoKHR<'_>,
) {
(self.fp.cmd_copy_acceleration_structure_khr)(command_buffer, info);
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdCopyAccelerationStructureToMemoryKHR.html>
#[inline]
pub unsafe fn cmd_copy_acceleration_structure_to_memory(
&self,
command_buffer: vk::CommandBuffer,
info: &vk::CopyAccelerationStructureToMemoryInfoKHR<'_>,
) {
(self.fp.cmd_copy_acceleration_structure_to_memory_khr)(command_buffer, info);
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdCopyMemoryToAccelerationStructureKHR.html>
#[inline]
pub unsafe fn cmd_copy_memory_to_acceleration_structure(
&self,
command_buffer: vk::CommandBuffer,
info: &vk::CopyMemoryToAccelerationStructureInfoKHR<'_>,
) {
(self.fp.cmd_copy_memory_to_acceleration_structure_khr)(command_buffer, info);
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetAccelerationStructureHandleKHR.html>
#[inline]
pub unsafe fn get_acceleration_structure_device_address(
&self,
info: &vk::AccelerationStructureDeviceAddressInfoKHR<'_>,
) -> vk::DeviceAddress {
(self.fp.get_acceleration_structure_device_address_khr)(self.handle, info)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdWriteAccelerationStructuresPropertiesKHR.html>
#[inline]
pub unsafe fn cmd_write_acceleration_structures_properties(
&self,
command_buffer: vk::CommandBuffer,
structures: &[vk::AccelerationStructureKHR],
query_type: vk::QueryType,
query_pool: vk::QueryPool,
first_query: u32,
) {
(self.fp.cmd_write_acceleration_structures_properties_khr)(
command_buffer,
structures.len() as _,
structures.as_ptr(),
query_type,
query_pool,
first_query,
);
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetDeviceAccelerationStructureCompatibilityKHR.html>
#[inline]
pub unsafe fn get_device_acceleration_structure_compatibility(
&self,
version: &vk::AccelerationStructureVersionInfoKHR<'_>,
) -> vk::AccelerationStructureCompatibilityKHR {
let mut compatibility = mem::MaybeUninit::uninit();
(self.fp.get_device_acceleration_structure_compatibility_khr)(
self.handle,
version,
compatibility.as_mut_ptr(),
);
compatibility.assume_init()
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetAccelerationStructureBuildSizesKHR.html>
#[inline]
pub unsafe fn get_acceleration_structure_build_sizes(
&self,
build_type: vk::AccelerationStructureBuildTypeKHR,
build_info: &vk::AccelerationStructureBuildGeometryInfoKHR<'_>,
max_primitive_counts: &[u32],
size_info: &mut vk::AccelerationStructureBuildSizesInfoKHR<'_>,
) {
assert_eq!(max_primitive_counts.len(), build_info.geometry_count as _);
(self.fp.get_acceleration_structure_build_sizes_khr)(
self.handle,
build_type,
build_info,
max_primitive_counts.as_ptr(),
size_info,
)
}
}

View File

@@ -0,0 +1,25 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_android_surface.html>
use crate::prelude::*;
use crate::vk;
use crate::RawPtr;
use core::mem;
impl crate::khr::android_surface::Instance {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCreateAndroidSurfaceKHR.html>
#[inline]
pub unsafe fn create_android_surface(
&self,
create_info: &vk::AndroidSurfaceCreateInfoKHR<'_>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<vk::SurfaceKHR> {
let mut surface = mem::MaybeUninit::uninit();
(self.fp.create_android_surface_khr)(
self.handle,
create_info,
allocation_callbacks.as_raw_ptr(),
surface.as_mut_ptr(),
)
.assume_init_on_success(surface)
}
}

View File

@@ -0,0 +1,32 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_buffer_device_address.html>
use crate::vk;
impl crate::khr::buffer_device_address::Device {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetBufferDeviceAddressKHR.html>
#[inline]
pub unsafe fn get_buffer_device_address(
&self,
info: &vk::BufferDeviceAddressInfoKHR<'_>,
) -> vk::DeviceAddress {
(self.fp.get_buffer_device_address_khr)(self.handle, info)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetBufferOpaqueCaptureAddressKHR.html>
#[inline]
pub unsafe fn get_buffer_opaque_capture_address(
&self,
info: &vk::BufferDeviceAddressInfoKHR<'_>,
) -> u64 {
(self.fp.get_buffer_opaque_capture_address_khr)(self.handle, info)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetDeviceMemoryOpaqueCaptureAddressKHR.html>
#[inline]
pub unsafe fn get_device_memory_opaque_capture_address(
&self,
info: &vk::DeviceMemoryOpaqueCaptureAddressInfoKHR<'_>,
) -> u64 {
(self.fp.get_device_memory_opaque_capture_address_khr)(self.handle, info)
}
}

View File

@@ -0,0 +1,47 @@
//! <https://registry.khronos.org//vulkan/specs/1.3-extensions/man/html/VK_KHR_calibrated_timestamps.html>
use crate::prelude::*;
use crate::vk;
use alloc::vec::Vec;
use core::mem;
impl crate::khr::calibrated_timestamps::Device {
/// <https://registry.khronos.org//vulkan/specs/1.3-extensions/man/html/vkGetCalibratedTimestampsKHR.html>
///
/// Returns a tuple containing `(timestamps, max_deviation)`
#[inline]
pub unsafe fn get_calibrated_timestamps(
&self,
info: &[vk::CalibratedTimestampInfoKHR<'_>],
) -> VkResult<(Vec<u64>, u64)> {
let mut timestamps = Vec::with_capacity(info.len());
let mut max_deviation = mem::MaybeUninit::uninit();
let max_deviation = (self.fp.get_calibrated_timestamps_khr)(
self.handle,
info.len() as u32,
info.as_ptr(),
timestamps.as_mut_ptr(),
max_deviation.as_mut_ptr(),
)
.assume_init_on_success(max_deviation)?;
timestamps.set_len(info.len());
Ok((timestamps, max_deviation))
}
}
impl crate::khr::calibrated_timestamps::Instance {
/// <https://registry.khronos.org//vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceCalibrateableTimeDomainsKHR.html>
#[inline]
pub unsafe fn get_physical_device_calibrateable_time_domains(
&self,
physical_device: vk::PhysicalDevice,
) -> VkResult<Vec<vk::TimeDomainKHR>> {
read_into_uninitialized_vector(|count, data| {
(self.fp.get_physical_device_calibrateable_time_domains_khr)(
physical_device,
count,
data,
)
})
}
}

View File

@@ -0,0 +1,24 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_cooperative_matrix.html>
use crate::prelude::*;
use crate::vk;
use alloc::vec::Vec;
impl crate::khr::cooperative_matrix::Instance {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceCooperativeMatrixPropertiesKHR.html>
#[inline]
pub unsafe fn get_physical_device_cooperative_matrix_properties(
&self,
physical_device: vk::PhysicalDevice,
) -> VkResult<Vec<vk::CooperativeMatrixPropertiesKHR<'_>>> {
read_into_defaulted_vector(|count, data| {
(self
.fp
.get_physical_device_cooperative_matrix_properties_khr)(
physical_device,
count,
data,
)
})
}
}

View File

@@ -0,0 +1,60 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_copy_commands2.html>
use crate::vk;
impl crate::khr::copy_commands2::Device {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdCopyBuffer2KHR.html>
#[inline]
pub unsafe fn cmd_copy_buffer2(
&self,
command_buffer: vk::CommandBuffer,
copy_buffer_info: &vk::CopyBufferInfo2KHR<'_>,
) {
(self.fp.cmd_copy_buffer2_khr)(command_buffer, copy_buffer_info)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdCopyImage2KHR.html>
#[inline]
pub unsafe fn cmd_copy_image2(
&self,
command_buffer: vk::CommandBuffer,
copy_image_info: &vk::CopyImageInfo2KHR<'_>,
) {
(self.fp.cmd_copy_image2_khr)(command_buffer, copy_image_info)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdCopyBufferToImage2KHR.html>
#[inline]
pub unsafe fn cmd_copy_buffer_to_image2(
&self,
command_buffer: vk::CommandBuffer,
copy_buffer_to_image_info: &vk::CopyBufferToImageInfo2KHR<'_>,
) {
(self.fp.cmd_copy_buffer_to_image2_khr)(command_buffer, copy_buffer_to_image_info)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdCopyImageToBuffer2KHR.html>
#[inline]
pub unsafe fn cmd_copy_image_to_buffer2(
&self,
command_buffer: vk::CommandBuffer,
copy_image_to_buffer_info: &vk::CopyImageToBufferInfo2KHR<'_>,
) {
(self.fp.cmd_copy_image_to_buffer2_khr)(command_buffer, copy_image_to_buffer_info)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdBlitImage2KHR.html>
#[inline]
pub unsafe fn cmd_blit_image2(
&self,
command_buffer: vk::CommandBuffer,
blit_image_info: &vk::BlitImageInfo2KHR<'_>,
) {
(self.fp.cmd_blit_image2_khr)(command_buffer, blit_image_info)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdResolveImage2KHR.html>
#[inline]
pub unsafe fn cmd_resolve_image2(
&self,
command_buffer: vk::CommandBuffer,
resolve_image_info: &vk::ResolveImageInfo2KHR<'_>,
) {
(self.fp.cmd_resolve_image2_khr)(command_buffer, resolve_image_info)
}
}

View File

@@ -0,0 +1,61 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_create_renderpass2.html>
use crate::prelude::*;
use crate::vk;
use crate::RawPtr;
use core::mem;
impl crate::khr::create_renderpass2::Device {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCreateRenderPass2.html>
#[inline]
pub unsafe fn create_render_pass2(
&self,
create_info: &vk::RenderPassCreateInfo2<'_>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<vk::RenderPass> {
let mut renderpass = mem::MaybeUninit::uninit();
(self.fp.create_render_pass2_khr)(
self.handle,
create_info,
allocation_callbacks.as_raw_ptr(),
renderpass.as_mut_ptr(),
)
.assume_init_on_success(renderpass)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdBeginRenderPass2.html>
#[inline]
pub unsafe fn cmd_begin_render_pass2(
&self,
command_buffer: vk::CommandBuffer,
render_pass_begin_info: &vk::RenderPassBeginInfo<'_>,
subpass_begin_info: &vk::SubpassBeginInfo<'_>,
) {
(self.fp.cmd_begin_render_pass2_khr)(
command_buffer,
render_pass_begin_info,
subpass_begin_info,
);
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdNextSubpass2.html>
#[inline]
pub unsafe fn cmd_next_subpass2(
&self,
command_buffer: vk::CommandBuffer,
subpass_begin_info: &vk::SubpassBeginInfo<'_>,
subpass_end_info: &vk::SubpassEndInfo<'_>,
) {
(self.fp.cmd_next_subpass2_khr)(command_buffer, subpass_begin_info, subpass_end_info);
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdEndRenderPass2.html>
#[inline]
pub unsafe fn cmd_end_render_pass2(
&self,
command_buffer: vk::CommandBuffer,
subpass_end_info: &vk::SubpassEndInfo<'_>,
) {
(self.fp.cmd_end_render_pass2_khr)(command_buffer, subpass_end_info);
}
}

View File

@@ -0,0 +1,64 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_deferred_host_operations.html>
use crate::prelude::*;
use crate::vk;
use crate::RawPtr;
use core::mem;
impl crate::khr::deferred_host_operations::Device {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCreateDeferredOperationKHR.html>
#[inline]
pub unsafe fn create_deferred_operation(
&self,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<vk::DeferredOperationKHR> {
let mut operation = mem::MaybeUninit::uninit();
(self.fp.create_deferred_operation_khr)(
self.handle,
allocation_callbacks.as_raw_ptr(),
operation.as_mut_ptr(),
)
.assume_init_on_success(operation)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkDeferredOperationJoinKHR.html>
#[inline]
pub unsafe fn deferred_operation_join(
&self,
operation: vk::DeferredOperationKHR,
) -> VkResult<()> {
(self.fp.deferred_operation_join_khr)(self.handle, operation).result()
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkDestroyDeferredOperationKHR.html>
#[inline]
pub unsafe fn destroy_deferred_operation(
&self,
operation: vk::DeferredOperationKHR,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) {
(self.fp.destroy_deferred_operation_khr)(
self.handle,
operation,
allocation_callbacks.as_raw_ptr(),
);
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetDeferredOperationMaxConcurrencyKHR.html>
#[inline]
pub unsafe fn get_deferred_operation_max_concurrency(
&self,
operation: vk::DeferredOperationKHR,
) -> u32 {
(self.fp.get_deferred_operation_max_concurrency_khr)(self.handle, operation)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetDeferredOperationResultKHR.html>
#[inline]
pub unsafe fn get_deferred_operation_result(
&self,
operation: vk::DeferredOperationKHR,
) -> VkResult<()> {
(self.fp.get_deferred_operation_result_khr)(self.handle, operation).result()
}
}

View File

@@ -0,0 +1,147 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_device_group.html>
#[cfg(doc)]
use crate::khr;
use crate::prelude::*;
use crate::vk;
use alloc::vec::Vec;
use core::mem;
impl crate::khr::device_group::Device {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetDeviceGroupPeerMemoryFeaturesKHR.html>
#[inline]
pub unsafe fn get_device_group_peer_memory_features(
&self,
heap_index: u32,
local_device_index: u32,
remote_device_index: u32,
) -> vk::PeerMemoryFeatureFlags {
let mut peer_memory_features = mem::MaybeUninit::uninit();
(self.fp.get_device_group_peer_memory_features_khr)(
self.handle,
heap_index,
local_device_index,
remote_device_index,
peer_memory_features.as_mut_ptr(),
);
peer_memory_features.assume_init()
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetDeviceMaskKHR.html>
#[inline]
pub unsafe fn cmd_set_device_mask(&self, command_buffer: vk::CommandBuffer, device_mask: u32) {
(self.fp.cmd_set_device_mask_khr)(command_buffer, device_mask)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdDispatchBaseKHR.html>
#[inline]
pub unsafe fn cmd_dispatch_base(
&self,
command_buffer: vk::CommandBuffer,
base_group: (u32, u32, u32),
group_count: (u32, u32, u32),
) {
(self.fp.cmd_dispatch_base_khr)(
command_buffer,
base_group.0,
base_group.1,
base_group.2,
group_count.0,
group_count.1,
group_count.2,
)
}
/// Requires [`VK_KHR_surface`] to be enabled.
///
/// Also available as [`khr::swapchain::Device::get_device_group_present_capabilities()`] since [Vulkan 1.1].
///
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetDeviceGroupPresentCapabilitiesKHR.html>
///
/// [Vulkan 1.1]: https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_VERSION_1_1.html
/// [`VK_KHR_surface`]: https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_surface.html
#[inline]
pub unsafe fn get_device_group_present_capabilities(
&self,
device_group_present_capabilities: &mut vk::DeviceGroupPresentCapabilitiesKHR<'_>,
) -> VkResult<()> {
(self.fp.get_device_group_present_capabilities_khr)(
self.handle,
device_group_present_capabilities,
)
.result()
}
/// Requires [`VK_KHR_surface`] to be enabled.
///
/// Also available as [`khr::swapchain::Device::get_device_group_surface_present_modes()`] since [Vulkan 1.1].
///
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetDeviceGroupSurfacePresentModesKHR.html>
///
/// [Vulkan 1.1]: https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_VERSION_1_1.html
/// [`VK_KHR_surface`]: https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_surface.html
#[inline]
pub unsafe fn get_device_group_surface_present_modes(
&self,
surface: vk::SurfaceKHR,
) -> VkResult<vk::DeviceGroupPresentModeFlagsKHR> {
let mut modes = mem::MaybeUninit::uninit();
(self.fp.get_device_group_surface_present_modes_khr)(
self.handle,
surface,
modes.as_mut_ptr(),
)
.assume_init_on_success(modes)
}
/// On success, returns the next image's index and whether the swapchain is suboptimal for the surface.
///
/// Requires [`VK_KHR_swapchain`] to be enabled.
///
/// Also available as [`khr::swapchain::Device::acquire_next_image2()`] since [Vulkan 1.1].
///
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkAcquireNextImage2KHR.html>
///
/// [Vulkan 1.1]: https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_VERSION_1_1.html
/// [`VK_KHR_swapchain`]: https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_swapchain.html
#[inline]
pub unsafe fn acquire_next_image2(
&self,
acquire_info: &vk::AcquireNextImageInfoKHR<'_>,
) -> VkResult<(u32, bool)> {
let mut index = mem::MaybeUninit::uninit();
let err_code =
(self.fp.acquire_next_image2_khr)(self.handle, acquire_info, index.as_mut_ptr());
match err_code {
vk::Result::SUCCESS => Ok((index.assume_init(), false)),
vk::Result::SUBOPTIMAL_KHR => Ok((index.assume_init(), true)),
_ => Err(err_code),
}
}
}
impl crate::khr::device_group::Instance {
/// Requires [`VK_KHR_surface`] to be enabled.
///
/// Also available as [`khr::swapchain::Instance::get_physical_device_present_rectangles()`] since [Vulkan 1.1].
///
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDevicePresentRectanglesKHR.html>
///
/// [Vulkan 1.1]: https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_VERSION_1_1.html
/// [`VK_KHR_surface`]: https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_surface.html
#[inline]
pub unsafe fn get_physical_device_present_rectangles(
&self,
physical_device: vk::PhysicalDevice,
surface: vk::SurfaceKHR,
) -> VkResult<Vec<vk::Rect2D>> {
read_into_uninitialized_vector(|count, data| {
(self.fp.get_physical_device_present_rectangles_khr)(
physical_device,
surface,
count,
data,
)
})
}
}

View File

@@ -0,0 +1,37 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_device_group_creation.html>
use crate::prelude::*;
use crate::vk;
use core::mem;
use core::ptr;
impl crate::khr::device_group_creation::Instance {
/// Retrieve the number of elements to pass to [`enumerate_physical_device_groups()`][Self::enumerate_physical_device_groups()]
#[inline]
pub unsafe fn enumerate_physical_device_groups_len(&self) -> VkResult<usize> {
let mut group_count = mem::MaybeUninit::uninit();
(self.fp.enumerate_physical_device_groups_khr)(
self.handle,
group_count.as_mut_ptr(),
ptr::null_mut(),
)
.assume_init_on_success(group_count)
.map(|c| c as usize)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkEnumeratePhysicalDeviceGroupsKHR.html>
///
/// Call [`enumerate_physical_device_groups_len()`][Self::enumerate_physical_device_groups_len()] to query the number of elements to pass to `out`.
/// Be sure to [`Default::default()`]-initialize these elements and optionally set their `p_next` pointer.
#[inline]
pub unsafe fn enumerate_physical_device_groups(
&self,
out: &mut [vk::PhysicalDeviceGroupProperties<'_>],
) -> VkResult<()> {
let mut count = out.len() as u32;
(self.fp.enumerate_physical_device_groups_khr)(self.handle, &mut count, out.as_mut_ptr())
.result()?;
assert_eq!(count as usize, out.len());
Ok(())
}
}

115
vendor/ash/src/extensions/khr/display.rs vendored Executable file
View File

@@ -0,0 +1,115 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_display.html>
use crate::prelude::*;
use crate::vk;
use crate::RawPtr;
use alloc::vec::Vec;
use core::mem;
impl crate::khr::display::Instance {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceDisplayPropertiesKHR.html>
#[inline]
pub unsafe fn get_physical_device_display_properties(
&self,
physical_device: vk::PhysicalDevice,
) -> VkResult<Vec<vk::DisplayPropertiesKHR<'_>>> {
read_into_uninitialized_vector(|count, data| {
(self.fp.get_physical_device_display_properties_khr)(physical_device, count, data)
})
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceDisplayPlanePropertiesKHR.html>
#[inline]
pub unsafe fn get_physical_device_display_plane_properties(
&self,
physical_device: vk::PhysicalDevice,
) -> VkResult<Vec<vk::DisplayPlanePropertiesKHR>> {
read_into_uninitialized_vector(|count, data| {
(self.fp.get_physical_device_display_plane_properties_khr)(physical_device, count, data)
})
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetDisplayPlaneSupportedDisplaysKHR.html>
#[inline]
pub unsafe fn get_display_plane_supported_displays(
&self,
physical_device: vk::PhysicalDevice,
plane_index: u32,
) -> VkResult<Vec<vk::DisplayKHR>> {
read_into_uninitialized_vector(|count, data| {
(self.fp.get_display_plane_supported_displays_khr)(
physical_device,
plane_index,
count,
data,
)
})
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetDisplayModePropertiesKHR.html>
#[inline]
pub unsafe fn get_display_mode_properties(
&self,
physical_device: vk::PhysicalDevice,
display: vk::DisplayKHR,
) -> VkResult<Vec<vk::DisplayModePropertiesKHR>> {
read_into_uninitialized_vector(|count, data| {
(self.fp.get_display_mode_properties_khr)(physical_device, display, count, data)
})
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCreateDisplayModeKHR.html>
#[inline]
pub unsafe fn create_display_mode(
&self,
physical_device: vk::PhysicalDevice,
display: vk::DisplayKHR,
create_info: &vk::DisplayModeCreateInfoKHR<'_>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<vk::DisplayModeKHR> {
let mut display_mode = mem::MaybeUninit::uninit();
(self.fp.create_display_mode_khr)(
physical_device,
display,
create_info,
allocation_callbacks.as_raw_ptr(),
display_mode.as_mut_ptr(),
)
.assume_init_on_success(display_mode)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetDisplayPlaneCapabilitiesKHR.html>
#[inline]
pub unsafe fn get_display_plane_capabilities(
&self,
physical_device: vk::PhysicalDevice,
mode: vk::DisplayModeKHR,
plane_index: u32,
) -> VkResult<vk::DisplayPlaneCapabilitiesKHR> {
let mut display_plane_capabilities = mem::MaybeUninit::uninit();
(self.fp.get_display_plane_capabilities_khr)(
physical_device,
mode,
plane_index,
display_plane_capabilities.as_mut_ptr(),
)
.assume_init_on_success(display_plane_capabilities)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCreateDisplayPlaneSurfaceKHR.html>
#[inline]
pub unsafe fn create_display_plane_surface(
&self,
create_info: &vk::DisplaySurfaceCreateInfoKHR<'_>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<vk::SurfaceKHR> {
let mut surface = mem::MaybeUninit::uninit();
(self.fp.create_display_plane_surface_khr)(
self.handle,
create_info,
allocation_callbacks.as_raw_ptr(),
surface.as_mut_ptr(),
)
.assume_init_on_success(surface)
}
}

View File

@@ -0,0 +1,26 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_display_swapchain.html>
use crate::prelude::*;
use crate::vk;
use crate::RawPtr;
use alloc::vec::Vec;
impl crate::khr::display_swapchain::Device {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCreateSharedSwapchainsKHR.html>
#[inline]
pub unsafe fn create_shared_swapchains(
&self,
create_infos: &[vk::SwapchainCreateInfoKHR<'_>],
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<Vec<vk::SwapchainKHR>> {
let mut swapchains = Vec::with_capacity(create_infos.len());
(self.fp.create_shared_swapchains_khr)(
self.handle,
create_infos.len() as u32,
create_infos.as_ptr(),
allocation_callbacks.as_raw_ptr(),
swapchains.as_mut_ptr(),
)
.set_vec_len_on_success(swapchains, create_infos.len())
}
}

View File

@@ -0,0 +1,51 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_draw_indirect_count.html>
use crate::vk;
impl crate::khr::draw_indirect_count::Device {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdDrawIndexedIndirectCountKHR.html>
#[inline]
pub unsafe fn cmd_draw_indexed_indirect_count(
&self,
command_buffer: vk::CommandBuffer,
buffer: vk::Buffer,
offset: vk::DeviceSize,
count_buffer: vk::Buffer,
count_buffer_offset: vk::DeviceSize,
max_draw_count: u32,
stride: u32,
) {
(self.fp.cmd_draw_indexed_indirect_count_khr)(
command_buffer,
buffer,
offset,
count_buffer,
count_buffer_offset,
max_draw_count,
stride,
);
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdDrawIndirectCountKHR.html>
#[inline]
pub unsafe fn cmd_draw_indirect_count(
&self,
command_buffer: vk::CommandBuffer,
buffer: vk::Buffer,
offset: vk::DeviceSize,
count_buffer: vk::Buffer,
count_buffer_offset: vk::DeviceSize,
max_draw_count: u32,
stride: u32,
) {
(self.fp.cmd_draw_indirect_count_khr)(
command_buffer,
buffer,
offset,
count_buffer,
count_buffer_offset,
max_draw_count,
stride,
);
}
}

View File

@@ -0,0 +1,21 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_dynamic_rendering.html>
use crate::vk;
impl crate::khr::dynamic_rendering::Device {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdBeginRenderingKHR.html>
#[inline]
pub unsafe fn cmd_begin_rendering(
&self,
command_buffer: vk::CommandBuffer,
rendering_info: &vk::RenderingInfoKHR<'_>,
) {
(self.fp.cmd_begin_rendering_khr)(command_buffer, rendering_info)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdEndRenderingKHR.html>
#[inline]
pub unsafe fn cmd_end_rendering(&self, command_buffer: vk::CommandBuffer) {
(self.fp.cmd_end_rendering_khr)(command_buffer)
}
}

View File

@@ -0,0 +1,25 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_dynamic_rendering_local_read.html>
use crate::vk;
impl crate::khr::dynamic_rendering_local_read::Device {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetRenderingAttachmentLocationsKHR.html>
#[inline]
pub unsafe fn cmd_set_rendering_attachment_locations(
&self,
command_buffer: vk::CommandBuffer,
location_info: &vk::RenderingAttachmentLocationInfoKHR<'_>,
) {
(self.fp.cmd_set_rendering_attachment_locations_khr)(command_buffer, location_info)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetRenderingInputAttachmentIndicesKHR.html>
#[inline]
pub unsafe fn cmd_set_rendering_input_attachment_indices(
&self,
command_buffer: vk::CommandBuffer,
location_info: &vk::RenderingInputAttachmentIndexInfoKHR<'_>,
) {
(self.fp.cmd_set_rendering_input_attachment_indices_khr)(command_buffer, location_info)
}
}

View File

@@ -0,0 +1,24 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_external_fence_fd.html>
use crate::prelude::*;
use crate::vk;
use core::mem;
impl crate::khr::external_fence_fd::Device {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkImportFenceFdKHR.html>
#[inline]
pub unsafe fn import_fence_fd(
&self,
import_info: &vk::ImportFenceFdInfoKHR<'_>,
) -> VkResult<()> {
(self.fp.import_fence_fd_khr)(self.handle, import_info).result()
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetFenceFdKHR.html>
#[inline]
pub unsafe fn get_fence_fd(&self, get_info: &vk::FenceGetFdInfoKHR<'_>) -> VkResult<i32> {
let mut fd = mem::MaybeUninit::uninit();
(self.fp.get_fence_fd_khr)(self.handle, get_info, fd.as_mut_ptr())
.assume_init_on_success(fd)
}
}

View File

@@ -0,0 +1,27 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_external_fence_win32.html>
use crate::prelude::*;
use crate::vk;
use core::mem;
impl crate::khr::external_fence_win32::Device {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkImportFenceWin32HandleKHR.html>
#[inline]
pub unsafe fn import_fence_win32_handle(
&self,
import_info: &vk::ImportFenceWin32HandleInfoKHR<'_>,
) -> VkResult<()> {
(self.fp.import_fence_win32_handle_khr)(self.handle, import_info).result()
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetFenceWin32HandleKHR.html>
#[inline]
pub unsafe fn get_fence_win32_handle(
&self,
get_info: &vk::FenceGetWin32HandleInfoKHR<'_>,
) -> VkResult<vk::HANDLE> {
let mut handle = mem::MaybeUninit::uninit();
(self.fp.get_fence_win32_handle_khr)(self.handle, get_info, handle.as_mut_ptr())
.assume_init_on_success(handle)
}
}

View File

@@ -0,0 +1,27 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_external_memory_fd.html>
use crate::prelude::*;
use crate::vk;
use core::mem;
impl crate::khr::external_memory_fd::Device {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetMemoryFdKHR.html>
#[inline]
pub unsafe fn get_memory_fd(&self, get_fd_info: &vk::MemoryGetFdInfoKHR<'_>) -> VkResult<i32> {
let mut fd = mem::MaybeUninit::uninit();
(self.fp.get_memory_fd_khr)(self.handle, get_fd_info, fd.as_mut_ptr())
.assume_init_on_success(fd)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetMemoryFdPropertiesKHR.html>
#[inline]
pub unsafe fn get_memory_fd_properties(
&self,
handle_type: vk::ExternalMemoryHandleTypeFlags,
fd: i32,
memory_fd_properties: &mut vk::MemoryFdPropertiesKHR<'_>,
) -> VkResult<()> {
(self.fp.get_memory_fd_properties_khr)(self.handle, handle_type, fd, memory_fd_properties)
.result()
}
}

View File

@@ -0,0 +1,35 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_external_memory_win32.html>
use crate::prelude::*;
use crate::vk;
use core::mem;
impl crate::khr::external_memory_win32::Device {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetMemoryWin32HandleKHR.html>
#[inline]
pub unsafe fn get_memory_win32_handle(
&self,
create_info: &vk::MemoryGetWin32HandleInfoKHR<'_>,
) -> VkResult<vk::HANDLE> {
let mut handle = mem::MaybeUninit::uninit();
(self.fp.get_memory_win32_handle_khr)(self.handle, create_info, handle.as_mut_ptr())
.assume_init_on_success(handle)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetMemoryWin32HandlePropertiesKHR.html>
#[inline]
pub unsafe fn get_memory_win32_handle_properties(
&self,
handle_type: vk::ExternalMemoryHandleTypeFlags,
handle: vk::HANDLE,
memory_win32_handle_properties: &mut vk::MemoryWin32HandlePropertiesKHR<'_>,
) -> VkResult<()> {
(self.fp.get_memory_win32_handle_properties_khr)(
self.handle,
handle_type,
handle,
memory_win32_handle_properties,
)
.result()
}
}

View File

@@ -0,0 +1,27 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_external_semaphore_fd.html>
use crate::prelude::*;
use crate::vk;
use core::mem;
impl crate::khr::external_semaphore_fd::Device {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkImportSemaphoreFdKHR.html>
#[inline]
pub unsafe fn import_semaphore_fd(
&self,
import_info: &vk::ImportSemaphoreFdInfoKHR<'_>,
) -> VkResult<()> {
(self.fp.import_semaphore_fd_khr)(self.handle, import_info).result()
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetSemaphoreFdKHR.html>
#[inline]
pub unsafe fn get_semaphore_fd(
&self,
get_info: &vk::SemaphoreGetFdInfoKHR<'_>,
) -> VkResult<i32> {
let mut fd = mem::MaybeUninit::uninit();
(self.fp.get_semaphore_fd_khr)(self.handle, get_info, fd.as_mut_ptr())
.assume_init_on_success(fd)
}
}

View File

@@ -0,0 +1,27 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_external_semaphore_win32.html>
use crate::prelude::*;
use crate::vk;
use core::mem;
impl crate::khr::external_semaphore_win32::Device {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkImportSemaphoreWin32HandleKHR.html>
#[inline]
pub unsafe fn import_semaphore_win32_handle(
&self,
import_info: &vk::ImportSemaphoreWin32HandleInfoKHR<'_>,
) -> VkResult<()> {
(self.fp.import_semaphore_win32_handle_khr)(self.handle, import_info).result()
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetSemaphoreWin32HandleKHR.html>
#[inline]
pub unsafe fn get_semaphore_win32_handle(
&self,
get_info: &vk::SemaphoreGetWin32HandleInfoKHR<'_>,
) -> VkResult<vk::HANDLE> {
let mut handle = mem::MaybeUninit::uninit();
(self.fp.get_semaphore_win32_handle_khr)(self.handle, get_info, handle.as_mut_ptr())
.assume_init_on_success(handle)
}
}

View File

@@ -0,0 +1,63 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_get_memory_requirements2.html>
use crate::vk;
use core::mem;
use core::ptr;
impl crate::khr::get_memory_requirements2::Device {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetBufferMemoryRequirements2KHR.html>
#[inline]
pub unsafe fn get_buffer_memory_requirements2(
&self,
info: &vk::BufferMemoryRequirementsInfo2KHR<'_>,
memory_requirements: &mut vk::MemoryRequirements2KHR<'_>,
) {
(self.fp.get_buffer_memory_requirements2_khr)(self.handle, info, memory_requirements);
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetImageMemoryRequirements2KHR.html>
#[inline]
pub unsafe fn get_image_memory_requirements2(
&self,
info: &vk::ImageMemoryRequirementsInfo2KHR<'_>,
memory_requirements: &mut vk::MemoryRequirements2KHR<'_>,
) {
(self.fp.get_image_memory_requirements2_khr)(self.handle, info, memory_requirements);
}
/// Retrieve the number of elements to pass to [`get_image_sparse_memory_requirements2()`][Self::get_image_sparse_memory_requirements2()]
#[inline]
pub unsafe fn get_image_sparse_memory_requirements2_len(
&self,
info: &vk::ImageSparseMemoryRequirementsInfo2KHR<'_>,
) -> usize {
let mut count = mem::MaybeUninit::uninit();
(self.fp.get_image_sparse_memory_requirements2_khr)(
self.handle,
info,
count.as_mut_ptr(),
ptr::null_mut(),
);
count.assume_init() as usize
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetImageSparseMemoryRequirements2KHR.html>
///
/// Call [`get_image_sparse_memory_requirements2_len()`][Self::get_image_sparse_memory_requirements2_len()] to query the number of elements to pass to `out`.
/// Be sure to [`Default::default()`]-initialize these elements and optionally set their `p_next` pointer.
#[inline]
pub unsafe fn get_image_sparse_memory_requirements2(
&self,
info: &vk::ImageSparseMemoryRequirementsInfo2KHR<'_>,
out: &mut [vk::SparseImageMemoryRequirements2KHR<'_>],
) {
let mut count = out.len() as u32;
(self.fp.get_image_sparse_memory_requirements2_khr)(
self.handle,
info,
&mut count,
out.as_mut_ptr(),
);
assert_eq!(count as usize, out.len());
}
}

View File

@@ -0,0 +1,145 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_get_physical_device_properties2.html>
use crate::prelude::*;
use crate::vk;
use core::mem;
use core::ptr;
impl crate::khr::get_physical_device_properties2::Instance {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceFeatures2KHR.html>
#[inline]
pub unsafe fn get_physical_device_features2(
&self,
physical_device: vk::PhysicalDevice,
features: &mut vk::PhysicalDeviceFeatures2KHR<'_>,
) {
(self.fp.get_physical_device_features2_khr)(physical_device, features);
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceFormatProperties2KHR.html>
#[inline]
pub unsafe fn get_physical_device_format_properties2(
&self,
physical_device: vk::PhysicalDevice,
format: vk::Format,
format_properties: &mut vk::FormatProperties2KHR<'_>,
) {
(self.fp.get_physical_device_format_properties2_khr)(
physical_device,
format,
format_properties,
);
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceImageFormatProperties2KHR.html>
#[inline]
pub unsafe fn get_physical_device_image_format_properties2(
&self,
physical_device: vk::PhysicalDevice,
image_format_info: &vk::PhysicalDeviceImageFormatInfo2KHR<'_>,
image_format_properties: &mut vk::ImageFormatProperties2KHR<'_>,
) -> VkResult<()> {
(self.fp.get_physical_device_image_format_properties2_khr)(
physical_device,
image_format_info,
image_format_properties,
)
.result()
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceMemoryProperties2KHR.html>
#[inline]
pub unsafe fn get_physical_device_memory_properties2(
&self,
physical_device: vk::PhysicalDevice,
memory_properties: &mut vk::PhysicalDeviceMemoryProperties2KHR<'_>,
) {
(self.fp.get_physical_device_memory_properties2_khr)(physical_device, memory_properties);
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceProperties2KHR.html>
#[inline]
pub unsafe fn get_physical_device_properties2(
&self,
physical_device: vk::PhysicalDevice,
properties: &mut vk::PhysicalDeviceProperties2KHR<'_>,
) {
(self.fp.get_physical_device_properties2_khr)(physical_device, properties);
}
/// Retrieve the number of elements to pass to [`get_physical_device_queue_family_properties2()`][Self::get_physical_device_queue_family_properties2()]
#[inline]
pub unsafe fn get_physical_device_queue_family_properties2_len(
&self,
physical_device: vk::PhysicalDevice,
) -> usize {
let mut count = mem::MaybeUninit::uninit();
(self.fp.get_physical_device_queue_family_properties2_khr)(
physical_device,
count.as_mut_ptr(),
ptr::null_mut(),
);
count.assume_init() as usize
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceQueueFamilyProperties2KHR.html>
///
/// Call [`get_physical_device_queue_family_properties2_len()`][Self::get_physical_device_queue_family_properties2_len()] to query the number of elements to pass to `out`.
/// Be sure to [`Default::default()`]-initialize these elements and optionally set their `p_next` pointer.
#[inline]
pub unsafe fn get_physical_device_queue_family_properties2(
&self,
physical_device: vk::PhysicalDevice,
out: &mut [vk::QueueFamilyProperties2KHR<'_>],
) {
let mut count = out.len() as u32;
(self.fp.get_physical_device_queue_family_properties2_khr)(
physical_device,
&mut count,
out.as_mut_ptr(),
);
assert_eq!(count as usize, out.len());
}
/// Retrieve the number of elements to pass to [`get_physical_device_sparse_image_format_properties2()`][Self::get_physical_device_sparse_image_format_properties2()]
#[inline]
pub unsafe fn get_physical_device_sparse_image_format_properties2_len(
&self,
physical_device: vk::PhysicalDevice,
format_info: &vk::PhysicalDeviceSparseImageFormatInfo2KHR<'_>,
) -> usize {
let mut count = mem::MaybeUninit::uninit();
(self
.fp
.get_physical_device_sparse_image_format_properties2_khr)(
physical_device,
format_info,
count.as_mut_ptr(),
ptr::null_mut(),
);
count.assume_init() as usize
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceSparseImageFormatProperties2KHR.html>
///
/// Call [`get_physical_device_sparse_image_format_properties2_len()`][Self::get_physical_device_sparse_image_format_properties2_len()] to query the number of elements to pass to `out`.
/// Be sure to [`Default::default()`]-initialize these elements and optionally set their `p_next` pointer.
#[inline]
pub unsafe fn get_physical_device_sparse_image_format_properties2(
&self,
physical_device: vk::PhysicalDevice,
format_info: &vk::PhysicalDeviceSparseImageFormatInfo2KHR<'_>,
out: &mut [vk::SparseImageFormatProperties2KHR<'_>],
) {
let mut count = out.len() as u32;
(self
.fp
.get_physical_device_sparse_image_format_properties2_khr)(
physical_device,
format_info,
&mut count,
out.as_mut_ptr(),
);
assert_eq!(count as usize, out.len());
}
}

View File

@@ -0,0 +1,63 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_get_surface_capabilities2.html>
use crate::prelude::*;
use crate::vk;
use core::mem;
use core::ptr;
impl crate::khr::get_surface_capabilities2::Instance {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceSurfaceCapabilities2KHR.html>
#[inline]
pub unsafe fn get_physical_device_surface_capabilities2(
&self,
physical_device: vk::PhysicalDevice,
surface_info: &vk::PhysicalDeviceSurfaceInfo2KHR<'_>,
surface_capabilities: &mut vk::SurfaceCapabilities2KHR<'_>,
) -> VkResult<()> {
(self.fp.get_physical_device_surface_capabilities2_khr)(
physical_device,
surface_info,
surface_capabilities,
)
.result()
}
/// Retrieve the number of elements to pass to [`get_physical_device_surface_formats2()`][Self::get_physical_device_surface_formats2()]
#[inline]
pub unsafe fn get_physical_device_surface_formats2_len(
&self,
physical_device: vk::PhysicalDevice,
surface_info: &vk::PhysicalDeviceSurfaceInfo2KHR<'_>,
) -> VkResult<usize> {
let mut count = mem::MaybeUninit::uninit();
let err_code = (self.fp.get_physical_device_surface_formats2_khr)(
physical_device,
surface_info,
count.as_mut_ptr(),
ptr::null_mut(),
);
err_code.assume_init_on_success(count).map(|c| c as usize)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceSurfaceFormats2KHR.html>
///
/// Call [`get_physical_device_surface_formats2_len()`][Self::get_physical_device_surface_formats2_len()] to query the number of elements to pass to `out`.
/// Be sure to [`Default::default()`]-initialize these elements and optionally set their `p_next` pointer.
#[inline]
pub unsafe fn get_physical_device_surface_formats2(
&self,
physical_device: vk::PhysicalDevice,
surface_info: &vk::PhysicalDeviceSurfaceInfo2KHR<'_>,
out: &mut [vk::SurfaceFormat2KHR<'_>],
) -> VkResult<()> {
let mut count = out.len() as u32;
let err_code = (self.fp.get_physical_device_surface_formats2_khr)(
physical_device,
surface_info,
&mut count,
out.as_mut_ptr(),
);
assert_eq!(count as usize, out.len());
err_code.result()
}
}

View File

@@ -0,0 +1,20 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_line_rasterization.html>
use crate::vk;
impl crate::khr::line_rasterization::Device {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetLineStippleKHR.html>
#[inline]
pub unsafe fn cmd_set_line_stipple(
&self,
command_buffer: vk::CommandBuffer,
line_stipple_factor: u32,
line_stipple_pattern: u16,
) {
(self.fp.cmd_set_line_stipple_khr)(
command_buffer,
line_stipple_factor,
line_stipple_pattern,
)
}
}

View File

@@ -0,0 +1,15 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_maintenance1.html>
use crate::vk;
impl crate::khr::maintenance1::Device {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkTrimCommandPoolKHR.html>
#[inline]
pub unsafe fn trim_command_pool(
&self,
command_pool: vk::CommandPool,
flags: vk::CommandPoolTrimFlagsKHR,
) {
(self.fp.trim_command_pool_khr)(self.handle, command_pool, flags);
}
}

View File

@@ -0,0 +1,15 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_maintenance3.html>
use crate::vk;
impl crate::khr::maintenance3::Device {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetDescriptorSetLayoutSupportKHR.html>
#[inline]
pub unsafe fn get_descriptor_set_layout_support(
&self,
create_info: &vk::DescriptorSetLayoutCreateInfo<'_>,
out: &mut vk::DescriptorSetLayoutSupportKHR<'_>,
) {
(self.fp.get_descriptor_set_layout_support_khr)(self.handle, create_info, out);
}
}

View File

@@ -0,0 +1,63 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_maintenance4.html>
use crate::vk;
use core::mem;
use core::ptr;
impl crate::khr::maintenance4::Device {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetDeviceBufferMemoryRequirementsKHR.html>
#[inline]
pub unsafe fn get_device_buffer_memory_requirements(
&self,
memory_requirements: &vk::DeviceBufferMemoryRequirementsKHR<'_>,
out: &mut vk::MemoryRequirements2<'_>,
) {
(self.fp.get_device_buffer_memory_requirements_khr)(self.handle, memory_requirements, out)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetDeviceImageMemoryRequirementsKHR.html>
#[inline]
pub unsafe fn get_device_image_memory_requirements(
&self,
memory_requirements: &vk::DeviceImageMemoryRequirementsKHR<'_>,
out: &mut vk::MemoryRequirements2<'_>,
) {
(self.fp.get_device_image_memory_requirements_khr)(self.handle, memory_requirements, out)
}
/// Retrieve the number of elements to pass to [`get_device_image_sparse_memory_requirements()`][Self::get_device_image_sparse_memory_requirements()]
#[inline]
pub unsafe fn get_device_image_sparse_memory_requirements_len(
&self,
memory_requirements: &vk::DeviceImageMemoryRequirementsKHR<'_>,
) -> usize {
let mut count = mem::MaybeUninit::uninit();
(self.fp.get_device_image_sparse_memory_requirements_khr)(
self.handle,
memory_requirements,
count.as_mut_ptr(),
ptr::null_mut(),
);
count.assume_init() as usize
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetDeviceImageSparseMemoryRequirementsKHR.html>
///
/// Call [`get_device_image_sparse_memory_requirements_len()`][Self::get_device_image_sparse_memory_requirements_len()] to query the number of elements to pass to `out`.
/// Be sure to [`Default::default()`]-initialize these elements and optionally set their `p_next` pointer.
#[inline]
pub unsafe fn get_device_image_sparse_memory_requirements(
&self,
memory_requirements: &vk::DeviceImageMemoryRequirementsKHR<'_>,
out: &mut [vk::SparseImageMemoryRequirements2<'_>],
) {
let mut count = out.len() as u32;
(self.fp.get_device_image_sparse_memory_requirements_khr)(
self.handle,
memory_requirements,
&mut count,
out.as_mut_ptr(),
);
assert_eq!(count as usize, out.len());
}
}

View File

@@ -0,0 +1,66 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_maintenance5.html>
#[cfg(doc)]
use crate::ext;
use crate::vk;
use core::mem;
impl crate::khr::maintenance5::Device {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdBindIndexBuffer2KHR.html>
#[inline]
pub unsafe fn cmd_bind_index_buffer2(
&self,
command_buffer: vk::CommandBuffer,
buffer: vk::Buffer,
offset: vk::DeviceSize,
size: vk::DeviceSize,
index_type: vk::IndexType,
) {
(self.fp.cmd_bind_index_buffer2_khr)(command_buffer, buffer, offset, size, index_type)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetRenderingAreaGranularityKHR.html>
#[inline]
pub unsafe fn get_rendering_area_granularity(
&self,
rendering_area_info: &vk::RenderingAreaInfoKHR<'_>,
) -> vk::Extent2D {
let mut granularity = mem::MaybeUninit::uninit();
(self.fp.get_rendering_area_granularity_khr)(
self.handle,
rendering_area_info,
granularity.as_mut_ptr(),
);
granularity.assume_init()
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetDeviceImageSubresourceLayoutKHR.html>
#[inline]
pub unsafe fn get_device_image_subresource_layout(
&self,
info: &vk::DeviceImageSubresourceInfoKHR<'_>,
layout: &mut vk::SubresourceLayout2KHR<'_>,
) {
(self.fp.get_device_image_subresource_layout_khr)(self.handle, info, layout)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetImageSubresourceLayout2KHR.html>
///
/// Also available as [`ext::host_image_copy::Device::get_image_subresource_layout2()`]
/// when [`VK_EXT_host_image_copy`] is enabled.
///
/// Also available as [`ext::image_compression_control::Device::get_image_subresource_layout2()`]
/// when [`VK_EXT_image_compression_control`] is enabled.
///
/// [`VK_EXT_host_image_copy`]: https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_host_image_copy.html
/// [`VK_EXT_image_compression_control`]: https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_image_compression_control.html
#[inline]
pub unsafe fn get_image_subresource_layout2(
&self,
image: vk::Image,
subresource: &vk::ImageSubresource2KHR<'_>,
layout: &mut vk::SubresourceLayout2KHR<'_>,
) {
(self.fp.get_image_subresource_layout2_khr)(self.handle, image, subresource, layout)
}
}

View File

@@ -0,0 +1,74 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_maintenance6.html>
use crate::vk;
impl crate::khr::maintenance6::Device {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdBindDescriptorSets2KHR.html>
#[inline]
pub unsafe fn cmd_bind_descriptor_sets2(
&self,
command_buffer: vk::CommandBuffer,
bind_descriptor_sets_info: &vk::BindDescriptorSetsInfoKHR<'_>,
) {
(self.fp.cmd_bind_descriptor_sets2_khr)(command_buffer, bind_descriptor_sets_info)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdPushConstants2KHR.html>
#[inline]
pub unsafe fn cmd_push_constants2(
&self,
command_buffer: vk::CommandBuffer,
push_constants_info: &vk::PushConstantsInfoKHR<'_>,
) {
(self.fp.cmd_push_constants2_khr)(command_buffer, push_constants_info)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdPushDescriptorSet2KHR.html>
#[inline]
pub unsafe fn cmd_push_descriptor_set2(
&self,
command_buffer: vk::CommandBuffer,
push_descriptor_set_info: &vk::PushDescriptorSetInfoKHR<'_>,
) {
(self.fp.cmd_push_descriptor_set2_khr)(command_buffer, push_descriptor_set_info)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdPushDescriptorSetWithTemplate2KHR.html>
#[inline]
pub unsafe fn cmd_push_descriptor_set_with_template2(
&self,
command_buffer: vk::CommandBuffer,
push_descriptor_set_with_template_info: &vk::PushDescriptorSetWithTemplateInfoKHR<'_>,
) {
(self.fp.cmd_push_descriptor_set_with_template2_khr)(
command_buffer,
push_descriptor_set_with_template_info,
)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetDescriptorBufferOffsets2EXT.html>
#[inline]
pub unsafe fn cmd_set_descriptor_buffer_offsets2(
&self,
command_buffer: vk::CommandBuffer,
set_descriptor_buffer_offsets_info: &vk::SetDescriptorBufferOffsetsInfoEXT<'_>,
) {
(self.fp.cmd_set_descriptor_buffer_offsets2_ext)(
command_buffer,
set_descriptor_buffer_offsets_info,
)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdBindDescriptorBufferEmbeddedSamplers2EXT.html>
#[inline]
pub unsafe fn cmd_bind_descriptor_buffer_embedded_samplers2(
&self,
command_buffer: vk::CommandBuffer,
bind_descriptor_buffer_embedded_samplers_info: &vk::BindDescriptorBufferEmbeddedSamplersInfoEXT<'_>,
) {
(self.fp.cmd_bind_descriptor_buffer_embedded_samplers2_ext)(
command_buffer,
bind_descriptor_buffer_embedded_samplers_info,
)
}
}

45
vendor/ash/src/extensions/khr/mod.rs vendored Normal file
View File

@@ -0,0 +1,45 @@
pub mod acceleration_structure;
pub mod android_surface;
pub mod buffer_device_address;
pub mod calibrated_timestamps;
pub mod cooperative_matrix;
pub mod copy_commands2;
pub mod create_renderpass2;
pub mod deferred_host_operations;
pub mod device_group;
pub mod device_group_creation;
pub mod display;
pub mod display_swapchain;
pub mod draw_indirect_count;
pub mod dynamic_rendering;
pub mod dynamic_rendering_local_read;
pub mod external_fence_fd;
pub mod external_fence_win32;
pub mod external_memory_fd;
pub mod external_memory_win32;
pub mod external_semaphore_fd;
pub mod external_semaphore_win32;
pub mod get_memory_requirements2;
pub mod get_physical_device_properties2;
pub mod get_surface_capabilities2;
pub mod line_rasterization;
pub mod maintenance1;
pub mod maintenance3;
pub mod maintenance4;
pub mod maintenance5;
pub mod maintenance6;
pub mod performance_query;
pub mod pipeline_executable_properties;
pub mod present_wait;
pub mod push_descriptor;
pub mod ray_tracing_maintenance1;
pub mod ray_tracing_pipeline;
pub mod sampler_ycbcr_conversion;
pub mod surface;
pub mod swapchain;
pub mod synchronization2;
pub mod timeline_semaphore;
pub mod wayland_surface;
pub mod win32_surface;
pub mod xcb_surface;
pub mod xlib_surface;

View File

@@ -0,0 +1,93 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_performance_query.html>
use crate::prelude::*;
use crate::vk;
use core::mem;
use core::ptr;
impl crate::khr::performance_query::Device {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkAcquireProfilingLockKHR.html>
#[inline]
pub unsafe fn acquire_profiling_lock(
&self,
info: &vk::AcquireProfilingLockInfoKHR<'_>,
) -> VkResult<()> {
(self.fp.acquire_profiling_lock_khr)(self.handle, info).result()
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkReleaseProfilingLockKHR.html>
#[inline]
pub unsafe fn release_profiling_lock(&self) {
(self.fp.release_profiling_lock_khr)(self.handle)
}
}
impl crate::khr::performance_query::Instance {
/// Retrieve the number of elements to pass to [`enumerate_physical_device_queue_family_performance_query_counters()`][Self::enumerate_physical_device_queue_family_performance_query_counters()]
#[inline]
pub unsafe fn enumerate_physical_device_queue_family_performance_query_counters_len(
&self,
physical_device: vk::PhysicalDevice,
queue_family_index: u32,
) -> VkResult<usize> {
let mut count = mem::MaybeUninit::uninit();
(self
.fp
.enumerate_physical_device_queue_family_performance_query_counters_khr)(
physical_device,
queue_family_index,
count.as_mut_ptr(),
ptr::null_mut(),
ptr::null_mut(),
)
.assume_init_on_success(count)
.map(|c| c as usize)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR.html>
///
/// Call [`enumerate_physical_device_queue_family_performance_query_counters_len()`][Self::enumerate_physical_device_queue_family_performance_query_counters_len()] to query the number of elements to pass to `out_counters` and `out_counter_descriptions`.
/// Be sure to [`Default::default()`]-initialize these elements and optionally set their `p_next` pointer.
#[inline]
pub unsafe fn enumerate_physical_device_queue_family_performance_query_counters(
&self,
physical_device: vk::PhysicalDevice,
queue_family_index: u32,
out_counters: &mut [vk::PerformanceCounterKHR<'_>],
out_counter_descriptions: &mut [vk::PerformanceCounterDescriptionKHR<'_>],
) -> VkResult<()> {
assert_eq!(out_counters.len(), out_counter_descriptions.len());
let mut count = out_counters.len() as u32;
(self
.fp
.enumerate_physical_device_queue_family_performance_query_counters_khr)(
physical_device,
queue_family_index,
&mut count,
out_counters.as_mut_ptr(),
out_counter_descriptions.as_mut_ptr(),
)
.result()?;
assert_eq!(count as usize, out_counters.len());
assert_eq!(count as usize, out_counter_descriptions.len());
Ok(())
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceQueueFamilyPerformanceQueryPassesKHR.html>
#[inline]
pub unsafe fn get_physical_device_queue_family_performance_query_passes(
&self,
physical_device: vk::PhysicalDevice,
performance_query_create_info: &vk::QueryPoolPerformanceCreateInfoKHR<'_>,
) -> u32 {
let mut num_passes = mem::MaybeUninit::uninit();
(self
.fp
.get_physical_device_queue_family_performance_query_passes_khr)(
physical_device,
performance_query_create_info,
num_passes.as_mut_ptr(),
);
num_passes.assume_init()
}
}

View File

@@ -0,0 +1,55 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_pipeline_executable_properties.html>
use crate::prelude::*;
use crate::vk;
use alloc::vec::Vec;
impl crate::khr::pipeline_executable_properties::Device {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetPipelineExecutableInternalRepresentationsKHR.html>
#[inline]
pub unsafe fn get_pipeline_executable_internal_representations(
&self,
executable_info: &vk::PipelineExecutableInfoKHR<'_>,
) -> VkResult<Vec<vk::PipelineExecutableInternalRepresentationKHR<'_>>> {
read_into_defaulted_vector(|count, data| {
(self.fp.get_pipeline_executable_internal_representations_khr)(
self.handle,
executable_info,
count,
data,
)
})
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetPipelineExecutablePropertiesKHR.html>
#[inline]
pub unsafe fn get_pipeline_executable_properties(
&self,
pipeline_info: &vk::PipelineInfoKHR<'_>,
) -> VkResult<Vec<vk::PipelineExecutablePropertiesKHR<'_>>> {
read_into_defaulted_vector(|count, data| {
(self.fp.get_pipeline_executable_properties_khr)(
self.handle,
pipeline_info,
count,
data,
)
})
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetPipelineExecutableStatisticsKHR.html>
#[inline]
pub unsafe fn get_pipeline_executable_statistics(
&self,
executable_info: &vk::PipelineExecutableInfoKHR<'_>,
) -> VkResult<Vec<vk::PipelineExecutableStatisticKHR<'_>>> {
read_into_defaulted_vector(|count, data| {
(self.fp.get_pipeline_executable_statistics_khr)(
self.handle,
executable_info,
count,
data,
)
})
}
}

View File

@@ -0,0 +1,17 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_present_wait.html>
use crate::prelude::*;
use crate::vk;
impl crate::khr::present_wait::Device {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkWaitForPresentKHR.html>
#[inline]
pub unsafe fn wait_for_present(
&self,
swapchain: vk::SwapchainKHR,
present_id: u64,
timeout: u64,
) -> VkResult<()> {
(self.fp.wait_for_present_khr)(self.handle, swapchain, present_id, timeout).result()
}
}

View File

@@ -0,0 +1,45 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_push_descriptor.html>
use crate::vk;
use core::ffi;
impl crate::khr::push_descriptor::Device {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdPushDescriptorSetKHR.html>
#[inline]
pub unsafe fn cmd_push_descriptor_set(
&self,
command_buffer: vk::CommandBuffer,
pipeline_bind_point: vk::PipelineBindPoint,
layout: vk::PipelineLayout,
set: u32,
descriptor_writes: &[vk::WriteDescriptorSet<'_>],
) {
(self.fp.cmd_push_descriptor_set_khr)(
command_buffer,
pipeline_bind_point,
layout,
set,
descriptor_writes.len() as u32,
descriptor_writes.as_ptr(),
)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdPushDescriptorSetWithTemplateKHR.html>
#[inline]
pub unsafe fn cmd_push_descriptor_set_with_template(
&self,
command_buffer: vk::CommandBuffer,
descriptor_update_template: vk::DescriptorUpdateTemplate,
layout: vk::PipelineLayout,
set: u32,
p_data: *const ffi::c_void,
) {
(self.fp.cmd_push_descriptor_set_with_template_khr)(
command_buffer,
descriptor_update_template,
layout,
set,
p_data,
)
}
}

View File

@@ -0,0 +1,17 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_ray_tracing_maintenance1.html>
use crate::vk;
impl crate::khr::ray_tracing_maintenance1::Device {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdTraceRaysIndirect2KHR.html>
///
/// `indirect_device_address` is a buffer device address which is a pointer to a [`vk::TraceRaysIndirectCommand2KHR`] structure containing the trace ray parameters.
#[inline]
pub unsafe fn cmd_trace_rays_indirect2(
&self,
command_buffer: vk::CommandBuffer,
indirect_device_address: vk::DeviceAddress,
) {
(self.fp.cmd_trace_rays_indirect2_khr)(command_buffer, indirect_device_address);
}
}

View File

@@ -0,0 +1,156 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_ray_tracing_pipeline.html>
use crate::prelude::*;
use crate::vk;
use crate::RawPtr;
use alloc::vec::Vec;
impl crate::khr::ray_tracing_pipeline::Device {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdTraceRaysKHR.html>
#[inline]
pub unsafe fn cmd_trace_rays(
&self,
command_buffer: vk::CommandBuffer,
raygen_shader_binding_tables: &vk::StridedDeviceAddressRegionKHR,
miss_shader_binding_tables: &vk::StridedDeviceAddressRegionKHR,
hit_shader_binding_tables: &vk::StridedDeviceAddressRegionKHR,
callable_shader_binding_tables: &vk::StridedDeviceAddressRegionKHR,
width: u32,
height: u32,
depth: u32,
) {
(self.fp.cmd_trace_rays_khr)(
command_buffer,
raygen_shader_binding_tables,
miss_shader_binding_tables,
hit_shader_binding_tables,
callable_shader_binding_tables,
width,
height,
depth,
);
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCreateRayTracingPipelinesKHR.html>
///
/// Pipelines are created and returned as described for [Multiple Pipeline Creation].
///
/// [Multiple Pipeline Creation]: https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#pipelines-multiple
#[inline]
pub unsafe fn create_ray_tracing_pipelines(
&self,
deferred_operation: vk::DeferredOperationKHR,
pipeline_cache: vk::PipelineCache,
create_infos: &[vk::RayTracingPipelineCreateInfoKHR<'_>],
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> Result<Vec<vk::Pipeline>, (Vec<vk::Pipeline>, vk::Result)> {
let mut pipelines = Vec::with_capacity(create_infos.len());
let err_code = (self.fp.create_ray_tracing_pipelines_khr)(
self.handle,
deferred_operation,
pipeline_cache,
create_infos.len() as u32,
create_infos.as_ptr(),
allocation_callbacks.as_raw_ptr(),
pipelines.as_mut_ptr(),
);
pipelines.set_len(create_infos.len());
match err_code {
vk::Result::SUCCESS => Ok(pipelines),
_ => Err((pipelines, err_code)),
}
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetRayTracingShaderGroupHandlesKHR.html>
#[inline]
pub unsafe fn get_ray_tracing_shader_group_handles(
&self,
pipeline: vk::Pipeline,
first_group: u32,
group_count: u32,
data_size: usize,
) -> VkResult<Vec<u8>> {
let mut data = Vec::<u8>::with_capacity(data_size);
(self.fp.get_ray_tracing_shader_group_handles_khr)(
self.handle,
pipeline,
first_group,
group_count,
data_size,
data.as_mut_ptr().cast(),
)
.set_vec_len_on_success(data, data_size)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetRayTracingCaptureReplayShaderGroupHandlesKHR.html>
#[inline]
pub unsafe fn get_ray_tracing_capture_replay_shader_group_handles(
&self,
pipeline: vk::Pipeline,
first_group: u32,
group_count: u32,
data_size: usize,
) -> VkResult<Vec<u8>> {
let mut data = Vec::<u8>::with_capacity(data_size);
(self
.fp
.get_ray_tracing_capture_replay_shader_group_handles_khr)(
self.handle,
pipeline,
first_group,
group_count,
data_size,
data.as_mut_ptr().cast(),
)
.set_vec_len_on_success(data, data_size)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdTraceRaysIndirectKHR.html>
///
/// `indirect_device_address` is a buffer device address which is a pointer to a [`vk::TraceRaysIndirectCommandKHR`] structure containing the trace ray parameters.
#[inline]
pub unsafe fn cmd_trace_rays_indirect(
&self,
command_buffer: vk::CommandBuffer,
raygen_shader_binding_table: &vk::StridedDeviceAddressRegionKHR,
miss_shader_binding_table: &vk::StridedDeviceAddressRegionKHR,
hit_shader_binding_table: &vk::StridedDeviceAddressRegionKHR,
callable_shader_binding_table: &vk::StridedDeviceAddressRegionKHR,
indirect_device_address: vk::DeviceAddress,
) {
(self.fp.cmd_trace_rays_indirect_khr)(
command_buffer,
raygen_shader_binding_table,
miss_shader_binding_table,
hit_shader_binding_table,
callable_shader_binding_table,
indirect_device_address,
);
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetRayTracingShaderGroupStackSizeKHR.html>
#[inline]
pub unsafe fn get_ray_tracing_shader_group_stack_size(
&self,
pipeline: vk::Pipeline,
group: u32,
group_shader: vk::ShaderGroupShaderKHR,
) -> vk::DeviceSize {
(self.fp.get_ray_tracing_shader_group_stack_size_khr)(
self.handle,
pipeline,
group,
group_shader,
)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetRayTracingPipelineStackSizeKHR.html>
#[inline]
pub unsafe fn cmd_set_ray_tracing_pipeline_stack_size(
&self,
command_buffer: vk::CommandBuffer,
pipeline_stack_size: u32,
) {
(self.fp.cmd_set_ray_tracing_pipeline_stack_size_khr)(command_buffer, pipeline_stack_size);
}
}

View File

@@ -0,0 +1,39 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_sampler_ycbcr_conversion.html>
use crate::prelude::*;
use crate::vk;
use crate::RawPtr;
use core::mem;
impl crate::khr::sampler_ycbcr_conversion::Device {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCreateSamplerYcbcrConversion.html>
#[inline]
pub unsafe fn create_sampler_ycbcr_conversion(
&self,
create_info: &vk::SamplerYcbcrConversionCreateInfo<'_>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<vk::SamplerYcbcrConversion> {
let mut ycbcr_conversion = mem::MaybeUninit::uninit();
(self.fp.create_sampler_ycbcr_conversion_khr)(
self.handle,
create_info,
allocation_callbacks.as_raw_ptr(),
ycbcr_conversion.as_mut_ptr(),
)
.assume_init_on_success(ycbcr_conversion)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkDestroySamplerYcbcrConversion.html>
#[inline]
pub unsafe fn destroy_sampler_ycbcr_conversion(
&self,
ycbcr_conversion: vk::SamplerYcbcrConversion,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) {
(self.fp.destroy_sampler_ycbcr_conversion_khr)(
self.handle,
ycbcr_conversion,
allocation_callbacks.as_raw_ptr(),
)
}
}

83
vendor/ash/src/extensions/khr/surface.rs vendored Executable file
View File

@@ -0,0 +1,83 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_surface.html>
use crate::prelude::*;
use crate::vk;
use crate::RawPtr;
use alloc::vec::Vec;
use core::mem;
impl crate::khr::surface::Instance {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceSurfaceSupportKHR.html>
#[inline]
pub unsafe fn get_physical_device_surface_support(
&self,
physical_device: vk::PhysicalDevice,
queue_family_index: u32,
surface: vk::SurfaceKHR,
) -> VkResult<bool> {
let mut b = mem::MaybeUninit::uninit();
(self.fp.get_physical_device_surface_support_khr)(
physical_device,
queue_family_index,
surface,
b.as_mut_ptr(),
)
.result()?;
Ok(b.assume_init() > 0)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceSurfacePresentModesKHR.html>
#[inline]
pub unsafe fn get_physical_device_surface_present_modes(
&self,
physical_device: vk::PhysicalDevice,
surface: vk::SurfaceKHR,
) -> VkResult<Vec<vk::PresentModeKHR>> {
read_into_uninitialized_vector(|count, data| {
(self.fp.get_physical_device_surface_present_modes_khr)(
physical_device,
surface,
count,
data,
)
})
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceSurfaceCapabilitiesKHR.html>
#[inline]
pub unsafe fn get_physical_device_surface_capabilities(
&self,
physical_device: vk::PhysicalDevice,
surface: vk::SurfaceKHR,
) -> VkResult<vk::SurfaceCapabilitiesKHR> {
let mut surface_capabilities = mem::MaybeUninit::uninit();
(self.fp.get_physical_device_surface_capabilities_khr)(
physical_device,
surface,
surface_capabilities.as_mut_ptr(),
)
.assume_init_on_success(surface_capabilities)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceSurfaceFormatsKHR.html>
#[inline]
pub unsafe fn get_physical_device_surface_formats(
&self,
physical_device: vk::PhysicalDevice,
surface: vk::SurfaceKHR,
) -> VkResult<Vec<vk::SurfaceFormatKHR>> {
read_into_uninitialized_vector(|count, data| {
(self.fp.get_physical_device_surface_formats_khr)(physical_device, surface, count, data)
})
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkDestroySurfaceKHR.html>
#[inline]
pub unsafe fn destroy_surface(
&self,
surface: vk::SurfaceKHR,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) {
(self.fp.destroy_surface_khr)(self.handle, surface, allocation_callbacks.as_raw_ptr());
}
}

190
vendor/ash/src/extensions/khr/swapchain.rs vendored Executable file
View File

@@ -0,0 +1,190 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_swapchain.html>
#[cfg(doc)]
use crate::khr;
use crate::prelude::*;
use crate::vk;
use crate::RawPtr;
use alloc::vec::Vec;
use core::mem;
impl crate::khr::swapchain::Device {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCreateSwapchainKHR.html>
#[inline]
pub unsafe fn create_swapchain(
&self,
create_info: &vk::SwapchainCreateInfoKHR<'_>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<vk::SwapchainKHR> {
let mut swapchain = mem::MaybeUninit::uninit();
(self.fp.create_swapchain_khr)(
self.handle,
create_info,
allocation_callbacks.as_raw_ptr(),
swapchain.as_mut_ptr(),
)
.assume_init_on_success(swapchain)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkDestroySwapchainKHR.html>
#[inline]
pub unsafe fn destroy_swapchain(
&self,
swapchain: vk::SwapchainKHR,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) {
(self.fp.destroy_swapchain_khr)(self.handle, swapchain, allocation_callbacks.as_raw_ptr());
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetSwapchainImagesKHR.html>
#[inline]
pub unsafe fn get_swapchain_images(
&self,
swapchain: vk::SwapchainKHR,
) -> VkResult<Vec<vk::Image>> {
read_into_uninitialized_vector(|count, data| {
(self.fp.get_swapchain_images_khr)(self.handle, swapchain, count, data)
})
}
/// On success, returns the next image's index and whether the swapchain is suboptimal for the surface.
///
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkAcquireNextImageKHR.html>
#[inline]
pub unsafe fn acquire_next_image(
&self,
swapchain: vk::SwapchainKHR,
timeout: u64,
semaphore: vk::Semaphore,
fence: vk::Fence,
) -> VkResult<(u32, bool)> {
let mut index = mem::MaybeUninit::uninit();
let err_code = (self.fp.acquire_next_image_khr)(
self.handle,
swapchain,
timeout,
semaphore,
fence,
index.as_mut_ptr(),
);
match err_code {
vk::Result::SUCCESS => Ok((index.assume_init(), false)),
vk::Result::SUBOPTIMAL_KHR => Ok((index.assume_init(), true)),
_ => Err(err_code),
}
}
/// On success, returns whether the swapchain is suboptimal for the surface.
///
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkQueuePresentKHR.html>
#[inline]
pub unsafe fn queue_present(
&self,
queue: vk::Queue,
present_info: &vk::PresentInfoKHR<'_>,
) -> VkResult<bool> {
let err_code = (self.fp.queue_present_khr)(queue, present_info);
match err_code {
vk::Result::SUCCESS => Ok(false),
vk::Result::SUBOPTIMAL_KHR => Ok(true),
_ => Err(err_code),
}
}
/// Only available since [Vulkan 1.1].
///
/// Also available as [`khr::device_group::Device::get_device_group_present_capabilities()`]
/// when [`VK_KHR_surface`] is enabled.
///
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetDeviceGroupPresentCapabilitiesKHR.html>
///
/// [Vulkan 1.1]: https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_VERSION_1_1.html
/// [`VK_KHR_surface`]: https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_surface.html
#[inline]
pub unsafe fn get_device_group_present_capabilities(
&self,
device_group_present_capabilities: &mut vk::DeviceGroupPresentCapabilitiesKHR<'_>,
) -> VkResult<()> {
(self.fp.get_device_group_present_capabilities_khr)(
self.handle,
device_group_present_capabilities,
)
.result()
}
/// Only available since [Vulkan 1.1].
///
/// Also available as [`khr::device_group::Device::get_device_group_surface_present_modes()`]
/// when [`VK_KHR_surface`] is enabled.
///
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetDeviceGroupSurfacePresentModesKHR.html>
///
/// [Vulkan 1.1]: https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_VERSION_1_1.html
/// [`VK_KHR_surface`]: https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_surface.html
#[inline]
pub unsafe fn get_device_group_surface_present_modes(
&self,
surface: vk::SurfaceKHR,
) -> VkResult<vk::DeviceGroupPresentModeFlagsKHR> {
let mut modes = mem::MaybeUninit::uninit();
(self.fp.get_device_group_surface_present_modes_khr)(
self.handle,
surface,
modes.as_mut_ptr(),
)
.assume_init_on_success(modes)
}
/// On success, returns the next image's index and whether the swapchain is suboptimal for the surface.
///
/// Only available since [Vulkan 1.1].
///
/// Also available as [`khr::device_group::Device::acquire_next_image2()`]
/// when [`VK_KHR_swapchain`] is enabled.
///
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkAcquireNextImage2KHR.html>
///
/// [Vulkan 1.1]: https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_VERSION_1_1.html
/// [`VK_KHR_swapchain`]: https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_swapchain.html
#[inline]
pub unsafe fn acquire_next_image2(
&self,
acquire_info: &vk::AcquireNextImageInfoKHR<'_>,
) -> VkResult<(u32, bool)> {
let mut index = mem::MaybeUninit::uninit();
let err_code =
(self.fp.acquire_next_image2_khr)(self.handle, acquire_info, index.as_mut_ptr());
match err_code {
vk::Result::SUCCESS => Ok((index.assume_init(), false)),
vk::Result::SUBOPTIMAL_KHR => Ok((index.assume_init(), true)),
_ => Err(err_code),
}
}
}
impl crate::khr::swapchain::Instance {
/// Only available since [Vulkan 1.1].
///
/// Also available as [`khr::device_group::Instance::get_physical_device_present_rectangles()`]
/// when [`VK_KHR_surface`] is enabled.
///
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDevicePresentRectanglesKHR.html>
///
/// [Vulkan 1.1]: https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_VERSION_1_1.html
/// [`VK_KHR_surface`]: https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_surface.html
#[inline]
pub unsafe fn get_physical_device_present_rectangles(
&self,
physical_device: vk::PhysicalDevice,
surface: vk::SurfaceKHR,
) -> VkResult<Vec<vk::Rect2D>> {
read_into_uninitialized_vector(|count, data| {
(self.fp.get_physical_device_present_rectangles_khr)(
physical_device,
surface,
count,
data,
)
})
}
}

View File

@@ -0,0 +1,78 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_synchronization2.html>
use crate::prelude::*;
use crate::vk;
impl crate::khr::synchronization2::Device {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdPipelineBarrier2KHR.html>
#[inline]
pub unsafe fn cmd_pipeline_barrier2(
&self,
command_buffer: vk::CommandBuffer,
dependency_info: &vk::DependencyInfoKHR<'_>,
) {
(self.fp.cmd_pipeline_barrier2_khr)(command_buffer, dependency_info)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdResetEvent2KHR.html>
#[inline]
pub unsafe fn cmd_reset_event2(
&self,
command_buffer: vk::CommandBuffer,
event: vk::Event,
stage_mask: vk::PipelineStageFlags2KHR,
) {
(self.fp.cmd_reset_event2_khr)(command_buffer, event, stage_mask)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetEvent2KHR.html>
#[inline]
pub unsafe fn cmd_set_event2(
&self,
command_buffer: vk::CommandBuffer,
event: vk::Event,
dependency_info: &vk::DependencyInfoKHR<'_>,
) {
(self.fp.cmd_set_event2_khr)(command_buffer, event, dependency_info)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdWaitEvents2KHR.html>
#[inline]
pub unsafe fn cmd_wait_events2(
&self,
command_buffer: vk::CommandBuffer,
events: &[vk::Event],
dependency_infos: &[vk::DependencyInfoKHR<'_>],
) {
assert_eq!(events.len(), dependency_infos.len());
(self.fp.cmd_wait_events2_khr)(
command_buffer,
events.len() as u32,
events.as_ptr(),
dependency_infos.as_ptr(),
)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdWriteTimestamp2KHR.html>
#[inline]
pub unsafe fn cmd_write_timestamp2(
&self,
command_buffer: vk::CommandBuffer,
stage: vk::PipelineStageFlags2KHR,
query_pool: vk::QueryPool,
query: u32,
) {
(self.fp.cmd_write_timestamp2_khr)(command_buffer, stage, query_pool, query)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkQueueSubmit2KHR.html>
#[inline]
pub unsafe fn queue_submit2(
&self,
queue: vk::Queue,
submits: &[vk::SubmitInfo2KHR<'_>],
fence: vk::Fence,
) -> VkResult<()> {
(self.fp.queue_submit2_khr)(queue, submits.len() as u32, submits.as_ptr(), fence).result()
}
}

View File

@@ -0,0 +1,34 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_timeline_semaphore.html>
use crate::prelude::*;
use crate::vk;
use core::mem;
impl crate::khr::timeline_semaphore::Device {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetSemaphoreCounterValue.html>
#[inline]
pub unsafe fn get_semaphore_counter_value(&self, semaphore: vk::Semaphore) -> VkResult<u64> {
let mut value = mem::MaybeUninit::uninit();
(self.fp.get_semaphore_counter_value_khr)(self.handle, semaphore, value.as_mut_ptr())
.assume_init_on_success(value)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkWaitSemaphores.html>
#[inline]
pub unsafe fn wait_semaphores(
&self,
wait_info: &vk::SemaphoreWaitInfo<'_>,
timeout: u64,
) -> VkResult<()> {
(self.fp.wait_semaphores_khr)(self.handle, wait_info, timeout).result()
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkSignalSemaphore.html>
#[inline]
pub unsafe fn signal_semaphore(
&self,
signal_info: &vk::SemaphoreSignalInfo<'_>,
) -> VkResult<()> {
(self.fp.signal_semaphore_khr)(self.handle, signal_info).result()
}
}

View File

@@ -0,0 +1,42 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_wayland_surface.html>
use crate::prelude::*;
use crate::vk;
use crate::RawPtr;
use core::mem;
impl crate::khr::wayland_surface::Instance {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCreateWaylandSurfaceKHR.html>
#[inline]
pub unsafe fn create_wayland_surface(
&self,
create_info: &vk::WaylandSurfaceCreateInfoKHR<'_>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<vk::SurfaceKHR> {
let mut surface = mem::MaybeUninit::uninit();
(self.fp.create_wayland_surface_khr)(
self.handle,
create_info,
allocation_callbacks.as_raw_ptr(),
surface.as_mut_ptr(),
)
.assume_init_on_success(surface)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceWaylandPresentationSupportKHR.html>
#[inline]
pub unsafe fn get_physical_device_wayland_presentation_support(
&self,
physical_device: vk::PhysicalDevice,
queue_family_index: u32,
wl_display: &mut vk::wl_display,
) -> bool {
let b = (self.fp.get_physical_device_wayland_presentation_support_khr)(
physical_device,
queue_family_index,
wl_display,
);
b > 0
}
}

View File

@@ -0,0 +1,40 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_win32_surface.html>
use crate::prelude::*;
use crate::vk;
use crate::RawPtr;
use core::mem;
impl crate::khr::win32_surface::Instance {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCreateWin32SurfaceKHR.html>
#[inline]
pub unsafe fn create_win32_surface(
&self,
create_info: &vk::Win32SurfaceCreateInfoKHR<'_>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<vk::SurfaceKHR> {
let mut surface = mem::MaybeUninit::uninit();
(self.fp.create_win32_surface_khr)(
self.handle,
create_info,
allocation_callbacks.as_raw_ptr(),
surface.as_mut_ptr(),
)
.assume_init_on_success(surface)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceWin32PresentationSupportKHR.html>
#[inline]
pub unsafe fn get_physical_device_win32_presentation_support(
&self,
physical_device: vk::PhysicalDevice,
queue_family_index: u32,
) -> bool {
let b = (self.fp.get_physical_device_win32_presentation_support_khr)(
physical_device,
queue_family_index,
);
b > 0
}
}

44
vendor/ash/src/extensions/khr/xcb_surface.rs vendored Executable file
View File

@@ -0,0 +1,44 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_xcb_surface.html>
use crate::prelude::*;
use crate::vk;
use crate::RawPtr;
use core::mem;
impl crate::khr::xcb_surface::Instance {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCreateXcbSurfaceKHR.html>
#[inline]
pub unsafe fn create_xcb_surface(
&self,
create_info: &vk::XcbSurfaceCreateInfoKHR<'_>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<vk::SurfaceKHR> {
let mut surface = mem::MaybeUninit::uninit();
(self.fp.create_xcb_surface_khr)(
self.handle,
create_info,
allocation_callbacks.as_raw_ptr(),
surface.as_mut_ptr(),
)
.assume_init_on_success(surface)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceXcbPresentationSupportKHR.html>
#[inline]
pub unsafe fn get_physical_device_xcb_presentation_support(
&self,
physical_device: vk::PhysicalDevice,
queue_family_index: u32,
connection: &mut vk::xcb_connection_t,
visual_id: vk::xcb_visualid_t,
) -> bool {
let b = (self.fp.get_physical_device_xcb_presentation_support_khr)(
physical_device,
queue_family_index,
connection,
visual_id,
);
b > 0
}
}

44
vendor/ash/src/extensions/khr/xlib_surface.rs vendored Executable file
View File

@@ -0,0 +1,44 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_xlib_surface.html>
use crate::prelude::*;
use crate::vk;
use crate::RawPtr;
use core::mem;
impl crate::khr::xlib_surface::Instance {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCreateXlibSurfaceKHR.html>
#[inline]
pub unsafe fn create_xlib_surface(
&self,
create_info: &vk::XlibSurfaceCreateInfoKHR<'_>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<vk::SurfaceKHR> {
let mut surface = mem::MaybeUninit::uninit();
(self.fp.create_xlib_surface_khr)(
self.handle,
create_info,
allocation_callbacks.as_raw_ptr(),
surface.as_mut_ptr(),
)
.assume_init_on_success(surface)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceXlibPresentationSupportKHR.html>
#[inline]
pub unsafe fn get_physical_device_xlib_presentation_support(
&self,
physical_device: vk::PhysicalDevice,
queue_family_index: u32,
display: *mut vk::Display,
visual_id: vk::VisualID,
) -> bool {
let b = (self.fp.get_physical_device_xlib_presentation_support_khr)(
physical_device,
queue_family_index,
display,
visual_id,
);
b > 0
}
}

9
vendor/ash/src/extensions/mod.rs vendored Normal file
View File

@@ -0,0 +1,9 @@
pub mod amd;
pub mod amdx;
pub mod android;
pub mod ext;
pub mod google;
pub mod khr;
pub mod mvk;
pub mod nn;
pub mod nv;

25
vendor/ash/src/extensions/mvk/ios_surface.rs vendored Executable file
View File

@@ -0,0 +1,25 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_MVK_ios_surface.html>
use crate::prelude::*;
use crate::vk;
use crate::RawPtr;
use core::mem;
impl crate::mvk::ios_surface::Instance {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCreateIOSSurfaceMVK.html>
#[inline]
pub unsafe fn create_ios_surface(
&self,
create_info: &vk::IOSSurfaceCreateInfoMVK<'_>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<vk::SurfaceKHR> {
let mut surface = mem::MaybeUninit::uninit();
(self.fp.create_ios_surface_mvk)(
self.handle,
create_info,
allocation_callbacks.as_raw_ptr(),
surface.as_mut_ptr(),
)
.assume_init_on_success(surface)
}
}

View File

@@ -0,0 +1,25 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_MVK_macos_surface.html>
use crate::prelude::*;
use crate::vk;
use crate::RawPtr;
use core::mem;
impl crate::mvk::macos_surface::Instance {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCreateMacOSSurfaceMVK.html>
#[inline]
pub unsafe fn create_mac_os_surface(
&self,
create_info: &vk::MacOSSurfaceCreateInfoMVK<'_>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<vk::SurfaceKHR> {
let mut surface = mem::MaybeUninit::uninit();
(self.fp.create_mac_os_surface_mvk)(
self.handle,
create_info,
allocation_callbacks.as_raw_ptr(),
surface.as_mut_ptr(),
)
.assume_init_on_success(surface)
}
}

2
vendor/ash/src/extensions/mvk/mod.rs vendored Normal file
View File

@@ -0,0 +1,2 @@
pub mod ios_surface;
pub mod macos_surface;

1
vendor/ash/src/extensions/nn/mod.rs vendored Normal file
View File

@@ -0,0 +1 @@
pub mod vi_surface;

View File

@@ -0,0 +1,25 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_NN_vi_surface.html>
use crate::prelude::*;
use crate::vk;
use crate::RawPtr;
use core::mem;
impl crate::nn::vi_surface::Instance {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCreateViSurfaceNN.html>
#[inline]
pub unsafe fn create_vi_surface(
&self,
create_info: &vk::ViSurfaceCreateInfoNN<'_>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<vk::SurfaceKHR> {
let mut surface = mem::MaybeUninit::uninit();
(self.fp.create_vi_surface_nn)(
self.handle,
create_info,
allocation_callbacks.as_raw_ptr(),
surface.as_mut_ptr(),
)
.assume_init_on_success(surface)
}
}

View File

@@ -0,0 +1,52 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_NV_copy_memory_indirect.html>
use crate::vk;
impl crate::nv::copy_memory_indirect::Device {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdCopyMemoryIndirectNV.html>
///
/// `copy_buffer_address` is a buffer device address which is a pointer to an array of
/// `copy_count` number of [`vk::CopyMemoryIndirectCommandNV`] structures containing the copy
/// parameters, each `stride` bytes apart.
#[inline]
pub unsafe fn cmd_copy_memory_indirect(
&self,
command_buffer: vk::CommandBuffer,
copy_buffer_address: vk::DeviceAddress,
copy_count: u32,
stride: u32,
) {
(self.fp.cmd_copy_memory_indirect_nv)(
command_buffer,
copy_buffer_address,
copy_count,
stride,
)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdCopyMemoryToImageIndirectNV.html>
///
/// `copy_buffer_address` is a buffer device address which is a pointer to an array of
/// `image_subresources.len()` number of [`vk::CopyMemoryToImageIndirectCommandNV`] structures
/// containing the copy parameters, each `stride` bytes apart.
#[inline]
pub unsafe fn cmd_copy_memory_to_image_indirect(
&self,
command_buffer: vk::CommandBuffer,
copy_buffer_address: vk::DeviceAddress,
stride: u32,
dst_image: vk::Image,
dst_image_layout: vk::ImageLayout,
image_subresources: &[vk::ImageSubresourceLayers],
) {
(self.fp.cmd_copy_memory_to_image_indirect_nv)(
command_buffer,
copy_buffer_address,
image_subresources.len() as u32,
stride,
dst_image,
dst_image_layout,
image_subresources.as_ptr(),
)
}
}

View File

@@ -0,0 +1,49 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_NV_coverage_reduction_mode.html>
use crate::prelude::*;
use crate::vk;
use core::mem;
use core::ptr;
impl crate::nv::coverage_reduction_mode::Instance {
/// Retrieve the number of elements to pass to [`get_physical_device_supported_framebuffer_mixed_samples_combinations()`][Self::get_physical_device_supported_framebuffer_mixed_samples_combinations()]
#[inline]
pub unsafe fn get_physical_device_supported_framebuffer_mixed_samples_combinations_len(
&self,
physical_device: vk::PhysicalDevice,
) -> VkResult<usize> {
let mut count = mem::MaybeUninit::uninit();
(self
.fp
.get_physical_device_supported_framebuffer_mixed_samples_combinations_nv)(
physical_device,
count.as_mut_ptr(),
ptr::null_mut(),
)
.assume_init_on_success(count)
.map(|c| c as usize)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceSupportedFramebufferMixedSamplesCombinationsNV.html>
///
/// Call [`get_physical_device_supported_framebuffer_mixed_samples_combinations_len()`][Self::get_physical_device_supported_framebuffer_mixed_samples_combinations_len()] to query the number of elements to pass to `out`.
/// Be sure to [`Default::default()`]-initialize these elements and optionally set their `p_next` pointer.
#[inline]
pub unsafe fn get_physical_device_supported_framebuffer_mixed_samples_combinations(
&self,
physical_device: vk::PhysicalDevice,
out: &mut [vk::FramebufferMixedSamplesCombinationNV<'_>],
) -> VkResult<()> {
let mut count = out.len() as u32;
(self
.fp
.get_physical_device_supported_framebuffer_mixed_samples_combinations_nv)(
physical_device,
&mut count,
out.as_mut_ptr(),
)
.result()?;
assert_eq!(count as usize, out.len());
Ok(())
}
}

View File

@@ -0,0 +1,81 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_NV_cuda_kernel_launch.html>
use crate::prelude::*;
use crate::vk;
use crate::RawPtr;
use alloc::vec::Vec;
use core::mem;
impl crate::nv::cuda_kernel_launch::Device {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCreateCudaModuleNV.html>
#[inline]
pub unsafe fn create_cuda_module(
&self,
create_info: &vk::CudaModuleCreateInfoNV<'_>,
allocator: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<vk::CudaModuleNV> {
let mut module = mem::MaybeUninit::uninit();
(self.fp.create_cuda_module_nv)(
self.handle,
create_info,
allocator.as_raw_ptr(),
module.as_mut_ptr(),
)
.assume_init_on_success(module)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetCudaModuleCacheNV.html>
#[inline]
pub unsafe fn get_cuda_module_cache(&self, module: vk::CudaModuleNV) -> VkResult<Vec<u8>> {
read_into_uninitialized_vector(|cache_size, cache_data: *mut u8| {
(self.fp.get_cuda_module_cache_nv)(self.handle, module, cache_size, cache_data.cast())
})
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCreateCudaFunctionNV.html>
#[inline]
pub unsafe fn create_cuda_function(
&self,
create_info: &vk::CudaFunctionCreateInfoNV<'_>,
allocator: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<vk::CudaFunctionNV> {
let mut function = mem::MaybeUninit::uninit();
(self.fp.create_cuda_function_nv)(
self.handle,
create_info,
allocator.as_raw_ptr(),
function.as_mut_ptr(),
)
.assume_init_on_success(function)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkDestroyCudaModuleNV.html>
#[inline]
pub unsafe fn destroy_cuda_module(
&self,
module: vk::CudaModuleNV,
allocator: Option<&vk::AllocationCallbacks<'_>>,
) {
(self.fp.destroy_cuda_module_nv)(self.handle, module, allocator.as_raw_ptr())
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkDestroyCudaFunctionNV.html>
#[inline]
pub unsafe fn destroy_cuda_function(
&self,
function: vk::CudaFunctionNV,
allocator: Option<&vk::AllocationCallbacks<'_>>,
) {
(self.fp.destroy_cuda_function_nv)(self.handle, function, allocator.as_raw_ptr())
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdCudaLaunchKernelNV.html>
#[inline]
pub unsafe fn cmd_cuda_launch_kernel(
&self,
command_buffer: vk::CommandBuffer,
launch_info: &vk::CudaLaunchInfoNV<'_>,
) {
(self.fp.cmd_cuda_launch_kernel_nv)(command_buffer, launch_info)
}
}

View File

@@ -0,0 +1,41 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_NV_device_diagnostic_checkpoints.html>
use crate::vk;
use core::ffi;
use core::mem;
use core::ptr;
impl crate::nv::device_diagnostic_checkpoints::Device {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdSetCheckpointNV.html>
#[inline]
pub unsafe fn cmd_set_checkpoint(
&self,
command_buffer: vk::CommandBuffer,
p_checkpoint_marker: *const ffi::c_void,
) {
(self.fp.cmd_set_checkpoint_nv)(command_buffer, p_checkpoint_marker);
}
/// Retrieve the number of elements to pass to [`get_queue_checkpoint_data()`][Self::get_queue_checkpoint_data()]
#[inline]
pub unsafe fn get_queue_checkpoint_data_len(&self, queue: vk::Queue) -> usize {
let mut count = mem::MaybeUninit::uninit();
(self.fp.get_queue_checkpoint_data_nv)(queue, count.as_mut_ptr(), ptr::null_mut());
count.assume_init() as usize
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetQueueCheckpointDataNV.html>
///
/// Call [`get_queue_checkpoint_data_len()`][Self::get_queue_checkpoint_data_len()] to query the number of elements to pass to `out`.
/// Be sure to [`Default::default()`]-initialize these elements and optionally set their `p_next` pointer.
#[inline]
pub unsafe fn get_queue_checkpoint_data(
&self,
queue: vk::Queue,
out: &mut [vk::CheckpointDataNV<'_>],
) {
let mut count = out.len() as u32;
(self.fp.get_queue_checkpoint_data_nv)(queue, &mut count, out.as_mut_ptr());
assert_eq!(count as usize, out.len());
}
}

View File

@@ -0,0 +1,43 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_NV_device_generated_commands_compute.html>
use crate::vk;
impl crate::nv::device_generated_commands_compute::Device {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetPipelineIndirectMemoryRequirementsNV.html>
#[inline]
pub unsafe fn get_pipeline_indirect_memory_requirements(
&self,
create_info: &vk::ComputePipelineCreateInfo<'_>,
memory_requirements: &mut vk::MemoryRequirements2<'_>,
) {
(self.fp.get_pipeline_indirect_memory_requirements_nv)(
self.handle,
create_info,
memory_requirements,
)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdUpdatePipelineIndirectBufferNV.html>
#[inline]
pub unsafe fn cmd_update_pipeline_indirect_buffer(
&self,
command_buffer: vk::CommandBuffer,
pipeline_bind_point: vk::PipelineBindPoint,
pipeline: vk::Pipeline,
) {
(self.fp.cmd_update_pipeline_indirect_buffer_nv)(
command_buffer,
pipeline_bind_point,
pipeline,
)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetPipelineIndirectDeviceAddressNV.html>
#[inline]
pub unsafe fn get_pipeline_indirect_device_address(
&self,
info: &vk::PipelineIndirectDeviceAddressInfoNV<'_>,
) -> vk::DeviceAddress {
(self.fp.get_pipeline_indirect_device_address_nv)(self.handle, info)
}
}

View File

@@ -0,0 +1,58 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_NV_low_latency2.html>
use crate::prelude::*;
use crate::vk;
use crate::RawPtr;
impl crate::nv::low_latency2::Device {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkSetLatencySleepModeNV.html>
#[inline]
pub unsafe fn set_latency_sleep_mode(
&self,
swapchain: vk::SwapchainKHR,
sleep_mode_info: Option<&vk::LatencySleepModeInfoNV<'_>>,
) -> VkResult<()> {
(self.fp.set_latency_sleep_mode_nv)(self.handle, swapchain, sleep_mode_info.as_raw_ptr())
.result()
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkLatencySleepNV.html>
#[inline]
pub unsafe fn latency_sleep(
&self,
swapchain: vk::SwapchainKHR,
sleep_info: &vk::LatencySleepInfoNV<'_>,
) -> VkResult<()> {
(self.fp.latency_sleep_nv)(self.handle, swapchain, sleep_info).result()
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkSetLatencyMarkerNV.html>
#[inline]
pub unsafe fn set_latency_marker(
&self,
swapchain: vk::SwapchainKHR,
latency_marker_info: &vk::SetLatencyMarkerInfoNV<'_>,
) {
(self.fp.set_latency_marker_nv)(self.handle, swapchain, latency_marker_info)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetLatencyTimingsNV.html>
#[inline]
pub unsafe fn get_latency_timings(
&self,
swapchain: vk::SwapchainKHR,
latency_marker_info: &mut vk::GetLatencyMarkerInfoNV<'_>,
) {
(self.fp.get_latency_timings_nv)(self.handle, swapchain, latency_marker_info)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkQueueNotifyOutOfBandNV.html>
#[inline]
pub unsafe fn queue_notify_out_of_band(
&self,
queue: vk::Queue,
queue_type_info: &vk::OutOfBandQueueTypeInfoNV<'_>,
) {
(self.fp.queue_notify_out_of_band_nv)(queue, queue_type_info)
}
}

View File

@@ -0,0 +1,34 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_NV_memory_decompression.html>
use crate::vk;
impl crate::nv::memory_decompression::Device {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdDecompressMemoryNV.html>
pub unsafe fn cmd_decompress_memory(
&self,
command_buffer: vk::CommandBuffer,
decompress_memory_regions: &[vk::DecompressMemoryRegionNV],
) {
(self.fp.cmd_decompress_memory_nv)(
command_buffer,
decompress_memory_regions.len() as u32,
decompress_memory_regions.as_ptr(),
)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdDecompressMemoryIndirectCountNV.html>
pub unsafe fn cmd_decompress_memory_indirect_count(
&self,
command_buffer: vk::CommandBuffer,
indirect_commands_address: vk::DeviceAddress,
indirect_commands_count_address: vk::DeviceAddress,
stride: u32,
) {
(self.fp.cmd_decompress_memory_indirect_count_nv)(
command_buffer,
indirect_commands_address,
indirect_commands_count_address,
stride,
)
}
}

58
vendor/ash/src/extensions/nv/mesh_shader.rs vendored Executable file
View File

@@ -0,0 +1,58 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_NV_mesh_shader.html>
use crate::vk;
impl crate::nv::mesh_shader::Device {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdDrawMeshTasksNV.html>
#[inline]
pub unsafe fn cmd_draw_mesh_tasks(
&self,
command_buffer: vk::CommandBuffer,
task_count: u32,
first_task: u32,
) {
(self.fp.cmd_draw_mesh_tasks_nv)(command_buffer, task_count, first_task);
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdDrawMeshTasksIndirectNV.html>
#[inline]
pub unsafe fn cmd_draw_mesh_tasks_indirect(
&self,
command_buffer: vk::CommandBuffer,
buffer: vk::Buffer,
offset: vk::DeviceSize,
draw_count: u32,
stride: u32,
) {
(self.fp.cmd_draw_mesh_tasks_indirect_nv)(
command_buffer,
buffer,
offset,
draw_count,
stride,
);
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdDrawMeshTasksIndirectCountNV.html>
#[inline]
pub unsafe fn cmd_draw_mesh_tasks_indirect_count(
&self,
command_buffer: vk::CommandBuffer,
buffer: vk::Buffer,
offset: vk::DeviceSize,
count_buffer: vk::Buffer,
count_buffer_offset: vk::DeviceSize,
max_draw_count: u32,
stride: u32,
) {
(self.fp.cmd_draw_mesh_tasks_indirect_count_nv)(
command_buffer,
buffer,
offset,
count_buffer,
count_buffer_offset,
max_draw_count,
stride,
);
}
}

9
vendor/ash/src/extensions/nv/mod.rs vendored Normal file
View File

@@ -0,0 +1,9 @@
pub mod copy_memory_indirect;
pub mod coverage_reduction_mode;
pub mod cuda_kernel_launch;
pub mod device_diagnostic_checkpoints;
pub mod device_generated_commands_compute;
pub mod low_latency2;
pub mod memory_decompression;
pub mod mesh_shader;
pub mod ray_tracing;

237
vendor/ash/src/extensions/nv/ray_tracing.rs vendored Executable file
View File

@@ -0,0 +1,237 @@
//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_NV_ray_tracing.html>
use crate::prelude::*;
use crate::vk;
use crate::RawPtr;
use alloc::vec::Vec;
use core::mem;
impl crate::nv::ray_tracing::Device {
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCreateAccelerationStructureNV.html>
#[inline]
pub unsafe fn create_acceleration_structure(
&self,
create_info: &vk::AccelerationStructureCreateInfoNV<'_>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<vk::AccelerationStructureNV> {
let mut accel_struct = mem::MaybeUninit::uninit();
(self.fp.create_acceleration_structure_nv)(
self.handle,
create_info,
allocation_callbacks.as_raw_ptr(),
accel_struct.as_mut_ptr(),
)
.assume_init_on_success(accel_struct)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkDestroyAccelerationStructureNV.html>
#[inline]
pub unsafe fn destroy_acceleration_structure(
&self,
accel_struct: vk::AccelerationStructureNV,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) {
(self.fp.destroy_acceleration_structure_nv)(
self.handle,
accel_struct,
allocation_callbacks.as_raw_ptr(),
);
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetAccelerationStructureMemoryRequirementsNV.html>
#[inline]
pub unsafe fn get_acceleration_structure_memory_requirements(
&self,
info: &vk::AccelerationStructureMemoryRequirementsInfoNV<'_>,
) -> vk::MemoryRequirements2KHR<'_> {
let mut requirements = Default::default();
(self.fp.get_acceleration_structure_memory_requirements_nv)(
self.handle,
info,
&mut requirements,
);
requirements
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkBindAccelerationStructureMemoryNV.html>
#[inline]
pub unsafe fn bind_acceleration_structure_memory(
&self,
bind_info: &[vk::BindAccelerationStructureMemoryInfoNV<'_>],
) -> VkResult<()> {
(self.fp.bind_acceleration_structure_memory_nv)(
self.handle,
bind_info.len() as u32,
bind_info.as_ptr(),
)
.result()
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdBuildAccelerationStructureNV.html>
#[inline]
pub unsafe fn cmd_build_acceleration_structure(
&self,
command_buffer: vk::CommandBuffer,
info: &vk::AccelerationStructureInfoNV<'_>,
instance_data: vk::Buffer,
instance_offset: vk::DeviceSize,
update: bool,
dst: vk::AccelerationStructureNV,
src: vk::AccelerationStructureNV,
scratch: vk::Buffer,
scratch_offset: vk::DeviceSize,
) {
(self.fp.cmd_build_acceleration_structure_nv)(
command_buffer,
info,
instance_data,
instance_offset,
if update { vk::TRUE } else { vk::FALSE },
dst,
src,
scratch,
scratch_offset,
);
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdCopyAccelerationStructureNV.html>
#[inline]
pub unsafe fn cmd_copy_acceleration_structure(
&self,
command_buffer: vk::CommandBuffer,
dst: vk::AccelerationStructureNV,
src: vk::AccelerationStructureNV,
mode: vk::CopyAccelerationStructureModeNV,
) {
(self.fp.cmd_copy_acceleration_structure_nv)(command_buffer, dst, src, mode);
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdTraceRaysNV.html>
#[inline]
pub unsafe fn cmd_trace_rays(
&self,
command_buffer: vk::CommandBuffer,
raygen_shader_binding_table_buffer: vk::Buffer,
raygen_shader_binding_offset: vk::DeviceSize,
miss_shader_binding_table_buffer: vk::Buffer,
miss_shader_binding_offset: vk::DeviceSize,
miss_shader_binding_stride: vk::DeviceSize,
hit_shader_binding_table_buffer: vk::Buffer,
hit_shader_binding_offset: vk::DeviceSize,
hit_shader_binding_stride: vk::DeviceSize,
callable_shader_binding_table_buffer: vk::Buffer,
callable_shader_binding_offset: vk::DeviceSize,
callable_shader_binding_stride: vk::DeviceSize,
width: u32,
height: u32,
depth: u32,
) {
(self.fp.cmd_trace_rays_nv)(
command_buffer,
raygen_shader_binding_table_buffer,
raygen_shader_binding_offset,
miss_shader_binding_table_buffer,
miss_shader_binding_offset,
miss_shader_binding_stride,
hit_shader_binding_table_buffer,
hit_shader_binding_offset,
hit_shader_binding_stride,
callable_shader_binding_table_buffer,
callable_shader_binding_offset,
callable_shader_binding_stride,
width,
height,
depth,
);
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCreateRayTracingPipelinesNV.html>
///
/// Pipelines are created and returned as described for [Multiple Pipeline Creation].
///
/// [Multiple Pipeline Creation]: https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#pipelines-multiple
#[inline]
pub unsafe fn create_ray_tracing_pipelines(
&self,
pipeline_cache: vk::PipelineCache,
create_infos: &[vk::RayTracingPipelineCreateInfoNV<'_>],
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> Result<Vec<vk::Pipeline>, (Vec<vk::Pipeline>, vk::Result)> {
let mut pipelines = Vec::with_capacity(create_infos.len());
let err_code = (self.fp.create_ray_tracing_pipelines_nv)(
self.handle,
pipeline_cache,
create_infos.len() as u32,
create_infos.as_ptr(),
allocation_callbacks.as_raw_ptr(),
pipelines.as_mut_ptr(),
);
pipelines.set_len(create_infos.len());
match err_code {
vk::Result::SUCCESS => Ok(pipelines),
_ => Err((pipelines, err_code)),
}
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetRayTracingShaderGroupHandlesNV.html>
#[inline]
pub unsafe fn get_ray_tracing_shader_group_handles(
&self,
pipeline: vk::Pipeline,
first_group: u32,
group_count: u32,
data: &mut [u8],
) -> VkResult<()> {
(self.fp.get_ray_tracing_shader_group_handles_nv)(
self.handle,
pipeline,
first_group,
group_count,
data.len(),
data.as_mut_ptr().cast(),
)
.result()
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetAccelerationStructureHandleNV.html>
#[inline]
pub unsafe fn get_acceleration_structure_handle(
&self,
accel_struct: vk::AccelerationStructureNV,
) -> VkResult<u64> {
let mut handle = mem::MaybeUninit::<u64>::uninit();
(self.fp.get_acceleration_structure_handle_nv)(
self.handle,
accel_struct,
mem::size_of_val(&handle),
handle.as_mut_ptr().cast(),
)
.assume_init_on_success(handle)
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdWriteAccelerationStructuresPropertiesNV.html>
#[inline]
pub unsafe fn cmd_write_acceleration_structures_properties(
&self,
command_buffer: vk::CommandBuffer,
structures: &[vk::AccelerationStructureNV],
query_type: vk::QueryType,
query_pool: vk::QueryPool,
first_query: u32,
) {
(self.fp.cmd_write_acceleration_structures_properties_nv)(
command_buffer,
structures.len() as u32,
structures.as_ptr(),
query_type,
query_pool,
first_query,
);
}
/// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCompileDeferredNV.html>
#[inline]
pub unsafe fn compile_deferred(&self, pipeline: vk::Pipeline, shader: u32) -> VkResult<()> {
(self.fp.compile_deferred_nv)(self.handle, pipeline, shader).result()
}
}

20474
vendor/ash/src/extensions_generated.rs vendored Normal file

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More