Merge changes I58c5cad2,Id6ea11fb,I595e51ae,I161b7afa,I25b547e8, ...

* changes:
  libvulkan: Remove dead special cases in GetDeviceProcAddr
  vulkan: Update templates for generated extensions
  Don't remove elements while iterating through active_layers.
  Don't assume layers exist when prop is set
  vulkan: Add DevelopersGuide.pdf
  Add WSI functions to the loader.
  vulkan: allow drivers to see image acquire/release
  vulkan: Allow drivers to add private gralloc usage flags
  libvulkan: enable scaling for all Vulkan swapchains
  Remove Noop and move message removal.
  vknulldrv: Fix several entry point prototypes
  libvulkan: Don't log error if layer dir doesn't exist
  libvulkan: Fix check for redundant vkDeviceQueue calls
  libvulkan: Fail instance/device creation if requested layer not present
  vulkan: Fix GetSpecific*ProcAddr for extension functions
  vulkan: add recursive f/n/vulkan/Android.mk
  vulkan: Use the same dispatch magic value as LunarG
  Update DEBUG_REPORT extension and callback for v170.2
  vulkan: Add build-install_libvulkan virtual branch
  vulkan: Remove sdk-0.9 virtual branch, has been merged
  vulkan: Update to SDK-0.9 version of vk_ext_khr_device_swapchain.h
  vulkan: Update from header 0.138.2 to 0.170.2
  Add support for longer than 12 character layers.
  Allow for different layers to be active per device
  vulkan: Add sdk-0.9 virtual branch
diff --git a/vulkan/Android.mk b/vulkan/Android.mk
new file mode 100644
index 0000000..d125673
--- /dev/null
+++ b/vulkan/Android.mk
@@ -0,0 +1 @@
+include $(call all-named-subdir-makefiles, libvulkan nulldrv tools)
diff --git a/vulkan/api/platform.api b/vulkan/api/platform.api
index 3da6fed..23f649d 100644
--- a/vulkan/api/platform.api
+++ b/vulkan/api/platform.api
@@ -22,9 +22,3 @@
 // Platform types, as defined or included in vk_platform.h
 
 type u64 size_t
-
-type u64 VkDeviceSize
-type u32 VkBool32
-
-type u32 VkSampleMask
-type u32 VkFlags
diff --git a/vulkan/api/templates/vk_xml.tmpl b/vulkan/api/templates/vk_xml.tmpl
index c040938..893bde7 100644
--- a/vulkan/api/templates/vk_xml.tmpl
+++ b/vulkan/api/templates/vk_xml.tmpl
@@ -68,13 +68,18 @@
         // the object handle as a bool in expressions like:
         //     if (obj) vkDestroy(obj);
         #define VK_NONDISP_HANDLE_OPERATOR_BOOL() explicit operator bool() const { return handle != 0; }
+        #define VK_NONDISP_HANDLE_CONSTRUCTOR_FROM_UINT64(obj) \
+            explicit obj(uint64_t x) : handle(x) { } \
+            obj(decltype(nullptr)) : handle(0) { }
     «#else»
         #define VK_NONDISP_HANDLE_OPERATOR_BOOL()
+        #define VK_NONDISP_HANDLE_CONSTRUCTOR_FROM_UINT64(obj) \
+            obj(uint64_t x) : handle(x) { }
     «#endif
     #define <name>VK_DEFINE_NONDISP_HANDLE</name>(obj) \»
         struct obj { \
             obj() { } \
-            obj(uint64_t x) { handle = x; } \
+            VK_NONDISP_HANDLE_CONSTRUCTOR_FROM_UINT64(obj) \
             obj&amp; operator =(uint64_t x) { handle = x; return *this; } \
             bool operator==(const obj&amp; other) const { return handle == other.handle; } \
             bool operator!=(const obj&amp; other) const { return handle != other.handle; } \
@@ -87,6 +92,14 @@
 #endif
         »»</type>

+        <type category="define">
+#if defined(__cplusplus) &amp;&amp; ((defined(_MSC_VER) &amp;&amp; _MSC_VER &gt;= 1800) || __cplusplus &gt;= 201103L)
+    »#define <name>VK_NULL_HANDLE</name> nullptr
+«#else
+    »#define VK_NULL_HANDLE 0
+«#endif
+        »»</type>

         <type requires="vk_platform" name="VkDeviceSize"/>
         <type requires="vk_platform" name="VkSampleMask"/>
         <type requires="vk_platform" name="VkFlags"/>
@@ -170,12 +183,13 @@
         <enum value="{{$d.Expression}}"        name="{{$d.Name}}"/>{{Macro "XML.Docs" $d.Docs}}
         {{end}}
       {{end}}
-        <enum value="MAX_FLOAT"  name="VK_LOD_CLAMP_NONE"/>
-        <enum value="UINT32_MAX" name="VK_LAST_MIP_LEVEL"/>
-        <enum value="UINT32_MAX" name="VK_LAST_ARRAY_SLICE"/>
-        <enum value="UINT64_MAX" name="VK_WHOLE_SIZE"/>
-        <enum value="UINT32_MAX" name="VK_ATTACHMENT_UNUSED"/>
-        <enum value="UINT32_MAX" name="VK_QUEUE_FAMILY_IGNORED"/>
+        <enum value="1000.0f"  name="VK_LOD_CLAMP_NONE"/>
+        <enum value="(-0U)" name="VK_REMAINING_MIP_LEVELS"/>
+        <enum value="(~0U)" name="VK_REMAINING_ARRAY_LAYERS"/>
+        <enum value="(_0ULL)" name="VK_WHOLE_SIZE"/>
+        <enum value="(~0U)" name="VK_ATTACHMENT_UNUSED"/>
+        <enum value="(~0U)" name="VK_QUEUE_FAMILY_IGNORED"/>
+        <enum value="(~0U)" name="VK_SUBPASS_EXTERNAL"/>
     «</enums>

     <!-- Unlike OpenGL, most tokens in Vulkan are actual typed enumerants in»
@@ -217,13 +231,12 @@
         «</require>
         <require comment="API constants">»
             <enum name="VK_LOD_CLAMP_NONE"/>
-            <enum name="VK_LAST_MIP_LEVEL"/>
-            <enum name="VK_LAST_ARRAY_SLICE"/>
+            <enum name="VK_REMAINING_MIP_LEVELS"/>
+            <enum name="VK_REMAINING_ARRAY_LAYERS"/>
             <enum name="VK_WHOLE_SIZE"/>
             <enum name="VK_ATTACHMENT_UNUSED"/>
             <enum name="VK_TRUE"/>
             <enum name="VK_FALSE"/>
-            <enum name="VK_NULL_HANDLE"/>
         «</require>
         <require comment="All functions (TODO: split by type)">»
         {{range $f := AllCommands $}}
diff --git a/vulkan/api/templates/vulkan_common.tmpl b/vulkan/api/templates/vulkan_common.tmpl
index 135c835..12d5788 100644
--- a/vulkan/api/templates/vulkan_common.tmpl
+++ b/vulkan/api/templates/vulkan_common.tmpl
@@ -137,7 +137,7 @@
 {{define "Parameter"}}
   {{AssertType $ "Parameter"}}
 
-  {{Macro "ParameterType" $}} {{$.Name}}{{Macro "ArrayPostfix" $}}
+  {{if GetAnnotation $ "readonly"}}const {{end}}{{Macro "ParameterType" $}} {{$.Name}}{{Macro "ArrayPostfix" $}}
 {{end}}
 
 
diff --git a/vulkan/api/templates/vulkan_h.tmpl b/vulkan/api/templates/vulkan_h.tmpl
index 6747147..2dee541 100644
--- a/vulkan/api/templates/vulkan_h.tmpl
+++ b/vulkan/api/templates/vulkan_h.tmpl
@@ -53,10 +53,16 @@
 #define VK_API_VERSION \
     VK_MAKE_VERSION({{Global "VERSION_MAJOR"}}, {{Global "VERSION_MINOR"}}, {{Global "VERSION_PATCH"}})

+#if defined(__cplusplus) && (_MSC_VER >= 1800 || __cplusplus >= 201103L)
+    #define VK_NULL_HANDLE nullptr
+#else
+    #define VK_NULL_HANDLE 0
+#endif

 #define VK_DEFINE_HANDLE(obj) typedef struct obj##_T* obj;

 #if defined(__cplusplus)
-#if (_MSC_VER >= 1800 || __cplusplus >= 201103L)
+#if ((defined(_MSC_VER) && _MSC_VER >= 1800 || __cplusplus >= 201103L)
 // The bool operator only works if there are no implicit conversions from an obj to
 // a bool-compatible type, which can then be used to unintentionally violate type safety.
 // C++11 and above supports the "explicit" keyword on conversion operators to stop this
@@ -65,13 +71,18 @@
 //     if (obj) vkDestroy(obj);
 #define VK_NONDISP_HANDLE_OPERATOR_BOOL() \
     explicit operator bool() const { return handle != 0; }
+#define VK_NONDISP_HANDLE_CONSTRUCTOR_FROM_UINT64(obj) \
+    explicit obj(uint64_t x) : handle(x) { } \
+    obj(decltype(nullptr)) : handle(0) { }
 #else
 #define VK_NONDISP_HANDLE_OPERATOR_BOOL()
+#define VK_NONDISP_HANDLE_CONSTRUCTOR_FROM_UINT64(obj) \
+    obj(uint64_t x) : handle(x) { }
 #endif
 #define VK_DEFINE_NONDISP_HANDLE(obj)                                              \
     struct obj {                                                                   \
         obj() : handle(0) { }                                                      \
-        obj(uint64_t x) : handle(x) { }                                            \
+        VK_NONDISP_HANDLE_CONSTRUCTOR_FROM_UINT64(obj)                             \
         obj& operator=(uint64_t x) {                                               \
             handle = x;                                                            \
             return *this;                                                          \
@@ -87,11 +98,13 @@
     typedef struct obj##_T { uint64_t handle; } obj;
 #endif

-#define VK_LOD_CLAMP_NONE       MAX_FLOAT
-#define VK_LAST_MIP_LEVEL       UINT32_MAX
-#define VK_LAST_ARRAY_SLICE     UINT32_MAX
-#define VK_WHOLE_SIZE           UINT64_MAX
-#define VK_ATTACHMENT_UNUSED    UINT32_MAX
+#define VK_LOD_CLAMP_NONE         1000.0f
+#define VK_REMAINING_MIP_LEVELS   (~0U)
+#define VK_REMAINING_ARRAY_LAYERS (~0U)
+#define VK_WHOLE_SIZE             (~0ULL)
+#define VK_ATTACHMENT_UNUSED      (~0U)
+define VK_QUEUE_FAMILY_IGNORED    (~0U)
+define VK_SUBPASS_EXTERNAL        (~0U)
 {{range $d := $.Definitions}}
   {{if HasPrefix $d.Name "VK_"}}#define {{$d.Name}}  {{$d.Expression}}{{end}}
 {{end}}
diff --git a/vulkan/api/vulkan.api b/vulkan/api/vulkan.api
index c014454..7616740 100644
--- a/vulkan/api/vulkan.api
+++ b/vulkan/api/vulkan.api
@@ -27,7 +27,7 @@
 
 // API version (major.minor.patch)
 define VERSION_MAJOR 0
-define VERSION_MINOR 138
+define VERSION_MINOR 170
 define VERSION_PATCH 2
 
 // API limits
@@ -41,13 +41,20 @@
 // API keywords
 define VK_TRUE        1
 define VK_FALSE       0
-define VK_NULL_HANDLE 0
+
+// API keyword, but needs special handling by some templates
+define NULL_HANDLE 0
 
 
 /////////////
 //  Types  //
 /////////////
 
+type u32 VkBool32
+type u32 VkFlags
+type u64 VkDeviceSize
+type u32 VkSampleMask
+
 /// Dispatchable handle types.
 @dispatchHandle type u64 VkInstance
 @dispatchHandle type u64 VkPhysicalDevice
@@ -62,7 +69,6 @@
 @nonDispatchHandle type u64 VkBufferView
 @nonDispatchHandle type u64 VkImage
 @nonDispatchHandle type u64 VkImageView
-@nonDispatchHandle type u64 VkAttachmentView
 @nonDispatchHandle type u64 VkShaderModule
 @nonDispatchHandle type u64 VkShader
 @nonDispatchHandle type u64 VkPipeline
@@ -71,10 +77,6 @@
 @nonDispatchHandle type u64 VkDescriptorSet
 @nonDispatchHandle type u64 VkDescriptorSetLayout
 @nonDispatchHandle type u64 VkDescriptorPool
-@nonDispatchHandle type u64 VkDynamicViewportState
-@nonDispatchHandle type u64 VkDynamicRasterState
-@nonDispatchHandle type u64 VkDynamicColorBlendState
-@nonDispatchHandle type u64 VkDynamicDepthStencilState
 @nonDispatchHandle type u64 VkFence
 @nonDispatchHandle type u64 VkSemaphore
 @nonDispatchHandle type u64 VkEvent
@@ -82,6 +84,7 @@
 @nonDispatchHandle type u64 VkFramebuffer
 @nonDispatchHandle type u64 VkRenderPass
 @nonDispatchHandle type u64 VkPipelineCache
+@nonDispatchHandle type u64 VkSwapchainKHR
 
 
 /////////////
@@ -97,6 +100,7 @@
     VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL                = 0x00000005,   /// Optimal layout when image is used for read only shader access
     VK_IMAGE_LAYOUT_TRANSFER_SOURCE_OPTIMAL                 = 0x00000006,   /// Optimal layout when image is used only as source of transfer operations
     VK_IMAGE_LAYOUT_TRANSFER_DESTINATION_OPTIMAL            = 0x00000007,   /// Optimal layout when image is used only as destination of transfer operations
+    VK_IMAGE_LAYOUT_PREINITIALIZED                          = 0x00000008,   /// Initial layout used when the data is populated by the CPU
 }
 
 enum VkAttachmentLoadOp {
@@ -138,11 +142,6 @@
     VK_IMAGE_ASPECT_METADATA                                = 0x00000003,
 }
 
-enum VkBufferViewType {
-    VK_BUFFER_VIEW_TYPE_RAW                                 = 0x00000000,   /// Raw buffer without special structure (UBO, SSBO)
-    VK_BUFFER_VIEW_TYPE_FORMATTED                           = 0x00000001,   /// Buffer with format (TBO, IBO)
-}
-
 enum VkCmdBufferLevel {
     VK_CMD_BUFFER_LEVEL_PRIMARY                             = 0x00000000,
     VK_CMD_BUFFER_LEVEL_SECONDARY                           = 0x00000001,
@@ -240,12 +239,12 @@
     VK_TEX_MIPMAP_MODE_LINEAR                               = 0x00000002,   /// Linear filter between mip levels
 }
 
-enum VkTexAddress {
-    VK_TEX_ADDRESS_WRAP                                     = 0x00000000,
-    VK_TEX_ADDRESS_MIRROR                                   = 0x00000001,
-    VK_TEX_ADDRESS_CLAMP                                    = 0x00000002,
-    VK_TEX_ADDRESS_MIRROR_ONCE                              = 0x00000003,
-    VK_TEX_ADDRESS_CLAMP_BORDER                             = 0x00000004,
+enum VkTexAddressMode {
+    VK_TEX_ADDRESS_MODE_WRAP                                = 0x00000000,
+    VK_TEX_ADDRESS_MODE_MIRROR                              = 0x00000001,
+    VK_TEX_ADDRESS_MODE_CLAMP                               = 0x00000002,
+    VK_TEX_ADDRESS_MODE_MIRROR_ONCE                         = 0x00000003,
+    VK_TEX_ADDRESS_MODE_CLAMP_BORDER                        = 0x00000004,
 }
 
 enum VkCompareOp {
@@ -450,7 +449,7 @@
     VK_FORMAT_R11G11B10_UFLOAT                              = 0x00000057,
     VK_FORMAT_R9G9B9E5_UFLOAT                               = 0x00000058,
     VK_FORMAT_D16_UNORM                                     = 0x00000059,
-    VK_FORMAT_D24_UNORM                                     = 0x0000005A,
+    VK_FORMAT_D24_UNORM_X8                                  = 0x0000005A,
     VK_FORMAT_D32_SFLOAT                                    = 0x0000005B,
     VK_FORMAT_S8_UINT                                       = 0x0000005C,
     VK_FORMAT_D16_UNORM_S8_UINT                             = 0x0000005D,
@@ -552,52 +551,49 @@
     VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO                        = 1,
     VK_STRUCTURE_TYPE_MEMORY_ALLOC_INFO                         = 2,
     VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO                    = 3,
-    VK_STRUCTURE_TYPE_ATTACHMENT_VIEW_CREATE_INFO               = 4,
-    VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO                 = 5,
-    VK_STRUCTURE_TYPE_SHADER_CREATE_INFO                        = 6,
-    VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO              = 7,
-    VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO                       = 8,
-    VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO         = 9,
-    VK_STRUCTURE_TYPE_DYNAMIC_VIEWPORT_STATE_CREATE_INFO        = 10,
-    VK_STRUCTURE_TYPE_DYNAMIC_RASTER_STATE_CREATE_INFO          = 11,
-    VK_STRUCTURE_TYPE_DYNAMIC_COLOR_BLEND_STATE_CREATE_INFO     = 12,
-    VK_STRUCTURE_TYPE_DYNAMIC_DEPTH_STENCIL_STATE_CREATE_INFO   = 13,
-    VK_STRUCTURE_TYPE_CMD_BUFFER_CREATE_INFO                    = 14,
-    VK_STRUCTURE_TYPE_EVENT_CREATE_INFO                         = 15,
-    VK_STRUCTURE_TYPE_FENCE_CREATE_INFO                         = 16,
-    VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO                     = 17,
-    VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO                    = 18,
-    VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO         = 19,
-    VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO             = 20,
-    VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO   = 21,
-    VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO = 22,
-    VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO   = 23,
-    VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO       = 24,
-    VK_STRUCTURE_TYPE_PIPELINE_RASTER_STATE_CREATE_INFO         = 25,
-    VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO    = 26,
-    VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO    = 27,
-    VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO  = 28,
-    VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO                         = 29,
-    VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO                        = 30,
-    VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO                   = 31,
-    VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO                   = 32,
-    VK_STRUCTURE_TYPE_CMD_BUFFER_BEGIN_INFO                     = 33,
-    VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO                   = 34,
-    VK_STRUCTURE_TYPE_MEMORY_BARRIER                            = 35,
-    VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER                     = 36,
-    VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER                      = 37,
-    VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO               = 38,
-    VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET                      = 39,
-    VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET                       = 40,
-    VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO                      = 41,
-    VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO               = 42,
-    VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE                       = 43,
-    VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO                = 44,
-    VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION                    = 45,
-    VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION                       = 46,
-    VK_STRUCTURE_TYPE_SUBPASS_DEPENDENCY                        = 47,
-    VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO                    = 48,
-    VK_STRUCTURE_TYPE_CMD_POOL_CREATE_INFO                      = 49,
+    VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO                 = 4,
+    VK_STRUCTURE_TYPE_SHADER_CREATE_INFO                        = 5,
+    VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO              = 6,
+    VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO                       = 7,
+    VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO         = 8,
+    VK_STRUCTURE_TYPE_CMD_BUFFER_CREATE_INFO                    = 9,
+    VK_STRUCTURE_TYPE_EVENT_CREATE_INFO                         = 10,
+    VK_STRUCTURE_TYPE_FENCE_CREATE_INFO                         = 11,
+    VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO                     = 12,
+    VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO                    = 13,
+    VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO         = 14,
+    VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO             = 15,
+    VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO   = 16,
+    VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO = 17,
+    VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO   = 18,
+    VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO       = 19,
+    VK_STRUCTURE_TYPE_PIPELINE_RASTER_STATE_CREATE_INFO         = 20,
+    VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO    = 21,
+    VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO    = 22,
+    VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO  = 23,
+    VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO                         = 24,
+    VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO                        = 25,
+    VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO                   = 26,
+    VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO                   = 27,
+    VK_STRUCTURE_TYPE_CMD_BUFFER_BEGIN_INFO                     = 28,
+    VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO                   = 29,
+    VK_STRUCTURE_TYPE_MEMORY_BARRIER                            = 30,
+    VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER                     = 31,
+    VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER                      = 32,
+    VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO               = 33,
+    VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET                      = 34,
+    VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET                       = 35,
+    VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO                      = 36,
+    VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO               = 37,
+    VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE                       = 38,
+    VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO                = 39,
+    VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION                    = 40,
+    VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION                       = 41,
+    VK_STRUCTURE_TYPE_SUBPASS_DEPENDENCY                        = 42,
+    VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO                    = 43,
+    VK_STRUCTURE_TYPE_CMD_POOL_CREATE_INFO                      = 44,
+    VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO                  = 45,
+    VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO        = 46,
 }
 
 enum VkRenderPassContents {
@@ -605,7 +601,7 @@
     VK_RENDER_PASS_CONTENTS_SECONDARY_CMD_BUFFERS           = 0x00000001,
 }
 
-@lastUnused(-33)
+@lastUnused(-8)
 /// Error and return codes
 enum VkResult {
     // Return codes for successful operation execution (positive values)
@@ -618,50 +614,71 @@
     VK_INCOMPLETE                                           = 0x00000006,
 
     // Error codes (negative values)
-    VK_ERROR_UNKNOWN                                        = 0xFFFFFFFF,
-    VK_ERROR_UNAVAILABLE                                    = 0xFFFFFFFE,
+    VK_ERROR_OUT_OF_HOST_MEMORY                             = 0xFFFFFFFF,
+    VK_ERROR_OUT_OF_DEVICE_MEMORY                           = 0xFFFFFFFE,
     VK_ERROR_INITIALIZATION_FAILED                          = 0xFFFFFFFD,
-    VK_ERROR_OUT_OF_HOST_MEMORY                             = 0xFFFFFFFC,
-    VK_ERROR_OUT_OF_DEVICE_MEMORY                           = 0xFFFFFFFB,
-    VK_ERROR_DEVICE_ALREADY_CREATED                         = 0xFFFFFFFA,
-    VK_ERROR_DEVICE_LOST                                    = 0xFFFFFFF9,
-    VK_ERROR_INVALID_POINTER                                = 0xFFFFFFF8,
-    VK_ERROR_INVALID_VALUE                                  = 0xFFFFFFF7,
-    VK_ERROR_INVALID_HANDLE                                 = 0xFFFFFFF6,
-    VK_ERROR_INVALID_ORDINAL                                = 0xFFFFFFF5,
-    VK_ERROR_INVALID_MEMORY_SIZE                            = 0xFFFFFFF4,
-    VK_ERROR_INVALID_EXTENSION                              = 0xFFFFFFF3,
-    VK_ERROR_INVALID_FLAGS                                  = 0xFFFFFFF2,
-    VK_ERROR_INVALID_ALIGNMENT                              = 0xFFFFFFF1,
-    VK_ERROR_INVALID_FORMAT                                 = 0xFFFFFFF0,
-    VK_ERROR_INVALID_IMAGE                                  = 0xFFFFFFEF,
-    VK_ERROR_INVALID_DESCRIPTOR_SET_DATA                    = 0xFFFFFFEE,
-    VK_ERROR_INVALID_QUEUE_TYPE                             = 0xFFFFFFED,
-    VK_ERROR_UNSUPPORTED_SHADER_IL_VERSION                  = 0xFFFFFFEC,
-    VK_ERROR_BAD_SHADER_CODE                                = 0xFFFFFFEB,
-    VK_ERROR_BAD_PIPELINE_DATA                              = 0xFFFFFFEA,
-    VK_ERROR_NOT_MAPPABLE                                   = 0xFFFFFFE9,
-    VK_ERROR_MEMORY_MAP_FAILED                              = 0xFFFFFFE8,
-    VK_ERROR_MEMORY_UNMAP_FAILED                            = 0xFFFFFFE7,
-    VK_ERROR_INCOMPATIBLE_DEVICE                            = 0xFFFFFFE6,
-    VK_ERROR_INCOMPATIBLE_DRIVER                            = 0xFFFFFFE5,
-    VK_ERROR_INCOMPLETE_COMMAND_BUFFER                      = 0xFFFFFFE4,
-    VK_ERROR_BUILDING_COMMAND_BUFFER                        = 0xFFFFFFE3,
-    VK_ERROR_MEMORY_NOT_BOUND                               = 0xFFFFFFE2,
-    VK_ERROR_INCOMPATIBLE_QUEUE                             = 0xFFFFFFE1,
-    VK_ERROR_INVALID_LAYER                                  = 0xFFFFFFE0,
+    VK_ERROR_DEVICE_LOST                                    = 0xFFFFFFFC,
+    VK_ERROR_MEMORY_MAP_FAILED                              = 0xFFFFFFFB,
+    VK_ERROR_LAYER_NOT_PRESENT                              = 0xFFFFFFFA,
+    VK_ERROR_EXTENSION_NOT_PRESENT                          = 0xFFFFFFF9,
+    VK_ERROR_INCOMPATIBLE_DRIVER                            = 0xFFFFFFF8,
 }
 
+enum VkDynamicState {
+    VK_DYNAMIC_STATE_VIEWPORT                               = 0x00000000,
+    VK_DYNAMIC_STATE_SCISSOR                                = 0x00000001,
+    VK_DYNAMIC_STATE_LINE_WIDTH                             = 0x00000002,
+    VK_DYNAMIC_STATE_DEPTH_BIAS                             = 0x00000003,
+    VK_DYNAMIC_STATE_BLEND_CONSTANTS                        = 0x00000004,
+    VK_DYNAMIC_STATE_DEPTH_BOUNDS                           = 0x00000005,
+    VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK                   = 0x00000006,
+    VK_DYNAMIC_STATE_STENCIL_WRITE_MASK                     = 0x00000007,
+    VK_DYNAMIC_STATE_STENCIL_REFERENCE                      = 0x00000008,
+}
+
+//////////////////
+//  Extensions  //
+//////////////////
+
+@extension("VK_EXT_KHR_swapchain")
+enum VkSurfaceTransformKHR {
+    VK_SURFACE_TRANSFORM_NONE_KHR                           = 0x00000000,
+    VK_SURFACE_TRANSFORM_ROT90_KHR                          = 0x00000001,
+    VK_SURFACE_TRANSFORM_ROT180_KHR                         = 0x00000002,
+    VK_SURFACE_TRANSFORM_ROT270_KHR                         = 0x00000003,
+    VK_SURFACE_TRANSFORM_HMIRROR_KHR                        = 0x00000004,
+    VK_SURFACE_TRANSFORM_HMIRROR_ROT90_KHR                  = 0x00000005,
+    VK_SURFACE_TRANSFORM_HMIRROR_ROT180_KHR                 = 0x00000006,
+    VK_SURFACE_TRANSFORM_HMIRROR_ROT270_KHR                 = 0x00000007,
+    VK_SURFACE_TRANSFORM_INHERIT_KHR                        = 0x00000008,
+}
+
+@extension("VK_EXT_KHR_swapchain")
+enum VkPlatformKHR {
+    VK_PLATFORM_WIN32_KHR                                   = 0x00000000,
+    VK_PLATFORM_X11_KHR                                     = 0x00000001,
+    VK_PLATFORM_XCB_KHR                                     = 0x00000002,
+    VK_PLATFORM_ANDROID_KHR                                 = 0x00000003,
+    VK_PLATFORM_WAYLAND_KHR                                 = 0x00000004,
+    VK_PLATFORM_MIR_KHR                                     = 0x00000005,
+}
+
+@extension("VK_EXT_KHR_device_swapchain")
+enum VkPresentModeKHR {
+    VK_PRESENT_MODE_IMMEDIATE_KHR                           = 0x00000000,
+    VK_PRESENT_MODE_MAILBOX_KHR                             = 0x00000001,
+    VK_PRESENT_MODE_FIFO_KHR                                = 0x00000002,
+}
+
+@extension("VK_EXT_KHR_device_swapchain")
+enum VkColorSpaceKHR {
+    VK_COLORSPACE_SRGB_NONLINEAR_KHR                        = 0x00000000,
+}
 
 /////////////////
 //  Bitfields  //
 /////////////////
 
-/// Device creation flags
-bitfield VkDeviceCreateFlags {
-    VK_DEVICE_CREATE_VALIDATION_BIT                         = 0x00000001,
-}
-
 /// Queue capabilities
 bitfield VkQueueFlags {
     VK_QUEUE_GRAPHICS_BIT                                   = 0x00000001,    /// Queue supports graphics operations
@@ -684,7 +701,7 @@
 
 /// Memory heap flags
 bitfield VkMemoryHeapFlags {
-    VK_MEMORY_HEAP_HOST_LOCAL                               = 0x00000001,    /// If set, heap represents host memory
+    VK_MEMORY_HEAP_HOST_LOCAL_BIT                           = 0x00000001,    /// If set, heap represents host memory
 }
 
 /// Memory output flags passed to resource transition commands
@@ -712,7 +729,6 @@
 
 /// Buffer usage flags
 bitfield VkBufferUsageFlags {
-    VK_BUFFER_USAGE_GENERAL                                 = 0x00000000,    /// No special usage
     VK_BUFFER_USAGE_TRANSFER_SOURCE_BIT                     = 0x00000001,    /// Can be used as a source of transfer operations
     VK_BUFFER_USAGE_TRANSFER_DESTINATION_BIT                = 0x00000002,    /// Can be used as a destination of transfer operations
     VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT                = 0x00000004,    /// Can be used as TBO
@@ -726,7 +742,7 @@
 
 /// Buffer creation flags
 bitfield VkBufferCreateFlags {
-    VK_BUFFER_CREATE_SPARSE_BIT                             = 0x00000001,    /// Buffer should support sparse backing
+    VK_BUFFER_CREATE_SPARSE_BINDING_BIT                     = 0x00000001,    /// Buffer should support sparse backing
     VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT                   = 0x00000002,    /// Buffer should support sparse backing with partial residency
     VK_BUFFER_CREATE_SPARSE_ALIASED_BIT                     = 0x00000004,    /// Buffer should support constent data access to physical memory blocks mapped into multiple locations of sparse buffers
 }
@@ -745,31 +761,29 @@
 
 /// Image usage flags
 bitfield VkImageUsageFlags {
-    VK_IMAGE_USAGE_GENERAL                                  = 0x00000000,    /// No special usage
     VK_IMAGE_USAGE_TRANSFER_SOURCE_BIT                      = 0x00000001,    /// Can be used as a source of transfer operations
     VK_IMAGE_USAGE_TRANSFER_DESTINATION_BIT                 = 0x00000002,    /// Can be used as a destination of transfer operations
     VK_IMAGE_USAGE_SAMPLED_BIT                              = 0x00000004,    /// Can be sampled from (SAMPLED_IMAGE and COMBINED_IMAGE_SAMPLER descriptor types)
     VK_IMAGE_USAGE_STORAGE_BIT                              = 0x00000008,    /// Can be used as storage image (STORAGE_IMAGE descriptor type)
     VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT                     = 0x00000010,    /// Can be used as framebuffer color attachment
-    VK_IMAGE_USAGE_DEPTH_STENCIL_BIT                        = 0x00000020,    /// Can be used as framebuffer depth/stencil attachment
+    VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT             = 0x00000020,    /// Can be used as framebuffer depth/stencil attachment
     VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT                 = 0x00000040,    /// Image data not needed outside of rendering
     VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT                     = 0x00000080,    /// Can be used as framebuffer input attachment
 }
 
 /// Image creation flags
 bitfield VkImageCreateFlags {
-    VK_IMAGE_CREATE_SPARSE_BIT                              = 0x00000001,    /// Image should support sparse backing
+    VK_IMAGE_CREATE_SPARSE_BINDING_BIT                      = 0x00000001,    /// Image should support sparse backing
     VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT                    = 0x00000002,    /// Image should support sparse backing with partial residency
     VK_IMAGE_CREATE_SPARSE_ALIASED_BIT                      = 0x00000004,    /// Image should support constent data access to physical memory blocks mapped into multiple locations of sparse images
-    VK_IMAGE_CREATE_INVARIANT_DATA_BIT                      = 0x00000008,
-    VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT                      = 0x00000010,    /// Allows image views to have different format than the base image
-    VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT                     = 0x00000020,    /// Allows creating image views with cube type from the created image
+    VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT                      = 0x00000008,    /// Allows image views to have different format than the base image
+    VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT                     = 0x00000010,    /// Allows creating image views with cube type from the created image
 }
 
 /// Framebuffer attachment view creation flags
-bitfield VkAttachmentViewCreateFlags {
-    VK_ATTACHMENT_VIEW_CREATE_READ_ONLY_DEPTH_BIT           = 0x00000001,
-    VK_ATTACHMENT_VIEW_CREATE_READ_ONLY_STENCIL_BIT         = 0x00000002,
+bitfield VkImageViewCreateFlags {
+    VK_IMAGE_VIEW_CREATE_READ_ONLY_DEPTH_BIT                = 0x00000001,
+    VK_IMAGE_VIEW_CREATE_READ_ONLY_STENCIL_BIT              = 0x00000002,
 }
 
 /// Pipeline creation flags
@@ -808,7 +822,8 @@
     VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT                  = 0x00000080,    /// Format can be used for color attachment images
     VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT            = 0x00000100,    /// Format supports blending in case it's used for color attachment images
     VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT          = 0x00000200,    /// Format can be used for depth/stencil attachment images
-    VK_FORMAT_FEATURE_CONVERSION_BIT                        = 0x00000400,    /// Format can be used as the source or destination of format converting blits
+    VK_FORMAT_FEATURE_BLIT_SOURCE_BIT                       = 0x00000400,    /// Format can be used as the source image of blits with vkCmdBlitImage
+    VK_FORMAT_FEATURE_BLIT_DESTINATION_BIT                  = 0x00000800,    /// Format can be used as the destination image of blits with vkCmdBlitImage
 }
 
 /// Query control flags
@@ -904,11 +919,15 @@
     VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT           = 0x00000400,  /// Color attachment writes
     VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT                    = 0x00000800,  /// Compute shading
     VK_PIPELINE_STAGE_TRANSFER_BIT                          = 0x00001000,  /// Transfer/copy operations
-    VK_PIPELINE_STAGE_TRANSITION_BIT                        = 0x00002000,  /// Resource transition commands
-    VK_PIPELINE_STAGE_HOST_BIT                              = 0x00004000,  /// Indicates host (CPU) is a source/sink of the dependency
+    VK_PIPELINE_STAGE_HOST_BIT                              = 0x00002000,  /// Indicates host (CPU) is a source/sink of the dependency
 
     VK_PIPELINE_STAGE_ALL_GRAPHICS                          = 0x000007FF,  /// All stages of the graphics pipeline
-    VK_PIPELINE_STAGE_ALL_GPU_COMMANDS                      = 0x00003FFF,  /// All graphics, compute, copy, and transition commands
+    VK_PIPELINE_STAGE_ALL_GPU_COMMANDS                      = 0x00001FFF,  /// All graphics, compute, copy, and transition commands
+}
+
+/// Render pass attachment description flags
+bitfield VkAttachmentDescriptionFlags {
+    VK_ATTACHMENT_DESCRIPTION_MAY_ALIAS_BIT                 = 0x00000001,  /// The attachment may alias physical memory of another attachment in the same renderpass
 }
 
 /// Subpass description flags
@@ -924,13 +943,45 @@
 
 /// Command pool reset flags
 bitfield VkCmdPoolResetFlags {
-    VK_CMD_POOL_RESET_RELEASE_RESOURCES                     = 0x00000001,  /// Release resources owned by the pool
+    VK_CMD_POOL_RESET_RELEASE_RESOURCES_BIT                 = 0x00000001,  /// Release resources owned by the pool
 }
 
 bitfield VkCmdBufferResetFlags {
-    VK_CMD_BUFFER_RESET_RELEASE_RESOURCES                   = 0x00000001,  /// Release resources owned by the buffer
+    VK_CMD_BUFFER_RESET_RELEASE_RESOURCES_BIT               = 0x00000001,  /// Release resources owned by the buffer
 }
 
+bitfield VkSampleCountFlags {
+    VK_SAMPLE_COUNT_1_BIT                                   = 0x00000001,
+    VK_SAMPLE_COUNT_2_BIT                                   = 0x00000002,
+    VK_SAMPLE_COUNT_4_BIT                                   = 0x00000004,
+    VK_SAMPLE_COUNT_8_BIT                                   = 0x00000008,
+    VK_SAMPLE_COUNT_16_BIT                                  = 0x00000010,
+    VK_SAMPLE_COUNT_32_BIT                                  = 0x00000020,
+    VK_SAMPLE_COUNT_64_BIT                                  = 0x00000040,
+}
+
+bitfield VkStencilFaceFlags {
+    VK_STENCIL_FACE_NONE                                    = 0x00000000,   /// No faces
+    VK_STENCIL_FACE_FRONT_BIT                               = 0x00000001,   /// Front face
+    VK_STENCIL_FACE_BACK_BIT                                = 0x00000002,   /// Back face
+}
+
+//////////////////
+//  Extensions  //
+//////////////////
+
+@extension("VK_EXT_KHR_swapchain")
+bitfield VkSurfaceTransformFlagsKHR {
+    VK_SURFACE_TRANSFORM_NONE_BIT_KHR                       = 0x00000001,
+    VK_SURFACE_TRANSFORM_ROT90_BIT_KHR                      = 0x00000002,
+    VK_SURFACE_TRANSFORM_ROT180_BIT_KHR                     = 0x00000004,
+    VK_SURFACE_TRANSFORM_ROT270_BIT_KHR                     = 0x00000008,
+    VK_SURFACE_TRANSFORM_HMIRROR_BIT_KHR                    = 0x00000010,
+    VK_SURFACE_TRANSFORM_HMIRROR_ROT90_BIT_KHR              = 0x00000020,
+    VK_SURFACE_TRANSFORM_HMIRROR_ROT180_BIT_KHR             = 0x00000040,
+    VK_SURFACE_TRANSFORM_HMIRROR_ROT270_BIT_KHR             = 0x00000080,
+    VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR                    = 0x00000100,
+}
 
 //////////////////
 //  Structures  //
@@ -992,6 +1043,8 @@
     VkPhysicalDeviceType                        deviceType
     char[VK_MAX_PHYSICAL_DEVICE_NAME]           deviceName
     u8[VK_UUID_LENGTH]                          pipelineCacheUUID
+    VkPhysicalDeviceLimits                      limits
+    VkPhysicalDeviceSparseProperties            sparseProperties
 }
 
 class VkExtensionProperties {
@@ -1023,6 +1076,8 @@
 }
 
 class VkDeviceQueueCreateInfo {
+    VkStructureType                             sStype                    /// Should be VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO
+    const void*                                 pNext                     /// Pointer to next structure
     u32                                         queueFamilyIndex
     u32                                         queueCount
 }
@@ -1037,7 +1092,6 @@
     u32                                         extensionCount
     const char* const*                          ppEnabledExtensionNames
     const VkPhysicalDeviceFeatures*             pEnabledFeatures
-    VkDeviceCreateFlags                         flags                      /// Device creation flags
 }
 
 class VkInstanceCreateInfo {
@@ -1051,10 +1105,10 @@
     const char* const*                          ppEnabledExtensionNames    /// Extension names to be enabled
 }
 
-class VkPhysicalDeviceQueueProperties {
+class VkQueueFamilyProperties {
     VkQueueFlags                                queueFlags                 /// Queue flags
     u32                                         queueCount
-    platform.VkBool32                           supportsTimestamps
+    VkBool32                                    supportsTimestamps
 }
 
 class VkPhysicalDeviceMemoryProperties {
@@ -1067,13 +1121,13 @@
 class VkMemoryAllocInfo {
     VkStructureType                             sType                      /// Must be VK_STRUCTURE_TYPE_MEMORY_ALLOC_INFO
     const void*                                 pNext                      /// Pointer to next structure
-    platform.VkDeviceSize                       allocationSize             /// Size of memory allocation
+    VkDeviceSize                                allocationSize             /// Size of memory allocation
     u32                                         memoryTypeIndex            /// Index of the of the memory type to allocate from
 }
 
 class VkMemoryRequirements {
-    platform.VkDeviceSize                       size                       /// Specified in bytes
-    platform.VkDeviceSize                       alignment                  /// Specified in bytes
+    VkDeviceSize                                size                       /// Specified in bytes
+    VkDeviceSize                                alignment                  /// Specified in bytes
     u32                                         memoryTypeBits             /// Bitfield of the allowed memory type indices into memoryTypes[] for this object
 }
 
@@ -1086,9 +1140,9 @@
 class VkSparseImageMemoryRequirements {
     VkSparseImageFormatProperties               formatProps
     u32                                         imageMipTailStartLOD
-    platform.VkDeviceSize                       imageMipTailSize           /// Specified in bytes, must be a multiple of image block size / alignment
-    platform.VkDeviceSize                       imageMipTailOffset         /// Specified in bytes, must be a multiple of image block size / alignment
-    platform.VkDeviceSize                       imageMipTailStride         /// Specified in bytes, must be a multiple of image block size / alignment
+    VkDeviceSize                                imageMipTailSize           /// Specified in bytes, must be a multiple of image block size / alignment
+    VkDeviceSize                                imageMipTailOffset         /// Specified in bytes, must be a multiple of image block size / alignment
+    VkDeviceSize                                imageMipTailStride         /// Specified in bytes, must be a multiple of image block size / alignment
 }
 
 class VkMemoryType {
@@ -1097,7 +1151,7 @@
 }
 
 class VkMemoryHeap {
-    platform.VkDeviceSize                       size                       /// Available memory in the heap
+    VkDeviceSize                                size                       /// Available memory in the heap
     VkMemoryHeapFlags                           flags                      /// Flags for the heap
 }
 
@@ -1105,26 +1159,36 @@
     VkStructureType                             sType                      /// Must be VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE
     const void*                                 pNext                      /// Pointer to next structure
     VkDeviceMemory                              mem                        /// Mapped memory object
-    platform.VkDeviceSize                       offset                     /// Offset within the mapped memory the range starts from
-    platform.VkDeviceSize                       size                       /// Size of the range within the mapped memory
+    VkDeviceSize                                offset                     /// Offset within the mapped memory the range starts from
+    VkDeviceSize                                size                       /// Size of the range within the mapped memory
 }
 
 class VkFormatProperties {
     VkFormatFeatureFlags                        linearTilingFeatures       /// Format features in case of linear tiling
     VkFormatFeatureFlags                        optimalTilingFeatures      /// Format features in case of optimal tiling
+    VkFormatFeatureFlags                        bufferFeatures             /// Format features supported by buffers
 }
 
 class VkImageFormatProperties {
-    u64                                         maxResourceSize            /// max size (in bytes) of this resource type
-    u32                                         maxSamples                 /// max sample count for this resource type
+    VkExtent3D                                  maxExtent                  /// max image dimensions for this resource type
+    u32                                         maxMipLevels               /// max number of mipmap levels for this resource type
+    u32                                         maxArraySize               /// max array size for this resource type
+    VkSampleCountFlags                          sampleCounts               /// supported sample counts for this resource type
+    VkDeviceSize                                maxResourceSize            /// max size (in bytes) of this resource type
+}
+
+class VkDescriptorBufferInfo {
+    VkBuffer                                    buffer                     /// Buffer used for this descriptor when the descriptor is UNIFORM_BUFFER[_DYNAMIC]
+    VkDeviceSize                                offset                     /// Base offset from buffer start in bytes to update in the descriptor set.
+    VkDeviceSize                                range                      /// Size in bytes of the buffer resource for this descriptor update.
 }
 
 class VkDescriptorInfo {
     VkBufferView                                bufferView                 /// Buffer view to write to the descriptor (in case it's a buffer descriptor, otherwise should be VK_NULL_HANDLE)
     VkSampler                                   sampler                    /// Sampler to write to the descriptor (in case it's a SAMPLER or COMBINED_IMAGE_SAMPLER descriptor, otherwise should be VK_NULL_HANDLE)
-    VkImageView                                 imageView                  /// Image view to write to the descriptor (in case it's a SAMPLED_IMAGE, STORAGE_IMAGE, or COMBINED_IMAGE_SAMPLER descriptor, otherwise should be VK_NULL_HANDLE)
-    VkAttachmentView                            attachmentView             /// Input attachment view to write to the descriptor (in case it's a INPUT_ATTACHMENT descriptor, otherwise should be VK_NULL_HANDLE)
-    VkImageLayout                               imageLayout                /// Layout the image is expected to be in when accessed using this descriptor (only used if imageView or attachmentView is not VK_NULL_HANDLE)
+    VkImageView                                 imageView                  /// Image view to write to the descriptor (in case it's a SAMPLED_IMAGE, STORAGE_IMAGE, COMBINED_IMAGE_SAMPLER, or INPUT_ATTACHMENT descriptor, otherwise should be VK_NULL_HANDLE)
+    VkImageLayout                               imageLayout                /// Layout the image is expected to be in when accessed using this descriptor (only used if imageView is not VK_NULL_HANDLE)
+    VkDescriptorBufferInfo                      bufferInfo                 /// Raw buffer, size and offset for UNIFORM_BUFFER[_DYNAMIC] or STORAGE_BUFFER[_DYNAMIC] descriptor types. Ignored otherwise.
 }
 
 class VkWriteDescriptorSet {
@@ -1153,7 +1217,7 @@
 class VkBufferCreateInfo {
     VkStructureType                             sType                      /// Must be VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO
     const void*                                 pNext                      /// Pointer to next structure.
-    platform.VkDeviceSize                       size                       /// Specified in bytes
+    VkDeviceSize                                size                       /// Specified in bytes
     VkBufferUsageFlags                          usage                      /// Buffer usage flags
     VkBufferCreateFlags                         flags                      /// Buffer creation flags
     VkSharingMode                               sharingMode
@@ -1165,23 +1229,22 @@
     VkStructureType                             sType                      /// Must be VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO
     const void*                                 pNext                      /// Pointer to next structure.
     VkBuffer                                    buffer
-    VkBufferViewType                            viewType
     VkFormat                                    format                     /// Optionally specifies format of elements
-    platform.VkDeviceSize                       offset                     /// Specified in bytes
-    platform.VkDeviceSize                       range                      /// View size specified in bytes
+    VkDeviceSize                                offset                     /// Specified in bytes
+    VkDeviceSize                                range                      /// View size specified in bytes
 }
 
 class VkImageSubresource {
     VkImageAspect                               aspect
     u32                                         mipLevel
-    u32                                         arraySlice
+    u32                                         arrayLayer
 }
 
 class VkImageSubresourceRange {
-    VkImageAspect                               aspect
+    VkImageAspectFlags                          aspectMask
     u32                                         baseMipLevel
     u32                                         mipLevels
-    u32                                         baseArraySlice
+    u32                                         baseArrayLayer
     u32                                         arraySize
 }
 
@@ -1200,8 +1263,8 @@
     u32                                         srcQueueFamilyIndex        /// Queue family to transition ownership from
     u32                                         destQueueFamilyIndex       /// Queue family to transition ownership to
     VkBuffer                                    buffer                     /// Buffer to sync
-    platform.VkDeviceSize                       offset                     /// Offset within the buffer to sync
-    platform.VkDeviceSize                       size                       /// Amount of bytes to sync
+    VkDeviceSize                                offset                     /// Offset within the buffer to sync
+    VkDeviceSize                                size                       /// Amount of bytes to sync
 }
 
 class VkImageMemoryBarrier {
@@ -1232,13 +1295,14 @@
     VkSharingMode                               sharingMode                /// Cross-queue-family sharing mode
     u32                                         queueFamilyCount           /// Number of queue families to share across
     const u32*                                  pQueueFamilyIndices        /// Array of queue family indices to share across
+    VkImageLayout                               initialLayout              /// Initial image layout for all subresources
 }
 
 class VkSubresourceLayout {
-    platform.VkDeviceSize                       offset                 /// Specified in bytes
-    platform.VkDeviceSize                       size                   /// Specified in bytes
-    platform.VkDeviceSize                       rowPitch               /// Specified in bytes
-    platform.VkDeviceSize                       depthPitch             /// Specified in bytes
+    VkDeviceSize                                offset                 /// Specified in bytes
+    VkDeviceSize                                size                   /// Specified in bytes
+    VkDeviceSize                                rowPitch               /// Specified in bytes
+    VkDeviceSize                                depthPitch             /// Specified in bytes
 }
 
 class VkImageViewCreateInfo {
@@ -1249,34 +1313,19 @@
     VkFormat                                    format
     VkChannelMapping                            channels
     VkImageSubresourceRange                     subresourceRange
-}
-
-class VkAttachmentViewCreateInfo {
-    VkStructureType                             sType                  /// Must be VK_STRUCTURE_TYPE_ATTACHMENT_VIEW_CREATE_INFO
-    const void*                                 pNext                  /// Pointer to next structure
-    VkImage                                     image
-    VkFormat                                    format
-    u32                                         mipLevel
-    u32                                         baseArraySlice
-    u32                                         arraySize
-    VkAttachmentViewCreateFlags                 flags                  /// Framebuffer attachment view flags
-}
-
-class VkAttachmentBindInfo {
-    VkAttachmentView                            view
-    VkImageLayout                               layout
+    VkImageViewCreateFlags                      flags
 }
 
 class VkBufferCopy {
-    platform.VkDeviceSize                       srcOffset              /// Specified in bytes
-    platform.VkDeviceSize                       destOffset             /// Specified in bytes
-    platform.VkDeviceSize                       copySize               /// Specified in bytes
+    VkDeviceSize                                srcOffset              /// Specified in bytes
+    VkDeviceSize                                destOffset             /// Specified in bytes
+    VkDeviceSize                                copySize               /// Specified in bytes
 }
 
 class VkSparseMemoryBindInfo {
-    platform.VkDeviceSize                       rangeOffset           /// Specified in bytes
-    platform.VkDeviceSize                       rangeSize             /// Specified in bytes
-    platform.VkDeviceSize                       memOffset             /// Specified in bytes
+    VkDeviceSize                                rangeOffset           /// Specified in bytes
+    VkDeviceSize                                rangeSize             /// Specified in bytes
+    VkDeviceSize                                memOffset             /// Specified in bytes
     VkDeviceMemory                              mem
     VkSparseMemoryBindFlags                     flags
 }
@@ -1285,41 +1334,48 @@
     VkImageSubresource                          subresource
     VkOffset3D                                  offset
     VkExtent3D                                  extent
-    platform.VkDeviceSize                       memOffset             /// Specified in bytes
+    VkDeviceSize                                memOffset             /// Specified in bytes
     VkDeviceMemory                              mem
     VkSparseMemoryBindFlags                     flags
 }
 
+class VkImageSubresourceCopy {
+    VkImageAspect                               aspect
+    u32                                         mipLevel
+    u32                                         arrayLayer
+    u32                                         arraySize
+}
+
 class VkImageCopy {
-    VkImageSubresource                          srcSubresource
+    VkImageSubresourceCopy                      srcSubresource
     VkOffset3D                                  srcOffset             /// Specified in pixels for both compressed and uncompressed images
-    VkImageSubresource                          destSubresource
+    VkImageSubresourceCopy                      destSubresource
     VkOffset3D                                  destOffset            /// Specified in pixels for both compressed and uncompressed images
     VkExtent3D                                  extent                /// Specified in pixels for both compressed and uncompressed images
 }
 
 class VkImageBlit {
-    VkImageSubresource                          srcSubresource
+    VkImageSubresourceCopy                      srcSubresource
     VkOffset3D                                  srcOffset              /// Specified in pixels for both compressed and uncompressed images
     VkExtent3D                                  srcExtent              /// Specified in pixels for both compressed and uncompressed images
-    VkImageSubresource                          destSubresource
+    VkImageSubresourceCopy                      destSubresource
     VkOffset3D                                  destOffset             /// Specified in pixels for both compressed and uncompressed images
     VkExtent3D                                  destExtent             /// Specified in pixels for both compressed and uncompressed images
 }
 
 class VkBufferImageCopy {
-    platform.VkDeviceSize                       bufferOffset           /// Specified in bytes
+    VkDeviceSize                                bufferOffset           /// Specified in bytes
     u32                                         bufferRowLength        /// Specified in texels
     u32                                         bufferImageHeight
-    VkImageSubresource                          imageSubresource
+    VkImageSubresourceCopy                      imageSubresource
     VkOffset3D                                  imageOffset            /// Specified in pixels for both compressed and uncompressed images
     VkExtent3D                                  imageExtent            /// Specified in pixels for both compressed and uncompressed images
 }
 
 class VkImageResolve {
-    VkImageSubresource                          srcSubresource
+    VkImageSubresourceCopy                      srcSubresource
     VkOffset3D                                  srcOffset
-    VkImageSubresource                          destSubresource
+    VkImageSubresourceCopy                      destSubresource
     VkOffset3D                                  destOffset
     VkExtent3D                                  extent
 }
@@ -1338,6 +1394,7 @@
     VkShaderModule                              module             /// Module containing entry point
     const char*                                 pName              /// Null-terminated entry point name
     VkShaderCreateFlags                         flags              /// Reserved
+    VkShaderStage                               stage
 }
 
 class VkDescriptorSetLayoutBinding {
@@ -1362,6 +1419,8 @@
 class VkDescriptorPoolCreateInfo {
     VkStructureType                             sType              /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO
     const void*                                 pNext              /// Pointer to next structure
+    VkDescriptorPoolUsage                       poolUsage
+    u32                                         maxSets
     u32                                         count
     const VkDescriptorTypeCount*                pTypeCount
 }
@@ -1390,7 +1449,7 @@
 class VkComputePipelineCreateInfo {
     VkStructureType                             sType              /// Must be VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO
     const void*                                 pNext              /// Pointer to next structure
-    VkPipelineShaderStageCreateInfo             cs
+    VkPipelineShaderStageCreateInfo             stage
     VkPipelineCreateFlags                       flags              /// Pipeline creation flags
     VkPipelineLayout                            layout             /// Interface layout of the pipeline
     VkPipeline                                  basePipelineHandle /// If VK_PIPELINE_CREATE_DERIVATIVE_BIT is set and this value is nonzero, it specifies the handle of the base pipeline this is a derivative of
@@ -1423,7 +1482,7 @@
     VkStructureType                             sType      /// Must be VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO
     const void*                                 pNext      /// Pointer to next structure
     VkPrimitiveTopology                         topology
-    platform.VkBool32                           primitiveRestartEnable
+    VkBool32                                    primitiveRestartEnable
 }
 
 class VkPipelineTessellationStateCreateInfo {
@@ -1436,29 +1495,37 @@
     VkStructureType                             sType      /// Must be VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO
     const void*                                 pNext      /// Pointer to next structure
     u32                                         viewportCount
+    const VkViewport*                           pViewports
+    u32                                         scissorCount
+    const VkRect2D*                             pScissors
 }
 
 class VkPipelineRasterStateCreateInfo {
     VkStructureType                             sType      /// Must be VK_STRUCTURE_TYPE_PIPELINE_RASTER_STATE_CREATE_INFO
     const void*                                 pNext      /// Pointer to next structure
-    platform.VkBool32                           depthClipEnable
-    platform.VkBool32                           rasterizerDiscardEnable
+    VkBool32                                    depthClipEnable
+    VkBool32                                    rasterizerDiscardEnable
     VkFillMode                                  fillMode                   /// optional (GL45)
     VkCullMode                                  cullMode
     VkFrontFace                                 frontFace
+    VkBool32                                    depthBiasEnable
+    f32                                         depthBias
+    f32                                         depthBiasClamp
+    f32                                         slopeScaledDepthBias
+    f32                                         lineWidth
 }
 
 class VkPipelineMultisampleStateCreateInfo {
     VkStructureType                             sType      /// Must be VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO
     const void*                                 pNext      /// Pointer to next structure
     u32                                         rasterSamples              /// Number of samples used for rasterization
-    platform.VkBool32                           sampleShadingEnable        /// optional (GL45)
+    VkBool32                                    sampleShadingEnable        /// optional (GL45)
     f32                                         minSampleShading           /// optional (GL45)
-    platform.VkSampleMask                       sampleMask
+    const VkSampleMask*                         pSampleMask
 }
 
 class VkPipelineColorBlendAttachmentState {
-    platform.VkBool32                           blendEnable
+    VkBool32                                    blendEnable
     VkBlend                                     srcBlendColor
     VkBlend                                     destBlendColor
     VkBlendOp                                   blendOpColor
@@ -1471,11 +1538,13 @@
 class VkPipelineColorBlendStateCreateInfo {
     VkStructureType                             sType      /// Must be VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO
     const void*                                 pNext      /// Pointer to next structure
-    platform.VkBool32                           alphaToCoverageEnable
-    platform.VkBool32                           logicOpEnable
+    VkBool32                                    alphaToCoverageEnable
+    VkBool32                                    alphaToOneEnable
+    VkBool32                                    logicOpEnable
     VkLogicOp                                   logicOp
     u32                                         attachmentCount    /// # of pAttachments
     const VkPipelineColorBlendAttachmentState*  pAttachments
+    f32[4]                                      blendConst
 }
 
 class VkStencilOpState {
@@ -1483,18 +1552,30 @@
     VkStencilOp                                 stencilPassOp
     VkStencilOp                                 stencilDepthFailOp
     VkCompareOp                                 stencilCompareOp
+    u32                                         stencilCompareMask
+    u32                                         stencilWriteMask
+    u32                                         stencilReference
 }
 
 class VkPipelineDepthStencilStateCreateInfo {
     VkStructureType                             sType      /// Must be VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO
     const void*                                 pNext      /// Pointer to next structure
-    platform.VkBool32                           depthTestEnable
-    platform.VkBool32                           depthWriteEnable
+    VkBool32                                    depthTestEnable
+    VkBool32                                    depthWriteEnable
     VkCompareOp                                 depthCompareOp
-    platform.VkBool32                           depthBoundsEnable  /// optional (depth_bounds_test)
-    platform.VkBool32                           stencilTestEnable
+    VkBool32                                    depthBoundsTestEnable  /// optional (depth_bounds_test)
+    VkBool32                                    stencilTestEnable
     VkStencilOpState                            front
     VkStencilOpState                            back
+    f32                                         minDepthBounds
+    f32                                         maxDepthBounds
+}
+
+class VkPipelineDynamicStateCreateInfo {
+    VkStructureType                             sType      /// Must be VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO
+    const void*                                 pNext      /// Pointer to next structure
+    u32                                         dynamicStateCount
+    const VkDynamicState*                       pDynamicStates
 }
 
 class VkGraphicsPipelineCreateInfo {
@@ -1510,6 +1591,7 @@
     const VkPipelineMultisampleStateCreateInfo*     pMultisampleState
     const VkPipelineDepthStencilStateCreateInfo*    pDepthStencilState
     const VkPipelineColorBlendStateCreateInfo*      pColorBlendState
+    const VkPipelineDynamicStateCreateInfo*         pDynamicState
     VkPipelineCreateFlags                           flags              /// Pipeline creation flags
     VkPipelineLayout                                layout             /// Interface layout of the pipeline
     VkRenderPass                                    renderPass
@@ -1547,50 +1629,17 @@
     VkTexFilter                                 magFilter      /// Filter mode for magnification
     VkTexFilter                                 minFilter      /// Filter mode for minifiation
     VkTexMipmapMode                             mipMode        /// Mipmap selection mode
-    VkTexAddress                                addressU
-    VkTexAddress                                addressV
-    VkTexAddress                                addressW
+    VkTexAddressMode                            addressModeU
+    VkTexAddressMode                            addressModeV
+    VkTexAddressMode                            addressModeW
     f32                                         mipLodBias
     f32                                         maxAnisotropy
-    platform.VkBool32                           compareEnable
+    VkBool32                                    compareEnable
     VkCompareOp                                 compareOp
     f32                                         minLod
     f32                                         maxLod
     VkBorderColor                               borderColor
-}
-
-class VkDynamicViewportStateCreateInfo {
-    VkStructureType                             sType      /// Must be VK_STRUCTURE_TYPE_DYNAMIC_VIEWPORT_STATE_CREATE_INFO
-    const void*                                 pNext      /// Pointer to next structure
-    u32                                         viewportAndScissorCount  /// number of entries in pViewports and pScissors
-    const VkViewport*                           pViewports
-    const VkRect2D*                             pScissors
-}
-
-class VkDynamicRasterStateCreateInfo {
-    VkStructureType                             sType      /// Must be VK_STRUCTURE_TYPE_DYNAMIC_RASTER_STATE_CREATE_INFO
-    const void*                                 pNext      /// Pointer to next structure
-    f32                                         depthBias
-    f32                                         depthBiasClamp
-    f32                                         slopeScaledDepthBias
-    f32                                         lineWidth          /// optional (GL45) - Width of lines
-}
-
-class VkDynamicColorBlendStateCreateInfo {
-    VkStructureType                             sType      /// Must be VK_STRUCTURE_TYPE_DYNAMIC_COLOR_BLEND_STATE_CREATE_INFO
-    const void*                                 pNext      /// Pointer to next structure
-    f32[4]                                      blendConst
-}
-
-class VkDynamicDepthStencilStateCreateInfo {
-    VkStructureType                             sType      /// Must be VK_STRUCTURE_TYPE_DYNAMIC_DEPTH_STENCIL_STATE_CREATE_INFO
-    const void*                                 pNext      /// Pointer to next structure
-    f32                                         minDepthBounds         /// optional (depth_bounds_test)
-    f32                                         maxDepthBounds         /// optional (depth_bounds_test)
-    u32                                         stencilReadMask
-    u32                                         stencilWriteMask
-    u32                                         stencilFrontRef
-    u32                                         stencilBackRef
+    VkBool32                                    unnormalizedCoordinates
 }
 
 class VkCmdPoolCreateInfo {
@@ -1613,6 +1662,7 @@
     const void*                                 pNext       /// Pointer to next structure
     VkCmdBufferOptimizeFlags                    flags       /// Command buffer optimization flags
     VkRenderPass                                renderPass  /// Render pass for secondary command buffers
+    u32                                         subpass
     VkFramebuffer                               framebuffer /// Framebuffer for secondary command buffers
 }
 
@@ -1622,16 +1672,16 @@
     VkRenderPass                                renderPass
     VkFramebuffer                               framebuffer
     VkRect2D                                    renderArea
-    u32                                         attachmentCount
-    const VkClearValue*                         pAttachmentClearValues
+    u32                                         clearValueCount
+    const VkClearValue*                         pClearValues
 }
 
 @union
 /// Union allowing specification of floating point, integer, or unsigned integer color data. Actual value selected is based on image/attachment being cleared.
 class VkClearColorValue {
-    f32[4]                                      f32
-    s32[4]                                      s32
-    u32[4]                                      u32
+    f32[4]                                      float32
+    s32[4]                                      int32
+    u32[4]                                      uint32
 }
 
 class VkClearDepthStencilValue {
@@ -1643,7 +1693,7 @@
 /// Union allowing specification of color, depth, and stencil color values. Actual value selected is based on attachment being cleared.
 class VkClearValue {
     VkClearColorValue                           color
-    VkClearDepthStencilValue                    ds
+    VkClearDepthStencilValue                    depthStencil
 }
 
 class VkAttachmentDescription {
@@ -1657,6 +1707,7 @@
     VkAttachmentStoreOp                         stencilStoreOp  /// Store op for stencil data
     VkImageLayout                               initialLayout
     VkImageLayout                               finalLayout
+    VkAttachmentDescriptionFlags                flags
 }
 
 class VkAttachmentReference {
@@ -1670,13 +1721,13 @@
     VkPipelineBindPoint                         pipelineBindPoint  /// Must be VK_PIPELINE_BIND_POINT_GRAPHICS for now
     VkSubpassDescriptionFlags                   flags
     u32                                         inputCount
-    const VkAttachmentReference*                inputAttachments
+    const VkAttachmentReference*                pInputAttachments
     u32                                         colorCount
-    const VkAttachmentReference*                colorAttachments
-    const VkAttachmentReference*                resolveAttachments
+    const VkAttachmentReference*                pColorAttachments
+    const VkAttachmentReference*                pResolveAttachments
     VkAttachmentReference                       depthStencilAttachment
     u32                                         preserveCount
-    const VkAttachmentReference*                preserveAttachments
+    const VkAttachmentReference*                pPreserveAttachments
 }
 
 class VkSubpassDependency {
@@ -1688,7 +1739,7 @@
     VkPipelineStageFlags                        destStageMask
     VkMemoryOutputFlags                         outputMask
     VkMemoryInputFlags                          inputMask
-    platform.VkBool32                           byRegion
+    VkBool32                                    byRegion
 }
 
 class VkRenderPassCreateInfo {
@@ -1715,64 +1766,57 @@
 }
 
 class VkPhysicalDeviceFeatures {
-    platform.VkBool32                           robustBufferAccess                        /// out of bounds buffer accesses are well defined
-    platform.VkBool32                           fullDrawIndexUint32                       /// full 32-bit range of indices for indexed draw calls
-    platform.VkBool32                           imageCubeArray                            /// image views which are arrays of cube maps
-    platform.VkBool32                           independentBlend                          /// blending operations are controlled per-attachment
-    platform.VkBool32                           geometryShader                            /// geometry stage
-    platform.VkBool32                           tessellationShader                        /// tessellation control and evaluation stage
-    platform.VkBool32                           sampleRateShading                         /// per-sample shading and interpolation
-    platform.VkBool32                           dualSourceBlend                           /// blend operations which take two sources
-    platform.VkBool32                           logicOp                                   /// logic operations
-    platform.VkBool32                           instancedDrawIndirect                     /// multi draw indirect
-    platform.VkBool32                           depthClip                                 /// depth clipping
-    platform.VkBool32                           depthBiasClamp                            /// depth bias clamping
-    platform.VkBool32                           fillModeNonSolid                          /// point and wireframe fill modes
-    platform.VkBool32                           depthBounds                               /// depth bounds test
-    platform.VkBool32                           wideLines                                 /// lines with width greater than 1
-    platform.VkBool32                           largePoints                               /// points with size greater than 1
-    platform.VkBool32                           textureCompressionETC2                    /// ETC texture compression formats
-    platform.VkBool32                           textureCompressionASTC_LDR                /// ASTC LDR texture compression formats
-    platform.VkBool32                           textureCompressionBC                      /// BC1-7 texture compressed formats
-    platform.VkBool32                           pipelineStatisticsQuery                   /// pipeline statistics query
-    platform.VkBool32                           vertexSideEffects                         /// storage buffers and images in vertex stage
-    platform.VkBool32                           tessellationSideEffects                   /// storage buffers and images in tessellation stage
-    platform.VkBool32                           geometrySideEffects                       /// storage buffers and images in geometry stage
-    platform.VkBool32                           fragmentSideEffects                       /// storage buffers and images in fragment stage
-    platform.VkBool32                           shaderTessellationPointSize               /// tessellation stage can export point size
-    platform.VkBool32                           shaderGeometryPointSize                   /// geometry stage can export point size
-    platform.VkBool32                           shaderTextureGatherExtended               /// texture gather with run-time values and independent offsets
-    platform.VkBool32                           shaderStorageImageExtendedFormats         /// the extended set of formats can be used for storage images
-    platform.VkBool32                           shaderStorageImageMultisample             /// multisample images can be used for storage images
-    platform.VkBool32                           shaderStorageBufferArrayConstantIndexing  /// arrays of storage buffers can be accessed with constant indices
-    platform.VkBool32                           shaderStorageImageArrayConstantIndexing   /// arrays of storage images can be accessed with constant indices
-    platform.VkBool32                           shaderUniformBufferArrayDynamicIndexing   /// arrays of uniform buffers can be accessed with dynamically uniform indices
-    platform.VkBool32                           shaderSampledImageArrayDynamicIndexing    /// arrays of sampled images can be accessed with dynamically uniform indices
-    platform.VkBool32                           shaderStorageBufferArrayDynamicIndexing   /// arrays of storage buffers can be accessed with dynamically uniform indices
-    platform.VkBool32                           shaderStorageImageArrayDynamicIndexing    /// arrays of storage images can be accessed with dynamically uniform indices
-    platform.VkBool32                           shaderClipDistance                        /// clip distance in shaders
-    platform.VkBool32                           shaderCullDistance                        /// cull distance in shaders
-    platform.VkBool32                           shaderFloat64                             /// 64-bit floats (doubles) in shaders
-    platform.VkBool32                           shaderInt64                               /// 64-bit integers in shaders
-    platform.VkBool32                           shaderFloat16                             /// 16-bit floats in shaders
-    platform.VkBool32                           shaderInt16                               /// 16-bit integers in shaders
-    platform.VkBool32                           shaderResourceResidency                   /// shader can use texture operations that return resource residency information (requires sparseNonResident support)
-    platform.VkBool32                           shaderResourceMinLOD                      /// shader can use texture operations that specify minimum resource LOD
-    platform.VkBool32                           sparse                                    /// Sparse resources support: Resource memory can be managed at opaque page level rather than object level
-    platform.VkBool32                           sparseResidencyBuffer                     /// Sparse resources support: GPU can access partially resident buffers
-    platform.VkBool32                           sparseResidencyImage2D                    /// Sparse resources support: GPU can access partially resident 2D (non-MSAA non-DepthStencil) images
-    platform.VkBool32                           sparseResidencyImage3D                    /// Sparse resources support: GPU can access partially resident 3D images
-    platform.VkBool32                           sparseResidency2Samples                   /// Sparse resources support: GPU can access partially resident MSAA 2D images with 2 samples
-    platform.VkBool32                           sparseResidency4Samples                   /// Sparse resources support: GPU can access partially resident MSAA 2D images with 4 samples
-    platform.VkBool32                           sparseResidency8Samples                   /// Sparse resources support: GPU can access partially resident MSAA 2D images with 8 samples
-    platform.VkBool32                           sparseResidency16Samples                  /// Sparse resources support: GPU can access partially resident MSAA 2D images with 16 samples
-    platform.VkBool32                           sparseResidencyStandard2DBlockShape       /// Sparse resources support: GPU will access all 2D (single sample) sparse resources using the standard block shapes (based on pixel format)
-    platform.VkBool32                           sparseResidencyStandard2DMSBlockShape     /// Sparse resources support: GPU will access all 2D (multisample) sparse resources using the standard block shapes (based on pixel format)
-    platform.VkBool32                           sparseResidencyStandard3DBlockShape       /// Sparse resources support: GPU will access all 3D sparse resources using the standard block shapes (based on pixel format)
-    platform.VkBool32                           sparseResidencyAlignedMipSize             /// Sparse resources support: Images with mip-level dimensions that are NOT a multiple of the block size will be placed in the mip tail
-    platform.VkBool32                           sparseResidencyNonResident                /// Sparse resources support: GPU can safely access non-resident regions of a resource, read values from read-write resources are undefined
-    platform.VkBool32                           sparseResidencyNonResidentStrict          /// Sparse resources support: GPU can safely access non-resident regions of a resource, all reads return as if data is 0, writes are discarded
-    platform.VkBool32                           sparseResidencyAliased                    /// Sparse resources support: GPU can correctly access data aliased into multiple locations (opt-in)
+    VkBool32                                    robustBufferAccess                        /// out of bounds buffer accesses are well defined
+    VkBool32                                    fullDrawIndexUint32                       /// full 32-bit range of indices for indexed draw calls
+    VkBool32                                    imageCubeArray                            /// image views which are arrays of cube maps
+    VkBool32                                    independentBlend                          /// blending operations are controlled per-attachment
+    VkBool32                                    geometryShader                            /// geometry stage
+    VkBool32                                    tessellationShader                        /// tessellation control and evaluation stage
+    VkBool32                                    sampleRateShading                         /// per-sample shading and interpolation
+    VkBool32                                    dualSourceBlend                           /// blend operations which take two sources
+    VkBool32                                    logicOp                                   /// logic operations
+    VkBool32                                    multiDrawIndirect                         /// multi draw indirect
+    VkBool32                                    depthClip                                 /// depth clipping
+    VkBool32                                    depthBiasClamp                            /// depth bias clamping
+    VkBool32                                    fillModeNonSolid                          /// point and wireframe fill modes
+    VkBool32                                    depthBounds                               /// depth bounds test
+    VkBool32                                    wideLines                                 /// lines with width greater than 1
+    VkBool32                                    largePoints                               /// points with size greater than 1
+    VkBool32                                    textureCompressionETC2                    /// ETC texture compression formats
+    VkBool32                                    textureCompressionASTC_LDR                /// ASTC LDR texture compression formats
+    VkBool32                                    textureCompressionBC                      /// BC1-7 texture compressed formats
+    VkBool32                                    occlusionQueryNonConservative             /// non-conservative (exact) occlusion queries
+    VkBool32                                    pipelineStatisticsQuery                   /// pipeline statistics query
+    VkBool32                                    vertexSideEffects                         /// storage buffers and images in vertex stage
+    VkBool32                                    tessellationSideEffects                   /// storage buffers and images in tessellation stage
+    VkBool32                                    geometrySideEffects                       /// storage buffers and images in geometry stage
+    VkBool32                                    fragmentSideEffects                       /// storage buffers and images in fragment stage
+    VkBool32                                    shaderTessellationPointSize               /// tessellation stage can export point size
+    VkBool32                                    shaderGeometryPointSize                   /// geometry stage can export point size
+    VkBool32                                    shaderImageGatherExtended                 /// texture gather with run-time values and independent offsets
+    VkBool32                                    shaderStorageImageExtendedFormats         /// the extended set of formats can be used for storage images
+    VkBool32                                    shaderStorageImageMultisample             /// multisample images can be used for storage images
+    VkBool32                                    shaderUniformBufferArrayDynamicIndexing   /// arrays of uniform buffers can be accessed with dynamically uniform indices
+    VkBool32                                    shaderSampledImageArrayDynamicIndexing    /// arrays of sampled images can be accessed with dynamically uniform indices
+    VkBool32                                    shaderStorageBufferArrayDynamicIndexing   /// arrays of storage buffers can be accessed with dynamically uniform indices
+    VkBool32                                    shaderStorageImageArrayDynamicIndexing    /// arrays of storage images can be accessed with dynamically uniform indices
+    VkBool32                                    shaderClipDistance                        /// clip distance in shaders
+    VkBool32                                    shaderCullDistance                        /// cull distance in shaders
+    VkBool32                                    shaderFloat64                             /// 64-bit floats (doubles) in shaders
+    VkBool32                                    shaderInt64                               /// 64-bit integers in shaders
+    VkBool32                                    shaderInt16                               /// 16-bit integers in shaders
+    VkBool32                                    shaderResourceResidency                   /// shader can use texture operations that return resource residency information (requires sparseNonResident support)
+    VkBool32                                    shaderResourceMinLOD                      /// shader can use texture operations that specify minimum resource LOD
+    VkBool32                                    alphaToOne                                /// The fragment alpha channel can be forced to maximum representable alpha value
+    VkBool32                                    sparseBinding                             /// Sparse resources support: Resource memory can be managed at opaque page level rather than object level
+    VkBool32                                    sparseResidencyBuffer                     /// Sparse resources support: GPU can access partially resident buffers
+    VkBool32                                    sparseResidencyImage2D                    /// Sparse resources support: GPU can access partially resident 2D (non-MSAA non-DepthStencil) images
+    VkBool32                                    sparseResidencyImage3D                    /// Sparse resources support: GPU can access partially resident 3D images
+    VkBool32                                    sparseResidency2Samples                   /// Sparse resources support: GPU can access partially resident MSAA 2D images with 2 samples
+    VkBool32                                    sparseResidency4Samples                   /// Sparse resources support: GPU can access partially resident MSAA 2D images with 4 samples
+    VkBool32                                    sparseResidency8Samples                   /// Sparse resources support: GPU can access partially resident MSAA 2D images with 8 samples
+    VkBool32                                    sparseResidency16Samples                  /// Sparse resources support: GPU can access partially resident MSAA 2D images with 16 samples
+    VkBool32                                    sparseResidencyAliased                    /// Sparse resources support: GPU can correctly access data aliased into multiple locations (opt-in)
 }
 
 class VkPhysicalDeviceLimits {
@@ -1782,13 +1826,15 @@
     u32                                         maxImageDimension3D                       /// max 3D image dimension
     u32                                         maxImageDimensionCube                     /// max cubemap image dimension
     u32                                         maxImageArrayLayers                       /// max layers for image arrays
+    VkSampleCountFlags                          sampleCounts                              /// sample counts supported for all images supporting rendering and sampling
     u32                                         maxTexelBufferSize                        /// max texel buffer size (bytes)
     u32                                         maxUniformBufferSize                      /// max uniform buffer size (bytes)
     u32                                         maxStorageBufferSize                      /// max storage buffer size (bytes)
     u32                                         maxPushConstantsSize                      /// max size of the push constants pool (bytes)
     /// memory limits
     u32                                         maxMemoryAllocationCount                  /// max number of device memory allocations supported
-    platform.VkDeviceSize                       bufferImageGranularity                    /// Granularity (in bytes) at which buffers and images can be bound to adjacent memory for simultaneous usage
+    VkDeviceSize                                bufferImageGranularity                    /// Granularity (in bytes) at which buffers and images can be bound to adjacent memory for simultaneous usage
+    VkDeviceSize                                sparseAddressSpaceSize                    /// Total address space available for sparse allocations (bytes)
     /// descriptor set limits
     u32                                         maxBoundDescriptorSets                    /// max number of descriptors sets that can be bound to a pipeline
     u32                                         maxDescriptorSets                         /// max number of allocated descriptor sets
@@ -1799,11 +1845,14 @@
     u32                                         maxPerStageDescriptorStorageImages        /// max num of storage images allowed per-stage in a descriptor set
     u32                                         maxDescriptorSetSamplers                  /// max num of samplers allowed in all stages in a descriptor set
     u32                                         maxDescriptorSetUniformBuffers            /// max num of uniform buffers allowed in all stages in a descriptor set
+    u32                                         maxDescriptorSetUniformBuffersDynamic     /// max num of dynamic uniform buffers allowed in all stages in a descriptor set
     u32                                         maxDescriptorSetStorageBuffers            /// max num of storage buffers allowed in all stages in a descriptor set
+    u32                                         maxDescriptorSetStorageBuffersDynamic     /// max num of dynamic storage buffers allowed in all stages in a descriptor set
     u32                                         maxDescriptorSetSampledImages             /// max num of sampled images allowed in all stages in a descriptor set
     u32                                         maxDescriptorSetStorageImages             /// max num of storage images allowed in all stages in a descriptor set
     /// vertex stage limits
     u32                                         maxVertexInputAttributes                  /// max num of vertex input attribute slots
+    u32                                         maxVertexInputBindings                    /// max num of vertex input binding slots
     u32                                         maxVertexInputAttributeOffset             /// max vertex input attribute offset added to vertex buffer offset
     u32                                         maxVertexInputBindingStride               /// max vertex input binding stride
     u32                                         maxVertexOutputComponents                 /// max num of output components written by vertex shader
@@ -1839,13 +1888,12 @@
 
     u32                                         maxDrawIndexedIndexValue                  /// max index value for indexed draw calls (for 32-bit indices)
     u32                                         maxDrawIndirectInstanceCount              /// max instance count for indirect draw calls
-    platform.VkBool32                           primitiveRestartForPatches                /// is primitive restart supported for PATCHES
+    VkBool32                                    primitiveRestartForPatches                /// is primitive restart supported for PATCHES
 
     f32                                         maxSamplerLodBias                         /// max absolute sampler level of detail bias
     f32                                         maxSamplerAnisotropy                      /// max degree of sampler anisotropy
 
     u32                                         maxViewports                              /// max number of active viewports
-    u32                                         maxDynamicViewportStates                  /// max number of dynamic viewport state objects
     u32[2]                                      maxViewportDimensions                     /// max viewport dimensions (x,y)
     f32[2]                                      viewportBoundsRange                       /// viewport bounds range (min,max)
     u32                                         viewportSubPixelBits                      /// num bits of subpixel precision for viewport
@@ -1883,12 +1931,21 @@
     u32                                         maxCullDistances                          /// max number of cull distances
     u32                                         maxCombinedClipAndCullDistances           /// max combined number of user clipping
 
-    f32[2]                                      pointSizeRange                         /// range (min,max) of supported point sizes
-    f32[2]                                      lineWidthRange                         /// range (min,max) of supported line widths
+    f32[2]                                      pointSizeRange                            /// range (min,max) of supported point sizes
+    f32[2]                                      lineWidthRange                            /// range (min,max) of supported line widths
     f32                                         pointSizeGranularity                      /// granularity of supported point sizes
     f32                                         lineWidthGranularity                      /// granularity of supported line widths
 }
 
+class VkPhysicalDeviceSparseProperties {
+    VkBool32                                    residencyStandard2DBlockShape             /// Sparse resources support: GPU will access all 2D (single sample) sparse resources using the standard block shapes (based on pixel format)
+    VkBool32                                    residencyStandard2DMSBlockShape           /// Sparse resources support: GPU will access all 2D (multisample) sparse resources using the standard block shapes (based on pixel format)
+    VkBool32                                    residencyStandard3DBlockShape             /// Sparse resources support: GPU will access all 3D sparse resources using the standard block shapes (based on pixel format)
+    VkBool32                                    residencyAlignedMipSize                   /// Sparse resources support: Images with mip-level dimensions that are NOT a multiple of the block size will be placed in the mip tail
+    VkBool32                                    residencyNonResident                      /// Sparse resources support: GPU can safely access non-resident regions of a resource, read values from read-write resources are undefined
+    VkBool32                                    residencyNonResidentStrict                /// Sparse resources support: GPU can safely access non-resident regions of a resource, all reads return as if data is 0, writes are discarded
+}
+
 class VkSemaphoreCreateInfo {
     VkStructureType                             sType      /// Must be VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO
     const void*                                 pNext      /// Pointer to next structure
@@ -1908,7 +1965,7 @@
     const void*                                 pNext  /// Pointer to next structure
     VkRenderPass                                renderPass
     u32                                         attachmentCount
-    const VkAttachmentBindInfo*                 pAttachments
+    const VkImageView*                          pAttachments
     u32                                         width
     u32                                         height
     u32                                         layers
@@ -1935,6 +1992,72 @@
     u32                                         z
 }
 
+//////////////////
+//  Extensions  //
+//////////////////
+
+@extension("VK_EXT_KHR_device_swapchain")
+class VkSurfacePropertiesKHR {
+    u32                                     minImageCount
+    u32                                     maxImageCount
+    VkExtent2D                              currentExtent
+    VkExtent2D                              minImageExtent
+    VkExtent2D                              maxImageExtent
+    VkSurfaceTransformFlagsKHR              supportedTransforms
+    VkSurfaceTransformKHR                   currentTransform
+    u32                                     maxImageArraySize
+    VkImageUsageFlags                       supportedUsageFlags
+}
+
+@extension("VK_EXT_KHR_device_swapchain")
+class VkSurfaceFormatKHR {
+    VkFormat                                format
+    VkColorSpaceKHR                         colorSpace
+}
+
+@extension("VK_EXT_KHR_device_swapchain")
+class VkSwapchainCreateInfoKHR {
+    VkStructureType                          sType
+    const void*                              pNext
+    const VkSurfaceDescriptionKHR*           pSurfaceDescription
+    u32                                      minImageCount
+    VkFormat                                 imageFormat
+    VkColorSpaceKHR                          imageColorSpace
+    VkExtent2D                               imageExtent
+    VkImageUsageFlags                        imageUsageFlags
+    VkSurfaceTransformKHR                    preTransform
+    u32                                      imageArraySize
+    VkSharingMode                            sharingMode
+    u32                                      queueFamilyCount
+    const u32*                               pQueueFamilyIndices
+    VkPresentModeKHR                         presentMode
+    VkSwapchainKHR                           oldSwapchain
+    VkBool32                                 clipped
+}
+
+@extension("VK_EXT_KHR_device_swapchain")
+class VkPresentInfoKHR {
+    VkStructureType                          sType
+    const void*                              pNext
+    u32                                      swapchainCount
+    const VkSwapchainKHR*                    swapchains
+    const u32*                               imageIndices
+}
+
+@extension("VK_EXT_KHR_swapchain")
+class VkSurfaceDescriptionKHR {
+    VkStructureType                          sType
+    const void*                              pNext
+}
+
+@extension("VK_EXT_KHR_swapchain")
+class VkSurfaceDescriptionWindowKHR {
+    VkStructureType                         sType
+    const void*                             pNext
+    VkPlatformKHR                           platform
+    void*                                   pPlatformHandle
+    void*                                   pPlatformWindow
+}
 
 ////////////////
 //  Commands  //
@@ -1981,13 +2104,11 @@
 }
 
 @threadSafety("system")
-cmd VkResult vkDestroyInstance(
+cmd void vkDestroyInstance(
         VkInstance                                  instance) {
     instanceObject := GetInstance(instance)
 
     State.Instances[instance] = null
-
-    return ?
 }
 
 @threadSafety("system")
@@ -2015,7 +2136,7 @@
 cmd PFN_vkVoidFunction vkGetDeviceProcAddr(
         VkDevice                                    device,
         const char*                                 pName) {
-    if device != VK_NULL_HANDLE {
+    if device != NULL_HANDLE {
         device := GetDevice(device)
     }
 
@@ -2025,7 +2146,7 @@
 cmd PFN_vkVoidFunction vkGetInstanceProcAddr(
         VkInstance                                  instance,
         const char*                                 pName) {
-    if instance != VK_NULL_HANDLE {
+    if instance != NULL_HANDLE {
         instanceObject := GetInstance(instance)
     }
 
@@ -2043,27 +2164,25 @@
     return ?
 }
 
-cmd VkResult vkGetPhysicalDeviceQueueCount(
+cmd VkResult vkGetPhysicalDeviceQueueFamilyProperties(
         VkPhysicalDevice                            physicalDevice,
-        u32*                                        pCount) {
+        u32*                                        pCount,
+        VkQueueFamilyProperties*                    pQueueFamilyProperties) {
     physicalDeviceObject := GetPhysicalDevice(physicalDevice)
-
-    count := ?
-    pCount[0] = count
-
-    return ?
-}
-
-cmd VkResult vkGetPhysicalDeviceQueueProperties(
-        VkPhysicalDevice                            physicalDevice,
-        u32                                         count,
-        VkPhysicalDeviceQueueProperties*            pQueueProperties) {
-    physicalDeviceObject := GetPhysicalDevice(physicalDevice)
-    queuesProperties := pQueueProperties[0:count]
-    for i in (0 .. count) {
-        queueProperties := as!VkPhysicalDeviceQueueProperties(?)
-        queuesProperties[i] = queueProperties
-    }
+    // TODO: Figure out how to express fetch-count-or-properties
+    // This version fails 'apic validate' with 'fence not allowed in
+    // *semantic.Branch'. Other attempts have failed with the same or other
+    // errors.
+    // if pQueueFamilyProperties != null {
+    //     queuesProperties := pQueueFamilyProperties[0:pCount[0]]
+    //     for i in (0 .. pCount[0]) {
+    //         queueProperties := as!VkQueueFamilyProperties(?)
+    //         queuesProperties[i] = queueProperties
+    //    }
+    // } else {
+    //     count := ?
+    //     pCount[0] = count
+    // }
     return ?
 }
 
@@ -2107,6 +2226,7 @@
         VkImageType                                 type,
         VkImageTiling                               tiling,
         VkImageUsageFlags                           usage,
+        VkImageCreateFlags                          flags,
         VkImageFormatProperties*                    pImageFormatProperties) {
     physicalDeviceObject := GetPhysicalDevice(physicalDevice)
 
@@ -2116,17 +2236,6 @@
     return ?
 }
 
-cmd VkResult vkGetPhysicalDeviceLimits(
-        VkPhysicalDevice                            physicalDevice,
-        VkPhysicalDeviceLimits*                     pLimits) {
-    physicalDeviceObject := GetPhysicalDevice(physicalDevice)
-
-    limits := ?
-    pLimits[0] = limits
-
-    return ?
-}
-
 
 // Device functions
 
@@ -2146,19 +2255,17 @@
 }
 
 @threadSafety("system")
-cmd VkResult vkDestroyDevice(
+cmd void vkDestroyDevice(
         VkDevice                                    device) {
     deviceObject := GetDevice(device)
 
     State.Devices[device] = null
-
-    return ?
 }
 
 
 // Extension discovery functions
 
-cmd VkResult vkGetGlobalLayerProperties(
+cmd VkResult vkEnumerateInstanceLayerProperties(
         u32*                                        pCount,
         VkLayerProperties*                          pProperties) {
     count := as!u32(?)
@@ -2173,7 +2280,7 @@
     return ?
 }
 
-cmd VkResult vkGetGlobalExtensionProperties(
+cmd VkResult vkEnumerateInstanceExtensionProperties(
         const char*                                 pLayerName,
         u32*                                        pCount,
         VkExtensionProperties*                      pProperties) {
@@ -2189,7 +2296,7 @@
     return ?
 }
 
-cmd VkResult vkGetPhysicalDeviceLayerProperties(
+cmd VkResult vkEnumerateDeviceLayerProperties(
         VkPhysicalDevice                            physicalDevice,
         u32*                                        pCount,
         VkLayerProperties*                          pProperties) {
@@ -2206,7 +2313,7 @@
     return ?
 }
 
-cmd VkResult vkGetPhysicalDeviceExtensionProperties(
+cmd VkResult vkEnumerateDeviceExtensionProperties(
         VkPhysicalDevice                            physicalDevice,
         const char*                                 pLayerName,
         u32*                                        pCount,
@@ -2254,7 +2361,7 @@
         VkFence                                     fence) {
     queueObject := GetQueue(queue)
 
-    if fence != VK_NULL_HANDLE {
+    if fence != NULL_HANDLE {
         fenceObject := GetFence(fence)
         assert(fenceObject.device == queueObject.device)
     }
@@ -2309,7 +2416,7 @@
 }
 
 @threadSafety("system")
-cmd VkResult vkFreeMemory(
+cmd void vkFreeMemory(
         VkDevice                                    device,
         VkDeviceMemory                              mem) {
     deviceObject := GetDevice(device)
@@ -2322,16 +2429,14 @@
     validate("MemoryCheck", len(memObject.boundCommandBuffers) == 0,
         "vkFreeMemory: cmdBuffers still bound")
     State.DeviceMemories[mem] = null
-
-    return ?
 }
 
 @threadSafety("app")
 cmd VkResult vkMapMemory(
         VkDevice                                    device,
         VkDeviceMemory                              mem,
-        platform.VkDeviceSize                       offset,
-        platform.VkDeviceSize                       size,
+        VkDeviceSize                                offset,
+        VkDeviceSize                                size,
         VkMemoryMapFlags                            flags,
         void**                                      ppData) {
     deviceObject := GetDevice(device)
@@ -2345,14 +2450,12 @@
 }
 
 @threadSafety("app")
-cmd VkResult vkUnmapMemory(
+cmd void vkUnmapMemory(
         VkDevice                                    device,
         VkDeviceMemory                              mem) {
     deviceObject := GetDevice(device)
     memObject := GetDeviceMemory(mem)
     assert(memObject.device == device)
-
-    return ?
 }
 
 cmd VkResult vkFlushMappedMemoryRanges(
@@ -2395,10 +2498,10 @@
 cmd VkResult vkGetDeviceMemoryCommitment(
         VkDevice                                    device,
         VkDeviceMemory                              memory,
-        platform.VkDeviceSize*                      pCommittedMemoryInBytes) {
+        VkDeviceSize*                               pCommittedMemoryInBytes) {
     deviceObject := GetDevice(device)
 
-    if memory != VK_NULL_HANDLE {
+    if memory != NULL_HANDLE {
         memoryObject := GetDeviceMemory(memory)
         assert(memoryObject.device == device)
     }
@@ -2424,19 +2527,19 @@
         VkDevice                                    device,
         VkBuffer                                    buffer,
         VkDeviceMemory                              mem,
-        platform.VkDeviceSize                       memOffset) {
+        VkDeviceSize                                memOffset) {
     deviceObject := GetDevice(device)
     bufferObject := GetBuffer(buffer)
     assert(bufferObject.device == device)
 
     // Unbind buffer from previous memory object, if not VK_NULL_HANDLE.
-    if bufferObject.mem != VK_NULL_HANDLE {
+    if bufferObject.mem != NULL_HANDLE {
         memObject := GetDeviceMemory(bufferObject.mem)
         memObject.boundObjects[as!u64(buffer)] = null
     }
 
     // Bind buffer to given memory object, if not VK_NULL_HANDLE.
-    if mem != VK_NULL_HANDLE {
+    if mem != NULL_HANDLE {
         memObject := GetDeviceMemory(mem)
         assert(memObject.device == device)
         memObject.boundObjects[as!u64(buffer)] = memOffset
@@ -2462,19 +2565,19 @@
         VkDevice                                    device,
         VkImage                                     image,
         VkDeviceMemory                              mem,
-        platform.VkDeviceSize                       memOffset) {
+        VkDeviceSize                                memOffset) {
     deviceObject := GetDevice(device)
     imageObject := GetImage(image)
     assert(imageObject.device == device)
 
     // Unbind image from previous memory object, if not VK_NULL_HANDLE.
-    if imageObject.mem != VK_NULL_HANDLE {
+    if imageObject.mem != NULL_HANDLE {
         memObject := GetDeviceMemory(imageObject.mem)
         memObject.boundObjects[as!u64(image)] = null
     }
 
     // Bind image to given memory object, if not VK_NULL_HANDLE.
-    if mem != VK_NULL_HANDLE {
+    if mem != NULL_HANDLE {
         memObject := GetDeviceMemory(mem)
         assert(memObject.device == device)
         memObject.boundObjects[as!u64(image)] = memOffset
@@ -2567,7 +2670,7 @@
 }
 
 @threadSafety("system")
-cmd VkResult vkDestroyFence(
+cmd void vkDestroyFence(
         VkDevice                                    device,
         VkFence                                     fence) {
     deviceObject := GetDevice(device)
@@ -2575,8 +2678,6 @@
     assert(fenceObject.device == device)
 
     State.Fences[fence] = null
-
-    return ?
 }
 
 @threadSafety("system")
@@ -2613,7 +2714,7 @@
         VkDevice                                    device,
         u32                                         fenceCount,
         const VkFence*                              pFences,
-        platform.VkBool32                           waitAll,
+        VkBool32                                    waitAll,
         u64                                         timeout) {  /// timeout in nanoseconds
     deviceObject := GetDevice(device)
 
@@ -2646,7 +2747,7 @@
 }
 
 @threadSafety("system")
-cmd VkResult vkDestroySemaphore(
+cmd void vkDestroySemaphore(
         VkDevice                                    device,
         VkSemaphore                                 semaphore) {
     deviceObject := GetDevice(device)
@@ -2654,8 +2755,6 @@
     assert(semaphoreObject.device == device)
 
     State.Semaphores[semaphore] = null
-
-    return ?
 }
 
 @threadSafety("app")
@@ -2699,7 +2798,7 @@
 }
 
 @threadSafety("system")
-cmd VkResult vkDestroyEvent(
+cmd void vkDestroyEvent(
         VkDevice                                    device,
         VkEvent                                     event) {
     deviceObject := GetDevice(device)
@@ -2707,8 +2806,6 @@
     assert(eventObject.device == device)
 
     State.Events[event] = null
-
-    return ?
 }
 
 @threadSafety("system")
@@ -2763,7 +2860,7 @@
 }
 
 @threadSafety("system")
-cmd VkResult vkDestroyQueryPool(
+cmd void vkDestroyQueryPool(
         VkDevice                                    device,
         VkQueryPool                                 queryPool) {
     deviceObject := GetDevice(device)
@@ -2771,8 +2868,6 @@
     assert(queryPoolObject.device == device)
 
     State.QueryPools[queryPool] = null
-
-    return ?
 }
 
 @threadSafety("system")
@@ -2813,7 +2908,7 @@
 }
 
 @threadSafety("system")
-cmd VkResult vkDestroyBuffer(
+cmd void vkDestroyBuffer(
         VkDevice                                    device,
         VkBuffer                                    buffer) {
     deviceObject := GetDevice(device)
@@ -2822,8 +2917,6 @@
 
     assert(bufferObject.mem == 0)
     State.Buffers[buffer] = null
-
-    return ?
 }
 
 
@@ -2848,7 +2941,7 @@
 }
 
 @threadSafety("system")
-cmd VkResult vkDestroyBufferView(
+cmd void vkDestroyBufferView(
         VkDevice                                    device,
         VkBufferView                                bufferView) {
     deviceObject := GetDevice(device)
@@ -2856,8 +2949,6 @@
     assert(bufferViewObject.device == device)
 
     State.BufferViews[bufferView] = null
-
-    return ?
 }
 
 
@@ -2879,7 +2970,7 @@
 }
 
 @threadSafety("system")
-cmd VkResult vkDestroyImage(
+cmd void vkDestroyImage(
         VkDevice                                    device,
         VkImage                                     image) {
     deviceObject := GetDevice(device)
@@ -2888,8 +2979,6 @@
 
     assert(imageObject.mem == 0)
     State.Images[image] = null
-
-    return ?
 }
 
 cmd VkResult vkGetImageSubresourceLayout(
@@ -2926,7 +3015,7 @@
 }
 
 @threadSafety("system")
-cmd VkResult vkDestroyImageView(
+cmd void vkDestroyImageView(
         VkDevice                                    device,
         VkImageView                                 imageView) {
     deviceObject := GetDevice(device)
@@ -2934,39 +3023,6 @@
     assert(imageViewObject.device == device)
 
     State.ImageViews[imageView] = null
-
-    return ?
-}
-
-@threadSafety("system")
-cmd VkResult vkCreateAttachmentView(
-        VkDevice                                    device,
-        const VkAttachmentViewCreateInfo*           pCreateInfo,
-        VkAttachmentView*                           pView) {
-    assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_ATTACHMENT_VIEW_CREATE_INFO)
-    deviceObject := GetDevice(device)
-
-    imageObject := GetImage(pCreateInfo.image)
-    assert(imageObject.device == device)
-
-    view := ?
-    pView[0] = view
-    State.AttachmentViews[view] = new!AttachmentViewObject(device: device, image: pCreateInfo.image)
-
-    return ?
-}
-
-@threadSafety("system")
-cmd VkResult vkDestroyAttachmentView(
-        VkDevice                                    device,
-        VkAttachmentView                            attachmentView) {
-    deviceObject := GetDevice(device)
-    attachmentViewObject := GetAttachmentView(attachmentView)
-    assert(attachmentViewObject.device == device)
-
-    State.AttachmentViews[attachmentView] = null
-
-    return ?
 }
 
 
@@ -2986,7 +3042,7 @@
     return ?
 }
 
-cmd VkResult vkDestroyShaderModule(
+cmd void vkDestroyShaderModule(
         VkDevice                                    device,
         VkShaderModule                              shaderModule) {
     deviceObject := GetDevice(device)
@@ -2994,8 +3050,6 @@
     assert(shaderModuleObject.device == device)
 
     State.ShaderModules[shaderModule] = null
-
-    return ?
 }
 
 @threadSafety("system")
@@ -3014,7 +3068,7 @@
 }
 
 @threadSafety("system")
-cmd VkResult vkDestroyShader(
+cmd void vkDestroyShader(
         VkDevice                                    device,
         VkShader                                    shader) {
     deviceObject := GetDevice(device)
@@ -3022,8 +3076,6 @@
     assert(shaderObject.device == device)
 
     State.Shaders[shader] = null
-
-    return ?
 }
 
 
@@ -3043,7 +3095,7 @@
     return ?
 }
 
-cmd VkResult vkDestroyPipelineCache(
+cmd void vkDestroyPipelineCache(
         VkDevice                                    device,
         VkPipelineCache                             pipelineCache) {
     deviceObject := GetDevice(device)
@@ -3051,8 +3103,6 @@
     assert(pipelineCacheObject.device == device)
 
     State.PipelineCaches[pipelineCache] = null
-
-    return ?
 }
 
 cmd platform.size_t vkGetPipelineCacheSize(
@@ -3102,7 +3152,7 @@
         const VkGraphicsPipelineCreateInfo*         pCreateInfos,
         VkPipeline*                                 pPipelines) {
     deviceObject := GetDevice(device)
-    if pipelineCache != VK_NULL_HANDLE {
+    if pipelineCache != NULL_HANDLE {
         pipelineCacheObject := GetPipelineCache(pipelineCache)
         assert(pipelineCacheObject.device == device)
     }
@@ -3125,7 +3175,7 @@
         const VkComputePipelineCreateInfo*          pCreateInfos,
         VkPipeline*                                 pPipelines) {
     deviceObject := GetDevice(device)
-    if pipelineCache != VK_NULL_HANDLE {
+    if pipelineCache != NULL_HANDLE {
         pipelineCacheObject := GetPipelineCache(pipelineCache)
         assert(pipelineCacheObject.device == device)
     }
@@ -3142,7 +3192,7 @@
 }
 
 @threadSafety("system")
-cmd VkResult vkDestroyPipeline(
+cmd void vkDestroyPipeline(
         VkDevice                                    device,
         VkPipeline                                  pipeline) {
     deviceObject := GetDevice(device)
@@ -3150,8 +3200,6 @@
     assert(pipelineObjects.device == device)
 
     State.Pipelines[pipeline] = null
-
-    return ?
 }
 
 
@@ -3173,7 +3221,7 @@
 }
 
 @threadSafety("system")
-cmd VkResult vkDestroyPipelineLayout(
+cmd void vkDestroyPipelineLayout(
         VkDevice                                    device,
         VkPipelineLayout                            pipelineLayout) {
     deviceObject := GetDevice(device)
@@ -3181,8 +3229,6 @@
     assert(pipelineLayoutObjects.device == device)
 
     State.PipelineLayouts[pipelineLayout] = null
-
-    return ?
 }
 
 
@@ -3204,7 +3250,7 @@
 }
 
 @threadSafety("system")
-cmd VkResult vkDestroySampler(
+cmd void vkDestroySampler(
         VkDevice                                    device,
         VkSampler                                   sampler) {
     deviceObject := GetDevice(device)
@@ -3212,8 +3258,6 @@
     assert(samplerObject.device == device)
 
     State.Samplers[sampler] = null
-
-    return ?
 }
 
 
@@ -3235,7 +3279,7 @@
 }
 
 @threadSafety("system")
-cmd VkResult vkDestroyDescriptorSetLayout(
+cmd void vkDestroyDescriptorSetLayout(
         VkDevice                                    device,
         VkDescriptorSetLayout                       descriptorSetLayout) {
     deviceObject := GetDevice(device)
@@ -3243,16 +3287,12 @@
     assert(descriptorSetLayoutObject.device == device)
 
     State.DescriptorSetLayouts[descriptorSetLayout] = null
-
-    return ?
 }
 
 @threadSafety("system")
 cmd VkResult vkCreateDescriptorPool(
         VkDevice                                    device,
-        VkDescriptorPoolUsage                       poolUsage,
-        u32                                         maxSets,
-        const VkDescriptorPoolCreateInfo*           pCreateInfo,
+        const VkDescriptorPoolCreateInfo*           pCreateInfo
         VkDescriptorPool*                           pDescriptorPool) {
     assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO)
     deviceObject := GetDevice(device)
@@ -3265,7 +3305,7 @@
 }
 
 @threadSafety("system")
-cmd VkResult vkDestroyDescriptorPool(
+cmd void vkDestroyDescriptorPool(
         VkDevice                                    device,
         VkDescriptorPool                            descriptorPool) {
     deviceObject := GetDevice(device)
@@ -3273,8 +3313,6 @@
     assert(descriptorPoolObject.device == device)
 
     State.DescriptorPools[descriptorPool] = null
-
-    return ?
 }
 
 @threadSafety("app")
@@ -3295,8 +3333,7 @@
         VkDescriptorSetUsage                        setUsage,
         u32                                         count,
         const VkDescriptorSetLayout*                pSetLayouts,
-        VkDescriptorSet*                            pDescriptorSets,
-        u32*                                        pCount) {
+        VkDescriptorSet*                            pDescriptorSets) {
     deviceObject := GetDevice(device)
     descriptorPoolObject := GetDescriptorPool(descriptorPool)
 
@@ -3307,10 +3344,8 @@
         assert(setLayoutObject.device == device)
     }
 
-    setsCount := as!u32(?)
-    pCount[0] = setsCount
-    descriptorSets := pDescriptorSets[0:setsCount]
-    for i in (0 .. setsCount) {
+    descriptorSets := pDescriptorSets[0:count]
+    for i in (0 .. count) {
         descriptorSet := ?
         descriptorSets[i] = descriptorSet
         State.DescriptorSets[descriptorSet] = new!DescriptorSetObject(device: device)
@@ -3338,7 +3373,7 @@
     return ?
 }
 
-cmd VkResult vkUpdateDescriptorSets(
+cmd void vkUpdateDescriptorSets(
         VkDevice                                    device,
         u32                                         writeCount,
         const VkWriteDescriptorSet*                 pDescriptorWrites,
@@ -3359,123 +3394,6 @@
         descriptorCopyObject := GetDescriptorSet(descriptorCopy.destSet)
         assert(descriptorCopyObject.device == device)
     }
-
-    return ?
-}
-
-
-// State object functions
-
-@threadSafety("system")
-cmd VkResult vkCreateDynamicViewportState(
-        VkDevice                                    device,
-        const VkDynamicViewportStateCreateInfo*     pCreateInfo,
-        VkDynamicViewportState*                     pState) {
-    assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DYNAMIC_VIEWPORT_STATE_CREATE_INFO)
-    deviceObject := GetDevice(device)
-
-    state := ?
-    pState[0] = state
-    State.DynamicViewportStates[state] = new!DynamicViewportStateObject(device: device)
-
-    return ?
-}
-
-@threadSafety("system")
-cmd VkResult vkDestroyDynamicViewportState(
-        VkDevice                                    device,
-        VkDynamicViewportState                      dynamicViewportState) {
-    deviceObject := GetDevice(device)
-    dynamicViewportStateObject := GetDynamicViewportState(dynamicViewportState)
-    assert(dynamicViewportStateObject.device == device)
-
-    State.DynamicViewportStates[dynamicViewportState] = null
-
-    return ?
-}
-
-@threadSafety("system")
-cmd VkResult vkCreateDynamicRasterState(
-        VkDevice                                    device,
-        const VkDynamicRasterStateCreateInfo*       pCreateInfo,
-        VkDynamicRasterState*                       pState) {
-    assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DYNAMIC_RASTER_STATE_CREATE_INFO)
-    deviceObject := GetDevice(device)
-
-    state := ?
-    pState[0] = state
-    State.DynamicRasterStates[state] = new!DynamicRasterStateObject(device: device)
-
-    return ?
-}
-
-@threadSafety("system")
-cmd VkResult vkDestroyDynamicRasterState(
-        VkDevice                                    device,
-        VkDynamicRasterState                        dynamicRasterState) {
-    deviceObject := GetDevice(device)
-    dynamicRasterStateObject := GetDynamicRasterState(dynamicRasterState)
-    assert(dynamicRasterStateObject.device == device)
-
-    State.DynamicRasterStates[dynamicRasterState] = null
-
-    return ?
-}
-
-@threadSafety("system")
-cmd VkResult vkCreateDynamicColorBlendState(
-        VkDevice                                    device,
-        const VkDynamicColorBlendStateCreateInfo*   pCreateInfo,
-        VkDynamicColorBlendState*                   pState) {
-    assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DYNAMIC_COLOR_BLEND_STATE_CREATE_INFO)
-    deviceObject := GetDevice(device)
-
-    state := ?
-    pState[0] = state
-    State.DynamicColorBlendStates[state] = new!DynamicColorBlendStateObject(device: device)
-
-    return ?
-}
-
-@threadSafety("system")
-cmd VkResult vkDestroyDynamicColorBlendState(
-        VkDevice                                    device,
-        VkDynamicColorBlendState                    dynamicColorBlendState) {
-    deviceObject := GetDevice(device)
-    dynamicColorBlendStateObject := GetDynamicColorBlendState(dynamicColorBlendState)
-    assert(dynamicColorBlendStateObject.device == device)
-
-    State.DynamicColorBlendStates[dynamicColorBlendState] = null
-
-    return ?
-}
-
-@threadSafety("system")
-cmd VkResult vkCreateDynamicDepthStencilState(
-        VkDevice                                    device,
-        const VkDynamicDepthStencilStateCreateInfo* pCreateInfo,
-        VkDynamicDepthStencilState*                 pState) {
-    assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DYNAMIC_DEPTH_STENCIL_STATE_CREATE_INFO)
-    deviceObject := GetDevice(device)
-
-    state := ?
-    pState[0] = state
-    State.DynamicDepthStencilStates[state] = new!DynamicDepthStencilStateObject(device: device)
-
-    return ?
-}
-
-@threadSafety("system")
-cmd VkResult vkDestroyDynamicDepthStencilState(
-        VkDevice                                    device,
-        VkDynamicDepthStencilState                  dynamicDepthStencilState) {
-    deviceObject := GetDevice(device)
-    dynamicDepthStencilStateObject := GetDynamicDepthStencilState(dynamicDepthStencilState)
-    assert(dynamicDepthStencilStateObject.device == device)
-
-    State.DynamicDepthStencilStates[dynamicDepthStencilState] = null
-
-    return ?
 }
 
 
@@ -3497,7 +3415,7 @@
 }
 
 @threadSafety("system")
-cmd VkResult vkDestroyFramebuffer(
+cmd void vkDestroyFramebuffer(
         VkDevice                                    device,
         VkFramebuffer                               framebuffer) {
     deviceObject := GetDevice(device)
@@ -3505,8 +3423,6 @@
     assert(framebufferObject.device == device)
 
     State.Framebuffers[framebuffer] = null
-
-    return ?
 }
 
 
@@ -3528,7 +3444,7 @@
 }
 
 @threadSafety("system")
-cmd VkResult vkDestroyRenderPass(
+cmd void vkDestroyRenderPass(
         VkDevice                                    device,
         VkRenderPass                                renderPass) {
     deviceObject := GetDevice(device)
@@ -3536,8 +3452,6 @@
     assert(renderPassObject.device == device)
 
     State.RenderPasses[renderPass] = null
-
-    return ?
 }
 
 cmd VkResult vkGetRenderAreaGranularity(
@@ -3569,7 +3483,7 @@
     return ?
 }
 
-cmd VkResult vkDestroyCommandPool(
+cmd void vkDestroyCommandPool(
         VkDevice                                    device,
         VkCmdPool                                   cmdPool) {
     deviceObject := GetDevice(device)
@@ -3577,8 +3491,6 @@
     assert(cmdPoolObject.device == device)
 
     State.CmdPools[cmdPool] = null
-
-    return ?
 }
 
 cmd VkResult vkResetCommandPool(
@@ -3625,7 +3537,7 @@
 }
 
 @threadSafety("system")
-cmd VkResult vkDestroyCommandBuffer(
+cmd void vkDestroyCommandBuffer(
         VkDevice                                    device,
         VkCmdBuffer                                 commandBuffer) {
     deviceObject := GetDevice(device)
@@ -3634,8 +3546,6 @@
 
     // TODO: iterate over boundObjects and clear memory bindings
     State.CmdBuffers[commandBuffer] = null
-
-    return ?
 }
 
 @threadSafety("app")
@@ -3689,49 +3599,93 @@
 }
 
 @threadSafety("app")
-cmd void vkCmdBindDynamicViewportState(
+cmd void vkCmdSetViewport(
         VkCmdBuffer                                 cmdBuffer,
-        VkDynamicViewportState                      dynamicViewportState) {
+        u32                                         viewportCount,
+        const VkViewport*                           pViewports) {
     cmdBufferObject := GetCmdBuffer(cmdBuffer)
-    dynamicViewportStateObject := GetDynamicViewportState(dynamicViewportState)
-    assert(cmdBufferObject.device == dynamicViewportStateObject.device)
-
     queueFlags := cmdBufferObject.queueFlags | VK_QUEUE_GRAPHICS_BIT
     cmdBufferObject.queueFlags = queueFlags
 }
 
 @threadSafety("app")
-cmd void vkCmdBindDynamicRasterState(
+cmd void vkCmdSetScissor(
         VkCmdBuffer                                 cmdBuffer,
-        VkDynamicRasterState                        dynamicRasterState) {
+        u32                                         scissorCount,
+        const VkRect2D*                             pScissors) {
     cmdBufferObject := GetCmdBuffer(cmdBuffer)
-    dynamicRasterStateObject := GetDynamicRasterState(dynamicRasterState)
-    assert(cmdBufferObject.device == dynamicRasterStateObject.device)
-
     queueFlags := cmdBufferObject.queueFlags | VK_QUEUE_GRAPHICS_BIT
     cmdBufferObject.queueFlags = queueFlags
 }
 
 @threadSafety("app")
-cmd void vkCmdBindDynamicColorBlendState(
+cmd void vkCmdSetLineWidth(
         VkCmdBuffer                                 cmdBuffer,
-        VkDynamicColorBlendState                    dynamicColorBlendState) {
+        f32                                         lineWidth) {
     cmdBufferObject := GetCmdBuffer(cmdBuffer)
-    dynamicColorBlendStateObject := GetDynamicColorBlendState(dynamicColorBlendState)
-    assert(cmdBufferObject.device == dynamicColorBlendStateObject.device)
-
     queueFlags := cmdBufferObject.queueFlags | VK_QUEUE_GRAPHICS_BIT
     cmdBufferObject.queueFlags = queueFlags
 }
 
 @threadSafety("app")
-cmd void vkCmdBindDynamicDepthStencilState(
+cmd void vkCmdSetDepthBias(
         VkCmdBuffer                                 cmdBuffer,
-        VkDynamicDepthStencilState                  dynamicDepthStencilState) {
+        f32                                         depthBias,
+        f32                                         depthBiasClamp,
+        f32                                         slopeScaledDepthBias) {
     cmdBufferObject := GetCmdBuffer(cmdBuffer)
-    dynamicDepthStencilStateObject := GetDynamicDepthStencilState(dynamicDepthStencilState)
-    assert(cmdBufferObject.device == dynamicDepthStencilStateObject.device)
+    queueFlags := cmdBufferObject.queueFlags | VK_QUEUE_GRAPHICS_BIT
+    cmdBufferObject.queueFlags = queueFlags
+}
 
+@threadSafety("app")
+cmd void vkCmdSetBlendConstants(
+        VkCmdBuffer                                 cmdBuffer,
+        // TODO(jessehall): apic only supports 'const' on pointer types. Using
+        // an annotation as a quick hack to pass this to the template without
+        // having to modify the AST and semantic model.
+        @readonly f32[4]                            blendConst) {
+    cmdBufferObject := GetCmdBuffer(cmdBuffer)
+    queueFlags := cmdBufferObject.queueFlags | VK_QUEUE_GRAPHICS_BIT
+    cmdBufferObject.queueFlags = queueFlags
+}
+
+@threadSafety("app")
+cmd void vkCmdSetDepthBounds(
+        VkCmdBuffer                                 cmdBuffer,
+        f32                                         minDepthBounds,
+        f32                                         maxDepthBounds) {
+    cmdBufferObject := GetCmdBuffer(cmdBuffer)
+    queueFlags := cmdBufferObject.queueFlags | VK_QUEUE_GRAPHICS_BIT
+    cmdBufferObject.queueFlags = queueFlags
+}
+
+@threadSafety("app")
+cmd void vkCmdSetStencilCompareMask(
+        VkCmdBuffer                                 cmdBuffer,
+        VkStencilFaceFlags                          faceMask,
+        u32                                         stencilCompareMask) {
+    cmdBufferObject := GetCmdBuffer(cmdBuffer)
+    queueFlags := cmdBufferObject.queueFlags | VK_QUEUE_GRAPHICS_BIT
+    cmdBufferObject.queueFlags = queueFlags
+}
+
+@threadSafety("app")
+cmd void vkCmdSetStencilWriteMask(
+        VkCmdBuffer                                 cmdBuffer,
+        VkStencilFaceFlags                          faceMask,
+        u32                                         stencilWriteMask) {
+    cmdBufferObject := GetCmdBuffer(cmdBuffer)
+    queueFlags := cmdBufferObject.queueFlags | VK_QUEUE_GRAPHICS_BIT
+    cmdBufferObject.queueFlags = queueFlags
+}
+
+@threadSafety("app")
+cmd void vkCmdSetStencilReference(
+        VkCmdBuffer                                 cmdBuffer,
+        VkStencilFaceFlags                          faceMask,
+        u32                                         stencilReference) {
+    cmdBufferObject := GetCmdBuffer(cmdBuffer)
     queueFlags := cmdBufferObject.queueFlags | VK_QUEUE_GRAPHICS_BIT
     cmdBufferObject.queueFlags = queueFlags
 }
@@ -3771,7 +3725,7 @@
 cmd void vkCmdBindIndexBuffer(
         VkCmdBuffer                                 cmdBuffer,
         VkBuffer                                    buffer,
-        platform.VkDeviceSize                       offset,
+        VkDeviceSize                                offset,
         VkIndexType                                 indexType) {
     cmdBufferObject := GetCmdBuffer(cmdBuffer)
     bufferObject := GetBuffer(buffer)
@@ -3789,7 +3743,7 @@
         u32                                         startBinding,
         u32                                         bindingCount,
         const VkBuffer*                             pBuffers,
-        const platform.VkDeviceSize*                pOffsets) {
+        const VkDeviceSize*                         pOffsets) {
     cmdBufferObject := GetCmdBuffer(cmdBuffer)
 
     // TODO: check if not [startBinding:startBinding+bindingCount]
@@ -3811,10 +3765,10 @@
 @threadSafety("app")
 cmd void vkCmdDraw(
         VkCmdBuffer                                 cmdBuffer,
-        u32                                         firstVertex,
         u32                                         vertexCount,
-        u32                                         firstInstance,
-        u32                                         instanceCount) {
+        u32                                         instanceCount,
+        u32                                         firstVertex,
+        u32                                         firstInstance) {
     cmdBufferObject := GetCmdBuffer(cmdBuffer)
 
     queueFlags := cmdBufferObject.queueFlags | VK_QUEUE_GRAPHICS_BIT
@@ -3824,11 +3778,11 @@
 @threadSafety("app")
 cmd void vkCmdDrawIndexed(
         VkCmdBuffer                                 cmdBuffer,
-        u32                                         firstIndex,
         u32                                         indexCount,
+        u32                                         instanceCount,
+        u32                                         firstIndex,
         s32                                         vertexOffset,
-        u32                                         firstInstance,
-        u32                                         instanceCount) {
+        u32                                         firstInstance) {
     cmdBufferObject := GetCmdBuffer(cmdBuffer)
 
     queueFlags := cmdBufferObject.queueFlags | VK_QUEUE_GRAPHICS_BIT
@@ -3839,7 +3793,7 @@
 cmd void vkCmdDrawIndirect(
         VkCmdBuffer                                 cmdBuffer,
         VkBuffer                                    buffer,
-        platform.VkDeviceSize                       offset,
+        VkDeviceSize                                offset,
         u32                                         count,
         u32                                         stride) {
     cmdBufferObject := GetCmdBuffer(cmdBuffer)
@@ -3856,7 +3810,7 @@
 cmd void vkCmdDrawIndexedIndirect(
         VkCmdBuffer                                 cmdBuffer,
         VkBuffer                                    buffer,
-        platform.VkDeviceSize                       offset,
+        VkDeviceSize                                offset,
         u32                                         count,
         u32                                         stride) {
     cmdBufferObject := GetCmdBuffer(cmdBuffer)
@@ -3885,7 +3839,7 @@
 cmd void vkCmdDispatchIndirect(
         VkCmdBuffer                                 cmdBuffer,
         VkBuffer                                    buffer,
-        platform.VkDeviceSize                       offset) {
+        VkDeviceSize                                offset) {
     cmdBufferObject := GetCmdBuffer(cmdBuffer)
     bufferObject := GetBuffer(buffer)
     assert(cmdBufferObject.device == bufferObject.device)
@@ -4032,8 +3986,8 @@
 cmd void vkCmdUpdateBuffer(
         VkCmdBuffer                                 cmdBuffer,
         VkBuffer                                    destBuffer,
-        platform.VkDeviceSize                       destOffset,
-        platform.VkDeviceSize                       dataSize,
+        VkDeviceSize                                destOffset,
+        VkDeviceSize                                dataSize,
         const u32*                                  pData) {
     cmdBufferObject := GetCmdBuffer(cmdBuffer)
     destBufferObject := GetBuffer(destBuffer)
@@ -4051,8 +4005,8 @@
 cmd void vkCmdFillBuffer(
         VkCmdBuffer                                 cmdBuffer,
         VkBuffer                                    destBuffer,
-        platform.VkDeviceSize                       destOffset,
-        platform.VkDeviceSize                       fillSize,
+        VkDeviceSize                                destOffset,
+        VkDeviceSize                                fillSize,
         u32                                         data) {
     cmdBufferObject := GetCmdBuffer(cmdBuffer)
     destBufferObject := GetBuffer(destBuffer)
@@ -4090,8 +4044,7 @@
         VkCmdBuffer                                 cmdBuffer,
         VkImage                                     image,
         VkImageLayout                               imageLayout,
-        f32                                         depth,
-        u32                                         stencil,
+        const VkClearDepthStencilValue*             pDepthStencil,
         u32                                         rangeCount,
         const VkImageSubresourceRange*              pRanges) {
     cmdBufferObject := GetCmdBuffer(cmdBuffer)
@@ -4131,10 +4084,9 @@
 @threadSafety("app")
 cmd void vkCmdClearDepthStencilAttachment(
         VkCmdBuffer                                 cmdBuffer,
-        VkImageAspectFlags                          imageAspectMask,
+        VkImageAspectFlags                          aspectMask,
         VkImageLayout                               imageLayout,
-        f32                                         depth,
-        u32                                         stencil,
+        const VkClearDepthStencilValue*             pDepthStencil,
         u32                                         rectCount,
         const VkRect3D*                             pRects) {
     cmdBufferObject := GetCmdBuffer(cmdBuffer)
@@ -4238,7 +4190,7 @@
         VkCmdBuffer                                 cmdBuffer,
         VkPipelineStageFlags                        srcStageMask,
         VkPipelineStageFlags                        destStageMask,
-        platform.VkBool32                           byRegion,
+        VkBool32                                    byRegion,
         u32                                         memBarrierCount,
         const void* const*                          ppMemBarriers) {
     cmdBufferObject := GetCmdBuffer(cmdBuffer)
@@ -4300,7 +4252,7 @@
         VkCmdBuffer                                 cmdBuffer,
         VkTimestampType                             timestampType,
         VkBuffer                                    destBuffer,
-        platform.VkDeviceSize                       destOffset) {
+        VkDeviceSize                                destOffset) {
     cmdBufferObject := GetCmdBuffer(cmdBuffer)
     destBufferObject := GetBuffer(destBuffer)
     assert(cmdBufferObject.device == destBufferObject.device)
@@ -4313,8 +4265,8 @@
         u32                                         startQuery,
         u32                                         queryCount,
         VkBuffer                                    destBuffer,
-        platform.VkDeviceSize                       destOffset,
-        platform.VkDeviceSize                       destStride,
+        VkDeviceSize                                destOffset,
+        VkDeviceSize                                destStride,
         VkQueryResultFlags                          flags) {
     cmdBufferObject := GetCmdBuffer(cmdBuffer)
     queryPoolObject := GetQueryPool(queryPool)
@@ -4379,6 +4331,156 @@
     }
 }
 
+////////////////
+// Extensions //
+////////////////
+
+@extension("VK_EXT_KHR_swapchain")
+cmd VkResult vkGetPhysicalDeviceSurfaceSupportKHR(
+        VkPhysicalDevice                        physicalDevice,
+        u32                                     queueFamilyIndex,
+        const VkSurfaceDescriptionKHR*          pSurfaceDescription,
+        VkBool32*                               pSupported) {
+    physicalDeviceObject := GetPhysicalDevice(physicalDevice)
+
+    supported := ?
+    pSupported[0] = supported
+
+    return ?
+}
+
+@extension("VK_EXT_KHR_device_swapchain")
+cmd VkResult vkGetSurfacePropertiesKHR(
+        VkDevice                                 device,
+        const VkSurfaceDescriptionKHR*           pSurfaceDescription,
+        VkSurfacePropertiesKHR*                  pSurfaceProperties) {
+    deviceObject := GetDevice(device)
+
+    surfaceProperties := ?
+    pSurfaceProperties[0] = surfaceProperties
+
+    return ?
+}
+
+@extension("VK_EXT_KHR_device_swapchain")
+cmd VkResult vkGetSurfaceFormatsKHR(
+        VkDevice                                 device,
+        const VkSurfaceDescriptionKHR*           pSurfaceDescription,
+        u32*                                     pCount,
+        VkSurfaceFormatKHR*                      pSurfaceFormats) {
+    deviceObject := GetDevice(device)
+
+    count := as!u32(?)
+    pCount[0] = count
+    surfaceFormats := pSurfaceFormats[0:count]
+
+    for i in (0 .. count) {
+        surfaceFormat := ?
+        surfaceFormats[i] = surfaceFormat
+    }
+
+    return ?
+}
+
+@extension("VK_EXT_KHR_device_swapchain")
+cmd VkResult vkGetSurfacePresentModesKHR(
+        VkDevice                                 device,
+        const VkSurfaceDescriptionKHR*           pSurfaceDescription,
+        u32*                                     pCount,
+        VkPresentModeKHR*                        pPresentModes) {
+    deviceObject := GetDevice(device)
+
+    count := as!u32(?)
+    pCount[0] = count
+    presentModes := pPresentModes[0:count]
+
+    for i in (0 .. count) {
+        presentMode := ?
+        presentModes[i] = presentMode
+    }
+
+    return ?
+}
+
+@extension("VK_EXT_KHR_device_swapchain")
+cmd VkResult vkCreateSwapchainKHR(
+        VkDevice                                 device,
+        const VkSwapchainCreateInfoKHR*          pCreateInfo,
+        VkSwapchainKHR*                          pSwapchain) {
+    //assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR)
+    deviceObject := GetDevice(device)
+
+    swapchain := ?
+    pSwapchain[0] = swapchain
+    State.Swapchains[swapchain] = new!SwapchainObject(device: device)
+
+    return ?
+}
+
+@extension("VK_EXT_KHR_device_swapchain")
+cmd VkResult vkDestroySwapchainKHR(
+        VkDevice                                 device,
+        VkSwapchainKHR                           swapchain) {
+    deviceObject := GetDevice(device)
+    swapchainObject := GetSwapchain(swapchain)
+    assert(swapchainObject.device == device)
+
+    State.Swapchains[swapchain] = null
+
+    return ?
+}
+
+@extension("VK_EXT_KHR_device_swapchain")
+cmd VkResult vkGetSwapchainImagesKHR(
+        VkDevice                                 device,
+        VkSwapchainKHR                           swapchain,
+        u32*                                     pCount,
+        VkImage*                                 pSwapchainImages) {
+    deviceObject := GetDevice(device)
+
+    count := as!u32(?)
+    pCount[0] = count
+    swapchainImages := pSwapchainImages[0:count]
+
+    for i in (0 .. count) {
+        swapchainImage := ?
+        swapchainImages[i] = swapchainImage
+        if !(swapchainImage in State.Images) {
+            State.Images[swapchainImage] = new!ImageObject(device: device)
+        }
+    }
+
+    return ?
+}
+
+@extension("VK_EXT_KHR_device_swapchain")
+cmd VkResult vkAcquireNextImageKHR(
+        VkDevice                                 device,
+        VkSwapchainKHR                           swapchain,
+        u64                                      timeout,
+        VkSemaphore                              semaphore,
+        u32*                                     pImageIndex) {
+    deviceObject := GetDevice(device)
+    swapchainObject := GetSwapchain(swapchain)
+
+    imageIndex := ?
+    pImageIndex[0] = imageIndex
+
+    return ?
+}
+
+@extension("VK_EXT_KHR_device_swapchain")
+cmd VkResult vkQueuePresentKHR(
+        VkQueue                                  queue,
+        VkPresentInfoKHR*                        pPresentInfo) {
+    queueObject := GetQueue(queue)
+
+    presentInfo := ?
+    pPresentInfo[0] = presentInfo
+
+    return ?
+}
+
 
 ////////////////
 // Validation //
@@ -4407,7 +4509,6 @@
     map!(VkBufferView,               ref!BufferViewObject)               BufferViews
     map!(VkImage,                    ref!ImageObject)                    Images
     map!(VkImageView,                ref!ImageViewObject)                ImageViews
-    map!(VkAttachmentView,           ref!AttachmentViewObject)           AttachmentViews
     map!(VkShaderModule,             ref!ShaderModuleObject)             ShaderModules
     map!(VkShader,                   ref!ShaderObject)                   Shaders
     map!(VkPipeline,                 ref!PipelineObject)                 Pipelines
@@ -4416,10 +4517,6 @@
     map!(VkDescriptorSet,            ref!DescriptorSetObject)            DescriptorSets
     map!(VkDescriptorSetLayout,      ref!DescriptorSetLayoutObject)      DescriptorSetLayouts
     map!(VkDescriptorPool,           ref!DescriptorPoolObject)           DescriptorPools
-    map!(VkDynamicViewportState,     ref!DynamicViewportStateObject)     DynamicViewportStates
-    map!(VkDynamicRasterState,       ref!DynamicRasterStateObject)       DynamicRasterStates
-    map!(VkDynamicColorBlendState,   ref!DynamicColorBlendStateObject)   DynamicColorBlendStates
-    map!(VkDynamicDepthStencilState, ref!DynamicDepthStencilStateObject) DynamicDepthStencilStates
     map!(VkFence,                    ref!FenceObject)                    Fences
     map!(VkSemaphore,                ref!SemaphoreObject)                Semaphores
     map!(VkEvent,                    ref!EventObject)                    Events
@@ -4428,6 +4525,7 @@
     map!(VkRenderPass,               ref!RenderPassObject)               RenderPasses
     map!(VkPipelineCache,            ref!PipelineCacheObject)            PipelineCaches
     map!(VkCmdPool,                  ref!CmdPoolObject)                  CmdPools
+    map!(VkSwapchainKHR,             ref!SwapchainObject)                Swapchains
 }
 
 @internal class InstanceObject {
@@ -4454,15 +4552,15 @@
 
 @internal class DeviceMemoryObject {
     VkDevice                         device
-    platform.VkDeviceSize            allocationSize
-    map!(u64, platform.VkDeviceSize) boundObjects
+    VkDeviceSize                     allocationSize
+    map!(u64, VkDeviceSize         ) boundObjects
     map!(VkCmdBuffer, VkCmdBuffer)   boundCommandBuffers
 }
 
 @internal class BufferObject {
     VkDevice              device
     VkDeviceMemory        mem
-    platform.VkDeviceSize memOffset
+    VkDeviceSize          memOffset
 }
 
 @internal class BufferViewObject {
@@ -4473,7 +4571,7 @@
 @internal class ImageObject {
     VkDevice              device
     VkDeviceMemory        mem
-    platform.VkDeviceSize memOffset
+    VkDeviceSize          memOffset
 }
 
 @internal class ImageViewObject {
@@ -4481,11 +4579,6 @@
     VkImage       image
 }
 
-@internal class AttachmentViewObject {
-    VkDevice      device
-    VkImage       image
-}
-
 @internal class ShaderObject {
     VkDevice      device
 }
@@ -4518,22 +4611,6 @@
     VkDevice      device
 }
 
-@internal class DynamicViewportStateObject {
-    VkDevice      device
-}
-
-@internal class DynamicRasterStateObject {
-    VkDevice      device
-}
-
-@internal class DynamicColorBlendStateObject {
-    VkDevice      device
-}
-
-@internal class DynamicDepthStencilStateObject {
-    VkDevice      device
-}
-
 @internal class FenceObject {
     VkDevice      device
     bool          signaled
@@ -4567,6 +4644,10 @@
     VkDevice      device
 }
 
+@internal class SwapchainObject {
+    VkDevice      device
+}
+
 macro ref!InstanceObject GetInstance(VkInstance instance) {
     assert(instance in State.Instances)
     return State.Instances[instance]
@@ -4617,11 +4698,6 @@
     return State.ImageViews[imageView]
 }
 
-macro ref!AttachmentViewObject GetAttachmentView(VkAttachmentView attachmentView) {
-    assert(attachmentView in State.AttachmentViews)
-    return State.AttachmentViews[attachmentView]
-}
-
 macro ref!ShaderObject GetShader(VkShader shader) {
     assert(shader in State.Shaders)
     return State.Shaders[shader]
@@ -4662,26 +4738,6 @@
     return State.DescriptorPools[descriptorPool]
 }
 
-macro ref!DynamicViewportStateObject GetDynamicViewportState(VkDynamicViewportState dynamicViewportState) {
-    assert(dynamicViewportState in State.DynamicViewportStates)
-    return State.DynamicViewportStates[dynamicViewportState]
-}
-
-macro ref!DynamicRasterStateObject GetDynamicRasterState(VkDynamicRasterState dynamicRasterState) {
-    assert(dynamicRasterState in State.DynamicRasterStates)
-    return State.DynamicRasterStates[dynamicRasterState]
-}
-
-macro ref!DynamicColorBlendStateObject GetDynamicColorBlendState(VkDynamicColorBlendState dynamicColorBlendState) {
-    assert(dynamicColorBlendState in State.DynamicColorBlendStates)
-    return State.DynamicColorBlendStates[dynamicColorBlendState]
-}
-
-macro ref!DynamicDepthStencilStateObject GetDynamicDepthStencilState(VkDynamicDepthStencilState dynamicDepthStencilState) {
-    assert(dynamicDepthStencilState in State.DynamicDepthStencilStates)
-    return State.DynamicDepthStencilStates[dynamicDepthStencilState]
-}
-
 macro ref!FenceObject GetFence(VkFence fence) {
     assert(fence in State.Fences)
     return State.Fences[fence]
@@ -4721,3 +4777,8 @@
     assert(cmdPool in State.CmdPools)
     return State.CmdPools[cmdPool]
 }
+
+macro ref!SwapchainObject GetSwapchain(VkSwapchainKHR swapchain) {
+    assert(swapchain in State.Swapchains)
+    return State.Swapchains[swapchain]
+}
diff --git a/vulkan/doc/DevelopersGuide.pdf b/vulkan/doc/DevelopersGuide.pdf
new file mode 100644
index 0000000..5b9918c
--- /dev/null
+++ b/vulkan/doc/DevelopersGuide.pdf
Binary files differ
diff --git a/vulkan/doc/implementors_guide-docinfo.adoc b/vulkan/doc/implementors_guide/implementors_guide-docinfo.adoc
similarity index 100%
rename from vulkan/doc/implementors_guide-docinfo.adoc
rename to vulkan/doc/implementors_guide/implementors_guide-docinfo.adoc
diff --git a/vulkan/doc/implementors_guide.adoc b/vulkan/doc/implementors_guide/implementors_guide.adoc
similarity index 77%
rename from vulkan/doc/implementors_guide.adoc
rename to vulkan/doc/implementors_guide/implementors_guide.adoc
index e972b2f..60a6f61 100644
--- a/vulkan/doc/implementors_guide.adoc
+++ b/vulkan/doc/implementors_guide/implementors_guide.adoc
@@ -2,7 +2,7 @@
 = Vulkan on Android Implementor's Guide =
 :toc: right
 :numbered:
-:revnumber: 1
+:revnumber: 3
 
 This document is intended for GPU IHVs writing Vulkan drivers for Android, and OEMs integrating them for specific devices. It describes how a Vulkan driver interacts with the system, how GPU-specific tools should be installed, and Android-specific requirements.
 
@@ -51,6 +51,18 @@
 
 The +vk_wsi_swapchin+ and +vk_wsi_device_swapchain+ extensions will primarily be implemented by the platform and live in +libvulkan.so+. The +VkSwapchain+ object and all interaction with +ANativeWindow+ will be handled by the platform and not exposed to drivers. The WSI implementation will rely on a few private interfaces to the driver for this implementation. These will be loaded through the driver's +vkGetDeviceProcAddr+ functions, after passing through any enabled layers.
 
+Implementations may need swapchain buffers to be allocated with implementation-defined private gralloc usage flags. When creating a swapchain, the platform will ask the driver to translate the requested format and image usage flags into gralloc usage flags by calling
+[source,c]
+----
+VkResult VKAPI vkGetSwapchainGrallocUsageANDROID(
+    VkDevice            device,
+    VkFormat            format,
+    VkImageUsageFlags   imageUsage,
+    int*                grallocUsage
+);
+----
+The +format+ and +imageUsage+ parameters are taken from the +VkSwapchainCreateInfoKHR+ structure. The driver should fill +*grallocUsage+ with the gralloc usage flags it requires for that format and usage. These will be combined with the usage flags requested by the swapchain consumer when allocating buffers.
+
 +VkNativeBufferANDROID+ is a +vkCreateImage+ extension structure for creating an image backed by a gralloc buffer. This structure is provided to +vkCreateImage+ in the +VkImageCreateInfo+ structure chain. Calls to +vkCreateImage+ with this structure will happen during the first call to +vkGetSwapChainInfoWSI(.. VK_SWAP_CHAIN_INFO_TYPE_IMAGES_WSI ..)+. The WSI implementation will allocate the number of native buffers requested for the swapchain, then create a +VkImage+ for each one.
 
 [source,c]
@@ -87,30 +99,33 @@
   .pQueueFamilyIndices = VkSwapChainCreateInfoWSI::pQueueFamilyIndices
 ----
 
-+vkImportNativeFenceANDROID+ imports an externally-signalled native fence into an existing +VkSemaphore+ object:
++vkAcquireImageANDROID+ acquires ownership of a swapchain image and imports an externally-signalled native fence into an existing +VkSemaphore+ object:
 
 [source,c]
 ----
-VkResult VKAPI vkImportNativeFenceANDROID(
-    VkDevice        device,
-    VkSemaphore     semaphore,
-    int             nativeFenceFd
+VkResult VKAPI vkAcquireImageANDROID(
+    VkDevice            device,
+    VkImage             image,
+    int                 nativeFenceFd,
+    VkSemaphore         semaphore
+);
 );
 ----
 
-This function is called during +vkAcquireNextImageWSI+ to import a native fence into the +VkSemaphore+ object provided by the application. This call puts the +VkSemaphore+ into the same "pending" state as +vkQueueSignalSemaphore+, so queues can wait on the semaphore. The +VkSemaphore+ signals when the underlying native fence signals; if the fence has already signalled, then the semaphore
-will be in the signalled state when this function returns. The driver takes ownership of the fence fd and is responsible for closing it when the +VkSemaphore+ is destroyed, when a different native fence is imported, or any other condition that replaces the +VkSemaphore+'s underlying synchronization object. If +fenceFd+ is -1, the +VkSemaphore+ will be considered signalled immediately, but it can still be passed to +vkQueueWaitSemaphore+.
+This function is called during +vkAcquireNextImageWSI+ to import a native fence into the +VkSemaphore+ object provided by the application. The driver may also use this opportunity to recognize and handle any external changes to the gralloc buffer state; many drivers won't need to do anything here. This call puts the +VkSemaphore+ into the same "pending" state as +vkQueueSignalSemaphore+, so queues can wait on the semaphore. The +VkSemaphore+ signals when the underlying native fence signals; if the fence has already signalled, then the semaphore will be in the signalled state when this function returns. The driver takes ownership of the fence fd and is responsible for closing it when the +VkSemaphore+ is destroyed, when a different native fence is imported, or any other condition that replaces the +VkSemaphore+'s underlying synchronization object. If +fenceFd+ is -1, the +VkSemaphore+ will be considered signalled immediately, but it can still be passed to +vkQueueWaitSemaphore+.
 
-+vkQueueSignalNativeFenceANDROID+ creates a native fence and schedules it to be signalled when prior work on the queue has completed.
++vkQueueSignalReleaseImageANDROID+ prepares a swapchain image for external use, and creates a native fence and schedules it to be signalled when prior work on the queue has completed.
 
 [source,c]
 ----
-VkResult VKAPI vkQueueSignalNativeFenceANDROID(
-    VkQueue         queue,
-    int*            pNativeFenceFd);
+VkResult VKAPI vkQueueSignalReleaseImageANDROID(
+    VkQueue             queue,
+    VkImage             image,
+    int*                pNativeFenceFd
+);
 ----
 
-This will be called during +vkQueuePresentWSI+ on the provided queue. Effects are similar to +vkQueueSignalSemaphore+, except with a native fence instead of a semaphore. Unlike +vkQueueSignalSemaphore+, however, this call creates and returns the synchronization object that will be signalled rather than having it provided as input. If the queue is already idle when this function is called, it is allowed but not required to set +*pNativeFenceFd+ to -1. The file descriptor returned in +*pNativeFenceFd+ is owned and will be closed by the caller.
+This will be called during +vkQueuePresentWSI+ on the provided queue. Effects are similar to +vkQueueSignalSemaphore+, except with a native fence instead of a semaphore. Unlike +vkQueueSignalSemaphore+, however, this call creates and returns the synchronization object that will be signalled rather than having it provided as input. If the queue is already idle when this function is called, it is allowed but not required to set +*pNativeFenceFd+ to -1. The file descriptor returned in +*pNativeFenceFd+ is owned and will be closed by the caller. Many drivers will be able to ignore the +image+ parameter, but some may need to prepare CPU-side data structures associated with a gralloc buffer for use by external image consumers. Preparing buffer contents for use by external consumers should have been done asynchronously as part of transitioning the image to +VK_IMAGE_LAYOUT_PRESENT_SRC_KHR+.
 
 == History ==
 
@@ -120,3 +135,8 @@
    * Wording and formatting changes
    * Updated based on resolution of Khronos bug 14265
    * Deferred support for multiple drivers
+. *2015-11-04*
+   * Added vkGetSwapchainGrallocUsageANDROID
+   * Replaced vkImportNativeFenceANDROID and vkQueueSignalNativeFenceANDROID
+     with vkAcquireImageANDROID and vkQueueSignalReleaseImageANDROID, to allow
+     drivers to known the ownership state of swapchain images.
diff --git a/vulkan/doc/implementors_guide.conf b/vulkan/doc/implementors_guide/implementors_guide.conf
similarity index 100%
rename from vulkan/doc/implementors_guide.conf
rename to vulkan/doc/implementors_guide/implementors_guide.conf
diff --git a/vulkan/doc/implementors_guide.html b/vulkan/doc/implementors_guide/implementors_guide.html
similarity index 85%
rename from vulkan/doc/implementors_guide.html
rename to vulkan/doc/implementors_guide/implementors_guide.html
index 8c2aabb..8d6297a 100644
--- a/vulkan/doc/implementors_guide.html
+++ b/vulkan/doc/implementors_guide/implementors_guide.html
@@ -733,7 +733,7 @@
 <body class="book">
 <div id="header">
 <h1>Vulkan on Android Implementor&#8217;s Guide</h1>
-<span id="revnumber">version 1</span>
+<span id="revnumber">version 3</span>
 <div id="toc">
   <div id="toctitle">Table of Contents</div>
   <noscript><p><b>JavaScript must be enabled in your browser to display the table of contents.</b></p></noscript>
@@ -795,9 +795,22 @@
 <h2 id="_window_system_integration">2. Window System Integration</h2>
 <div class="sectionbody">
 <div class="paragraph"><p>The <span class="monospaced">vk_wsi_swapchin</span> and <span class="monospaced">vk_wsi_device_swapchain</span> extensions will primarily be implemented by the platform and live in <span class="monospaced">libvulkan.so</span>. The <span class="monospaced">VkSwapchain</span> object and all interaction with <span class="monospaced">ANativeWindow</span> will be handled by the platform and not exposed to drivers. The WSI implementation will rely on a few private interfaces to the driver for this implementation. These will be loaded through the driver&#8217;s <span class="monospaced">vkGetDeviceProcAddr</span> functions, after passing through any enabled layers.</p></div>
+<div class="paragraph"><p>Implementations may need swapchain buffers to be allocated with implementation-defined private gralloc usage flags. When creating a swapchain, the platform will ask the driver to translate the requested format and image usage flags into gralloc usage flags by calling</p></div>
+<div class="listingblock">
+<div class="content"><!-- Generator: GNU source-highlight 3.1.6
+by Lorenzo Bettini
+http://www.lorenzobettini.it
+http://www.gnu.org/software/src-highlite -->
+<pre><tt>VkResult <span style="color: #008080">VKAPI</span> <span style="font-weight: bold"><span style="color: #000000">vkGetSwapchainGrallocUsageANDROID</span></span><span style="color: #990000">(</span>
+    <span style="color: #008080">VkDevice</span>            device<span style="color: #990000">,</span>
+    <span style="color: #008080">VkFormat</span>            format<span style="color: #990000">,</span>
+    <span style="color: #008080">VkImageUsageFlags</span>   imageUsage<span style="color: #990000">,</span>
+    <span style="color: #009900">int</span><span style="color: #990000">*</span>                grallocUsage
+<span style="color: #990000">);</span></tt></pre></div></div>
+<div class="paragraph"><p>The <span class="monospaced">format</span> and <span class="monospaced">imageUsage</span> parameters are taken from the <span class="monospaced">VkSwapchainCreateInfoKHR</span> structure. The driver should fill <span class="monospaced">*grallocUsage</span> with the gralloc usage flags it requires for that format and usage. These will be combined with the usage flags requested by the swapchain consumer when allocating buffers.</p></div>
 <div class="paragraph"><p><span class="monospaced">VkNativeBufferANDROID</span> is a <span class="monospaced">vkCreateImage</span> extension structure for creating an image backed by a gralloc buffer. This structure is provided to <span class="monospaced">vkCreateImage</span> in the <span class="monospaced">VkImageCreateInfo</span> structure chain. Calls to <span class="monospaced">vkCreateImage</span> with this structure will happen during the first call to <span class="monospaced">vkGetSwapChainInfoWSI(.. VK_SWAP_CHAIN_INFO_TYPE_IMAGES_WSI ..)</span>. The WSI implementation will allocate the number of native buffers requested for the swapchain, then create a <span class="monospaced">VkImage</span> for each one.</p></div>
 <div class="listingblock">
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="content"><!-- Generator: GNU source-highlight 3.1.6
 by Lorenzo Bettini
 http://www.lorenzobettini.it
 http://www.gnu.org/software/src-highlite -->
@@ -830,29 +843,32 @@
   .queueFamilyCount    = VkSwapChainCreateInfoWSI::queueFamilyCount
   .pQueueFamilyIndices = VkSwapChainCreateInfoWSI::pQueueFamilyIndices</pre>
 </div></div>
-<div class="paragraph"><p><span class="monospaced">vkImportNativeFenceANDROID</span> imports an externally-signalled native fence into an existing <span class="monospaced">VkSemaphore</span> object:</p></div>
+<div class="paragraph"><p><span class="monospaced">vkAcquireImageANDROID</span> acquires ownership of a swapchain image and imports an externally-signalled native fence into an existing <span class="monospaced">VkSemaphore</span> object:</p></div>
 <div class="listingblock">
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="content"><!-- Generator: GNU source-highlight 3.1.6
 by Lorenzo Bettini
 http://www.lorenzobettini.it
 http://www.gnu.org/software/src-highlite -->
-<pre><tt>VkResult <span style="color: #008080">VKAPI</span> <span style="font-weight: bold"><span style="color: #000000">vkImportNativeFenceANDROID</span></span><span style="color: #990000">(</span>
-    <span style="color: #008080">VkDevice</span>        device<span style="color: #990000">,</span>
-    <span style="color: #008080">VkSemaphore</span>     semaphore<span style="color: #990000">,</span>
-    <span style="color: #009900">int</span>             nativeFenceFd
+<pre><tt>VkResult <span style="color: #008080">VKAPI</span> <span style="font-weight: bold"><span style="color: #000000">vkAcquireImageANDROID</span></span><span style="color: #990000">(</span>
+    <span style="color: #008080">VkDevice</span>            device<span style="color: #990000">,</span>
+    <span style="color: #008080">VkImage</span>             image<span style="color: #990000">,</span>
+    <span style="color: #009900">int</span>                 nativeFenceFd<span style="color: #990000">,</span>
+    VkSemaphore         semaphore
+<span style="color: #990000">);</span>
 <span style="color: #990000">);</span></tt></pre></div></div>
-<div class="paragraph"><p>This function is called during <span class="monospaced">vkAcquireNextImageWSI</span> to import a native fence into the <span class="monospaced">VkSemaphore</span> object provided by the application. This call puts the <span class="monospaced">VkSemaphore</span> into the same "pending" state as <span class="monospaced">vkQueueSignalSemaphore</span>, so queues can wait on the semaphore. The <span class="monospaced">VkSemaphore</span> signals when the underlying native fence signals; if the fence has already signalled, then the semaphore
-will be in the signalled state when this function returns. The driver takes ownership of the fence fd and is responsible for closing it when the <span class="monospaced">VkSemaphore</span> is destroyed, when a different native fence is imported, or any other condition that replaces the <span class="monospaced">VkSemaphore</span>'s underlying synchronization object. If <span class="monospaced">fenceFd</span> is -1, the <span class="monospaced">VkSemaphore</span> will be considered signalled immediately, but it can still be passed to <span class="monospaced">vkQueueWaitSemaphore</span>.</p></div>
-<div class="paragraph"><p><span class="monospaced">vkQueueSignalNativeFenceANDROID</span> creates a native fence and schedules it to be signalled when prior work on the queue has completed.</p></div>
+<div class="paragraph"><p>This function is called during <span class="monospaced">vkAcquireNextImageWSI</span> to import a native fence into the <span class="monospaced">VkSemaphore</span> object provided by the application. The driver may also use this opportunity to recognize and handle any external changes to the gralloc buffer state; many drivers won&#8217;t need to do anything here. This call puts the <span class="monospaced">VkSemaphore</span> into the same "pending" state as <span class="monospaced">vkQueueSignalSemaphore</span>, so queues can wait on the semaphore. The <span class="monospaced">VkSemaphore</span> signals when the underlying native fence signals; if the fence has already signalled, then the semaphore will be in the signalled state when this function returns. The driver takes ownership of the fence fd and is responsible for closing it when the <span class="monospaced">VkSemaphore</span> is destroyed, when a different native fence is imported, or any other condition that replaces the <span class="monospaced">VkSemaphore</span>'s underlying synchronization object. If <span class="monospaced">fenceFd</span> is -1, the <span class="monospaced">VkSemaphore</span> will be considered signalled immediately, but it can still be passed to <span class="monospaced">vkQueueWaitSemaphore</span>.</p></div>
+<div class="paragraph"><p><span class="monospaced">vkQueueSignalReleaseImageANDROID</span> prepares a swapchain image for external use, and creates a native fence and schedules it to be signalled when prior work on the queue has completed.</p></div>
 <div class="listingblock">
-<div class="content"><!-- Generator: GNU source-highlight 3.1.8
+<div class="content"><!-- Generator: GNU source-highlight 3.1.6
 by Lorenzo Bettini
 http://www.lorenzobettini.it
 http://www.gnu.org/software/src-highlite -->
-<pre><tt>VkResult <span style="color: #008080">VKAPI</span> <span style="font-weight: bold"><span style="color: #000000">vkQueueSignalNativeFenceANDROID</span></span><span style="color: #990000">(</span>
-    <span style="color: #008080">VkQueue</span>         queue<span style="color: #990000">,</span>
-    <span style="color: #009900">int</span><span style="color: #990000">*</span>            pNativeFenceFd<span style="color: #990000">);</span></tt></pre></div></div>
-<div class="paragraph"><p>This will be called during <span class="monospaced">vkQueuePresentWSI</span> on the provided queue. Effects are similar to <span class="monospaced">vkQueueSignalSemaphore</span>, except with a native fence instead of a semaphore. Unlike <span class="monospaced">vkQueueSignalSemaphore</span>, however, this call creates and returns the synchronization object that will be signalled rather than having it provided as input. If the queue is already idle when this function is called, it is allowed but not required to set <span class="monospaced">*pNativeFenceFd</span> to -1. The file descriptor returned in <span class="monospaced">*pNativeFenceFd</span> is owned and will be closed by the caller.</p></div>
+<pre><tt>VkResult <span style="color: #008080">VKAPI</span> <span style="font-weight: bold"><span style="color: #000000">vkQueueSignalReleaseImageANDROID</span></span><span style="color: #990000">(</span>
+    <span style="color: #008080">VkQueue</span>             queue<span style="color: #990000">,</span>
+    <span style="color: #008080">VkImage</span>             image<span style="color: #990000">,</span>
+    <span style="color: #009900">int</span><span style="color: #990000">*</span>                pNativeFenceFd
+<span style="color: #990000">);</span></tt></pre></div></div>
+<div class="paragraph"><p>This will be called during <span class="monospaced">vkQueuePresentWSI</span> on the provided queue. Effects are similar to <span class="monospaced">vkQueueSignalSemaphore</span>, except with a native fence instead of a semaphore. Unlike <span class="monospaced">vkQueueSignalSemaphore</span>, however, this call creates and returns the synchronization object that will be signalled rather than having it provided as input. If the queue is already idle when this function is called, it is allowed but not required to set <span class="monospaced">*pNativeFenceFd</span> to -1. The file descriptor returned in <span class="monospaced">*pNativeFenceFd</span> is owned and will be closed by the caller. Many drivers will be able to ignore the <span class="monospaced">image</span> parameter, but some may need to prepare CPU-side data structures associated with a gralloc buffer for use by external image consumers. Preparing buffer contents for use by external consumers should have been done asynchronously as part of transitioning the image to <span class="monospaced">VK_IMAGE_LAYOUT_PRESENT_SRC_KHR</span>.</p></div>
 </div>
 </div>
 <div class="sect1">
@@ -891,6 +907,25 @@
 </li>
 </ul></div>
 </li>
+<li>
+<p>
+<strong>2015-11-04</strong>
+</p>
+<div class="ulist"><ul>
+<li>
+<p>
+Added vkGetSwapchainGrallocUsageANDROID
+</p>
+</li>
+<li>
+<p>
+Replaced vkImportNativeFenceANDROID and vkQueueSignalNativeFenceANDROID
+     with vkAcquireImageANDROID and vkQueueSignalReleaseImageANDROID, to allow
+     drivers to known the ownership state of swapchain images.
+</p>
+</li>
+</ul></div>
+</li>
 </ol></div>
 </div>
 </div>
@@ -898,8 +933,8 @@
 <div id="footnotes"><hr></div>
 <div id="footer">
 <div id="footer-text">
-Version 1<br>
-Last updated 2015-08-16 23:34:58 PDT
+Version 3<br>
+Last updated 2015-11-04 10:58:22 PST
 </div>
 </div>
 </body>
diff --git a/vulkan/include/hardware/hwvulkan.h b/vulkan/include/hardware/hwvulkan.h
index 91dd41e..9e9a14d 100644
--- a/vulkan/include/hardware/hwvulkan.h
+++ b/vulkan/include/hardware/hwvulkan.h
@@ -38,15 +38,14 @@
  * implementation-defined data). On return from the creation function, the
  * 'magic' field must contain HWVULKAN_DISPATCH_MAGIC; the loader will overwrite
  * the 'vtbl' field.
+ *
+ * NOTE: The magic value and the layout of hwvulkan_dispatch_t match the LunarG
+ * loader used on platforms, to avoid pointless annoying differences for
+ * multi-platform drivers. Don't change them without a good reason. If there is
+ * an opportunity to change it, using a magic value that doesn't leave the
+ * upper 32-bits zero on 64-bit platforms would be nice.
  */
-#if defined(__LP64__)
-#define HWVULKAN_DISPATCH_MAGIC UINT64_C(0xCA11AB1E00C0DE00)
-#elif defined(__ILP32__)
-#define HWVULKAN_DISPATCH_MAGIC UINT32_C(0xCA11AB1E)
-#else
-#error "unknown pointer size?!"
-#endif
-
+#define HWVULKAN_DISPATCH_MAGIC 0x01CDC0DE
 typedef union {
     uintptr_t magic;
     const void* vtbl;
@@ -61,7 +60,8 @@
 typedef struct hwvulkan_device_t {
     struct hw_device_t common;
 
-    PFN_vkGetGlobalExtensionProperties GetGlobalExtensionProperties;
+    PFN_vkEnumerateInstanceExtensionProperties
+        EnumerateInstanceExtensionProperties;
     PFN_vkCreateInstance CreateInstance;
     PFN_vkGetInstanceProcAddr GetInstanceProcAddr;
 } hwvulkan_device_t;
diff --git a/vulkan/include/vulkan/vk_debug_report_lunarg.h b/vulkan/include/vulkan/vk_debug_report_lunarg.h
index 8ff5654..23bb63c 100644
--- a/vulkan/include/vulkan/vk_debug_report_lunarg.h
+++ b/vulkan/include/vulkan/vk_debug_report_lunarg.h
@@ -32,13 +32,14 @@
 #ifndef __VK_DEBUG_REPORT_LUNARG_H__
 #define __VK_DEBUG_REPORT_LUNARG_H__
 
-#include <vulkan/vulkan.h>
+#include "vulkan.h"
 
 #define VK_DEBUG_REPORT_EXTENSION_NUMBER 5
 #define VK_DEBUG_REPORT_EXTENSION_REVISION 1
 #ifdef __cplusplus
-extern "C" {
-#endif  // __cplusplus
+extern "C"
+{
+#endif // __cplusplus
 
 /*
 ***************************************************************************************************
@@ -65,25 +66,18 @@
     VK_OBJECT_TYPE_DESCRIPTOR_SET = 17,
     VK_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT = 18,
     VK_OBJECT_TYPE_DESCRIPTOR_POOL = 19,
-    VK_OBJECT_TYPE_DYNAMIC_VIEWPORT_STATE = 20,
-    VK_OBJECT_TYPE_DYNAMIC_LINE_WIDTH_STATE = 21,
-    VK_OBJECT_TYPE_DYNAMIC_DEPTH_BIAS_STATE = 22,
-    VK_OBJECT_TYPE_DYNAMIC_BLEND_STATE = 23,
-    VK_OBJECT_TYPE_DYNAMIC_DEPTH_BOUNDS_STATE = 24,
-    VK_OBJECT_TYPE_DYNAMIC_STENCIL_STATE = 25,
-    VK_OBJECT_TYPE_FENCE = 26,
-    VK_OBJECT_TYPE_SEMAPHORE = 27,
-    VK_OBJECT_TYPE_EVENT = 28,
-    VK_OBJECT_TYPE_QUERY_POOL = 29,
-    VK_OBJECT_TYPE_FRAMEBUFFER = 30,
-    VK_OBJECT_TYPE_RENDER_PASS = 31,
-    VK_OBJECT_TYPE_PIPELINE_CACHE = 32,
-    VK_OBJECT_TYPE_SWAPCHAIN_KHR = 33,
-    VK_OBJECT_TYPE_CMD_POOL = 34,
+    VK_OBJECT_TYPE_FENCE = 20,
+    VK_OBJECT_TYPE_SEMAPHORE = 21,
+    VK_OBJECT_TYPE_EVENT = 22,
+    VK_OBJECT_TYPE_QUERY_POOL = 23,
+    VK_OBJECT_TYPE_FRAMEBUFFER = 24,
+    VK_OBJECT_TYPE_RENDER_PASS = 25,
+    VK_OBJECT_TYPE_PIPELINE_CACHE = 26,
+    VK_OBJECT_TYPE_SWAPCHAIN_KHR = 27,
+    VK_OBJECT_TYPE_CMD_POOL = 28,
     VK_OBJECT_TYPE_BEGIN_RANGE = VK_OBJECT_TYPE_INSTANCE,
     VK_OBJECT_TYPE_END_RANGE = VK_OBJECT_TYPE_CMD_POOL,
-    VK_OBJECT_TYPE_NUM =
-        (VK_OBJECT_TYPE_CMD_POOL - VK_OBJECT_TYPE_INSTANCE + 1),
+    VK_OBJECT_TYPE_NUM = (VK_OBJECT_TYPE_CMD_POOL - VK_OBJECT_TYPE_INSTANCE + 1),
     VK_OBJECT_TYPE_MAX_ENUM = 0x7FFFFFFF
 } VkDbgObjectType;
 
@@ -94,95 +88,95 @@
 // ------------------------------------------------------------------------------------------------
 // Enumerations
 
-typedef enum VkDbgReportFlags_ {
-    VK_DBG_REPORT_INFO_BIT = 0x0001,
-    VK_DBG_REPORT_WARN_BIT = 0x0002,
-    VK_DBG_REPORT_PERF_WARN_BIT = 0x0004,
-    VK_DBG_REPORT_ERROR_BIT = 0x0008,
-    VK_DBG_REPORT_DEBUG_BIT = 0x0010,
+typedef enum VkDbgReportFlags_
+{
+    VK_DBG_REPORT_INFO_BIT       = 0x0001,
+    VK_DBG_REPORT_WARN_BIT       = 0x0002,
+    VK_DBG_REPORT_PERF_WARN_BIT  = 0x0004,
+    VK_DBG_REPORT_ERROR_BIT      = 0x0008,
+    VK_DBG_REPORT_DEBUG_BIT      = 0x0010,
 } VkDbgReportFlags;
 
 // Debug Report ERROR codes
-typedef enum _DEBUG_REPORT_ERROR {
-    DEBUG_REPORT_NONE,          // Used for INFO & other non-error messages
-    DEBUG_REPORT_CALLBACK_REF,  // Callbacks were not destroyed prior to calling
-                                // DestroyInstance
+typedef enum _DEBUG_REPORT_ERROR
+{
+    DEBUG_REPORT_NONE,                  // Used for INFO & other non-error messages
+    DEBUG_REPORT_CALLBACK_REF,          // Callbacks were not destroyed prior to calling DestroyInstance
 } DEBUG_REPORT_ERROR;
 
-#define VK_DEBUG_REPORT_ENUM_EXTEND(type, id) \
-    ((type)(VK_DEBUG_REPORT_EXTENSION_NUMBER * -1000 + (id)))
+#define VK_DEBUG_REPORT_ENUM_EXTEND(type, id)    ((type)(VK_DEBUG_REPORT_EXTENSION_NUMBER * -1000 + (id)))
 
-#define VK_OBJECT_TYPE_MSG_CALLBACK \
-    VK_DEBUG_REPORT_ENUM_EXTEND(VkDbgObjectType, 0)
+#define VK_OBJECT_TYPE_MSG_CALLBACK VK_DEBUG_REPORT_ENUM_EXTEND(VkDbgObjectType, 0)
+#define VK_ERROR_VALIDATION_FAILED VK_DEBUG_REPORT_ENUM_EXTEND(VkResult, 0)
+
 // ------------------------------------------------------------------------------------------------
 // Vulkan function pointers
 
-typedef void (*PFN_vkDbgMsgCallback)(VkFlags msgFlags,
-                                     VkDbgObjectType objType,
-                                     uint64_t srcObject,
-                                     size_t location,
-                                     int32_t msgCode,
-                                     const char* pLayerPrefix,
-                                     const char* pMsg,
-                                     void* pUserData);
+typedef VkBool32 (*PFN_vkDbgMsgCallback)(
+    VkFlags                             msgFlags,
+    VkDbgObjectType                     objType,
+    uint64_t                            srcObject,
+    size_t                              location,
+    int32_t                             msgCode,
+    const char*                         pLayerPrefix,
+    const char*                         pMsg,
+    void*                               pUserData);
 
 // ------------------------------------------------------------------------------------------------
 // API functions
 
-typedef VkResult(VKAPI* PFN_vkDbgCreateMsgCallback)(
-    VkInstance instance,
-    VkFlags msgFlags,
-    const PFN_vkDbgMsgCallback pfnMsgCallback,
-    void* pUserData,
-    VkDbgMsgCallback* pMsgCallback);
-typedef VkResult(VKAPI* PFN_vkDbgDestroyMsgCallback)(
-    VkInstance instance,
-    VkDbgMsgCallback msgCallback);
+typedef VkResult (VKAPI *PFN_vkDbgCreateMsgCallback)(VkInstance instance, VkFlags msgFlags, const PFN_vkDbgMsgCallback pfnMsgCallback, void* pUserData, VkDbgMsgCallback* pMsgCallback);
+typedef VkResult (VKAPI *PFN_vkDbgDestroyMsgCallback)(VkInstance instance, VkDbgMsgCallback msgCallback);
 
 #ifdef VK_PROTOTYPES
 
 // DebugReport extension entrypoints
-VkResult VKAPI vkDbgCreateMsgCallback(VkInstance instance,
-                                      VkFlags msgFlags,
-                                      const PFN_vkDbgMsgCallback pfnMsgCallback,
-                                      void* pUserData,
-                                      VkDbgMsgCallback* pMsgCallback);
+VkResult VKAPI vkDbgCreateMsgCallback(
+    VkInstance                          instance,
+    VkFlags                             msgFlags,
+    const PFN_vkDbgMsgCallback          pfnMsgCallback,
+    void*                               pUserData,
+    VkDbgMsgCallback*                   pMsgCallback);
 
-VkResult VKAPI vkDbgDestroyMsgCallback(VkInstance instance,
-                                       VkDbgMsgCallback msgCallback);
+VkResult VKAPI vkDbgDestroyMsgCallback(
+    VkInstance                          instance,
+    VkDbgMsgCallback                    msgCallback);
 
 // DebugReport utility callback functions
-void VKAPI vkDbgStringCallback(VkFlags msgFlags,
-                               VkDbgObjectType objType,
-                               uint64_t srcObject,
-                               size_t location,
-                               int32_t msgCode,
-                               const char* pLayerPrefix,
-                               const char* pMsg,
-                               void* pUserData);
+void VKAPI vkDbgStringCallback(
+    VkFlags                             msgFlags,
+    VkDbgObjectType                     objType,
+    uint64_t                            srcObject,
+    size_t                              location,
+    int32_t                             msgCode,
+    const char*                         pLayerPrefix,
+    const char*                         pMsg,
+    void*                               pUserData);
 
-void VKAPI vkDbgStdioCallback(VkFlags msgFlags,
-                              VkDbgObjectType objType,
-                              uint64_t srcObject,
-                              size_t location,
-                              int32_t msgCode,
-                              const char* pLayerPrefix,
-                              const char* pMsg,
-                              void* pUserData);
+void VKAPI vkDbgStdioCallback(
+    VkFlags                             msgFlags,
+    VkDbgObjectType                     objType,
+    uint64_t                            srcObject,
+    size_t                              location,
+    int32_t                             msgCode,
+    const char*                         pLayerPrefix,
+    const char*                         pMsg,
+    void*                               pUserData);
 
-void VKAPI vkDbgBreakCallback(VkFlags msgFlags,
-                              VkDbgObjectType objType,
-                              uint64_t srcObject,
-                              size_t location,
-                              int32_t msgCode,
-                              const char* pLayerPrefix,
-                              const char* pMsg,
-                              void* pUserData);
+void VKAPI vkDbgBreakCallback(
+    VkFlags                             msgFlags,
+    VkDbgObjectType                     objType,
+    uint64_t                            srcObject,
+    size_t                              location,
+    int32_t                             msgCode,
+    const char*                         pLayerPrefix,
+    const char*                         pMsg,
+    void*                               pUserData);
 
-#endif  // VK_PROTOTYPES
+#endif // VK_PROTOTYPES
 
 #ifdef __cplusplus
-}  // extern "C"
-#endif  // __cplusplus
+} // extern "C"
+#endif // __cplusplus
 
-#endif  // __VK_DEBUG_REPORT_LUNARG_H__
+#endif // __VK_DEBUG_REPORT_LUNARG_H__
diff --git a/vulkan/include/vulkan/vk_ext_android_native_buffer.h b/vulkan/include/vulkan/vk_ext_android_native_buffer.h
index a1311f4..f665164 100644
--- a/vulkan/include/vulkan/vk_ext_android_native_buffer.h
+++ b/vulkan/include/vulkan/vk_ext_android_native_buffer.h
@@ -47,19 +47,43 @@
     int                         usage;
 } VkNativeBufferANDROID;
 
+typedef VkResult (VKAPI *PFN_vkGetSwapchainGrallocUsageANDROID)(VkDevice device, VkFormat format, VkImageUsageFlags imageUsage, int* grallocUsage);
+typedef VkResult (VKAPI *PFN_vkAcquireImageANDROID)(VkDevice device, VkImage image, int nativeFenceFd, VkSemaphore semaphore);
+typedef VkResult (VKAPI *PFN_vkQueueSignalReleaseImageANDROID)(VkQueue queue, VkImage image, int* pNativeFenceFd);
+// -- DEPRECATED --
 typedef VkResult (VKAPI *PFN_vkImportNativeFenceANDROID)(VkDevice device, VkSemaphore semaphore, int nativeFenceFd);
 typedef VkResult (VKAPI *PFN_vkQueueSignalNativeFenceANDROID)(VkQueue queue, int* pNativeFenceFd);
+// ----------------
 
 #ifdef VK_PROTOTYPES
+VkResult VKAPI vkGetSwapchainGrallocUsageANDROID(
+    VkDevice            device,
+    VkFormat            format,
+    VkImageUsageFlags   imageUsage,
+    int*                grallocUsage
+);
+VkResult VKAPI vkAcquireImageANDROID(
+    VkDevice            device,
+    VkImage             image,
+    int                 nativeFenceFd,
+    VkSemaphore         semaphore
+);
+VkResult VKAPI vkQueueSignalReleaseImageANDROID(
+    VkQueue             queue,
+    VkImage             image,
+    int*                pNativeFenceFd
+);
+// -- DEPRECATED --
 VkResult VKAPI vkImportNativeFenceANDROID(
-    VkDevice        device,
-    VkSemaphore     semaphore,
-    int             nativeFenceFd
+    VkDevice            device,
+    VkSemaphore         semaphore,
+    int                 nativeFenceFd
 );
 VkResult VKAPI vkQueueSignalNativeFenceANDROID(
-    VkQueue         queue,
-    int*            pNativeFenceFd
+    VkQueue             queue,
+    int*                pNativeFenceFd
 );
+// ----------------
 #endif
 
 #ifdef __cplusplus
diff --git a/vulkan/include/vulkan/vk_ext_khr_device_swapchain.h b/vulkan/include/vulkan/vk_ext_khr_device_swapchain.h
index b254586..3bf73c8 100644
--- a/vulkan/include/vulkan/vk_ext_khr_device_swapchain.h
+++ b/vulkan/include/vulkan/vk_ext_khr_device_swapchain.h
@@ -29,7 +29,7 @@
 
 #include "vulkan.h"
 
-#define VK_EXT_KHR_DEVICE_SWAPCHAIN_REVISION         51
+#define VK_EXT_KHR_DEVICE_SWAPCHAIN_REVISION         53
 #define VK_EXT_KHR_DEVICE_SWAPCHAIN_EXTENSION_NUMBER 2
 #define VK_EXT_KHR_DEVICE_SWAPCHAIN_EXTENSION_NAME   "VK_EXT_KHR_device_swapchain"
 
@@ -50,7 +50,7 @@
 #define VK_EXT_KHR_DEVICE_SWAPCHAIN_ENUM_POSITIVE(type,id)    ((type)((int)0x40000000 + (VK_EXT_KHR_DEVICE_SWAPCHAIN_EXTENSION_NUMBER - 1) * 1024 + (id)))
 
 // Extend VkStructureType enum with extension specific constants
-#define VK_STRUCTURE_TYPE_SWAP_CHAIN_CREATE_INFO_KHR VK_EXT_KHR_DEVICE_SWAPCHAIN_ENUM(VkStructureType, 0)
+#define VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR VK_EXT_KHR_DEVICE_SWAPCHAIN_ENUM(VkStructureType, 0)
 #define VK_STRUCTURE_TYPE_PRESENT_INFO_KHR VK_EXT_KHR_DEVICE_SWAPCHAIN_ENUM(VkStructureType, 1)
 
 // Extend VkImageLayout enum with extension specific constants
@@ -109,7 +109,7 @@
 } VkSurfaceFormatKHR;
 
 typedef struct {
-    VkStructureType                          sType;             // Must be VK_STRUCTURE_TYPE_SWAP_CHAIN_CREATE_INFO_KHR
+    VkStructureType                          sType;             // Must be VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR
     const void*                              pNext;             // Pointer to next structure
 
     const VkSurfaceDescriptionKHR*           pSurfaceDescription;// describes the swap chain's target surface
diff --git a/vulkan/include/vulkan/vk_platform.h b/vulkan/include/vulkan/vk_platform.h
index 7ba8d77..969e532 100644
--- a/vulkan/include/vulkan/vk_platform.h
+++ b/vulkan/include/vulkan/vk_platform.h
@@ -67,22 +67,6 @@
     #endif
 #endif // !defined(VK_NO_STDINT_H)
 
-typedef uint64_t   VkDeviceSize;
-typedef uint32_t   VkBool32;
-
-typedef uint32_t   VkSampleMask;
-typedef uint32_t   VkFlags;
-
-#if (UINTPTR_MAX >= UINT64_MAX)
-    #define VK_UINTPTRLEAST64_MAX UINTPTR_MAX
-
-    typedef uintptr_t VkUintPtrLeast64;
-#else
-    #define VK_UINTPTRLEAST64_MAX UINT64_MAX
-
-    typedef uint64_t  VkUintPtrLeast64;
-#endif
-
 #ifdef __cplusplus
 } // extern "C"
 #endif // __cplusplus
diff --git a/vulkan/include/vulkan/vulkan.h b/vulkan/include/vulkan/vulkan.h
index 9877233..03bcefe 100644
--- a/vulkan/include/vulkan/vulkan.h
+++ b/vulkan/include/vulkan/vulkan.h
@@ -41,14 +41,21 @@
     ((major << 22) | (minor << 12) | patch)
 
 // Vulkan API version supported by this file
-#define VK_API_VERSION VK_MAKE_VERSION(0, 138, 2)
+#define VK_API_VERSION VK_MAKE_VERSION(0, 170, 2)
+
+
+#if defined(__cplusplus) && (_MSC_VER >= 1800 || __cplusplus >= 201103L)
+    #define VK_NULL_HANDLE nullptr
+#else
+    #define VK_NULL_HANDLE 0
+#endif
 
 
 #define VK_DEFINE_HANDLE(obj) typedef struct obj##_T* obj;
 
 
 #if defined(__cplusplus)
-    #if (_MSC_VER >= 1800 || __cplusplus >= 201103L)
+    #if ((defined(_MSC_VER) && _MSC_VER >= 1800) || __cplusplus >= 201103L)
         // The bool operator only works if there are no implicit conversions from an obj to
         // a bool-compatible type, which can then be used to unintentionally violate type safety.
         // C++11 and above supports the "explicit" keyword on conversion operators to stop this
@@ -56,13 +63,18 @@
         // the object handle as a bool in expressions like:
         //     if (obj) vkDestroy(obj);
         #define VK_NONDISP_HANDLE_OPERATOR_BOOL() explicit operator bool() const { return handle != 0; }
+        #define VK_NONDISP_HANDLE_CONSTRUCTOR_FROM_UINT64(obj) \
+            explicit obj(uint64_t x) : handle(x) { } \
+            obj(decltype(nullptr)) : handle(0) { }
     #else
         #define VK_NONDISP_HANDLE_OPERATOR_BOOL()
+        #define VK_NONDISP_HANDLE_CONSTRUCTOR_FROM_UINT64(obj) \
+            obj(uint64_t x) : handle(x) { }
     #endif
     #define VK_DEFINE_NONDISP_HANDLE(obj) \
         struct obj { \
             obj() : handle(0) { } \
-            obj(uint64_t x) : handle(x) { } \
+            VK_NONDISP_HANDLE_CONSTRUCTOR_FROM_UINT64(obj) \
             obj& operator =(uint64_t x) { handle = x; return *this; } \
             bool operator==(const obj& other) const { return handle == other.handle; } \
             bool operator!=(const obj& other) const { return handle != other.handle; } \
@@ -76,20 +88,10 @@
         
 
 
-#define VK_LOD_CLAMP_NONE                 MAX_FLOAT
-#define VK_LAST_MIP_LEVEL                 UINT32_MAX
-#define VK_LAST_ARRAY_SLICE               UINT32_MAX
-#define VK_WHOLE_SIZE                     UINT64_MAX
-#define VK_ATTACHMENT_UNUSED              UINT32_MAX
-#define VK_TRUE                           1
-#define VK_FALSE                          0
-#define VK_NULL_HANDLE                    0
-#define VK_MAX_PHYSICAL_DEVICE_NAME       256
-#define VK_UUID_LENGTH                    16
-#define VK_MAX_MEMORY_TYPES               32
-#define VK_MAX_MEMORY_HEAPS               16
-#define VK_MAX_EXTENSION_NAME             256
-#define VK_MAX_DESCRIPTION                256
+typedef uint32_t VkBool32;
+typedef uint32_t VkFlags;
+typedef uint64_t VkDeviceSize;
+typedef uint32_t VkSampleMask;
 
 VK_DEFINE_HANDLE(VkInstance)
 VK_DEFINE_HANDLE(VkPhysicalDevice)
@@ -105,7 +107,6 @@
 VK_DEFINE_NONDISP_HANDLE(VkQueryPool)
 VK_DEFINE_NONDISP_HANDLE(VkBufferView)
 VK_DEFINE_NONDISP_HANDLE(VkImageView)
-VK_DEFINE_NONDISP_HANDLE(VkAttachmentView)
 VK_DEFINE_NONDISP_HANDLE(VkShaderModule)
 VK_DEFINE_NONDISP_HANDLE(VkShader)
 VK_DEFINE_NONDISP_HANDLE(VkPipelineCache)
@@ -116,13 +117,25 @@
 VK_DEFINE_NONDISP_HANDLE(VkSampler)
 VK_DEFINE_NONDISP_HANDLE(VkDescriptorPool)
 VK_DEFINE_NONDISP_HANDLE(VkDescriptorSet)
-VK_DEFINE_NONDISP_HANDLE(VkDynamicViewportState)
-VK_DEFINE_NONDISP_HANDLE(VkDynamicRasterState)
-VK_DEFINE_NONDISP_HANDLE(VkDynamicColorBlendState)
-VK_DEFINE_NONDISP_HANDLE(VkDynamicDepthStencilState)
 VK_DEFINE_NONDISP_HANDLE(VkFramebuffer)
 VK_DEFINE_NONDISP_HANDLE(VkCmdPool)
 
+#define VK_LOD_CLAMP_NONE                 1000.0f
+#define VK_REMAINING_MIP_LEVELS           (~0U)
+#define VK_REMAINING_ARRAY_LAYERS         (~0U)
+#define VK_WHOLE_SIZE                     (~0ULL)
+#define VK_ATTACHMENT_UNUSED              (~0U)
+#define VK_TRUE                           1
+#define VK_FALSE                          0
+#define VK_QUEUE_FAMILY_IGNORED           (~0U)
+#define VK_SUBPASS_EXTERNAL               (~0U)
+#define VK_MAX_PHYSICAL_DEVICE_NAME       256
+#define VK_UUID_LENGTH                    16
+#define VK_MAX_MEMORY_TYPES               32
+#define VK_MAX_MEMORY_HEAPS               16
+#define VK_MAX_EXTENSION_NAME             256
+#define VK_MAX_DESCRIPTION                256
+
 
 typedef enum {
     VK_SUCCESS = 0,
@@ -132,41 +145,17 @@
     VK_EVENT_SET = 4,
     VK_EVENT_RESET = 5,
     VK_INCOMPLETE = 6,
-    VK_ERROR_UNKNOWN = -1,
-    VK_ERROR_UNAVAILABLE = -2,
+    VK_ERROR_OUT_OF_HOST_MEMORY = -1,
+    VK_ERROR_OUT_OF_DEVICE_MEMORY = -2,
     VK_ERROR_INITIALIZATION_FAILED = -3,
-    VK_ERROR_OUT_OF_HOST_MEMORY = -4,
-    VK_ERROR_OUT_OF_DEVICE_MEMORY = -5,
-    VK_ERROR_DEVICE_ALREADY_CREATED = -6,
-    VK_ERROR_DEVICE_LOST = -7,
-    VK_ERROR_INVALID_POINTER = -8,
-    VK_ERROR_INVALID_VALUE = -9,
-    VK_ERROR_INVALID_HANDLE = -10,
-    VK_ERROR_INVALID_ORDINAL = -11,
-    VK_ERROR_INVALID_MEMORY_SIZE = -12,
-    VK_ERROR_INVALID_EXTENSION = -13,
-    VK_ERROR_INVALID_FLAGS = -14,
-    VK_ERROR_INVALID_ALIGNMENT = -15,
-    VK_ERROR_INVALID_FORMAT = -16,
-    VK_ERROR_INVALID_IMAGE = -17,
-    VK_ERROR_INVALID_DESCRIPTOR_SET_DATA = -18,
-    VK_ERROR_INVALID_QUEUE_TYPE = -19,
-    VK_ERROR_UNSUPPORTED_SHADER_IL_VERSION = -20,
-    VK_ERROR_BAD_SHADER_CODE = -21,
-    VK_ERROR_BAD_PIPELINE_DATA = -22,
-    VK_ERROR_NOT_MAPPABLE = -23,
-    VK_ERROR_MEMORY_MAP_FAILED = -24,
-    VK_ERROR_MEMORY_UNMAP_FAILED = -25,
-    VK_ERROR_INCOMPATIBLE_DEVICE = -26,
-    VK_ERROR_INCOMPATIBLE_DRIVER = -27,
-    VK_ERROR_INCOMPLETE_COMMAND_BUFFER = -28,
-    VK_ERROR_BUILDING_COMMAND_BUFFER = -29,
-    VK_ERROR_MEMORY_NOT_BOUND = -30,
-    VK_ERROR_INCOMPATIBLE_QUEUE = -31,
-    VK_ERROR_INVALID_LAYER = -32,
-    VK_RESULT_BEGIN_RANGE = VK_ERROR_INVALID_LAYER,
+    VK_ERROR_DEVICE_LOST = -4,
+    VK_ERROR_MEMORY_MAP_FAILED = -5,
+    VK_ERROR_LAYER_NOT_PRESENT = -6,
+    VK_ERROR_EXTENSION_NOT_PRESENT = -7,
+    VK_ERROR_INCOMPATIBLE_DRIVER = -8,
+    VK_RESULT_BEGIN_RANGE = VK_ERROR_INCOMPATIBLE_DRIVER,
     VK_RESULT_END_RANGE = VK_INCOMPLETE,
-    VK_RESULT_NUM = (VK_INCOMPLETE - VK_ERROR_INVALID_LAYER + 1),
+    VK_RESULT_NUM = (VK_INCOMPLETE - VK_ERROR_INCOMPATIBLE_DRIVER + 1),
     VK_RESULT_MAX_ENUM = 0x7FFFFFFF
 } VkResult;
 
@@ -175,55 +164,52 @@
     VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO = 1,
     VK_STRUCTURE_TYPE_MEMORY_ALLOC_INFO = 2,
     VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO = 3,
-    VK_STRUCTURE_TYPE_ATTACHMENT_VIEW_CREATE_INFO = 4,
-    VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO = 5,
-    VK_STRUCTURE_TYPE_SHADER_CREATE_INFO = 6,
-    VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO = 7,
-    VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO = 8,
-    VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO = 9,
-    VK_STRUCTURE_TYPE_DYNAMIC_VIEWPORT_STATE_CREATE_INFO = 10,
-    VK_STRUCTURE_TYPE_DYNAMIC_RASTER_STATE_CREATE_INFO = 11,
-    VK_STRUCTURE_TYPE_DYNAMIC_COLOR_BLEND_STATE_CREATE_INFO = 12,
-    VK_STRUCTURE_TYPE_DYNAMIC_DEPTH_STENCIL_STATE_CREATE_INFO = 13,
-    VK_STRUCTURE_TYPE_CMD_BUFFER_CREATE_INFO = 14,
-    VK_STRUCTURE_TYPE_EVENT_CREATE_INFO = 15,
-    VK_STRUCTURE_TYPE_FENCE_CREATE_INFO = 16,
-    VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO = 17,
-    VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO = 18,
-    VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO = 19,
-    VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO = 20,
-    VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO = 21,
-    VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO = 22,
-    VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO = 23,
-    VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO = 24,
-    VK_STRUCTURE_TYPE_PIPELINE_RASTER_STATE_CREATE_INFO = 25,
-    VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO = 26,
-    VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO = 27,
-    VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO = 28,
-    VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO = 29,
-    VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO = 30,
-    VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO = 31,
-    VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO = 32,
-    VK_STRUCTURE_TYPE_CMD_BUFFER_BEGIN_INFO = 33,
-    VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO = 34,
-    VK_STRUCTURE_TYPE_MEMORY_BARRIER = 35,
-    VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER = 36,
-    VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER = 37,
-    VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO = 38,
-    VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET = 39,
-    VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET = 40,
-    VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO = 41,
-    VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO = 42,
-    VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE = 43,
-    VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO = 44,
-    VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION = 45,
-    VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION = 46,
-    VK_STRUCTURE_TYPE_SUBPASS_DEPENDENCY = 47,
-    VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO = 48,
-    VK_STRUCTURE_TYPE_CMD_POOL_CREATE_INFO = 49,
+    VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO = 4,
+    VK_STRUCTURE_TYPE_SHADER_CREATE_INFO = 5,
+    VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO = 6,
+    VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO = 7,
+    VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO = 8,
+    VK_STRUCTURE_TYPE_CMD_BUFFER_CREATE_INFO = 9,
+    VK_STRUCTURE_TYPE_EVENT_CREATE_INFO = 10,
+    VK_STRUCTURE_TYPE_FENCE_CREATE_INFO = 11,
+    VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO = 12,
+    VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO = 13,
+    VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO = 14,
+    VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO = 15,
+    VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO = 16,
+    VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO = 17,
+    VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO = 18,
+    VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO = 19,
+    VK_STRUCTURE_TYPE_PIPELINE_RASTER_STATE_CREATE_INFO = 20,
+    VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO = 21,
+    VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO = 22,
+    VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO = 23,
+    VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO = 24,
+    VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO = 25,
+    VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO = 26,
+    VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO = 27,
+    VK_STRUCTURE_TYPE_CMD_BUFFER_BEGIN_INFO = 28,
+    VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO = 29,
+    VK_STRUCTURE_TYPE_MEMORY_BARRIER = 30,
+    VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER = 31,
+    VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER = 32,
+    VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO = 33,
+    VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET = 34,
+    VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET = 35,
+    VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO = 36,
+    VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO = 37,
+    VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE = 38,
+    VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO = 39,
+    VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION = 40,
+    VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION = 41,
+    VK_STRUCTURE_TYPE_SUBPASS_DEPENDENCY = 42,
+    VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO = 43,
+    VK_STRUCTURE_TYPE_CMD_POOL_CREATE_INFO = 44,
+    VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO = 45,
+    VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO = 46,
     VK_STRUCTURE_TYPE_BEGIN_RANGE = VK_STRUCTURE_TYPE_APPLICATION_INFO,
-    VK_STRUCTURE_TYPE_END_RANGE = VK_STRUCTURE_TYPE_CMD_POOL_CREATE_INFO,
-    VK_STRUCTURE_TYPE_NUM = (VK_STRUCTURE_TYPE_CMD_POOL_CREATE_INFO - VK_STRUCTURE_TYPE_APPLICATION_INFO + 1),
+    VK_STRUCTURE_TYPE_END_RANGE = VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO,
+    VK_STRUCTURE_TYPE_NUM = (VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO - VK_STRUCTURE_TYPE_APPLICATION_INFO + 1),
     VK_STRUCTURE_TYPE_MAX_ENUM = 0x7FFFFFFF
 } VkStructureType;
 
@@ -330,7 +316,7 @@
     VK_FORMAT_R11G11B10_UFLOAT = 87,
     VK_FORMAT_R9G9B9E5_UFLOAT = 88,
     VK_FORMAT_D16_UNORM = 89,
-    VK_FORMAT_D24_UNORM = 90,
+    VK_FORMAT_D24_UNORM_X8 = 90,
     VK_FORMAT_D32_SFLOAT = 91,
     VK_FORMAT_S8_UINT = 92,
     VK_FORMAT_D16_UNORM_S8_UINT = 93,
@@ -481,13 +467,20 @@
 } VkSharingMode;
 
 typedef enum {
-    VK_BUFFER_VIEW_TYPE_RAW = 0,
-    VK_BUFFER_VIEW_TYPE_FORMATTED = 1,
-    VK_BUFFER_VIEW_TYPE_BEGIN_RANGE = VK_BUFFER_VIEW_TYPE_RAW,
-    VK_BUFFER_VIEW_TYPE_END_RANGE = VK_BUFFER_VIEW_TYPE_FORMATTED,
-    VK_BUFFER_VIEW_TYPE_NUM = (VK_BUFFER_VIEW_TYPE_FORMATTED - VK_BUFFER_VIEW_TYPE_RAW + 1),
-    VK_BUFFER_VIEW_TYPE_MAX_ENUM = 0x7FFFFFFF
-} VkBufferViewType;
+    VK_IMAGE_LAYOUT_UNDEFINED = 0,
+    VK_IMAGE_LAYOUT_GENERAL = 1,
+    VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL = 2,
+    VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL = 3,
+    VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL = 4,
+    VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL = 5,
+    VK_IMAGE_LAYOUT_TRANSFER_SOURCE_OPTIMAL = 6,
+    VK_IMAGE_LAYOUT_TRANSFER_DESTINATION_OPTIMAL = 7,
+    VK_IMAGE_LAYOUT_PREINITIALIZED = 8,
+    VK_IMAGE_LAYOUT_BEGIN_RANGE = VK_IMAGE_LAYOUT_UNDEFINED,
+    VK_IMAGE_LAYOUT_END_RANGE = VK_IMAGE_LAYOUT_PREINITIALIZED,
+    VK_IMAGE_LAYOUT_NUM = (VK_IMAGE_LAYOUT_PREINITIALIZED - VK_IMAGE_LAYOUT_UNDEFINED + 1),
+    VK_IMAGE_LAYOUT_MAX_ENUM = 0x7FFFFFFF
+} VkImageLayout;
 
 typedef enum {
     VK_IMAGE_VIEW_TYPE_1D = 0,
@@ -678,6 +671,22 @@
 } VkBlendOp;
 
 typedef enum {
+    VK_DYNAMIC_STATE_VIEWPORT = 0,
+    VK_DYNAMIC_STATE_SCISSOR = 1,
+    VK_DYNAMIC_STATE_LINE_WIDTH = 2,
+    VK_DYNAMIC_STATE_DEPTH_BIAS = 3,
+    VK_DYNAMIC_STATE_BLEND_CONSTANTS = 4,
+    VK_DYNAMIC_STATE_DEPTH_BOUNDS = 5,
+    VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK = 6,
+    VK_DYNAMIC_STATE_STENCIL_WRITE_MASK = 7,
+    VK_DYNAMIC_STATE_STENCIL_REFERENCE = 8,
+    VK_DYNAMIC_STATE_BEGIN_RANGE = VK_DYNAMIC_STATE_VIEWPORT,
+    VK_DYNAMIC_STATE_END_RANGE = VK_DYNAMIC_STATE_STENCIL_REFERENCE,
+    VK_DYNAMIC_STATE_NUM = (VK_DYNAMIC_STATE_STENCIL_REFERENCE - VK_DYNAMIC_STATE_VIEWPORT + 1),
+    VK_DYNAMIC_STATE_MAX_ENUM = 0x7FFFFFFF
+} VkDynamicState;
+
+typedef enum {
     VK_TEX_FILTER_NEAREST = 0,
     VK_TEX_FILTER_LINEAR = 1,
     VK_TEX_FILTER_BEGIN_RANGE = VK_TEX_FILTER_NEAREST,
@@ -697,16 +706,16 @@
 } VkTexMipmapMode;
 
 typedef enum {
-    VK_TEX_ADDRESS_WRAP = 0,
-    VK_TEX_ADDRESS_MIRROR = 1,
-    VK_TEX_ADDRESS_CLAMP = 2,
-    VK_TEX_ADDRESS_MIRROR_ONCE = 3,
-    VK_TEX_ADDRESS_CLAMP_BORDER = 4,
-    VK_TEX_ADDRESS_BEGIN_RANGE = VK_TEX_ADDRESS_WRAP,
-    VK_TEX_ADDRESS_END_RANGE = VK_TEX_ADDRESS_CLAMP_BORDER,
-    VK_TEX_ADDRESS_NUM = (VK_TEX_ADDRESS_CLAMP_BORDER - VK_TEX_ADDRESS_WRAP + 1),
+    VK_TEX_ADDRESS_MODE_WRAP = 0,
+    VK_TEX_ADDRESS_MODE_MIRROR = 1,
+    VK_TEX_ADDRESS_MODE_CLAMP = 2,
+    VK_TEX_ADDRESS_MODE_MIRROR_ONCE = 3,
+    VK_TEX_ADDRESS_MODE_CLAMP_BORDER = 4,
+    VK_TEX_ADDRESS_BEGIN_RANGE = VK_TEX_ADDRESS_MODE_WRAP,
+    VK_TEX_ADDRESS_END_RANGE = VK_TEX_ADDRESS_MODE_CLAMP_BORDER,
+    VK_TEX_ADDRESS_NUM = (VK_TEX_ADDRESS_MODE_CLAMP_BORDER - VK_TEX_ADDRESS_MODE_WRAP + 1),
     VK_TEX_ADDRESS_MAX_ENUM = 0x7FFFFFFF
-} VkTexAddress;
+} VkTexAddressMode;
 
 typedef enum {
     VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK = 0,
@@ -758,21 +767,6 @@
 } VkDescriptorSetUsage;
 
 typedef enum {
-    VK_IMAGE_LAYOUT_UNDEFINED = 0,
-    VK_IMAGE_LAYOUT_GENERAL = 1,
-    VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL = 2,
-    VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL = 3,
-    VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL = 4,
-    VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL = 5,
-    VK_IMAGE_LAYOUT_TRANSFER_SOURCE_OPTIMAL = 6,
-    VK_IMAGE_LAYOUT_TRANSFER_DESTINATION_OPTIMAL = 7,
-    VK_IMAGE_LAYOUT_BEGIN_RANGE = VK_IMAGE_LAYOUT_UNDEFINED,
-    VK_IMAGE_LAYOUT_END_RANGE = VK_IMAGE_LAYOUT_TRANSFER_DESTINATION_OPTIMAL,
-    VK_IMAGE_LAYOUT_NUM = (VK_IMAGE_LAYOUT_TRANSFER_DESTINATION_OPTIMAL - VK_IMAGE_LAYOUT_UNDEFINED + 1),
-    VK_IMAGE_LAYOUT_MAX_ENUM = 0x7FFFFFFF
-} VkImageLayout;
-
-typedef enum {
     VK_ATTACHMENT_LOAD_OP_LOAD = 0,
     VK_ATTACHMENT_LOAD_OP_CLEAR = 1,
     VK_ATTACHMENT_LOAD_OP_DONT_CARE = 2,
@@ -848,24 +842,44 @@
     VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT = 0x00000080,
     VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT = 0x00000100,
     VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000200,
-    VK_FORMAT_FEATURE_CONVERSION_BIT = 0x00000400,
+    VK_FORMAT_FEATURE_BLIT_SOURCE_BIT = 0x00000400,
+    VK_FORMAT_FEATURE_BLIT_DESTINATION_BIT = 0x00000800,
 } VkFormatFeatureFlagBits;
 typedef VkFlags VkFormatFeatureFlags;
 
 typedef enum {
-    VK_IMAGE_USAGE_GENERAL = 0,
     VK_IMAGE_USAGE_TRANSFER_SOURCE_BIT = 0x00000001,
     VK_IMAGE_USAGE_TRANSFER_DESTINATION_BIT = 0x00000002,
     VK_IMAGE_USAGE_SAMPLED_BIT = 0x00000004,
     VK_IMAGE_USAGE_STORAGE_BIT = 0x00000008,
     VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT = 0x00000010,
-    VK_IMAGE_USAGE_DEPTH_STENCIL_BIT = 0x00000020,
+    VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000020,
     VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT = 0x00000040,
     VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT = 0x00000080,
 } VkImageUsageFlagBits;
 typedef VkFlags VkImageUsageFlags;
 
 typedef enum {
+    VK_IMAGE_CREATE_SPARSE_BINDING_BIT = 0x00000001,
+    VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002,
+    VK_IMAGE_CREATE_SPARSE_ALIASED_BIT = 0x00000004,
+    VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT = 0x00000008,
+    VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT = 0x00000010,
+} VkImageCreateFlagBits;
+typedef VkFlags VkImageCreateFlags;
+
+typedef enum {
+    VK_SAMPLE_COUNT_1_BIT = 0x00000001,
+    VK_SAMPLE_COUNT_2_BIT = 0x00000002,
+    VK_SAMPLE_COUNT_4_BIT = 0x00000004,
+    VK_SAMPLE_COUNT_8_BIT = 0x00000008,
+    VK_SAMPLE_COUNT_16_BIT = 0x00000010,
+    VK_SAMPLE_COUNT_32_BIT = 0x00000020,
+    VK_SAMPLE_COUNT_64_BIT = 0x00000040,
+} VkSampleCountFlagBits;
+typedef VkFlags VkSampleCountFlags;
+
+typedef enum {
     VK_QUEUE_GRAPHICS_BIT = 0x00000001,
     VK_QUEUE_COMPUTE_BIT = 0x00000002,
     VK_QUEUE_DMA_BIT = 0x00000004,
@@ -885,14 +899,9 @@
 typedef VkFlags VkMemoryPropertyFlags;
 
 typedef enum {
-    VK_MEMORY_HEAP_HOST_LOCAL = 0x00000001,
+    VK_MEMORY_HEAP_HOST_LOCAL_BIT = 0x00000001,
 } VkMemoryHeapFlagBits;
 typedef VkFlags VkMemoryHeapFlags;
-
-typedef enum {
-    VK_DEVICE_CREATE_VALIDATION_BIT = 0x00000001,
-} VkDeviceCreateFlagBits;
-typedef VkFlags VkDeviceCreateFlags;
 typedef VkFlags VkMemoryMapFlags;
 
 typedef enum {
@@ -939,7 +948,6 @@
 typedef VkFlags VkQueryResultFlags;
 
 typedef enum {
-    VK_BUFFER_USAGE_GENERAL = 0,
     VK_BUFFER_USAGE_TRANSFER_SOURCE_BIT = 0x00000001,
     VK_BUFFER_USAGE_TRANSFER_DESTINATION_BIT = 0x00000002,
     VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000004,
@@ -953,27 +961,25 @@
 typedef VkFlags VkBufferUsageFlags;
 
 typedef enum {
-    VK_BUFFER_CREATE_SPARSE_BIT = 0x00000001,
+    VK_BUFFER_CREATE_SPARSE_BINDING_BIT = 0x00000001,
     VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002,
     VK_BUFFER_CREATE_SPARSE_ALIASED_BIT = 0x00000004,
 } VkBufferCreateFlagBits;
 typedef VkFlags VkBufferCreateFlags;
 
 typedef enum {
-    VK_IMAGE_CREATE_SPARSE_BIT = 0x00000001,
-    VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002,
-    VK_IMAGE_CREATE_SPARSE_ALIASED_BIT = 0x00000004,
-    VK_IMAGE_CREATE_INVARIANT_DATA_BIT = 0x00000008,
-    VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT = 0x00000010,
-    VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT = 0x00000020,
-} VkImageCreateFlagBits;
-typedef VkFlags VkImageCreateFlags;
+    VK_IMAGE_ASPECT_COLOR_BIT = 0x00000001,
+    VK_IMAGE_ASPECT_DEPTH_BIT = 0x00000002,
+    VK_IMAGE_ASPECT_STENCIL_BIT = 0x00000004,
+    VK_IMAGE_ASPECT_METADATA_BIT = 0x00000008,
+} VkImageAspectFlagBits;
+typedef VkFlags VkImageAspectFlags;
 
 typedef enum {
-    VK_ATTACHMENT_VIEW_CREATE_READ_ONLY_DEPTH_BIT = 0x00000001,
-    VK_ATTACHMENT_VIEW_CREATE_READ_ONLY_STENCIL_BIT = 0x00000002,
-} VkAttachmentViewCreateFlagBits;
-typedef VkFlags VkAttachmentViewCreateFlags;
+    VK_IMAGE_VIEW_CREATE_READ_ONLY_DEPTH_BIT = 0x00000001,
+    VK_IMAGE_VIEW_CREATE_READ_ONLY_STENCIL_BIT = 0x00000002,
+} VkImageViewCreateFlagBits;
+typedef VkFlags VkImageViewCreateFlags;
 typedef VkFlags VkShaderModuleCreateFlags;
 typedef VkFlags VkShaderCreateFlags;
 
@@ -1004,6 +1010,11 @@
 typedef VkFlags VkShaderStageFlags;
 
 typedef enum {
+    VK_ATTACHMENT_DESCRIPTION_MAY_ALIAS_BIT = 0x00000001,
+} VkAttachmentDescriptionFlagBits;
+typedef VkFlags VkAttachmentDescriptionFlags;
+
+typedef enum {
     VK_SUBPASS_DESCRIPTION_NO_OVERDRAW_BIT = 0x00000001,
 } VkSubpassDescriptionFlagBits;
 typedef VkFlags VkSubpassDescriptionFlags;
@@ -1022,10 +1033,9 @@
     VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT = 0x00000400,
     VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT = 0x00000800,
     VK_PIPELINE_STAGE_TRANSFER_BIT = 0x00001000,
-    VK_PIPELINE_STAGE_TRANSITION_BIT = 0x00002000,
-    VK_PIPELINE_STAGE_HOST_BIT = 0x00004000,
+    VK_PIPELINE_STAGE_HOST_BIT = 0x00002000,
     VK_PIPELINE_STAGE_ALL_GRAPHICS = 0x000007FF,
-    VK_PIPELINE_STAGE_ALL_GPU_COMMANDS = 0x00003FFF,
+    VK_PIPELINE_STAGE_ALL_GPU_COMMANDS = 0x00001FFF,
 } VkPipelineStageFlagBits;
 typedef VkFlags VkPipelineStageFlags;
 
@@ -1059,7 +1069,7 @@
 typedef VkFlags VkCmdPoolCreateFlags;
 
 typedef enum {
-    VK_CMD_POOL_RESET_RELEASE_RESOURCES = 0x00000001,
+    VK_CMD_POOL_RESET_RELEASE_RESOURCES_BIT = 0x00000001,
 } VkCmdPoolResetFlagBits;
 typedef VkFlags VkCmdPoolResetFlags;
 typedef VkFlags VkCmdBufferCreateFlags;
@@ -1074,33 +1084,22 @@
 typedef VkFlags VkCmdBufferOptimizeFlags;
 
 typedef enum {
-    VK_CMD_BUFFER_RESET_RELEASE_RESOURCES = 0x00000001,
+    VK_CMD_BUFFER_RESET_RELEASE_RESOURCES_BIT = 0x00000001,
 } VkCmdBufferResetFlagBits;
 typedef VkFlags VkCmdBufferResetFlags;
 
 typedef enum {
-    VK_IMAGE_ASPECT_COLOR_BIT = 0x00000001,
-    VK_IMAGE_ASPECT_DEPTH_BIT = 0x00000002,
-    VK_IMAGE_ASPECT_STENCIL_BIT = 0x00000004,
-    VK_IMAGE_ASPECT_METADATA_BIT = 0x00000008,
-} VkImageAspectFlagBits;
-typedef VkFlags VkImageAspectFlags;
+    VK_STENCIL_FACE_NONE = 0,
+    VK_STENCIL_FACE_FRONT_BIT = 0x00000001,
+    VK_STENCIL_FACE_BACK_BIT = 0x00000002,
+} VkStencilFaceFlagBits;
+typedef VkFlags VkStencilFaceFlags;
 
 typedef enum {
     VK_QUERY_CONTROL_CONSERVATIVE_BIT = 0x00000001,
 } VkQueryControlFlagBits;
 typedef VkFlags VkQueryControlFlags;
 
-typedef struct {
-    VkStructureType                             sType;
-    const void*                                 pNext;
-    const char*                                 pAppName;
-    uint32_t                                    appVersion;
-    const char*                                 pEngineName;
-    uint32_t                                    engineVersion;
-    uint32_t                                    apiVersion;
-} VkApplicationInfo;
-
 typedef void* (VKAPI *PFN_vkAllocFunction)(
     void*                           pUserData,
     size_t                          size,
@@ -1111,6 +1110,18 @@
     void*                           pUserData,
     void*                           pMem);
 
+typedef void (VKAPI *PFN_vkVoidFunction)(void);
+
+typedef struct {
+    VkStructureType                             sType;
+    const void*                                 pNext;
+    const char*                                 pAppName;
+    uint32_t                                    appVersion;
+    const char*                                 pEngineName;
+    uint32_t                                    engineVersion;
+    uint32_t                                    apiVersion;
+} VkApplicationInfo;
+
 typedef struct {
     void*                                       pUserData;
     PFN_vkAllocFunction                         pfnAlloc;
@@ -1138,7 +1149,7 @@
     VkBool32                                    sampleRateShading;
     VkBool32                                    dualSourceBlend;
     VkBool32                                    logicOp;
-    VkBool32                                    instancedDrawIndirect;
+    VkBool32                                    multiDrawIndirect;
     VkBool32                                    depthClip;
     VkBool32                                    depthBiasClamp;
     VkBool32                                    fillModeNonSolid;
@@ -1148,6 +1159,7 @@
     VkBool32                                    textureCompressionETC2;
     VkBool32                                    textureCompressionASTC_LDR;
     VkBool32                                    textureCompressionBC;
+    VkBool32                                    occlusionQueryNonConservative;
     VkBool32                                    pipelineStatisticsQuery;
     VkBool32                                    vertexSideEffects;
     VkBool32                                    tessellationSideEffects;
@@ -1155,11 +1167,9 @@
     VkBool32                                    fragmentSideEffects;
     VkBool32                                    shaderTessellationPointSize;
     VkBool32                                    shaderGeometryPointSize;
-    VkBool32                                    shaderTextureGatherExtended;
+    VkBool32                                    shaderImageGatherExtended;
     VkBool32                                    shaderStorageImageExtendedFormats;
     VkBool32                                    shaderStorageImageMultisample;
-    VkBool32                                    shaderStorageBufferArrayConstantIndexing;
-    VkBool32                                    shaderStorageImageArrayConstantIndexing;
     VkBool32                                    shaderUniformBufferArrayDynamicIndexing;
     VkBool32                                    shaderSampledImageArrayDynamicIndexing;
     VkBool32                                    shaderStorageBufferArrayDynamicIndexing;
@@ -1168,11 +1178,11 @@
     VkBool32                                    shaderCullDistance;
     VkBool32                                    shaderFloat64;
     VkBool32                                    shaderInt64;
-    VkBool32                                    shaderFloat16;
     VkBool32                                    shaderInt16;
     VkBool32                                    shaderResourceResidency;
     VkBool32                                    shaderResourceMinLOD;
-    VkBool32                                    sparse;
+    VkBool32                                    alphaToOne;
+    VkBool32                                    sparseBinding;
     VkBool32                                    sparseResidencyBuffer;
     VkBool32                                    sparseResidencyImage2D;
     VkBool32                                    sparseResidencyImage3D;
@@ -1180,23 +1190,27 @@
     VkBool32                                    sparseResidency4Samples;
     VkBool32                                    sparseResidency8Samples;
     VkBool32                                    sparseResidency16Samples;
-    VkBool32                                    sparseResidencyStandard2DBlockShape;
-    VkBool32                                    sparseResidencyStandard2DMSBlockShape;
-    VkBool32                                    sparseResidencyStandard3DBlockShape;
-    VkBool32                                    sparseResidencyAlignedMipSize;
-    VkBool32                                    sparseResidencyNonResident;
-    VkBool32                                    sparseResidencyNonResidentStrict;
     VkBool32                                    sparseResidencyAliased;
 } VkPhysicalDeviceFeatures;
 
 typedef struct {
     VkFormatFeatureFlags                        linearTilingFeatures;
     VkFormatFeatureFlags                        optimalTilingFeatures;
+    VkFormatFeatureFlags                        bufferFeatures;
 } VkFormatProperties;
 
 typedef struct {
-    uint64_t                                    maxResourceSize;
-    uint32_t                                    maxSamples;
+    int32_t                                     width;
+    int32_t                                     height;
+    int32_t                                     depth;
+} VkExtent3D;
+
+typedef struct {
+    VkExtent3D                                  maxExtent;
+    uint32_t                                    maxMipLevels;
+    uint32_t                                    maxArraySize;
+    VkSampleCountFlags                          sampleCounts;
+    VkDeviceSize                                maxResourceSize;
 } VkImageFormatProperties;
 
 typedef struct {
@@ -1205,12 +1219,14 @@
     uint32_t                                    maxImageDimension3D;
     uint32_t                                    maxImageDimensionCube;
     uint32_t                                    maxImageArrayLayers;
+    VkSampleCountFlags                          sampleCounts;
     uint32_t                                    maxTexelBufferSize;
     uint32_t                                    maxUniformBufferSize;
     uint32_t                                    maxStorageBufferSize;
     uint32_t                                    maxPushConstantsSize;
     uint32_t                                    maxMemoryAllocationCount;
     VkDeviceSize                                bufferImageGranularity;
+    VkDeviceSize                                sparseAddressSpaceSize;
     uint32_t                                    maxBoundDescriptorSets;
     uint32_t                                    maxDescriptorSets;
     uint32_t                                    maxPerStageDescriptorSamplers;
@@ -1220,10 +1236,13 @@
     uint32_t                                    maxPerStageDescriptorStorageImages;
     uint32_t                                    maxDescriptorSetSamplers;
     uint32_t                                    maxDescriptorSetUniformBuffers;
+    uint32_t                                    maxDescriptorSetUniformBuffersDynamic;
     uint32_t                                    maxDescriptorSetStorageBuffers;
+    uint32_t                                    maxDescriptorSetStorageBuffersDynamic;
     uint32_t                                    maxDescriptorSetSampledImages;
     uint32_t                                    maxDescriptorSetStorageImages;
     uint32_t                                    maxVertexInputAttributes;
+    uint32_t                                    maxVertexInputBindings;
     uint32_t                                    maxVertexInputAttributeOffset;
     uint32_t                                    maxVertexInputBindingStride;
     uint32_t                                    maxVertexOutputComponents;
@@ -1257,7 +1276,6 @@
     float                                       maxSamplerLodBias;
     float                                       maxSamplerAnisotropy;
     uint32_t                                    maxViewports;
-    uint32_t                                    maxDynamicViewportStates;
     uint32_t                                    maxViewportDimensions[2];
     float                                       viewportBoundsRange[2];
     uint32_t                                    viewportSubPixelBits;
@@ -1295,6 +1313,15 @@
 } VkPhysicalDeviceLimits;
 
 typedef struct {
+    VkBool32                                    residencyStandard2DBlockShape;
+    VkBool32                                    residencyStandard2DMSBlockShape;
+    VkBool32                                    residencyStandard3DBlockShape;
+    VkBool32                                    residencyAlignedMipSize;
+    VkBool32                                    residencyNonResident;
+    VkBool32                                    residencyNonResidentStrict;
+} VkPhysicalDeviceSparseProperties;
+
+typedef struct {
     uint32_t                                    apiVersion;
     uint32_t                                    driverVersion;
     uint32_t                                    vendorId;
@@ -1302,13 +1329,15 @@
     VkPhysicalDeviceType                        deviceType;
     char                                        deviceName[VK_MAX_PHYSICAL_DEVICE_NAME];
     uint8_t                                     pipelineCacheUUID[VK_UUID_LENGTH];
+    VkPhysicalDeviceLimits                      limits;
+    VkPhysicalDeviceSparseProperties            sparseProperties;
 } VkPhysicalDeviceProperties;
 
 typedef struct {
     VkQueueFlags                                queueFlags;
     uint32_t                                    queueCount;
     VkBool32                                    supportsTimestamps;
-} VkPhysicalDeviceQueueProperties;
+} VkQueueFamilyProperties;
 
 typedef struct {
     VkMemoryPropertyFlags                       propertyFlags;
@@ -1327,8 +1356,9 @@
     VkMemoryHeap                                memoryHeaps[VK_MAX_MEMORY_HEAPS];
 } VkPhysicalDeviceMemoryProperties;
 
-typedef void (VKAPI *PFN_vkVoidFunction)(void);
 typedef struct {
+    VkStructureType                             sType;
+    const void*                                 pNext;
     uint32_t                                    queueFamilyIndex;
     uint32_t                                    queueCount;
 } VkDeviceQueueCreateInfo;
@@ -1343,7 +1373,6 @@
     uint32_t                                    extensionCount;
     const char*const*                           ppEnabledExtensionNames;
     const VkPhysicalDeviceFeatures*             pEnabledFeatures;
-    VkDeviceCreateFlags                         flags;
 } VkDeviceCreateInfo;
 
 typedef struct {
@@ -1380,12 +1409,6 @@
 } VkMemoryRequirements;
 
 typedef struct {
-    int32_t                                     width;
-    int32_t                                     height;
-    int32_t                                     depth;
-} VkExtent3D;
-
-typedef struct {
     VkImageAspect                               aspect;
     VkExtent3D                                  imageGranularity;
     VkSparseImageFormatFlags                    flags;
@@ -1410,7 +1433,7 @@
 typedef struct {
     VkImageAspect                               aspect;
     uint32_t                                    mipLevel;
-    uint32_t                                    arraySlice;
+    uint32_t                                    arrayLayer;
 } VkImageSubresource;
 
 typedef struct {
@@ -1469,7 +1492,6 @@
     VkStructureType                             sType;
     const void*                                 pNext;
     VkBuffer                                    buffer;
-    VkBufferViewType                            viewType;
     VkFormat                                    format;
     VkDeviceSize                                offset;
     VkDeviceSize                                range;
@@ -1490,6 +1512,7 @@
     VkSharingMode                               sharingMode;
     uint32_t                                    queueFamilyCount;
     const uint32_t*                             pQueueFamilyIndices;
+    VkImageLayout                               initialLayout;
 } VkImageCreateInfo;
 
 typedef struct {
@@ -1507,10 +1530,10 @@
 } VkChannelMapping;
 
 typedef struct {
-    VkImageAspect                               aspect;
+    VkImageAspectFlags                          aspectMask;
     uint32_t                                    baseMipLevel;
     uint32_t                                    mipLevels;
-    uint32_t                                    baseArraySlice;
+    uint32_t                                    baseArrayLayer;
     uint32_t                                    arraySize;
 } VkImageSubresourceRange;
 
@@ -1522,22 +1545,12 @@
     VkFormat                                    format;
     VkChannelMapping                            channels;
     VkImageSubresourceRange                     subresourceRange;
+    VkImageViewCreateFlags                      flags;
 } VkImageViewCreateInfo;
 
 typedef struct {
     VkStructureType                             sType;
     const void*                                 pNext;
-    VkImage                                     image;
-    VkFormat                                    format;
-    uint32_t                                    mipLevel;
-    uint32_t                                    baseArraySlice;
-    uint32_t                                    arraySize;
-    VkAttachmentViewCreateFlags                 flags;
-} VkAttachmentViewCreateInfo;
-
-typedef struct {
-    VkStructureType                             sType;
-    const void*                                 pNext;
     size_t                                      codeSize;
     const void*                                 pCode;
     VkShaderModuleCreateFlags                   flags;
@@ -1549,6 +1562,7 @@
     VkShaderModule                              module;
     const char*                                 pName;
     VkShaderCreateFlags                         flags;
+    VkShaderStage                               stage;
 } VkShaderCreateInfo;
 
 typedef struct {
@@ -1616,9 +1630,36 @@
 } VkPipelineTessellationStateCreateInfo;
 
 typedef struct {
+    float                                       originX;
+    float                                       originY;
+    float                                       width;
+    float                                       height;
+    float                                       minDepth;
+    float                                       maxDepth;
+} VkViewport;
+
+typedef struct {
+    int32_t                                     x;
+    int32_t                                     y;
+} VkOffset2D;
+
+typedef struct {
+    int32_t                                     width;
+    int32_t                                     height;
+} VkExtent2D;
+
+typedef struct {
+    VkOffset2D                                  offset;
+    VkExtent2D                                  extent;
+} VkRect2D;
+
+typedef struct {
     VkStructureType                             sType;
     const void*                                 pNext;
     uint32_t                                    viewportCount;
+    const VkViewport*                           pViewports;
+    uint32_t                                    scissorCount;
+    const VkRect2D*                             pScissors;
 } VkPipelineViewportStateCreateInfo;
 
 typedef struct {
@@ -1629,6 +1670,11 @@
     VkFillMode                                  fillMode;
     VkCullMode                                  cullMode;
     VkFrontFace                                 frontFace;
+    VkBool32                                    depthBiasEnable;
+    float                                       depthBias;
+    float                                       depthBiasClamp;
+    float                                       slopeScaledDepthBias;
+    float                                       lineWidth;
 } VkPipelineRasterStateCreateInfo;
 
 typedef struct {
@@ -1637,7 +1683,7 @@
     uint32_t                                    rasterSamples;
     VkBool32                                    sampleShadingEnable;
     float                                       minSampleShading;
-    VkSampleMask                                sampleMask;
+    const VkSampleMask*                         pSampleMask;
 } VkPipelineMultisampleStateCreateInfo;
 
 typedef struct {
@@ -1645,6 +1691,9 @@
     VkStencilOp                                 stencilPassOp;
     VkStencilOp                                 stencilDepthFailOp;
     VkCompareOp                                 stencilCompareOp;
+    uint32_t                                    stencilCompareMask;
+    uint32_t                                    stencilWriteMask;
+    uint32_t                                    stencilReference;
 } VkStencilOpState;
 
 typedef struct {
@@ -1653,10 +1702,12 @@
     VkBool32                                    depthTestEnable;
     VkBool32                                    depthWriteEnable;
     VkCompareOp                                 depthCompareOp;
-    VkBool32                                    depthBoundsEnable;
+    VkBool32                                    depthBoundsTestEnable;
     VkBool32                                    stencilTestEnable;
     VkStencilOpState                            front;
     VkStencilOpState                            back;
+    float                                       minDepthBounds;
+    float                                       maxDepthBounds;
 } VkPipelineDepthStencilStateCreateInfo;
 
 typedef struct {
@@ -1674,15 +1725,24 @@
     VkStructureType                             sType;
     const void*                                 pNext;
     VkBool32                                    alphaToCoverageEnable;
+    VkBool32                                    alphaToOneEnable;
     VkBool32                                    logicOpEnable;
     VkLogicOp                                   logicOp;
     uint32_t                                    attachmentCount;
     const VkPipelineColorBlendAttachmentState*  pAttachments;
+    float                                       blendConst[4];
 } VkPipelineColorBlendStateCreateInfo;
 
 typedef struct {
     VkStructureType                             sType;
     const void*                                 pNext;
+    uint32_t                                    dynamicStateCount;
+    const VkDynamicState*                       pDynamicStates;
+} VkPipelineDynamicStateCreateInfo;
+
+typedef struct {
+    VkStructureType                             sType;
+    const void*                                 pNext;
     uint32_t                                    stageCount;
     const VkPipelineShaderStageCreateInfo*      pStages;
     const VkPipelineVertexInputStateCreateInfo* pVertexInputState;
@@ -1693,6 +1753,7 @@
     const VkPipelineMultisampleStateCreateInfo* pMultisampleState;
     const VkPipelineDepthStencilStateCreateInfo* pDepthStencilState;
     const VkPipelineColorBlendStateCreateInfo*  pColorBlendState;
+    const VkPipelineDynamicStateCreateInfo*     pDynamicState;
     VkPipelineCreateFlags                       flags;
     VkPipelineLayout                            layout;
     VkRenderPass                                renderPass;
@@ -1704,7 +1765,7 @@
 typedef struct {
     VkStructureType                             sType;
     const void*                                 pNext;
-    VkPipelineShaderStageCreateInfo             cs;
+    VkPipelineShaderStageCreateInfo             stage;
     VkPipelineCreateFlags                       flags;
     VkPipelineLayout                            layout;
     VkPipeline                                  basePipelineHandle;
@@ -1732,9 +1793,9 @@
     VkTexFilter                                 magFilter;
     VkTexFilter                                 minFilter;
     VkTexMipmapMode                             mipMode;
-    VkTexAddress                                addressU;
-    VkTexAddress                                addressV;
-    VkTexAddress                                addressW;
+    VkTexAddressMode                            addressModeU;
+    VkTexAddressMode                            addressModeV;
+    VkTexAddressMode                            addressModeW;
     float                                       mipLodBias;
     float                                       maxAnisotropy;
     VkBool32                                    compareEnable;
@@ -1742,6 +1803,7 @@
     float                                       minLod;
     float                                       maxLod;
     VkBorderColor                               borderColor;
+    VkBool32                                    unnormalizedCoordinates;
 } VkSamplerCreateInfo;
 
 typedef struct {
@@ -1766,16 +1828,24 @@
 typedef struct {
     VkStructureType                             sType;
     const void*                                 pNext;
+    VkDescriptorPoolUsage                       poolUsage;
+    uint32_t                                    maxSets;
     uint32_t                                    count;
     const VkDescriptorTypeCount*                pTypeCount;
 } VkDescriptorPoolCreateInfo;
 
 typedef struct {
+    VkBuffer                                    buffer;
+    VkDeviceSize                                offset;
+    VkDeviceSize                                range;
+} VkDescriptorBufferInfo;
+
+typedef struct {
     VkBufferView                                bufferView;
     VkSampler                                   sampler;
     VkImageView                                 imageView;
-    VkAttachmentView                            attachmentView;
     VkImageLayout                               imageLayout;
+    VkDescriptorBufferInfo                      bufferInfo;
 } VkDescriptorInfo;
 
 typedef struct {
@@ -1802,74 +1872,11 @@
 } VkCopyDescriptorSet;
 
 typedef struct {
-    float                                       originX;
-    float                                       originY;
-    float                                       width;
-    float                                       height;
-    float                                       minDepth;
-    float                                       maxDepth;
-} VkViewport;
-
-typedef struct {
-    int32_t                                     x;
-    int32_t                                     y;
-} VkOffset2D;
-
-typedef struct {
-    int32_t                                     width;
-    int32_t                                     height;
-} VkExtent2D;
-
-typedef struct {
-    VkOffset2D                                  offset;
-    VkExtent2D                                  extent;
-} VkRect2D;
-
-typedef struct {
-    VkStructureType                             sType;
-    const void*                                 pNext;
-    uint32_t                                    viewportAndScissorCount;
-    const VkViewport*                           pViewports;
-    const VkRect2D*                             pScissors;
-} VkDynamicViewportStateCreateInfo;
-
-typedef struct {
-    VkStructureType                             sType;
-    const void*                                 pNext;
-    float                                       depthBias;
-    float                                       depthBiasClamp;
-    float                                       slopeScaledDepthBias;
-    float                                       lineWidth;
-} VkDynamicRasterStateCreateInfo;
-
-typedef struct {
-    VkStructureType                             sType;
-    const void*                                 pNext;
-    float                                       blendConst[4];
-} VkDynamicColorBlendStateCreateInfo;
-
-typedef struct {
-    VkStructureType                             sType;
-    const void*                                 pNext;
-    float                                       minDepthBounds;
-    float                                       maxDepthBounds;
-    uint32_t                                    stencilReadMask;
-    uint32_t                                    stencilWriteMask;
-    uint32_t                                    stencilFrontRef;
-    uint32_t                                    stencilBackRef;
-} VkDynamicDepthStencilStateCreateInfo;
-
-typedef struct {
-    VkAttachmentView                            view;
-    VkImageLayout                               layout;
-} VkAttachmentBindInfo;
-
-typedef struct {
     VkStructureType                             sType;
     const void*                                 pNext;
     VkRenderPass                                renderPass;
     uint32_t                                    attachmentCount;
-    const VkAttachmentBindInfo*                 pAttachments;
+    const VkImageView*                          pAttachments;
     uint32_t                                    width;
     uint32_t                                    height;
     uint32_t                                    layers;
@@ -1886,6 +1893,7 @@
     VkAttachmentStoreOp                         stencilStoreOp;
     VkImageLayout                               initialLayout;
     VkImageLayout                               finalLayout;
+    VkAttachmentDescriptionFlags                flags;
 } VkAttachmentDescription;
 
 typedef struct {
@@ -1899,13 +1907,13 @@
     VkPipelineBindPoint                         pipelineBindPoint;
     VkSubpassDescriptionFlags                   flags;
     uint32_t                                    inputCount;
-    const VkAttachmentReference*                inputAttachments;
+    const VkAttachmentReference*                pInputAttachments;
     uint32_t                                    colorCount;
-    const VkAttachmentReference*                colorAttachments;
-    const VkAttachmentReference*                resolveAttachments;
+    const VkAttachmentReference*                pColorAttachments;
+    const VkAttachmentReference*                pResolveAttachments;
     VkAttachmentReference                       depthStencilAttachment;
     uint32_t                                    preserveCount;
-    const VkAttachmentReference*                preserveAttachments;
+    const VkAttachmentReference*                pPreserveAttachments;
 } VkSubpassDescription;
 
 typedef struct {
@@ -1951,6 +1959,7 @@
     const void*                                 pNext;
     VkCmdBufferOptimizeFlags                    flags;
     VkRenderPass                                renderPass;
+    uint32_t                                    subpass;
     VkFramebuffer                               framebuffer;
 } VkCmdBufferBeginInfo;
 
@@ -1961,18 +1970,25 @@
 } VkBufferCopy;
 
 typedef struct {
-    VkImageSubresource                          srcSubresource;
+    VkImageAspect                               aspect;
+    uint32_t                                    mipLevel;
+    uint32_t                                    arrayLayer;
+    uint32_t                                    arraySize;
+} VkImageSubresourceCopy;
+
+typedef struct {
+    VkImageSubresourceCopy                      srcSubresource;
     VkOffset3D                                  srcOffset;
-    VkImageSubresource                          destSubresource;
+    VkImageSubresourceCopy                      destSubresource;
     VkOffset3D                                  destOffset;
     VkExtent3D                                  extent;
 } VkImageCopy;
 
 typedef struct {
-    VkImageSubresource                          srcSubresource;
+    VkImageSubresourceCopy                      srcSubresource;
     VkOffset3D                                  srcOffset;
     VkExtent3D                                  srcExtent;
-    VkImageSubresource                          destSubresource;
+    VkImageSubresourceCopy                      destSubresource;
     VkOffset3D                                  destOffset;
     VkExtent3D                                  destExtent;
 } VkImageBlit;
@@ -1981,38 +1997,38 @@
     VkDeviceSize                                bufferOffset;
     uint32_t                                    bufferRowLength;
     uint32_t                                    bufferImageHeight;
-    VkImageSubresource                          imageSubresource;
+    VkImageSubresourceCopy                      imageSubresource;
     VkOffset3D                                  imageOffset;
     VkExtent3D                                  imageExtent;
 } VkBufferImageCopy;
 
 typedef union {
-    float                                       f32[4];
-    int32_t                                     s32[4];
-    uint32_t                                    u32[4];
+    float                                       float32[4];
+    int32_t                                     int32[4];
+    uint32_t                                    uint32[4];
 } VkClearColorValue;
 
 typedef struct {
+    float                                       depth;
+    uint32_t                                    stencil;
+} VkClearDepthStencilValue;
+
+typedef struct {
     VkOffset3D                                  offset;
     VkExtent3D                                  extent;
 } VkRect3D;
 
 typedef struct {
-    VkImageSubresource                          srcSubresource;
+    VkImageSubresourceCopy                      srcSubresource;
     VkOffset3D                                  srcOffset;
-    VkImageSubresource                          destSubresource;
+    VkImageSubresourceCopy                      destSubresource;
     VkOffset3D                                  destOffset;
     VkExtent3D                                  extent;
 } VkImageResolve;
 
-typedef struct {
-    float                                       depth;
-    uint32_t                                    stencil;
-} VkClearDepthStencilValue;
-
 typedef union {
     VkClearColorValue                           color;
-    VkClearDepthStencilValue                    ds;
+    VkClearDepthStencilValue                    depthStencil;
 } VkClearValue;
 
 typedef struct {
@@ -2021,8 +2037,8 @@
     VkRenderPass                                renderPass;
     VkFramebuffer                               framebuffer;
     VkRect2D                                    renderArea;
-    uint32_t                                    attachmentCount;
-    const VkClearValue*                         pAttachmentClearValues;
+    uint32_t                                    clearValueCount;
+    const VkClearValue*                         pClearValues;
 } VkRenderPassBeginInfo;
 
 typedef struct {
@@ -2080,32 +2096,30 @@
 
 
 typedef VkResult (VKAPI *PFN_vkCreateInstance)(const VkInstanceCreateInfo* pCreateInfo, VkInstance* pInstance);
-typedef VkResult (VKAPI *PFN_vkDestroyInstance)(VkInstance instance);
+typedef void (VKAPI *PFN_vkDestroyInstance)(VkInstance instance);
 typedef VkResult (VKAPI *PFN_vkEnumeratePhysicalDevices)(VkInstance instance, uint32_t* pPhysicalDeviceCount, VkPhysicalDevice* pPhysicalDevices);
 typedef VkResult (VKAPI *PFN_vkGetPhysicalDeviceFeatures)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures* pFeatures);
 typedef VkResult (VKAPI *PFN_vkGetPhysicalDeviceFormatProperties)(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties* pFormatProperties);
-typedef VkResult (VKAPI *PFN_vkGetPhysicalDeviceImageFormatProperties)(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageFormatProperties* pImageFormatProperties);
-typedef VkResult (VKAPI *PFN_vkGetPhysicalDeviceLimits)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceLimits* pLimits);
+typedef VkResult (VKAPI *PFN_vkGetPhysicalDeviceImageFormatProperties)(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, VkImageFormatProperties* pImageFormatProperties);
 typedef VkResult (VKAPI *PFN_vkGetPhysicalDeviceProperties)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties* pProperties);
-typedef VkResult (VKAPI *PFN_vkGetPhysicalDeviceQueueCount)(VkPhysicalDevice physicalDevice, uint32_t* pCount);
-typedef VkResult (VKAPI *PFN_vkGetPhysicalDeviceQueueProperties)(VkPhysicalDevice physicalDevice, uint32_t count, VkPhysicalDeviceQueueProperties* pQueueProperties);
+typedef VkResult (VKAPI *PFN_vkGetPhysicalDeviceQueueFamilyProperties)(VkPhysicalDevice physicalDevice, uint32_t* pCount, VkQueueFamilyProperties* pQueueFamilyProperties);
 typedef VkResult (VKAPI *PFN_vkGetPhysicalDeviceMemoryProperties)(VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties* pMemoryProperties);
 typedef PFN_vkVoidFunction (VKAPI *PFN_vkGetInstanceProcAddr)(VkInstance instance, const char* pName);
 typedef PFN_vkVoidFunction (VKAPI *PFN_vkGetDeviceProcAddr)(VkDevice device, const char* pName);
 typedef VkResult (VKAPI *PFN_vkCreateDevice)(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo* pCreateInfo, VkDevice* pDevice);
-typedef VkResult (VKAPI *PFN_vkDestroyDevice)(VkDevice device);
-typedef VkResult (VKAPI *PFN_vkGetGlobalExtensionProperties)(const char* pLayerName, uint32_t* pCount, VkExtensionProperties* pProperties);
-typedef VkResult (VKAPI *PFN_vkGetPhysicalDeviceExtensionProperties)(VkPhysicalDevice physicalDevice, const char* pLayerName, uint32_t* pCount, VkExtensionProperties* pProperties);
-typedef VkResult (VKAPI *PFN_vkGetGlobalLayerProperties)(uint32_t* pCount, VkLayerProperties* pProperties);
-typedef VkResult (VKAPI *PFN_vkGetPhysicalDeviceLayerProperties)(VkPhysicalDevice physicalDevice, uint32_t* pCount, VkLayerProperties* pProperties);
+typedef void (VKAPI *PFN_vkDestroyDevice)(VkDevice device);
+typedef VkResult (VKAPI *PFN_vkEnumerateInstanceExtensionProperties)(const char* pLayerName, uint32_t* pCount, VkExtensionProperties* pProperties);
+typedef VkResult (VKAPI *PFN_vkEnumerateDeviceExtensionProperties)(VkPhysicalDevice physicalDevice, const char* pLayerName, uint32_t* pCount, VkExtensionProperties* pProperties);
+typedef VkResult (VKAPI *PFN_vkEnumerateInstanceLayerProperties)(uint32_t* pCount, VkLayerProperties* pProperties);
+typedef VkResult (VKAPI *PFN_vkEnumerateDeviceLayerProperties)(VkPhysicalDevice physicalDevice, uint32_t* pCount, VkLayerProperties* pProperties);
 typedef VkResult (VKAPI *PFN_vkGetDeviceQueue)(VkDevice device, uint32_t queueFamilyIndex, uint32_t queueIndex, VkQueue* pQueue);
 typedef VkResult (VKAPI *PFN_vkQueueSubmit)(VkQueue queue, uint32_t cmdBufferCount, const VkCmdBuffer* pCmdBuffers, VkFence fence);
 typedef VkResult (VKAPI *PFN_vkQueueWaitIdle)(VkQueue queue);
 typedef VkResult (VKAPI *PFN_vkDeviceWaitIdle)(VkDevice device);
 typedef VkResult (VKAPI *PFN_vkAllocMemory)(VkDevice device, const VkMemoryAllocInfo* pAllocInfo, VkDeviceMemory* pMem);
-typedef VkResult (VKAPI *PFN_vkFreeMemory)(VkDevice device, VkDeviceMemory mem);
+typedef void (VKAPI *PFN_vkFreeMemory)(VkDevice device, VkDeviceMemory mem);
 typedef VkResult (VKAPI *PFN_vkMapMemory)(VkDevice device, VkDeviceMemory mem, VkDeviceSize offset, VkDeviceSize size, VkMemoryMapFlags flags, void** ppData);
-typedef VkResult (VKAPI *PFN_vkUnmapMemory)(VkDevice device, VkDeviceMemory mem);
+typedef void (VKAPI *PFN_vkUnmapMemory)(VkDevice device, VkDeviceMemory mem);
 typedef VkResult (VKAPI *PFN_vkFlushMappedMemoryRanges)(VkDevice device, uint32_t memRangeCount, const VkMappedMemoryRange* pMemRanges);
 typedef VkResult (VKAPI *PFN_vkInvalidateMappedMemoryRanges)(VkDevice device, uint32_t memRangeCount, const VkMappedMemoryRange* pMemRanges);
 typedef VkResult (VKAPI *PFN_vkGetDeviceMemoryCommitment)(VkDevice device, VkDeviceMemory memory, VkDeviceSize* pCommittedMemoryInBytes);
@@ -2119,88 +2133,83 @@
 typedef VkResult (VKAPI *PFN_vkQueueBindSparseImageOpaqueMemory)(VkQueue queue, VkImage image, uint32_t numBindings, const VkSparseMemoryBindInfo* pBindInfo);
 typedef VkResult (VKAPI *PFN_vkQueueBindSparseImageMemory)(VkQueue queue, VkImage image, uint32_t numBindings, const VkSparseImageMemoryBindInfo* pBindInfo);
 typedef VkResult (VKAPI *PFN_vkCreateFence)(VkDevice device, const VkFenceCreateInfo* pCreateInfo, VkFence* pFence);
-typedef VkResult (VKAPI *PFN_vkDestroyFence)(VkDevice device, VkFence fence);
+typedef void (VKAPI *PFN_vkDestroyFence)(VkDevice device, VkFence fence);
 typedef VkResult (VKAPI *PFN_vkResetFences)(VkDevice device, uint32_t fenceCount, const VkFence* pFences);
 typedef VkResult (VKAPI *PFN_vkGetFenceStatus)(VkDevice device, VkFence fence);
 typedef VkResult (VKAPI *PFN_vkWaitForFences)(VkDevice device, uint32_t fenceCount, const VkFence* pFences, VkBool32 waitAll, uint64_t timeout);
 typedef VkResult (VKAPI *PFN_vkCreateSemaphore)(VkDevice device, const VkSemaphoreCreateInfo* pCreateInfo, VkSemaphore* pSemaphore);
-typedef VkResult (VKAPI *PFN_vkDestroySemaphore)(VkDevice device, VkSemaphore semaphore);
+typedef void (VKAPI *PFN_vkDestroySemaphore)(VkDevice device, VkSemaphore semaphore);
 typedef VkResult (VKAPI *PFN_vkQueueSignalSemaphore)(VkQueue queue, VkSemaphore semaphore);
 typedef VkResult (VKAPI *PFN_vkQueueWaitSemaphore)(VkQueue queue, VkSemaphore semaphore);
 typedef VkResult (VKAPI *PFN_vkCreateEvent)(VkDevice device, const VkEventCreateInfo* pCreateInfo, VkEvent* pEvent);
-typedef VkResult (VKAPI *PFN_vkDestroyEvent)(VkDevice device, VkEvent event);
+typedef void (VKAPI *PFN_vkDestroyEvent)(VkDevice device, VkEvent event);
 typedef VkResult (VKAPI *PFN_vkGetEventStatus)(VkDevice device, VkEvent event);
 typedef VkResult (VKAPI *PFN_vkSetEvent)(VkDevice device, VkEvent event);
 typedef VkResult (VKAPI *PFN_vkResetEvent)(VkDevice device, VkEvent event);
 typedef VkResult (VKAPI *PFN_vkCreateQueryPool)(VkDevice device, const VkQueryPoolCreateInfo* pCreateInfo, VkQueryPool* pQueryPool);
-typedef VkResult (VKAPI *PFN_vkDestroyQueryPool)(VkDevice device, VkQueryPool queryPool);
+typedef void (VKAPI *PFN_vkDestroyQueryPool)(VkDevice device, VkQueryPool queryPool);
 typedef VkResult (VKAPI *PFN_vkGetQueryPoolResults)(VkDevice device, VkQueryPool queryPool, uint32_t startQuery, uint32_t queryCount, size_t* pDataSize, void* pData, VkQueryResultFlags flags);
 typedef VkResult (VKAPI *PFN_vkCreateBuffer)(VkDevice device, const VkBufferCreateInfo* pCreateInfo, VkBuffer* pBuffer);
-typedef VkResult (VKAPI *PFN_vkDestroyBuffer)(VkDevice device, VkBuffer buffer);
+typedef void (VKAPI *PFN_vkDestroyBuffer)(VkDevice device, VkBuffer buffer);
 typedef VkResult (VKAPI *PFN_vkCreateBufferView)(VkDevice device, const VkBufferViewCreateInfo* pCreateInfo, VkBufferView* pView);
-typedef VkResult (VKAPI *PFN_vkDestroyBufferView)(VkDevice device, VkBufferView bufferView);
+typedef void (VKAPI *PFN_vkDestroyBufferView)(VkDevice device, VkBufferView bufferView);
 typedef VkResult (VKAPI *PFN_vkCreateImage)(VkDevice device, const VkImageCreateInfo* pCreateInfo, VkImage* pImage);
-typedef VkResult (VKAPI *PFN_vkDestroyImage)(VkDevice device, VkImage image);
+typedef void (VKAPI *PFN_vkDestroyImage)(VkDevice device, VkImage image);
 typedef VkResult (VKAPI *PFN_vkGetImageSubresourceLayout)(VkDevice device, VkImage image, const VkImageSubresource* pSubresource, VkSubresourceLayout* pLayout);
 typedef VkResult (VKAPI *PFN_vkCreateImageView)(VkDevice device, const VkImageViewCreateInfo* pCreateInfo, VkImageView* pView);
-typedef VkResult (VKAPI *PFN_vkDestroyImageView)(VkDevice device, VkImageView imageView);
-typedef VkResult (VKAPI *PFN_vkCreateAttachmentView)(VkDevice device, const VkAttachmentViewCreateInfo* pCreateInfo, VkAttachmentView* pView);
-typedef VkResult (VKAPI *PFN_vkDestroyAttachmentView)(VkDevice device, VkAttachmentView attachmentView);
+typedef void (VKAPI *PFN_vkDestroyImageView)(VkDevice device, VkImageView imageView);
 typedef VkResult (VKAPI *PFN_vkCreateShaderModule)(VkDevice device, const VkShaderModuleCreateInfo* pCreateInfo, VkShaderModule* pShaderModule);
-typedef VkResult (VKAPI *PFN_vkDestroyShaderModule)(VkDevice device, VkShaderModule shaderModule);
+typedef void (VKAPI *PFN_vkDestroyShaderModule)(VkDevice device, VkShaderModule shaderModule);
 typedef VkResult (VKAPI *PFN_vkCreateShader)(VkDevice device, const VkShaderCreateInfo* pCreateInfo, VkShader* pShader);
-typedef VkResult (VKAPI *PFN_vkDestroyShader)(VkDevice device, VkShader shader);
+typedef void (VKAPI *PFN_vkDestroyShader)(VkDevice device, VkShader shader);
 typedef VkResult (VKAPI *PFN_vkCreatePipelineCache)(VkDevice device, const VkPipelineCacheCreateInfo* pCreateInfo, VkPipelineCache* pPipelineCache);
-typedef VkResult (VKAPI *PFN_vkDestroyPipelineCache)(VkDevice device, VkPipelineCache pipelineCache);
+typedef void (VKAPI *PFN_vkDestroyPipelineCache)(VkDevice device, VkPipelineCache pipelineCache);
 typedef size_t (VKAPI *PFN_vkGetPipelineCacheSize)(VkDevice device, VkPipelineCache pipelineCache);
 typedef VkResult (VKAPI *PFN_vkGetPipelineCacheData)(VkDevice device, VkPipelineCache pipelineCache, void* pData);
 typedef VkResult (VKAPI *PFN_vkMergePipelineCaches)(VkDevice device, VkPipelineCache destCache, uint32_t srcCacheCount, const VkPipelineCache* pSrcCaches);
 typedef VkResult (VKAPI *PFN_vkCreateGraphicsPipelines)(VkDevice device, VkPipelineCache pipelineCache, uint32_t count, const VkGraphicsPipelineCreateInfo* pCreateInfos, VkPipeline* pPipelines);
 typedef VkResult (VKAPI *PFN_vkCreateComputePipelines)(VkDevice device, VkPipelineCache pipelineCache, uint32_t count, const VkComputePipelineCreateInfo* pCreateInfos, VkPipeline* pPipelines);
-typedef VkResult (VKAPI *PFN_vkDestroyPipeline)(VkDevice device, VkPipeline pipeline);
+typedef void (VKAPI *PFN_vkDestroyPipeline)(VkDevice device, VkPipeline pipeline);
 typedef VkResult (VKAPI *PFN_vkCreatePipelineLayout)(VkDevice device, const VkPipelineLayoutCreateInfo* pCreateInfo, VkPipelineLayout* pPipelineLayout);
-typedef VkResult (VKAPI *PFN_vkDestroyPipelineLayout)(VkDevice device, VkPipelineLayout pipelineLayout);
+typedef void (VKAPI *PFN_vkDestroyPipelineLayout)(VkDevice device, VkPipelineLayout pipelineLayout);
 typedef VkResult (VKAPI *PFN_vkCreateSampler)(VkDevice device, const VkSamplerCreateInfo* pCreateInfo, VkSampler* pSampler);
-typedef VkResult (VKAPI *PFN_vkDestroySampler)(VkDevice device, VkSampler sampler);
+typedef void (VKAPI *PFN_vkDestroySampler)(VkDevice device, VkSampler sampler);
 typedef VkResult (VKAPI *PFN_vkCreateDescriptorSetLayout)(VkDevice device, const VkDescriptorSetLayoutCreateInfo* pCreateInfo, VkDescriptorSetLayout* pSetLayout);
-typedef VkResult (VKAPI *PFN_vkDestroyDescriptorSetLayout)(VkDevice device, VkDescriptorSetLayout descriptorSetLayout);
-typedef VkResult (VKAPI *PFN_vkCreateDescriptorPool)(VkDevice device, VkDescriptorPoolUsage poolUsage, uint32_t maxSets, const VkDescriptorPoolCreateInfo* pCreateInfo, VkDescriptorPool* pDescriptorPool);
-typedef VkResult (VKAPI *PFN_vkDestroyDescriptorPool)(VkDevice device, VkDescriptorPool descriptorPool);
+typedef void (VKAPI *PFN_vkDestroyDescriptorSetLayout)(VkDevice device, VkDescriptorSetLayout descriptorSetLayout);
+typedef VkResult (VKAPI *PFN_vkCreateDescriptorPool)(VkDevice device, const VkDescriptorPoolCreateInfo* pCreateInfo, VkDescriptorPool* pDescriptorPool);
+typedef void (VKAPI *PFN_vkDestroyDescriptorPool)(VkDevice device, VkDescriptorPool descriptorPool);
 typedef VkResult (VKAPI *PFN_vkResetDescriptorPool)(VkDevice device, VkDescriptorPool descriptorPool);
-typedef VkResult (VKAPI *PFN_vkAllocDescriptorSets)(VkDevice device, VkDescriptorPool descriptorPool, VkDescriptorSetUsage setUsage, uint32_t count, const VkDescriptorSetLayout* pSetLayouts, VkDescriptorSet* pDescriptorSets, uint32_t* pCount);
+typedef VkResult (VKAPI *PFN_vkAllocDescriptorSets)(VkDevice device, VkDescriptorPool descriptorPool, VkDescriptorSetUsage setUsage, uint32_t count, const VkDescriptorSetLayout* pSetLayouts, VkDescriptorSet* pDescriptorSets);
 typedef VkResult (VKAPI *PFN_vkFreeDescriptorSets)(VkDevice device, VkDescriptorPool descriptorPool, uint32_t count, const VkDescriptorSet* pDescriptorSets);
-typedef VkResult (VKAPI *PFN_vkUpdateDescriptorSets)(VkDevice device, uint32_t writeCount, const VkWriteDescriptorSet* pDescriptorWrites, uint32_t copyCount, const VkCopyDescriptorSet* pDescriptorCopies);
-typedef VkResult (VKAPI *PFN_vkCreateDynamicViewportState)(VkDevice device, const VkDynamicViewportStateCreateInfo* pCreateInfo, VkDynamicViewportState* pState);
-typedef VkResult (VKAPI *PFN_vkDestroyDynamicViewportState)(VkDevice device, VkDynamicViewportState dynamicViewportState);
-typedef VkResult (VKAPI *PFN_vkCreateDynamicRasterState)(VkDevice device, const VkDynamicRasterStateCreateInfo* pCreateInfo, VkDynamicRasterState* pState);
-typedef VkResult (VKAPI *PFN_vkDestroyDynamicRasterState)(VkDevice device, VkDynamicRasterState dynamicRasterState);
-typedef VkResult (VKAPI *PFN_vkCreateDynamicColorBlendState)(VkDevice device, const VkDynamicColorBlendStateCreateInfo* pCreateInfo, VkDynamicColorBlendState* pState);
-typedef VkResult (VKAPI *PFN_vkDestroyDynamicColorBlendState)(VkDevice device, VkDynamicColorBlendState dynamicColorBlendState);
-typedef VkResult (VKAPI *PFN_vkCreateDynamicDepthStencilState)(VkDevice device, const VkDynamicDepthStencilStateCreateInfo* pCreateInfo, VkDynamicDepthStencilState* pState);
-typedef VkResult (VKAPI *PFN_vkDestroyDynamicDepthStencilState)(VkDevice device, VkDynamicDepthStencilState dynamicDepthStencilState);
+typedef void (VKAPI *PFN_vkUpdateDescriptorSets)(VkDevice device, uint32_t writeCount, const VkWriteDescriptorSet* pDescriptorWrites, uint32_t copyCount, const VkCopyDescriptorSet* pDescriptorCopies);
 typedef VkResult (VKAPI *PFN_vkCreateFramebuffer)(VkDevice device, const VkFramebufferCreateInfo* pCreateInfo, VkFramebuffer* pFramebuffer);
-typedef VkResult (VKAPI *PFN_vkDestroyFramebuffer)(VkDevice device, VkFramebuffer framebuffer);
+typedef void (VKAPI *PFN_vkDestroyFramebuffer)(VkDevice device, VkFramebuffer framebuffer);
 typedef VkResult (VKAPI *PFN_vkCreateRenderPass)(VkDevice device, const VkRenderPassCreateInfo* pCreateInfo, VkRenderPass* pRenderPass);
-typedef VkResult (VKAPI *PFN_vkDestroyRenderPass)(VkDevice device, VkRenderPass renderPass);
+typedef void (VKAPI *PFN_vkDestroyRenderPass)(VkDevice device, VkRenderPass renderPass);
 typedef VkResult (VKAPI *PFN_vkGetRenderAreaGranularity)(VkDevice device, VkRenderPass renderPass, VkExtent2D* pGranularity);
 typedef VkResult (VKAPI *PFN_vkCreateCommandPool)(VkDevice device, const VkCmdPoolCreateInfo* pCreateInfo, VkCmdPool* pCmdPool);
-typedef VkResult (VKAPI *PFN_vkDestroyCommandPool)(VkDevice device, VkCmdPool cmdPool);
+typedef void (VKAPI *PFN_vkDestroyCommandPool)(VkDevice device, VkCmdPool cmdPool);
 typedef VkResult (VKAPI *PFN_vkResetCommandPool)(VkDevice device, VkCmdPool cmdPool, VkCmdPoolResetFlags flags);
 typedef VkResult (VKAPI *PFN_vkCreateCommandBuffer)(VkDevice device, const VkCmdBufferCreateInfo* pCreateInfo, VkCmdBuffer* pCmdBuffer);
-typedef VkResult (VKAPI *PFN_vkDestroyCommandBuffer)(VkDevice device, VkCmdBuffer commandBuffer);
+typedef void (VKAPI *PFN_vkDestroyCommandBuffer)(VkDevice device, VkCmdBuffer commandBuffer);
 typedef VkResult (VKAPI *PFN_vkBeginCommandBuffer)(VkCmdBuffer cmdBuffer, const VkCmdBufferBeginInfo* pBeginInfo);
 typedef VkResult (VKAPI *PFN_vkEndCommandBuffer)(VkCmdBuffer cmdBuffer);
 typedef VkResult (VKAPI *PFN_vkResetCommandBuffer)(VkCmdBuffer cmdBuffer, VkCmdBufferResetFlags flags);
 typedef void (VKAPI *PFN_vkCmdBindPipeline)(VkCmdBuffer cmdBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline);
-typedef void (VKAPI *PFN_vkCmdBindDynamicViewportState)(VkCmdBuffer cmdBuffer, VkDynamicViewportState dynamicViewportState);
-typedef void (VKAPI *PFN_vkCmdBindDynamicRasterState)(VkCmdBuffer cmdBuffer, VkDynamicRasterState dynamicRasterState);
-typedef void (VKAPI *PFN_vkCmdBindDynamicColorBlendState)(VkCmdBuffer cmdBuffer, VkDynamicColorBlendState dynamicColorBlendState);
-typedef void (VKAPI *PFN_vkCmdBindDynamicDepthStencilState)(VkCmdBuffer cmdBuffer, VkDynamicDepthStencilState dynamicDepthStencilState);
+typedef void (VKAPI *PFN_vkCmdSetViewport)(VkCmdBuffer cmdBuffer, uint32_t viewportCount, const VkViewport* pViewports);
+typedef void (VKAPI *PFN_vkCmdSetScissor)(VkCmdBuffer cmdBuffer, uint32_t scissorCount, const VkRect2D* pScissors);
+typedef void (VKAPI *PFN_vkCmdSetLineWidth)(VkCmdBuffer cmdBuffer, float lineWidth);
+typedef void (VKAPI *PFN_vkCmdSetDepthBias)(VkCmdBuffer cmdBuffer, float depthBias, float depthBiasClamp, float slopeScaledDepthBias);
+typedef void (VKAPI *PFN_vkCmdSetBlendConstants)(VkCmdBuffer cmdBuffer, const float blendConst[4]);
+typedef void (VKAPI *PFN_vkCmdSetDepthBounds)(VkCmdBuffer cmdBuffer, float minDepthBounds, float maxDepthBounds);
+typedef void (VKAPI *PFN_vkCmdSetStencilCompareMask)(VkCmdBuffer cmdBuffer, VkStencilFaceFlags faceMask, uint32_t stencilCompareMask);
+typedef void (VKAPI *PFN_vkCmdSetStencilWriteMask)(VkCmdBuffer cmdBuffer, VkStencilFaceFlags faceMask, uint32_t stencilWriteMask);
+typedef void (VKAPI *PFN_vkCmdSetStencilReference)(VkCmdBuffer cmdBuffer, VkStencilFaceFlags faceMask, uint32_t stencilReference);
 typedef void (VKAPI *PFN_vkCmdBindDescriptorSets)(VkCmdBuffer cmdBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t firstSet, uint32_t setCount, const VkDescriptorSet* pDescriptorSets, uint32_t dynamicOffsetCount, const uint32_t* pDynamicOffsets);
 typedef void (VKAPI *PFN_vkCmdBindIndexBuffer)(VkCmdBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset, VkIndexType indexType);
 typedef void (VKAPI *PFN_vkCmdBindVertexBuffers)(VkCmdBuffer cmdBuffer, uint32_t startBinding, uint32_t bindingCount, const VkBuffer* pBuffers, const VkDeviceSize* pOffsets);
-typedef void (VKAPI *PFN_vkCmdDraw)(VkCmdBuffer cmdBuffer, uint32_t firstVertex, uint32_t vertexCount, uint32_t firstInstance, uint32_t instanceCount);
-typedef void (VKAPI *PFN_vkCmdDrawIndexed)(VkCmdBuffer cmdBuffer, uint32_t firstIndex, uint32_t indexCount, int32_t vertexOffset, uint32_t firstInstance, uint32_t instanceCount);
+typedef void (VKAPI *PFN_vkCmdDraw)(VkCmdBuffer cmdBuffer, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance);
+typedef void (VKAPI *PFN_vkCmdDrawIndexed)(VkCmdBuffer cmdBuffer, uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t vertexOffset, uint32_t firstInstance);
 typedef void (VKAPI *PFN_vkCmdDrawIndirect)(VkCmdBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t count, uint32_t stride);
 typedef void (VKAPI *PFN_vkCmdDrawIndexedIndirect)(VkCmdBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t count, uint32_t stride);
 typedef void (VKAPI *PFN_vkCmdDispatch)(VkCmdBuffer cmdBuffer, uint32_t x, uint32_t y, uint32_t z);
@@ -2213,9 +2222,9 @@
 typedef void (VKAPI *PFN_vkCmdUpdateBuffer)(VkCmdBuffer cmdBuffer, VkBuffer destBuffer, VkDeviceSize destOffset, VkDeviceSize dataSize, const uint32_t* pData);
 typedef void (VKAPI *PFN_vkCmdFillBuffer)(VkCmdBuffer cmdBuffer, VkBuffer destBuffer, VkDeviceSize destOffset, VkDeviceSize fillSize, uint32_t data);
 typedef void (VKAPI *PFN_vkCmdClearColorImage)(VkCmdBuffer cmdBuffer, VkImage image, VkImageLayout imageLayout, const VkClearColorValue* pColor, uint32_t rangeCount, const VkImageSubresourceRange* pRanges);
-typedef void (VKAPI *PFN_vkCmdClearDepthStencilImage)(VkCmdBuffer cmdBuffer, VkImage image, VkImageLayout imageLayout, float depth, uint32_t stencil, uint32_t rangeCount, const VkImageSubresourceRange* pRanges);
+typedef void (VKAPI *PFN_vkCmdClearDepthStencilImage)(VkCmdBuffer cmdBuffer, VkImage image, VkImageLayout imageLayout, const VkClearDepthStencilValue* pDepthStencil, uint32_t rangeCount, const VkImageSubresourceRange* pRanges);
 typedef void (VKAPI *PFN_vkCmdClearColorAttachment)(VkCmdBuffer cmdBuffer, uint32_t colorAttachment, VkImageLayout imageLayout, const VkClearColorValue* pColor, uint32_t rectCount, const VkRect3D* pRects);
-typedef void (VKAPI *PFN_vkCmdClearDepthStencilAttachment)(VkCmdBuffer cmdBuffer, VkImageAspectFlags imageAspectMask, VkImageLayout imageLayout, float depth, uint32_t stencil, uint32_t rectCount, const VkRect3D* pRects);
+typedef void (VKAPI *PFN_vkCmdClearDepthStencilAttachment)(VkCmdBuffer cmdBuffer, VkImageAspectFlags aspectMask, VkImageLayout imageLayout, const VkClearDepthStencilValue* pDepthStencil, uint32_t rectCount, const VkRect3D* pRects);
 typedef void (VKAPI *PFN_vkCmdResolveImage)(VkCmdBuffer cmdBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage destImage, VkImageLayout destImageLayout, uint32_t regionCount, const VkImageResolve* pRegions);
 typedef void (VKAPI *PFN_vkCmdSetEvent)(VkCmdBuffer cmdBuffer, VkEvent event, VkPipelineStageFlags stageMask);
 typedef void (VKAPI *PFN_vkCmdResetEvent)(VkCmdBuffer cmdBuffer, VkEvent event, VkPipelineStageFlags stageMask);
@@ -2237,7 +2246,7 @@
     const VkInstanceCreateInfo*                 pCreateInfo,
     VkInstance*                                 pInstance);
 
-VkResult VKAPI vkDestroyInstance(
+void VKAPI vkDestroyInstance(
     VkInstance                                  instance);
 
 VkResult VKAPI vkEnumeratePhysicalDevices(
@@ -2260,24 +2269,17 @@
     VkImageType                                 type,
     VkImageTiling                               tiling,
     VkImageUsageFlags                           usage,
+    VkImageCreateFlags                          flags,
     VkImageFormatProperties*                    pImageFormatProperties);
 
-VkResult VKAPI vkGetPhysicalDeviceLimits(
-    VkPhysicalDevice                            physicalDevice,
-    VkPhysicalDeviceLimits*                     pLimits);
-
 VkResult VKAPI vkGetPhysicalDeviceProperties(
     VkPhysicalDevice                            physicalDevice,
     VkPhysicalDeviceProperties*                 pProperties);
 
-VkResult VKAPI vkGetPhysicalDeviceQueueCount(
+VkResult VKAPI vkGetPhysicalDeviceQueueFamilyProperties(
     VkPhysicalDevice                            physicalDevice,
-    uint32_t*                                   pCount);
-
-VkResult VKAPI vkGetPhysicalDeviceQueueProperties(
-    VkPhysicalDevice                            physicalDevice,
-    uint32_t                                    count,
-    VkPhysicalDeviceQueueProperties*            pQueueProperties);
+    uint32_t*                                   pCount,
+    VkQueueFamilyProperties*                    pQueueFamilyProperties);
 
 VkResult VKAPI vkGetPhysicalDeviceMemoryProperties(
     VkPhysicalDevice                            physicalDevice,
@@ -2296,25 +2298,25 @@
     const VkDeviceCreateInfo*                   pCreateInfo,
     VkDevice*                                   pDevice);
 
-VkResult VKAPI vkDestroyDevice(
+void VKAPI vkDestroyDevice(
     VkDevice                                    device);
 
-VkResult VKAPI vkGetGlobalExtensionProperties(
+VkResult VKAPI vkEnumerateInstanceExtensionProperties(
     const char*                                 pLayerName,
     uint32_t*                                   pCount,
     VkExtensionProperties*                      pProperties);
 
-VkResult VKAPI vkGetPhysicalDeviceExtensionProperties(
+VkResult VKAPI vkEnumerateDeviceExtensionProperties(
     VkPhysicalDevice                            physicalDevice,
     const char*                                 pLayerName,
     uint32_t*                                   pCount,
     VkExtensionProperties*                      pProperties);
 
-VkResult VKAPI vkGetGlobalLayerProperties(
+VkResult VKAPI vkEnumerateInstanceLayerProperties(
     uint32_t*                                   pCount,
     VkLayerProperties*                          pProperties);
 
-VkResult VKAPI vkGetPhysicalDeviceLayerProperties(
+VkResult VKAPI vkEnumerateDeviceLayerProperties(
     VkPhysicalDevice                            physicalDevice,
     uint32_t*                                   pCount,
     VkLayerProperties*                          pProperties);
@@ -2342,7 +2344,7 @@
     const VkMemoryAllocInfo*                    pAllocInfo,
     VkDeviceMemory*                             pMem);
 
-VkResult VKAPI vkFreeMemory(
+void VKAPI vkFreeMemory(
     VkDevice                                    device,
     VkDeviceMemory                              mem);
 
@@ -2354,7 +2356,7 @@
     VkMemoryMapFlags                            flags,
     void**                                      ppData);
 
-VkResult VKAPI vkUnmapMemory(
+void VKAPI vkUnmapMemory(
     VkDevice                                    device,
     VkDeviceMemory                              mem);
 
@@ -2434,7 +2436,7 @@
     const VkFenceCreateInfo*                    pCreateInfo,
     VkFence*                                    pFence);
 
-VkResult VKAPI vkDestroyFence(
+void VKAPI vkDestroyFence(
     VkDevice                                    device,
     VkFence                                     fence);
 
@@ -2459,7 +2461,7 @@
     const VkSemaphoreCreateInfo*                pCreateInfo,
     VkSemaphore*                                pSemaphore);
 
-VkResult VKAPI vkDestroySemaphore(
+void VKAPI vkDestroySemaphore(
     VkDevice                                    device,
     VkSemaphore                                 semaphore);
 
@@ -2476,7 +2478,7 @@
     const VkEventCreateInfo*                    pCreateInfo,
     VkEvent*                                    pEvent);
 
-VkResult VKAPI vkDestroyEvent(
+void VKAPI vkDestroyEvent(
     VkDevice                                    device,
     VkEvent                                     event);
 
@@ -2497,7 +2499,7 @@
     const VkQueryPoolCreateInfo*                pCreateInfo,
     VkQueryPool*                                pQueryPool);
 
-VkResult VKAPI vkDestroyQueryPool(
+void VKAPI vkDestroyQueryPool(
     VkDevice                                    device,
     VkQueryPool                                 queryPool);
 
@@ -2515,7 +2517,7 @@
     const VkBufferCreateInfo*                   pCreateInfo,
     VkBuffer*                                   pBuffer);
 
-VkResult VKAPI vkDestroyBuffer(
+void VKAPI vkDestroyBuffer(
     VkDevice                                    device,
     VkBuffer                                    buffer);
 
@@ -2524,7 +2526,7 @@
     const VkBufferViewCreateInfo*               pCreateInfo,
     VkBufferView*                               pView);
 
-VkResult VKAPI vkDestroyBufferView(
+void VKAPI vkDestroyBufferView(
     VkDevice                                    device,
     VkBufferView                                bufferView);
 
@@ -2533,7 +2535,7 @@
     const VkImageCreateInfo*                    pCreateInfo,
     VkImage*                                    pImage);
 
-VkResult VKAPI vkDestroyImage(
+void VKAPI vkDestroyImage(
     VkDevice                                    device,
     VkImage                                     image);
 
@@ -2548,25 +2550,16 @@
     const VkImageViewCreateInfo*                pCreateInfo,
     VkImageView*                                pView);
 
-VkResult VKAPI vkDestroyImageView(
+void VKAPI vkDestroyImageView(
     VkDevice                                    device,
     VkImageView                                 imageView);
 
-VkResult VKAPI vkCreateAttachmentView(
-    VkDevice                                    device,
-    const VkAttachmentViewCreateInfo*           pCreateInfo,
-    VkAttachmentView*                           pView);
-
-VkResult VKAPI vkDestroyAttachmentView(
-    VkDevice                                    device,
-    VkAttachmentView                            attachmentView);
-
 VkResult VKAPI vkCreateShaderModule(
     VkDevice                                    device,
     const VkShaderModuleCreateInfo*             pCreateInfo,
     VkShaderModule*                             pShaderModule);
 
-VkResult VKAPI vkDestroyShaderModule(
+void VKAPI vkDestroyShaderModule(
     VkDevice                                    device,
     VkShaderModule                              shaderModule);
 
@@ -2575,7 +2568,7 @@
     const VkShaderCreateInfo*                   pCreateInfo,
     VkShader*                                   pShader);
 
-VkResult VKAPI vkDestroyShader(
+void VKAPI vkDestroyShader(
     VkDevice                                    device,
     VkShader                                    shader);
 
@@ -2584,7 +2577,7 @@
     const VkPipelineCacheCreateInfo*            pCreateInfo,
     VkPipelineCache*                            pPipelineCache);
 
-VkResult VKAPI vkDestroyPipelineCache(
+void VKAPI vkDestroyPipelineCache(
     VkDevice                                    device,
     VkPipelineCache                             pipelineCache);
 
@@ -2617,7 +2610,7 @@
     const VkComputePipelineCreateInfo*          pCreateInfos,
     VkPipeline*                                 pPipelines);
 
-VkResult VKAPI vkDestroyPipeline(
+void VKAPI vkDestroyPipeline(
     VkDevice                                    device,
     VkPipeline                                  pipeline);
 
@@ -2626,7 +2619,7 @@
     const VkPipelineLayoutCreateInfo*           pCreateInfo,
     VkPipelineLayout*                           pPipelineLayout);
 
-VkResult VKAPI vkDestroyPipelineLayout(
+void VKAPI vkDestroyPipelineLayout(
     VkDevice                                    device,
     VkPipelineLayout                            pipelineLayout);
 
@@ -2635,7 +2628,7 @@
     const VkSamplerCreateInfo*                  pCreateInfo,
     VkSampler*                                  pSampler);
 
-VkResult VKAPI vkDestroySampler(
+void VKAPI vkDestroySampler(
     VkDevice                                    device,
     VkSampler                                   sampler);
 
@@ -2644,18 +2637,16 @@
     const VkDescriptorSetLayoutCreateInfo*      pCreateInfo,
     VkDescriptorSetLayout*                      pSetLayout);
 
-VkResult VKAPI vkDestroyDescriptorSetLayout(
+void VKAPI vkDestroyDescriptorSetLayout(
     VkDevice                                    device,
     VkDescriptorSetLayout                       descriptorSetLayout);
 
 VkResult VKAPI vkCreateDescriptorPool(
     VkDevice                                    device,
-    VkDescriptorPoolUsage                       poolUsage,
-    uint32_t                                    maxSets,
     const VkDescriptorPoolCreateInfo*           pCreateInfo,
     VkDescriptorPool*                           pDescriptorPool);
 
-VkResult VKAPI vkDestroyDescriptorPool(
+void VKAPI vkDestroyDescriptorPool(
     VkDevice                                    device,
     VkDescriptorPool                            descriptorPool);
 
@@ -2669,8 +2660,7 @@
     VkDescriptorSetUsage                        setUsage,
     uint32_t                                    count,
     const VkDescriptorSetLayout*                pSetLayouts,
-    VkDescriptorSet*                            pDescriptorSets,
-    uint32_t*                                   pCount);
+    VkDescriptorSet*                            pDescriptorSets);
 
 VkResult VKAPI vkFreeDescriptorSets(
     VkDevice                                    device,
@@ -2678,55 +2668,19 @@
     uint32_t                                    count,
     const VkDescriptorSet*                      pDescriptorSets);
 
-VkResult VKAPI vkUpdateDescriptorSets(
+void VKAPI vkUpdateDescriptorSets(
     VkDevice                                    device,
     uint32_t                                    writeCount,
     const VkWriteDescriptorSet*                 pDescriptorWrites,
     uint32_t                                    copyCount,
     const VkCopyDescriptorSet*                  pDescriptorCopies);
 
-VkResult VKAPI vkCreateDynamicViewportState(
-    VkDevice                                    device,
-    const VkDynamicViewportStateCreateInfo*     pCreateInfo,
-    VkDynamicViewportState*                     pState);
-
-VkResult VKAPI vkDestroyDynamicViewportState(
-    VkDevice                                    device,
-    VkDynamicViewportState                      dynamicViewportState);
-
-VkResult VKAPI vkCreateDynamicRasterState(
-    VkDevice                                    device,
-    const VkDynamicRasterStateCreateInfo*       pCreateInfo,
-    VkDynamicRasterState*                       pState);
-
-VkResult VKAPI vkDestroyDynamicRasterState(
-    VkDevice                                    device,
-    VkDynamicRasterState                        dynamicRasterState);
-
-VkResult VKAPI vkCreateDynamicColorBlendState(
-    VkDevice                                    device,
-    const VkDynamicColorBlendStateCreateInfo*   pCreateInfo,
-    VkDynamicColorBlendState*                   pState);
-
-VkResult VKAPI vkDestroyDynamicColorBlendState(
-    VkDevice                                    device,
-    VkDynamicColorBlendState                    dynamicColorBlendState);
-
-VkResult VKAPI vkCreateDynamicDepthStencilState(
-    VkDevice                                    device,
-    const VkDynamicDepthStencilStateCreateInfo* pCreateInfo,
-    VkDynamicDepthStencilState*                 pState);
-
-VkResult VKAPI vkDestroyDynamicDepthStencilState(
-    VkDevice                                    device,
-    VkDynamicDepthStencilState                  dynamicDepthStencilState);
-
 VkResult VKAPI vkCreateFramebuffer(
     VkDevice                                    device,
     const VkFramebufferCreateInfo*              pCreateInfo,
     VkFramebuffer*                              pFramebuffer);
 
-VkResult VKAPI vkDestroyFramebuffer(
+void VKAPI vkDestroyFramebuffer(
     VkDevice                                    device,
     VkFramebuffer                               framebuffer);
 
@@ -2735,7 +2689,7 @@
     const VkRenderPassCreateInfo*               pCreateInfo,
     VkRenderPass*                               pRenderPass);
 
-VkResult VKAPI vkDestroyRenderPass(
+void VKAPI vkDestroyRenderPass(
     VkDevice                                    device,
     VkRenderPass                                renderPass);
 
@@ -2749,7 +2703,7 @@
     const VkCmdPoolCreateInfo*                  pCreateInfo,
     VkCmdPool*                                  pCmdPool);
 
-VkResult VKAPI vkDestroyCommandPool(
+void VKAPI vkDestroyCommandPool(
     VkDevice                                    device,
     VkCmdPool                                   cmdPool);
 
@@ -2763,7 +2717,7 @@
     const VkCmdBufferCreateInfo*                pCreateInfo,
     VkCmdBuffer*                                pCmdBuffer);
 
-VkResult VKAPI vkDestroyCommandBuffer(
+void VKAPI vkDestroyCommandBuffer(
     VkDevice                                    device,
     VkCmdBuffer                                 commandBuffer);
 
@@ -2783,21 +2737,49 @@
     VkPipelineBindPoint                         pipelineBindPoint,
     VkPipeline                                  pipeline);
 
-void VKAPI vkCmdBindDynamicViewportState(
+void VKAPI vkCmdSetViewport(
     VkCmdBuffer                                 cmdBuffer,
-    VkDynamicViewportState                      dynamicViewportState);
+    uint32_t                                    viewportCount,
+    const VkViewport*                           pViewports);
 
-void VKAPI vkCmdBindDynamicRasterState(
+void VKAPI vkCmdSetScissor(
     VkCmdBuffer                                 cmdBuffer,
-    VkDynamicRasterState                        dynamicRasterState);
+    uint32_t                                    scissorCount,
+    const VkRect2D*                             pScissors);
 
-void VKAPI vkCmdBindDynamicColorBlendState(
+void VKAPI vkCmdSetLineWidth(
     VkCmdBuffer                                 cmdBuffer,
-    VkDynamicColorBlendState                    dynamicColorBlendState);
+    float                                       lineWidth);
 
-void VKAPI vkCmdBindDynamicDepthStencilState(
+void VKAPI vkCmdSetDepthBias(
     VkCmdBuffer                                 cmdBuffer,
-    VkDynamicDepthStencilState                  dynamicDepthStencilState);
+    float                                       depthBias,
+    float                                       depthBiasClamp,
+    float                                       slopeScaledDepthBias);
+
+void VKAPI vkCmdSetBlendConstants(
+    VkCmdBuffer                                 cmdBuffer,
+    const float                                 blendConst[4]);
+
+void VKAPI vkCmdSetDepthBounds(
+    VkCmdBuffer                                 cmdBuffer,
+    float                                       minDepthBounds,
+    float                                       maxDepthBounds);
+
+void VKAPI vkCmdSetStencilCompareMask(
+    VkCmdBuffer                                 cmdBuffer,
+    VkStencilFaceFlags                          faceMask,
+    uint32_t                                    stencilCompareMask);
+
+void VKAPI vkCmdSetStencilWriteMask(
+    VkCmdBuffer                                 cmdBuffer,
+    VkStencilFaceFlags                          faceMask,
+    uint32_t                                    stencilWriteMask);
+
+void VKAPI vkCmdSetStencilReference(
+    VkCmdBuffer                                 cmdBuffer,
+    VkStencilFaceFlags                          faceMask,
+    uint32_t                                    stencilReference);
 
 void VKAPI vkCmdBindDescriptorSets(
     VkCmdBuffer                                 cmdBuffer,
@@ -2824,18 +2806,18 @@
 
 void VKAPI vkCmdDraw(
     VkCmdBuffer                                 cmdBuffer,
-    uint32_t                                    firstVertex,
     uint32_t                                    vertexCount,
-    uint32_t                                    firstInstance,
-    uint32_t                                    instanceCount);
+    uint32_t                                    instanceCount,
+    uint32_t                                    firstVertex,
+    uint32_t                                    firstInstance);
 
 void VKAPI vkCmdDrawIndexed(
     VkCmdBuffer                                 cmdBuffer,
-    uint32_t                                    firstIndex,
     uint32_t                                    indexCount,
+    uint32_t                                    instanceCount,
+    uint32_t                                    firstIndex,
     int32_t                                     vertexOffset,
-    uint32_t                                    firstInstance,
-    uint32_t                                    instanceCount);
+    uint32_t                                    firstInstance);
 
 void VKAPI vkCmdDrawIndirect(
     VkCmdBuffer                                 cmdBuffer,
@@ -2930,8 +2912,7 @@
     VkCmdBuffer                                 cmdBuffer,
     VkImage                                     image,
     VkImageLayout                               imageLayout,
-    float                                       depth,
-    uint32_t                                    stencil,
+    const VkClearDepthStencilValue*             pDepthStencil,
     uint32_t                                    rangeCount,
     const VkImageSubresourceRange*              pRanges);
 
@@ -2945,10 +2926,9 @@
 
 void VKAPI vkCmdClearDepthStencilAttachment(
     VkCmdBuffer                                 cmdBuffer,
-    VkImageAspectFlags                          imageAspectMask,
+    VkImageAspectFlags                          aspectMask,
     VkImageLayout                               imageLayout,
-    float                                       depth,
-    uint32_t                                    stencil,
+    const VkClearDepthStencilValue*             pDepthStencil,
     uint32_t                                    rectCount,
     const VkRect3D*                             pRects);
 
diff --git a/vulkan/libvulkan/entry.cpp b/vulkan/libvulkan/entry.cpp
index cd5dd99..2f7583d 100644
--- a/vulkan/libvulkan/entry.cpp
+++ b/vulkan/libvulkan/entry.cpp
@@ -47,8 +47,8 @@
 }
 
 __attribute__((visibility("default")))
-VkResult vkDestroyInstance(VkInstance instance) {
-    return GetVtbl(instance).DestroyInstance(instance);
+void vkDestroyInstance(VkInstance instance) {
+    GetVtbl(instance).DestroyInstance(instance);
 }
 
 __attribute__((visibility("default")))
@@ -72,13 +72,8 @@
 }
 
 __attribute__((visibility("default")))
-VkResult vkGetPhysicalDeviceQueueCount(VkPhysicalDevice physicalDevice, uint32_t* pCount) {
-    return GetVtbl(physicalDevice).GetPhysicalDeviceQueueCount(physicalDevice, pCount);
-}
-
-__attribute__((visibility("default")))
-VkResult vkGetPhysicalDeviceQueueProperties(VkPhysicalDevice physicalDevice, uint32_t count, VkPhysicalDeviceQueueProperties* pQueueProperties) {
-    return GetVtbl(physicalDevice).GetPhysicalDeviceQueueProperties(physicalDevice, count, pQueueProperties);
+VkResult vkGetPhysicalDeviceQueueFamilyProperties(VkPhysicalDevice physicalDevice, uint32_t* pCount, VkQueueFamilyProperties* pQueueFamilyProperties) {
+    return GetVtbl(physicalDevice).GetPhysicalDeviceQueueFamilyProperties(physicalDevice, pCount, pQueueFamilyProperties);
 }
 
 __attribute__((visibility("default")))
@@ -97,13 +92,8 @@
 }
 
 __attribute__((visibility("default")))
-VkResult vkGetPhysicalDeviceImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageFormatProperties* pImageFormatProperties) {
-    return GetVtbl(physicalDevice).GetPhysicalDeviceImageFormatProperties(physicalDevice, format, type, tiling, usage, pImageFormatProperties);
-}
-
-__attribute__((visibility("default")))
-VkResult vkGetPhysicalDeviceLimits(VkPhysicalDevice physicalDevice, VkPhysicalDeviceLimits* pLimits) {
-    return GetVtbl(physicalDevice).GetPhysicalDeviceLimits(physicalDevice, pLimits);
+VkResult vkGetPhysicalDeviceImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, VkImageFormatProperties* pImageFormatProperties) {
+    return GetVtbl(physicalDevice).GetPhysicalDeviceImageFormatProperties(physicalDevice, format, type, tiling, usage, flags, pImageFormatProperties);
 }
 
 __attribute__((visibility("default")))
@@ -112,28 +102,28 @@
 }
 
 __attribute__((visibility("default")))
-VkResult vkDestroyDevice(VkDevice device) {
-    return vulkan::DestroyDevice(device);
+void vkDestroyDevice(VkDevice device) {
+    vulkan::DestroyDevice(device);
 }
 
 __attribute__((visibility("default")))
-VkResult vkGetGlobalLayerProperties(uint32_t* pCount, VkLayerProperties* pProperties) {
-    return vulkan::GetGlobalLayerProperties(pCount, pProperties);
+VkResult vkEnumerateInstanceLayerProperties(uint32_t* pCount, VkLayerProperties* pProperties) {
+    return vulkan::EnumerateInstanceLayerProperties(pCount, pProperties);
 }
 
 __attribute__((visibility("default")))
-VkResult vkGetGlobalExtensionProperties(const char* pLayerName, uint32_t* pCount, VkExtensionProperties* pProperties) {
-    return vulkan::GetGlobalExtensionProperties(pLayerName, pCount, pProperties);
+VkResult vkEnumerateInstanceExtensionProperties(const char* pLayerName, uint32_t* pCount, VkExtensionProperties* pProperties) {
+    return vulkan::EnumerateInstanceExtensionProperties(pLayerName, pCount, pProperties);
 }
 
 __attribute__((visibility("default")))
-VkResult vkGetPhysicalDeviceLayerProperties(VkPhysicalDevice physicalDevice, uint32_t* pCount, VkLayerProperties* pProperties) {
-    return GetVtbl(physicalDevice).GetPhysicalDeviceLayerProperties(physicalDevice, pCount, pProperties);
+VkResult vkEnumerateDeviceLayerProperties(VkPhysicalDevice physicalDevice, uint32_t* pCount, VkLayerProperties* pProperties) {
+    return GetVtbl(physicalDevice).EnumerateDeviceLayerProperties(physicalDevice, pCount, pProperties);
 }
 
 __attribute__((visibility("default")))
-VkResult vkGetPhysicalDeviceExtensionProperties(VkPhysicalDevice physicalDevice, const char* pLayerName, uint32_t* pCount, VkExtensionProperties* pProperties) {
-    return GetVtbl(physicalDevice).GetPhysicalDeviceExtensionProperties(physicalDevice, pLayerName, pCount, pProperties);
+VkResult vkEnumerateDeviceExtensionProperties(VkPhysicalDevice physicalDevice, const char* pLayerName, uint32_t* pCount, VkExtensionProperties* pProperties) {
+    return GetVtbl(physicalDevice).EnumerateDeviceExtensionProperties(physicalDevice, pLayerName, pCount, pProperties);
 }
 
 __attribute__((visibility("default")))
@@ -162,8 +152,8 @@
 }
 
 __attribute__((visibility("default")))
-VkResult vkFreeMemory(VkDevice device, VkDeviceMemory mem) {
-    return GetVtbl(device).FreeMemory(device, mem);
+void vkFreeMemory(VkDevice device, VkDeviceMemory mem) {
+    GetVtbl(device).FreeMemory(device, mem);
 }
 
 __attribute__((visibility("default")))
@@ -172,8 +162,8 @@
 }
 
 __attribute__((visibility("default")))
-VkResult vkUnmapMemory(VkDevice device, VkDeviceMemory mem) {
-    return GetVtbl(device).UnmapMemory(device, mem);
+void vkUnmapMemory(VkDevice device, VkDeviceMemory mem) {
+    GetVtbl(device).UnmapMemory(device, mem);
 }
 
 __attribute__((visibility("default")))
@@ -242,8 +232,8 @@
 }
 
 __attribute__((visibility("default")))
-VkResult vkDestroyFence(VkDevice device, VkFence fence) {
-    return GetVtbl(device).DestroyFence(device, fence);
+void vkDestroyFence(VkDevice device, VkFence fence) {
+    GetVtbl(device).DestroyFence(device, fence);
 }
 
 __attribute__((visibility("default")))
@@ -267,8 +257,8 @@
 }
 
 __attribute__((visibility("default")))
-VkResult vkDestroySemaphore(VkDevice device, VkSemaphore semaphore) {
-    return GetVtbl(device).DestroySemaphore(device, semaphore);
+void vkDestroySemaphore(VkDevice device, VkSemaphore semaphore) {
+    GetVtbl(device).DestroySemaphore(device, semaphore);
 }
 
 __attribute__((visibility("default")))
@@ -287,8 +277,8 @@
 }
 
 __attribute__((visibility("default")))
-VkResult vkDestroyEvent(VkDevice device, VkEvent event) {
-    return GetVtbl(device).DestroyEvent(device, event);
+void vkDestroyEvent(VkDevice device, VkEvent event) {
+    GetVtbl(device).DestroyEvent(device, event);
 }
 
 __attribute__((visibility("default")))
@@ -312,8 +302,8 @@
 }
 
 __attribute__((visibility("default")))
-VkResult vkDestroyQueryPool(VkDevice device, VkQueryPool queryPool) {
-    return GetVtbl(device).DestroyQueryPool(device, queryPool);
+void vkDestroyQueryPool(VkDevice device, VkQueryPool queryPool) {
+    GetVtbl(device).DestroyQueryPool(device, queryPool);
 }
 
 __attribute__((visibility("default")))
@@ -327,8 +317,8 @@
 }
 
 __attribute__((visibility("default")))
-VkResult vkDestroyBuffer(VkDevice device, VkBuffer buffer) {
-    return GetVtbl(device).DestroyBuffer(device, buffer);
+void vkDestroyBuffer(VkDevice device, VkBuffer buffer) {
+    GetVtbl(device).DestroyBuffer(device, buffer);
 }
 
 __attribute__((visibility("default")))
@@ -337,8 +327,8 @@
 }
 
 __attribute__((visibility("default")))
-VkResult vkDestroyBufferView(VkDevice device, VkBufferView bufferView) {
-    return GetVtbl(device).DestroyBufferView(device, bufferView);
+void vkDestroyBufferView(VkDevice device, VkBufferView bufferView) {
+    GetVtbl(device).DestroyBufferView(device, bufferView);
 }
 
 __attribute__((visibility("default")))
@@ -347,8 +337,8 @@
 }
 
 __attribute__((visibility("default")))
-VkResult vkDestroyImage(VkDevice device, VkImage image) {
-    return GetVtbl(device).DestroyImage(device, image);
+void vkDestroyImage(VkDevice device, VkImage image) {
+    GetVtbl(device).DestroyImage(device, image);
 }
 
 __attribute__((visibility("default")))
@@ -362,18 +352,8 @@
 }
 
 __attribute__((visibility("default")))
-VkResult vkDestroyImageView(VkDevice device, VkImageView imageView) {
-    return GetVtbl(device).DestroyImageView(device, imageView);
-}
-
-__attribute__((visibility("default")))
-VkResult vkCreateAttachmentView(VkDevice device, const VkAttachmentViewCreateInfo* pCreateInfo, VkAttachmentView* pView) {
-    return GetVtbl(device).CreateAttachmentView(device, pCreateInfo, pView);
-}
-
-__attribute__((visibility("default")))
-VkResult vkDestroyAttachmentView(VkDevice device, VkAttachmentView attachmentView) {
-    return GetVtbl(device).DestroyAttachmentView(device, attachmentView);
+void vkDestroyImageView(VkDevice device, VkImageView imageView) {
+    GetVtbl(device).DestroyImageView(device, imageView);
 }
 
 __attribute__((visibility("default")))
@@ -382,8 +362,8 @@
 }
 
 __attribute__((visibility("default")))
-VkResult vkDestroyShaderModule(VkDevice device, VkShaderModule shaderModule) {
-    return GetVtbl(device).DestroyShaderModule(device, shaderModule);
+void vkDestroyShaderModule(VkDevice device, VkShaderModule shaderModule) {
+    GetVtbl(device).DestroyShaderModule(device, shaderModule);
 }
 
 __attribute__((visibility("default")))
@@ -392,8 +372,8 @@
 }
 
 __attribute__((visibility("default")))
-VkResult vkDestroyShader(VkDevice device, VkShader shader) {
-    return GetVtbl(device).DestroyShader(device, shader);
+void vkDestroyShader(VkDevice device, VkShader shader) {
+    GetVtbl(device).DestroyShader(device, shader);
 }
 
 __attribute__((visibility("default")))
@@ -402,8 +382,8 @@
 }
 
 __attribute__((visibility("default")))
-VkResult vkDestroyPipelineCache(VkDevice device, VkPipelineCache pipelineCache) {
-    return GetVtbl(device).DestroyPipelineCache(device, pipelineCache);
+void vkDestroyPipelineCache(VkDevice device, VkPipelineCache pipelineCache) {
+    GetVtbl(device).DestroyPipelineCache(device, pipelineCache);
 }
 
 __attribute__((visibility("default")))
@@ -432,8 +412,8 @@
 }
 
 __attribute__((visibility("default")))
-VkResult vkDestroyPipeline(VkDevice device, VkPipeline pipeline) {
-    return GetVtbl(device).DestroyPipeline(device, pipeline);
+void vkDestroyPipeline(VkDevice device, VkPipeline pipeline) {
+    GetVtbl(device).DestroyPipeline(device, pipeline);
 }
 
 __attribute__((visibility("default")))
@@ -442,8 +422,8 @@
 }
 
 __attribute__((visibility("default")))
-VkResult vkDestroyPipelineLayout(VkDevice device, VkPipelineLayout pipelineLayout) {
-    return GetVtbl(device).DestroyPipelineLayout(device, pipelineLayout);
+void vkDestroyPipelineLayout(VkDevice device, VkPipelineLayout pipelineLayout) {
+    GetVtbl(device).DestroyPipelineLayout(device, pipelineLayout);
 }
 
 __attribute__((visibility("default")))
@@ -452,8 +432,8 @@
 }
 
 __attribute__((visibility("default")))
-VkResult vkDestroySampler(VkDevice device, VkSampler sampler) {
-    return GetVtbl(device).DestroySampler(device, sampler);
+void vkDestroySampler(VkDevice device, VkSampler sampler) {
+    GetVtbl(device).DestroySampler(device, sampler);
 }
 
 __attribute__((visibility("default")))
@@ -462,18 +442,18 @@
 }
 
 __attribute__((visibility("default")))
-VkResult vkDestroyDescriptorSetLayout(VkDevice device, VkDescriptorSetLayout descriptorSetLayout) {
-    return GetVtbl(device).DestroyDescriptorSetLayout(device, descriptorSetLayout);
+void vkDestroyDescriptorSetLayout(VkDevice device, VkDescriptorSetLayout descriptorSetLayout) {
+    GetVtbl(device).DestroyDescriptorSetLayout(device, descriptorSetLayout);
 }
 
 __attribute__((visibility("default")))
-VkResult vkCreateDescriptorPool(VkDevice device, VkDescriptorPoolUsage poolUsage, uint32_t maxSets, const VkDescriptorPoolCreateInfo* pCreateInfo, VkDescriptorPool* pDescriptorPool) {
-    return GetVtbl(device).CreateDescriptorPool(device, poolUsage, maxSets, pCreateInfo, pDescriptorPool);
+VkResult vkCreateDescriptorPool(VkDevice device, const VkDescriptorPoolCreateInfo* pCreateInfo, VkDescriptorPool* pDescriptorPool) {
+    return GetVtbl(device).CreateDescriptorPool(device, pCreateInfo, pDescriptorPool);
 }
 
 __attribute__((visibility("default")))
-VkResult vkDestroyDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool) {
-    return GetVtbl(device).DestroyDescriptorPool(device, descriptorPool);
+void vkDestroyDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool) {
+    GetVtbl(device).DestroyDescriptorPool(device, descriptorPool);
 }
 
 __attribute__((visibility("default")))
@@ -482,8 +462,8 @@
 }
 
 __attribute__((visibility("default")))
-VkResult vkAllocDescriptorSets(VkDevice device, VkDescriptorPool descriptorPool, VkDescriptorSetUsage setUsage, uint32_t count, const VkDescriptorSetLayout* pSetLayouts, VkDescriptorSet* pDescriptorSets, uint32_t* pCount) {
-    return GetVtbl(device).AllocDescriptorSets(device, descriptorPool, setUsage, count, pSetLayouts, pDescriptorSets, pCount);
+VkResult vkAllocDescriptorSets(VkDevice device, VkDescriptorPool descriptorPool, VkDescriptorSetUsage setUsage, uint32_t count, const VkDescriptorSetLayout* pSetLayouts, VkDescriptorSet* pDescriptorSets) {
+    return GetVtbl(device).AllocDescriptorSets(device, descriptorPool, setUsage, count, pSetLayouts, pDescriptorSets);
 }
 
 __attribute__((visibility("default")))
@@ -492,48 +472,8 @@
 }
 
 __attribute__((visibility("default")))
-VkResult vkUpdateDescriptorSets(VkDevice device, uint32_t writeCount, const VkWriteDescriptorSet* pDescriptorWrites, uint32_t copyCount, const VkCopyDescriptorSet* pDescriptorCopies) {
-    return GetVtbl(device).UpdateDescriptorSets(device, writeCount, pDescriptorWrites, copyCount, pDescriptorCopies);
-}
-
-__attribute__((visibility("default")))
-VkResult vkCreateDynamicViewportState(VkDevice device, const VkDynamicViewportStateCreateInfo* pCreateInfo, VkDynamicViewportState* pState) {
-    return GetVtbl(device).CreateDynamicViewportState(device, pCreateInfo, pState);
-}
-
-__attribute__((visibility("default")))
-VkResult vkDestroyDynamicViewportState(VkDevice device, VkDynamicViewportState dynamicViewportState) {
-    return GetVtbl(device).DestroyDynamicViewportState(device, dynamicViewportState);
-}
-
-__attribute__((visibility("default")))
-VkResult vkCreateDynamicRasterState(VkDevice device, const VkDynamicRasterStateCreateInfo* pCreateInfo, VkDynamicRasterState* pState) {
-    return GetVtbl(device).CreateDynamicRasterState(device, pCreateInfo, pState);
-}
-
-__attribute__((visibility("default")))
-VkResult vkDestroyDynamicRasterState(VkDevice device, VkDynamicRasterState dynamicRasterState) {
-    return GetVtbl(device).DestroyDynamicRasterState(device, dynamicRasterState);
-}
-
-__attribute__((visibility("default")))
-VkResult vkCreateDynamicColorBlendState(VkDevice device, const VkDynamicColorBlendStateCreateInfo* pCreateInfo, VkDynamicColorBlendState* pState) {
-    return GetVtbl(device).CreateDynamicColorBlendState(device, pCreateInfo, pState);
-}
-
-__attribute__((visibility("default")))
-VkResult vkDestroyDynamicColorBlendState(VkDevice device, VkDynamicColorBlendState dynamicColorBlendState) {
-    return GetVtbl(device).DestroyDynamicColorBlendState(device, dynamicColorBlendState);
-}
-
-__attribute__((visibility("default")))
-VkResult vkCreateDynamicDepthStencilState(VkDevice device, const VkDynamicDepthStencilStateCreateInfo* pCreateInfo, VkDynamicDepthStencilState* pState) {
-    return GetVtbl(device).CreateDynamicDepthStencilState(device, pCreateInfo, pState);
-}
-
-__attribute__((visibility("default")))
-VkResult vkDestroyDynamicDepthStencilState(VkDevice device, VkDynamicDepthStencilState dynamicDepthStencilState) {
-    return GetVtbl(device).DestroyDynamicDepthStencilState(device, dynamicDepthStencilState);
+void vkUpdateDescriptorSets(VkDevice device, uint32_t writeCount, const VkWriteDescriptorSet* pDescriptorWrites, uint32_t copyCount, const VkCopyDescriptorSet* pDescriptorCopies) {
+    GetVtbl(device).UpdateDescriptorSets(device, writeCount, pDescriptorWrites, copyCount, pDescriptorCopies);
 }
 
 __attribute__((visibility("default")))
@@ -542,8 +482,8 @@
 }
 
 __attribute__((visibility("default")))
-VkResult vkDestroyFramebuffer(VkDevice device, VkFramebuffer framebuffer) {
-    return GetVtbl(device).DestroyFramebuffer(device, framebuffer);
+void vkDestroyFramebuffer(VkDevice device, VkFramebuffer framebuffer) {
+    GetVtbl(device).DestroyFramebuffer(device, framebuffer);
 }
 
 __attribute__((visibility("default")))
@@ -552,8 +492,8 @@
 }
 
 __attribute__((visibility("default")))
-VkResult vkDestroyRenderPass(VkDevice device, VkRenderPass renderPass) {
-    return GetVtbl(device).DestroyRenderPass(device, renderPass);
+void vkDestroyRenderPass(VkDevice device, VkRenderPass renderPass) {
+    GetVtbl(device).DestroyRenderPass(device, renderPass);
 }
 
 __attribute__((visibility("default")))
@@ -567,8 +507,8 @@
 }
 
 __attribute__((visibility("default")))
-VkResult vkDestroyCommandPool(VkDevice device, VkCmdPool cmdPool) {
-    return GetVtbl(device).DestroyCommandPool(device, cmdPool);
+void vkDestroyCommandPool(VkDevice device, VkCmdPool cmdPool) {
+    GetVtbl(device).DestroyCommandPool(device, cmdPool);
 }
 
 __attribute__((visibility("default")))
@@ -582,8 +522,8 @@
 }
 
 __attribute__((visibility("default")))
-VkResult vkDestroyCommandBuffer(VkDevice device, VkCmdBuffer commandBuffer) {
-    return GetVtbl(device).DestroyCommandBuffer(device, commandBuffer);
+void vkDestroyCommandBuffer(VkDevice device, VkCmdBuffer commandBuffer) {
+    GetVtbl(device).DestroyCommandBuffer(device, commandBuffer);
 }
 
 __attribute__((visibility("default")))
@@ -607,23 +547,48 @@
 }
 
 __attribute__((visibility("default")))
-void vkCmdBindDynamicViewportState(VkCmdBuffer cmdBuffer, VkDynamicViewportState dynamicViewportState) {
-    GetVtbl(cmdBuffer).CmdBindDynamicViewportState(cmdBuffer, dynamicViewportState);
+void vkCmdSetViewport(VkCmdBuffer cmdBuffer, uint32_t viewportCount, const VkViewport* pViewports) {
+    GetVtbl(cmdBuffer).CmdSetViewport(cmdBuffer, viewportCount, pViewports);
 }
 
 __attribute__((visibility("default")))
-void vkCmdBindDynamicRasterState(VkCmdBuffer cmdBuffer, VkDynamicRasterState dynamicRasterState) {
-    GetVtbl(cmdBuffer).CmdBindDynamicRasterState(cmdBuffer, dynamicRasterState);
+void vkCmdSetScissor(VkCmdBuffer cmdBuffer, uint32_t scissorCount, const VkRect2D* pScissors) {
+    GetVtbl(cmdBuffer).CmdSetScissor(cmdBuffer, scissorCount, pScissors);
 }
 
 __attribute__((visibility("default")))
-void vkCmdBindDynamicColorBlendState(VkCmdBuffer cmdBuffer, VkDynamicColorBlendState dynamicColorBlendState) {
-    GetVtbl(cmdBuffer).CmdBindDynamicColorBlendState(cmdBuffer, dynamicColorBlendState);
+void vkCmdSetLineWidth(VkCmdBuffer cmdBuffer, float lineWidth) {
+    GetVtbl(cmdBuffer).CmdSetLineWidth(cmdBuffer, lineWidth);
 }
 
 __attribute__((visibility("default")))
-void vkCmdBindDynamicDepthStencilState(VkCmdBuffer cmdBuffer, VkDynamicDepthStencilState dynamicDepthStencilState) {
-    GetVtbl(cmdBuffer).CmdBindDynamicDepthStencilState(cmdBuffer, dynamicDepthStencilState);
+void vkCmdSetDepthBias(VkCmdBuffer cmdBuffer, float depthBias, float depthBiasClamp, float slopeScaledDepthBias) {
+    GetVtbl(cmdBuffer).CmdSetDepthBias(cmdBuffer, depthBias, depthBiasClamp, slopeScaledDepthBias);
+}
+
+__attribute__((visibility("default")))
+void vkCmdSetBlendConstants(VkCmdBuffer cmdBuffer, const float blendConst[4]) {
+    GetVtbl(cmdBuffer).CmdSetBlendConstants(cmdBuffer, blendConst);
+}
+
+__attribute__((visibility("default")))
+void vkCmdSetDepthBounds(VkCmdBuffer cmdBuffer, float minDepthBounds, float maxDepthBounds) {
+    GetVtbl(cmdBuffer).CmdSetDepthBounds(cmdBuffer, minDepthBounds, maxDepthBounds);
+}
+
+__attribute__((visibility("default")))
+void vkCmdSetStencilCompareMask(VkCmdBuffer cmdBuffer, VkStencilFaceFlags faceMask, uint32_t stencilCompareMask) {
+    GetVtbl(cmdBuffer).CmdSetStencilCompareMask(cmdBuffer, faceMask, stencilCompareMask);
+}
+
+__attribute__((visibility("default")))
+void vkCmdSetStencilWriteMask(VkCmdBuffer cmdBuffer, VkStencilFaceFlags faceMask, uint32_t stencilWriteMask) {
+    GetVtbl(cmdBuffer).CmdSetStencilWriteMask(cmdBuffer, faceMask, stencilWriteMask);
+}
+
+__attribute__((visibility("default")))
+void vkCmdSetStencilReference(VkCmdBuffer cmdBuffer, VkStencilFaceFlags faceMask, uint32_t stencilReference) {
+    GetVtbl(cmdBuffer).CmdSetStencilReference(cmdBuffer, faceMask, stencilReference);
 }
 
 __attribute__((visibility("default")))
@@ -642,13 +607,13 @@
 }
 
 __attribute__((visibility("default")))
-void vkCmdDraw(VkCmdBuffer cmdBuffer, uint32_t firstVertex, uint32_t vertexCount, uint32_t firstInstance, uint32_t instanceCount) {
-    GetVtbl(cmdBuffer).CmdDraw(cmdBuffer, firstVertex, vertexCount, firstInstance, instanceCount);
+void vkCmdDraw(VkCmdBuffer cmdBuffer, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance) {
+    GetVtbl(cmdBuffer).CmdDraw(cmdBuffer, vertexCount, instanceCount, firstVertex, firstInstance);
 }
 
 __attribute__((visibility("default")))
-void vkCmdDrawIndexed(VkCmdBuffer cmdBuffer, uint32_t firstIndex, uint32_t indexCount, int32_t vertexOffset, uint32_t firstInstance, uint32_t instanceCount) {
-    GetVtbl(cmdBuffer).CmdDrawIndexed(cmdBuffer, firstIndex, indexCount, vertexOffset, firstInstance, instanceCount);
+void vkCmdDrawIndexed(VkCmdBuffer cmdBuffer, uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t vertexOffset, uint32_t firstInstance) {
+    GetVtbl(cmdBuffer).CmdDrawIndexed(cmdBuffer, indexCount, instanceCount, firstIndex, vertexOffset, firstInstance);
 }
 
 __attribute__((visibility("default")))
@@ -712,8 +677,8 @@
 }
 
 __attribute__((visibility("default")))
-void vkCmdClearDepthStencilImage(VkCmdBuffer cmdBuffer, VkImage image, VkImageLayout imageLayout, float depth, uint32_t stencil, uint32_t rangeCount, const VkImageSubresourceRange* pRanges) {
-    GetVtbl(cmdBuffer).CmdClearDepthStencilImage(cmdBuffer, image, imageLayout, depth, stencil, rangeCount, pRanges);
+void vkCmdClearDepthStencilImage(VkCmdBuffer cmdBuffer, VkImage image, VkImageLayout imageLayout, const VkClearDepthStencilValue* pDepthStencil, uint32_t rangeCount, const VkImageSubresourceRange* pRanges) {
+    GetVtbl(cmdBuffer).CmdClearDepthStencilImage(cmdBuffer, image, imageLayout, pDepthStencil, rangeCount, pRanges);
 }
 
 __attribute__((visibility("default")))
@@ -722,8 +687,8 @@
 }
 
 __attribute__((visibility("default")))
-void vkCmdClearDepthStencilAttachment(VkCmdBuffer cmdBuffer, VkImageAspectFlags imageAspectMask, VkImageLayout imageLayout, float depth, uint32_t stencil, uint32_t rectCount, const VkRect3D* pRects) {
-    GetVtbl(cmdBuffer).CmdClearDepthStencilAttachment(cmdBuffer, imageAspectMask, imageLayout, depth, stencil, rectCount, pRects);
+void vkCmdClearDepthStencilAttachment(VkCmdBuffer cmdBuffer, VkImageAspectFlags aspectMask, VkImageLayout imageLayout, const VkClearDepthStencilValue* pDepthStencil, uint32_t rectCount, const VkRect3D* pRects) {
+    GetVtbl(cmdBuffer).CmdClearDepthStencilAttachment(cmdBuffer, aspectMask, imageLayout, pDepthStencil, rectCount, pRects);
 }
 
 __attribute__((visibility("default")))
diff --git a/vulkan/libvulkan/entry.cpp.tmpl b/vulkan/libvulkan/entry.cpp.tmpl
index 4e671e5..72185e7 100644
--- a/vulkan/libvulkan/entry.cpp.tmpl
+++ b/vulkan/libvulkan/entry.cpp.tmpl
@@ -79,52 +79,6 @@
     {{end}}
   {{end}}
 
-{{/* Extension functions aren't in the API file yet, so must be special-cased */}}
-__attribute__((visibility("default")))
-VkResult vkGetPhysicalDeviceSurfaceSupportKHR(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, const VkSurfaceDescriptionKHR* pSurfaceDescription, VkBool32* pSupported) {
-    return GetVtbl(physicalDevice).GetPhysicalDeviceSurfaceSupportKHR(physicalDevice, queueFamilyIndex, pSurfaceDescription, pSupported);
-}

-__attribute__((visibility("default")))
-VkResult vkGetSurfacePropertiesKHR(VkDevice device, const VkSurfaceDescriptionKHR* pSurfaceDescription, VkSurfacePropertiesKHR* pSurfaceProperties) {
-    return GetVtbl(device).GetSurfacePropertiesKHR(device, pSurfaceDescription, pSurfaceProperties);
-}

-__attribute__((visibility("default")))
-VkResult vkGetSurfaceFormatsKHR(VkDevice device, const VkSurfaceDescriptionKHR* pSurfaceDescription, uint32_t* pCount, VkSurfaceFormatKHR* pSurfaceFormats) {
-    return GetVtbl(device).GetSurfaceFormatsKHR(device, pSurfaceDescription, pCount, pSurfaceFormats);
-}

-__attribute__((visibility("default")))
-VkResult vkGetSurfacePresentModesKHR(VkDevice device, const VkSurfaceDescriptionKHR* pSurfaceDescription, uint32_t* pCount, VkPresentModeKHR* pPresentModes) {
-    return GetVtbl(device).GetSurfacePresentModesKHR(device, pSurfaceDescription, pCount, pPresentModes);
-}

-__attribute__((visibility("default")))
-VkResult vkCreateSwapchainKHR(VkDevice device, const VkSwapchainCreateInfoKHR* pCreateInfo, VkSwapchainKHR* pSwapchain) {
-    return GetVtbl(device).CreateSwapchainKHR(device, pCreateInfo, pSwapchain);
-}

-__attribute__((visibility("default")))
-VkResult vkDestroySwapchainKHR(VkDevice device, VkSwapchainKHR swapchain) {
-    return GetVtbl(device).DestroySwapchainKHR(device, swapchain);
-}

-__attribute__((visibility("default")))
-VkResult vkGetSwapchainImagesKHR(VkDevice device, VkSwapchainKHR swapchain, uint32_t* pCount, VkImage* pSwapchainImages) {
-    return GetVtbl(device).GetSwapchainImagesKHR(device, swapchain, pCount, pSwapchainImages);
-}

-__attribute__((visibility("default")))
-VkResult vkAcquireNextImageKHR(VkDevice device, VkSwapchainKHR swapchain, uint64_t timeout, VkSemaphore semaphore, uint32_t* pImageIndex) {
-    return GetVtbl(device).AcquireNextImageKHR(device, swapchain, timeout, semaphore, pImageIndex);
-}

-__attribute__((visibility("default")))
-VkResult vkQueuePresentKHR(VkQueue queue, VkPresentInfoKHR* pPresentInfo) {
-    return GetVtbl(queue).QueuePresentKHR(queue, pPresentInfo);
-}

 {{end}}
 
 
diff --git a/vulkan/libvulkan/get_proc_addr.cpp b/vulkan/libvulkan/get_proc_addr.cpp
index ceb76b9..4f37c9c 100644
--- a/vulkan/libvulkan/get_proc_addr.cpp
+++ b/vulkan/libvulkan/get_proc_addr.cpp
@@ -38,7 +38,7 @@
 };
 
 template <typename TEntry, size_t N>
-const TEntry* FindProcEntry(const TEntry(&table)[N], const char* name) {
+const TEntry* FindProcEntry(const TEntry (&table)[N], const char* name) {
     auto entry = std::lower_bound(
         table, table + N, name,
         [](const TEntry& e, const char* n) { return strcmp(e.name, n) < 0; });
@@ -51,24 +51,24 @@
     // clang-format off
     {"vkCreateDevice", reinterpret_cast<PFN_vkVoidFunction>(vkCreateDevice)},
     {"vkDestroyInstance", reinterpret_cast<PFN_vkVoidFunction>(vkDestroyInstance)},
+    {"vkEnumerateDeviceExtensionProperties", reinterpret_cast<PFN_vkVoidFunction>(vkEnumerateDeviceExtensionProperties)},
+    {"vkEnumerateDeviceLayerProperties", reinterpret_cast<PFN_vkVoidFunction>(vkEnumerateDeviceLayerProperties)},
     {"vkEnumeratePhysicalDevices", reinterpret_cast<PFN_vkVoidFunction>(vkEnumeratePhysicalDevices)},
     {"vkGetInstanceProcAddr", reinterpret_cast<PFN_vkVoidFunction>(vkGetInstanceProcAddr)},
-    {"vkGetPhysicalDeviceExtensionProperties", reinterpret_cast<PFN_vkVoidFunction>(vkGetPhysicalDeviceExtensionProperties)},
     {"vkGetPhysicalDeviceFeatures", reinterpret_cast<PFN_vkVoidFunction>(vkGetPhysicalDeviceFeatures)},
     {"vkGetPhysicalDeviceFormatProperties", reinterpret_cast<PFN_vkVoidFunction>(vkGetPhysicalDeviceFormatProperties)},
     {"vkGetPhysicalDeviceImageFormatProperties", reinterpret_cast<PFN_vkVoidFunction>(vkGetPhysicalDeviceImageFormatProperties)},
-    {"vkGetPhysicalDeviceLayerProperties", reinterpret_cast<PFN_vkVoidFunction>(vkGetPhysicalDeviceLayerProperties)},
-    {"vkGetPhysicalDeviceLimits", reinterpret_cast<PFN_vkVoidFunction>(vkGetPhysicalDeviceLimits)},
     {"vkGetPhysicalDeviceMemoryProperties", reinterpret_cast<PFN_vkVoidFunction>(vkGetPhysicalDeviceMemoryProperties)},
     {"vkGetPhysicalDeviceProperties", reinterpret_cast<PFN_vkVoidFunction>(vkGetPhysicalDeviceProperties)},
-    {"vkGetPhysicalDeviceQueueCount", reinterpret_cast<PFN_vkVoidFunction>(vkGetPhysicalDeviceQueueCount)},
-    {"vkGetPhysicalDeviceQueueProperties", reinterpret_cast<PFN_vkVoidFunction>(vkGetPhysicalDeviceQueueProperties)},
+    {"vkGetPhysicalDeviceQueueFamilyProperties", reinterpret_cast<PFN_vkVoidFunction>(vkGetPhysicalDeviceQueueFamilyProperties)},
     {"vkGetPhysicalDeviceSparseImageFormatProperties", reinterpret_cast<PFN_vkVoidFunction>(vkGetPhysicalDeviceSparseImageFormatProperties)},
+    {"vkGetPhysicalDeviceSurfaceSupportKHR", reinterpret_cast<PFN_vkVoidFunction>(vkGetPhysicalDeviceSurfaceSupportKHR)},
     // clang-format on
 };
 
 const NameProcEntry kDeviceProcTbl[] = {
     // clang-format off
+    {"vkAcquireNextImageKHR", reinterpret_cast<PFN_vkVoidFunction>(vkAcquireNextImageKHR)},
     {"vkAllocDescriptorSets", reinterpret_cast<PFN_vkVoidFunction>(vkAllocDescriptorSets)},
     {"vkAllocMemory", reinterpret_cast<PFN_vkVoidFunction>(vkAllocMemory)},
     {"vkBeginCommandBuffer", reinterpret_cast<PFN_vkVoidFunction>(vkBeginCommandBuffer)},
@@ -77,10 +77,6 @@
     {"vkCmdBeginQuery", reinterpret_cast<PFN_vkVoidFunction>(vkCmdBeginQuery)},
     {"vkCmdBeginRenderPass", reinterpret_cast<PFN_vkVoidFunction>(vkCmdBeginRenderPass)},
     {"vkCmdBindDescriptorSets", reinterpret_cast<PFN_vkVoidFunction>(vkCmdBindDescriptorSets)},
-    {"vkCmdBindDynamicColorBlendState", reinterpret_cast<PFN_vkVoidFunction>(vkCmdBindDynamicColorBlendState)},
-    {"vkCmdBindDynamicDepthStencilState", reinterpret_cast<PFN_vkVoidFunction>(vkCmdBindDynamicDepthStencilState)},
-    {"vkCmdBindDynamicRasterState", reinterpret_cast<PFN_vkVoidFunction>(vkCmdBindDynamicRasterState)},
-    {"vkCmdBindDynamicViewportState", reinterpret_cast<PFN_vkVoidFunction>(vkCmdBindDynamicViewportState)},
     {"vkCmdBindIndexBuffer", reinterpret_cast<PFN_vkVoidFunction>(vkCmdBindIndexBuffer)},
     {"vkCmdBindPipeline", reinterpret_cast<PFN_vkVoidFunction>(vkCmdBindPipeline)},
     {"vkCmdBindVertexBuffers", reinterpret_cast<PFN_vkVoidFunction>(vkCmdBindVertexBuffers)},
@@ -110,11 +106,19 @@
     {"vkCmdResetEvent", reinterpret_cast<PFN_vkVoidFunction>(vkCmdResetEvent)},
     {"vkCmdResetQueryPool", reinterpret_cast<PFN_vkVoidFunction>(vkCmdResetQueryPool)},
     {"vkCmdResolveImage", reinterpret_cast<PFN_vkVoidFunction>(vkCmdResolveImage)},
+    {"vkCmdSetBlendConstants", reinterpret_cast<PFN_vkVoidFunction>(vkCmdSetBlendConstants)},
+    {"vkCmdSetDepthBias", reinterpret_cast<PFN_vkVoidFunction>(vkCmdSetDepthBias)},
+    {"vkCmdSetDepthBounds", reinterpret_cast<PFN_vkVoidFunction>(vkCmdSetDepthBounds)},
     {"vkCmdSetEvent", reinterpret_cast<PFN_vkVoidFunction>(vkCmdSetEvent)},
+    {"vkCmdSetLineWidth", reinterpret_cast<PFN_vkVoidFunction>(vkCmdSetLineWidth)},
+    {"vkCmdSetScissor", reinterpret_cast<PFN_vkVoidFunction>(vkCmdSetScissor)},
+    {"vkCmdSetStencilCompareMask", reinterpret_cast<PFN_vkVoidFunction>(vkCmdSetStencilCompareMask)},
+    {"vkCmdSetStencilReference", reinterpret_cast<PFN_vkVoidFunction>(vkCmdSetStencilReference)},
+    {"vkCmdSetStencilWriteMask", reinterpret_cast<PFN_vkVoidFunction>(vkCmdSetStencilWriteMask)},
+    {"vkCmdSetViewport", reinterpret_cast<PFN_vkVoidFunction>(vkCmdSetViewport)},
     {"vkCmdUpdateBuffer", reinterpret_cast<PFN_vkVoidFunction>(vkCmdUpdateBuffer)},
     {"vkCmdWaitEvents", reinterpret_cast<PFN_vkVoidFunction>(vkCmdWaitEvents)},
     {"vkCmdWriteTimestamp", reinterpret_cast<PFN_vkVoidFunction>(vkCmdWriteTimestamp)},
-    {"vkCreateAttachmentView", reinterpret_cast<PFN_vkVoidFunction>(vkCreateAttachmentView)},
     {"vkCreateBuffer", reinterpret_cast<PFN_vkVoidFunction>(vkCreateBuffer)},
     {"vkCreateBufferView", reinterpret_cast<PFN_vkVoidFunction>(vkCreateBufferView)},
     {"vkCreateCommandBuffer", reinterpret_cast<PFN_vkVoidFunction>(vkCreateCommandBuffer)},
@@ -122,10 +126,6 @@
     {"vkCreateComputePipelines", reinterpret_cast<PFN_vkVoidFunction>(vkCreateComputePipelines)},
     {"vkCreateDescriptorPool", reinterpret_cast<PFN_vkVoidFunction>(vkCreateDescriptorPool)},
     {"vkCreateDescriptorSetLayout", reinterpret_cast<PFN_vkVoidFunction>(vkCreateDescriptorSetLayout)},
-    {"vkCreateDynamicColorBlendState", reinterpret_cast<PFN_vkVoidFunction>(vkCreateDynamicColorBlendState)},
-    {"vkCreateDynamicDepthStencilState", reinterpret_cast<PFN_vkVoidFunction>(vkCreateDynamicDepthStencilState)},
-    {"vkCreateDynamicRasterState", reinterpret_cast<PFN_vkVoidFunction>(vkCreateDynamicRasterState)},
-    {"vkCreateDynamicViewportState", reinterpret_cast<PFN_vkVoidFunction>(vkCreateDynamicViewportState)},
     {"vkCreateEvent", reinterpret_cast<PFN_vkVoidFunction>(vkCreateEvent)},
     {"vkCreateFence", reinterpret_cast<PFN_vkVoidFunction>(vkCreateFence)},
     {"vkCreateFramebuffer", reinterpret_cast<PFN_vkVoidFunction>(vkCreateFramebuffer)},
@@ -140,7 +140,7 @@
     {"vkCreateSemaphore", reinterpret_cast<PFN_vkVoidFunction>(vkCreateSemaphore)},
     {"vkCreateShader", reinterpret_cast<PFN_vkVoidFunction>(vkCreateShader)},
     {"vkCreateShaderModule", reinterpret_cast<PFN_vkVoidFunction>(vkCreateShaderModule)},
-    {"vkDestroyAttachmentView", reinterpret_cast<PFN_vkVoidFunction>(vkDestroyAttachmentView)},
+    {"vkCreateSwapchainKHR", reinterpret_cast<PFN_vkVoidFunction>(vkCreateSwapchainKHR)},
     {"vkDestroyBuffer", reinterpret_cast<PFN_vkVoidFunction>(vkDestroyBuffer)},
     {"vkDestroyBufferView", reinterpret_cast<PFN_vkVoidFunction>(vkDestroyBufferView)},
     {"vkDestroyCommandBuffer", reinterpret_cast<PFN_vkVoidFunction>(vkDestroyCommandBuffer)},
@@ -148,10 +148,6 @@
     {"vkDestroyDescriptorPool", reinterpret_cast<PFN_vkVoidFunction>(vkDestroyDescriptorPool)},
     {"vkDestroyDescriptorSetLayout", reinterpret_cast<PFN_vkVoidFunction>(vkDestroyDescriptorSetLayout)},
     {"vkDestroyDevice", reinterpret_cast<PFN_vkVoidFunction>(vkDestroyDevice)},
-    {"vkDestroyDynamicColorBlendState", reinterpret_cast<PFN_vkVoidFunction>(vkDestroyDynamicColorBlendState)},
-    {"vkDestroyDynamicDepthStencilState", reinterpret_cast<PFN_vkVoidFunction>(vkDestroyDynamicDepthStencilState)},
-    {"vkDestroyDynamicRasterState", reinterpret_cast<PFN_vkVoidFunction>(vkDestroyDynamicRasterState)},
-    {"vkDestroyDynamicViewportState", reinterpret_cast<PFN_vkVoidFunction>(vkDestroyDynamicViewportState)},
     {"vkDestroyEvent", reinterpret_cast<PFN_vkVoidFunction>(vkDestroyEvent)},
     {"vkDestroyFence", reinterpret_cast<PFN_vkVoidFunction>(vkDestroyFence)},
     {"vkDestroyFramebuffer", reinterpret_cast<PFN_vkVoidFunction>(vkDestroyFramebuffer)},
@@ -166,6 +162,7 @@
     {"vkDestroySemaphore", reinterpret_cast<PFN_vkVoidFunction>(vkDestroySemaphore)},
     {"vkDestroyShader", reinterpret_cast<PFN_vkVoidFunction>(vkDestroyShader)},
     {"vkDestroyShaderModule", reinterpret_cast<PFN_vkVoidFunction>(vkDestroyShaderModule)},
+    {"vkDestroySwapchainKHR", reinterpret_cast<PFN_vkVoidFunction>(vkDestroySwapchainKHR)},
     {"vkDeviceWaitIdle", reinterpret_cast<PFN_vkVoidFunction>(vkDeviceWaitIdle)},
     {"vkEndCommandBuffer", reinterpret_cast<PFN_vkVoidFunction>(vkEndCommandBuffer)},
     {"vkFlushMappedMemoryRanges", reinterpret_cast<PFN_vkVoidFunction>(vkFlushMappedMemoryRanges)},
@@ -184,12 +181,17 @@
     {"vkGetPipelineCacheSize", reinterpret_cast<PFN_vkVoidFunction>(vkGetPipelineCacheSize)},
     {"vkGetQueryPoolResults", reinterpret_cast<PFN_vkVoidFunction>(vkGetQueryPoolResults)},
     {"vkGetRenderAreaGranularity", reinterpret_cast<PFN_vkVoidFunction>(vkGetRenderAreaGranularity)},
+    {"vkGetSurfaceFormatsKHR", reinterpret_cast<PFN_vkVoidFunction>(vkGetSurfaceFormatsKHR)},
+    {"vkGetSurfacePresentModesKHR", reinterpret_cast<PFN_vkVoidFunction>(vkGetSurfacePresentModesKHR)},
+    {"vkGetSurfacePropertiesKHR", reinterpret_cast<PFN_vkVoidFunction>(vkGetSurfacePropertiesKHR)},
+    {"vkGetSwapchainImagesKHR", reinterpret_cast<PFN_vkVoidFunction>(vkGetSwapchainImagesKHR)},
     {"vkInvalidateMappedMemoryRanges", reinterpret_cast<PFN_vkVoidFunction>(vkInvalidateMappedMemoryRanges)},
     {"vkMapMemory", reinterpret_cast<PFN_vkVoidFunction>(vkMapMemory)},
     {"vkMergePipelineCaches", reinterpret_cast<PFN_vkVoidFunction>(vkMergePipelineCaches)},
     {"vkQueueBindSparseBufferMemory", reinterpret_cast<PFN_vkVoidFunction>(vkQueueBindSparseBufferMemory)},
     {"vkQueueBindSparseImageMemory", reinterpret_cast<PFN_vkVoidFunction>(vkQueueBindSparseImageMemory)},
     {"vkQueueBindSparseImageOpaqueMemory", reinterpret_cast<PFN_vkVoidFunction>(vkQueueBindSparseImageOpaqueMemory)},
+    {"vkQueuePresentKHR", reinterpret_cast<PFN_vkVoidFunction>(vkQueuePresentKHR)},
     {"vkQueueSignalSemaphore", reinterpret_cast<PFN_vkVoidFunction>(vkQueueSignalSemaphore)},
     {"vkQueueSubmit", reinterpret_cast<PFN_vkVoidFunction>(vkQueueSubmit)},
     {"vkQueueWaitIdle", reinterpret_cast<PFN_vkVoidFunction>(vkQueueWaitIdle)},
@@ -210,24 +212,24 @@
     // clang-format off
     {"vkCreateDevice", offsetof(InstanceVtbl, CreateDevice)},
     {"vkDestroyInstance", offsetof(InstanceVtbl, DestroyInstance)},
+    {"vkEnumerateDeviceExtensionProperties", offsetof(InstanceVtbl, EnumerateDeviceExtensionProperties)},
+    {"vkEnumerateDeviceLayerProperties", offsetof(InstanceVtbl, EnumerateDeviceLayerProperties)},
     {"vkEnumeratePhysicalDevices", offsetof(InstanceVtbl, EnumeratePhysicalDevices)},
     {"vkGetInstanceProcAddr", offsetof(InstanceVtbl, GetInstanceProcAddr)},
-    {"vkGetPhysicalDeviceExtensionProperties", offsetof(InstanceVtbl, GetPhysicalDeviceExtensionProperties)},
     {"vkGetPhysicalDeviceFeatures", offsetof(InstanceVtbl, GetPhysicalDeviceFeatures)},
     {"vkGetPhysicalDeviceFormatProperties", offsetof(InstanceVtbl, GetPhysicalDeviceFormatProperties)},
     {"vkGetPhysicalDeviceImageFormatProperties", offsetof(InstanceVtbl, GetPhysicalDeviceImageFormatProperties)},
-    {"vkGetPhysicalDeviceLayerProperties", offsetof(InstanceVtbl, GetPhysicalDeviceLayerProperties)},
-    {"vkGetPhysicalDeviceLimits", offsetof(InstanceVtbl, GetPhysicalDeviceLimits)},
     {"vkGetPhysicalDeviceMemoryProperties", offsetof(InstanceVtbl, GetPhysicalDeviceMemoryProperties)},
     {"vkGetPhysicalDeviceProperties", offsetof(InstanceVtbl, GetPhysicalDeviceProperties)},
-    {"vkGetPhysicalDeviceQueueCount", offsetof(InstanceVtbl, GetPhysicalDeviceQueueCount)},
-    {"vkGetPhysicalDeviceQueueProperties", offsetof(InstanceVtbl, GetPhysicalDeviceQueueProperties)},
+    {"vkGetPhysicalDeviceQueueFamilyProperties", offsetof(InstanceVtbl, GetPhysicalDeviceQueueFamilyProperties)},
     {"vkGetPhysicalDeviceSparseImageFormatProperties", offsetof(InstanceVtbl, GetPhysicalDeviceSparseImageFormatProperties)},
+    {"vkGetPhysicalDeviceSurfaceSupportKHR", offsetof(InstanceVtbl, GetPhysicalDeviceSurfaceSupportKHR)},
     // clang-format on
 };
 
 const NameOffsetEntry kDeviceOffsetTbl[] = {
     // clang-format off
+    {"vkAcquireNextImageKHR", offsetof(DeviceVtbl, AcquireNextImageKHR)},
     {"vkAllocDescriptorSets", offsetof(DeviceVtbl, AllocDescriptorSets)},
     {"vkAllocMemory", offsetof(DeviceVtbl, AllocMemory)},
     {"vkBeginCommandBuffer", offsetof(DeviceVtbl, BeginCommandBuffer)},
@@ -236,10 +238,6 @@
     {"vkCmdBeginQuery", offsetof(DeviceVtbl, CmdBeginQuery)},
     {"vkCmdBeginRenderPass", offsetof(DeviceVtbl, CmdBeginRenderPass)},
     {"vkCmdBindDescriptorSets", offsetof(DeviceVtbl, CmdBindDescriptorSets)},
-    {"vkCmdBindDynamicColorBlendState", offsetof(DeviceVtbl, CmdBindDynamicColorBlendState)},
-    {"vkCmdBindDynamicDepthStencilState", offsetof(DeviceVtbl, CmdBindDynamicDepthStencilState)},
-    {"vkCmdBindDynamicRasterState", offsetof(DeviceVtbl, CmdBindDynamicRasterState)},
-    {"vkCmdBindDynamicViewportState", offsetof(DeviceVtbl, CmdBindDynamicViewportState)},
     {"vkCmdBindIndexBuffer", offsetof(DeviceVtbl, CmdBindIndexBuffer)},
     {"vkCmdBindPipeline", offsetof(DeviceVtbl, CmdBindPipeline)},
     {"vkCmdBindVertexBuffers", offsetof(DeviceVtbl, CmdBindVertexBuffers)},
@@ -269,11 +267,19 @@
     {"vkCmdResetEvent", offsetof(DeviceVtbl, CmdResetEvent)},
     {"vkCmdResetQueryPool", offsetof(DeviceVtbl, CmdResetQueryPool)},
     {"vkCmdResolveImage", offsetof(DeviceVtbl, CmdResolveImage)},
+    {"vkCmdSetBlendConstants", offsetof(DeviceVtbl, CmdSetBlendConstants)},
+    {"vkCmdSetDepthBias", offsetof(DeviceVtbl, CmdSetDepthBias)},
+    {"vkCmdSetDepthBounds", offsetof(DeviceVtbl, CmdSetDepthBounds)},
     {"vkCmdSetEvent", offsetof(DeviceVtbl, CmdSetEvent)},
+    {"vkCmdSetLineWidth", offsetof(DeviceVtbl, CmdSetLineWidth)},
+    {"vkCmdSetScissor", offsetof(DeviceVtbl, CmdSetScissor)},
+    {"vkCmdSetStencilCompareMask", offsetof(DeviceVtbl, CmdSetStencilCompareMask)},
+    {"vkCmdSetStencilReference", offsetof(DeviceVtbl, CmdSetStencilReference)},
+    {"vkCmdSetStencilWriteMask", offsetof(DeviceVtbl, CmdSetStencilWriteMask)},
+    {"vkCmdSetViewport", offsetof(DeviceVtbl, CmdSetViewport)},
     {"vkCmdUpdateBuffer", offsetof(DeviceVtbl, CmdUpdateBuffer)},
     {"vkCmdWaitEvents", offsetof(DeviceVtbl, CmdWaitEvents)},
     {"vkCmdWriteTimestamp", offsetof(DeviceVtbl, CmdWriteTimestamp)},
-    {"vkCreateAttachmentView", offsetof(DeviceVtbl, CreateAttachmentView)},
     {"vkCreateBuffer", offsetof(DeviceVtbl, CreateBuffer)},
     {"vkCreateBufferView", offsetof(DeviceVtbl, CreateBufferView)},
     {"vkCreateCommandBuffer", offsetof(DeviceVtbl, CreateCommandBuffer)},
@@ -281,10 +287,6 @@
     {"vkCreateComputePipelines", offsetof(DeviceVtbl, CreateComputePipelines)},
     {"vkCreateDescriptorPool", offsetof(DeviceVtbl, CreateDescriptorPool)},
     {"vkCreateDescriptorSetLayout", offsetof(DeviceVtbl, CreateDescriptorSetLayout)},
-    {"vkCreateDynamicColorBlendState", offsetof(DeviceVtbl, CreateDynamicColorBlendState)},
-    {"vkCreateDynamicDepthStencilState", offsetof(DeviceVtbl, CreateDynamicDepthStencilState)},
-    {"vkCreateDynamicRasterState", offsetof(DeviceVtbl, CreateDynamicRasterState)},
-    {"vkCreateDynamicViewportState", offsetof(DeviceVtbl, CreateDynamicViewportState)},
     {"vkCreateEvent", offsetof(DeviceVtbl, CreateEvent)},
     {"vkCreateFence", offsetof(DeviceVtbl, CreateFence)},
     {"vkCreateFramebuffer", offsetof(DeviceVtbl, CreateFramebuffer)},
@@ -299,7 +301,7 @@
     {"vkCreateSemaphore", offsetof(DeviceVtbl, CreateSemaphore)},
     {"vkCreateShader", offsetof(DeviceVtbl, CreateShader)},
     {"vkCreateShaderModule", offsetof(DeviceVtbl, CreateShaderModule)},
-    {"vkDestroyAttachmentView", offsetof(DeviceVtbl, DestroyAttachmentView)},
+    {"vkCreateSwapchainKHR", offsetof(DeviceVtbl, CreateSwapchainKHR)},
     {"vkDestroyBuffer", offsetof(DeviceVtbl, DestroyBuffer)},
     {"vkDestroyBufferView", offsetof(DeviceVtbl, DestroyBufferView)},
     {"vkDestroyCommandBuffer", offsetof(DeviceVtbl, DestroyCommandBuffer)},
@@ -307,10 +309,6 @@
     {"vkDestroyDescriptorPool", offsetof(DeviceVtbl, DestroyDescriptorPool)},
     {"vkDestroyDescriptorSetLayout", offsetof(DeviceVtbl, DestroyDescriptorSetLayout)},
     {"vkDestroyDevice", offsetof(DeviceVtbl, DestroyDevice)},
-    {"vkDestroyDynamicColorBlendState", offsetof(DeviceVtbl, DestroyDynamicColorBlendState)},
-    {"vkDestroyDynamicDepthStencilState", offsetof(DeviceVtbl, DestroyDynamicDepthStencilState)},
-    {"vkDestroyDynamicRasterState", offsetof(DeviceVtbl, DestroyDynamicRasterState)},
-    {"vkDestroyDynamicViewportState", offsetof(DeviceVtbl, DestroyDynamicViewportState)},
     {"vkDestroyEvent", offsetof(DeviceVtbl, DestroyEvent)},
     {"vkDestroyFence", offsetof(DeviceVtbl, DestroyFence)},
     {"vkDestroyFramebuffer", offsetof(DeviceVtbl, DestroyFramebuffer)},
@@ -325,6 +323,7 @@
     {"vkDestroySemaphore", offsetof(DeviceVtbl, DestroySemaphore)},
     {"vkDestroyShader", offsetof(DeviceVtbl, DestroyShader)},
     {"vkDestroyShaderModule", offsetof(DeviceVtbl, DestroyShaderModule)},
+    {"vkDestroySwapchainKHR", offsetof(DeviceVtbl, DestroySwapchainKHR)},
     {"vkDeviceWaitIdle", offsetof(DeviceVtbl, DeviceWaitIdle)},
     {"vkEndCommandBuffer", offsetof(DeviceVtbl, EndCommandBuffer)},
     {"vkFlushMappedMemoryRanges", offsetof(DeviceVtbl, FlushMappedMemoryRanges)},
@@ -343,12 +342,17 @@
     {"vkGetPipelineCacheSize", offsetof(DeviceVtbl, GetPipelineCacheSize)},
     {"vkGetQueryPoolResults", offsetof(DeviceVtbl, GetQueryPoolResults)},
     {"vkGetRenderAreaGranularity", offsetof(DeviceVtbl, GetRenderAreaGranularity)},
+    {"vkGetSurfaceFormatsKHR", offsetof(DeviceVtbl, GetSurfaceFormatsKHR)},
+    {"vkGetSurfacePresentModesKHR", offsetof(DeviceVtbl, GetSurfacePresentModesKHR)},
+    {"vkGetSurfacePropertiesKHR", offsetof(DeviceVtbl, GetSurfacePropertiesKHR)},
+    {"vkGetSwapchainImagesKHR", offsetof(DeviceVtbl, GetSwapchainImagesKHR)},
     {"vkInvalidateMappedMemoryRanges", offsetof(DeviceVtbl, InvalidateMappedMemoryRanges)},
     {"vkMapMemory", offsetof(DeviceVtbl, MapMemory)},
     {"vkMergePipelineCaches", offsetof(DeviceVtbl, MergePipelineCaches)},
     {"vkQueueBindSparseBufferMemory", offsetof(DeviceVtbl, QueueBindSparseBufferMemory)},
     {"vkQueueBindSparseImageMemory", offsetof(DeviceVtbl, QueueBindSparseImageMemory)},
     {"vkQueueBindSparseImageOpaqueMemory", offsetof(DeviceVtbl, QueueBindSparseImageOpaqueMemory)},
+    {"vkQueuePresentKHR", offsetof(DeviceVtbl, QueuePresentKHR)},
     {"vkQueueSignalSemaphore", offsetof(DeviceVtbl, QueueSignalSemaphore)},
     {"vkQueueSubmit", offsetof(DeviceVtbl, QueueSubmit)},
     {"vkQueueWaitIdle", offsetof(DeviceVtbl, QueueWaitIdle)},
@@ -377,10 +381,6 @@
     // bootstrapping
     if (strcmp(name, "vkGetDeviceProcAddr") == 0)
         return reinterpret_cast<PFN_vkVoidFunction>(vkGetDeviceProcAddr);
-    // special-case extension functions until they can be auto-generated
-    if (strcmp(name, "vkGetPhysicalDeviceSurfaceSupportKHR") == 0)
-        return reinterpret_cast<PFN_vkVoidFunction>(
-            vkGetPhysicalDeviceSurfaceSupportKHR);
     return nullptr;
 }
 
@@ -388,24 +388,6 @@
     const NameProcEntry* entry = FindProcEntry(kDeviceProcTbl, name);
     if (entry)
         return entry->proc;
-    // special-case extension functions until they can be auto-generated
-    if (strcmp(name, "vkGetSurfacePropertiesKHR") == 0)
-        return reinterpret_cast<PFN_vkVoidFunction>(vkGetSurfacePropertiesKHR);
-    if (strcmp(name, "vkGetSurfaceFormatsKHR") == 0)
-        return reinterpret_cast<PFN_vkVoidFunction>(vkGetSurfaceFormatsKHR);
-    if (strcmp(name, "vkGetSurfacePresentModesKHR") == 0)
-        return reinterpret_cast<PFN_vkVoidFunction>(
-            vkGetSurfacePresentModesKHR);
-    if (strcmp(name, "vkCreateSwapchainKHR") == 0)
-        return reinterpret_cast<PFN_vkVoidFunction>(vkCreateSwapchainKHR);
-    if (strcmp(name, "vkDestroySwapchainKHR") == 0)
-        return reinterpret_cast<PFN_vkVoidFunction>(vkDestroySwapchainKHR);
-    if (strcmp(name, "vkGetSwapchainImagesKHR") == 0)
-        return reinterpret_cast<PFN_vkVoidFunction>(vkGetSwapchainImagesKHR);
-    if (strcmp(name, "vkAcquireNextImageKHR") == 0)
-        return reinterpret_cast<PFN_vkVoidFunction>(vkAcquireNextImageKHR);
-    if (strcmp(name, "vkQueuePresentKHR") == 0)
-        return reinterpret_cast<PFN_vkVoidFunction>(vkQueuePresentKHR);
     return nullptr;
 }
 
@@ -415,13 +397,11 @@
     const NameOffsetEntry* entry = FindProcEntry(kInstanceOffsetTbl, name);
     if (entry)
         offset = entry->offset;
-    else if (strcmp(name, "vkGetPhysicalDeviceSurfaceSupportKHR") == 0)
-        offset = offsetof(InstanceVtbl, GetPhysicalDeviceSurfaceSupportKHR);
     else
         return nullptr;
     const unsigned char* base = reinterpret_cast<const unsigned char*>(vtbl);
     return *reinterpret_cast<PFN_vkVoidFunction*>(
-        const_cast<unsigned char*>(base) + entry->offset);
+        const_cast<unsigned char*>(base) + offset);
 }
 
 PFN_vkVoidFunction GetSpecificDeviceProcAddr(const DeviceVtbl* vtbl,
@@ -430,30 +410,13 @@
     const NameOffsetEntry* entry = FindProcEntry(kDeviceOffsetTbl, name);
     if (entry)
         offset = entry->offset;
-    else if (strcmp(name, "vkGetSurfacePropertiesKHR") == 0)
-        offset = offsetof(DeviceVtbl, GetSurfacePropertiesKHR);
-    else if (strcmp(name, "vkGetSurfaceFormatsKHR") == 0)
-        offset = offsetof(DeviceVtbl, GetSurfaceFormatsKHR);
-    else if (strcmp(name, "vkGetSurfacePresentModesKHR") == 0)
-        offset = offsetof(DeviceVtbl, GetSurfacePresentModesKHR);
-    else if (strcmp(name, "vkCreateSwapchainKHR") == 0)
-        offset = offsetof(DeviceVtbl, CreateSwapchainKHR);
-    else if (strcmp(name, "vkDestroySwapchainKHR") == 0)
-        offset = offsetof(DeviceVtbl, DestroySwapchainKHR);
-    else if (strcmp(name, "vkGetSwapchainImagesKHR") == 0)
-        offset = offsetof(DeviceVtbl, GetSwapchainImagesKHR);
-    else if (strcmp(name, "vkAcquireNextImageKHR") == 0)
-        offset = offsetof(DeviceVtbl, AcquireNextImageKHR);
-    else if (strcmp(name, "vkQueuePresentKHR") == 0)
-        offset = offsetof(DeviceVtbl, QueuePresentKHR);
     else
         return nullptr;
     const unsigned char* base = reinterpret_cast<const unsigned char*>(vtbl);
     return *reinterpret_cast<PFN_vkVoidFunction*>(
-        const_cast<unsigned char*>(base) + entry->offset);
+        const_cast<unsigned char*>(base) + offset);
 }
 
-// TODO: remove need for instance_next
 bool LoadInstanceVtbl(VkInstance instance,
                       VkInstance instance_next,
                       PFN_vkGetInstanceProcAddr get_proc_addr,
@@ -484,14 +447,9 @@
         ALOGE("missing instance proc: %s", "vkGetPhysicalDeviceProperties");
         success = false;
     }
-    vtbl.GetPhysicalDeviceQueueCount = reinterpret_cast<PFN_vkGetPhysicalDeviceQueueCount>(get_proc_addr(instance, "vkGetPhysicalDeviceQueueCount"));
-    if (UNLIKELY(!vtbl.GetPhysicalDeviceQueueCount)) {
-        ALOGE("missing instance proc: %s", "vkGetPhysicalDeviceQueueCount");
-        success = false;
-    }
-    vtbl.GetPhysicalDeviceQueueProperties = reinterpret_cast<PFN_vkGetPhysicalDeviceQueueProperties>(get_proc_addr(instance, "vkGetPhysicalDeviceQueueProperties"));
-    if (UNLIKELY(!vtbl.GetPhysicalDeviceQueueProperties)) {
-        ALOGE("missing instance proc: %s", "vkGetPhysicalDeviceQueueProperties");
+    vtbl.GetPhysicalDeviceQueueFamilyProperties = reinterpret_cast<PFN_vkGetPhysicalDeviceQueueFamilyProperties>(get_proc_addr(instance, "vkGetPhysicalDeviceQueueFamilyProperties"));
+    if (UNLIKELY(!vtbl.GetPhysicalDeviceQueueFamilyProperties)) {
+        ALOGE("missing instance proc: %s", "vkGetPhysicalDeviceQueueFamilyProperties");
         success = false;
     }
     vtbl.GetPhysicalDeviceMemoryProperties = reinterpret_cast<PFN_vkGetPhysicalDeviceMemoryProperties>(get_proc_addr(instance, "vkGetPhysicalDeviceMemoryProperties"));
@@ -514,24 +472,19 @@
         ALOGE("missing instance proc: %s", "vkGetPhysicalDeviceImageFormatProperties");
         success = false;
     }
-    vtbl.GetPhysicalDeviceLimits = reinterpret_cast<PFN_vkGetPhysicalDeviceLimits>(get_proc_addr(instance, "vkGetPhysicalDeviceLimits"));
-    if (UNLIKELY(!vtbl.GetPhysicalDeviceLimits)) {
-        ALOGE("missing instance proc: %s", "vkGetPhysicalDeviceLimits");
-        success = false;
-    }
     vtbl.CreateDevice = reinterpret_cast<PFN_vkCreateDevice>(get_proc_addr(instance, "vkCreateDevice"));
     if (UNLIKELY(!vtbl.CreateDevice)) {
         ALOGE("missing instance proc: %s", "vkCreateDevice");
         success = false;
     }
-    vtbl.GetPhysicalDeviceLayerProperties = reinterpret_cast<PFN_vkGetPhysicalDeviceLayerProperties>(get_proc_addr(instance, "vkGetPhysicalDeviceLayerProperties"));
-    if (UNLIKELY(!vtbl.GetPhysicalDeviceLayerProperties)) {
-        ALOGE("missing instance proc: %s", "vkGetPhysicalDeviceLayerProperties");
+    vtbl.EnumerateDeviceLayerProperties = reinterpret_cast<PFN_vkEnumerateDeviceLayerProperties>(get_proc_addr(instance, "vkEnumerateDeviceLayerProperties"));
+    if (UNLIKELY(!vtbl.EnumerateDeviceLayerProperties)) {
+        ALOGE("missing instance proc: %s", "vkEnumerateDeviceLayerProperties");
         success = false;
     }
-    vtbl.GetPhysicalDeviceExtensionProperties = reinterpret_cast<PFN_vkGetPhysicalDeviceExtensionProperties>(get_proc_addr(instance, "vkGetPhysicalDeviceExtensionProperties"));
-    if (UNLIKELY(!vtbl.GetPhysicalDeviceExtensionProperties)) {
-        ALOGE("missing instance proc: %s", "vkGetPhysicalDeviceExtensionProperties");
+    vtbl.EnumerateDeviceExtensionProperties = reinterpret_cast<PFN_vkEnumerateDeviceExtensionProperties>(get_proc_addr(instance, "vkEnumerateDeviceExtensionProperties"));
+    if (UNLIKELY(!vtbl.EnumerateDeviceExtensionProperties)) {
+        ALOGE("missing instance proc: %s", "vkEnumerateDeviceExtensionProperties");
         success = false;
     }
     vtbl.GetPhysicalDeviceSparseImageFormatProperties = reinterpret_cast<PFN_vkGetPhysicalDeviceSparseImageFormatProperties>(get_proc_addr(instance, "vkGetPhysicalDeviceSparseImageFormatProperties"));
@@ -539,6 +492,7 @@
         ALOGE("missing instance proc: %s", "vkGetPhysicalDeviceSparseImageFormatProperties");
         success = false;
     }
+    vtbl.GetPhysicalDeviceSurfaceSupportKHR = reinterpret_cast<PFN_vkGetPhysicalDeviceSurfaceSupportKHR>(get_proc_addr(instance, "vkGetPhysicalDeviceSurfaceSupportKHR"));
     // clang-format on
     return success;
 }
@@ -784,16 +738,6 @@
         ALOGE("missing device proc: %s", "vkDestroyImageView");
         success = false;
     }
-    vtbl.CreateAttachmentView = reinterpret_cast<PFN_vkCreateAttachmentView>(get_proc_addr(device, "vkCreateAttachmentView"));
-    if (UNLIKELY(!vtbl.CreateAttachmentView)) {
-        ALOGE("missing device proc: %s", "vkCreateAttachmentView");
-        success = false;
-    }
-    vtbl.DestroyAttachmentView = reinterpret_cast<PFN_vkDestroyAttachmentView>(get_proc_addr(device, "vkDestroyAttachmentView"));
-    if (UNLIKELY(!vtbl.DestroyAttachmentView)) {
-        ALOGE("missing device proc: %s", "vkDestroyAttachmentView");
-        success = false;
-    }
     vtbl.CreateShaderModule = reinterpret_cast<PFN_vkCreateShaderModule>(get_proc_addr(device, "vkCreateShaderModule"));
     if (UNLIKELY(!vtbl.CreateShaderModule)) {
         ALOGE("missing device proc: %s", "vkCreateShaderModule");
@@ -914,46 +858,6 @@
         ALOGE("missing device proc: %s", "vkUpdateDescriptorSets");
         success = false;
     }
-    vtbl.CreateDynamicViewportState = reinterpret_cast<PFN_vkCreateDynamicViewportState>(get_proc_addr(device, "vkCreateDynamicViewportState"));
-    if (UNLIKELY(!vtbl.CreateDynamicViewportState)) {
-        ALOGE("missing device proc: %s", "vkCreateDynamicViewportState");
-        success = false;
-    }
-    vtbl.DestroyDynamicViewportState = reinterpret_cast<PFN_vkDestroyDynamicViewportState>(get_proc_addr(device, "vkDestroyDynamicViewportState"));
-    if (UNLIKELY(!vtbl.DestroyDynamicViewportState)) {
-        ALOGE("missing device proc: %s", "vkDestroyDynamicViewportState");
-        success = false;
-    }
-    vtbl.CreateDynamicRasterState = reinterpret_cast<PFN_vkCreateDynamicRasterState>(get_proc_addr(device, "vkCreateDynamicRasterState"));
-    if (UNLIKELY(!vtbl.CreateDynamicRasterState)) {
-        ALOGE("missing device proc: %s", "vkCreateDynamicRasterState");
-        success = false;
-    }
-    vtbl.DestroyDynamicRasterState = reinterpret_cast<PFN_vkDestroyDynamicRasterState>(get_proc_addr(device, "vkDestroyDynamicRasterState"));
-    if (UNLIKELY(!vtbl.DestroyDynamicRasterState)) {
-        ALOGE("missing device proc: %s", "vkDestroyDynamicRasterState");
-        success = false;
-    }
-    vtbl.CreateDynamicColorBlendState = reinterpret_cast<PFN_vkCreateDynamicColorBlendState>(get_proc_addr(device, "vkCreateDynamicColorBlendState"));
-    if (UNLIKELY(!vtbl.CreateDynamicColorBlendState)) {
-        ALOGE("missing device proc: %s", "vkCreateDynamicColorBlendState");
-        success = false;
-    }
-    vtbl.DestroyDynamicColorBlendState = reinterpret_cast<PFN_vkDestroyDynamicColorBlendState>(get_proc_addr(device, "vkDestroyDynamicColorBlendState"));
-    if (UNLIKELY(!vtbl.DestroyDynamicColorBlendState)) {
-        ALOGE("missing device proc: %s", "vkDestroyDynamicColorBlendState");
-        success = false;
-    }
-    vtbl.CreateDynamicDepthStencilState = reinterpret_cast<PFN_vkCreateDynamicDepthStencilState>(get_proc_addr(device, "vkCreateDynamicDepthStencilState"));
-    if (UNLIKELY(!vtbl.CreateDynamicDepthStencilState)) {
-        ALOGE("missing device proc: %s", "vkCreateDynamicDepthStencilState");
-        success = false;
-    }
-    vtbl.DestroyDynamicDepthStencilState = reinterpret_cast<PFN_vkDestroyDynamicDepthStencilState>(get_proc_addr(device, "vkDestroyDynamicDepthStencilState"));
-    if (UNLIKELY(!vtbl.DestroyDynamicDepthStencilState)) {
-        ALOGE("missing device proc: %s", "vkDestroyDynamicDepthStencilState");
-        success = false;
-    }
     vtbl.CreateFramebuffer = reinterpret_cast<PFN_vkCreateFramebuffer>(get_proc_addr(device, "vkCreateFramebuffer"));
     if (UNLIKELY(!vtbl.CreateFramebuffer)) {
         ALOGE("missing device proc: %s", "vkCreateFramebuffer");
@@ -1024,24 +928,49 @@
         ALOGE("missing device proc: %s", "vkCmdBindPipeline");
         success = false;
     }
-    vtbl.CmdBindDynamicViewportState = reinterpret_cast<PFN_vkCmdBindDynamicViewportState>(get_proc_addr(device, "vkCmdBindDynamicViewportState"));
-    if (UNLIKELY(!vtbl.CmdBindDynamicViewportState)) {
-        ALOGE("missing device proc: %s", "vkCmdBindDynamicViewportState");
+    vtbl.CmdSetViewport = reinterpret_cast<PFN_vkCmdSetViewport>(get_proc_addr(device, "vkCmdSetViewport"));
+    if (UNLIKELY(!vtbl.CmdSetViewport)) {
+        ALOGE("missing device proc: %s", "vkCmdSetViewport");
         success = false;
     }
-    vtbl.CmdBindDynamicRasterState = reinterpret_cast<PFN_vkCmdBindDynamicRasterState>(get_proc_addr(device, "vkCmdBindDynamicRasterState"));
-    if (UNLIKELY(!vtbl.CmdBindDynamicRasterState)) {
-        ALOGE("missing device proc: %s", "vkCmdBindDynamicRasterState");
+    vtbl.CmdSetScissor = reinterpret_cast<PFN_vkCmdSetScissor>(get_proc_addr(device, "vkCmdSetScissor"));
+    if (UNLIKELY(!vtbl.CmdSetScissor)) {
+        ALOGE("missing device proc: %s", "vkCmdSetScissor");
         success = false;
     }
-    vtbl.CmdBindDynamicColorBlendState = reinterpret_cast<PFN_vkCmdBindDynamicColorBlendState>(get_proc_addr(device, "vkCmdBindDynamicColorBlendState"));
-    if (UNLIKELY(!vtbl.CmdBindDynamicColorBlendState)) {
-        ALOGE("missing device proc: %s", "vkCmdBindDynamicColorBlendState");
+    vtbl.CmdSetLineWidth = reinterpret_cast<PFN_vkCmdSetLineWidth>(get_proc_addr(device, "vkCmdSetLineWidth"));
+    if (UNLIKELY(!vtbl.CmdSetLineWidth)) {
+        ALOGE("missing device proc: %s", "vkCmdSetLineWidth");
         success = false;
     }
-    vtbl.CmdBindDynamicDepthStencilState = reinterpret_cast<PFN_vkCmdBindDynamicDepthStencilState>(get_proc_addr(device, "vkCmdBindDynamicDepthStencilState"));
-    if (UNLIKELY(!vtbl.CmdBindDynamicDepthStencilState)) {
-        ALOGE("missing device proc: %s", "vkCmdBindDynamicDepthStencilState");
+    vtbl.CmdSetDepthBias = reinterpret_cast<PFN_vkCmdSetDepthBias>(get_proc_addr(device, "vkCmdSetDepthBias"));
+    if (UNLIKELY(!vtbl.CmdSetDepthBias)) {
+        ALOGE("missing device proc: %s", "vkCmdSetDepthBias");
+        success = false;
+    }
+    vtbl.CmdSetBlendConstants = reinterpret_cast<PFN_vkCmdSetBlendConstants>(get_proc_addr(device, "vkCmdSetBlendConstants"));
+    if (UNLIKELY(!vtbl.CmdSetBlendConstants)) {
+        ALOGE("missing device proc: %s", "vkCmdSetBlendConstants");
+        success = false;
+    }
+    vtbl.CmdSetDepthBounds = reinterpret_cast<PFN_vkCmdSetDepthBounds>(get_proc_addr(device, "vkCmdSetDepthBounds"));
+    if (UNLIKELY(!vtbl.CmdSetDepthBounds)) {
+        ALOGE("missing device proc: %s", "vkCmdSetDepthBounds");
+        success = false;
+    }
+    vtbl.CmdSetStencilCompareMask = reinterpret_cast<PFN_vkCmdSetStencilCompareMask>(get_proc_addr(device, "vkCmdSetStencilCompareMask"));
+    if (UNLIKELY(!vtbl.CmdSetStencilCompareMask)) {
+        ALOGE("missing device proc: %s", "vkCmdSetStencilCompareMask");
+        success = false;
+    }
+    vtbl.CmdSetStencilWriteMask = reinterpret_cast<PFN_vkCmdSetStencilWriteMask>(get_proc_addr(device, "vkCmdSetStencilWriteMask"));
+    if (UNLIKELY(!vtbl.CmdSetStencilWriteMask)) {
+        ALOGE("missing device proc: %s", "vkCmdSetStencilWriteMask");
+        success = false;
+    }
+    vtbl.CmdSetStencilReference = reinterpret_cast<PFN_vkCmdSetStencilReference>(get_proc_addr(device, "vkCmdSetStencilReference"));
+    if (UNLIKELY(!vtbl.CmdSetStencilReference)) {
+        ALOGE("missing device proc: %s", "vkCmdSetStencilReference");
         success = false;
     }
     vtbl.CmdBindDescriptorSets = reinterpret_cast<PFN_vkCmdBindDescriptorSets>(get_proc_addr(device, "vkCmdBindDescriptorSets"));
@@ -1219,14 +1148,73 @@
         ALOGE("missing device proc: %s", "vkCmdExecuteCommands");
         success = false;
     }
-    vtbl.ImportNativeFenceANDROID = reinterpret_cast<PFN_vkImportNativeFenceANDROID>(get_proc_addr(device, "vkImportNativeFenceANDROID"));
-    if (UNLIKELY(!vtbl.ImportNativeFenceANDROID)) {
-        ALOGE("missing device proc: %s", "vkImportNativeFenceANDROID");
+    vtbl.GetSurfacePropertiesKHR = reinterpret_cast<PFN_vkGetSurfacePropertiesKHR>(get_proc_addr(device, "vkGetSurfacePropertiesKHR"));
+    if (UNLIKELY(!vtbl.GetSurfacePropertiesKHR)) {
+        ALOGE("missing device proc: %s", "vkGetSurfacePropertiesKHR");
         success = false;
     }
+    vtbl.GetSurfaceFormatsKHR = reinterpret_cast<PFN_vkGetSurfaceFormatsKHR>(get_proc_addr(device, "vkGetSurfaceFormatsKHR"));
+    if (UNLIKELY(!vtbl.GetSurfaceFormatsKHR)) {
+        ALOGE("missing device proc: %s", "vkGetSurfaceFormatsKHR");
+        success = false;
+    }
+    vtbl.GetSurfacePresentModesKHR = reinterpret_cast<PFN_vkGetSurfacePresentModesKHR>(get_proc_addr(device, "vkGetSurfacePresentModesKHR"));
+    if (UNLIKELY(!vtbl.GetSurfacePresentModesKHR)) {
+        ALOGE("missing device proc: %s", "vkGetSurfacePresentModesKHR");
+        success = false;
+    }
+    vtbl.CreateSwapchainKHR = reinterpret_cast<PFN_vkCreateSwapchainKHR>(get_proc_addr(device, "vkCreateSwapchainKHR"));
+    if (UNLIKELY(!vtbl.CreateSwapchainKHR)) {
+        ALOGE("missing device proc: %s", "vkCreateSwapchainKHR");
+        success = false;
+    }
+    vtbl.DestroySwapchainKHR = reinterpret_cast<PFN_vkDestroySwapchainKHR>(get_proc_addr(device, "vkDestroySwapchainKHR"));
+    if (UNLIKELY(!vtbl.DestroySwapchainKHR)) {
+        ALOGE("missing device proc: %s", "vkDestroySwapchainKHR");
+        success = false;
+    }
+    vtbl.GetSwapchainImagesKHR = reinterpret_cast<PFN_vkGetSwapchainImagesKHR>(get_proc_addr(device, "vkGetSwapchainImagesKHR"));
+    if (UNLIKELY(!vtbl.GetSwapchainImagesKHR)) {
+        ALOGE("missing device proc: %s", "vkGetSwapchainImagesKHR");
+        success = false;
+    }
+    vtbl.AcquireNextImageKHR = reinterpret_cast<PFN_vkAcquireNextImageKHR>(get_proc_addr(device, "vkAcquireNextImageKHR"));
+    if (UNLIKELY(!vtbl.AcquireNextImageKHR)) {
+        ALOGE("missing device proc: %s", "vkAcquireNextImageKHR");
+        success = false;
+    }
+    vtbl.QueuePresentKHR = reinterpret_cast<PFN_vkQueuePresentKHR>(get_proc_addr(device, "vkQueuePresentKHR"));
+    if (UNLIKELY(!vtbl.QueuePresentKHR)) {
+        ALOGE("missing device proc: %s", "vkQueuePresentKHR");
+        success = false;
+    }
+    vtbl.GetSwapchainGrallocUsageANDROID = reinterpret_cast<PFN_vkGetSwapchainGrallocUsageANDROID>(get_proc_addr(device, "vkGetSwapchainGrallocUsageANDROID"));
+    if (UNLIKELY(!vtbl.GetSwapchainGrallocUsageANDROID)) {
+        // TODO(jessehall): temporarily make this optional, until drivers have been updated
+        // ALOGE("missing device proc: %s", "vkGetSwapchainGrallocUsageANDROID");
+        ALOGW("missing device proc: %s", "vkGetSwapchainGrallocUsageANDROID");
+        // success = false;
+    }
+    vtbl.AcquireImageANDROID = reinterpret_cast<PFN_vkAcquireImageANDROID>(get_proc_addr(device, "vkAcquireImageANDROID"));
+    if (UNLIKELY(!vtbl.AcquireImageANDROID)) {
+        // TODO(jessehall): temporarily make this optional, until drivers have been updated
+        // ALOGE("missing device proc: %s", "vkImportNativeFenceANDROID");
+        ALOGW("missing device proc: %s", "vkAcquireImageANDROID");
+        // success = false;
+    }
+    vtbl.QueueSignalReleaseImageANDROID = reinterpret_cast<PFN_vkQueueSignalReleaseImageANDROID>(get_proc_addr(device, "vkQueueSignalReleaseImageANDROID"));
+    if (UNLIKELY(!vtbl.QueueSignalReleaseImageANDROID)) {
+        // TODO(jessehall): temporarily make this optional, until drivers have been updated
+        // ALOGE("missing device proc: %s", "vkQueueSignalReleaseImageANDROID");
+        ALOGW("missing device proc: %s", "vkQueueSignalReleaseImageANDROID");
+        // success = false;
+    }
+    // TODO(jessehall): these are deprecated; remove when drivers have been updated
+    vtbl.ImportNativeFenceANDROID = reinterpret_cast<PFN_vkImportNativeFenceANDROID>(get_proc_addr(device, "vkImportNativeFenceANDROID"));
     vtbl.QueueSignalNativeFenceANDROID = reinterpret_cast<PFN_vkQueueSignalNativeFenceANDROID>(get_proc_addr(device, "vkQueueSignalNativeFenceANDROID"));
-    if (UNLIKELY(!vtbl.QueueSignalNativeFenceANDROID)) {
-        ALOGE("missing device proc: %s", "vkQueueSignalNativeFenceANDROID");
+    if (!((!vtbl.AcquireImageANDROID && !vtbl.QueueSignalReleaseImageANDROID && vtbl.ImportNativeFenceANDROID && vtbl.QueueSignalNativeFenceANDROID) ||
+    (vtbl.AcquireImageANDROID && vtbl.QueueSignalReleaseImageANDROID && !vtbl.ImportNativeFenceANDROID && !vtbl.QueueSignalNativeFenceANDROID))) {
+        ALOGE("driver doesn't support exactly one of old- or new-style VK_EXT_ANDROID_native_buffer commands");
         success = false;
     }
     // clang-format on
diff --git a/vulkan/libvulkan/get_proc_addr.cpp.tmpl b/vulkan/libvulkan/get_proc_addr.cpp.tmpl
index 2e63893..6d5f618 100644
--- a/vulkan/libvulkan/get_proc_addr.cpp.tmpl
+++ b/vulkan/libvulkan/get_proc_addr.cpp.tmpl
@@ -66,7 +66,7 @@
 };

 template <typename TEntry, size_t N>
-const TEntry* FindProcEntry(const TEntry(&table)[N], const char* name) {
+const TEntry* FindProcEntry(const TEntry (&table)[N], const char* name) {
     auto entry = std::lower_bound(
         table, table + N, name,
         [](const TEntry& e, const char* n) { return strcmp(e.name, n) < 0; });
@@ -126,9 +126,6 @@
     // vkGetDeviceProcAddr must be available at the global/instance level for bootstrapping
     if (strcmp(name, "vkGetDeviceProcAddr") == 0)
         return reinterpret_cast<PFN_vkVoidFunction>(vkGetDeviceProcAddr);
-    // special-case extension functions until they can be auto-generated
-    if (strcmp(name, "vkGetPhysicalDeviceSurfaceSupportKHR") == 0)
-        return reinterpret_cast<PFN_vkVoidFunction>(vkGetPhysicalDeviceSurfaceSupportKHR);
     return nullptr;
 }

@@ -136,23 +133,6 @@
     const NameProcEntry* entry = FindProcEntry(kDeviceProcTbl, name);
     if (entry)
         return entry->proc;
-    // special-case extension functions until they can be auto-generated
-    if (strcmp(name, "vkGetSurfacePropertiesKHR") == 0)
-        return reinterpret_cast<PFN_vkVoidFunction>(vkGetSurfacePropertiesKHR);
-    if (strcmp(name, "vkGetSurfaceFormatsKHR") == 0)
-        return reinterpret_cast<PFN_vkVoidFunction>(vkGetSurfaceFormatsKHR);
-    if (strcmp(name, "vkGetSurfacePresentModesKHR") == 0)
-        return reinterpret_cast<PFN_vkVoidFunction>(vkGetSurfacePresentModesKHR);
-    if (strcmp(name, "vkCreateSwapchainKHR") == 0)
-        return reinterpret_cast<PFN_vkVoidFunction>(vkCreateSwapchainKHR);
-    if (strcmp(name, "vkDestroySwapchainKHR") == 0)
-        return reinterpret_cast<PFN_vkVoidFunction>(vkDestroySwapchainKHR);
-    if (strcmp(name, "vkGetSwapchainImagesKHR") == 0)
-        return reinterpret_cast<PFN_vkVoidFunction>(vkGetSwapchainImagesKHR);
-    if (strcmp(name, "vkAcquireNextImageKHR") == 0)
-        return reinterpret_cast<PFN_vkVoidFunction>(vkAcquireNextImageKHR);
-    if (strcmp(name, "vkQueuePresentKHR") == 0)
-        return reinterpret_cast<PFN_vkVoidFunction>(vkQueuePresentKHR);
     return nullptr;
 }

@@ -162,13 +142,11 @@
     const NameOffsetEntry* entry = FindProcEntry(kInstanceOffsetTbl, name);
     if (entry)
         offset = entry->offset;
-    else if (strcmp(name, "vkGetPhysicalDeviceSurfaceSupportKHR") == 0)
-        offset = offsetof(InstanceVtbl, GetPhysicalDeviceSurfaceSupportKHR);
     else
         return nullptr;
     const unsigned char* base = reinterpret_cast<const unsigned char*>(vtbl);
     return *reinterpret_cast<PFN_vkVoidFunction*>(
-        const_cast<unsigned char*>(base) + entry->offset);
+        const_cast<unsigned char*>(base) + offset);
 }

 PFN_vkVoidFunction GetSpecificDeviceProcAddr(const DeviceVtbl* vtbl,
@@ -177,27 +155,11 @@
     const NameOffsetEntry* entry = FindProcEntry(kDeviceOffsetTbl, name);
     if (entry)
         offset = entry->offset;
-    else if (strcmp(name, "vkGetSurfacePropertiesKHR") == 0)
-        offset = offsetof(DeviceVtbl, GetSurfacePropertiesKHR);
-    else if (strcmp(name, "vkGetSurfaceFormatsKHR") == 0)
-        offset = offsetof(DeviceVtbl, GetSurfaceFormatsKHR);
-    else if (strcmp(name, "vkGetSurfacePresentModesKHR") == 0)
-        offset = offsetof(DeviceVtbl, GetSurfacePresentModesKHR);
-    else if (strcmp(name, "vkCreateSwapchainKHR") == 0)
-        offset = offsetof(DeviceVtbl, CreateSwapchainKHR);
-    else if (strcmp(name, "vkDestroySwapchainKHR") == 0)
-        offset = offsetof(DeviceVtbl, DestroySwapchainKHR);
-    else if (strcmp(name, "vkGetSwapchainImagesKHR") == 0)
-        offset = offsetof(DeviceVtbl, GetSwapchainImagesKHR);
-    else if (strcmp(name, "vkAcquireNextImageKHR") == 0)
-        offset = offsetof(DeviceVtbl, AcquireNextImageKHR);
-    else if (strcmp(name, "vkQueuePresentKHR") == 0)
-        offset = offsetof(DeviceVtbl, QueuePresentKHR);
     else
         return nullptr;
     const unsigned char* base = reinterpret_cast<const unsigned char*>(vtbl);
     return *reinterpret_cast<PFN_vkVoidFunction*>(
-        const_cast<unsigned char*>(base) + entry->offset);
+        const_cast<unsigned char*>(base) + offset);
 }

 bool LoadInstanceVtbl(VkInstance instance,
@@ -218,6 +180,7 @@
     {{range $f := AllCommands $}}
       {{if eq (Macro "Vtbl" $f) "Instance"}}
         {{if not (eq (Macro "FunctionName" $f) "vkGetInstanceProcAddr")}}
+          {{if not (GetAnnotation $f "extension")}}
     vtbl.{{TrimPrefix "vk" (Macro "FunctionName" $f)}} = §
         reinterpret_cast<{{Macro "FunctionPtrName" $f}}>(§
             get_proc_addr(instance, "{{Macro "FunctionName" $f}}"));
@@ -225,6 +188,16 @@
         ALOGE("missing instance proc: %s", "{{Macro "FunctionName" $f}}");
         success = false;
     }
+          {{end}}
+        {{end}}
+      {{end}}
+    {{end}}
+    {{range $f := AllCommands $}}
+      {{if eq (Macro "Vtbl" $f) "Instance"}}
+        {{if (GetAnnotation $f "extension")}}
+    vtbl.{{TrimPrefix "vk" (Macro "FunctionName" $f)}} = §
+        reinterpret_cast<{{Macro "FunctionPtrName" $f}}>(§
+            get_proc_addr(instance, "{{Macro "FunctionName" $f}}"));
         {{end}}
       {{end}}
     {{end}}
@@ -256,14 +229,33 @@
         {{end}}
       {{end}}
     {{end}}
-    vtbl.ImportNativeFenceANDROID = reinterpret_cast<PFN_vkImportNativeFenceANDROID>(get_proc_addr(device, "vkImportNativeFenceANDROID"));
-    if (UNLIKELY(!vtbl.ImportNativeFenceANDROID)) {
-        ALOGE("missing device proc: %s", "vkImportNativeFenceANDROID");
-        success = false;
+    vtbl.GetSwapchainGrallocUsageANDROID = reinterpret_cast<PFN_vkGetSwapchainGrallocUsageANDROID>(get_proc_addr(device, "vkGetSwapchainGrallocUsageANDROID"));
+    if (UNLIKELY(!vtbl.GetSwapchainGrallocUsageANDROID)) {
+        // TODO(jessehall): temporarily make this optional, until drivers have been updated
+        // ALOGE("missing device proc: %s", "vkGetSwapchainGrallocUsageANDROID");
+        ALOGW("missing device proc: %s", "vkGetSwapchainGrallocUsageANDROID");
+        // success = false;
     }
+    vtbl.AcquireImageANDROID = reinterpret_cast<PFN_vkAcquireImageANDROID>(get_proc_addr(device, "vkAcquireImageANDROID"));
+    if (UNLIKELY(!vtbl.AcquireImageANDROID)) {
+        // TODO(jessehall): temporarily make this optional, until drivers have been updated
+        // ALOGE("missing device proc: %s", "vkImportNativeFenceANDROID");
+        ALOGW("missing device proc: %s", "vkAcquireImageANDROID");
+        // success = false;
+    }
+    vtbl.QueueSignalReleaseImageANDROID = reinterpret_cast<PFN_vkQueueSignalReleaseImageANDROID>(get_proc_addr(device, "vkQueueSignalReleaseImageANDROID"));
+    if (UNLIKELY(!vtbl.QueueSignalReleaseImageANDROID)) {
+        // TODO(jessehall): temporarily make this optional, until drivers have been updated
+        // ALOGE("missing device proc: %s", "vkQueueSignalReleaseImageANDROID");
+        ALOGW("missing device proc: %s", "vkQueueSignalReleaseImageANDROID");
+        // success = false;
+    }
+    // TODO(jessehall): these are deprecated; remove when drivers have been updated
+    vtbl.ImportNativeFenceANDROID = reinterpret_cast<PFN_vkImportNativeFenceANDROID>(get_proc_addr(device, "vkImportNativeFenceANDROID"));
     vtbl.QueueSignalNativeFenceANDROID = reinterpret_cast<PFN_vkQueueSignalNativeFenceANDROID>(get_proc_addr(device, "vkQueueSignalNativeFenceANDROID"));
-    if (UNLIKELY(!vtbl.QueueSignalNativeFenceANDROID)) {
-        ALOGE("missing device proc: %s", "vkQueueSignalNativeFenceANDROID");
+    if (!((!vtbl.AcquireImageANDROID && !vtbl.QueueSignalReleaseImageANDROID && vtbl.ImportNativeFenceANDROID && vtbl.QueueSignalNativeFenceANDROID) ||
+          (vtbl.AcquireImageANDROID && vtbl.QueueSignalReleaseImageANDROID && !vtbl.ImportNativeFenceANDROID && !vtbl.QueueSignalNativeFenceANDROID))) {
+        ALOGE("driver doesn't support exactly one of old- or new-style VK_EXT_ANDROID_native_buffer commands");
         success = false;
     }
     // clang-format on
diff --git a/vulkan/libvulkan/loader.cpp b/vulkan/libvulkan/loader.cpp
index 97ceb4a..fe33114 100644
--- a/vulkan/libvulkan/loader.cpp
+++ b/vulkan/libvulkan/loader.cpp
@@ -14,6 +14,8 @@
  * limitations under the License.
  */
 
+//#define LOG_NDEBUG 0
+
 // module header
 #include "loader.h"
 // standard C headers
@@ -115,14 +117,26 @@
 
 // -----------------------------------------------------------------------------
 
+namespace {
+
+struct LayerData {
+    String path;
+    SharedLibraryHandle handle;
+    uint32_t ref_count;
+};
+
+typedef UnorderedMap<String, LayerData>::iterator LayerMapIterator;
+
+}  // namespace
+
 struct VkInstance_T {
     VkInstance_T(const VkAllocCallbacks* alloc_callbacks)
         : vtbl(&vtbl_storage),
           alloc(alloc_callbacks),
           num_physical_devices(0),
-          active_layers(
-              CallbackAllocator<std::pair<String, SharedLibraryHandle> >(
-                  alloc)) {
+          layers(CallbackAllocator<std::pair<String, LayerData> >(alloc)),
+          active_layers(CallbackAllocator<String>(alloc)) {
+        pthread_mutex_init(&layer_lock, 0);
         memset(&vtbl_storage, 0, sizeof(vtbl_storage));
         memset(physical_devices, 0, sizeof(physical_devices));
         memset(&drv.vtbl, 0, sizeof(drv.vtbl));
@@ -130,6 +144,8 @@
         drv.num_physical_devices = 0;
     }
 
+    ~VkInstance_T() { pthread_mutex_destroy(&layer_lock); }
+
     InstanceVtbl* vtbl;
     InstanceVtbl vtbl_storage;
 
@@ -137,7 +153,11 @@
     uint32_t num_physical_devices;
     VkPhysicalDevice physical_devices[kMaxPhysicalDevices];
 
-    Vector<std::pair<String, SharedLibraryHandle> > active_layers;
+    pthread_mutex_t layer_lock;
+    // Map of layer names to layer data
+    UnorderedMap<String, LayerData> layers;
+    // Vector of layers active for this instance
+    Vector<LayerMapIterator> active_layers;
     VkDbgMsgCallback message;
 
     struct Driver {
@@ -162,13 +182,16 @@
 typedef VkInstance_T Instance;
 
 struct Device {
-    Device(const VkAllocCallbacks* alloc_callbacks) : alloc(alloc_callbacks) {
+    Device(Instance* instance_input)
+        : instance(instance_input),
+          active_layers(CallbackAllocator<LayerMapIterator>(instance->alloc)) {
         memset(&vtbl_storage, 0, sizeof(vtbl_storage));
         vtbl_storage.device = this;
     }
     DeviceVtbl vtbl_storage;
-    const VkAllocCallbacks* alloc;
-    PFN_vkGetDeviceProcAddr GetDeviceProcAddr;
+    Instance* instance;
+    // Vector of layers active for this device
+    Vector<LayerMapIterator> active_layers;
 };
 
 // -----------------------------------------------------------------------------
@@ -228,78 +251,247 @@
 }
 
 void DestroyDevice(Device* device) {
-    const VkAllocCallbacks* alloc = device->alloc;
+    const VkAllocCallbacks* alloc = device->instance->alloc;
     device->~Device();
     alloc->pfnFree(alloc->pUserData, device);
 }
 
-void FindLayersInDirectory(
-    Instance& instance,
-    UnorderedMap<String, SharedLibraryHandle>& layer_name_to_handle_map,
-    const String& dir_name) {
-    DIR* directory;
-    struct dirent* entry;
-    if ((directory = opendir(dir_name.c_str()))) {
-        Vector<VkLayerProperties> properties(
-            CallbackAllocator<VkLayerProperties>(instance.alloc));
-        while ((entry = readdir(directory))) {
-            size_t length = strlen(entry->d_name);
-            if (strncmp(entry->d_name, "libVKLayer", 10) != 0 ||
-                strncmp(entry->d_name + length - 3, ".so", 3) != 0)
-                continue;
-            // Open so
-            SharedLibraryHandle layer_handle = dlopen(
-                (dir_name + entry->d_name).c_str(), RTLD_NOW | RTLD_LOCAL);
-            if (!layer_handle) {
-                ALOGE("%s failed to load with error %s; Skipping",
-                      entry->d_name, dlerror());
-                continue;
-            }
-
-            // Get Layers in so
-            PFN_vkGetGlobalLayerProperties get_layer_properties =
-                reinterpret_cast<PFN_vkGetGlobalLayerProperties>(
-                    dlsym(layer_handle, "vkGetGlobalLayerProperties"));
-            if (!get_layer_properties) {
-                ALOGE(
-                    "%s failed to find vkGetGlobalLayerProperties with "
-                    "error %s; Skipping",
-                    entry->d_name, dlerror());
-                dlclose(layer_handle);
-                continue;
-            }
-            uint32_t count;
-            get_layer_properties(&count, nullptr);
-
-            properties.resize(count);
-            get_layer_properties(&count, &properties[0]);
-
-            // Add Layers to potential list
-            for (uint32_t i = 0; i < count; ++i) {
-                layer_name_to_handle_map.insert(std::make_pair(
-                    String(properties[i].layerName,
-                           CallbackAllocator<char>(instance.alloc)),
-                    layer_handle));
-                ALOGV("Found layer %s", properties[i].layerName);
-            }
-        }
-        closedir(directory);
-    } else {
-        ALOGE("Failed to Open Directory %s: %s (%d)", dir_name.c_str(),
-              strerror(errno), errno);
+void FindLayersInDirectory(Instance& instance, const String& dir_name) {
+    DIR* directory = opendir(dir_name.c_str());
+    if (!directory) {
+        android_LogPriority log_priority =
+            (errno == ENOENT) ? ANDROID_LOG_VERBOSE : ANDROID_LOG_ERROR;
+        LOG_PRI(log_priority, LOG_TAG,
+                "failed to open layer directory '%s': %s (%d)",
+                dir_name.c_str(), strerror(errno), errno);
+        return;
     }
+
+    Vector<VkLayerProperties> properties(
+        CallbackAllocator<VkLayerProperties>(instance.alloc));
+    struct dirent* entry;
+    while ((entry = readdir(directory))) {
+        size_t length = strlen(entry->d_name);
+        if (strncmp(entry->d_name, "libVKLayer", 10) != 0 ||
+            strncmp(entry->d_name + length - 3, ".so", 3) != 0)
+            continue;
+        // Open so
+        SharedLibraryHandle layer_handle =
+            dlopen((dir_name + entry->d_name).c_str(), RTLD_NOW | RTLD_LOCAL);
+        if (!layer_handle) {
+            ALOGE("%s failed to load with error %s; Skipping", entry->d_name,
+                  dlerror());
+            continue;
+        }
+
+        // Get Layers in so
+        PFN_vkEnumerateInstanceLayerProperties get_layer_properties =
+            reinterpret_cast<PFN_vkEnumerateInstanceLayerProperties>(
+                dlsym(layer_handle, "vkEnumerateInstanceLayerProperties"));
+        if (!get_layer_properties) {
+            ALOGE(
+                "%s failed to find vkEnumerateInstanceLayerProperties with "
+                "error %s; Skipping",
+                entry->d_name, dlerror());
+            dlclose(layer_handle);
+            continue;
+        }
+        uint32_t count;
+        get_layer_properties(&count, nullptr);
+
+        properties.resize(count);
+        get_layer_properties(&count, &properties[0]);
+
+        // Add Layers to potential list
+        for (uint32_t i = 0; i < count; ++i) {
+            String layer_name(properties[i].layerName,
+                              CallbackAllocator<char>(instance.alloc));
+            LayerData layer_data = {dir_name + entry->d_name, 0, 0};
+            instance.layers.insert(std::make_pair(layer_name, layer_data));
+            ALOGV("Found layer %s", properties[i].layerName);
+        }
+        dlclose(layer_handle);
+    }
+
+    closedir(directory);
 }
 
-void LoadLayer(Instance* instance,
-               const String& name,
-               SharedLibraryHandle& layer_handle) {
-    ALOGV("Loading layer %s", name.c_str());
-    instance->active_layers.push_back(std::make_pair(name, layer_handle));
+template <class TObject>
+void ActivateLayer(TObject* object, Instance* instance, const String& name) {
+    // If object has layer, do nothing
+    auto element = instance->layers.find(name);
+    if (element == instance->layers.end()) {
+        return;
+    }
+    if (std::find(object->active_layers.begin(), object->active_layers.end(),
+                  element) != object->active_layers.end()) {
+        ALOGW("Layer %s already activated; skipping", name.c_str());
+        return;
+    }
+    // If layer is not open, open it
+    LayerData& layer_data = element->second;
+    pthread_mutex_lock(&instance->layer_lock);
+    if (layer_data.ref_count == 0) {
+        SharedLibraryHandle layer_handle =
+            dlopen(layer_data.path.c_str(), RTLD_NOW | RTLD_LOCAL);
+        if (!layer_handle) {
+            pthread_mutex_unlock(&instance->layer_lock);
+            ALOGE("%s failed to load with error %s; Skipping",
+                  layer_data.path.c_str(), dlerror());
+            return;
+        }
+        layer_data.handle = layer_handle;
+    }
+    layer_data.ref_count++;
+    pthread_mutex_unlock(&instance->layer_lock);
+    ALOGV("Activating layer %s", name.c_str());
+    object->active_layers.push_back(element);
 }
 
-VkResult CreateDeviceNoop(VkPhysicalDevice,
-                          const VkDeviceCreateInfo*,
-                          VkDevice*) {
+void DeactivateLayer(Instance* instance,
+                     Vector<LayerMapIterator>::iterator& element) {
+    LayerMapIterator& layer_map_data = *element;
+    LayerData& layer_data = layer_map_data->second;
+    pthread_mutex_lock(&instance->layer_lock);
+    layer_data.ref_count--;
+    if (!layer_data.ref_count) {
+        dlclose(layer_data.handle);
+    }
+    pthread_mutex_unlock(&instance->layer_lock);
+}
+
+struct InstanceNamesPair {
+    Instance* instance;
+    Vector<String>* layer_names;
+};
+
+void SetLayerNamesFromProperty(const char* name,
+                               const char* value,
+                               void* data) {
+    const char prefix[] = "debug.vulkan.layer.";
+    const size_t prefixlen = sizeof(prefix) - 1;
+    if (value[0] == '\0' || strncmp(name, prefix, prefixlen) != 0)
+        return;
+    const char* number_str = name + prefixlen;
+    long layer_number = strtol(number_str, nullptr, 10);
+    if (layer_number <= 0 || layer_number == LONG_MAX) {
+        ALOGW("Cannot use a layer at number %ld from string %s", layer_number,
+              number_str);
+        return;
+    }
+    auto instance_names_pair = static_cast<InstanceNamesPair*>(data);
+    Vector<String>* layer_names = instance_names_pair->layer_names;
+    Instance* instance = instance_names_pair->instance;
+    size_t layer_size = static_cast<size_t>(layer_number);
+    if (layer_size > layer_names->size()) {
+        layer_names->resize(layer_size,
+                            String(CallbackAllocator<char>(instance->alloc)));
+    }
+    (*layer_names)[layer_size - 1] = value;
+}
+
+template <class TInfo, class TObject>
+VkResult ActivateAllLayers(TInfo create_info, Instance* instance, TObject* object) {
+    ALOG_ASSERT(create_info->sType == VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO ||
+                    create_info->sType == VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO,
+                "Cannot activate layers for unknown object %p", object);
+    CallbackAllocator<char> string_allocator(instance->alloc);
+    // Load system layers
+    {
+        char layer_prop[PROPERTY_VALUE_MAX];
+        property_get("debug.vulkan.layers", layer_prop, "");
+        String layer_name(string_allocator);
+        String layer_prop_str(layer_prop, string_allocator);
+        size_t end, start = 0;
+        while ((end = layer_prop_str.find(':', start)) != std::string::npos) {
+            layer_name = layer_prop_str.substr(start, end - start);
+            ActivateLayer(object, instance, layer_name);
+            start = end + 1;
+        }
+        Vector<String> layer_names(CallbackAllocator<String>(instance->alloc));
+        InstanceNamesPair instance_names_pair = {.instance = instance,
+                                                 .layer_names = &layer_names};
+        property_list(SetLayerNamesFromProperty,
+                      static_cast<void*>(&instance_names_pair));
+        for (auto layer_name_element : layer_names) {
+            ActivateLayer(object, instance, layer_name_element);
+        }
+    }
+    // Load app layers
+    for (uint32_t i = 0; i < create_info->layerCount; ++i) {
+        String layer_name(create_info->ppEnabledLayerNames[i],
+                          string_allocator);
+        auto element = instance->layers.find(layer_name);
+        if (element == instance->layers.end()) {
+            ALOGE("requested %s layer '%s' not present",
+                create_info->sType == VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO ?
+                    "instance" : "device",
+                layer_name.c_str());
+            return VK_ERROR_LAYER_NOT_PRESENT;
+        } else {
+            ActivateLayer(object, instance, layer_name);
+        }
+    }
+    return VK_SUCCESS;
+}
+
+template <class TCreateInfo>
+bool AddExtensionToCreateInfo(TCreateInfo& local_create_info,
+                              const char* extension_name,
+                              const VkAllocCallbacks* alloc) {
+    for (uint32_t i = 0; i < local_create_info.extensionCount; ++i) {
+        if (!strcmp(extension_name,
+                    local_create_info.ppEnabledExtensionNames[i])) {
+            return false;
+        }
+    }
+    uint32_t extension_count = local_create_info.extensionCount;
+    local_create_info.extensionCount++;
+    void* mem = alloc->pfnAlloc(
+        alloc->pUserData, local_create_info.extensionCount * sizeof(char*),
+        alignof(char*), VK_SYSTEM_ALLOC_TYPE_INTERNAL);
+    if (mem) {
+        const char** enabled_extensions = static_cast<const char**>(mem);
+        for (uint32_t i = 0; i < extension_count; ++i) {
+            enabled_extensions[i] =
+                local_create_info.ppEnabledExtensionNames[i];
+        }
+        enabled_extensions[extension_count] = extension_name;
+        local_create_info.ppEnabledExtensionNames = enabled_extensions;
+    } else {
+        ALOGW("%s extension cannot be enabled: memory allocation failed",
+              extension_name);
+        local_create_info.extensionCount--;
+        return false;
+    }
+    return true;
+}
+
+template <class T>
+void FreeAllocatedCreateInfo(T& local_create_info,
+                             const VkAllocCallbacks* alloc) {
+    alloc->pfnFree(
+        alloc->pUserData,
+        const_cast<char**>(local_create_info.ppEnabledExtensionNames));
+}
+
+VkBool32 LogDebugMessageCallback(VkFlags message_flags,
+                                 VkDbgObjectType /*obj_type*/,
+                                 uint64_t /*src_object*/,
+                                 size_t /*location*/,
+                                 int32_t message_code,
+                                 const char* layer_prefix,
+                                 const char* message,
+                                 void* /*user_data*/) {
+    if (message_flags & VK_DBG_REPORT_ERROR_BIT) {
+        ALOGE("[%s] Code %d : %s", layer_prefix, message_code, message);
+    } else if (message_flags & VK_DBG_REPORT_WARN_BIT) {
+        ALOGW("[%s] Code %d : %s", layer_prefix, message_code, message);
+    }
+    return false;
+}
+
+VkResult Noop(...) {
     return VK_SUCCESS;
 }
 
@@ -308,71 +500,64 @@
         return reinterpret_cast<PFN_vkVoidFunction>(GetLayerDeviceProcAddr);
     }
     if (strcmp(name, "vkCreateDevice") == 0) {
-        return reinterpret_cast<PFN_vkVoidFunction>(CreateDeviceNoop);
+        return reinterpret_cast<PFN_vkVoidFunction>(Noop);
+    }
+    // WSI extensions are not in the driver so return the loader functions
+    if (strcmp(name, "vkGetSurfacePropertiesKHR") == 0) {
+        return reinterpret_cast<PFN_vkVoidFunction>(GetSurfacePropertiesKHR);
+    }
+    if (strcmp(name, "vkGetSurfaceFormatsKHR") == 0) {
+        return reinterpret_cast<PFN_vkVoidFunction>(GetSurfaceFormatsKHR);
+    }
+    if (strcmp(name, "vkGetSurfacePresentModesKHR") == 0) {
+        return reinterpret_cast<PFN_vkVoidFunction>(GetSurfacePresentModesKHR);
+    }
+    if (strcmp(name, "vkCreateSwapchainKHR") == 0) {
+        return reinterpret_cast<PFN_vkVoidFunction>(CreateSwapchainKHR);
+    }
+    if (strcmp(name, "vkDestroySwapchainKHR") == 0) {
+        return reinterpret_cast<PFN_vkVoidFunction>(DestroySwapchainKHR);
+    }
+    if (strcmp(name, "vkGetSwapchainImagesKHR") == 0) {
+        return reinterpret_cast<PFN_vkVoidFunction>(GetSwapchainImagesKHR);
+    }
+    if (strcmp(name, "vkAcquireNextImageKHR") == 0) {
+        return reinterpret_cast<PFN_vkVoidFunction>(AcquireNextImageKHR);
+    }
+    if (strcmp(name, "vkQueuePresentKHR") == 0) {
+        return reinterpret_cast<PFN_vkVoidFunction>(QueuePresentKHR);
     }
     if (!device)
         return GetGlobalDeviceProcAddr(name);
     Device* loader_device = reinterpret_cast<Device*>(GetVtbl(device)->device);
-    return loader_device->GetDeviceProcAddr(device, name);
-}
-
-struct InstanceLayersPair {
-    Instance* instance;
-    UnorderedMap<String, SharedLibraryHandle>* layers;
-};
-
-void LoadLayerFromProperty(const char* name, const char* value, void* data) {
-    auto instance_layers_pair = static_cast<InstanceLayersPair*>(data);
-    const char prefix[] = "debug.vulkan.layer.";
-    const size_t prefixlen = sizeof(prefix) - 1;
-    if (value[0] == '\0' || strncmp(name, prefix, prefixlen) != 0)
-        return;
-    String layer_name_str(
-        name + prefixlen,
-        CallbackAllocator<char>(instance_layers_pair->instance->alloc));
-    LoadLayer(instance_layers_pair->instance, layer_name_str,
-              (*instance_layers_pair->layers)[layer_name_str]);
-}
-
-void LogDebugMessageCallback(VkFlags message_flags,
-                             VkDbgObjectType /*obj_type*/,
-                             uint64_t /*src_object*/,
-                             size_t /*location*/,
-                             int32_t message_code,
-                             const char* layer_prefix,
-                             const char* message,
-                             void* /*user_data*/) {
-    if (message_flags & VK_DBG_REPORT_ERROR_BIT) {
-        ALOGE("[%s] Code %d : %s", layer_prefix, message_code, message);
-    } else if (message_flags & VK_DBG_REPORT_WARN_BIT) {
-        ALOGW("[%s] Code %d : %s", layer_prefix, message_code, message);
-    }
+    return loader_device->instance->drv.GetDeviceProcAddr(device, name);
 }
 
 // -----------------------------------------------------------------------------
 // "Bottom" functions. These are called at the end of the instance dispatch
 // chain.
 
-VkResult DestroyInstanceBottom(VkInstance instance) {
+void DestroyInstanceBottom(VkInstance instance) {
     // These checks allow us to call DestroyInstanceBottom from any error path
     // in CreateInstanceBottom, before the driver instance is fully initialized.
     if (instance->drv.vtbl.instance != VK_NULL_HANDLE &&
         instance->drv.vtbl.DestroyInstance) {
         instance->drv.vtbl.DestroyInstance(instance->drv.vtbl.instance);
     }
-    for (auto& layer : instance->active_layers) {
-        dlclose(layer.second);
-    }
     if (instance->message) {
         PFN_vkDbgDestroyMsgCallback DebugDestroyMessageCallback;
-        DebugDestroyMessageCallback = reinterpret_cast<PFN_vkDbgDestroyMsgCallback>(
-            vkGetInstanceProcAddr(instance, "vkDbgDestroyMsgCallback"));
+        DebugDestroyMessageCallback =
+            reinterpret_cast<PFN_vkDbgDestroyMsgCallback>(
+                vkGetInstanceProcAddr(instance, "vkDbgDestroyMsgCallback"));
         DebugDestroyMessageCallback(instance, instance->message);
     }
+    for (auto it = instance->active_layers.begin();
+         it != instance->active_layers.end(); ++it) {
+        DeactivateLayer(instance, it);
+    }
     const VkAllocCallbacks* alloc = instance->alloc;
     instance->~VkInstance_T();
     alloc->pfnFree(alloc->pUserData, instance);
-    return VK_SUCCESS;
 }
 
 VkResult CreateInstanceBottom(const VkInstanceCreateInfo* create_info,
@@ -484,16 +669,11 @@
     VkImageType type,
     VkImageTiling tiling,
     VkImageUsageFlags usage,
+    VkImageCreateFlags flags,
     VkImageFormatProperties* properties) {
     return GetVtbl(pdev)
         ->instance->drv.vtbl.GetPhysicalDeviceImageFormatProperties(
-            pdev, format, type, tiling, usage, properties);
-}
-
-VkResult GetPhysicalDeviceLimitsBottom(VkPhysicalDevice pdev,
-                                       VkPhysicalDeviceLimits* limits) {
-    return GetVtbl(pdev)
-        ->instance->drv.vtbl.GetPhysicalDeviceLimits(pdev, limits);
+            pdev, format, type, tiling, usage, flags, properties);
 }
 
 VkResult GetPhysicalDevicePropertiesBottom(
@@ -503,18 +683,13 @@
         ->instance->drv.vtbl.GetPhysicalDeviceProperties(pdev, properties);
 }
 
-VkResult GetPhysicalDeviceQueueCountBottom(VkPhysicalDevice pdev,
-                                           uint32_t* count) {
-    return GetVtbl(pdev)
-        ->instance->drv.vtbl.GetPhysicalDeviceQueueCount(pdev, count);
-}
-
-VkResult GetPhysicalDeviceQueuePropertiesBottom(
+VkResult GetPhysicalDeviceQueueFamilyPropertiesBottom(
     VkPhysicalDevice pdev,
-    uint32_t count,
-    VkPhysicalDeviceQueueProperties* properties) {
-    return GetVtbl(pdev)->instance->drv.vtbl.GetPhysicalDeviceQueueProperties(
-        pdev, count, properties);
+    uint32_t* pCount,
+    VkQueueFamilyProperties* properties) {
+    return GetVtbl(pdev)
+        ->instance->drv.vtbl.GetPhysicalDeviceQueueFamilyProperties(
+            pdev, pCount, properties);
 }
 
 VkResult GetPhysicalDeviceMemoryPropertiesBottom(
@@ -527,7 +702,7 @@
 VkResult CreateDeviceBottom(VkPhysicalDevice pdev,
                             const VkDeviceCreateInfo* create_info,
                             VkDevice* out_device) {
-    const Instance& instance = *static_cast<Instance*>(GetVtbl(pdev)->instance);
+    Instance& instance = *static_cast<Instance*>(GetVtbl(pdev)->instance);
     VkResult result;
 
     void* mem = instance.alloc->pfnAlloc(instance.alloc->pUserData,
@@ -535,8 +710,13 @@
                                          VK_SYSTEM_ALLOC_TYPE_API_OBJECT);
     if (!mem)
         return VK_ERROR_OUT_OF_HOST_MEMORY;
-    Device* device = new (mem) Device(instance.alloc);
-    device->GetDeviceProcAddr = instance.drv.GetDeviceProcAddr;
+    Device* device = new (mem) Device(&instance);
+
+    result = ActivateAllLayers(create_info, &instance, device);
+    if (result != VK_SUCCESS) {
+        DestroyDevice(device);
+        return result;
+    }
 
     VkDevice drv_device;
     result = instance.drv.vtbl.CreateDevice(pdev, create_info, &drv_device);
@@ -558,21 +738,12 @@
     }
     dispatch->vtbl = &device->vtbl_storage;
 
-    device->vtbl_storage.GetSurfacePropertiesKHR = GetSurfacePropertiesKHR;
-    device->vtbl_storage.GetSurfaceFormatsKHR = GetSurfaceFormatsKHR;
-    device->vtbl_storage.GetSurfacePresentModesKHR = GetSurfacePresentModesKHR;
-    device->vtbl_storage.CreateSwapchainKHR = CreateSwapchainKHR;
-    device->vtbl_storage.DestroySwapchainKHR = DestroySwapchainKHR;
-    device->vtbl_storage.GetSwapchainImagesKHR = GetSwapchainImagesKHR;
-    device->vtbl_storage.AcquireNextImageKHR = AcquireNextImageKHR;
-    device->vtbl_storage.QueuePresentKHR = QueuePresentKHR;
-
     void* base_object = static_cast<void*>(drv_device);
     void* next_object = base_object;
     VkLayerLinkedListElem* next_element;
     PFN_vkGetDeviceProcAddr next_get_proc_addr = GetLayerDeviceProcAddr;
     Vector<VkLayerLinkedListElem> elem_list(
-        instance.active_layers.size(),
+        device->active_layers.size(),
         CallbackAllocator<VkLayerLinkedListElem>(instance.alloc));
 
     for (size_t i = elem_list.size(); i > 0; i--) {
@@ -584,16 +755,16 @@
         next_element->next_element = next_object;
         next_object = static_cast<void*>(next_element);
 
-        auto& name_libhandle_pair = instance.active_layers[idx];
+        auto& name = device->active_layers[idx]->first;
+        auto& handle = device->active_layers[idx]->second.handle;
         next_get_proc_addr = reinterpret_cast<PFN_vkGetDeviceProcAddr>(
-            dlsym(name_libhandle_pair.second,
-                  (name_libhandle_pair.first + "GetDeviceProcAddr").c_str()));
+            dlsym(handle, (name + "GetDeviceProcAddr").c_str()));
         if (!next_get_proc_addr) {
             next_get_proc_addr = reinterpret_cast<PFN_vkGetDeviceProcAddr>(
-                dlsym(name_libhandle_pair.second, "vkGetDeviceProcAddr"));
+                dlsym(handle, "vkGetDeviceProcAddr"));
             if (!next_get_proc_addr) {
                 ALOGE("Cannot find vkGetDeviceProcAddr for %s, error is %s",
-                      name_libhandle_pair.first.c_str(), dlerror());
+                      name.c_str(), dlerror());
                 next_object = next_element->next_element;
                 next_get_proc_addr = reinterpret_cast<PFN_vkGetDeviceProcAddr>(
                     next_element->get_proc_addr);
@@ -614,25 +785,33 @@
                                                    "vkCreateDevice"));
     layer_createDevice(pdev, create_info, &drv_device);
 
+    // TODO(mlentine) : This is needed to use WSI layer validation. Remove this
+    // when new version of layer initialization exits.
+    if (!LoadDeviceVtbl(static_cast<VkDevice>(base_object),
+                        static_cast<VkDevice>(next_object), next_get_proc_addr,
+                        device->vtbl_storage)) {
+        DestroyDevice(device);
+        return VK_ERROR_INITIALIZATION_FAILED;
+    }
+
     *out_device = drv_device;
     return VK_SUCCESS;
 }
 
-VkResult GetPhysicalDeviceExtensionPropertiesBottom(
+VkResult EnumerateDeviceExtensionPropertiesBottom(
     VkPhysicalDevice pdev,
     const char* layer_name,
     uint32_t* properties_count,
     VkExtensionProperties* properties) {
     // TODO: what are we supposed to do with layer_name here?
-    return GetVtbl(pdev)
-        ->instance->drv.vtbl.GetPhysicalDeviceExtensionProperties(
-            pdev, layer_name, properties_count, properties);
+    return GetVtbl(pdev)->instance->drv.vtbl.EnumerateDeviceExtensionProperties(
+        pdev, layer_name, properties_count, properties);
 }
 
-VkResult GetPhysicalDeviceLayerPropertiesBottom(VkPhysicalDevice pdev,
-                                                uint32_t* properties_count,
-                                                VkLayerProperties* properties) {
-    return GetVtbl(pdev)->instance->drv.vtbl.GetPhysicalDeviceLayerProperties(
+VkResult EnumerateDeviceLayerPropertiesBottom(VkPhysicalDevice pdev,
+                                              uint32_t* properties_count,
+                                              VkLayerProperties* properties) {
+    return GetVtbl(pdev)->instance->drv.vtbl.EnumerateDeviceLayerProperties(
         pdev, properties_count, properties);
 }
 
@@ -663,23 +842,17 @@
     .GetPhysicalDeviceFeatures = GetPhysicalDeviceFeaturesBottom,
     .GetPhysicalDeviceFormatProperties = GetPhysicalDeviceFormatPropertiesBottom,
     .GetPhysicalDeviceImageFormatProperties = GetPhysicalDeviceImageFormatPropertiesBottom,
-    .GetPhysicalDeviceLimits = GetPhysicalDeviceLimitsBottom,
     .GetPhysicalDeviceProperties = GetPhysicalDevicePropertiesBottom,
-    .GetPhysicalDeviceQueueCount = GetPhysicalDeviceQueueCountBottom,
-    .GetPhysicalDeviceQueueProperties = GetPhysicalDeviceQueuePropertiesBottom,
+    .GetPhysicalDeviceQueueFamilyProperties = GetPhysicalDeviceQueueFamilyPropertiesBottom,
     .GetPhysicalDeviceMemoryProperties = GetPhysicalDeviceMemoryPropertiesBottom,
     .CreateDevice = CreateDeviceBottom,
-    .GetPhysicalDeviceExtensionProperties = GetPhysicalDeviceExtensionPropertiesBottom,
-    .GetPhysicalDeviceLayerProperties = GetPhysicalDeviceLayerPropertiesBottom,
+    .EnumerateDeviceExtensionProperties = EnumerateDeviceExtensionPropertiesBottom,
+    .EnumerateDeviceLayerProperties = EnumerateDeviceLayerPropertiesBottom,
     .GetPhysicalDeviceSparseImageFormatProperties = GetPhysicalDeviceSparseImageFormatPropertiesBottom,
     .GetPhysicalDeviceSurfaceSupportKHR = GetPhysicalDeviceSurfaceSupportKHR,
     // clang-format on
 };
 
-VkResult Noop(...) {
-    return VK_SUCCESS;
-}
-
 PFN_vkVoidFunction GetInstanceProcAddrBottom(VkInstance, const char* name) {
     // TODO: Possibly move this into the instance table
     // TODO: Possibly register the callbacks in the loader
@@ -701,30 +874,27 @@
 
 namespace vulkan {
 
-VkResult GetGlobalExtensionProperties(const char* /*layer_name*/,
-                                      uint32_t* count,
-                                      VkExtensionProperties* /*properties*/) {
-    if (!count)
-        return VK_ERROR_INVALID_POINTER;
+VkResult EnumerateInstanceExtensionProperties(
+    const char* /*layer_name*/,
+    uint32_t* count,
+    VkExtensionProperties* /*properties*/) {
     if (!EnsureInitialized())
-        return VK_ERROR_UNAVAILABLE;
+        return VK_ERROR_INITIALIZATION_FAILED;
 
     // TODO: not yet implemented
-    ALOGW("vkGetGlobalExtensionProperties not implemented");
+    ALOGW("vkEnumerateInstanceExtensionProperties not implemented");
 
     *count = 0;
     return VK_SUCCESS;
 }
 
-VkResult GetGlobalLayerProperties(uint32_t* count,
-                                  VkLayerProperties* /*properties*/) {
-    if (!count)
-        return VK_ERROR_INVALID_POINTER;
+VkResult EnumerateInstanceLayerProperties(uint32_t* count,
+                                          VkLayerProperties* /*properties*/) {
     if (!EnsureInitialized())
-        return VK_ERROR_UNAVAILABLE;
+        return VK_ERROR_INITIALIZATION_FAILED;
 
     // TODO: not yet implemented
-    ALOGW("vkGetGlobalLayerProperties not implemented");
+    ALOGW("vkEnumerateInstanceLayerProperties not implemented");
 
     *count = 0;
     return VK_SUCCESS;
@@ -735,7 +905,7 @@
     VkResult result;
 
     if (!EnsureInitialized())
-        return VK_ERROR_UNAVAILABLE;
+        return VK_ERROR_INITIALIZATION_FAILED;
 
     VkInstanceCreateInfo local_create_info = *create_info;
     if (!local_create_info.pAllocCb)
@@ -754,49 +924,19 @@
     instance->message = VK_NULL_HANDLE;
 
     // Scan layers
-    UnorderedMap<String, SharedLibraryHandle> layers(
-        CallbackAllocator<std::pair<String, SharedLibraryHandle> >(
-            instance->alloc));
     CallbackAllocator<char> string_allocator(instance->alloc);
+
     String dir_name("/data/local/tmp/vulkan/", string_allocator);
-    FindLayersInDirectory(*instance, layers, dir_name);
+    FindLayersInDirectory(*instance, dir_name);
     const std::string& path = LoaderData::GetInstance().layer_path;
     dir_name.assign(path.c_str(), path.size());
     dir_name.append("/");
-    FindLayersInDirectory(*instance, layers, dir_name);
+    FindLayersInDirectory(*instance, dir_name);
 
-    // Load layers
-    {
-        char layer_prop[PROPERTY_VALUE_MAX];
-        property_get("debug.vulkan.layers", layer_prop, "");
-        String layer_name(string_allocator);
-        String layer_prop_str(layer_prop, string_allocator);
-        size_t end, start = 0;
-        while ((end = layer_prop_str.find(':', start)) != std::string::npos) {
-            layer_name = layer_prop_str.substr(start, end - start);
-            auto element = layers.find(layer_name);
-            if (element != layers.end()) {
-                LoadLayer(instance, layer_name, element->second);
-                layers.erase(element);
-            }
-            start = end + 1;
-        }
-        InstanceLayersPair instance_layers_pair = {.instance = instance,
-                                                   .layers = &layers};
-        property_list(LoadLayerFromProperty,
-                      static_cast<void*>(&instance_layers_pair));
-    }
-    for (uint32_t i = 0; i < create_info->layerCount; ++i) {
-        String layer_name(create_info->ppEnabledLayerNames[i],
-                          string_allocator);
-        auto element = layers.find(layer_name);
-        if (element != layers.end()) {
-            LoadLayer(instance, layer_name, element->second);
-            layers.erase(element);
-        }
-    }
-    for (auto& layer : layers) {
-        dlclose(layer.second);
+    result = ActivateAllLayers(create_info, instance, instance);
+    if (result != VK_SUCCESS) {
+        DestroyInstanceBottom(instance);
+        return result;
     }
 
     void* base_object = static_cast<void*>(instance);
@@ -817,16 +957,16 @@
         next_element->next_element = next_object;
         next_object = static_cast<void*>(next_element);
 
-        auto& name_libhandle_pair = instance->active_layers[idx];
+        auto& name = instance->active_layers[idx]->first;
+        auto& handle = instance->active_layers[idx]->second.handle;
         next_get_proc_addr = reinterpret_cast<PFN_vkGetInstanceProcAddr>(
-            dlsym(name_libhandle_pair.second,
-                  (name_libhandle_pair.first + "GetInstanceProcAddr").c_str()));
+            dlsym(handle, (name + "GetInstanceProcAddr").c_str()));
         if (!next_get_proc_addr) {
             next_get_proc_addr = reinterpret_cast<PFN_vkGetInstanceProcAddr>(
-                dlsym(name_libhandle_pair.second, "vkGetInstanceProcAddr"));
+                dlsym(handle, "vkGetInstanceProcAddr"));
             if (!next_get_proc_addr) {
                 ALOGE("Cannot find vkGetInstanceProcAddr for %s, error is %s",
-                      name_libhandle_pair.first.c_str(), dlerror());
+                      name.c_str(), dlerror());
                 next_object = next_element->next_element;
                 next_get_proc_addr =
                     reinterpret_cast<PFN_vkGetInstanceProcAddr>(
@@ -844,48 +984,18 @@
 
     // Force enable callback extension if required
     bool enable_callback =
-        property_get_bool("debug.vulkan.enable_layer_callback", false);
+        property_get_bool("debug.vulkan.enable_callback", false);
     bool enable_logging = enable_callback;
-    const char* callback_name = "DEBUG_REPORT";
+    const char* extension_name = "DEBUG_REPORT";
     if (enable_callback) {
-        for (uint32_t i = 0; i < create_info->extensionCount; ++i) {
-            if (!strcmp(callback_name,
-                        create_info->ppEnabledExtensionNames[i])) {
-                enable_callback = false;
-                break;
-            }
-        }
-    }
-    if (enable_callback) {
-        uint32_t extension_count = local_create_info.extensionCount;
-        local_create_info.extensionCount++;
-        void* mem = instance->alloc->pfnAlloc(
-            instance->alloc->pUserData,
-            local_create_info.extensionCount * sizeof(char*), alignof(char*),
-            VK_SYSTEM_ALLOC_TYPE_INTERNAL);
-        if (mem) {
-            const char** enabled_extensions = static_cast<const char**>(mem);
-            for (uint32_t i = 0; i < extension_count; ++i) {
-                enabled_extensions[i] =
-                    local_create_info.ppEnabledExtensionNames[i];
-            }
-            enabled_extensions[extension_count] = callback_name;
-            local_create_info.ppEnabledExtensionNames = enabled_extensions;
-        } else {
-            ALOGW("DEBUG_REPORT extension cannot be enabled!");
-            enable_callback = false;
-            local_create_info.extensionCount--;
-        }
+        enable_callback = AddExtensionToCreateInfo(
+            local_create_info, extension_name, instance->alloc);
     }
 
     *out_instance = instance;
     result = instance->vtbl_storage.CreateInstance(create_info, out_instance);
-    if (enable_callback) {
-        const char* const* enabled_extensions =
-            local_create_info.ppEnabledExtensionNames;
-        instance->alloc->pfnFree(instance->alloc->pUserData,
-                                 const_cast<char**>(enabled_extensions));
-    }
+    if (enable_callback)
+        FreeAllocatedCreateInfo(local_create_info, instance->alloc);
     if (result <= 0) {
         // For every layer, including the loader top and bottom layers:
         // - If a call to the next CreateInstance fails, the layer must clean
@@ -903,11 +1013,12 @@
 
     if (enable_logging) {
         PFN_vkDbgCreateMsgCallback DebugCreateMessageCallback;
-        DebugCreateMessageCallback = reinterpret_cast<PFN_vkDbgCreateMsgCallback>(
-            vkGetInstanceProcAddr(instance, "vkDbgCreateMsgCallback"));
-        DebugCreateMessageCallback(instance,
-                             VK_DBG_REPORT_ERROR_BIT | VK_DBG_REPORT_WARN_BIT,
-                             LogDebugMessageCallback, NULL, &instance->message);
+        DebugCreateMessageCallback =
+            reinterpret_cast<PFN_vkDbgCreateMsgCallback>(
+                vkGetInstanceProcAddr(instance, "vkDbgCreateMsgCallback"));
+        DebugCreateMessageCallback(
+            instance, VK_DBG_REPORT_ERROR_BIT | VK_DBG_REPORT_WARN_BIT,
+            LogDebugMessageCallback, NULL, &instance->message);
     }
 
     return result;
@@ -938,11 +1049,14 @@
     if (strcmp(name, "vkGetDeviceProcAddr") == 0) {
         return reinterpret_cast<PFN_vkVoidFunction>(GetDeviceProcAddr);
     }
-    // For special-case functions we always return the loader entry
-    if (strcmp(name, "vkGetDeviceQueue") == 0 ||
-        strcmp(name, "vkCreateCommandBuffer") == 0 ||
-        strcmp(name, "vkDestroyDevice") == 0) {
-        return GetGlobalDeviceProcAddr(name);
+    if (strcmp(name, "vkGetDeviceQueue") == 0) {
+        return reinterpret_cast<PFN_vkVoidFunction>(GetDeviceQueue);
+    }
+    if (strcmp(name, "vkCreateCommandBuffer") == 0) {
+        return reinterpret_cast<PFN_vkVoidFunction>(CreateCommandBuffer);
+    }
+    if (strcmp(name, "vkDestroyDevice") == 0) {
+        return reinterpret_cast<PFN_vkVoidFunction>(DestroyDevice);
     }
     return GetSpecificDeviceProcAddr(GetVtbl(device), name);
 }
@@ -959,7 +1073,7 @@
         return result;
     hwvulkan_dispatch_t* dispatch =
         reinterpret_cast<hwvulkan_dispatch_t*>(queue);
-    if (dispatch->magic != HWVULKAN_DISPATCH_MAGIC && dispatch->vtbl != &vtbl) {
+    if (dispatch->magic != HWVULKAN_DISPATCH_MAGIC && dispatch->vtbl != vtbl) {
         ALOGE("invalid VkQueue dispatch magic: 0x%" PRIxPTR, dispatch->magic);
         return VK_ERROR_INITIALIZATION_FAILED;
     }
@@ -992,6 +1106,10 @@
 VkResult DestroyDevice(VkDevice drv_device) {
     const DeviceVtbl* vtbl = GetVtbl(drv_device);
     Device* device = static_cast<Device*>(vtbl->device);
+    for (auto it = device->active_layers.begin();
+         it != device->active_layers.end(); ++it) {
+        DeactivateLayer(device->instance, it);
+    }
     vtbl->DestroyDevice(drv_device);
     DestroyDevice(device);
     return VK_SUCCESS;
@@ -1002,13 +1120,13 @@
                      size_t align,
                      VkSystemAllocType type) {
     const VkAllocCallbacks* alloc_cb =
-        static_cast<Device*>(GetVtbl(device)->device)->alloc;
+        static_cast<Device*>(GetVtbl(device)->device)->instance->alloc;
     return alloc_cb->pfnAlloc(alloc_cb->pUserData, size, align, type);
 }
 
 void FreeDeviceMem(VkDevice device, void* ptr) {
     const VkAllocCallbacks* alloc_cb =
-        static_cast<Device*>(GetVtbl(device)->device)->alloc;
+        static_cast<Device*>(GetVtbl(device)->device)->instance->alloc;
     alloc_cb->pfnFree(alloc_cb->pUserData, ptr);
 }
 
diff --git a/vulkan/libvulkan/loader.h b/vulkan/libvulkan/loader.h
index 5933eb2..6999e1e 100644
--- a/vulkan/libvulkan/loader.h
+++ b/vulkan/libvulkan/loader.h
@@ -43,14 +43,12 @@
     PFN_vkGetPhysicalDeviceFeatures GetPhysicalDeviceFeatures;
     PFN_vkGetPhysicalDeviceFormatProperties GetPhysicalDeviceFormatProperties;
     PFN_vkGetPhysicalDeviceImageFormatProperties GetPhysicalDeviceImageFormatProperties;
-    PFN_vkGetPhysicalDeviceLimits GetPhysicalDeviceLimits;
     PFN_vkGetPhysicalDeviceProperties GetPhysicalDeviceProperties;
-    PFN_vkGetPhysicalDeviceQueueCount GetPhysicalDeviceQueueCount;
-    PFN_vkGetPhysicalDeviceQueueProperties GetPhysicalDeviceQueueProperties;
+    PFN_vkGetPhysicalDeviceQueueFamilyProperties GetPhysicalDeviceQueueFamilyProperties;
     PFN_vkGetPhysicalDeviceMemoryProperties GetPhysicalDeviceMemoryProperties;
     PFN_vkCreateDevice CreateDevice;
-    PFN_vkGetPhysicalDeviceExtensionProperties GetPhysicalDeviceExtensionProperties;
-    PFN_vkGetPhysicalDeviceLayerProperties GetPhysicalDeviceLayerProperties;
+    PFN_vkEnumerateDeviceExtensionProperties EnumerateDeviceExtensionProperties;
+    PFN_vkEnumerateDeviceLayerProperties EnumerateDeviceLayerProperties;
     PFN_vkGetPhysicalDeviceSparseImageFormatProperties GetPhysicalDeviceSparseImageFormatProperties;
 
     // Layers and loader only, not implemented by drivers
@@ -101,8 +99,6 @@
     PFN_vkGetImageSubresourceLayout GetImageSubresourceLayout;
     PFN_vkCreateImageView CreateImageView;
     PFN_vkDestroyImageView DestroyImageView;
-    PFN_vkCreateAttachmentView CreateAttachmentView;
-    PFN_vkDestroyAttachmentView DestroyAttachmentView;
     PFN_vkCreateShaderModule CreateShaderModule;
     PFN_vkDestroyShaderModule DestroyShaderModule;
     PFN_vkCreateShader CreateShader;
@@ -127,14 +123,6 @@
     PFN_vkAllocDescriptorSets AllocDescriptorSets;
     PFN_vkFreeDescriptorSets FreeDescriptorSets;
     PFN_vkUpdateDescriptorSets UpdateDescriptorSets;
-    PFN_vkCreateDynamicViewportState CreateDynamicViewportState;
-    PFN_vkDestroyDynamicViewportState DestroyDynamicViewportState;
-    PFN_vkCreateDynamicRasterState CreateDynamicRasterState;
-    PFN_vkDestroyDynamicRasterState DestroyDynamicRasterState;
-    PFN_vkCreateDynamicColorBlendState CreateDynamicColorBlendState;
-    PFN_vkDestroyDynamicColorBlendState DestroyDynamicColorBlendState;
-    PFN_vkCreateDynamicDepthStencilState CreateDynamicDepthStencilState;
-    PFN_vkDestroyDynamicDepthStencilState DestroyDynamicDepthStencilState;
     PFN_vkCreateFramebuffer CreateFramebuffer;
     PFN_vkDestroyFramebuffer DestroyFramebuffer;
     PFN_vkCreateRenderPass CreateRenderPass;
@@ -158,10 +146,15 @@
     PFN_vkEndCommandBuffer EndCommandBuffer;
     PFN_vkResetCommandBuffer ResetCommandBuffer;
     PFN_vkCmdBindPipeline CmdBindPipeline;
-    PFN_vkCmdBindDynamicViewportState CmdBindDynamicViewportState;
-    PFN_vkCmdBindDynamicRasterState CmdBindDynamicRasterState;
-    PFN_vkCmdBindDynamicColorBlendState CmdBindDynamicColorBlendState;
-    PFN_vkCmdBindDynamicDepthStencilState CmdBindDynamicDepthStencilState;
+    PFN_vkCmdSetViewport CmdSetViewport;
+    PFN_vkCmdSetScissor CmdSetScissor;
+    PFN_vkCmdSetLineWidth CmdSetLineWidth;
+    PFN_vkCmdSetDepthBias CmdSetDepthBias;
+    PFN_vkCmdSetBlendConstants CmdSetBlendConstants;
+    PFN_vkCmdSetDepthBounds CmdSetDepthBounds;
+    PFN_vkCmdSetStencilCompareMask CmdSetStencilCompareMask;
+    PFN_vkCmdSetStencilWriteMask CmdSetStencilWriteMask;
+    PFN_vkCmdSetStencilReference CmdSetStencilReference;
     PFN_vkCmdBindDescriptorSets CmdBindDescriptorSets;
     PFN_vkCmdBindIndexBuffer CmdBindIndexBuffer;
     PFN_vkCmdBindVertexBuffers CmdBindVertexBuffers;
@@ -209,6 +202,9 @@
     PFN_vkQueuePresentKHR QueuePresentKHR;
 
     // Implemented only by drivers, not by layers or the loader
+    PFN_vkGetSwapchainGrallocUsageANDROID GetSwapchainGrallocUsageANDROID;
+    PFN_vkAcquireImageANDROID AcquireImageANDROID;
+    PFN_vkQueueSignalReleaseImageANDROID QueueSignalReleaseImageANDROID;
     PFN_vkImportNativeFenceANDROID ImportNativeFenceANDROID;
     PFN_vkQueueSignalNativeFenceANDROID QueueSignalNativeFenceANDROID;
 };
@@ -216,11 +212,12 @@
 // -----------------------------------------------------------------------------
 // loader.cpp
 
-VkResult GetGlobalExtensionProperties(const char* layer_name,
-                                      uint32_t* count,
-                                      VkExtensionProperties* properties);
-VkResult GetGlobalLayerProperties(uint32_t* count,
-                                  VkLayerProperties* properties);
+VkResult EnumerateInstanceExtensionProperties(
+    const char* layer_name,
+    uint32_t* count,
+    VkExtensionProperties* properties);
+VkResult EnumerateInstanceLayerProperties(uint32_t* count,
+                                          VkLayerProperties* properties);
 VkResult CreateInstance(const VkInstanceCreateInfo* create_info,
                         VkInstance* instance);
 PFN_vkVoidFunction GetInstanceProcAddr(VkInstance instance, const char* name);
diff --git a/vulkan/libvulkan/swapchain.cpp b/vulkan/libvulkan/swapchain.cpp
index af3d585..53c13a9 100644
--- a/vulkan/libvulkan/swapchain.cpp
+++ b/vulkan/libvulkan/swapchain.cpp
@@ -27,6 +27,11 @@
 
 using namespace vulkan;
 
+// TODO(jessehall): Currently we don't have a good error code for when a native
+// window operation fails. Just returning INITIALIZATION_FAILED for now. Later
+// versions (post SDK 0.9) of the API/extension have a better error code.
+// When updating to that version, audit all error returns.
+
 namespace {
 
 // ----------------------------------------------------------------------------
@@ -118,8 +123,11 @@
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored "-Wold-style-cast"
 #pragma clang diagnostic ignored "-Wsign-conversion"
-    if (surface_desc->sType != VK_STRUCTURE_TYPE_SURFACE_DESCRIPTION_WINDOW_KHR)
-        return VK_ERROR_INVALID_VALUE;
+    ALOGE_IF(
+        surface_desc->sType != VK_STRUCTURE_TYPE_SURFACE_DESCRIPTION_WINDOW_KHR,
+        "vkGetPhysicalDeviceSurfaceSupportKHR: pSurfaceDescription->sType=%#x "
+        "not supported",
+        surface_desc->sType);
 #pragma clang diagnostic pop
 
     const VkSurfaceDescriptionWindowKHR* window_desc =
@@ -170,7 +178,7 @@
     } else if (err != 0) {
         // TODO(jessehall): Improve error reporting. Can we enumerate possible
         // errors and translate them to valid Vulkan result codes?
-        return VK_ERROR_UNKNOWN;
+        return VK_ERROR_INITIALIZATION_FAILED;
     }
 
     int width, height;
@@ -180,7 +188,7 @@
               strerror(-err), err);
         if (disconnect)
             native_window_api_disconnect(window, NATIVE_WINDOW_API_EGL);
-        return VK_ERROR_UNKNOWN;
+        return VK_ERROR_INITIALIZATION_FAILED;
     }
     err = window->query(window, NATIVE_WINDOW_DEFAULT_HEIGHT, &height);
     if (err != 0) {
@@ -188,7 +196,7 @@
               strerror(-err), err);
         if (disconnect)
             native_window_api_disconnect(window, NATIVE_WINDOW_API_EGL);
-        return VK_ERROR_UNKNOWN;
+        return VK_ERROR_INITIALIZATION_FAILED;
     }
 
     if (disconnect)
@@ -298,6 +306,8 @@
     // -- Configure the native window --
     // Failure paths from here on need to disconnect the window.
 
+    const DeviceVtbl& driver_vtbl = GetDriverVtbl(device);
+
     std::shared_ptr<ANativeWindow> window = InitSharedPtr(
         device, static_cast<ANativeWindow*>(
                     reinterpret_cast<const VkSurfaceDescriptionWindowKHR*>(
@@ -311,7 +321,7 @@
         // errors and translate them to valid Vulkan result codes?
         ALOGE("native_window_api_connect() failed: %s (%d)", strerror(-err),
               err);
-        return VK_ERROR_UNKNOWN;
+        return VK_ERROR_INITIALIZATION_FAILED;
     }
 
     err = native_window_set_buffers_dimensions(window.get(),
@@ -324,7 +334,18 @@
               create_info->imageExtent.width, create_info->imageExtent.height,
               strerror(-err), err);
         native_window_api_disconnect(window.get(), NATIVE_WINDOW_API_EGL);
-        return VK_ERROR_UNKNOWN;
+        return VK_ERROR_INITIALIZATION_FAILED;
+    }
+
+    err = native_window_set_scaling_mode(
+        window.get(), NATIVE_WINDOW_SCALING_MODE_SCALE_TO_WINDOW);
+    if (err != 0) {
+        // TODO(jessehall): Improve error reporting. Can we enumerate possible
+        // errors and translate them to valid Vulkan result codes?
+        ALOGE("native_window_set_scaling_mode(SCALE_TO_WINDOW) failed: %s (%d)",
+              strerror(-err), err);
+        native_window_api_disconnect(window.get(), NATIVE_WINDOW_API_EGL);
+        return VK_ERROR_INITIALIZATION_FAILED;
     }
 
     uint32_t min_undequeued_buffers;
@@ -335,7 +356,7 @@
         // errors and translate them to valid Vulkan result codes?
         ALOGE("window->query failed: %s (%d)", strerror(-err), err);
         native_window_api_disconnect(window.get(), NATIVE_WINDOW_API_EGL);
-        return VK_ERROR_UNKNOWN;
+        return VK_ERROR_INITIALIZATION_FAILED;
     }
     uint32_t num_images =
         (create_info->minImageCount - 1) + min_undequeued_buffers;
@@ -346,11 +367,31 @@
         ALOGE("native_window_set_buffer_count failed: %s (%d)", strerror(-err),
               err);
         native_window_api_disconnect(window.get(), NATIVE_WINDOW_API_EGL);
-        return VK_ERROR_UNKNOWN;
+        return VK_ERROR_INITIALIZATION_FAILED;
     }
 
-    // TODO(jessehall): Do we need to call modify native_window_set_usage()
-    // based on create_info->imageUsageFlags?
+    int gralloc_usage = 0;
+    // TODO(jessehall): Remove conditional once all drivers have been updated
+    if (driver_vtbl.GetSwapchainGrallocUsageANDROID) {
+        result = driver_vtbl.GetSwapchainGrallocUsageANDROID(
+            device, create_info->imageFormat, create_info->imageUsageFlags,
+            &gralloc_usage);
+        if (result != VK_SUCCESS) {
+            ALOGE("vkGetSwapchainGrallocUsageANDROID failed: %d", result);
+            native_window_api_disconnect(window.get(), NATIVE_WINDOW_API_EGL);
+            return VK_ERROR_INITIALIZATION_FAILED;
+        }
+    } else {
+        gralloc_usage = GRALLOC_USAGE_HW_RENDER | GRALLOC_USAGE_HW_TEXTURE;
+    }
+    err = native_window_set_usage(window.get(), gralloc_usage);
+    if (err != 0) {
+        // TODO(jessehall): Improve error reporting. Can we enumerate possible
+        // errors and translate them to valid Vulkan result codes?
+        ALOGE("native_window_set_usage failed: %s (%d)", strerror(-err), err);
+        native_window_api_disconnect(window.get(), NATIVE_WINDOW_API_EGL);
+        return VK_ERROR_INITIALIZATION_FAILED;
+    }
 
     // -- Allocate our Swapchain object --
     // After this point, we must deallocate the swapchain on error.
@@ -391,7 +432,6 @@
         .pQueueFamilyIndices = create_info->pQueueFamilyIndices,
     };
 
-    const DeviceVtbl& driver_vtbl = GetDriverVtbl(device);
     for (uint32_t i = 0; i < num_images; i++) {
         Swapchain::Image& img = swapchain->images[i];
 
@@ -401,7 +441,7 @@
             // TODO(jessehall): Improve error reporting. Can we enumerate
             // possible errors and translate them to valid Vulkan result codes?
             ALOGE("dequeueBuffer[%u] failed: %s (%d)", i, strerror(-err), err);
-            result = VK_ERROR_UNKNOWN;
+            result = VK_ERROR_INITIALIZATION_FAILED;
             break;
         }
         img.buffer = InitSharedPtr(device, buffer);
@@ -517,7 +557,7 @@
         // TODO(jessehall): Improve error reporting. Can we enumerate possible
         // errors and translate them to valid Vulkan result codes?
         ALOGE("dequeueBuffer failed: %s (%d)", strerror(-err), err);
-        return VK_ERROR_UNKNOWN;
+        return VK_ERROR_INITIALIZATION_FAILED;
     }
 
     uint32_t idx;
@@ -548,14 +588,24 @@
     }
 
     const DeviceVtbl& driver_vtbl = GetDriverVtbl(device);
-    result =
-        driver_vtbl.ImportNativeFenceANDROID(device, semaphore, fence_clone);
+    if (driver_vtbl.AcquireImageANDROID) {
+        result = driver_vtbl.AcquireImageANDROID(
+            device, swapchain.images[idx].image, fence_clone, semaphore);
+    } else {
+        ALOG_ASSERT(driver_vtbl.ImportNativeFenceANDROID,
+                    "Have neither vkAcquireImageANDROID nor "
+                    "vkImportNativeFenceANDROID");
+        result = driver_vtbl.ImportNativeFenceANDROID(device, semaphore,
+                                                      fence_clone);
+    }
     if (result != VK_SUCCESS) {
-        // NOTE: we're relying on ImportNativeFenceANDROID to close
-        // fence_clone, even if the call fails. We could close it ourselves on
-        // failure, but that would create a race condition if the driver closes
-        // it on a failure path. We must assume one of: the driver *always*
-        // closes it even on failure, or *never* closes it on failure.
+        // NOTE: we're relying on AcquireImageANDROID to close fence_clone,
+        // even if the call fails. We could close it ourselves on failure, but
+        // that would create a race condition if the driver closes it on a
+        // failure path: some other thread might create an fd with the same
+        // number between the time the driver closes it and the time we close
+        // it. We must assume one of: the driver *always* closes it even on
+        // failure, or *never* closes it on failure.
         swapchain.window->cancelBuffer(swapchain.window.get(), buffer, fence);
         swapchain.images[idx].dequeued = false;
         swapchain.images[idx].dequeue_fence = -1;
@@ -582,24 +632,22 @@
         Swapchain& swapchain =
             *SwapchainFromHandle(present_info->swapchains[sc]);
         uint32_t image_idx = present_info->imageIndices[sc];
+        Swapchain::Image& img = swapchain.images[image_idx];
         VkResult result;
         int err;
 
-        if (image_idx >= swapchain.num_images ||
-            !swapchain.images[image_idx].dequeued) {
-            ALOGE(
-                "invalid image index or image not acquired: swapchain=%u "
-                "index=%u",
-                sc, image_idx);
-            final_result = VK_ERROR_INVALID_VALUE;
-            continue;
-        }
-        Swapchain::Image& img = swapchain.images[image_idx];
-
         int fence = -1;
-        result = driver_vtbl.QueueSignalNativeFenceANDROID(queue, &fence);
+        if (driver_vtbl.QueueSignalReleaseImageANDROID) {
+            result = driver_vtbl.QueueSignalReleaseImageANDROID(
+                queue, img.image, &fence);
+        } else {
+            ALOG_ASSERT(driver_vtbl.QueueSignalNativeFenceANDROID,
+                        "Have neither vkQueueSignalReleaseImageANDROID nor "
+                        "vkQueueSignalNativeFenceANDROID");
+            result = driver_vtbl.QueueSignalNativeFenceANDROID(queue, &fence);
+        }
         if (result != VK_SUCCESS) {
-            ALOGE("vkQueueSignalNativeFenceANDROID failed: %d", result);
+            ALOGE("QueueSignalReleaseImageANDROID failed: %d", result);
             if (final_result == VK_SUCCESS)
                 final_result = result;
             // TODO(jessehall): What happens to the buffer here? Does the app
@@ -616,7 +664,7 @@
             // I guess?
             ALOGE("queueBuffer failed: %s (%d)", strerror(-err), err);
             if (final_result == VK_SUCCESS)
-                final_result = VK_ERROR_UNKNOWN;
+                final_result = VK_ERROR_INITIALIZATION_FAILED;
             continue;
         }
 
diff --git a/vulkan/nulldrv/null_driver.cpp b/vulkan/nulldrv/null_driver.cpp
index 8f65156..053e403 100644
--- a/vulkan/nulldrv/null_driver.cpp
+++ b/vulkan/nulldrv/null_driver.cpp
@@ -66,16 +66,11 @@
 // constants but also want implicit conversions to integral types.
 namespace HandleType {
 enum Enum {
-    kAttachmentView,
     kBufferView,
     kCmdPool,
     kDescriptorPool,
     kDescriptorSet,
     kDescriptorSetLayout,
-    kDynamicColorBlendState,
-    kDynamicDepthStencilState,
-    kDynamicRasterState,
-    kDynamicViewportState,
     kEvent,
     kFence,
     kFramebuffer,
@@ -170,7 +165,8 @@
             .module = &HAL_MODULE_INFO_SYM.common,
             .close = CloseDevice,
         },
-    .GetGlobalExtensionProperties = GetGlobalExtensionProperties,
+    .EnumerateInstanceExtensionProperties =
+        EnumerateInstanceExtensionProperties,
     .CreateInstance = CreateInstance,
     .GetInstanceProcAddr = GetInstanceProcAddr};
 
@@ -221,9 +217,9 @@
 // -----------------------------------------------------------------------------
 // Global
 
-VkResult GetGlobalExtensionProperties(const char*,
-                                      uint32_t* count,
-                                      VkExtensionProperties*) {
+VkResult EnumerateInstanceExtensionProperties(const char*,
+                                              uint32_t* count,
+                                              VkExtensionProperties*) {
     *count = 0;
     return VK_SUCCESS;
 }
@@ -239,20 +235,22 @@
     PFN_vkVoidFunction proc = LookupDeviceProcAddr(name);
     if (proc)
         return proc;
-    if (strcmp(name, "vkImportNativeFenceANDROID") == 0)
-        return reinterpret_cast<PFN_vkVoidFunction>(ImportNativeFenceANDROID);
-    if (strcmp(name, "vkQueueSignalNativeFenceANDROID") == 0)
+    if (strcmp(name, "vkGetSwapchainGrallocUsageANDROID") == 0)
         return reinterpret_cast<PFN_vkVoidFunction>(
-            QueueSignalNativeFenceANDROID);
+            GetSwapchainGrallocUsageANDROID);
+    if (strcmp(name, "vkAcquireImageANDROID") == 0)
+        return reinterpret_cast<PFN_vkVoidFunction>(AcquireImageANDROID);
+    if (strcmp(name, "vkQueueSignalReleaseImageANDROID") == 0)
+        return reinterpret_cast<PFN_vkVoidFunction>(
+            QueueSignalReleaseImageANDROID);
     return nullptr;
 }
 
 // -----------------------------------------------------------------------------
 // Instance
 
-VkResult DestroyInstance(VkInstance instance) {
+void DestroyInstance(VkInstance instance) {
     instance->alloc->pfnFree(instance->alloc->pUserData, instance);
-    return VK_SUCCESS;
 }
 
 // -----------------------------------------------------------------------------
@@ -271,8 +269,8 @@
                                      VkPhysicalDeviceProperties* properties) {
     properties->apiVersion = VK_API_VERSION;
     properties->driverVersion = VK_MAKE_VERSION(0, 0, 1);
-    properties->vendorId = 0xC0DE;
-    properties->deviceId = 0xCAFE;
+    properties->vendorId = 0;
+    properties->deviceId = 0;
     properties->deviceType = VK_PHYSICAL_DEVICE_TYPE_OTHER;
     strcpy(properties->deviceName, "Android Vulkan Null Driver");
     memset(properties->pipelineCacheUUID, 0,
@@ -280,6 +278,22 @@
     return VK_SUCCESS;
 }
 
+VkResult GetPhysicalDeviceQueueFamilyProperties(
+    VkPhysicalDevice,
+    uint32_t* count,
+    VkQueueFamilyProperties* properties) {
+    if (properties) {
+        if (*count < 1)
+            return VK_INCOMPLETE;
+        properties->queueFlags =
+            VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_COMPUTE_BIT | VK_QUEUE_DMA_BIT;
+        properties->queueCount = 1;
+        properties->supportsTimestamps = VK_FALSE;
+    }
+    *count = 1;
+    return VK_SUCCESS;
+}
+
 VkResult GetPhysicalDeviceMemoryProperties(
     VkPhysicalDevice,
     VkPhysicalDeviceMemoryProperties* properties) {
@@ -289,7 +303,7 @@
     properties->memoryTypes[0].heapIndex = 0;
     properties->memoryHeapCount = 1;
     properties->memoryHeaps[0].size = kMaxDeviceMemory;
-    properties->memoryHeaps[0].flags = VK_MEMORY_HEAP_HOST_LOCAL;
+    properties->memoryHeaps[0].flags = VK_MEMORY_HEAP_HOST_LOCAL_BIT;
     return VK_SUCCESS;
 }
 
@@ -316,12 +330,11 @@
     return VK_SUCCESS;
 }
 
-VkResult DestroyDevice(VkDevice device) {
+void DestroyDevice(VkDevice device) {
     if (!device)
-        return VK_SUCCESS;
+        return;
     const VkAllocCallbacks* alloc = device->instance->alloc;
     alloc->pfnFree(alloc->pUserData, device);
-    return VK_SUCCESS;
 }
 
 VkResult GetDeviceQueue(VkDevice device, uint32_t, uint32_t, VkQueue* queue) {
@@ -346,10 +359,9 @@
     return VK_SUCCESS;
 }
 
-VkResult DestroyCommandBuffer(VkDevice device, VkCmdBuffer cmdbuf) {
+void DestroyCommandBuffer(VkDevice device, VkCmdBuffer cmdbuf) {
     const VkAllocCallbacks* alloc = device->instance->alloc;
     alloc->pfnFree(alloc->pUserData, cmdbuf);
-    return VK_SUCCESS;
 }
 
 // -----------------------------------------------------------------------------
@@ -383,11 +395,10 @@
     return VK_SUCCESS;
 }
 
-VkResult FreeMemory(VkDevice device, VkDeviceMemory mem_handle) {
+void FreeMemory(VkDevice device, VkDeviceMemory mem_handle) {
     const VkAllocCallbacks* alloc = device->instance->alloc;
     DeviceMemory* mem = GetObjectFromHandle(mem_handle);
     alloc->pfnFree(alloc->pUserData, mem);
-    return VK_SUCCESS;
 }
 
 VkResult MapMemory(VkDevice,
@@ -442,11 +453,10 @@
     return VK_SUCCESS;
 }
 
-VkResult DestroyBuffer(VkDevice device, VkBuffer buffer_handle) {
+void DestroyBuffer(VkDevice device, VkBuffer buffer_handle) {
     const VkAllocCallbacks* alloc = device->instance->alloc;
     Buffer* buffer = GetObjectFromHandle(buffer_handle);
     alloc->pfnFree(alloc->pUserData, buffer);
-    return VK_SUCCESS;
 }
 
 // -----------------------------------------------------------------------------
@@ -470,7 +480,7 @@
         ALOGE("CreateImage: not yet implemented: type=%d format=%d mips=%u",
               create_info->imageType, create_info->format,
               create_info->mipLevels);
-        return VK_ERROR_UNAVAILABLE;
+        return VK_UNSUPPORTED;
     }
 
     VkDeviceSize size =
@@ -502,23 +512,15 @@
     return VK_SUCCESS;
 }
 
-VkResult DestroyImage(VkDevice device, VkImage image_handle) {
+void DestroyImage(VkDevice device, VkImage image_handle) {
     const VkAllocCallbacks* alloc = device->instance->alloc;
     Image* image = GetObjectFromHandle(image_handle);
     alloc->pfnFree(alloc->pUserData, image);
-    return VK_SUCCESS;
 }
 
 // -----------------------------------------------------------------------------
 // No-op types
 
-VkResult CreateAttachmentView(VkDevice device,
-                              const VkAttachmentViewCreateInfo*,
-                              VkAttachmentView* view) {
-    *view = AllocHandle(device, HandleType::kAttachmentView);
-    return VK_SUCCESS;
-}
-
 VkResult CreateBufferView(VkDevice device,
                           const VkBufferViewCreateInfo*,
                           VkBufferView* view) {
@@ -534,8 +536,6 @@
 }
 
 VkResult CreateDescriptorPool(VkDevice device,
-                              VkDescriptorPoolUsage,
-                              uint32_t,
                               const VkDescriptorPoolCreateInfo*,
                               VkDescriptorPool* pool) {
     *pool = AllocHandle(device, HandleType::kDescriptorPool);
@@ -547,11 +547,9 @@
                              VkDescriptorSetUsage,
                              uint32_t count,
                              const VkDescriptorSetLayout*,
-                             VkDescriptorSet* sets,
-                             uint32_t* out_count) {
+                             VkDescriptorSet* sets) {
     for (uint32_t i = 0; i < count; i++)
         sets[i] = AllocHandle(device, HandleType::kDescriptorSet);
-    *out_count = count;
     return VK_SUCCESS;
 }
 
@@ -562,35 +560,6 @@
     return VK_SUCCESS;
 }
 
-VkResult CreateDynamicColorBlendState(VkDevice device,
-                                      const VkDynamicColorBlendStateCreateInfo*,
-                                      VkDynamicColorBlendState* state) {
-    *state = AllocHandle(device, HandleType::kDynamicColorBlendState);
-    return VK_SUCCESS;
-}
-
-VkResult CreateDynamicDepthStencilState(
-    VkDevice device,
-    const VkDynamicDepthStencilStateCreateInfo*,
-    VkDynamicDepthStencilState* state) {
-    *state = AllocHandle(device, HandleType::kDynamicDepthStencilState);
-    return VK_SUCCESS;
-}
-
-VkResult CreateDynamicRasterState(VkDevice device,
-                                  const VkDynamicRasterStateCreateInfo*,
-                                  VkDynamicRasterState* state) {
-    *state = AllocHandle(device, HandleType::kDynamicRasterState);
-    return VK_SUCCESS;
-}
-
-VkResult CreateDynamicViewportState(VkDevice device,
-                                    const VkDynamicViewportStateCreateInfo*,
-                                    VkDynamicViewportState* state) {
-    *state = AllocHandle(device, HandleType::kDynamicViewportState);
-    return VK_SUCCESS;
-}
-
 VkResult CreateEvent(VkDevice device,
                      const VkEventCreateInfo*,
                      VkEvent* event) {
@@ -695,12 +664,21 @@
     return VK_SUCCESS;
 }
 
-VkResult ImportNativeFenceANDROID(VkDevice, VkSemaphore, int fence) {
+VkResult GetSwapchainGrallocUsageANDROID(VkDevice,
+                                         VkFormat,
+                                         VkImageUsageFlags,
+                                         int* grallocUsage) {
+    // The null driver never reads or writes the gralloc buffer
+    *grallocUsage = 0;
+    return VK_SUCCESS;
+}
+
+VkResult AcquireImageANDROID(VkDevice, VkImage, int fence, VkSemaphore) {
     close(fence);
     return VK_SUCCESS;
 }
 
-VkResult QueueSignalNativeFenceANDROID(VkQueue, int* fence) {
+VkResult QueueSignalReleaseImageANDROID(VkQueue, VkImage, int* fence) {
     *fence = -1;
     return VK_SUCCESS;
 }
@@ -712,16 +690,6 @@
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored "-Wunused-parameter"
 
-VkResult GetPhysicalDeviceQueueCount(VkPhysicalDevice physicalDevice, uint32_t* pCount) {
-    ALOGV("TODO: vk%s", __FUNCTION__);
-    return VK_SUCCESS;
-}
-
-VkResult GetPhysicalDeviceQueueProperties(VkPhysicalDevice physicalDevice, uint32_t count, VkPhysicalDeviceQueueProperties* pQueueProperties) {
-    ALOGV("TODO: vk%s", __FUNCTION__);
-    return VK_SUCCESS;
-}
-
 VkResult GetPhysicalDeviceFeatures(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures* pFeatures) {
     ALOGV("TODO: vk%s", __FUNCTION__);
     return VK_SUCCESS;
@@ -732,27 +700,22 @@
     return VK_SUCCESS;
 }
 
-VkResult GetPhysicalDeviceImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageFormatProperties* pImageFormatProperties) {
+VkResult GetPhysicalDeviceImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, VkImageFormatProperties* pImageFormatProperties) {
     ALOGV("TODO: vk%s", __FUNCTION__);
     return VK_SUCCESS;
 }
 
-VkResult GetPhysicalDeviceLimits(VkPhysicalDevice physicalDevice, VkPhysicalDeviceLimits* pLimits) {
+VkResult EnumerateInstanceLayerProperties(uint32_t* pCount, VkLayerProperties* pProperties) {
     ALOGV("TODO: vk%s", __FUNCTION__);
     return VK_SUCCESS;
 }
 
-VkResult GetGlobalLayerProperties(uint32_t* pCount, VkLayerProperties* pProperties) {
+VkResult EnumerateDeviceLayerProperties(VkPhysicalDevice physicalDevice, uint32_t* pCount, VkLayerProperties* pProperties) {
     ALOGV("TODO: vk%s", __FUNCTION__);
     return VK_SUCCESS;
 }
 
-VkResult GetPhysicalDeviceLayerProperties(VkPhysicalDevice physicalDevice, uint32_t* pCount, VkLayerProperties* pProperties) {
-    ALOGV("TODO: vk%s", __FUNCTION__);
-    return VK_SUCCESS;
-}
-
-VkResult GetPhysicalDeviceExtensionProperties(VkPhysicalDevice physicalDevice, const char* pLayerName, uint32_t* pCount, VkExtensionProperties* pProperties) {
+VkResult EnumerateDeviceExtensionProperties(VkPhysicalDevice physicalDevice, const char* pLayerName, uint32_t* pCount, VkExtensionProperties* pProperties) {
     ALOGV("TODO: vk%s", __FUNCTION__);
     return VK_SUCCESS;
 }
@@ -771,8 +734,7 @@
     return VK_SUCCESS;
 }
 
-VkResult UnmapMemory(VkDevice device, VkDeviceMemory mem) {
-    return VK_SUCCESS;
+void UnmapMemory(VkDevice device, VkDeviceMemory mem) {
 }
 
 VkResult FlushMappedMemoryRanges(VkDevice device, uint32_t memRangeCount, const VkMappedMemoryRange* pMemRanges) {
@@ -823,8 +785,7 @@
     return VK_SUCCESS;
 }
 
-VkResult DestroyFence(VkDevice device, VkFence fence) {
-    return VK_SUCCESS;
+void DestroyFence(VkDevice device, VkFence fence) {
 }
 
 VkResult ResetFences(VkDevice device, uint32_t fenceCount, const VkFence* pFences) {
@@ -840,8 +801,7 @@
     return VK_SUCCESS;
 }
 
-VkResult DestroySemaphore(VkDevice device, VkSemaphore semaphore) {
-    return VK_SUCCESS;
+void DestroySemaphore(VkDevice device, VkSemaphore semaphore) {
 }
 
 VkResult QueueSignalSemaphore(VkQueue queue, VkSemaphore semaphore) {
@@ -853,8 +813,7 @@
     return VK_SUCCESS;
 }
 
-VkResult DestroyEvent(VkDevice device, VkEvent event) {
-    return VK_SUCCESS;
+void DestroyEvent(VkDevice device, VkEvent event) {
 }
 
 VkResult GetEventStatus(VkDevice device, VkEvent event) {
@@ -872,8 +831,7 @@
     return VK_SUCCESS;
 }
 
-VkResult DestroyQueryPool(VkDevice device, VkQueryPool queryPool) {
-    return VK_SUCCESS;
+void DestroyQueryPool(VkDevice device, VkQueryPool queryPool) {
 }
 
 VkResult GetQueryPoolResults(VkDevice device, VkQueryPool queryPool, uint32_t startQuery, uint32_t queryCount, size_t* pDataSize, void* pData, VkQueryResultFlags flags) {
@@ -881,8 +839,7 @@
     return VK_SUCCESS;
 }
 
-VkResult DestroyBufferView(VkDevice device, VkBufferView bufferView) {
-    return VK_SUCCESS;
+void DestroyBufferView(VkDevice device, VkBufferView bufferView) {
 }
 
 VkResult GetImageSubresourceLayout(VkDevice device, VkImage image, const VkImageSubresource* pSubresource, VkSubresourceLayout* pLayout) {
@@ -890,24 +847,16 @@
     return VK_SUCCESS;
 }
 
-VkResult DestroyImageView(VkDevice device, VkImageView imageView) {
-    return VK_SUCCESS;
+void DestroyImageView(VkDevice device, VkImageView imageView) {
 }
 
-VkResult DestroyAttachmentView(VkDevice device, VkAttachmentView attachmentView) {
-    return VK_SUCCESS;
+void DestroyShaderModule(VkDevice device, VkShaderModule shaderModule) {
 }
 
-VkResult DestroyShaderModule(VkDevice device, VkShaderModule shaderModule) {
-    return VK_SUCCESS;
+void DestroyShader(VkDevice device, VkShader shader) {
 }
 
-VkResult DestroyShader(VkDevice device, VkShader shader) {
-    return VK_SUCCESS;
-}
-
-VkResult DestroyPipelineCache(VkDevice device, VkPipelineCache pipelineCache) {
-    return VK_SUCCESS;
+void DestroyPipelineCache(VkDevice device, VkPipelineCache pipelineCache) {
 }
 
 size_t GetPipelineCacheSize(VkDevice device, VkPipelineCache pipelineCache) {
@@ -925,24 +874,19 @@
     return VK_SUCCESS;
 }
 
-VkResult DestroyPipeline(VkDevice device, VkPipeline pipeline) {
-    return VK_SUCCESS;
+void DestroyPipeline(VkDevice device, VkPipeline pipeline) {
 }
 
-VkResult DestroyPipelineLayout(VkDevice device, VkPipelineLayout pipelineLayout) {
-    return VK_SUCCESS;
+void DestroyPipelineLayout(VkDevice device, VkPipelineLayout pipelineLayout) {
 }
 
-VkResult DestroySampler(VkDevice device, VkSampler sampler) {
-    return VK_SUCCESS;
+void DestroySampler(VkDevice device, VkSampler sampler) {
 }
 
-VkResult DestroyDescriptorSetLayout(VkDevice device, VkDescriptorSetLayout descriptorSetLayout) {
-    return VK_SUCCESS;
+void DestroyDescriptorSetLayout(VkDevice device, VkDescriptorSetLayout descriptorSetLayout) {
 }
 
-VkResult DestroyDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool) {
-    return VK_SUCCESS;
+void DestroyDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool) {
 }
 
 VkResult ResetDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool) {
@@ -950,9 +894,8 @@
     return VK_SUCCESS;
 }
 
-VkResult UpdateDescriptorSets(VkDevice device, uint32_t writeCount, const VkWriteDescriptorSet* pDescriptorWrites, uint32_t copyCount, const VkCopyDescriptorSet* pDescriptorCopies) {
+void UpdateDescriptorSets(VkDevice device, uint32_t writeCount, const VkWriteDescriptorSet* pDescriptorWrites, uint32_t copyCount, const VkCopyDescriptorSet* pDescriptorCopies) {
     ALOGV("TODO: vk%s", __FUNCTION__);
-    return VK_SUCCESS;
 }
 
 VkResult FreeDescriptorSets(VkDevice device, VkDescriptorPool descriptorPool, uint32_t count, const VkDescriptorSet* pDescriptorSets) {
@@ -960,28 +903,10 @@
     return VK_SUCCESS;
 }
 
-VkResult DestroyDynamicViewportState(VkDevice device, VkDynamicViewportState dynamicViewportState) {
-    return VK_SUCCESS;
+void DestroyFramebuffer(VkDevice device, VkFramebuffer framebuffer) {
 }
 
-VkResult DestroyDynamicRasterState(VkDevice device, VkDynamicRasterState dynamicRasterState) {
-    return VK_SUCCESS;
-}
-
-VkResult DestroyDynamicColorBlendState(VkDevice device, VkDynamicColorBlendState dynamicColorBlendState) {
-    return VK_SUCCESS;
-}
-
-VkResult DestroyDynamicDepthStencilState(VkDevice device, VkDynamicDepthStencilState dynamicDepthStencilState) {
-    return VK_SUCCESS;
-}
-
-VkResult DestroyFramebuffer(VkDevice device, VkFramebuffer framebuffer) {
-    return VK_SUCCESS;
-}
-
-VkResult DestroyRenderPass(VkDevice device, VkRenderPass renderPass) {
-    return VK_SUCCESS;
+void DestroyRenderPass(VkDevice device, VkRenderPass renderPass) {
 }
 
 VkResult GetRenderAreaGranularity(VkDevice device, VkRenderPass renderPass, VkExtent2D* pGranularity) {
@@ -989,8 +914,7 @@
     return VK_SUCCESS;
 }
 
-VkResult DestroyCommandPool(VkDevice device, VkCmdPool cmdPool) {
-    return VK_SUCCESS;
+void DestroyCommandPool(VkDevice device, VkCmdPool cmdPool) {
 }
 
 VkResult ResetCommandPool(VkDevice device, VkCmdPool cmdPool, VkCmdPoolResetFlags flags) {
@@ -1014,16 +938,31 @@
 void CmdBindPipeline(VkCmdBuffer cmdBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline) {
 }
 
-void CmdBindDynamicViewportState(VkCmdBuffer cmdBuffer, VkDynamicViewportState dynamicViewportState) {
+void CmdSetViewport(VkCmdBuffer cmdBuffer, uint32_t viewportCount, const VkViewport* pViewports) {
 }
 
-void CmdBindDynamicRasterState(VkCmdBuffer cmdBuffer, VkDynamicRasterState dynamicRasterState) {
+void CmdSetScissor(VkCmdBuffer cmdBuffer, uint32_t scissorCount, const VkRect2D* pScissors) {
 }
 
-void CmdBindDynamicColorBlendState(VkCmdBuffer cmdBuffer, VkDynamicColorBlendState dynamicColorBlendState) {
+void CmdSetLineWidth(VkCmdBuffer cmdBuffer, float lineWidth) {
 }
 
-void CmdBindDynamicDepthStencilState(VkCmdBuffer cmdBuffer, VkDynamicDepthStencilState dynamicDepthStencilState) {
+void CmdSetDepthBias(VkCmdBuffer cmdBuffer, float depthBias, float depthBiasClamp, float slopeScaledDepthBias) {
+}
+
+void CmdSetBlendConstants(VkCmdBuffer cmdBuffer, const float blendConst[4]) {
+}
+
+void CmdSetDepthBounds(VkCmdBuffer cmdBuffer, float minDepthBounds, float maxDepthBounds) {
+}
+
+void CmdSetStencilCompareMask(VkCmdBuffer cmdBuffer, VkStencilFaceFlags faceMask, uint32_t stencilCompareMask) {
+}
+
+void CmdSetStencilWriteMask(VkCmdBuffer cmdBuffer, VkStencilFaceFlags faceMask, uint32_t stencilWriteMask) {
+}
+
+void CmdSetStencilReference(VkCmdBuffer cmdBuffer, VkStencilFaceFlags faceMask, uint32_t stencilReference) {
 }
 
 void CmdBindDescriptorSets(VkCmdBuffer cmdBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t firstSet, uint32_t setCount, const VkDescriptorSet* pDescriptorSets, uint32_t dynamicOffsetCount, const uint32_t* pDynamicOffsets) {
@@ -1035,10 +974,10 @@
 void CmdBindVertexBuffers(VkCmdBuffer cmdBuffer, uint32_t startBinding, uint32_t bindingCount, const VkBuffer* pBuffers, const VkDeviceSize* pOffsets) {
 }
 
-void CmdDraw(VkCmdBuffer cmdBuffer, uint32_t firstVertex, uint32_t vertexCount, uint32_t firstInstance, uint32_t instanceCount) {
+void CmdDraw(VkCmdBuffer cmdBuffer, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance) {
 }
 
-void CmdDrawIndexed(VkCmdBuffer cmdBuffer, uint32_t firstIndex, uint32_t indexCount, int32_t vertexOffset, uint32_t firstInstance, uint32_t instanceCount) {
+void CmdDrawIndexed(VkCmdBuffer cmdBuffer, uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t vertexOffset, uint32_t firstInstance) {
 }
 
 void CmdDrawIndirect(VkCmdBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t count, uint32_t stride) {
@@ -1077,13 +1016,13 @@
 void CmdClearColorImage(VkCmdBuffer cmdBuffer, VkImage image, VkImageLayout imageLayout, const VkClearColorValue* pColor, uint32_t rangeCount, const VkImageSubresourceRange* pRanges) {
 }
 
-void CmdClearDepthStencilImage(VkCmdBuffer cmdBuffer, VkImage image, VkImageLayout imageLayout, float depth, uint32_t stencil, uint32_t rangeCount, const VkImageSubresourceRange* pRanges) {
+void CmdClearDepthStencilImage(VkCmdBuffer cmdBuffer, VkImage image, VkImageLayout imageLayout, const VkClearDepthStencilValue* pDepthStencil, uint32_t rangeCount, const VkImageSubresourceRange* pRanges) {
 }
 
 void CmdClearColorAttachment(VkCmdBuffer cmdBuffer, uint32_t colorAttachment, VkImageLayout imageLayout, const VkClearColorValue* pColor, uint32_t rectCount, const VkRect3D* pRects) {
 }
 
-void CmdClearDepthStencilAttachment(VkCmdBuffer cmdBuffer, VkImageAspectFlags imageAspectMask, VkImageLayout imageLayout, float depth, uint32_t stencil, uint32_t rectCount, const VkRect3D* pRects) {
+void CmdClearDepthStencilAttachment(VkCmdBuffer cmdBuffer, VkImageAspectFlags aspectMask, VkImageLayout imageLayout, const VkClearDepthStencilValue* pDepthStencil, uint32_t rectCount, const VkRect3D* pRects) {
 }
 
 void CmdResolveImage(VkCmdBuffer cmdBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage destImage, VkImageLayout destImageLayout, uint32_t regionCount, const VkImageResolve* pRegions) {
diff --git a/vulkan/nulldrv/null_driver.h b/vulkan/nulldrv/null_driver.h
index 6bfbda5..808673a 100644
--- a/vulkan/nulldrv/null_driver.h
+++ b/vulkan/nulldrv/null_driver.h
@@ -27,127 +27,120 @@
 PFN_vkVoidFunction LookupDeviceProcAddr(const char* name);
 
 // clang-format off
-VkResult DestroyInstance(VkInstance instance);
+void DestroyInstance(VkInstance instance);
 VkResult EnumeratePhysicalDevices(VkInstance instance, uint32_t* pPhysicalDeviceCount, VkPhysicalDevice* pPhysicalDevices);
-PFN_vkVoidFunction GetDeviceProcAddr(VkDevice device, const char* pName);
-VkResult GetPhysicalDeviceProperties(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties* pProperties);
-VkResult GetPhysicalDeviceQueueCount(VkPhysicalDevice physicalDevice, uint32_t* pCount);
-VkResult GetPhysicalDeviceQueueProperties(VkPhysicalDevice physicalDevice, uint32_t count, VkPhysicalDeviceQueueProperties* pQueueProperties);
-VkResult GetPhysicalDeviceMemoryProperties(VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties* pMemoryProperties);
-PFN_vkVoidFunction GetInstanceProcAddr(VkInstance instance, const char* pName);
 VkResult GetPhysicalDeviceFeatures(VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures* pFeatures);
 VkResult GetPhysicalDeviceFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties* pFormatProperties);
-VkResult GetPhysicalDeviceImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageFormatProperties* pImageFormatProperties);
-VkResult GetPhysicalDeviceLimits(VkPhysicalDevice physicalDevice, VkPhysicalDeviceLimits* pLimits);
+VkResult GetPhysicalDeviceImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, VkImageFormatProperties* pImageFormatProperties);
+VkResult GetPhysicalDeviceProperties(VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties* pProperties);
+VkResult GetPhysicalDeviceQueueFamilyProperties(VkPhysicalDevice physicalDevice, uint32_t* pCount, VkQueueFamilyProperties* pQueueFamilyProperties);
+VkResult GetPhysicalDeviceMemoryProperties(VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties* pMemoryProperties);
+PFN_vkVoidFunction GetInstanceProcAddr(VkInstance instance, const char* pName);
+PFN_vkVoidFunction GetDeviceProcAddr(VkDevice device, const char* pName);
 VkResult CreateDevice(VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo* pCreateInfo, VkDevice* pDevice);
-VkResult DestroyDevice(VkDevice device);
-VkResult GetGlobalExtensionProperties(const char* pLayerName, uint32_t* pCount, VkExtensionProperties* pProperties);
-VkResult GetGlobalLayerProperties(uint32_t* pCount, VkLayerProperties* pProperties);
-VkResult GetPhysicalDeviceLayerProperties(VkPhysicalDevice physicalDevice, uint32_t* pCount, VkLayerProperties* pProperties);
-VkResult GetPhysicalDeviceExtensionProperties(VkPhysicalDevice physicalDevice, const char* pLayerName, uint32_t* pCount, VkExtensionProperties* pProperties);
+void DestroyDevice(VkDevice device);
+VkResult EnumerateInstanceExtensionProperties(const char* pLayerName, uint32_t* pCount, VkExtensionProperties* pProperties);
+VkResult EnumerateDeviceExtensionProperties(VkPhysicalDevice physicalDevice, const char* pLayerName, uint32_t* pCount, VkExtensionProperties* pProperties);
+VkResult EnumerateInstanceLayerProperties(uint32_t* pCount, VkLayerProperties* pProperties);
+VkResult EnumerateDeviceLayerProperties(VkPhysicalDevice physicalDevice, uint32_t* pCount, VkLayerProperties* pProperties);
 VkResult GetDeviceQueue(VkDevice device, uint32_t queueFamilyIndex, uint32_t queueIndex, VkQueue* pQueue);
 VkResult QueueSubmit(VkQueue queue, uint32_t cmdBufferCount, const VkCmdBuffer* pCmdBuffers, VkFence fence);
 VkResult QueueWaitIdle(VkQueue queue);
 VkResult DeviceWaitIdle(VkDevice device);
 VkResult AllocMemory(VkDevice device, const VkMemoryAllocInfo* pAllocInfo, VkDeviceMemory* pMem);
-VkResult FreeMemory(VkDevice device, VkDeviceMemory mem);
+void FreeMemory(VkDevice device, VkDeviceMemory mem);
 VkResult MapMemory(VkDevice device, VkDeviceMemory mem, VkDeviceSize offset, VkDeviceSize size, VkMemoryMapFlags flags, void** ppData);
-VkResult UnmapMemory(VkDevice device, VkDeviceMemory mem);
+void UnmapMemory(VkDevice device, VkDeviceMemory mem);
 VkResult FlushMappedMemoryRanges(VkDevice device, uint32_t memRangeCount, const VkMappedMemoryRange* pMemRanges);
 VkResult InvalidateMappedMemoryRanges(VkDevice device, uint32_t memRangeCount, const VkMappedMemoryRange* pMemRanges);
 VkResult GetDeviceMemoryCommitment(VkDevice device, VkDeviceMemory memory, VkDeviceSize* pCommittedMemoryInBytes);
-VkResult GetBufferMemoryRequirements(VkDevice device, VkBuffer buffer, VkMemoryRequirements* pMemoryRequirements);
 VkResult BindBufferMemory(VkDevice device, VkBuffer buffer, VkDeviceMemory mem, VkDeviceSize memOffset);
-VkResult GetImageMemoryRequirements(VkDevice device, VkImage image, VkMemoryRequirements* pMemoryRequirements);
 VkResult BindImageMemory(VkDevice device, VkImage image, VkDeviceMemory mem, VkDeviceSize memOffset);
+VkResult GetBufferMemoryRequirements(VkDevice device, VkBuffer buffer, VkMemoryRequirements* pMemoryRequirements);
+VkResult GetImageMemoryRequirements(VkDevice device, VkImage image, VkMemoryRequirements* pMemoryRequirements);
 VkResult GetImageSparseMemoryRequirements(VkDevice device, VkImage image, uint32_t* pNumRequirements, VkSparseImageMemoryRequirements* pSparseMemoryRequirements);
 VkResult GetPhysicalDeviceSparseImageFormatProperties(VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, uint32_t samples, VkImageUsageFlags usage, VkImageTiling tiling, uint32_t* pNumProperties, VkSparseImageFormatProperties* pProperties);
 VkResult QueueBindSparseBufferMemory(VkQueue queue, VkBuffer buffer, uint32_t numBindings, const VkSparseMemoryBindInfo* pBindInfo);
 VkResult QueueBindSparseImageOpaqueMemory(VkQueue queue, VkImage image, uint32_t numBindings, const VkSparseMemoryBindInfo* pBindInfo);
 VkResult QueueBindSparseImageMemory(VkQueue queue, VkImage image, uint32_t numBindings, const VkSparseImageMemoryBindInfo* pBindInfo);
 VkResult CreateFence(VkDevice device, const VkFenceCreateInfo* pCreateInfo, VkFence* pFence);
-VkResult DestroyFence(VkDevice device, VkFence fence);
+void DestroyFence(VkDevice device, VkFence fence);
 VkResult ResetFences(VkDevice device, uint32_t fenceCount, const VkFence* pFences);
 VkResult GetFenceStatus(VkDevice device, VkFence fence);
 VkResult WaitForFences(VkDevice device, uint32_t fenceCount, const VkFence* pFences, VkBool32 waitAll, uint64_t timeout);
 VkResult CreateSemaphore(VkDevice device, const VkSemaphoreCreateInfo* pCreateInfo, VkSemaphore* pSemaphore);
-VkResult DestroySemaphore(VkDevice device, VkSemaphore semaphore);
+void DestroySemaphore(VkDevice device, VkSemaphore semaphore);
 VkResult QueueSignalSemaphore(VkQueue queue, VkSemaphore semaphore);
 VkResult QueueWaitSemaphore(VkQueue queue, VkSemaphore semaphore);
 VkResult CreateEvent(VkDevice device, const VkEventCreateInfo* pCreateInfo, VkEvent* pEvent);
-VkResult DestroyEvent(VkDevice device, VkEvent event);
+void DestroyEvent(VkDevice device, VkEvent event);
 VkResult GetEventStatus(VkDevice device, VkEvent event);
 VkResult SetEvent(VkDevice device, VkEvent event);
 VkResult ResetEvent(VkDevice device, VkEvent event);
 VkResult CreateQueryPool(VkDevice device, const VkQueryPoolCreateInfo* pCreateInfo, VkQueryPool* pQueryPool);
-VkResult DestroyQueryPool(VkDevice device, VkQueryPool queryPool);
+void DestroyQueryPool(VkDevice device, VkQueryPool queryPool);
 VkResult GetQueryPoolResults(VkDevice device, VkQueryPool queryPool, uint32_t startQuery, uint32_t queryCount, size_t* pDataSize, void* pData, VkQueryResultFlags flags);
 VkResult CreateBuffer(VkDevice device, const VkBufferCreateInfo* pCreateInfo, VkBuffer* pBuffer);
-VkResult DestroyBuffer(VkDevice device, VkBuffer buffer);
+void DestroyBuffer(VkDevice device, VkBuffer buffer);
 VkResult CreateBufferView(VkDevice device, const VkBufferViewCreateInfo* pCreateInfo, VkBufferView* pView);
-VkResult DestroyBufferView(VkDevice device, VkBufferView bufferView);
+void DestroyBufferView(VkDevice device, VkBufferView bufferView);
 VkResult CreateImage(VkDevice device, const VkImageCreateInfo* pCreateInfo, VkImage* pImage);
-VkResult DestroyImage(VkDevice device, VkImage image);
+void DestroyImage(VkDevice device, VkImage image);
 VkResult GetImageSubresourceLayout(VkDevice device, VkImage image, const VkImageSubresource* pSubresource, VkSubresourceLayout* pLayout);
 VkResult CreateImageView(VkDevice device, const VkImageViewCreateInfo* pCreateInfo, VkImageView* pView);
-VkResult DestroyImageView(VkDevice device, VkImageView imageView);
-VkResult CreateAttachmentView(VkDevice device, const VkAttachmentViewCreateInfo* pCreateInfo, VkAttachmentView* pView);
-VkResult DestroyAttachmentView(VkDevice device, VkAttachmentView attachmentView);
+void DestroyImageView(VkDevice device, VkImageView imageView);
 VkResult CreateShaderModule(VkDevice device, const VkShaderModuleCreateInfo* pCreateInfo, VkShaderModule* pShaderModule);
-VkResult DestroyShaderModule(VkDevice device, VkShaderModule shaderModule);
+void DestroyShaderModule(VkDevice device, VkShaderModule shaderModule);
 VkResult CreateShader(VkDevice device, const VkShaderCreateInfo* pCreateInfo, VkShader* pShader);
-VkResult DestroyShader(VkDevice device, VkShader shader);
+void DestroyShader(VkDevice device, VkShader shader);
 VkResult CreatePipelineCache(VkDevice device, const VkPipelineCacheCreateInfo* pCreateInfo, VkPipelineCache* pPipelineCache);
-VkResult DestroyPipelineCache(VkDevice device, VkPipelineCache pipelineCache);
+void DestroyPipelineCache(VkDevice device, VkPipelineCache pipelineCache);
 size_t GetPipelineCacheSize(VkDevice device, VkPipelineCache pipelineCache);
 VkResult GetPipelineCacheData(VkDevice device, VkPipelineCache pipelineCache, void* pData);
 VkResult MergePipelineCaches(VkDevice device, VkPipelineCache destCache, uint32_t srcCacheCount, const VkPipelineCache* pSrcCaches);
 VkResult CreateGraphicsPipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t count, const VkGraphicsPipelineCreateInfo* pCreateInfos, VkPipeline* pPipelines);
 VkResult CreateComputePipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t count, const VkComputePipelineCreateInfo* pCreateInfos, VkPipeline* pPipelines);
-VkResult DestroyPipeline(VkDevice device, VkPipeline pipeline);
+void DestroyPipeline(VkDevice device, VkPipeline pipeline);
 VkResult CreatePipelineLayout(VkDevice device, const VkPipelineLayoutCreateInfo* pCreateInfo, VkPipelineLayout* pPipelineLayout);
-VkResult DestroyPipelineLayout(VkDevice device, VkPipelineLayout pipelineLayout);
+void DestroyPipelineLayout(VkDevice device, VkPipelineLayout pipelineLayout);
 VkResult CreateSampler(VkDevice device, const VkSamplerCreateInfo* pCreateInfo, VkSampler* pSampler);
-VkResult DestroySampler(VkDevice device, VkSampler sampler);
+void DestroySampler(VkDevice device, VkSampler sampler);
 VkResult CreateDescriptorSetLayout(VkDevice device, const VkDescriptorSetLayoutCreateInfo* pCreateInfo, VkDescriptorSetLayout* pSetLayout);
-VkResult DestroyDescriptorSetLayout(VkDevice device, VkDescriptorSetLayout descriptorSetLayout);
-VkResult CreateDescriptorPool(VkDevice device, VkDescriptorPoolUsage poolUsage, uint32_t maxSets, const VkDescriptorPoolCreateInfo* pCreateInfo, VkDescriptorPool* pDescriptorPool);
-VkResult DestroyDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool);
+void DestroyDescriptorSetLayout(VkDevice device, VkDescriptorSetLayout descriptorSetLayout);
+VkResult CreateDescriptorPool(VkDevice device, const VkDescriptorPoolCreateInfo* pCreateInfo, VkDescriptorPool* pDescriptorPool);
+void DestroyDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool);
 VkResult ResetDescriptorPool(VkDevice device, VkDescriptorPool descriptorPool);
-VkResult AllocDescriptorSets(VkDevice device, VkDescriptorPool descriptorPool, VkDescriptorSetUsage setUsage, uint32_t count, const VkDescriptorSetLayout* pSetLayouts, VkDescriptorSet* pDescriptorSets, uint32_t* pCount);
+VkResult AllocDescriptorSets(VkDevice device, VkDescriptorPool descriptorPool, VkDescriptorSetUsage setUsage, uint32_t count, const VkDescriptorSetLayout* pSetLayouts, VkDescriptorSet* pDescriptorSets);
 VkResult FreeDescriptorSets(VkDevice device, VkDescriptorPool descriptorPool, uint32_t count, const VkDescriptorSet* pDescriptorSets);
-VkResult UpdateDescriptorSets(VkDevice device, uint32_t writeCount, const VkWriteDescriptorSet* pDescriptorWrites, uint32_t copyCount, const VkCopyDescriptorSet* pDescriptorCopies);
-VkResult CreateDynamicViewportState(VkDevice device, const VkDynamicViewportStateCreateInfo* pCreateInfo, VkDynamicViewportState* pState);
-VkResult DestroyDynamicViewportState(VkDevice device, VkDynamicViewportState dynamicViewportState);
-VkResult CreateDynamicRasterState(VkDevice device, const VkDynamicRasterStateCreateInfo* pCreateInfo, VkDynamicRasterState* pState);
-VkResult DestroyDynamicRasterState(VkDevice device, VkDynamicRasterState dynamicRasterState);
-VkResult CreateDynamicColorBlendState(VkDevice device, const VkDynamicColorBlendStateCreateInfo* pCreateInfo, VkDynamicColorBlendState* pState);
-VkResult DestroyDynamicColorBlendState(VkDevice device, VkDynamicColorBlendState dynamicColorBlendState);
-VkResult CreateDynamicDepthStencilState(VkDevice device, const VkDynamicDepthStencilStateCreateInfo* pCreateInfo, VkDynamicDepthStencilState* pState);
-VkResult DestroyDynamicDepthStencilState(VkDevice device, VkDynamicDepthStencilState dynamicDepthStencilState);
+void UpdateDescriptorSets(VkDevice device, uint32_t writeCount, const VkWriteDescriptorSet* pDescriptorWrites, uint32_t copyCount, const VkCopyDescriptorSet* pDescriptorCopies);
 VkResult CreateFramebuffer(VkDevice device, const VkFramebufferCreateInfo* pCreateInfo, VkFramebuffer* pFramebuffer);
-VkResult DestroyFramebuffer(VkDevice device, VkFramebuffer framebuffer);
+void DestroyFramebuffer(VkDevice device, VkFramebuffer framebuffer);
 VkResult CreateRenderPass(VkDevice device, const VkRenderPassCreateInfo* pCreateInfo, VkRenderPass* pRenderPass);
-VkResult DestroyRenderPass(VkDevice device, VkRenderPass renderPass);
+void DestroyRenderPass(VkDevice device, VkRenderPass renderPass);
 VkResult GetRenderAreaGranularity(VkDevice device, VkRenderPass renderPass, VkExtent2D* pGranularity);
 VkResult CreateCommandPool(VkDevice device, const VkCmdPoolCreateInfo* pCreateInfo, VkCmdPool* pCmdPool);
-VkResult DestroyCommandPool(VkDevice device, VkCmdPool cmdPool);
+void DestroyCommandPool(VkDevice device, VkCmdPool cmdPool);
 VkResult ResetCommandPool(VkDevice device, VkCmdPool cmdPool, VkCmdPoolResetFlags flags);
 VkResult CreateCommandBuffer(VkDevice device, const VkCmdBufferCreateInfo* pCreateInfo, VkCmdBuffer* pCmdBuffer);
-VkResult DestroyCommandBuffer(VkDevice device, VkCmdBuffer commandBuffer);
+void DestroyCommandBuffer(VkDevice device, VkCmdBuffer commandBuffer);
 VkResult BeginCommandBuffer(VkCmdBuffer cmdBuffer, const VkCmdBufferBeginInfo* pBeginInfo);
 VkResult EndCommandBuffer(VkCmdBuffer cmdBuffer);
 VkResult ResetCommandBuffer(VkCmdBuffer cmdBuffer, VkCmdBufferResetFlags flags);
 void CmdBindPipeline(VkCmdBuffer cmdBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipeline pipeline);
-void CmdBindDynamicViewportState(VkCmdBuffer cmdBuffer, VkDynamicViewportState dynamicViewportState);
-void CmdBindDynamicRasterState(VkCmdBuffer cmdBuffer, VkDynamicRasterState dynamicRasterState);
-void CmdBindDynamicColorBlendState(VkCmdBuffer cmdBuffer, VkDynamicColorBlendState dynamicColorBlendState);
-void CmdBindDynamicDepthStencilState(VkCmdBuffer cmdBuffer, VkDynamicDepthStencilState dynamicDepthStencilState);
+void CmdSetViewport(VkCmdBuffer cmdBuffer, uint32_t viewportCount, const VkViewport* pViewports);
+void CmdSetScissor(VkCmdBuffer cmdBuffer, uint32_t scissorCount, const VkRect2D* pScissors);
+void CmdSetLineWidth(VkCmdBuffer cmdBuffer, float lineWidth);
+void CmdSetDepthBias(VkCmdBuffer cmdBuffer, float depthBias, float depthBiasClamp, float slopeScaledDepthBias);
+void CmdSetBlendConstants(VkCmdBuffer cmdBuffer, const float blendConst[4]);
+void CmdSetDepthBounds(VkCmdBuffer cmdBuffer, float minDepthBounds, float maxDepthBounds);
+void CmdSetStencilCompareMask(VkCmdBuffer cmdBuffer, VkStencilFaceFlags faceMask, uint32_t stencilCompareMask);
+void CmdSetStencilWriteMask(VkCmdBuffer cmdBuffer, VkStencilFaceFlags faceMask, uint32_t stencilWriteMask);
+void CmdSetStencilReference(VkCmdBuffer cmdBuffer, VkStencilFaceFlags faceMask, uint32_t stencilReference);
 void CmdBindDescriptorSets(VkCmdBuffer cmdBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t firstSet, uint32_t setCount, const VkDescriptorSet* pDescriptorSets, uint32_t dynamicOffsetCount, const uint32_t* pDynamicOffsets);
 void CmdBindIndexBuffer(VkCmdBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset, VkIndexType indexType);
 void CmdBindVertexBuffers(VkCmdBuffer cmdBuffer, uint32_t startBinding, uint32_t bindingCount, const VkBuffer* pBuffers, const VkDeviceSize* pOffsets);
-void CmdDraw(VkCmdBuffer cmdBuffer, uint32_t firstVertex, uint32_t vertexCount, uint32_t firstInstance, uint32_t instanceCount);
-void CmdDrawIndexed(VkCmdBuffer cmdBuffer, uint32_t firstIndex, uint32_t indexCount, int32_t vertexOffset, uint32_t firstInstance, uint32_t instanceCount);
+void CmdDraw(VkCmdBuffer cmdBuffer, uint32_t vertexCount, uint32_t instanceCount, uint32_t firstVertex, uint32_t firstInstance);
+void CmdDrawIndexed(VkCmdBuffer cmdBuffer, uint32_t indexCount, uint32_t instanceCount, uint32_t firstIndex, int32_t vertexOffset, uint32_t firstInstance);
 void CmdDrawIndirect(VkCmdBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t count, uint32_t stride);
 void CmdDrawIndexedIndirect(VkCmdBuffer cmdBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t count, uint32_t stride);
 void CmdDispatch(VkCmdBuffer cmdBuffer, uint32_t x, uint32_t y, uint32_t z);
@@ -160,9 +153,9 @@
 void CmdUpdateBuffer(VkCmdBuffer cmdBuffer, VkBuffer destBuffer, VkDeviceSize destOffset, VkDeviceSize dataSize, const uint32_t* pData);
 void CmdFillBuffer(VkCmdBuffer cmdBuffer, VkBuffer destBuffer, VkDeviceSize destOffset, VkDeviceSize fillSize, uint32_t data);
 void CmdClearColorImage(VkCmdBuffer cmdBuffer, VkImage image, VkImageLayout imageLayout, const VkClearColorValue* pColor, uint32_t rangeCount, const VkImageSubresourceRange* pRanges);
-void CmdClearDepthStencilImage(VkCmdBuffer cmdBuffer, VkImage image, VkImageLayout imageLayout, float depth, uint32_t stencil, uint32_t rangeCount, const VkImageSubresourceRange* pRanges);
+void CmdClearDepthStencilImage(VkCmdBuffer cmdBuffer, VkImage image, VkImageLayout imageLayout, const VkClearDepthStencilValue* pDepthStencil, uint32_t rangeCount, const VkImageSubresourceRange* pRanges);
 void CmdClearColorAttachment(VkCmdBuffer cmdBuffer, uint32_t colorAttachment, VkImageLayout imageLayout, const VkClearColorValue* pColor, uint32_t rectCount, const VkRect3D* pRects);
-void CmdClearDepthStencilAttachment(VkCmdBuffer cmdBuffer, VkImageAspectFlags imageAspectMask, VkImageLayout imageLayout, float depth, uint32_t stencil, uint32_t rectCount, const VkRect3D* pRects);
+void CmdClearDepthStencilAttachment(VkCmdBuffer cmdBuffer, VkImageAspectFlags aspectMask, VkImageLayout imageLayout, const VkClearDepthStencilValue* pDepthStencil, uint32_t rectCount, const VkRect3D* pRects);
 void CmdResolveImage(VkCmdBuffer cmdBuffer, VkImage srcImage, VkImageLayout srcImageLayout, VkImage destImage, VkImageLayout destImageLayout, uint32_t regionCount, const VkImageResolve* pRegions);
 void CmdSetEvent(VkCmdBuffer cmdBuffer, VkEvent event, VkPipelineStageFlags stageMask);
 void CmdResetEvent(VkCmdBuffer cmdBuffer, VkEvent event, VkPipelineStageFlags stageMask);
@@ -179,8 +172,9 @@
 void CmdEndRenderPass(VkCmdBuffer cmdBuffer);
 void CmdExecuteCommands(VkCmdBuffer cmdBuffer, uint32_t cmdBuffersCount, const VkCmdBuffer* pCmdBuffers);
 
-VkResult ImportNativeFenceANDROID(VkDevice device, VkSemaphore semaphore, int nativeFenceFd);
-VkResult QueueSignalNativeFenceANDROID(VkQueue queue, int* pNativeFenceFd);
+VkResult GetSwapchainGrallocUsageANDROID(VkDevice device, VkFormat format, VkImageUsageFlags imageUsage, int* grallocUsage);
+VkResult AcquireImageANDROID(VkDevice device, VkImage image, int nativeFenceFd, VkSemaphore semaphore);
+VkResult QueueSignalReleaseImageANDROID(VkQueue queue, VkImage image, int* pNativeFenceFd);
 // clang-format on
 
 }  // namespace null_driver
diff --git a/vulkan/nulldrv/null_driver_gen.cpp b/vulkan/nulldrv/null_driver_gen.cpp
index 56ee49a..ac6d50f 100644
--- a/vulkan/nulldrv/null_driver_gen.cpp
+++ b/vulkan/nulldrv/null_driver_gen.cpp
@@ -31,7 +31,7 @@
 };
 
 template <size_t N>
-PFN_vkVoidFunction LookupProcAddr(const NameProcEntry(&table)[N],
+PFN_vkVoidFunction LookupProcAddr(const NameProcEntry (&table)[N],
                                   const char* name) {
     auto entry = std::lower_bound(table, table + N, name,
                                   [](const NameProcEntry& e, const char* n) {
@@ -42,162 +42,160 @@
     return nullptr;
 }
 
+// The reinterpret_cast<..>(static_cast<..>(..)) business is there to ensure
+// that the function declaration in null_driver.h matches the function pointer
+// type in vulkan.h. If we just used reinterpret_cast<>, the compiler wouldn't
+// tell us if there's a mistake in null_driver.h. A better solution would be to
+// generate the declarations in null_driver.h.
 const NameProcEntry kInstanceProcTbl[] = {
     // clang-format off
-    {"vkCreateDevice", reinterpret_cast<PFN_vkVoidFunction>(CreateDevice)},
-    {"vkDestroyInstance", reinterpret_cast<PFN_vkVoidFunction>(DestroyInstance)},
-    {"vkEnumeratePhysicalDevices", reinterpret_cast<PFN_vkVoidFunction>(EnumeratePhysicalDevices)},
-    {"vkGetInstanceProcAddr", reinterpret_cast<PFN_vkVoidFunction>(GetInstanceProcAddr)},
-    {"vkGetPhysicalDeviceExtensionProperties", reinterpret_cast<PFN_vkVoidFunction>(GetPhysicalDeviceExtensionProperties)},
-    {"vkGetPhysicalDeviceFeatures", reinterpret_cast<PFN_vkVoidFunction>(GetPhysicalDeviceFeatures)},
-    {"vkGetPhysicalDeviceFormatProperties", reinterpret_cast<PFN_vkVoidFunction>(GetPhysicalDeviceFormatProperties)},
-    {"vkGetPhysicalDeviceImageFormatProperties", reinterpret_cast<PFN_vkVoidFunction>(GetPhysicalDeviceImageFormatProperties)},
-    {"vkGetPhysicalDeviceLayerProperties", reinterpret_cast<PFN_vkVoidFunction>(GetPhysicalDeviceLayerProperties)},
-    {"vkGetPhysicalDeviceLimits", reinterpret_cast<PFN_vkVoidFunction>(GetPhysicalDeviceLimits)},
-    {"vkGetPhysicalDeviceMemoryProperties", reinterpret_cast<PFN_vkVoidFunction>(GetPhysicalDeviceMemoryProperties)},
-    {"vkGetPhysicalDeviceProperties", reinterpret_cast<PFN_vkVoidFunction>(GetPhysicalDeviceProperties)},
-    {"vkGetPhysicalDeviceQueueCount", reinterpret_cast<PFN_vkVoidFunction>(GetPhysicalDeviceQueueCount)},
-    {"vkGetPhysicalDeviceQueueProperties", reinterpret_cast<PFN_vkVoidFunction>(GetPhysicalDeviceQueueProperties)},
-    {"vkGetPhysicalDeviceSparseImageFormatProperties", reinterpret_cast<PFN_vkVoidFunction>(GetPhysicalDeviceSparseImageFormatProperties)},
+    {"vkCreateDevice", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCreateDevice>(CreateDevice))},
+    {"vkDestroyInstance", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkDestroyInstance>(DestroyInstance))},
+    {"vkEnumerateDeviceExtensionProperties", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkEnumerateDeviceExtensionProperties>(EnumerateDeviceExtensionProperties))},
+    {"vkEnumerateDeviceLayerProperties", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkEnumerateDeviceLayerProperties>(EnumerateDeviceLayerProperties))},
+    {"vkEnumeratePhysicalDevices", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkEnumeratePhysicalDevices>(EnumeratePhysicalDevices))},
+    {"vkGetInstanceProcAddr", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkGetInstanceProcAddr>(GetInstanceProcAddr))},
+    {"vkGetPhysicalDeviceFeatures", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkGetPhysicalDeviceFeatures>(GetPhysicalDeviceFeatures))},
+    {"vkGetPhysicalDeviceFormatProperties", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkGetPhysicalDeviceFormatProperties>(GetPhysicalDeviceFormatProperties))},
+    {"vkGetPhysicalDeviceImageFormatProperties", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkGetPhysicalDeviceImageFormatProperties>(GetPhysicalDeviceImageFormatProperties))},
+    {"vkGetPhysicalDeviceMemoryProperties", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkGetPhysicalDeviceMemoryProperties>(GetPhysicalDeviceMemoryProperties))},
+    {"vkGetPhysicalDeviceProperties", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkGetPhysicalDeviceProperties>(GetPhysicalDeviceProperties))},
+    {"vkGetPhysicalDeviceQueueFamilyProperties", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkGetPhysicalDeviceQueueFamilyProperties>(GetPhysicalDeviceQueueFamilyProperties))},
+    {"vkGetPhysicalDeviceSparseImageFormatProperties", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkGetPhysicalDeviceSparseImageFormatProperties>(GetPhysicalDeviceSparseImageFormatProperties))},
     // clang-format on
 };
 
 const NameProcEntry kDeviceProcTbl[] = {
     // clang-format off
-    {"vkAllocDescriptorSets", reinterpret_cast<PFN_vkVoidFunction>(AllocDescriptorSets)},
-    {"vkAllocMemory", reinterpret_cast<PFN_vkVoidFunction>(AllocMemory)},
-    {"vkBeginCommandBuffer", reinterpret_cast<PFN_vkVoidFunction>(BeginCommandBuffer)},
-    {"vkBindBufferMemory", reinterpret_cast<PFN_vkVoidFunction>(BindBufferMemory)},
-    {"vkBindImageMemory", reinterpret_cast<PFN_vkVoidFunction>(BindImageMemory)},
-    {"vkCmdBeginQuery", reinterpret_cast<PFN_vkVoidFunction>(CmdBeginQuery)},
-    {"vkCmdBeginRenderPass", reinterpret_cast<PFN_vkVoidFunction>(CmdBeginRenderPass)},
-    {"vkCmdBindDescriptorSets", reinterpret_cast<PFN_vkVoidFunction>(CmdBindDescriptorSets)},
-    {"vkCmdBindDynamicColorBlendState", reinterpret_cast<PFN_vkVoidFunction>(CmdBindDynamicColorBlendState)},
-    {"vkCmdBindDynamicDepthStencilState", reinterpret_cast<PFN_vkVoidFunction>(CmdBindDynamicDepthStencilState)},
-    {"vkCmdBindDynamicRasterState", reinterpret_cast<PFN_vkVoidFunction>(CmdBindDynamicRasterState)},
-    {"vkCmdBindDynamicViewportState", reinterpret_cast<PFN_vkVoidFunction>(CmdBindDynamicViewportState)},
-    {"vkCmdBindIndexBuffer", reinterpret_cast<PFN_vkVoidFunction>(CmdBindIndexBuffer)},
-    {"vkCmdBindPipeline", reinterpret_cast<PFN_vkVoidFunction>(CmdBindPipeline)},
-    {"vkCmdBindVertexBuffers", reinterpret_cast<PFN_vkVoidFunction>(CmdBindVertexBuffers)},
-    {"vkCmdBlitImage", reinterpret_cast<PFN_vkVoidFunction>(CmdBlitImage)},
-    {"vkCmdClearColorAttachment", reinterpret_cast<PFN_vkVoidFunction>(CmdClearColorAttachment)},
-    {"vkCmdClearColorImage", reinterpret_cast<PFN_vkVoidFunction>(CmdClearColorImage)},
-    {"vkCmdClearDepthStencilAttachment", reinterpret_cast<PFN_vkVoidFunction>(CmdClearDepthStencilAttachment)},
-    {"vkCmdClearDepthStencilImage", reinterpret_cast<PFN_vkVoidFunction>(CmdClearDepthStencilImage)},
-    {"vkCmdCopyBuffer", reinterpret_cast<PFN_vkVoidFunction>(CmdCopyBuffer)},
-    {"vkCmdCopyBufferToImage", reinterpret_cast<PFN_vkVoidFunction>(CmdCopyBufferToImage)},
-    {"vkCmdCopyImage", reinterpret_cast<PFN_vkVoidFunction>(CmdCopyImage)},
-    {"vkCmdCopyImageToBuffer", reinterpret_cast<PFN_vkVoidFunction>(CmdCopyImageToBuffer)},
-    {"vkCmdCopyQueryPoolResults", reinterpret_cast<PFN_vkVoidFunction>(CmdCopyQueryPoolResults)},
-    {"vkCmdDispatch", reinterpret_cast<PFN_vkVoidFunction>(CmdDispatch)},
-    {"vkCmdDispatchIndirect", reinterpret_cast<PFN_vkVoidFunction>(CmdDispatchIndirect)},
-    {"vkCmdDraw", reinterpret_cast<PFN_vkVoidFunction>(CmdDraw)},
-    {"vkCmdDrawIndexed", reinterpret_cast<PFN_vkVoidFunction>(CmdDrawIndexed)},
-    {"vkCmdDrawIndexedIndirect", reinterpret_cast<PFN_vkVoidFunction>(CmdDrawIndexedIndirect)},
-    {"vkCmdDrawIndirect", reinterpret_cast<PFN_vkVoidFunction>(CmdDrawIndirect)},
-    {"vkCmdEndQuery", reinterpret_cast<PFN_vkVoidFunction>(CmdEndQuery)},
-    {"vkCmdEndRenderPass", reinterpret_cast<PFN_vkVoidFunction>(CmdEndRenderPass)},
-    {"vkCmdExecuteCommands", reinterpret_cast<PFN_vkVoidFunction>(CmdExecuteCommands)},
-    {"vkCmdFillBuffer", reinterpret_cast<PFN_vkVoidFunction>(CmdFillBuffer)},
-    {"vkCmdNextSubpass", reinterpret_cast<PFN_vkVoidFunction>(CmdNextSubpass)},
-    {"vkCmdPipelineBarrier", reinterpret_cast<PFN_vkVoidFunction>(CmdPipelineBarrier)},
-    {"vkCmdPushConstants", reinterpret_cast<PFN_vkVoidFunction>(CmdPushConstants)},
-    {"vkCmdResetEvent", reinterpret_cast<PFN_vkVoidFunction>(CmdResetEvent)},
-    {"vkCmdResetQueryPool", reinterpret_cast<PFN_vkVoidFunction>(CmdResetQueryPool)},
-    {"vkCmdResolveImage", reinterpret_cast<PFN_vkVoidFunction>(CmdResolveImage)},
-    {"vkCmdSetEvent", reinterpret_cast<PFN_vkVoidFunction>(CmdSetEvent)},
-    {"vkCmdUpdateBuffer", reinterpret_cast<PFN_vkVoidFunction>(CmdUpdateBuffer)},
-    {"vkCmdWaitEvents", reinterpret_cast<PFN_vkVoidFunction>(CmdWaitEvents)},
-    {"vkCmdWriteTimestamp", reinterpret_cast<PFN_vkVoidFunction>(CmdWriteTimestamp)},
-    {"vkCreateAttachmentView", reinterpret_cast<PFN_vkVoidFunction>(CreateAttachmentView)},
-    {"vkCreateBuffer", reinterpret_cast<PFN_vkVoidFunction>(CreateBuffer)},
-    {"vkCreateBufferView", reinterpret_cast<PFN_vkVoidFunction>(CreateBufferView)},
-    {"vkCreateCommandBuffer", reinterpret_cast<PFN_vkVoidFunction>(CreateCommandBuffer)},
-    {"vkCreateCommandPool", reinterpret_cast<PFN_vkVoidFunction>(CreateCommandPool)},
-    {"vkCreateComputePipelines", reinterpret_cast<PFN_vkVoidFunction>(CreateComputePipelines)},
-    {"vkCreateDescriptorPool", reinterpret_cast<PFN_vkVoidFunction>(CreateDescriptorPool)},
-    {"vkCreateDescriptorSetLayout", reinterpret_cast<PFN_vkVoidFunction>(CreateDescriptorSetLayout)},
-    {"vkCreateDynamicColorBlendState", reinterpret_cast<PFN_vkVoidFunction>(CreateDynamicColorBlendState)},
-    {"vkCreateDynamicDepthStencilState", reinterpret_cast<PFN_vkVoidFunction>(CreateDynamicDepthStencilState)},
-    {"vkCreateDynamicRasterState", reinterpret_cast<PFN_vkVoidFunction>(CreateDynamicRasterState)},
-    {"vkCreateDynamicViewportState", reinterpret_cast<PFN_vkVoidFunction>(CreateDynamicViewportState)},
-    {"vkCreateEvent", reinterpret_cast<PFN_vkVoidFunction>(CreateEvent)},
-    {"vkCreateFence", reinterpret_cast<PFN_vkVoidFunction>(CreateFence)},
-    {"vkCreateFramebuffer", reinterpret_cast<PFN_vkVoidFunction>(CreateFramebuffer)},
-    {"vkCreateGraphicsPipelines", reinterpret_cast<PFN_vkVoidFunction>(CreateGraphicsPipelines)},
-    {"vkCreateImage", reinterpret_cast<PFN_vkVoidFunction>(CreateImage)},
-    {"vkCreateImageView", reinterpret_cast<PFN_vkVoidFunction>(CreateImageView)},
-    {"vkCreatePipelineCache", reinterpret_cast<PFN_vkVoidFunction>(CreatePipelineCache)},
-    {"vkCreatePipelineLayout", reinterpret_cast<PFN_vkVoidFunction>(CreatePipelineLayout)},
-    {"vkCreateQueryPool", reinterpret_cast<PFN_vkVoidFunction>(CreateQueryPool)},
-    {"vkCreateRenderPass", reinterpret_cast<PFN_vkVoidFunction>(CreateRenderPass)},
-    {"vkCreateSampler", reinterpret_cast<PFN_vkVoidFunction>(CreateSampler)},
-    {"vkCreateSemaphore", reinterpret_cast<PFN_vkVoidFunction>(CreateSemaphore)},
-    {"vkCreateShader", reinterpret_cast<PFN_vkVoidFunction>(CreateShader)},
-    {"vkCreateShaderModule", reinterpret_cast<PFN_vkVoidFunction>(CreateShaderModule)},
-    {"vkDestroyAttachmentView", reinterpret_cast<PFN_vkVoidFunction>(DestroyAttachmentView)},
-    {"vkDestroyBuffer", reinterpret_cast<PFN_vkVoidFunction>(DestroyBuffer)},
-    {"vkDestroyBufferView", reinterpret_cast<PFN_vkVoidFunction>(DestroyBufferView)},
-    {"vkDestroyCommandBuffer", reinterpret_cast<PFN_vkVoidFunction>(DestroyCommandBuffer)},
-    {"vkDestroyCommandPool", reinterpret_cast<PFN_vkVoidFunction>(DestroyCommandPool)},
-    {"vkDestroyDescriptorPool", reinterpret_cast<PFN_vkVoidFunction>(DestroyDescriptorPool)},
-    {"vkDestroyDescriptorSetLayout", reinterpret_cast<PFN_vkVoidFunction>(DestroyDescriptorSetLayout)},
-    {"vkDestroyDevice", reinterpret_cast<PFN_vkVoidFunction>(DestroyDevice)},
-    {"vkDestroyDynamicColorBlendState", reinterpret_cast<PFN_vkVoidFunction>(DestroyDynamicColorBlendState)},
-    {"vkDestroyDynamicDepthStencilState", reinterpret_cast<PFN_vkVoidFunction>(DestroyDynamicDepthStencilState)},
-    {"vkDestroyDynamicRasterState", reinterpret_cast<PFN_vkVoidFunction>(DestroyDynamicRasterState)},
-    {"vkDestroyDynamicViewportState", reinterpret_cast<PFN_vkVoidFunction>(DestroyDynamicViewportState)},
-    {"vkDestroyEvent", reinterpret_cast<PFN_vkVoidFunction>(DestroyEvent)},
-    {"vkDestroyFence", reinterpret_cast<PFN_vkVoidFunction>(DestroyFence)},
-    {"vkDestroyFramebuffer", reinterpret_cast<PFN_vkVoidFunction>(DestroyFramebuffer)},
-    {"vkDestroyImage", reinterpret_cast<PFN_vkVoidFunction>(DestroyImage)},
-    {"vkDestroyImageView", reinterpret_cast<PFN_vkVoidFunction>(DestroyImageView)},
-    {"vkDestroyPipeline", reinterpret_cast<PFN_vkVoidFunction>(DestroyPipeline)},
-    {"vkDestroyPipelineCache", reinterpret_cast<PFN_vkVoidFunction>(DestroyPipelineCache)},
-    {"vkDestroyPipelineLayout", reinterpret_cast<PFN_vkVoidFunction>(DestroyPipelineLayout)},
-    {"vkDestroyQueryPool", reinterpret_cast<PFN_vkVoidFunction>(DestroyQueryPool)},
-    {"vkDestroyRenderPass", reinterpret_cast<PFN_vkVoidFunction>(DestroyRenderPass)},
-    {"vkDestroySampler", reinterpret_cast<PFN_vkVoidFunction>(DestroySampler)},
-    {"vkDestroySemaphore", reinterpret_cast<PFN_vkVoidFunction>(DestroySemaphore)},
-    {"vkDestroyShader", reinterpret_cast<PFN_vkVoidFunction>(DestroyShader)},
-    {"vkDestroyShaderModule", reinterpret_cast<PFN_vkVoidFunction>(DestroyShaderModule)},
-    {"vkDeviceWaitIdle", reinterpret_cast<PFN_vkVoidFunction>(DeviceWaitIdle)},
-    {"vkEndCommandBuffer", reinterpret_cast<PFN_vkVoidFunction>(EndCommandBuffer)},
-    {"vkFlushMappedMemoryRanges", reinterpret_cast<PFN_vkVoidFunction>(FlushMappedMemoryRanges)},
-    {"vkFreeDescriptorSets", reinterpret_cast<PFN_vkVoidFunction>(FreeDescriptorSets)},
-    {"vkFreeMemory", reinterpret_cast<PFN_vkVoidFunction>(FreeMemory)},
-    {"vkGetBufferMemoryRequirements", reinterpret_cast<PFN_vkVoidFunction>(GetBufferMemoryRequirements)},
-    {"vkGetDeviceMemoryCommitment", reinterpret_cast<PFN_vkVoidFunction>(GetDeviceMemoryCommitment)},
-    {"vkGetDeviceProcAddr", reinterpret_cast<PFN_vkVoidFunction>(GetDeviceProcAddr)},
-    {"vkGetDeviceQueue", reinterpret_cast<PFN_vkVoidFunction>(GetDeviceQueue)},
-    {"vkGetEventStatus", reinterpret_cast<PFN_vkVoidFunction>(GetEventStatus)},
-    {"vkGetFenceStatus", reinterpret_cast<PFN_vkVoidFunction>(GetFenceStatus)},
-    {"vkGetImageMemoryRequirements", reinterpret_cast<PFN_vkVoidFunction>(GetImageMemoryRequirements)},
-    {"vkGetImageSparseMemoryRequirements", reinterpret_cast<PFN_vkVoidFunction>(GetImageSparseMemoryRequirements)},
-    {"vkGetImageSubresourceLayout", reinterpret_cast<PFN_vkVoidFunction>(GetImageSubresourceLayout)},
-    {"vkGetPipelineCacheData", reinterpret_cast<PFN_vkVoidFunction>(GetPipelineCacheData)},
-    {"vkGetPipelineCacheSize", reinterpret_cast<PFN_vkVoidFunction>(GetPipelineCacheSize)},
-    {"vkGetQueryPoolResults", reinterpret_cast<PFN_vkVoidFunction>(GetQueryPoolResults)},
-    {"vkGetRenderAreaGranularity", reinterpret_cast<PFN_vkVoidFunction>(GetRenderAreaGranularity)},
-    {"vkInvalidateMappedMemoryRanges", reinterpret_cast<PFN_vkVoidFunction>(InvalidateMappedMemoryRanges)},
-    {"vkMapMemory", reinterpret_cast<PFN_vkVoidFunction>(MapMemory)},
-    {"vkMergePipelineCaches", reinterpret_cast<PFN_vkVoidFunction>(MergePipelineCaches)},
-    {"vkQueueBindSparseBufferMemory", reinterpret_cast<PFN_vkVoidFunction>(QueueBindSparseBufferMemory)},
-    {"vkQueueBindSparseImageMemory", reinterpret_cast<PFN_vkVoidFunction>(QueueBindSparseImageMemory)},
-    {"vkQueueBindSparseImageOpaqueMemory", reinterpret_cast<PFN_vkVoidFunction>(QueueBindSparseImageOpaqueMemory)},
-    {"vkQueueSignalSemaphore", reinterpret_cast<PFN_vkVoidFunction>(QueueSignalSemaphore)},
-    {"vkQueueSubmit", reinterpret_cast<PFN_vkVoidFunction>(QueueSubmit)},
-    {"vkQueueWaitIdle", reinterpret_cast<PFN_vkVoidFunction>(QueueWaitIdle)},
-    {"vkQueueWaitSemaphore", reinterpret_cast<PFN_vkVoidFunction>(QueueWaitSemaphore)},
-    {"vkResetCommandBuffer", reinterpret_cast<PFN_vkVoidFunction>(ResetCommandBuffer)},
-    {"vkResetCommandPool", reinterpret_cast<PFN_vkVoidFunction>(ResetCommandPool)},
-    {"vkResetDescriptorPool", reinterpret_cast<PFN_vkVoidFunction>(ResetDescriptorPool)},
-    {"vkResetEvent", reinterpret_cast<PFN_vkVoidFunction>(ResetEvent)},
-    {"vkResetFences", reinterpret_cast<PFN_vkVoidFunction>(ResetFences)},
-    {"vkSetEvent", reinterpret_cast<PFN_vkVoidFunction>(SetEvent)},
-    {"vkUnmapMemory", reinterpret_cast<PFN_vkVoidFunction>(UnmapMemory)},
-    {"vkUpdateDescriptorSets", reinterpret_cast<PFN_vkVoidFunction>(UpdateDescriptorSets)},
-    {"vkWaitForFences", reinterpret_cast<PFN_vkVoidFunction>(WaitForFences)},
+    {"vkAllocDescriptorSets", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkAllocDescriptorSets>(AllocDescriptorSets))},
+    {"vkAllocMemory", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkAllocMemory>(AllocMemory))},
+    {"vkBeginCommandBuffer", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkBeginCommandBuffer>(BeginCommandBuffer))},
+    {"vkBindBufferMemory", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkBindBufferMemory>(BindBufferMemory))},
+    {"vkBindImageMemory", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkBindImageMemory>(BindImageMemory))},
+    {"vkCmdBeginQuery", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdBeginQuery>(CmdBeginQuery))},
+    {"vkCmdBeginRenderPass", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdBeginRenderPass>(CmdBeginRenderPass))},
+    {"vkCmdBindDescriptorSets", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdBindDescriptorSets>(CmdBindDescriptorSets))},
+    {"vkCmdBindIndexBuffer", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdBindIndexBuffer>(CmdBindIndexBuffer))},
+    {"vkCmdBindPipeline", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdBindPipeline>(CmdBindPipeline))},
+    {"vkCmdBindVertexBuffers", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdBindVertexBuffers>(CmdBindVertexBuffers))},
+    {"vkCmdBlitImage", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdBlitImage>(CmdBlitImage))},
+    {"vkCmdClearColorAttachment", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdClearColorAttachment>(CmdClearColorAttachment))},
+    {"vkCmdClearColorImage", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdClearColorImage>(CmdClearColorImage))},
+    {"vkCmdClearDepthStencilAttachment", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdClearDepthStencilAttachment>(CmdClearDepthStencilAttachment))},
+    {"vkCmdClearDepthStencilImage", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdClearDepthStencilImage>(CmdClearDepthStencilImage))},
+    {"vkCmdCopyBuffer", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdCopyBuffer>(CmdCopyBuffer))},
+    {"vkCmdCopyBufferToImage", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdCopyBufferToImage>(CmdCopyBufferToImage))},
+    {"vkCmdCopyImage", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdCopyImage>(CmdCopyImage))},
+    {"vkCmdCopyImageToBuffer", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdCopyImageToBuffer>(CmdCopyImageToBuffer))},
+    {"vkCmdCopyQueryPoolResults", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdCopyQueryPoolResults>(CmdCopyQueryPoolResults))},
+    {"vkCmdDispatch", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdDispatch>(CmdDispatch))},
+    {"vkCmdDispatchIndirect", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdDispatchIndirect>(CmdDispatchIndirect))},
+    {"vkCmdDraw", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdDraw>(CmdDraw))},
+    {"vkCmdDrawIndexed", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdDrawIndexed>(CmdDrawIndexed))},
+    {"vkCmdDrawIndexedIndirect", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdDrawIndexedIndirect>(CmdDrawIndexedIndirect))},
+    {"vkCmdDrawIndirect", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdDrawIndirect>(CmdDrawIndirect))},
+    {"vkCmdEndQuery", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdEndQuery>(CmdEndQuery))},
+    {"vkCmdEndRenderPass", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdEndRenderPass>(CmdEndRenderPass))},
+    {"vkCmdExecuteCommands", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdExecuteCommands>(CmdExecuteCommands))},
+    {"vkCmdFillBuffer", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdFillBuffer>(CmdFillBuffer))},
+    {"vkCmdNextSubpass", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdNextSubpass>(CmdNextSubpass))},
+    {"vkCmdPipelineBarrier", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdPipelineBarrier>(CmdPipelineBarrier))},
+    {"vkCmdPushConstants", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdPushConstants>(CmdPushConstants))},
+    {"vkCmdResetEvent", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdResetEvent>(CmdResetEvent))},
+    {"vkCmdResetQueryPool", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdResetQueryPool>(CmdResetQueryPool))},
+    {"vkCmdResolveImage", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdResolveImage>(CmdResolveImage))},
+    {"vkCmdSetBlendConstants", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdSetBlendConstants>(CmdSetBlendConstants))},
+    {"vkCmdSetDepthBias", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdSetDepthBias>(CmdSetDepthBias))},
+    {"vkCmdSetDepthBounds", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdSetDepthBounds>(CmdSetDepthBounds))},
+    {"vkCmdSetEvent", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdSetEvent>(CmdSetEvent))},
+    {"vkCmdSetLineWidth", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdSetLineWidth>(CmdSetLineWidth))},
+    {"vkCmdSetScissor", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdSetScissor>(CmdSetScissor))},
+    {"vkCmdSetStencilCompareMask", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdSetStencilCompareMask>(CmdSetStencilCompareMask))},
+    {"vkCmdSetStencilReference", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdSetStencilReference>(CmdSetStencilReference))},
+    {"vkCmdSetStencilWriteMask", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdSetStencilWriteMask>(CmdSetStencilWriteMask))},
+    {"vkCmdSetViewport", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdSetViewport>(CmdSetViewport))},
+    {"vkCmdUpdateBuffer", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdUpdateBuffer>(CmdUpdateBuffer))},
+    {"vkCmdWaitEvents", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdWaitEvents>(CmdWaitEvents))},
+    {"vkCmdWriteTimestamp", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCmdWriteTimestamp>(CmdWriteTimestamp))},
+    {"vkCreateBuffer", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCreateBuffer>(CreateBuffer))},
+    {"vkCreateBufferView", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCreateBufferView>(CreateBufferView))},
+    {"vkCreateCommandBuffer", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCreateCommandBuffer>(CreateCommandBuffer))},
+    {"vkCreateCommandPool", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCreateCommandPool>(CreateCommandPool))},
+    {"vkCreateComputePipelines", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCreateComputePipelines>(CreateComputePipelines))},
+    {"vkCreateDescriptorPool", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCreateDescriptorPool>(CreateDescriptorPool))},
+    {"vkCreateDescriptorSetLayout", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCreateDescriptorSetLayout>(CreateDescriptorSetLayout))},
+    {"vkCreateEvent", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCreateEvent>(CreateEvent))},
+    {"vkCreateFence", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCreateFence>(CreateFence))},
+    {"vkCreateFramebuffer", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCreateFramebuffer>(CreateFramebuffer))},
+    {"vkCreateGraphicsPipelines", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCreateGraphicsPipelines>(CreateGraphicsPipelines))},
+    {"vkCreateImage", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCreateImage>(CreateImage))},
+    {"vkCreateImageView", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCreateImageView>(CreateImageView))},
+    {"vkCreatePipelineCache", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCreatePipelineCache>(CreatePipelineCache))},
+    {"vkCreatePipelineLayout", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCreatePipelineLayout>(CreatePipelineLayout))},
+    {"vkCreateQueryPool", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCreateQueryPool>(CreateQueryPool))},
+    {"vkCreateRenderPass", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCreateRenderPass>(CreateRenderPass))},
+    {"vkCreateSampler", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCreateSampler>(CreateSampler))},
+    {"vkCreateSemaphore", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCreateSemaphore>(CreateSemaphore))},
+    {"vkCreateShader", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCreateShader>(CreateShader))},
+    {"vkCreateShaderModule", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkCreateShaderModule>(CreateShaderModule))},
+    {"vkDestroyBuffer", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkDestroyBuffer>(DestroyBuffer))},
+    {"vkDestroyBufferView", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkDestroyBufferView>(DestroyBufferView))},
+    {"vkDestroyCommandBuffer", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkDestroyCommandBuffer>(DestroyCommandBuffer))},
+    {"vkDestroyCommandPool", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkDestroyCommandPool>(DestroyCommandPool))},
+    {"vkDestroyDescriptorPool", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkDestroyDescriptorPool>(DestroyDescriptorPool))},
+    {"vkDestroyDescriptorSetLayout", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkDestroyDescriptorSetLayout>(DestroyDescriptorSetLayout))},
+    {"vkDestroyDevice", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkDestroyDevice>(DestroyDevice))},
+    {"vkDestroyEvent", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkDestroyEvent>(DestroyEvent))},
+    {"vkDestroyFence", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkDestroyFence>(DestroyFence))},
+    {"vkDestroyFramebuffer", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkDestroyFramebuffer>(DestroyFramebuffer))},
+    {"vkDestroyImage", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkDestroyImage>(DestroyImage))},
+    {"vkDestroyImageView", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkDestroyImageView>(DestroyImageView))},
+    {"vkDestroyPipeline", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkDestroyPipeline>(DestroyPipeline))},
+    {"vkDestroyPipelineCache", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkDestroyPipelineCache>(DestroyPipelineCache))},
+    {"vkDestroyPipelineLayout", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkDestroyPipelineLayout>(DestroyPipelineLayout))},
+    {"vkDestroyQueryPool", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkDestroyQueryPool>(DestroyQueryPool))},
+    {"vkDestroyRenderPass", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkDestroyRenderPass>(DestroyRenderPass))},
+    {"vkDestroySampler", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkDestroySampler>(DestroySampler))},
+    {"vkDestroySemaphore", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkDestroySemaphore>(DestroySemaphore))},
+    {"vkDestroyShader", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkDestroyShader>(DestroyShader))},
+    {"vkDestroyShaderModule", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkDestroyShaderModule>(DestroyShaderModule))},
+    {"vkDeviceWaitIdle", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkDeviceWaitIdle>(DeviceWaitIdle))},
+    {"vkEndCommandBuffer", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkEndCommandBuffer>(EndCommandBuffer))},
+    {"vkFlushMappedMemoryRanges", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkFlushMappedMemoryRanges>(FlushMappedMemoryRanges))},
+    {"vkFreeDescriptorSets", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkFreeDescriptorSets>(FreeDescriptorSets))},
+    {"vkFreeMemory", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkFreeMemory>(FreeMemory))},
+    {"vkGetBufferMemoryRequirements", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkGetBufferMemoryRequirements>(GetBufferMemoryRequirements))},
+    {"vkGetDeviceMemoryCommitment", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkGetDeviceMemoryCommitment>(GetDeviceMemoryCommitment))},
+    {"vkGetDeviceProcAddr", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkGetDeviceProcAddr>(GetDeviceProcAddr))},
+    {"vkGetDeviceQueue", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkGetDeviceQueue>(GetDeviceQueue))},
+    {"vkGetEventStatus", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkGetEventStatus>(GetEventStatus))},
+    {"vkGetFenceStatus", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkGetFenceStatus>(GetFenceStatus))},
+    {"vkGetImageMemoryRequirements", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkGetImageMemoryRequirements>(GetImageMemoryRequirements))},
+    {"vkGetImageSparseMemoryRequirements", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkGetImageSparseMemoryRequirements>(GetImageSparseMemoryRequirements))},
+    {"vkGetImageSubresourceLayout", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkGetImageSubresourceLayout>(GetImageSubresourceLayout))},
+    {"vkGetPipelineCacheData", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkGetPipelineCacheData>(GetPipelineCacheData))},
+    {"vkGetPipelineCacheSize", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkGetPipelineCacheSize>(GetPipelineCacheSize))},
+    {"vkGetQueryPoolResults", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkGetQueryPoolResults>(GetQueryPoolResults))},
+    {"vkGetRenderAreaGranularity", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkGetRenderAreaGranularity>(GetRenderAreaGranularity))},
+    {"vkInvalidateMappedMemoryRanges", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkInvalidateMappedMemoryRanges>(InvalidateMappedMemoryRanges))},
+    {"vkMapMemory", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkMapMemory>(MapMemory))},
+    {"vkMergePipelineCaches", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkMergePipelineCaches>(MergePipelineCaches))},
+    {"vkQueueBindSparseBufferMemory", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkQueueBindSparseBufferMemory>(QueueBindSparseBufferMemory))},
+    {"vkQueueBindSparseImageMemory", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkQueueBindSparseImageMemory>(QueueBindSparseImageMemory))},
+    {"vkQueueBindSparseImageOpaqueMemory", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkQueueBindSparseImageOpaqueMemory>(QueueBindSparseImageOpaqueMemory))},
+    {"vkQueueSignalSemaphore", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkQueueSignalSemaphore>(QueueSignalSemaphore))},
+    {"vkQueueSubmit", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkQueueSubmit>(QueueSubmit))},
+    {"vkQueueWaitIdle", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkQueueWaitIdle>(QueueWaitIdle))},
+    {"vkQueueWaitSemaphore", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkQueueWaitSemaphore>(QueueWaitSemaphore))},
+    {"vkResetCommandBuffer", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkResetCommandBuffer>(ResetCommandBuffer))},
+    {"vkResetCommandPool", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkResetCommandPool>(ResetCommandPool))},
+    {"vkResetDescriptorPool", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkResetDescriptorPool>(ResetDescriptorPool))},
+    {"vkResetEvent", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkResetEvent>(ResetEvent))},
+    {"vkResetFences", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkResetFences>(ResetFences))},
+    {"vkSetEvent", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkSetEvent>(SetEvent))},
+    {"vkUnmapMemory", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkUnmapMemory>(UnmapMemory))},
+    {"vkUpdateDescriptorSets", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkUpdateDescriptorSets>(UpdateDescriptorSets))},
+    {"vkWaitForFences", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vkWaitForFences>(WaitForFences))},
     // clang-format on
 };
 
diff --git a/vulkan/nulldrv/null_driver_gen.cpp.tmpl b/vulkan/nulldrv/null_driver_gen.cpp.tmpl
index 9b48869..d749c6e 100644
--- a/vulkan/nulldrv/null_driver_gen.cpp.tmpl
+++ b/vulkan/nulldrv/null_driver_gen.cpp.tmpl
@@ -68,11 +68,18 @@
     return nullptr;
 }

+// The reinterpret_cast<..>(static_cast<..>(..)) business is there to ensure
+// that the function declaration in null_driver.h matches the function pointer
+// type in vulkan.h. If we just used reinterpret_cast<>, the compiler wouldn't
+// tell us if there's a mistake in null_driver.h. A better solution would be to
+// generate the declarations in null_driver.h.
 const NameProcEntry kInstanceProcTbl[] = {«
   // clang-format off
   {{range $f := SortBy (AllCommands $) "FunctionName"}}
-    {{if eq (Macro "Vtbl" $f) "Instance"}}
-      {"{{Macro "FunctionName" $f}}", reinterpret_cast<PFN_vkVoidFunction>({{Macro "FunctionNameNoPrefix" $f}})},
+    {{if not (GetAnnotation $f "extension")}}
+      {{if eq (Macro "Vtbl" $f) "Instance"}}
+        {"{{Macro "FunctionName" $f}}", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vk{{Macro "FunctionNameNoPrefix" $f}}>({{Macro "FunctionNameNoPrefix" $f}}))},
+      {{end}}
     {{end}}
   {{end}}
   // clang-format on
@@ -81,8 +88,10 @@
 const NameProcEntry kDeviceProcTbl[] = {«
   // clang-format off
   {{range $f := SortBy (AllCommands $) "FunctionName"}}
-    {{if eq (Macro "Vtbl" $f) "Device"}}
-      {"{{Macro "FunctionName" $f}}", reinterpret_cast<PFN_vkVoidFunction>({{Macro "FunctionNameNoPrefix" $f}})},
+    {{if not (GetAnnotation $f "extension")}}
+      {{if eq (Macro "Vtbl" $f) "Device"}}
+        {"{{Macro "FunctionName" $f}}", reinterpret_cast<PFN_vkVoidFunction>(static_cast<PFN_vk{{Macro "FunctionNameNoPrefix" $f}}>({{Macro "FunctionNameNoPrefix" $f}}))},
+      {{end}}
     {{end}}
   {{end}}
   // clang-format on
diff --git a/vulkan/patches/README b/vulkan/patches/README
index 64ccf5d..d424dd8 100644
--- a/vulkan/patches/README
+++ b/vulkan/patches/README
@@ -12,8 +12,15 @@
 
 frameworks_base-apk_library_dir
 -------------------------------
-This branch is for frameworks/base. It modifies the framework to
+This branch is for $TOP/frameworks/base. It modifies the framework to
 inform the Vulkan loader, during activity startup, where the
 activity's native library directory. The loader will search this
 directory for layer libraries. Without this change, layers will only
 be loaded from a global location under /data.
+
+
+build-install_libvulkan
+-----------------------
+This branch is for $TOP/build. It adds libvulkan.so to the base
+PRODUCT_PACKAGES variable, so it will be built and installed on the system
+partition by default.
diff --git a/vulkan/patches/build-install_libvulkan/0001-Add-libvulkan-to-base-PRODUCT_PACKAGES.patch b/vulkan/patches/build-install_libvulkan/0001-Add-libvulkan-to-base-PRODUCT_PACKAGES.patch
new file mode 100644
index 0000000..9d214bd
--- /dev/null
+++ b/vulkan/patches/build-install_libvulkan/0001-Add-libvulkan-to-base-PRODUCT_PACKAGES.patch
@@ -0,0 +1,25 @@
+From a0aa01fb36a2769b7113316c86e902def62001d9 Mon Sep 17 00:00:00 2001
+From: Jesse Hall <jessehall@google.com>
+Date: Wed, 14 Oct 2015 15:20:34 -0700
+Subject: [PATCH] Add libvulkan to base PRODUCT_PACKAGES
+
+Change-Id: I6c3ad4732148888a88fe980bf8e2bedf26ee74c8
+---
+ target/product/base.mk | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/target/product/base.mk b/target/product/base.mk
+index 1699156..4b9ce92 100644
+--- a/target/product/base.mk
++++ b/target/product/base.mk
+@@ -94,6 +94,7 @@ PRODUCT_PACKAGES += \
+     libvisualizer \
+     libvorbisidec \
+     libmediandk \
++    libvulkan \
+     libwifi-service \
+     media \
+     media_cmd \
+-- 
+2.6.0.rc2.230.g3dd15c0
+
diff --git a/vulkan/tools/Android.mk b/vulkan/tools/Android.mk
index 9ea5f14..31d6089 100644
--- a/vulkan/tools/Android.mk
+++ b/vulkan/tools/Android.mk
@@ -17,6 +17,7 @@
 
 LOCAL_CLANG := true
 LOCAL_CFLAGS := -std=c99 -fvisibility=hidden -fstrict-aliasing
+LOCAL_CFLAGS += -DLOG_TAG=\"vkinfo\"
 LOCAL_CFLAGS += -Weverything -Werror -Wno-padded -Wno-undef -Wno-switch-enum
 LOCAL_CPPFLAGS := -std=c++1y \
 	-Wno-c++98-compat-pedantic \
diff --git a/vulkan/tools/vkinfo.cpp b/vulkan/tools/vkinfo.cpp
index e1eb129..583e607 100644
--- a/vulkan/tools/vkinfo.cpp
+++ b/vulkan/tools/vkinfo.cpp
@@ -38,38 +38,14 @@
         case VK_EVENT_SET: result_str = "VK_EVENT_SET"; break;
         case VK_EVENT_RESET: result_str = "VK_EVENT_RESET"; break;
         case VK_INCOMPLETE: result_str = "VK_INCOMPLETE"; break;
-        case VK_ERROR_UNKNOWN: result_str = "VK_ERROR_UNKNOWN"; break;
-        case VK_ERROR_UNAVAILABLE: result_str = "VK_ERROR_UNAVAILABLE"; break;
-        case VK_ERROR_INITIALIZATION_FAILED: result_str = "VK_ERROR_INITIALIZATION_FAILED"; break;
         case VK_ERROR_OUT_OF_HOST_MEMORY: result_str = "VK_ERROR_OUT_OF_HOST_MEMORY"; break;
         case VK_ERROR_OUT_OF_DEVICE_MEMORY: result_str = "VK_ERROR_OUT_OF_DEVICE_MEMORY"; break;
-        case VK_ERROR_DEVICE_ALREADY_CREATED: result_str = "VK_ERROR_DEVICE_ALREADY_CREATED"; break;
+        case VK_ERROR_INITIALIZATION_FAILED: result_str = "VK_ERROR_INITIALIZATION_FAILED"; break;
         case VK_ERROR_DEVICE_LOST: result_str = "VK_ERROR_DEVICE_LOST"; break;
-        case VK_ERROR_INVALID_POINTER: result_str = "VK_ERROR_INVALID_POINTER"; break;
-        case VK_ERROR_INVALID_VALUE: result_str = "VK_ERROR_INVALID_VALUE"; break;
-        case VK_ERROR_INVALID_HANDLE: result_str = "VK_ERROR_INVALID_HANDLE"; break;
-        case VK_ERROR_INVALID_ORDINAL: result_str = "VK_ERROR_INVALID_ORDINAL"; break;
-        case VK_ERROR_INVALID_MEMORY_SIZE: result_str = "VK_ERROR_INVALID_MEMORY_SIZE"; break;
-        case VK_ERROR_INVALID_EXTENSION: result_str = "VK_ERROR_INVALID_EXTENSION"; break;
-        case VK_ERROR_INVALID_FLAGS: result_str = "VK_ERROR_INVALID_FLAGS"; break;
-        case VK_ERROR_INVALID_ALIGNMENT: result_str = "VK_ERROR_INVALID_ALIGNMENT"; break;
-        case VK_ERROR_INVALID_FORMAT: result_str = "VK_ERROR_INVALID_FORMAT"; break;
-        case VK_ERROR_INVALID_IMAGE: result_str = "VK_ERROR_INVALID_IMAGE"; break;
-        case VK_ERROR_INVALID_DESCRIPTOR_SET_DATA: result_str = "VK_ERROR_INVALID_DESCRIPTOR_SET_DATA"; break;
-        case VK_ERROR_INVALID_QUEUE_TYPE: result_str = "VK_ERROR_INVALID_QUEUE_TYPE"; break;
-        case VK_ERROR_UNSUPPORTED_SHADER_IL_VERSION: result_str = "VK_ERROR_UNSUPPORTED_SHADER_IL_VERSION"; break;
-        case VK_ERROR_BAD_SHADER_CODE: result_str = "VK_ERROR_BAD_SHADER_CODE"; break;
-        case VK_ERROR_BAD_PIPELINE_DATA: result_str = "VK_ERROR_BAD_PIPELINE_DATA"; break;
-        case VK_ERROR_NOT_MAPPABLE: result_str = "VK_ERROR_NOT_MAPPABLE"; break;
         case VK_ERROR_MEMORY_MAP_FAILED: result_str = "VK_ERROR_MEMORY_MAP_FAILED"; break;
-        case VK_ERROR_MEMORY_UNMAP_FAILED: result_str = "VK_ERROR_MEMORY_UNMAP_FAILED"; break;
-        case VK_ERROR_INCOMPATIBLE_DEVICE: result_str = "VK_ERROR_INCOMPATIBLE_DEVICE"; break;
+        case VK_ERROR_LAYER_NOT_PRESENT: result_str = "VK_ERROR_LAYER_NOT_PRESENT"; break;
+        case VK_ERROR_EXTENSION_NOT_PRESENT: result_str = "VK_ERROR_EXTENSION_NOT_PRESENT"; break;
         case VK_ERROR_INCOMPATIBLE_DRIVER: result_str = "VK_ERROR_INCOMPATIBLE_DRIVER"; break;
-        case VK_ERROR_INCOMPLETE_COMMAND_BUFFER: result_str = "VK_ERROR_INCOMPLETE_COMMAND_BUFFER"; break;
-        case VK_ERROR_BUILDING_COMMAND_BUFFER: result_str = "VK_ERROR_BUILDING_COMMAND_BUFFER"; break;
-        case VK_ERROR_MEMORY_NOT_BOUND: result_str = "VK_ERROR_MEMORY_NOT_BOUND"; break;
-        case VK_ERROR_INCOMPATIBLE_QUEUE: result_str = "VK_ERROR_INCOMPATIBLE_QUEUE"; break;
-        case VK_ERROR_INVALID_LAYER: result_str = "VK_ERROR_INVALID_LAYER"; break;
         default: result_str = "<unknown VkResult>"; break;
             // clang-format on
     }
@@ -94,6 +70,21 @@
     }
 }
 
+const char* VkQueueFlagBitStr(VkQueueFlagBits bit) {
+    switch (bit) {
+        case VK_QUEUE_GRAPHICS_BIT:
+            return "GRAPHICS";
+        case VK_QUEUE_COMPUTE_BIT:
+            return "COMPUTE";
+        case VK_QUEUE_DMA_BIT:
+            return "DMA";
+        case VK_QUEUE_SPARSE_MEMMGR_BIT:
+            return "SPARSE";
+        case VK_QUEUE_EXTENDED_BIT:
+            return "EXT";
+    }
+}
+
 void DumpPhysicalDevice(uint32_t idx, VkPhysicalDevice pdev) {
     VkResult result;
     std::ostringstream strbuf;
@@ -113,8 +104,8 @@
     if (result != VK_SUCCESS)
         die("vkGetPhysicalDeviceMemoryProperties", result);
     for (uint32_t heap = 0; heap < mem_props.memoryHeapCount; heap++) {
-        if ((mem_props.memoryHeaps[heap].flags & VK_MEMORY_HEAP_HOST_LOCAL) !=
-            0)
+        if ((mem_props.memoryHeaps[heap].flags &
+             VK_MEMORY_HEAP_HOST_LOCAL_BIT) != 0)
             strbuf << "HOST_LOCAL";
         printf("     Heap %u: 0x%" PRIx64 " %s\n", heap,
                mem_props.memoryHeaps[heap].size, strbuf.str().c_str());
@@ -137,10 +128,37 @@
                 strbuf << " WRITE_COMBINED";
             if ((flags & VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT) != 0)
                 strbuf << " LAZILY_ALLOCATED";
-            printf("        Type %u: %s\n", type, strbuf.str().c_str());
+            printf("       Type %u: %s\n", type, strbuf.str().c_str());
             strbuf.str(std::string());
         }
     }
+
+    uint32_t num_queue_families;
+    result = vkGetPhysicalDeviceQueueFamilyProperties(pdev, &num_queue_families,
+                                                      nullptr);
+    if (result != VK_SUCCESS)
+        die("vkGetPhysicalDeviceQueueFamilyProperties (count)", result);
+    std::vector<VkQueueFamilyProperties> queue_family_properties(
+        num_queue_families);
+    result = vkGetPhysicalDeviceQueueFamilyProperties(
+        pdev, &num_queue_families, queue_family_properties.data());
+    if (result != VK_SUCCESS)
+        die("vkGetPhysicalDeviceQueueFamilyProperties (values)", result);
+    for (uint32_t family = 0; family < num_queue_families; family++) {
+        const VkQueueFamilyProperties& qprops = queue_family_properties[family];
+        const char* sep = "";
+        int bit, queue_flags = static_cast<int>(qprops.queueFlags);
+        while ((bit = __builtin_ffs(queue_flags)) != 0) {
+            VkQueueFlagBits flag = VkQueueFlagBits(1 << (bit - 1));
+            strbuf << sep << VkQueueFlagBitStr(flag);
+            queue_flags &= ~flag;
+            sep = "+";
+        }
+        printf("     Queue Family %u: %2ux %s timestamps:%s\n", family,
+               qprops.queueCount, strbuf.str().c_str(),
+               qprops.supportsTimestamps ? "YES" : "NO");
+        strbuf.str(std::string());
+    }
 }
 
 }  // namespace
@@ -184,9 +202,7 @@
     for (uint32_t i = 0; i < physical_devices.size(); i++)
         DumpPhysicalDevice(i, physical_devices[i]);
 
-    result = vkDestroyInstance(instance);
-    if (result != VK_SUCCESS)
-        die("vkDestroyInstance", result);
+    vkDestroyInstance(instance);
 
     return 0;
 }