mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-06 06:40:08 +01:00
anv/pipeline: Handle output lowering in anv_pipeline instead of spirv_to_nir
While we're at it, we delete any unused variables. This allows us to prune variables that are not used in the current stage from the shader.
This commit is contained in:
parent
b8ec48ee76
commit
790565b06e
2 changed files with 7 additions and 5 deletions
|
|
@ -3526,10 +3526,5 @@ spirv_to_nir(const uint32_t *words, size_t word_count,
|
|||
|
||||
ralloc_free(b);
|
||||
|
||||
/* Because we can still have output reads in NIR, we need to lower
|
||||
* outputs to temporaries before we are truely finished.
|
||||
*/
|
||||
nir_lower_outputs_to_temporaries(entry_point->shader, entry_point);
|
||||
|
||||
return entry_point;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -133,6 +133,13 @@ anv_shader_compile_to_nir(struct anv_device *device,
|
|||
assert(exec_list_length(&nir->functions) == 1);
|
||||
entry_point->name = ralloc_strdup(entry_point, "main");
|
||||
|
||||
nir_remove_dead_variables(nir, nir_var_shader_in);
|
||||
nir_remove_dead_variables(nir, nir_var_shader_out);
|
||||
nir_remove_dead_variables(nir, nir_var_system_value);
|
||||
nir_validate_shader(nir);
|
||||
|
||||
nir_lower_outputs_to_temporaries(entry_point->shader, entry_point);
|
||||
|
||||
nir_lower_system_values(nir);
|
||||
nir_validate_shader(nir);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue