| 1 | //! <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_host_image_copy.html> |
| 2 | |
| 3 | use crate::prelude::*; |
| 4 | use crate::vk; |
| 5 | #[cfg(doc)] |
| 6 | use crate::{ext, khr}; |
| 7 | |
| 8 | impl crate::ext::host_image_copy::Device { |
| 9 | /// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCopyMemoryToImageEXT.html> |
| 10 | #[inline] |
| 11 | pub unsafe fn copy_memory_to_image( |
| 12 | &self, |
| 13 | copy_memory_to_image_info: &vk::CopyMemoryToImageInfoEXT<'_>, |
| 14 | ) -> VkResult<()> { |
| 15 | (self.fp.copy_memory_to_image_ext)(self.handle, copy_memory_to_image_info).result() |
| 16 | } |
| 17 | |
| 18 | /// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCopyImageToMemoryEXT.html> |
| 19 | #[inline] |
| 20 | pub unsafe fn copy_image_to_memory( |
| 21 | &self, |
| 22 | copy_image_to_memory_info: &vk::CopyImageToMemoryInfoEXT<'_>, |
| 23 | ) -> VkResult<()> { |
| 24 | (self.fp.copy_image_to_memory_ext)(self.handle, copy_image_to_memory_info).result() |
| 25 | } |
| 26 | |
| 27 | /// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCopyImageToImageEXT.html> |
| 28 | #[inline] |
| 29 | pub unsafe fn copy_image_to_image( |
| 30 | &self, |
| 31 | copy_image_to_image_info: &vk::CopyImageToImageInfoEXT<'_>, |
| 32 | ) -> VkResult<()> { |
| 33 | (self.fp.copy_image_to_image_ext)(self.handle, copy_image_to_image_info).result() |
| 34 | } |
| 35 | |
| 36 | /// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkTransitionImageLayoutEXT.html> |
| 37 | #[inline] |
| 38 | pub unsafe fn transition_image_layout( |
| 39 | &self, |
| 40 | transitions: &[vk::HostImageLayoutTransitionInfoEXT<'_>], |
| 41 | ) -> VkResult<()> { |
| 42 | (self.fp.transition_image_layout_ext)( |
| 43 | self.handle, |
| 44 | transitions.len() as u32, |
| 45 | transitions.as_ptr(), |
| 46 | ) |
| 47 | .result() |
| 48 | } |
| 49 | |
| 50 | /// <https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkGetImageSubresourceLayout2EXT.html> |
| 51 | /// |
| 52 | /// Also available as [`khr::maintenance5::Device::get_image_subresource_layout2()`] |
| 53 | /// when [`VK_KHR_maintenance5`] is enabled. |
| 54 | /// |
| 55 | /// Also available as [`ext::image_compression_control::Device::get_image_subresource_layout2()`] |
| 56 | /// when [`VK_EXT_image_compression_control`] is enabled. |
| 57 | /// |
| 58 | /// [`VK_KHR_maintenance5`]: https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_maintenance5.html |
| 59 | /// [`VK_EXT_image_compression_control`]: https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_EXT_image_compression_control.html |
| 60 | #[inline] |
| 61 | pub unsafe fn get_image_subresource_layout2( |
| 62 | &self, |
| 63 | image: vk::Image, |
| 64 | subresource: &vk::ImageSubresource2EXT<'_>, |
| 65 | layout: &mut vk::SubresourceLayout2EXT<'_>, |
| 66 | ) { |
| 67 | (self.fp.get_image_subresource_layout2_ext)(self.handle, image, subresource, layout) |
| 68 | } |
| 69 | } |