llvmpipe: add support for b5g6r5_srgb
authorRoland Scheidegger <sroland@vmware.com>
Thu, 20 Mar 2014 15:43:36 +0000 (16:43 +0100)
committerRoland Scheidegger <sroland@vmware.com>
Fri, 21 Mar 2014 16:23:38 +0000 (17:23 +0100)
commit9477d8c862b206c35de0bc957a08524188abc898
tree9fd13f6453dc28723b30b054451a41156b96a8e8
parent2aa77f2777ad35d7fe249939b0d828306f13eade
llvmpipe: add support for b5g6r5_srgb

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.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
src/gallium/auxiliary/gallivm/lp_bld_format.h
src/gallium/auxiliary/gallivm/lp_bld_format_soa.c
src/gallium/auxiliary/gallivm/lp_bld_format_srgb.c
src/gallium/drivers/llvmpipe/lp_screen.c
src/gallium/drivers/llvmpipe/lp_state_fs.c