radv: gather the number of output components per stream
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 11 Sep 2018 09:08:49 +0000 (11:08 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 29 Oct 2018 16:09:08 +0000 (17:09 +0100)
This will be also used for splitting the GS->VS ring buffer.

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 465c8d1..c199b3c 100644 (file)
@@ -159,6 +159,7 @@ struct radv_shader_info {
        } vs;
        struct {
                uint8_t output_usage_mask[VARYING_SLOT_VAR31 + 1];
+               uint8_t num_stream_output_components[4];
                uint8_t max_stream;
        } gs;
        struct {
index 00bc2ca..1267851 100644 (file)
@@ -438,11 +438,13 @@ static void
 gather_info_output_decl_gs(const nir_shader *nir, const nir_variable *var,
                           struct radv_shader_info *info)
 {
+       unsigned num_components = glsl_get_component_slots(var->type);
        unsigned stream = var->data.stream;
 
        assert(stream < 4);
 
        info->gs.max_stream = MAX2(info->gs.max_stream, stream);
+       info->gs.num_stream_output_components[stream] += num_components;
 }
 
 static void