Make image copy operation public accessible

This commit is contained in:
hodasemi 2023-04-10 20:44:59 +02:00
parent 1976af0166
commit 0f89ceabce

View file

@ -811,7 +811,7 @@ impl Image {
Ok(()) Ok(())
} }
fn copy_image_to_buffer(self: &Arc<Image>) -> Result<Arc<Buffer<RawBuffer>>> { pub fn copy_image_to_buffer(self: &Arc<Image>) -> Result<Arc<Buffer<RawBuffer>>> {
let buffer = Buffer::builder() let buffer = Buffer::builder()
.set_usage(VK_BUFFER_USAGE_TRANSFER_DST_BIT) .set_usage(VK_BUFFER_USAGE_TRANSFER_DST_BIT)
.set_memory_usage(MemoryUsage::GpuToCpu) .set_memory_usage(MemoryUsage::GpuToCpu)
@ -873,6 +873,10 @@ impl Image {
Ok(buffer) Ok(buffer)
} }
pub fn copy_buffer_to_image(self: &Arc<Image>, buffer: &Arc<Buffer<RawBuffer>>) -> Result<()> {
copy_buffer_to_image(&self.device, &self.queue, &buffer, self)
}
} }
impl VulkanDevice for Image { impl VulkanDevice for Image {