Mesa (main): r300: disable PIPE_CAP_PREFER_IMM_ARRAYS_AS_CONSTBUF

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jul 19 20:39:06 UTC 2022


Module: Mesa
Branch: main
Commit: ae003ef78cb3a6e76edd32c5a6ae5766ebf51d3b
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ae003ef78cb3a6e76edd32c5a6ae5766ebf51d3b

Author: Pavel Ondračka <pavel.ondracka at gmail.com>
Date:   Sat Jul 16 07:57:33 2022 +0200

r300: disable PIPE_CAP_PREFER_IMM_ARRAYS_AS_CONSTBUF

We can't do uniform buffer objects and from the hardware
perspective constants (uniforms) and immediates are treated in
the same way. They are uploaded together and fit together into the
(rather low) total constant limit. Therefore, there is actually no
advantage in converting immediates to uniforms, and a whole lot of
disadvantages (less possible optimizations and no inlining).

Fixes the dEQP regressions from https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16770

The tests failed because when there is an indirect array access the
compiler inserts a big if ladder and converting the temp to a uniform
means more instructions because the ifs cant be lowered at least
partially to selects. It is particularly visible, because the code
NIR currently emits for the indirect access doesn't really fit the
hardware, see: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6366

No change in my shader-db, so this concerns the tests only.

Signed-off-by: Pavel Ondračka <pavel.ondracka at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17576>

---

 src/gallium/drivers/r300/ci/r300-rv515-fails.txt | 5 -----
 src/gallium/drivers/r300/r300_screen.c           | 3 +++
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/gallium/drivers/r300/ci/r300-rv515-fails.txt b/src/gallium/drivers/r300/ci/r300-rv515-fails.txt
index 8aa12cb4062..d92062c9c3e 100644
--- a/src/gallium/drivers/r300/ci/r300-rv515-fails.txt
+++ b/src/gallium/drivers/r300/ci/r300-rv515-fails.txt
@@ -45,11 +45,6 @@ dEQP-GLES2.functional.shaders.discard.dynamic_loop_always,Fail
 
 dEQP-GLES2.functional.shaders.indexing.tmp_array.float_dynamic_write_dynamic_loop_read_fragment,Fail
 
-# Too many instructions due to https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16770
-dEQP-GLES2.functional.shaders.indexing.tmp_array.vec2_const_write_dynamic_read_fragment,Fail
-dEQP-GLES2.functional.shaders.indexing.tmp_array.vec3_const_write_dynamic_read_fragment,Fail
-dEQP-GLES2.functional.shaders.indexing.tmp_array.vec4_const_write_dynamic_read_fragment,Fail
-
 dEQP-GLES2.functional.shaders.random.texture.fragment.141,Fail
 
 dEQP-GLES2.functional.shaders.return.return_in_dynamic_loop_dynamic_fragment,Fail
diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c
index ffcaf649141..59cbce86fad 100644
--- a/src/gallium/drivers/r300/r300_screen.c
+++ b/src/gallium/drivers/r300/r300_screen.c
@@ -220,6 +220,9 @@ static int r300_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
         case PIPE_CAP_MAX_VARYINGS:
             return 10;
 
+	case PIPE_CAP_PREFER_IMM_ARRAYS_AS_CONSTBUF:
+	    return 0;
+
         case PIPE_CAP_VENDOR_ID:
                 return 0x1002;
         case PIPE_CAP_DEVICE_ID:



More information about the mesa-commit mailing list