nir: gather info in opt_varyings_bulk

the info is all messed up so we need to do this right after. merge this
code.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36501>
This commit is contained in:
Alyssa Rosenzweig
2025-07-31 14:38:37 -04:00
committed by Marge Bot
parent 3e8575c037
commit b8f50b6317
3 changed files with 8 additions and 4 deletions
-3
View File
@@ -1563,9 +1563,6 @@ hk_compile_shaders(struct vk_device *vk_dev, uint32_t shader_count,
nir_opts);
for (uint32_t i = 0; i < shader_count; i++) {
nir_shader_gather_info(infos[i].nir,
nir_shader_get_entrypoint(infos[i].nir));
VkResult result =
hk_compile_shader(dev, &infos[i], state, features, pAllocator,
(struct hk_api_shader **)&shaders_out[i]);
-1
View File
@@ -4197,7 +4197,6 @@ link_varyings(struct gl_shader_program *prog, unsigned first,
continue;
nir_shader *nir = prog->_LinkedShaders[i]->Program->nir;
nir_shader_gather_info(nir, nir_shader_get_entrypoint(nir));
if (i != first) {
uint64_t inputs_read = nir->info.inputs_read;
+8
View File
@@ -5477,6 +5477,11 @@ nir_opt_varyings_bulk(nir_shader **shaders, uint32_t num_shaders, bool spirv,
NIR_PASS(_, nir, nir_lower_io_to_scalar, nir_varying_var_mask(nir),
NULL, NULL);
NIR_PASS(_, nir, nir_opt_vectorize_io, nir_varying_var_mask(nir), false);
/* Regather shader info so we have consistent behaviour for
* linked/unlinked code paths. Honeykrisp depends on this.
*/
nir_shader_gather_info(nir, nir_shader_get_entrypoint(nir));
return;
}
@@ -5551,6 +5556,9 @@ nir_opt_varyings_bulk(nir_shader **shaders, uint32_t num_shaders, bool spirv,
NIR_PASS(_, nir, nir_recompute_io_bases,
nir_var_shader_in | nir_var_shader_out);
/* Regather shader info because the slots info is messed up now. */
nir_shader_gather_info(nir, nir_shader_get_entrypoint(nir));
/* Regenerate transform feedback info because compaction in
* nir_opt_varyings always moves them to other slots.
*/