Skip to content

Commit

Permalink
profiles: Update to header 260
Browse files Browse the repository at this point in the history
  • Loading branch information
ziga-lunarg committed Aug 2, 2023
1 parent 89d7d34 commit 1409178
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 4 deletions.
32 changes: 32 additions & 0 deletions scripts/gen_profiles_layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -932,6 +932,22 @@ class JsonLoader {
}
return count;
}
int GetArray(const Json::Value &parent, const std::string &member, const char *name, VkImageLayout *dest, bool not_modifiable) {
if (member != name) {
return -1;
}
const Json::Value value = parent[name];
if (value.type() != Json::arrayValue) {
return -1;
}
const int count = static_cast<int>(value.size());
for (int i = 0; i < count; ++i) {
dest[i] = StringToImageLayout(value[i].asCString());
}
return count;
}
'''

JSON_LOADER_NON_GENERATED = '''
Expand Down Expand Up @@ -2776,6 +2792,8 @@ def generate_helpers(self):
gen += self.generate_format_to_string(registry.enums['VkFormat'].values, registry.enums['VkFormat'].aliasValues)
gen += self.generate_string_to_format(registry.enums['VkFormat'].values)

gen += self.generate_string_to_image_layout(registry.enums['VkImageLayout'].values)

gen += self.generate_string_to_uint(('VkToolPurposeFlagBits', 'VkSampleCountFlagBits', 'VkResolveModeFlagBits', 'VkShaderStageFlagBits', 'VkSubgroupFeatureFlagBits', 'VkShaderFloatControlsIndependence', 'VkPointClippingBehavior', 'VkOpticalFlowGridSizeFlagBitsNV', 'VkQueueFlagBits', 'VkMemoryDecompressionMethodFlagBitsNV'), registry.enums)

gen += self.generate_string_to_flag_functions(('VkToolPurposeFlags', 'VkFormatFeatureFlags', 'VkQueueFlags', 'VkQueueGlobalPriorityKHR', 'VkVideoCodecOperationFlagsKHR', 'VkPipelineStageFlags', 'VkPipelineStageFlags2', 'VkFormatFeatureFlags2'))
Expand Down Expand Up @@ -3655,6 +3673,20 @@ def generate_string_to_format(self, formats):
gen += '}\n'
return gen

def generate_string_to_image_layout(self, imageLayouts):
gen = '\nstatic VkImageLayout StringToImageLayout(const std::string &input_value) {\n'
gen += ' static const std::unordered_map<std::string, VkImageLayout> map = {\n'
for imageLayout in imageLayouts:
gen += ' {\"' + imageLayout + '\", ' + imageLayout + '},\n'
gen += ' };\n'
gen += ' const auto it = map.find(input_value);\n'
gen += ' if (it != map.end()) {\n'
gen += ' return it->second;\n'
gen += ' }\n'
gen += ' return VK_IMAGE_LAYOUT_UNDEFINED;\n'
gen += '}\n'
return gen

if __name__ == '__main__':
parser = argparse.ArgumentParser()

Expand Down
3 changes: 3 additions & 0 deletions scripts/gen_profiles_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ class ProfileGenerator():
i = 1
skipped_features = []
skipped_members = ["sType", "pNext", "physicalDevices", "driverID"]
skipped_properties_structs = ["VkPhysicalDeviceHostImageCopyPropertiesEXT"]

def generate_profile(self, outProfile, registry):
with open(outProfile, 'w') as f:
Expand Down Expand Up @@ -283,6 +284,8 @@ def gen_properties(self, extensions, registry):
for name, value in registry.structs.items():
if ('VkPhysicalDeviceProperties2' in value.extends and value.definedByExtensions):
self.test_values[name] = dict()
if (name in self.skipped_properties_structs):
continue
if first:
first = False
else:
Expand Down
8 changes: 4 additions & 4 deletions scripts/known_good.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
"sub_dir": "Vulkan-Headers",
"build_dir": "Vulkan-Headers/build",
"install_dir": "Vulkan-Headers/build/install",
"commit": "v1.3.257"
"commit": "v1.3.259"
},
{
"name": "Vulkan-Utility-Libraries",
"url": "https://github.com/KhronosGroup/Vulkan-Utility-Libraries.git",
"sub_dir": "Vulkan-Utility-Libraries",
"build_dir": "Vulkan-Utility-Libraries/build",
"install_dir": "Vulkan-Utility-Libraries/build/install",
"commit": "v1.3.257",
"commit": "v1.3.259",
"deps": [
{
"var_name": "VULKAN_HEADERS_INSTALL_DIR",
Expand All @@ -28,7 +28,7 @@
"sub_dir": "Vulkan-Loader",
"build_dir": "Vulkan-Loader/build",
"install_dir": "Vulkan-Loader/build/install",
"commit": "v1.3.257",
"commit": "v1.3.259",
"deps": [
{
"var_name": "VULKAN_HEADERS_INSTALL_DIR",
Expand All @@ -49,7 +49,7 @@
"sub_dir": "Vulkan-ValidationLayers",
"build_dir": "Vulkan-ValidationLayers/build",
"install_dir": "Vulkan-ValidationLayers/build/install",
"commit": "v1.3.257",
"commit": "v1.3.259",
"deps": [
{
"var_name": "VULKAN_HEADERS_INSTALL_DIR",
Expand Down

0 comments on commit 1409178

Please sign in to comment.