nvk: Only lower outputs to temporaries
Also, move it up to right after we parse the SPIR-V and remove some now unnecessary clean-up passes. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26197>
This commit is contained in:
parent
26bb5f4972
commit
845e7d2911
1 changed files with 3 additions and 13 deletions
|
|
@ -481,6 +481,9 @@ nvk_shader_stage_to_nir(struct nvk_device *dev,
|
|||
if (result != VK_SUCCESS)
|
||||
return result;
|
||||
|
||||
NIR_PASS_V(nir, nir_lower_io_to_temporaries,
|
||||
nir_shader_get_entrypoint(nir), true, false);
|
||||
|
||||
if (use_nak(dev->pdev, nir->info.stage))
|
||||
nak_preprocess_nir(nir, NULL);
|
||||
|
||||
|
|
@ -542,19 +545,6 @@ nvk_lower_nir(struct nvk_device *dev, nir_shader *nir,
|
|||
/* Vulkan uses the separate-shader linking model */
|
||||
nir->info.separate_shader = true;
|
||||
|
||||
if (nir->info.stage == MESA_SHADER_VERTEX ||
|
||||
nir->info.stage == MESA_SHADER_GEOMETRY ||
|
||||
nir->info.stage == MESA_SHADER_FRAGMENT) {
|
||||
NIR_PASS_V(nir, nir_lower_io_to_temporaries, nir_shader_get_entrypoint(nir), true, true);
|
||||
} else if (nir->info.stage == MESA_SHADER_TESS_EVAL) {
|
||||
NIR_PASS_V(nir, nir_lower_io_to_temporaries, nir_shader_get_entrypoint(nir), true, false);
|
||||
}
|
||||
NIR_PASS(_, nir, nir_split_var_copies);
|
||||
|
||||
NIR_PASS(_, nir, nir_lower_global_vars_to_local);
|
||||
NIR_PASS(_, nir, nir_remove_dead_variables, nir_var_function_temp, NULL);
|
||||
|
||||
|
||||
nvk_optimize_nir(nir);
|
||||
|
||||
NIR_PASS(_, nir, nir_lower_var_copies);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue