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

Author: Nanley Chery <[email protected]>
Date:   Fri Apr 14 16:45:33 2023 -0700

iris: Add a barrier to iris_mcs_partial_resolve

Partial resolves read from the MCS and write to the MSAA surface.
Add a texture barrier to prepare for the reads.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4179
Reviewed-by: Kenneth Graunke <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22545>

---

 src/gallium/drivers/iris/iris_resolve.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/gallium/drivers/iris/iris_resolve.c 
b/src/gallium/drivers/iris/iris_resolve.c
index e515c4e8971..965259e9c0c 100644
--- a/src/gallium/drivers/iris/iris_resolve.c
+++ b/src/gallium/drivers/iris/iris_resolve.c
@@ -553,6 +553,10 @@ iris_mcs_partial_resolve(struct iris_context *ice,
    struct blorp_surf surf;
    iris_blorp_surf_for_resource(&batch->screen->isl_dev, &surf,
                                 &res->base.b, res->aux.usage, 0, true);
+
+   /* MCS partial resolve will read from the MCS surface. */
+   assert(res->aux.bo == res->bo);
+   iris_emit_buffer_barrier_for(batch, res->bo, IRIS_DOMAIN_SAMPLER_READ);
    iris_emit_buffer_barrier_for(batch, res->bo, IRIS_DOMAIN_RENDER_WRITE);
 
    struct blorp_batch blorp_batch;

Reply via email to