From 2d0500d24a88cf4353937fc45bcc8a5530c60cbc Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Tue, 23 Aug 2022 08:48:56 +0200 Subject: [PATCH] radv: fill radv_vs_output_info unconditionally for vertex related stages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit That shouldn't change anything for VS as LS (or as ES) and for TES as ES because radv_vs_output_info is only used by the last vertex stage. So, if we have TES+GS, radv_vs_output_info for TES will be overwritten by GS. This allows to decouple the shader info pass from other stages. Signed-off-by: Samuel Pitoiset Reviewed-by: Timur Kristóf Part-of: --- src/amd/vulkan/radv_shader_info.c | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/src/amd/vulkan/radv_shader_info.c b/src/amd/vulkan/radv_shader_info.c index 89919561602..0311595197a 100644 --- a/src/amd/vulkan/radv_shader_info.c +++ b/src/amd/vulkan/radv_shader_info.c @@ -354,18 +354,6 @@ gather_info_output_decl_gs(const nir_shader *nir, const nir_variable *var, info->gs.output_streams[idx] = stream; } -static struct radv_vs_output_info * -get_vs_output_info(const nir_shader *nir, struct radv_shader_info *info) -{ - if ((nir->info.stage == MESA_SHADER_VERTEX && !info->vs.as_ls && !info->vs.as_es) || - (nir->info.stage == MESA_SHADER_TESS_EVAL && !info->tes.as_es) || - nir->info.stage == MESA_SHADER_GEOMETRY || nir->info.stage == MESA_SHADER_MESH) { - return &info->outinfo; - } - - return NULL; -} - static void gather_info_output_decl(const nir_shader *nir, const nir_variable *var, struct radv_shader_info *info) @@ -491,8 +479,10 @@ radv_nir_shader_info_pass(struct radv_device *device, const struct nir_shader *n nir->info.stage == MESA_SHADER_GEOMETRY) gather_xfb_info(nir, info); - struct radv_vs_output_info *outinfo = get_vs_output_info(nir, info); - if (outinfo) { + if (nir->info.stage == MESA_SHADER_VERTEX || nir->info.stage == MESA_SHADER_TESS_EVAL || + nir->info.stage == MESA_SHADER_GEOMETRY || nir->info.stage == MESA_SHADER_MESH) { + struct radv_vs_output_info *outinfo = &info->outinfo; + /* These are not compiled into neither output param nor position exports. */ uint64_t special_mask = BITFIELD64_BIT(VARYING_SLOT_PRIMITIVE_COUNT) | BITFIELD64_BIT(VARYING_SLOT_PRIMITIVE_INDICES) |