VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT |
VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT;
buffer |= VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT;
+
+ if (physical_device->supported_extensions.EXT_filter_cubic)
+ optimal |= VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_EXT;
}
if (native_fmt.supported & FMT_COLOR) {
tu_get_image_format_properties(
struct tu_physical_device *physical_device,
const VkPhysicalDeviceImageFormatInfo2 *info,
- VkImageFormatProperties *pImageFormatProperties)
-
+ VkImageFormatProperties *pImageFormatProperties,
+ VkFormatFeatureFlags *p_feature_flags)
{
VkFormatProperties format_props;
VkFormatFeatureFlags format_feature_flags;
.maxResourceSize = UINT32_MAX,
};
+ if (p_feature_flags)
+ *p_feature_flags = format_feature_flags;
+
return VK_SUCCESS;
unsupported:
*pImageFormatProperties = (VkImageFormatProperties) {
};
return tu_get_image_format_properties(physical_device, &info,
- pImageFormatProperties);
+ pImageFormatProperties, NULL);
}
static VkResult
{
TU_FROM_HANDLE(tu_physical_device, physical_device, physicalDevice);
const VkPhysicalDeviceExternalImageFormatInfo *external_info = NULL;
+ const VkPhysicalDeviceImageViewImageFormatInfoEXT *image_view_info = NULL;
VkExternalImageFormatProperties *external_props = NULL;
+ VkFilterCubicImageViewImageFormatPropertiesEXT *cubic_props = NULL;
+ VkFormatFeatureFlags format_feature_flags;
VkResult result;
- result = tu_get_image_format_properties(
- physical_device, base_info, &base_props->imageFormatProperties);
+ result = tu_get_image_format_properties(physical_device,
+ base_info, &base_props->imageFormatProperties, &format_feature_flags);
if (result != VK_SUCCESS)
return result;
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO:
external_info = (const void *) s;
break;
+ case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_IMAGE_FORMAT_INFO_EXT:
+ image_view_info = (const void *) s;
+ break;
default:
break;
}
case VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES:
external_props = (void *) s;
break;
+ case VK_STRUCTURE_TYPE_FILTER_CUBIC_IMAGE_VIEW_IMAGE_FORMAT_PROPERTIES_EXT:
+ cubic_props = (void *) s;
+ break;
default:
break;
}
goto fail;
}
+ if (cubic_props) {
+ /* note: blob only allows cubic filtering for 2D and 2D array views
+ * its likely we can enable it for 1D and CUBE, needs testing however
+ */
+ if ((image_view_info->imageViewType == VK_IMAGE_VIEW_TYPE_2D ||
+ image_view_info->imageViewType == VK_IMAGE_VIEW_TYPE_2D_ARRAY) &&
+ (format_feature_flags & VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_EXT)) {
+ cubic_props->filterCubic = true;
+ cubic_props->filterCubicMinmax = true;
+ } else {
+ cubic_props->filterCubic = false;
+ cubic_props->filterCubicMinmax = false;
+ }
+ }
+
return VK_SUCCESS;
fail: