radv: Use nir_remove_non_entrypoints in radv_shader.c

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23902>
This commit is contained in:
Yonggang Luo
2023-06-29 01:08:21 +08:00
committed by Marge Bot
parent c545c39c7e
commit 0fbec6dd79

View File

@@ -477,13 +477,7 @@ radv_shader_spirv_to_nir(struct radv_device *device, const struct radv_pipeline_
NIR_PASS(_, nir, nir_opt_deref);
/* Pick off the single entrypoint that we want */
foreach_list_typed_safe (nir_function, func, node, &nir->functions) {
if (func->is_entrypoint)
func->name = ralloc_strdup(func, "main");
else
exec_node_remove(&func->node);
}
assert(exec_list_length(&nir->functions) == 1);
nir_remove_non_entrypoints(nir);
/* Make sure we lower constant initializers on output variables so that
* nir_remove_dead_variables below sees the corresponding stores