llvmpipe: add support for b5g6r5_srgb

Graphics / Mesa 3D Graphics Library / Mesa - Roland Scheidegger [vmware.com] - 21 March 2014 11:23 UTC

The conversion code for srgb was tuned for n x 4x8bit AoS -> 4 x nxfloat SoA (and vice versa), fix this to handle also 16bit 565-style srgb formats. Still not really all that generic, things like r10g10b10a2_srgb or r4g4b4a4_srgb wouldn't work (the latter trivial to fix, the former would not require more work to not crash but near certainly need some higher precision calculation) but not needed right now. The code is not fully optimized for this (could use more direct calculation instead of expanding to 8-bit range first) but should be good enough.

9477d8c llvmpipe: add support for b5g6r5_srgb
src/gallium/auxiliary/gallivm/lp_bld_format.h | 1 +
src/gallium/auxiliary/gallivm/lp_bld_format_soa.c | 3 +-
src/gallium/auxiliary/gallivm/lp_bld_format_srgb.c | 26 +++++++++++--
src/gallium/drivers/llvmpipe/lp_screen.c | 1 +
src/gallium/drivers/llvmpipe/lp_state_fs.c | 39 ++++++++++++++++++--
5 files changed, 61 insertions(+), 9 deletions(-)

Upstream: cgit.freedesktop.org


  • Share