Lines Matching defs:xfer
1196 crocus_flush_staging_region(struct pipe_transfer *xfer,
1199 if (!(xfer->usage & PIPE_MAP_WRITE))
1202 struct crocus_transfer *map = (void *) xfer;
1207 if (xfer->resource->target == PIPE_BUFFER)
1208 src_box.x += xfer->box.x % CROCUS_MAP_BUFFER_ALIGNMENT;
1211 .x = xfer->box.x + flush_box->x,
1212 .y = xfer->box.y + flush_box->y,
1213 .z = xfer->box.z + flush_box->z,
1219 crocus_copy_region(map->blorp, map->batch, xfer->resource, xfer->level,
1236 struct pipe_transfer *xfer = &map->base.b;
1237 struct pipe_box *box = &xfer->box;
1238 struct crocus_resource *res = (void *) xfer->resource;
1240 unsigned extra = xfer->resource->target == PIPE_BUFFER ?
1248 .nr_samples = xfer->resource->nr_samples,
1249 .nr_storage_samples = xfer->resource->nr_storage_samples,
1254 if (xfer->resource->target == PIPE_BUFFER)
1266 xfer->stride = isl_surf_get_row_pitch_B(surf);
1267 xfer->layer_stride = isl_surf_get_array_pitch(surf);
1270 if (!(xfer->usage & PIPE_MAP_DISCARD_RANGE)) {
1272 xfer->resource, xfer->level, box);
1286 crocus_bo_map(map->dbg, staging_bo, xfer->usage & MAP_FLAGS) + extra;
1373 struct pipe_transfer *xfer = &map->base.b;
1374 const struct pipe_box *box = &xfer->box;
1375 struct crocus_resource *res = (struct crocus_resource *) xfer->resource;
1378 if (xfer->usage & PIPE_MAP_WRITE) {
1381 crocus_bo_map(map->dbg, res->bo, (xfer->usage | MAP_RAW) & MAP_FLAGS);
1385 get_image_offset_el(surf, xfer->level, box->z + s, &x0_el, &y0_el);
1394 untiled_s8_map[s * xfer->layer_stride + y * xfer->stride + x];
1406 struct pipe_transfer *xfer = &map->base.b;
1407 const struct pipe_box *box = &xfer->box;
1408 struct crocus_resource *res = (struct crocus_resource *) xfer->resource;
1411 xfer->stride = surf->row_pitch_B;
1412 xfer->layer_stride = xfer->stride * box->height;
1418 map->buffer = map->ptr = malloc(xfer->layer_stride * box->depth);
1426 if (!(xfer->usage & PIPE_MAP_DISCARD_RANGE)) {
1429 crocus_bo_map(map->dbg, res->bo, (xfer->usage | MAP_RAW) & MAP_FLAGS);
1433 get_image_offset_el(surf, xfer->level, box->z + s, &x0_el, &y0_el);
1441 untiled_s8_map[s * xfer->layer_stride + y * xfer->stride + x] =
1479 struct pipe_transfer *xfer = &map->base.b;
1480 const struct pipe_box *box = &xfer->box;
1481 struct crocus_resource *res = (struct crocus_resource *) xfer->resource;
1484 if (xfer->usage & PIPE_MAP_WRITE) {
1486 crocus_bo_map(map->dbg, res->bo, (xfer->usage | MAP_RAW) & MAP_FLAGS);
1490 tile_extents(surf, box, xfer->level, s, &x1, &x2, &y1, &y2);
1492 void *ptr = map->ptr + s * xfer->layer_stride;
1495 surf->row_pitch_B, xfer->stride,
1507 struct pipe_transfer *xfer = &map->base.b;
1508 const struct pipe_box *box = &xfer->box;
1509 struct crocus_resource *res = (struct crocus_resource *) xfer->resource;
1512 xfer->stride = ALIGN(surf->row_pitch_B, 16);
1513 xfer->layer_stride = xfer->stride * box->height;
1516 tile_extents(surf, box, xfer->level, 0, &x1, &x2, &y1, &y2);
1523 os_malloc_aligned(xfer->layer_stride * box->depth, 16);
1527 if (!(xfer->usage & PIPE_MAP_DISCARD_RANGE)) {
1529 crocus_bo_map(map->dbg, res->bo, (xfer->usage | MAP_RAW) & MAP_FLAGS);
1533 tile_extents(surf, box, xfer->level, s, &x1, &x2, &y1, &y2);
1536 void *ptr = map->ptr + s * xfer->layer_stride;
1538 isl_memcpy_tiled_to_linear(x1, x2, y1, y2, ptr, src, xfer->stride,
1555 struct pipe_transfer *xfer = &map->base.b;
1556 struct pipe_box *box = &xfer->box;
1557 struct crocus_resource *res = (struct crocus_resource *) xfer->resource;
1559 void *ptr = crocus_bo_map(map->dbg, res->bo, xfer->usage & MAP_FLAGS);
1562 xfer->stride = 0;
1563 xfer->layer_stride = 0;
1575 get_image_offset_el(surf, xfer->level, box->z, &x0_el, &y0_el);
1580 xfer->stride = isl_surf_get_row_pitch_B(surf);
1581 xfer->layer_stride = isl_surf_get_array_pitch(surf);
1583 map->ptr = ptr + y0_el * xfer->stride + x0_el * cpp;
1652 struct pipe_transfer *xfer = &map->base.b;
1660 pipe_resource_reference(&xfer->resource, resource);
1661 xfer->level = level;
1662 xfer->usage = usage;
1663 xfer->box = *box;
1664 *ptransfer = xfer;
1738 struct pipe_transfer *xfer,
1742 struct crocus_resource *res = (struct crocus_resource *) xfer->resource;
1743 struct crocus_transfer *map = (void *) xfer;
1746 crocus_flush_staging_region(xfer, box);
1782 crocus_transfer_unmap(struct pipe_context *ctx, struct pipe_transfer *xfer)
1785 struct crocus_transfer *map = (void *) xfer;
1787 if (!(xfer->usage & (PIPE_MAP_FLUSH_EXPLICIT |
1791 .width = xfer->box.width,
1792 .height = xfer->box.height,
1793 .depth = xfer->box.depth,
1795 crocus_transfer_flush_region(ctx, xfer, &flush_box);
1801 pipe_resource_reference(&xfer->resource, NULL);