nir: Don't set writes_memory for reading XFB

That's a read, not a write. Fixes optimizations getting disabled for fragment
shaders when linked with a shader producing transform feedback varyings.

Fixes: 85a723975b ("nir: add and gather shader_info::writes_memory")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16285>
(cherry picked from commit ca280b2283)
This commit is contained in:
Alyssa Rosenzweig 2022-05-02 13:59:55 -04:00 committed by Dylan Baker
parent 9e99274fd6
commit 2981d3fa71
2 changed files with 3 additions and 2 deletions

View file

@ -716,7 +716,7 @@
"description": "nir: Don't set writes_memory for reading XFB",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"because_sha": "85a723975bbd651fa6692655b9a4f14b4405d0ae"
},
{

View file

@ -907,7 +907,8 @@ nir_shader_gather_info(nir_shader *shader, nir_function_impl *entrypoint)
shader->info.tess.tcs_cross_invocation_outputs_read = 0;
}
shader->info.writes_memory = shader->info.has_transform_feedback_varyings;
if (shader->info.stage != MESA_SHADER_FRAGMENT)
shader->info.writes_memory = shader->info.has_transform_feedback_varyings;
void *dead_ctx = ralloc_context(NULL);
nir_foreach_block(block, entrypoint) {