panvk: Only lower outputs to temporaries
We need to lower outputs to get rid of output reads and so that we can fix up layer writes on Bifrost. However, there's really no point in lowering reads besides moving them to the top. Even then, NIR can probably copy propagate the copies and we'll end up reading straight from the input variable anyway. Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com> Reviewed-by: Christoph Pillmayer <christoph.pillmayern@arm.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38334>
This commit is contained in:
committed by
Marge Bot
parent
a8b6213983
commit
1a9c7f8c8a
@@ -398,12 +398,13 @@ panvk_preprocess_nir(struct vk_physical_device *vk_pdev,
|
||||
if (nir->info.stage == MESA_SHADER_FRAGMENT)
|
||||
NIR_PASS(_, nir, nir_opt_vectorize_io_vars, nir_var_shader_out);
|
||||
|
||||
NIR_PASS(_, nir, nir_lower_io_vars_to_temporaries, nir_shader_get_entrypoint(nir),
|
||||
true, true);
|
||||
NIR_PASS(_, nir, nir_lower_io_vars_to_temporaries,
|
||||
nir_shader_get_entrypoint(nir), true, false);
|
||||
|
||||
#if PAN_ARCH < 9
|
||||
/* This needs to be done just after the io_to_temporaries pass, because we
|
||||
* rely on in/out temporaries to collect the final layer_id value. */
|
||||
* rely on out temporaries to collect the final layer_id value.
|
||||
*/
|
||||
NIR_PASS(_, nir, lower_layer_writes);
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user