diff --git a/scripts/generators/vulkaninfo_generator.py b/scripts/generators/vulkaninfo_generator.py index 4ff9c9d77..f2f9bc1ea 100644 --- a/scripts/generators/vulkaninfo_generator.py +++ b/scripts/generators/vulkaninfo_generator.py @@ -460,6 +460,21 @@ def genVideoProfileUtils(self): result.push_back(std::move(profile)); } }; + + auto add_extended_flags = [&](void **ppnext, video_format_properties_chain* format_properties_chain) { + if (format_properties_chain != nullptr && + gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_EXTENDED_FLAGS_EXTENSION_NAME)) { + format_properties_chain->ImageCreateFlags2CreateInfoKHR.sType = + VK_STRUCTURE_TYPE_IMAGE_CREATE_FLAGS_2_CREATE_INFO_KHR; + *ppnext = &format_properties_chain->ImageCreateFlags2CreateInfoKHR; + ppnext = &format_properties_chain->ImageCreateFlags2CreateInfoKHR.pNext; + format_properties_chain->ImageUsageFlags2CreateInfoKHR.sType = + VK_STRUCTURE_TYPE_IMAGE_USAGE_FLAGS_2_CREATE_INFO_KHR; + *ppnext = &format_properties_chain->ImageUsageFlags2CreateInfoKHR; + ppnext = &format_properties_chain->ImageUsageFlags2CreateInfoKHR.pNext; + } + return ppnext; + }; ''') # Generate individual video profiles from the video codec metadata @@ -562,6 +577,7 @@ def genVideoProfileUtils(self): # Callback to create video format properties chain out.append(f'{" " * 28}[&](void **ppnext) -> std::unique_ptr {{\n') out.append(f'{" " * 28} auto format_properties_chain = std::make_unique();\n') + out.append(f'{" " * 28} ppnext = add_extended_flags(ppnext, format_properties_chain.get());\n') for formatProps in format.properties: structDef = self.vk.structs[formatProps] out.append(self.AddGuardHeader(structDef)) diff --git a/vulkaninfo/generated/vulkaninfo.hpp b/vulkaninfo/generated/vulkaninfo.hpp index 8bae190f3..28dab747d 100644 --- a/vulkaninfo/generated/vulkaninfo.hpp +++ b/vulkaninfo/generated/vulkaninfo.hpp @@ -13186,6 +13186,18 @@ std::vector> enumerate_supported_video_profiles } }; + auto add_extended_flags = [&](void **ppnext, video_format_properties_chain *format_properties_chain) { + if (format_properties_chain != nullptr && gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_EXTENDED_FLAGS_EXTENSION_NAME)) { + format_properties_chain->ImageCreateFlags2CreateInfoKHR.sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_FLAGS_2_CREATE_INFO_KHR; + *ppnext = &format_properties_chain->ImageCreateFlags2CreateInfoKHR; + ppnext = &format_properties_chain->ImageCreateFlags2CreateInfoKHR.pNext; + format_properties_chain->ImageUsageFlags2CreateInfoKHR.sType = VK_STRUCTURE_TYPE_IMAGE_USAGE_FLAGS_2_CREATE_INFO_KHR; + *ppnext = &format_properties_chain->ImageUsageFlags2CreateInfoKHR; + ppnext = &format_properties_chain->ImageUsageFlags2CreateInfoKHR.pNext; + } + return ppnext; + }; + if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_VIDEO_DECODE_H264_EXTENSION_NAME)) { const std::string codec_name = "H.264 Decode"; @@ -13251,6 +13263,7 @@ std::vector> enumerate_supported_video_profiles }, [&](void **ppnext) -> std::unique_ptr { auto format_properties_chain = std::make_unique(); + ppnext = add_extended_flags(ppnext, format_properties_chain.get()); return format_properties_chain; }, }, @@ -13263,6 +13276,7 @@ std::vector> enumerate_supported_video_profiles }, [&](void **ppnext) -> std::unique_ptr { auto format_properties_chain = std::make_unique(); + ppnext = add_extended_flags(ppnext, format_properties_chain.get()); return format_properties_chain; }, }, @@ -13472,6 +13486,7 @@ std::vector> enumerate_supported_video_profiles }, [&](void **ppnext) -> std::unique_ptr { auto format_properties_chain = std::make_unique(); + ppnext = add_extended_flags(ppnext, format_properties_chain.get()); return format_properties_chain; }, }, @@ -13484,6 +13499,7 @@ std::vector> enumerate_supported_video_profiles }, [&](void **ppnext) -> std::unique_ptr { auto format_properties_chain = std::make_unique(); + ppnext = add_extended_flags(ppnext, format_properties_chain.get()); return format_properties_chain; }, }, @@ -13584,6 +13600,7 @@ std::vector> enumerate_supported_video_profiles }, [&](void **ppnext) -> std::unique_ptr { auto format_properties_chain = std::make_unique(); + ppnext = add_extended_flags(ppnext, format_properties_chain.get()); return format_properties_chain; }, }, @@ -13596,6 +13613,7 @@ std::vector> enumerate_supported_video_profiles }, [&](void **ppnext) -> std::unique_ptr { auto format_properties_chain = std::make_unique(); + ppnext = add_extended_flags(ppnext, format_properties_chain.get()); return format_properties_chain; }, }, @@ -13687,6 +13705,7 @@ std::vector> enumerate_supported_video_profiles }, [&](void **ppnext) -> std::unique_ptr { auto format_properties_chain = std::make_unique(); + ppnext = add_extended_flags(ppnext, format_properties_chain.get()); return format_properties_chain; }, }, @@ -13699,6 +13718,7 @@ std::vector> enumerate_supported_video_profiles }, [&](void **ppnext) -> std::unique_ptr { auto format_properties_chain = std::make_unique(); + ppnext = add_extended_flags(ppnext, format_properties_chain.get()); return format_properties_chain; }, }, @@ -13857,6 +13877,7 @@ std::vector> enumerate_supported_video_profiles }, [&](void **ppnext) -> std::unique_ptr { auto format_properties_chain = std::make_unique(); + ppnext = add_extended_flags(ppnext, format_properties_chain.get()); return format_properties_chain; }, }, @@ -13869,6 +13890,7 @@ std::vector> enumerate_supported_video_profiles }, [&](void **ppnext) -> std::unique_ptr { auto format_properties_chain = std::make_unique(); + ppnext = add_extended_flags(ppnext, format_properties_chain.get()); return format_properties_chain; }, }, @@ -13894,6 +13916,7 @@ std::vector> enumerate_supported_video_profiles }, [&](void **ppnext) -> std::unique_ptr { auto format_properties_chain = std::make_unique(); + ppnext = add_extended_flags(ppnext, format_properties_chain.get()); if (format_properties_chain != nullptr) { if (gpu.CheckPhysicalDeviceExtensionIncluded( VK_KHR_VIDEO_ENCODE_QUANTIZATION_MAP_EXTENSION_NAME)) { @@ -13928,6 +13951,7 @@ std::vector> enumerate_supported_video_profiles }, [&](void **ppnext) -> std::unique_ptr { auto format_properties_chain = std::make_unique(); + ppnext = add_extended_flags(ppnext, format_properties_chain.get()); if (format_properties_chain != nullptr) { if (gpu.CheckPhysicalDeviceExtensionIncluded( VK_KHR_VIDEO_ENCODE_QUANTIZATION_MAP_EXTENSION_NAME)) { @@ -14088,6 +14112,7 @@ std::vector> enumerate_supported_video_profiles }, [&](void **ppnext) -> std::unique_ptr { auto format_properties_chain = std::make_unique(); + ppnext = add_extended_flags(ppnext, format_properties_chain.get()); return format_properties_chain; }, }, @@ -14100,6 +14125,7 @@ std::vector> enumerate_supported_video_profiles }, [&](void **ppnext) -> std::unique_ptr { auto format_properties_chain = std::make_unique(); + ppnext = add_extended_flags(ppnext, format_properties_chain.get()); return format_properties_chain; }, }, @@ -14125,6 +14151,7 @@ std::vector> enumerate_supported_video_profiles }, [&](void **ppnext) -> std::unique_ptr { auto format_properties_chain = std::make_unique(); + ppnext = add_extended_flags(ppnext, format_properties_chain.get()); if (format_properties_chain != nullptr) { if (gpu.CheckPhysicalDeviceExtensionIncluded( VK_KHR_VIDEO_ENCODE_QUANTIZATION_MAP_EXTENSION_NAME)) { @@ -14169,6 +14196,7 @@ std::vector> enumerate_supported_video_profiles }, [&](void **ppnext) -> std::unique_ptr { auto format_properties_chain = std::make_unique(); + ppnext = add_extended_flags(ppnext, format_properties_chain.get()); if (format_properties_chain != nullptr) { if (gpu.CheckPhysicalDeviceExtensionIncluded( VK_KHR_VIDEO_ENCODE_QUANTIZATION_MAP_EXTENSION_NAME)) { @@ -14325,6 +14353,7 @@ std::vector> enumerate_supported_video_profiles }, [&](void **ppnext) -> std::unique_ptr { auto format_properties_chain = std::make_unique(); + ppnext = add_extended_flags(ppnext, format_properties_chain.get()); return format_properties_chain; }, }, @@ -14337,6 +14366,7 @@ std::vector> enumerate_supported_video_profiles }, [&](void **ppnext) -> std::unique_ptr { auto format_properties_chain = std::make_unique(); + ppnext = add_extended_flags(ppnext, format_properties_chain.get()); return format_properties_chain; }, }, @@ -14362,6 +14392,7 @@ std::vector> enumerate_supported_video_profiles }, [&](void **ppnext) -> std::unique_ptr { auto format_properties_chain = std::make_unique(); + ppnext = add_extended_flags(ppnext, format_properties_chain.get()); if (format_properties_chain != nullptr) { if (gpu.CheckPhysicalDeviceExtensionIncluded( VK_KHR_VIDEO_ENCODE_QUANTIZATION_MAP_EXTENSION_NAME)) { @@ -14406,6 +14437,7 @@ std::vector> enumerate_supported_video_profiles }, [&](void **ppnext) -> std::unique_ptr { auto format_properties_chain = std::make_unique(); + ppnext = add_extended_flags(ppnext, format_properties_chain.get()); if (format_properties_chain != nullptr) { if (gpu.CheckPhysicalDeviceExtensionIncluded( VK_KHR_VIDEO_ENCODE_QUANTIZATION_MAP_EXTENSION_NAME)) {