summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/llvmpipe/lp_screen.c
diff options
context:
space:
mode:
authorRoland Scheidegger <[email protected]>2014-03-20 16:43:36 +0100
committerRoland Scheidegger <[email protected]>2014-03-21 17:23:38 +0100
commit9477d8c862b206c35de0bc957a08524188abc898 (patch)
tree9fd13f6453dc28723b30b054451a41156b96a8e8 /src/gallium/drivers/llvmpipe/lp_screen.c
parent2aa77f2777ad35d7fe249939b0d828306f13eade (diff)
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 <[email protected]>
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_screen.c')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_screen.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c
index c8e95fe329e..fe06e34f675 100644
--- a/src/gallium/drivers/llvmpipe/lp_screen.c
+++ b/src/gallium/drivers/llvmpipe/lp_screen.c
@@ -342,6 +342,7 @@ llvmpipe_is_format_supported( struct pipe_screen *_screen,
if (bind & PIPE_BIND_RENDER_TARGET) {
if (format_desc->colorspace == UTIL_FORMAT_COLORSPACE_SRGB) {
+ /* this is a lie actually other formats COULD exist where we would fail */
if (format_desc->nr_channels < 3)
return FALSE;
}