llvmpipe: Ensure tile cache transfers are mapped before flushing it.

This commit is contained in:
José Fonseca 2009-10-04 13:25:24 +01:00
parent 589ec337f0
commit 77ef705058
3 changed files with 9 additions and 2 deletions

View File

@ -58,8 +58,10 @@ llvmpipe_flush( struct pipe_context *pipe,
* 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])
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,8 +73,10 @@ llvmpipe_flush( struct pipe_context *pipe,
}
else if (flags & PIPE_FLUSH_RENDER_CACHE) {
for (i = 0; i < llvmpipe->framebuffer.nr_cbufs; i++)
if (llvmpipe->cbuf_cache[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! */

View File

@ -53,6 +53,7 @@ llvmpipe_set_framebuffer_state(struct pipe_context *pipe,
/* check if changing cbuf */
if (lp->framebuffer.cbufs[i] != fb->cbufs[i]) {
/* flush old */
lp_tile_cache_map_transfers(lp->cbuf_cache[i]);
lp_flush_tile_cache(lp->cbuf_cache[i]);
/* assign new */

View File

@ -236,6 +236,8 @@ lp_flush_tile_cache(struct llvmpipe_tile_cache *tc)
if(!pt)
return;
assert(tc->transfer_map);
/* push the tile to all positions marked as clear */
for (y = 0; y < pt->height; y += TILE_SIZE) {
for (x = 0; x < pt->width; x += TILE_SIZE) {