venus: support VK_EXT_filter_cubic

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33992>
This commit is contained in:
Yiwei Zhang
2025-03-10 14:52:59 -07:00
committed by Marge Bot
parent 89ec6c4d8f
commit cb5fa89bc4
3 changed files with 26 additions and 2 deletions

View File

@@ -608,7 +608,7 @@ Khronos extensions that are not part of any Vulkan version:
VK_EXT_external_memory_acquire_unmodified DONE (radv, vn)
VK_EXT_external_memory_dma_buf DONE (anv, hasvk, lvp, nvk, panvk, pvr, radv, tu, v3dv, vn)
VK_EXT_external_memory_host DONE (anv, hasvk, lvp, radv)
VK_EXT_filter_cubic DONE (tu/a650+)
VK_EXT_filter_cubic DONE (tu/a650+, vn)
VK_EXT_fragment_density_map DONE (tu)
VK_EXT_fragment_shader_interlock DONE (anv, radv/gfx9+, vn)
VK_EXT_global_priority DONE (anv, hasvk, panvk, radv, tu, vn)
@@ -664,7 +664,7 @@ Khronos extensions that are not part of any Vulkan version:
VK_GOOGLE_decorate_string DONE (anv, hasvk, lvp, nvk, panvk, radv, tu, vn)
VK_GOOGLE_hlsl_functionality1 DONE (anv, hasvk, lvp, nvk, panvk, radv, tu, vn)
VK_GOOGLE_user_type DONE (anv, hasvk, nvk, panvk, radv, tu, vn)
VK_IMG_filter_cubic DONE (tu/a650+)
VK_IMG_filter_cubic DONE (tu/a650+, vn)
VK_NV_compute_shader_derivatives DONE (anv, hasvk, nvk, radv, vn)
VK_EXT_acquire_drm_display DONE (anv, nvk, radv, tu, v3dv, vn)
VK_VALVE_mutable_descriptor_type DONE (anv, hasvk, nvk, radv, tu, vn)

View File

@@ -1273,6 +1273,7 @@ vn_physical_device_get_passthrough_extensions(
.EXT_extended_dynamic_state3 = true,
.EXT_dynamic_rendering_unused_attachments = true,
.EXT_external_memory_acquire_unmodified = true,
.EXT_filter_cubic = true,
.EXT_fragment_shader_interlock = true,
.EXT_global_priority = true,
.EXT_global_priority_query = true,
@@ -1313,6 +1314,7 @@ vn_physical_device_get_passthrough_extensions(
.GOOGLE_decorate_string = true,
.GOOGLE_hlsl_functionality1 = true,
.GOOGLE_user_type = true,
.IMG_filter_cubic = true,
.NV_compute_shader_derivatives = true,
.VALVE_mutable_descriptor_type = true,
};
@@ -2112,6 +2114,7 @@ struct vn_physical_device_image_format_info {
VkImageFormatListCreateInfo list;
VkImageStencilUsageCreateInfo stencil_usage;
VkPhysicalDeviceImageDrmFormatModifierInfoEXT modifier;
VkPhysicalDeviceImageViewImageFormatInfoEXT filter_cubic;
};
static const VkPhysicalDeviceImageFormatInfo2 *
@@ -2151,6 +2154,11 @@ vn_physical_device_fix_image_format_info(
memcpy(&local_info->modifier, src, sizeof(local_info->modifier));
pnext = &local_info->modifier;
break;
case VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_IMAGE_FORMAT_INFO_EXT:
memcpy(&local_info->filter_cubic, src,
sizeof(local_info->filter_cubic));
pnext = &local_info->filter_cubic;
break;
default:
break;
}
@@ -2362,6 +2370,7 @@ vn_image_get_image_format_key(
case VK_STRUCTURE_TYPE_HOST_IMAGE_COPY_DEVICE_PERFORMANCE_QUERY:
case VK_STRUCTURE_TYPE_IMAGE_COMPRESSION_PROPERTIES_EXT:
case VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_IMAGE_FORMAT_PROPERTIES:
case VK_STRUCTURE_TYPE_FILTER_CUBIC_IMAGE_VIEW_IMAGE_FORMAT_PROPERTIES_EXT:
_mesa_sha1_update(&sha1_ctx, &src->sType,
sizeof(VkStructureType));
break;
@@ -2450,6 +2459,15 @@ vn_image_init_format_from_cache(
.combinedImageSamplerDescriptorCount;
break;
}
case VK_STRUCTURE_TYPE_FILTER_CUBIC_IMAGE_VIEW_IMAGE_FORMAT_PROPERTIES_EXT: {
VkFilterCubicImageViewImageFormatPropertiesEXT *filter_cubic =
(VkFilterCubicImageViewImageFormatPropertiesEXT *)src;
filter_cubic->filterCubic =
cache_entry->properties.filter_cubic.filterCubic;
filter_cubic->filterCubicMinmax =
cache_entry->properties.filter_cubic.filterCubicMinmax;
break;
}
default:
unreachable("unexpected format props pNext");
}
@@ -2529,6 +2547,11 @@ vn_image_store_format_in_cache(
*((VkSamplerYcbcrConversionImageFormatProperties *)src);
break;
}
case VK_STRUCTURE_TYPE_FILTER_CUBIC_IMAGE_VIEW_IMAGE_FORMAT_PROPERTIES_EXT: {
cache_entry->properties.filter_cubic =
*((VkFilterCubicImageViewImageFormatPropertiesEXT *)src);
break;
}
default:
unreachable("unexpected format props pNext");
}

View File

@@ -32,6 +32,7 @@ struct vn_image_format_properties {
VkHostImageCopyDevicePerformanceQuery host_copy;
VkImageCompressionPropertiesEXT compression;
VkSamplerYcbcrConversionImageFormatProperties ycbcr_conversion;
VkFilterCubicImageViewImageFormatPropertiesEXT filter_cubic;
};
struct vn_image_format_cache_entry {