nir: add a nir_remove_non_entrypoints helper
This code just got duplicated a lot. There is still more, but the remaining instances do a bit more than just removing other functions. Signed-off-by: Karol Herbst <kherbst@redhat.com> Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16348>
This commit is contained in:
@@ -334,11 +334,7 @@ brw_kernel_from_spirv(struct brw_compiler *compiler,
|
||||
NIR_PASS_V(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)
|
||||
exec_node_remove(&func->node);
|
||||
}
|
||||
assert(exec_list_length(&nir->functions) == 1);
|
||||
nir_remove_non_entrypoints(nir);
|
||||
|
||||
/* Now that we've deleted all but the main function, we can go ahead and
|
||||
* lower the rest of the constant initializers. We do this here so that
|
||||
|
Reference in New Issue
Block a user