}
if (buf->derived_surface.resource) {
- *pbuff = pipe_buffer_map(drv->pipe, buf->derived_surface.resource,
- PIPE_TRANSFER_WRITE,
- &buf->derived_surface.transfer);
+ struct pipe_resource *resource;
+ struct pipe_box box = {};
+
+ resource = buf->derived_surface.resource;
+ box.width = resource->width0;
+ box.height = resource->height0;
+ box.depth = resource->depth0;
+ *pbuff = drv->pipe->transfer_map(drv->pipe, resource, 0, PIPE_TRANSFER_WRITE,
+ &box, &buf->derived_surface.transfer);
mtx_unlock(&drv->mutex);
if (!buf->derived_surface.transfer || !*pbuff)