From 9f174eb2df128dd89f61ac07b5d394c24668a43c Mon Sep 17 00:00:00 2001 From: Hyunjun Ko Date: Mon, 6 Apr 2020 04:55:19 +0000 Subject: [PATCH] nir: fix wrong assignment to buffer in xfb_varyings_info MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Tested with dEQP-VK.transform_feedback.fuzz.various_buffers.buffers100_instance_array_vertex Signed-off-by: Hyunjun Ko Reviewed-by: Tapani Pälli Cc: mesa-stable@lists.freedesktop.org Tested-by: Marge Bot Part-of: --- 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) { -- 2.30.2