| @@ -100,6 +100,9 @@ typedef struct VulkanDevicePriv { · 99 unmodified lines |
| 100 | VkPhysicalDeviceOpticalFlowFeaturesNV optical_flow_features; | 100 | VkPhysicalDeviceOpticalFlowFeaturesNV optical_flow_features; |
| 101 | VkPhysicalDeviceShaderObjectFeaturesEXT shader_object_features; | 101 | VkPhysicalDeviceShaderObjectFeaturesEXT shader_object_features; |
| 102 | VkPhysicalDeviceVideoMaintenance1FeaturesKHR video_maint_1_features; | 102 | VkPhysicalDeviceVideoMaintenance1FeaturesKHR video_maint_1_features; |
| | 103 | #ifdef VK_KHR_shader_relaxed_extended_instruction |
| | 104 | VkPhysicalDeviceShaderRelaxedExtendedInstructionFeaturesKHR relaxed_extended_instr_features; |
| | 105 | #endif |
| 103 | | 106 | |
| 104 | /* Queues */ | 107 | /* Queues */ |
| 105 | pthread_mutex_t **qf_mutex; | 108 | pthread_mutex_t **qf_mutex; |
| @@ -622,6 +625,28 @@ static int check_extensions(AVHWDeviceContext *ctx, int dev, AVDictionary *opts, · 516 unmodified lines |
| 622 | } | 625 | } |
| 623 | } | 626 | } |
| 624 | | 627 | |
| | 628 | #ifdef VK_KHR_shader_relaxed_extended_instruction |
| | 629 | if (dev && debug_mode == FF_VULKAN_DEBUG_PRINTF) { |
| | 630 | tstr = VK_KHR_SHADER_RELAXED_EXTENDED_INSTRUCTION_EXTENSION_NAME; |
| | 631 | found = 0; |
| | 632 | for (int j = 0; j < sup_ext_count; j++) { |
| | 633 | if (!strcmp(tstr, sup_ext[j].extensionName)) { |
| | 634 | found = 1; |
| | 635 | break; |
| | 636 | } |
| | 637 | } |
| | 638 | if (found) { |
| | 639 | av_log(ctx, AV_LOG_VERBOSE, "Using %s extension %s\n", mod, tstr); |
| | 640 | ADD_VAL_TO_LIST(extension_names, extensions_found, tstr); |
| | 641 | } else { |
| | 642 | av_log(ctx, AV_LOG_ERROR, "Debug printf enabled, but extension \"%s\" not found!\n", |
| | 643 | tstr); |
| | 644 | err = AVERROR(EINVAL); |
| | 645 | goto fail; |
| | 646 | } |
| | 647 | #endif |
| | 648 | } |
| | 649 | |
| 625 | if (user_exts_str) { | 650 | if (user_exts_str) { |
| 626 | char *save, *token = av_strtok(user_exts_str, "+", &save); | 651 | char *save, *token = av_strtok(user_exts_str, "+", &save); |
| 627 | while (token) { | 652 | while (token) { |
| @@ -1419,9 +1444,19 @@ static int vulkan_device_create_internal(AVHWDeviceContext *ctx, · 791 unmodified lines |
| 1419 | VkPhysicalDeviceTimelineSemaphoreFeatures timeline_features = { | 1444 | VkPhysicalDeviceTimelineSemaphoreFeatures timeline_features = { |
| 1420 | .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES, | 1445 | .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES, |
| 1421 | }; | 1446 | }; |
| | 1447 | #ifdef VK_KHR_shader_relaxed_extended_instruction |
| | 1448 | VkPhysicalDeviceShaderRelaxedExtendedInstructionFeaturesKHR relaxed_extended_instr_features = { |
| | 1449 | .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_RELAXED_EXTENDED_INSTRUCTION_FEATURES_KHR, |
| | 1450 | .pNext = &timeline_features, |
| | 1451 | }; |
| | 1452 | #endif |
| 1422 | VkPhysicalDeviceVideoMaintenance1FeaturesKHR video_maint_1_features = { | 1453 | VkPhysicalDeviceVideoMaintenance1FeaturesKHR video_maint_1_features = { |
| 1423 | .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_MAINTENANCE_1_FEATURES_KHR, | 1454 | .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VIDEO_MAINTENANCE_1_FEATURES_KHR, |
| | 1455 | #ifdef VK_KHR_shader_relaxed_extended_instruction |
| | 1456 | .pNext = &relaxed_extended_instr_features, |
| | 1457 | #else |
| 1424 | .pNext = &timeline_features, | 1458 | .pNext = &timeline_features, |
| | 1459 | #endif |
| 1425 | }; | 1460 | }; |
| 1426 | VkPhysicalDeviceShaderObjectFeaturesEXT shader_object_features = { | 1461 | VkPhysicalDeviceShaderObjectFeaturesEXT shader_object_features = { |
| 1427 | .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_OBJECT_FEATURES_EXT, | 1462 | .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_OBJECT_FEATURES_EXT, |
| @@ -1535,6 +1570,10 @@ static int vulkan_device_create_internal(AVHWDeviceContext *ctx, · 107 unmodified lines |
| 1535 | | 1570 | |
| 1536 | p->shader_object_features.shaderObject = shader_object_features.shaderObject; | 1571 | p->shader_object_features.shaderObject = shader_object_features.shaderObject; |
| 1537 | | 1572 | |
| | 1573 | #ifdef VK_KHR_shader_relaxed_extended_instruction |
| | 1574 | p->relaxed_extended_instr_features.shaderRelaxedExtendedInstruction = relaxed_extended_instr_features.shaderRelaxedExtendedInstruction; |
| | 1575 | #endif |
| | 1576 | |
| 1538 | /* Find and enable extensions */ | 1577 | /* Find and enable extensions */ |
| 1539 | if ((err = check_extensions(ctx, 1, opts, &dev_info.ppEnabledExtensionNames, | 1578 | if ((err = check_extensions(ctx, 1, opts, &dev_info.ppEnabledExtensionNames, |
| 1540 | &dev_info.enabledExtensionCount, debug_mode))) { | 1579 | &dev_info.enabledExtensionCount, debug_mode))) { |