radeonsi: don't use fast color clear for small images even on APUs
authorMarek Olšák <marek.olsak@amd.com>
Tue, 12 Dec 2017 23:40:19 +0000 (00:40 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Mon, 25 Dec 2017 13:23:18 +0000 (14:23 +0100)
Increase the limit and handle non-square images better.

This makes glxgears 20% faster on APUs, and a little more on dGPUs.
We all use and love glxgears.

Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
src/gallium/drivers/radeonsi/si_clear.c

index 0ac83f446bf869a766153e695bb08de3ce36fc42..464b9d7ac563d227068cba9e5c8d4da837015a67 100644 (file)
@@ -425,12 +425,11 @@ static void si_do_fast_color_clear(struct si_context *sctx,
                 * the eliminate pass can be higher than the benefit of fast
                 * clear. The closed driver does this, but the numbers may differ.
                 *
-                * Always use fast clear on APUs.
+                * This helps on both dGPUs and APUs, even small APUs like Mullins.
                 */
-               bool too_small = sctx->screen->info.has_dedicated_vram &&
-                                tex->resource.b.b.nr_samples <= 1 &&
-                                tex->resource.b.b.width0 <= 256 &&
-                                tex->resource.b.b.height0 <= 256;
+               bool too_small = tex->resource.b.b.nr_samples <= 1 &&
+                                tex->resource.b.b.width0 *
+                                tex->resource.b.b.height0 <= 512 * 512;
 
                /* Try to clear DCC first, otherwise try CMASK. */
                if (vi_dcc_enabled(tex, 0)) {