From 87e6866b043c6fcadc78f34929e48961b885003e Mon Sep 17 00:00:00 2001 From: Samuel Pitoiset Date: Tue, 11 Sep 2018 11:08:23 +0200 Subject: [PATCH] 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 Reviewed-by: Dave Airlie --- src/amd/vulkan/radv_shader.h | 1 + src/amd/vulkan/radv_shader_info.c | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/src/amd/vulkan/radv_shader.h b/src/amd/vulkan/radv_shader.h index 22423e5f99a..465c8d160fe 100644 --- a/src/amd/vulkan/radv_shader.h +++ b/src/amd/vulkan/radv_shader.h @@ -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]; diff --git a/src/amd/vulkan/radv_shader_info.c b/src/amd/vulkan/radv_shader_info.c index 6262acb1a65..00bc2ca5db1 100644 --- a/src/amd/vulkan/radv_shader_info.c +++ b/src/amd/vulkan/radv_shader_info.c @@ -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; } -- 2.30.2