Lines Matching defs:format

245 get_compatible_tlb_format(VkFormat format)
247 switch (format) {
276 * a compatible format with the same bpp as the compressed format. Because
277 * the compressed format's bpp is for a full block (i.e. 4x4 pixels in the
278 * case of ETC), when we implement copies with the compatible format we
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
356 * a compatible format instead.
359 *compat_format = get_compatible_tlb_format(image->vk.format);
404 /* Handle copy from compressed format using a compatible format */
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);
469 * source and destination formats to be the same (to avoid any format
470 * conversions), so we choose a canonical format that matches the
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);
561 * compatible color format.
583 uint32_t block_width = vk_format_get_blockwidth(image->vk.format);
584 uint32_t block_height = vk_format_get_blockheight(image->vk.format);
596 /* Our blit interface can see the real format of the images to detect
607 if (vk_format_is_compressed(image->vk.format)) {
612 .format = dst_format,
647 .format = dst_format,
681 * Since we are copying, the blit must use the same format on the
682 * destination and source images to avoid format conversions. The
685 * stencil format we support).
775 /* Destination can't be raster format */
779 /* We can only do full copies, so if the format is D24S8 both aspects need
780 * to be copied. We only need to check the dst format because the spec
783 if (dst->vk.format == VK_FORMAT_D24_UNORM_S8_UINT) {
797 * image format.
799 if (vk_format_is_compressed(dst->vk.format) !=
800 vk_format_is_compressed(src->vk.format)) {
824 const uint32_t block_w = vk_format_get_blockwidth(src->vk.format);
825 const uint32_t block_h = vk_format_get_blockheight(src->vk.format);
837 /* The TFU unit doesn't handle format conversions so we need the formats to
846 * the underlying pixel data according to its format, we can always choose
850 const struct v3dv_format *format =
888 width, height, format);
913 * dstImage has a multi-planar image format then the aspectMask member
945 /* Handle copy to compressed image using compatible format */
946 const uint32_t block_w = vk_format_get_blockwidth(dst->vk.format);
947 const uint32_t block_h = vk_format_get_blockheight(dst->vk.format);
970 * - It has the uncompressed format passed in.
975 * source and destination images using the uncompressed format and then we
976 * define the copy blit in terms of that format.
983 VkFormat format)
985 assert(!vk_format_is_compressed(format));
992 .format = format,
1029 const uint32_t src_block_w = vk_format_get_blockwidth(src->vk.format);
1030 const uint32_t src_block_h = vk_format_get_blockheight(src->vk.format);
1031 const uint32_t dst_block_w = vk_format_get_blockwidth(dst->vk.format);
1032 const uint32_t dst_block_h = vk_format_get_blockheight(dst->vk.format);
1036 /* We need to choose a single format for the blit to ensure that this is
1037 * really a copy and there are not format conversions going on. Since we
1038 * going to blit, we need to make sure that the selected format can be
1041 VkFormat format;
1046 if (vk_format_is_compressed(src->vk.format)) {
1047 /* If we are copying from a compressed format we should be aware that we
1049 * knows the actual size of the image, so we need to choose a format
1052 * and format ETC2_RGBA8_UNORM copied to a WxH image of format RGBA32UI,
1055 * so we could specify a blit with size Bw*WxBh*H and a format with
1058 * Unfortunately, when copying from a format like ETC2_RGB8A1_UNORM,
1059 * which is 64-bit per texel, then we would need a 4-bit format, which
1060 * we don't have, so instead we still choose an 8-bit format, but we
1064 * Generally, we can choose any format so long as we compute appropriate
1070 format = VK_FORMAT_R32G32_UINT;
1073 format = VK_FORMAT_R32G32B32A32_UINT;
1076 format = VK_FORMAT_R16G16B16A16_UINT;
1079 unreachable("Unsupported compressed format");
1083 * terms of the canonical format.
1091 src_scale_w, src_scale_h, format);
1094 dst_scale_w, dst_scale_h, format);
1096 format = src->format->rt_type != V3D_OUTPUT_IMAGE_FORMAT_NO ?
1097 src->vk.format : get_compatible_tlb_format(src->vk.format);
1098 if (format == VK_FORMAT_UNDEFINED)
1101 const struct v3dv_format *f = v3dv_X(cmd_buffer->device, get_format)(format);
1108 * are the compressed format's block width and height. This means that
1112 * consistent from the point of view of the single compatible format
1118 * the source region for the compatible format, so basically, we apply
1155 dst, format,
1156 src, format,
1312 /* Destination can't be raster format */
1323 if (image->vk.format == VK_FORMAT_D24_UNORM_S8_UINT ||
1324 image->vk.format == VK_FORMAT_X8_D24_UNORM_PACK32) {
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
1359 const struct v3dv_format *format =
1408 width, height, format);
1445 /* Handle copy to compressed format using a compatible format */
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);
1565 get_texel_buffer_copy_pipeline_cache_key(VkFormat format,
1575 *p = format;
1729 get_texel_buffer_copy_fs(struct v3dv_device *device, VkFormat format,
1738 * format for the copy.
1740 assert(vk_format_is_int(format));
1827 VkFormat format,
1837 assert(vk_format_is_color(format));
1840 nir_shader *fs_nir = get_texel_buffer_copy_fs(device, format, cswizzle);
1889 VkFormat format,
1899 get_texel_buffer_copy_pipeline_cache_key(format, cmask, cswizzle, is_layered,
1919 ok = create_blit_render_pass(device, format, format,
1927 format, cmask, cswizzle, is_layered,
1976 /* This is a copy path, so we don't handle format conversions. The only
1986 * a compatible color format and maybe a cmask/cswizzle for D24 formats.
1992 if (vk_format_is_compressed(image->vk.format))
2067 .format = src_format,
2121 .format = dst_format,
2323 .format = src_format,
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);
2405 .format = src_format,
2465 * Since we are copying, the blit must use the same format on the
2466 * destination and source images to avoid format conversions. The
2469 * stencil format we support).
2548 * the same (to avoid any format conversions), so we choose a canonical
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) {
2609 assert(image->vk.format == VK_FORMAT_D24_UNORM_S8_UINT);
2662 if (vk_format_is_depth_or_stencil(image->vk.format))
2665 if (vk_format_is_compressed(image->vk.format))
2819 if (src->vk.format != dst->vk.format)
2822 /* Destination can't be raster format */
2848 /* If the format is D24S8 both aspects need to be copied, since the TFU
2851 if (dst->vk.format == VK_FORMAT_D24_UNORM_S8_UINT) {
2859 * on input and output, no scaling, etc), so there is no pixel format
2860 * conversions and we can rewrite the format to use one that is TFU
2863 const struct v3dv_format *format =
2933 dst_width, dst_height, format);
2940 format_needs_software_int_clamp(VkFormat format)
2942 switch (format) {
2968 /* Generally, when blitting from a larger format to a smaller format
2976 * we need the src format to be part of the key.
3002 .format = dst_format,
3844 unreachable("Unsupported depth/stencil format");
3871 const uint32_t dst_block_w = vk_format_get_blockwidth(dst->vk.format);
3872 const uint32_t dst_block_h = vk_format_get_blockheight(dst->vk.format);
3873 const uint32_t src_block_w = vk_format_get_blockwidth(src->vk.format);
3874 const uint32_t src_block_h = vk_format_get_blockheight(src->vk.format);
4043 .format = dst_format,
4101 .format = src_format,
4232 assert(!vk_format_is_compressed(dst->vk.format));
4240 dst, dst->vk.format,
4241 src, src->vk.format,
4264 if (!v3dv_X(cmd_buffer->device, format_supports_tlb_resolve)(src->format))
4267 const VkFormat fb_format = src->vk.format;
4281 const uint32_t block_w = vk_format_get_blockwidth(dst->vk.format);
4282 const uint32_t block_h = vk_format_get_blockheight(dst->vk.format);
4332 dst, dst->vk.format,
4333 src, src->vk.format,