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
This commit is contained in:
lilly lizard 2023-03-11 12:59:44 +13:00 committed by Marijn Suijten
parent a6215f7b18
commit 40c7509783
No known key found for this signature in database
GPG key ID: 449FC1DE031665DA
3 changed files with 38 additions and 30 deletions

View file

@ -465,34 +465,42 @@ impl Device {
#[inline] #[inline]
pub unsafe fn get_device_buffer_memory_requirements( pub unsafe fn get_device_buffer_memory_requirements(
&self, &self,
create_info: &vk::DeviceBufferMemoryRequirements, memory_reqirements: &vk::DeviceBufferMemoryRequirements,
out: &mut vk::MemoryRequirements2, 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,
)
} }
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetDeviceImageMemoryRequirements.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetDeviceImageMemoryRequirements.html>
#[inline] #[inline]
pub unsafe fn get_device_image_memory_requirements( pub unsafe fn get_device_image_memory_requirements(
&self, &self,
create_info: &vk::DeviceImageMemoryRequirements, memory_reqirements: &vk::DeviceImageMemoryRequirements,
out: &mut vk::MemoryRequirements2, 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()] /// Retrieve the number of elements to pass to [`get_device_image_sparse_memory_requirements()`][Self::get_device_image_sparse_memory_requirements()]
#[inline] #[inline]
pub unsafe fn get_device_image_sparse_memory_requirements_len( pub unsafe fn get_device_image_sparse_memory_requirements_len(
&self, &self,
create_info: &vk::DeviceImageMemoryRequirements, memory_reqirements: &vk::DeviceImageMemoryRequirements,
) -> usize { ) -> usize {
let mut count = 0; let mut count = 0;
(self (self
.device_fn_1_3 .device_fn_1_3
.get_device_image_sparse_memory_requirements)( .get_device_image_sparse_memory_requirements)(
self.handle, self.handle,
create_info, memory_reqirements,
&mut count, &mut count,
std::ptr::null_mut(), std::ptr::null_mut(),
); );
@ -506,7 +514,7 @@ impl Device {
#[inline] #[inline]
pub unsafe fn get_device_image_sparse_memory_requirements( pub unsafe fn get_device_image_sparse_memory_requirements(
&self, &self,
create_info: &vk::DeviceImageMemoryRequirements, memory_reqirements: &vk::DeviceImageMemoryRequirements,
out: &mut [vk::SparseImageMemoryRequirements2], out: &mut [vk::SparseImageMemoryRequirements2],
) { ) {
let mut count = out.len() as u32; let mut count = out.len() as u32;
@ -514,7 +522,7 @@ impl Device {
.device_fn_1_3 .device_fn_1_3
.get_device_image_sparse_memory_requirements)( .get_device_image_sparse_memory_requirements)(
self.handle, self.handle,
create_info, memory_reqirements,
&mut count, &mut count,
out.as_mut_ptr(), out.as_mut_ptr(),
); );
@ -1499,17 +1507,17 @@ impl Device {
#[inline] #[inline]
pub unsafe fn allocate_descriptor_sets( pub unsafe fn allocate_descriptor_sets(
&self, &self,
create_info: &vk::DescriptorSetAllocateInfo, allocate_info: &vk::DescriptorSetAllocateInfo,
) -> VkResult<Vec<vk::DescriptorSet>> { ) -> VkResult<Vec<vk::DescriptorSet>> {
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.device_fn_1_0.allocate_descriptor_sets)(
self.handle(), self.handle(),
create_info, allocate_info,
desc_set.as_mut_ptr(), desc_set.as_mut_ptr(),
) )
.result()?; .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) Ok(desc_set)
} }
@ -1786,10 +1794,10 @@ impl Device {
pub unsafe fn cmd_begin_render_pass( pub unsafe fn cmd_begin_render_pass(
&self, &self,
command_buffer: vk::CommandBuffer, command_buffer: vk::CommandBuffer,
create_info: &vk::RenderPassBeginInfo, render_pass_begin: &vk::RenderPassBeginInfo,
contents: vk::SubpassContents, 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);
} }
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdNextSubpass.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkCmdNextSubpass.html>
@ -2488,16 +2496,16 @@ impl Device {
#[inline] #[inline]
pub unsafe fn allocate_command_buffers( pub unsafe fn allocate_command_buffers(
&self, &self,
create_info: &vk::CommandBufferAllocateInfo, allocate_info: &vk::CommandBufferAllocateInfo,
) -> VkResult<Vec<vk::CommandBuffer>> { ) -> VkResult<Vec<vk::CommandBuffer>> {
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.device_fn_1_0.allocate_command_buffers)(
self.handle(), self.handle(),
create_info, allocate_info,
buffers.as_mut_ptr(), buffers.as_mut_ptr(),
) )
.result()?; .result()?;
buffers.set_len(create_info.command_buffer_count as usize); buffers.set_len(allocate_info.command_buffer_count as usize);
Ok(buffers) Ok(buffers)
} }
@ -2592,13 +2600,13 @@ impl Device {
#[inline] #[inline]
pub unsafe fn allocate_memory( pub unsafe fn allocate_memory(
&self, &self,
create_info: &vk::MemoryAllocateInfo, allocate_info: &vk::MemoryAllocateInfo,
allocation_callbacks: Option<&vk::AllocationCallbacks>, allocation_callbacks: Option<&vk::AllocationCallbacks>,
) -> VkResult<vk::DeviceMemory> { ) -> VkResult<vk::DeviceMemory> {
let mut memory = mem::zeroed(); let mut memory = mem::zeroed();
(self.device_fn_1_0.allocate_memory)( (self.device_fn_1_0.allocate_memory)(
self.handle(), self.handle(),
create_info, allocate_info,
allocation_callbacks.as_raw_ptr(), allocation_callbacks.as_raw_ptr(),
&mut memory, &mut memory,
) )

View file

@ -21,9 +21,9 @@ impl ExternalMemoryFd {
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetMemoryFdKHR.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetMemoryFdKHR.html>
#[inline] #[inline]
pub unsafe fn get_memory_fd(&self, create_info: &vk::MemoryGetFdInfoKHR) -> VkResult<i32> { pub unsafe fn get_memory_fd(&self, get_fd_info: &vk::MemoryGetFdInfoKHR) -> VkResult<i32> {
let mut fd = -1; 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)
} }
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetMemoryFdPropertiesKHR.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetMemoryFdPropertiesKHR.html>

View file

@ -22,32 +22,32 @@ impl Maintenance4 {
#[inline] #[inline]
pub unsafe fn get_device_buffer_memory_requirements( pub unsafe fn get_device_buffer_memory_requirements(
&self, &self,
create_info: &vk::DeviceBufferMemoryRequirementsKHR, memory_requirements: &vk::DeviceBufferMemoryRequirementsKHR,
out: &mut vk::MemoryRequirements2, 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)
} }
/// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetDeviceImageMemoryRequirementsKHR.html> /// <https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/vkGetDeviceImageMemoryRequirementsKHR.html>
#[inline] #[inline]
pub unsafe fn get_device_image_memory_requirements( pub unsafe fn get_device_image_memory_requirements(
&self, &self,
create_info: &vk::DeviceImageMemoryRequirementsKHR, memory_requirements: &vk::DeviceImageMemoryRequirementsKHR,
out: &mut vk::MemoryRequirements2, 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()] /// Retrieve the number of elements to pass to [`get_device_image_sparse_memory_requirements()`][Self::get_device_image_sparse_memory_requirements()]
#[inline] #[inline]
pub unsafe fn get_device_image_sparse_memory_requirements_len( pub unsafe fn get_device_image_sparse_memory_requirements_len(
&self, &self,
create_info: &vk::DeviceImageMemoryRequirementsKHR, memory_requirements: &vk::DeviceImageMemoryRequirementsKHR,
) -> usize { ) -> usize {
let mut count = 0; let mut count = 0;
(self.fp.get_device_image_sparse_memory_requirements_khr)( (self.fp.get_device_image_sparse_memory_requirements_khr)(
self.handle, self.handle,
create_info, memory_requirements,
&mut count, &mut count,
std::ptr::null_mut(), std::ptr::null_mut(),
); );
@ -61,13 +61,13 @@ impl Maintenance4 {
#[inline] #[inline]
pub unsafe fn get_device_image_sparse_memory_requirements( pub unsafe fn get_device_image_sparse_memory_requirements(
&self, &self,
create_info: &vk::DeviceImageMemoryRequirementsKHR, memory_requirements: &vk::DeviceImageMemoryRequirementsKHR,
out: &mut [vk::SparseImageMemoryRequirements2], out: &mut [vk::SparseImageMemoryRequirements2],
) { ) {
let mut count = out.len() as u32; let mut count = out.len() as u32;
(self.fp.get_device_image_sparse_memory_requirements_khr)( (self.fp.get_device_image_sparse_memory_requirements_khr)(
self.handle, self.handle,
create_info, memory_requirements,
&mut count, &mut count,
out.as_mut_ptr(), out.as_mut_ptr(),
); );