summaryrefslogtreecommitdiffstats
path: root/src/compiler
diff options
context:
space:
mode:
authorLionel Landwerlin <[email protected]>2019-05-15 23:02:51 +0100
committerLionel Landwerlin <[email protected]>2019-05-16 10:22:01 +0100
commite04cf0b61269ca60b3260d81d94e625965d39901 (patch)
tree4dc3e4d2af286528bec2fe6f904bc0f30dcb6c10 /src/compiler
parent752367b76640fe4fbd6dbb98c1d9bff53c0db993 (diff)
nir: lower_non_uniform_access: iterate over instructions safely
This pass moves instructions around and adds control-flow in the middle of blocks. We need to use nir_foreach_instr_safe to ensure that we iterate over instructions correctly anyway. Signed-off-by: Lionel Landwerlin <[email protected]> Fixes: 3bd545764151 ("nir: Add a lowering pass for non-uniform resource access") Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/nir/nir_lower_non_uniform_access.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compiler/nir/nir_lower_non_uniform_access.c b/src/compiler/nir/nir_lower_non_uniform_access.c
index b2bdb4dd412..6367f5670e8 100644
--- a/src/compiler/nir/nir_lower_non_uniform_access.c
+++ b/src/compiler/nir/nir_lower_non_uniform_access.c
@@ -130,7 +130,7 @@ nir_lower_non_uniform_access_impl(nir_function_impl *impl,
nir_builder_init(&b, impl);
nir_foreach_block(block, impl) {
- nir_foreach_instr(instr, block) {
+ nir_foreach_instr_safe(instr, block) {
switch (instr->type) {
case nir_instr_type_tex: {
nir_tex_instr *tex = nir_instr_as_tex(instr);