nir: Use src_is_invocation_id in get_deref_info.
authorTimur Kristóf <timur.kristof@gmail.com>
Sat, 21 Nov 2020 15:05:22 +0000 (16:05 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Sun, 22 Nov 2020 00:38:57 +0000 (19:38 -0500)
Signed-off-by: Timur Kristof <timur.kristof@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7622>

src/compiler/nir/nir_gather_info.c

index 2f468f7..bf0f1e3 100644 (file)
@@ -53,11 +53,7 @@ get_deref_info(nir_shader *shader, nir_variable *var, nir_deref_instr *deref,
    /* Vertex index is the outermost array index. */
    if (per_vertex) {
       assert((*p)->deref_type == nir_deref_type_array);
-      nir_instr *vertex_index_instr = (*p)->arr.index.ssa->parent_instr;
-      *cross_invocation =
-         vertex_index_instr->type != nir_instr_type_intrinsic ||
-         nir_instr_as_intrinsic(vertex_index_instr)->intrinsic !=
-            nir_intrinsic_load_invocation_id;
+      *cross_invocation = src_is_invocation_id(&(*p)->arr.index);
       p++;
    }