SpiecsEngine
 
Loading...
Searching...
No Matches

◆ CopyBufferToImage() [2/2]

void Spices::VulkanImage::CopyBufferToImage ( VkBuffer buffer,
VkImage image,
uint32_t width,
uint32_t height,
const std::vector< VkBufferImageCopy > & regions ) const

Copy the Buffer's data to this VkImage. Used to create image data (include mipmaps), which owns a compressed format.

Parameters
[in]bufferThe buffer we want copy from.
[in]imageThe image we want copy to, usually this VkImage Object.
[in]widthThe image's width.
[in]heightThe image's height.
[in]regionsSpecific Regions.

Use Custom Cmd.

Use Custom Cmd.

Definition at line 362 of file VulkanImage.cpp.

370 {
372
376 VulkanCommandBuffer::CustomGraphicCmd(m_VulkanState, [&](const VkCommandBuffer& commandBuffer) {
377 vkCmdCopyBufferToImage(
378 commandBuffer,
379 buffer,
380 image,
381 VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL,
382 static_cast<uint32_t>(regions.size()),
383 regions.data()
384 );
385 });
386 }
#define SPICES_PROFILE_ZONE
static void CustomGraphicCmd(VulkanState &vulkanState, T func)
Create a new command buffer and record custom cmd, submit to graphic queue, execute it immediately.
VulkanState & m_VulkanState
The global VulkanState Referenced from VulkanRenderBackend.

References Spices::VulkanObject::m_VulkanState.