summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2016-06-03 15:06:28 -0600
committerBrian Paul <[email protected]>2016-06-10 15:50:04 -0600
commit2db747cf266f51cfecc020b7aeb8c04bd527ad16 (patch)
tree76728346b9b0c417055d620538c27efb55ae65d2
parent672e92a1462b72b56a50e6b18f02a723c4b0fcc8 (diff)
llvmpipe: don't use 3-component formats, except 32-bit x 3 formats
This basically disallows all 8-bit x 3 and 16-bit x 3 formats for textures and render targets. Some 3-component formats were already disallowed before. This avoids problems with GL_ARB_copy_image. v2: the previous version of this patch disallowed all 3-component formats Reviewed-by: Charmaine Lee <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
-rw-r--r--src/gallium/drivers/llvmpipe/lp_screen.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c
index f2a12a00690..a44312c23d5 100644
--- a/src/gallium/drivers/llvmpipe/lp_screen.c
+++ b/src/gallium/drivers/llvmpipe/lp_screen.c
@@ -450,19 +450,20 @@ llvmpipe_is_format_supported( struct pipe_screen *_screen,
if (!format_desc->is_array && !format_desc->is_bitmask &&
format != PIPE_FORMAT_R11G11B10_FLOAT)
return FALSE;
+ }
- /*
- * XXX refuse formats known to crash in generate_unswizzled_blend().
- * These include all 3-channel 24bit RGB8 variants, plus 48bit
- * (except those using floats) 3-channel RGB16 variants (the latter
- * seems to be more of a llvm bug though).
- * The mesa state tracker only seems to use these for SINT/UINT formats.
+ if ((bind & (PIPE_BIND_RENDER_TARGET | PIPE_BIND_SAMPLER_VIEW)) &&
+ ((bind & PIPE_BIND_DISPLAY_TARGET) == 0)) {
+ /* Disable all 3-channel formats, where channel size != 32 bits.
+ * In some cases we run into crashes (in generate_unswizzled_blend()),
+ * for 3-channel RGB16 variants, there was an apparent LLVM bug.
+ * In any case, disabling the shallower 3-channel formats avoids a
+ * number of issues with GL_ARB_copy_image support.
*/
- if (format_desc->is_array && format_desc->nr_channels == 3) {
- if (format_desc->block.bits == 24 || (format_desc->block.bits == 48 &&
- !util_format_is_float(format))) {
- return FALSE;
- }
+ if (format_desc->is_array &&
+ format_desc->nr_channels == 3 &&
+ format_desc->block.bits != 96) {
+ return FALSE;
}
}