anv/apply_pipeline_layout: Set the cursor in lower_res_reindex_intrinsic

The loop through instructions doesn't set the cursor for us so unless we
set it somewhere, we may end up emitting instructions in the wrong
place.  The only reason why we haven't been bitten by this in the past
is that it only happens in a few variable pointers cases and the CTS
tests for those don't use much control flow so things were getting
emitted in the correct order by accident.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
This commit is contained in:
Jason Ekstrand 2018-12-13 18:33:46 -06:00 committed by Jason Ekstrand
parent 42b2f3e91f
commit f8992eb5ba

View file

@ -169,6 +169,8 @@ lower_res_reindex_intrinsic(nir_intrinsic_instr *intrin,
{
nir_builder *b = &state->builder;
b->cursor = nir_before_instr(&intrin->instr);
/* For us, the resource indices are just indices into the binding table and
* array elements are sequential. A resource_reindex just turns into an
* add of the two indices.