radv: export multiview in VS/TES/GS for depth-only rendering

For depth-only rendering, a VS would not export layer properly.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10606
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27615>
(cherry picked from commit 786c1b8322)
This commit is contained in:
Hans-Kristian Arntzen 2024-02-14 12:53:58 +01:00 committed by Eric Engestrom
parent 2166ee5c2e
commit f36d69d1d6
2 changed files with 5 additions and 4 deletions

View file

@ -3594,7 +3594,7 @@
"description": "radv: export multiview in VS/TES/GS for depth-only rendering",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null,
"notes": null

View file

@ -1178,11 +1178,12 @@ get_vs_output_info(const struct radv_graphics_pipeline *pipeline)
static bool
radv_should_export_multiview(const struct radv_shader_stage *stage, const struct radv_pipeline_key *pipeline_key)
{
/* Export the layer in the last VGT stage if multiview is used. When the next stage is unknown
* (with graphics pipeline library), the layer is exported unconditionally.
/* Export the layer in the last VGT stage if multiview is used.
* Also checks for NONE stage, which happens when we have depth-only rendering.
* When the next stage is unknown (with graphics pipeline library), the layer is exported unconditionally.
*/
return pipeline_key->has_multiview_view_index &&
(stage->info.next_stage == MESA_SHADER_FRAGMENT ||
(stage->info.next_stage == MESA_SHADER_FRAGMENT || stage->info.next_stage == MESA_SHADER_NONE ||
!(pipeline_key->lib_flags & VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT)) &&
!(stage->nir->info.outputs_written & VARYING_BIT_LAYER);
}