X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fgallium%2Fdrivers%2Fllvmpipe%2Flp_flush.c;h=cd8381fe3086c1c6702286c488a04ee05cf0bfcd;hb=caf2cf884cb32883e9af07dbe36ca9648bae1821;hp=2bb6414b3f4c6414553265aee97fb9b1eee6da39;hpb=946f432a08112148d743eb9faf6b27bb8cc7fa76;p=mesa.git diff --git a/src/gallium/drivers/llvmpipe/lp_flush.c b/src/gallium/drivers/llvmpipe/lp_flush.c index 2bb6414b3f4..cd8381fe308 100644 --- a/src/gallium/drivers/llvmpipe/lp_flush.c +++ b/src/gallium/drivers/llvmpipe/lp_flush.c @@ -37,6 +37,7 @@ #include "lp_surface.h" #include "lp_state.h" #include "lp_tile_cache.h" +#include "lp_tex_cache.h" #include "lp_winsys.h" @@ -50,19 +51,17 @@ llvmpipe_flush( struct pipe_context *pipe, draw_flush(llvmpipe->draw); - if (flags & PIPE_FLUSH_TEXTURE_CACHE) { - for (i = 0; i < llvmpipe->num_textures; i++) { - lp_flush_tile_cache(llvmpipe, llvmpipe->tex_cache[i]); - } - } - - if (flags & PIPE_FLUSH_RENDER_CACHE) { + if (flags & PIPE_FLUSH_SWAPBUFFERS) { + /* If this is a swapbuffers, just flush color buffers. + * + * The zbuffer changes are not discarded, but held in the cache + * in the hope that a later clear will wipe them out. + */ for (i = 0; i < llvmpipe->framebuffer.nr_cbufs; i++) - if (llvmpipe->cbuf_cache[i]) - lp_flush_tile_cache(llvmpipe, llvmpipe->cbuf_cache[i]); - - if (llvmpipe->zsbuf_cache) - lp_flush_tile_cache(llvmpipe, llvmpipe->zsbuf_cache); + if (llvmpipe->cbuf_cache[i]) { + lp_tile_cache_map_transfers(llvmpipe->cbuf_cache[i]); + lp_flush_tile_cache(llvmpipe->cbuf_cache[i]); + } /* Need this call for hardware buffers before swapbuffers. * @@ -71,7 +70,16 @@ llvmpipe_flush( struct pipe_context *pipe, * to unmap surfaces when flushing. */ llvmpipe_unmap_transfers(llvmpipe); - + } + else if (flags & PIPE_FLUSH_RENDER_CACHE) { + for (i = 0; i < llvmpipe->framebuffer.nr_cbufs; i++) + if (llvmpipe->cbuf_cache[i]) { + lp_tile_cache_map_transfers(llvmpipe->cbuf_cache[i]); + lp_flush_tile_cache(llvmpipe->cbuf_cache[i]); + } + + /* FIXME: untile zsbuf! */ + llvmpipe->dirty_render_cache = FALSE; }