treewide: use UTIL_DYNARRAY_INIT

Instead of util_dynarray_init(&dynarray, NULL), just use
UTIL_DYNARRAY_INIT instead. This is more ergonomic.

Via Coccinelle patch:

    @@
    identifier dynarray;
    @@

    -struct util_dynarray dynarray = {0};
    -util_dynarray_init(&dynarray, NULL);
    +struct util_dynarray dynarray = UTIL_DYNARRAY_INIT;

    @@
    identifier dynarray;
    @@

    -struct util_dynarray dynarray;
    -util_dynarray_init(&dynarray, NULL);
    +struct util_dynarray dynarray = UTIL_DYNARRAY_INIT;

    @@
    expression dynarray;
    @@

    -util_dynarray_init(&(dynarray), NULL);
    +dynarray = UTIL_DYNARRAY_INIT;

    @@
    expression dynarray;
    @@

    -util_dynarray_init(dynarray, NULL);
    +(*dynarray) = UTIL_DYNARRAY_INIT;

Followed by sed:

    bash -c "find . -type f -exec sed -i -e 's/util_dynarray_init(&\(.*\), NULL)/\1 = UTIL_DYNARRAY_INIT/g' \{} \;"
    bash -c "find . -type f -exec sed -i -e 's/util_dynarray_init( &\(.*\), NULL )/\1 = UTIL_DYNARRAY_INIT/g' \{} \;"
    bash -c "find . -type f -exec sed -i -e 's/util_dynarray_init(\(.*\), NULL)/*\1 = UTIL_DYNARRAY_INIT/g' \{} \;"

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com>
Reviewed-by: Mel Henning <mhenning@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38189>
This commit is contained in:
Alyssa Rosenzweig 2025-10-31 13:48:53 -04:00 committed by Marge Bot
parent f6f23dfdd1
commit 17355f716b
102 changed files with 177 additions and 197 deletions

View file

@ -313,7 +313,7 @@ void ac_gather_context_rolls(FILE *f, uint32_t **ibs, uint32_t *ib_dw_sizes, uns
memset(&ctx, 0, sizeof(ctx));
ctx.info = info;
ctx.cur = CALLOC_STRUCT(ac_context_reg_state);
util_dynarray_init(&ctx.rolls, NULL);
ctx.rolls = UTIL_DYNARRAY_INIT;
/* Parse the IBs. */
for (unsigned i = 0; i < num_ibs; i++)

View file

@ -1220,7 +1220,7 @@ radv_create_cmd_buffer(struct vk_command_pool *pool, VkCommandBufferLevel level,
vk_object_base_init(&device->vk, &cmd_buffer->descriptors[i].push_set.set.base, VK_OBJECT_TYPE_DESCRIPTOR_SET);
cmd_buffer->accel_struct_buffers = _mesa_pointer_set_create(NULL);
util_dynarray_init(&cmd_buffer->ray_history, NULL);
cmd_buffer->ray_history = UTIL_DYNARRAY_INIT;
}
*cmd_buffer_out = &cmd_buffer->vk;

View file

@ -151,7 +151,7 @@ radv_init_adress_binding_report(struct radv_device *device)
return false;
simple_mtx_init(&device->addr_binding_tracker->mtx, mtx_plain);
util_dynarray_init(&device->addr_binding_tracker->reports, NULL);
device->addr_binding_tracker->reports = UTIL_DYNARRAY_INIT;
VkDebugUtilsMessengerCreateInfoEXT create_info = {
.messageSeverity = VK_DEBUG_UTILS_MESSAGE_SEVERITY_INFO_BIT_EXT,

View file

@ -22,7 +22,7 @@ radv_printf_data_init(struct radv_device *device)
{
const struct radv_physical_device *pdev = radv_device_physical(device);
util_dynarray_init(&device->printf.formats, NULL);
device->printf.formats = UTIL_DYNARRAY_INIT;
device->printf.buffer_size = debug_get_num_option("RADV_PRINTF_BUFFER_SIZE", 0);
if (device->printf.buffer_size < sizeof(struct radv_printf_buffer_header))

View file

@ -376,7 +376,7 @@ radv_CreatePipelineBinariesKHR(VkDevice _device, const VkPipelineBinaryCreateInf
for (uint32_t i = 0; i < pBinaries->pipelineBinaryCount; i++)
pBinaries->pPipelineBinaries[i] = VK_NULL_HANDLE;
util_dynarray_init(&pipeline_binaries, NULL);
pipeline_binaries = UTIL_DYNARRAY_INIT;
/* Get all pipeline binaries from the pCreateInfo first to simplify the creation. */
result = radv_create_pipeline_binaries(device, pCreateInfo, pAllocator, &pipeline_binaries, NULL);

View file

@ -487,7 +487,7 @@ radv_rra_trace_init(struct radv_device *device)
radv_find_memory_index(pdev, VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT |
VK_MEMORY_PROPERTY_HOST_CACHED_BIT);
util_dynarray_init(&device->rra_trace.ray_history, NULL);
device->rra_trace.ray_history = UTIL_DYNARRAY_INIT;
device->rra_trace.ray_history_buffer_size = debug_get_num_option("RADV_RRA_TRACE_HISTORY_SIZE", 100 * 1024 * 1024);
if (device->rra_trace.ray_history_buffer_size <

View file

@ -3787,8 +3787,7 @@ agx_compile_shader_nir(nir_shader *nir, struct agx_shader_key *key,
agx_compiler_debug = agx_get_compiler_debug();
struct agx_shader_info *info = &out->info;
struct util_dynarray binary;
util_dynarray_init(&binary, NULL);
struct util_dynarray binary = UTIL_DYNARRAY_INIT;
memset(out, 0, sizeof *out);

View file

@ -615,8 +615,7 @@ find_regs(struct ra_ctx *rctx, agx_instr *I, unsigned dest_idx, unsigned count,
assert(!rctx->early_killed && "no live range splits with early kill");
assert(cls == RA_GPR && "no memory live range splits");
struct util_dynarray copies = {0};
util_dynarray_init(&copies, NULL);
struct util_dynarray copies = UTIL_DYNARRAY_INIT;
reg = assign_regs_by_copying(rctx, I->dest[dest_idx], I, &copies);

View file

@ -634,7 +634,7 @@ calculate_local_next_use(struct spill_ctx *ctx, struct util_dynarray *out)
struct spill_block *sb = spill_block(ctx, ctx->block);
unsigned ip = sb->cycles;
util_dynarray_init(out, NULL);
*out = UTIL_DYNARRAY_INIT;
struct next_uses nu;
init_next_uses(&nu, NULL);

View file

@ -19,7 +19,7 @@ agx_test_builder(void *memctx)
list_inithead(&ctx->blocks);
agx_block *blk = rzalloc(ctx, agx_block);
util_dynarray_init(&blk->predecessors, NULL);
blk->predecessors = UTIL_DYNARRAY_INIT;
ctx->num_blocks = 1;
list_addtail(&blk->link, &ctx->blocks);

View file

@ -36,7 +36,7 @@ agx_pool_init(struct agx_pool *pool, struct agx_device *dev, const char *label,
pool->dev = dev;
pool->create_flags = create_flags;
pool->label = label;
util_dynarray_init(&pool->bos, NULL);
pool->bos = UTIL_DYNARRAY_INIT;
if (prealloc)
agx_pool_alloc_backing(pool, POOL_SLAB_SIZE);

View file

@ -106,7 +106,7 @@ hk_create_cmd_buffer(struct vk_command_pool *vk_pool,
return result;
}
util_dynarray_init(&cmd->large_bos, NULL);
cmd->large_bos = UTIL_DYNARRAY_INIT;
cmd->vk.dynamic_graphics_state.vi = &cmd->state.gfx._dynamic_vi;
cmd->vk.dynamic_graphics_state.ms.sample_locations =
@ -831,8 +831,8 @@ hk_cs_init_graphics(struct hk_cmd_buffer *cmd, struct hk_cs *cs)
agx_ppp_fini(&map, &ppp);
cs->current = map;
util_dynarray_init(&cs->scissor, NULL);
util_dynarray_init(&cs->depth_bias, NULL);
cs->scissor = UTIL_DYNARRAY_INIT;
cs->depth_bias = UTIL_DYNARRAY_INIT;
/* All graphics state must be reemited in each control stream */
hk_cmd_buffer_dirty_all(cmd);

View file

@ -435,8 +435,8 @@ hk_CreateDevice(VkPhysicalDevice physicalDevice,
agx_scratch_init(&dev->dev, &dev->scratch.cs);
u_rwlock_init(&dev->external_bos.lock);
util_dynarray_init(&dev->external_bos.counts, NULL);
util_dynarray_init(&dev->external_bos.list, NULL);
dev->external_bos.counts = UTIL_DYNARRAY_INIT;
dev->external_bos.list = UTIL_DYNARRAY_INIT;
return VK_SUCCESS;

View file

@ -167,7 +167,7 @@ hk_queue_write(struct hk_cmd_buffer *cmd, uint64_t address, uint32_t value,
struct libagx_imm_write imm = {.address = address, .value = value};
if (!cs->imm_writes.data) {
util_dynarray_init(&cs->imm_writes, NULL);
cs->imm_writes = UTIL_DYNARRAY_INIT;
}
util_dynarray_append(&cs->imm_writes, imm);

View file

@ -405,7 +405,7 @@ hk_bind_builder(struct hk_device *dev, struct vk_object_base *obj_base,
.image = image,
};
util_dynarray_init(&b.binds, NULL);
b.binds = UTIL_DYNARRAY_INIT;
return b;
}
@ -810,8 +810,7 @@ queue_submit(struct hk_device *dev, struct hk_queue *queue,
};
/* Now setup the command structs */
struct util_dynarray payload;
util_dynarray_init(&payload, NULL);
struct util_dynarray payload = UTIL_DYNARRAY_INIT;
unsigned nr_vdm = 0, nr_cdm = 0;

View file

@ -1206,7 +1206,7 @@ v3d_simulator_init_global()
_mesa_hash_pointer,
_mesa_key_pointer_equal);
util_dynarray_init(&sim_state.bin_oom, NULL);
sim_state.bin_oom = UTIL_DYNARRAY_INIT;
v3d_X_simulator(init_regs)(sim_state.v3d);
v3d_X_simulator(get_perfcnt_total)(&sim_state.perfcnt_total);

View file

@ -280,8 +280,7 @@ nir_opt_dead_write_vars(nir_shader *shader)
{
bool progress = false;
struct util_dynarray unused_writes;
util_dynarray_init(&unused_writes, NULL);
struct util_dynarray unused_writes = UTIL_DYNARRAY_INIT;
nir_foreach_function_impl(impl, shader) {
progress |= remove_dead_write_vars_impl(shader, impl, &unused_writes);

View file

@ -464,8 +464,7 @@ nir_opt_group_loads(nir_shader *shader, nir_load_grouping grouping,
unsigned max_distance)
{
/* Temporary space for instruction info. */
struct util_dynarray infos_scratch;
util_dynarray_init(&infos_scratch, NULL);
struct util_dynarray infos_scratch = UTIL_DYNARRAY_INIT;
nir_foreach_function_impl(impl, shader) {
nir_metadata_require(impl, nir_metadata_instr_index);

View file

@ -519,7 +519,7 @@ nir_opt_reassociate(nir_shader *nir, nir_reassociate_options opts)
/* Clear pass flags. All instructions are possible roots, a priori. Interior
* nodes are indicated with a non-zero pass flags, set as we go.
*/
util_dynarray_init(&chains, NULL);
chains = UTIL_DYNARRAY_INIT;
nir_shader_clear_pass_flags(nir);
/* We use nir_def indices, which are function-local, so the algorithm runs on

View file

@ -555,8 +555,7 @@ nir_opt_vectorize_io(nir_shader *shader, nir_variable_mode modes,
}
/* Initialize dynamic arrays. */
struct util_dynarray io_instructions;
util_dynarray_init(&io_instructions, NULL);
struct util_dynarray io_instructions = UTIL_DYNARRAY_INIT;
bool global_progress = false;
nir_foreach_function_impl(impl, shader) {

View file

@ -398,8 +398,7 @@ nir_opt_vectorize_io_vars_impl(nir_function_impl *impl, nir_variable_mode modes)
nir_metadata_require(impl, nir_metadata_dominance);
struct util_dynarray demote_vars;
util_dynarray_init(&demote_vars, NULL);
struct util_dynarray demote_vars = UTIL_DYNARRAY_INIT;
nir_shader *shader = impl->function->shader;
nir_variable *new_inputs[MAX_SLOTS][4] = { { 0 } };

View file

@ -2138,7 +2138,7 @@ nir_serialize_function(struct blob *blob, const nir_function *fxn)
ctx.blob = blob;
ctx.nir = fxn->shader;
ctx.strip = true;
util_dynarray_init(&ctx.phi_fixups, NULL);
ctx.phi_fixups = UTIL_DYNARRAY_INIT;
size_t idx_size_offset = blob_reserve_uint32(blob);
@ -2160,7 +2160,7 @@ serialize_internal(struct blob *blob, const nir_shader *nir, bool strip, bool se
ctx.nir = nir;
ctx.strip = strip;
ctx.debug_info = nir->has_debug_info && !strip;
util_dynarray_init(&ctx.phi_fixups, NULL);
ctx.phi_fixups = UTIL_DYNARRAY_INIT;
size_t idx_size_offset = blob_reserve_uint32(blob);

View file

@ -422,7 +422,7 @@ dmabuf_feedback_init(struct dmabuf_feedback *dmabuf_feedback)
if (dmabuf_feedback_tranche_init(&dmabuf_feedback->pending_tranche) < 0)
return -1;
util_dynarray_init(&dmabuf_feedback->tranches, NULL);
dmabuf_feedback->tranches = UTIL_DYNARRAY_INIT;
dmabuf_feedback_format_table_init(&dmabuf_feedback->format_table);

View file

@ -95,8 +95,7 @@ main(int argc, char *argv[])
return EXIT_FAILURE;
}
struct util_dynarray bin;
util_dynarray_init(&bin, NULL);
struct util_dynarray bin = UTIL_DYNARRAY_INIT;
for (unsigned int i = 0; i < result->num_instr; i++) {
struct encoded_instr encoded;

View file

@ -78,7 +78,7 @@ fd_rd_output_sanitize_name(char *name)
static void
fd_rd_parse_dump_range(const char *option_name, struct util_dynarray *range_array)
{
util_dynarray_init(range_array, NULL);
*range_array = UTIL_DYNARRAY_INIT;
const char *range_value = os_get_option(option_name);
if (!range_value)
return;

View file

@ -4209,8 +4209,7 @@ tu_debug_bos_print_stats(struct tu_device *dev)
mtx_lock(&dev->bo_mutex);
/* Put the HT's sizes data in an array so we can sort by number of allocations. */
struct util_dynarray dyn;
util_dynarray_init(&dyn, NULL);
struct util_dynarray dyn = UTIL_DYNARRAY_INIT;
uint32_t size = 0;
uint32_t count = 0;

View file

@ -89,7 +89,7 @@ get_cmd_buffer(struct tu_device *dev, struct tu_cmd_buffer **cmd_buffer_out)
VkResult
tu_init_dynamic_rendering(struct tu_device *dev)
{
util_dynarray_init(&dev->dynamic_rendering_pending, NULL);
dev->dynamic_rendering_pending = UTIL_DYNARRAY_INIT;
dev->dynamic_rendering_fence = 0;
const VkCommandPoolCreateInfo create_info = {

View file

@ -384,7 +384,7 @@ queue_submit(struct vk_queue *_queue, struct vk_queue_submit *vk_submit)
vk_submit->image_opaque_bind_count)
return queue_submit_sparse(_queue, vk_submit);
util_dynarray_init(&dump_cmds, NULL);
dump_cmds = UTIL_DYNARRAY_INIT;
uint32_t perf_pass_index =
device->perfcntrs_pass_cs_entries ? vk_submit->perf_pass_index : ~0;

View file

@ -5560,7 +5560,7 @@ threaded_context_create(struct pipe_context *pipe,
util_queue_fence_init(&tc->batch_slots[i].fence);
tc->batch_slots[i].renderpass_info_idx = -1;
if (tc->options.parse_renderpass_info) {
util_dynarray_init(&tc->batch_slots[i].renderpass_infos, NULL);
tc->batch_slots[i].renderpass_infos = UTIL_DYNARRAY_INIT;
tc_batch_renderpass_infos_resize(tc, &tc->batch_slots[i]);
}
}

View file

@ -815,8 +815,7 @@ agx_batch_submit(struct agx_context *ctx, struct agx_batch *batch,
};
/* Submit! */
struct util_dynarray cmdbuf;
util_dynarray_init(&cmdbuf, NULL);
struct util_dynarray cmdbuf = UTIL_DYNARRAY_INIT;
if (compute) {
/* Barrier on previous submission */

View file

@ -59,7 +59,7 @@ d3d12_init_batch(struct d3d12_context *ctx, struct d3d12_batch *batch)
batch->bos = _mesa_hash_table_create(NULL, _mesa_hash_pointer,
_mesa_key_pointer_equal);
util_dynarray_init(&batch->local_bos, NULL);
batch->local_bos = UTIL_DYNARRAY_INIT;
batch->surfaces = _mesa_set_create(NULL, _mesa_hash_pointer,
_mesa_key_pointer_equal);
@ -89,7 +89,7 @@ d3d12_init_batch(struct d3d12_context *ctx, struct d3d12_batch *batch)
if (!batch->sampler_tables || !batch->sampler_views || !batch->view_heap || !batch->queries)
return false;
util_dynarray_init(&batch->zombie_samplers, NULL);
batch->zombie_samplers = UTIL_DYNARRAY_INIT;
batch->sampler_heap =
d3d12_descriptor_heap_new(screen->dev,

View file

@ -79,7 +79,7 @@ d3d12_descriptor_heap_new(ID3D12Device *dev,
heap->cpu_base = GetCPUDescriptorHandleForHeapStart(heap->heap).ptr;
if (flags & D3D12_DESCRIPTOR_HEAP_FLAG_SHADER_VISIBLE)
heap->gpu_base = GetGPUDescriptorHandleForHeapStart(heap->heap).ptr;
util_dynarray_init(&heap->free_list, NULL);
heap->free_list = UTIL_DYNARRAY_INIT;
return heap;
}

View file

@ -728,8 +728,8 @@ ethosu_emit_cmdstream(struct ethosu_subgraph *subgraph)
struct util_dynarray outstanding_dma_ops;
struct util_dynarray outstanding_npu_ops;
util_dynarray_init(&outstanding_dma_ops, NULL);
util_dynarray_init(&outstanding_npu_ops, NULL);
outstanding_dma_ops = UTIL_DYNARRAY_INIT;
outstanding_npu_ops = UTIL_DYNARRAY_INIT;
subgraph->cmdstream_used = 32;
subgraph->cmdstream = calloc(subgraph->cmdstream_used, sizeof(*subgraph->cmdstream));

View file

@ -204,8 +204,8 @@ ethosu_ml_subgraph_create(struct pipe_context *pcontext,
subgraph = calloc(1, sizeof(*subgraph));
subgraph->base.context = pcontext;
util_dynarray_init(&subgraph->tensors, NULL);
util_dynarray_init(&subgraph->operations, NULL);
subgraph->tensors = UTIL_DYNARRAY_INIT;
subgraph->operations = UTIL_DYNARRAY_INIT;
ethosu_lower_graph(subgraph, poperations, count);

View file

@ -760,9 +760,9 @@ etna_ml_subgraph_create(struct pipe_context *pcontext,
list_inithead(&operations);
subgraph->base.context = pcontext;
util_dynarray_init(&subgraph->operations, NULL);
subgraph->operations = UTIL_DYNARRAY_INIT;
util_dynarray_init(&subgraph->tensors, NULL);
subgraph->tensors = UTIL_DYNARRAY_INIT;
if (!util_dynarray_resize(&subgraph->tensors, struct etna_ml_tensor*, tensor_count))
return NULL;
memset(util_dynarray_begin(&subgraph->tensors), 0, subgraph->tensors.size);

View file

@ -1075,7 +1075,7 @@ etna_screen_create(struct etna_device *dev, struct etna_gpu *gpu,
etna_init_shader_caps(screen);
etna_init_screen_caps(screen);
util_dynarray_init(&screen->supported_pm_queries, NULL);
screen->supported_pm_queries = UTIL_DYNARRAY_INIT;
slab_create_parent(&screen->transfer_pool, sizeof(struct etna_transfer), 16);
if (screen->drm_version >= ETNA_DRM_VERSION_PERFMON)

View file

@ -119,18 +119,19 @@ fd_batch_create(struct fd_context *ctx, bool nondraw)
fd_reset_wfi(batch);
util_dynarray_init(&batch->draw_patches, NULL);
util_dynarray_init(&(batch->fb_read_patches), NULL);
batch->draw_patches = UTIL_DYNARRAY_INIT;
batch->fb_read_patches = UTIL_DYNARRAY_INIT;
if (is_a2xx(ctx->screen)) {
util_dynarray_init(&batch->shader_patches, NULL);
util_dynarray_init(&batch->gmem_patches, NULL);
batch->shader_patches = UTIL_DYNARRAY_INIT;
batch->gmem_patches = UTIL_DYNARRAY_INIT;
}
if (is_a3xx(ctx->screen))
util_dynarray_init(&batch->rbrc_patches, NULL);
if (is_a3xx(ctx->screen)) {
batch->rbrc_patches = UTIL_DYNARRAY_INIT;
}
util_dynarray_init(&batch->samples, NULL);
batch->samples = UTIL_DYNARRAY_INIT;
u_trace_init(&batch->trace, &ctx->trace_context);
batch->last_timestamp_cmd = NULL;

View file

@ -697,7 +697,7 @@ fd_context_init(struct fd_context *ctx, struct pipe_screen *pscreen,
slab_create_child(&ctx->transfer_pool, &screen->transfer_pool);
slab_create_child(&ctx->transfer_pool_unsync, &screen->transfer_pool);
util_dynarray_init(&ctx->global_bindings, NULL);
ctx->global_bindings = UTIL_DYNARRAY_INIT;
fd_draw_init(pctx);
fd_resource_context_init(pctx);

View file

@ -218,7 +218,7 @@ static void
lp_function_cache_init(struct lp_function_cache *cache, struct hash_table *initial_cache)
{
p_atomic_set(&cache->latest_cache.value, (uint64_t)(uintptr_t)initial_cache);
util_dynarray_init(&cache->trash_caches, NULL);
cache->trash_caches = UTIL_DYNARRAY_INIT;
}
void
@ -231,7 +231,7 @@ llvmpipe_init_sampler_matrix(struct llvmpipe_context *ctx)
struct lp_sampler_matrix *matrix = &ctx->sampler_matrix;
util_dynarray_init(&matrix->gallivms, NULL);
matrix->gallivms = UTIL_DYNARRAY_INIT;
matrix->ctx = ctx;

View file

@ -1090,7 +1090,7 @@ _nvfx_fragprog_translate(uint16_t oclass, struct nv30_fragprog *fp)
goto out_err;
tgsi_parse_init(&parse, fp->pipe.tokens);
util_dynarray_init(&insns, NULL);
insns = UTIL_DYNARRAY_INIT;
while (!tgsi_parse_end_of_tokens(&parse)) {
tgsi_parse_token(&parse);

View file

@ -989,7 +989,7 @@ _nvfx_vertprog_translate(uint16_t oclass, struct nv30_vertprog *vp)
vpc->cvtx_idx = vpc->hpos_idx;
}
util_dynarray_init(&insns, NULL);
insns = UTIL_DYNARRAY_INIT;
tgsi_parse_init(&parse, vp->pipe.tokens);
while (!tgsi_parse_end_of_tokens(&parse)) {

View file

@ -407,7 +407,7 @@ nv50_create(struct pipe_screen *pscreen, void *priv, unsigned ctxflags)
nv50->base.scratch.bo_size = 2 << 20;
util_dynarray_init(&nv50->global_residents, NULL);
nv50->global_residents = UTIL_DYNARRAY_INIT;
// Make sure that the first TSC entry has SRGB conversion bit set, since we
// use it as a fallback.

View file

@ -528,7 +528,7 @@ nvc0_create(struct pipe_screen *pscreen, void *priv, unsigned ctxflags)
memset(nvc0->tex_handles, ~0, sizeof(nvc0->tex_handles));
util_dynarray_init(&nvc0->global_residents, NULL);
nvc0->global_residents = UTIL_DYNARRAY_INIT;
// Make sure that the first TSC entry has SRGB conversion bit set, since we
// use it as a fallback on Fermi for TXF, and on Kepler+ generations for

View file

@ -124,7 +124,7 @@ GENX(pan_blend_get_shader_locked)(struct pan_blend_shader_cache *cache,
#endif
struct util_dynarray binary;
util_dynarray_init(&binary, NULL);
binary = UTIL_DYNARRAY_INIT;
pan_shader_compile(nir, &inputs, &binary, &info);
struct pan_ptr bin =

View file

@ -656,7 +656,7 @@ GENX(csf_submit_batch)(struct panfrost_batch *batch)
uint32_t vm_sync_handle = panthor_kmod_vm_sync_handle(dev->kmod.vm);
struct util_dynarray syncops;
util_dynarray_init(&syncops, NULL);
syncops = UTIL_DYNARRAY_INIT;
ret = csf_submit_collect_wait_ops(batch, &syncops, vm_sync_handle);
if (ret)

View file

@ -141,7 +141,7 @@ panfrost_disk_cache_retrieve(struct disk_cache *cache,
struct blob_reader blob;
blob_reader_init(&blob, buffer, size);
util_dynarray_init(&binary->binary, NULL);
binary->binary = UTIL_DYNARRAY_INIT;
uint32_t binary_size = blob_read_uint32(&blob);
void *ptr = util_dynarray_resize_bytes(&binary->binary, binary_size, 1);

View file

@ -551,9 +551,7 @@ pan_preload_get_shader(struct pan_fb_preload_cache *cache,
.is_blit = true,
.no_idvs = true,
};
struct util_dynarray binary;
util_dynarray_init(&binary, NULL);
struct util_dynarray binary = UTIL_DYNARRAY_INIT;
shader = rzalloc(cache->shaders.preload, struct pan_preload_shader_data);

View file

@ -84,7 +84,7 @@ panfrost_batch_init(struct panfrost_context *ctx,
batch->seqnum = ++ctx->batches.seqnum;
util_dynarray_init(&batch->bos, NULL);
batch->bos = UTIL_DYNARRAY_INIT;
batch->minx = batch->miny = ~0;
batch->maxx = batch->maxy = 0;

View file

@ -166,7 +166,7 @@ panfrost_shader_compile(struct panfrost_screen *screen, const nir_shader *ir,
}
}
util_dynarray_init(&out->binary, NULL);
out->binary = UTIL_DYNARRAY_INIT;
if (s->info.stage == MESA_SHADER_FRAGMENT) {
if (key->fs.nr_cbufs_for_fragcolor) {

View file

@ -788,11 +788,11 @@ static struct pipe_context *si_create_context(struct pipe_screen *screen, unsign
sctx->tex_handles = _mesa_hash_table_create(NULL, _mesa_hash_pointer, _mesa_key_pointer_equal);
sctx->img_handles = _mesa_hash_table_create(NULL, _mesa_hash_pointer, _mesa_key_pointer_equal);
util_dynarray_init(&sctx->resident_tex_handles, NULL);
util_dynarray_init(&sctx->resident_img_handles, NULL);
util_dynarray_init(&sctx->resident_tex_needs_color_decompress, NULL);
util_dynarray_init(&sctx->resident_img_needs_color_decompress, NULL);
util_dynarray_init(&sctx->resident_tex_needs_depth_decompress, NULL);
sctx->resident_tex_handles = UTIL_DYNARRAY_INIT;
sctx->resident_img_handles = UTIL_DYNARRAY_INIT;
sctx->resident_tex_needs_color_decompress = UTIL_DYNARRAY_INIT;
sctx->resident_img_needs_color_decompress = UTIL_DYNARRAY_INIT;
sctx->resident_tex_needs_depth_decompress = UTIL_DYNARRAY_INIT;
sctx->dirty_implicit_resources = _mesa_pointer_hash_table_create(NULL);
if (!sctx->dirty_implicit_resources) {

View file

@ -100,7 +100,7 @@ compile_operation(struct rkt_ml_subgraph *subgraph,
regcfgs = calloc(num_tasks, sizeof(struct util_dynarray));
for (int i = 0; i < num_tasks; i++) {
util_dynarray_init(&regcfgs[i], NULL);
regcfgs[i] = UTIL_DYNARRAY_INIT;
rkt_fill_regcmd(subgraph, operation, &regcfgs[i], i);
unsigned size =
@ -168,7 +168,7 @@ lower_convolution(struct rkt_ml_subgraph *subgraph,
const struct pipe_ml_operation *poperation,
struct rkt_operation *operation)
{
util_dynarray_init(&operation->tasks, NULL);
operation->tasks = UTIL_DYNARRAY_INIT;
operation->depthwise = rkt_is_depthwise(poperation);
operation->padding_same = poperation->conv.padding_same;
@ -307,8 +307,8 @@ rkt_ml_subgraph_create(struct pipe_context *pcontext,
subgraph->base.context = pcontext;
tensor_count = count_tensors(poperations, count);
util_dynarray_init(&subgraph->tensors, NULL);
util_dynarray_init(&subgraph->operations, NULL);
subgraph->tensors = UTIL_DYNARRAY_INIT;
subgraph->operations = UTIL_DYNARRAY_INIT;
if (!util_dynarray_resize(&subgraph->tensors, struct pipe_resource *,
tensor_count))
return NULL;
@ -473,8 +473,7 @@ rkt_ml_subgraph_invoke(struct pipe_context *pcontext,
DBG("Submitting graph\n");
struct util_dynarray jobs = {0};
util_dynarray_init(&jobs, NULL);
struct util_dynarray jobs = UTIL_DYNARRAY_INIT;
util_dynarray_foreach (&subgraph->operations, struct rkt_operation,
operation) {

View file

@ -362,26 +362,26 @@ create_batch_state(struct zink_context *ctx)
SET_CREATE(&bs->programs);
SET_CREATE(&bs->active_queries);
SET_CREATE(&bs->dmabuf_exports);
util_dynarray_init(&bs->signal_semaphores, NULL);
util_dynarray_init(&bs->user_signal_semaphores, NULL);
util_dynarray_init(&bs->user_signal_semaphore_values, NULL);
util_dynarray_init(&bs->wait_semaphores, NULL);
util_dynarray_init(&bs->tracked_semaphores, NULL);
util_dynarray_init(&bs->fd_wait_semaphores, NULL);
util_dynarray_init(&bs->fences, NULL);
util_dynarray_init(&bs->dead_querypools, NULL);
util_dynarray_init(&bs->wait_semaphore_stages, NULL);
util_dynarray_init(&bs->wait_semaphore_values, NULL);
util_dynarray_init(&bs->fd_wait_semaphore_stages, NULL);
util_dynarray_init(&bs->zombie_samplers, NULL);
util_dynarray_init(&bs->freed_sparse_backing_bos, NULL);
util_dynarray_init(&bs->acquires, NULL);
util_dynarray_init(&bs->acquire_flags, NULL);
util_dynarray_init(&bs->bindless_releases[0], NULL);
util_dynarray_init(&bs->bindless_releases[1], NULL);
util_dynarray_init(&bs->swapchain_obj, NULL);
util_dynarray_init(&bs->swapchain_obj_unsync, NULL);
util_dynarray_init(&bs->fence.mfences, NULL);
bs->signal_semaphores = UTIL_DYNARRAY_INIT;
bs->user_signal_semaphores = UTIL_DYNARRAY_INIT;
bs->user_signal_semaphore_values = UTIL_DYNARRAY_INIT;
bs->wait_semaphores = UTIL_DYNARRAY_INIT;
bs->tracked_semaphores = UTIL_DYNARRAY_INIT;
bs->fd_wait_semaphores = UTIL_DYNARRAY_INIT;
bs->fences = UTIL_DYNARRAY_INIT;
bs->dead_querypools = UTIL_DYNARRAY_INIT;
bs->wait_semaphore_stages = UTIL_DYNARRAY_INIT;
bs->wait_semaphore_values = UTIL_DYNARRAY_INIT;
bs->fd_wait_semaphore_stages = UTIL_DYNARRAY_INIT;
bs->zombie_samplers = UTIL_DYNARRAY_INIT;
bs->freed_sparse_backing_bos = UTIL_DYNARRAY_INIT;
bs->acquires = UTIL_DYNARRAY_INIT;
bs->acquire_flags = UTIL_DYNARRAY_INIT;
bs->bindless_releases[0] = UTIL_DYNARRAY_INIT;
bs->bindless_releases[1] = UTIL_DYNARRAY_INIT;
bs->swapchain_obj = UTIL_DYNARRAY_INIT;
bs->swapchain_obj_unsync = UTIL_DYNARRAY_INIT;
bs->fence.mfences = UTIL_DYNARRAY_INIT;
cnd_init(&bs->usage.flush);
mtx_init(&bs->usage.mtx, mtx_plain);

View file

@ -5765,8 +5765,8 @@ zink_context_create(struct pipe_screen *pscreen, void *priv, unsigned flags)
mesa_loge("ZINK: failed to allocate ctx->di.bindless[%d].img_infos!",i);
goto fail;
}
util_dynarray_init(&ctx->di.bindless[i].updates, NULL);
util_dynarray_init(&ctx->di.bindless[i].resident, NULL);
ctx->di.bindless[i].updates = UTIL_DYNARRAY_INIT;
ctx->di.bindless[i].resident = UTIL_DYNARRAY_INIT;
}
}

View file

@ -1038,8 +1038,8 @@ get_descriptor_pool(struct zink_context *ctx, struct zink_program *pg, enum zink
struct zink_descriptor_pool_multi *mpool = CALLOC_STRUCT(zink_descriptor_pool_multi);
if (!mpool)
return NULL;
util_dynarray_init(&mpool->overflowed_pools[0], NULL);
util_dynarray_init(&mpool->overflowed_pools[1], NULL);
mpool->overflowed_pools[0] = UTIL_DYNARRAY_INIT;
mpool->overflowed_pools[1] = UTIL_DYNARRAY_INIT;
mpool->pool_key = pool_key;
if (!set_pool(bs, pg, mpool, type)) {
multi_pool_destroy(screen, mpool);

View file

@ -832,7 +832,7 @@ kopper_present(void *data, void *gdata, int thread_idx)
return;
}
util_dynarray_init(arr, NULL);
*arr = UTIL_DYNARRAY_INIT;
_mesa_hash_table_insert(swapchain->presents, (void*)(uintptr_t)next, arr);
}
util_dynarray_append(arr, cpi->sem);

View file

@ -525,7 +525,7 @@ zink_create_query(struct pipe_context *pctx,
if (query->vkqtype == -1)
return NULL;
util_dynarray_init(&query->starts, NULL);
query->starts = UTIL_DYNARRAY_INIT;
assert(!query->precise || query->vkqtype == VK_QUERY_TYPE_OCCLUSION);

View file

@ -133,8 +133,7 @@ zink_debug_mem_print_stats(struct zink_screen *screen)
simple_mtx_lock(&screen->debug_mem_lock);
/* Put the HT's sizes data in an array so we can sort by number of allocations. */
struct util_dynarray dyn;
util_dynarray_init(&dyn, NULL);
struct util_dynarray dyn = UTIL_DYNARRAY_INIT;
uint32_t size = 0;
uint32_t count = 0;
@ -1548,8 +1547,9 @@ resource_object_create(struct zink_screen *screen, const struct pipe_resource *t
switch (create_result) {
case roc_success:
for (unsigned i = 0; i < max_level; i++)
util_dynarray_init(&obj->copies[i], NULL);
for (unsigned i = 0; i < max_level; i++) {
obj->copies[i] = UTIL_DYNARRAY_INIT;
}
FALLTHROUGH;
case roc_success_early_return:
return obj;

View file

@ -393,7 +393,7 @@ lvp_flatten_as(const struct vk_ir_header *header, const struct vk_ir_box_node *i
/* Select the subtrees that have to be rebuilt in order to
* limit the BVH to a supported depth.
*/
util_dynarray_init(&subtrees, NULL);
subtrees = UTIL_DYNARRAY_INIT;
uint32_t max_subtree_size = 0;
lvp_select_subtrees_to_flatten(header, ir_box_nodes, node_depth, child_counts,
root_offset, header->ir_internal_node_count - 1,

View file

@ -1795,7 +1795,7 @@ lvp_queue_init(struct lvp_device *device, struct lvp_queue *queue,
queue->vk.driver_submit = lvp_queue_submit;
simple_mtx_init(&queue->lock, mtx_plain);
util_dynarray_init(&queue->pipeline_destroys, NULL);
queue->pipeline_destroys = UTIL_DYNARRAY_INIT;
return VK_SUCCESS;
}
@ -1884,8 +1884,8 @@ VKAPI_ATTR VkResult VKAPI_CALL lvp_CreateDevice(
device->null_image_handle = (void *)(uintptr_t)device->queue.ctx->create_image_handle(device->queue.ctx,
&(struct pipe_image_view){ 0 });
util_dynarray_init(&device->bda_texture_handles, NULL);
util_dynarray_init(&device->bda_image_handles, NULL);
device->bda_texture_handles = UTIL_DYNARRAY_INIT;
device->bda_image_handles = UTIL_DYNARRAY_INIT;
device->group_handle_alloc = 1;

View file

@ -5395,8 +5395,8 @@ VkResult lvp_execute_cmds(struct lvp_device *device,
state->min_samples_dirty = true;
state->sample_mask = UINT32_MAX;
state->poison_mem = device->poison_mem;
util_dynarray_init(&state->push_desc_sets, NULL);
util_dynarray_init(&state->releasebufs, NULL);
state->push_desc_sets = UTIL_DYNARRAY_INIT;
state->releasebufs = UTIL_DYNARRAY_INIT;
/* default values */
state->min_sample_shading = 1;

View file

@ -198,7 +198,7 @@ CDX12EncHMFT::PrepareForEncodeHelper( LPDX12EncodeContext pDX12EncodeContext, bo
const reference_frames_tracker_frame_descriptor_h264 *cur_frame_desc = nullptr;
pipe_h264_enc_picture_desc *pPicInfo = &pDX12EncodeContext->encoderPicInfo.h264enc;
// Initialize raw headers array
util_dynarray_init( &pPicInfo->raw_headers, NULL );
pPicInfo->raw_headers = UTIL_DYNARRAY_INIT;
uint32_t height_in_blocks = 0;
uint32_t width_in_blocks = 0;

View file

@ -238,7 +238,7 @@ CDX12EncHMFT::PrepareForEncodeHelper( LPDX12EncodeContext pDX12EncodeContext, bo
HRESULT hr = S_OK;
pipe_h265_enc_picture_desc *pPicInfo = &pDX12EncodeContext->encoderPicInfo.h265enc;
// Initialize raw headers array
util_dynarray_init( &pPicInfo->raw_headers, NULL );
pPicInfo->raw_headers = UTIL_DYNARRAY_INIT;
const reference_frames_tracker_frame_descriptor_hevc *cur_frame_desc = nullptr;

View file

@ -372,7 +372,7 @@ vlVaCreateContext(VADriverContextP ctx, VAConfigID config_id, int picture_width,
context->desc.h264enc.rate_ctrl[i].frame_rate_den = 1;
}
context->desc.h264enc.frame_idx = util_hash_table_create_ptr_keys();
util_dynarray_init(&context->desc.h264enc.raw_headers, NULL);
context->desc.h264enc.raw_headers = UTIL_DYNARRAY_INIT;
}
break;
@ -402,7 +402,7 @@ vlVaCreateContext(VADriverContextP ctx, VAConfigID config_id, int picture_width,
context->desc.h265enc.rc[i].frame_rate_den = 1;
}
context->desc.h265enc.frame_idx = util_hash_table_create_ptr_keys();
util_dynarray_init(&context->desc.h265enc.raw_headers, NULL);
context->desc.h265enc.raw_headers = UTIL_DYNARRAY_INIT;
}
break;

View file

@ -1295,7 +1295,7 @@ vlVaCreateSurfaces2(VADriverContextP ctx, unsigned int format,
assert(0);
}
util_dynarray_init(&surf->subpics, NULL);
surf->subpics = UTIL_DYNARRAY_INIT;
surfaces[i] = handle_table_add(drv->htab, surf);
if (!surfaces[i]) {
vaStatus = VA_STATUS_ERROR_ALLOCATION_FAILED;

View file

@ -317,7 +317,7 @@ stw_pixelformat_init(void)
assert(!stw_dev->pixelformat_count);
util_dynarray_init(&stw_dev->pixelformats, NULL);
stw_dev->pixelformats = UTIL_DYNARRAY_INIT;
/* normal, displayable formats */
num_formats = add_color_format_variants(stw_pf_color,

View file

@ -844,8 +844,8 @@ bool pco_nir_pfo(nir_shader *shader, pco_fs_data *fs)
state.last_discard_store =
nir_build_store_reg(&b, nir_imm_false(&b), state.discard_cond_reg);
util_dynarray_init(&state.loads, NULL);
util_dynarray_init(&state.stores, NULL);
state.loads = UTIL_DYNARRAY_INIT;
state.stores = UTIL_DYNARRAY_INIT;
bool progress = false;

View file

@ -761,8 +761,7 @@ bool pco_opt_comp_only_vecs(pco_shader *shader)
bool used_by_noncomps = false;
pco_ref dest = vec->dest[0];
struct util_dynarray comps;
util_dynarray_init(&comps, NULL);
struct util_dynarray comps = UTIL_DYNARRAY_INIT;
pco_foreach_instr_in_func_from (instr, vec) {
if (instr->op == PCO_OP_COMP) {

View file

@ -869,8 +869,7 @@ static bool pco_ra_func(pco_func *func, pco_ra_ctx *ctx)
override ? ra_get_node_reg(ra_graph, override->ref.val)
: ra_get_node_reg(ra_graph, instr->dest[0].val);
struct util_dynarray copies;
util_dynarray_init(&copies, NULL);
struct util_dynarray copies = UTIL_DYNARRAY_INIT;
unsigned highest_temp = 0;
unsigned lowest_temp = ~0;

View file

@ -237,10 +237,10 @@ static VkResult pvr_cmd_buffer_create(struct pvr_device *device,
cmd_buffer->device = device;
util_dynarray_init(&cmd_buffer->depth_bias_array, NULL);
util_dynarray_init(&cmd_buffer->scissor_array, NULL);
util_dynarray_init(&cmd_buffer->deferred_csb_commands, NULL);
util_dynarray_init(&cmd_buffer->deferred_clears, NULL);
cmd_buffer->depth_bias_array = UTIL_DYNARRAY_INIT;
cmd_buffer->scissor_array = UTIL_DYNARRAY_INIT;
cmd_buffer->deferred_csb_commands = UTIL_DYNARRAY_INIT;
cmd_buffer->deferred_clears = UTIL_DYNARRAY_INIT;
list_inithead(&cmd_buffer->sub_cmds);
list_inithead(&cmd_buffer->bo_list);
@ -2681,7 +2681,7 @@ VkResult pvr_cmd_buffer_start_sub_cmd(struct pvr_cmd_buffer *cmd_buffer,
&sub_cmd->gfx.control_stream);
}
util_dynarray_init(&sub_cmd->gfx.sec_query_indices, NULL);
sub_cmd->gfx.sec_query_indices = UTIL_DYNARRAY_INIT;
break;
case PVR_SUB_CMD_TYPE_QUERY:
@ -3664,7 +3664,7 @@ VkResult pvr_BeginCommandBuffer(VkCommandBuffer commandBuffer,
state->dirty.isp_userpass = true;
}
util_dynarray_init(&state->query_indices, NULL);
state->query_indices = UTIL_DYNARRAY_INIT;
memset(state->barriers_needed,
0xFF,

View file

@ -92,7 +92,7 @@ void pvr_csb_init(struct pvr_device *device,
csb->status = VK_SUCCESS;
if (stream_type == PVR_CMD_STREAM_TYPE_GRAPHICS_DEFERRED)
util_dynarray_init(&csb->deferred_cs_mem, NULL);
csb->deferred_cs_mem = UTIL_DYNARRAY_INIT;
else
list_inithead(&csb->pvr_bo_list);
}

View file

@ -623,7 +623,7 @@ elk_cfg_t::dump(FILE *file)
* output, making it possible to use it for certain tests.
*/
util_dynarray scratch;
util_dynarray_init(&scratch, NULL);
scratch = UTIL_DYNARRAY_INIT;
foreach_block (block, this) {
if (idom && idom->parent(block))

View file

@ -1584,8 +1584,7 @@ compare_inst_ptr(const void *v1, const void *v2)
static void
intel_print_accumulated_instrs(struct intel_batch_decode_ctx *ctx)
{
struct util_dynarray arr;
util_dynarray_init(&arr, NULL);
struct util_dynarray arr = UTIL_DYNARRAY_INIT;
hash_table_foreach(ctx->commands, entry) {
struct inst_ptr inst = {
@ -1886,8 +1885,7 @@ compare_inst_stat(const void *v1, const void *v2)
void
intel_batch_print_stats(struct intel_batch_decode_ctx *ctx)
{
struct util_dynarray arr;
util_dynarray_init(&arr, NULL);
struct util_dynarray arr = UTIL_DYNARRAY_INIT;
hash_table_foreach(ctx->stats, entry) {
struct inst_stat inst = {

View file

@ -1034,7 +1034,7 @@ anv_state_stream_init(struct anv_state_stream *stream,
stream->next = block_size;
stream->total_size = 0;
util_dynarray_init(&stream->all_blocks, NULL);
stream->all_blocks = UTIL_DYNARRAY_INIT;
VG(VALGRIND_CREATE_MEMPOOL(stream, 0, false));
}

View file

@ -1715,7 +1715,7 @@ anv_async_submit_init(struct anv_async_submit *submit,
.engine_class = queue->family->engine_class,
};
util_dynarray_init(&submit->batch_bos, NULL);
submit->batch_bos = UTIL_DYNARRAY_INIT;
if (create_signal_sync) {
result = vk_sync_create(&device->vk,

View file

@ -802,7 +802,7 @@ anv_sparse_bind_trtt(struct anv_device *device,
struct anv_trtt_bind *ptr = alloca(alloc_size);
util_dynarray_init_from_stack(&l1_binds, ptr, alloc_size);
} else {
util_dynarray_init(&l1_binds, NULL);
l1_binds = UTIL_DYNARRAY_INIT;
if (!util_dynarray_ensure_cap(&l1_binds,
l1_binds_capacity * sizeof(struct anv_trtt_bind)))
goto out_dynarrays;

View file

@ -1211,7 +1211,7 @@ anv_state_stream_init(struct anv_state_stream *stream,
*/
stream->next = block_size;
util_dynarray_init(&stream->all_blocks, NULL);
stream->all_blocks = UTIL_DYNARRAY_INIT;
VG(VALGRIND_CREATE_MEMPOOL(stream, 0, false));
}

View file

@ -84,7 +84,7 @@ kk_create_cmd_buffer(struct vk_command_pool *vk_pool,
return result;
}
util_dynarray_init(&cmd->large_bos, NULL);
cmd->large_bos = UTIL_DYNARRAY_INIT;
cmd->vk.dynamic_graphics_state.vi = &cmd->state.gfx._dynamic_vi;
cmd->vk.dynamic_graphics_state.ms.sample_locations =

View file

@ -209,7 +209,7 @@ kk_CreateDevice(VkPhysicalDevice physicalDevice,
goto fail_sampler_heap;
simple_mtx_init(&dev->user_heap_cache.mutex, mtx_plain);
util_dynarray_init(&dev->user_heap_cache.handles, NULL);
dev->user_heap_cache.handles = UTIL_DYNARRAY_INIT;
*pDevice = kk_device_to_handle(dev);

View file

@ -21,7 +21,7 @@ kk_encoder_start_internal(struct kk_encoder_internal *encoder,
{
encoder->cmd_buffer = mtl_new_command_buffer(queue);
encoder->last_used = KK_ENC_NONE;
util_dynarray_init(&encoder->fences, NULL);
encoder->fences = UTIL_DYNARRAY_INIT;
}
VkResult
@ -38,9 +38,9 @@ kk_encoder_init(mtl_device *device, struct kk_queue *queue,
kk_encoder_start_internal(&enc->main, device, queue->main.mtl_handle);
kk_encoder_start_internal(&enc->pre_gfx, device, queue->pre_gfx.mtl_handle);
enc->event = mtl_new_event(device);
util_dynarray_init(&enc->imm_writes, NULL);
util_dynarray_init(&enc->resident_buffers, NULL);
util_dynarray_init(&enc->copy_query_pool_result_infos, NULL);
enc->imm_writes = UTIL_DYNARRAY_INIT;
enc->resident_buffers = UTIL_DYNARRAY_INIT;
enc->copy_query_pool_result_infos = UTIL_DYNARRAY_INIT;
*encoder = enc;
return VK_SUCCESS;

View file

@ -1043,7 +1043,7 @@ _mesa_initialize_context(struct gl_context *ctx,
simple_mtx_lock(&ctx->Shared->Mutex);
list_addtail(&ctx->SharedLink, &ctx->Shared->Contexts);
simple_mtx_unlock(&ctx->Shared->Mutex);
util_dynarray_init(&ctx->ReleaseResources, NULL);
ctx->ReleaseResources = UTIL_DYNARRAY_INIT;
return GL_TRUE;

View file

@ -442,8 +442,8 @@ _mesa_free_shared_handles(struct gl_shared_state *shared)
void
_mesa_init_texture_handles(struct gl_texture_object *texObj)
{
util_dynarray_init(&texObj->SamplerHandles, NULL);
util_dynarray_init(&texObj->ImageHandles, NULL);
texObj->SamplerHandles = UTIL_DYNARRAY_INIT;
texObj->ImageHandles = UTIL_DYNARRAY_INIT;
}
void
@ -504,7 +504,7 @@ _mesa_delete_texture_handles(struct gl_context *ctx,
void
_mesa_init_sampler_handles(struct gl_sampler_object *sampObj)
{
util_dynarray_init(&sampObj->Handles, NULL);
sampObj->Handles = UTIL_DYNARRAY_INIT;
}
void

View file

@ -769,7 +769,7 @@ st_create_context_priv(struct gl_context *ctx, struct pipe_context *pipe,
list_inithead(&st->zombie_shaders.list.node);
simple_mtx_init(&st->zombie_shaders.mutex, mtx_plain);
util_dynarray_init(&st->release_resources, NULL);
st->release_resources = UTIL_DYNARRAY_INIT;
ctx->Const.DriverSupportedPrimMask = screen->caps.supported_prim_modes |
/* patches is always supported */

View file

@ -609,9 +609,9 @@ dzn_cmd_buffer_create(const VkCommandBufferAllocateInfo *info,
cmdbuf->state.multiview.view_mask = 1;
for (uint32_t bucket = 0; bucket < DZN_INTERNAL_BUF_BUCKET_COUNT; ++bucket)
list_inithead(&cmdbuf->internal_bufs[bucket]);
util_dynarray_init(&cmdbuf->events.signal, NULL);
util_dynarray_init(&cmdbuf->queries.reset, NULL);
util_dynarray_init(&cmdbuf->queries.signal, NULL);
cmdbuf->events.signal = UTIL_DYNARRAY_INIT;
cmdbuf->queries.reset = UTIL_DYNARRAY_INIT;
cmdbuf->queries.signal = UTIL_DYNARRAY_INIT;
dzn_descriptor_heap_pool_init(&cmdbuf->rtvs.pool, device,
D3D12_DESCRIPTOR_HEAP_TYPE_RTV,
false, &pool->alloc);
@ -832,10 +832,10 @@ dzn_cmd_buffer_create_query_pool_state(struct dzn_cmd_buffer *cmdbuf)
return NULL;
}
util_dynarray_init(&state->reset, NULL);
util_dynarray_init(&state->collect, NULL);
util_dynarray_init(&state->signal, NULL);
util_dynarray_init(&state->zero, NULL);
state->reset = UTIL_DYNARRAY_INIT;
state->collect = UTIL_DYNARRAY_INIT;
state->signal = UTIL_DYNARRAY_INIT;
state->zero = UTIL_DYNARRAY_INIT;
return state;
}

View file

@ -2404,7 +2404,7 @@ dzn_device_create(struct dzn_physical_device *pdev,
}
mtx_init(&device->device_heaps[type].lock, mtx_plain);
util_dynarray_init(&device->device_heaps[type].slot_freelist, NULL);
device->device_heaps[type].slot_freelist = UTIL_DYNARRAY_INIT;
device->device_heaps[type].next_alloc_slot = 0;
}
}

View file

@ -94,7 +94,7 @@ nvk_create_cmd_buffer(struct vk_command_pool *vk_pool,
list_inithead(&cmd->owned_mem);
list_inithead(&cmd->owned_gart_mem);
list_inithead(&cmd->owned_qmd);
util_dynarray_init(&cmd->pushes, NULL);
cmd->pushes = UTIL_DYNARRAY_INIT;
cmd->prev_subc = ffs(nvk_cmd_buffer_subchannel_mask(cmd)) - 1;

View file

@ -442,7 +442,7 @@ main(int argc, const char **argv)
struct util_dynarray shader_binary;
struct pan_shader_info shader_info = {0};
util_dynarray_init(&shader_binary, NULL);
shader_binary = UTIL_DYNARRAY_INIT;
pan_shader_compile(clone, &inputs, &shader_binary, &shader_info);
assert(shader_info.push.count * 4 <=

View file

@ -98,8 +98,7 @@ bi_iterator_schedule(bi_context *ctx)
}
}
struct util_dynarray iterators;
util_dynarray_init(&iterators, NULL);
struct util_dynarray iterators = UTIL_DYNARRAY_INIT;
bi_foreach_instr_global(ctx, phi) {
if (phi->op != BI_OPCODE_PHI || phi->nr_dests != 1)
continue;

View file

@ -669,7 +669,7 @@ calculate_local_next_use(struct spill_ctx *ctx, struct util_dynarray *out)
struct spill_block *sb = spill_block(ctx, ctx->block);
unsigned ip = sb->cycles;
util_dynarray_init(out, NULL);
*out = UTIL_DYNARRAY_INIT;
struct next_uses nu;
init_next_uses(&nu, NULL);

View file

@ -225,8 +225,8 @@ bi_create_dependency_graph(struct bi_worklist st, bool inorder, bool is_blend)
struct util_dynarray last_read[64], last_write[64];
for (unsigned i = 0; i < 64; ++i) {
util_dynarray_init(&last_read[i], NULL);
util_dynarray_init(&last_write[i], NULL);
last_read[i] = UTIL_DYNARRAY_INIT;
last_write[i] = UTIL_DYNARRAY_INIT;
}
/* Initialize dependency graph */

View file

@ -31,7 +31,7 @@ class PackFormats : public testing::Test {
protected:
PackFormats()
{
util_dynarray_init(&result, NULL);
result = UTIL_DYNARRAY_INIT;
}
~PackFormats()
{

View file

@ -263,7 +263,7 @@ cs_builder_init(struct cs_builder *b, const struct cs_builder_conf *conf,
*/
b->conf.nr_kernel_registers = MAX2(b->conf.nr_kernel_registers, 3);
util_dynarray_init(&b->blocks.instrs, NULL);
b->blocks.instrs = UTIL_DYNARRAY_INIT;
}
static inline bool

View file

@ -310,7 +310,7 @@ pandecode_create_context(bool to_stderr)
ctx->dump_stream = to_stderr ? stderr : NULL;
rb_tree_init(&ctx->mmap_tree);
util_dynarray_init(&ctx->ro_mappings, NULL);
ctx->ro_mappings = UTIL_DYNARRAY_INIT;
simple_mtx_t mtx_init = SIMPLE_MTX_INITIALIZER;
memcpy(&ctx->lock, &mtx_init, sizeof(simple_mtx_t));

View file

@ -107,8 +107,8 @@ mir_create_dependency_graph(midgard_instruction **instructions, unsigned count,
struct util_dynarray *last_write = calloc(sizeof(struct util_dynarray), sz);
for (unsigned i = 0; i < sz; ++i) {
util_dynarray_init(&last_read[i], NULL);
util_dynarray_init(&last_write[i], NULL);
last_read[i] = UTIL_DYNARRAY_INIT;
last_write[i] = UTIL_DYNARRAY_INIT;
}
/* Initialize dependency graph */
@ -1473,8 +1473,7 @@ schedule_block(compiler_context *ctx, midgard_block *block)
++num_ldst;
}
struct util_dynarray bundles;
util_dynarray_init(&bundles, NULL);
struct util_dynarray bundles = UTIL_DYNARRAY_INIT;
block->quadword_count = 0;

View file

@ -306,8 +306,8 @@ panvk_per_arch(cmd_open_batch)(struct panvk_cmd_buffer *cmdbuf)
cmdbuf->cur_batch =
vk_zalloc(&cmdbuf->vk.pool->alloc, sizeof(*cmdbuf->cur_batch), 8,
VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
util_dynarray_init(&cmdbuf->cur_batch->jobs, NULL);
util_dynarray_init(&cmdbuf->cur_batch->event_ops, NULL);
cmdbuf->cur_batch->jobs = UTIL_DYNARRAY_INIT;
cmdbuf->cur_batch->event_ops = UTIL_DYNARRAY_INIT;
assert(cmdbuf->cur_batch);
return cmdbuf->cur_batch;
}

View file

@ -975,8 +975,7 @@ panvk_compile_nir(struct panvk_device *dev, nir_shader *nir,
const bool dump_asm =
shader_flags & VK_SHADER_CREATE_CAPTURE_INTERNAL_REPRESENTATIONS_BIT_MESA;
struct util_dynarray binary;
util_dynarray_init(&binary, NULL);
struct util_dynarray binary = UTIL_DYNARRAY_INIT;
pan_shader_compile(nir, compile_input, &binary, &shader->info);
/* Propagate potential additional FAU values into the panvk info struct. */

View file

@ -140,8 +140,7 @@ dag_traverse_bottom_up_node(struct dag_node *node,
if (_mesa_set_search(state->seen, node))
return;
struct util_dynarray stack;
util_dynarray_init(&stack, NULL);
struct util_dynarray stack = UTIL_DYNARRAY_INIT;
do {
assert(node);

View file

@ -797,7 +797,7 @@ vdrm_vpipe_connect(uint32_t context_type)
simple_mtx_init(&vtdev->lock, mtx_plain);
util_idalloc_init(&vtdev->bo_idx_allocator, 512);
util_dynarray_init(&vtdev->bo_table, NULL);
vtdev->bo_table = UTIL_DYNARRAY_INIT;
simple_mtx_lock(&vtdev->lock);
send_init(vtdev);

View file

@ -30,7 +30,7 @@ vk_memory_trace_init(struct vk_device *device, const struct vk_rmv_device_info *
{
device->memory_trace_data.device_info = *device_info;
device->memory_trace_data.is_enabled = true;
util_dynarray_init(&device->memory_trace_data.tokens, NULL);
device->memory_trace_data.tokens = UTIL_DYNARRAY_INIT;
simple_mtx_init(&device->memory_trace_data.token_mtx, mtx_plain);
device->memory_trace_data.next_resource_id = 1;

View file

@ -46,7 +46,7 @@ vk_command_buffer_init(struct vk_command_pool *pool,
command_buffer->record_result = VK_SUCCESS;
vk_cmd_queue_init(&command_buffer->cmd_queue, &pool->alloc);
vk_meta_object_list_init(&command_buffer->meta_objects);
util_dynarray_init(&command_buffer->labels, NULL);
command_buffer->labels = UTIL_DYNARRAY_INIT;
command_buffer->region_begin = true;
list_add(&command_buffer->pool_link, &pool->command_buffers);

View file

@ -47,7 +47,7 @@ vk_meta_destroy_object(struct vk_device *device, struct vk_object_base *obj)
void
vk_meta_object_list_init(struct vk_meta_object_list *mol)
{
util_dynarray_init(&mol->arr, NULL);
mol->arr = UTIL_DYNARRAY_INIT;
}
void

Some files were not shown because too many files have changed in this diff Show more