SpiecsEngine
 
Loading...
Searching...
No Matches

◆ CopyImageToMemoryHost() [2/2]

void Spices::VulkanImage::CopyImageToMemoryHost ( void * data) const

@breif Copy memory from a VkImage.

Parameters
[in]dataOut data.

Instance a VkCopyImageToMemoryInfoEXT.

Instance a VkCopyImageToMemoryInfoEXT.

Definition at line 555 of file VulkanImage.cpp.

556 {
558
559 VkImageToMemoryCopyEXT memoryCopy{};
560 memoryCopy.sType = VK_STRUCTURE_TYPE_IMAGE_TO_MEMORY_COPY_EXT;
561 memoryCopy.imageSubresource.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
562 memoryCopy.imageSubresource.mipLevel = 0;
563 memoryCopy.imageSubresource.baseArrayLayer = 0;
564 memoryCopy.imageSubresource.layerCount = 1;
565 memoryCopy.imageOffset = { 0, 0, 0 };
566 memoryCopy.imageExtent.width = m_Width;
567 memoryCopy.imageExtent.height = m_Height;
568 memoryCopy.imageExtent.depth = m_Layers;
569 memoryCopy.pHostPointer = data;
570
574 VkCopyImageToMemoryInfoEXT copyInfo{};
575 copyInfo.sType = VK_STRUCTURE_TYPE_COPY_IMAGE_TO_MEMORY_INFO_EXT;
576 copyInfo.srcImage = m_Image;
577 copyInfo.srcImageLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL;
578 copyInfo.regionCount = 1;
579 copyInfo.pRegions = &memoryCopy;
580
581 m_VulkanState.m_VkFunc.vkCopyImageToMemoryEXT(m_VulkanState.m_Device, &copyInfo);
582 }
#define SPICES_PROFILE_ZONE
int m_Width
Image width.
int m_Height
Image height.
VkImage m_Image
The VkImage this Class Wrapped.
uint32_t m_Layers
Image layer(texture cube: 6).
VulkanState & m_VulkanState
The global VulkanState Referenced from VulkanRenderBackend.
VulkanFunctions m_VkFunc
Definition VulkanUtils.h:98