Omit wrapper functions on Fp structs (#599)

* Omit wrapper functions on Fp structs

These wrappers contributed thousands of lines of code but offered
insignificant ergonomic benefit as the same functions are also wrapped
at a higher level and, if necessary, wrapper functions can be called
directly.

* Standardize on direct fp table access in wrapper functions
This commit is contained in:
Benjamin Saunders 2022-03-22 15:50:18 -07:00 committed by GitHub
parent 1cd810653c
commit 84cddb7383
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
59 changed files with 1045 additions and 7400 deletions

View file

@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## Unreleased ## Unreleased
- Dropped auto-generated wrapper methods from function pointer structs
in favor of direct invocation of function pointers (#599)
### Added ### Added
- Update Vulkan-Headers to 1.3.208 (#597) - Update Vulkan-Headers to 1.3.208 (#597)

File diff suppressed because it is too large Load diff

View file

@ -144,7 +144,10 @@ impl Entry {
/// Vulkan 1.0, which must remain valid for at least the lifetime of the returned [`Entry`]. /// Vulkan 1.0, which must remain valid for at least the lifetime of the returned [`Entry`].
pub unsafe fn from_static_fn(static_fn: vk::StaticFn) -> Self { pub unsafe fn from_static_fn(static_fn: vk::StaticFn) -> Self {
let load_fn = |name: &std::ffi::CStr| { let load_fn = |name: &std::ffi::CStr| {
mem::transmute(static_fn.get_instance_proc_addr(vk::Instance::null(), name.as_ptr())) mem::transmute((static_fn.get_instance_proc_addr)(
vk::Instance::null(),
name.as_ptr(),
))
}; };
let entry_fn_1_0 = vk::EntryFnV1_0::load(load_fn); let entry_fn_1_0 = vk::EntryFnV1_0::load(load_fn);
let entry_fn_1_1 = vk::EntryFnV1_1::load(load_fn); let entry_fn_1_1 = vk::EntryFnV1_1::load(load_fn);
@ -192,10 +195,10 @@ impl Entry {
let mut api_version = 0; let mut api_version = 0;
let enumerate_instance_version: Option<vk::PFN_vkEnumerateInstanceVersion> = { let enumerate_instance_version: Option<vk::PFN_vkEnumerateInstanceVersion> = {
let name = b"vkEnumerateInstanceVersion\0".as_ptr() as *const _; let name = b"vkEnumerateInstanceVersion\0".as_ptr() as *const _;
mem::transmute( mem::transmute((self.static_fn.get_instance_proc_addr)(
self.static_fn vk::Instance::null(),
.get_instance_proc_addr(vk::Instance::null(), name), name,
) ))
}; };
if let Some(enumerate_instance_version) = enumerate_instance_version { if let Some(enumerate_instance_version) = enumerate_instance_version {
(enumerate_instance_version)(&mut api_version) (enumerate_instance_version)(&mut api_version)
@ -218,8 +221,7 @@ impl Entry {
allocation_callbacks: Option<&vk::AllocationCallbacks>, allocation_callbacks: Option<&vk::AllocationCallbacks>,
) -> VkResult<Instance> { ) -> VkResult<Instance> {
let mut instance = mem::zeroed(); let mut instance = mem::zeroed();
self.entry_fn_1_0 (self.entry_fn_1_0.create_instance)(
.create_instance(
create_info, create_info,
allocation_callbacks.as_raw_ptr(), allocation_callbacks.as_raw_ptr(),
&mut instance, &mut instance,
@ -232,8 +234,7 @@ impl Entry {
pub fn enumerate_instance_layer_properties(&self) -> VkResult<Vec<vk::LayerProperties>> { pub fn enumerate_instance_layer_properties(&self) -> VkResult<Vec<vk::LayerProperties>> {
unsafe { unsafe {
read_into_uninitialized_vector(|count, data| { read_into_uninitialized_vector(|count, data| {
self.entry_fn_1_0 (self.entry_fn_1_0.enumerate_instance_layer_properties)(count, data)
.enumerate_instance_layer_properties(count, data)
}) })
} }
} }
@ -245,7 +246,7 @@ impl Entry {
) -> VkResult<Vec<vk::ExtensionProperties>> { ) -> VkResult<Vec<vk::ExtensionProperties>> {
unsafe { unsafe {
read_into_uninitialized_vector(|count, data| { read_into_uninitialized_vector(|count, data| {
self.entry_fn_1_0.enumerate_instance_extension_properties( (self.entry_fn_1_0.enumerate_instance_extension_properties)(
layer_name.map_or(ptr::null(), |str| str.as_ptr()), layer_name.map_or(ptr::null(), |str| str.as_ptr()),
count, count,
data, data,
@ -260,7 +261,7 @@ impl Entry {
instance: vk::Instance, instance: vk::Instance,
p_name: *const c_char, p_name: *const c_char,
) -> vk::PFN_vkVoidFunction { ) -> vk::PFN_vkVoidFunction {
self.static_fn.get_instance_proc_addr(instance, p_name) (self.static_fn.get_instance_proc_addr)(instance, p_name)
} }
} }
@ -278,8 +279,7 @@ impl Entry {
pub fn enumerate_instance_version(&self) -> VkResult<u32> { pub fn enumerate_instance_version(&self) -> VkResult<u32> {
unsafe { unsafe {
let mut api_version = 0; let mut api_version = 0;
self.entry_fn_1_1 (self.entry_fn_1_1.enumerate_instance_version)(&mut api_version)
.enumerate_instance_version(&mut api_version)
.result_with_success(api_version) .result_with_success(api_version)
} }
} }

View file

@ -23,7 +23,7 @@ impl BufferDeviceAddress {
&self, &self,
info: &vk::BufferDeviceAddressInfoEXT, info: &vk::BufferDeviceAddressInfoEXT,
) -> vk::DeviceAddress { ) -> vk::DeviceAddress {
self.fp.get_buffer_device_address_ext(self.handle, info) (self.fp.get_buffer_device_address_ext)(self.handle, info)
} }
pub const fn name() -> &'static CStr { pub const fn name() -> &'static CStr {

View file

@ -25,8 +25,11 @@ impl CalibratedTimestamps {
physical_device: vk::PhysicalDevice, physical_device: vk::PhysicalDevice,
) -> VkResult<Vec<vk::TimeDomainEXT>> { ) -> VkResult<Vec<vk::TimeDomainEXT>> {
read_into_uninitialized_vector(|count, data| { read_into_uninitialized_vector(|count, data| {
self.fp (self.fp.get_physical_device_calibrateable_time_domains_ext)(
.get_physical_device_calibrateable_time_domains_ext(physical_device, count, data) physical_device,
count,
data,
)
}) })
} }
@ -40,8 +43,7 @@ impl CalibratedTimestamps {
) -> VkResult<(Vec<u64>, Vec<u64>)> { ) -> VkResult<(Vec<u64>, Vec<u64>)> {
let mut timestamps = vec![0u64; info.len()]; let mut timestamps = vec![0u64; info.len()];
let mut max_deviation = vec![0u64; info.len()]; let mut max_deviation = vec![0u64; info.len()];
self.fp (self.fp.get_calibrated_timestamps_ext)(
.get_calibrated_timestamps_ext(
device, device,
info.len() as u32, info.len() as u32,
info.as_ptr(), info.as_ptr(),

View file

@ -24,9 +24,7 @@ impl DebugMarker {
&self, &self,
name_info: &vk::DebugMarkerObjectNameInfoEXT, name_info: &vk::DebugMarkerObjectNameInfoEXT,
) -> VkResult<()> { ) -> VkResult<()> {
self.fp (self.fp.debug_marker_set_object_name_ext)(self.handle, name_info).result()
.debug_marker_set_object_name_ext(self.handle, name_info)
.result()
} }
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdDebugMarkerBeginEXT.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdDebugMarkerBeginEXT.html>
@ -35,13 +33,12 @@ impl DebugMarker {
command_buffer: vk::CommandBuffer, command_buffer: vk::CommandBuffer,
marker_info: &vk::DebugMarkerMarkerInfoEXT, marker_info: &vk::DebugMarkerMarkerInfoEXT,
) { ) {
self.fp (self.fp.cmd_debug_marker_begin_ext)(command_buffer, marker_info);
.cmd_debug_marker_begin_ext(command_buffer, marker_info);
} }
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdDebugMarkerEndEXT.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdDebugMarkerEndEXT.html>
pub unsafe fn cmd_debug_marker_end(&self, command_buffer: vk::CommandBuffer) { pub unsafe fn cmd_debug_marker_end(&self, command_buffer: vk::CommandBuffer) {
self.fp.cmd_debug_marker_end_ext(command_buffer); (self.fp.cmd_debug_marker_end_ext)(command_buffer);
} }
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdDebugMarkerInsertEXT.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdDebugMarkerInsertEXT.html>
@ -50,8 +47,7 @@ impl DebugMarker {
command_buffer: vk::CommandBuffer, command_buffer: vk::CommandBuffer,
marker_info: &vk::DebugMarkerMarkerInfoEXT, marker_info: &vk::DebugMarkerMarkerInfoEXT,
) { ) {
self.fp (self.fp.cmd_debug_marker_insert_ext)(command_buffer, marker_info);
.cmd_debug_marker_insert_ext(command_buffer, marker_info);
} }
pub const fn name() -> &'static CStr { pub const fn name() -> &'static CStr {

View file

@ -26,7 +26,7 @@ impl DebugReport {
debug: vk::DebugReportCallbackEXT, debug: vk::DebugReportCallbackEXT,
allocation_callbacks: Option<&vk::AllocationCallbacks>, allocation_callbacks: Option<&vk::AllocationCallbacks>,
) { ) {
self.fp.destroy_debug_report_callback_ext( (self.fp.destroy_debug_report_callback_ext)(
self.handle, self.handle,
debug, debug,
allocation_callbacks.as_raw_ptr(), allocation_callbacks.as_raw_ptr(),
@ -40,8 +40,7 @@ impl DebugReport {
allocation_callbacks: Option<&vk::AllocationCallbacks>, allocation_callbacks: Option<&vk::AllocationCallbacks>,
) -> VkResult<vk::DebugReportCallbackEXT> { ) -> VkResult<vk::DebugReportCallbackEXT> {
let mut debug_cb = mem::zeroed(); let mut debug_cb = mem::zeroed();
self.fp (self.fp.create_debug_report_callback_ext)(
.create_debug_report_callback_ext(
self.handle, self.handle,
create_info, create_info,
allocation_callbacks.as_raw_ptr(), allocation_callbacks.as_raw_ptr(),

View file

@ -25,9 +25,7 @@ impl DebugUtils {
device: vk::Device, device: vk::Device,
name_info: &vk::DebugUtilsObjectNameInfoEXT, name_info: &vk::DebugUtilsObjectNameInfoEXT,
) -> VkResult<()> { ) -> VkResult<()> {
self.fp (self.fp.set_debug_utils_object_name_ext)(device, name_info).result()
.set_debug_utils_object_name_ext(device, name_info)
.result()
} }
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkSetDebugUtilsObjectTagEXT.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkSetDebugUtilsObjectTagEXT.html>
@ -36,9 +34,7 @@ impl DebugUtils {
device: vk::Device, device: vk::Device,
tag_info: &vk::DebugUtilsObjectTagInfoEXT, tag_info: &vk::DebugUtilsObjectTagInfoEXT,
) -> VkResult<()> { ) -> VkResult<()> {
self.fp (self.fp.set_debug_utils_object_tag_ext)(device, tag_info).result()
.set_debug_utils_object_tag_ext(device, tag_info)
.result()
} }
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdBeginDebugUtilsLabelEXT.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdBeginDebugUtilsLabelEXT.html>
@ -47,13 +43,12 @@ impl DebugUtils {
command_buffer: vk::CommandBuffer, command_buffer: vk::CommandBuffer,
label: &vk::DebugUtilsLabelEXT, label: &vk::DebugUtilsLabelEXT,
) { ) {
self.fp (self.fp.cmd_begin_debug_utils_label_ext)(command_buffer, label);
.cmd_begin_debug_utils_label_ext(command_buffer, label);
} }
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdEndDebugUtilsLabelEXT.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdEndDebugUtilsLabelEXT.html>
pub unsafe fn cmd_end_debug_utils_label(&self, command_buffer: vk::CommandBuffer) { pub unsafe fn cmd_end_debug_utils_label(&self, command_buffer: vk::CommandBuffer) {
self.fp.cmd_end_debug_utils_label_ext(command_buffer); (self.fp.cmd_end_debug_utils_label_ext)(command_buffer);
} }
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdInsertDebugUtilsLabelEXT.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdInsertDebugUtilsLabelEXT.html>
@ -62,8 +57,7 @@ impl DebugUtils {
command_buffer: vk::CommandBuffer, command_buffer: vk::CommandBuffer,
label: &vk::DebugUtilsLabelEXT, label: &vk::DebugUtilsLabelEXT,
) { ) {
self.fp (self.fp.cmd_insert_debug_utils_label_ext)(command_buffer, label);
.cmd_insert_debug_utils_label_ext(command_buffer, label);
} }
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkQueueBeginDebugUtilsLabelEXT.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkQueueBeginDebugUtilsLabelEXT.html>
@ -72,12 +66,12 @@ impl DebugUtils {
queue: vk::Queue, queue: vk::Queue,
label: &vk::DebugUtilsLabelEXT, label: &vk::DebugUtilsLabelEXT,
) { ) {
self.fp.queue_begin_debug_utils_label_ext(queue, label); (self.fp.queue_begin_debug_utils_label_ext)(queue, label);
} }
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkQueueEndDebugUtilsLabelEXT.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkQueueEndDebugUtilsLabelEXT.html>
pub unsafe fn queue_end_debug_utils_label(&self, queue: vk::Queue) { pub unsafe fn queue_end_debug_utils_label(&self, queue: vk::Queue) {
self.fp.queue_end_debug_utils_label_ext(queue); (self.fp.queue_end_debug_utils_label_ext)(queue);
} }
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkQueueInsertDebugUtilsLabelEXT.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkQueueInsertDebugUtilsLabelEXT.html>
@ -86,7 +80,7 @@ impl DebugUtils {
queue: vk::Queue, queue: vk::Queue,
label: &vk::DebugUtilsLabelEXT, label: &vk::DebugUtilsLabelEXT,
) { ) {
self.fp.queue_insert_debug_utils_label_ext(queue, label); (self.fp.queue_insert_debug_utils_label_ext)(queue, label);
} }
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCreateDebugUtilsMessengerEXT.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCreateDebugUtilsMessengerEXT.html>
@ -96,8 +90,7 @@ impl DebugUtils {
allocator: Option<&vk::AllocationCallbacks>, allocator: Option<&vk::AllocationCallbacks>,
) -> VkResult<vk::DebugUtilsMessengerEXT> { ) -> VkResult<vk::DebugUtilsMessengerEXT> {
let mut messenger = mem::zeroed(); let mut messenger = mem::zeroed();
self.fp (self.fp.create_debug_utils_messenger_ext)(
.create_debug_utils_messenger_ext(
self.handle, self.handle,
create_info, create_info,
allocator.as_raw_ptr(), allocator.as_raw_ptr(),
@ -112,8 +105,7 @@ impl DebugUtils {
messenger: vk::DebugUtilsMessengerEXT, messenger: vk::DebugUtilsMessengerEXT,
allocator: Option<&vk::AllocationCallbacks>, allocator: Option<&vk::AllocationCallbacks>,
) { ) {
self.fp (self.fp.destroy_debug_utils_messenger_ext)(self.handle, messenger, allocator.as_raw_ptr());
.destroy_debug_utils_messenger_ext(self.handle, messenger, allocator.as_raw_ptr());
} }
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkSubmitDebugUtilsMessageEXT.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkSubmitDebugUtilsMessageEXT.html>
@ -123,7 +115,7 @@ impl DebugUtils {
message_types: vk::DebugUtilsMessageTypeFlagsEXT, message_types: vk::DebugUtilsMessageTypeFlagsEXT,
callback_data: &vk::DebugUtilsMessengerCallbackDataEXT, callback_data: &vk::DebugUtilsMessengerCallbackDataEXT,
) { ) {
self.fp.submit_debug_utils_message_ext( (self.fp.submit_debug_utils_message_ext)(
self.handle, self.handle,
message_severity, message_severity,
message_types, message_types,

View file

@ -23,7 +23,7 @@ impl ExtendedDynamicState {
command_buffer: vk::CommandBuffer, command_buffer: vk::CommandBuffer,
cull_mode: vk::CullModeFlags, cull_mode: vk::CullModeFlags,
) { ) {
self.fp.cmd_set_cull_mode_ext(command_buffer, cull_mode) (self.fp.cmd_set_cull_mode_ext)(command_buffer, cull_mode)
} }
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetFrontFaceEXT.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetFrontFaceEXT.html>
@ -32,7 +32,7 @@ impl ExtendedDynamicState {
command_buffer: vk::CommandBuffer, command_buffer: vk::CommandBuffer,
front_face: vk::FrontFace, front_face: vk::FrontFace,
) { ) {
self.fp.cmd_set_front_face_ext(command_buffer, front_face) (self.fp.cmd_set_front_face_ext)(command_buffer, front_face)
} }
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetPrimitiveTopologyEXT.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetPrimitiveTopologyEXT.html>
@ -41,8 +41,7 @@ impl ExtendedDynamicState {
command_buffer: vk::CommandBuffer, command_buffer: vk::CommandBuffer,
primitive_topology: vk::PrimitiveTopology, primitive_topology: vk::PrimitiveTopology,
) { ) {
self.fp (self.fp.cmd_set_primitive_topology_ext)(command_buffer, primitive_topology)
.cmd_set_primitive_topology_ext(command_buffer, primitive_topology)
} }
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetViewportWithCountEXT.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetViewportWithCountEXT.html>
@ -51,7 +50,7 @@ impl ExtendedDynamicState {
command_buffer: vk::CommandBuffer, command_buffer: vk::CommandBuffer,
viewports: &[vk::Viewport], viewports: &[vk::Viewport],
) { ) {
self.fp.cmd_set_viewport_with_count_ext( (self.fp.cmd_set_viewport_with_count_ext)(
command_buffer, command_buffer,
viewports.len() as u32, viewports.len() as u32,
viewports.as_ptr(), viewports.as_ptr(),
@ -64,7 +63,7 @@ impl ExtendedDynamicState {
command_buffer: vk::CommandBuffer, command_buffer: vk::CommandBuffer,
scissors: &[vk::Rect2D], scissors: &[vk::Rect2D],
) { ) {
self.fp.cmd_set_scissor_with_count_ext( (self.fp.cmd_set_scissor_with_count_ext)(
command_buffer, command_buffer,
scissors.len() as u32, scissors.len() as u32,
scissors.as_ptr(), scissors.as_ptr(),
@ -94,7 +93,7 @@ impl ExtendedDynamicState {
} else { } else {
ptr::null() ptr::null()
}; };
self.fp.cmd_bind_vertex_buffers2_ext( (self.fp.cmd_bind_vertex_buffers2_ext)(
command_buffer, command_buffer,
first_binding, first_binding,
buffers.len() as u32, buffers.len() as u32,
@ -111,8 +110,7 @@ impl ExtendedDynamicState {
command_buffer: vk::CommandBuffer, command_buffer: vk::CommandBuffer,
depth_test_enable: bool, depth_test_enable: bool,
) { ) {
self.fp (self.fp.cmd_set_depth_test_enable_ext)(command_buffer, depth_test_enable.into())
.cmd_set_depth_test_enable_ext(command_buffer, depth_test_enable.into())
} }
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetDepthWriteEnableEXT.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetDepthWriteEnableEXT.html>
@ -121,8 +119,7 @@ impl ExtendedDynamicState {
command_buffer: vk::CommandBuffer, command_buffer: vk::CommandBuffer,
depth_write_enable: bool, depth_write_enable: bool,
) { ) {
self.fp (self.fp.cmd_set_depth_write_enable_ext)(command_buffer, depth_write_enable.into())
.cmd_set_depth_write_enable_ext(command_buffer, depth_write_enable.into())
} }
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetDepthCompareOpEXT.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetDepthCompareOpEXT.html>
@ -131,8 +128,7 @@ impl ExtendedDynamicState {
command_buffer: vk::CommandBuffer, command_buffer: vk::CommandBuffer,
depth_compare_op: vk::CompareOp, depth_compare_op: vk::CompareOp,
) { ) {
self.fp (self.fp.cmd_set_depth_compare_op_ext)(command_buffer, depth_compare_op)
.cmd_set_depth_compare_op_ext(command_buffer, depth_compare_op)
} }
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetDepthBoundsTestEnableEXT.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetDepthBoundsTestEnableEXT.html>
@ -141,8 +137,10 @@ impl ExtendedDynamicState {
command_buffer: vk::CommandBuffer, command_buffer: vk::CommandBuffer,
depth_bounds_test_enable: bool, depth_bounds_test_enable: bool,
) { ) {
self.fp (self.fp.cmd_set_depth_bounds_test_enable_ext)(
.cmd_set_depth_bounds_test_enable_ext(command_buffer, depth_bounds_test_enable.into()) command_buffer,
depth_bounds_test_enable.into(),
)
} }
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetStencilTestEnableEXT.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetStencilTestEnableEXT.html>
@ -151,8 +149,7 @@ impl ExtendedDynamicState {
command_buffer: vk::CommandBuffer, command_buffer: vk::CommandBuffer,
stencil_test_enable: bool, stencil_test_enable: bool,
) { ) {
self.fp (self.fp.cmd_set_stencil_test_enable_ext)(command_buffer, stencil_test_enable.into())
.cmd_set_stencil_test_enable_ext(command_buffer, stencil_test_enable.into())
} }
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetStencilOpEXT.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetStencilOpEXT.html>
@ -165,7 +162,7 @@ impl ExtendedDynamicState {
depth_fail_op: vk::StencilOp, depth_fail_op: vk::StencilOp,
compare_op: vk::CompareOp, compare_op: vk::CompareOp,
) { ) {
self.fp.cmd_set_stencil_op_ext( (self.fp.cmd_set_stencil_op_ext)(
command_buffer, command_buffer,
face_mask, face_mask,
fail_op, fail_op,

View file

@ -23,8 +23,7 @@ impl ExtendedDynamicState2 {
command_buffer: vk::CommandBuffer, command_buffer: vk::CommandBuffer,
patch_control_points: u32, patch_control_points: u32,
) { ) {
self.fp (self.fp.cmd_set_patch_control_points_ext)(command_buffer, patch_control_points)
.cmd_set_patch_control_points_ext(command_buffer, patch_control_points)
} }
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetRasterizerDiscardEnableEXT.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetRasterizerDiscardEnableEXT.html>
@ -33,8 +32,10 @@ impl ExtendedDynamicState2 {
command_buffer: vk::CommandBuffer, command_buffer: vk::CommandBuffer,
rasterizer_discard_enable: bool, rasterizer_discard_enable: bool,
) { ) {
self.fp (self.fp.cmd_set_rasterizer_discard_enable_ext)(
.cmd_set_rasterizer_discard_enable_ext(command_buffer, rasterizer_discard_enable.into()) command_buffer,
rasterizer_discard_enable.into(),
)
} }
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetDepthBiasEnableEXT.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetDepthBiasEnableEXT.html>
@ -43,8 +44,7 @@ impl ExtendedDynamicState2 {
command_buffer: vk::CommandBuffer, command_buffer: vk::CommandBuffer,
depth_bias_enable: bool, depth_bias_enable: bool,
) { ) {
self.fp (self.fp.cmd_set_depth_bias_enable_ext)(command_buffer, depth_bias_enable.into())
.cmd_set_depth_bias_enable_ext(command_buffer, depth_bias_enable.into())
} }
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetLogicOpEXT.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetLogicOpEXT.html>
@ -53,7 +53,7 @@ impl ExtendedDynamicState2 {
command_buffer: vk::CommandBuffer, command_buffer: vk::CommandBuffer,
logic_op: vk::LogicOp, logic_op: vk::LogicOp,
) { ) {
self.fp.cmd_set_logic_op_ext(command_buffer, logic_op) (self.fp.cmd_set_logic_op_ext)(command_buffer, logic_op)
} }
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetPrimitiveRestartEnableEXT.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetPrimitiveRestartEnableEXT.html>
@ -62,8 +62,10 @@ impl ExtendedDynamicState2 {
command_buffer: vk::CommandBuffer, command_buffer: vk::CommandBuffer,
primitive_restart_enable: bool, primitive_restart_enable: bool,
) { ) {
self.fp (self.fp.cmd_set_primitive_restart_enable_ext)(
.cmd_set_primitive_restart_enable_ext(command_buffer, primitive_restart_enable.into()) command_buffer,
primitive_restart_enable.into(),
)
} }
pub const fn name() -> &'static CStr { pub const fn name() -> &'static CStr {

View file

@ -24,9 +24,7 @@ impl FullScreenExclusive {
&self, &self,
swapchain: vk::SwapchainKHR, swapchain: vk::SwapchainKHR,
) -> VkResult<()> { ) -> VkResult<()> {
self.fp (self.fp.acquire_full_screen_exclusive_mode_ext)(self.handle, swapchain).result()
.acquire_full_screen_exclusive_mode_ext(self.handle, swapchain)
.result()
} }
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceSurfacePresentModes2EXT.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceSurfacePresentModes2EXT.html>
@ -36,7 +34,7 @@ impl FullScreenExclusive {
surface_info: &vk::PhysicalDeviceSurfaceInfo2KHR, surface_info: &vk::PhysicalDeviceSurfaceInfo2KHR,
) -> VkResult<Vec<vk::PresentModeKHR>> { ) -> VkResult<Vec<vk::PresentModeKHR>> {
read_into_uninitialized_vector(|count, data| { read_into_uninitialized_vector(|count, data| {
self.fp.get_physical_device_surface_present_modes2_ext( (self.fp.get_physical_device_surface_present_modes2_ext)(
physical_device, physical_device,
surface_info, surface_info,
count, count,
@ -50,9 +48,7 @@ impl FullScreenExclusive {
&self, &self,
swapchain: vk::SwapchainKHR, swapchain: vk::SwapchainKHR,
) -> VkResult<()> { ) -> VkResult<()> {
self.fp (self.fp.release_full_screen_exclusive_mode_ext)(self.handle, swapchain).result()
.release_full_screen_exclusive_mode_ext(self.handle, swapchain)
.result()
} }
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetDeviceGroupSurfacePresentModes2EXT.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetDeviceGroupSurfacePresentModes2EXT.html>
@ -61,8 +57,7 @@ impl FullScreenExclusive {
surface_info: &vk::PhysicalDeviceSurfaceInfo2KHR, surface_info: &vk::PhysicalDeviceSurfaceInfo2KHR,
) -> VkResult<vk::DeviceGroupPresentModeFlagsKHR> { ) -> VkResult<vk::DeviceGroupPresentModeFlagsKHR> {
let mut present_modes = mem::zeroed(); let mut present_modes = mem::zeroed();
self.fp (self.fp.get_device_group_surface_present_modes2_ext)(
.get_device_group_surface_present_modes2_ext(
self.handle, self.handle,
surface_info, surface_info,
&mut present_modes, &mut present_modes,

View file

@ -28,8 +28,7 @@ impl HeadlessSurface {
allocation_callbacks: Option<&vk::AllocationCallbacks>, allocation_callbacks: Option<&vk::AllocationCallbacks>,
) -> VkResult<vk::SurfaceKHR> { ) -> VkResult<vk::SurfaceKHR> {
let mut surface = mem::zeroed(); let mut surface = mem::zeroed();
self.fp (self.fp.create_headless_surface_ext)(
.create_headless_surface_ext(
self.handle, self.handle,
create_info, create_info,
allocation_callbacks.as_raw_ptr(), allocation_callbacks.as_raw_ptr(),

View file

@ -27,8 +27,7 @@ impl MetalSurface {
allocation_callbacks: Option<&vk::AllocationCallbacks>, allocation_callbacks: Option<&vk::AllocationCallbacks>,
) -> VkResult<vk::SurfaceKHR> { ) -> VkResult<vk::SurfaceKHR> {
let mut surface = mem::zeroed(); let mut surface = mem::zeroed();
self.fp (self.fp.create_metal_surface_ext)(
.create_metal_surface_ext(
self.handle, self.handle,
create_info, create_info,
allocation_callbacks.as_raw_ptr(), allocation_callbacks.as_raw_ptr(),

View file

@ -28,8 +28,7 @@ impl PrivateData {
allocation_callbacks: Option<&vk::AllocationCallbacks>, allocation_callbacks: Option<&vk::AllocationCallbacks>,
) -> VkResult<vk::PrivateDataSlotEXT> { ) -> VkResult<vk::PrivateDataSlotEXT> {
let mut private_data_slot = mem::zeroed(); let mut private_data_slot = mem::zeroed();
self.fp (self.fp.create_private_data_slot_ext)(
.create_private_data_slot_ext(
self.handle, self.handle,
create_info, create_info,
allocation_callbacks.as_raw_ptr(), allocation_callbacks.as_raw_ptr(),
@ -44,7 +43,7 @@ impl PrivateData {
private_data_slot: vk::PrivateDataSlotEXT, private_data_slot: vk::PrivateDataSlotEXT,
allocation_callbacks: Option<&vk::AllocationCallbacks>, allocation_callbacks: Option<&vk::AllocationCallbacks>,
) { ) {
self.fp.destroy_private_data_slot_ext( (self.fp.destroy_private_data_slot_ext)(
self.handle, self.handle,
private_data_slot, private_data_slot,
allocation_callbacks.as_raw_ptr(), allocation_callbacks.as_raw_ptr(),
@ -58,8 +57,7 @@ impl PrivateData {
private_data_slot: vk::PrivateDataSlotEXT, private_data_slot: vk::PrivateDataSlotEXT,
data: u64, data: u64,
) -> VkResult<()> { ) -> VkResult<()> {
self.fp (self.fp.set_private_data_ext)(
.set_private_data_ext(
self.handle, self.handle,
T::TYPE, T::TYPE,
object.as_raw(), object.as_raw(),
@ -76,7 +74,7 @@ impl PrivateData {
private_data_slot: vk::PrivateDataSlotEXT, private_data_slot: vk::PrivateDataSlotEXT,
) -> u64 { ) -> u64 {
let mut data = mem::zeroed(); let mut data = mem::zeroed();
self.fp.get_private_data_ext( (self.fp.get_private_data_ext)(
self.handle, self.handle,
T::TYPE, T::TYPE,
object.as_raw(), object.as_raw(),

View file

@ -23,8 +23,7 @@ impl ToolingInfo {
physical_device: vk::PhysicalDevice, physical_device: vk::PhysicalDevice,
) -> VkResult<Vec<vk::PhysicalDeviceToolPropertiesEXT>> { ) -> VkResult<Vec<vk::PhysicalDeviceToolPropertiesEXT>> {
read_into_defaulted_vector(|count, data| { read_into_defaulted_vector(|count, data| {
self.fp (self.fp.get_physical_device_tool_properties_ext)(physical_device, count, data)
.get_physical_device_tool_properties_ext(physical_device, count, data)
}) })
} }

View file

@ -39,8 +39,7 @@ impl AccelerationStructure {
allocation_callbacks: Option<&vk::AllocationCallbacks>, allocation_callbacks: Option<&vk::AllocationCallbacks>,
) -> VkResult<vk::AccelerationStructureKHR> { ) -> VkResult<vk::AccelerationStructureKHR> {
let mut accel_struct = mem::zeroed(); let mut accel_struct = mem::zeroed();
self.fp (self.fp.create_acceleration_structure_khr)(
.create_acceleration_structure_khr(
self.handle, self.handle,
create_info, create_info,
allocation_callbacks.as_raw_ptr(), allocation_callbacks.as_raw_ptr(),
@ -55,7 +54,7 @@ impl AccelerationStructure {
accel_struct: vk::AccelerationStructureKHR, accel_struct: vk::AccelerationStructureKHR,
allocation_callbacks: Option<&vk::AllocationCallbacks>, allocation_callbacks: Option<&vk::AllocationCallbacks>,
) { ) {
self.fp.destroy_acceleration_structure_khr( (self.fp.destroy_acceleration_structure_khr)(
self.handle, self.handle,
accel_struct, accel_struct,
allocation_callbacks.as_raw_ptr(), allocation_callbacks.as_raw_ptr(),
@ -80,7 +79,7 @@ impl AccelerationStructure {
}) })
.collect::<Vec<_>>(); .collect::<Vec<_>>();
self.fp.cmd_build_acceleration_structures_khr( (self.fp.cmd_build_acceleration_structures_khr)(
command_buffer, command_buffer,
infos.len() as _, infos.len() as _,
infos.as_ptr(), infos.as_ptr(),
@ -110,7 +109,7 @@ impl AccelerationStructure {
}) })
.collect::<Vec<_>>(); .collect::<Vec<_>>();
self.fp.cmd_build_acceleration_structures_indirect_khr( (self.fp.cmd_build_acceleration_structures_indirect_khr)(
command_buffer, command_buffer,
infos.len() as _, infos.len() as _,
infos.as_ptr(), infos.as_ptr(),
@ -138,8 +137,7 @@ impl AccelerationStructure {
}) })
.collect::<Vec<_>>(); .collect::<Vec<_>>();
self.fp (self.fp.build_acceleration_structures_khr)(
.build_acceleration_structures_khr(
self.handle, self.handle,
deferred_operation, deferred_operation,
infos.len() as _, infos.len() as _,
@ -155,9 +153,7 @@ impl AccelerationStructure {
deferred_operation: vk::DeferredOperationKHR, deferred_operation: vk::DeferredOperationKHR,
info: &vk::CopyAccelerationStructureInfoKHR, info: &vk::CopyAccelerationStructureInfoKHR,
) -> VkResult<()> { ) -> VkResult<()> {
self.fp (self.fp.copy_acceleration_structure_khr)(self.handle, deferred_operation, info).result()
.copy_acceleration_structure_khr(self.handle, deferred_operation, info)
.result()
} }
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCopyAccelerationStructureToMemoryKHR.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCopyAccelerationStructureToMemoryKHR.html>
@ -166,8 +162,7 @@ impl AccelerationStructure {
deferred_operation: vk::DeferredOperationKHR, deferred_operation: vk::DeferredOperationKHR,
info: &vk::CopyAccelerationStructureToMemoryInfoKHR, info: &vk::CopyAccelerationStructureToMemoryInfoKHR,
) -> VkResult<()> { ) -> VkResult<()> {
self.fp (self.fp.copy_acceleration_structure_to_memory_khr)(self.handle, deferred_operation, info)
.copy_acceleration_structure_to_memory_khr(self.handle, deferred_operation, info)
.result() .result()
} }
@ -177,8 +172,7 @@ impl AccelerationStructure {
deferred_operation: vk::DeferredOperationKHR, deferred_operation: vk::DeferredOperationKHR,
info: &vk::CopyMemoryToAccelerationStructureInfoKHR, info: &vk::CopyMemoryToAccelerationStructureInfoKHR,
) -> VkResult<()> { ) -> VkResult<()> {
self.fp (self.fp.copy_memory_to_acceleration_structure_khr)(self.handle, deferred_operation, info)
.copy_memory_to_acceleration_structure_khr(self.handle, deferred_operation, info)
.result() .result()
} }
@ -190,8 +184,7 @@ impl AccelerationStructure {
data: &mut [u8], data: &mut [u8],
stride: usize, stride: usize,
) -> VkResult<()> { ) -> VkResult<()> {
self.fp (self.fp.write_acceleration_structures_properties_khr)(
.write_acceleration_structures_properties_khr(
self.handle, self.handle,
acceleration_structures.len() as _, acceleration_structures.len() as _,
acceleration_structures.as_ptr(), acceleration_structures.as_ptr(),
@ -209,8 +202,7 @@ impl AccelerationStructure {
command_buffer: vk::CommandBuffer, command_buffer: vk::CommandBuffer,
info: &vk::CopyAccelerationStructureInfoKHR, info: &vk::CopyAccelerationStructureInfoKHR,
) { ) {
self.fp (self.fp.cmd_copy_acceleration_structure_khr)(command_buffer, info);
.cmd_copy_acceleration_structure_khr(command_buffer, info);
} }
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdCopyAccelerationStructureToMemoryKHR.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdCopyAccelerationStructureToMemoryKHR.html>
@ -219,8 +211,7 @@ impl AccelerationStructure {
command_buffer: vk::CommandBuffer, command_buffer: vk::CommandBuffer,
info: &vk::CopyAccelerationStructureToMemoryInfoKHR, info: &vk::CopyAccelerationStructureToMemoryInfoKHR,
) { ) {
self.fp (self.fp.cmd_copy_acceleration_structure_to_memory_khr)(command_buffer, info);
.cmd_copy_acceleration_structure_to_memory_khr(command_buffer, info);
} }
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdCopyMemoryToAccelerationStructureKHR.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdCopyMemoryToAccelerationStructureKHR.html>
@ -229,8 +220,7 @@ impl AccelerationStructure {
command_buffer: vk::CommandBuffer, command_buffer: vk::CommandBuffer,
info: &vk::CopyMemoryToAccelerationStructureInfoKHR, info: &vk::CopyMemoryToAccelerationStructureInfoKHR,
) { ) {
self.fp (self.fp.cmd_copy_memory_to_acceleration_structure_khr)(command_buffer, info);
.cmd_copy_memory_to_acceleration_structure_khr(command_buffer, info);
} }
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetAccelerationStructureHandleKHR.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetAccelerationStructureHandleKHR.html>
@ -238,8 +228,7 @@ impl AccelerationStructure {
&self, &self,
info: &vk::AccelerationStructureDeviceAddressInfoKHR, info: &vk::AccelerationStructureDeviceAddressInfoKHR,
) -> vk::DeviceAddress { ) -> vk::DeviceAddress {
self.fp (self.fp.get_acceleration_structure_device_address_khr)(self.handle, info)
.get_acceleration_structure_device_address_khr(self.handle, info)
} }
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdWriteAccelerationStructuresPropertiesKHR.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdWriteAccelerationStructuresPropertiesKHR.html>
@ -251,7 +240,7 @@ impl AccelerationStructure {
query_pool: vk::QueryPool, query_pool: vk::QueryPool,
first_query: u32, first_query: u32,
) { ) {
self.fp.cmd_write_acceleration_structures_properties_khr( (self.fp.cmd_write_acceleration_structures_properties_khr)(
command_buffer, command_buffer,
structures.len() as _, structures.len() as _,
structures.as_ptr(), structures.as_ptr(),
@ -268,7 +257,7 @@ impl AccelerationStructure {
) -> vk::AccelerationStructureCompatibilityKHR { ) -> vk::AccelerationStructureCompatibilityKHR {
let mut compatibility = vk::AccelerationStructureCompatibilityKHR::default(); let mut compatibility = vk::AccelerationStructureCompatibilityKHR::default();
self.fp.get_device_acceleration_structure_compatibility_khr( (self.fp.get_device_acceleration_structure_compatibility_khr)(
self.handle, self.handle,
version, version,
&mut compatibility, &mut compatibility,
@ -288,7 +277,7 @@ impl AccelerationStructure {
let mut size_info = vk::AccelerationStructureBuildSizesInfoKHR::default(); let mut size_info = vk::AccelerationStructureBuildSizesInfoKHR::default();
self.fp.get_acceleration_structure_build_sizes_khr( (self.fp.get_acceleration_structure_build_sizes_khr)(
self.handle, self.handle,
build_type, build_type,
build_info, build_info,

View file

@ -27,8 +27,7 @@ impl AndroidSurface {
allocation_callbacks: Option<&vk::AllocationCallbacks>, allocation_callbacks: Option<&vk::AllocationCallbacks>,
) -> VkResult<vk::SurfaceKHR> { ) -> VkResult<vk::SurfaceKHR> {
let mut surface = mem::zeroed(); let mut surface = mem::zeroed();
self.fp (self.fp.create_android_surface_khr)(
.create_android_surface_khr(
self.handle, self.handle,
create_info, create_info,
allocation_callbacks.as_raw_ptr(), allocation_callbacks.as_raw_ptr(),

View file

@ -23,7 +23,7 @@ impl BufferDeviceAddress {
&self, &self,
info: &vk::BufferDeviceAddressInfoKHR, info: &vk::BufferDeviceAddressInfoKHR,
) -> vk::DeviceAddress { ) -> vk::DeviceAddress {
self.fp.get_buffer_device_address_khr(self.handle, info) (self.fp.get_buffer_device_address_khr)(self.handle, info)
} }
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetBufferOpaqueCaptureAddressKHR.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetBufferOpaqueCaptureAddressKHR.html>
@ -31,8 +31,7 @@ impl BufferDeviceAddress {
&self, &self,
info: &vk::BufferDeviceAddressInfoKHR, info: &vk::BufferDeviceAddressInfoKHR,
) -> u64 { ) -> u64 {
self.fp (self.fp.get_buffer_opaque_capture_address_khr)(self.handle, info)
.get_buffer_opaque_capture_address_khr(self.handle, info)
} }
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetDeviceMemoryOpaqueCaptureAddressKHR.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetDeviceMemoryOpaqueCaptureAddressKHR.html>
@ -40,8 +39,7 @@ impl BufferDeviceAddress {
&self, &self,
info: &vk::DeviceMemoryOpaqueCaptureAddressInfoKHR, info: &vk::DeviceMemoryOpaqueCaptureAddressInfoKHR,
) -> u64 { ) -> u64 {
self.fp (self.fp.get_device_memory_opaque_capture_address_khr)(self.handle, info)
.get_device_memory_opaque_capture_address_khr(self.handle, info)
} }
pub const fn name() -> &'static CStr { pub const fn name() -> &'static CStr {

View file

@ -23,8 +23,7 @@ impl CopyCommands2 {
command_buffer: vk::CommandBuffer, command_buffer: vk::CommandBuffer,
copy_buffer_info: &vk::CopyBufferInfo2KHR, copy_buffer_info: &vk::CopyBufferInfo2KHR,
) { ) {
self.fp (self.fp.cmd_copy_buffer2_khr)(command_buffer, copy_buffer_info)
.cmd_copy_buffer2_khr(command_buffer, copy_buffer_info)
} }
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdCopyImage2KHR.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdCopyImage2KHR.html>
pub unsafe fn cmd_copy_image2( pub unsafe fn cmd_copy_image2(
@ -32,7 +31,7 @@ impl CopyCommands2 {
command_buffer: vk::CommandBuffer, command_buffer: vk::CommandBuffer,
copy_image_info: &vk::CopyImageInfo2KHR, copy_image_info: &vk::CopyImageInfo2KHR,
) { ) {
self.fp.cmd_copy_image2_khr(command_buffer, copy_image_info) (self.fp.cmd_copy_image2_khr)(command_buffer, copy_image_info)
} }
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdCopyBufferToImage2KHR.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdCopyBufferToImage2KHR.html>
pub unsafe fn cmd_copy_buffer_to_image2( pub unsafe fn cmd_copy_buffer_to_image2(
@ -40,8 +39,7 @@ impl CopyCommands2 {
command_buffer: vk::CommandBuffer, command_buffer: vk::CommandBuffer,
copy_buffer_to_image_info: &vk::CopyBufferToImageInfo2KHR, copy_buffer_to_image_info: &vk::CopyBufferToImageInfo2KHR,
) { ) {
self.fp (self.fp.cmd_copy_buffer_to_image2_khr)(command_buffer, copy_buffer_to_image_info)
.cmd_copy_buffer_to_image2_khr(command_buffer, copy_buffer_to_image_info)
} }
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdCopyImageToBuffer2KHR.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdCopyImageToBuffer2KHR.html>
pub unsafe fn cmd_copy_image_to_buffer2( pub unsafe fn cmd_copy_image_to_buffer2(
@ -49,8 +47,7 @@ impl CopyCommands2 {
command_buffer: vk::CommandBuffer, command_buffer: vk::CommandBuffer,
copy_image_to_buffer_info: &vk::CopyImageToBufferInfo2KHR, copy_image_to_buffer_info: &vk::CopyImageToBufferInfo2KHR,
) { ) {
self.fp (self.fp.cmd_copy_image_to_buffer2_khr)(command_buffer, copy_image_to_buffer_info)
.cmd_copy_image_to_buffer2_khr(command_buffer, copy_image_to_buffer_info)
} }
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdBlitImage2KHR.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdBlitImage2KHR.html>
pub unsafe fn cmd_blit_image2( pub unsafe fn cmd_blit_image2(
@ -58,7 +55,7 @@ impl CopyCommands2 {
command_buffer: vk::CommandBuffer, command_buffer: vk::CommandBuffer,
blit_image_info: &vk::BlitImageInfo2KHR, blit_image_info: &vk::BlitImageInfo2KHR,
) { ) {
self.fp.cmd_blit_image2_khr(command_buffer, blit_image_info) (self.fp.cmd_blit_image2_khr)(command_buffer, blit_image_info)
} }
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdResolveImage2KHR.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdResolveImage2KHR.html>
pub unsafe fn cmd_resolve_image2( pub unsafe fn cmd_resolve_image2(
@ -66,8 +63,7 @@ impl CopyCommands2 {
command_buffer: vk::CommandBuffer, command_buffer: vk::CommandBuffer,
resolve_image_info: &vk::ResolveImageInfo2KHR, resolve_image_info: &vk::ResolveImageInfo2KHR,
) { ) {
self.fp (self.fp.cmd_resolve_image2_khr)(command_buffer, resolve_image_info)
.cmd_resolve_image2_khr(command_buffer, resolve_image_info)
} }
pub const fn name() -> &'static CStr { pub const fn name() -> &'static CStr {

View file

@ -27,8 +27,7 @@ impl CreateRenderPass2 {
allocation_callbacks: Option<&vk::AllocationCallbacks>, allocation_callbacks: Option<&vk::AllocationCallbacks>,
) -> VkResult<vk::RenderPass> { ) -> VkResult<vk::RenderPass> {
let mut renderpass = mem::zeroed(); let mut renderpass = mem::zeroed();
self.fp (self.fp.create_render_pass2_khr)(
.create_render_pass2_khr(
self.handle, self.handle,
create_info, create_info,
allocation_callbacks.as_raw_ptr(), allocation_callbacks.as_raw_ptr(),
@ -44,7 +43,7 @@ impl CreateRenderPass2 {
render_pass_begin_info: &vk::RenderPassBeginInfo, render_pass_begin_info: &vk::RenderPassBeginInfo,
subpass_begin_info: &vk::SubpassBeginInfo, subpass_begin_info: &vk::SubpassBeginInfo,
) { ) {
self.fp.cmd_begin_render_pass2_khr( (self.fp.cmd_begin_render_pass2_khr)(
command_buffer, command_buffer,
render_pass_begin_info, render_pass_begin_info,
subpass_begin_info, subpass_begin_info,
@ -58,8 +57,7 @@ impl CreateRenderPass2 {
subpass_begin_info: &vk::SubpassBeginInfo, subpass_begin_info: &vk::SubpassBeginInfo,
subpass_end_info: &vk::SubpassEndInfo, subpass_end_info: &vk::SubpassEndInfo,
) { ) {
self.fp (self.fp.cmd_next_subpass2_khr)(command_buffer, subpass_begin_info, subpass_end_info);
.cmd_next_subpass2_khr(command_buffer, subpass_begin_info, subpass_end_info);
} }
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdEndRenderPass2.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdEndRenderPass2.html>
@ -68,8 +66,7 @@ impl CreateRenderPass2 {
command_buffer: vk::CommandBuffer, command_buffer: vk::CommandBuffer,
subpass_end_info: &vk::SubpassEndInfo, subpass_end_info: &vk::SubpassEndInfo,
) { ) {
self.fp (self.fp.cmd_end_render_pass2_khr)(command_buffer, subpass_end_info);
.cmd_end_render_pass2_khr(command_buffer, subpass_end_info);
} }
pub const fn name() -> &'static CStr { pub const fn name() -> &'static CStr {

View file

@ -26,8 +26,7 @@ impl DeferredHostOperations {
allocation_callbacks: Option<&vk::AllocationCallbacks>, allocation_callbacks: Option<&vk::AllocationCallbacks>,
) -> VkResult<vk::DeferredOperationKHR> { ) -> VkResult<vk::DeferredOperationKHR> {
let mut operation = mem::zeroed(); let mut operation = mem::zeroed();
self.fp (self.fp.create_deferred_operation_khr)(
.create_deferred_operation_khr(
self.handle, self.handle,
allocation_callbacks.as_raw_ptr(), allocation_callbacks.as_raw_ptr(),
&mut operation, &mut operation,
@ -40,9 +39,7 @@ impl DeferredHostOperations {
&self, &self,
operation: vk::DeferredOperationKHR, operation: vk::DeferredOperationKHR,
) -> VkResult<()> { ) -> VkResult<()> {
self.fp (self.fp.deferred_operation_join_khr)(self.handle, operation).result()
.deferred_operation_join_khr(self.handle, operation)
.result()
} }
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkDestroyDeferredOperationKHR.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkDestroyDeferredOperationKHR.html>
@ -51,7 +48,7 @@ impl DeferredHostOperations {
operation: vk::DeferredOperationKHR, operation: vk::DeferredOperationKHR,
allocation_callbacks: Option<&vk::AllocationCallbacks>, allocation_callbacks: Option<&vk::AllocationCallbacks>,
) { ) {
self.fp.destroy_deferred_operation_khr( (self.fp.destroy_deferred_operation_khr)(
self.handle, self.handle,
operation, operation,
allocation_callbacks.as_raw_ptr(), allocation_callbacks.as_raw_ptr(),
@ -63,8 +60,7 @@ impl DeferredHostOperations {
&self, &self,
operation: vk::DeferredOperationKHR, operation: vk::DeferredOperationKHR,
) -> u32 { ) -> u32 {
self.fp (self.fp.get_deferred_operation_max_concurrency_khr)(self.handle, operation)
.get_deferred_operation_max_concurrency_khr(self.handle, operation)
} }
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetDeferredOperationResultKHR.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetDeferredOperationResultKHR.html>
@ -72,9 +68,7 @@ impl DeferredHostOperations {
&self, &self,
operation: vk::DeferredOperationKHR, operation: vk::DeferredOperationKHR,
) -> VkResult<()> { ) -> VkResult<()> {
self.fp (self.fp.get_deferred_operation_result_khr)(self.handle, operation).result()
.get_deferred_operation_result_khr(self.handle, operation)
.result()
} }
pub const fn name() -> &'static CStr { pub const fn name() -> &'static CStr {

View file

@ -26,8 +26,7 @@ impl Display {
physical_device: vk::PhysicalDevice, physical_device: vk::PhysicalDevice,
) -> VkResult<Vec<vk::DisplayPropertiesKHR>> { ) -> VkResult<Vec<vk::DisplayPropertiesKHR>> {
read_into_uninitialized_vector(|count, data| { read_into_uninitialized_vector(|count, data| {
self.fp (self.fp.get_physical_device_display_properties_khr)(physical_device, count, data)
.get_physical_device_display_properties_khr(physical_device, count, data)
}) })
} }
@ -37,8 +36,7 @@ impl Display {
physical_device: vk::PhysicalDevice, physical_device: vk::PhysicalDevice,
) -> VkResult<Vec<vk::DisplayPlanePropertiesKHR>> { ) -> VkResult<Vec<vk::DisplayPlanePropertiesKHR>> {
read_into_uninitialized_vector(|count, data| { read_into_uninitialized_vector(|count, data| {
self.fp (self.fp.get_physical_device_display_plane_properties_khr)(physical_device, count, data)
.get_physical_device_display_plane_properties_khr(physical_device, count, data)
}) })
} }
@ -49,7 +47,7 @@ impl Display {
plane_index: u32, plane_index: u32,
) -> VkResult<Vec<vk::DisplayKHR>> { ) -> VkResult<Vec<vk::DisplayKHR>> {
read_into_uninitialized_vector(|count, data| { read_into_uninitialized_vector(|count, data| {
self.fp.get_display_plane_supported_displays_khr( (self.fp.get_display_plane_supported_displays_khr)(
physical_device, physical_device,
plane_index, plane_index,
count, count,
@ -65,8 +63,7 @@ impl Display {
display: vk::DisplayKHR, display: vk::DisplayKHR,
) -> VkResult<Vec<vk::DisplayModePropertiesKHR>> { ) -> VkResult<Vec<vk::DisplayModePropertiesKHR>> {
read_into_uninitialized_vector(|count, data| { read_into_uninitialized_vector(|count, data| {
self.fp (self.fp.get_display_mode_properties_khr)(physical_device, display, count, data)
.get_display_mode_properties_khr(physical_device, display, count, data)
}) })
} }
@ -79,8 +76,7 @@ impl Display {
allocation_callbacks: Option<&vk::AllocationCallbacks>, allocation_callbacks: Option<&vk::AllocationCallbacks>,
) -> VkResult<vk::DisplayModeKHR> { ) -> VkResult<vk::DisplayModeKHR> {
let mut display_mode = mem::MaybeUninit::zeroed(); let mut display_mode = mem::MaybeUninit::zeroed();
self.fp (self.fp.create_display_mode_khr)(
.create_display_mode_khr(
physical_device, physical_device,
display, display,
create_info, create_info,
@ -98,8 +94,7 @@ impl Display {
plane_index: u32, plane_index: u32,
) -> VkResult<vk::DisplayPlaneCapabilitiesKHR> { ) -> VkResult<vk::DisplayPlaneCapabilitiesKHR> {
let mut display_plane_capabilities = mem::MaybeUninit::zeroed(); let mut display_plane_capabilities = mem::MaybeUninit::zeroed();
self.fp (self.fp.get_display_plane_capabilities_khr)(
.get_display_plane_capabilities_khr(
physical_device, physical_device,
mode, mode,
plane_index, plane_index,
@ -115,8 +110,7 @@ impl Display {
allocation_callbacks: Option<&vk::AllocationCallbacks>, allocation_callbacks: Option<&vk::AllocationCallbacks>,
) -> VkResult<vk::SurfaceKHR> { ) -> VkResult<vk::SurfaceKHR> {
let mut surface = mem::MaybeUninit::zeroed(); let mut surface = mem::MaybeUninit::zeroed();
self.fp (self.fp.create_display_plane_surface_khr)(
.create_display_plane_surface_khr(
self.handle, self.handle,
create_info, create_info,
allocation_callbacks.as_raw_ptr(), allocation_callbacks.as_raw_ptr(),

View file

@ -27,7 +27,7 @@ impl DisplaySwapchain {
allocation_callbacks: Option<&vk::AllocationCallbacks>, allocation_callbacks: Option<&vk::AllocationCallbacks>,
) -> VkResult<Vec<vk::SwapchainKHR>> { ) -> VkResult<Vec<vk::SwapchainKHR>> {
let mut swapchains = Vec::with_capacity(create_infos.len()); let mut swapchains = Vec::with_capacity(create_infos.len());
let err_code = self.fp.create_shared_swapchains_khr( let err_code = (self.fp.create_shared_swapchains_khr)(
self.handle, self.handle,
create_infos.len() as u32, create_infos.len() as u32,
create_infos.as_ptr(), create_infos.as_ptr(),

View file

@ -27,7 +27,7 @@ impl DrawIndirectCount {
max_draw_count: u32, max_draw_count: u32,
stride: u32, stride: u32,
) { ) {
self.fp.cmd_draw_indexed_indirect_count_khr( (self.fp.cmd_draw_indexed_indirect_count_khr)(
command_buffer, command_buffer,
buffer, buffer,
offset, offset,
@ -49,7 +49,7 @@ impl DrawIndirectCount {
max_draw_count: u32, max_draw_count: u32,
stride: u32, stride: u32,
) { ) {
self.fp.cmd_draw_indexed_indirect_count_khr( (self.fp.cmd_draw_indexed_indirect_count_khr)(
command_buffer, command_buffer,
buffer, buffer,
offset, offset,

View file

@ -22,13 +22,12 @@ impl DynamicRendering {
command_buffer: vk::CommandBuffer, command_buffer: vk::CommandBuffer,
rendering_info: &vk::RenderingInfoKHR, rendering_info: &vk::RenderingInfoKHR,
) { ) {
self.fp (self.fp.cmd_begin_rendering_khr)(command_buffer, rendering_info)
.cmd_begin_rendering_khr(command_buffer, rendering_info)
} }
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdEndRenderingKHR.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdEndRenderingKHR.html>
pub unsafe fn cmd_end_rendering(&self, command_buffer: vk::CommandBuffer) { pub unsafe fn cmd_end_rendering(&self, command_buffer: vk::CommandBuffer) {
self.fp.cmd_end_rendering_khr(command_buffer) (self.fp.cmd_end_rendering_khr)(command_buffer)
} }
pub const fn name() -> &'static CStr { pub const fn name() -> &'static CStr {

View file

@ -21,17 +21,13 @@ impl ExternalFenceFd {
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkImportFenceFdKHR.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkImportFenceFdKHR.html>
pub unsafe fn import_fence_fd(&self, import_info: &vk::ImportFenceFdInfoKHR) -> VkResult<()> { pub unsafe fn import_fence_fd(&self, import_info: &vk::ImportFenceFdInfoKHR) -> VkResult<()> {
self.fp (self.fp.import_fence_fd_khr)(self.handle, import_info).result()
.import_fence_fd_khr(self.handle, import_info)
.result()
} }
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetFenceFdKHR.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetFenceFdKHR.html>
pub unsafe fn get_fence_fd(&self, get_info: &vk::FenceGetFdInfoKHR) -> VkResult<i32> { pub unsafe fn get_fence_fd(&self, get_info: &vk::FenceGetFdInfoKHR) -> VkResult<i32> {
let mut fd = -1; let mut fd = -1;
self.fp (self.fp.get_fence_fd_khr)(self.handle, get_info, &mut fd).result_with_success(fd)
.get_fence_fd_khr(self.handle, get_info, &mut fd)
.result_with_success(fd)
} }
pub const fn name() -> &'static CStr { pub const fn name() -> &'static CStr {

View file

@ -26,9 +26,7 @@ impl ExternalFenceWin32 {
&self, &self,
import_info: &vk::ImportFenceWin32HandleInfoKHR, import_info: &vk::ImportFenceWin32HandleInfoKHR,
) -> VkResult<()> { ) -> VkResult<()> {
self.fp (self.fp.import_fence_win32_handle_khr)(self.handle, import_info).result()
.import_fence_win32_handle_khr(self.handle, import_info)
.result()
} }
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetFenceWin32HandleKHR.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetFenceWin32HandleKHR.html>
@ -37,8 +35,7 @@ impl ExternalFenceWin32 {
get_info: &vk::FenceGetWin32HandleInfoKHR, get_info: &vk::FenceGetWin32HandleInfoKHR,
) -> VkResult<vk::HANDLE> { ) -> VkResult<vk::HANDLE> {
let mut handle = ptr::null_mut(); let mut handle = ptr::null_mut();
self.fp (self.fp.get_fence_win32_handle_khr)(self.handle, get_info, &mut handle)
.get_fence_win32_handle_khr(self.handle, get_info, &mut handle)
.result_with_success(handle) .result_with_success(handle)
} }

View file

@ -22,9 +22,7 @@ impl ExternalMemoryFd {
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetMemoryFdKHR.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetMemoryFdKHR.html>
pub unsafe fn get_memory_fd(&self, create_info: &vk::MemoryGetFdInfoKHR) -> VkResult<i32> { pub unsafe fn get_memory_fd(&self, create_info: &vk::MemoryGetFdInfoKHR) -> VkResult<i32> {
let mut fd = -1; let mut fd = -1;
self.fp (self.fp.get_memory_fd_khr)(self.handle, create_info, &mut fd).result_with_success(fd)
.get_memory_fd_khr(self.handle, create_info, &mut fd)
.result_with_success(fd)
} }
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetMemoryFdPropertiesKHR.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetMemoryFdPropertiesKHR.html>
@ -34,8 +32,12 @@ impl ExternalMemoryFd {
fd: i32, fd: i32,
) -> VkResult<vk::MemoryFdPropertiesKHR> { ) -> VkResult<vk::MemoryFdPropertiesKHR> {
let mut memory_fd_properties = Default::default(); let mut memory_fd_properties = Default::default();
self.fp (self.fp.get_memory_fd_properties_khr)(
.get_memory_fd_properties_khr(self.handle, handle_type, fd, &mut memory_fd_properties) self.handle,
handle_type,
fd,
&mut memory_fd_properties,
)
.result_with_success(memory_fd_properties) .result_with_success(memory_fd_properties)
} }

View file

@ -27,8 +27,7 @@ impl ExternalMemoryWin32 {
create_info: &vk::MemoryGetWin32HandleInfoKHR, create_info: &vk::MemoryGetWin32HandleInfoKHR,
) -> VkResult<vk::HANDLE> { ) -> VkResult<vk::HANDLE> {
let mut handle = ptr::null_mut(); let mut handle = ptr::null_mut();
self.fp (self.fp.get_memory_win32_handle_khr)(self.handle, create_info, &mut handle)
.get_memory_win32_handle_khr(self.handle, create_info, &mut handle)
.result_with_success(handle) .result_with_success(handle)
} }
@ -39,8 +38,7 @@ impl ExternalMemoryWin32 {
handle: vk::HANDLE, handle: vk::HANDLE,
) -> VkResult<vk::MemoryWin32HandlePropertiesKHR> { ) -> VkResult<vk::MemoryWin32HandlePropertiesKHR> {
let mut memory_win32_handle_properties = Default::default(); let mut memory_win32_handle_properties = Default::default();
self.fp (self.fp.get_memory_win32_handle_properties_khr)(
.get_memory_win32_handle_properties_khr(
self.handle, self.handle,
handle_type, handle_type,
handle, handle,

View file

@ -24,17 +24,13 @@ impl ExternalSemaphoreFd {
&self, &self,
import_info: &vk::ImportSemaphoreFdInfoKHR, import_info: &vk::ImportSemaphoreFdInfoKHR,
) -> VkResult<()> { ) -> VkResult<()> {
self.fp (self.fp.import_semaphore_fd_khr)(self.handle, import_info).result()
.import_semaphore_fd_khr(self.handle, import_info)
.result()
} }
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetSemaphoreFdKHR.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetSemaphoreFdKHR.html>
pub unsafe fn get_semaphore_fd(&self, get_info: &vk::SemaphoreGetFdInfoKHR) -> VkResult<i32> { pub unsafe fn get_semaphore_fd(&self, get_info: &vk::SemaphoreGetFdInfoKHR) -> VkResult<i32> {
let mut fd = -1; let mut fd = -1;
self.fp (self.fp.get_semaphore_fd_khr)(self.handle, get_info, &mut fd).result_with_success(fd)
.get_semaphore_fd_khr(self.handle, get_info, &mut fd)
.result_with_success(fd)
} }
pub const fn name() -> &'static CStr { pub const fn name() -> &'static CStr {

View file

@ -26,9 +26,7 @@ impl ExternalSemaphoreWin32 {
&self, &self,
import_info: &vk::ImportSemaphoreWin32HandleInfoKHR, import_info: &vk::ImportSemaphoreWin32HandleInfoKHR,
) -> VkResult<()> { ) -> VkResult<()> {
self.fp (self.fp.import_semaphore_win32_handle_khr)(self.handle, import_info).result()
.import_semaphore_win32_handle_khr(self.handle, import_info)
.result()
} }
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetSemaphoreWin32HandleKHR.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetSemaphoreWin32HandleKHR.html>
@ -37,8 +35,7 @@ impl ExternalSemaphoreWin32 {
get_info: &vk::SemaphoreGetWin32HandleInfoKHR, get_info: &vk::SemaphoreGetWin32HandleInfoKHR,
) -> VkResult<vk::HANDLE> { ) -> VkResult<vk::HANDLE> {
let mut handle = ptr::null_mut(); let mut handle = ptr::null_mut();
self.fp (self.fp.get_semaphore_win32_handle_khr)(self.handle, get_info, &mut handle)
.get_semaphore_win32_handle_khr(self.handle, get_info, &mut handle)
.result_with_success(handle) .result_with_success(handle)
} }

View file

@ -25,8 +25,7 @@ impl GetMemoryRequirements2 {
info: &vk::BufferMemoryRequirementsInfo2KHR, info: &vk::BufferMemoryRequirementsInfo2KHR,
memory_requirements: &mut vk::MemoryRequirements2KHR, memory_requirements: &mut vk::MemoryRequirements2KHR,
) { ) {
self.fp (self.fp.get_buffer_memory_requirements2_khr)(self.handle, info, memory_requirements);
.get_buffer_memory_requirements2_khr(self.handle, info, memory_requirements);
} }
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetImageMemoryRequirements2KHR.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetImageMemoryRequirements2KHR.html>
@ -35,8 +34,7 @@ impl GetMemoryRequirements2 {
info: &vk::ImageMemoryRequirementsInfo2KHR, info: &vk::ImageMemoryRequirementsInfo2KHR,
memory_requirements: &mut vk::MemoryRequirements2KHR, memory_requirements: &mut vk::MemoryRequirements2KHR,
) { ) {
self.fp (self.fp.get_image_memory_requirements2_khr)(self.handle, info, memory_requirements);
.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()] /// Retrieve the number of elements to pass to [`get_image_sparse_memory_requirements2()`][Self::get_image_sparse_memory_requirements2()]
@ -45,7 +43,7 @@ impl GetMemoryRequirements2 {
info: &vk::ImageSparseMemoryRequirementsInfo2KHR, info: &vk::ImageSparseMemoryRequirementsInfo2KHR,
) -> usize { ) -> usize {
let mut count = 0; let mut count = 0;
self.fp.get_image_sparse_memory_requirements2_khr( (self.fp.get_image_sparse_memory_requirements2_khr)(
self.handle, self.handle,
info, info,
&mut count, &mut count,
@ -64,7 +62,7 @@ impl GetMemoryRequirements2 {
out: &mut [vk::SparseImageMemoryRequirements2KHR], out: &mut [vk::SparseImageMemoryRequirements2KHR],
) { ) {
let mut count = out.len() as u32; let mut count = out.len() as u32;
self.fp.get_image_sparse_memory_requirements2_khr( (self.fp.get_image_sparse_memory_requirements2_khr)(
self.handle, self.handle,
info, info,
&mut count, &mut count,

View file

@ -24,8 +24,7 @@ impl GetPhysicalDeviceProperties2 {
physical_device: vk::PhysicalDevice, physical_device: vk::PhysicalDevice,
features: &mut vk::PhysicalDeviceFeatures2KHR, features: &mut vk::PhysicalDeviceFeatures2KHR,
) { ) {
self.fp (self.fp.get_physical_device_features2_khr)(physical_device, features);
.get_physical_device_features2_khr(physical_device, features);
} }
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceFormatProperties2KHR.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceFormatProperties2KHR.html>
@ -35,7 +34,7 @@ impl GetPhysicalDeviceProperties2 {
format: vk::Format, format: vk::Format,
format_properties: &mut vk::FormatProperties2KHR, format_properties: &mut vk::FormatProperties2KHR,
) { ) {
self.fp.get_physical_device_format_properties2_khr( (self.fp.get_physical_device_format_properties2_khr)(
physical_device, physical_device,
format, format,
format_properties, format_properties,
@ -49,8 +48,7 @@ impl GetPhysicalDeviceProperties2 {
image_format_info: &vk::PhysicalDeviceImageFormatInfo2KHR, image_format_info: &vk::PhysicalDeviceImageFormatInfo2KHR,
image_format_properties: &mut vk::ImageFormatProperties2KHR, image_format_properties: &mut vk::ImageFormatProperties2KHR,
) -> VkResult<()> { ) -> VkResult<()> {
self.fp (self.fp.get_physical_device_image_format_properties2_khr)(
.get_physical_device_image_format_properties2_khr(
physical_device, physical_device,
image_format_info, image_format_info,
image_format_properties, image_format_properties,
@ -64,8 +62,7 @@ impl GetPhysicalDeviceProperties2 {
physical_device: vk::PhysicalDevice, physical_device: vk::PhysicalDevice,
memory_properties: &mut vk::PhysicalDeviceMemoryProperties2KHR, memory_properties: &mut vk::PhysicalDeviceMemoryProperties2KHR,
) { ) {
self.fp (self.fp.get_physical_device_memory_properties2_khr)(physical_device, memory_properties);
.get_physical_device_memory_properties2_khr(physical_device, memory_properties);
} }
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceProperties2KHR.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceProperties2KHR.html>
@ -74,8 +71,7 @@ impl GetPhysicalDeviceProperties2 {
physical_device: vk::PhysicalDevice, physical_device: vk::PhysicalDevice,
properties: &mut vk::PhysicalDeviceProperties2KHR, properties: &mut vk::PhysicalDeviceProperties2KHR,
) { ) {
self.fp (self.fp.get_physical_device_properties2_khr)(physical_device, properties);
.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()] /// Retrieve the number of elements to pass to [`get_physical_device_queue_family_properties2()`][Self::get_physical_device_queue_family_properties2()]
@ -84,7 +80,7 @@ impl GetPhysicalDeviceProperties2 {
physical_device: vk::PhysicalDevice, physical_device: vk::PhysicalDevice,
) -> usize { ) -> usize {
let mut count = 0; let mut count = 0;
self.fp.get_physical_device_queue_family_properties2_khr( (self.fp.get_physical_device_queue_family_properties2_khr)(
physical_device, physical_device,
&mut count, &mut count,
ptr::null_mut(), ptr::null_mut(),
@ -102,7 +98,7 @@ impl GetPhysicalDeviceProperties2 {
out: &mut [vk::QueueFamilyProperties2KHR], out: &mut [vk::QueueFamilyProperties2KHR],
) { ) {
let mut count = out.len() as u32; let mut count = out.len() as u32;
self.fp.get_physical_device_queue_family_properties2_khr( (self.fp.get_physical_device_queue_family_properties2_khr)(
physical_device, physical_device,
&mut count, &mut count,
out.as_mut_ptr(), out.as_mut_ptr(),
@ -117,8 +113,9 @@ impl GetPhysicalDeviceProperties2 {
format_info: &vk::PhysicalDeviceSparseImageFormatInfo2KHR, format_info: &vk::PhysicalDeviceSparseImageFormatInfo2KHR,
) -> usize { ) -> usize {
let mut count = 0; let mut count = 0;
self.fp (self
.get_physical_device_sparse_image_format_properties2_khr( .fp
.get_physical_device_sparse_image_format_properties2_khr)(
physical_device, physical_device,
format_info, format_info,
&mut count, &mut count,
@ -138,8 +135,9 @@ impl GetPhysicalDeviceProperties2 {
out: &mut [vk::SparseImageFormatProperties2KHR], out: &mut [vk::SparseImageFormatProperties2KHR],
) { ) {
let mut count = out.len() as u32; let mut count = out.len() as u32;
self.fp (self
.get_physical_device_sparse_image_format_properties2_khr( .fp
.get_physical_device_sparse_image_format_properties2_khr)(
physical_device, physical_device,
format_info, format_info,
&mut count, &mut count,

View file

@ -24,8 +24,7 @@ impl GetSurfaceCapabilities2 {
surface_info: &vk::PhysicalDeviceSurfaceInfo2KHR, surface_info: &vk::PhysicalDeviceSurfaceInfo2KHR,
) -> VkResult<vk::SurfaceCapabilities2KHR> { ) -> VkResult<vk::SurfaceCapabilities2KHR> {
let mut surface_capabilities = Default::default(); let mut surface_capabilities = Default::default();
self.fp (self.fp.get_physical_device_surface_capabilities2_khr)(
.get_physical_device_surface_capabilities2_khr(
physical_device, physical_device,
surface_info, surface_info,
&mut surface_capabilities, &mut surface_capabilities,
@ -40,7 +39,7 @@ impl GetSurfaceCapabilities2 {
surface_info: &vk::PhysicalDeviceSurfaceInfo2KHR, surface_info: &vk::PhysicalDeviceSurfaceInfo2KHR,
) -> VkResult<usize> { ) -> VkResult<usize> {
let mut count = 0; let mut count = 0;
let err_code = self.fp.get_physical_device_surface_formats2_khr( let err_code = (self.fp.get_physical_device_surface_formats2_khr)(
physical_device, physical_device,
surface_info, surface_info,
&mut count, &mut count,
@ -60,7 +59,7 @@ impl GetSurfaceCapabilities2 {
out: &mut [vk::SurfaceFormat2KHR], out: &mut [vk::SurfaceFormat2KHR],
) -> VkResult<()> { ) -> VkResult<()> {
let mut count = out.len() as u32; let mut count = out.len() as u32;
let err_code = self.fp.get_physical_device_surface_formats2_khr( let err_code = (self.fp.get_physical_device_surface_formats2_khr)(
physical_device, physical_device,
surface_info, surface_info,
&mut count, &mut count,

View file

@ -24,8 +24,7 @@ impl Maintenance1 {
command_pool: vk::CommandPool, command_pool: vk::CommandPool,
flags: vk::CommandPoolTrimFlagsKHR, flags: vk::CommandPoolTrimFlagsKHR,
) { ) {
self.fp (self.fp.trim_command_pool_khr)(self.handle, command_pool, flags);
.trim_command_pool_khr(self.handle, command_pool, flags);
} }
pub const fn name() -> &'static CStr { pub const fn name() -> &'static CStr {

View file

@ -24,8 +24,7 @@ impl Maintenance3 {
create_info: &vk::DescriptorSetLayoutCreateInfo, create_info: &vk::DescriptorSetLayoutCreateInfo,
out: &mut vk::DescriptorSetLayoutSupportKHR, out: &mut vk::DescriptorSetLayoutSupportKHR,
) { ) {
self.fp (self.fp.get_descriptor_set_layout_support_khr)(self.handle, create_info, out);
.get_descriptor_set_layout_support_khr(self.handle, create_info, out);
} }
pub const fn name() -> &'static CStr { pub const fn name() -> &'static CStr {

View file

@ -24,8 +24,7 @@ impl Maintenance4 {
create_info: &vk::DeviceBufferMemoryRequirementsKHR, create_info: &vk::DeviceBufferMemoryRequirementsKHR,
out: &mut vk::MemoryRequirements2, out: &mut vk::MemoryRequirements2,
) { ) {
self.fp (self.fp.get_device_buffer_memory_requirements_khr)(self.handle, create_info, out)
.get_device_buffer_memory_requirements_khr(self.handle, create_info, out)
} }
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetDeviceImageMemoryRequirementsKHR.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetDeviceImageMemoryRequirementsKHR.html>
@ -34,8 +33,7 @@ impl Maintenance4 {
create_info: &vk::DeviceImageMemoryRequirementsKHR, create_info: &vk::DeviceImageMemoryRequirementsKHR,
out: &mut vk::MemoryRequirements2, out: &mut vk::MemoryRequirements2,
) { ) {
self.fp (self.fp.get_device_image_memory_requirements_khr)(self.handle, create_info, out)
.get_device_image_memory_requirements_khr(self.handle, create_info, out)
} }
/// Retrieve the number of elements to pass to [`get_device_image_sparse_memory_requirements()`][Self::get_device_image_sparse_memory_requirements()] /// Retrieve the number of elements to pass to [`get_device_image_sparse_memory_requirements()`][Self::get_device_image_sparse_memory_requirements()]
@ -44,7 +42,7 @@ impl Maintenance4 {
create_info: &vk::DeviceImageMemoryRequirementsKHR, create_info: &vk::DeviceImageMemoryRequirementsKHR,
) -> usize { ) -> usize {
let mut count = 0; let mut count = 0;
self.fp.get_device_image_sparse_memory_requirements_khr( (self.fp.get_device_image_sparse_memory_requirements_khr)(
self.handle, self.handle,
create_info, create_info,
&mut count, &mut count,
@ -63,7 +61,7 @@ impl Maintenance4 {
out: &mut [vk::SparseImageMemoryRequirements2], out: &mut [vk::SparseImageMemoryRequirements2],
) { ) {
let mut count = out.len() as u32; let mut count = out.len() as u32;
self.fp.get_device_image_sparse_memory_requirements_khr( (self.fp.get_device_image_sparse_memory_requirements_khr)(
self.handle, self.handle,
create_info, create_info,
&mut count, &mut count,

View file

@ -25,8 +25,7 @@ impl PipelineExecutableProperties {
executable_info: &vk::PipelineExecutableInfoKHR, executable_info: &vk::PipelineExecutableInfoKHR,
) -> VkResult<Vec<vk::PipelineExecutableInternalRepresentationKHR>> { ) -> VkResult<Vec<vk::PipelineExecutableInternalRepresentationKHR>> {
read_into_defaulted_vector(|count, data| { read_into_defaulted_vector(|count, data| {
self.fp (self.fp.get_pipeline_executable_internal_representations_khr)(
.get_pipeline_executable_internal_representations_khr(
self.handle, self.handle,
executable_info, executable_info,
count, count,
@ -41,8 +40,12 @@ impl PipelineExecutableProperties {
pipeline_info: &vk::PipelineInfoKHR, pipeline_info: &vk::PipelineInfoKHR,
) -> VkResult<Vec<vk::PipelineExecutablePropertiesKHR>> { ) -> VkResult<Vec<vk::PipelineExecutablePropertiesKHR>> {
read_into_defaulted_vector(|count, data| { read_into_defaulted_vector(|count, data| {
self.fp (self.fp.get_pipeline_executable_properties_khr)(
.get_pipeline_executable_properties_khr(self.handle, pipeline_info, count, data) self.handle,
pipeline_info,
count,
data,
)
}) })
} }
@ -52,7 +55,7 @@ impl PipelineExecutableProperties {
executable_info: &vk::PipelineExecutableInfoKHR, executable_info: &vk::PipelineExecutableInfoKHR,
) -> VkResult<Vec<vk::PipelineExecutableStatisticKHR>> { ) -> VkResult<Vec<vk::PipelineExecutableStatisticKHR>> {
read_into_defaulted_vector(|count, data| { read_into_defaulted_vector(|count, data| {
self.fp.get_pipeline_executable_statistics_khr( (self.fp.get_pipeline_executable_statistics_khr)(
self.handle, self.handle,
executable_info, executable_info,
count, count,

View file

@ -26,9 +26,7 @@ impl PresentWait {
present_id: u64, present_id: u64,
timeout: u64, timeout: u64,
) -> VkResult<()> { ) -> VkResult<()> {
self.fp (self.fp.wait_for_present_khr)(self.handle, swapchain, present_id, timeout).result()
.wait_for_present_khr(self.handle, swapchain, present_id, timeout)
.result()
} }
pub const fn name() -> &'static CStr { pub const fn name() -> &'static CStr {

View file

@ -26,7 +26,7 @@ impl PushDescriptor {
set: u32, set: u32,
descriptor_writes: &[vk::WriteDescriptorSet], descriptor_writes: &[vk::WriteDescriptorSet],
) { ) {
self.fp.cmd_push_descriptor_set_khr( (self.fp.cmd_push_descriptor_set_khr)(
command_buffer, command_buffer,
pipeline_bind_point, pipeline_bind_point,
layout, layout,
@ -45,7 +45,7 @@ impl PushDescriptor {
set: u32, set: u32,
p_data: *const c_void, p_data: *const c_void,
) { ) {
self.fp.cmd_push_descriptor_set_with_template_khr( (self.fp.cmd_push_descriptor_set_with_template_khr)(
command_buffer, command_buffer,
descriptor_update_template, descriptor_update_template,
layout, layout,

View file

@ -44,7 +44,7 @@ impl RayTracingPipeline {
height: u32, height: u32,
depth: u32, depth: u32,
) { ) {
self.fp.cmd_trace_rays_khr( (self.fp.cmd_trace_rays_khr)(
command_buffer, command_buffer,
raygen_shader_binding_tables, raygen_shader_binding_tables,
miss_shader_binding_tables, miss_shader_binding_tables,
@ -65,8 +65,7 @@ impl RayTracingPipeline {
allocation_callbacks: Option<&vk::AllocationCallbacks>, allocation_callbacks: Option<&vk::AllocationCallbacks>,
) -> VkResult<Vec<vk::Pipeline>> { ) -> VkResult<Vec<vk::Pipeline>> {
let mut pipelines = vec![mem::zeroed(); create_info.len()]; let mut pipelines = vec![mem::zeroed(); create_info.len()];
self.fp (self.fp.create_ray_tracing_pipelines_khr)(
.create_ray_tracing_pipelines_khr(
self.handle, self.handle,
deferred_operation, deferred_operation,
pipeline_cache, pipeline_cache,
@ -87,7 +86,7 @@ impl RayTracingPipeline {
data_size: usize, data_size: usize,
) -> VkResult<Vec<u8>> { ) -> VkResult<Vec<u8>> {
let mut data = Vec::<u8>::with_capacity(data_size); let mut data = Vec::<u8>::with_capacity(data_size);
let err_code = self.fp.get_ray_tracing_shader_group_handles_khr( let err_code = (self.fp.get_ray_tracing_shader_group_handles_khr)(
self.handle, self.handle,
pipeline, pipeline,
first_group, first_group,
@ -109,8 +108,9 @@ impl RayTracingPipeline {
) -> VkResult<Vec<u8>> { ) -> VkResult<Vec<u8>> {
let mut data: Vec<u8> = Vec::with_capacity(data_size); let mut data: Vec<u8> = Vec::with_capacity(data_size);
self.fp (self
.get_ray_tracing_capture_replay_shader_group_handles_khr( .fp
.get_ray_tracing_capture_replay_shader_group_handles_khr)(
self.handle, self.handle,
pipeline, pipeline,
first_group, first_group,
@ -131,7 +131,7 @@ impl RayTracingPipeline {
callable_shader_binding_table: &[vk::StridedDeviceAddressRegionKHR], callable_shader_binding_table: &[vk::StridedDeviceAddressRegionKHR],
indirect_device_address: vk::DeviceAddress, indirect_device_address: vk::DeviceAddress,
) { ) {
self.fp.cmd_trace_rays_indirect_khr( (self.fp.cmd_trace_rays_indirect_khr)(
command_buffer, command_buffer,
raygen_shader_binding_table.as_ptr(), raygen_shader_binding_table.as_ptr(),
miss_shader_binding_table.as_ptr(), miss_shader_binding_table.as_ptr(),
@ -148,7 +148,7 @@ impl RayTracingPipeline {
group: u32, group: u32,
group_shader: vk::ShaderGroupShaderKHR, group_shader: vk::ShaderGroupShaderKHR,
) -> vk::DeviceSize { ) -> vk::DeviceSize {
self.fp.get_ray_tracing_shader_group_stack_size_khr( (self.fp.get_ray_tracing_shader_group_stack_size_khr)(
self.handle, self.handle,
pipeline, pipeline,
group, group,
@ -162,8 +162,7 @@ impl RayTracingPipeline {
command_buffer: vk::CommandBuffer, command_buffer: vk::CommandBuffer,
pipeline_stack_size: u32, pipeline_stack_size: u32,
) { ) {
self.fp (self.fp.cmd_set_ray_tracing_pipeline_stack_size_khr)(command_buffer, pipeline_stack_size);
.cmd_set_ray_tracing_pipeline_stack_size_khr(command_buffer, pipeline_stack_size);
} }
pub const fn name() -> &'static CStr { pub const fn name() -> &'static CStr {

View file

@ -28,8 +28,7 @@ impl Surface {
surface: vk::SurfaceKHR, surface: vk::SurfaceKHR,
) -> VkResult<bool> { ) -> VkResult<bool> {
let mut b = 0; let mut b = 0;
self.fp (self.fp.get_physical_device_surface_support_khr)(
.get_physical_device_surface_support_khr(
physical_device, physical_device,
queue_family_index, queue_family_index,
surface, surface,
@ -45,7 +44,7 @@ impl Surface {
surface: vk::SurfaceKHR, surface: vk::SurfaceKHR,
) -> VkResult<Vec<vk::PresentModeKHR>> { ) -> VkResult<Vec<vk::PresentModeKHR>> {
read_into_uninitialized_vector(|count, data| { read_into_uninitialized_vector(|count, data| {
self.fp.get_physical_device_surface_present_modes_khr( (self.fp.get_physical_device_surface_present_modes_khr)(
physical_device, physical_device,
surface, surface,
count, count,
@ -61,8 +60,7 @@ impl Surface {
surface: vk::SurfaceKHR, surface: vk::SurfaceKHR,
) -> VkResult<vk::SurfaceCapabilitiesKHR> { ) -> VkResult<vk::SurfaceCapabilitiesKHR> {
let mut surface_capabilities = mem::zeroed(); let mut surface_capabilities = mem::zeroed();
self.fp (self.fp.get_physical_device_surface_capabilities_khr)(
.get_physical_device_surface_capabilities_khr(
physical_device, physical_device,
surface, surface,
&mut surface_capabilities, &mut surface_capabilities,
@ -77,8 +75,7 @@ impl Surface {
surface: vk::SurfaceKHR, surface: vk::SurfaceKHR,
) -> VkResult<Vec<vk::SurfaceFormatKHR>> { ) -> VkResult<Vec<vk::SurfaceFormatKHR>> {
read_into_uninitialized_vector(|count, data| { read_into_uninitialized_vector(|count, data| {
self.fp (self.fp.get_physical_device_surface_formats_khr)(physical_device, surface, count, data)
.get_physical_device_surface_formats_khr(physical_device, surface, count, data)
}) })
} }
@ -88,8 +85,7 @@ impl Surface {
surface: vk::SurfaceKHR, surface: vk::SurfaceKHR,
allocation_callbacks: Option<&vk::AllocationCallbacks>, allocation_callbacks: Option<&vk::AllocationCallbacks>,
) { ) {
self.fp (self.fp.destroy_surface_khr)(self.handle, surface, allocation_callbacks.as_raw_ptr());
.destroy_surface_khr(self.handle, surface, allocation_callbacks.as_raw_ptr());
} }
pub const fn name() -> &'static CStr { pub const fn name() -> &'static CStr {

View file

@ -26,8 +26,7 @@ impl Swapchain {
swapchain: vk::SwapchainKHR, swapchain: vk::SwapchainKHR,
allocation_callbacks: Option<&vk::AllocationCallbacks>, allocation_callbacks: Option<&vk::AllocationCallbacks>,
) { ) {
self.fp (self.fp.destroy_swapchain_khr)(self.handle, swapchain, allocation_callbacks.as_raw_ptr());
.destroy_swapchain_khr(self.handle, swapchain, allocation_callbacks.as_raw_ptr());
} }
/// On success, returns the next image's index and whether the swapchain is suboptimal for the surface. /// On success, returns the next image's index and whether the swapchain is suboptimal for the surface.
@ -40,7 +39,7 @@ impl Swapchain {
fence: vk::Fence, fence: vk::Fence,
) -> VkResult<(u32, bool)> { ) -> VkResult<(u32, bool)> {
let mut index = 0; let mut index = 0;
let err_code = self.fp.acquire_next_image_khr( let err_code = (self.fp.acquire_next_image_khr)(
self.handle, self.handle,
swapchain, swapchain,
timeout, timeout,
@ -62,8 +61,7 @@ impl Swapchain {
allocation_callbacks: Option<&vk::AllocationCallbacks>, allocation_callbacks: Option<&vk::AllocationCallbacks>,
) -> VkResult<vk::SwapchainKHR> { ) -> VkResult<vk::SwapchainKHR> {
let mut swapchain = mem::zeroed(); let mut swapchain = mem::zeroed();
self.fp (self.fp.create_swapchain_khr)(
.create_swapchain_khr(
self.handle, self.handle,
create_info, create_info,
allocation_callbacks.as_raw_ptr(), allocation_callbacks.as_raw_ptr(),
@ -79,7 +77,7 @@ impl Swapchain {
queue: vk::Queue, queue: vk::Queue,
present_info: &vk::PresentInfoKHR, present_info: &vk::PresentInfoKHR,
) -> VkResult<bool> { ) -> VkResult<bool> {
let err_code = self.fp.queue_present_khr(queue, present_info); let err_code = (self.fp.queue_present_khr)(queue, present_info);
match err_code { match err_code {
vk::Result::SUCCESS => Ok(false), vk::Result::SUCCESS => Ok(false),
vk::Result::SUBOPTIMAL_KHR => Ok(true), vk::Result::SUBOPTIMAL_KHR => Ok(true),
@ -93,8 +91,7 @@ impl Swapchain {
swapchain: vk::SwapchainKHR, swapchain: vk::SwapchainKHR,
) -> VkResult<Vec<vk::Image>> { ) -> VkResult<Vec<vk::Image>> {
read_into_uninitialized_vector(|count, data| { read_into_uninitialized_vector(|count, data| {
self.fp (self.fp.get_swapchain_images_khr)(self.handle, swapchain, count, data)
.get_swapchain_images_khr(self.handle, swapchain, count, data)
}) })
} }

View file

@ -23,8 +23,7 @@ impl Synchronization2 {
command_buffer: vk::CommandBuffer, command_buffer: vk::CommandBuffer,
dependency_info: &vk::DependencyInfoKHR, dependency_info: &vk::DependencyInfoKHR,
) { ) {
self.fp (self.fp.cmd_pipeline_barrier2_khr)(command_buffer, dependency_info)
.cmd_pipeline_barrier2_khr(command_buffer, dependency_info)
} }
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdResetEvent2KHR.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdResetEvent2KHR.html>
@ -34,8 +33,7 @@ impl Synchronization2 {
event: vk::Event, event: vk::Event,
stage_mask: vk::PipelineStageFlags2KHR, stage_mask: vk::PipelineStageFlags2KHR,
) { ) {
self.fp (self.fp.cmd_reset_event2_khr)(command_buffer, event, stage_mask)
.cmd_reset_event2_khr(command_buffer, event, stage_mask)
} }
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetEvent2KHR.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdSetEvent2KHR.html>
@ -45,8 +43,7 @@ impl Synchronization2 {
event: vk::Event, event: vk::Event,
dependency_info: &vk::DependencyInfoKHR, dependency_info: &vk::DependencyInfoKHR,
) { ) {
self.fp (self.fp.cmd_set_event2_khr)(command_buffer, event, dependency_info)
.cmd_set_event2_khr(command_buffer, event, dependency_info)
} }
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdWaitEvents2KHR.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdWaitEvents2KHR.html>
@ -57,7 +54,7 @@ impl Synchronization2 {
dependency_infos: &[vk::DependencyInfoKHR], dependency_infos: &[vk::DependencyInfoKHR],
) { ) {
assert_eq!(events.len(), dependency_infos.len()); assert_eq!(events.len(), dependency_infos.len());
self.fp.cmd_wait_events2_khr( (self.fp.cmd_wait_events2_khr)(
command_buffer, command_buffer,
events.len() as u32, events.len() as u32,
events.as_ptr(), events.as_ptr(),
@ -73,8 +70,7 @@ impl Synchronization2 {
query_pool: vk::QueryPool, query_pool: vk::QueryPool,
query: u32, query: u32,
) { ) {
self.fp (self.fp.cmd_write_timestamp2_khr)(command_buffer, stage, query_pool, query)
.cmd_write_timestamp2_khr(command_buffer, stage, query_pool, query)
} }
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkQueueSubmit2KHR.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkQueueSubmit2KHR.html>
@ -84,9 +80,7 @@ impl Synchronization2 {
submits: &[vk::SubmitInfo2KHR], submits: &[vk::SubmitInfo2KHR],
fence: vk::Fence, fence: vk::Fence,
) -> VkResult<()> { ) -> VkResult<()> {
self.fp (self.fp.queue_submit2_khr)(queue, submits.len() as u32, submits.as_ptr(), fence).result()
.queue_submit2_khr(queue, submits.len() as u32, submits.as_ptr(), fence)
.result()
} }
pub const fn name() -> &'static CStr { pub const fn name() -> &'static CStr {

View file

@ -22,8 +22,7 @@ impl TimelineSemaphore {
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetSemaphoreCounterValue.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetSemaphoreCounterValue.html>
pub unsafe fn get_semaphore_counter_value(&self, semaphore: vk::Semaphore) -> VkResult<u64> { pub unsafe fn get_semaphore_counter_value(&self, semaphore: vk::Semaphore) -> VkResult<u64> {
let mut value = 0; let mut value = 0;
self.fp (self.fp.get_semaphore_counter_value_khr)(self.handle, semaphore, &mut value)
.get_semaphore_counter_value_khr(self.handle, semaphore, &mut value)
.result_with_success(value) .result_with_success(value)
} }
@ -33,16 +32,12 @@ impl TimelineSemaphore {
wait_info: &vk::SemaphoreWaitInfo, wait_info: &vk::SemaphoreWaitInfo,
timeout: u64, timeout: u64,
) -> VkResult<()> { ) -> VkResult<()> {
self.fp (self.fp.wait_semaphores_khr)(self.handle, wait_info, timeout).result()
.wait_semaphores_khr(self.handle, wait_info, timeout)
.result()
} }
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkSignalSemaphore.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkSignalSemaphore.html>
pub unsafe fn signal_semaphore(&self, signal_info: &vk::SemaphoreSignalInfo) -> VkResult<()> { pub unsafe fn signal_semaphore(&self, signal_info: &vk::SemaphoreSignalInfo) -> VkResult<()> {
self.fp (self.fp.signal_semaphore_khr)(self.handle, signal_info).result()
.signal_semaphore_khr(self.handle, signal_info)
.result()
} }
pub const fn name() -> &'static CStr { pub const fn name() -> &'static CStr {

View file

@ -27,8 +27,7 @@ impl WaylandSurface {
allocation_callbacks: Option<&vk::AllocationCallbacks>, allocation_callbacks: Option<&vk::AllocationCallbacks>,
) -> VkResult<vk::SurfaceKHR> { ) -> VkResult<vk::SurfaceKHR> {
let mut surface = mem::zeroed(); let mut surface = mem::zeroed();
self.fp (self.fp.create_wayland_surface_khr)(
.create_wayland_surface_khr(
self.handle, self.handle,
create_info, create_info,
allocation_callbacks.as_raw_ptr(), allocation_callbacks.as_raw_ptr(),
@ -44,9 +43,7 @@ impl WaylandSurface {
queue_family_index: u32, queue_family_index: u32,
wl_display: &mut vk::wl_display, wl_display: &mut vk::wl_display,
) -> bool { ) -> bool {
let b = self let b = (self.fp.get_physical_device_wayland_presentation_support_khr)(
.fp
.get_physical_device_wayland_presentation_support_khr(
physical_device, physical_device,
queue_family_index, queue_family_index,
wl_display, wl_display,

View file

@ -27,8 +27,7 @@ impl Win32Surface {
allocation_callbacks: Option<&vk::AllocationCallbacks>, allocation_callbacks: Option<&vk::AllocationCallbacks>,
) -> VkResult<vk::SurfaceKHR> { ) -> VkResult<vk::SurfaceKHR> {
let mut surface = mem::zeroed(); let mut surface = mem::zeroed();
self.fp (self.fp.create_win32_surface_khr)(
.create_win32_surface_khr(
self.handle, self.handle,
create_info, create_info,
allocation_callbacks.as_raw_ptr(), allocation_callbacks.as_raw_ptr(),
@ -43,7 +42,7 @@ impl Win32Surface {
physical_device: vk::PhysicalDevice, physical_device: vk::PhysicalDevice,
queue_family_index: u32, queue_family_index: u32,
) -> bool { ) -> bool {
let b = self.fp.get_physical_device_win32_presentation_support_khr( let b = (self.fp.get_physical_device_win32_presentation_support_khr)(
physical_device, physical_device,
queue_family_index, queue_family_index,
); );

View file

@ -27,8 +27,7 @@ impl XcbSurface {
allocation_callbacks: Option<&vk::AllocationCallbacks>, allocation_callbacks: Option<&vk::AllocationCallbacks>,
) -> VkResult<vk::SurfaceKHR> { ) -> VkResult<vk::SurfaceKHR> {
let mut surface = mem::zeroed(); let mut surface = mem::zeroed();
self.fp (self.fp.create_xcb_surface_khr)(
.create_xcb_surface_khr(
self.handle, self.handle,
create_info, create_info,
allocation_callbacks.as_raw_ptr(), allocation_callbacks.as_raw_ptr(),
@ -45,7 +44,7 @@ impl XcbSurface {
connection: &mut vk::xcb_connection_t, connection: &mut vk::xcb_connection_t,
visual_id: vk::xcb_visualid_t, visual_id: vk::xcb_visualid_t,
) -> bool { ) -> bool {
let b = self.fp.get_physical_device_xcb_presentation_support_khr( let b = (self.fp.get_physical_device_xcb_presentation_support_khr)(
physical_device, physical_device,
queue_family_index, queue_family_index,
connection, connection,

View file

@ -27,8 +27,7 @@ impl XlibSurface {
allocation_callbacks: Option<&vk::AllocationCallbacks>, allocation_callbacks: Option<&vk::AllocationCallbacks>,
) -> VkResult<vk::SurfaceKHR> { ) -> VkResult<vk::SurfaceKHR> {
let mut surface = mem::zeroed(); let mut surface = mem::zeroed();
self.fp (self.fp.create_xlib_surface_khr)(
.create_xlib_surface_khr(
self.handle, self.handle,
create_info, create_info,
allocation_callbacks.as_raw_ptr(), allocation_callbacks.as_raw_ptr(),
@ -45,7 +44,7 @@ impl XlibSurface {
display: &mut vk::Display, display: &mut vk::Display,
visual_id: vk::VisualID, visual_id: vk::VisualID,
) -> bool { ) -> bool {
let b = self.fp.get_physical_device_xlib_presentation_support_khr( let b = (self.fp.get_physical_device_xlib_presentation_support_khr)(
physical_device, physical_device,
queue_family_index, queue_family_index,
display, display,

View file

@ -27,8 +27,7 @@ impl IOSSurface {
allocation_callbacks: Option<&vk::AllocationCallbacks>, allocation_callbacks: Option<&vk::AllocationCallbacks>,
) -> VkResult<vk::SurfaceKHR> { ) -> VkResult<vk::SurfaceKHR> {
let mut surface = mem::zeroed(); let mut surface = mem::zeroed();
self.fp (self.fp.create_ios_surface_mvk)(
.create_ios_surface_mvk(
self.handle, self.handle,
create_info, create_info,
allocation_callbacks.as_raw_ptr(), allocation_callbacks.as_raw_ptr(),

View file

@ -27,8 +27,7 @@ impl MacOSSurface {
allocation_callbacks: Option<&vk::AllocationCallbacks>, allocation_callbacks: Option<&vk::AllocationCallbacks>,
) -> VkResult<vk::SurfaceKHR> { ) -> VkResult<vk::SurfaceKHR> {
let mut surface = mem::zeroed(); let mut surface = mem::zeroed();
self.fp (self.fp.create_mac_os_surface_mvk)(
.create_mac_os_surface_mvk(
self.handle, self.handle,
create_info, create_info,
allocation_callbacks.as_raw_ptr(), allocation_callbacks.as_raw_ptr(),

View file

@ -27,8 +27,7 @@ impl ViSurface {
allocation_callbacks: Option<&vk::AllocationCallbacks>, allocation_callbacks: Option<&vk::AllocationCallbacks>,
) -> VkResult<vk::SurfaceKHR> { ) -> VkResult<vk::SurfaceKHR> {
let mut surface = mem::zeroed(); let mut surface = mem::zeroed();
self.fp (self.fp.create_vi_surface_nn)(
.create_vi_surface_nn(
self.handle, self.handle,
create_info, create_info,
allocation_callbacks.as_raw_ptr(), allocation_callbacks.as_raw_ptr(),

View file

@ -23,21 +23,20 @@ impl DeviceDiagnosticCheckpoints {
command_buffer: vk::CommandBuffer, command_buffer: vk::CommandBuffer,
p_checkpoint_marker: *const c_void, p_checkpoint_marker: *const c_void,
) { ) {
self.fp (self.fp.cmd_set_checkpoint_nv)(command_buffer, p_checkpoint_marker);
.cmd_set_checkpoint_nv(command_buffer, p_checkpoint_marker);
} }
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetQueueCheckpointDataNV.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetQueueCheckpointDataNV.html>
pub unsafe fn get_queue_checkpoint_data(&self, queue: vk::Queue) -> Vec<vk::CheckpointDataNV> { pub unsafe fn get_queue_checkpoint_data(&self, queue: vk::Queue) -> Vec<vk::CheckpointDataNV> {
let mut checkpoint_data_count: u32 = 0; let mut checkpoint_data_count: u32 = 0;
self.fp.get_queue_checkpoint_data_nv( (self.fp.get_queue_checkpoint_data_nv)(
queue, queue,
&mut checkpoint_data_count, &mut checkpoint_data_count,
std::ptr::null_mut(), std::ptr::null_mut(),
); );
let mut checkpoint_data: Vec<vk::CheckpointDataNV> = let mut checkpoint_data: Vec<vk::CheckpointDataNV> =
vec![vk::CheckpointDataNV::default(); checkpoint_data_count as _]; vec![vk::CheckpointDataNV::default(); checkpoint_data_count as _];
self.fp.get_queue_checkpoint_data_nv( (self.fp.get_queue_checkpoint_data_nv)(
queue, queue,
&mut checkpoint_data_count, &mut checkpoint_data_count,
checkpoint_data.as_mut_ptr(), checkpoint_data.as_mut_ptr(),

View file

@ -23,8 +23,7 @@ impl MeshShader {
task_count: u32, task_count: u32,
first_task: u32, first_task: u32,
) { ) {
self.fp (self.fp.cmd_draw_mesh_tasks_nv)(command_buffer, task_count, first_task);
.cmd_draw_mesh_tasks_nv(command_buffer, task_count, first_task);
} }
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdDrawMeshTasksIndirectNV.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdDrawMeshTasksIndirectNV.html>
@ -36,8 +35,13 @@ impl MeshShader {
draw_count: u32, draw_count: u32,
stride: u32, stride: u32,
) { ) {
self.fp (self.fp.cmd_draw_mesh_tasks_indirect_nv)(
.cmd_draw_mesh_tasks_indirect_nv(command_buffer, buffer, offset, draw_count, stride); command_buffer,
buffer,
offset,
draw_count,
stride,
);
} }
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdDrawMeshTasksIndirectCountNV.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdDrawMeshTasksIndirectCountNV.html>
@ -51,7 +55,7 @@ impl MeshShader {
max_draw_count: u32, max_draw_count: u32,
stride: u32, stride: u32,
) { ) {
self.fp.cmd_draw_mesh_tasks_indirect_count_nv( (self.fp.cmd_draw_mesh_tasks_indirect_count_nv)(
command_buffer, command_buffer,
buffer, buffer,
offset, offset,

View file

@ -39,8 +39,7 @@ impl RayTracing {
allocation_callbacks: Option<&vk::AllocationCallbacks>, allocation_callbacks: Option<&vk::AllocationCallbacks>,
) -> VkResult<vk::AccelerationStructureNV> { ) -> VkResult<vk::AccelerationStructureNV> {
let mut accel_struct = mem::zeroed(); let mut accel_struct = mem::zeroed();
self.fp (self.fp.create_acceleration_structure_nv)(
.create_acceleration_structure_nv(
self.handle, self.handle,
create_info, create_info,
allocation_callbacks.as_raw_ptr(), allocation_callbacks.as_raw_ptr(),
@ -55,7 +54,7 @@ impl RayTracing {
accel_struct: vk::AccelerationStructureNV, accel_struct: vk::AccelerationStructureNV,
allocation_callbacks: Option<&vk::AllocationCallbacks>, allocation_callbacks: Option<&vk::AllocationCallbacks>,
) { ) {
self.fp.destroy_acceleration_structure_nv( (self.fp.destroy_acceleration_structure_nv)(
self.handle, self.handle,
accel_struct, accel_struct,
allocation_callbacks.as_raw_ptr(), allocation_callbacks.as_raw_ptr(),
@ -68,7 +67,7 @@ impl RayTracing {
info: &vk::AccelerationStructureMemoryRequirementsInfoNV, info: &vk::AccelerationStructureMemoryRequirementsInfoNV,
) -> vk::MemoryRequirements2KHR { ) -> vk::MemoryRequirements2KHR {
let mut requirements = mem::zeroed(); let mut requirements = mem::zeroed();
self.fp.get_acceleration_structure_memory_requirements_nv( (self.fp.get_acceleration_structure_memory_requirements_nv)(
self.handle, self.handle,
info, info,
&mut requirements, &mut requirements,
@ -81,8 +80,7 @@ impl RayTracing {
&self, &self,
bind_info: &[vk::BindAccelerationStructureMemoryInfoNV], bind_info: &[vk::BindAccelerationStructureMemoryInfoNV],
) -> VkResult<()> { ) -> VkResult<()> {
self.fp (self.fp.bind_acceleration_structure_memory_nv)(
.bind_acceleration_structure_memory_nv(
self.handle, self.handle,
bind_info.len() as u32, bind_info.len() as u32,
bind_info.as_ptr(), bind_info.as_ptr(),
@ -103,7 +101,7 @@ impl RayTracing {
scratch: vk::Buffer, scratch: vk::Buffer,
scratch_offset: vk::DeviceSize, scratch_offset: vk::DeviceSize,
) { ) {
self.fp.cmd_build_acceleration_structure_nv( (self.fp.cmd_build_acceleration_structure_nv)(
command_buffer, command_buffer,
info, info,
instance_data, instance_data,
@ -124,8 +122,7 @@ impl RayTracing {
src: vk::AccelerationStructureNV, src: vk::AccelerationStructureNV,
mode: vk::CopyAccelerationStructureModeNV, mode: vk::CopyAccelerationStructureModeNV,
) { ) {
self.fp (self.fp.cmd_copy_acceleration_structure_nv)(command_buffer, dst, src, mode);
.cmd_copy_acceleration_structure_nv(command_buffer, dst, src, mode);
} }
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdTraceRaysNV.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdTraceRaysNV.html>
@ -147,7 +144,7 @@ impl RayTracing {
height: u32, height: u32,
depth: u32, depth: u32,
) { ) {
self.fp.cmd_trace_rays_nv( (self.fp.cmd_trace_rays_nv)(
command_buffer, command_buffer,
raygen_shader_binding_table_buffer, raygen_shader_binding_table_buffer,
raygen_shader_binding_offset, raygen_shader_binding_offset,
@ -174,8 +171,7 @@ impl RayTracing {
allocation_callbacks: Option<&vk::AllocationCallbacks>, allocation_callbacks: Option<&vk::AllocationCallbacks>,
) -> VkResult<Vec<vk::Pipeline>> { ) -> VkResult<Vec<vk::Pipeline>> {
let mut pipelines = vec![mem::zeroed(); create_info.len()]; let mut pipelines = vec![mem::zeroed(); create_info.len()];
self.fp (self.fp.create_ray_tracing_pipelines_nv)(
.create_ray_tracing_pipelines_nv(
self.handle, self.handle,
pipeline_cache, pipeline_cache,
create_info.len() as u32, create_info.len() as u32,
@ -194,8 +190,7 @@ impl RayTracing {
group_count: u32, group_count: u32,
data: &mut [u8], data: &mut [u8],
) -> VkResult<()> { ) -> VkResult<()> {
self.fp (self.fp.get_ray_tracing_shader_group_handles_nv)(
.get_ray_tracing_shader_group_handles_nv(
self.handle, self.handle,
pipeline, pipeline,
first_group, first_group,
@ -213,8 +208,7 @@ impl RayTracing {
) -> VkResult<u64> { ) -> VkResult<u64> {
let mut handle: u64 = 0; let mut handle: u64 = 0;
let handle_ptr: *mut u64 = &mut handle; let handle_ptr: *mut u64 = &mut handle;
self.fp (self.fp.get_acceleration_structure_handle_nv)(
.get_acceleration_structure_handle_nv(
self.handle, self.handle,
accel_struct, accel_struct,
std::mem::size_of::<u64>(), std::mem::size_of::<u64>(),
@ -232,7 +226,7 @@ impl RayTracing {
query_pool: vk::QueryPool, query_pool: vk::QueryPool,
first_query: u32, first_query: u32,
) { ) {
self.fp.cmd_write_acceleration_structures_properties_nv( (self.fp.cmd_write_acceleration_structures_properties_nv)(
command_buffer, command_buffer,
structures.len() as u32, structures.len() as u32,
structures.as_ptr(), structures.as_ptr(),
@ -244,9 +238,7 @@ impl RayTracing {
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCompileDeferredNV.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCompileDeferredNV.html>
pub unsafe fn compile_deferred(&self, pipeline: vk::Pipeline, shader: u32) -> VkResult<()> { pub unsafe fn compile_deferred(&self, pipeline: vk::Pipeline, shader: u32) -> VkResult<()> {
self.fp (self.fp.compile_deferred_nv)(self.handle, pipeline, shader).result()
.compile_deferred_nv(self.handle, pipeline, shader)
.result()
} }
pub const fn name() -> &'static CStr { pub const fn name() -> &'static CStr {

View file

@ -20,7 +20,7 @@ pub struct Instance {
impl Instance { impl Instance {
pub unsafe fn load(static_fn: &vk::StaticFn, instance: vk::Instance) -> Self { pub unsafe fn load(static_fn: &vk::StaticFn, instance: vk::Instance) -> Self {
let load_fn = |name: &std::ffi::CStr| { let load_fn = |name: &std::ffi::CStr| {
mem::transmute(static_fn.get_instance_proc_addr(instance, name.as_ptr())) mem::transmute((static_fn.get_instance_proc_addr)(instance, name.as_ptr()))
}; };
Self { Self {
@ -51,8 +51,11 @@ impl Instance {
physical_device: vk::PhysicalDevice, physical_device: vk::PhysicalDevice,
) -> VkResult<usize> { ) -> VkResult<usize> {
let mut count = 0; let mut count = 0;
self.instance_fn_1_3 (self.instance_fn_1_3.get_physical_device_tool_properties)(
.get_physical_device_tool_properties(physical_device, &mut count, ptr::null_mut()) physical_device,
&mut count,
ptr::null_mut(),
)
.result_with_success(count as usize) .result_with_success(count as usize)
} }
@ -66,8 +69,11 @@ impl Instance {
out: &mut [vk::PhysicalDeviceToolProperties], out: &mut [vk::PhysicalDeviceToolProperties],
) -> VkResult<()> { ) -> VkResult<()> {
let mut count = out.len() as u32; let mut count = out.len() as u32;
self.instance_fn_1_3 (self.instance_fn_1_3.get_physical_device_tool_properties)(
.get_physical_device_tool_properties(physical_device, &mut count, out.as_mut_ptr()) physical_device,
&mut count,
out.as_mut_ptr(),
)
.result()?; .result()?;
assert_eq!(count as usize, out.len()); assert_eq!(count as usize, out.len());
Ok(()) Ok(())
@ -92,8 +98,11 @@ impl Instance {
/// Retrieve the number of elements to pass to [`enumerate_physical_device_groups()`][Self::enumerate_physical_device_groups()] /// Retrieve the number of elements to pass to [`enumerate_physical_device_groups()`][Self::enumerate_physical_device_groups()]
pub unsafe fn enumerate_physical_device_groups_len(&self) -> VkResult<usize> { pub unsafe fn enumerate_physical_device_groups_len(&self) -> VkResult<usize> {
let mut group_count = 0; let mut group_count = 0;
self.instance_fn_1_1 (self.instance_fn_1_1.enumerate_physical_device_groups)(
.enumerate_physical_device_groups(self.handle(), &mut group_count, ptr::null_mut()) self.handle(),
&mut group_count,
ptr::null_mut(),
)
.result_with_success(group_count as usize) .result_with_success(group_count as usize)
} }
@ -106,8 +115,11 @@ impl Instance {
out: &mut [vk::PhysicalDeviceGroupProperties], out: &mut [vk::PhysicalDeviceGroupProperties],
) -> VkResult<()> { ) -> VkResult<()> {
let mut count = out.len() as u32; let mut count = out.len() as u32;
self.instance_fn_1_1 (self.instance_fn_1_1.enumerate_physical_device_groups)(
.enumerate_physical_device_groups(self.handle(), &mut count, out.as_mut_ptr()) self.handle(),
&mut count,
out.as_mut_ptr(),
)
.result()?; .result()?;
assert_eq!(count as usize, out.len()); assert_eq!(count as usize, out.len());
Ok(()) Ok(())
@ -119,8 +131,7 @@ impl Instance {
physical_device: vk::PhysicalDevice, physical_device: vk::PhysicalDevice,
features: &mut vk::PhysicalDeviceFeatures2, features: &mut vk::PhysicalDeviceFeatures2,
) { ) {
self.instance_fn_1_1 (self.instance_fn_1_1.get_physical_device_features2)(physical_device, features);
.get_physical_device_features2(physical_device, features);
} }
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceProperties2.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceProperties2.html>
@ -129,8 +140,7 @@ impl Instance {
physical_device: vk::PhysicalDevice, physical_device: vk::PhysicalDevice,
prop: &mut vk::PhysicalDeviceProperties2, prop: &mut vk::PhysicalDeviceProperties2,
) { ) {
self.instance_fn_1_1 (self.instance_fn_1_1.get_physical_device_properties2)(physical_device, prop);
.get_physical_device_properties2(physical_device, prop);
} }
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceFormatProperties2.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceFormatProperties2.html>
@ -140,8 +150,7 @@ impl Instance {
format: vk::Format, format: vk::Format,
out: &mut vk::FormatProperties2, out: &mut vk::FormatProperties2,
) { ) {
self.instance_fn_1_1 (self.instance_fn_1_1.get_physical_device_format_properties2)(physical_device, format, out);
.get_physical_device_format_properties2(physical_device, format, out);
} }
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceImageFormatProperties2.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceImageFormatProperties2.html>
@ -151,8 +160,9 @@ impl Instance {
format_info: &vk::PhysicalDeviceImageFormatInfo2, format_info: &vk::PhysicalDeviceImageFormatInfo2,
image_format_prop: &mut vk::ImageFormatProperties2, image_format_prop: &mut vk::ImageFormatProperties2,
) -> VkResult<()> { ) -> VkResult<()> {
self.instance_fn_1_1 (self
.get_physical_device_image_format_properties2( .instance_fn_1_1
.get_physical_device_image_format_properties2)(
physical_device, physical_device,
format_info, format_info,
image_format_prop, image_format_prop,
@ -166,8 +176,9 @@ impl Instance {
physical_device: vk::PhysicalDevice, physical_device: vk::PhysicalDevice,
) -> usize { ) -> usize {
let mut queue_count = 0; let mut queue_count = 0;
self.instance_fn_1_1 (self
.get_physical_device_queue_family_properties2( .instance_fn_1_1
.get_physical_device_queue_family_properties2)(
physical_device, physical_device,
&mut queue_count, &mut queue_count,
ptr::null_mut(), ptr::null_mut(),
@ -185,8 +196,9 @@ impl Instance {
out: &mut [vk::QueueFamilyProperties2], out: &mut [vk::QueueFamilyProperties2],
) { ) {
let mut count = out.len() as u32; let mut count = out.len() as u32;
self.instance_fn_1_1 (self
.get_physical_device_queue_family_properties2( .instance_fn_1_1
.get_physical_device_queue_family_properties2)(
physical_device, physical_device,
&mut count, &mut count,
out.as_mut_ptr(), out.as_mut_ptr(),
@ -200,8 +212,7 @@ impl Instance {
physical_device: vk::PhysicalDevice, physical_device: vk::PhysicalDevice,
out: &mut vk::PhysicalDeviceMemoryProperties2, out: &mut vk::PhysicalDeviceMemoryProperties2,
) { ) {
self.instance_fn_1_1 (self.instance_fn_1_1.get_physical_device_memory_properties2)(physical_device, out);
.get_physical_device_memory_properties2(physical_device, out);
} }
/// Retrieve the number of elements to pass to [`get_physical_device_sparse_image_format_properties2()`][Self::get_physical_device_sparse_image_format_properties2()] /// Retrieve the number of elements to pass to [`get_physical_device_sparse_image_format_properties2()`][Self::get_physical_device_sparse_image_format_properties2()]
@ -211,8 +222,9 @@ impl Instance {
format_info: &vk::PhysicalDeviceSparseImageFormatInfo2, format_info: &vk::PhysicalDeviceSparseImageFormatInfo2,
) -> usize { ) -> usize {
let mut format_count = 0; let mut format_count = 0;
self.instance_fn_1_1 (self
.get_physical_device_sparse_image_format_properties2( .instance_fn_1_1
.get_physical_device_sparse_image_format_properties2)(
physical_device, physical_device,
format_info, format_info,
&mut format_count, &mut format_count,
@ -232,8 +244,9 @@ impl Instance {
out: &mut [vk::SparseImageFormatProperties2], out: &mut [vk::SparseImageFormatProperties2],
) { ) {
let mut count = out.len() as u32; let mut count = out.len() as u32;
self.instance_fn_1_1 (self
.get_physical_device_sparse_image_format_properties2( .instance_fn_1_1
.get_physical_device_sparse_image_format_properties2)(
physical_device, physical_device,
format_info, format_info,
&mut count, &mut count,
@ -249,8 +262,9 @@ impl Instance {
external_buffer_info: &vk::PhysicalDeviceExternalBufferInfo, external_buffer_info: &vk::PhysicalDeviceExternalBufferInfo,
out: &mut vk::ExternalBufferProperties, out: &mut vk::ExternalBufferProperties,
) { ) {
self.instance_fn_1_1 (self
.get_physical_device_external_buffer_properties( .instance_fn_1_1
.get_physical_device_external_buffer_properties)(
physical_device, physical_device,
external_buffer_info, external_buffer_info,
out, out,
@ -264,8 +278,9 @@ impl Instance {
external_fence_info: &vk::PhysicalDeviceExternalFenceInfo, external_fence_info: &vk::PhysicalDeviceExternalFenceInfo,
out: &mut vk::ExternalFenceProperties, out: &mut vk::ExternalFenceProperties,
) { ) {
self.instance_fn_1_1 (self
.get_physical_device_external_fence_properties( .instance_fn_1_1
.get_physical_device_external_fence_properties)(
physical_device, physical_device,
external_fence_info, external_fence_info,
out, out,
@ -279,8 +294,9 @@ impl Instance {
external_semaphore_info: &vk::PhysicalDeviceExternalSemaphoreInfo, external_semaphore_info: &vk::PhysicalDeviceExternalSemaphoreInfo,
out: &mut vk::ExternalSemaphoreProperties, out: &mut vk::ExternalSemaphoreProperties,
) { ) {
self.instance_fn_1_1 (self
.get_physical_device_external_semaphore_properties( .instance_fn_1_1
.get_physical_device_external_semaphore_properties)(
physical_device, physical_device,
external_semaphore_info, external_semaphore_info,
out, out,
@ -308,8 +324,7 @@ impl Instance {
allocation_callbacks: Option<&vk::AllocationCallbacks>, allocation_callbacks: Option<&vk::AllocationCallbacks>,
) -> VkResult<Device> { ) -> VkResult<Device> {
let mut device = mem::zeroed(); let mut device = mem::zeroed();
self.instance_fn_1_0 (self.instance_fn_1_0.create_device)(
.create_device(
physical_device, physical_device,
create_info, create_info,
allocation_callbacks.as_raw_ptr(), allocation_callbacks.as_raw_ptr(),
@ -325,13 +340,12 @@ impl Instance {
device: vk::Device, device: vk::Device,
p_name: *const c_char, p_name: *const c_char,
) -> vk::PFN_vkVoidFunction { ) -> vk::PFN_vkVoidFunction {
self.instance_fn_1_0.get_device_proc_addr(device, p_name) (self.instance_fn_1_0.get_device_proc_addr)(device, p_name)
} }
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkDestroyInstance.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkDestroyInstance.html>
pub unsafe fn destroy_instance(&self, allocation_callbacks: Option<&vk::AllocationCallbacks>) { pub unsafe fn destroy_instance(&self, allocation_callbacks: Option<&vk::AllocationCallbacks>) {
self.instance_fn_1_0 (self.instance_fn_1_0.destroy_instance)(self.handle(), allocation_callbacks.as_raw_ptr());
.destroy_instance(self.handle(), allocation_callbacks.as_raw_ptr());
} }
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceFormatProperties.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetPhysicalDeviceFormatProperties.html>
@ -341,7 +355,7 @@ impl Instance {
format: vk::Format, format: vk::Format,
) -> vk::FormatProperties { ) -> vk::FormatProperties {
let mut format_prop = mem::zeroed(); let mut format_prop = mem::zeroed();
self.instance_fn_1_0.get_physical_device_format_properties( (self.instance_fn_1_0.get_physical_device_format_properties)(
physical_device, physical_device,
format, format,
&mut format_prop, &mut format_prop,
@ -360,8 +374,9 @@ impl Instance {
flags: vk::ImageCreateFlags, flags: vk::ImageCreateFlags,
) -> VkResult<vk::ImageFormatProperties> { ) -> VkResult<vk::ImageFormatProperties> {
let mut image_format_prop = mem::zeroed(); let mut image_format_prop = mem::zeroed();
self.instance_fn_1_0 (self
.get_physical_device_image_format_properties( .instance_fn_1_0
.get_physical_device_image_format_properties)(
physical_device, physical_device,
format, format,
typ, typ,
@ -379,8 +394,10 @@ impl Instance {
physical_device: vk::PhysicalDevice, physical_device: vk::PhysicalDevice,
) -> vk::PhysicalDeviceMemoryProperties { ) -> vk::PhysicalDeviceMemoryProperties {
let mut memory_prop = mem::zeroed(); let mut memory_prop = mem::zeroed();
self.instance_fn_1_0 (self.instance_fn_1_0.get_physical_device_memory_properties)(
.get_physical_device_memory_properties(physical_device, &mut memory_prop); physical_device,
&mut memory_prop,
);
memory_prop memory_prop
} }
@ -390,8 +407,7 @@ impl Instance {
physical_device: vk::PhysicalDevice, physical_device: vk::PhysicalDevice,
) -> vk::PhysicalDeviceProperties { ) -> vk::PhysicalDeviceProperties {
let mut prop = mem::zeroed(); let mut prop = mem::zeroed();
self.instance_fn_1_0 (self.instance_fn_1_0.get_physical_device_properties)(physical_device, &mut prop);
.get_physical_device_properties(physical_device, &mut prop);
prop prop
} }
@ -401,8 +417,11 @@ impl Instance {
physical_device: vk::PhysicalDevice, physical_device: vk::PhysicalDevice,
) -> Vec<vk::QueueFamilyProperties> { ) -> Vec<vk::QueueFamilyProperties> {
read_into_uninitialized_vector(|count, data| { read_into_uninitialized_vector(|count, data| {
self.instance_fn_1_0 (self
.get_physical_device_queue_family_properties(physical_device, count, data); .instance_fn_1_0
.get_physical_device_queue_family_properties)(
physical_device, count, data
);
vk::Result::SUCCESS vk::Result::SUCCESS
}) })
// The closure always returns SUCCESS // The closure always returns SUCCESS
@ -415,16 +434,14 @@ impl Instance {
physical_device: vk::PhysicalDevice, physical_device: vk::PhysicalDevice,
) -> vk::PhysicalDeviceFeatures { ) -> vk::PhysicalDeviceFeatures {
let mut prop = mem::zeroed(); let mut prop = mem::zeroed();
self.instance_fn_1_0 (self.instance_fn_1_0.get_physical_device_features)(physical_device, &mut prop);
.get_physical_device_features(physical_device, &mut prop);
prop prop
} }
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkEnumeratePhysicalDevices.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkEnumeratePhysicalDevices.html>
pub unsafe fn enumerate_physical_devices(&self) -> VkResult<Vec<vk::PhysicalDevice>> { pub unsafe fn enumerate_physical_devices(&self) -> VkResult<Vec<vk::PhysicalDevice>> {
read_into_uninitialized_vector(|count, data| { read_into_uninitialized_vector(|count, data| {
self.instance_fn_1_0 (self.instance_fn_1_0.enumerate_physical_devices)(self.handle(), count, data)
.enumerate_physical_devices(self.handle(), count, data)
}) })
} }
@ -434,7 +451,7 @@ impl Instance {
device: vk::PhysicalDevice, device: vk::PhysicalDevice,
) -> VkResult<Vec<vk::ExtensionProperties>> { ) -> VkResult<Vec<vk::ExtensionProperties>> {
read_into_uninitialized_vector(|count, data| { read_into_uninitialized_vector(|count, data| {
self.instance_fn_1_0.enumerate_device_extension_properties( (self.instance_fn_1_0.enumerate_device_extension_properties)(
device, device,
ptr::null(), ptr::null(),
count, count,
@ -449,8 +466,7 @@ impl Instance {
device: vk::PhysicalDevice, device: vk::PhysicalDevice,
) -> VkResult<Vec<vk::LayerProperties>> { ) -> VkResult<Vec<vk::LayerProperties>> {
read_into_uninitialized_vector(|count, data| { read_into_uninitialized_vector(|count, data| {
self.instance_fn_1_0 (self.instance_fn_1_0.enumerate_device_layer_properties)(device, count, data)
.enumerate_device_layer_properties(device, count, data)
}) })
} }
@ -465,8 +481,9 @@ impl Instance {
tiling: vk::ImageTiling, tiling: vk::ImageTiling,
) -> Vec<vk::SparseImageFormatProperties> { ) -> Vec<vk::SparseImageFormatProperties> {
read_into_uninitialized_vector(|count, data| { read_into_uninitialized_vector(|count, data| {
self.instance_fn_1_0 (self
.get_physical_device_sparse_image_format_properties( .instance_fn_1_0
.get_physical_device_sparse_image_format_properties)(
physical_device, physical_device,
format, format,
typ, typ,

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -725,7 +725,6 @@ fn generate_function_pointers<'a>(
type_name: Ident, type_name: Ident,
function_name_c: String, function_name_c: String,
function_name_rust: Ident, function_name_rust: Ident,
parameter_names: TokenStream,
parameters: TokenStream, parameters: TokenStream,
parameters_unused: TokenStream, parameters_unused: TokenStream,
returns: TokenStream, returns: TokenStream,
@ -760,9 +759,6 @@ fn generate_function_pointers<'a>(
}) })
.collect(); .collect();
let params_iter = params.iter().map(|(param_name, _)| param_name);
let parameter_names = quote!(#(#params_iter,)*);
let params_iter = params let params_iter = params
.iter() .iter()
.map(|(param_name, param_ty)| quote!(#param_name: #param_ty)); .map(|(param_name, param_ty)| quote!(#param_name: #param_ty));
@ -781,7 +777,6 @@ fn generate_function_pointers<'a>(
type_name, type_name,
function_name_c, function_name_c,
function_name_rust, function_name_rust,
parameter_names,
parameters, parameters,
parameters_unused, parameters_unused,
returns: if cmd.return_type.is_void() { returns: if cmd.return_type.is_void() {
@ -852,31 +847,12 @@ fn generate_function_pointers<'a>(
} }
} }
struct CommandToBody<'a>(&'a Command);
impl<'a> quote::ToTokens for CommandToBody<'a> {
fn to_tokens(&self, tokens: &mut TokenStream) {
let function_name_rust = &self.0.function_name_rust;
let parameters = &self.0.parameters;
let parameter_names = &self.0.parameter_names;
let returns = &self.0.returns;
let khronos_link = khronos_link(&self.0.function_name_c);
quote!(
#[doc = #khronos_link]
pub unsafe fn #function_name_rust(&self, #parameters) #returns {
(self.#function_name_rust)(#parameter_names)
}
)
.to_tokens(tokens)
}
}
let pfn_typedefs = commands let pfn_typedefs = commands
.iter() .iter()
.filter(|pfn| pfn.type_needs_defining) .filter(|pfn| pfn.type_needs_defining)
.map(CommandToType); .map(CommandToType);
let members = commands.iter().map(CommandToMember); let members = commands.iter().map(CommandToMember);
let loaders = commands.iter().map(CommandToLoader); let loaders = commands.iter().map(CommandToLoader);
let bodies = commands.iter().map(CommandToBody);
quote! { quote! {
#(#pfn_typedefs)* #(#pfn_typedefs)*
@ -897,7 +873,6 @@ fn generate_function_pointers<'a>(
#(#loaders,)* #(#loaders,)*
} }
} }
#(#bodies)*
} }
} }
} }