Mesa (main): vulkan: Call gather_xfb_info in vk_spirv_to_nir

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jul 21 21:52:41 UTC 2022


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

Author: Jason Ekstrand <jason.ekstrand at collabora.com>
Date:   Tue Jul 19 19:20:38 2022 -0500

vulkan: Call gather_xfb_info in vk_spirv_to_nir

In particular, we now call it before running dead variables so we get
the XFB info even for things which are never written.  This fixes a 102
Vulkan CTS tests on ANV and probably turnip as well.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17644>

---

 src/intel/vulkan/anv_pipeline.c | 5 -----
 src/vulkan/runtime/vk_nir.c     | 6 ++++++
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/intel/vulkan/anv_pipeline.c b/src/intel/vulkan/anv_pipeline.c
index 453760a5f7e..9b73c3e00d2 100644
--- a/src/intel/vulkan/anv_pipeline.c
+++ b/src/intel/vulkan/anv_pipeline.c
@@ -789,11 +789,6 @@ anv_pipeline_lower_nir(struct anv_pipeline *pipeline,
        gl_shader_stage_is_mesh(nir->info.stage))
       NIR_PASS(_, nir, brw_nir_lower_cs_intrinsics);
 
-   if (nir->info.stage == MESA_SHADER_VERTEX ||
-       nir->info.stage == MESA_SHADER_TESS_EVAL ||
-       nir->info.stage == MESA_SHADER_GEOMETRY)
-      NIR_PASS_V(nir, nir_shader_gather_xfb_info);
-
    stage->nir = nir;
 }
 
diff --git a/src/vulkan/runtime/vk_nir.c b/src/vulkan/runtime/vk_nir.c
index 1474630e793..8000b94034e 100644
--- a/src/vulkan/runtime/vk_nir.c
+++ b/src/vulkan/runtime/vk_nir.c
@@ -24,6 +24,7 @@
 
 #include "vk_nir.h"
 
+#include "compiler/nir/nir_xfb_info.h"
 #include "compiler/spirv/nir_spirv.h"
 #include "vk_log.h"
 #include "vk_util.h"
@@ -151,6 +152,11 @@ vk_spirv_to_nir(struct vk_device *device,
     */
    NIR_PASS_V(nir, nir_lower_clip_cull_distance_arrays);
 
+   if (nir->info.stage == MESA_SHADER_VERTEX ||
+       nir->info.stage == MESA_SHADER_TESS_EVAL ||
+       nir->info.stage == MESA_SHADER_GEOMETRY)
+      NIR_PASS_V(nir, nir_shader_gather_xfb_info);
+
    NIR_PASS_V(nir, nir_propagate_invariant, false);
 
    return nir;



More information about the mesa-commit mailing list