aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobin Ehlis <tobine@google.com>2016-12-22 13:59:42 -0700
committerTobin Ehlis <tobine@google.com>2016-12-23 14:39:34 -0700
commit94e77b44fb321bb2300ef5c9916aeaae9fe5f5e2 (patch)
treeda7f1b5a4b9c1795eaa3d6ec990e2142ab513b54
parentdc0a5f8338a57eb4cd3d1a05cb136647cdd20b3d (diff)
downloadusermoji-94e77b44fb321bb2300ef5c9916aeaae9fe5f5e2.tar.xz
scripts:Allow duplicate exceptions for some ids
Added global duplicate_exceptions list at the top of the script that is used to store any IDs that are allowed to be used multiple times in the source. An explanation comment of all exceptions should be included. Initial exception included in list is VALIDATION_ERROR_00942 which is a descriptor set update error to make sure a valid sampler is included for relevant write updates. This is re-used for two copy updates that may have invalid samplers.
-rwxr-xr-xlayers/vk_validation_stats.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/layers/vk_validation_stats.py b/layers/vk_validation_stats.py
index 2f4e478b..1868bfd6 100755
--- a/layers/vk_validation_stats.py
+++ b/layers/vk_validation_stats.py
@@ -55,7 +55,10 @@ layer_source_files = [
header_file = 'vk_validation_error_messages.h'
# TODO : Don't hardcode linux path format if we want this to run on windows
test_file = '../tests/layer_validation_tests.cpp'
-
+# List of enums that are allowed to be used more than once so don't warn on their duplicates
+duplicate_exceptions = [
+'VALIDATION_ERROR_00942', # This is a descriptor set write update error that we use for a couple copy cases as well
+]
class ValidationDatabase:
def __init__(self, filename=db_file):
@@ -320,7 +323,7 @@ def main(argv=None):
if db_imp not in val_source.enum_count_dict:
imp_not_found.append(db_imp)
for src_enum in val_source.enum_count_dict:
- if val_source.enum_count_dict[src_enum]['count'] > 1:
+ if val_source.enum_count_dict[src_enum]['count'] > 1 and src_enum not in duplicate_exceptions:
multiple_uses = True
if src_enum not in val_db.db_implemented_enums:
imp_not_claimed.append(src_enum)
@@ -342,7 +345,7 @@ def main(argv=None):
print(txt_color.yellow() + " Note that some checks are used multiple times. These may be good candidates for new valid usage spec language." + txt_color.endc())
print(txt_color.yellow() + " Here is a list of each check used multiple times with its number of uses:" + txt_color.endc())
for enum in val_source.enum_count_dict:
- if val_source.enum_count_dict[enum]['count'] > 1:
+ if val_source.enum_count_dict[enum]['count'] > 1 and enum not in duplicate_exceptions:
print(txt_color.yellow() + " %s: %d uses in file,line:" % (enum, val_source.enum_count_dict[enum]['count']) + txt_color.endc())
for file_line in val_source.enum_count_dict[enum]['file_line']:
print(txt_color.yellow() + " \t%s" % (file_line) + txt_color.endc())