I have a Direct3D 11 renderer that I'm implementing shared surfaces in to display content in a WPF application (which only uses Direct3D 9).
On the D3D11 side my back buffer is using the format DXGI_FORMAT_R8G8B8A8_UNORM and this works fine. According to this documentation DXGI_FORMAT_R8G8B8A8_UNORM maps to D3DFMT_A8B8G8R8 in D3D9. However, when I go to create the texture on the D3D9 side using that format it fails. I'm using Windows 10 and there's no D3D9 debug runtime so all I get is a D3DERR_INVALIDCALL as a result with no additional information.
This documentation seems to say that only the ARGB format is supported for back buffers in D3D9, with the ABGR format not listed under any section for support. Is this a mistake in the documentation or is this format completely unsupported?
If I instead use DXGI_FORMAT_B8G8R8A8_UNORM on the D3D11 side and D3DFMT_A8R8G8B8 on the D3D9 side texture creation succeeds.
For further confusion, this post implies that DXGI_FORMAT_R8G8B8A8_UNORM should be the more compatible format, yet it's the one I'm having trouble with.
I've also confirmed this behavior with the Microsoft WPF DirectX Interop sample on GitHub. Out of the box it's using DXGI_FORMAT_R8G8B8A8_UNORM and works fine, but if I change the back buffer to DXGI_FORMAT_B8G8R8A8_UNORM it breaks.
Why does a format that my video card supports work in one API and not the other? How do I know for sure which formats are supported in D3D9?