layers: Initial codegen of unique error enums
authorTobin Ehlis <tobine@google.com>
Wed, 5 Oct 2016 23:18:15 +0000 (17:18 -0600)
committerTobin Ehlis <tobine@google.com>
Thu, 6 Oct 2016 13:45:21 +0000 (07:45 -0600)
commit555a3548aac7e04b3da88b711c20057a10ca4640
tree2f8c947135b144ea2992346386230eb98134e090
parent8ce76667f3ad2a25adc25c3d767f347cc6f8f6dd
layers: Initial codegen of unique error enums

This is the initial commit of spec.py script that's used to generate a header
and database file that contain unique error enums per valid usage line in the
spec.

The basic usage is just "python spec.py" which will write out a header file to
"vk_validation_error_messages.h" that contains unique error enum values for
each valid usage line in the current spec that's online at
https://www.khronos.org/registry/vulkan/specs/1.0/xhtml/vkspec.html

The header also contains validation_error_map with unique enum values as keys
that map to customized output messages for each validation error.

Updated one check to use the new model in core_validation.

The database file contains an enum value and error message on each line, as well
as fields indicating if the enum has been implemented in code and the testname
for a layer validation test that verifies that particular check. Initially the
implemented fields are set to 'U' and testname set to 'Unknown' to indicate that
they haven't yet been checked. Will be updated manually as the code is scrubbed
and new error enums are added.

When updating the header as the spec changes, the "-update" option to spec.py
will pull the database file and use it as a baseline reference to compare against
the updated spec. The script will attempt to keep errors with same message to have
the same error enum. When it's unsure if messages are updated or new, the script
will flag errors for manual review.
layers/core_validation.cpp
layers/spec.py [new file with mode: 0644]
layers/vk_validation_error_database.txt [new file with mode: 0644]
layers/vk_validation_error_messages.h [new file with mode: 0644]