Texture format info: Invert R and B in RGBA4 (#2878)

* 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
This commit is contained in:
Sandy
2022-08-22 22:03:22 -04:00
committed by GitHub
parent 31c92ece0a
commit 054a9ecd83
3 changed files with 14 additions and 6 deletions

View File

@@ -4504,6 +4504,11 @@ namespace bgfx { namespace d3d11
bimg::imageConvert(temp, 16, bx::packBgr5a1, mip.m_data, bx::unpackRgb5a1, srd[kk].SysMemPitch*mip.m_height);
srd[kk].pSysMem = temp;
break;
case TextureFormat::RGBA4:
temp = (uint8_t*)BX_ALLOC(g_allocator, srd[kk].SysMemPitch*mip.m_height);
bimg::imageConvert(temp, 16, bx::packBgra4, mip.m_data, bx::unpackRgba4, srd[kk].SysMemPitch*mip.m_height);
srd[kk].pSysMem = temp;
break;
}
}
@@ -4845,6 +4850,11 @@ namespace bgfx { namespace d3d11
bimg::imageConvert(temp, 16, bx::packBgr5a1, src, bx::unpackRgb5a1, rectpitch);
data = temp;
break;
case TextureFormat::RGBA4:
temp = (uint8_t*)BX_ALLOC(g_allocator, rectpitch);
bimg::imageConvert(temp, 16, bx::packBgra4, src, bx::unpackRgba4, rectpitch);
data = temp;
break;
}
src += srcpitch;
}