mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-02-19 21:42:59 +01:00
Texture format info: Invert R and B in RGBA4 (#2878)
* texture format info: Invert R and B in RGBA4 d3d9: Revert06c08adc9eto force software conversion because the format doesn't exist d3d11: Force software conversion because the format doesn't exist gl: Revert3e3e655262to 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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user