[Mesa-dev] [PATCH] nir/rfc: don't compare casts

Dave Airlie airlied at gmail.com
Mon Nov 19 04:22:41 UTC 2018


From: Dave Airlie <airlied at redhat.com>

I've no idea how right or wrong this is, it stops a crash with
dEQP-VK.spirv_assembly.instruction.compute.variable_pointers.compute.workgroup_two_buffers
on radv with variablePointers.
---
 src/compiler/nir/nir_deref.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/compiler/nir/nir_deref.c b/src/compiler/nir/nir_deref.c
index 4a2e81956d1..fe75febe037 100644
--- a/src/compiler/nir/nir_deref.c
+++ b/src/compiler/nir/nir_deref.c
@@ -365,6 +365,10 @@ nir_compare_derefs(nir_deref_instr *a, nir_deref_instr *b)
              nir_derefs_a_contains_b_bit | nir_derefs_b_contains_a_bit;
    }
 
+   if (a->deref_type == nir_deref_type_cast ||
+       b->deref_type == nir_deref_type_cast)
+     return 0;
+
    nir_deref_path a_path, b_path;
    nir_deref_path_init(&a_path, a, NULL);
    nir_deref_path_init(&b_path, b, NULL);
-- 
2.17.2



More information about the mesa-dev mailing list