Lines Matching defs:image
279 * will have to divide offsets and dimensions on the compressed image by
338 * Checks if we can implement an image copy or clear operation using the TLB
342 v3dv_meta_can_use_tlb(struct v3dv_image *image,
349 if (image->format->rt_type != V3D_OUTPUT_IMAGE_FORMAT_NO) {
351 *compat_format = image->vk.format;
355 /* If the image format is not TLB-supported, then check if we can use
359 *compat_format = get_compatible_tlb_format(image->vk.format);
380 struct v3dv_image *image,
384 if (!v3dv_meta_can_use_tlb(image, ®ion->imageOffset, &fb_format))
393 if (image->vk.image_type != VK_IMAGE_TYPE_3D)
405 const uint32_t block_w = vk_format_get_blockwidth(image->vk.format);
406 const uint32_t block_h = vk_format_get_blockheight(image->vk.format);
419 (job, buffer, image, &framebuffer, region);
445 struct v3dv_image *image,
454 if (image->vk.tiling == VK_IMAGE_TILING_LINEAR &&
455 image->vk.image_type != VK_IMAGE_TYPE_1D) {
460 * source image. The exception is the case where we are copying
461 * stencil (8bpp) to a combined d24s8 image (32bpp).
463 uint32_t buffer_bpp = image->cpp;
468 * a linear image from the destination buffer and we also want our blit
471 * source image bpp.
474 * because we are copying only one aspect of the image, so we need to setup
504 assert(image->vk.format == VK_FORMAT_D32_SFLOAT ||
505 image->vk.format == VK_FORMAT_D24_UNORM_S8_UINT ||
506 image->vk.format == VK_FORMAT_X8_D24_UNORM_PACK32);
507 if (image->vk.format == VK_FORMAT_D32_SFLOAT) {
529 assert(image->vk.format == VK_FORMAT_D24_UNORM_S8_UINT);
582 /* If the image is compressed, the bpp refers to blocks, not pixels */
583 uint32_t block_width = vk_format_get_blockwidth(image->vk.format);
584 uint32_t block_height = vk_format_get_blockheight(image->vk.format);
590 if (image->vk.image_type != VK_IMAGE_TYPE_3D)
600 * buffer for the blit destination image (since compressed formats are
602 * the source image.
607 if (vk_format_is_compressed(image->vk.format)) {
613 .extent = { buf_width, buf_height, image->vk.extent.depth },
614 .mipLevels = image->vk.mip_levels,
615 .arrayLayers = image->vk.array_layers,
616 .samples = image->vk.samples,
617 .tiling = image->vk.tiling,
633 v3dv_device_memory_to_handle(image->mem),
634 image->mem_offset);
638 image = v3dv_image_from_handle(uiview);
643 /* Create the destination blit image from the destination buffer */
669 /* Bind the buffer memory to the image */
679 /* Blit-copy the requested image extent.
684 * image, but that we need to blit to a S8D24 destination (the only
727 image, src_format,
732 unreachable("Unable to blit buffer to destination image");
747 V3DV_FROM_HANDLE(v3dv_image, image, info->srcImage);
750 assert(image->vk.samples == VK_SAMPLE_COUNT_1_BIT);
755 if (copy_image_to_buffer_tlb(cmd_buffer, buffer, image, &info->pRegions[i]))
757 if (copy_image_to_buffer_blit(cmd_buffer, buffer, image, &info->pRegions[i]))
759 unreachable("Unsupported image to buffer copy.");
795 * checks for "dst image complete" requires some changes, since it is
797 * image format.
808 /* Destination image must be complete */
821 * members represent the texel dimensions of the source image and not
913 * dstImage has a multi-planar image format then the aspectMask member
945 /* Handle copy to compressed image using compatible format */
967 * Takes the image provided as argument and creates a new image that has
974 * path. The idea is that we create uncompressed "image views" of both the
1013 struct v3dv_image *image = v3dv_image_from_handle(_image);
1014 image->mem = src->mem;
1015 image->mem_offset = src->mem_offset;
1016 return image;
1048 * are going to texture from the source image, and the texture setup
1049 * knows the actual size of the image, so we need to choose a format
1051 * image size. For example, for a source image with size Bw*WxBh*H
1052 * and format ETC2_RGBA8_UNORM copied to a WxH image of format RGBA32UI,
1053 * each of the Bw*WxBh*H texels in the compressed source image is 8-bit
1065 * divisors for the width and height depending on the source image's
1082 /* Create image views of the src/dst images that we can interpret in
1106 /* Given an uncompressed image with size WxH, if we copy it to a compressed
1107 * image, it will result in an image with size W*bWxH*bH, where bW and bH
1110 * image sizes, and therefore, we need to take that into account when
1116 * to the copy command are specified in terms of the source image. With that
1120 * command (because it is specified in terms of the destination image, not
1123 * image).
1306 struct v3dv_image *image,
1310 assert(image->vk.samples == VK_SAMPLE_COUNT_1_BIT);
1313 if (image->vk.tiling == VK_IMAGE_TILING_LINEAR)
1316 /* We can't copy D24S8 because buffer to image copies only copy one aspect
1323 if (image->vk.format == VK_FORMAT_D24_UNORM_S8_UINT ||
1324 image->vk.format == VK_FORMAT_X8_D24_UNORM_PACK32) {
1345 if (width != image->vk.extent.width || height != image->vk.extent.height)
1349 const uint32_t block_w = vk_format_get_blockwidth(image->vk.format);
1350 const uint32_t block_h = vk_format_get_blockheight(image->vk.format);
1356 * the image's format and choose a compatible TFU format for the image
1361 image->cpp, NULL);
1364 const struct v3d_resource_slice *slice = &image->slices[mip_level];
1367 if (image->vk.image_type != VK_IMAGE_TYPE_3D)
1373 assert(image->mem && image->mem->bo);
1374 const struct v3dv_bo *dst_bo = image->mem->bo;
1380 const uint32_t buffer_stride = width * image->cpp;
1383 if (image->vk.image_type != VK_IMAGE_TYPE_3D)
1394 dst_bo->offset + v3dv_layer_offset(image, mip_level, layer);
1402 image->cpp,
1420 struct v3dv_image *image,
1425 if (!v3dv_meta_can_use_tlb(image, ®ion->imageOffset, &fb_format))
1434 if (image->vk.image_type != VK_IMAGE_TYPE_3D)
1446 const uint32_t block_w = vk_format_get_blockwidth(image->vk.format);
1447 const uint32_t block_h = vk_format_get_blockheight(image->vk.format);
1460 (job, image, buffer, &framebuffer, region);
1469 struct v3dv_image *image,
1473 if (copy_buffer_to_image_tfu(cmd_buffer, image, buffer, region))
1475 if (copy_buffer_to_image_tlb(cmd_buffer, image, buffer, region))
1961 struct v3dv_image *image,
1992 if (vk_format_is_compressed(image->vk.format))
2025 * image subresource so we can take this from the first region. For 3D
2030 if (image->vk.image_type != VK_IMAGE_TYPE_3D) {
2042 image->vk.image_type, num_layers > 1,
2113 * layers matching the depth extent of the 3D image.
2115 uint32_t fb_width = u_minify(image->vk.extent.width, resource->mipLevel);
2116 uint32_t fb_height = u_minify(image->vk.extent.height, resource->mipLevel);
2119 .image = v3dv_image_to_handle(image),
2120 .viewType = v3dv_image_type_to_view_type(image->vk.image_type),
2292 struct v3dv_image *image,
2303 * buffer to a tiled image that we can use as a blit source, which
2306 perf_debug("Falling back to blit path for buffer to image copy.\n");
2312 /* Allocate memory for the tiled image. Since we copy layer by layer
2314 * For that we create a dummy image with that spec, get memory requirements
2324 .extent = { image->vk.extent.width, image->vk.extent.height, 1 },
2361 * image subresource so we can take this from the first region.
2364 if (image->vk.image_type != VK_IMAGE_TYPE_3D)
2375 const uint32_t block_width = vk_format_get_blockwidth(image->vk.format);
2376 const uint32_t block_height = vk_format_get_blockheight(image->vk.format);
2378 /* Copy regions by uploading each region to a temporary tiled image using
2396 /* If the image is compressed, the bpp refers to blocks, not pixels */
2401 /* Create the tiled image */
2458 unreachable("Unable to copy buffer to image through TLB");
2462 /* Blit-copy the requested image extent from the buffer image to the
2463 * destination image.
2468 * image, but that we need to blit to a S8D24 destination (the only
2506 image, dst_format,
2512 unreachable("Unable to blit buffer to destination image");
2527 struct v3dv_image *image,
2534 * together, in which case they share the same image subresource, and so
2540 * destination image. The exception is the case where we are uploading
2541 * stencil (8bpp) to a combined d24s8 image (32bpp).
2543 uint32_t buf_bpp = image->cpp;
2545 /* We are about to upload the buffer data to an image so we can then
2549 * format that matches the destination image bpp.
2580 assert(image->vk.format == VK_FORMAT_D32_SFLOAT ||
2581 image->vk.format == VK_FORMAT_D24_UNORM_S8_UINT ||
2582 image->vk.format == VK_FORMAT_X8_D24_UNORM_PACK32);
2590 if (image->vk.format == VK_FORMAT_D24_UNORM_S8_UINT ||
2591 image->vk.format == VK_FORMAT_X8_D24_UNORM_PACK32) {
2603 * copy to a combined depth/stencil image. Because we don't support
2605 * color R8UI image, and implement the blit as a compatible color
2607 * GBA (which map to the D24 component of a S8D24 image).
2609 assert(image->vk.format == VK_FORMAT_D24_UNORM_S8_UINT);
2637 return texel_buffer_shader_copy(cmd_buffer, aspect, image,
2643 return copy_buffer_to_image_blit(cmd_buffer, aspect, image,
2657 struct v3dv_image *image,
2662 if (vk_format_is_depth_or_stencil(image->vk.format))
2665 if (vk_format_is_compressed(image->vk.format))
2668 if (image->vk.tiling == VK_IMAGE_TILING_LINEAR)
2682 uint32_t buffer_stride = buffer_width * image->cpp;
2686 if (image->vk.image_type != VK_IMAGE_TYPE_3D)
2699 job->cpu.copy_buffer_to_image.image = image;
2723 V3DV_FROM_HANDLE(v3dv_image, image, info->dstImage);
2725 assert(image->vk.samples == VK_SAMPLE_COUNT_1_BIT);
2736 if (copy_buffer_to_image_tfu(cmd_buffer, image, buffer, &info->pRegions[r]))
2739 if (copy_buffer_to_image_tlb(cmd_buffer, image, buffer, &info->pRegions[r]))
2745 * framebuffer spec, which is mostly determined by the image
2757 if (image->vk.image_type == VK_IMAGE_TYPE_3D &&
2766 if (copy_buffer_to_image_shader(cmd_buffer, image, buffer,
2777 if (copy_buffer_to_image_cpu(cmd_buffer, image, buffer,
2783 if (copy_buffer_to_image_shader(cmd_buffer, image, buffer,
2788 unreachable("Unsupported buffer to image copy.");
2830 /* Destination image must be complete */
2849 * can't be programmed to copy only one aspect of the image.
3502 unreachable("Invalid image type");
3867 * semantics of the source image of the copy (see copy_image_blit), so we
3869 * destination image level.
3986 /* Create sampler for blit source image */
4041 .image = v3dv_image_to_handle(dst),
4099 .image = v3dv_image_to_handle(src),
4146 * with the dst image contents before the blit. The exception is when we