Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions scripts/generators/vulkaninfo_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -562,6 +577,7 @@ def genVideoProfileUtils(self):
# Callback to create video format properties chain
out.append(f'{" " * 28}[&](void **ppnext) -> std::unique_ptr<video_format_properties_chain> {{\n')
out.append(f'{" " * 28} auto format_properties_chain = std::make_unique<video_format_properties_chain>();\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))
Expand Down
32 changes: 32 additions & 0 deletions vulkaninfo/generated/vulkaninfo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13186,6 +13186,18 @@ std::vector<std::unique_ptr<AppVideoProfile>> 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";

Expand Down Expand Up @@ -13251,6 +13263,7 @@ std::vector<std::unique_ptr<AppVideoProfile>> enumerate_supported_video_profiles
},
[&](void **ppnext) -> std::unique_ptr<video_format_properties_chain> {
auto format_properties_chain = std::make_unique<video_format_properties_chain>();
ppnext = add_extended_flags(ppnext, format_properties_chain.get());
return format_properties_chain;
},
},
Expand All @@ -13263,6 +13276,7 @@ std::vector<std::unique_ptr<AppVideoProfile>> enumerate_supported_video_profiles
},
[&](void **ppnext) -> std::unique_ptr<video_format_properties_chain> {
auto format_properties_chain = std::make_unique<video_format_properties_chain>();
ppnext = add_extended_flags(ppnext, format_properties_chain.get());
return format_properties_chain;
},
},
Expand Down Expand Up @@ -13472,6 +13486,7 @@ std::vector<std::unique_ptr<AppVideoProfile>> enumerate_supported_video_profiles
},
[&](void **ppnext) -> std::unique_ptr<video_format_properties_chain> {
auto format_properties_chain = std::make_unique<video_format_properties_chain>();
ppnext = add_extended_flags(ppnext, format_properties_chain.get());
return format_properties_chain;
},
},
Expand All @@ -13484,6 +13499,7 @@ std::vector<std::unique_ptr<AppVideoProfile>> enumerate_supported_video_profiles
},
[&](void **ppnext) -> std::unique_ptr<video_format_properties_chain> {
auto format_properties_chain = std::make_unique<video_format_properties_chain>();
ppnext = add_extended_flags(ppnext, format_properties_chain.get());
return format_properties_chain;
},
},
Expand Down Expand Up @@ -13584,6 +13600,7 @@ std::vector<std::unique_ptr<AppVideoProfile>> enumerate_supported_video_profiles
},
[&](void **ppnext) -> std::unique_ptr<video_format_properties_chain> {
auto format_properties_chain = std::make_unique<video_format_properties_chain>();
ppnext = add_extended_flags(ppnext, format_properties_chain.get());
return format_properties_chain;
},
},
Expand All @@ -13596,6 +13613,7 @@ std::vector<std::unique_ptr<AppVideoProfile>> enumerate_supported_video_profiles
},
[&](void **ppnext) -> std::unique_ptr<video_format_properties_chain> {
auto format_properties_chain = std::make_unique<video_format_properties_chain>();
ppnext = add_extended_flags(ppnext, format_properties_chain.get());
return format_properties_chain;
},
},
Expand Down Expand Up @@ -13687,6 +13705,7 @@ std::vector<std::unique_ptr<AppVideoProfile>> enumerate_supported_video_profiles
},
[&](void **ppnext) -> std::unique_ptr<video_format_properties_chain> {
auto format_properties_chain = std::make_unique<video_format_properties_chain>();
ppnext = add_extended_flags(ppnext, format_properties_chain.get());
return format_properties_chain;
},
},
Expand All @@ -13699,6 +13718,7 @@ std::vector<std::unique_ptr<AppVideoProfile>> enumerate_supported_video_profiles
},
[&](void **ppnext) -> std::unique_ptr<video_format_properties_chain> {
auto format_properties_chain = std::make_unique<video_format_properties_chain>();
ppnext = add_extended_flags(ppnext, format_properties_chain.get());
return format_properties_chain;
},
},
Expand Down Expand Up @@ -13857,6 +13877,7 @@ std::vector<std::unique_ptr<AppVideoProfile>> enumerate_supported_video_profiles
},
[&](void **ppnext) -> std::unique_ptr<video_format_properties_chain> {
auto format_properties_chain = std::make_unique<video_format_properties_chain>();
ppnext = add_extended_flags(ppnext, format_properties_chain.get());
return format_properties_chain;
},
},
Expand All @@ -13869,6 +13890,7 @@ std::vector<std::unique_ptr<AppVideoProfile>> enumerate_supported_video_profiles
},
[&](void **ppnext) -> std::unique_ptr<video_format_properties_chain> {
auto format_properties_chain = std::make_unique<video_format_properties_chain>();
ppnext = add_extended_flags(ppnext, format_properties_chain.get());
return format_properties_chain;
},
},
Expand All @@ -13894,6 +13916,7 @@ std::vector<std::unique_ptr<AppVideoProfile>> enumerate_supported_video_profiles
},
[&](void **ppnext) -> std::unique_ptr<video_format_properties_chain> {
auto format_properties_chain = std::make_unique<video_format_properties_chain>();
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)) {
Expand Down Expand Up @@ -13928,6 +13951,7 @@ std::vector<std::unique_ptr<AppVideoProfile>> enumerate_supported_video_profiles
},
[&](void **ppnext) -> std::unique_ptr<video_format_properties_chain> {
auto format_properties_chain = std::make_unique<video_format_properties_chain>();
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)) {
Expand Down Expand Up @@ -14088,6 +14112,7 @@ std::vector<std::unique_ptr<AppVideoProfile>> enumerate_supported_video_profiles
},
[&](void **ppnext) -> std::unique_ptr<video_format_properties_chain> {
auto format_properties_chain = std::make_unique<video_format_properties_chain>();
ppnext = add_extended_flags(ppnext, format_properties_chain.get());
return format_properties_chain;
},
},
Expand All @@ -14100,6 +14125,7 @@ std::vector<std::unique_ptr<AppVideoProfile>> enumerate_supported_video_profiles
},
[&](void **ppnext) -> std::unique_ptr<video_format_properties_chain> {
auto format_properties_chain = std::make_unique<video_format_properties_chain>();
ppnext = add_extended_flags(ppnext, format_properties_chain.get());
return format_properties_chain;
},
},
Expand All @@ -14125,6 +14151,7 @@ std::vector<std::unique_ptr<AppVideoProfile>> enumerate_supported_video_profiles
},
[&](void **ppnext) -> std::unique_ptr<video_format_properties_chain> {
auto format_properties_chain = std::make_unique<video_format_properties_chain>();
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)) {
Expand Down Expand Up @@ -14169,6 +14196,7 @@ std::vector<std::unique_ptr<AppVideoProfile>> enumerate_supported_video_profiles
},
[&](void **ppnext) -> std::unique_ptr<video_format_properties_chain> {
auto format_properties_chain = std::make_unique<video_format_properties_chain>();
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)) {
Expand Down Expand Up @@ -14325,6 +14353,7 @@ std::vector<std::unique_ptr<AppVideoProfile>> enumerate_supported_video_profiles
},
[&](void **ppnext) -> std::unique_ptr<video_format_properties_chain> {
auto format_properties_chain = std::make_unique<video_format_properties_chain>();
ppnext = add_extended_flags(ppnext, format_properties_chain.get());
return format_properties_chain;
},
},
Expand All @@ -14337,6 +14366,7 @@ std::vector<std::unique_ptr<AppVideoProfile>> enumerate_supported_video_profiles
},
[&](void **ppnext) -> std::unique_ptr<video_format_properties_chain> {
auto format_properties_chain = std::make_unique<video_format_properties_chain>();
ppnext = add_extended_flags(ppnext, format_properties_chain.get());
return format_properties_chain;
},
},
Expand All @@ -14362,6 +14392,7 @@ std::vector<std::unique_ptr<AppVideoProfile>> enumerate_supported_video_profiles
},
[&](void **ppnext) -> std::unique_ptr<video_format_properties_chain> {
auto format_properties_chain = std::make_unique<video_format_properties_chain>();
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)) {
Expand Down Expand Up @@ -14406,6 +14437,7 @@ std::vector<std::unique_ptr<AppVideoProfile>> enumerate_supported_video_profiles
},
[&](void **ppnext) -> std::unique_ptr<video_format_properties_chain> {
auto format_properties_chain = std::make_unique<video_format_properties_chain>();
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)) {
Expand Down
Loading