Skip to content

Commit

Permalink
vulkaninfo: Fix promoted structure exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
ziga-lunarg committed Jan 5, 2024
1 parent e21dc3d commit 9078b02
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 19 deletions.
10 changes: 8 additions & 2 deletions scripts/vulkaninfo_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@
'VkSurfaceCapabilities2KHR', 'VkSurfaceCapabilities2EXT']
# don't generate these structures
STRUCT_BLACKLIST = ['VkVideoProfileListInfoKHR', 'VkVideoProfileInfoKHR', 'VkDrmFormatModifierPropertiesListEXT', 'VkDrmFormatModifierPropertiesEXT', 'VkDrmFormatModifierPropertiesList2EXT']
# These structures are only used in version 1.1, otherwise they are included in the promoted structs
STRUCT_1_1_LIST = ['VkPhysicalDeviceProtectedMemoryFeatures', 'VkPhysicalDeviceShaderDrawParametersFeatures', 'VkPhysicalDeviceSubgroupProperties', 'VkPhysicalDeviceProtectedMemoryProperties']

# generate these structures such that they only print when not in json mode (as json wants them separate)
PORTABILITY_STRUCTS = ['VkPhysicalDevicePortabilitySubsetFeaturesKHR', 'VkPhysicalDevicePortabilitySubsetPropertiesKHR']
Expand Down Expand Up @@ -801,7 +803,9 @@ def PrintChainStruct(listName, structures, all_structures, chain_details, extTyp
else:
assert False, 'Should never get here'
if has_version:
if has_printed_condition:
if s.name in STRUCT_1_1_LIST:
out += f'{version_desc} == {version.constant}'
elif has_printed_condition:
out += f')\n && {version_desc} < {version.constant}'
else:
out += f'{version_desc} >= {version.constant}'
Expand Down Expand Up @@ -891,7 +895,9 @@ def PrintChainStruct(listName, structures, all_structures, chain_details, extTyp
else:
assert False, 'Should never get here'
if has_version:
if has_printed_condition:
if s.name in STRUCT_1_1_LIST:
out += f'{version_desc} == {version.constant}'
elif has_printed_condition:
out += f') &&\n {version_desc} < {version.constant}'
else:
out += f'{version_desc} >= {version.constant}'
Expand Down
16 changes: 8 additions & 8 deletions vulkaninfo/generated/vulkaninfo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3495,7 +3495,7 @@ struct phys_device_props2_chain {
if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_PORTABILITY_SUBSET_EXTENSION_NAME))
chain_members.push_back(reinterpret_cast<VkBaseOutStructure*>(&PhysicalDevicePortabilitySubsetPropertiesKHR));
#endif // VK_ENABLE_BETA_EXTENSIONS
if (gpu.api_version >= VK_API_VERSION_1_1)
if (gpu.api_version == VK_API_VERSION_1_1)
chain_members.push_back(reinterpret_cast<VkBaseOutStructure*>(&PhysicalDeviceProtectedMemoryProperties));
if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_PROVOKING_VERTEX_EXTENSION_NAME))
chain_members.push_back(reinterpret_cast<VkBaseOutStructure*>(&PhysicalDeviceProvokingVertexPropertiesEXT));
Expand All @@ -3519,7 +3519,7 @@ struct phys_device_props2_chain {
chain_members.push_back(reinterpret_cast<VkBaseOutStructure*>(&PhysicalDeviceShaderObjectPropertiesEXT));
if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_SHADER_TILE_IMAGE_EXTENSION_NAME))
chain_members.push_back(reinterpret_cast<VkBaseOutStructure*>(&PhysicalDeviceShaderTileImagePropertiesEXT));
if (gpu.api_version >= VK_API_VERSION_1_1)
if (gpu.api_version == VK_API_VERSION_1_1)
chain_members.push_back(reinterpret_cast<VkBaseOutStructure*>(&PhysicalDeviceSubgroupProperties));
if ((gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_SUBGROUP_SIZE_CONTROL_EXTENSION_NAME))
&& gpu.api_version < VK_API_VERSION_1_3)
Expand Down Expand Up @@ -3796,7 +3796,7 @@ void chain_iterator_phys_device_props2(Printer &p, AppInstance &inst, AppGpu &gp
}
#endif // VK_ENABLE_BETA_EXTENSIONS
if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_PROPERTIES &&
(gpu.api_version >= VK_API_VERSION_1_1)) {
(gpu.api_version == VK_API_VERSION_1_1)) {
VkPhysicalDeviceProtectedMemoryProperties* props = (VkPhysicalDeviceProtectedMemoryProperties*)structure;
DumpVkPhysicalDeviceProtectedMemoryProperties(p, "VkPhysicalDeviceProtectedMemoryProperties", *props);
p.AddNewline();
Expand Down Expand Up @@ -3864,7 +3864,7 @@ void chain_iterator_phys_device_props2(Printer &p, AppInstance &inst, AppGpu &gp
p.AddNewline();
}
if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES &&
(gpu.api_version >= VK_API_VERSION_1_1)) {
(gpu.api_version == VK_API_VERSION_1_1)) {
VkPhysicalDeviceSubgroupProperties* props = (VkPhysicalDeviceSubgroupProperties*)structure;
DumpVkPhysicalDeviceSubgroupProperties(p, "VkPhysicalDeviceSubgroupProperties", *props);
p.AddNewline();
Expand Down Expand Up @@ -4389,7 +4389,7 @@ struct phys_device_features2_chain {
if ((gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_PRIVATE_DATA_EXTENSION_NAME))
&& gpu.api_version < VK_API_VERSION_1_3)
chain_members.push_back(reinterpret_cast<VkBaseOutStructure*>(&PhysicalDevicePrivateDataFeatures));
if (gpu.api_version >= VK_API_VERSION_1_1)
if (gpu.api_version == VK_API_VERSION_1_1)
chain_members.push_back(reinterpret_cast<VkBaseOutStructure*>(&PhysicalDeviceProtectedMemoryFeatures));
if (gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_PROVOKING_VERTEX_EXTENSION_NAME))
chain_members.push_back(reinterpret_cast<VkBaseOutStructure*>(&PhysicalDeviceProvokingVertexFeaturesEXT));
Expand Down Expand Up @@ -4429,7 +4429,7 @@ struct phys_device_features2_chain {
if ((gpu.CheckPhysicalDeviceExtensionIncluded(VK_EXT_SHADER_DEMOTE_TO_HELPER_INVOCATION_EXTENSION_NAME))
&& gpu.api_version < VK_API_VERSION_1_3)
chain_members.push_back(reinterpret_cast<VkBaseOutStructure*>(&PhysicalDeviceShaderDemoteToHelperInvocationFeatures));
if (gpu.api_version >= VK_API_VERSION_1_1)
if (gpu.api_version == VK_API_VERSION_1_1)
chain_members.push_back(reinterpret_cast<VkBaseOutStructure*>(&PhysicalDeviceShaderDrawParametersFeatures));
if ((gpu.CheckPhysicalDeviceExtensionIncluded(VK_KHR_SHADER_FLOAT16_INT8_EXTENSION_NAME))
&& gpu.api_version < VK_API_VERSION_1_2)
Expand Down Expand Up @@ -4995,7 +4995,7 @@ void chain_iterator_phys_device_features2(Printer &p, AppGpu &gpu, void * place)
p.AddNewline();
}
if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROTECTED_MEMORY_FEATURES &&
(gpu.api_version >= VK_API_VERSION_1_1)) {
(gpu.api_version == VK_API_VERSION_1_1)) {
VkPhysicalDeviceProtectedMemoryFeatures* props = (VkPhysicalDeviceProtectedMemoryFeatures*)structure;
DumpVkPhysicalDeviceProtectedMemoryFeatures(p, "VkPhysicalDeviceProtectedMemoryFeatures", *props);
p.AddNewline();
Expand Down Expand Up @@ -5102,7 +5102,7 @@ void chain_iterator_phys_device_features2(Printer &p, AppGpu &gpu, void * place)
p.AddNewline();
}
if (structure->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DRAW_PARAMETERS_FEATURES &&
(gpu.api_version >= VK_API_VERSION_1_1)) {
(gpu.api_version == VK_API_VERSION_1_1)) {
VkPhysicalDeviceShaderDrawParametersFeatures* props = (VkPhysicalDeviceShaderDrawParametersFeatures*)structure;
DumpVkPhysicalDeviceShaderDrawParametersFeatures(p, gpu.api_version >= VK_API_VERSION_1_1 ?"VkPhysicalDeviceShaderDrawParametersFeatures":"VkPhysicalDeviceShaderDrawParameterFeatures", *props);
p.AddNewline();
Expand Down
18 changes: 9 additions & 9 deletions windows-runtime-installer/VulkanRT-License.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Copyright (c) 2015-2023 The Khronos Group Inc.
Copyright (c) 2015-2023 LunarG, Inc.
Copyright (c) 2015-2023 Valve Corporation
Copyright (c) 2015-2024 The Khronos Group Inc.
Copyright (c) 2015-2024 LunarG, Inc.
Copyright (c) 2015-2024 Valve Corporation

The Vulkan Runtime is comprised of 100% open-source components (MIT, and
Apache 2.0). The text of such licenses is included below along with the
Expand Down Expand Up @@ -30,9 +30,9 @@ under the License.
============================MIT============================

Copyright (c) 2009 Dave Gamble
Copyright (c) 2015-2023 The Khronos Group Inc.
Copyright (c) 2015-2023 Valve Corporation
Copyright (c) 2015-2023 LunarG, Inc.
Copyright (c) 2015-2024 The Khronos Group Inc.
Copyright (c) 2015-2024 Valve Corporation
Copyright (c) 2015-2024 LunarG, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -55,9 +55,9 @@ THE SOFTWARE.
============================MIT============================

Copyright (c) 2014 joseph werle <joseph.werle@gmail.com>
Copyright (c) 2015-2023 The Khronos Group Inc.
Copyright (c) 2015-2023 Valve Corporation
Copyright (c) 2015-2023 LunarG, Inc.
Copyright (c) 2015-2024 The Khronos Group Inc.
Copyright (c) 2015-2024 Valve Corporation
Copyright (c) 2015-2024 LunarG, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and/or associated documentation files (the "Materials"), to
Expand Down

0 comments on commit 9078b02

Please sign in to comment.