radv: fill radv_vs_output_info unconditionally for vertex related stages

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 <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18210>
This commit is contained in:
Samuel Pitoiset 2022-08-23 08:48:56 +02:00 committed by Marge Bot
parent ee5b9bcc57
commit 2d0500d24a

View file

@ -354,18 +354,6 @@ gather_info_output_decl_gs(const nir_shader *nir, const nir_variable *var,
info->gs.output_streams[idx] = stream; 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 static void
gather_info_output_decl(const nir_shader *nir, const nir_variable *var, gather_info_output_decl(const nir_shader *nir, const nir_variable *var,
struct radv_shader_info *info) 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) nir->info.stage == MESA_SHADER_GEOMETRY)
gather_xfb_info(nir, info); gather_xfb_info(nir, info);
struct radv_vs_output_info *outinfo = get_vs_output_info(nir, info); if (nir->info.stage == MESA_SHADER_VERTEX || nir->info.stage == MESA_SHADER_TESS_EVAL ||
if (outinfo) { 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. */ /* These are not compiled into neither output param nor position exports. */
uint64_t special_mask = BITFIELD64_BIT(VARYING_SLOT_PRIMITIVE_COUNT) | uint64_t special_mask = BITFIELD64_BIT(VARYING_SLOT_PRIMITIVE_COUNT) |
BITFIELD64_BIT(VARYING_SLOT_PRIMITIVE_INDICES) | BITFIELD64_BIT(VARYING_SLOT_PRIMITIVE_INDICES) |