From 168f282908af60c2d5ddb7974cb93b5b8af2e1c5 Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Thu, 23 Mar 2023 18:15:59 +0100 Subject: [PATCH] radv: add radv_get_last_vgt_shader() helper Signed-off-by: Samuel Pitoiset Part-of: --- src/amd/vulkan/radv_pipeline.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c index ad4d544..ef0e42c 100644 --- a/src/amd/vulkan/radv_pipeline.c +++ b/src/amd/vulkan/radv_pipeline.c @@ -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 -- 2.7.4