aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/cell
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2009-02-24 20:10:36 -0700
committerBrian Paul <[email protected]>2009-02-24 21:01:34 -0700
commitbd0370cd26e4fe9bc84afdb3d087e46b38022961 (patch)
tree5073d7ab048835e5893fa68d451ab3e0a1c4f39f /src/gallium/drivers/cell
parent32dc28ac7ace3ab9fedeba66ab90cf690b1d6794 (diff)
cell: don't need tex transfer for drawing surfaces
Diffstat (limited to 'src/gallium/drivers/cell')
-rw-r--r--src/gallium/drivers/cell/ppu/cell_pipe_state.c54
1 files changed, 24 insertions, 30 deletions
diff --git a/src/gallium/drivers/cell/ppu/cell_pipe_state.c b/src/gallium/drivers/cell/ppu/cell_pipe_state.c
index facd9551fe7..ccd0fef6e84 100644
--- a/src/gallium/drivers/cell/ppu/cell_pipe_state.c
+++ b/src/gallium/drivers/cell/ppu/cell_pipe_state.c
@@ -285,28 +285,22 @@ cell_map_surfaces(struct cell_context *cell)
for (i = 0; i < 1; i++) {
struct pipe_surface *ps = cell->framebuffer.cbufs[i];
if (ps) {
- cell->cbuf_transfer[i] =
- screen->get_tex_transfer(screen, ps->texture, ps->face,
- ps->level, ps->zslice,
- PIPE_TRANSFER_READ_WRITE,
- 0, 0, ps->width, ps->height);
-
- cell->cbuf_map[i] =
- screen->transfer_map(screen, cell->cbuf_transfer[i]);
+ struct cell_texture *ct = cell_texture(ps->texture);
+ cell->cbuf_map[i] = screen->buffer_map(screen,
+ ct->buffer,
+ (PIPE_BUFFER_USAGE_GPU_READ |
+ PIPE_BUFFER_USAGE_GPU_WRITE));
}
}
{
struct pipe_surface *ps = cell->framebuffer.zsbuf;
if (ps) {
- cell->zsbuf_transfer =
- screen->get_tex_transfer(screen, ps->texture, ps->face,
- ps->level, ps->zslice,
- PIPE_TRANSFER_READ_WRITE,
- 0, 0, ps->width, ps->height);
-
- cell->zsbuf_map =
- screen->transfer_map(screen, cell->zsbuf_transfer);
+ struct cell_texture *ct = cell_texture(ps->texture);
+ cell->zsbuf_map = screen->buffer_map(screen,
+ ct->buffer,
+ (PIPE_BUFFER_USAGE_GPU_READ |
+ PIPE_BUFFER_USAGE_GPU_WRITE));
}
}
}
@@ -322,24 +316,24 @@ cell_unmap_surfaces(struct cell_context *cell)
uint i;
for (i = 0; i < PIPE_MAX_COLOR_BUFS; i++) {
- if (cell->cbuf_transfer[i] && cell->cbuf_map[i]) {
- /* unmap color buffer/surface [i] */
- screen->transfer_unmap(screen, cell->cbuf_transfer[i]);
- cell->cbuf_map[i] = NULL;
+ struct pipe_surface *ps = cell->framebuffer.cbufs[i];
+ if (ps && cell->cbuf_map[i]) {
+ struct cell_texture *ct = cell_texture(ps->texture);
+ assert(ps->texture);
+ assert(ct->buffer);
- /* get rid of transfer object [i] */
- screen->tex_transfer_release(screen, &cell->cbuf_transfer[i]);
- assert(cell->cbuf_transfer[i] == NULL);
+ screen->buffer_unmap(screen, ct->buffer);
+ cell->cbuf_map[i] = NULL;
}
}
- if (cell->zsbuf_transfer && cell->zsbuf_map) {
- screen->transfer_unmap(screen, cell->zsbuf_transfer);
- cell->zsbuf_map = NULL;
-
- /* get rid of transfer object */
- screen->tex_transfer_release(screen, &cell->zsbuf_transfer);
- assert(cell->zsbuf_transfer == NULL);
+ {
+ struct pipe_surface *ps = cell->framebuffer.zsbuf;
+ if (ps && cell->zsbuf_map) {
+ struct cell_texture *ct = cell_texture(ps->texture);
+ screen->buffer_unmap(screen, ct->buffer);
+ cell->zsbuf_map = NULL;
+ }
}
}