0
$\begingroup$

I wish to render an image with my vulkan program and save it to local path. What's a good way to do this or has anyone done it before? Thanks!

$\endgroup$

1 Answer 1

1
$\begingroup$

This is done in a very similar way of copying images to the gpu: (here some pseudo code:

Create dest image in mappable memory so it can be read back later.
Transition source image to transfer read access.
Transition the dest image to transfer write access.
vkCmdBlit src to dest
Transition dest image to a access memory read/general layout
Transition src image back to original access/layout (assuming it will be used again)
memory map the dest image for reading back to the cpu
copy dest image to cpu memory
clean up

Use VkImageMemoryBarrier(2) for the transitions.

I am sure there are some good samples on how to do this out there.

$\endgroup$
1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.