From e1f6000b540c3d48cb573653db6e1bf4e0003050 Mon Sep 17 00:00:00 2001 From: Connor Abbott Date: Fri, 21 Aug 2020 15:51:47 +0200 Subject: [PATCH] nir/lower_io_arrays: Fix xfb_offset bug I noticed this once I started gathering xfb_info after nir_lower_io_arrays_to_elements_no_indirect. Fixes: b2bbd978d0b ("nir: fix lowering arrays to elements for XFB outputs") Reviewed-by: Caio Marcelo de Oliveira Filho Part-of: (cherry picked from commit 5a88db682e08b5e58b40653872569f5b5d77777d) --- .pick_status.json | 2 +- src/compiler/nir/nir_lower_io_arrays_to_elements.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 57d4ab82da8..1fce3727bb4 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -211,7 +211,7 @@ "description": "nir/lower_io_arrays: Fix xfb_offset bug", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "master_sha": null, "because_sha": "b2bbd978d0b1c85919c6f3b5f631b3c6cbaaaf8a" }, diff --git a/src/compiler/nir/nir_lower_io_arrays_to_elements.c b/src/compiler/nir/nir_lower_io_arrays_to_elements.c index e49abefc0d4..376326575b0 100644 --- a/src/compiler/nir/nir_lower_io_arrays_to_elements.c +++ b/src/compiler/nir/nir_lower_io_arrays_to_elements.c @@ -61,7 +61,7 @@ get_io_offset(nir_builder *b, nir_deref_instr *deref, nir_variable *var, unsigned size = glsl_count_attribute_slots((*p)->type, false); offset += size * index; - xfb_offset += index * glsl_get_component_slots((*p)->type) * 4; + *xfb_offset += index * glsl_get_component_slots((*p)->type) * 4; unsigned num_elements = glsl_type_is_array((*p)->type) ? glsl_get_aoa_size((*p)->type) : 1;