mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2024-11-27 04:04:23 +08:00
glsl: remove unused detect_recursion_linked()
This is now unused as the recursion is now detected via a nir pass. Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29495>
This commit is contained in:
parent
724bb7fa15
commit
71d455b96f
@ -2446,18 +2446,6 @@ void
|
||||
detect_recursion_unlinked(struct _mesa_glsl_parse_state *state,
|
||||
exec_list *instructions);
|
||||
|
||||
/**
|
||||
* Detect whether a linked shader contains static recursion
|
||||
*
|
||||
* If the list of instructions is determined to contain static recursion,
|
||||
* \c link_error_printf will be called to emit error messages for each function
|
||||
* that is in the recursion cycle. In addition,
|
||||
* \c gl_shader_program::LinkStatus will be set to false.
|
||||
*/
|
||||
void
|
||||
detect_recursion_linked(struct gl_shader_program *prog,
|
||||
exec_list *instructions);
|
||||
|
||||
/**
|
||||
* Make a clone of each IR instruction in a list
|
||||
*
|
||||
|
@ -290,24 +290,6 @@ emit_errors_unlinked(const void *key, void *data, void *closure)
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
emit_errors_linked(const void *key, void *data, void *closure)
|
||||
{
|
||||
struct gl_shader_program *prog =
|
||||
(struct gl_shader_program *) closure;
|
||||
function *f = (function *) data;
|
||||
|
||||
(void) key;
|
||||
|
||||
char *proto = prototype_string(f->sig->return_type,
|
||||
f->sig->function_name(),
|
||||
&f->sig->parameters);
|
||||
|
||||
linker_error(prog, "function `%s' has static recursion.\n", proto);
|
||||
ralloc_free(proto);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
detect_recursion_unlinked(struct _mesa_glsl_parse_state *state,
|
||||
exec_list *instructions)
|
||||
@ -332,29 +314,3 @@ detect_recursion_unlinked(struct _mesa_glsl_parse_state *state,
|
||||
*/
|
||||
hash_table_call_foreach(v.function_hash, emit_errors_unlinked, state);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
detect_recursion_linked(struct gl_shader_program *prog,
|
||||
exec_list *instructions)
|
||||
{
|
||||
has_recursion_visitor v;
|
||||
|
||||
/* Collect all of the information about which functions call which other
|
||||
* functions.
|
||||
*/
|
||||
v.run(instructions);
|
||||
|
||||
/* Remove from the set all of the functions that either have no caller or
|
||||
* call no other functions. Repeat until no functions are removed.
|
||||
*/
|
||||
do {
|
||||
v.progress = false;
|
||||
hash_table_call_foreach(v.function_hash, remove_unlinked_functions, & v);
|
||||
} while (v.progress);
|
||||
|
||||
|
||||
/* At this point any functions still in the hash must be part of a cycle.
|
||||
*/
|
||||
hash_table_call_foreach(v.function_hash, emit_errors_linked, prog);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user