Lines Matching refs:trans

958                       struct d3d12_transfer *trans, unsigned resid, unsigned z)
961 int subres = get_subresource_id(res, resid, z, trans->base.b.level);
973 struct d3d12_transfer *trans,
984 unsigned sub_resid = get_subresource_id(res, resid, z, trans->base.b.level);
991 buf_loc.PlacedFootprint.Offset += trans->base.b.offset;
999 buf_loc.PlacedFootprint.Footprint.Width = ALIGN(trans->base.b.box.width,
1001 buf_loc.PlacedFootprint.Footprint.Height = ALIGN(trans->base.b.box.height,
1007 buf_loc.PlacedFootprint.Footprint.RowPitch = trans->base.b.stride;
1041 struct d3d12_transfer *trans,
1047 trans->base.b.box.x, trans->base.b.box.y, trans->base.b.box.z,
1048 trans->base.b.box.width, trans->base.b.box.height, trans->base.b.box.depth,
1056 copy_info.src_loc = fill_buffer_location(ctx, res, staging_res, trans, depth, resid, z);
1057 copy_info.src_loc.PlacedFootprint.Offset += (z - start_z) * trans->base.b.layer_stride;
1060 copy_info.dst_loc = fill_texture_location(res, trans, resid, z);
1066 copy_info.dst_x = trans->base.b.box.x;
1067 copy_info.dst_y = trans->base.b.box.y;
1079 struct d3d12_transfer *trans, int resid)
1083 transfer_buf_to_image_part(ctx, res, staging_res, trans,
1084 0, trans->base.b.box.depth, 0,
1085 trans->base.b.box.z, 0);
1087 int num_layers = trans->base.b.box.depth;
1088 int start_z = trans->base.b.box.z;
1091 transfer_buf_to_image_part(ctx, res, staging_res, trans,
1102 struct d3d12_transfer *trans,
1106 struct pipe_box *box = &trans->base.b.box;
1113 copy_info.src_loc = fill_texture_location(res, trans, resid, z);
1115 copy_info.dst_loc = fill_buffer_location(ctx, res, staging_res, trans,
1117 copy_info.dst_loc.PlacedFootprint.Offset += (z - start_layer) * trans->base.b.layer_stride;
1120 bool whole_resource = util_texrange_covers_whole_level(&res->base.b, trans->base.b.level,
1143 struct d3d12_transfer *trans,
1150 assert(resid == 0 || trans->base.b.box.depth == 1);
1154 trans->base.b.box.x, trans->base.b.box.y, trans->base.b.box.z,
1155 trans->base.b.box.width, trans->base.b.box.height, trans->base.b.box.depth,
1184 transfer_image_part_to_buf(ctx, res, staging_res, trans, resid,
1185 0, 0, trans->base.b.box.z, trans->base.b.box.depth);
1187 int start_layer = trans->base.b.box.z;
1188 for (int z = start_layer; z < start_layer + trans->base.b.box.depth; ++z) {
1189 transfer_image_part_to_buf(ctx, res, staging_res, trans, resid,
1338 struct d3d12_transfer *trans)
1344 trans->base.b.stride = align(util_format_get_stride(res->base.b.format, width),
1346 trans->base.b.layer_stride = util_format_get_2d_size(res->base.b.format,
1347 trans->base.b.stride,
1351 trans->zs_cpu_copy_stride = align(util_format_get_stride(res->base.b.format, box->width),
1353 trans->zs_cpu_copy_layer_stride = util_format_get_2d_size(res->base.b.format,
1354 trans->base.b.stride,
1357 trans->zs_cpu_copy_stride = trans->base.b.stride;
1358 trans->zs_cpu_copy_layer_stride = trans->base.b.layer_stride;
1365 struct d3d12_transfer *trans)
1370 prepare_zs_layer_strides(screen, res, box, trans);
1379 tmpl.width0 = trans->base.b.layer_stride;
1390 if (!transfer_image_to_buf(ctx, res, depth_buffer, trans, 0))
1401 if (!transfer_image_to_buf(ctx, res, stencil_buffer, trans, 1))
1418 uint8_t *buf = (uint8_t *)malloc(trans->zs_cpu_copy_layer_stride);
1422 trans->data = buf;
1427 depth_ptr += trans->base.b.box.y * trans->base.b.stride + trans->base.b.box.x * 4;
1428 stencil_ptr += trans->base.b.box.y * trans->base.b.stride + trans->base.b.box.x * 4;
1430 util_format_z24_unorm_s8_uint_pack_separate(buf, trans->zs_cpu_copy_stride,
1431 (uint32_t *)depth_ptr, trans->base.b.stride,
1432 stencil_ptr, trans->base.b.stride,
1433 trans->base.b.box.width, trans->base.b.box.height);
1437 depth_ptr += trans->base.b.box.y * trans->base.b.stride + trans->base.b.box.x * 4;
1438 stencil_ptr += trans->base.b.box.y * trans->base.b.stride + trans->base.b.box.x;
1440 util_format_z32_float_s8x24_uint_pack_z_float(buf, trans->zs_cpu_copy_stride,
1441 (float *)depth_ptr, trans->base.b.stride,
1442 trans->base.b.box.width, trans->base.b.box.height);
1443 util_format_z32_float_s8x24_uint_pack_s_8uint(buf, trans->zs_cpu_copy_stride,
1444 stencil_ptr, trans->base.b.stride,
1445 trans->base.b.box.width, trans->base.b.box.height);
1451 return trans->data;
1457 struct d3d12_transfer *trans)
1460 prepare_zs_layer_strides(screen, res, box, trans);
1461 uint32_t *buf = (uint32_t *)malloc(trans->base.b.layer_stride);
1465 trans->data = buf;
1466 return trans->data;
1471 struct d3d12_transfer *trans)
1481 tmpl.width0 = trans->base.b.layer_stride;
1513 depth_ptr += trans->base.b.box.y * trans->base.b.stride + trans->base.b.box.x * 4;
1514 stencil_ptr += trans->base.b.box.y * trans->base.b.stride + trans->base.b.box.x * 4;
1516 util_format_z32_unorm_unpack_z_32unorm((uint32_t *)depth_ptr, trans->base.b.stride, (uint8_t*)trans->data,
1517 trans->zs_cpu_copy_stride, trans->base.b.box.width,
1518 trans->base.b.box.height);
1519 util_format_z24_unorm_s8_uint_unpack_s_8uint(stencil_ptr, trans->base.b.stride, (uint8_t*)trans->data,
1520 trans->zs_cpu_copy_stride, trans->base.b.box.width,
1521 trans->base.b.box.height);
1525 depth_ptr += trans->base.b.box.y * trans->base.b.stride + trans->base.b.box.x * 4;
1526 stencil_ptr += trans->base.b.box.y * trans->base.b.stride + trans->base.b.box.x;
1528 util_format_z32_float_s8x24_uint_unpack_z_float((float *)depth_ptr, trans->base.b.stride, (uint8_t*)trans->data,
1529 trans->zs_cpu_copy_stride, trans->base.b.box.width,
1530 trans->base.b.box.height);
1531 util_format_z32_float_s8x24_uint_unpack_s_8uint(stencil_ptr, trans->base.b.stride, (uint8_t*)trans->data,
1532 trans->zs_cpu_copy_stride, trans->base.b.box.width,
1533 trans->base.b.box.height);
1542 transfer_buf_to_image(d3d12_context(pctx), res, depth_buffer, trans, 0);
1543 transfer_buf_to_image(d3d12_context(pctx), res, stencil_buffer, trans, 1);
1565 struct d3d12_transfer *trans = (struct d3d12_transfer *)slab_zalloc(transfer_pool);
1566 struct pipe_transfer *ptrans = &trans->base.b;
1567 if (!trans)
1591 slab_free(transfer_pool, trans);
1598 ptr = read_zs_surface(ctx, res, box, trans);
1600 ptr = prepare_write_zs_surface(res, box, trans);
1629 trans->staging_res = pipe_buffer_create(pctx->screen, 0,
1632 if (!trans->staging_res)
1635 struct d3d12_resource *staging_res = d3d12_resource(trans->staging_res);
1652 if(!transfer_image_to_buf(ctx, d3d12_resource(planes[plane_slice]), staging_res, trans, 0)){
1683 trans->zs_cpu_copy_stride = ptrans->stride;
1684 trans->zs_cpu_copy_layer_stride = ptrans->layer_stride;
1711 trans->staging_res = pipe_buffer_create(pctx->screen, 0,
1714 if (!trans->staging_res) {
1715 slab_free(transfer_pool, trans);
1719 struct d3d12_resource *staging_res = d3d12_resource(trans->staging_res);
1728 ret = transfer_image_to_buf(ctx, res, staging_res, trans, 0);
1750 struct d3d12_transfer *trans = (struct d3d12_transfer *)ptrans;
1753 if (trans->data != nullptr) {
1754 if (trans->base.b.usage & PIPE_MAP_WRITE)
1755 write_zs_surface(pctx, res, trans);
1756 free(trans->data);
1757 } else if (trans->staging_res) {
1787 struct d3d12_resource *staging_res = d3d12_resource(trans->staging_res);
1788 if (trans->base.b.usage & PIPE_MAP_WRITE) {
1806 transfer_buf_to_image(ctx, d3d12_resource(planes[plane_slice]), staging_res, trans, 0);
1810 pipe_resource_reference(&trans->staging_res, NULL);
1812 struct d3d12_resource *staging_res = d3d12_resource(trans->staging_res);
1813 if (trans->base.b.usage & PIPE_MAP_WRITE) {
1821 if (trans->base.b.usage & PIPE_MAP_WRITE) {
1824 uint64_t dst_offset = trans->base.b.box.x;
1828 transfer_buf_to_image(ctx, res, staging_res, trans, 0);
1831 pipe_resource_reference(&trans->staging_res, NULL);
1834 if (trans->base.b.usage & PIPE_MAP_WRITE) {