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
diff --git a/scripts/helper_file_generator.py b/scripts/helper_file_generator.py
index 794864d..ba2f14a 100644
--- a/scripts/helper_file_generator.py
+++ b/scripts/helper_file_generator.py
@@ -515,10 +515,7 @@
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'