freedreno/a6xx: Fix MSAA clear
authorRob Clark <robdclark@chromium.org>
Tue, 8 Sep 2020 16:12:23 +0000 (09:12 -0700)
committerMarge Bot <eric+marge@anholt.net>
Thu, 10 Sep 2020 02:36:59 +0000 (02:36 +0000)
We need to do MSAA clear on the 3d pipe, it seems to not work out
properly on 2d pipe (at least for 4x MSAA and heights that are not
multiple of 16).

This matches what blob and tu seem to do.  Fixes the following with
DEQP_CONFIG=rgba8888d24s8ms4

dEQP-GLES31.functional.primitive_bounding_box.depth.builtin_depth.per_primitive_bbox_equal
dEQP-GLES31.functional.primitive_bounding_box.depth.builtin_depth.per_primitive_bbox_larger
dEQP-GLES31.functional.primitive_bounding_box.depth.user_defined_depth.per_primitive_bbox_equal
dEQP-GLES31.functional.primitive_bounding_box.depth.user_defined_depth.per_primitive_bbox_larger

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6649>

src/gallium/drivers/freedreno/a6xx/fd6_draw.c

index 284569f..c9630f2 100644 (file)
@@ -480,6 +480,10 @@ fd6_clear(struct fd_context *ctx, unsigned buffers,
        const bool has_depth = pfb->zsbuf;
        unsigned color_buffers = buffers >> 2;
 
+       /* we need to do multisample clear on 3d pipe, so fallback to u_blitter: */
+       if (pfb->samples > 1)
+               return false;
+
        /* If we're clearing after draws, fallback to 3D pipe clears.  We could
         * use blitter clears in the draw batch but then we'd have to patch up the
         * gmem offsets. This doesn't seem like a useful thing to optimize for