From 856d773b0e67e13848defe49109300315527ea0f Mon Sep 17 00:00:00 2001 From: John Zulauf Date: Fri, 30 Mar 2018 14:51:59 -0600 Subject: 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 --- scripts/helper_file_generator.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'scripts') 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' -- cgit v1.2.3