summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/llvmpipe/lp_scene.c
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2010-03-13 16:04:06 +0000
committerJosé Fonseca <jfonseca@vmware.com>2010-03-13 16:04:06 +0000
commit3abc7b985ce0787c5103d1a86bd0ba07b127a82f (patch)
tree59b5cbaf0c3c103fb9f5d7237b61ecb29a2b7e32 /src/gallium/drivers/llvmpipe/lp_scene.c
parenta80e33f40731f07e8a39896bfdcd1b1504aedc1f (diff)
downloadexternal_mesa3d-3abc7b985ce0787c5103d1a86bd0ba07b127a82f.zip
external_mesa3d-3abc7b985ce0787c5103d1a86bd0ba07b127a82f.tar.gz
external_mesa3d-3abc7b985ce0787c5103d1a86bd0ba07b127a82f.tar.bz2
llvmpipe: Don't use texture transfer internally.
Now that transfers are context objects their sideeffects must happen in order when used by the state tracker, but that synchronization must be bypassed when used inside the driver, or it would cause infinite recursion.
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_scene.c')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_scene.c70
1 files changed, 24 insertions, 46 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_scene.c b/src/gallium/drivers/llvmpipe/lp_scene.c
index 505cb21..681ce67 100644
--- a/src/gallium/drivers/llvmpipe/lp_scene.c
+++ b/src/gallium/drivers/llvmpipe/lp_scene.c
@@ -397,7 +397,6 @@ end:
static boolean
lp_scene_map_buffers( struct lp_scene *scene )
{
- struct pipe_context *pipe = scene->pipe;
struct pipe_surface *cbuf, *zsbuf;
int i;
@@ -409,20 +408,10 @@ lp_scene_map_buffers( struct lp_scene *scene )
for (i = 0; i < scene->fb.nr_cbufs; i++) {
cbuf = scene->fb.cbufs[i];
if (cbuf) {
- scene->cbuf_transfer[i] = pipe->get_tex_transfer(pipe,
- cbuf->texture,
- cbuf->face,
- cbuf->level,
- cbuf->zslice,
- PIPE_TRANSFER_READ_WRITE,
- 0, 0,
- cbuf->width,
- cbuf->height);
- if (!scene->cbuf_transfer[i])
- goto fail;
-
- scene->cbuf_map[i] = pipe->transfer_map(pipe,
- scene->cbuf_transfer[i]);
+ scene->cbuf_map[i] = llvmpipe_texture_map(cbuf->texture,
+ cbuf->face,
+ cbuf->level,
+ cbuf->zslice);
if (!scene->cbuf_map[i])
goto fail;
}
@@ -432,20 +421,10 @@ lp_scene_map_buffers( struct lp_scene *scene )
*/
zsbuf = scene->fb.zsbuf;
if (zsbuf) {
- scene->zsbuf_transfer = pipe->get_tex_transfer(pipe,
- zsbuf->texture,
- zsbuf->face,
- zsbuf->level,
- zsbuf->zslice,
- PIPE_TRANSFER_READ_WRITE,
- 0, 0,
- zsbuf->width,
- zsbuf->height);
- if (!scene->zsbuf_transfer)
- goto fail;
-
- scene->zsbuf_map = pipe->transfer_map(pipe,
- scene->zsbuf_transfer);
+ scene->zsbuf_map = llvmpipe_texture_map(zsbuf->texture,
+ zsbuf->face,
+ zsbuf->level,
+ zsbuf->zslice);
if (!scene->zsbuf_map)
goto fail;
}
@@ -469,28 +448,27 @@ fail:
static void
lp_scene_unmap_buffers( struct lp_scene *scene )
{
- struct pipe_context *pipe = scene->pipe;
unsigned i;
for (i = 0; i < scene->fb.nr_cbufs; i++) {
- if (scene->cbuf_map[i])
- pipe->transfer_unmap(pipe, scene->cbuf_transfer[i]);
-
- if (scene->cbuf_transfer[i])
- pipe->tex_transfer_destroy(pipe, scene->cbuf_transfer[i]);
-
- scene->cbuf_transfer[i] = NULL;
- scene->cbuf_map[i] = NULL;
+ if (scene->cbuf_map[i]) {
+ struct pipe_surface *cbuf = scene->fb.cbufs[i];
+ llvmpipe_texture_unmap(cbuf->texture,
+ cbuf->face,
+ cbuf->level,
+ cbuf->zslice);
+ scene->cbuf_map[i] = NULL;
+ }
}
- if (scene->zsbuf_map)
- pipe->transfer_unmap(pipe, scene->zsbuf_transfer);
-
- if (scene->zsbuf_transfer)
- pipe->tex_transfer_destroy(pipe, scene->zsbuf_transfer);
-
- scene->zsbuf_transfer = NULL;
- scene->zsbuf_map = NULL;
+ if (scene->zsbuf_map) {
+ struct pipe_surface *zsbuf = scene->fb.zsbuf;
+ llvmpipe_texture_unmap(zsbuf->texture,
+ zsbuf->face,
+ zsbuf->level,
+ zsbuf->zslice);
+ scene->zsbuf_map = NULL;
+ }
util_unreference_framebuffer_state( &scene->fb );
}