/* we'll do pixel transfer in a fragment shader */
ctx->_ImageTransferState = 0x0;
- transfer = pipe_get_transfer(st->pipe, pt, 0, 0,
- PIPE_TRANSFER_WRITE, 0, 0,
- width, height);
-
/* map texture transfer */
- dest = pipe_transfer_map(pipe, transfer);
+ dest = pipe_transfer_map(pipe, pt, 0, 0,
+ PIPE_TRANSFER_WRITE, 0, 0,
+ width, height, &transfer);
/* Put image into texture transfer.
/* unmap */
pipe_transfer_unmap(pipe, transfer);
- pipe->transfer_destroy(pipe, transfer);
assert(success);
usage = PIPE_TRANSFER_WRITE;
}
- pt = pipe_get_transfer(pipe, strb->texture,
- strb->rtt_level, strb->rtt_face + strb->rtt_slice,
- usage, x, y,
- width, height);
-
- stmap = pipe_transfer_map(pipe, pt);
+ stmap = pipe_transfer_map(pipe, strb->texture,
+ strb->rtt_level, strb->rtt_face + strb->rtt_slice,
+ usage, x, y,
+ width, height, &pt);
pixels = _mesa_map_pbo_source(ctx, &clippedUnpack, pixels);
assert(pixels);
/* unmap the stencil buffer */
pipe_transfer_unmap(pipe, pt);
- pipe->transfer_destroy(pipe, pt);
}
dsty = rbDraw->Base.Height - dsty - height;
}
- ptDraw = pipe_get_transfer(pipe,
- rbDraw->texture,
- rbDraw->rtt_level,
- rbDraw->rtt_face + rbDraw->rtt_slice,
- usage, dstx, dsty,
- width, height);
-
assert(util_format_get_blockwidth(ptDraw->resource->format) == 1);
assert(util_format_get_blockheight(ptDraw->resource->format) == 1);
/* map the stencil buffer */
- drawMap = pipe_transfer_map(pipe, ptDraw);
+ drawMap = pipe_transfer_map(pipe,
+ rbDraw->texture,
+ rbDraw->rtt_level,
+ rbDraw->rtt_face + rbDraw->rtt_slice,
+ usage, dstx, dsty,
+ width, height, &ptDraw);
/* draw */
/* XXX PixelZoom not handled yet */
/* unmap the stencil buffer */
pipe_transfer_unmap(pipe, ptDraw);
- pipe->transfer_destroy(pipe, ptDraw);
}
}
else {
/* CPU-based fallback/conversion */
- struct pipe_transfer *ptRead =
- pipe_get_transfer(st->pipe, rbRead->texture,
+ struct pipe_transfer *ptRead;
+ void *mapRead =
+ pipe_transfer_map(st->pipe, rbRead->texture,
rbRead->rtt_level,
rbRead->rtt_face + rbRead->rtt_slice,
PIPE_TRANSFER_READ,
- readX, readY, readW, readH);
+ readX, readY, readW, readH, &ptRead);
struct pipe_transfer *ptTex;
+ void *mapTex;
enum pipe_transfer_usage transfer_usage;
if (ST_DEBUG & DEBUG_FALLBACK)
else
transfer_usage = PIPE_TRANSFER_WRITE;
- ptTex = pipe_get_transfer(st->pipe, pt, 0, 0, transfer_usage,
- 0, 0, width, height);
+ mapTex = pipe_transfer_map(st->pipe, pt, 0, 0, transfer_usage,
+ 0, 0, width, height, &ptTex);
/* copy image from ptRead surface to ptTex surface */
if (type == GL_COLOR) {
enum pipe_format readFormat, drawFormat;
readFormat = util_format_linear(rbRead->texture->format);
drawFormat = util_format_linear(pt->format);
- pipe_get_tile_rgba_format(pipe, ptRead, 0, 0, readW, readH,
+ pipe_get_tile_rgba_format(ptRead, mapRead, 0, 0, readW, readH,
readFormat, buf);
- pipe_put_tile_rgba_format(pipe, ptTex, pack.SkipPixels, pack.SkipRows,
+ pipe_put_tile_rgba_format(ptTex, mapTex, pack.SkipPixels,
+ pack.SkipRows,
readW, readH, drawFormat, buf);
free(buf);
}
else {
/* GL_DEPTH */
GLuint *buf = malloc(width * height * sizeof(GLuint));
- pipe_get_tile_z(pipe, ptRead, 0, 0, readW, readH, buf);
- pipe_put_tile_z(pipe, ptTex, pack.SkipPixels, pack.SkipRows,
+ pipe_get_tile_z(ptRead, mapRead, 0, 0, readW, readH, buf);
+ pipe_put_tile_z(ptTex, mapTex, pack.SkipPixels, pack.SkipRows,
readW, readH, buf);
free(buf);
}
- pipe->transfer_destroy(pipe, ptRead);
- pipe->transfer_destroy(pipe, ptTex);
+ pipe->transfer_unmap(pipe, ptRead);
+ pipe->transfer_unmap(pipe, ptTex);
}
/* OK, the texture 'pt' contains the src image/pixels. Now draw a