Module: Mesa
Branch: main
Commit: a35cfa77f643aba52b18d847c1fe9c0240361e10
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=a35cfa77f643aba52b18d847c1fe9c0240361e10

Author: Samuel Pitoiset <[email protected]>
Date:   Mon Sep 27 12:00:24 2021 +0200

radv: remove unnecessary vs_common_out.export_viewport_index

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 <[email protected]>
Reviewed-by: Timur Kristóf <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13061>

---

 src/amd/vulkan/radv_pipeline.c    |  4 ----
 src/amd/vulkan/radv_shader.h      |  1 -
 src/amd/vulkan/radv_shader_info.c | 17 -----------------
 3 files changed, 22 deletions(-)

diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c
index 5c1a39bf732..99478b9a521 100644
--- a/src/amd/vulkan/radv_pipeline.c
+++ b/src/amd/vulkan/radv_pipeline.c
@@ -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.
diff --git a/src/amd/vulkan/radv_shader.h b/src/amd/vulkan/radv_shader.h
index 4139375d21e..449d8dac700 100644
--- a/src/amd/vulkan/radv_shader.h
+++ b/src/amd/vulkan/radv_shader.h
@@ -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 {
diff --git a/src/amd/vulkan/radv_shader_info.c 
b/src/amd/vulkan/radv_shader_info.c
index 7c121a718f7..fb77f59c529 100644
--- a/src/amd/vulkan/radv_shader_info.c
+++ b/src/amd/vulkan/radv_shader_info.c
@@ -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) {

Reply via email to