Mesa (master): nir: Port to u_dynarray

Marek Olšák mareko at kemper.freedesktop.org
Wed Jun 7 19:08:47 UTC 2017


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

Author: Thomas Helland <thomashelland90 at gmail.com>
Date:   Wed Jun  7 20:45:41 2017 +0200

nir: Port to u_dynarray

Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Reviewed-by: Eric Engestrom <eric.engestrom at imgtec.com>

---

 src/compiler/spirv/vtn_cfg.c     | 6 +++---
 src/compiler/spirv/vtn_private.h | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/compiler/spirv/vtn_cfg.c b/src/compiler/spirv/vtn_cfg.c
index 54248b111d..50ef767dea 100644
--- a/src/compiler/spirv/vtn_cfg.c
+++ b/src/compiler/spirv/vtn_cfg.c
@@ -183,7 +183,7 @@ vtn_add_case(struct vtn_builder *b, struct vtn_switch *swtch,
       list_inithead(&c->body);
       c->start_block = case_block;
       c->fallthrough = NULL;
-      nir_array_init(&c->values, b);
+      util_dynarray_init(&c->values, b);
       c->is_default = false;
       c->visited = false;
 
@@ -195,7 +195,7 @@ vtn_add_case(struct vtn_builder *b, struct vtn_switch *swtch,
    if (is_default) {
       case_block->switch_case->is_default = true;
    } else {
-      nir_array_add(&case_block->switch_case->values, uint32_t, val);
+      util_dynarray_append(&case_block->switch_case->values, uint32_t, val);
    }
 }
 
@@ -709,7 +709,7 @@ vtn_emit_cf_list(struct vtn_builder *b, struct list_head *cf_list,
             }
 
             nir_ssa_def *cond = NULL;
-            nir_array_foreach(&cse->values, uint32_t, val) {
+            util_dynarray_foreach(&cse->values, uint32_t, val) {
                nir_ssa_def *is_val =
                   nir_ieq(&b->nb, sel, nir_imm_int(&b->nb, *val));
 
diff --git a/src/compiler/spirv/vtn_private.h b/src/compiler/spirv/vtn_private.h
index 5769c0c6cd..59fcc94fcd 100644
--- a/src/compiler/spirv/vtn_private.h
+++ b/src/compiler/spirv/vtn_private.h
@@ -30,7 +30,7 @@
 
 #include "nir/nir.h"
 #include "nir/nir_builder.h"
-#include "nir/nir_array.h"
+#include "util/u_dynarray.h"
 #include "nir_spirv.h"
 #include "spirv.h"
 
@@ -115,7 +115,7 @@ struct vtn_case {
    struct vtn_case *fallthrough;
 
    /* The uint32_t values that map to this case */
-   nir_array values;
+   struct util_dynarray values;
 
    /* True if this is the default case */
    bool is_default;




More information about the mesa-commit mailing list