diff options
author | Roland Scheidegger <[email protected]> | 2013-07-16 01:52:29 +0200 |
---|---|---|
committer | Roland Scheidegger <[email protected]> | 2013-07-16 01:54:51 +0200 |
commit | dc1cc928edc09b3e804702d299f1c71aef014354 (patch) | |
tree | 7cf01823f5b41e56729f7ffad4dd6c055f57a8b5 /src/gallium/drivers/llvmpipe/lp_screen.c | |
parent | a882067d74840ab87e35018bca53081f8deb460b (diff) |
llvmpipe: support sRGB framebuffers
Just use the new conversion functions to do the work. The way it's plugged
in into the blend code is quite hacktastic but follows all the same hacks
as used by packed float format already.
Only support 4x8bit srgb formats (rgba/rgbx plus swizzle), 24bit formats never
worked anyway in the blend code and are thus disabled, and I don't think anyone
is interested in L8/L8A8. Would need even more hacks otherwise.
Unless I'm missing something, this is the last feature except MSAA needed for
OpenGL 3.0, and for OpenGL 3.1 as well I believe.
v2: prettify a bit, use separate function for packing.
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.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c index 1fed537899a..26aac329e67 100644 --- a/src/gallium/drivers/llvmpipe/lp_screen.c +++ b/src/gallium/drivers/llvmpipe/lp_screen.c @@ -328,12 +328,17 @@ llvmpipe_is_format_supported( struct pipe_screen *_screen, return FALSE; if (bind & PIPE_BIND_RENDER_TARGET) { - if (format_desc->colorspace != UTIL_FORMAT_COLORSPACE_RGB) + if (format_desc->colorspace == UTIL_FORMAT_COLORSPACE_SRGB) { + if (format_desc->nr_channels < 3) + return FALSE; + } + else if (format_desc->colorspace != UTIL_FORMAT_COLORSPACE_RGB) return FALSE; if (format_desc->layout != UTIL_FORMAT_LAYOUT_PLAIN && format != PIPE_FORMAT_R11G11B10_FLOAT) return FALSE; + assert(format_desc->block.width == 1); assert(format_desc->block.height == 1); |