Mesa (master): freedreno: Disable PIPE_CAP_PREFER_IMM_ARRAYS_AS_CONSTBUF.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Nov 16 22:33:03 UTC 2020


Module: Mesa
Branch: master
Commit: 1beb477908c49ae962017d61bb4ca252640c9018
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=1beb477908c49ae962017d61bb4ca252640c9018

Author: Eric Anholt <eric at anholt.net>
Date:   Tue Aug  4 17:03:34 2020 -0700

freedreno: Disable PIPE_CAP_PREFER_IMM_ARRAYS_AS_CONSTBUF.

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 | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/gallium/drivers/freedreno/freedreno_screen.c b/src/gallium/drivers/freedreno/freedreno_screen.c
index 7e78cba585d..705355fd373 100644
--- a/src/gallium/drivers/freedreno/freedreno_screen.c
+++ b/src/gallium/drivers/freedreno/freedreno_screen.c
@@ -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;



More information about the mesa-commit mailing list