From: Alyssa Rosenzweig Date: Tue, 7 Mar 2023 16:38:36 +0000 (-0500) Subject: agx: Lower discard late X-Git-Tag: upstream/23.3.3~11785 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=45554a957a71c0bb04388bf2c9389956e1b84bb1;p=platform%2Fupstream%2Fmesa.git agx: Lower discard late Fixes regression with Dolphin's ubershaders. Signed-off-by: Alyssa Rosenzweig Part-of: --- diff --git a/src/asahi/compiler/agx_compile.c b/src/asahi/compiler/agx_compile.c index 83e13f8..151d80f 100644 --- a/src/asahi/compiler/agx_compile.c +++ b/src/asahi/compiler/agx_compile.c @@ -2317,7 +2317,6 @@ agx_preprocess_nir(nir_shader *nir, bool support_lod_bias) NIR_PASS_V(nir, nir_lower_ssbo); if (nir->info.stage == MESA_SHADER_FRAGMENT) { NIR_PASS_V(nir, agx_nir_lower_frag_sidefx); - NIR_PASS_V(nir, agx_nir_lower_zs_emit); /* Interpolate varyings at fp16 and write to the tilebuffer at fp16. As an * exception, interpolate flat shaded at fp32. This works around a @@ -2406,6 +2405,11 @@ agx_compile_shader_nir(nir_shader *nir, struct agx_shader_key *key, out->depth_layout = layout; } + /* Late clip plane lowering created discards */ + if (nir->info.stage == MESA_SHADER_FRAGMENT) { + NIR_PASS_V(nir, agx_nir_lower_zs_emit); + } + /* Late sysval lowering creates large loads. Load lowering creates unpacks */ NIR_PASS_V(nir, nir_lower_mem_access_bit_sizes, nir_var_mem_ssbo | nir_var_mem_constant |