tu: VkExternalImageFormatProperties is optional

..even if external image info has valid external handles.

Fixes: 26380b3a9f ("turnip: Add driver skeleton (v2)")

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14730>
(cherry picked from commit 96acd0933e)
This commit is contained in:
Yiwei Zhang 2022-01-26 07:53:59 +00:00 committed by Eric Engestrom
parent 343f9f52a1
commit a987828e6b
2 changed files with 11 additions and 8 deletions

View file

@ -4621,7 +4621,7 @@
"description": "tu: VkExternalImageFormatProperties is optional",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "26380b3a9f8fd513dc4da86798f3c15191914fc2"
},

View file

@ -484,7 +484,7 @@ tu_get_external_image_format_properties(
const struct tu_physical_device *physical_device,
const VkPhysicalDeviceImageFormatInfo2 *pImageFormatInfo,
VkExternalMemoryHandleTypeFlagBits handleType,
VkExternalMemoryProperties *external_properties)
VkExternalImageFormatProperties *external_properties)
{
VkExternalMemoryFeatureFlagBits flags = 0;
VkExternalMemoryHandleTypeFlags export_flags = 0;
@ -526,11 +526,14 @@ tu_get_external_image_format_properties(
handleType);
}
*external_properties = (VkExternalMemoryProperties) {
.externalMemoryFeatures = flags,
.exportFromImportedHandleTypes = export_flags,
.compatibleHandleTypes = compat_flags,
};
if (external_properties) {
external_properties->externalMemoryProperties =
(VkExternalMemoryProperties) {
.externalMemoryFeatures = flags,
.exportFromImportedHandleTypes = export_flags,
.compatibleHandleTypes = compat_flags,
};
}
return VK_SUCCESS;
}
@ -597,7 +600,7 @@ tu_GetPhysicalDeviceImageFormatProperties2(
if (external_info && external_info->handleType != 0) {
result = tu_get_external_image_format_properties(
physical_device, base_info, external_info->handleType,
&external_props->externalMemoryProperties);
external_props);
if (result != VK_SUCCESS)
goto fail;
}