texture format info: Invert R and B in RGB5A1 (#2876)

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
This commit is contained in:
Sandy
2022-08-22 20:36:50 -04:00
committed by GitHub
parent 7cc56a01de
commit 58aeeaf155
4 changed files with 42 additions and 6 deletions

View File

@@ -3037,6 +3037,10 @@ namespace bgfx { namespace d3d9
uint32_t size = useMipSize ? mip.m_size : mipSize;
switch (m_textureFormat)
{
case TextureFormat::RGB5A1:
bimg::imageConvert(bits, 16, bx::packBgr5a1, mip.m_data, bx::unpackRgb5a1, size);
break;
case TextureFormat::RGBA4:
bimg::imageConvert(bits, 16, bx::packBgra4, mip.m_data, bx::unpackRgba4, size);
break;
@@ -3098,6 +3102,10 @@ namespace bgfx { namespace d3d9
{
switch (m_textureFormat)
{
case TextureFormat::RGB5A1:
bimg::imageConvert(dst, 16, bx::packBgr5a1, src, bx::unpackRgb5a1, rectpitch);
break;
case TextureFormat::RGBA4:
bimg::imageConvert(dst, 16, bx::packBgra4, src, bx::unpackRgba4, rectpitch);
break;