From 786c1b8322d96b9cf8d39403e9e868030a73323d Mon Sep 17 00:00:00 2001 From: Hans-Kristian Arntzen Date: Wed, 14 Feb 2024 12:53:58 +0100 Subject: [PATCH] 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 Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10606 Reviewed-by: Samuel Pitoiset cc: mesa-stable Part-of: --- src/amd/vulkan/radv_pipeline_graphics.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/amd/vulkan/radv_pipeline_graphics.c b/src/amd/vulkan/radv_pipeline_graphics.c index d95d822dca8..e404f21004f 100644 --- a/src/amd/vulkan/radv_pipeline_graphics.c +++ b/src/amd/vulkan/radv_pipeline_graphics.c @@ -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_graphics_state_key *gfx_state) { - /* 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 gfx_state->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 || !(gfx_state->lib_flags & VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT)) && !(stage->nir->info.outputs_written & VARYING_BIT_LAYER); }