glsl: switch to nir linkers cross_validate_outputs_to_inputs()

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25371>
This commit is contained in:
Timothy Arceri 2023-09-25 10:57:15 +10:00 committed by Marge Bot
parent 7d1948e9b5
commit 36e49c162c
2 changed files with 17 additions and 6 deletions

View file

@ -1340,6 +1340,23 @@ gl_nir_link_glsl(const struct gl_constants *consts,
last = i;
}
/* Validate the inputs of each stage with the output of the preceding
* stage.
*/
unsigned prev = first;
for (unsigned i = prev + 1; i <= MESA_SHADER_FRAGMENT; i++) {
if (prog->_LinkedShaders[i] == NULL)
continue;
gl_nir_cross_validate_outputs_to_inputs(consts, prog,
prog->_LinkedShaders[prev],
prog->_LinkedShaders[i]);
if (!prog->data->LinkStatus)
return false;
prev = i;
}
/* The cross validation of outputs/inputs above validates interstage
* explicit locations. We need to do this also for the inputs in the first
* stage and outputs of the last stage included in the program, since there

View file

@ -3109,12 +3109,6 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
if (!prog->data->LinkStatus)
goto done;
cross_validate_outputs_to_inputs(consts, prog,
prog->_LinkedShaders[prev],
prog->_LinkedShaders[i]);
if (!prog->data->LinkStatus)
goto done;
prev = i;
}