agx: Call nir_lower_discard_if

We still need to implement discard itself, but this means we don't need
to worry about discard_if. This compiles down to the same idiom as
the vendor compiler (Metal) generates

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14217>
This commit is contained in:
Alyssa Rosenzweig
2021-12-15 20:39:02 -05:00
committed by Marge Bot
parent aaf00a1b4d
commit f8feaee0dd

View File

@@ -1481,6 +1481,9 @@ agx_compile_shader_nir(nir_shader *nir,
agx_optimize_nir(nir);
/* Implement conditional discard with real control flow like Metal */
NIR_PASS_V(nir, nir_lower_discard_if);
/* Must be last since NIR passes can remap driver_location freely */
if (ctx->stage == MESA_SHADER_VERTEX) {
agx_remap_varyings_vs(nir, &out->varyings, ctx->varyings);