mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-06 19:40:10 +01:00
glsl: switch to nir validate_first_and_last_interface_explicit_locations()
Use the new nir version. The glsl ir version will be removed in the following patch. Reviewed-by: Emma Anholt <emma@anholt.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25318>
This commit is contained in:
parent
92f24e6cdc
commit
7b744bb8df
2 changed files with 22 additions and 13 deletions
|
|
@ -1337,6 +1337,27 @@ gl_nir_link_glsl(const struct gl_constants *consts,
|
|||
break;
|
||||
}
|
||||
|
||||
unsigned first = MESA_SHADER_STAGES;
|
||||
unsigned last = 0;
|
||||
|
||||
/* Determine first and last stage. */
|
||||
for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) {
|
||||
if (!prog->_LinkedShaders[i])
|
||||
continue;
|
||||
if (first == MESA_SHADER_STAGES)
|
||||
first = i;
|
||||
last = 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
|
||||
* is no cross validation for these.
|
||||
*/
|
||||
gl_nir_validate_first_and_last_interface_explicit_locations(consts, prog,
|
||||
(gl_shader_stage) first,
|
||||
(gl_shader_stage) last);
|
||||
|
||||
if (prog->SeparateShader)
|
||||
disable_varying_optimizations_for_sso(prog);
|
||||
|
||||
|
|
|
|||
|
|
@ -3076,18 +3076,15 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
|
|||
if (!prog->data->LinkStatus)
|
||||
goto done;
|
||||
|
||||
unsigned first, last, prev;
|
||||
unsigned first, prev;
|
||||
|
||||
first = MESA_SHADER_STAGES;
|
||||
last = 0;
|
||||
|
||||
/* Determine first and last stage. */
|
||||
for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) {
|
||||
if (!prog->_LinkedShaders[i])
|
||||
continue;
|
||||
if (first == MESA_SHADER_STAGES)
|
||||
first = i;
|
||||
last = i;
|
||||
}
|
||||
|
||||
check_explicit_uniform_locations(&ctx->Extensions, prog);
|
||||
|
|
@ -3121,15 +3118,6 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
|
|||
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
|
||||
* is no cross validation for these.
|
||||
*/
|
||||
validate_first_and_last_interface_explicit_locations(consts, prog,
|
||||
(gl_shader_stage) first,
|
||||
(gl_shader_stage) last);
|
||||
|
||||
/* Cross-validate uniform blocks between shader stages */
|
||||
validate_interstage_uniform_blocks(prog, prog->_LinkedShaders);
|
||||
if (!prog->data->LinkStatus)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue