I wrote a simple Vulkan demo with BGRA images queried from swapchain. If I output RGBA pixels to it, the R channel and G channel in final result were swapped.
But when I checked the demo in Vulkan SDK dir, I found that it also use a BGRA image view for color output (I checked this in code and RenderDoc), but the final result is correct!
So, when did the conversion happen? Did I miss something?
vulkan demo output
Vulkan demo has a BGRA format output
My poor result
Edit:
Sorry about the lack of the code. The first answer gave me a hint to find the real problem in loading image from disk by FreeImage. Images it loads are stored as BGRA format with default setting on windows:
Thanks for your help and advice, @opa and @solidpixel.
You're either setting up your texture reads incorrectly, or you're setting up your swapchain writes incorrectly. If I had to guess you're uploading data into the wrong texture format, but without a complete example it's hard to tell.