radv: gather the number of streams used by geometry shaders
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 11 Sep 2018 09:08:23 +0000 (11:08 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 29 Oct 2018 16:09:08 +0000 (17:09 +0100)
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>
src/amd/vulkan/radv_shader.h
src/amd/vulkan/radv_shader_info.c

index 22423e5f99a9ec5abba689e3419d7e02e9581049..465c8d160fef744520a0ee747ecf0176851a2a21 100644 (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];
index 6262acb1a655f60bfb1a1fd2c9c0c7fc961f18d6..00bc2ca5db11df4fb326f4598a481cb8576539b4 100644 (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;
        }