mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-16 11:58:05 +02:00
For compute shaders, to avoid a crash with that optimization, it requires
doing some optimizations and lowerings before. Example:
static void
lower_cs_shared(struct nir_shader *nir)
{
NIR_PASS_V(nir, nir_lower_vars_to_explicit_types,
nir_var_mem_shared, shared_type_info);
NIR_PASS_V(nir, nir_lower_explicit_io,
nir_var_mem_shared, nir_address_format_32bit_offset);
}
In the same way other drivers (like anv) calls
nir_opt_load_store_vectorize as part of their post-process-nir.
So one option would be to move nir_opt_load_store_vectorize outsize
the common v3d_nir_optimize, to a post-process nir method.
To make things simpler, this change calls that optimization only if we
have a v3d_compiler object, that is when each frontend has already
done their lowerings, and call the v3d_compiler to get the final
assembly (so we are already on a kind of post processing nir step).
This avoids dEQP-VK.memory_model.shared.basic_types.3 crashing if we
start to call v3d_optimize_nir on v3dv directly.
Slight shaderdb changes, but not significant.
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17185>
|
||
|---|---|---|
| .. | ||
| meson.build | ||
| nir_to_vir.c | ||
| qpu_schedule.c | ||
| qpu_validate.c | ||
| v3d33_tex.c | ||
| v3d33_vpm_setup.c | ||
| v3d40_tex.c | ||
| v3d_compiler.h | ||
| v3d_nir_lower_image_load_store.c | ||
| v3d_nir_lower_io.c | ||
| v3d_nir_lower_line_smooth.c | ||
| v3d_nir_lower_load_store_bitsize.c | ||
| v3d_nir_lower_logic_ops.c | ||
| v3d_nir_lower_robust_access.c | ||
| v3d_nir_lower_scratch.c | ||
| v3d_nir_lower_txf_ms.c | ||
| vir.c | ||
| vir_dump.c | ||
| vir_live_variables.c | ||
| vir_opt_constant_alu.c | ||
| vir_opt_copy_propagate.c | ||
| vir_opt_dead_code.c | ||
| vir_opt_redundant_flags.c | ||
| vir_opt_small_immediates.c | ||
| vir_register_allocate.c | ||
| vir_to_qpu.c | ||