Mesa (main): nir_to_tgsi: Don't count ZS fbfetch vars as outputs

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jun 22 05:02:10 UTC 2022


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

Author: Pavel Asyutchenko <sventeam at yandex.ru>
Date:   Sat Dec  4 00:38:56 2021 +0300

nir_to_tgsi: Don't count ZS fbfetch vars as outputs

Signed-off-by: Pavel Asyutchenko <sventeam at yandex.ru>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13979>

---

 src/gallium/auxiliary/nir/nir_to_tgsi_info.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/gallium/auxiliary/nir/nir_to_tgsi_info.c b/src/gallium/auxiliary/nir/nir_to_tgsi_info.c
index 80db4e5e193..72998d20ebf 100644
--- a/src/gallium/auxiliary/nir/nir_to_tgsi_info.c
+++ b/src/gallium/auxiliary/nir/nir_to_tgsi_info.c
@@ -717,7 +717,8 @@ void nir_tgsi_scan_shader(const struct nir_shader *nir,
             info->colors_written |= 1 << semantic_index;
             break;
          case TGSI_SEMANTIC_STENCIL:
-            info->writes_stencil = true;
+            if (!variable->data.fb_fetch_output)
+               info->writes_stencil = true;
             break;
          case TGSI_SEMANTIC_SAMPLEMASK:
             info->writes_samplemask = true;
@@ -726,10 +727,12 @@ void nir_tgsi_scan_shader(const struct nir_shader *nir,
             info->writes_edgeflag = true;
             break;
          case TGSI_SEMANTIC_POSITION:
-            if (info->processor == PIPE_SHADER_FRAGMENT)
-               info->writes_z = true;
-            else
+            if (info->processor == PIPE_SHADER_FRAGMENT) {
+               if (!variable->data.fb_fetch_output)
+                  info->writes_z = true;
+            } else {
                info->writes_position = true;
+            }
             break;
          }
 



More information about the mesa-commit mailing list