mesa/src/asahi/lib
Alyssa Rosenzweig b824ef83ab util/dynarray: infer type in append
Most of the time, we can infer the type to append in
util_dynarray_append using __typeof__, which is standardized in C23 and
support in Jesse's MSMSVCV. This patch drops the type argument most of
the time, making util_dynarray a little more ergonomic to use.

This is done in four steps.

First, rename util_dynarray_append -> util_dynarray_append_typed

    bash -c "find . -type f -exec sed -i -e 's/util_dynarray_append(/util_dynarray_append_typed(/g' \{} \;"

Then, add a new append that infers the type. This is much more ergonomic
for what you want most of the time.

Next, use type-inferred append as much as possible, via Coccinelle
patch (plus manual fixup):

    @@
    expression dynarray, element;
    type type;
    @@

    -util_dynarray_append_typed(dynarray, type, element);
    +util_dynarray_append(dynarray, element);

Finally, hand fixup cases that Coccinelle missed or incorrectly
translated, of which there were several because we can't used the
untyped append with a literal (since the sizeof won't do what you want).

All four steps are squashed to produce a single patch changing every
util_dynarray_append call site in tree to either drop a type parameter
(if possible) or insert a _typed suffix (if we can't infer). As such,
the final patch is best reviewed by hand even though it was
tool-assisted.

No Long Linguine Meals were involved in the making of this patch.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38038>
2025-10-24 18:32:07 +00:00
..
tests asahi: add missing tib alignment check 2024-01-10 08:44:38 -04:00
agx_abi.h hk,asahi: move scratch BO to common 2025-06-27 15:31:44 +00:00
agx_bg_eot.c asahi: use 16-bit coordinates for bg program 2025-08-03 14:41:11 -04:00
agx_bg_eot.h asahi,vtn: precompile kernels 2024-11-28 17:34:12 +00:00
agx_bo.c asahi: Add refcnt assert to agx_bo_unreference() 2025-07-13 17:43:06 +00:00
agx_bo.h asahi: Ensure shared BOs have a prime_fd 2025-07-20 00:45:48 +09:00
agx_border.c build: avoid redefining unreachable() which is standard in C23 2025-07-31 17:49:42 +00:00
agx_device.c treewide: Make exported DRM FDs read-write. 2025-09-27 19:46:14 +00:00
agx_device.h asahi: enable virtgpu support 2025-08-06 11:11:06 +00:00
agx_device_virtio.c asahi: enable virtgpu support 2025-08-06 11:11:06 +00:00
agx_device_virtio.h asahi: add broken bits of unstable Linux UAPI 2024-06-14 15:44:30 +00:00
agx_helpers.h poly: Migrate AGX's GS/TESS emulation to common code 2025-10-16 19:25:35 +00:00
agx_linker.c asahi,hk: optimize no-op FS 2025-08-03 14:40:53 -04:00
agx_linker.h asahi,hk: optimize no-op FS 2025-08-03 14:40:53 -04:00
agx_nir_format_helpers.h asahi/lib: use #pragma once 2024-02-14 21:02:32 +00:00
agx_nir_lower_msaa.c treewide: use nir_break_if 2025-06-30 14:51:24 -04:00
agx_nir_lower_sample_intrinsics.c treewide: simplify nir_def_rewrite_uses_after 2025-08-01 15:34:24 +00:00
agx_nir_lower_tilebuffer.c asahi: switch tib lower to intrinsic pass 2025-02-22 02:24:28 +00:00
agx_nir_lower_uvs.c asahi: inline UVS indices 2025-08-03 21:57:26 +00:00
agx_nir_lower_vbo.c build: avoid redefining unreachable() which is standard in C23 2025-07-31 17:49:42 +00:00
agx_nir_lower_vbo.h hk: support static vertex input state 2025-07-22 11:21:50 +00:00
agx_nir_prolog_epilog.c poly: Migrate AGX's GS/TESS emulation to common code 2025-10-16 19:25:35 +00:00
agx_ppp.h asahi: split frag shader words 2024-05-16 13:25:56 -04:00
agx_scratch.c asahi,hk: mmap BO on first use 2024-12-02 19:26:46 +00:00
agx_scratch.h asahi,vtn: precompile kernels 2024-11-28 17:34:12 +00:00
agx_tilebuffer.c build: avoid redefining unreachable() which is standard in C23 2025-07-31 17:49:42 +00:00
agx_tilebuffer.h asahi/lib: Move alpha_to_one and alpha_to_coverage lowering to common code. 2025-04-23 09:03:41 +00:00
agx_usc.h all: rename PIPE_SHADER_FRAGMENT to MESA_SHADER_FRAGMENT 2025-08-06 10:28:39 +08:00
agx_uvs.h asahi: extend varying linking for tri fan weirdness 2024-05-14 04:57:27 +00:00
agx_va.c asahi: port to stable uAPI 2025-04-09 20:25:49 +00:00
asahi_proto.h asahi: port to stable uAPI 2025-04-09 20:25:49 +00:00
decode.c util/dynarray: infer type in append 2025-10-24 18:32:07 +00:00
decode.h asahi: drop image heap decode 2025-07-16 18:27:20 +00:00
dyld_interpose.h asahi: Clang-format the subtree 2022-12-27 22:46:29 +00:00
meson.build poly: Migrate AGX's GS/TESS emulation to common code 2025-10-16 19:25:35 +00:00
pool.c util/dynarray: infer type in append 2025-10-24 18:32:07 +00:00
pool.h asahi: label individual pools 2024-12-02 19:26:46 +00:00
wrap.c asahi: fix libwrap.dylib 2025-02-22 02:24:28 +00:00