summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/llvmpipe/lp_scene.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_scene.c')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_scene.c36
1 files changed, 21 insertions, 15 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_scene.c b/src/gallium/drivers/llvmpipe/lp_scene.c
index 0c51b52d170..245d3875785 100644
--- a/src/gallium/drivers/llvmpipe/lp_scene.c
+++ b/src/gallium/drivers/llvmpipe/lp_scene.c
@@ -181,7 +181,7 @@ lp_scene_reset(struct lp_scene *scene )
struct texture_ref *ref, *next, *ref_list = &scene->textures;
for (ref = ref_list->next; ref != ref_list; ref = next) {
next = next_elem(ref);
- pipe_texture_reference(&ref->texture, NULL);
+ pipe_resource_reference(&ref->texture, NULL);
FREE(ref);
}
make_empty_list(ref_list);
@@ -248,12 +248,12 @@ lp_scene_bin_size( const struct lp_scene *scene, unsigned x, unsigned y )
*/
void
lp_scene_texture_reference( struct lp_scene *scene,
- struct pipe_texture *texture )
+ struct pipe_resource *texture )
{
struct texture_ref *ref = CALLOC_STRUCT(texture_ref);
if (ref) {
struct texture_ref *ref_list = &scene->textures;
- pipe_texture_reference(&ref->texture, texture);
+ pipe_resource_reference(&ref->texture, texture);
insert_at_tail(ref_list, ref);
}
}
@@ -263,8 +263,8 @@ lp_scene_texture_reference( struct lp_scene *scene,
* Does this scene have a reference to the given texture?
*/
boolean
-lp_scene_is_texture_referenced( const struct lp_scene *scene,
- const struct pipe_texture *texture )
+lp_scene_is_resource_referenced( const struct lp_scene *scene,
+ const struct pipe_resource *texture )
{
const struct texture_ref *ref_list = &scene->textures;
const struct texture_ref *ref;
@@ -398,20 +398,25 @@ static boolean
lp_scene_map_buffers( struct lp_scene *scene )
{
struct pipe_surface *cbuf, *zsbuf;
+ unsigned usage;
int i;
LP_DBG(DEBUG_RAST, "%s\n", __FUNCTION__);
+ /* XXX: try to improve on this:
+ */
+ usage = PIPE_TRANSFER_READ_WRITE;
/* Map all color buffers
*/
for (i = 0; i < scene->fb.nr_cbufs; i++) {
cbuf = scene->fb.cbufs[i];
if (cbuf) {
- scene->cbuf_map[i] = llvmpipe_texture_map(cbuf->texture,
- cbuf->face,
- cbuf->level,
- cbuf->zslice);
+ scene->cbuf_map[i] = llvmpipe_resource_map(cbuf->texture,
+ usage,
+ cbuf->face,
+ cbuf->level,
+ cbuf->zslice);
if (!scene->cbuf_map[i])
goto fail;
}
@@ -421,10 +426,11 @@ lp_scene_map_buffers( struct lp_scene *scene )
*/
zsbuf = scene->fb.zsbuf;
if (zsbuf) {
- scene->zsbuf_map = llvmpipe_texture_map(zsbuf->texture,
- zsbuf->face,
- zsbuf->level,
- zsbuf->zslice);
+ scene->zsbuf_map = llvmpipe_resource_map(zsbuf->texture,
+ usage,
+ zsbuf->face,
+ zsbuf->level,
+ zsbuf->zslice);
if (!scene->zsbuf_map)
goto fail;
}
@@ -453,7 +459,7 @@ lp_scene_unmap_buffers( struct lp_scene *scene )
for (i = 0; i < scene->fb.nr_cbufs; i++) {
if (scene->cbuf_map[i]) {
struct pipe_surface *cbuf = scene->fb.cbufs[i];
- llvmpipe_texture_unmap(cbuf->texture,
+ llvmpipe_resource_unmap(cbuf->texture,
cbuf->face,
cbuf->level,
cbuf->zslice);
@@ -463,7 +469,7 @@ lp_scene_unmap_buffers( struct lp_scene *scene )
if (scene->zsbuf_map) {
struct pipe_surface *zsbuf = scene->fb.zsbuf;
- llvmpipe_texture_unmap(zsbuf->texture,
+ llvmpipe_resource_unmap(zsbuf->texture,
zsbuf->face,
zsbuf->level,
zsbuf->zslice);