From 07e2d6edfac618729bc2321fd64e15f34360d5fa Mon Sep 17 00:00:00 2001 From: Michel Dänzer Date: Fri, 25 Sep 2009 20:49:53 +0200 Subject: 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 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/gallium/state_trackers/xorg') diff --git a/src/gallium/state_trackers/xorg/xorg_composite.c b/src/gallium/state_trackers/xorg/xorg_composite.c index a97cad48b5..9d15a615f1 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; -- cgit v1.2.3