+ map = pipe->transfer_map(pipe,
+ resource,
+ level,
+ usage,
+ box, &transfer);
+ if (map == NULL)
+ return;
+
+ if (resource->target == PIPE_BUFFER) {
+ assert(box->height == 1);
+ assert(box->depth == 1);
+
+ memcpy(map, data, box->width);
+ }
+ else {
+ const uint8_t *src_data = data;
+
+ util_copy_box(map,
+ resource->format,
+ transfer->stride, /* bytes */
+ transfer->layer_stride, /* bytes */
+ 0, 0, 0,
+ box->width,
+ box->height,
+ box->depth,
+ src_data,
+ stride, /* bytes */
+ layer_stride, /* bytes */
+ 0, 0, 0);
+ }