FREE( tc->tile );
if (tc->transfer) {
- tc->pipe->transfer_destroy(tc->pipe, tc->transfer);
+ tc->pipe->transfer_unmap(tc->pipe, tc->transfer);
}
FREE( tc );
{
struct pipe_context *pipe = tc->pipe;
- if (tc->transfer) {
+ if (tc->transfer_map) {
if (ps == tc->surface)
return;
- if (tc->transfer_map) {
- pipe->transfer_unmap(pipe, tc->transfer);
- tc->transfer_map = NULL;
- }
-
- pipe->transfer_destroy(pipe, tc->transfer);
+ pipe->transfer_unmap(pipe, tc->transfer);
tc->transfer = NULL;
+ tc->transfer_map = NULL;
}
tc->surface = ps;
if (ps) {
- tc->transfer = pipe_get_transfer(pipe, ps->texture,
- ps->u.tex.level, ps->u.tex.first_layer,
- PIPE_TRANSFER_READ_WRITE |
- PIPE_TRANSFER_UNSYNCHRONIZED,
- 0, 0, ps->width, ps->height);
+ tc->transfer_map = pipe_transfer_map(pipe, ps->texture,
+ ps->u.tex.level, ps->u.tex.first_layer,
+ PIPE_TRANSFER_READ_WRITE |
+ PIPE_TRANSFER_UNSYNCHRONIZED,
+ 0, 0, ps->width, ps->height,
+ &tc->transfer);
tc->depth_stencil = util_format_is_depth_or_stencil(ps->format);
}
}
-void
-sp_tile_cache_map_transfers(struct softpipe_tile_cache *tc)
-{
- if (tc->transfer && !tc->transfer_map)
- tc->transfer_map = tc->pipe->transfer_map(tc->pipe, tc->transfer);
-}
-
-
-void
-sp_tile_cache_unmap_transfers(struct softpipe_tile_cache *tc)
-{
- if (tc->transfer_map) {
- tc->pipe->transfer_unmap(tc->pipe, tc->transfer);
- tc->transfer_map = NULL;
- }
-}
-
-
/**
* Set pixels in a tile to the given clear color/value, float.
*/
if (is_clear_flag_set(tc->clear_flags, addr)) {
/* write the scratch tile to the surface */
if (tc->depth_stencil) {
- pipe_put_tile_raw(tc->pipe,
- pt,
+ pipe_put_tile_raw(pt, tc->transfer_map,
x, y, TILE_SIZE, TILE_SIZE,
tc->tile->data.any, 0/*STRIDE*/);
}
else {
if (util_format_is_pure_uint(tc->surface->format)) {
- pipe_put_tile_ui_format(tc->pipe, pt,
+ pipe_put_tile_ui_format(pt, tc->transfer_map,
x, y, TILE_SIZE, TILE_SIZE,
pt->resource->format,
(unsigned *) tc->tile->data.colorui128);
} else if (util_format_is_pure_sint(tc->surface->format)) {
- pipe_put_tile_i_format(tc->pipe, pt,
+ pipe_put_tile_i_format(pt, tc->transfer_map,
x, y, TILE_SIZE, TILE_SIZE,
pt->resource->format,
(int *) tc->tile->data.colori128);
} else {
- pipe_put_tile_rgba(tc->pipe, pt,
+ pipe_put_tile_rgba(pt, tc->transfer_map,
x, y, TILE_SIZE, TILE_SIZE,
(float *) tc->tile->data.color);
}
{
if (!tc->tile_addrs[pos].bits.invalid) {
if (tc->depth_stencil) {
- pipe_put_tile_raw(tc->pipe, tc->transfer,
+ pipe_put_tile_raw(tc->transfer, tc->transfer_map,
tc->tile_addrs[pos].bits.x * TILE_SIZE,
tc->tile_addrs[pos].bits.y * TILE_SIZE,
TILE_SIZE, TILE_SIZE,
}
else {
if (util_format_is_pure_uint(tc->surface->format)) {
- pipe_put_tile_ui_format(tc->pipe, tc->transfer,
+ pipe_put_tile_ui_format(tc->transfer, tc->transfer_map,
tc->tile_addrs[pos].bits.x * TILE_SIZE,
tc->tile_addrs[pos].bits.y * TILE_SIZE,
TILE_SIZE, TILE_SIZE,
tc->surface->format,
(unsigned *) tc->entries[pos]->data.colorui128);
} else if (util_format_is_pure_sint(tc->surface->format)) {
- pipe_put_tile_i_format(tc->pipe, tc->transfer,
+ pipe_put_tile_i_format(tc->transfer, tc->transfer_map,
tc->tile_addrs[pos].bits.x * TILE_SIZE,
tc->tile_addrs[pos].bits.y * TILE_SIZE,
TILE_SIZE, TILE_SIZE,
tc->surface->format,
(int *) tc->entries[pos]->data.colori128);
} else {
- pipe_put_tile_rgba_format(tc->pipe, tc->transfer,
+ pipe_put_tile_rgba_format(tc->transfer, tc->transfer_map,
tc->tile_addrs[pos].bits.x * TILE_SIZE,
tc->tile_addrs[pos].bits.y * TILE_SIZE,
TILE_SIZE, TILE_SIZE,
if (tc->tile_addrs[pos].bits.invalid == 0) {
/* put dirty tile back in framebuffer */
if (tc->depth_stencil) {
- pipe_put_tile_raw(tc->pipe, pt,
+ pipe_put_tile_raw(pt, tc->transfer_map,
tc->tile_addrs[pos].bits.x * TILE_SIZE,
tc->tile_addrs[pos].bits.y * TILE_SIZE,
TILE_SIZE, TILE_SIZE,
}
else {
if (util_format_is_pure_uint(tc->surface->format)) {
- pipe_put_tile_ui_format(tc->pipe, pt,
+ pipe_put_tile_ui_format(pt, tc->transfer_map,
tc->tile_addrs[pos].bits.x * TILE_SIZE,
tc->tile_addrs[pos].bits.y * TILE_SIZE,
TILE_SIZE, TILE_SIZE,
tc->surface->format,
(unsigned *) tile->data.colorui128);
} else if (util_format_is_pure_sint(tc->surface->format)) {
- pipe_put_tile_i_format(tc->pipe, pt,
+ pipe_put_tile_i_format(pt, tc->transfer_map,
tc->tile_addrs[pos].bits.x * TILE_SIZE,
tc->tile_addrs[pos].bits.y * TILE_SIZE,
TILE_SIZE, TILE_SIZE,
tc->surface->format,
(int *) tile->data.colori128);
} else {
- pipe_put_tile_rgba_format(tc->pipe, pt,
+ pipe_put_tile_rgba_format(pt, tc->transfer_map,
tc->tile_addrs[pos].bits.x * TILE_SIZE,
tc->tile_addrs[pos].bits.y * TILE_SIZE,
TILE_SIZE, TILE_SIZE,
else {
/* get new tile data from transfer */
if (tc->depth_stencil) {
- pipe_get_tile_raw(tc->pipe, pt,
+ pipe_get_tile_raw(pt, tc->transfer_map,
tc->tile_addrs[pos].bits.x * TILE_SIZE,
tc->tile_addrs[pos].bits.y * TILE_SIZE,
TILE_SIZE, TILE_SIZE,
}
else {
if (util_format_is_pure_uint(tc->surface->format)) {
- pipe_get_tile_ui_format(tc->pipe, pt,
+ pipe_get_tile_ui_format(pt, tc->transfer_map,
tc->tile_addrs[pos].bits.x * TILE_SIZE,
tc->tile_addrs[pos].bits.y * TILE_SIZE,
TILE_SIZE, TILE_SIZE,
tc->surface->format,
(unsigned *) tile->data.colorui128);
} else if (util_format_is_pure_sint(tc->surface->format)) {
- pipe_get_tile_i_format(tc->pipe, pt,
+ pipe_get_tile_i_format(pt, tc->transfer_map,
tc->tile_addrs[pos].bits.x * TILE_SIZE,
tc->tile_addrs[pos].bits.y * TILE_SIZE,
TILE_SIZE, TILE_SIZE,
tc->surface->format,
(int *) tile->data.colori128);
} else {
- pipe_get_tile_rgba_format(tc->pipe, pt,
+ pipe_get_tile_rgba_format(pt, tc->transfer_map,
tc->tile_addrs[pos].bits.x * TILE_SIZE,
tc->tile_addrs[pos].bits.y * TILE_SIZE,
TILE_SIZE, TILE_SIZE,