summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/softpipe/sp_flush.c
diff options
context:
space:
mode:
authorKeith Whitwell <keithw@vmware.com>2009-09-23 17:37:28 +0100
committerKeith Whitwell <keithw@vmware.com>2009-09-23 17:37:28 +0100
commit890679d4322e7ba4f12f32532a3fdd277edff886 (patch)
tree37df5e8a53f7da9fdcaf2e9660c694e28e14b5bc /src/gallium/drivers/softpipe/sp_flush.c
parenta1fa770c01d913658900de1c267fb4c41bc6300d (diff)
parent75276ea316610a5737f2115326482024aa09d02a (diff)
Merge branch 'softpipe-opt'
Conflicts: progs/demos/cubemap.c src/gallium/drivers/softpipe/sp_tex_sample.c src/gallium/drivers/softpipe/sp_texture.c
Diffstat (limited to 'src/gallium/drivers/softpipe/sp_flush.c')
-rw-r--r--src/gallium/drivers/softpipe/sp_flush.c25
1 files changed, 18 insertions, 7 deletions
diff --git a/src/gallium/drivers/softpipe/sp_flush.c b/src/gallium/drivers/softpipe/sp_flush.c
index 4a14d49686..e38b767cf2 100644
--- a/src/gallium/drivers/softpipe/sp_flush.c
+++ b/src/gallium/drivers/softpipe/sp_flush.c
@@ -37,6 +37,7 @@
#include "sp_surface.h"
#include "sp_state.h"
#include "sp_tile_cache.h"
+#include "sp_tex_tile_cache.h"
#include "sp_winsys.h"
@@ -52,17 +53,19 @@ softpipe_flush( struct pipe_context *pipe,
if (flags & PIPE_FLUSH_TEXTURE_CACHE) {
for (i = 0; i < softpipe->num_textures; i++) {
- sp_flush_tile_cache(softpipe, softpipe->tex_cache[i]);
+ sp_flush_tex_tile_cache(softpipe->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 < softpipe->framebuffer.nr_cbufs; i++)
if (softpipe->cbuf_cache[i])
- sp_flush_tile_cache(softpipe, softpipe->cbuf_cache[i]);
-
- if (softpipe->zsbuf_cache)
- sp_flush_tile_cache(softpipe, softpipe->zsbuf_cache);
+ sp_flush_tile_cache(softpipe->cbuf_cache[i]);
/* Need this call for hardware buffers before swapbuffers.
*
@@ -71,7 +74,15 @@ softpipe_flush( struct pipe_context *pipe,
* to unmap surfaces when flushing.
*/
softpipe_unmap_transfers(softpipe);
-
+ }
+ else if (flags & PIPE_FLUSH_RENDER_CACHE) {
+ for (i = 0; i < softpipe->framebuffer.nr_cbufs; i++)
+ if (softpipe->cbuf_cache[i])
+ sp_flush_tile_cache(softpipe->cbuf_cache[i]);
+
+ if (softpipe->zsbuf_cache)
+ sp_flush_tile_cache(softpipe->zsbuf_cache);
+
softpipe->dirty_render_cache = FALSE;
}