-/**
- * Allocate storage for a linear image
- * (all cube faces and all 3D slices, all levels).
- */
-static void
-alloc_image_data(struct llvmpipe_resource *lpr)
-{
- uint alignment = MAX2(64, util_cpu_caps.cacheline);
- uint level;
- uint offset = 0;
-
- assert(!lpr->dt);
-
- /* not a display target - allocate regular memory */
- /*
- * Offset calculation for start of a specific mip/layer is always
- * offset = lpr->linear_mip_offsets[level] + lpr->img_stride[level] * layer
- */
- for (level = 0; level <= lpr->base.last_level; level++) {
- uint buffer_size = tex_image_size(lpr, level);
- lpr->mip_offsets[level] = offset;
- offset += align(buffer_size, alignment);
- }
- lpr->tex_data = align_malloc(offset, alignment);
- if (lpr->tex_data) {
- memset(lpr->tex_data, 0, offset);
- }
-}
-
-