Module: Mesa
Branch: main
Commit: 168f282908af60c2d5ddb7974cb93b5b8af2e1c5
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=168f282908af60c2d5ddb7974cb93b5b8af2e1c5

Author: Samuel Pitoiset <[email protected]>
Date:   Thu Mar 23 18:15:59 2023 +0100

radv: add radv_get_last_vgt_shader() helper

Signed-off-by: Samuel Pitoiset <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22095>

---

 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 ad4d5447dae..ef0e42c1663 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

Reply via email to