Link _len() functions to their array-getter using intradoc-links (#490)
Point the user in the right direction telling them where to get the length of the mutable slice that has to passed in, and document that these have to be default-initialized (so that `s_type` is set appropriately) and `p_next` can optionally be set too.
This commit is contained in:
parent
6640ecb200
commit
e120dd7838
|
@ -297,6 +297,7 @@ impl Device {
|
||||||
.get_buffer_memory_requirements2(self.handle(), info, out);
|
.get_buffer_memory_requirements2(self.handle(), info, out);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Retrieve the number of elements to pass to [`Self::get_image_sparse_memory_requirements2()`]
|
||||||
pub unsafe fn get_image_sparse_memory_requirements2_len(
|
pub unsafe fn get_image_sparse_memory_requirements2_len(
|
||||||
&self,
|
&self,
|
||||||
info: &vk::ImageSparseMemoryRequirementsInfo2,
|
info: &vk::ImageSparseMemoryRequirementsInfo2,
|
||||||
|
@ -312,6 +313,9 @@ impl Device {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetImageSparseMemoryRequirements2.html>"]
|
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetImageSparseMemoryRequirements2.html>"]
|
||||||
|
///
|
||||||
|
/// Call [`Self::get_image_sparse_memory_requirements2_len()`] to query the number of elements to pass to `out`.
|
||||||
|
/// Be sure to [`Default::default()`]-initialize these elements and optionally set their `p_next` pointer.
|
||||||
pub unsafe fn get_image_sparse_memory_requirements2(
|
pub unsafe fn get_image_sparse_memory_requirements2(
|
||||||
&self,
|
&self,
|
||||||
info: &vk::ImageSparseMemoryRequirementsInfo2,
|
info: &vk::ImageSparseMemoryRequirementsInfo2,
|
||||||
|
|
|
@ -45,6 +45,7 @@ impl GetMemoryRequirements2 {
|
||||||
.get_image_memory_requirements2_khr(self.handle, info, memory_requirements);
|
.get_image_memory_requirements2_khr(self.handle, info, memory_requirements);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Retrieve the number of elements to pass to [`Self::get_image_sparse_memory_requirements2()`]
|
||||||
pub unsafe fn get_image_sparse_memory_requirements2_len(
|
pub unsafe fn get_image_sparse_memory_requirements2_len(
|
||||||
&self,
|
&self,
|
||||||
info: &vk::ImageSparseMemoryRequirementsInfo2KHR,
|
info: &vk::ImageSparseMemoryRequirementsInfo2KHR,
|
||||||
|
@ -61,18 +62,21 @@ impl GetMemoryRequirements2 {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetImageSparseMemoryRequirements2KHR.html>"]
|
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetImageSparseMemoryRequirements2KHR.html>"]
|
||||||
|
///
|
||||||
|
/// Call [`Self::get_image_sparse_memory_requirements2_len()`] to query the number of elements to pass to `out`.
|
||||||
|
/// Be sure to [`Default::default()`]-initialize these elements and optionally set their `p_next` pointer.
|
||||||
pub unsafe fn get_image_sparse_memory_requirements2(
|
pub unsafe fn get_image_sparse_memory_requirements2(
|
||||||
&self,
|
&self,
|
||||||
info: &vk::ImageSparseMemoryRequirementsInfo2KHR,
|
info: &vk::ImageSparseMemoryRequirementsInfo2KHR,
|
||||||
sparse_memory_requirements: &mut [vk::SparseImageMemoryRequirements2KHR],
|
out: &mut [vk::SparseImageMemoryRequirements2KHR],
|
||||||
) {
|
) {
|
||||||
let mut count = sparse_memory_requirements.len() as u32;
|
let mut count = out.len() as u32;
|
||||||
self.get_memory_requirements2_fn
|
self.get_memory_requirements2_fn
|
||||||
.get_image_sparse_memory_requirements2_khr(
|
.get_image_sparse_memory_requirements2_khr(
|
||||||
self.handle,
|
self.handle,
|
||||||
info,
|
info,
|
||||||
&mut count,
|
&mut count,
|
||||||
sparse_memory_requirements.as_mut_ptr(),
|
out.as_mut_ptr(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -84,6 +84,7 @@ impl GetPhysicalDeviceProperties2 {
|
||||||
.get_physical_device_properties2_khr(physical_device, properties);
|
.get_physical_device_properties2_khr(physical_device, properties);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Retrieve the number of elements to pass to [`Self::get_physical_device_queue_family_properties2()`]
|
||||||
pub unsafe fn get_physical_device_queue_family_properties2_len(
|
pub unsafe fn get_physical_device_queue_family_properties2_len(
|
||||||
&self,
|
&self,
|
||||||
physical_device: vk::PhysicalDevice,
|
physical_device: vk::PhysicalDevice,
|
||||||
|
@ -99,20 +100,24 @@ impl GetPhysicalDeviceProperties2 {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPhysicalDeviceQueueFamilyProperties2KHR.html>"]
|
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPhysicalDeviceQueueFamilyProperties2KHR.html>"]
|
||||||
|
///
|
||||||
|
/// Call [`Self::get_physical_device_queue_family_properties2_len()`] to query the number of elements to pass to `out`.
|
||||||
|
/// Be sure to [`Default::default()`]-initialize these elements and optionally set their `p_next` pointer.
|
||||||
pub unsafe fn get_physical_device_queue_family_properties2(
|
pub unsafe fn get_physical_device_queue_family_properties2(
|
||||||
&self,
|
&self,
|
||||||
physical_device: vk::PhysicalDevice,
|
physical_device: vk::PhysicalDevice,
|
||||||
queue_family_properties: &mut [vk::QueueFamilyProperties2KHR],
|
out: &mut [vk::QueueFamilyProperties2KHR],
|
||||||
) {
|
) {
|
||||||
let mut count = queue_family_properties.len() as u32;
|
let mut count = out.len() as u32;
|
||||||
self.get_physical_device_properties2_fn
|
self.get_physical_device_properties2_fn
|
||||||
.get_physical_device_queue_family_properties2_khr(
|
.get_physical_device_queue_family_properties2_khr(
|
||||||
physical_device,
|
physical_device,
|
||||||
&mut count,
|
&mut count,
|
||||||
queue_family_properties.as_mut_ptr(),
|
out.as_mut_ptr(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Retrieve the number of elements to pass to [`Self::get_physical_device_sparse_image_format_properties2()`]
|
||||||
pub unsafe fn get_physical_device_sparse_image_format_properties2_len(
|
pub unsafe fn get_physical_device_sparse_image_format_properties2_len(
|
||||||
&self,
|
&self,
|
||||||
physical_device: vk::PhysicalDevice,
|
physical_device: vk::PhysicalDevice,
|
||||||
|
@ -130,19 +135,22 @@ impl GetPhysicalDeviceProperties2 {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPhysicalDeviceSparseImageFormatProperties2KHR.html>"]
|
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPhysicalDeviceSparseImageFormatProperties2KHR.html>"]
|
||||||
|
///
|
||||||
|
/// Call [`Self::get_physical_device_sparse_image_format_properties2_len()`] to query the number of elements to pass to `out`.
|
||||||
|
/// Be sure to [`Default::default()`]-initialize these elements and optionally set their `p_next` pointer.
|
||||||
pub unsafe fn get_physical_device_sparse_image_format_properties2(
|
pub unsafe fn get_physical_device_sparse_image_format_properties2(
|
||||||
&self,
|
&self,
|
||||||
physical_device: vk::PhysicalDevice,
|
physical_device: vk::PhysicalDevice,
|
||||||
format_info: &vk::PhysicalDeviceSparseImageFormatInfo2KHR,
|
format_info: &vk::PhysicalDeviceSparseImageFormatInfo2KHR,
|
||||||
properties: &mut [vk::SparseImageFormatProperties2KHR],
|
out: &mut [vk::SparseImageFormatProperties2KHR],
|
||||||
) {
|
) {
|
||||||
let mut count = properties.len() as u32;
|
let mut count = out.len() as u32;
|
||||||
self.get_physical_device_properties2_fn
|
self.get_physical_device_properties2_fn
|
||||||
.get_physical_device_sparse_image_format_properties2_khr(
|
.get_physical_device_sparse_image_format_properties2_khr(
|
||||||
physical_device,
|
physical_device,
|
||||||
format_info,
|
format_info,
|
||||||
&mut count,
|
&mut count,
|
||||||
properties.as_mut_ptr(),
|
out.as_mut_ptr(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -51,6 +51,7 @@ impl Instance {
|
||||||
&self.instance_fn_1_1
|
&self.instance_fn_1_1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Retrieve the number of elements to pass to [`Self::enumerate_physical_device_groups()`]
|
||||||
pub unsafe fn enumerate_physical_device_groups_len(&self) -> VkResult<usize> {
|
pub unsafe fn enumerate_physical_device_groups_len(&self) -> VkResult<usize> {
|
||||||
let mut group_count = 0;
|
let mut group_count = 0;
|
||||||
self.instance_fn_1_1
|
self.instance_fn_1_1
|
||||||
|
@ -59,6 +60,9 @@ impl Instance {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkEnumeratePhysicalDeviceGroups.html>"]
|
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkEnumeratePhysicalDeviceGroups.html>"]
|
||||||
|
///
|
||||||
|
/// Call [`Self::enumerate_physical_device_groups_len()`] to query the number of elements to pass to `out`.
|
||||||
|
/// Be sure to [`Default::default()`]-initialize these elements and optionally set their `p_next` pointer.
|
||||||
pub unsafe fn enumerate_physical_device_groups(
|
pub unsafe fn enumerate_physical_device_groups(
|
||||||
&self,
|
&self,
|
||||||
out: &mut [vk::PhysicalDeviceGroupProperties],
|
out: &mut [vk::PhysicalDeviceGroupProperties],
|
||||||
|
@ -116,6 +120,7 @@ impl Instance {
|
||||||
.into()
|
.into()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Retrieve the number of elements to pass to [`Self::get_physical_device_queue_family_properties2()`]
|
||||||
pub unsafe fn get_physical_device_queue_family_properties2_len(
|
pub unsafe fn get_physical_device_queue_family_properties2_len(
|
||||||
&self,
|
&self,
|
||||||
physical_device: vk::PhysicalDevice,
|
physical_device: vk::PhysicalDevice,
|
||||||
|
@ -131,17 +136,20 @@ impl Instance {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPhysicalDeviceQueueFamilyProperties2.html>"]
|
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPhysicalDeviceQueueFamilyProperties2.html>"]
|
||||||
|
///
|
||||||
|
/// Call [`Self::get_physical_device_queue_family_properties2_len()`] to query the number of elements to pass to `out`.
|
||||||
|
/// Be sure to [`Default::default()`]-initialize these elements and optionally set their `p_next` pointer.
|
||||||
pub unsafe fn get_physical_device_queue_family_properties2(
|
pub unsafe fn get_physical_device_queue_family_properties2(
|
||||||
&self,
|
&self,
|
||||||
physical_device: vk::PhysicalDevice,
|
physical_device: vk::PhysicalDevice,
|
||||||
queue_family_props: &mut [vk::QueueFamilyProperties2],
|
out: &mut [vk::QueueFamilyProperties2],
|
||||||
) {
|
) {
|
||||||
let mut queue_count = queue_family_props.len() as u32;
|
let mut queue_count = out.len() as u32;
|
||||||
self.instance_fn_1_1
|
self.instance_fn_1_1
|
||||||
.get_physical_device_queue_family_properties2(
|
.get_physical_device_queue_family_properties2(
|
||||||
physical_device,
|
physical_device,
|
||||||
&mut queue_count,
|
&mut queue_count,
|
||||||
queue_family_props.as_mut_ptr(),
|
out.as_mut_ptr(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -155,6 +163,7 @@ impl Instance {
|
||||||
.get_physical_device_memory_properties2(physical_device, out);
|
.get_physical_device_memory_properties2(physical_device, out);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Retrieve the number of elements to pass to [`Self::get_physical_device_sparse_image_format_properties2()`]
|
||||||
pub unsafe fn get_physical_device_sparse_image_format_properties2_len(
|
pub unsafe fn get_physical_device_sparse_image_format_properties2_len(
|
||||||
&self,
|
&self,
|
||||||
physical_device: vk::PhysicalDevice,
|
physical_device: vk::PhysicalDevice,
|
||||||
|
@ -172,6 +181,9 @@ impl Instance {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPhysicalDeviceSparseImageFormatProperties2.html>"]
|
#[doc = "<https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPhysicalDeviceSparseImageFormatProperties2.html>"]
|
||||||
|
///
|
||||||
|
/// Call [`Self::get_physical_device_sparse_image_format_properties2_len()`] to query the number of elements to pass to `out`.
|
||||||
|
/// Be sure to [`Default::default()`]-initialize these elements and optionally set their `p_next` pointer.
|
||||||
pub unsafe fn get_physical_device_sparse_image_format_properties2(
|
pub unsafe fn get_physical_device_sparse_image_format_properties2(
|
||||||
&self,
|
&self,
|
||||||
physical_device: vk::PhysicalDevice,
|
physical_device: vk::PhysicalDevice,
|
||||||
|
|
Loading…
Reference in a new issue