nir: fix wrong assignment to buffer in xfb_varyings_info
authorHyunjun Ko <zzoon@igalia.com>
Mon, 6 Apr 2020 04:55:19 +0000 (04:55 +0000)
committerMarge Bot <eric+marge@anholt.net>
Mon, 6 Apr 2020 08:55:05 +0000 (08:55 +0000)
Tested with dEQP-VK.transform_feedback.fuzz.various_buffers.buffers100_instance_array_vertex

Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Cc: mesa-stable@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

index bcbc2a3a4c3954ac290d93a782b6bcc6bbf8f398..7a3ce7966d39c908900dd4dbc5b6e1b89628b346 100644 (file)
@@ -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) {