This was added in commit
911ce374caf ("freedreno/a6xx: Fix MSAA clear"),
but the only case that can't handle fast-clear is sysmem blitter clear
path.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19884>
}
uint32_t nr_samples = fd_resource_nr_samples(psurf->texture);
+
+ /* TODO the trick of multiplying the dimensions for MSAA sysmem clears
+ * works for linear, but falls apart with tiled/ubwc.
+ */
+
OUT_PKT4(ring, REG_A6XX_GRAS_2D_DST_TL, 2);
OUT_RING(ring, A6XX_GRAS_2D_DST_TL_X(box2d->x * nr_samples) |
A6XX_GRAS_2D_DST_TL_Y(box2d->y));
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;
+ /* multisample clear does not work properly for sysmem: */
+ if (pfb->samples > 1) {
+ /* layered rendering forces sysmem, so just bail now: */
+ if (pfb->layers > 1)
+ return false;
+ ctx->batch->gmem_reason |= FD_GMEM_MSAA_CLEAR;
+ }
/* 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
FD_GMEM_BLEND_ENABLED = BIT(3),
FD_GMEM_LOGICOP_ENABLED = BIT(4),
FD_GMEM_FB_READ = BIT(5),
+ FD_GMEM_MSAA_CLEAR = BIT(6),
};
struct fd_screen {