venus: extend image format cache for host copy props

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33757>
This commit is contained in:
Yiwei Zhang 2025-02-25 00:13:06 -08:00 committed by Marge Bot
parent 2eb5a75d51
commit 036493f43d
2 changed files with 16 additions and 2 deletions

View file

@ -2233,14 +2233,13 @@ vn_image_get_image_format_key(
*
* VkAndroidHardwareBufferUsageANDROID is handled outside of the cache.
* VkFilterCubicImageViewImageFormatPropertiesEXT,
* VkHostImageCopyDevicePerformanceQueryEXT,
* VkHostImageCopyDevicePerformanceQueryEXT,
* VkTextureLODGatherFormatPropertiesAMD are not supported
*/
if (format_props->pNext) {
vk_foreach_struct_const(src, format_props->pNext) {
switch (src->sType) {
case VK_STRUCTURE_TYPE_EXTERNAL_IMAGE_FORMAT_PROPERTIES:
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:
_mesa_sha1_update(&sha1_ctx, &src->sType,
@ -2304,6 +2303,15 @@ vn_image_init_format_from_cache(
cache_entry->properties.ext_image.externalMemoryProperties;
break;
}
case VK_STRUCTURE_TYPE_HOST_IMAGE_COPY_DEVICE_PERFORMANCE_QUERY: {
VkHostImageCopyDevicePerformanceQuery *host_copy =
(VkHostImageCopyDevicePerformanceQuery *)src;
host_copy->optimalDeviceAccess =
cache_entry->properties.host_copy.optimalDeviceAccess;
host_copy->identicalMemoryLayout =
cache_entry->properties.host_copy.identicalMemoryLayout;
break;
}
case VK_STRUCTURE_TYPE_IMAGE_COMPRESSION_PROPERTIES_EXT: {
VkImageCompressionPropertiesEXT *compression =
(VkImageCompressionPropertiesEXT *)src;
@ -2386,6 +2394,11 @@ vn_image_store_format_in_cache(
*((VkExternalImageFormatProperties *)src);
break;
}
case VK_STRUCTURE_TYPE_HOST_IMAGE_COPY_DEVICE_PERFORMANCE_QUERY: {
cache_entry->properties.host_copy =
*((VkHostImageCopyDevicePerformanceQuery *)src);
break;
}
case VK_STRUCTURE_TYPE_IMAGE_COMPRESSION_PROPERTIES_EXT: {
cache_entry->properties.compression =
*((VkImageCompressionPropertiesEXT *)src);

View file

@ -29,6 +29,7 @@ struct vn_image_format_properties {
VkResult cached_result;
VkExternalImageFormatProperties ext_image;
VkHostImageCopyDevicePerformanceQuery host_copy;
VkImageCompressionPropertiesEXT compression;
VkSamplerYcbcrConversionImageFormatProperties ycbcr_conversion;
};