radv: add radv_get_last_vgt_shader() helper

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22095>
This commit is contained in:
Samuel Pitoiset
2023-03-23 18:15:59 +01:00
committed by Marge Bot
parent 5c3c80be45
commit 168f282908

View File

@@ -1432,20 +1432,26 @@ radv_get_shader(const struct radv_pipeline *pipeline, gl_shader_stage stage)
return pipeline->shaders[stage];
}
static const struct radv_vs_output_info *
get_vs_output_info(const struct radv_graphics_pipeline *pipeline)
static const struct radv_shader *
radv_get_last_vgt_shader(const struct radv_graphics_pipeline *pipeline)
{
if (radv_pipeline_has_stage(pipeline, MESA_SHADER_GEOMETRY))
if (radv_pipeline_has_ngg(pipeline))
return &pipeline->base.shaders[MESA_SHADER_GEOMETRY]->info.outinfo;
return pipeline->base.shaders[MESA_SHADER_GEOMETRY];
else
return &pipeline->base.gs_copy_shader->info.outinfo;
return pipeline->base.gs_copy_shader;
else if (radv_pipeline_has_stage(pipeline, MESA_SHADER_TESS_CTRL))
return &pipeline->base.shaders[MESA_SHADER_TESS_EVAL]->info.outinfo;
return pipeline->base.shaders[MESA_SHADER_TESS_EVAL];
else if (radv_pipeline_has_stage(pipeline, MESA_SHADER_MESH))
return &pipeline->base.shaders[MESA_SHADER_MESH]->info.outinfo;
return pipeline->base.shaders[MESA_SHADER_MESH];
else
return &pipeline->base.shaders[MESA_SHADER_VERTEX]->info.outinfo;
return pipeline->base.shaders[MESA_SHADER_VERTEX];
}
static const struct radv_vs_output_info *
get_vs_output_info(const struct radv_graphics_pipeline *pipeline)
{
return &radv_get_last_vgt_shader(pipeline)->info.outinfo;
}
static bool