radv: scan the geometry shader output usage mask
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 14 May 2018 14:04:35 +0000 (16:04 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 14 May 2018 19:38:21 +0000 (21:38 +0200)
For reducing the number of parameters that are exported by
the GS copy shader.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_shader.h
src/amd/vulkan/radv_shader_info.c

index b711cba80cfbfd3b23d0e4784b2f68b4b83916a8..679fa442798436bc3657a2472366b14c4bd5c078 100644 (file)
@@ -157,6 +157,9 @@ struct radv_shader_info {
                bool needs_draw_id;
                bool needs_instance_id;
        } vs;
+       struct {
+               uint8_t output_usage_mask[VARYING_SLOT_VAR31 + 1];
+       } gs;
        struct {
                uint8_t output_usage_mask[VARYING_SLOT_VAR31 + 1];
        } tes;
index a436bd753430a525f38b972b6352f7f3616b5d54..b45b4c0c95b723be30fe5341b97748db28aa1868 100644 (file)
@@ -134,6 +134,12 @@ gather_intrinsic_store_var_info(const nir_shader *nir,
                                        instr->const_index[0] << comp;
                        }
                        break;
+               case MESA_SHADER_GEOMETRY:
+                       for (unsigned i = 0; i < attrib_count; i++) {
+                               info->gs.output_usage_mask[idx + i + const_offset] |=
+                                       instr->const_index[0] << comp;
+                       }
+                       break;
                case MESA_SHADER_TESS_EVAL:
                        for (unsigned i = 0; i < attrib_count; i++) {
                                info->tes.output_usage_mask[idx + i + const_offset] |=