mirror of https://gitlab.freedesktop.org/mesa/mesa
nir: fix nir_shader_get_function_for_name for functions without names.
It's legal in SPIRV for functions to not have names, we have to take this
into account when calling into strcmp here.
Fixes: 2aa9eb497d
("nir: Add a helper for finding a function by name")
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29063>
This commit is contained in:
parent
13bd413860
commit
569c2fcf95
|
@ -4332,7 +4332,7 @@ static inline nir_function *
|
||||||
nir_shader_get_function_for_name(const nir_shader *shader, const char *name)
|
nir_shader_get_function_for_name(const nir_shader *shader, const char *name)
|
||||||
{
|
{
|
||||||
nir_foreach_function(func, shader) {
|
nir_foreach_function(func, shader) {
|
||||||
if (strcmp(func->name, name) == 0)
|
if (func->name && strcmp(func->name, name) == 0)
|
||||||
return func;
|
return func;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue