summaryrefslogtreecommitdiffstats
path: root/src/amd/vulkan
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2018-09-11 11:08:23 +0200
committerSamuel Pitoiset <[email protected]>2018-10-29 17:09:08 +0100
commit87e6866b043c6fcadc78f34929e48961b885003e (patch)
tree4c71f24eac4a1c2b46e9bde6653dabb1c8c09d9f /src/amd/vulkan
parent19064b8c3a8e0f7b9081a0564f1c7c79a1953d0b (diff)
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 <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/amd/vulkan')
-rw-r--r--src/amd/vulkan/radv_shader.h1
-rw-r--r--src/amd/vulkan/radv_shader_info.c14
2 files changed, 15 insertions, 0 deletions
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
@@ -435,6 +435,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,
const struct radv_nir_compiler_options *options)
@@ -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;
}