agx: Disable tri merging with side effects
authorAlyssa Rosenzweig <alyssa@rosenzweig.io>
Sun, 19 Feb 2023 20:30:10 +0000 (15:30 -0500)
committerMarge Bot <emma+marge@anholt.net>
Sun, 5 Mar 2023 19:12:35 +0000 (19:12 +0000)
As Metal does.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21712>

src/asahi/compiler/agx_compile.c

index f9fc8e4..7f9358c 100644 (file)
@@ -2316,7 +2316,8 @@ agx_compile_shader_nir(nir_shader *nir, struct agx_shader_key *key,
    } else if (nir->info.stage == MESA_SHADER_FRAGMENT) {
       out->no_colour_output = !(nir->info.outputs_written >> FRAG_RESULT_DATA0);
       out->disable_tri_merging = nir->info.fs.needs_all_helper_invocations ||
-                                 nir->info.fs.needs_quad_helper_invocations;
+                                 nir->info.fs.needs_quad_helper_invocations ||
+                                 nir->info.writes_memory;
 
       /* Report a canonical depth layout */
       enum gl_frag_depth_layout layout = nir->info.fs.depth_layout;