broadcom/compiler: handle gl_SampleMask writes in fragment shaders
authorIago Toral Quiroga <itoral@igalia.com>
Thu, 30 Jul 2020 09:29:12 +0000 (11:29 +0200)
committerMarge Bot <eric+marge@anholt.net>
Tue, 13 Oct 2020 21:21:32 +0000 (21:21 +0000)
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>

src/broadcom/compiler/nir_to_vir.c

index 12dcfe9..e40c1f0 100644 (file)
@@ -1328,11 +1328,12 @@ vir_emit_tlb_color_write(struct v3d_compile *c, unsigned rt)
 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++) {