Currently, there is no way to poll the swapchain image or other textures after they've been drawn to. There should be some sort of way for a user to get the current state of a texture. This should provide the user a pixel array in the form of RGB888, with an interface such as
void texture_callback(uint8_t *pixels, uint32_t width, uint32_t height, void *data) {...}
void vk2dReadBackTexture(VK_TEXTURE_SWAPCHAIN, texture_callback, NULL);
It would then be VK2D's job to handles all of the heavy lifting which would look like the following:
- Create a host-coherent, transfer destination, linear tiling image
- Pipeline barrier to transition image layout to transfer source
- Copy from swapchain image to other image
- Once the submission fence is complete, call the user callback with the host-coherent data
Currently, there is no way to poll the swapchain image or other textures after they've been drawn to. There should be some sort of way for a user to get the current state of a texture. This should provide the user a pixel array in the form of RGB888, with an interface such as
It would then be VK2D's job to handles all of the heavy lifting which would look like the following: