From 27097ca6b52f3b84a8fd8f7427487440980fae29 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Wed, 9 Dec 2020 18:18:33 -0500 Subject: [PATCH] radeonsi: improve a comment about an MSAA bug workaround It doesn't make complete sense to me, but it's copied from the commit message that made this change. Acked-by: Pierre-Eric Pelloux-Prayer Part-of: --- src/gallium/drivers/radeonsi/si_state.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_state.c b/src/gallium/drivers/radeonsi/si_state.c index 4e91fb8..f407c6d 100644 --- a/src/gallium/drivers/radeonsi/si_state.c +++ b/src/gallium/drivers/radeonsi/si_state.c @@ -3297,9 +3297,16 @@ static void si_emit_msaa_sample_locs(struct si_context *sctx) /* line bug */ S_028830_LINE_FILTER_DISABLE(sctx->family <= CHIP_POLARIS12); - /* The alternative of setting sample locations to 0 would - * require a DB flush to avoid Z errors, see - * https://bugs.freedesktop.org/show_bug.cgi?id=96908 + /* For hardware with the sample location bug, the problem is that in order to use the small + * primitive filter, we need to explicitly set the sample locations to 0. But the DB doesn't + * properly process the change of sample locations without a flush, and so we can end up + * with incorrect Z values. + * + * Instead of doing a flush, just disable the small primitive filter when MSAA is + * force-disabled. + * + * The alternative of setting sample locations to 0 would require a DB flush to avoid + * Z errors, see https://bugs.freedesktop.org/show_bug.cgi?id=96908 */ if (has_msaa_sample_loc_bug && sctx->framebuffer.nr_samples > 1 && !rs->multisample_enable) small_prim_filter_cntl &= C_028830_SMALL_PRIM_FILTER_ENABLE; -- 2.7.4