mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-20 07:20:10 +01:00
panvk: Pull multiview lowering out of panvk_lower_nir()
It only applies to vertex shaders right now. Also, once we add geometry, it won't really work anymore so we'll need to do something else. Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com> Acked-by: Eric R. Smith <eric.smith@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38821>
This commit is contained in:
parent
4f0386fbfb
commit
4909e23d11
1 changed files with 21 additions and 17 deletions
|
|
@ -780,23 +780,6 @@ panvk_lower_nir(struct panvk_device *dev, nir_shader *nir,
|
|||
};
|
||||
NIR_PASS(_, nir, nir_opt_access, &access_options);
|
||||
|
||||
#if PAN_ARCH >= 10
|
||||
if (stage == MESA_SHADER_VERTEX && compile_input->view_mask) {
|
||||
nir_lower_multiview_options options = {
|
||||
.view_mask = compile_input->view_mask,
|
||||
.allowed_per_view_outputs = ~0
|
||||
};
|
||||
/* The only case where this should fail is with memory/image writes,
|
||||
* which we don't support in vertex shaders */
|
||||
assert(nir_can_lower_multiview(nir, options));
|
||||
NIR_PASS(_, nir, nir_lower_multiview, options);
|
||||
/* Pull output writes out of the loop and give them constant offsets for
|
||||
* pan_nir_lower_store_components */
|
||||
NIR_PASS(_, nir, nir_lower_io_vars_to_temporaries,
|
||||
nir_shader_get_entrypoint(nir), nir_var_shader_out);
|
||||
}
|
||||
#endif
|
||||
|
||||
const struct lower_ycbcr_state ycbcr_state = {
|
||||
.set_layout_count = set_layout_count,
|
||||
.set_layouts = set_layouts,
|
||||
|
|
@ -1327,6 +1310,27 @@ panvk_compile_shader(struct panvk_device *dev,
|
|||
nir_shader *nir =
|
||||
clone_nir ? nir_shader_clone(NULL, info->nir) : info->nir;
|
||||
|
||||
#if PAN_ARCH >= 10
|
||||
if (inputs.view_mask) {
|
||||
nir_lower_multiview_options options = {
|
||||
.view_mask = inputs.view_mask,
|
||||
.allowed_per_view_outputs = ~0
|
||||
};
|
||||
|
||||
/* The only case where this should fail is with memory/image
|
||||
* writes, which we don't support in vertex shaders
|
||||
*/
|
||||
assert(nir_can_lower_multiview(nir, options));
|
||||
NIR_PASS(_, nir, nir_lower_multiview, options);
|
||||
|
||||
/* Pull output writes out of the loop and give them constant
|
||||
* offsets for pan_lower_store_components
|
||||
*/
|
||||
NIR_PASS(_, nir, nir_lower_io_vars_to_temporaries,
|
||||
nir_shader_get_entrypoint(nir), nir_var_shader_out);
|
||||
}
|
||||
#endif
|
||||
|
||||
panvk_lower_nir(dev, nir, info->set_layout_count,
|
||||
info->set_layouts, info->robustness,
|
||||
state, &inputs, &variant->desc_info);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue