[METAL] Fragment shader texture pixel format linked to swapchain format

I am trying to sample a RGBA8Unorm texture in a fragment shader that uses an output format of BGRA8Unorm and getting weird results.
Using the simple texturing sample provided if the input texture to the fragment shader is declared as RGBA8 and the swapchain format is declared as BGRA8, both the input and output textures have the R and B values swapped.
I would assume it should correctly convert the texture formats not just use R as B and B as R.


Please correct me if I'm missing something obvious.

Accepted Reply

Figured it out.
Turns out there's an xcode project setting to compress png's and stip header information which causes loss of format information when loading the texture.
Turning both off fixed the texture format inconsistencies and stopped auto converting png's to bgra.

Replies

Figured it out.
Turns out there's an xcode project setting to compress png's and stip header information which causes loss of format information when loading the texture.
Turning both off fixed the texture format inconsistencies and stopped auto converting png's to bgra.