radv: gather the number of streams used by geometry shaders

This will be used for splitting the GS->VS ring buffer. The
stream ID is always 0 for now.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
Samuel Pitoiset 2018-09-11 11:08:23 +02:00
parent 19064b8c3a
commit 87e6866b04
2 changed files with 15 additions and 0 deletions

View File

@ -159,6 +159,7 @@ struct radv_shader_info {
} vs;
struct {
uint8_t output_usage_mask[VARYING_SLOT_VAR31 + 1];
uint8_t max_stream;
} gs;
struct {
uint8_t output_usage_mask[VARYING_SLOT_VAR31 + 1];

View File

@ -434,6 +434,17 @@ gather_info_output_decl_ps(const nir_shader *nir, const nir_variable *var,
}
}
static void
gather_info_output_decl_gs(const nir_shader *nir, const nir_variable *var,
struct radv_shader_info *info)
{
unsigned stream = var->data.stream;
assert(stream < 4);
info->gs.max_stream = MAX2(info->gs.max_stream, stream);
}
static void
gather_info_output_decl(const nir_shader *nir, const nir_variable *var,
struct radv_shader_info *info,
@ -447,6 +458,9 @@ gather_info_output_decl(const nir_shader *nir, const nir_variable *var,
if (options->key.vs.as_ls)
gather_info_output_decl_ls(nir, var, info);
break;
case MESA_SHADER_GEOMETRY:
gather_info_output_decl_gs(nir, var, info);
break;
default:
break;
}