aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorJohn Zulauf <jzulauf@lunarg.com>2018-03-30 14:51:59 -0600
committerjzulauf-lunarg <32470354+jzulauf-lunarg@users.noreply.github.com>2018-04-03 16:35:29 -0600
commit856d773b0e67e13848defe49109300315527ea0f (patch)
tree9aa15bd95e34939488974271598e4d60ff02983a /scripts
parent874651452c6fd4e576729aee5061388a389de4fe (diff)
downloadusermoji-856d773b0e67e13848defe49109300315527ea0f.tar.xz
layers: Add correct validation for apiVersion
Update and correct validation of passed apiVersion for 1.1 specified behavior. Instances with apiVersion > 1.1 will be validated as 1.1 instances (and warn). Instances with apiVersions < 0 and < 1.0 will be validated as 1.0 instances and generate an error. Instances with missing or 0 apiVersions will be treated as 1.0 instances. LOGCONSOLE warning converted to log_msg warning. Change-Id: I2debb6175cf094918fc86cdea2973ddae9479a0b
Diffstat (limited to 'scripts')
-rw-r--r--scripts/helper_file_generator.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/scripts/helper_file_generator.py b/scripts/helper_file_generator.py
index 794864d9..ba2f14a9 100644
--- a/scripts/helper_file_generator.py
+++ b/scripts/helper_file_generator.py
@@ -515,10 +515,7 @@ class HelperFileOutputGenerator(OutputGenerator):
struct += '\n'
if type == 'Instance':
struct += ' uint32_t NormalizeApiVersion(uint32_t specified_version) {\n'
- struct += ' uint32_t api_version = specified_version & ~VK_VERSION_PATCH(~0);\n'
- struct += ' if (!(api_version == VK_API_VERSION_1_0) && !(api_version == VK_API_VERSION_1_1)) {\n'
- struct += ' api_version = VK_API_VERSION_1_1;\n'
- struct += ' }\n'
+ struct += ' uint32_t api_version = (specified_version < VK_API_VERSION_1_1) ? VK_API_VERSION_1_0 : VK_API_VERSION_1_1;\n'
struct += ' return api_version;\n'
struct += ' }\n'
struct += '\n'