Module: Mesa
Branch: master
Commit: 07e2d6edfac618729bc2321fd64e15f34360d5fa
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=07e2d6edfac618729bc2321fd64e15f34360d5fa

Author: Michel Dänzer <[email protected]>
Date:   Fri Sep 25 20:49:53 2009 +0200

st/xorg: Flush render cache if but only if a source has pending write 
operations.

---

 src/gallium/state_trackers/xorg/xorg_composite.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/src/gallium/state_trackers/xorg/xorg_composite.c 
b/src/gallium/state_trackers/xorg/xorg_composite.c
index a97cad4..9d15a61 100644
--- a/src/gallium/state_trackers/xorg/xorg_composite.c
+++ b/src/gallium/state_trackers/xorg/xorg_composite.c
@@ -465,6 +465,12 @@ bind_samplers(struct exa_context *exa, int op,
    memset(&src_sampler, 0, sizeof(struct pipe_sampler_state));
    memset(&mask_sampler, 0, sizeof(struct pipe_sampler_state));
 
+   if ((pSrc && exa->pipe->is_texture_referenced(exa->pipe, pSrc->tex, 0, 0) &
+        PIPE_REFERENCED_FOR_WRITE) ||
+       (pMask && exa->pipe->is_texture_referenced(exa->pipe, pMask->tex, 0, 0) 
&
+        PIPE_REFERENCED_FOR_WRITE))
+      exa->pipe->flush(exa->pipe, PIPE_FLUSH_RENDER_CACHE, NULL);
+
    if (pSrcPicture && pSrc) {
       unsigned src_wrap = render_repeat_to_gallium(
          pSrcPicture->repeatType);
@@ -995,7 +1001,9 @@ void xorg_copy_pixmap(struct exa_context *ctx,
    struct pipe_texture *dst = dst_priv->tex;
    struct pipe_texture *src = src_priv->tex;
 
-   xorg_exa_finish(ctx);
+   if (ctx->pipe->is_texture_referenced(ctx->pipe, src, 0, 0) &
+       PIPE_REFERENCED_FOR_WRITE)
+      ctx->pipe->flush(ctx->pipe, PIPE_FLUSH_RENDER_CACHE, NULL);
 
    dst_loc[0] = dx;
    dst_loc[1] = dy;

_______________________________________________
mesa-commit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to