hwcontext_vulkan: disable descriptor buffer extension on Intel

Temporary workaround. Will be replaced with a version check once a fix is
in the works and a known next version for Mesa with a fix is known.
This commit is contained in:
Lynne
2025-04-12 06:22:24 +00:00
parent 79ff1f21c4
commit a1137f9214

View File

@ -114,6 +114,7 @@ typedef struct VulkanDevicePriv {
VkPhysicalDeviceProperties2 props;
VkPhysicalDeviceMemoryProperties mprops;
VkPhysicalDeviceExternalMemoryHostPropertiesEXT hprops;
VkPhysicalDeviceDriverProperties dprops;
/* Opaque FD external semaphore properties */
VkExternalSemaphoreProperties ext_sem_props_opaque;
@ -773,6 +774,11 @@ static int check_extensions(AVHWDeviceContext *ctx, int dev, AVDictionary *opts,
tstr = optional_exts[i].name;
found = 0;
/* Intel has had a bad descriptor buffer implementation for a while */
if (p->dprops.driverID == VK_DRIVER_ID_INTEL_OPEN_SOURCE_MESA &&
!strcmp(tstr, VK_EXT_DESCRIPTOR_BUFFER_EXTENSION_NAME))
continue;
if (dev &&
((debug_mode == FF_VULKAN_DEBUG_VALIDATE) ||
(debug_mode == FF_VULKAN_DEBUG_PRINTF) ||
@ -1199,6 +1205,7 @@ static int find_device(AVHWDeviceContext *ctx, VulkanDeviceSelection *select)
VkPhysicalDevice *devices = NULL;
VkPhysicalDeviceIDProperties *idp = NULL;
VkPhysicalDeviceProperties2 *prop = NULL;
VkPhysicalDeviceDriverProperties *driver_prop = NULL;
VkPhysicalDeviceDrmPropertiesEXT *drm_prop = NULL;
ret = vk->EnumeratePhysicalDevices(hwctx->inst, &num, NULL);
@ -1231,6 +1238,12 @@ static int find_device(AVHWDeviceContext *ctx, VulkanDeviceSelection *select)
goto end;
}
driver_prop = av_calloc(num, sizeof(*driver_prop));
if (!driver_prop) {
err = AVERROR(ENOMEM);
goto end;
}
if (p->vkctx.extensions & FF_VK_EXT_DEVICE_DRM) {
drm_prop = av_calloc(num, sizeof(*drm_prop));
if (!drm_prop) {
@ -1243,8 +1256,10 @@ static int find_device(AVHWDeviceContext *ctx, VulkanDeviceSelection *select)
for (int i = 0; i < num; i++) {
if (p->vkctx.extensions & FF_VK_EXT_DEVICE_DRM) {
drm_prop[i].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRM_PROPERTIES_EXT;
idp[i].pNext = &drm_prop[i];
driver_prop[i].pNext = &drm_prop[i];
}
driver_prop[i].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES;
idp[i].pNext = &driver_prop[i];
idp[i].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ID_PROPERTIES;
prop[i].sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2;
prop[i].pNext = &idp[i];
@ -1334,12 +1349,17 @@ end:
vk_dev_type(prop[choice].properties.deviceType),
prop[choice].properties.deviceID);
hwctx->phys_dev = devices[choice];
p->props = prop[choice];
p->props.pNext = NULL;
p->dprops = driver_prop[choice];
p->dprops.pNext = NULL;
}
av_free(devices);
av_free(prop);
av_free(idp);
av_free(drm_prop);
av_free(driver_prop);
return err;
}