mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 08:40:11 +01:00
glsl: Use nir_remove_non_entrypoints to simplify the code
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:
parent
1238a65251
commit
c545c39c7e
1 changed files with 5 additions and 7 deletions
|
|
@ -249,14 +249,12 @@ glsl_to_nir(const struct gl_constants *consts,
|
|||
|
||||
nir_validate_shader(shader, "after function inlining and return lowering");
|
||||
|
||||
/* Now that we have inlined everything remove all of the functions except
|
||||
* main().
|
||||
/* We set func->is_entrypoint after nir_function_create if the function
|
||||
* is named "main", so we can use nir_remove_non_entrypoints() for this.
|
||||
* Now that we have inlined everything remove all of the functions except
|
||||
* func->is_entrypoint.
|
||||
*/
|
||||
foreach_list_typed_safe(nir_function, function, node, &(shader)->functions){
|
||||
if (strcmp("main", function->name) != 0) {
|
||||
exec_node_remove(&function->node);
|
||||
}
|
||||
}
|
||||
nir_remove_non_entrypoints(shader);
|
||||
|
||||
shader->info.name = ralloc_asprintf(shader, "GLSL%d", shader_prog->Name);
|
||||
if (shader_prog->Label)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue