gallium/radeon: handle failure when mapping staging buffer

Cc: "11.1 11.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
(cherry picked from commit a17911ceb1)
This commit is contained in:
Nicolai Hähnle 2016-04-13 10:55:29 -05:00 committed by Emil Velikov
parent 0b4a916ab0
commit 048247115b

View file

@ -358,6 +358,10 @@ static void *r600_buffer_transfer_map(struct pipe_context *ctx,
0, 0, resource, level, box);
data = r600_buffer_map_sync_with_rings(rctx, staging, PIPE_TRANSFER_READ);
if (!data) {
pipe_resource_reference((struct pipe_resource **)&staging, NULL);
return NULL;
}
data += box->x % R600_MAP_BUFFER_ALIGNMENT;
return r600_buffer_get_transfer(ctx, resource, level, usage, box,