summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2016-02-25 00:23:21 +0100
committerMarek Olšák <[email protected]>2016-03-09 15:02:26 +0100
commitd95f59375886a18f6f9fb211fc839cf30c110d81 (patch)
treec70f4c3cf298d5ec2e2677d28dadb638de22b341 /src/gallium
parentc034d3dde06b1ff882938bfea2b7cad10468b0db (diff)
gallium/radeon: remember that texture_from_handle was called and its flags
Reviewed-by: Michel Dänzer <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/radeon/r600_texture.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/gallium/drivers/radeon/r600_texture.c b/src/gallium/drivers/radeon/r600_texture.c
index 5f49dd7df5d..8fc236e713c 100644
--- a/src/gallium/drivers/radeon/r600_texture.c
+++ b/src/gallium/drivers/radeon/r600_texture.c
@@ -908,6 +908,7 @@ static struct pipe_resource *r600_texture_from_handle(struct pipe_screen *screen
struct radeon_surf surface;
int r;
struct radeon_bo_metadata metadata = {};
+ struct r600_texture *rtex;
/* Support only 2D textures without mipmaps */
if ((templ->target != PIPE_TEXTURE_2D && templ->target != PIPE_TEXTURE_RECT) ||
@@ -941,8 +942,14 @@ static struct pipe_resource *r600_texture_from_handle(struct pipe_screen *screen
if (metadata.scanout)
surface.flags |= RADEON_SURF_SCANOUT;
- return (struct pipe_resource *)r600_texture_create_object(screen, templ,
- stride, buf, &surface);
+ rtex = r600_texture_create_object(screen, templ,
+ stride, buf, &surface);
+ if (!rtex)
+ return NULL;
+
+ rtex->resource.is_shared = true;
+ rtex->resource.external_usage = usage;
+ return &rtex->resource.b.b;
}
bool r600_init_flushed_depth_texture(struct pipe_context *ctx,