Module: Mesa Branch: main Commit: d05a02018bec80c982e5b3bcaa33c3833d42fde5 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=d05a02018bec80c982e5b3bcaa33c3833d42fde5
Author: Samuel Pitoiset <[email protected]> Date: Fri Feb 10 11:32:07 2023 +0100 radv: use last_vgt_api_stage for determining the last stage with XFB It's shorter and cleaner. Signed-off-by: Samuel Pitoiset <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21237> --- src/amd/vulkan/radv_pipeline.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c index 7567cc7dcda..52cc0506d4d 100644 --- a/src/amd/vulkan/radv_pipeline.c +++ b/src/amd/vulkan/radv_pipeline.c @@ -2455,15 +2455,9 @@ radv_fill_shader_info_ngg(struct radv_graphics_pipeline *pipeline, stages[MESA_SHADER_TESS_EVAL].info.is_ngg = false; } - gl_shader_stage last_xfb_stage = MESA_SHADER_VERTEX; - - for (int i = MESA_SHADER_VERTEX; i <= MESA_SHADER_GEOMETRY; i++) { - if (stages[i].nir) - last_xfb_stage = i; - } - - bool uses_xfb = stages[last_xfb_stage].nir && - stages[last_xfb_stage].nir->xfb_info; + bool uses_xfb = pipeline->last_vgt_api_stage != MESA_SHADER_NONE && + stages[pipeline->last_vgt_api_stage].nir && + stages[pipeline->last_vgt_api_stage].nir->xfb_info; if (!device->physical_device->use_ngg_streamout && uses_xfb) { /* GFX11+ requires NGG. */
