Mesa (master): nir: fix wrong assignment to buffer in xfb_varyings_info

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Apr 6 09:13:45 UTC 2020


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

Author: Hyunjun Ko <zzoon at igalia.com>
Date:   Mon Apr  6 04:55:19 2020 +0000

nir: fix wrong assignment to buffer in xfb_varyings_info

Tested with dEQP-VK.transform_feedback.fuzz.various_buffers.buffers100_instance_array_vertex

Signed-off-by: Hyunjun Ko <zzoon at igalia.com>
Reviewed-by: Tapani Pälli <tapani.palli at intel.com>
Cc: mesa-stable at lists.freedesktop.org
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4459>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4459>

---

 src/compiler/nir/nir_gather_xfb_info.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/compiler/nir/nir_gather_xfb_info.c b/src/compiler/nir/nir_gather_xfb_info.c
index bcbc2a3a4c3..7a3ce7966d3 100644
--- a/src/compiler/nir/nir_gather_xfb_info.c
+++ b/src/compiler/nir/nir_gather_xfb_info.c
@@ -28,7 +28,7 @@
 static void
 add_var_xfb_varying(nir_xfb_info *xfb,
                     nir_xfb_varyings_info *varyings,
-                    nir_variable *var,
+                    unsigned buffer,
                     unsigned offset,
                     const struct glsl_type *type)
 {
@@ -38,9 +38,9 @@ add_var_xfb_varying(nir_xfb_info *xfb,
    nir_xfb_varying_info *varying = &varyings->varyings[varyings->varying_count++];
 
    varying->type = type;
-   varying->buffer = var->data.xfb.buffer;
+   varying->buffer = buffer;
    varying->offset = offset;
-   xfb->buffers[var->data.xfb.buffer].varying_count++;
+   xfb->buffers[buffer].varying_count++;
 }
 
 
@@ -83,7 +83,7 @@ add_var_xfb_outputs(nir_xfb_info *xfb,
       if (!glsl_type_is_array(child_type) &&
           !glsl_type_is_struct(child_type)) {
 
-         add_var_xfb_varying(xfb, varyings, var, *offset, type);
+         add_var_xfb_varying(xfb, varyings, buffer, *offset, type);
          varying_added = true;
       }
 
@@ -138,7 +138,7 @@ add_var_xfb_outputs(nir_xfb_info *xfb,
       unsigned comp_offset = var->data.location_frac;
 
       if (!varying_added) {
-         add_var_xfb_varying(xfb, varyings, var, *offset, type);
+         add_var_xfb_varying(xfb, varyings, buffer, *offset, type);
       }
 
       while (comp_mask) {



More information about the mesa-commit mailing list