summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/llvmpipe/lp_tile_cache.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_tile_cache.c')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_tile_cache.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_tile_cache.c b/src/gallium/drivers/llvmpipe/lp_tile_cache.c
index ec3e002d62..7a1ecf5107 100644
--- a/src/gallium/drivers/llvmpipe/lp_tile_cache.c
+++ b/src/gallium/drivers/llvmpipe/lp_tile_cache.c
@@ -252,13 +252,13 @@ lp_flush_tile_cache(struct llvmpipe_tile_cache *tc)
case LP_TILE_STATUS_CLEAR:
/* Actually clear the tiles which were flagged as being in a
* clear state. */
- util_fill_rect(tc->transfer_map, &pt->block, pt->stride,
+ util_fill_rect(tc->transfer_map, pt->texture->format, pt->stride,
x, y, w, h,
tc->clear_val);
break;
case LP_TILE_STATUS_DEFINED:
- lp_tile_write_4ub(pt->format,
+ lp_tile_write_4ub(pt->texture->format,
tile->color,
tc->transfer_map, pt->stride,
x, y, w, h);
@@ -291,6 +291,11 @@ lp_get_cached_tile(struct llvmpipe_tile_cache *tc,
assert(tc->surface);
assert(tc->transfer);
+ if(!tc->transfer_map)
+ lp_tile_cache_map_transfers(tc);
+
+ assert(tc->transfer_map);
+
switch(tile->status) {
case LP_TILE_STATUS_CLEAR:
/* don't get tile from framebuffer, just clear it */
@@ -306,7 +311,7 @@ lp_get_cached_tile(struct llvmpipe_tile_cache *tc,
y &= ~(TILE_SIZE - 1);
if (!pipe_clip_tile(x, y, &w, &h, tc->transfer))
- lp_tile_read_4ub(pt->format,
+ lp_tile_read_4ub(pt->texture->format,
tile->color,
tc->transfer_map, tc->transfer->stride,
x, y, w, h);