radv: remove unnecessary vs_common_out.export_viewport_index
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 27 Sep 2021 10:00:24 +0000 (12:00 +0200)
committerMarge Bot <eric+marge@anholt.net>
Tue, 28 Sep 2021 12:30:36 +0000 (12:30 +0000)
This was only used when the FS needs the viewport index if it's not
exported by the previous stage. Though, this is actually useless
because the driver will emit 0 for the PS input in this case.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13061>

src/amd/vulkan/radv_pipeline.c
src/amd/vulkan/radv_shader.h
src/amd/vulkan/radv_shader_info.c

index 5c1a39b..99478b9 100644 (file)
@@ -2872,16 +2872,12 @@ radv_fill_shader_info(struct radv_pipeline *pipeline,
          infos[MESA_SHADER_FRAGMENT].ps.layer_input;
       keys[MESA_SHADER_VERTEX].vs_common_out.export_clip_dists =
          !!infos[MESA_SHADER_FRAGMENT].ps.num_input_clips_culls;
-      keys[MESA_SHADER_VERTEX].vs_common_out.export_viewport_index =
-         infos[MESA_SHADER_FRAGMENT].ps.viewport_index_input;
       keys[MESA_SHADER_TESS_EVAL].vs_common_out.export_prim_id =
          infos[MESA_SHADER_FRAGMENT].ps.prim_id_input;
       keys[MESA_SHADER_TESS_EVAL].vs_common_out.export_layer_id =
          infos[MESA_SHADER_FRAGMENT].ps.layer_input;
       keys[MESA_SHADER_TESS_EVAL].vs_common_out.export_clip_dists =
          !!infos[MESA_SHADER_FRAGMENT].ps.num_input_clips_culls;
-      keys[MESA_SHADER_TESS_EVAL].vs_common_out.export_viewport_index =
-         infos[MESA_SHADER_FRAGMENT].ps.viewport_index_input;
 
       /* NGG passthrough mode can't be enabled for vertex shaders
        * that export the primitive ID.
index 4139375..449d8da 100644 (file)
@@ -55,7 +55,6 @@ struct radv_vs_out_key {
    uint32_t export_prim_id : 1;
    uint32_t export_layer_id : 1;
    uint32_t export_clip_dists : 1;
-   uint32_t export_viewport_index : 1;
 };
 
 struct radv_vs_variant_key {
index 7c121a7..fb77f59 100644 (file)
@@ -637,23 +637,6 @@ radv_nir_shader_info_pass(struct radv_device *device, const struct nir_shader *n
       }
    }
 
-   /* Make sure to export the ViewportIndex if the fragment shader needs it. */
-   if (key->vs_common_out.export_viewport_index) {
-      switch (nir->info.stage) {
-      case MESA_SHADER_VERTEX:
-         info->vs.output_usage_mask[VARYING_SLOT_VIEWPORT] |= 0x1;
-         break;
-      case MESA_SHADER_TESS_EVAL:
-         info->tes.output_usage_mask[VARYING_SLOT_VIEWPORT] |= 0x1;
-         break;
-      case MESA_SHADER_GEOMETRY:
-         info->gs.output_usage_mask[VARYING_SLOT_VIEWPORT] |= 0x1;
-         break;
-      default:
-         break;
-      }
-   }
-
    /* Make sure to export the clip/cull distances if the fragment shader needs it. */
    if (key->vs_common_out.export_clip_dists) {
       switch (nir->info.stage) {