radv: gather which GS stream is used for every outputs
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 13 Sep 2018 13:39:43 +0000 (15:39 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 29 Oct 2018 16:09:08 +0000 (17:09 +0100)
To only emit outputs for the given stream.

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 c199b3c27af91a0e38f8c3293cfb3395cc967303..6511538dacea68663734982f299e8617aedc2673 100644 (file)
@@ -160,6 +160,7 @@ struct radv_shader_info {
        struct {
                uint8_t output_usage_mask[VARYING_SLOT_VAR31 + 1];
                uint8_t num_stream_output_components[4];
+               uint8_t output_streams[VARYING_SLOT_VAR31 + 1];
                uint8_t max_stream;
        } gs;
        struct {
index 126785120d91170c593f42acc8563b9cf8468cfa..29f5f68a3285b07978098c9fcaefb6f53cecc9db 100644 (file)
@@ -440,11 +440,13 @@ gather_info_output_decl_gs(const nir_shader *nir, const nir_variable *var,
 {
        unsigned num_components = glsl_get_component_slots(var->type);
        unsigned stream = var->data.stream;
+       unsigned idx = var->data.location;
 
        assert(stream < 4);
 
        info->gs.max_stream = MAX2(info->gs.max_stream, stream);
        info->gs.num_stream_output_components[stream] += num_components;
+       info->gs.output_streams[idx] = stream;
 }
 
 static void