Mesa (master): nir: Use src_is_invocation_id in get_deref_info.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sun Nov 22 01:03:11 UTC 2020


Module: Mesa
Branch: master
Commit: 5b77b14448c39d664460fd00d2a356d47858880f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=5b77b14448c39d664460fd00d2a356d47858880f

Author: Timur Kristóf <timur.kristof at gmail.com>
Date:   Sat Nov 21 16:05:22 2020 +0100

nir: Use src_is_invocation_id in get_deref_info.

Signed-off-by: Timur Kristof <timur.kristof at gmail.com>
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7622>

---

 src/compiler/nir/nir_gather_info.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/src/compiler/nir/nir_gather_info.c b/src/compiler/nir/nir_gather_info.c
index 2f468f75d04..bf0f1e37a9b 100644
--- a/src/compiler/nir/nir_gather_info.c
+++ b/src/compiler/nir/nir_gather_info.c
@@ -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++;
    }
 



More information about the mesa-commit mailing list