From 8788b175969c8adadb36921b4634d1e3db6aee06 Mon Sep 17 00:00:00 2001 From: Pavel Asyutchenko Date: Sat, 4 Dec 2021 00:38:56 +0300 Subject: [PATCH] nir_to_tgsi: Don't count ZS fbfetch vars as outputs Signed-off-by: Pavel Asyutchenko Reviewed-By: Mike Blumenkrantz Part-of: --- 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; }