summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuca Barbieri <luca@luca-barbieri.com>2010-08-24 21:02:18 +0200
committerLuca Barbieri <luca@luca-barbieri.com>2010-09-05 18:01:35 +0200
commit5e3c31316d68cb86e81795428baa95956e24ddd5 (patch)
tree59b0ab43beefe75e9afa41de3647f407306d7d5e
parent27732ebb037ab65e54153adbaf2501e306684815 (diff)
llvmpipe: refuse float16 formats for sampling/render in favor of float32
This should be faster, and the state tracker will automatically fall back to the 32-bit formats.
-rw-r--r--src/gallium/drivers/llvmpipe/lp_screen.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c
index 1e65a91fc6..1b07a98c21 100644
--- a/src/gallium/drivers/llvmpipe/lp_screen.c
+++ b/src/gallium/drivers/llvmpipe/lp_screen.c
@@ -246,6 +246,21 @@ llvmpipe_is_format_supported( struct pipe_screen *_screen,
if (sample_count > 1)
return FALSE;
+ if (bind & (PIPE_BIND_RENDER_TARGET | PIPE_BIND_SAMPLER_VIEW)) {
+ /* Reject 16-bit floating point formats because conversion is not native.
+ * The state tracker will fall back to 32-bit ones.
+ * TODO: extend this interface to allow us to return a "ok, but slow" answer
+ * TODO: fully enable this on (unreleased) CPUs supporting CVT16
+ */
+ unsigned i;
+ for(i = 0; i < format_desc->nr_channels; ++i)
+ {
+ if(format_desc->channel[0].type == UTIL_FORMAT_TYPE_FLOAT
+ && format_desc->channel[0].size < 32)
+ return FALSE;
+ }
+ }
+
if (bind & PIPE_BIND_RENDER_TARGET) {
if (format_desc->colorspace == UTIL_FORMAT_COLORSPACE_ZS)
return FALSE;