gallium/radeon: add a fail path for depth MSAA texture readback
authorMarek Olšák <marek.olsak@amd.com>
Thu, 10 Sep 2015 16:14:36 +0000 (18:14 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Thu, 24 Sep 2015 17:51:42 +0000 (19:51 +0200)
Cc: 11.0 <mesa-stable@lists.freedesktop.org>
Acked-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
src/gallium/drivers/radeon/r600_texture.c

index a0259160f8cb95874ab271906c6c90efbeeaaaac..fc69f48bb70d01c5aa72c6e72cc6fded58ecc62b 100644 (file)
@@ -989,6 +989,11 @@ static void *r600_texture_transfer_map(struct pipe_context *ctx,
 
                        if (usage & PIPE_TRANSFER_READ) {
                                struct pipe_resource *temp = ctx->screen->resource_create(ctx->screen, &resource);
+                               if (!temp) {
+                                       R600_ERR("failed to create a temporary depth texture\n");
+                                       FREE(trans);
+                                       return NULL;
+                               }
 
                                r600_copy_region_with_blit(ctx, temp, 0, 0, 0, 0, texture, level, box);
                                rctx->blit_decompress_depth(ctx, (struct r600_texture*)temp, staging_depth,