00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #include "pipe/p_defines.h"
00034 #include "draw/draw_context.h"
00035 #include "sp_flush.h"
00036 #include "sp_context.h"
00037 #include "sp_surface.h"
00038 #include "sp_state.h"
00039 #include "sp_tile_cache.h"
00040 #include "sp_winsys.h"
00041
00042
00043 void
00044 softpipe_flush( struct pipe_context *pipe,
00045 unsigned flags,
00046 struct pipe_fence_handle **fence )
00047 {
00048 struct softpipe_context *softpipe = softpipe_context(pipe);
00049 uint i;
00050
00051 draw_flush(softpipe->draw);
00052
00053 if (flags & PIPE_FLUSH_TEXTURE_CACHE) {
00054 for (i = 0; i < softpipe->num_textures; i++) {
00055 sp_flush_tile_cache(softpipe, softpipe->tex_cache[i]);
00056 }
00057 }
00058
00059 if (flags & PIPE_FLUSH_RENDER_CACHE) {
00060 for (i = 0; i < softpipe->framebuffer.num_cbufs; i++)
00061 if (softpipe->cbuf_cache[i])
00062 sp_flush_tile_cache(softpipe, softpipe->cbuf_cache[i]);
00063
00064 if (softpipe->zsbuf_cache)
00065 sp_flush_tile_cache(softpipe, softpipe->zsbuf_cache);
00066
00067
00068
00069
00070
00071
00072
00073 softpipe_unmap_surfaces(softpipe);
00074 }
00075
00076
00077 #if 0
00078 if(flags & PIPE_FLUSH_FRAME) {
00079 static unsigned frame_no = 1;
00080 static char filename[256];
00081 util_snprintf(filename, sizeof(filename), "cbuf_%u.bmp", frame_no);
00082 debug_dump_surface_bmp(filename, softpipe->framebuffer.cbufs[0]);
00083 util_snprintf(filename, sizeof(filename), "zsbuf_%u.bmp", frame_no);
00084 debug_dump_surface_bmp(filename, softpipe->framebuffer.zsbuf);
00085 ++frame_no;
00086 }
00087 #endif
00088
00089 if (fence)
00090 *fence = NULL;
00091 }
00092