ash/extensions/nv/
copy_memory_indirect.rs

1//! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_NV_copy_memory_indirect.html>
2
3use crate::vk;
4
5impl crate::nv::copy_memory_indirect::Device {
6    /// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdCopyMemoryIndirectNV.html>
7    ///
8    /// `copy_buffer_address` is a buffer device address which is a pointer to an array of
9    /// `copy_count` number of [`vk::CopyMemoryIndirectCommandNV`] structures containing the copy
10    /// parameters, each `stride` bytes apart.
11    #[inline]
12    pub unsafe fn cmd_copy_memory_indirect(
13        &self,
14        command_buffer: vk::CommandBuffer,
15        copy_buffer_address: vk::DeviceAddress,
16        copy_count: u32,
17        stride: u32,
18    ) {
19        (self.fp.cmd_copy_memory_indirect_nv)(
20            command_buffer,
21            copy_buffer_address,
22            copy_count,
23            stride,
24        )
25    }
26
27    /// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdCopyMemoryToImageIndirectNV.html>
28    ///
29    /// `copy_buffer_address` is a buffer device address which is a pointer to an array of
30    /// `image_subresources.len()` number of [`vk::CopyMemoryToImageIndirectCommandNV`] structures
31    /// containing the copy parameters, each `stride` bytes apart.
32    #[inline]
33    pub unsafe fn cmd_copy_memory_to_image_indirect(
34        &self,
35        command_buffer: vk::CommandBuffer,
36        copy_buffer_address: vk::DeviceAddress,
37        stride: u32,
38        dst_image: vk::Image,
39        dst_image_layout: vk::ImageLayout,
40        image_subresources: &[vk::ImageSubresourceLayers],
41    ) {
42        (self.fp.cmd_copy_memory_to_image_indirect_nv)(
43            command_buffer,
44            copy_buffer_address,
45            image_subresources.len() as u32,
46            stride,
47            dst_image,
48            dst_image_layout,
49            image_subresources.as_ptr(),
50        )
51    }
52}