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

Author: Samuel Pitoiset <[email protected]>
Date:   Mon Sep 27 15:11:15 2021 +0200

radv: remove vs_common_out:export_clip_dists

Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Timur Kristóf <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13085>

---

 src/amd/vulkan/radv_pipeline.c    | 15 ++++++++++-----
 src/amd/vulkan/radv_shader_info.c | 18 ------------------
 2 files changed, 10 insertions(+), 23 deletions(-)

diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c
index 29e23bb465a..539f1443b83 100644
--- a/src/amd/vulkan/radv_pipeline.c
+++ b/src/amd/vulkan/radv_pipeline.c
@@ -2885,11 +2885,16 @@ radv_fill_shader_info(struct radv_pipeline *pipeline,
          }
       }
 
-      /* TODO: These are no longer used as keys we should refactor this */
-      keys[MESA_SHADER_VERTEX].vs_common_out.export_clip_dists =
-         !!infos[MESA_SHADER_FRAGMENT].ps.num_input_clips_culls;
-      keys[MESA_SHADER_TESS_EVAL].vs_common_out.export_clip_dists =
-         !!infos[MESA_SHADER_FRAGMENT].ps.num_input_clips_culls;
+      if (!!infos[MESA_SHADER_FRAGMENT].ps.num_input_clips_culls) {
+         if (pipeline->graphics.last_vgt_api_stage == MESA_SHADER_VERTEX) {
+            infos[MESA_SHADER_VERTEX].vs.outinfo.export_clip_dists = true;
+         } else if (pipeline->graphics.last_vgt_api_stage == 
MESA_SHADER_TESS_EVAL) {
+            infos[MESA_SHADER_TESS_EVAL].tes.outinfo.export_clip_dists = true;
+         } else {
+            assert(pipeline->graphics.last_vgt_api_stage == 
MESA_SHADER_GEOMETRY);
+            infos[MESA_SHADER_GEOMETRY].vs.outinfo.export_clip_dists = true;
+         }
+      }
 
       /* NGG passthrough mode can't be enabled for vertex shaders
        * that export the primitive ID.
diff --git a/src/amd/vulkan/radv_shader_info.c 
b/src/amd/vulkan/radv_shader_info.c
index a6d28942087..de1daa7266d 100644
--- a/src/amd/vulkan/radv_shader_info.c
+++ b/src/amd/vulkan/radv_shader_info.c
@@ -603,24 +603,6 @@ radv_nir_shader_info_pass(struct radv_device *device, 
const struct nir_shader *n
       }
    }
 
-
-   /* 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) {
-      case MESA_SHADER_VERTEX:
-         info->vs.outinfo.export_clip_dists = true;
-         break;
-      case MESA_SHADER_TESS_EVAL:
-         info->tes.outinfo.export_clip_dists = true;
-         break;
-      case MESA_SHADER_GEOMETRY:
-         info->vs.outinfo.export_clip_dists = true;
-         break;
-      default:
-         break;
-      }
-   }
-
    if (nir->info.stage == MESA_SHADER_FRAGMENT)
       info->ps.num_interp = nir->num_inputs;
 

Reply via email to