[Mesa-dev] [PATCH 5/5] st/mesa: use texture_barrier before CopyPixels blits where src == dst

Marek Olšák maraeo at gmail.com
Mon Jun 5 16:50:26 UTC 2017


From: Marek Olšák <marek.olsak at amd.com>

radeonsi won't flush caches if set_framebuffer_state doesn't change
anything.
---
 src/mesa/state_tracker/st_cb_drawpixels.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c
index 33d10f6..0ef05ef 100644
--- a/src/mesa/state_tracker/st_cb_drawpixels.c
+++ b/src/mesa/state_tracker/st_cb_drawpixels.c
@@ -1400,20 +1400,27 @@ blit_copy_pixels(struct gl_context *ctx, GLint srcx, GLint srcy,
             st_window_rectangles_to_blit(ctx, &blit);
 
          if (screen->is_format_supported(screen, blit.src.format,
                                          blit.src.resource->target,
                                          blit.src.resource->nr_samples,
                                          PIPE_BIND_SAMPLER_VIEW) &&
              screen->is_format_supported(screen, blit.dst.format,
                                          blit.dst.resource->target,
                                          blit.dst.resource->nr_samples,
                                          PIPE_BIND_RENDER_TARGET)) {
+            /* If src == dst, make sure src is coherent with recent dst
+             * updates.
+             */
+            if (blit.src.resource == blit.dst.resource &&
+                screen->get_param(screen, PIPE_CAP_TEXTURE_BARRIER))
+               pipe->texture_barrier(pipe, PIPE_TEXTURE_BARRIER_SAMPLER);
+
             pipe->blit(pipe, &blit);
             return GL_TRUE;
          }
       }
    }
 
    return GL_FALSE;
 }
 
 
-- 
2.7.4



More information about the mesa-dev mailing list