* texture format info: Invert R and B in RGBA4
d3d9: Revert 06c08adc9e to force software
conversion because the format doesn't exist
d3d11: Force software conversion because the format doesn't exist
gl: Revert 3e3e655262 to swizzle R and B
mtl: Swizzle channels
* metal: Remove explicit conversion of RGBA4 and RGB5A1 in osx
* metal: Set alpha bit to correct end of short
d3d9: Revert 76db2ed38d to force software
conversion and use the format that does exist
d3d11: Force software conversion because the format doesn't exist
gl: Revert b36aa71403 to swizzle R and B
mtl: Swizzle R and B
I noticed that this 0363560934
broke b5e7a4cccd/examples/16-shadowmaps/shadowmaps.cpp (L1750)
which shouldn't be the case. The validation was meant for only multisample flags.
my boolean logic assumes that it must be BGFX_TEXTURE_RT in the flag or BGFX_TEXTURE_RT_MSAA_XX in the flag.
* D3D12: Fix ResolveSubresource texture format parameter
For depth textures this always returned the TYPELESS one, but instead it should have passed the FLOAT.
* D3D11: Fix ResolveSubresource texture format parameter
For depth textures this always returned the TYPELESS one, but instead it should have passed the FLOAT.
Compute kSortKeyViewNumBits automatically via log2(BGFX_CONFIG_MAX_VIEWS), so that we could change BGFX_CONFIG_MAX_VIEWS to be above 2^10 = 1024 without changing the `bgfx` source code.
One possible problem with this approach is running out of bits, so maybe we could assert for that, I am not sure where to do it and how many bits we can use though.
Using `bx::uint32_cntlz` because `bx::log2` is not constexpr.
Tested on linux opengl with BGFX_CONFIG_MAX_VIEWS=4096, seems to work.
On Mesa, the pixel format would match the 0 stencil bits as requested. This change helps bring the pixel format to match what `createContext` would use.