nir_to_tgsi: Don't count ZS fbfetch vars as outputs

Signed-off-by: Pavel Asyutchenko <sventeam@yandex.ru>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13979>
This commit is contained in:
Pavel Asyutchenko
2021-12-04 00:38:56 +03:00
committed by Marge Bot
parent 959b748038
commit 8788b17596

View File

@@ -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;
}