[Mesa-dev] [PATCH 0/7] Unify our two dynamic array implementations

Thomas Helland thomashelland90 at gmail.com
Sat Jun 3 18:11:35 UTC 2017


We currently have two dynamic array implementations in mesa.
One lives in nir, and is used in only one location, and the
other lives in galliums util directory. Let's merge these two,
so that we can get the best of both worlds.

This series uses the u_dynarray from gallium as the basis,
and merges in the nir_array's iterator and support for using
ralloc for memory handling. It then ports the user of nir_array,
and deletes it.

I have not tested this on freedreno, as I'm having some issues
building it. It seems to be the only user of u_dynarray that
I have not been able to at least build-test, so there might be
similar include-related issues as uncovered for nouveau.

I still have to do some thorough testing, but I tested a quick
run with shader-db, and there where no immediate crashes and
no ir validation failures, so that counts for something.

Let me know what you think. A disadvantage is the slightly
higher memory usage due to the extra pointer stored for the
ralloc mem_ctx compared to u_dynarray before this series.

Thomas Helland (7):
  gallium: Add missing includes
  util: Move u_dynarray to src/util
  util: Remove unused includes and convert to lower-case memory ops
  util: Port nir_array functionality to u_dynarray
  nir: Remove unused include
  nir: Port to u_dynarray and delete nir_array
  util: Add extern c to u_dynarray.h

 src/compiler/Makefile.sources                    |  1 -
 src/compiler/nir/nir_array.h                     | 99 ------------------------
 src/compiler/nir/nir_lower_locals_to_regs.c      |  1 -
 src/compiler/spirv/vtn_cfg.c                     |  6 +-
 src/compiler/spirv/vtn_private.h                 |  4 +-
 src/gallium/auxiliary/Makefile.sources           |  1 -
 src/gallium/drivers/freedreno/freedreno_batch.c  |  6 +-
 src/gallium/drivers/nouveau/nv30/nvfx_fragprog.c |  3 +-
 src/gallium/drivers/nouveau/nv30/nvfx_vertprog.c |  3 +-
 src/gallium/drivers/nouveau/nv50/nv50_context.c  |  2 +-
 src/gallium/drivers/nouveau/nvc0/nvc0_context.c  |  2 +-
 src/gallium/state_trackers/va/config.c           |  1 +
 src/gallium/state_trackers/va/postproc.c         |  1 +
 src/gallium/state_trackers/va/surface.c          |  2 +-
 src/util/Makefile.sources                        |  1 +
 src/{gallium/auxiliary => }/util/u_dynarray.h    | 72 ++++++++++++-----
 16 files changed, 70 insertions(+), 135 deletions(-)
 delete mode 100644 src/compiler/nir/nir_array.h
 rename src/{gallium/auxiliary => }/util/u_dynarray.h (70%)

-- 
2.13.0



More information about the mesa-dev mailing list