Mesa (main): nir/lower_clip: location offset goes into offset, not base

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sun Nov 28 05:39:47 UTC 2021


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

Author: Ilia Mirkin <imirkin at alum.mit.edu>
Date:   Mon Nov 22 17:54:09 2021 -0500

nir/lower_clip: location offset goes into offset, not base

Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
Reviewed-by: Emma Anholt <emma at anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13917>

---

 src/compiler/nir/nir_lower_clip.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/compiler/nir/nir_lower_clip.c b/src/compiler/nir/nir_lower_clip.c
index 9bb167eeaa6..e7220127dc4 100644
--- a/src/compiler/nir/nir_lower_clip.c
+++ b/src/compiler/nir/nir_lower_clip.c
@@ -121,14 +121,14 @@ load_clipdist_input(nir_builder *b, nir_variable *in, int location_offset,
       nir_ssa_def *barycentric = nir_load_barycentric(
             b, nir_intrinsic_load_barycentric_pixel, INTERP_MODE_NONE);
       load = nir_load_interpolated_input(
-            b, 4, 32, barycentric, nir_imm_int(b, 0),
-            .base = in->data.driver_location + location_offset,
+            b, 4, 32, barycentric, nir_imm_int(b, location_offset),
+            .base = in->data.driver_location,
             .dest_type = nir_type_float32,
             .io_semantics = semantics);
 
    } else {
-      load = nir_load_input(b, 4, 32, nir_imm_int(b, 0),
-                            .base = in->data.driver_location + location_offset,
+      load = nir_load_input(b, 4, 32, nir_imm_int(b, location_offset),
+                            .base = in->data.driver_location,
                             .dest_type = nir_type_float32,
                             .io_semantics = semantics);
    }



More information about the mesa-commit mailing list