freedreno: Disable PIPE_CAP_PREFER_IMM_ARRAYS_AS_CONSTBUF.
authorEric Anholt <eric@anholt.net>
Wed, 5 Aug 2020 00:03:34 +0000 (17:03 -0700)
committerEric Anholt <eric@anholt.net>
Mon, 16 Nov 2020 21:55:41 +0000 (13:55 -0800)
We now have NIR opt_large_constants support in place, so we can flip the
switch and get better optimization before lowering to a constant buffer,
but also avoid having constant data mixed in with the shader's uniforms,
which should lower CPU overhead on affected shaders.

Only a few shaders are affected (<.01% impact across shader-db), but for
those the impact is pretty big:

instructions in affected programs: 748 -> 639 (-14.57%)
nops in affected programs: 364 -> 284 (-21.98%)
non-nops in affected programs: 384 -> 355 (-7.55%)
mov in affected programs: 47 -> 27 (-42.55%)
cov in affected programs: 9 -> 6 (-33.33%)
dwords in affected programs: 932 -> 836 (-10.30%)
full in affected programs: 13 -> 14 (7.69%)
constlen in affected programs: 140 -> 64 (-54.29%)
(ss) in affected programs: 14 -> 15 (7.14%)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5810>

src/gallium/drivers/freedreno/freedreno_screen.c

index 7e78cba..705355f 100644 (file)
@@ -269,6 +269,9 @@ fd_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
        case PIPE_CAP_POLYGON_OFFSET_CLAMP:
                return is_a4xx(screen) || is_a5xx(screen) || is_a6xx(screen);
 
+       case PIPE_CAP_PREFER_IMM_ARRAYS_AS_CONSTBUF:
+               return 0;
+
        case PIPE_CAP_TEXTURE_BUFFER_OFFSET_ALIGNMENT:
                if (is_a3xx(screen)) return 16;
                if (is_a4xx(screen)) return 32;