glsl: move some linking calls to gl_nir_link_glsl()

This is a more logical place for them and will avoid us adding more
function validtion calls to the st glsl to nir file in future
patches.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28538>
This commit is contained in:
Timothy Arceri
2024-03-20 15:02:19 +11:00
committed by Marge Bot
parent dbaa90200c
commit 1a78e9a7e8
2 changed files with 12 additions and 6 deletions

View File

@@ -1677,6 +1677,18 @@ gl_nir_link_glsl(const struct gl_constants *consts,
MESA_TRACE_FUNC();
for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) {
if (prog->_LinkedShaders[i] == NULL)
continue;
gl_nir_detect_recursion_linked(prog,
prog->_LinkedShaders[i]->Program->nir);
if (!prog->data->LinkStatus)
return false;
gl_nir_inline_functions(prog->_LinkedShaders[i]->Program->nir);
}
resize_tes_inputs(consts, prog);
/* Validate the inputs of each stage with the output of the preceding

View File

@@ -542,12 +542,6 @@ st_link_glsl_to_nir(struct gl_context *ctx,
}
prog->nir = glsl_to_nir(&st->ctx->Const, shader_program, shader->Stage, options);
gl_nir_detect_recursion_linked(shader_program, prog->nir);
if (!shader_program->data->LinkStatus)
return GL_FALSE;
gl_nir_inline_functions(prog->nir);
}
memcpy(prog->nir->info.source_sha1, shader->linked_source_sha1,