build: Update to header 1.2.176

- Update known-good
- Generate source
- Fix scripts/generate_vulkan_wrapper.py
  - Handle new version macros in vulkan_core.h
  - Recognize beta/provisional platform guard
  - Skip extensions without commands

Change-Id: Ie1518aaa6fbf6ca996023fbd82f299a48759215e
diff --git a/scripts/generate_vulkan_wrapper.py b/scripts/generate_vulkan_wrapper.py
index 8dcb89f..9ff6a2c 100755
--- a/scripts/generate_vulkan_wrapper.py
+++ b/scripts/generate_vulkan_wrapper.py
@@ -385,7 +385,7 @@
 VK_KHR_16bit_storage = Extension(name='VK_KHR_16bit_storage', version=1, guard=None, commands=[
 ])
 
-VK_KHR_incremental_present = Extension(name='VK_KHR_incremental_present', version=1, guard=None, commands=[
+VK_KHR_incremental_present = Extension(name='VK_KHR_incremental_present', version=2, guard=None, commands=[
 ])
 
 VK_KHR_descriptor_update_template = Extension(name='VK_KHR_descriptor_update_template', version=1, guard=None, commands=[
@@ -587,7 +587,7 @@
     Command(name='vkCmdResolveImage2KHR', dispatch='VkCommandBuffer'),
 ])
 
-VK_EXT_debug_report = Extension(name='VK_EXT_debug_report', version=9, guard=None, commands=[
+VK_EXT_debug_report = Extension(name='VK_EXT_debug_report', version=10, guard=None, commands=[
     Command(name='vkCreateDebugReportCallbackEXT', dispatch='VkInstance'),
     Command(name='vkDestroyDebugReportCallbackEXT', dispatch='VkInstance'),
     Command(name='vkDebugReportMessageEXT', dispatch='VkInstance'),
@@ -875,7 +875,7 @@
 VK_AMD_pipeline_compiler_control = Extension(name='VK_AMD_pipeline_compiler_control', version=1, guard=None, commands=[
 ])
 
-VK_EXT_calibrated_timestamps = Extension(name='VK_EXT_calibrated_timestamps', version=1, guard=None, commands=[
+VK_EXT_calibrated_timestamps = Extension(name='VK_EXT_calibrated_timestamps', version=2, guard=None, commands=[
     Command(name='vkGetPhysicalDeviceCalibrateableTimeDomainsEXT', dispatch='VkPhysicalDevice'),
     Command(name='vkGetCalibratedTimestampsEXT', dispatch='VkDevice'),
 ])
@@ -1047,10 +1047,13 @@
     Command(name='vkDestroyIndirectCommandsLayoutNV', dispatch='VkDevice'),
 ])
 
+VK_NV_inherited_viewport_scissor = Extension(name='VK_NV_inherited_viewport_scissor', version=1, guard=None, commands=[
+])
+
 VK_EXT_texel_buffer_alignment = Extension(name='VK_EXT_texel_buffer_alignment', version=1, guard=None, commands=[
 ])
 
-VK_QCOM_render_pass_transform = Extension(name='VK_QCOM_render_pass_transform', version=1, guard=None, commands=[
+VK_QCOM_render_pass_transform = Extension(name='VK_QCOM_render_pass_transform', version=2, guard=None, commands=[
 ])
 
 VK_EXT_device_memory_report = Extension(name='VK_EXT_device_memory_report', version=2, guard=None, commands=[
@@ -1085,10 +1088,13 @@
     Command(name='vkCmdSetFragmentShadingRateEnumNV', dispatch='VkCommandBuffer'),
 ])
 
+VK_EXT_ycbcr_2plane_444_formats = Extension(name='VK_EXT_ycbcr_2plane_444_formats', version=1, guard=None, commands=[
+])
+
 VK_EXT_fragment_density_map2 = Extension(name='VK_EXT_fragment_density_map2', version=1, guard=None, commands=[
 ])
 
-VK_QCOM_rotated_copy_commands = Extension(name='VK_QCOM_rotated_copy_commands', version=0, guard=None, commands=[
+VK_QCOM_rotated_copy_commands = Extension(name='VK_QCOM_rotated_copy_commands', version=1, guard=None, commands=[
 ])
 
 VK_EXT_image_robustness = Extension(name='VK_EXT_image_robustness', version=1, guard=None, commands=[
@@ -1105,6 +1111,22 @@
 VK_VALVE_mutable_descriptor_type = Extension(name='VK_VALVE_mutable_descriptor_type', version=1, guard=None, commands=[
 ])
 
+VK_EXT_vertex_input_dynamic_state = Extension(name='VK_EXT_vertex_input_dynamic_state', version=2, guard=None, commands=[
+    Command(name='vkCmdSetVertexInputEXT', dispatch='VkCommandBuffer'),
+])
+
+VK_EXT_extended_dynamic_state2 = Extension(name='VK_EXT_extended_dynamic_state2', version=1, guard=None, commands=[
+    Command(name='vkCmdSetPatchControlPointsEXT', dispatch='VkCommandBuffer'),
+    Command(name='vkCmdSetRasterizerDiscardEnableEXT', dispatch='VkCommandBuffer'),
+    Command(name='vkCmdSetDepthBiasEnableEXT', dispatch='VkCommandBuffer'),
+    Command(name='vkCmdSetLogicOpEXT', dispatch='VkCommandBuffer'),
+    Command(name='vkCmdSetPrimitiveRestartEnableEXT', dispatch='VkCommandBuffer'),
+])
+
+VK_EXT_color_write_enable = Extension(name='VK_EXT_color_write_enable', version=1, guard=None, commands=[
+    Command(name='vkCmdSetColorWriteEnableEXT', dispatch='VkCommandBuffer'),
+])
+
 VK_KHR_acceleration_structure = Extension(name='VK_KHR_acceleration_structure', version=11, guard=None, commands=[
     Command(name='vkCreateAccelerationStructureKHR', dispatch='VkDevice'),
     Command(name='vkDestroyAccelerationStructureKHR', dispatch='VkDevice'),
@@ -1249,7 +1271,39 @@
     Command(name='vkGetPhysicalDeviceScreenPresentationSupportQNX', dispatch='VkPhysicalDevice'),
 ])
 
-VK_KHR_portability_subset = Extension(name='VK_KHR_portability_subset', version=1, guard='VK_USE_PLATFORM_SCREEN_QNX', commands=[
+VK_KHR_video_queue = Extension(name='VK_KHR_video_queue', version=1, guard='VK_ENABLE_BETA_EXTENSIONS', commands=[
+    Command(name='vkGetPhysicalDeviceVideoCapabilitiesKHR', dispatch='VkPhysicalDevice'),
+    Command(name='vkGetPhysicalDeviceVideoFormatPropertiesKHR', dispatch='VkPhysicalDevice'),
+    Command(name='vkCreateVideoSessionKHR', dispatch='VkDevice'),
+    Command(name='vkDestroyVideoSessionKHR', dispatch='VkDevice'),
+    Command(name='vkGetVideoSessionMemoryRequirementsKHR', dispatch='VkDevice'),
+    Command(name='vkBindVideoSessionMemoryKHR', dispatch='VkDevice'),
+    Command(name='vkCreateVideoSessionParametersKHR', dispatch='VkDevice'),
+    Command(name='vkUpdateVideoSessionParametersKHR', dispatch='VkDevice'),
+    Command(name='vkDestroyVideoSessionParametersKHR', dispatch='VkDevice'),
+    Command(name='vkCmdBeginVideoCodingKHR', dispatch='VkCommandBuffer'),
+    Command(name='vkCmdEndVideoCodingKHR', dispatch='VkCommandBuffer'),
+    Command(name='vkCmdControlVideoCodingKHR', dispatch='VkCommandBuffer'),
+])
+
+VK_KHR_video_decode_queue = Extension(name='VK_KHR_video_decode_queue', version=1, guard='VK_ENABLE_BETA_EXTENSIONS', commands=[
+    Command(name='vkCmdDecodeVideoKHR', dispatch='VkCommandBuffer'),
+])
+
+VK_KHR_portability_subset = Extension(name='VK_KHR_portability_subset', version=1, guard='VK_ENABLE_BETA_EXTENSIONS', commands=[
+])
+
+VK_KHR_video_encode_queue = Extension(name='VK_KHR_video_encode_queue', version=2, guard='VK_ENABLE_BETA_EXTENSIONS', commands=[
+    Command(name='vkCmdEncodeVideoKHR', dispatch='VkCommandBuffer'),
+])
+
+VK_EXT_video_encode_h264 = Extension(name='VK_EXT_video_encode_h264', version=1, guard='VK_ENABLE_BETA_EXTENSIONS', commands=[
+])
+
+VK_EXT_video_decode_h264 = Extension(name='VK_EXT_video_decode_h264', version=1, guard='VK_ENABLE_BETA_EXTENSIONS', commands=[
+])
+
+VK_EXT_video_decode_h265 = Extension(name='VK_EXT_video_decode_h265', version=1, guard='VK_ENABLE_BETA_EXTENSIONS', commands=[
 ])
 
 extensions = [
@@ -1439,6 +1493,7 @@
     VK_EXT_extended_dynamic_state,
     VK_EXT_shader_demote_to_helper_invocation,
     VK_NV_device_generated_commands,
+    VK_NV_inherited_viewport_scissor,
     VK_EXT_texel_buffer_alignment,
     VK_QCOM_render_pass_transform,
     VK_EXT_device_memory_report,
@@ -1450,12 +1505,16 @@
     VK_NV_device_diagnostics_config,
     VK_QCOM_render_pass_store_ops,
     VK_NV_fragment_shading_rate_enums,
+    VK_EXT_ycbcr_2plane_444_formats,
     VK_EXT_fragment_density_map2,
     VK_QCOM_rotated_copy_commands,
     VK_EXT_image_robustness,
     VK_EXT_4444_formats,
     VK_NV_acquire_winrt_display,
     VK_VALVE_mutable_descriptor_type,
+    VK_EXT_vertex_input_dynamic_state,
+    VK_EXT_extended_dynamic_state2,
+    VK_EXT_color_write_enable,
     VK_KHR_acceleration_structure,
     VK_KHR_ray_tracing_pipeline,
     VK_KHR_ray_query,
@@ -1484,7 +1543,13 @@
     VK_GGP_stream_descriptor_surface,
     VK_GGP_frame_token,
     VK_QNX_screen_surface,
+    VK_KHR_video_queue,
+    VK_KHR_video_decode_queue,
     VK_KHR_portability_subset,
+    VK_KHR_video_encode_queue,
+    VK_EXT_video_encode_h264,
+    VK_EXT_video_decode_h264,
+    VK_EXT_video_decode_h265,
 ]
 # end of generated code
 
@@ -1530,16 +1595,17 @@
         if not any(ext.name.startswith(s) for s in wrapped_exts):
             continue
 
-        if ext.guard:
-            lines.append("#ifdef %s" % ext.guard)
+        if ext.commands:
+            if ext.guard:
+                lines.append("#ifdef %s" % ext.guard)
 
-        lines.append("// %s" % ext.name)
-        for cmd in ext.commands:
-            lines.append("extern PFN_%s %s;" % (cmd.name, cmd.name))
+            lines.append("// %s" % ext.name)
+            for cmd in ext.commands:
+                lines.append("extern PFN_%s %s;" % (cmd.name, cmd.name))
 
-        if ext.guard:
-            lines.append("#endif")
-        lines.append("")
+            if ext.guard:
+                lines.append("#endif")
+            lines.append("")
 
     lines.append("")
     lines.append("")
@@ -1591,15 +1657,16 @@
         if not any(ext.name.startswith(s) for s in wrapped_exts):
             continue
 
-        if ext.guard:
-            lines.append("")
-            lines.append("#ifdef %s" % ext.guard)
+        if ext.commands:
+            if ext.guard:
+                lines.append("")
+                lines.append("#ifdef %s" % ext.guard)
 
-        for cmd in ext.commands:
-            lines.append("    %s = reinterpret_cast<PFN_%s>(dlsym(libvulkan, \"%s\"));" % (cmd.name, cmd.name, cmd.name))
+            for cmd in ext.commands:
+                lines.append("    %s = reinterpret_cast<PFN_%s>(dlsym(libvulkan, \"%s\"));" % (cmd.name, cmd.name, cmd.name))
 
-        if ext.guard:
-            lines.append("#endif")
+            if ext.guard:
+                lines.append("#endif")
 
     lines.append("    return 1;")
     lines.append("}")
@@ -1607,15 +1674,16 @@
 
     lines.append("// No Vulkan support, do not set function addresses")
     for ext in extensions:
-        if ext.guard:
-            lines.append("")
-            lines.append("#ifdef %s" % ext.guard)
+        if ext.commands:
+            if ext.guard:
+                lines.append("")
+                lines.append("#ifdef %s" % ext.guard)
 
-        for cmd in ext.commands:
-            lines.append("PFN_%s %s;" % (cmd.name, cmd.name))
+            for cmd in ext.commands:
+                lines.append("PFN_%s %s;" % (cmd.name, cmd.name))
 
-        if ext.guard:
-            lines.append("#endif")
+            if ext.guard:
+                lines.append("#endif")
 
     lines.append("")
     lines.append("#ifdef __cplusplus")
@@ -1634,7 +1702,7 @@
         for line in f:
             line = line.strip();
 
-            if line.startswith("#define VK_API_VERSION"):
+            if line.startswith("#define VK_API_VERSION") and "VK_MAKE_API_VERSION" in line:
                 minor_end = line.rfind(",")
                 minor_begin = line.rfind(",", 0, minor_end) + 1
                 spec_version = int(line[minor_begin:minor_end])
@@ -1668,7 +1736,7 @@
             if line.startswith("#include \"vulkan_"):
                 # Extract the filename and parse it.  Must be local to script file (no path).
                 extensions.extend(parse_subheader(line[10:].replace('"', ''), ext_guard))
-            elif line.startswith("#ifdef VK_USE_PLATFORM"):
+            elif line.startswith("#ifdef VK_USE_PLATFORM") or line.startswith('#ifdef VK_ENABLE_BETA_EXTENSIONS'):
                 guard_begin = line.find(" ") + 1
                 ext_guard = line[guard_begin:]
             elif ext_guard and line.startswith("#endif") and ext_guard in line: