~mmach/netext73/mesa-ryzen

« back to all changes in this revision

Viewing changes to src/freedreno/vulkan/tu_formats.cc

  • Committer: mmach
  • Date: 2023-11-02 21:31:35 UTC
  • Revision ID: netbit73@gmail.com-20231102213135-18d4tzh7tj0uz752
2023-11-02 22:11:57

Show diffs side-by-side

added added

removed removed

Lines of Context:
258
258
         if (physical_device->vk.supported_extensions.EXT_filter_cubic)
259
259
            optimal |= VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_EXT;
260
260
      }
 
261
 
 
262
      /* We sample on the CPU so we can technically support anything as long
 
263
       * as it's floating point, but this restricts it to "reasonable" formats
 
264
       * to use, which means two channels and not something weird like
 
265
       * luminance-alpha.
 
266
       */
 
267
      if (util_format_is_float(format) &&
 
268
          desc->nr_channels == 2 && desc->swizzle[0] == PIPE_SWIZZLE_X &&
 
269
          desc->swizzle[1] == PIPE_SWIZZLE_Y) {
 
270
         optimal |= VK_FORMAT_FEATURE_FRAGMENT_DENSITY_MAP_BIT_EXT;
 
271
      }
261
272
   }
262
273
 
263
274
   if (supported_color) {
454
465
      const VkPhysicalDeviceImageDrmFormatModifierInfoEXT *drm_info =
455
466
         vk_find_struct_const(info->pNext, PHYSICAL_DEVICE_IMAGE_DRM_FORMAT_MODIFIER_INFO_EXT);
456
467
 
 
468
      /* Subsampled format isn't stable yet, so don't allow
 
469
       * importing/exporting with modifiers yet.
 
470
       */
 
471
      if (info->flags & VK_IMAGE_CREATE_SUBSAMPLED_BIT_EXT)
 
472
         return VK_ERROR_FORMAT_NOT_SUPPORTED;
 
473
 
457
474
      switch (drm_info->drmFormatModifier) {
458
475
      case DRM_FORMAT_MOD_QCOM_COMPRESSED:
459
476
         /* falling back to linear/non-UBWC isn't possible with explicit modifier */