Go to the source code of this file.
Functions | |
void | softpipe_flush (struct pipe_context *pipe, unsigned flags, struct pipe_fence_handle **fence) |
void softpipe_flush | ( | struct pipe_context * | pipe, | |
unsigned | flags, | |||
struct pipe_fence_handle ** | fence | |||
) |
Definition at line 44 of file sp_flush.c.
References softpipe_context::cbuf_cache, pipe_framebuffer_state::cbufs, debug_dump_surface_bmp, softpipe_context::draw, draw_flush(), softpipe_context::framebuffer, pipe_framebuffer_state::num_cbufs, softpipe_context::num_textures, PIPE_FLUSH_FRAME, PIPE_FLUSH_RENDER_CACHE, PIPE_FLUSH_TEXTURE_CACHE, softpipe_context(), softpipe_unmap_surfaces(), sp_flush_tile_cache(), softpipe_context::tex_cache, util_snprintf, pipe_framebuffer_state::zsbuf, and softpipe_context::zsbuf_cache.
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 /* Need this call for hardware buffers before swapbuffers. 00068 * 00069 * there should probably be another/different flush-type function 00070 * that's called before swapbuffers because we don't always want 00071 * to unmap surfaces when flushing. 00072 */ 00073 softpipe_unmap_surfaces(softpipe); 00074 } 00075 00076 /* Enable to dump BMPs of the color/depth buffers each frame */ 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 }