From 76a4fd098f44ae4f226d4747b9fdaf9db5d40270 Mon Sep 17 00:00:00 2001 From: Brian Date: Tue, 23 Oct 2007 18:49:19 -0600 Subject: a bit more work for optimizing clears in tile cache (not enabled yet) --- src/mesa/drivers/x11/xm_surface.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/mesa/drivers') diff --git a/src/mesa/drivers/x11/xm_surface.c b/src/mesa/drivers/x11/xm_surface.c index b2ef70ea90..f83c7917c4 100644 --- a/src/mesa/drivers/x11/xm_surface.c +++ b/src/mesa/drivers/x11/xm_surface.c @@ -46,6 +46,7 @@ #include "pipe/p_defines.h" #include "pipe/softpipe/sp_context.h" #include "pipe/softpipe/sp_clear.h" +#include "pipe/softpipe/sp_tile_cache.h" #include "state_tracker/st_context.h" @@ -219,6 +220,19 @@ xmesa_clear(struct pipe_context *pipe, struct pipe_surface *ps, GLuint value) */ pipe->flush(pipe, 0); + { + struct softpipe_context *sp = softpipe_context(pipe); + struct softpipe_surface *sps = softpipe_surface(ps); + if (sps == sp_tile_cache_get_surface(sp->cbuf_cache[0])) { + float clear[4]; + clear[0] = 0.2; /* XXX hack */ + clear[1] = 0.2; + clear[2] = 0.2; + clear[3] = 0.2; + sp_tile_cache_clear(sp->cbuf_cache[0], clear); + } + } + if (xrb && xrb->ximage) { /* clearing back color buffer */ GET_CURRENT_CONTEXT(ctx); -- cgit v1.2.3