Mesa (main): nir: always keep the clip distance array size updated

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Nov 22 20:39:50 UTC 2021


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

Author: Ilia Mirkin <imirkin at alum.mit.edu>
Date:   Sun Nov 21 03:04:32 2021 -0500

nir: always keep the clip distance array size updated

Drivers expect to know the number of clip distances irrespective of
whether compact arrays are used or not.

Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
Reviewed-by: Connor Abbott <cwabbott0 at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13900>

---

 src/compiler/nir/nir_lower_clip.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/compiler/nir/nir_lower_clip.c b/src/compiler/nir/nir_lower_clip.c
index 91945f42c4a..5a9438bf386 100644
--- a/src/compiler/nir/nir_lower_clip.c
+++ b/src/compiler/nir/nir_lower_clip.c
@@ -74,8 +74,8 @@ create_clipdist_vars(nir_shader *shader, nir_variable **io_vars,
                      unsigned ucp_enables, bool output,
                      bool use_clipdist_array)
 {
+   shader->info.clip_distance_array_size = util_last_bit(ucp_enables);
    if (use_clipdist_array) {
-      shader->info.clip_distance_array_size = util_last_bit(ucp_enables);
       io_vars[0] =
          create_clipdist_var(shader, output,
                              VARYING_SLOT_CLIP_DIST0,



More information about the mesa-commit mailing list