From 40c750978397b8d052e4d355e33a0c578840f3b7 Mon Sep 17 00:00:00 2001 From: lilly lizard <44878819+lilly-lizard@users.noreply.github.com> Date: Sat, 11 Mar 2023 12:59:44 +1300 Subject: [PATCH] Rename some function arguments to match the vulkan spec (#717) renamed some function arguments that were previously called 'create_info' to match the argument names in the vulkan spec --- ash/src/device.rs | 48 ++++++++++++-------- ash/src/extensions/khr/external_memory_fd.rs | 4 +- ash/src/extensions/khr/maintenance4.rs | 16 +++---- 3 files changed, 38 insertions(+), 30 deletions(-) diff --git a/ash/src/device.rs b/ash/src/device.rs index 60a91ae..0b43928 100644 --- a/ash/src/device.rs +++ b/ash/src/device.rs @@ -465,34 +465,42 @@ impl Device { #[inline] pub unsafe fn get_device_buffer_memory_requirements( &self, - create_info: &vk::DeviceBufferMemoryRequirements, + memory_reqirements: &vk::DeviceBufferMemoryRequirements, out: &mut vk::MemoryRequirements2, ) { - (self.device_fn_1_3.get_device_buffer_memory_requirements)(self.handle, create_info, out) + (self.device_fn_1_3.get_device_buffer_memory_requirements)( + self.handle, + memory_reqirements, + out, + ) } /// #[inline] pub unsafe fn get_device_image_memory_requirements( &self, - create_info: &vk::DeviceImageMemoryRequirements, + memory_reqirements: &vk::DeviceImageMemoryRequirements, out: &mut vk::MemoryRequirements2, ) { - (self.device_fn_1_3.get_device_image_memory_requirements)(self.handle, create_info, out) + (self.device_fn_1_3.get_device_image_memory_requirements)( + self.handle, + memory_reqirements, + out, + ) } /// Retrieve the number of elements to pass to [`get_device_image_sparse_memory_requirements()`][Self::get_device_image_sparse_memory_requirements()] #[inline] pub unsafe fn get_device_image_sparse_memory_requirements_len( &self, - create_info: &vk::DeviceImageMemoryRequirements, + memory_reqirements: &vk::DeviceImageMemoryRequirements, ) -> usize { let mut count = 0; (self .device_fn_1_3 .get_device_image_sparse_memory_requirements)( self.handle, - create_info, + memory_reqirements, &mut count, std::ptr::null_mut(), ); @@ -506,7 +514,7 @@ impl Device { #[inline] pub unsafe fn get_device_image_sparse_memory_requirements( &self, - create_info: &vk::DeviceImageMemoryRequirements, + memory_reqirements: &vk::DeviceImageMemoryRequirements, out: &mut [vk::SparseImageMemoryRequirements2], ) { let mut count = out.len() as u32; @@ -514,7 +522,7 @@ impl Device { .device_fn_1_3 .get_device_image_sparse_memory_requirements)( self.handle, - create_info, + memory_reqirements, &mut count, out.as_mut_ptr(), ); @@ -1499,17 +1507,17 @@ impl Device { #[inline] pub unsafe fn allocate_descriptor_sets( &self, - create_info: &vk::DescriptorSetAllocateInfo, + allocate_info: &vk::DescriptorSetAllocateInfo, ) -> VkResult> { - let mut desc_set = Vec::with_capacity(create_info.descriptor_set_count as usize); + let mut desc_set = Vec::with_capacity(allocate_info.descriptor_set_count as usize); (self.device_fn_1_0.allocate_descriptor_sets)( self.handle(), - create_info, + allocate_info, desc_set.as_mut_ptr(), ) .result()?; - desc_set.set_len(create_info.descriptor_set_count as usize); + desc_set.set_len(allocate_info.descriptor_set_count as usize); Ok(desc_set) } @@ -1786,10 +1794,10 @@ impl Device { pub unsafe fn cmd_begin_render_pass( &self, command_buffer: vk::CommandBuffer, - create_info: &vk::RenderPassBeginInfo, + render_pass_begin: &vk::RenderPassBeginInfo, contents: vk::SubpassContents, ) { - (self.device_fn_1_0.cmd_begin_render_pass)(command_buffer, create_info, contents); + (self.device_fn_1_0.cmd_begin_render_pass)(command_buffer, render_pass_begin, contents); } /// @@ -2488,16 +2496,16 @@ impl Device { #[inline] pub unsafe fn allocate_command_buffers( &self, - create_info: &vk::CommandBufferAllocateInfo, + allocate_info: &vk::CommandBufferAllocateInfo, ) -> VkResult> { - let mut buffers = Vec::with_capacity(create_info.command_buffer_count as usize); + let mut buffers = Vec::with_capacity(allocate_info.command_buffer_count as usize); (self.device_fn_1_0.allocate_command_buffers)( self.handle(), - create_info, + allocate_info, buffers.as_mut_ptr(), ) .result()?; - buffers.set_len(create_info.command_buffer_count as usize); + buffers.set_len(allocate_info.command_buffer_count as usize); Ok(buffers) } @@ -2592,13 +2600,13 @@ impl Device { #[inline] pub unsafe fn allocate_memory( &self, - create_info: &vk::MemoryAllocateInfo, + allocate_info: &vk::MemoryAllocateInfo, allocation_callbacks: Option<&vk::AllocationCallbacks>, ) -> VkResult { let mut memory = mem::zeroed(); (self.device_fn_1_0.allocate_memory)( self.handle(), - create_info, + allocate_info, allocation_callbacks.as_raw_ptr(), &mut memory, ) diff --git a/ash/src/extensions/khr/external_memory_fd.rs b/ash/src/extensions/khr/external_memory_fd.rs index 9023498..77e66c2 100644 --- a/ash/src/extensions/khr/external_memory_fd.rs +++ b/ash/src/extensions/khr/external_memory_fd.rs @@ -21,9 +21,9 @@ impl ExternalMemoryFd { /// #[inline] - pub unsafe fn get_memory_fd(&self, create_info: &vk::MemoryGetFdInfoKHR) -> VkResult { + pub unsafe fn get_memory_fd(&self, get_fd_info: &vk::MemoryGetFdInfoKHR) -> VkResult { let mut fd = -1; - (self.fp.get_memory_fd_khr)(self.handle, create_info, &mut fd).result_with_success(fd) + (self.fp.get_memory_fd_khr)(self.handle, get_fd_info, &mut fd).result_with_success(fd) } /// diff --git a/ash/src/extensions/khr/maintenance4.rs b/ash/src/extensions/khr/maintenance4.rs index 003e1a9..7ec1781 100644 --- a/ash/src/extensions/khr/maintenance4.rs +++ b/ash/src/extensions/khr/maintenance4.rs @@ -22,32 +22,32 @@ impl Maintenance4 { #[inline] pub unsafe fn get_device_buffer_memory_requirements( &self, - create_info: &vk::DeviceBufferMemoryRequirementsKHR, + memory_requirements: &vk::DeviceBufferMemoryRequirementsKHR, out: &mut vk::MemoryRequirements2, ) { - (self.fp.get_device_buffer_memory_requirements_khr)(self.handle, create_info, out) + (self.fp.get_device_buffer_memory_requirements_khr)(self.handle, memory_requirements, out) } /// #[inline] pub unsafe fn get_device_image_memory_requirements( &self, - create_info: &vk::DeviceImageMemoryRequirementsKHR, + memory_requirements: &vk::DeviceImageMemoryRequirementsKHR, out: &mut vk::MemoryRequirements2, ) { - (self.fp.get_device_image_memory_requirements_khr)(self.handle, create_info, out) + (self.fp.get_device_image_memory_requirements_khr)(self.handle, memory_requirements, out) } /// Retrieve the number of elements to pass to [`get_device_image_sparse_memory_requirements()`][Self::get_device_image_sparse_memory_requirements()] #[inline] pub unsafe fn get_device_image_sparse_memory_requirements_len( &self, - create_info: &vk::DeviceImageMemoryRequirementsKHR, + memory_requirements: &vk::DeviceImageMemoryRequirementsKHR, ) -> usize { let mut count = 0; (self.fp.get_device_image_sparse_memory_requirements_khr)( self.handle, - create_info, + memory_requirements, &mut count, std::ptr::null_mut(), ); @@ -61,13 +61,13 @@ impl Maintenance4 { #[inline] pub unsafe fn get_device_image_sparse_memory_requirements( &self, - create_info: &vk::DeviceImageMemoryRequirementsKHR, + memory_requirements: &vk::DeviceImageMemoryRequirementsKHR, out: &mut [vk::SparseImageMemoryRequirements2], ) { let mut count = out.len() as u32; (self.fp.get_device_image_sparse_memory_requirements_khr)( self.handle, - create_info, + memory_requirements, &mut count, out.as_mut_ptr(), );