From 6bbe8811e98d1d0692e1ca3fc5ce0b4fcd4c39c8 Mon Sep 17 00:00:00 2001 From: Tobin Ehlis Date: Fri, 14 Oct 2016 18:06:16 -0600 Subject: scripts:Update spec script to include extensions Moving all of the validation error enums from the vanilla 1.0 script to the script that includes all of the extensions. Took a bit of script wizardry and lots of back and forth to get all of the new checks matching the old ones. I think everything is there from the original except for 4 layer checks (enums 1661-1664) that were all invalid errors. For reference here's the complete command line used to migrate: python spec.py -update -remap 628-619:708-671:729-689:732-692:762-722:\ 1251-1203:1253-1204:1256-1206:1258-1207:1315-1263:1320-1268:1322-1269:\ 1364-1310:1366-1311:1369-1313:1371-1314:1555-1458:1684-1584:1697-1597:\ 1960-1679,3:1945-1665,13:1963-1683,11 --- layers/spec.py | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'layers/spec.py') diff --git a/layers/spec.py b/layers/spec.py index ceb77247..91184f9b 100644 --- a/layers/spec.py +++ b/layers/spec.py @@ -37,7 +37,8 @@ db_filename = "vk_validation_error_database.txt" # can override w/ '-gendb ' option provided spec_compare = False # set to True with '-compare ' option # This is the root spec link that is used in error messages to point users to spec sections -spec_url = "https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html" +#old_spec_url = "https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html" +spec_url = "https://www.khronos.org/registry/vulkan/specs/1.0-extensions/xhtml/vkspec.html" # After the custom validation error message, this is the prefix for the standard message that includes the # spec valid usage language as well as the link to nearest section of spec to that language error_msg_prefix = "For more information refer to Vulkan Spec Section " @@ -273,16 +274,22 @@ class Specification: for enum in sorted(self.val_error_dict): ids_parsed = ids_parsed + 1 enum_list = enum.split('_') # grab sections of enum for use below - if enum in orig_db_dict: + # Any user-forced remap takes precendence + if enum_list[-1] in remap_dict: + enum_list[-1] = remap_dict[enum_list[-1]] + new_enum = "_".join(enum_list) + print "NOTE: Using user-supplied remap to force %s to be %s" % (enum, new_enum) + updated_val_error_dict[new_enum] = self.val_error_dict[enum] + elif enum in orig_db_dict: if self.val_error_dict[enum] == orig_db_dict[enum]: - #print "Exact match for enum %s" % (enum) + print "Exact match for enum %s" % (enum) # Nothing to see here if enum in updated_val_error_dict: print "ERROR: About to overwrite entry for %s" % (enum) updated_val_error_dict[enum] = self.val_error_dict[enum] elif self.val_error_dict[enum] in orig_err_to_id_dict: # Same value w/ different error id, need to anchor to original id - #print "Need to switch new id %s to original id %s" % (enum, orig_err_to_id_dict[self.val_error_dict[enum]]) + print "Need to switch new id %s to original id %s" % (enum, orig_err_to_id_dict[self.val_error_dict[enum]]) # Update id at end of new enum to be same id from original enum enum_list[-1] = orig_err_to_id_dict[self.val_error_dict[enum]].split('_')[-1] new_enum = "_".join(enum_list) @@ -297,13 +304,7 @@ class Specification: if orig_msg_list[0] == new_msg_list[0]: # Msg is same bug link has changed, keep enum & update msg print "NOTE: Found that only spec link changed for %s so keeping same id w/ new link" % (enum) updated_val_error_dict[enum] = self.val_error_dict[enum] - # Second, check if user is forcing remap here - elif enum_list[-1] in remap_dict: - enum_list[-1] = remap_dict[enum_list[-1]] - new_enum = "_".join(enum_list) - print "NOTE: Using user-supplied remap to force %s to be %s" % (enum, new_enum) - updated_val_error_dict[new_enum] = self.val_error_dict[enum] - # Finally, this seems to be a new error so need to pick it up from end of original unique ids & flag for review + # This seems to be a new error so need to pick it up from end of original unique ids & flag for review else: enum_list[-1] = "%05d" % (next_id) new_enum = "_".join(enum_list) @@ -315,7 +316,7 @@ class Specification: updated_val_error_dict[new_enum] = self.val_error_dict[enum] else: # new enum is not in orig db if self.val_error_dict[enum] in orig_err_to_id_dict: - #print "New enum %s not in orig dict, but exact error message matches original unique id %s" % (enum, orig_err_to_id_dict[self.val_error_dict[enum]]) + print "New enum %s not in orig dict, but exact error message matches original unique id %s" % (enum, orig_err_to_id_dict[self.val_error_dict[enum]]) # Update new unique_id to use original enum_list[-1] = orig_err_to_id_dict[self.val_error_dict[enum]].split('_')[-1] new_enum = "_".join(enum_list) -- cgit v1.2.3