SpiecsEngine
 
Loading...
Searching...
No Matches

◆ CopyMemoryToImageHost() [2/2]

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

Copy the Memory's data to this VkImage.

Parameters
[in]dataMemory data.

Instance a VkMemoryToImageCopyEXT.

Issue the copy.

Instance a VkMemoryToImageCopyEXT.

Issue the copy.

Definition at line 405 of file VulkanImage.cpp.

406 {
408
412 VkMemoryToImageCopyEXT memoryCopy{};
413 memoryCopy.sType = VK_STRUCTURE_TYPE_MEMORY_TO_IMAGE_COPY_EXT;
414 memoryCopy.imageSubresource.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
415 memoryCopy.imageSubresource.mipLevel = 0;
416 memoryCopy.imageSubresource.baseArrayLayer = 0;
417 memoryCopy.imageSubresource.layerCount = 1;
418 memoryCopy.imageExtent.width = m_Width;
419 memoryCopy.imageExtent.height = m_Height;
420 memoryCopy.imageExtent.depth = m_Layers;
421 memoryCopy.pHostPointer = data;
422
426 VkCopyMemoryToImageInfoEXT copyInfo{};
427 copyInfo.sType = VK_STRUCTURE_TYPE_COPY_MEMORY_TO_IMAGE_INFO_EXT;
428 copyInfo.dstImage = m_Image;
429 copyInfo.dstImageLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL;
430 copyInfo.regionCount = 1;
431 copyInfo.pRegions = &memoryCopy;
432
433 m_VulkanState.m_VkFunc.vkCopyMemoryToImageEXT(m_VulkanState.m_Device, &copyInfo);
434 }
#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