From: Jason Ekstrand Date: Fri, 14 Dec 2018 00:33:46 +0000 (-0600) Subject: anv/apply_pipeline_layout: Set the cursor in lower_res_reindex_intrinsic X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f8992eb5badf91e0d9ad3732d56a4e3d78fd1abf;p=mesa.git 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 Reviewed-by: Caio Marcelo de Oliveira Filho --- diff --git a/src/intel/vulkan/anv_nir_apply_pipeline_layout.c b/src/intel/vulkan/anv_nir_apply_pipeline_layout.c index 4e405ae4bb0..00f0798da35 100644 --- a/src/intel/vulkan/anv_nir_apply_pipeline_layout.c +++ b/src/intel/vulkan/anv_nir_apply_pipeline_layout.c @@ -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.