aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2018-12-13 18:33:46 -0600
committerJason Ekstrand <[email protected]>2019-01-08 00:38:29 +0000
commitf8992eb5badf91e0d9ad3732d56a4e3d78fd1abf (patch)
treebc18ba3458fa2f55a200611aeee4c6e4f6a59172
parent42b2f3e91f6d6c4eead40ef91e5edde68019f23c (diff)
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: [email protected] Reviewed-by: Alejandro PiƱeiro <[email protected]> Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]>
-rw-r--r--src/intel/vulkan/anv_nir_apply_pipeline_layout.c2
1 files changed, 2 insertions, 0 deletions
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.