aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/llvmpipe/lp_screen.c
diff options
context:
space:
mode:
authorRoland Scheidegger <[email protected]>2013-03-22 20:09:18 +0100
committerRoland Scheidegger <[email protected]>2013-03-22 20:10:53 +0100
commitb101a094b5576337f5bb7aecf525eb1755757b9c (patch)
treed429450eb17043860c80edc726aa5df008f66474 /src/gallium/drivers/llvmpipe/lp_screen.c
parent31009b45213ae9efab6af9d8efcc061194919b12 (diff)
llvmpipe: add EXT_packed_float render target format support
New conversion code to handle conversion from/to r11g11b10 AoS to/from SoA floats, and also add code for conversion from rgb9e5 AoS to float SoA (which works pretty much the same as r11g11b10 except for the packing). (This code should also be used for texture sampling instead of relying on u_format conversion but it's not yet, so rgb9e5 is unused.) Unfortunately a crazy amount of hacks is necessary to get the conversion code running in llvmpipe's generate_unswizzled_blend, which isn't well suited for formats where the storage representation has nothing to do with what's needed for blending (moreover, the conversion will convert from packed AoS values, which is the storage format, to float SoA values, because this is much more natural for the conversion, and likewise from SoA values to packed AoS values - but the "blend" (which includes trivial things like partial mask) works on AoS values, so incoming fs values will go SoA->AoS, values from destination will go packed AoS->SoA->AoS, then do blend, then AoS->SoA->packed AoS which probably isn't the most efficient way though the shuffles are probably bearable). Passes piglit fbo-blending-formats (with GL_EXT_packed_float parameter), still need to verify Inf/NaNs (where most of the complexity in the conversion comes from actually). v2: drop the (very bogus) rgb9e5 part, and do component extraction in the helper code for r11g11b10 to float conversion, making the code slightly more compact (suggested by Jose), now that there are no other callers left this works quite well. (Could do the same for the opposite way but it's less than ideal there, final part of packing needs to be done in caller anyway and there'd be another conditional.) v3: minor style and comment fixes. Also fix a potential issue with negative zero being potentially returned by max(src, zero) as we don't have well-defined min/max behavior (fortunately no additonal cost). 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.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c
index 5ec1df659b8..6760db0b38f 100644
--- a/src/gallium/drivers/llvmpipe/lp_screen.c
+++ b/src/gallium/drivers/llvmpipe/lp_screen.c
@@ -322,7 +322,8 @@ llvmpipe_is_format_supported( struct pipe_screen *_screen,
if (format_desc->colorspace != UTIL_FORMAT_COLORSPACE_RGB)
return FALSE;
- if (format_desc->layout != UTIL_FORMAT_LAYOUT_PLAIN)
+ 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);
@@ -330,7 +331,8 @@ llvmpipe_is_format_supported( struct pipe_screen *_screen,
if (format_desc->is_mixed)
return FALSE;
- if (!format_desc->is_array && !format_desc->is_bitmask)
+ if (!format_desc->is_array && !format_desc->is_bitmask &&
+ format != PIPE_FORMAT_R11G11B10_FLOAT)
return FALSE;
/*