broadcom/compiler: handle gl_SampleMask writes in fragment shaders

We didn't need this until now, since this was included with GLES 3.2,
but we need it for Vulkan.

Eric had already done the plumbing for it though, we just need to
actually emit the mask.

Fixes some tests in:
dEQP-VK.renderpass.suballocation.multisample_resolve.*

Reviewed-by: Alejandro PiƱeiro <apinheiro@igalia.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6766>
diff --git a/src/broadcom/compiler/nir_to_vir.c b/src/broadcom/compiler/nir_to_vir.c
index 12dcfe9..e40c1f0 100644
--- a/src/broadcom/compiler/nir_to_vir.c
+++ b/src/broadcom/compiler/nir_to_vir.c
@@ -1328,11 +1328,12 @@
 static void
 emit_frag_end(struct v3d_compile *c)
 {
-        /* XXX
         if (c->output_sample_mask_index != -1) {
-                vir_MS_MASK(c, c->outputs[c->output_sample_mask_index]);
+                vir_SETMSF_dest(c, vir_nop_reg(),
+                                vir_AND(c,
+                                        vir_MSF(c),
+                                        c->outputs[c->output_sample_mask_index]));
         }
-        */
 
         bool has_any_tlb_color_write = false;
         for (int rt = 0; rt < V3D_MAX_DRAW_BUFFERS; rt++) {