Mesa (main): freedreno/a5xx: Emit MSAA state for sysmem rendering, too.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Nov 19 17:52:05 UTC 2021


Module: Mesa
Branch: main
Commit: b8ffd7a8886f327900572c11d207dc9ec035ceea
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b8ffd7a8886f327900572c11d207dc9ec035ceea

Author: Emma Anholt <emma at anholt.net>
Date:   Wed Nov 17 19:28:52 2021 -0800

freedreno/a5xx: Emit MSAA state for sysmem rendering, too.

This looked obviously wrong, we want to set the sample counts for sysmem
too just like we do on 6xx.  Turns out it fixes some piglits.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13867>

---

 src/freedreno/ci/freedreno-a530-fails.txt     |  4 --
 src/gallium/drivers/freedreno/a5xx/fd5_gmem.c | 61 ++++++++++++---------------
 2 files changed, 26 insertions(+), 39 deletions(-)

diff --git a/src/freedreno/ci/freedreno-a530-fails.txt b/src/freedreno/ci/freedreno-a530-fails.txt
index a2cceb4d14f..e4432f05dc7 100644
--- a/src/freedreno/ci/freedreno-a530-fails.txt
+++ b/src/freedreno/ci/freedreno-a530-fails.txt
@@ -303,10 +303,6 @@ spec at arb_depth_buffer_float@fbo-stencil-gl_depth32f_stencil8-copypixels,Fail
 spec at arb_direct_state_access@gettextureimage-formats,Crash
 spec at arb_draw_indirect@gl_vertexid used with gldrawarraysindirect,Fail
 spec at arb_draw_indirect@gl_vertexid used with gldrawelementsindirect,Fail
-spec at arb_framebuffer_no_attachments@arb_framebuffer_no_attachments-atomic,Fail
-spec at arb_framebuffer_no_attachments@arb_framebuffer_no_attachments-atomic at MS4,Fail
-spec at arb_framebuffer_no_attachments@arb_framebuffer_no_attachments-query,Fail
-spec at arb_framebuffer_no_attachments@arb_framebuffer_no_attachments-query at MS4,Fail
 spec at arb_framebuffer_object@arb_framebuffer_object-depth-stencil-blit depth_stencil gl_depth24_stencil8,Fail
 spec at arb_framebuffer_object@arb_framebuffer_object-depth-stencil-blit depth_stencil gl_depth32f_stencil8,Fail
 spec at arb_framebuffer_object@arb_framebuffer_object-depth-stencil-blit stencil gl_depth24_stencil8,Fail
diff --git a/src/gallium/drivers/freedreno/a5xx/fd5_gmem.c b/src/gallium/drivers/freedreno/a5xx/fd5_gmem.c
index 851c3233261..48e148b29ce 100644
--- a/src/gallium/drivers/freedreno/a5xx/fd5_gmem.c
+++ b/src/gallium/drivers/freedreno/a5xx/fd5_gmem.c
@@ -234,6 +234,30 @@ emit_zs(struct fd_ringbuffer *ring, struct pipe_surface *zsbuf,
    }
 }
 
+static void
+emit_msaa(struct fd_ringbuffer *ring, uint32_t nr_samples)
+{
+   enum a3xx_msaa_samples samples = fd_msaa_samples(nr_samples);
+
+   OUT_PKT4(ring, REG_A5XX_TPL1_TP_RAS_MSAA_CNTL, 2);
+   OUT_RING(ring, A5XX_TPL1_TP_RAS_MSAA_CNTL_SAMPLES(samples));
+   OUT_RING(ring, A5XX_TPL1_TP_DEST_MSAA_CNTL_SAMPLES(samples) |
+                     COND(samples == MSAA_ONE,
+                          A5XX_TPL1_TP_DEST_MSAA_CNTL_MSAA_DISABLE));
+
+   OUT_PKT4(ring, REG_A5XX_RB_RAS_MSAA_CNTL, 2);
+   OUT_RING(ring, A5XX_RB_RAS_MSAA_CNTL_SAMPLES(samples));
+   OUT_RING(ring,
+            A5XX_RB_DEST_MSAA_CNTL_SAMPLES(samples) |
+               COND(samples == MSAA_ONE, A5XX_RB_DEST_MSAA_CNTL_MSAA_DISABLE));
+
+   OUT_PKT4(ring, REG_A5XX_GRAS_SC_RAS_MSAA_CNTL, 2);
+   OUT_RING(ring, A5XX_GRAS_SC_RAS_MSAA_CNTL_SAMPLES(samples));
+   OUT_RING(ring, A5XX_GRAS_SC_DEST_MSAA_CNTL_SAMPLES(samples) |
+                     COND(samples == MSAA_ONE,
+                          A5XX_GRAS_SC_DEST_MSAA_CNTL_MSAA_DISABLE));
+}
+
 static bool
 use_hw_binning(struct fd_batch *batch)
 {
@@ -584,26 +608,7 @@ fd5_emit_tile_renderprep(struct fd_batch *batch, const struct fd_tile *tile)
 
    emit_zs(ring, pfb->zsbuf, gmem);
    emit_mrt(ring, pfb->nr_cbufs, pfb->cbufs, gmem);
-
-   enum a3xx_msaa_samples samples = fd_msaa_samples(pfb->samples);
-
-   OUT_PKT4(ring, REG_A5XX_TPL1_TP_RAS_MSAA_CNTL, 2);
-   OUT_RING(ring, A5XX_TPL1_TP_RAS_MSAA_CNTL_SAMPLES(samples));
-   OUT_RING(ring, A5XX_TPL1_TP_DEST_MSAA_CNTL_SAMPLES(samples) |
-                     COND(samples == MSAA_ONE,
-                          A5XX_TPL1_TP_DEST_MSAA_CNTL_MSAA_DISABLE));
-
-   OUT_PKT4(ring, REG_A5XX_RB_RAS_MSAA_CNTL, 2);
-   OUT_RING(ring, A5XX_RB_RAS_MSAA_CNTL_SAMPLES(samples));
-   OUT_RING(ring,
-            A5XX_RB_DEST_MSAA_CNTL_SAMPLES(samples) |
-               COND(samples == MSAA_ONE, A5XX_RB_DEST_MSAA_CNTL_MSAA_DISABLE));
-
-   OUT_PKT4(ring, REG_A5XX_GRAS_SC_RAS_MSAA_CNTL, 2);
-   OUT_RING(ring, A5XX_GRAS_SC_RAS_MSAA_CNTL_SAMPLES(samples));
-   OUT_RING(ring, A5XX_GRAS_SC_DEST_MSAA_CNTL_SAMPLES(samples) |
-                     COND(samples == MSAA_ONE,
-                          A5XX_GRAS_SC_DEST_MSAA_CNTL_MSAA_DISABLE));
+   emit_msaa(ring, pfb->samples);
 }
 
 /*
@@ -762,21 +767,7 @@ fd5_emit_sysmem_prep(struct fd_batch *batch) assert_dt
 
    emit_zs(ring, pfb->zsbuf, NULL);
    emit_mrt(ring, pfb->nr_cbufs, pfb->cbufs, NULL);
-
-   OUT_PKT4(ring, REG_A5XX_TPL1_TP_RAS_MSAA_CNTL, 2);
-   OUT_RING(ring, A5XX_TPL1_TP_RAS_MSAA_CNTL_SAMPLES(MSAA_ONE));
-   OUT_RING(ring, A5XX_TPL1_TP_DEST_MSAA_CNTL_SAMPLES(MSAA_ONE) |
-                     A5XX_TPL1_TP_DEST_MSAA_CNTL_MSAA_DISABLE);
-
-   OUT_PKT4(ring, REG_A5XX_RB_RAS_MSAA_CNTL, 2);
-   OUT_RING(ring, A5XX_RB_RAS_MSAA_CNTL_SAMPLES(MSAA_ONE));
-   OUT_RING(ring, A5XX_RB_DEST_MSAA_CNTL_SAMPLES(MSAA_ONE) |
-                     A5XX_RB_DEST_MSAA_CNTL_MSAA_DISABLE);
-
-   OUT_PKT4(ring, REG_A5XX_GRAS_SC_RAS_MSAA_CNTL, 2);
-   OUT_RING(ring, A5XX_GRAS_SC_RAS_MSAA_CNTL_SAMPLES(MSAA_ONE));
-   OUT_RING(ring, A5XX_GRAS_SC_DEST_MSAA_CNTL_SAMPLES(MSAA_ONE) |
-                     A5XX_GRAS_SC_DEST_MSAA_CNTL_MSAA_DISABLE);
+   emit_msaa(ring, pfb->samples);
 }
 
 static void



More information about the mesa-commit mailing list