Lines Matching defs:format
47 assert(util_format_get_num_planes(desc->format) == 1);
49 if (desc->format == PIPE_FORMAT_R11G11B10_FLOAT)
92 * undergo any format conversion.'
119 assert(util_format_get_num_planes(desc->format) == 1);
121 if (desc->format == PIPE_FORMAT_R11G11B10_FLOAT)
151 radv_translate_vertex_format(const struct radv_physical_device *pdevice, VkFormat format,
162 switch (format) {
180 switch (format) {
203 radv_translate_tex_dataformat(VkFormat format, const struct util_format_description *desc,
209 assert(vk_format_get_plane_count(format) == 1);
215 switch (format) {
239 switch (format) {
251 switch (format) {
264 switch (format) {
282 switch (format) {
295 switch (format) {
316 if (format == VK_FORMAT_E5B9G9R9_UFLOAT_PACK32) {
318 } else if (format == VK_FORMAT_B10G11R11_UFLOAT_PACK32) {
418 /* R600_ERR("Unable to handle texformat %d %s\n", format, vk_format_name(format)); */
423 radv_translate_tex_numformat(VkFormat format, const struct util_format_description *desc,
426 assert(vk_format_get_plane_count(format) == 1);
428 switch (format) {
433 if (vk_format_is_compressed(format)) {
434 switch (format) {
486 radv_translate_color_numformat(VkFormat format, const struct util_format_description *desc,
491 assert(vk_format_get_plane_count(format) == 1);
519 radv_is_sampler_format_supported(VkFormat format, bool *linear_sampling)
521 const struct util_format_description *desc = vk_format_description(format);
523 if (format == VK_FORMAT_UNDEFINED || format == VK_FORMAT_R64_UINT ||
524 format == VK_FORMAT_R64_SINT)
527 radv_translate_tex_numformat(format, desc, vk_format_get_first_non_void_channel(format));
538 return radv_translate_tex_dataformat(format, vk_format_description(format),
539 vk_format_get_first_non_void_channel(format)) != ~0U;
543 radv_is_atomic_format_supported(VkFormat format)
545 return format == VK_FORMAT_R32_UINT || format == VK_FORMAT_R32_SINT ||
546 format == VK_FORMAT_R32_SFLOAT || format == VK_FORMAT_R64_UINT ||
547 format == VK_FORMAT_R64_SINT;
552 VkFormat format)
554 const struct util_format_description *desc = vk_format_description(format);
556 if (format == VK_FORMAT_UNDEFINED)
560 radv_translate_tex_dataformat(format, desc, vk_format_get_first_non_void_channel(format));
562 radv_translate_tex_numformat(format, desc, vk_format_get_first_non_void_channel(format));
607 radv_is_buffer_format_supported(VkFormat format, bool *scaled)
609 const struct util_format_description *desc = vk_format_description(format);
611 if (format == VK_FORMAT_UNDEFINED)
615 radv_translate_buffer_dataformat(desc, vk_format_get_first_non_void_channel(format));
616 num_format = radv_translate_buffer_numformat(desc, vk_format_get_first_non_void_channel(format));
625 radv_is_colorbuffer_format_supported(const struct radv_physical_device *pdevice, VkFormat format,
628 const struct util_format_description *desc = vk_format_description(format);
629 uint32_t color_format = radv_translate_colorformat(format);
630 uint32_t color_swap = radv_translate_colorswap(format, false);
632 radv_translate_color_numformat(format, desc, vk_format_get_first_non_void_channel(format));
641 if (format == VK_FORMAT_E5B9G9R9_UFLOAT_PACK32 && pdevice->rad_info.gfx_level < GFX10_3)
648 radv_is_zs_format_supported(VkFormat format)
650 return radv_translate_dbformat(format) != V_028040_Z_INVALID || format == VK_FORMAT_S8_UINT;
654 radv_is_filter_minmax_format_supported(VkFormat format)
664 switch (format) {
694 VkFormat format, VkFormatProperties3 *out_properties)
697 const struct util_format_description *desc = vk_format_description(format);
701 if (desc->format == PIPE_FORMAT_NONE || desc->layout == UTIL_FORMAT_LAYOUT_SUBSAMPLED) {
716 const bool multiplanar = vk_format_get_plane_count(format) > 1;
740 if (radv_is_storage_image_format_supported(physical_device, format)) {
749 if (radv_is_buffer_format_supported(format, &scaled)) {
750 if (format != VK_FORMAT_R64_UINT && format != VK_FORMAT_R64_SINT &&
751 !vk_format_is_srgb(format)) {
761 if (vk_format_is_depth_or_stencil(format)) {
762 if (radv_is_zs_format_supported(format)) {
768 if (radv_is_filter_minmax_format_supported(format))
771 if (vk_format_has_depth(format)) {
777 if (vk_format_has_depth(format) && vk_format_has_stencil(format))
785 if (radv_is_sampler_format_supported(format, &linear_sampling)) {
789 if (radv_is_filter_minmax_format_supported(format))
798 if (format == VK_FORMAT_R32G32B32_SFLOAT || format == VK_FORMAT_R32G32B32_UINT ||
799 format == VK_FORMAT_R32G32B32_SINT) {
803 if (radv_is_colorbuffer_format_supported(physical_device, format, &blendable)) {
816 if (!util_is_power_of_two_or_zero(vk_format_get_blocksize(format)))
824 if (radv_is_atomic_format_supported(format)) {
830 switch (format) {
846 switch (format) {
868 if (vk_format_is_compressed(format))
878 if (format == VK_FORMAT_R8_UINT) {
883 if (vk_format_is_depth_or_stencil(format)) {
893 radv_translate_colorformat(VkFormat format)
895 const struct util_format_description *desc = vk_format_description(format);
901 if (format == VK_FORMAT_B10G11R11_UFLOAT_PACK32) /* isn't plain */
904 if (format == VK_FORMAT_E5B9G9R9_UFLOAT_PACK32)
1019 radv_translate_dbformat(VkFormat format)
1021 switch (format) {
1034 radv_translate_colorswap(VkFormat format, bool do_endian_swap)
1036 const struct util_format_description *desc = vk_format_description(format);
1040 if (format == VK_FORMAT_B10G11R11_UFLOAT_PACK32)
1043 if (format == VK_FORMAT_E5B9G9R9_UFLOAT_PACK32)
1097 radv_format_pack_clear_color(VkFormat format, uint32_t clear_vals[2], VkClearColorValue *value)
1099 const struct util_format_description *desc = vk_format_description(format);
1101 if (format == VK_FORMAT_B10G11R11_UFLOAT_PACK32) {
1105 } else if (format == VK_FORMAT_E5B9G9R9_UFLOAT_PACK32) {
1112 fprintf(stderr, "failed to fast clear for non-plain format %d\n", format);
1117 fprintf(stderr, "failed to fast clear for NPOT format %d\n", format);
1123 * We have a 128 bits format, check if the first 3 components are the same.
1180 fprintf(stderr, "failed to fast clear for unhandled float size in format %d\n", format);
1184 fprintf(stderr, "failed to fast clear for unhandled component type in format %d\n",
1185 format);
1203 radv_get_modifier_flags(struct radv_physical_device *dev, VkFormat format, uint64_t modifier,
1208 if (vk_format_is_compressed(format) || vk_format_is_depth_or_stencil(format))
1223 if (!ac_modifier_supports_dcc_image_stores(modifier) || radv_is_atomic_format_supported(format))
1240 radv_list_drm_format_modifiers(struct radv_physical_device *dev, VkFormat format,
1249 if (vk_format_is_compressed(format) || vk_format_is_depth_or_stencil(format)) {
1259 vk_format_to_pipe_format(format), &mod_count, NULL);
1268 vk_format_to_pipe_format(format), &mod_count, mods);
1272 radv_get_modifier_flags(dev, format, mods[i], format_props);
1273 unsigned planes = vk_format_get_plane_count(format);
1297 radv_list_drm_format_modifiers_2(struct radv_physical_device *dev, VkFormat format,
1306 if (vk_format_is_compressed(format) || vk_format_is_depth_or_stencil(format)) {
1316 vk_format_to_pipe_format(format), &mod_count, NULL);
1325 vk_format_to_pipe_format(format), &mod_count, mods);
1329 radv_get_modifier_flags(dev, format, mods[i], format_props);
1330 unsigned planes = vk_format_get_plane_count(format);
1356 VkImageFormatProperties *props, VkFormat format, uint64_t modifier)
1358 const struct util_format_description *desc = vk_format_description(format);
1387 radv_GetPhysicalDeviceFormatProperties2(radv_physical_device_to_handle(dev), format,
1398 radv_GetPhysicalDeviceFormatProperties2(radv_physical_device_to_handle(dev), format,
1413 !radv_are_formats_dcc_compatible(dev, info->pNext, format, info->flags,
1435 radv_GetPhysicalDeviceFormatProperties2(VkPhysicalDevice physicalDevice, VkFormat format,
1441 radv_physical_device_get_format_properties(physical_device, format, &format_props);
1459 physical_device, format, &format_props,
1462 physical_device, format, &format_props,
1468 const VkPhysicalDeviceImageFormatInfo2 *info, VkFormat format,
1478 const struct util_format_description *desc = vk_format_description(format);
1485 radv_physical_device_get_format_properties(physical_device, format, &format_props);
1491 format_feature_flags = radv_get_modifier_flags(physical_device, format,
1500 if (info->type != VK_IMAGE_TYPE_2D && vk_format_is_depth_or_stencil(format))
1536 /* Might be able to support but the entire format support is
1550 (format == VK_FORMAT_R32G32B32_SFLOAT || format == VK_FORMAT_R32G32B32_SINT ||
1551 format == VK_FORMAT_R32G32B32_UINT)) {
1552 /* R32G32B32 is a weird format and the driver currently only
1564 vk_format_get_blocksizebits(format) == 128 && vk_format_is_compressed(format) &&
1574 * that are not supported for the format the image is created with but are supported for at least
1575 * one format a VkImageView created from the image can have."
1626 if (vk_format_get_plane_count(format) > 1)
1635 if (vk_format_get_plane_count(format) > 1 || info->type != VK_IMAGE_TYPE_2D ||
1636 info->tiling != VK_IMAGE_TILING_OPTIMAL || vk_format_is_depth_or_stencil(format))
1659 result = radv_check_modifier_support(physical_device, info, pImageFormatProperties, format,
1688 const struct util_format_description *desc = vk_format_description(pImageFormatInfo->format);
1730 if (!radv_android_gralloc_supports_format(pImageFormatInfo->format, pImageFormatInfo->usage))
1773 VkFormat format = radv_select_android_external_format(base_info->pNext, base_info->format);
1775 result = radv_get_image_format_properties(physical_device, base_info, format,
1855 ycbcr_props->combinedImageSamplerDescriptorCount = vk_format_get_plane_count(format);
1862 texture_lod_props->supportsTextureGatherLODBiasAMD = !vk_format_is_int(format);
1884 fill_sparse_image_format_properties(struct radv_physical_device *pdev, VkFormat format,
1897 unsigned l2_size = 16 - util_logbase2(vk_format_get_blocksize(format));
1898 unsigned w = (1u << ((l2_size + 1) / 2)) * vk_format_get_blockwidth(format);
1899 unsigned h = (1u << (l2_size / 2)) * vk_format_get_blockheight(format);
1919 .format = pFormatInfo->format,
1926 result = radv_get_image_format_properties(pdev, &fmt_info, pFormatInfo->format, &fmt_props);
1936 fill_sparse_image_format_properties(pdev, pFormatInfo->format, &prop->properties);
1959 fill_sparse_image_format_properties(device->physical_device, image->vk.format,
2090 /* Return if it's allowed to reinterpret one format as another with DCC enabled. */