Resolve lint warnings for deprecated_in_future, rust_2018_idioms and unused_qualifications (#803)

* generator: Add many missing lifetime parameters

* Globally find-replace common patterns that need a `<'_>` lifetime annotation

    perl -pi -E "s/(&(mut )?\[?vk::(?\!\w+(V1_\d|Fn|<))\w+)/\$1<'_>/" **/*.{rs,md}

* generator: Include aliased types in `has_lifetime` lookup table

* Manually revert wrong find-replace lifetimes

* Resolve lint warnings for `deprecated_in_future`, `rust_2018_idioms` and `unused_qualifications`

These are 3 non-default lints that cause a lot of violations in this
project that are sensible to resolve, and reduce noise when
test-including a local `ash` checkout in other projects that have
stricter lint setups.
This commit is contained in:
Marijn Suijten 2023-10-26 08:30:16 +02:00 committed by GitHub
parent 2d2aeac84a
commit ff54d22a15
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
81 changed files with 1956 additions and 1828 deletions

View file

@ -33,8 +33,8 @@ The Vulkan Video bindings are experimental and still seeing breaking changes in
```rust
// function signature
pub fn create_instance(&self,
create_info: &vk::InstanceCreateInfo,
allocation_callbacks: Option<&vk::AllocationCallbacks>)
create_info: &vk::InstanceCreateInfo<'_>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>)
-> Result<Instance, InstanceError> { .. }
let instance = entry.create_instance(&create_info, None)
.expect("Instance creation error");
@ -59,9 +59,9 @@ pub fn cmd_pipeline_barrier(&self,
src_stage_mask: vk::PipelineStageFlags,
dst_stage_mask: vk::PipelineStageFlags,
dependency_flags: vk::DependencyFlags,
memory_barriers: &[vk::MemoryBarrier],
buffer_memory_barriers: &[vk::BufferMemoryBarrier],
image_memory_barriers: &[vk::ImageMemoryBarrier]);
memory_barriers: &[vk::MemoryBarrier<'_>],
buffer_memory_barriers: &[vk::BufferMemoryBarrier<'_>],
image_memory_barriers: &[vk::ImageMemoryBarrier<'_>]);
```
### Strongly typed handles
@ -181,7 +181,7 @@ Handles from Instance or Device are passed implicitly.
```rust
pub fn create_command_pool(&self,
create_info: &vk::CommandPoolCreateInfo)
create_info: &vk::CommandPoolCreateInfo<'_>)
-> VkResult<vk::CommandPool>;
let pool = device.create_command_pool(&pool_create_info).unwrap();

View file

@ -37,7 +37,7 @@ pub unsafe fn create_surface(
instance: &Instance,
display_handle: RawDisplayHandle,
window_handle: RawWindowHandle,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<vk::SurfaceKHR> {
match (display_handle, window_handle) {
(RawDisplayHandle::Windows(_), RawWindowHandle::Win32(window)) => {

View file

@ -67,8 +67,8 @@ impl Device {
#[inline]
pub unsafe fn create_private_data_slot(
&self,
create_info: &vk::PrivateDataSlotCreateInfo,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
create_info: &vk::PrivateDataSlotCreateInfo<'_>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<vk::PrivateDataSlot> {
let mut private_data_slot = mem::zeroed();
(self.device_fn_1_3.create_private_data_slot)(
@ -85,7 +85,7 @@ impl Device {
pub unsafe fn destroy_private_data_slot(
&self,
private_data_slot: vk::PrivateDataSlot,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) {
(self.device_fn_1_3.destroy_private_data_slot)(
self.handle,
@ -135,7 +135,7 @@ impl Device {
pub unsafe fn cmd_pipeline_barrier2(
&self,
command_buffer: vk::CommandBuffer,
dependency_info: &vk::DependencyInfo,
dependency_info: &vk::DependencyInfo<'_>,
) {
(self.device_fn_1_3.cmd_pipeline_barrier2)(command_buffer, dependency_info)
}
@ -157,7 +157,7 @@ impl Device {
&self,
command_buffer: vk::CommandBuffer,
event: vk::Event,
dependency_info: &vk::DependencyInfo,
dependency_info: &vk::DependencyInfo<'_>,
) {
(self.device_fn_1_3.cmd_set_event2)(command_buffer, event, dependency_info)
}
@ -168,7 +168,7 @@ impl Device {
&self,
command_buffer: vk::CommandBuffer,
events: &[vk::Event],
dependency_infos: &[vk::DependencyInfo],
dependency_infos: &[vk::DependencyInfo<'_>],
) {
assert_eq!(events.len(), dependency_infos.len());
(self.device_fn_1_3.cmd_wait_events2)(
@ -196,7 +196,7 @@ impl Device {
pub unsafe fn queue_submit2(
&self,
queue: vk::Queue,
submits: &[vk::SubmitInfo2],
submits: &[vk::SubmitInfo2<'_>],
fence: vk::Fence,
) -> VkResult<()> {
(self.device_fn_1_3.queue_submit2)(queue, submits.len() as u32, submits.as_ptr(), fence)
@ -208,7 +208,7 @@ impl Device {
pub unsafe fn cmd_copy_buffer2(
&self,
command_buffer: vk::CommandBuffer,
copy_buffer_info: &vk::CopyBufferInfo2,
copy_buffer_info: &vk::CopyBufferInfo2<'_>,
) {
(self.device_fn_1_3.cmd_copy_buffer2)(command_buffer, copy_buffer_info)
}
@ -217,7 +217,7 @@ impl Device {
pub unsafe fn cmd_copy_image2(
&self,
command_buffer: vk::CommandBuffer,
copy_image_info: &vk::CopyImageInfo2,
copy_image_info: &vk::CopyImageInfo2<'_>,
) {
(self.device_fn_1_3.cmd_copy_image2)(command_buffer, copy_image_info)
}
@ -226,7 +226,7 @@ impl Device {
pub unsafe fn cmd_copy_buffer_to_image2(
&self,
command_buffer: vk::CommandBuffer,
copy_buffer_to_image_info: &vk::CopyBufferToImageInfo2,
copy_buffer_to_image_info: &vk::CopyBufferToImageInfo2<'_>,
) {
(self.device_fn_1_3.cmd_copy_buffer_to_image2)(command_buffer, copy_buffer_to_image_info)
}
@ -235,7 +235,7 @@ impl Device {
pub unsafe fn cmd_copy_image_to_buffer2(
&self,
command_buffer: vk::CommandBuffer,
copy_image_to_buffer_info: &vk::CopyImageToBufferInfo2,
copy_image_to_buffer_info: &vk::CopyImageToBufferInfo2<'_>,
) {
(self.device_fn_1_3.cmd_copy_image_to_buffer2)(command_buffer, copy_image_to_buffer_info)
}
@ -244,7 +244,7 @@ impl Device {
pub unsafe fn cmd_blit_image2(
&self,
command_buffer: vk::CommandBuffer,
blit_image_info: &vk::BlitImageInfo2,
blit_image_info: &vk::BlitImageInfo2<'_>,
) {
(self.device_fn_1_3.cmd_blit_image2)(command_buffer, blit_image_info)
}
@ -253,7 +253,7 @@ impl Device {
pub unsafe fn cmd_resolve_image2(
&self,
command_buffer: vk::CommandBuffer,
resolve_image_info: &vk::ResolveImageInfo2,
resolve_image_info: &vk::ResolveImageInfo2<'_>,
) {
(self.device_fn_1_3.cmd_resolve_image2)(command_buffer, resolve_image_info)
}
@ -263,7 +263,7 @@ impl Device {
pub unsafe fn cmd_begin_rendering(
&self,
command_buffer: vk::CommandBuffer,
rendering_info: &vk::RenderingInfo,
rendering_info: &vk::RenderingInfo<'_>,
) {
(self.device_fn_1_3.cmd_begin_rendering)(command_buffer, rendering_info)
}
@ -481,8 +481,8 @@ impl Device {
#[inline]
pub unsafe fn get_device_buffer_memory_requirements(
&self,
memory_requirements: &vk::DeviceBufferMemoryRequirements,
out: &mut vk::MemoryRequirements2,
memory_requirements: &vk::DeviceBufferMemoryRequirements<'_>,
out: &mut vk::MemoryRequirements2<'_>,
) {
(self.device_fn_1_3.get_device_buffer_memory_requirements)(
self.handle,
@ -495,8 +495,8 @@ impl Device {
#[inline]
pub unsafe fn get_device_image_memory_requirements(
&self,
memory_requirements: &vk::DeviceImageMemoryRequirements,
out: &mut vk::MemoryRequirements2,
memory_requirements: &vk::DeviceImageMemoryRequirements<'_>,
out: &mut vk::MemoryRequirements2<'_>,
) {
(self.device_fn_1_3.get_device_image_memory_requirements)(
self.handle,
@ -509,7 +509,7 @@ impl Device {
#[inline]
pub unsafe fn get_device_image_sparse_memory_requirements_len(
&self,
memory_requirements: &vk::DeviceImageMemoryRequirements,
memory_requirements: &vk::DeviceImageMemoryRequirements<'_>,
) -> usize {
let mut count = 0;
(self
@ -530,8 +530,8 @@ impl Device {
#[inline]
pub unsafe fn get_device_image_sparse_memory_requirements(
&self,
memory_requirements: &vk::DeviceImageMemoryRequirements,
out: &mut [vk::SparseImageMemoryRequirements2],
memory_requirements: &vk::DeviceImageMemoryRequirements<'_>,
out: &mut [vk::SparseImageMemoryRequirements2<'_>],
) {
let mut count = out.len() as u32;
(self
@ -603,8 +603,8 @@ impl Device {
#[inline]
pub unsafe fn create_render_pass2(
&self,
create_info: &vk::RenderPassCreateInfo2,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
create_info: &vk::RenderPassCreateInfo2<'_>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<vk::RenderPass> {
let mut renderpass = mem::zeroed();
(self.device_fn_1_2.create_render_pass2)(
@ -621,8 +621,8 @@ impl Device {
pub unsafe fn cmd_begin_render_pass2(
&self,
command_buffer: vk::CommandBuffer,
render_pass_begin_info: &vk::RenderPassBeginInfo,
subpass_begin_info: &vk::SubpassBeginInfo,
render_pass_begin_info: &vk::RenderPassBeginInfo<'_>,
subpass_begin_info: &vk::SubpassBeginInfo<'_>,
) {
(self.device_fn_1_2.cmd_begin_render_pass2)(
command_buffer,
@ -636,8 +636,8 @@ impl Device {
pub unsafe fn cmd_next_subpass2(
&self,
command_buffer: vk::CommandBuffer,
subpass_begin_info: &vk::SubpassBeginInfo,
subpass_end_info: &vk::SubpassEndInfo,
subpass_begin_info: &vk::SubpassBeginInfo<'_>,
subpass_end_info: &vk::SubpassEndInfo<'_>,
) {
(self.device_fn_1_2.cmd_next_subpass2)(
command_buffer,
@ -651,7 +651,7 @@ impl Device {
pub unsafe fn cmd_end_render_pass2(
&self,
command_buffer: vk::CommandBuffer,
subpass_end_info: &vk::SubpassEndInfo,
subpass_end_info: &vk::SubpassEndInfo<'_>,
) {
(self.device_fn_1_2.cmd_end_render_pass2)(command_buffer, subpass_end_info);
}
@ -679,7 +679,7 @@ impl Device {
#[inline]
pub unsafe fn wait_semaphores(
&self,
wait_info: &vk::SemaphoreWaitInfo,
wait_info: &vk::SemaphoreWaitInfo<'_>,
timeout: u64,
) -> VkResult<()> {
(self.device_fn_1_2.wait_semaphores)(self.handle(), wait_info, timeout).result()
@ -687,7 +687,10 @@ impl Device {
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkSignalSemaphore.html>
#[inline]
pub unsafe fn signal_semaphore(&self, signal_info: &vk::SemaphoreSignalInfo) -> VkResult<()> {
pub unsafe fn signal_semaphore(
&self,
signal_info: &vk::SemaphoreSignalInfo<'_>,
) -> VkResult<()> {
(self.device_fn_1_2.signal_semaphore)(self.handle(), signal_info).result()
}
@ -695,7 +698,7 @@ impl Device {
#[inline]
pub unsafe fn get_buffer_device_address(
&self,
info: &vk::BufferDeviceAddressInfo,
info: &vk::BufferDeviceAddressInfo<'_>,
) -> vk::DeviceAddress {
(self.device_fn_1_2.get_buffer_device_address)(self.handle(), info)
}
@ -704,7 +707,7 @@ impl Device {
#[inline]
pub unsafe fn get_buffer_opaque_capture_address(
&self,
info: &vk::BufferDeviceAddressInfo,
info: &vk::BufferDeviceAddressInfo<'_>,
) -> u64 {
(self.device_fn_1_2.get_buffer_opaque_capture_address)(self.handle(), info)
}
@ -713,7 +716,7 @@ impl Device {
#[inline]
pub unsafe fn get_device_memory_opaque_capture_address(
&self,
info: &vk::DeviceMemoryOpaqueCaptureAddressInfo,
info: &vk::DeviceMemoryOpaqueCaptureAddressInfo<'_>,
) -> u64 {
(self.device_fn_1_2.get_device_memory_opaque_capture_address)(self.handle(), info)
}
@ -730,7 +733,7 @@ impl Device {
#[inline]
pub unsafe fn bind_buffer_memory2(
&self,
bind_infos: &[vk::BindBufferMemoryInfo],
bind_infos: &[vk::BindBufferMemoryInfo<'_>],
) -> VkResult<()> {
(self.device_fn_1_1.bind_buffer_memory2)(
self.handle(),
@ -744,7 +747,7 @@ impl Device {
#[inline]
pub unsafe fn bind_image_memory2(
&self,
bind_infos: &[vk::BindImageMemoryInfo],
bind_infos: &[vk::BindImageMemoryInfo<'_>],
) -> VkResult<()> {
(self.device_fn_1_1.bind_image_memory2)(
self.handle(),
@ -806,8 +809,8 @@ impl Device {
#[inline]
pub unsafe fn get_image_memory_requirements2(
&self,
info: &vk::ImageMemoryRequirementsInfo2,
out: &mut vk::MemoryRequirements2,
info: &vk::ImageMemoryRequirementsInfo2<'_>,
out: &mut vk::MemoryRequirements2<'_>,
) {
(self.device_fn_1_1.get_image_memory_requirements2)(self.handle(), info, out);
}
@ -816,8 +819,8 @@ impl Device {
#[inline]
pub unsafe fn get_buffer_memory_requirements2(
&self,
info: &vk::BufferMemoryRequirementsInfo2,
out: &mut vk::MemoryRequirements2,
info: &vk::BufferMemoryRequirementsInfo2<'_>,
out: &mut vk::MemoryRequirements2<'_>,
) {
(self.device_fn_1_1.get_buffer_memory_requirements2)(self.handle(), info, out);
}
@ -826,7 +829,7 @@ impl Device {
#[inline]
pub unsafe fn get_image_sparse_memory_requirements2_len(
&self,
info: &vk::ImageSparseMemoryRequirementsInfo2,
info: &vk::ImageSparseMemoryRequirementsInfo2<'_>,
) -> usize {
let mut count = 0;
(self.device_fn_1_1.get_image_sparse_memory_requirements2)(
@ -845,8 +848,8 @@ impl Device {
#[inline]
pub unsafe fn get_image_sparse_memory_requirements2(
&self,
info: &vk::ImageSparseMemoryRequirementsInfo2,
out: &mut [vk::SparseImageMemoryRequirements2],
info: &vk::ImageSparseMemoryRequirementsInfo2<'_>,
out: &mut [vk::SparseImageMemoryRequirements2<'_>],
) {
let mut count = out.len() as u32;
(self.device_fn_1_1.get_image_sparse_memory_requirements2)(
@ -870,7 +873,7 @@ impl Device {
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetDeviceQueue2.html>
#[inline]
pub unsafe fn get_device_queue2(&self, queue_info: &vk::DeviceQueueInfo2) -> vk::Queue {
pub unsafe fn get_device_queue2(&self, queue_info: &vk::DeviceQueueInfo2<'_>) -> vk::Queue {
let mut queue = mem::zeroed();
(self.device_fn_1_1.get_device_queue2)(self.handle(), queue_info, &mut queue);
queue
@ -880,8 +883,8 @@ impl Device {
#[inline]
pub unsafe fn create_sampler_ycbcr_conversion(
&self,
create_info: &vk::SamplerYcbcrConversionCreateInfo,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
create_info: &vk::SamplerYcbcrConversionCreateInfo<'_>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<vk::SamplerYcbcrConversion> {
let mut ycbcr_conversion = mem::zeroed();
(self.device_fn_1_1.create_sampler_ycbcr_conversion)(
@ -898,7 +901,7 @@ impl Device {
pub unsafe fn destroy_sampler_ycbcr_conversion(
&self,
ycbcr_conversion: vk::SamplerYcbcrConversion,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) {
(self.device_fn_1_1.destroy_sampler_ycbcr_conversion)(
self.handle(),
@ -911,8 +914,8 @@ impl Device {
#[inline]
pub unsafe fn create_descriptor_update_template(
&self,
create_info: &vk::DescriptorUpdateTemplateCreateInfo,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
create_info: &vk::DescriptorUpdateTemplateCreateInfo<'_>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<vk::DescriptorUpdateTemplate> {
let mut descriptor_update_template = mem::zeroed();
(self.device_fn_1_1.create_descriptor_update_template)(
@ -929,7 +932,7 @@ impl Device {
pub unsafe fn destroy_descriptor_update_template(
&self,
descriptor_update_template: vk::DescriptorUpdateTemplate,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) {
(self.device_fn_1_1.destroy_descriptor_update_template)(
self.handle(),
@ -958,8 +961,8 @@ impl Device {
#[inline]
pub unsafe fn get_descriptor_set_layout_support(
&self,
create_info: &vk::DescriptorSetLayoutCreateInfo,
out: &mut vk::DescriptorSetLayoutSupport,
create_info: &vk::DescriptorSetLayoutCreateInfo<'_>,
out: &mut vk::DescriptorSetLayoutSupport<'_>,
) {
(self.device_fn_1_1.get_descriptor_set_layout_support)(self.handle(), create_info, out);
}
@ -974,7 +977,10 @@ impl Device {
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkDestroyDevice.html>
#[inline]
pub unsafe fn destroy_device(&self, allocation_callbacks: Option<&vk::AllocationCallbacks>) {
pub unsafe fn destroy_device(
&self,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) {
(self.device_fn_1_0.destroy_device)(self.handle(), allocation_callbacks.as_raw_ptr());
}
@ -983,7 +989,7 @@ impl Device {
pub unsafe fn destroy_sampler(
&self,
sampler: vk::Sampler,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) {
(self.device_fn_1_0.destroy_sampler)(
self.handle(),
@ -997,7 +1003,7 @@ impl Device {
pub unsafe fn free_memory(
&self,
memory: vk::DeviceMemory,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) {
(self.device_fn_1_0.free_memory)(self.handle(), memory, allocation_callbacks.as_raw_ptr());
}
@ -1021,8 +1027,8 @@ impl Device {
#[inline]
pub unsafe fn create_event(
&self,
create_info: &vk::EventCreateInfo,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
create_info: &vk::EventCreateInfo<'_>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<vk::Event> {
let mut event = mem::zeroed();
(self.device_fn_1_0.create_event)(
@ -1087,9 +1093,9 @@ impl Device {
events: &[vk::Event],
src_stage_mask: vk::PipelineStageFlags,
dst_stage_mask: vk::PipelineStageFlags,
memory_barriers: &[vk::MemoryBarrier],
buffer_memory_barriers: &[vk::BufferMemoryBarrier],
image_memory_barriers: &[vk::ImageMemoryBarrier],
memory_barriers: &[vk::MemoryBarrier<'_>],
buffer_memory_barriers: &[vk::BufferMemoryBarrier<'_>],
image_memory_barriers: &[vk::ImageMemoryBarrier<'_>],
) {
(self.device_fn_1_0.cmd_wait_events)(
command_buffer,
@ -1111,7 +1117,7 @@ impl Device {
pub unsafe fn destroy_fence(
&self,
fence: vk::Fence,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) {
(self.device_fn_1_0.destroy_fence)(self.handle(), fence, allocation_callbacks.as_raw_ptr());
}
@ -1121,7 +1127,7 @@ impl Device {
pub unsafe fn destroy_event(
&self,
event: vk::Event,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) {
(self.device_fn_1_0.destroy_event)(self.handle(), event, allocation_callbacks.as_raw_ptr());
}
@ -1131,7 +1137,7 @@ impl Device {
pub unsafe fn destroy_image(
&self,
image: vk::Image,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) {
(self.device_fn_1_0.destroy_image)(self.handle(), image, allocation_callbacks.as_raw_ptr());
}
@ -1141,7 +1147,7 @@ impl Device {
pub unsafe fn destroy_command_pool(
&self,
pool: vk::CommandPool,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) {
(self.device_fn_1_0.destroy_command_pool)(
self.handle(),
@ -1155,7 +1161,7 @@ impl Device {
pub unsafe fn destroy_image_view(
&self,
image_view: vk::ImageView,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) {
(self.device_fn_1_0.destroy_image_view)(
self.handle(),
@ -1169,7 +1175,7 @@ impl Device {
pub unsafe fn destroy_render_pass(
&self,
renderpass: vk::RenderPass,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) {
(self.device_fn_1_0.destroy_render_pass)(
self.handle(),
@ -1183,7 +1189,7 @@ impl Device {
pub unsafe fn destroy_framebuffer(
&self,
framebuffer: vk::Framebuffer,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) {
(self.device_fn_1_0.destroy_framebuffer)(
self.handle(),
@ -1197,7 +1203,7 @@ impl Device {
pub unsafe fn destroy_pipeline_layout(
&self,
pipeline_layout: vk::PipelineLayout,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) {
(self.device_fn_1_0.destroy_pipeline_layout)(
self.handle(),
@ -1211,7 +1217,7 @@ impl Device {
pub unsafe fn destroy_pipeline_cache(
&self,
pipeline_cache: vk::PipelineCache,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) {
(self.device_fn_1_0.destroy_pipeline_cache)(
self.handle(),
@ -1225,7 +1231,7 @@ impl Device {
pub unsafe fn destroy_buffer(
&self,
buffer: vk::Buffer,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) {
(self.device_fn_1_0.destroy_buffer)(
self.handle(),
@ -1239,7 +1245,7 @@ impl Device {
pub unsafe fn destroy_shader_module(
&self,
shader: vk::ShaderModule,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) {
(self.device_fn_1_0.destroy_shader_module)(
self.handle(),
@ -1253,7 +1259,7 @@ impl Device {
pub unsafe fn destroy_pipeline(
&self,
pipeline: vk::Pipeline,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) {
(self.device_fn_1_0.destroy_pipeline)(
self.handle(),
@ -1267,7 +1273,7 @@ impl Device {
pub unsafe fn destroy_semaphore(
&self,
semaphore: vk::Semaphore,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) {
(self.device_fn_1_0.destroy_semaphore)(
self.handle(),
@ -1281,7 +1287,7 @@ impl Device {
pub unsafe fn destroy_descriptor_pool(
&self,
pool: vk::DescriptorPool,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) {
(self.device_fn_1_0.destroy_descriptor_pool)(
self.handle(),
@ -1295,7 +1301,7 @@ impl Device {
pub unsafe fn destroy_query_pool(
&self,
pool: vk::QueryPool,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) {
(self.device_fn_1_0.destroy_query_pool)(
self.handle(),
@ -1309,7 +1315,7 @@ impl Device {
pub unsafe fn destroy_descriptor_set_layout(
&self,
layout: vk::DescriptorSetLayout,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) {
(self.device_fn_1_0.destroy_descriptor_set_layout)(
self.handle(),
@ -1338,8 +1344,8 @@ impl Device {
#[inline]
pub unsafe fn update_descriptor_sets(
&self,
descriptor_writes: &[vk::WriteDescriptorSet],
descriptor_copies: &[vk::CopyDescriptorSet],
descriptor_writes: &[vk::WriteDescriptorSet<'_>],
descriptor_copies: &[vk::CopyDescriptorSet<'_>],
) {
(self.device_fn_1_0.update_descriptor_sets)(
self.handle(),
@ -1354,8 +1360,8 @@ impl Device {
#[inline]
pub unsafe fn create_sampler(
&self,
create_info: &vk::SamplerCreateInfo,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
create_info: &vk::SamplerCreateInfo<'_>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<vk::Sampler> {
let mut sampler = mem::zeroed();
(self.device_fn_1_0.create_sampler)(
@ -1528,7 +1534,7 @@ impl Device {
#[inline]
pub unsafe fn allocate_descriptor_sets(
&self,
allocate_info: &vk::DescriptorSetAllocateInfo,
allocate_info: &vk::DescriptorSetAllocateInfo<'_>,
) -> VkResult<Vec<vk::DescriptorSet>> {
let mut desc_set = Vec::with_capacity(allocate_info.descriptor_set_count as usize);
(self.device_fn_1_0.allocate_descriptor_sets)(
@ -1546,8 +1552,8 @@ impl Device {
#[inline]
pub unsafe fn create_descriptor_set_layout(
&self,
create_info: &vk::DescriptorSetLayoutCreateInfo,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
create_info: &vk::DescriptorSetLayoutCreateInfo<'_>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<vk::DescriptorSetLayout> {
let mut layout = mem::zeroed();
(self.device_fn_1_0.create_descriptor_set_layout)(
@ -1569,8 +1575,8 @@ impl Device {
#[inline]
pub unsafe fn create_descriptor_pool(
&self,
create_info: &vk::DescriptorPoolCreateInfo,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
create_info: &vk::DescriptorPoolCreateInfo<'_>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<vk::DescriptorPool> {
let mut pool = mem::zeroed();
(self.device_fn_1_0.create_descriptor_pool)(
@ -1815,7 +1821,7 @@ impl Device {
pub unsafe fn cmd_begin_render_pass(
&self,
command_buffer: vk::CommandBuffer,
render_pass_begin: &vk::RenderPassBeginInfo,
render_pass_begin: &vk::RenderPassBeginInfo<'_>,
contents: vk::SubpassContents,
) {
(self.device_fn_1_0.cmd_begin_render_pass)(command_buffer, render_pass_begin, contents);
@ -2114,8 +2120,8 @@ impl Device {
#[inline]
pub unsafe fn create_semaphore(
&self,
create_info: &vk::SemaphoreCreateInfo,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
create_info: &vk::SemaphoreCreateInfo<'_>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<vk::Semaphore> {
let mut semaphore = mem::zeroed();
(self.device_fn_1_0.create_semaphore)(
@ -2132,8 +2138,8 @@ impl Device {
pub unsafe fn create_graphics_pipelines(
&self,
pipeline_cache: vk::PipelineCache,
create_infos: &[vk::GraphicsPipelineCreateInfo],
allocation_callbacks: Option<&vk::AllocationCallbacks>,
create_infos: &[vk::GraphicsPipelineCreateInfo<'_>],
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> Result<Vec<vk::Pipeline>, (Vec<vk::Pipeline>, vk::Result)> {
let mut pipelines = Vec::with_capacity(create_infos.len());
let err_code = (self.device_fn_1_0.create_graphics_pipelines)(
@ -2156,8 +2162,8 @@ impl Device {
pub unsafe fn create_compute_pipelines(
&self,
pipeline_cache: vk::PipelineCache,
create_infos: &[vk::ComputePipelineCreateInfo],
allocation_callbacks: Option<&vk::AllocationCallbacks>,
create_infos: &[vk::ComputePipelineCreateInfo<'_>],
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> Result<Vec<vk::Pipeline>, (Vec<vk::Pipeline>, vk::Result)> {
let mut pipelines = Vec::with_capacity(create_infos.len());
let err_code = (self.device_fn_1_0.create_compute_pipelines)(
@ -2179,8 +2185,8 @@ impl Device {
#[inline]
pub unsafe fn create_buffer(
&self,
create_info: &vk::BufferCreateInfo,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
create_info: &vk::BufferCreateInfo<'_>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<vk::Buffer> {
let mut buffer = mem::zeroed();
(self.device_fn_1_0.create_buffer)(
@ -2196,8 +2202,8 @@ impl Device {
#[inline]
pub unsafe fn create_pipeline_layout(
&self,
create_info: &vk::PipelineLayoutCreateInfo,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
create_info: &vk::PipelineLayoutCreateInfo<'_>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<vk::PipelineLayout> {
let mut pipeline_layout = mem::zeroed();
(self.device_fn_1_0.create_pipeline_layout)(
@ -2213,8 +2219,8 @@ impl Device {
#[inline]
pub unsafe fn create_pipeline_cache(
&self,
create_info: &vk::PipelineCacheCreateInfo,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
create_info: &vk::PipelineCacheCreateInfo<'_>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<vk::PipelineCache> {
let mut pipeline_cache = mem::zeroed();
(self.device_fn_1_0.create_pipeline_cache)(
@ -2282,7 +2288,7 @@ impl Device {
#[inline]
pub unsafe fn invalidate_mapped_memory_ranges(
&self,
ranges: &[vk::MappedMemoryRange],
ranges: &[vk::MappedMemoryRange<'_>],
) -> VkResult<()> {
(self.device_fn_1_0.invalidate_mapped_memory_ranges)(
self.handle(),
@ -2296,7 +2302,7 @@ impl Device {
#[inline]
pub unsafe fn flush_mapped_memory_ranges(
&self,
ranges: &[vk::MappedMemoryRange],
ranges: &[vk::MappedMemoryRange<'_>],
) -> VkResult<()> {
(self.device_fn_1_0.flush_mapped_memory_ranges)(
self.handle(),
@ -2310,8 +2316,8 @@ impl Device {
#[inline]
pub unsafe fn create_framebuffer(
&self,
create_info: &vk::FramebufferCreateInfo,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
create_info: &vk::FramebufferCreateInfo<'_>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<vk::Framebuffer> {
let mut framebuffer = mem::zeroed();
(self.device_fn_1_0.create_framebuffer)(
@ -2344,9 +2350,9 @@ impl Device {
src_stage_mask: vk::PipelineStageFlags,
dst_stage_mask: vk::PipelineStageFlags,
dependency_flags: vk::DependencyFlags,
memory_barriers: &[vk::MemoryBarrier],
buffer_memory_barriers: &[vk::BufferMemoryBarrier],
image_memory_barriers: &[vk::ImageMemoryBarrier],
memory_barriers: &[vk::MemoryBarrier<'_>],
buffer_memory_barriers: &[vk::BufferMemoryBarrier<'_>],
image_memory_barriers: &[vk::ImageMemoryBarrier<'_>],
) {
(self.device_fn_1_0.cmd_pipeline_barrier)(
command_buffer,
@ -2366,8 +2372,8 @@ impl Device {
#[inline]
pub unsafe fn create_render_pass(
&self,
create_info: &vk::RenderPassCreateInfo,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
create_info: &vk::RenderPassCreateInfo<'_>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<vk::RenderPass> {
let mut renderpass = mem::zeroed();
(self.device_fn_1_0.create_render_pass)(
@ -2384,7 +2390,7 @@ impl Device {
pub unsafe fn begin_command_buffer(
&self,
command_buffer: vk::CommandBuffer,
begin_info: &vk::CommandBufferBeginInfo,
begin_info: &vk::CommandBufferBeginInfo<'_>,
) -> VkResult<()> {
(self.device_fn_1_0.begin_command_buffer)(command_buffer, begin_info).result()
}
@ -2435,7 +2441,7 @@ impl Device {
pub unsafe fn queue_submit(
&self,
queue: vk::Queue,
submits: &[vk::SubmitInfo],
submits: &[vk::SubmitInfo<'_>],
fence: vk::Fence,
) -> VkResult<()> {
(self.device_fn_1_0.queue_submit)(queue, submits.len() as u32, submits.as_ptr(), fence)
@ -2447,7 +2453,7 @@ impl Device {
pub unsafe fn queue_bind_sparse(
&self,
queue: vk::Queue,
bind_info: &[vk::BindSparseInfo],
bind_info: &[vk::BindSparseInfo<'_>],
fence: vk::Fence,
) -> VkResult<()> {
(self.device_fn_1_0.queue_bind_sparse)(
@ -2463,8 +2469,8 @@ impl Device {
#[inline]
pub unsafe fn create_buffer_view(
&self,
create_info: &vk::BufferViewCreateInfo,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
create_info: &vk::BufferViewCreateInfo<'_>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<vk::BufferView> {
let mut buffer_view = mem::zeroed();
(self.device_fn_1_0.create_buffer_view)(
@ -2481,7 +2487,7 @@ impl Device {
pub unsafe fn destroy_buffer_view(
&self,
buffer_view: vk::BufferView,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) {
(self.device_fn_1_0.destroy_buffer_view)(
self.handle(),
@ -2494,8 +2500,8 @@ impl Device {
#[inline]
pub unsafe fn create_image_view(
&self,
create_info: &vk::ImageViewCreateInfo,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
create_info: &vk::ImageViewCreateInfo<'_>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<vk::ImageView> {
let mut image_view = mem::zeroed();
(self.device_fn_1_0.create_image_view)(
@ -2511,7 +2517,7 @@ impl Device {
#[inline]
pub unsafe fn allocate_command_buffers(
&self,
allocate_info: &vk::CommandBufferAllocateInfo,
allocate_info: &vk::CommandBufferAllocateInfo<'_>,
) -> VkResult<Vec<vk::CommandBuffer>> {
let mut buffers = Vec::with_capacity(allocate_info.command_buffer_count as usize);
(self.device_fn_1_0.allocate_command_buffers)(
@ -2528,8 +2534,8 @@ impl Device {
#[inline]
pub unsafe fn create_command_pool(
&self,
create_info: &vk::CommandPoolCreateInfo,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
create_info: &vk::CommandPoolCreateInfo<'_>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<vk::CommandPool> {
let mut pool = mem::zeroed();
(self.device_fn_1_0.create_command_pool)(
@ -2545,8 +2551,8 @@ impl Device {
#[inline]
pub unsafe fn create_query_pool(
&self,
create_info: &vk::QueryPoolCreateInfo,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
create_info: &vk::QueryPoolCreateInfo<'_>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<vk::QueryPool> {
let mut pool = mem::zeroed();
(self.device_fn_1_0.create_query_pool)(
@ -2562,8 +2568,8 @@ impl Device {
#[inline]
pub unsafe fn create_image(
&self,
create_info: &vk::ImageCreateInfo,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
create_info: &vk::ImageCreateInfo<'_>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<vk::Image> {
let mut image = mem::zeroed();
(self.device_fn_1_0.create_image)(
@ -2615,8 +2621,8 @@ impl Device {
#[inline]
pub unsafe fn allocate_memory(
&self,
allocate_info: &vk::MemoryAllocateInfo,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
allocate_info: &vk::MemoryAllocateInfo<'_>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<vk::DeviceMemory> {
let mut memory = mem::zeroed();
(self.device_fn_1_0.allocate_memory)(
@ -2632,8 +2638,8 @@ impl Device {
#[inline]
pub unsafe fn create_shader_module(
&self,
create_info: &vk::ShaderModuleCreateInfo,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
create_info: &vk::ShaderModuleCreateInfo<'_>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<vk::ShaderModule> {
let mut shader = mem::zeroed();
(self.device_fn_1_0.create_shader_module)(
@ -2649,8 +2655,8 @@ impl Device {
#[inline]
pub unsafe fn create_fence(
&self,
create_info: &vk::FenceCreateInfo,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
create_info: &vk::FenceCreateInfo<'_>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<vk::Fence> {
let mut fence = mem::zeroed();
(self.device_fn_1_0.create_fence)(

View file

@ -2,9 +2,11 @@ use crate::instance::Instance;
use crate::prelude::*;
use crate::vk;
use crate::RawPtr;
use std::error::Error;
use std::ffi::CStr;
#[cfg(feature = "loaded")]
use std::ffi::OsStr;
use std::fmt;
use std::mem;
use std::os::raw::c_char;
use std::os::raw::c_void;
@ -156,7 +158,7 @@ impl Entry {
/// `static_fn` must contain valid function pointers that comply with the semantics specified
/// by Vulkan 1.0, which must remain valid for at least the lifetime of the returned [`Entry`].
pub unsafe fn from_static_fn(static_fn: vk::StaticFn) -> Self {
let load_fn = move |name: &std::ffi::CStr| {
let load_fn = move |name: &CStr| {
mem::transmute((static_fn.get_instance_proc_addr)(
vk::Instance::null(),
name.as_ptr(),
@ -246,8 +248,8 @@ impl Entry {
#[inline]
pub unsafe fn create_instance(
&self,
create_info: &vk::InstanceCreateInfo,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
create_info: &vk::InstanceCreateInfo<'_>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<Instance> {
let mut instance = mem::zeroed();
(self.entry_fn_1_0.create_instance)(
@ -342,12 +344,12 @@ impl vk::StaticFn {
#[derive(Clone, Debug)]
pub struct MissingEntryPoint;
impl std::fmt::Display for MissingEntryPoint {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
impl fmt::Display for MissingEntryPoint {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "Cannot load `vkGetInstanceProcAddr` symbol from library")
}
}
impl std::error::Error for MissingEntryPoint {}
impl Error for MissingEntryPoint {}
#[cfg(feature = "linked")]
extern "system" {
@ -357,8 +359,6 @@ extern "system" {
#[cfg(feature = "loaded")]
mod loaded {
use std::error::Error;
use std::fmt;
use super::*;
@ -370,7 +370,7 @@ mod loaded {
}
impl fmt::Display for LoadingError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Self::LibraryLoadFailure(err) => fmt::Display::fmt(err, f),
Self::MissingEntryPoint(err) => fmt::Display::fmt(err, f),

View file

@ -26,8 +26,8 @@ impl ShaderEnqueue {
pub unsafe fn create_execution_graph_pipelines(
&self,
pipeline_cache: vk::PipelineCache,
create_infos: &[vk::ExecutionGraphPipelineCreateInfoAMDX],
allocation_callbacks: Option<&vk::AllocationCallbacks>,
create_infos: &[vk::ExecutionGraphPipelineCreateInfoAMDX<'_>],
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<Vec<vk::Pipeline>> {
let mut pipelines = vec![mem::zeroed(); create_infos.len()];
(self.fp.create_execution_graph_pipelines_amdx)(
@ -46,7 +46,7 @@ impl ShaderEnqueue {
pub unsafe fn get_execution_graph_pipeline_scratch_size(
&self,
execution_graph: vk::Pipeline,
size_info: &mut vk::ExecutionGraphPipelineScratchSizeAMDX,
size_info: &mut vk::ExecutionGraphPipelineScratchSizeAMDX<'_>,
) -> VkResult<()> {
(self.fp.get_execution_graph_pipeline_scratch_size_amdx)(
self.handle,
@ -61,7 +61,7 @@ impl ShaderEnqueue {
pub unsafe fn get_execution_graph_pipeline_node_index(
&self,
execution_graph: vk::Pipeline,
node_info: &vk::PipelineShaderStageNodeCreateInfoAMDX,
node_info: &vk::PipelineShaderStageNodeCreateInfoAMDX<'_>,
) -> VkResult<u32> {
let mut node_index = 0;
(self.fp.get_execution_graph_pipeline_node_index_amdx)(

View file

@ -25,7 +25,7 @@ impl ExternalMemoryAndroidHardwareBuffer {
pub unsafe fn get_android_hardware_buffer_properties(
&self,
buffer: *const vk::AHardwareBuffer,
properties: &mut vk::AndroidHardwareBufferPropertiesANDROID,
properties: &mut vk::AndroidHardwareBufferPropertiesANDROID<'_>,
) -> VkResult<()> {
(self.fp.get_android_hardware_buffer_properties_android)(self.handle, buffer, properties)
.result()
@ -35,7 +35,7 @@ impl ExternalMemoryAndroidHardwareBuffer {
#[inline]
pub unsafe fn get_memory_android_hardware_buffer(
&self,
info: &vk::MemoryGetAndroidHardwareBufferInfoANDROID,
info: &vk::MemoryGetAndroidHardwareBufferInfoANDROID<'_>,
) -> VkResult<*mut vk::AHardwareBuffer> {
let mut buffer = std::ptr::null_mut();
(self.fp.get_memory_android_hardware_buffer_android)(self.handle, info, &mut buffer)

View file

@ -22,7 +22,7 @@ impl BufferDeviceAddress {
#[inline]
pub unsafe fn get_buffer_device_address(
&self,
info: &vk::BufferDeviceAddressInfoEXT,
info: &vk::BufferDeviceAddressInfoEXT<'_>,
) -> vk::DeviceAddress {
(self.fp.get_buffer_device_address_ext)(self.handle, info)
}

View file

@ -41,7 +41,7 @@ impl CalibratedTimestamps {
pub unsafe fn get_calibrated_timestamps(
&self,
device: vk::Device,
info: &[vk::CalibratedTimestampInfoEXT],
info: &[vk::CalibratedTimestampInfoEXT<'_>],
) -> VkResult<(Vec<u64>, u64)> {
let mut timestamps = vec![0u64; info.len()];
let mut max_deviation = 0u64;

View file

@ -23,7 +23,7 @@ impl DebugMarker {
#[inline]
pub unsafe fn debug_marker_set_object_name(
&self,
name_info: &vk::DebugMarkerObjectNameInfoEXT,
name_info: &vk::DebugMarkerObjectNameInfoEXT<'_>,
) -> VkResult<()> {
(self.fp.debug_marker_set_object_name_ext)(self.handle, name_info).result()
}
@ -33,7 +33,7 @@ impl DebugMarker {
pub unsafe fn cmd_debug_marker_begin(
&self,
command_buffer: vk::CommandBuffer,
marker_info: &vk::DebugMarkerMarkerInfoEXT,
marker_info: &vk::DebugMarkerMarkerInfoEXT<'_>,
) {
(self.fp.cmd_debug_marker_begin_ext)(command_buffer, marker_info);
}
@ -49,7 +49,7 @@ impl DebugMarker {
pub unsafe fn cmd_debug_marker_insert(
&self,
command_buffer: vk::CommandBuffer,
marker_info: &vk::DebugMarkerMarkerInfoEXT,
marker_info: &vk::DebugMarkerMarkerInfoEXT<'_>,
) {
(self.fp.cmd_debug_marker_insert_ext)(command_buffer, marker_info);
}

View file

@ -25,7 +25,7 @@ impl DebugReport {
pub unsafe fn destroy_debug_report_callback(
&self,
debug: vk::DebugReportCallbackEXT,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) {
(self.fp.destroy_debug_report_callback_ext)(
self.handle,
@ -38,8 +38,8 @@ impl DebugReport {
#[inline]
pub unsafe fn create_debug_report_callback(
&self,
create_info: &vk::DebugReportCallbackCreateInfoEXT,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
create_info: &vk::DebugReportCallbackCreateInfoEXT<'_>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<vk::DebugReportCallbackEXT> {
let mut debug_cb = mem::zeroed();
(self.fp.create_debug_report_callback_ext)(

View file

@ -24,7 +24,7 @@ impl DebugUtils {
pub unsafe fn set_debug_utils_object_name(
&self,
device: vk::Device,
name_info: &vk::DebugUtilsObjectNameInfoEXT,
name_info: &vk::DebugUtilsObjectNameInfoEXT<'_>,
) -> VkResult<()> {
(self.fp.set_debug_utils_object_name_ext)(device, name_info).result()
}
@ -34,7 +34,7 @@ impl DebugUtils {
pub unsafe fn set_debug_utils_object_tag(
&self,
device: vk::Device,
tag_info: &vk::DebugUtilsObjectTagInfoEXT,
tag_info: &vk::DebugUtilsObjectTagInfoEXT<'_>,
) -> VkResult<()> {
(self.fp.set_debug_utils_object_tag_ext)(device, tag_info).result()
}
@ -44,7 +44,7 @@ impl DebugUtils {
pub unsafe fn cmd_begin_debug_utils_label(
&self,
command_buffer: vk::CommandBuffer,
label: &vk::DebugUtilsLabelEXT,
label: &vk::DebugUtilsLabelEXT<'_>,
) {
(self.fp.cmd_begin_debug_utils_label_ext)(command_buffer, label);
}
@ -60,7 +60,7 @@ impl DebugUtils {
pub unsafe fn cmd_insert_debug_utils_label(
&self,
command_buffer: vk::CommandBuffer,
label: &vk::DebugUtilsLabelEXT,
label: &vk::DebugUtilsLabelEXT<'_>,
) {
(self.fp.cmd_insert_debug_utils_label_ext)(command_buffer, label);
}
@ -70,7 +70,7 @@ impl DebugUtils {
pub unsafe fn queue_begin_debug_utils_label(
&self,
queue: vk::Queue,
label: &vk::DebugUtilsLabelEXT,
label: &vk::DebugUtilsLabelEXT<'_>,
) {
(self.fp.queue_begin_debug_utils_label_ext)(queue, label);
}
@ -86,7 +86,7 @@ impl DebugUtils {
pub unsafe fn queue_insert_debug_utils_label(
&self,
queue: vk::Queue,
label: &vk::DebugUtilsLabelEXT,
label: &vk::DebugUtilsLabelEXT<'_>,
) {
(self.fp.queue_insert_debug_utils_label_ext)(queue, label);
}
@ -95,8 +95,8 @@ impl DebugUtils {
#[inline]
pub unsafe fn create_debug_utils_messenger(
&self,
create_info: &vk::DebugUtilsMessengerCreateInfoEXT,
allocator: Option<&vk::AllocationCallbacks>,
create_info: &vk::DebugUtilsMessengerCreateInfoEXT<'_>,
allocator: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<vk::DebugUtilsMessengerEXT> {
let mut messenger = mem::zeroed();
(self.fp.create_debug_utils_messenger_ext)(
@ -113,7 +113,7 @@ impl DebugUtils {
pub unsafe fn destroy_debug_utils_messenger(
&self,
messenger: vk::DebugUtilsMessengerEXT,
allocator: Option<&vk::AllocationCallbacks>,
allocator: Option<&vk::AllocationCallbacks<'_>>,
) {
(self.fp.destroy_debug_utils_messenger_ext)(self.handle, messenger, allocator.as_raw_ptr());
}
@ -124,7 +124,7 @@ impl DebugUtils {
&self,
message_severity: vk::DebugUtilsMessageSeverityFlagsEXT,
message_types: vk::DebugUtilsMessageTypeFlagsEXT,
callback_data: &vk::DebugUtilsMessengerCallbackDataEXT,
callback_data: &vk::DebugUtilsMessengerCallbackDataEXT<'_>,
) {
(self.fp.submit_debug_utils_message_ext)(
self.handle,

View file

@ -52,7 +52,7 @@ impl DescriptorBuffer {
#[inline]
pub unsafe fn get_descriptor(
&self,
descriptor_info: &vk::DescriptorGetInfoEXT,
descriptor_info: &vk::DescriptorGetInfoEXT<'_>,
descriptor: &mut [u8],
) {
(self.fp.get_descriptor_ext)(
@ -68,7 +68,7 @@ impl DescriptorBuffer {
pub unsafe fn cmd_bind_descriptor_buffers(
&self,
command_buffer: vk::CommandBuffer,
binding_info: &[vk::DescriptorBufferBindingInfoEXT],
binding_info: &[vk::DescriptorBufferBindingInfoEXT<'_>],
) {
(self.fp.cmd_bind_descriptor_buffers_ext)(
command_buffer,
@ -121,7 +121,7 @@ impl DescriptorBuffer {
#[inline]
pub unsafe fn get_buffer_opaque_capture_descriptor_data(
&self,
info: &vk::BufferCaptureDescriptorDataInfoEXT,
info: &vk::BufferCaptureDescriptorDataInfoEXT<'_>,
data: &mut [u8],
) -> VkResult<()> {
(self.fp.get_buffer_opaque_capture_descriptor_data_ext)(
@ -136,7 +136,7 @@ impl DescriptorBuffer {
#[inline]
pub unsafe fn get_image_opaque_capture_descriptor_data(
&self,
info: &vk::ImageCaptureDescriptorDataInfoEXT,
info: &vk::ImageCaptureDescriptorDataInfoEXT<'_>,
data: &mut [u8],
) -> VkResult<()> {
(self.fp.get_image_opaque_capture_descriptor_data_ext)(
@ -151,7 +151,7 @@ impl DescriptorBuffer {
#[inline]
pub unsafe fn get_image_view_opaque_capture_descriptor_data(
&self,
info: &vk::ImageViewCaptureDescriptorDataInfoEXT,
info: &vk::ImageViewCaptureDescriptorDataInfoEXT<'_>,
data: &mut [u8],
) -> VkResult<()> {
(self.fp.get_image_view_opaque_capture_descriptor_data_ext)(
@ -166,7 +166,7 @@ impl DescriptorBuffer {
#[inline]
pub unsafe fn get_sampler_opaque_capture_descriptor_data(
&self,
info: &vk::SamplerCaptureDescriptorDataInfoEXT,
info: &vk::SamplerCaptureDescriptorDataInfoEXT<'_>,
data: &mut [u8],
) -> VkResult<()> {
(self.fp.get_sampler_opaque_capture_descriptor_data_ext)(
@ -181,7 +181,7 @@ impl DescriptorBuffer {
#[inline]
pub unsafe fn get_acceleration_structure_opaque_capture_descriptor_data(
&self,
info: &vk::AccelerationStructureCaptureDescriptorDataInfoEXT,
info: &vk::AccelerationStructureCaptureDescriptorDataInfoEXT<'_>,
data: &mut [u8],
) -> VkResult<()> {
(self

View file

@ -33,7 +33,7 @@ impl FullScreenExclusive {
pub unsafe fn get_physical_device_surface_present_modes2(
&self,
physical_device: vk::PhysicalDevice,
surface_info: &vk::PhysicalDeviceSurfaceInfo2KHR,
surface_info: &vk::PhysicalDeviceSurfaceInfo2KHR<'_>,
) -> VkResult<Vec<vk::PresentModeKHR>> {
read_into_uninitialized_vector(|count, data| {
(self.fp.get_physical_device_surface_present_modes2_ext)(
@ -58,7 +58,7 @@ impl FullScreenExclusive {
#[inline]
pub unsafe fn get_device_group_surface_present_modes2(
&self,
surface_info: &vk::PhysicalDeviceSurfaceInfo2KHR,
surface_info: &vk::PhysicalDeviceSurfaceInfo2KHR<'_>,
) -> VkResult<vk::DeviceGroupPresentModeFlagsKHR> {
let mut present_modes = mem::zeroed();
(self.fp.get_device_group_surface_present_modes2_ext)(

View file

@ -25,8 +25,8 @@ impl HeadlessSurface {
#[inline]
pub unsafe fn create_headless_surface(
&self,
create_info: &vk::HeadlessSurfaceCreateInfoEXT,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
create_info: &vk::HeadlessSurfaceCreateInfoEXT<'_>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<vk::SurfaceKHR> {
let mut surface = mem::zeroed();
(self.fp.create_headless_surface_ext)(

View file

@ -26,7 +26,7 @@ impl HostImageCopy {
#[inline]
pub unsafe fn copy_memory_to_image(
&self,
copy_memory_to_image_info: &vk::CopyMemoryToImageInfoEXT,
copy_memory_to_image_info: &vk::CopyMemoryToImageInfoEXT<'_>,
) -> VkResult<()> {
(self.fp.copy_memory_to_image_ext)(self.handle, copy_memory_to_image_info).result()
}
@ -35,7 +35,7 @@ impl HostImageCopy {
#[inline]
pub unsafe fn copy_image_to_memory(
&self,
copy_image_to_memory_info: &vk::CopyImageToMemoryInfoEXT,
copy_image_to_memory_info: &vk::CopyImageToMemoryInfoEXT<'_>,
) -> VkResult<()> {
(self.fp.copy_image_to_memory_ext)(self.handle, copy_image_to_memory_info).result()
}
@ -44,7 +44,7 @@ impl HostImageCopy {
#[inline]
pub unsafe fn copy_image_to_image(
&self,
copy_image_to_image_info: &vk::CopyImageToImageInfoEXT,
copy_image_to_image_info: &vk::CopyImageToImageInfoEXT<'_>,
) -> VkResult<()> {
(self.fp.copy_image_to_image_ext)(self.handle, copy_image_to_image_info).result()
}
@ -53,7 +53,7 @@ impl HostImageCopy {
#[inline]
pub unsafe fn transition_image_layout(
&self,
transitions: &[vk::HostImageLayoutTransitionInfoEXT],
transitions: &[vk::HostImageLayoutTransitionInfoEXT<'_>],
) -> VkResult<()> {
(self.fp.transition_image_layout_ext)(
self.handle,
@ -77,8 +77,8 @@ impl HostImageCopy {
pub unsafe fn get_image_subresource_layout2(
&self,
image: vk::Image,
subresource: &vk::ImageSubresource2EXT,
layout: &mut vk::SubresourceLayout2EXT,
subresource: &vk::ImageSubresource2EXT<'_>,
layout: &mut vk::SubresourceLayout2EXT<'_>,
) {
(self.fp.get_image_subresource_layout2_ext)(self.handle, image, subresource, layout)
}

View file

@ -35,8 +35,8 @@ impl ImageCompressionControl {
pub unsafe fn get_image_subresource_layout2(
&self,
image: vk::Image,
subresource: &vk::ImageSubresource2EXT,
layout: &mut vk::SubresourceLayout2EXT,
subresource: &vk::ImageSubresource2EXT<'_>,
layout: &mut vk::SubresourceLayout2EXT<'_>,
) {
(self.fp.get_image_subresource_layout2_ext)(self.handle, image, subresource, layout)
}

View file

@ -25,7 +25,7 @@ impl ImageDrmFormatModifier {
pub unsafe fn get_image_drm_format_modifier_properties(
&self,
image: vk::Image,
properties: &mut vk::ImageDrmFormatModifierPropertiesEXT,
properties: &mut vk::ImageDrmFormatModifierPropertiesEXT<'_>,
) -> VkResult<()> {
(self.fp.get_image_drm_format_modifier_properties_ext)(self.handle, image, properties)
.result()

View file

@ -24,8 +24,8 @@ impl MetalSurface {
#[inline]
pub unsafe fn create_metal_surface(
&self,
create_info: &vk::MetalSurfaceCreateInfoEXT,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
create_info: &vk::MetalSurfaceCreateInfoEXT<'_>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<vk::SurfaceKHR> {
let mut surface = mem::zeroed();
(self.fp.create_metal_surface_ext)(

View file

@ -24,7 +24,7 @@ impl PipelineProperties {
#[inline]
pub unsafe fn get_pipeline_properties(
&self,
pipeline_info: &vk::PipelineInfoEXT,
pipeline_info: &vk::PipelineInfoEXT<'_>,
pipeline_properties: &mut impl vk::GetPipelinePropertiesEXTParamPipelineProperties,
) -> VkResult<()> {
(self.fp.get_pipeline_properties_ext)(

View file

@ -25,8 +25,8 @@ impl PrivateData {
#[inline]
pub unsafe fn create_private_data_slot(
&self,
create_info: &vk::PrivateDataSlotCreateInfoEXT,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
create_info: &vk::PrivateDataSlotCreateInfoEXT<'_>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<vk::PrivateDataSlotEXT> {
let mut private_data_slot = mem::zeroed();
(self.fp.create_private_data_slot_ext)(
@ -43,7 +43,7 @@ impl PrivateData {
pub unsafe fn destroy_private_data_slot(
&self,
private_data_slot: vk::PrivateDataSlotEXT,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) {
(self.fp.destroy_private_data_slot_ext)(
self.handle,

View file

@ -23,7 +23,7 @@ impl SampleLocations {
&self,
physical_device: vk::PhysicalDevice,
samples: vk::SampleCountFlags,
multisample_properties: &mut vk::MultisamplePropertiesEXT,
multisample_properties: &mut vk::MultisamplePropertiesEXT<'_>,
) {
(self.fp.get_physical_device_multisample_properties_ext)(
physical_device,
@ -37,7 +37,7 @@ impl SampleLocations {
pub unsafe fn cmd_set_sample_locations(
&self,
command_buffer: vk::CommandBuffer,
sample_locations_info: &vk::SampleLocationsInfoEXT,
sample_locations_info: &vk::SampleLocationsInfoEXT<'_>,
) {
(self.fp.cmd_set_sample_locations_ext)(command_buffer, sample_locations_info)
}

View file

@ -26,8 +26,8 @@ impl ShaderObject {
#[inline]
pub unsafe fn create_shaders(
&self,
create_infos: &[vk::ShaderCreateInfoEXT],
allocator: Option<&vk::AllocationCallbacks>,
create_infos: &[vk::ShaderCreateInfoEXT<'_>],
allocator: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<Vec<vk::ShaderEXT>> {
let mut shaders = Vec::with_capacity(create_infos.len());
(self.fp.create_shaders_ext)(
@ -47,7 +47,7 @@ impl ShaderObject {
pub unsafe fn destroy_shader(
&self,
shader: vk::ShaderEXT,
allocator: Option<&vk::AllocationCallbacks>,
allocator: Option<&vk::AllocationCallbacks<'_>>,
) {
(self.fp.destroy_shader_ext)(self.handle, shader, allocator.as_raw_ptr())
}
@ -82,8 +82,8 @@ impl ShaderObject {
pub unsafe fn cmd_set_vertex_input(
&self,
command_buffer: vk::CommandBuffer,
vertex_binding_descriptions: &[vk::VertexInputBindingDescription2EXT],
vertex_attribute_descriptions: &[vk::VertexInputAttributeDescription2EXT],
vertex_binding_descriptions: &[vk::VertexInputBindingDescription2EXT<'_>],
vertex_attribute_descriptions: &[vk::VertexInputAttributeDescription2EXT<'_>],
) {
(self.fp.cmd_set_vertex_input_ext)(
command_buffer,

View file

@ -22,7 +22,7 @@ impl ToolingInfo {
pub unsafe fn get_physical_device_tool_properties(
&self,
physical_device: vk::PhysicalDevice,
) -> VkResult<Vec<vk::PhysicalDeviceToolPropertiesEXT>> {
) -> VkResult<Vec<vk::PhysicalDeviceToolPropertiesEXT<'_>>> {
read_into_defaulted_vector(|count, data| {
(self.fp.get_physical_device_tool_properties_ext)(physical_device, count, data)
})

View file

@ -22,8 +22,8 @@ impl VertexInputDynamicState {
pub unsafe fn cmd_set_vertex_input(
&self,
command_buffer: vk::CommandBuffer,
vertex_binding_descriptions: &[vk::VertexInputBindingDescription2EXT],
vertex_attribute_descriptions: &[vk::VertexInputAttributeDescription2EXT],
vertex_binding_descriptions: &[vk::VertexInputBindingDescription2EXT<'_>],
vertex_attribute_descriptions: &[vk::VertexInputAttributeDescription2EXT<'_>],
) {
(self.fp.cmd_set_vertex_input_ext)(
command_buffer,

View file

@ -25,8 +25,8 @@ impl AccelerationStructure {
#[inline]
pub unsafe fn create_acceleration_structure(
&self,
create_info: &vk::AccelerationStructureCreateInfoKHR,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
create_info: &vk::AccelerationStructureCreateInfoKHR<'_>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<vk::AccelerationStructureKHR> {
let mut accel_struct = mem::zeroed();
(self.fp.create_acceleration_structure_khr)(
@ -43,7 +43,7 @@ impl AccelerationStructure {
pub unsafe fn destroy_acceleration_structure(
&self,
accel_struct: vk::AccelerationStructureKHR,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) {
(self.fp.destroy_acceleration_structure_khr)(
self.handle,
@ -57,7 +57,7 @@ impl AccelerationStructure {
pub unsafe fn cmd_build_acceleration_structures(
&self,
command_buffer: vk::CommandBuffer,
infos: &[vk::AccelerationStructureBuildGeometryInfoKHR],
infos: &[vk::AccelerationStructureBuildGeometryInfoKHR<'_>],
build_range_infos: &[&[vk::AccelerationStructureBuildRangeInfoKHR]],
) {
assert_eq!(infos.len(), build_range_infos.len());
@ -84,7 +84,7 @@ impl AccelerationStructure {
pub unsafe fn cmd_build_acceleration_structures_indirect(
&self,
command_buffer: vk::CommandBuffer,
infos: &[vk::AccelerationStructureBuildGeometryInfoKHR],
infos: &[vk::AccelerationStructureBuildGeometryInfoKHR<'_>],
indirect_device_addresses: &[vk::DeviceAddress],
indirect_strides: &[u32],
max_primitive_counts: &[&[u32]],
@ -117,7 +117,7 @@ impl AccelerationStructure {
pub unsafe fn build_acceleration_structures(
&self,
deferred_operation: vk::DeferredOperationKHR,
infos: &[vk::AccelerationStructureBuildGeometryInfoKHR],
infos: &[vk::AccelerationStructureBuildGeometryInfoKHR<'_>],
build_range_infos: &[&[vk::AccelerationStructureBuildRangeInfoKHR]],
) -> VkResult<()> {
assert_eq!(infos.len(), build_range_infos.len());
@ -146,7 +146,7 @@ impl AccelerationStructure {
pub unsafe fn copy_acceleration_structure(
&self,
deferred_operation: vk::DeferredOperationKHR,
info: &vk::CopyAccelerationStructureInfoKHR,
info: &vk::CopyAccelerationStructureInfoKHR<'_>,
) -> VkResult<()> {
(self.fp.copy_acceleration_structure_khr)(self.handle, deferred_operation, info).result()
}
@ -156,7 +156,7 @@ impl AccelerationStructure {
pub unsafe fn copy_acceleration_structure_to_memory(
&self,
deferred_operation: vk::DeferredOperationKHR,
info: &vk::CopyAccelerationStructureToMemoryInfoKHR,
info: &vk::CopyAccelerationStructureToMemoryInfoKHR<'_>,
) -> VkResult<()> {
(self.fp.copy_acceleration_structure_to_memory_khr)(self.handle, deferred_operation, info)
.result()
@ -167,7 +167,7 @@ impl AccelerationStructure {
pub unsafe fn copy_memory_to_acceleration_structure(
&self,
deferred_operation: vk::DeferredOperationKHR,
info: &vk::CopyMemoryToAccelerationStructureInfoKHR,
info: &vk::CopyMemoryToAccelerationStructureInfoKHR<'_>,
) -> VkResult<()> {
(self.fp.copy_memory_to_acceleration_structure_khr)(self.handle, deferred_operation, info)
.result()
@ -199,7 +199,7 @@ impl AccelerationStructure {
pub unsafe fn cmd_copy_acceleration_structure(
&self,
command_buffer: vk::CommandBuffer,
info: &vk::CopyAccelerationStructureInfoKHR,
info: &vk::CopyAccelerationStructureInfoKHR<'_>,
) {
(self.fp.cmd_copy_acceleration_structure_khr)(command_buffer, info);
}
@ -209,7 +209,7 @@ impl AccelerationStructure {
pub unsafe fn cmd_copy_acceleration_structure_to_memory(
&self,
command_buffer: vk::CommandBuffer,
info: &vk::CopyAccelerationStructureToMemoryInfoKHR,
info: &vk::CopyAccelerationStructureToMemoryInfoKHR<'_>,
) {
(self.fp.cmd_copy_acceleration_structure_to_memory_khr)(command_buffer, info);
}
@ -219,7 +219,7 @@ impl AccelerationStructure {
pub unsafe fn cmd_copy_memory_to_acceleration_structure(
&self,
command_buffer: vk::CommandBuffer,
info: &vk::CopyMemoryToAccelerationStructureInfoKHR,
info: &vk::CopyMemoryToAccelerationStructureInfoKHR<'_>,
) {
(self.fp.cmd_copy_memory_to_acceleration_structure_khr)(command_buffer, info);
}
@ -228,7 +228,7 @@ impl AccelerationStructure {
#[inline]
pub unsafe fn get_acceleration_structure_device_address(
&self,
info: &vk::AccelerationStructureDeviceAddressInfoKHR,
info: &vk::AccelerationStructureDeviceAddressInfoKHR<'_>,
) -> vk::DeviceAddress {
(self.fp.get_acceleration_structure_device_address_khr)(self.handle, info)
}
@ -257,7 +257,7 @@ impl AccelerationStructure {
#[inline]
pub unsafe fn get_device_acceleration_structure_compatibility(
&self,
version: &vk::AccelerationStructureVersionInfoKHR,
version: &vk::AccelerationStructureVersionInfoKHR<'_>,
) -> vk::AccelerationStructureCompatibilityKHR {
let mut compatibility = mem::zeroed();
@ -275,9 +275,9 @@ impl AccelerationStructure {
pub unsafe fn get_acceleration_structure_build_sizes(
&self,
build_type: vk::AccelerationStructureBuildTypeKHR,
build_info: &vk::AccelerationStructureBuildGeometryInfoKHR,
build_info: &vk::AccelerationStructureBuildGeometryInfoKHR<'_>,
max_primitive_counts: &[u32],
size_info: &mut vk::AccelerationStructureBuildSizesInfoKHR,
size_info: &mut vk::AccelerationStructureBuildSizesInfoKHR<'_>,
) {
assert_eq!(max_primitive_counts.len(), build_info.geometry_count as _);

View file

@ -24,8 +24,8 @@ impl AndroidSurface {
#[inline]
pub unsafe fn create_android_surface(
&self,
create_info: &vk::AndroidSurfaceCreateInfoKHR,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
create_info: &vk::AndroidSurfaceCreateInfoKHR<'_>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<vk::SurfaceKHR> {
let mut surface = mem::zeroed();
(self.fp.create_android_surface_khr)(

View file

@ -22,7 +22,7 @@ impl BufferDeviceAddress {
#[inline]
pub unsafe fn get_buffer_device_address(
&self,
info: &vk::BufferDeviceAddressInfoKHR,
info: &vk::BufferDeviceAddressInfoKHR<'_>,
) -> vk::DeviceAddress {
(self.fp.get_buffer_device_address_khr)(self.handle, info)
}
@ -31,7 +31,7 @@ impl BufferDeviceAddress {
#[inline]
pub unsafe fn get_buffer_opaque_capture_address(
&self,
info: &vk::BufferDeviceAddressInfoKHR,
info: &vk::BufferDeviceAddressInfoKHR<'_>,
) -> u64 {
(self.fp.get_buffer_opaque_capture_address_khr)(self.handle, info)
}
@ -40,7 +40,7 @@ impl BufferDeviceAddress {
#[inline]
pub unsafe fn get_device_memory_opaque_capture_address(
&self,
info: &vk::DeviceMemoryOpaqueCaptureAddressInfoKHR,
info: &vk::DeviceMemoryOpaqueCaptureAddressInfoKHR<'_>,
) -> u64 {
(self.fp.get_device_memory_opaque_capture_address_khr)(self.handle, info)
}

View file

@ -24,7 +24,7 @@ impl CooperativeMatrix {
pub unsafe fn get_physical_device_cooperative_matrix_properties(
&self,
physical_device: vk::PhysicalDevice,
) -> VkResult<Vec<vk::CooperativeMatrixPropertiesKHR>> {
) -> VkResult<Vec<vk::CooperativeMatrixPropertiesKHR<'_>>> {
read_into_defaulted_vector(|count, data| {
(self
.fp

View file

@ -22,7 +22,7 @@ impl CopyCommands2 {
pub unsafe fn cmd_copy_buffer2(
&self,
command_buffer: vk::CommandBuffer,
copy_buffer_info: &vk::CopyBufferInfo2KHR,
copy_buffer_info: &vk::CopyBufferInfo2KHR<'_>,
) {
(self.fp.cmd_copy_buffer2_khr)(command_buffer, copy_buffer_info)
}
@ -31,7 +31,7 @@ impl CopyCommands2 {
pub unsafe fn cmd_copy_image2(
&self,
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)
}
@ -40,7 +40,7 @@ impl CopyCommands2 {
pub unsafe fn cmd_copy_buffer_to_image2(
&self,
command_buffer: vk::CommandBuffer,
copy_buffer_to_image_info: &vk::CopyBufferToImageInfo2KHR,
copy_buffer_to_image_info: &vk::CopyBufferToImageInfo2KHR<'_>,
) {
(self.fp.cmd_copy_buffer_to_image2_khr)(command_buffer, copy_buffer_to_image_info)
}
@ -49,7 +49,7 @@ impl CopyCommands2 {
pub unsafe fn cmd_copy_image_to_buffer2(
&self,
command_buffer: vk::CommandBuffer,
copy_image_to_buffer_info: &vk::CopyImageToBufferInfo2KHR,
copy_image_to_buffer_info: &vk::CopyImageToBufferInfo2KHR<'_>,
) {
(self.fp.cmd_copy_image_to_buffer2_khr)(command_buffer, copy_image_to_buffer_info)
}
@ -58,7 +58,7 @@ impl CopyCommands2 {
pub unsafe fn cmd_blit_image2(
&self,
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)
}
@ -67,7 +67,7 @@ impl CopyCommands2 {
pub unsafe fn cmd_resolve_image2(
&self,
command_buffer: vk::CommandBuffer,
resolve_image_info: &vk::ResolveImageInfo2KHR,
resolve_image_info: &vk::ResolveImageInfo2KHR<'_>,
) {
(self.fp.cmd_resolve_image2_khr)(command_buffer, resolve_image_info)
}

View file

@ -24,8 +24,8 @@ impl CreateRenderPass2 {
#[inline]
pub unsafe fn create_render_pass2(
&self,
create_info: &vk::RenderPassCreateInfo2,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
create_info: &vk::RenderPassCreateInfo2<'_>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<vk::RenderPass> {
let mut renderpass = mem::zeroed();
(self.fp.create_render_pass2_khr)(
@ -42,8 +42,8 @@ impl CreateRenderPass2 {
pub unsafe fn cmd_begin_render_pass2(
&self,
command_buffer: vk::CommandBuffer,
render_pass_begin_info: &vk::RenderPassBeginInfo,
subpass_begin_info: &vk::SubpassBeginInfo,
render_pass_begin_info: &vk::RenderPassBeginInfo<'_>,
subpass_begin_info: &vk::SubpassBeginInfo<'_>,
) {
(self.fp.cmd_begin_render_pass2_khr)(
command_buffer,
@ -57,8 +57,8 @@ impl CreateRenderPass2 {
pub unsafe fn cmd_next_subpass2(
&self,
command_buffer: vk::CommandBuffer,
subpass_begin_info: &vk::SubpassBeginInfo,
subpass_end_info: &vk::SubpassEndInfo,
subpass_begin_info: &vk::SubpassBeginInfo<'_>,
subpass_end_info: &vk::SubpassEndInfo<'_>,
) {
(self.fp.cmd_next_subpass2_khr)(command_buffer, subpass_begin_info, subpass_end_info);
}
@ -68,7 +68,7 @@ impl CreateRenderPass2 {
pub unsafe fn cmd_end_render_pass2(
&self,
command_buffer: vk::CommandBuffer,
subpass_end_info: &vk::SubpassEndInfo,
subpass_end_info: &vk::SubpassEndInfo<'_>,
) {
(self.fp.cmd_end_render_pass2_khr)(command_buffer, subpass_end_info);
}

View file

@ -24,7 +24,7 @@ impl DeferredHostOperations {
#[inline]
pub unsafe fn create_deferred_operation(
&self,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<vk::DeferredOperationKHR> {
let mut operation = mem::zeroed();
(self.fp.create_deferred_operation_khr)(
@ -49,7 +49,7 @@ impl DeferredHostOperations {
pub unsafe fn destroy_deferred_operation(
&self,
operation: vk::DeferredOperationKHR,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) {
(self.fp.destroy_deferred_operation_khr)(
self.handle,

View file

@ -77,7 +77,7 @@ impl DeviceGroup {
#[inline]
pub unsafe fn get_device_group_present_capabilities(
&self,
device_group_present_capabilities: &mut vk::DeviceGroupPresentCapabilitiesKHR,
device_group_present_capabilities: &mut vk::DeviceGroupPresentCapabilitiesKHR<'_>,
) -> VkResult<()> {
(self.fp.get_device_group_present_capabilities_khr)(
self.handle,
@ -141,7 +141,7 @@ impl DeviceGroup {
#[inline]
pub unsafe fn acquire_next_image2(
&self,
acquire_info: &vk::AcquireNextImageInfoKHR,
acquire_info: &vk::AcquireNextImageInfoKHR<'_>,
) -> VkResult<(u32, bool)> {
let mut index = 0;
let err_code = (self.fp.acquire_next_image2_khr)(self.handle, acquire_info, &mut index);

View file

@ -40,7 +40,7 @@ impl DeviceGroupCreation {
#[inline]
pub unsafe fn enumerate_physical_device_groups(
&self,
out: &mut [vk::PhysicalDeviceGroupProperties],
out: &mut [vk::PhysicalDeviceGroupProperties<'_>],
) -> VkResult<()> {
let mut count = out.len() as u32;
(self.fp.enumerate_physical_device_groups_khr)(self.handle, &mut count, out.as_mut_ptr())

View file

@ -25,7 +25,7 @@ impl Display {
pub unsafe fn get_physical_device_display_properties(
&self,
physical_device: vk::PhysicalDevice,
) -> VkResult<Vec<vk::DisplayPropertiesKHR>> {
) -> VkResult<Vec<vk::DisplayPropertiesKHR<'_>>> {
read_into_uninitialized_vector(|count, data| {
(self.fp.get_physical_device_display_properties_khr)(physical_device, count, data)
})
@ -77,8 +77,8 @@ impl Display {
&self,
physical_device: vk::PhysicalDevice,
display: vk::DisplayKHR,
create_info: &vk::DisplayModeCreateInfoKHR,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
create_info: &vk::DisplayModeCreateInfoKHR<'_>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<vk::DisplayModeKHR> {
let mut display_mode = mem::MaybeUninit::zeroed();
(self.fp.create_display_mode_khr)(
@ -113,8 +113,8 @@ impl Display {
#[inline]
pub unsafe fn create_display_plane_surface(
&self,
create_info: &vk::DisplaySurfaceCreateInfoKHR,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
create_info: &vk::DisplaySurfaceCreateInfoKHR<'_>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<vk::SurfaceKHR> {
let mut surface = mem::MaybeUninit::zeroed();
(self.fp.create_display_plane_surface_khr)(

View file

@ -24,8 +24,8 @@ impl DisplaySwapchain {
#[inline]
pub unsafe fn create_shared_swapchains(
&self,
create_infos: &[vk::SwapchainCreateInfoKHR],
allocation_callbacks: Option<&vk::AllocationCallbacks>,
create_infos: &[vk::SwapchainCreateInfoKHR<'_>],
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<Vec<vk::SwapchainKHR>> {
let mut swapchains = Vec::with_capacity(create_infos.len());
(self.fp.create_shared_swapchains_khr)(

View file

@ -21,7 +21,7 @@ impl DynamicRendering {
pub unsafe fn cmd_begin_rendering(
&self,
command_buffer: vk::CommandBuffer,
rendering_info: &vk::RenderingInfoKHR,
rendering_info: &vk::RenderingInfoKHR<'_>,
) {
(self.fp.cmd_begin_rendering_khr)(command_buffer, rendering_info)
}

View file

@ -21,13 +21,16 @@ impl ExternalFenceFd {
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkImportFenceFdKHR.html>
#[inline]
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.import_fence_fd_khr)(self.handle, import_info).result()
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetFenceFdKHR.html>
#[inline]
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;
(self.fp.get_fence_fd_khr)(self.handle, get_info, &mut fd).result_with_success(fd)
}

View file

@ -25,7 +25,7 @@ impl ExternalFenceWin32 {
#[inline]
pub unsafe fn import_fence_win32_handle(
&self,
import_info: &vk::ImportFenceWin32HandleInfoKHR,
import_info: &vk::ImportFenceWin32HandleInfoKHR<'_>,
) -> VkResult<()> {
(self.fp.import_fence_win32_handle_khr)(self.handle, import_info).result()
}
@ -34,7 +34,7 @@ impl ExternalFenceWin32 {
#[inline]
pub unsafe fn get_fence_win32_handle(
&self,
get_info: &vk::FenceGetWin32HandleInfoKHR,
get_info: &vk::FenceGetWin32HandleInfoKHR<'_>,
) -> VkResult<vk::HANDLE> {
let mut handle = MaybeUninit::uninit();
(self.fp.get_fence_win32_handle_khr)(self.handle, get_info, handle.as_mut_ptr())

View file

@ -22,7 +22,7 @@ impl ExternalMemoryFd {
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetMemoryFdKHR.html>
#[inline]
pub unsafe fn get_memory_fd(&self, get_fd_info: &vk::MemoryGetFdInfoKHR) -> VkResult<i32> {
pub unsafe fn get_memory_fd(&self, get_fd_info: &vk::MemoryGetFdInfoKHR<'_>) -> VkResult<i32> {
let mut fd = -1;
(self.fp.get_memory_fd_khr)(self.handle, get_fd_info, &mut fd).result_with_success(fd)
}
@ -33,7 +33,7 @@ impl ExternalMemoryFd {
&self,
handle_type: vk::ExternalMemoryHandleTypeFlags,
fd: i32,
memory_fd_properties: &mut vk::MemoryFdPropertiesKHR,
memory_fd_properties: &mut vk::MemoryFdPropertiesKHR<'_>,
) -> VkResult<()> {
(self.fp.get_memory_fd_properties_khr)(self.handle, handle_type, fd, memory_fd_properties)
.result()

View file

@ -25,7 +25,7 @@ impl ExternalMemoryWin32 {
#[inline]
pub unsafe fn get_memory_win32_handle(
&self,
create_info: &vk::MemoryGetWin32HandleInfoKHR,
create_info: &vk::MemoryGetWin32HandleInfoKHR<'_>,
) -> VkResult<vk::HANDLE> {
let mut handle = MaybeUninit::uninit();
(self.fp.get_memory_win32_handle_khr)(self.handle, create_info, handle.as_mut_ptr())
@ -38,7 +38,7 @@ impl ExternalMemoryWin32 {
&self,
handle_type: vk::ExternalMemoryHandleTypeFlags,
handle: vk::HANDLE,
memory_win32_handle_properties: &mut vk::MemoryWin32HandlePropertiesKHR,
memory_win32_handle_properties: &mut vk::MemoryWin32HandlePropertiesKHR<'_>,
) -> VkResult<()> {
(self.fp.get_memory_win32_handle_properties_khr)(
self.handle,

View file

@ -23,14 +23,17 @@ impl ExternalSemaphoreFd {
#[inline]
pub unsafe fn import_semaphore_fd(
&self,
import_info: &vk::ImportSemaphoreFdInfoKHR,
import_info: &vk::ImportSemaphoreFdInfoKHR<'_>,
) -> VkResult<()> {
(self.fp.import_semaphore_fd_khr)(self.handle, import_info).result()
}
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetSemaphoreFdKHR.html>
#[inline]
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;
(self.fp.get_semaphore_fd_khr)(self.handle, get_info, &mut fd).result_with_success(fd)
}

View file

@ -25,7 +25,7 @@ impl ExternalSemaphoreWin32 {
#[inline]
pub unsafe fn import_semaphore_win32_handle(
&self,
import_info: &vk::ImportSemaphoreWin32HandleInfoKHR,
import_info: &vk::ImportSemaphoreWin32HandleInfoKHR<'_>,
) -> VkResult<()> {
(self.fp.import_semaphore_win32_handle_khr)(self.handle, import_info).result()
}
@ -34,7 +34,7 @@ impl ExternalSemaphoreWin32 {
#[inline]
pub unsafe fn get_semaphore_win32_handle(
&self,
get_info: &vk::SemaphoreGetWin32HandleInfoKHR,
get_info: &vk::SemaphoreGetWin32HandleInfoKHR<'_>,
) -> VkResult<vk::HANDLE> {
let mut handle = MaybeUninit::uninit();
(self.fp.get_semaphore_win32_handle_khr)(self.handle, get_info, handle.as_mut_ptr())

View file

@ -23,8 +23,8 @@ impl GetMemoryRequirements2 {
#[inline]
pub unsafe fn get_buffer_memory_requirements2(
&self,
info: &vk::BufferMemoryRequirementsInfo2KHR,
memory_requirements: &mut vk::MemoryRequirements2KHR,
info: &vk::BufferMemoryRequirementsInfo2KHR<'_>,
memory_requirements: &mut vk::MemoryRequirements2KHR<'_>,
) {
(self.fp.get_buffer_memory_requirements2_khr)(self.handle, info, memory_requirements);
}
@ -33,8 +33,8 @@ impl GetMemoryRequirements2 {
#[inline]
pub unsafe fn get_image_memory_requirements2(
&self,
info: &vk::ImageMemoryRequirementsInfo2KHR,
memory_requirements: &mut vk::MemoryRequirements2KHR,
info: &vk::ImageMemoryRequirementsInfo2KHR<'_>,
memory_requirements: &mut vk::MemoryRequirements2KHR<'_>,
) {
(self.fp.get_image_memory_requirements2_khr)(self.handle, info, memory_requirements);
}
@ -43,7 +43,7 @@ impl GetMemoryRequirements2 {
#[inline]
pub unsafe fn get_image_sparse_memory_requirements2_len(
&self,
info: &vk::ImageSparseMemoryRequirementsInfo2KHR,
info: &vk::ImageSparseMemoryRequirementsInfo2KHR<'_>,
) -> usize {
let mut count = 0;
(self.fp.get_image_sparse_memory_requirements2_khr)(
@ -62,8 +62,8 @@ impl GetMemoryRequirements2 {
#[inline]
pub unsafe fn get_image_sparse_memory_requirements2(
&self,
info: &vk::ImageSparseMemoryRequirementsInfo2KHR,
out: &mut [vk::SparseImageMemoryRequirements2KHR],
info: &vk::ImageSparseMemoryRequirementsInfo2KHR<'_>,
out: &mut [vk::SparseImageMemoryRequirements2KHR<'_>],
) {
let mut count = out.len() as u32;
(self.fp.get_image_sparse_memory_requirements2_khr)(

View file

@ -23,7 +23,7 @@ impl GetPhysicalDeviceProperties2 {
pub unsafe fn get_physical_device_features2(
&self,
physical_device: vk::PhysicalDevice,
features: &mut vk::PhysicalDeviceFeatures2KHR,
features: &mut vk::PhysicalDeviceFeatures2KHR<'_>,
) {
(self.fp.get_physical_device_features2_khr)(physical_device, features);
}
@ -34,7 +34,7 @@ impl GetPhysicalDeviceProperties2 {
&self,
physical_device: vk::PhysicalDevice,
format: vk::Format,
format_properties: &mut vk::FormatProperties2KHR,
format_properties: &mut vk::FormatProperties2KHR<'_>,
) {
(self.fp.get_physical_device_format_properties2_khr)(
physical_device,
@ -48,8 +48,8 @@ impl GetPhysicalDeviceProperties2 {
pub unsafe fn get_physical_device_image_format_properties2(
&self,
physical_device: vk::PhysicalDevice,
image_format_info: &vk::PhysicalDeviceImageFormatInfo2KHR,
image_format_properties: &mut vk::ImageFormatProperties2KHR,
image_format_info: &vk::PhysicalDeviceImageFormatInfo2KHR<'_>,
image_format_properties: &mut vk::ImageFormatProperties2KHR<'_>,
) -> VkResult<()> {
(self.fp.get_physical_device_image_format_properties2_khr)(
physical_device,
@ -64,7 +64,7 @@ impl GetPhysicalDeviceProperties2 {
pub unsafe fn get_physical_device_memory_properties2(
&self,
physical_device: vk::PhysicalDevice,
memory_properties: &mut vk::PhysicalDeviceMemoryProperties2KHR,
memory_properties: &mut vk::PhysicalDeviceMemoryProperties2KHR<'_>,
) {
(self.fp.get_physical_device_memory_properties2_khr)(physical_device, memory_properties);
}
@ -74,7 +74,7 @@ impl GetPhysicalDeviceProperties2 {
pub unsafe fn get_physical_device_properties2(
&self,
physical_device: vk::PhysicalDevice,
properties: &mut vk::PhysicalDeviceProperties2KHR,
properties: &mut vk::PhysicalDeviceProperties2KHR<'_>,
) {
(self.fp.get_physical_device_properties2_khr)(physical_device, properties);
}
@ -102,7 +102,7 @@ impl GetPhysicalDeviceProperties2 {
pub unsafe fn get_physical_device_queue_family_properties2(
&self,
physical_device: vk::PhysicalDevice,
out: &mut [vk::QueueFamilyProperties2KHR],
out: &mut [vk::QueueFamilyProperties2KHR<'_>],
) {
let mut count = out.len() as u32;
(self.fp.get_physical_device_queue_family_properties2_khr)(
@ -118,7 +118,7 @@ impl GetPhysicalDeviceProperties2 {
pub unsafe fn get_physical_device_sparse_image_format_properties2_len(
&self,
physical_device: vk::PhysicalDevice,
format_info: &vk::PhysicalDeviceSparseImageFormatInfo2KHR,
format_info: &vk::PhysicalDeviceSparseImageFormatInfo2KHR<'_>,
) -> usize {
let mut count = 0;
(self
@ -140,8 +140,8 @@ impl GetPhysicalDeviceProperties2 {
pub unsafe fn get_physical_device_sparse_image_format_properties2(
&self,
physical_device: vk::PhysicalDevice,
format_info: &vk::PhysicalDeviceSparseImageFormatInfo2KHR,
out: &mut [vk::SparseImageFormatProperties2KHR],
format_info: &vk::PhysicalDeviceSparseImageFormatInfo2KHR<'_>,
out: &mut [vk::SparseImageFormatProperties2KHR<'_>],
) {
let mut count = out.len() as u32;
(self

View file

@ -23,8 +23,8 @@ impl GetSurfaceCapabilities2 {
pub unsafe fn get_physical_device_surface_capabilities2(
&self,
physical_device: vk::PhysicalDevice,
surface_info: &vk::PhysicalDeviceSurfaceInfo2KHR,
surface_capabilities: &mut vk::SurfaceCapabilities2KHR,
surface_info: &vk::PhysicalDeviceSurfaceInfo2KHR<'_>,
surface_capabilities: &mut vk::SurfaceCapabilities2KHR<'_>,
) -> VkResult<()> {
(self.fp.get_physical_device_surface_capabilities2_khr)(
physical_device,
@ -39,7 +39,7 @@ impl GetSurfaceCapabilities2 {
pub unsafe fn get_physical_device_surface_formats2_len(
&self,
physical_device: vk::PhysicalDevice,
surface_info: &vk::PhysicalDeviceSurfaceInfo2KHR,
surface_info: &vk::PhysicalDeviceSurfaceInfo2KHR<'_>,
) -> VkResult<usize> {
let mut count = 0;
let err_code = (self.fp.get_physical_device_surface_formats2_khr)(
@ -59,8 +59,8 @@ impl GetSurfaceCapabilities2 {
pub unsafe fn get_physical_device_surface_formats2(
&self,
physical_device: vk::PhysicalDevice,
surface_info: &vk::PhysicalDeviceSurfaceInfo2KHR,
out: &mut [vk::SurfaceFormat2KHR],
surface_info: &vk::PhysicalDeviceSurfaceInfo2KHR<'_>,
out: &mut [vk::SurfaceFormat2KHR<'_>],
) -> VkResult<()> {
let mut count = out.len() as u32;
let err_code = (self.fp.get_physical_device_surface_formats2_khr)(

View file

@ -23,8 +23,8 @@ impl Maintenance3 {
#[inline]
pub unsafe fn get_descriptor_set_layout_support(
&self,
create_info: &vk::DescriptorSetLayoutCreateInfo,
out: &mut vk::DescriptorSetLayoutSupportKHR,
create_info: &vk::DescriptorSetLayoutCreateInfo<'_>,
out: &mut vk::DescriptorSetLayoutSupportKHR<'_>,
) {
(self.fp.get_descriptor_set_layout_support_khr)(self.handle, create_info, out);
}

View file

@ -23,8 +23,8 @@ impl Maintenance4 {
#[inline]
pub unsafe fn get_device_buffer_memory_requirements(
&self,
memory_requirements: &vk::DeviceBufferMemoryRequirementsKHR,
out: &mut vk::MemoryRequirements2,
memory_requirements: &vk::DeviceBufferMemoryRequirementsKHR<'_>,
out: &mut vk::MemoryRequirements2<'_>,
) {
(self.fp.get_device_buffer_memory_requirements_khr)(self.handle, memory_requirements, out)
}
@ -33,8 +33,8 @@ impl Maintenance4 {
#[inline]
pub unsafe fn get_device_image_memory_requirements(
&self,
memory_requirements: &vk::DeviceImageMemoryRequirementsKHR,
out: &mut vk::MemoryRequirements2,
memory_requirements: &vk::DeviceImageMemoryRequirementsKHR<'_>,
out: &mut vk::MemoryRequirements2<'_>,
) {
(self.fp.get_device_image_memory_requirements_khr)(self.handle, memory_requirements, out)
}
@ -43,7 +43,7 @@ impl Maintenance4 {
#[inline]
pub unsafe fn get_device_image_sparse_memory_requirements_len(
&self,
memory_requirements: &vk::DeviceImageMemoryRequirementsKHR,
memory_requirements: &vk::DeviceImageMemoryRequirementsKHR<'_>,
) -> usize {
let mut count = 0;
(self.fp.get_device_image_sparse_memory_requirements_khr)(
@ -62,8 +62,8 @@ impl Maintenance4 {
#[inline]
pub unsafe fn get_device_image_sparse_memory_requirements(
&self,
memory_requirements: &vk::DeviceImageMemoryRequirementsKHR,
out: &mut [vk::SparseImageMemoryRequirements2],
memory_requirements: &vk::DeviceImageMemoryRequirementsKHR<'_>,
out: &mut [vk::SparseImageMemoryRequirements2<'_>],
) {
let mut count = out.len() as u32;
(self.fp.get_device_image_sparse_memory_requirements_khr)(

View file

@ -38,7 +38,7 @@ impl Maintenance5 {
#[inline]
pub unsafe fn get_rendering_area_granularity(
&self,
rendering_area_info: &vk::RenderingAreaInfoKHR,
rendering_area_info: &vk::RenderingAreaInfoKHR<'_>,
) -> vk::Extent2D {
let mut granularity = mem::zeroed();
(self.fp.get_rendering_area_granularity_khr)(
@ -53,8 +53,8 @@ impl Maintenance5 {
#[inline]
pub unsafe fn get_device_image_subresource_layout(
&self,
info: &vk::DeviceImageSubresourceInfoKHR,
layout: &mut vk::SubresourceLayout2KHR,
info: &vk::DeviceImageSubresourceInfoKHR<'_>,
layout: &mut vk::SubresourceLayout2KHR<'_>,
) {
(self.fp.get_device_image_subresource_layout_khr)(self.handle, info, layout)
}
@ -73,8 +73,8 @@ impl Maintenance5 {
pub unsafe fn get_image_subresource_layout2(
&self,
image: vk::Image,
subresource: &vk::ImageSubresource2KHR,
layout: &mut vk::SubresourceLayout2KHR,
subresource: &vk::ImageSubresource2KHR<'_>,
layout: &mut vk::SubresourceLayout2KHR<'_>,
) {
(self.fp.get_image_subresource_layout2_khr)(self.handle, image, subresource, layout)
}

View file

@ -50,8 +50,8 @@ impl PerformanceQuery {
&self,
physical_device: vk::PhysicalDevice,
queue_family_index: u32,
out_counters: &mut [vk::PerformanceCounterKHR],
out_counter_descriptions: &mut [vk::PerformanceCounterDescriptionKHR],
out_counters: &mut [vk::PerformanceCounterKHR<'_>],
out_counter_descriptions: &mut [vk::PerformanceCounterDescriptionKHR<'_>],
) -> VkResult<()> {
assert_eq!(out_counters.len(), out_counter_descriptions.len());
let mut count = out_counters.len() as u32;
@ -75,7 +75,7 @@ impl PerformanceQuery {
pub unsafe fn get_physical_device_queue_family_performance_query_passes(
&self,
physical_device: vk::PhysicalDevice,
performance_query_create_info: &vk::QueryPoolPerformanceCreateInfoKHR,
performance_query_create_info: &vk::QueryPoolPerformanceCreateInfoKHR<'_>,
) -> u32 {
let mut num_passes = 0;
(self
@ -93,7 +93,7 @@ impl PerformanceQuery {
pub unsafe fn acquire_profiling_lock(
&self,
device: vk::Device,
info: &vk::AcquireProfilingLockInfoKHR,
info: &vk::AcquireProfilingLockInfoKHR<'_>,
) -> VkResult<()> {
(self.fp.acquire_profiling_lock_khr)(device, info).result()
}

View file

@ -23,8 +23,8 @@ impl PipelineExecutableProperties {
#[inline]
pub unsafe fn get_pipeline_executable_internal_representations(
&self,
executable_info: &vk::PipelineExecutableInfoKHR,
) -> VkResult<Vec<vk::PipelineExecutableInternalRepresentationKHR>> {
executable_info: &vk::PipelineExecutableInfoKHR<'_>,
) -> VkResult<Vec<vk::PipelineExecutableInternalRepresentationKHR<'_>>> {
read_into_defaulted_vector(|count, data| {
(self.fp.get_pipeline_executable_internal_representations_khr)(
self.handle,
@ -39,8 +39,8 @@ impl PipelineExecutableProperties {
#[inline]
pub unsafe fn get_pipeline_executable_properties(
&self,
pipeline_info: &vk::PipelineInfoKHR,
) -> VkResult<Vec<vk::PipelineExecutablePropertiesKHR>> {
pipeline_info: &vk::PipelineInfoKHR<'_>,
) -> VkResult<Vec<vk::PipelineExecutablePropertiesKHR<'_>>> {
read_into_defaulted_vector(|count, data| {
(self.fp.get_pipeline_executable_properties_khr)(
self.handle,
@ -55,8 +55,8 @@ impl PipelineExecutableProperties {
#[inline]
pub unsafe fn get_pipeline_executable_statistics(
&self,
executable_info: &vk::PipelineExecutableInfoKHR,
) -> VkResult<Vec<vk::PipelineExecutableStatisticKHR>> {
executable_info: &vk::PipelineExecutableInfoKHR<'_>,
) -> VkResult<Vec<vk::PipelineExecutableStatisticKHR<'_>>> {
read_into_defaulted_vector(|count, data| {
(self.fp.get_pipeline_executable_statistics_khr)(
self.handle,

View file

@ -25,7 +25,7 @@ impl PushDescriptor {
pipeline_bind_point: vk::PipelineBindPoint,
layout: vk::PipelineLayout,
set: u32,
descriptor_writes: &[vk::WriteDescriptorSet],
descriptor_writes: &[vk::WriteDescriptorSet<'_>],
) {
(self.fp.cmd_push_descriptor_set_khr)(
command_buffer,

View file

@ -51,8 +51,8 @@ impl RayTracingPipeline {
&self,
deferred_operation: vk::DeferredOperationKHR,
pipeline_cache: vk::PipelineCache,
create_info: &[vk::RayTracingPipelineCreateInfoKHR],
allocation_callbacks: Option<&vk::AllocationCallbacks>,
create_info: &[vk::RayTracingPipelineCreateInfoKHR<'_>],
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<Vec<vk::Pipeline>> {
let mut pipelines = vec![mem::zeroed(); create_info.len()];
(self.fp.create_ray_tracing_pipelines_khr)(

View file

@ -25,8 +25,8 @@ impl SamplerYcbcrConversion {
#[inline]
pub unsafe fn create_sampler_ycbcr_conversion(
&self,
create_info: &vk::SamplerYcbcrConversionCreateInfo,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
create_info: &vk::SamplerYcbcrConversionCreateInfo<'_>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<vk::SamplerYcbcrConversion> {
let mut ycbcr_conversion = mem::zeroed();
(self.fp.create_sampler_ycbcr_conversion_khr)(
@ -43,7 +43,7 @@ impl SamplerYcbcrConversion {
pub unsafe fn destroy_sampler_ycbcr_conversion(
&self,
ycbcr_conversion: vk::SamplerYcbcrConversion,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) {
(self.fp.destroy_sampler_ycbcr_conversion_khr)(
self.handle,

View file

@ -88,7 +88,7 @@ impl Surface {
pub unsafe fn destroy_surface(
&self,
surface: vk::SurfaceKHR,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) {
(self.fp.destroy_surface_khr)(self.handle, surface, allocation_callbacks.as_raw_ptr());
}

View file

@ -26,8 +26,8 @@ impl Swapchain {
#[inline]
pub unsafe fn create_swapchain(
&self,
create_info: &vk::SwapchainCreateInfoKHR,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
create_info: &vk::SwapchainCreateInfoKHR<'_>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<vk::SwapchainKHR> {
let mut swapchain = mem::zeroed();
(self.fp.create_swapchain_khr)(
@ -44,7 +44,7 @@ impl Swapchain {
pub unsafe fn destroy_swapchain(
&self,
swapchain: vk::SwapchainKHR,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) {
(self.fp.destroy_swapchain_khr)(self.handle, swapchain, allocation_callbacks.as_raw_ptr());
}
@ -94,7 +94,7 @@ impl Swapchain {
pub unsafe fn queue_present(
&self,
queue: vk::Queue,
present_info: &vk::PresentInfoKHR,
present_info: &vk::PresentInfoKHR<'_>,
) -> VkResult<bool> {
let err_code = (self.fp.queue_present_khr)(queue, present_info);
match err_code {
@ -116,7 +116,7 @@ impl Swapchain {
#[inline]
pub unsafe fn get_device_group_present_capabilities(
&self,
device_group_present_capabilities: &mut vk::DeviceGroupPresentCapabilitiesKHR,
device_group_present_capabilities: &mut vk::DeviceGroupPresentCapabilitiesKHR<'_>,
) -> VkResult<()> {
(self.fp.get_device_group_present_capabilities_khr)(
self.handle,
@ -183,7 +183,7 @@ impl Swapchain {
#[inline]
pub unsafe fn acquire_next_image2(
&self,
acquire_info: &vk::AcquireNextImageInfoKHR,
acquire_info: &vk::AcquireNextImageInfoKHR<'_>,
) -> VkResult<(u32, bool)> {
let mut index = 0;
let err_code = (self.fp.acquire_next_image2_khr)(self.handle, acquire_info, &mut index);

View file

@ -22,7 +22,7 @@ impl Synchronization2 {
pub unsafe fn cmd_pipeline_barrier2(
&self,
command_buffer: vk::CommandBuffer,
dependency_info: &vk::DependencyInfoKHR,
dependency_info: &vk::DependencyInfoKHR<'_>,
) {
(self.fp.cmd_pipeline_barrier2_khr)(command_buffer, dependency_info)
}
@ -44,7 +44,7 @@ impl Synchronization2 {
&self,
command_buffer: vk::CommandBuffer,
event: vk::Event,
dependency_info: &vk::DependencyInfoKHR,
dependency_info: &vk::DependencyInfoKHR<'_>,
) {
(self.fp.cmd_set_event2_khr)(command_buffer, event, dependency_info)
}
@ -55,7 +55,7 @@ impl Synchronization2 {
&self,
command_buffer: vk::CommandBuffer,
events: &[vk::Event],
dependency_infos: &[vk::DependencyInfoKHR],
dependency_infos: &[vk::DependencyInfoKHR<'_>],
) {
assert_eq!(events.len(), dependency_infos.len());
(self.fp.cmd_wait_events2_khr)(
@ -83,7 +83,7 @@ impl Synchronization2 {
pub unsafe fn queue_submit2(
&self,
queue: vk::Queue,
submits: &[vk::SubmitInfo2KHR],
submits: &[vk::SubmitInfo2KHR<'_>],
fence: vk::Fence,
) -> VkResult<()> {
(self.fp.queue_submit2_khr)(queue, submits.len() as u32, submits.as_ptr(), fence).result()

View file

@ -31,7 +31,7 @@ impl TimelineSemaphore {
#[inline]
pub unsafe fn wait_semaphores(
&self,
wait_info: &vk::SemaphoreWaitInfo,
wait_info: &vk::SemaphoreWaitInfo<'_>,
timeout: u64,
) -> VkResult<()> {
(self.fp.wait_semaphores_khr)(self.handle, wait_info, timeout).result()
@ -39,7 +39,10 @@ impl TimelineSemaphore {
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkSignalSemaphore.html>
#[inline]
pub unsafe fn signal_semaphore(&self, signal_info: &vk::SemaphoreSignalInfo) -> VkResult<()> {
pub unsafe fn signal_semaphore(
&self,
signal_info: &vk::SemaphoreSignalInfo<'_>,
) -> VkResult<()> {
(self.fp.signal_semaphore_khr)(self.handle, signal_info).result()
}

View file

@ -24,8 +24,8 @@ impl WaylandSurface {
#[inline]
pub unsafe fn create_wayland_surface(
&self,
create_info: &vk::WaylandSurfaceCreateInfoKHR,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
create_info: &vk::WaylandSurfaceCreateInfoKHR<'_>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<vk::SurfaceKHR> {
let mut surface = mem::zeroed();
(self.fp.create_wayland_surface_khr)(

View file

@ -24,8 +24,8 @@ impl Win32Surface {
#[inline]
pub unsafe fn create_win32_surface(
&self,
create_info: &vk::Win32SurfaceCreateInfoKHR,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
create_info: &vk::Win32SurfaceCreateInfoKHR<'_>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<vk::SurfaceKHR> {
let mut surface = mem::zeroed();
(self.fp.create_win32_surface_khr)(

View file

@ -24,8 +24,8 @@ impl XcbSurface {
#[inline]
pub unsafe fn create_xcb_surface(
&self,
create_info: &vk::XcbSurfaceCreateInfoKHR,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
create_info: &vk::XcbSurfaceCreateInfoKHR<'_>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<vk::SurfaceKHR> {
let mut surface = mem::zeroed();
(self.fp.create_xcb_surface_khr)(

View file

@ -24,8 +24,8 @@ impl XlibSurface {
#[inline]
pub unsafe fn create_xlib_surface(
&self,
create_info: &vk::XlibSurfaceCreateInfoKHR,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
create_info: &vk::XlibSurfaceCreateInfoKHR<'_>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<vk::SurfaceKHR> {
let mut surface = mem::zeroed();
(self.fp.create_xlib_surface_khr)(

View file

@ -24,8 +24,8 @@ impl IOSSurface {
#[inline]
pub unsafe fn create_ios_surface(
&self,
create_info: &vk::IOSSurfaceCreateInfoMVK,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
create_info: &vk::IOSSurfaceCreateInfoMVK<'_>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<vk::SurfaceKHR> {
let mut surface = mem::zeroed();
(self.fp.create_ios_surface_mvk)(

View file

@ -24,8 +24,8 @@ impl MacOSSurface {
#[inline]
pub unsafe fn create_mac_os_surface(
&self,
create_info: &vk::MacOSSurfaceCreateInfoMVK,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
create_info: &vk::MacOSSurfaceCreateInfoMVK<'_>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<vk::SurfaceKHR> {
let mut surface = mem::zeroed();
(self.fp.create_mac_os_surface_mvk)(

View file

@ -24,8 +24,8 @@ impl ViSurface {
#[inline]
pub unsafe fn create_vi_surface(
&self,
create_info: &vk::ViSurfaceCreateInfoNN,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
create_info: &vk::ViSurfaceCreateInfoNN<'_>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<vk::SurfaceKHR> {
let mut surface = mem::zeroed();
(self.fp.create_vi_surface_nn)(

View file

@ -43,7 +43,7 @@ impl CoverageReductionMode {
pub unsafe fn get_physical_device_supported_framebuffer_mixed_samples_combinations(
&self,
physical_device: vk::PhysicalDevice,
out: &mut [vk::FramebufferMixedSamplesCombinationNV],
out: &mut [vk::FramebufferMixedSamplesCombinationNV<'_>],
) -> VkResult<()> {
let mut count = out.len() as u32;
(self

View file

@ -44,7 +44,7 @@ impl DeviceDiagnosticCheckpoints {
pub unsafe fn get_queue_checkpoint_data(
&self,
queue: vk::Queue,
out: &mut [vk::CheckpointDataNV],
out: &mut [vk::CheckpointDataNV<'_>],
) {
let mut count = out.len() as u32;
(self.fp.get_queue_checkpoint_data_nv)(queue, &mut count, out.as_mut_ptr());

View file

@ -23,8 +23,8 @@ impl DeviceGeneratedCommandsCompute {
#[inline]
pub unsafe fn get_pipeline_indirect_memory_requirements(
&self,
create_info: &vk::ComputePipelineCreateInfo,
memory_requirements: &mut vk::MemoryRequirements2,
create_info: &vk::ComputePipelineCreateInfo<'_>,
memory_requirements: &mut vk::MemoryRequirements2<'_>,
) {
(self.fp.get_pipeline_indirect_memory_requirements_nv)(
self.handle,
@ -52,7 +52,7 @@ impl DeviceGeneratedCommandsCompute {
#[inline]
pub unsafe fn get_pipeline_indirect_device_address(
&self,
info: &vk::PipelineIndirectDeviceAddressInfoNV,
info: &vk::PipelineIndirectDeviceAddressInfoNV<'_>,
) -> vk::DeviceAddress {
(self.fp.get_pipeline_indirect_device_address_nv)(self.handle, info)
}

View file

@ -24,8 +24,8 @@ impl RayTracing {
#[inline]
pub unsafe fn create_acceleration_structure(
&self,
create_info: &vk::AccelerationStructureCreateInfoNV,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
create_info: &vk::AccelerationStructureCreateInfoNV<'_>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<vk::AccelerationStructureNV> {
let mut accel_struct = mem::zeroed();
(self.fp.create_acceleration_structure_nv)(
@ -42,7 +42,7 @@ impl RayTracing {
pub unsafe fn destroy_acceleration_structure(
&self,
accel_struct: vk::AccelerationStructureNV,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) {
(self.fp.destroy_acceleration_structure_nv)(
self.handle,
@ -55,8 +55,8 @@ impl RayTracing {
#[inline]
pub unsafe fn get_acceleration_structure_memory_requirements(
&self,
info: &vk::AccelerationStructureMemoryRequirementsInfoNV,
) -> vk::MemoryRequirements2KHR {
info: &vk::AccelerationStructureMemoryRequirementsInfoNV<'_>,
) -> vk::MemoryRequirements2KHR<'_> {
let mut requirements = Default::default();
(self.fp.get_acceleration_structure_memory_requirements_nv)(
self.handle,
@ -70,7 +70,7 @@ impl RayTracing {
#[inline]
pub unsafe fn bind_acceleration_structure_memory(
&self,
bind_info: &[vk::BindAccelerationStructureMemoryInfoNV],
bind_info: &[vk::BindAccelerationStructureMemoryInfoNV<'_>],
) -> VkResult<()> {
(self.fp.bind_acceleration_structure_memory_nv)(
self.handle,
@ -85,7 +85,7 @@ impl RayTracing {
pub unsafe fn cmd_build_acceleration_structure(
&self,
command_buffer: vk::CommandBuffer,
info: &vk::AccelerationStructureInfoNV,
info: &vk::AccelerationStructureInfoNV<'_>,
instance_data: vk::Buffer,
instance_offset: vk::DeviceSize,
update: bool,
@ -163,8 +163,8 @@ impl RayTracing {
pub unsafe fn create_ray_tracing_pipelines(
&self,
pipeline_cache: vk::PipelineCache,
create_info: &[vk::RayTracingPipelineCreateInfoNV],
allocation_callbacks: Option<&vk::AllocationCallbacks>,
create_info: &[vk::RayTracingPipelineCreateInfoNV<'_>],
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<Vec<vk::Pipeline>> {
let mut pipelines = vec![mem::zeroed(); create_info.len()];
(self.fp.create_ray_tracing_pipelines_nv)(

View file

@ -84,7 +84,7 @@ impl Instance {
pub unsafe fn get_physical_device_tool_properties(
&self,
physical_device: vk::PhysicalDevice,
out: &mut [vk::PhysicalDeviceToolProperties],
out: &mut [vk::PhysicalDeviceToolProperties<'_>],
) -> VkResult<()> {
let mut count = out.len() as u32;
(self.instance_fn_1_3.get_physical_device_tool_properties)(
@ -124,7 +124,7 @@ impl Instance {
#[inline]
pub unsafe fn enumerate_physical_device_groups(
&self,
out: &mut [vk::PhysicalDeviceGroupProperties],
out: &mut [vk::PhysicalDeviceGroupProperties<'_>],
) -> VkResult<()> {
let mut count = out.len() as u32;
(self.instance_fn_1_1.enumerate_physical_device_groups)(
@ -142,7 +142,7 @@ impl Instance {
pub unsafe fn get_physical_device_features2(
&self,
physical_device: vk::PhysicalDevice,
features: &mut vk::PhysicalDeviceFeatures2,
features: &mut vk::PhysicalDeviceFeatures2<'_>,
) {
(self.instance_fn_1_1.get_physical_device_features2)(physical_device, features);
}
@ -152,7 +152,7 @@ impl Instance {
pub unsafe fn get_physical_device_properties2(
&self,
physical_device: vk::PhysicalDevice,
prop: &mut vk::PhysicalDeviceProperties2,
prop: &mut vk::PhysicalDeviceProperties2<'_>,
) {
(self.instance_fn_1_1.get_physical_device_properties2)(physical_device, prop);
}
@ -163,7 +163,7 @@ impl Instance {
&self,
physical_device: vk::PhysicalDevice,
format: vk::Format,
out: &mut vk::FormatProperties2,
out: &mut vk::FormatProperties2<'_>,
) {
(self.instance_fn_1_1.get_physical_device_format_properties2)(physical_device, format, out);
}
@ -173,8 +173,8 @@ impl Instance {
pub unsafe fn get_physical_device_image_format_properties2(
&self,
physical_device: vk::PhysicalDevice,
format_info: &vk::PhysicalDeviceImageFormatInfo2,
image_format_prop: &mut vk::ImageFormatProperties2,
format_info: &vk::PhysicalDeviceImageFormatInfo2<'_>,
image_format_prop: &mut vk::ImageFormatProperties2<'_>,
) -> VkResult<()> {
(self
.instance_fn_1_1
@ -211,7 +211,7 @@ impl Instance {
pub unsafe fn get_physical_device_queue_family_properties2(
&self,
physical_device: vk::PhysicalDevice,
out: &mut [vk::QueueFamilyProperties2],
out: &mut [vk::QueueFamilyProperties2<'_>],
) {
let mut count = out.len() as u32;
(self
@ -229,7 +229,7 @@ impl Instance {
pub unsafe fn get_physical_device_memory_properties2(
&self,
physical_device: vk::PhysicalDevice,
out: &mut vk::PhysicalDeviceMemoryProperties2,
out: &mut vk::PhysicalDeviceMemoryProperties2<'_>,
) {
(self.instance_fn_1_1.get_physical_device_memory_properties2)(physical_device, out);
}
@ -239,7 +239,7 @@ impl Instance {
pub unsafe fn get_physical_device_sparse_image_format_properties2_len(
&self,
physical_device: vk::PhysicalDevice,
format_info: &vk::PhysicalDeviceSparseImageFormatInfo2,
format_info: &vk::PhysicalDeviceSparseImageFormatInfo2<'_>,
) -> usize {
let mut format_count = 0;
(self
@ -261,8 +261,8 @@ impl Instance {
pub unsafe fn get_physical_device_sparse_image_format_properties2(
&self,
physical_device: vk::PhysicalDevice,
format_info: &vk::PhysicalDeviceSparseImageFormatInfo2,
out: &mut [vk::SparseImageFormatProperties2],
format_info: &vk::PhysicalDeviceSparseImageFormatInfo2<'_>,
out: &mut [vk::SparseImageFormatProperties2<'_>],
) {
let mut count = out.len() as u32;
(self
@ -281,8 +281,8 @@ impl Instance {
pub unsafe fn get_physical_device_external_buffer_properties(
&self,
physical_device: vk::PhysicalDevice,
external_buffer_info: &vk::PhysicalDeviceExternalBufferInfo,
out: &mut vk::ExternalBufferProperties,
external_buffer_info: &vk::PhysicalDeviceExternalBufferInfo<'_>,
out: &mut vk::ExternalBufferProperties<'_>,
) {
(self
.instance_fn_1_1
@ -298,8 +298,8 @@ impl Instance {
pub unsafe fn get_physical_device_external_fence_properties(
&self,
physical_device: vk::PhysicalDevice,
external_fence_info: &vk::PhysicalDeviceExternalFenceInfo,
out: &mut vk::ExternalFenceProperties,
external_fence_info: &vk::PhysicalDeviceExternalFenceInfo<'_>,
out: &mut vk::ExternalFenceProperties<'_>,
) {
(self
.instance_fn_1_1
@ -315,8 +315,8 @@ impl Instance {
pub unsafe fn get_physical_device_external_semaphore_properties(
&self,
physical_device: vk::PhysicalDevice,
external_semaphore_info: &vk::PhysicalDeviceExternalSemaphoreInfo,
out: &mut vk::ExternalSemaphoreProperties,
external_semaphore_info: &vk::PhysicalDeviceExternalSemaphoreInfo<'_>,
out: &mut vk::ExternalSemaphoreProperties<'_>,
) {
(self
.instance_fn_1_1
@ -353,8 +353,8 @@ impl Instance {
pub unsafe fn create_device(
&self,
physical_device: vk::PhysicalDevice,
create_info: &vk::DeviceCreateInfo,
allocation_callbacks: Option<&vk::AllocationCallbacks>,
create_info: &vk::DeviceCreateInfo<'_>,
allocation_callbacks: Option<&vk::AllocationCallbacks<'_>>,
) -> VkResult<Device> {
let mut device = mem::zeroed();
(self.instance_fn_1_0.create_device)(
@ -379,7 +379,10 @@ impl Instance {
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkDestroyInstance.html>
#[inline]
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.destroy_instance)(self.handle(), allocation_callbacks.as_raw_ptr());
}

View file

@ -1,5 +1,11 @@
#![deny(clippy::use_self)]
#![warn(trivial_casts, trivial_numeric_casts)]
#![warn(
clippy::use_self,
deprecated_in_future,
rust_2018_idioms,
trivial_casts,
trivial_numeric_casts,
unused_qualifications
)]
#![allow(
clippy::too_many_arguments,
clippy::missing_safety_doc,
@ -187,7 +193,7 @@ mod tests {
let mut device_create_info = vk::DeviceCreateInfo::default()
.push_next(&mut corner)
.push_next(&mut variable_pointers);
let chain2: Vec<*mut vk::BaseOutStructure> = unsafe {
let chain2: Vec<*mut vk::BaseOutStructure<'_>> = unsafe {
vk::ptr_chain_iter(&mut device_create_info)
.skip(1)
.collect()

View file

@ -93,7 +93,7 @@ where
#[cfg(feature = "debug")]
pub(crate) fn debug_flags<Value: Into<u64> + Copy>(
f: &mut fmt::Formatter,
f: &mut fmt::Formatter<'_>,
known: &[(Value, &'static str)],
value: Value,
) -> fmt::Result {

View file

@ -21,7 +21,7 @@ pub struct Align<T> {
}
#[derive(Debug)]
pub struct AlignIter<'a, T: 'a> {
pub struct AlignIter<'a, T> {
align: &'a mut Align<T>,
current: vk::DeviceSize,
}
@ -59,7 +59,7 @@ impl<T> Align<T> {
}
}
pub fn iter_mut(&mut self) -> AlignIter<T> {
pub fn iter_mut(&mut self) -> AlignIter<'_, T> {
AlignIter {
current: 0,
align: self,
@ -113,7 +113,7 @@ pub fn read_spv<R: io::Read + io::Seek>(x: &mut R) -> io::Result<Vec<u32>> {
"input length not divisible by 4",
));
}
if size > usize::max_value() as u64 {
if size > usize::MAX as u64 {
return Err(io::Error::new(io::ErrorKind::InvalidData, "input too long"));
}
let words = (size / 4) as usize;

View file

@ -33,8 +33,10 @@ mod platform_types;
pub use platform_types::*;
/// Iterates through the pointer chain. Includes the item that is passed into the function.
/// Stops at the last [`BaseOutStructure`] that has a null [`BaseOutStructure::p_next`] field.
pub(crate) unsafe fn ptr_chain_iter<T>(ptr: &mut T) -> impl Iterator<Item = *mut BaseOutStructure> {
let ptr = <*mut T>::cast::<BaseOutStructure>(ptr);
pub(crate) unsafe fn ptr_chain_iter<T>(
ptr: &mut T,
) -> impl Iterator<Item = *mut BaseOutStructure<'_>> {
let ptr = <*mut T>::cast::<BaseOutStructure<'_>>(ptr);
(0..).scan(ptr, |p_ptr, _| {
if p_ptr.is_null() {
return None;

File diff suppressed because it is too large Load diff

View file

@ -525,7 +525,7 @@ pub type PFN_vkDebugUtilsMessengerCallbackEXT = Option<
unsafe extern "system" fn(
message_severity: DebugUtilsMessageSeverityFlagsEXT,
message_types: DebugUtilsMessageTypeFlagsEXT,
p_callback_data: *const DebugUtilsMessengerCallbackDataEXT,
p_callback_data: *const DebugUtilsMessengerCallbackDataEXT<'_>,
p_user_data: *mut c_void,
) -> Bool32,
>;
@ -533,7 +533,7 @@ pub type PFN_vkDebugUtilsMessengerCallbackEXT = Option<
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/PFN_vkDeviceMemoryReportCallbackEXT.html>"]
pub type PFN_vkDeviceMemoryReportCallbackEXT = Option<
unsafe extern "system" fn(
p_callback_data: *const DeviceMemoryReportCallbackDataEXT,
p_callback_data: *const DeviceMemoryReportCallbackDataEXT<'_>,
p_user_data: *mut c_void,
),
>;
@ -810,7 +810,7 @@ pub struct PhysicalDeviceProperties {
}
#[cfg(feature = "debug")]
impl fmt::Debug for PhysicalDeviceProperties {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt.debug_struct("PhysicalDeviceProperties")
.field("api_version", &self.api_version)
.field("driver_version", &self.driver_version)
@ -898,7 +898,7 @@ pub struct ExtensionProperties {
}
#[cfg(feature = "debug")]
impl fmt::Debug for ExtensionProperties {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt.debug_struct("ExtensionProperties")
.field("extension_name", &unsafe {
::std::ffi::CStr::from_ptr(self.extension_name.as_ptr())
@ -939,7 +939,7 @@ pub struct LayerProperties {
}
#[cfg(feature = "debug")]
impl fmt::Debug for LayerProperties {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt.debug_struct("LayerProperties")
.field("layer_name", &unsafe {
::std::ffi::CStr::from_ptr(self.layer_name.as_ptr())
@ -1058,7 +1058,7 @@ pub struct AllocationCallbacks<'a> {
}
#[cfg(feature = "debug")]
impl fmt::Debug for AllocationCallbacks<'_> {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt.debug_struct("AllocationCallbacks")
.field("p_user_data", &self.p_user_data)
.field(
@ -1242,7 +1242,10 @@ impl<'a> DeviceCreateInfo<'a> {
self
}
#[inline]
pub fn queue_create_infos(mut self, queue_create_infos: &'a [DeviceQueueCreateInfo]) -> Self {
pub fn queue_create_infos(
mut self,
queue_create_infos: &'a [DeviceQueueCreateInfo<'a>],
) -> Self {
self.queue_create_info_count = queue_create_infos.len() as _;
self.p_queue_create_infos = queue_create_infos.as_ptr();
self
@ -2951,7 +2954,7 @@ impl<'a> BindSparseInfo<'a> {
self
}
#[inline]
pub fn buffer_binds(mut self, buffer_binds: &'a [SparseBufferMemoryBindInfo]) -> Self {
pub fn buffer_binds(mut self, buffer_binds: &'a [SparseBufferMemoryBindInfo<'a>]) -> Self {
self.buffer_bind_count = buffer_binds.len() as _;
self.p_buffer_binds = buffer_binds.as_ptr();
self
@ -2959,14 +2962,14 @@ impl<'a> BindSparseInfo<'a> {
#[inline]
pub fn image_opaque_binds(
mut self,
image_opaque_binds: &'a [SparseImageOpaqueMemoryBindInfo],
image_opaque_binds: &'a [SparseImageOpaqueMemoryBindInfo<'a>],
) -> Self {
self.image_opaque_bind_count = image_opaque_binds.len() as _;
self.p_image_opaque_binds = image_opaque_binds.as_ptr();
self
}
#[inline]
pub fn image_binds(mut self, image_binds: &'a [SparseImageMemoryBindInfo]) -> Self {
pub fn image_binds(mut self, image_binds: &'a [SparseImageMemoryBindInfo<'a>]) -> Self {
self.image_bind_count = image_binds.len() as _;
self.p_image_binds = image_binds.as_ptr();
self
@ -3371,7 +3374,7 @@ impl<'a> DescriptorSetLayoutCreateInfo<'a> {
self
}
#[inline]
pub fn bindings(mut self, bindings: &'a [DescriptorSetLayoutBinding]) -> Self {
pub fn bindings(mut self, bindings: &'a [DescriptorSetLayoutBinding<'a>]) -> Self {
self.binding_count = bindings.len() as _;
self.p_bindings = bindings.as_ptr();
self
@ -4738,7 +4741,7 @@ impl<'a> GraphicsPipelineCreateInfo<'a> {
self
}
#[inline]
pub fn stages(mut self, stages: &'a [PipelineShaderStageCreateInfo]) -> Self {
pub fn stages(mut self, stages: &'a [PipelineShaderStageCreateInfo<'a>]) -> Self {
self.stage_count = stages.len() as _;
self.p_stages = stages.as_ptr();
self
@ -5406,7 +5409,7 @@ pub struct RenderPassBeginInfo<'a> {
}
#[cfg(feature = "debug")]
impl fmt::Debug for RenderPassBeginInfo<'_> {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt.debug_struct("RenderPassBeginInfo")
.field("s_type", &self.s_type)
.field("p_next", &self.p_next)
@ -5531,7 +5534,7 @@ pub struct ClearAttachment {
}
#[cfg(feature = "debug")]
impl fmt::Debug for ClearAttachment {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt.debug_struct("ClearAttachment")
.field("aspect_mask", &self.aspect_mask)
.field("color_attachment", &self.color_attachment)
@ -5817,7 +5820,7 @@ impl<'a> RenderPassCreateInfo<'a> {
self
}
#[inline]
pub fn subpasses(mut self, subpasses: &'a [SubpassDescription]) -> Self {
pub fn subpasses(mut self, subpasses: &'a [SubpassDescription<'a>]) -> Self {
self.subpass_count = subpasses.len() as _;
self.p_subpasses = subpasses.as_ptr();
self
@ -8768,7 +8771,7 @@ pub struct DebugReportCallbackCreateInfoEXT<'a> {
}
#[cfg(feature = "debug")]
impl fmt::Debug for DebugReportCallbackCreateInfoEXT<'_> {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt.debug_struct("DebugReportCallbackCreateInfoEXT")
.field("s_type", &self.s_type)
.field("p_next", &self.p_next)
@ -9803,7 +9806,7 @@ unsafe impl<'a> TaggedStructure for GraphicsShaderGroupCreateInfoNV<'a> {
}
impl<'a> GraphicsShaderGroupCreateInfoNV<'a> {
#[inline]
pub fn stages(mut self, stages: &'a [PipelineShaderStageCreateInfo]) -> Self {
pub fn stages(mut self, stages: &'a [PipelineShaderStageCreateInfo<'a>]) -> Self {
self.stage_count = stages.len() as _;
self.p_stages = stages.as_ptr();
self
@ -9859,7 +9862,7 @@ unsafe impl<'a> TaggedStructure for GraphicsPipelineShaderGroupsCreateInfoNV<'a>
unsafe impl ExtendsGraphicsPipelineCreateInfo for GraphicsPipelineShaderGroupsCreateInfoNV<'_> {}
impl<'a> GraphicsPipelineShaderGroupsCreateInfoNV<'a> {
#[inline]
pub fn groups(mut self, groups: &'a [GraphicsShaderGroupCreateInfoNV]) -> Self {
pub fn groups(mut self, groups: &'a [GraphicsShaderGroupCreateInfoNV<'a>]) -> Self {
self.group_count = groups.len() as _;
self.p_groups = groups.as_ptr();
self
@ -10135,7 +10138,7 @@ impl<'a> IndirectCommandsLayoutCreateInfoNV<'a> {
self
}
#[inline]
pub fn tokens(mut self, tokens: &'a [IndirectCommandsLayoutTokenNV]) -> Self {
pub fn tokens(mut self, tokens: &'a [IndirectCommandsLayoutTokenNV<'a>]) -> Self {
self.token_count = tokens.len() as _;
self.p_tokens = tokens.as_ptr();
self
@ -10895,7 +10898,7 @@ pub struct PhysicalDeviceDriverProperties<'a> {
}
#[cfg(feature = "debug")]
impl fmt::Debug for PhysicalDeviceDriverProperties<'_> {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt.debug_struct("PhysicalDeviceDriverProperties")
.field("s_type", &self.s_type)
.field("p_next", &self.p_next)
@ -10979,7 +10982,7 @@ unsafe impl<'a> TaggedStructure for PresentRegionsKHR<'a> {
unsafe impl ExtendsPresentInfoKHR for PresentRegionsKHR<'_> {}
impl<'a> PresentRegionsKHR<'a> {
#[inline]
pub fn regions(mut self, regions: &'a [PresentRegionKHR]) -> Self {
pub fn regions(mut self, regions: &'a [PresentRegionKHR<'a>]) -> Self {
self.swapchain_count = regions.len() as _;
self.p_regions = regions.as_ptr();
self
@ -16504,7 +16507,7 @@ impl<'a> RenderPassSampleLocationsBeginInfoEXT<'a> {
#[inline]
pub fn attachment_initial_sample_locations(
mut self,
attachment_initial_sample_locations: &'a [AttachmentSampleLocationsEXT],
attachment_initial_sample_locations: &'a [AttachmentSampleLocationsEXT<'a>],
) -> Self {
self.attachment_initial_sample_locations_count =
attachment_initial_sample_locations.len() as _;
@ -16514,7 +16517,7 @@ impl<'a> RenderPassSampleLocationsBeginInfoEXT<'a> {
#[inline]
pub fn post_subpass_sample_locations(
mut self,
post_subpass_sample_locations: &'a [SubpassSampleLocationsEXT],
post_subpass_sample_locations: &'a [SubpassSampleLocationsEXT<'a>],
) -> Self {
self.post_subpass_sample_locations_count = post_subpass_sample_locations.len() as _;
self.p_post_subpass_sample_locations = post_subpass_sample_locations.as_ptr();
@ -18403,7 +18406,7 @@ pub struct DebugUtilsMessengerCreateInfoEXT<'a> {
}
#[cfg(feature = "debug")]
impl fmt::Debug for DebugUtilsMessengerCreateInfoEXT<'_> {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt.debug_struct("DebugUtilsMessengerCreateInfoEXT")
.field("s_type", &self.s_type)
.field("p_next", &self.p_next)
@ -18532,19 +18535,19 @@ impl<'a> DebugUtilsMessengerCallbackDataEXT<'a> {
self
}
#[inline]
pub fn queue_labels(mut self, queue_labels: &'a [DebugUtilsLabelEXT]) -> Self {
pub fn queue_labels(mut self, queue_labels: &'a [DebugUtilsLabelEXT<'a>]) -> Self {
self.queue_label_count = queue_labels.len() as _;
self.p_queue_labels = queue_labels.as_ptr();
self
}
#[inline]
pub fn cmd_buf_labels(mut self, cmd_buf_labels: &'a [DebugUtilsLabelEXT]) -> Self {
pub fn cmd_buf_labels(mut self, cmd_buf_labels: &'a [DebugUtilsLabelEXT<'a>]) -> Self {
self.cmd_buf_label_count = cmd_buf_labels.len() as _;
self.p_cmd_buf_labels = cmd_buf_labels.as_ptr();
self
}
#[inline]
pub fn objects(mut self, objects: &'a [DebugUtilsObjectNameInfoEXT]) -> Self {
pub fn objects(mut self, objects: &'a [DebugUtilsObjectNameInfoEXT<'a>]) -> Self {
self.object_count = objects.len() as _;
self.p_objects = objects.as_ptr();
self
@ -18614,7 +18617,7 @@ pub struct DeviceDeviceMemoryReportCreateInfoEXT<'a> {
}
#[cfg(feature = "debug")]
impl fmt::Debug for DeviceDeviceMemoryReportCreateInfoEXT<'_> {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt.debug_struct("DeviceDeviceMemoryReportCreateInfoEXT")
.field("s_type", &self.s_type)
.field("p_next", &self.p_next)
@ -20057,19 +20060,22 @@ impl<'a> SubpassDescription2<'a> {
self
}
#[inline]
pub fn input_attachments(mut self, input_attachments: &'a [AttachmentReference2]) -> Self {
pub fn input_attachments(mut self, input_attachments: &'a [AttachmentReference2<'a>]) -> Self {
self.input_attachment_count = input_attachments.len() as _;
self.p_input_attachments = input_attachments.as_ptr();
self
}
#[inline]
pub fn color_attachments(mut self, color_attachments: &'a [AttachmentReference2]) -> Self {
pub fn color_attachments(mut self, color_attachments: &'a [AttachmentReference2<'a>]) -> Self {
self.color_attachment_count = color_attachments.len() as _;
self.p_color_attachments = color_attachments.as_ptr();
self
}
#[inline]
pub fn resolve_attachments(mut self, resolve_attachments: &'a [AttachmentReference2]) -> Self {
pub fn resolve_attachments(
mut self,
resolve_attachments: &'a [AttachmentReference2<'a>],
) -> Self {
self.color_attachment_count = resolve_attachments.len() as _;
self.p_resolve_attachments = resolve_attachments.as_ptr();
self
@ -20246,19 +20252,19 @@ impl<'a> RenderPassCreateInfo2<'a> {
self
}
#[inline]
pub fn attachments(mut self, attachments: &'a [AttachmentDescription2]) -> Self {
pub fn attachments(mut self, attachments: &'a [AttachmentDescription2<'a>]) -> Self {
self.attachment_count = attachments.len() as _;
self.p_attachments = attachments.as_ptr();
self
}
#[inline]
pub fn subpasses(mut self, subpasses: &'a [SubpassDescription2]) -> Self {
pub fn subpasses(mut self, subpasses: &'a [SubpassDescription2<'a>]) -> Self {
self.subpass_count = subpasses.len() as _;
self.p_subpasses = subpasses.as_ptr();
self
}
#[inline]
pub fn dependencies(mut self, dependencies: &'a [SubpassDependency2]) -> Self {
pub fn dependencies(mut self, dependencies: &'a [SubpassDependency2<'a>]) -> Self {
self.dependency_count = dependencies.len() as _;
self.p_dependencies = dependencies.as_ptr();
self
@ -22546,7 +22552,7 @@ impl<'a> PipelineViewportShadingRateImageStateCreateInfoNV<'a> {
#[inline]
pub fn shading_rate_palettes(
mut self,
shading_rate_palettes: &'a [ShadingRatePaletteNV],
shading_rate_palettes: &'a [ShadingRatePaletteNV<'a>],
) -> Self {
self.viewport_count = shading_rate_palettes.len() as _;
self.p_shading_rate_palettes = shading_rate_palettes.as_ptr();
@ -22787,7 +22793,7 @@ impl<'a> PipelineViewportCoarseSampleOrderStateCreateInfoNV<'a> {
#[inline]
pub fn custom_sample_orders(
mut self,
custom_sample_orders: &'a [CoarseSampleOrderCustomNV],
custom_sample_orders: &'a [CoarseSampleOrderCustomNV<'a>],
) -> Self {
self.custom_sample_order_count = custom_sample_orders.len() as _;
self.p_custom_sample_orders = custom_sample_orders.as_ptr();
@ -23495,13 +23501,13 @@ impl<'a> RayTracingPipelineCreateInfoNV<'a> {
self
}
#[inline]
pub fn stages(mut self, stages: &'a [PipelineShaderStageCreateInfo]) -> Self {
pub fn stages(mut self, stages: &'a [PipelineShaderStageCreateInfo<'a>]) -> Self {
self.stage_count = stages.len() as _;
self.p_stages = stages.as_ptr();
self
}
#[inline]
pub fn groups(mut self, groups: &'a [RayTracingShaderGroupCreateInfoNV]) -> Self {
pub fn groups(mut self, groups: &'a [RayTracingShaderGroupCreateInfoNV<'a>]) -> Self {
self.group_count = groups.len() as _;
self.p_groups = groups.as_ptr();
self
@ -23595,13 +23601,13 @@ impl<'a> RayTracingPipelineCreateInfoKHR<'a> {
self
}
#[inline]
pub fn stages(mut self, stages: &'a [PipelineShaderStageCreateInfo]) -> Self {
pub fn stages(mut self, stages: &'a [PipelineShaderStageCreateInfo<'a>]) -> Self {
self.stage_count = stages.len() as _;
self.p_stages = stages.as_ptr();
self
}
#[inline]
pub fn groups(mut self, groups: &'a [RayTracingShaderGroupCreateInfoKHR]) -> Self {
pub fn groups(mut self, groups: &'a [RayTracingShaderGroupCreateInfoKHR<'a>]) -> Self {
self.group_count = groups.len() as _;
self.p_groups = groups.as_ptr();
self
@ -23930,7 +23936,7 @@ impl<'a> AccelerationStructureInfoNV<'a> {
self
}
#[inline]
pub fn geometries(mut self, geometries: &'a [GeometryNV]) -> Self {
pub fn geometries(mut self, geometries: &'a [GeometryNV<'a>]) -> Self {
self.geometry_count = geometries.len() as _;
self.p_geometries = geometries.as_ptr();
self
@ -26170,7 +26176,7 @@ impl<'a> FramebufferAttachmentsCreateInfo<'a> {
#[inline]
pub fn attachment_image_infos(
mut self,
attachment_image_infos: &'a [FramebufferAttachmentImageInfo],
attachment_image_infos: &'a [FramebufferAttachmentImageInfo<'a>],
) -> Self {
self.attachment_image_info_count = attachment_image_infos.len() as _;
self.p_attachment_image_infos = attachment_image_infos.as_ptr();
@ -27048,7 +27054,7 @@ pub struct PerformanceCounterDescriptionKHR<'a> {
}
#[cfg(feature = "debug")]
impl fmt::Debug for PerformanceCounterDescriptionKHR<'_> {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt.debug_struct("PerformanceCounterDescriptionKHR")
.field("s_type", &self.s_type)
.field("p_next", &self.p_next)
@ -27462,7 +27468,7 @@ pub struct PerformanceValueINTEL {
}
#[cfg(feature = "debug")]
impl fmt::Debug for PerformanceValueINTEL {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt.debug_struct("PerformanceValueINTEL")
.field("ty", &self.ty)
.field("data", &"union")
@ -28135,7 +28141,7 @@ pub struct PipelineExecutablePropertiesKHR<'a> {
}
#[cfg(feature = "debug")]
impl fmt::Debug for PipelineExecutablePropertiesKHR<'_> {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt.debug_struct("PipelineExecutablePropertiesKHR")
.field("s_type", &self.s_type)
.field("p_next", &self.p_next)
@ -28256,7 +28262,7 @@ pub struct PipelineExecutableStatisticKHR<'a> {
}
#[cfg(feature = "debug")]
impl fmt::Debug for PipelineExecutableStatisticKHR<'_> {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt.debug_struct("PipelineExecutableStatisticKHR")
.field("s_type", &self.s_type)
.field("p_next", &self.p_next)
@ -28325,7 +28331,7 @@ pub struct PipelineExecutableInternalRepresentationKHR<'a> {
}
#[cfg(feature = "debug")]
impl fmt::Debug for PipelineExecutableInternalRepresentationKHR<'_> {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt.debug_struct("PipelineExecutableInternalRepresentationKHR")
.field("s_type", &self.s_type)
.field("p_next", &self.p_next)
@ -29832,7 +29838,7 @@ pub struct PhysicalDeviceVulkan12Properties<'a> {
}
#[cfg(feature = "debug")]
impl fmt::Debug for PhysicalDeviceVulkan12Properties<'_> {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt.debug_struct("PhysicalDeviceVulkan12Properties")
.field("s_type", &self.s_type)
.field("p_next", &self.p_next)
@ -31189,7 +31195,7 @@ pub struct PhysicalDeviceToolProperties<'a> {
}
#[cfg(feature = "debug")]
impl fmt::Debug for PhysicalDeviceToolProperties<'_> {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt.debug_struct("PhysicalDeviceToolProperties")
.field("s_type", &self.s_type)
.field("p_next", &self.p_next)
@ -31266,7 +31272,7 @@ pub struct SamplerCustomBorderColorCreateInfoEXT<'a> {
}
#[cfg(feature = "debug")]
impl fmt::Debug for SamplerCustomBorderColorCreateInfoEXT<'_> {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt.debug_struct("SamplerCustomBorderColorCreateInfoEXT")
.field("s_type", &self.s_type)
.field("p_next", &self.p_next)
@ -31524,7 +31530,7 @@ pub struct AccelerationStructureGeometryTrianglesDataKHR<'a> {
}
#[cfg(feature = "debug")]
impl fmt::Debug for AccelerationStructureGeometryTrianglesDataKHR<'_> {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt.debug_struct("AccelerationStructureGeometryTrianglesDataKHR")
.field("s_type", &self.s_type)
.field("p_next", &self.p_next)
@ -31626,7 +31632,7 @@ pub struct AccelerationStructureGeometryAabbsDataKHR<'a> {
}
#[cfg(feature = "debug")]
impl fmt::Debug for AccelerationStructureGeometryAabbsDataKHR<'_> {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt.debug_struct("AccelerationStructureGeometryAabbsDataKHR")
.field("s_type", &self.s_type)
.field("p_next", &self.p_next)
@ -31675,7 +31681,7 @@ pub struct AccelerationStructureGeometryInstancesDataKHR<'a> {
}
#[cfg(feature = "debug")]
impl fmt::Debug for AccelerationStructureGeometryInstancesDataKHR<'_> {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt.debug_struct("AccelerationStructureGeometryInstancesDataKHR")
.field("s_type", &self.s_type)
.field("p_next", &self.p_next)
@ -31739,7 +31745,7 @@ pub struct AccelerationStructureGeometryKHR<'a> {
}
#[cfg(feature = "debug")]
impl fmt::Debug for AccelerationStructureGeometryKHR<'_> {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt.debug_struct("AccelerationStructureGeometryKHR")
.field("s_type", &self.s_type)
.field("p_next", &self.p_next)
@ -31801,7 +31807,7 @@ pub struct AccelerationStructureBuildGeometryInfoKHR<'a> {
}
#[cfg(feature = "debug")]
impl fmt::Debug for AccelerationStructureBuildGeometryInfoKHR<'_> {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt.debug_struct("AccelerationStructureBuildGeometryInfoKHR")
.field("s_type", &self.s_type)
.field("p_next", &self.p_next)
@ -31879,7 +31885,7 @@ impl<'a> AccelerationStructureBuildGeometryInfoKHR<'a> {
self
}
#[inline]
pub fn geometries(mut self, geometries: &'a [AccelerationStructureGeometryKHR]) -> Self {
pub fn geometries(mut self, geometries: &'a [AccelerationStructureGeometryKHR<'a>]) -> Self {
self.geometry_count = geometries.len() as _;
self.p_geometries = geometries.as_ptr();
self
@ -31887,7 +31893,7 @@ impl<'a> AccelerationStructureBuildGeometryInfoKHR<'a> {
#[inline]
pub fn geometries_ptrs(
mut self,
geometries_ptrs: &'a [&'a AccelerationStructureGeometryKHR],
geometries_ptrs: &'a [&'a AccelerationStructureGeometryKHR<'a>],
) -> Self {
self.geometry_count = geometries_ptrs.len() as _;
self.pp_geometries = geometries_ptrs.as_ptr().cast();
@ -32205,7 +32211,7 @@ pub struct CopyAccelerationStructureToMemoryInfoKHR<'a> {
}
#[cfg(feature = "debug")]
impl fmt::Debug for CopyAccelerationStructureToMemoryInfoKHR<'_> {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt.debug_struct("CopyAccelerationStructureToMemoryInfoKHR")
.field("s_type", &self.s_type)
.field("p_next", &self.p_next)
@ -32262,7 +32268,7 @@ pub struct CopyMemoryToAccelerationStructureInfoKHR<'a> {
}
#[cfg(feature = "debug")]
impl fmt::Debug for CopyMemoryToAccelerationStructureInfoKHR<'_> {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt.debug_struct("CopyMemoryToAccelerationStructureInfoKHR")
.field("s_type", &self.s_type)
.field("p_next", &self.p_next)
@ -34074,7 +34080,7 @@ impl<'a> CopyBufferInfo2<'a> {
self
}
#[inline]
pub fn regions(mut self, regions: &'a [BufferCopy2]) -> Self {
pub fn regions(mut self, regions: &'a [BufferCopy2<'a>]) -> Self {
self.region_count = regions.len() as _;
self.p_regions = regions.as_ptr();
self
@ -34136,7 +34142,7 @@ impl<'a> CopyImageInfo2<'a> {
self
}
#[inline]
pub fn regions(mut self, regions: &'a [ImageCopy2]) -> Self {
pub fn regions(mut self, regions: &'a [ImageCopy2<'a>]) -> Self {
self.region_count = regions.len() as _;
self.p_regions = regions.as_ptr();
self
@ -34201,7 +34207,7 @@ impl<'a> BlitImageInfo2<'a> {
self
}
#[inline]
pub fn regions(mut self, regions: &'a [ImageBlit2]) -> Self {
pub fn regions(mut self, regions: &'a [ImageBlit2<'a>]) -> Self {
self.region_count = regions.len() as _;
self.p_regions = regions.as_ptr();
self
@ -34275,7 +34281,7 @@ impl<'a> CopyBufferToImageInfo2<'a> {
self
}
#[inline]
pub fn regions(mut self, regions: &'a [BufferImageCopy2]) -> Self {
pub fn regions(mut self, regions: &'a [BufferImageCopy2<'a>]) -> Self {
self.region_count = regions.len() as _;
self.p_regions = regions.as_ptr();
self
@ -34330,7 +34336,7 @@ impl<'a> CopyImageToBufferInfo2<'a> {
self
}
#[inline]
pub fn regions(mut self, regions: &'a [BufferImageCopy2]) -> Self {
pub fn regions(mut self, regions: &'a [BufferImageCopy2<'a>]) -> Self {
self.region_count = regions.len() as _;
self.p_regions = regions.as_ptr();
self
@ -34392,7 +34398,7 @@ impl<'a> ResolveImageInfo2<'a> {
self
}
#[inline]
pub fn regions(mut self, regions: &'a [ImageResolve2]) -> Self {
pub fn regions(mut self, regions: &'a [ImageResolve2<'a>]) -> Self {
self.region_count = regions.len() as _;
self.p_regions = regions.as_ptr();
self
@ -35265,7 +35271,7 @@ impl<'a> MutableDescriptorTypeCreateInfoEXT<'a> {
#[inline]
pub fn mutable_descriptor_type_lists(
mut self,
mutable_descriptor_type_lists: &'a [MutableDescriptorTypeListEXT],
mutable_descriptor_type_lists: &'a [MutableDescriptorTypeListEXT<'a>],
) -> Self {
self.mutable_descriptor_type_list_count = mutable_descriptor_type_lists.len() as _;
self.p_mutable_descriptor_type_lists = mutable_descriptor_type_lists.as_ptr();
@ -35893,7 +35899,7 @@ impl<'a> DependencyInfo<'a> {
self
}
#[inline]
pub fn memory_barriers(mut self, memory_barriers: &'a [MemoryBarrier2]) -> Self {
pub fn memory_barriers(mut self, memory_barriers: &'a [MemoryBarrier2<'a>]) -> Self {
self.memory_barrier_count = memory_barriers.len() as _;
self.p_memory_barriers = memory_barriers.as_ptr();
self
@ -35901,7 +35907,7 @@ impl<'a> DependencyInfo<'a> {
#[inline]
pub fn buffer_memory_barriers(
mut self,
buffer_memory_barriers: &'a [BufferMemoryBarrier2],
buffer_memory_barriers: &'a [BufferMemoryBarrier2<'a>],
) -> Self {
self.buffer_memory_barrier_count = buffer_memory_barriers.len() as _;
self.p_buffer_memory_barriers = buffer_memory_barriers.as_ptr();
@ -35910,7 +35916,7 @@ impl<'a> DependencyInfo<'a> {
#[inline]
pub fn image_memory_barriers(
mut self,
image_memory_barriers: &'a [ImageMemoryBarrier2],
image_memory_barriers: &'a [ImageMemoryBarrier2<'a>],
) -> Self {
self.image_memory_barrier_count = image_memory_barriers.len() as _;
self.p_image_memory_barriers = image_memory_barriers.as_ptr();
@ -36051,7 +36057,10 @@ impl<'a> SubmitInfo2<'a> {
self
}
#[inline]
pub fn wait_semaphore_infos(mut self, wait_semaphore_infos: &'a [SemaphoreSubmitInfo]) -> Self {
pub fn wait_semaphore_infos(
mut self,
wait_semaphore_infos: &'a [SemaphoreSubmitInfo<'a>],
) -> Self {
self.wait_semaphore_info_count = wait_semaphore_infos.len() as _;
self.p_wait_semaphore_infos = wait_semaphore_infos.as_ptr();
self
@ -36059,7 +36068,7 @@ impl<'a> SubmitInfo2<'a> {
#[inline]
pub fn command_buffer_infos(
mut self,
command_buffer_infos: &'a [CommandBufferSubmitInfo],
command_buffer_infos: &'a [CommandBufferSubmitInfo<'a>],
) -> Self {
self.command_buffer_info_count = command_buffer_infos.len() as _;
self.p_command_buffer_infos = command_buffer_infos.as_ptr();
@ -36068,7 +36077,7 @@ impl<'a> SubmitInfo2<'a> {
#[inline]
pub fn signal_semaphore_infos(
mut self,
signal_semaphore_infos: &'a [SemaphoreSubmitInfo],
signal_semaphore_infos: &'a [SemaphoreSubmitInfo<'a>],
) -> Self {
self.signal_semaphore_info_count = signal_semaphore_infos.len() as _;
self.p_signal_semaphore_infos = signal_semaphore_infos.as_ptr();
@ -36476,7 +36485,7 @@ impl<'a> CopyMemoryToImageInfoEXT<'a> {
self
}
#[inline]
pub fn regions(mut self, regions: &'a [MemoryToImageCopyEXT]) -> Self {
pub fn regions(mut self, regions: &'a [MemoryToImageCopyEXT<'a>]) -> Self {
self.region_count = regions.len() as _;
self.p_regions = regions.as_ptr();
self
@ -36531,7 +36540,7 @@ impl<'a> CopyImageToMemoryInfoEXT<'a> {
self
}
#[inline]
pub fn regions(mut self, regions: &'a [ImageToMemoryCopyEXT]) -> Self {
pub fn regions(mut self, regions: &'a [ImageToMemoryCopyEXT<'a>]) -> Self {
self.region_count = regions.len() as _;
self.p_regions = regions.as_ptr();
self
@ -36600,7 +36609,7 @@ impl<'a> CopyImageToImageInfoEXT<'a> {
self
}
#[inline]
pub fn regions(mut self, regions: &'a [ImageCopy2]) -> Self {
pub fn regions(mut self, regions: &'a [ImageCopy2<'a>]) -> Self {
self.region_count = regions.len() as _;
self.p_regions = regions.as_ptr();
self
@ -37080,7 +37089,7 @@ unsafe impl ExtendsImageCreateInfo for VideoProfileListInfoKHR<'_> {}
unsafe impl ExtendsBufferCreateInfo for VideoProfileListInfoKHR<'_> {}
impl<'a> VideoProfileListInfoKHR<'a> {
#[inline]
pub fn profiles(mut self, profiles: &'a [VideoProfileInfoKHR]) -> Self {
pub fn profiles(mut self, profiles: &'a [VideoProfileInfoKHR<'a>]) -> Self {
self.profile_count = profiles.len() as _;
self.p_profiles = profiles.as_ptr();
self
@ -37723,7 +37732,7 @@ impl<'a> VideoDecodeInfoKHR<'a> {
self
}
#[inline]
pub fn reference_slots(mut self, reference_slots: &'a [VideoReferenceSlotInfoKHR]) -> Self {
pub fn reference_slots(mut self, reference_slots: &'a [VideoReferenceSlotInfoKHR<'a>]) -> Self {
self.reference_slot_count = reference_slots.len() as _;
self.p_reference_slots = reference_slots.as_ptr();
self
@ -38635,7 +38644,7 @@ impl<'a> VideoBeginCodingInfoKHR<'a> {
self
}
#[inline]
pub fn reference_slots(mut self, reference_slots: &'a [VideoReferenceSlotInfoKHR]) -> Self {
pub fn reference_slots(mut self, reference_slots: &'a [VideoReferenceSlotInfoKHR<'a>]) -> Self {
self.reference_slot_count = reference_slots.len() as _;
self.p_reference_slots = reference_slots.as_ptr();
self
@ -38858,7 +38867,7 @@ impl<'a> VideoEncodeInfoKHR<'a> {
self
}
#[inline]
pub fn reference_slots(mut self, reference_slots: &'a [VideoReferenceSlotInfoKHR]) -> Self {
pub fn reference_slots(mut self, reference_slots: &'a [VideoReferenceSlotInfoKHR<'a>]) -> Self {
self.reference_slot_count = reference_slots.len() as _;
self.p_reference_slots = reference_slots.as_ptr();
self
@ -39107,7 +39116,7 @@ impl<'a> VideoEncodeRateControlInfoKHR<'a> {
self
}
#[inline]
pub fn layers(mut self, layers: &'a [VideoEncodeRateControlLayerInfoKHR]) -> Self {
pub fn layers(mut self, layers: &'a [VideoEncodeRateControlLayerInfoKHR<'a>]) -> Self {
self.layer_count = layers.len() as _;
self.p_layers = layers.as_ptr();
self
@ -39822,7 +39831,7 @@ impl<'a> VideoEncodeH264PictureInfoEXT<'a> {
#[inline]
pub fn nalu_slice_entries(
mut self,
nalu_slice_entries: &'a [VideoEncodeH264NaluSliceInfoEXT],
nalu_slice_entries: &'a [VideoEncodeH264NaluSliceInfoEXT<'a>],
) -> Self {
self.nalu_slice_entry_count = nalu_slice_entries.len() as _;
self.p_nalu_slice_entries = nalu_slice_entries.as_ptr();
@ -40707,7 +40716,7 @@ impl<'a> VideoEncodeH265PictureInfoEXT<'a> {
#[inline]
pub fn nalu_slice_segment_entries(
mut self,
nalu_slice_segment_entries: &'a [VideoEncodeH265NaluSliceSegmentInfoEXT],
nalu_slice_segment_entries: &'a [VideoEncodeH265NaluSliceSegmentInfoEXT<'a>],
) -> Self {
self.nalu_slice_segment_entry_count = nalu_slice_segment_entries.len() as _;
self.p_nalu_slice_segment_entries = nalu_slice_segment_entries.as_ptr();
@ -42101,7 +42110,7 @@ pub struct DescriptorGetInfoEXT<'a> {
}
#[cfg(feature = "debug")]
impl fmt::Debug for DescriptorGetInfoEXT<'_> {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt.debug_struct("DescriptorGetInfoEXT")
.field("s_type", &self.s_type)
.field("p_next", &self.p_next)
@ -42913,7 +42922,7 @@ pub struct AccelerationStructureGeometryMotionTrianglesDataNV<'a> {
}
#[cfg(feature = "debug")]
impl fmt::Debug for AccelerationStructureGeometryMotionTrianglesDataNV<'_> {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt.debug_struct("AccelerationStructureGeometryMotionTrianglesDataNV")
.field("s_type", &self.s_type)
.field("p_next", &self.p_next)
@ -43138,7 +43147,7 @@ pub struct AccelerationStructureMotionInstanceNV {
}
#[cfg(feature = "debug")]
impl fmt::Debug for AccelerationStructureMotionInstanceNV {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt.debug_struct("AccelerationStructureMotionInstanceNV")
.field("ty", &self.ty)
.field("flags", &self.flags)
@ -43604,7 +43613,7 @@ impl<'a> ImageFormatConstraintsInfoFUCHSIA<'a> {
self
}
#[inline]
pub fn color_spaces(mut self, color_spaces: &'a [SysmemColorSpaceFUCHSIA]) -> Self {
pub fn color_spaces(mut self, color_spaces: &'a [SysmemColorSpaceFUCHSIA<'a>]) -> Self {
self.color_space_count = color_spaces.len() as _;
self.p_color_spaces = color_spaces.as_ptr();
self
@ -43644,7 +43653,7 @@ impl<'a> ImageConstraintsInfoFUCHSIA<'a> {
#[inline]
pub fn format_constraints(
mut self,
format_constraints: &'a [ImageFormatConstraintsInfoFUCHSIA],
format_constraints: &'a [ImageFormatConstraintsInfoFUCHSIA<'a>],
) -> Self {
self.format_constraints_count = format_constraints.len() as _;
self.p_format_constraints = format_constraints.as_ptr();
@ -44262,7 +44271,10 @@ impl<'a> RenderingInfo<'a> {
self
}
#[inline]
pub fn color_attachments(mut self, color_attachments: &'a [RenderingAttachmentInfo]) -> Self {
pub fn color_attachments(
mut self,
color_attachments: &'a [RenderingAttachmentInfo<'a>],
) -> Self {
self.color_attachment_count = color_attachments.len() as _;
self.p_color_attachments = color_attachments.as_ptr();
self
@ -44313,7 +44325,7 @@ pub struct RenderingAttachmentInfo<'a> {
}
#[cfg(feature = "debug")]
impl fmt::Debug for RenderingAttachmentInfo<'_> {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt.debug_struct("RenderingAttachmentInfo")
.field("s_type", &self.s_type)
.field("p_next", &self.p_next)
@ -45665,7 +45677,7 @@ pub struct RenderPassSubpassFeedbackInfoEXT {
}
#[cfg(feature = "debug")]
impl fmt::Debug for RenderPassSubpassFeedbackInfoEXT {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt.debug_struct("RenderPassSubpassFeedbackInfoEXT")
.field("subpass_merge_status", &self.subpass_merge_status)
.field("description", &unsafe {
@ -45793,7 +45805,7 @@ pub struct MicromapBuildInfoEXT<'a> {
}
#[cfg(feature = "debug")]
impl fmt::Debug for MicromapBuildInfoEXT<'_> {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt.debug_struct("MicromapBuildInfoEXT")
.field("s_type", &self.s_type)
.field("p_next", &self.p_next)
@ -46044,7 +46056,7 @@ pub struct CopyMicromapToMemoryInfoEXT<'a> {
}
#[cfg(feature = "debug")]
impl fmt::Debug for CopyMicromapToMemoryInfoEXT<'_> {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt.debug_struct("CopyMicromapToMemoryInfoEXT")
.field("s_type", &self.s_type)
.field("p_next", &self.p_next)
@ -46100,7 +46112,7 @@ pub struct CopyMemoryToMicromapInfoEXT<'a> {
}
#[cfg(feature = "debug")]
impl fmt::Debug for CopyMemoryToMicromapInfoEXT<'_> {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt.debug_struct("CopyMemoryToMicromapInfoEXT")
.field("s_type", &self.s_type)
.field("p_next", &self.p_next)
@ -46352,7 +46364,7 @@ pub struct AccelerationStructureTrianglesOpacityMicromapEXT<'a> {
}
#[cfg(feature = "debug")]
impl fmt::Debug for AccelerationStructureTrianglesOpacityMicromapEXT<'_> {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt.debug_struct("AccelerationStructureTrianglesOpacityMicromapEXT")
.field("s_type", &self.s_type)
.field("p_next", &self.p_next)
@ -46532,7 +46544,7 @@ pub struct AccelerationStructureTrianglesDisplacementMicromapNV<'a> {
}
#[cfg(feature = "debug")]
impl fmt::Debug for AccelerationStructureTrianglesDisplacementMicromapNV<'_> {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt.debug_struct("AccelerationStructureTrianglesDisplacementMicromapNV")
.field("s_type", &self.s_type)
.field("p_next", &self.p_next)
@ -48437,7 +48449,7 @@ pub struct DeviceFaultVendorInfoEXT {
}
#[cfg(feature = "debug")]
impl fmt::Debug for DeviceFaultVendorInfoEXT {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt.debug_struct("DeviceFaultVendorInfoEXT")
.field("description", &unsafe {
::std::ffi::CStr::from_ptr(self.description.as_ptr())
@ -48533,7 +48545,7 @@ pub struct DeviceFaultInfoEXT<'a> {
}
#[cfg(feature = "debug")]
impl fmt::Debug for DeviceFaultInfoEXT<'_> {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt.debug_struct("DeviceFaultInfoEXT")
.field("s_type", &self.s_type)
.field("p_next", &self.p_next)
@ -49705,7 +49717,7 @@ pub struct DirectDriverLoadingInfoLUNARG<'a> {
}
#[cfg(feature = "debug")]
impl fmt::Debug for DirectDriverLoadingInfoLUNARG<'_> {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt.debug_struct("DirectDriverLoadingInfoLUNARG")
.field("s_type", &self.s_type)
.field("p_next", &self.p_next)
@ -49783,7 +49795,7 @@ impl<'a> DirectDriverLoadingListLUNARG<'a> {
self
}
#[inline]
pub fn drivers(mut self, drivers: &'a [DirectDriverLoadingInfoLUNARG]) -> Self {
pub fn drivers(mut self, drivers: &'a [DirectDriverLoadingInfoLUNARG<'a>]) -> Self {
self.driver_count = drivers.len() as _;
self.p_drivers = drivers.as_ptr();
self
@ -51015,7 +51027,7 @@ impl<'a> ExecutionGraphPipelineCreateInfoAMDX<'a> {
self
}
#[inline]
pub fn stages(mut self, stages: &'a [PipelineShaderStageCreateInfo]) -> Self {
pub fn stages(mut self, stages: &'a [PipelineShaderStageCreateInfo<'a>]) -> Self {
self.stage_count = stages.len() as _;
self.p_stages = stages.as_ptr();
self
@ -51140,7 +51152,7 @@ pub struct DispatchGraphInfoAMDX {
}
#[cfg(feature = "debug")]
impl fmt::Debug for DispatchGraphInfoAMDX {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt.debug_struct("DispatchGraphInfoAMDX")
.field("node_index", &self.node_index)
.field("payload_count", &self.payload_count)
@ -51181,7 +51193,7 @@ pub struct DispatchGraphCountInfoAMDX {
}
#[cfg(feature = "debug")]
impl fmt::Debug for DispatchGraphCountInfoAMDX {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt.debug_struct("DispatchGraphCountInfoAMDX")
.field("count", &self.count)
.field("infos", &"union")

View file

@ -989,7 +989,7 @@ impl Result {
}
impl ::std::error::Error for Result {}
impl fmt::Display for Result {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
let name = match * self { Self :: SUCCESS => Some ("Command completed successfully") , Self :: NOT_READY => Some ("A fence or query has not yet completed") , Self :: TIMEOUT => Some ("A wait operation has not completed in the specified time") , Self :: EVENT_SET => Some ("An event is signaled") , Self :: EVENT_RESET => Some ("An event is unsignaled") , Self :: INCOMPLETE => Some ("A return array was too small for the result") , Self :: ERROR_OUT_OF_HOST_MEMORY => Some ("A host memory allocation has failed") , Self :: ERROR_OUT_OF_DEVICE_MEMORY => Some ("A device memory allocation has failed") , Self :: ERROR_INITIALIZATION_FAILED => Some ("Initialization of an object has failed") , Self :: ERROR_DEVICE_LOST => Some ("The logical device has been lost. See <https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#devsandqueues-lost-device>") , Self :: ERROR_MEMORY_MAP_FAILED => Some ("Mapping of a memory object has failed") , Self :: ERROR_LAYER_NOT_PRESENT => Some ("Layer specified does not exist") , Self :: ERROR_EXTENSION_NOT_PRESENT => Some ("Extension specified does not exist") , Self :: ERROR_FEATURE_NOT_PRESENT => Some ("Requested feature is not available on this device") , Self :: ERROR_INCOMPATIBLE_DRIVER => Some ("Unable to find a Vulkan driver") , Self :: ERROR_TOO_MANY_OBJECTS => Some ("Too many objects of the type have already been created") , Self :: ERROR_FORMAT_NOT_SUPPORTED => Some ("Requested format is not supported on this device") , Self :: ERROR_FRAGMENTED_POOL => Some ("A requested pool allocation has failed due to fragmentation of the pool's memory") , Self :: ERROR_UNKNOWN => Some ("An unknown error has occurred, due to an implementation or application bug") , _ => None , } ;
if let Some(x) = name {
fmt.write_str(x)
@ -2907,7 +2907,7 @@ impl OutOfBandQueueTypeNV {
pub const PRESENT: Self = Self(1);
}
impl fmt::Debug for ObjectType {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let name = match *self {
Self::UNKNOWN => Some("UNKNOWN"),
Self::INSTANCE => Some("INSTANCE"),
@ -2970,7 +2970,7 @@ impl fmt::Debug for ObjectType {
}
}
impl fmt::Debug for Result {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let name = match *self {
Self::SUCCESS => Some("SUCCESS"),
Self::NOT_READY => Some("NOT_READY"),

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -106,12 +106,12 @@ macro_rules! handle_nondispatchable {
}
}
impl fmt::Pointer for $name {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "0x{:x}", self.0)
}
}
impl fmt::Debug for $name {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "0x{:x}", self.0)
}
}
@ -149,12 +149,12 @@ macro_rules! define_handle {
}
}
impl fmt::Pointer for $name {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt::Pointer::fmt(&self.0, f)
}
}
impl fmt::Debug for $name {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt::Debug::fmt(&self.0, f)
}
}

View file

@ -1,5 +1,11 @@
extern crate ash;
extern crate winit;
#![warn(
clippy::use_self,
deprecated_in_future,
rust_2018_idioms,
trivial_casts,
trivial_numeric_casts,
unused_qualifications
)]
use ash::extensions::{
ext::DebugUtils,
@ -54,7 +60,7 @@ pub fn record_submit_commandbuffer<F: FnOnce(&Device, vk::CommandBuffer)>(
) {
unsafe {
device
.wait_for_fences(&[command_buffer_reuse_fence], true, std::u64::MAX)
.wait_for_fences(&[command_buffer_reuse_fence], true, u64::MAX)
.expect("Wait for fence failed.");
device
@ -96,7 +102,7 @@ pub fn record_submit_commandbuffer<F: FnOnce(&Device, vk::CommandBuffer)>(
unsafe extern "system" fn vulkan_debug_callback(
message_severity: vk::DebugUtilsMessageSeverityFlagsEXT,
message_type: vk::DebugUtilsMessageTypeFlagsEXT,
p_callback_data: *const vk::DebugUtilsMessengerCallbackDataEXT,
p_callback_data: *const vk::DebugUtilsMessengerCallbackDataEXT<'_>,
_user_data: *mut std::os::raw::c_void,
) -> vk::Bool32 {
let callback_data = *p_callback_data;
@ -355,7 +361,7 @@ impl ExampleBase {
desired_image_count = surface_capabilities.max_image_count;
}
let surface_resolution = match surface_capabilities.current_extent.width {
std::u32::MAX => vk::Extent2D {
u32::MAX => vk::Extent2D {
width: window_width,
height: window_height,
},
@ -541,7 +547,7 @@ impl ExampleBase {
.create_semaphore(&semaphore_create_info, None)
.unwrap();
ExampleBase {
Self {
event_loop: RefCell::new(event_loop),
entry,
instance,

View file

@ -1,5 +1,12 @@
#![recursion_limit = "256"]
#![warn(trivial_casts, trivial_numeric_casts)]
#![warn(
clippy::use_self,
deprecated_in_future,
rust_2018_idioms,
trivial_casts,
trivial_numeric_casts,
unused_qualifications
)]
use heck::{ToShoutySnakeCase, ToSnakeCase, ToUpperCamelCase};
use itertools::Itertools;
@ -198,7 +205,7 @@ struct CParameterType<'a> {
reference_type: CReferenceType,
}
fn parse_c_type(i: &str) -> IResult<&str, CParameterType> {
fn parse_c_type(i: &str) -> IResult<&str, CParameterType<'_>> {
(map(
separated_pair(
tuple((
@ -246,7 +253,7 @@ struct CParameter<'a> {
/// ```c
/// VkSparseImageMemoryRequirements2* pSparseMemoryRequirements
/// ```
fn parse_c_parameter(i: &str) -> IResult<&str, CParameter> {
fn parse_c_parameter(i: &str) -> IResult<&str, CParameter<'_>> {
(map(
separated_pair(
parse_c_type,
@ -295,7 +302,7 @@ pub enum ConstVal {
impl ConstVal {
pub fn bits(&self) -> u64 {
match self {
ConstVal::U64(n) => *n,
Self::U64(n) => *n,
_ => panic!("Constval not supported"),
}
}
@ -385,27 +392,27 @@ pub enum Constant {
impl quote::ToTokens for Constant {
fn to_tokens(&self, tokens: &mut TokenStream) {
match *self {
Constant::Number(n) => {
Self::Number(n) => {
let number = interleave_number('_', 3, &n.to_string());
syn::LitInt::new(&number, Span::call_site()).to_tokens(tokens);
}
Constant::Hex(ref s) => {
Self::Hex(ref s) => {
let number = interleave_number('_', 4, s);
syn::LitInt::new(&format!("0x{number}"), Span::call_site()).to_tokens(tokens);
}
Constant::Text(ref text) => text.to_tokens(tokens),
Constant::CExpr(ref expr) => {
Self::Text(ref text) => text.to_tokens(tokens),
Self::CExpr(ref expr) => {
let (rem, (_, rexpr)) = parse_cexpr(expr).expect("Unable to parse cexpr");
assert!(rem.is_empty());
tokens.extend(rexpr.parse::<TokenStream>());
}
Constant::BitPos(pos) => {
Self::BitPos(pos) => {
let value = 1u64 << pos;
let bit_string = format!("{value:b}");
let bit_string = interleave_number('_', 4, &bit_string);
syn::LitInt::new(&format!("0b{bit_string}"), Span::call_site()).to_tokens(tokens);
}
Constant::Alias(ref value) => tokens.extend(quote!(Self::#value)),
Self::Alias(ref value) => tokens.extend(quote!(Self::#value)),
}
}
}
@ -413,9 +420,9 @@ impl quote::ToTokens for Constant {
impl quote::ToTokens for ConstVal {
fn to_tokens(&self, tokens: &mut TokenStream) {
match self {
ConstVal::U32(n) => n.to_tokens(tokens),
ConstVal::U64(n) => n.to_tokens(tokens),
ConstVal::Float(f) => f.to_tokens(tokens),
Self::U32(n) => n.to_tokens(tokens),
Self::U64(n) => n.to_tokens(tokens),
Self::Float(f) => f.to_tokens(tokens),
}
}
}
@ -438,17 +445,17 @@ fn interleave_number(symbol: char, count: usize, n: &str) -> String {
impl Constant {
pub fn value(&self) -> Option<ConstVal> {
match *self {
Constant::Number(n) => Some(ConstVal::U64(n as u64)),
Constant::Hex(ref hex) => u64::from_str_radix(hex, 16).ok().map(ConstVal::U64),
Constant::BitPos(pos) => Some(ConstVal::U64(1u64 << pos)),
Self::Number(n) => Some(ConstVal::U64(n as u64)),
Self::Hex(ref hex) => u64::from_str_radix(hex, 16).ok().map(ConstVal::U64),
Self::BitPos(pos) => Some(ConstVal::U64(1u64 << pos)),
_ => None,
}
}
pub fn ty(&self) -> CType {
match self {
Constant::Number(_) | Constant::Hex(_) => CType::USize,
Constant::CExpr(expr) => {
Self::Number(_) | Self::Hex(_) => CType::USize,
Self::CExpr(expr) => {
let (rem, (ty, _)) = parse_cexpr(expr).expect("Unable to parse cexpr");
assert!(rem.is_empty());
ty
@ -459,23 +466,23 @@ impl Constant {
pub fn from_extension_enum(constant: &vkxml::ExtensionEnum) -> Option<Self> {
let number = constant.number.map(Constant::Number);
let hex = constant.hex.as_ref().map(|hex| Constant::Hex(hex.clone()));
let hex = constant.hex.as_ref().map(|hex| Self::Hex(hex.clone()));
let bitpos = constant.bitpos.map(Constant::BitPos);
let expr = constant
.c_expression
.as_ref()
.map(|e| Constant::CExpr(e.clone()));
.map(|e| Self::CExpr(e.clone()));
number.or(hex).or(bitpos).or(expr)
}
pub fn from_constant(constant: &vkxml::Constant) -> Self {
let number = constant.number.map(Constant::Number);
let hex = constant.hex.as_ref().map(|hex| Constant::Hex(hex.clone()));
let hex = constant.hex.as_ref().map(|hex| Self::Hex(hex.clone()));
let bitpos = constant.bitpos.map(Constant::BitPos);
let expr = constant
.c_expression
.as_ref()
.map(|e| Constant::CExpr(e.clone()));
.map(|e| Self::CExpr(e.clone()));
number.or(hex).or(bitpos).or(expr).expect("")
}
@ -593,12 +600,17 @@ pub trait FieldExt {
/// Returns reference-types wrapped in their safe variant. (Dynamic) arrays become
/// slices, pointers become Rust references.
fn safe_type_tokens(&self, lifetime: TokenStream, inner_length: Option<usize>) -> TokenStream;
fn safe_type_tokens(
&self,
lifetime: TokenStream,
type_lifetime: Option<TokenStream>,
inner_length: Option<usize>,
) -> TokenStream;
/// Returns the basetype ident and removes the 'Vk' prefix. When `is_ffi_param` is `true`
/// array types (e.g. `[f32; 3]`) will be converted to pointer types (e.g. `&[f32; 3]`),
/// which is needed for `C` function parameters. Set to `false` for struct definitions.
fn type_tokens(&self, is_ffi_param: bool) -> TokenStream;
fn type_tokens(&self, is_ffi_param: bool, type_lifetime: Option<TokenStream>) -> TokenStream;
/// Whether this is C's `void` type (not to be mistaken with a void _pointer_!)
fn is_void(&self) -> bool;
@ -621,9 +633,9 @@ impl ToTokens for vkxml::ReferenceType {
quote!(*mut)
};
match self {
vkxml::ReferenceType::Pointer => quote!(#r),
vkxml::ReferenceType::PointerToPointer => quote!(#r *mut),
vkxml::ReferenceType::PointerToConstPointer => quote!(#r *const),
Self::Pointer => quote!(#r),
Self::PointerToPointer => quote!(#r *mut),
Self::PointerToConstPointer => quote!(#r *const),
}
}
@ -634,9 +646,9 @@ impl ToTokens for vkxml::ReferenceType {
quote!(&#lifetime mut)
};
match self {
vkxml::ReferenceType::Pointer => quote!(#r),
vkxml::ReferenceType::PointerToPointer => quote!(#r *mut),
vkxml::ReferenceType::PointerToConstPointer => quote!(#r *const),
Self::Pointer => quote!(#r),
Self::PointerToPointer => quote!(#r *mut),
Self::PointerToConstPointer => quote!(#r *const),
}
}
}
@ -763,14 +775,19 @@ impl FieldExt for vkxml::Field {
}
}
fn safe_type_tokens(&self, lifetime: TokenStream, inner_length: Option<usize>) -> TokenStream {
fn safe_type_tokens(
&self,
lifetime: TokenStream,
type_lifetime: Option<TokenStream>,
inner_length: Option<usize>,
) -> TokenStream {
assert!(!self.is_void());
match self.array {
// The outer type fn type_tokens() returns is [], which fits our "safe" prescription
Some(vkxml::ArrayType::Static) => self.type_tokens(false),
Some(vkxml::ArrayType::Static) => self.type_tokens(false, type_lifetime),
Some(vkxml::ArrayType::Dynamic) => {
let ty = self.inner_type_tokens(Some(lifetime), inner_length);
quote!([#ty])
quote!([#ty #type_lifetime])
}
None => {
let ty = name_to_tokens(&self.basetype);
@ -778,12 +795,12 @@ impl FieldExt for vkxml::Field {
.reference
.as_ref()
.map(|r| r.to_safe_tokens(self.is_const, lifetime));
quote!(#pointer #ty)
quote!(#pointer #ty #type_lifetime)
}
}
}
fn type_tokens(&self, is_ffi_param: bool) -> TokenStream {
fn type_tokens(&self, is_ffi_param: bool, type_lifetime: Option<TokenStream>) -> TokenStream {
assert!(!self.is_void());
let ty = name_to_tokens(&self.basetype);
@ -802,7 +819,7 @@ impl FieldExt for vkxml::Field {
if is_ffi_param {
quote!(*const [#ty; #size])
} else {
quote!([#ty; #size])
quote!([#ty #type_lifetime; #size])
}
}
_ => {
@ -810,9 +827,9 @@ impl FieldExt for vkxml::Field {
if self.is_pointer_to_static_sized_array() {
let size = self.c_size.as_ref().expect("Should have c_size");
let size = convert_c_expression(size, &BTreeMap::new());
quote!(#pointer [#ty; #size])
quote!(#pointer [#ty #type_lifetime; #size])
} else {
quote!(#pointer #ty)
quote!(#pointer #ty #type_lifetime)
}
}
}
@ -849,16 +866,18 @@ impl FieldExt for vk_parse::CommandParam {
fn safe_type_tokens(
&self,
_lifetime: TokenStream,
_type_lifetime: Option<TokenStream>,
_inner_length: Option<usize>,
) -> TokenStream {
unimplemented!()
}
fn type_tokens(&self, is_ffi_param: bool) -> TokenStream {
fn type_tokens(&self, is_ffi_param: bool, type_lifetime: Option<TokenStream>) -> TokenStream {
assert!(!self.is_void(), "{:?}", self);
let (rem, ty) = parse_c_parameter(&self.definition.code).unwrap();
assert!(rem.is_empty());
let type_name = name_to_tokens(ty.type_.name);
let type_name = quote!(#type_name #type_lifetime);
let inner_ty = match ty.type_.reference_type {
CReferenceType::Value => quote!(#type_name),
CReferenceType::Pointer => {
@ -896,6 +915,7 @@ fn generate_function_pointers<'a>(
commands: &[&'a vk_parse::CommandDefinition],
rename_commands: &HashMap<&'a str, &'a str>,
fn_cache: &mut HashSet<&'a str>,
has_lifetimes: &HashSet<Ident>,
) -> TokenStream {
// Commands can have duplicates inside them because they are declared per features. But we only
// really want to generate one function pointer.
@ -939,7 +959,12 @@ fn generate_function_pointers<'a>(
.clone()
.map(|param| {
let name = param.param_ident();
let ty = param.type_tokens(true);
let type_lifetime = has_lifetimes
.contains(&name_to_tokens(
param.definition.type_name.as_ref().unwrap(),
))
.then(|| quote!(<'_>));
let ty = param.type_tokens(true, type_lifetime);
(name, ty)
})
.collect();
@ -1161,7 +1186,7 @@ pub fn generate_extension_constants<'a>(
.filter(|(api, _items)| matches!(api.as_deref(), None | Some(DESIRED_API)))
.flat_map(|(_api, items)| items);
let mut extended_enums = BTreeMap::<String, Vec<ExtensionConstant>>::new();
let mut extended_enums = BTreeMap::<String, Vec<ExtensionConstant<'_>>>::new();
for item in items {
if let vk_parse::InterfaceItem::Enum(enum_) = item {
@ -1228,6 +1253,7 @@ pub fn generate_extension_commands<'a>(
cmd_map: &CommandMap<'a>,
cmd_aliases: &HashMap<&'a str, &'a str>,
fn_cache: &mut HashSet<&'a str>,
has_lifetimes: &HashSet<Ident>,
) -> TokenStream {
let mut commands = Vec::new();
let mut rename_commands = HashMap::new();
@ -1261,7 +1287,13 @@ pub fn generate_extension_commands<'a>(
.strip_prefix("Vk")
.unwrap()
);
let fp = generate_function_pointers(ident.clone(), &commands, &rename_commands, fn_cache);
let fp = generate_function_pointers(
ident.clone(),
&commands,
&rename_commands,
fn_cache,
has_lifetimes,
);
let spec_version = items
.iter()
@ -1299,6 +1331,7 @@ pub fn generate_extension<'a>(
const_values: &mut BTreeMap<Ident, ConstantTypeInfo>,
cmd_aliases: &HashMap<&'a str, &'a str>,
fn_cache: &mut HashSet<&'a str>,
has_lifetimes: &HashSet<Ident>,
) -> Option<TokenStream> {
let extension_tokens = generate_extension_constants(
&extension.name,
@ -1313,6 +1346,7 @@ pub fn generate_extension<'a>(
cmd_map,
cmd_aliases,
fn_cache,
has_lifetimes,
);
let q = quote! {
#fp
@ -1659,7 +1693,7 @@ fn generate_result(ident: Ident, enum_: &vk_parse::Enums) -> TokenStream {
quote! {
impl ::std::error::Error for #ident {}
impl fmt::Display for #ident {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
let name = match *self {
#(#notation),*,
_ => None,
@ -1682,7 +1716,7 @@ fn is_static_array(field: &vkxml::Field) -> bool {
fn derive_default(
struct_: &vkxml::Struct,
members: &[PreprocessedMember],
members: &[PreprocessedMember<'_>],
has_lifetime: bool,
) -> Option<TokenStream> {
let name = name_to_tokens(&struct_.name);
@ -1736,7 +1770,7 @@ fn derive_default(
{
quote!(#param_ident: unsafe { ::std::mem::zeroed() })
} else {
let ty = member.vkxml_field.type_tokens(false);
let ty = member.vkxml_field.type_tokens(false, None);
quote!(#param_ident: #ty::default())
}
});
@ -1761,7 +1795,7 @@ fn derive_default(
fn derive_debug(
struct_: &vkxml::Struct,
members: &[PreprocessedMember],
members: &[PreprocessedMember<'_>],
union_types: &HashSet<&str>,
has_lifetime: bool,
) -> Option<TokenStream> {
@ -1813,7 +1847,7 @@ fn derive_debug(
let q = quote! {
#[cfg(feature = "debug")]
impl fmt::Debug for #name #lifetime {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
fmt.debug_struct(#name_str)
#(#debug_fields)*
.finish()
@ -1825,7 +1859,7 @@ fn derive_debug(
fn derive_setters(
struct_: &vkxml::Struct,
members: &[PreprocessedMember],
members: &[PreprocessedMember<'_>],
root_structs: &HashSet<Ident>,
has_lifetimes: &HashSet<Ident>,
) -> Option<TokenStream> {
@ -1901,7 +1935,10 @@ fn derive_setters(
let deprecated = member.deprecated.as_ref().map(|d| quote!(#d #[allow(deprecated)]));
let param_ident = field.param_ident();
let param_ty_tokens = field.safe_type_tokens(quote!('a), None);
let type_lifetime = has_lifetimes
.contains(&name_to_tokens(&field.basetype))
.then(|| quote!(<'a>));
let param_ty_tokens = field.safe_type_tokens(quote!('a), type_lifetime.clone(), None);
let param_ident_string = param_ident.to_string();
if param_ident_string == "s_type" || param_ident_string == "p_next" {
@ -1966,7 +2003,7 @@ fn derive_setters(
if matches!(field.array, Some(vkxml::ArrayType::Dynamic)) {
if let Some(ref array_size) = field.size {
let mut slice_param_ty_tokens = field.safe_type_tokens(quote!('a), None);
let mut slice_param_ty_tokens = field.safe_type_tokens(quote!('a), type_lifetime.clone(), None);
let mut ptr = if field.is_const {
quote!(.as_ptr())
@ -1994,7 +2031,7 @@ fn derive_setters(
// Deal with a "special" 2D dynamic array with an inner size of 1 (effectively an array containing pointers to single objects)
let array_size = if let Some(array_size) = array_size.strip_suffix(",1") {
param_ident_short = format_ident!("{}_ptrs", param_ident_short);
slice_param_ty_tokens = field.safe_type_tokens(quote!('a), Some(1));
slice_param_ty_tokens = field.safe_type_tokens(quote!('a), type_lifetime.clone(), Some(1));
ptr = quote!(#ptr.cast());
array_size
} else {
@ -2065,19 +2102,15 @@ fn derive_setters(
let param_ty_tokens = if is_opaque_type(&field.basetype) {
// Use raw pointers for void/opaque types
field.type_tokens(false)
field.type_tokens(false, type_lifetime)
} else {
param_ty_tokens
};
let lifetime = has_lifetimes
.contains(&name_to_tokens(&field.basetype))
.then(|| quote!(<'a>));
Some(quote!{
#[inline]
#deprecated
pub fn #param_ident_short(mut self, #param_ident_short: #param_ty_tokens #lifetime) -> Self {
pub fn #param_ident_short(mut self, #param_ident_short: #param_ty_tokens) -> Self {
self.#param_ident = #param_ident_short;
self
}
@ -2319,11 +2352,10 @@ pub fn generate_struct(
.map(|r| r.to_tokens(field.is_const));
quote!(#pointer Self)
} else {
let lifetime = has_lifetimes
let type_lifetime = has_lifetimes
.contains(&name_to_tokens(&field.basetype))
.then(|| quote!(<'a>));
let ty = field.type_tokens(false);
quote!(#ty #lifetime)
field.type_tokens(false, type_lifetime)
};
quote!(#deprecated pub #param_ident: #param_ty_tokens)
@ -2390,17 +2422,20 @@ pub fn generate_handle(handle: &vkxml::Handle) -> Option<TokenStream> {
};
Some(tokens)
}
fn generate_funcptr(fnptr: &vkxml::FunctionPointer) -> TokenStream {
fn generate_funcptr(fnptr: &vkxml::FunctionPointer, has_lifetimes: &HashSet<Ident>) -> TokenStream {
let name = format_ident!("{}", fnptr.name);
let ret_ty_tokens = if fnptr.return_type.is_void() {
quote!()
} else {
let ret_ty_tokens = fnptr.return_type.type_tokens(true);
let ret_ty_tokens = fnptr.return_type.type_tokens(true, None);
quote!(-> #ret_ty_tokens)
};
let params = fnptr.param.iter().map(|field| {
let ident = field.param_ident();
let type_tokens = field.type_tokens(true);
let type_lifetime = has_lifetimes
.contains(&name_to_tokens(&field.basetype))
.then(|| quote!(<'_>));
let type_tokens = field.type_tokens(true, type_lifetime);
quote! {
#ident: #type_tokens
}
@ -2417,12 +2452,12 @@ fn generate_union(union: &vkxml::Union, has_lifetimes: &HashSet<Ident>) -> Token
let name = name_to_tokens(&union.name);
let fields = union.elements.iter().map(|field| {
let name = field.param_ident();
let ty = field.type_tokens(false);
let lifetime = has_lifetimes
let type_lifetime = has_lifetimes
.contains(&name_to_tokens(&field.basetype))
.then(|| quote!(<'a>));
let ty = field.type_tokens(false, type_lifetime);
quote! {
pub #name: #ty #lifetime
pub #name: #ty
}
});
let khronos_link = khronos_link(&union.name);
@ -2520,7 +2555,7 @@ pub fn generate_definition(
generate_handle(handle)
}
vkxml::DefinitionsElement::FuncPtr(ref fp) if allowed_types.contains(fp.name.as_str()) => {
Some(generate_funcptr(fp))
Some(generate_funcptr(fp, has_lifetimes))
}
vkxml::DefinitionsElement::Union(ref union)
if allowed_types.contains(union.name.as_str()) =>
@ -2534,6 +2569,7 @@ pub fn generate_feature<'a>(
feature: &vkxml::Feature,
commands: &CommandMap<'a>,
fn_cache: &mut HashSet<&'a str>,
has_lifetimes: &HashSet<Ident>,
) -> TokenStream {
if !contains_desired_api(&feature.api) {
return quote!();
@ -2566,6 +2602,7 @@ pub fn generate_feature<'a>(
&static_commands,
&HashMap::new(),
fn_cache,
has_lifetimes,
)
} else {
quote! {}
@ -2575,18 +2612,21 @@ pub fn generate_feature<'a>(
&entry_commands,
&HashMap::new(),
fn_cache,
has_lifetimes,
);
let instance = generate_function_pointers(
format_ident!("InstanceFnV{}", version),
&instance_commands,
&HashMap::new(),
fn_cache,
has_lifetimes,
);
let device = generate_function_pointers(
format_ident!("DeviceFnV{}", version),
&device_commands,
&HashMap::new(),
fn_cache,
has_lifetimes,
);
quote! {
#static_fn
@ -2685,7 +2725,7 @@ pub fn generate_const_debugs(const_values: &BTreeMap<Ident, ConstantTypeInfo>) -
quote! {
impl fmt::Debug for #ty {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
const KNOWN: &[(#type_, &str)] = &[#(#cases),*];
debug_flags(f, KNOWN, self.0)
}
@ -2703,7 +2743,7 @@ pub fn generate_const_debugs(const_values: &BTreeMap<Ident, ConstantTypeInfo>) -
});
quote! {
impl fmt::Debug for #ty {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let name = match *self {
#(#cases)*
_ => None,
@ -2940,20 +2980,6 @@ pub fn write_source_code<P: AsRef<Path>>(vk_headers_dir: &Path, src_dir: P) {
constants_code.push(quote! { pub const SHADER_UNUSED_NV : u32 = SHADER_UNUSED_KHR;});
let extension_code = extensions
.iter()
.filter_map(|ext| {
generate_extension(
ext,
&commands,
&mut const_cache,
&mut const_values,
&cmd_aliases,
&mut fn_cache,
)
})
.collect_vec();
let union_types = definitions
.iter()
.filter_map(get_variant!(vkxml::DefinitionsElement::Union))
@ -2992,6 +3018,35 @@ pub fn write_source_code<P: AsRef<Path>>(vk_headers_dir: &Path, src_dir: P) {
_ => continue,
};
}
for type_ in spec2
.0
.iter()
.filter_map(get_variant!(vk_parse::RegistryChild::Types))
.flat_map(|types| &types.children)
.filter_map(get_variant!(vk_parse::TypesChild::Type))
{
if let (Some(name), Some(alias)) = (&type_.name, &type_.alias) {
if has_lifetimes.contains(&name_to_tokens(alias)) {
has_lifetimes.insert(name_to_tokens(name));
}
}
}
let extension_code = extensions
.iter()
.filter_map(|ext| {
generate_extension(
ext,
&commands,
&mut const_cache,
&mut const_values,
&cmd_aliases,
&mut fn_cache,
&has_lifetimes,
)
})
.collect_vec();
let vk_parse_types = spec2
.0
.iter()
@ -3041,7 +3096,7 @@ pub fn write_source_code<P: AsRef<Path>>(vk_headers_dir: &Path, src_dir: P) {
let feature_code: Vec<_> = features
.iter()
.map(|feature| generate_feature(feature, &commands, &mut fn_cache))
.map(|feature| generate_feature(feature, &commands, &mut fn_cache, &has_lifetimes))
.collect();
let feature_extensions_code =
generate_feature_extension(&spec2, &mut const_cache, &mut const_values);
@ -3109,6 +3164,8 @@ pub fn write_source_code<P: AsRef<Path>>(vk_headers_dir: &Path, src_dir: P) {
};
let extension_code = quote! {
#![allow(unused_qualifications)] // Because we do not know in what file the PFNs are defined
use std::os::raw::*;
use crate::vk::platform_types::*;
use crate::vk::aliases::*;