Skip to content
Snippets Groups Projects
Commit a9686658 authored by Lars Hoerttrich's avatar Lars Hoerttrich
Browse files

[#31] Added function to copy buffer to image

parent 9b6bacff
No related branches found
No related tags found
1 merge request!32Resolve "Image-Klasse"
Pipeline #25268 passed
......@@ -31,7 +31,7 @@ namespace vkcv {
ImageManager& operator=(ImageManager&& other) = delete;
ImageManager& operator=(const ImageManager& other) = delete;
void copyBufferToImage(vk::Buffer bufffer, vk::Image image, uint32_t width, uint32_t height);
void copyBufferToImage(vk::Buffer buffer, vk::Image image, uint32_t width, uint32_t height);
void switchImageLayout(uint64_t id, vk::ImageLayout oldLayout, vk::ImageLayout newLayout);
uint64_t createImage(uint32_t width, uint32_t height);
......
......@@ -45,9 +45,24 @@ namespace vkcv {
}
}
void ImageManager::copyBufferToImage(vk::Buffer bufffer, vk::Image image, uint32_t width, uint32_t height)
void ImageManager::copyBufferToImage(vk::Buffer buffer, vk::Image image, uint32_t width, uint32_t height)
{
//TODO
vk::BufferImageCopy copyRegion(0,width,height); // possibly add offset etc
SubmitInfo submitInfo;
submitInfo.queueType = QueueType::Transfer; //not sure
m_core->submitCommands(
submitInfo,
[buffer, image,copyRegion](const vk::CommandBuffer& commandBuffer) {
commandBuffer.copyBufferToImage(
buffer,
image,vk::ImageLayout::eTransferDstOptimal,
copyRegion
);
},
[]() {}
);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment