Lines Matching refs:format
15 #include "util/format/u_format.h"
26 tu6_plane_count(VkFormat format)
28 switch (format) {
40 tu6_plane_format(VkFormat format, uint32_t plane)
42 switch (format) {
50 return tu_vk_format_to_pipe_format(format);
55 tu6_plane_index(VkFormat format, VkImageAspectFlags aspect_mask)
68 return format == VK_FORMAT_D32_SFLOAT_S8_UINT;
73 tu_format_for_aspect(enum pipe_format format, VkImageAspectFlags aspect_mask)
75 switch (format) {
92 return format;
97 tu_is_r8g8(enum pipe_format format)
99 return (util_format_get_blocksize(format) == 2) &&
100 (util_format_get_nr_components(format) == 2);
104 tu_is_r8g8_compatible(enum pipe_format format)
106 return (util_format_get_blocksize(format) == 2) &&
107 !util_format_is_depth_or_stencil(format);
157 VkFormat vk_format = pCreateInfo->format;
171 layouts[0] = &image->layout[tu6_plane_index(image->vk.format, aspect_mask)];
173 enum pipe_format format;
175 format = tu6_plane_format(vk_format, tu6_plane_index(vk_format, aspect_mask));
177 format = tu_vk_format_to_pipe_format(vk_format);
179 if (image->vk.format == VK_FORMAT_G8_B8R8_2PLANE_420_UNORM &&
182 /* The 0'th plane of this format has a different UBWC compression. */
183 format = PIPE_FORMAT_Y8_UNORM;
206 args.format = tu_format_for_aspect(format, aspect_mask);
245 if (image->vk.format == VK_FORMAT_D32_SFLOAT_S8_UINT) {
261 tiling_possible(VkFormat format)
263 if (format == VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM ||
264 format == VK_FORMAT_G8B8G8R8_422_UNORM ||
265 format == VK_FORMAT_B8G8R8G8_422_UNORM)
272 ubwc_possible(VkFormat format, VkImageType type, VkImageUsageFlags usage,
279 if (vk_format_is_compressed(format) ||
280 format == VK_FORMAT_E5B9G9R9_UFLOAT_PACK32 ||
281 format == VK_FORMAT_S8_UINT)
288 if (vk_format_is_snorm(format))
292 (format == VK_FORMAT_R8_UNORM ||
293 format == VK_FORMAT_R8_SNORM ||
294 format == VK_FORMAT_R8_UINT ||
295 format == VK_FORMAT_R8_SINT ||
296 format == VK_FORMAT_R8_SRGB))
319 * from the stencil component as UINT, however no format allows this
320 * on a630 (the special FMT6_Z24_UINT_S8_UINT format is missing)
324 * If we wish to get the border colors correct without knowing the format
327 * Additionally, the special AS_R8G8B8A8 format is broken without UBWC,
331 format == VK_FORMAT_D24_UNORM_S8_UINT &&
359 if (!tiling_possible(image->vk.format)) {
370 enum pipe_format format =
371 tu_vk_format_to_pipe_format(image->vk.format);
372 /* Whether a view of the image with an R8G8 format could be made. */
373 bool has_r8g8 = tu_is_r8g8(format);
375 /* Mutable images can be reinterpreted as any other compatible format.
378 * Depth and stencil formats cannot be reintepreted as another format, and
388 !vk_format_is_depth_or_stencil(image->vk.format)) {
392 /* Whether a view of the image with a non-R8G8 but R8G8 compatible format
398 has_r8g8_compatible = !has_r8g8 && tu_is_r8g8_compatible(format);
400 enum pipe_format format =
402 bool is_r8g8 = tu_is_r8g8(format);
405 (!is_r8g8 && tu_is_r8g8_compatible(format));
407 if (tu6_format_texture(format, TILE6_LINEAR).swap) {
413 /* If there is no format list it could be reinterpreted as
414 * any compatible format.
416 has_r8g8 = tu_is_r8g8_compatible(format);
433 if (!ubwc_possible(image->vk.format, pCreateInfo->imageType,
454 for (uint32_t i = 0; i < tu6_plane_count(image->vk.format); i++) {
456 enum pipe_format format = tu6_plane_format(image->vk.format, i);
461 switch (image->vk.format) {
494 if (!fdl6_layout(layout, format,
524 const struct util_format_description *desc = util_format_description(image->layout[0].format);
759 &image->layout[tu6_plane_index(image->vk.format, pSubresource->aspectMask)];
831 view->descriptor, tu_vk_format_to_pipe_format(pCreateInfo->format),