nir/gather_info: clear interpolation qualifiers only in fragment stage

Asahi wants the the interpolation qualifiers from the shader info in the
vertex shader. Clear them only in the fragment stage so they can
propagate back.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/work_items/15288
Backport-to: 26.0
Fixes: a72704d0fb ("nir/gather_info: clear interpolation qualifiers before gathering")
Signed-off-by: Janne Grunau <j@jannau.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41040>
This commit is contained in:
Janne Grunau 2026-04-17 15:38:31 +02:00 committed by Marge Bot
parent b860e0132f
commit 98a97cb413
2 changed files with 7 additions and 2 deletions

View file

@ -1096,8 +1096,6 @@ nir_shader_gather_info(nir_shader *shader, nir_function_impl *entrypoint)
shader->info.per_primitive_inputs = 0;
shader->info.per_primitive_outputs = 0;
shader->info.per_view_outputs = 0;
shader->info.linear_varyings = 0;
shader->info.perspective_varyings = 0;
shader->info.uses_resource_info_query = false;
@ -1115,6 +1113,8 @@ nir_shader_gather_info(nir_shader *shader, nir_function_impl *entrypoint)
/* By definition the fragment shader knows, unless we fail to gather. */
shader->info.known_interpolation_qualifiers = true;
shader->info.linear_varyings = 0;
shader->info.perspective_varyings = 0;
}
if (shader->info.stage == MESA_SHADER_TESS_CTRL) {
shader->info.tess.tcs_same_invocation_inputs_read = 0;

View file

@ -1790,6 +1790,11 @@ agx_shader_initialize(struct agx_device *dev, struct agx_uncompiled_shader *so,
nir_lower_io_lower_64bit_to_32 |
nir_lower_io_use_interpolated_input_intrinsics);
/* Regather shader info after nir_lower_io. This recalculates interpolation
* qualifiers which got lost when mesa/st lowered I/O back to vars.
*/
nir_shader_gather_info(nir, nir_shader_get_entrypoint(nir));
if (nir->info.stage == MESA_SHADER_FRAGMENT) {
so->info.uses_fbfetch = nir->info.fs.uses_fbfetch_output;
so->info.inputs_linear_shaded = nir->info.linear_varyings;