changeset 545:39aed3128be7

fix: tons of errors in wrapper generator, can now compile, extension function not loaded yet it seems
author Sam <sam@basx.dev>
date Fri, 24 Feb 2023 01:32:45 +0700
parents c3c772512e7c
children db4e583b40c3
files src/semicongine/engine.nim src/semicongine/shader.nim src/semicongine/vulkan/api.nim src/semicongine/vulkan/platform/android.nim src/semicongine/vulkan_helpers.nim src/vulkan_api/vulkan_api_generator.nim
diffstat 6 files changed, 1029 insertions(+), 442 deletions(-) [+]
line wrap: on
line diff
--- a/src/semicongine/engine.nim	Thu Feb 23 00:34:38 2023 +0700
+++ b/src/semicongine/engine.nim	Fri Feb 24 01:32:45 2023 +0700
@@ -529,13 +529,13 @@
   if mousepos.isSome():
     result.input.mousePos = mousePos.get()
 
-  # setup vulkan functions
-  vkLoad1_0()
-  vkLoad1_1()
-  vkLoad1_2()
 
   # create vulkan instance
   result.vulkan.instance = createVulkanInstance(VULKAN_VERSION)
+
+  # setup vulkan functions
+  loadVulkan(result.vulkan.instance)
+
   when DEBUG_LOG:
     result.vulkan.debugMessenger = result.vulkan.instance.setupDebugLog()
   result.vulkan.surface = result.vulkan.instance.createVulkanSurface(result.window)
@@ -602,7 +602,7 @@
 
   var
     poolSize = VkDescriptorPoolSize(
-      `type`: VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER,
+      thetype: VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER,
       descriptorCount: uint32(MAX_FRAMES_IN_FLIGHT),
     )
     poolInfo = VkDescriptorPoolCreateInfo(
--- a/src/semicongine/shader.nim	Thu Feb 23 00:34:38 2023 +0700
+++ b/src/semicongine/shader.nim	Fri Feb 24 01:32:45 2023 +0700
@@ -38,9 +38,8 @@
   of VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT: "tese"
   of VK_SHADER_STAGE_GEOMETRY_BIT: "geom"
   of VK_SHADER_STAGE_FRAGMENT_BIT: "frag"
-  of VK_SHADER_STAGE_ALL_GRAPHICS: ""
   of VK_SHADER_STAGE_COMPUTE_BIT: "comp"
-  of VK_SHADER_STAGE_ALL: ""
+  else: ""
 
 proc compileGLSLToSPIRV(stage: static VkShaderStageFlagBits,
     shaderSource: static string, entrypoint: string): seq[
--- a/src/semicongine/vulkan/api.nim	Thu Feb 23 00:34:38 2023 +0700
+++ b/src/semicongine/vulkan/api.nim	Fri Feb 24 01:32:45 2023 +0700
@@ -1,5 +1,10 @@
 import std/dynlib
 import std/tables
+import std/strutils
+import std/logging
+import std/macros
+import std/private/digitsutils
+from typetraits import HoleyEnum
 type
   VkHandle* = distinct uint
   VkNonDispatchableHandle* = distinct uint
@@ -26,6 +31,12 @@
       error "Vulkan error: ", astToStr(call), " returned ", $value
       raise newException(Exception, "Vulkan error: " & astToStr(call) &
           " returned " & $value)
+# custom enum iteration (for enum values > 2^16)
+macro enumFullRange(a: typed): untyped =
+  newNimNode(nnkBracket).add(a.getType[1][1..^1])
+
+iterator items[T: HoleyEnum](E: typedesc[T]): T =
+  for a in enumFullRange(E): yield a
 const
   VK_MAX_PHYSICAL_DEVICE_NAME_SIZE*: uint32 = 256
   VK_UUID_SIZE*: uint32 = 16
@@ -430,9 +441,13 @@
     VK_PIPELINE_CACHE_CREATE_EXTERNALLY_SYNCHRONIZED_BIT = 0b00000000000000000000000000000001
     VK_PIPELINE_CACHE_CREATE_RESERVED_1_BIT_EXT = 0b00000000000000000000000000000010
     VK_PIPELINE_CACHE_CREATE_USE_APPLICATION_STORAGE_BIT = 0b00000000000000000000000000000100
-converter BitsetToNumber*(flags: openArray[VkPipelineCacheCreateFlagBits]): VkPipelineCacheCreateFlags =
-  for flag in flags:
-    result = VkPipelineCacheCreateFlags(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkPipelineCacheCreateFlagBits]): VkPipelineCacheCreateFlags =
+    for flag in flags:
+      result = VkPipelineCacheCreateFlags(uint(result) or uint(flag))
+func toEnums*(number: VkPipelineCacheCreateFlags): seq[VkPipelineCacheCreateFlagBits] =
+    for value in VkPipelineCacheCreateFlagBits.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkPrimitiveTopology* {.size: sizeof(cint).} = enum
     VK_PRIMITIVE_TOPOLOGY_POINT_LIST = 0
@@ -1861,30 +1876,49 @@
     VK_QUEUE_RESERVED_7_BIT_QCOM = 0b00000000000000000000000010000000
     VK_QUEUE_OPTICAL_FLOW_BIT_NV = 0b00000000000000000000000100000000
     VK_QUEUE_RESERVED_9_BIT_EXT = 0b00000000000000000000001000000000
-converter BitsetToNumber*(flags: openArray[VkQueueFlagBits]): VkQueueFlags =
-  for flag in flags:
-    result = VkQueueFlags(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkQueueFlagBits]): VkQueueFlags =
+    for flag in flags:
+      result = VkQueueFlags(uint(result) or uint(flag))
+func toEnums*(number: VkQueueFlags): seq[VkQueueFlagBits] =
+    for value in VkQueueFlagBits.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkCullModeFlagBits* {.size: sizeof(cint).} = enum
     VK_CULL_MODE_FRONT_BIT = 0b00000000000000000000000000000001
     VK_CULL_MODE_BACK_BIT = 0b00000000000000000000000000000010
-converter BitsetToNumber*(flags: openArray[VkCullModeFlagBits]): VkCullModeFlags =
-  for flag in flags:
-    result = VkCullModeFlags(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkCullModeFlagBits]): VkCullModeFlags =
+    for flag in flags:
+      result = VkCullModeFlags(uint(result) or uint(flag))
+func toEnums*(number: VkCullModeFlags): seq[VkCullModeFlagBits] =
+    for value in VkCullModeFlagBits.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
+const
+  VK_CULL_MODE_NONE* = 0
+  VK_CULL_MODE_FRONT_AND_BACK* = 0x00000003
 type
   VkRenderPassCreateFlagBits* {.size: sizeof(cint).} = enum
     VK_RENDER_PASS_CREATE_RESERVED_0_BIT_KHR = 0b00000000000000000000000000000001
     VK_RENDER_PASS_CREATE_TRANSFORM_BIT_QCOM = 0b00000000000000000000000000000010
-converter BitsetToNumber*(flags: openArray[VkRenderPassCreateFlagBits]): VkRenderPassCreateFlags =
-  for flag in flags:
-    result = VkRenderPassCreateFlags(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkRenderPassCreateFlagBits]): VkRenderPassCreateFlags =
+    for flag in flags:
+      result = VkRenderPassCreateFlags(uint(result) or uint(flag))
+func toEnums*(number: VkRenderPassCreateFlags): seq[VkRenderPassCreateFlagBits] =
+    for value in VkRenderPassCreateFlagBits.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkDeviceQueueCreateFlagBits* {.size: sizeof(cint).} = enum
     VK_DEVICE_QUEUE_CREATE_PROTECTED_BIT = 0b00000000000000000000000000000001
     VK_DEVICE_QUEUE_CREATE_RESERVED_1_BIT_QCOM = 0b00000000000000000000000000000010
-converter BitsetToNumber*(flags: openArray[VkDeviceQueueCreateFlagBits]): VkDeviceQueueCreateFlags =
-  for flag in flags:
-    result = VkDeviceQueueCreateFlags(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkDeviceQueueCreateFlagBits]): VkDeviceQueueCreateFlags =
+    for flag in flags:
+      result = VkDeviceQueueCreateFlags(uint(result) or uint(flag))
+func toEnums*(number: VkDeviceQueueCreateFlags): seq[VkDeviceQueueCreateFlagBits] =
+    for value in VkDeviceQueueCreateFlagBits.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkMemoryPropertyFlagBits* {.size: sizeof(cint).} = enum
     VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT = 0b00000000000000000000000000000001
@@ -1896,17 +1930,25 @@
     VK_MEMORY_PROPERTY_DEVICE_COHERENT_BIT_AMD = 0b00000000000000000000000001000000
     VK_MEMORY_PROPERTY_DEVICE_UNCACHED_BIT_AMD = 0b00000000000000000000000010000000
     VK_MEMORY_PROPERTY_RDMA_CAPABLE_BIT_NV = 0b00000000000000000000000100000000
-converter BitsetToNumber*(flags: openArray[VkMemoryPropertyFlagBits]): VkMemoryPropertyFlags =
-  for flag in flags:
-    result = VkMemoryPropertyFlags(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkMemoryPropertyFlagBits]): VkMemoryPropertyFlags =
+    for flag in flags:
+      result = VkMemoryPropertyFlags(uint(result) or uint(flag))
+func toEnums*(number: VkMemoryPropertyFlags): seq[VkMemoryPropertyFlagBits] =
+    for value in VkMemoryPropertyFlagBits.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkMemoryHeapFlagBits* {.size: sizeof(cint).} = enum
     VK_MEMORY_HEAP_DEVICE_LOCAL_BIT = 0b00000000000000000000000000000001
     VK_MEMORY_HEAP_MULTI_INSTANCE_BIT = 0b00000000000000000000000000000010
     VK_MEMORY_HEAP_SEU_SAFE_BIT = 0b00000000000000000000000000000100
-converter BitsetToNumber*(flags: openArray[VkMemoryHeapFlagBits]): VkMemoryHeapFlags =
-  for flag in flags:
-    result = VkMemoryHeapFlags(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkMemoryHeapFlagBits]): VkMemoryHeapFlags =
+    for flag in flags:
+      result = VkMemoryHeapFlags(uint(result) or uint(flag))
+func toEnums*(number: VkMemoryHeapFlags): seq[VkMemoryHeapFlagBits] =
+    for value in VkMemoryHeapFlagBits.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkAccessFlagBits* {.size: sizeof(cint).} = enum
     VK_ACCESS_INDIRECT_COMMAND_READ_BIT = 0b00000000000000000000000000000001
@@ -1937,9 +1979,13 @@
     VK_ACCESS_TRANSFORM_FEEDBACK_WRITE_BIT_EXT = 0b00000010000000000000000000000000
     VK_ACCESS_TRANSFORM_FEEDBACK_COUNTER_READ_BIT_EXT = 0b00000100000000000000000000000000
     VK_ACCESS_TRANSFORM_FEEDBACK_COUNTER_WRITE_BIT_EXT = 0b00001000000000000000000000000000
-converter BitsetToNumber*(flags: openArray[VkAccessFlagBits]): VkAccessFlags =
-  for flag in flags:
-    result = VkAccessFlags(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkAccessFlagBits]): VkAccessFlags =
+    for flag in flags:
+      result = VkAccessFlags(uint(result) or uint(flag))
+func toEnums*(number: VkAccessFlags): seq[VkAccessFlagBits] =
+    for value in VkAccessFlagBits.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkBufferUsageFlagBits* {.size: sizeof(cint).} = enum
     VK_BUFFER_USAGE_TRANSFER_SRC_BIT = 0b00000000000000000000000000000001
@@ -1969,9 +2015,13 @@
     VK_BUFFER_USAGE_MICROMAP_STORAGE_BIT_EXT = 0b00000001000000000000000000000000
     VK_BUFFER_USAGE_RESERVED_25_BIT_AMD = 0b00000010000000000000000000000000
     VK_BUFFER_USAGE_PUSH_DESCRIPTORS_DESCRIPTOR_BUFFER_BIT_EXT = 0b00000100000000000000000000000000
-converter BitsetToNumber*(flags: openArray[VkBufferUsageFlagBits]): VkBufferUsageFlags =
-  for flag in flags:
-    result = VkBufferUsageFlags(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkBufferUsageFlagBits]): VkBufferUsageFlags =
+    for flag in flags:
+      result = VkBufferUsageFlags(uint(result) or uint(flag))
+func toEnums*(number: VkBufferUsageFlags): seq[VkBufferUsageFlagBits] =
+    for value in VkBufferUsageFlagBits.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkBufferCreateFlagBits* {.size: sizeof(cint).} = enum
     VK_BUFFER_CREATE_SPARSE_BINDING_BIT = 0b00000000000000000000000000000001
@@ -1980,9 +2030,13 @@
     VK_BUFFER_CREATE_PROTECTED_BIT = 0b00000000000000000000000000001000
     VK_BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT = 0b00000000000000000000000000010000
     VK_BUFFER_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_EXT = 0b00000000000000000000000000100000
-converter BitsetToNumber*(flags: openArray[VkBufferCreateFlagBits]): VkBufferCreateFlags =
-  for flag in flags:
-    result = VkBufferCreateFlags(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkBufferCreateFlagBits]): VkBufferCreateFlags =
+    for flag in flags:
+      result = VkBufferCreateFlags(uint(result) or uint(flag))
+func toEnums*(number: VkBufferCreateFlags): seq[VkBufferCreateFlagBits] =
+    for value in VkBufferCreateFlagBits.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkShaderStageFlagBits* {.size: sizeof(cint).} = enum
     VK_SHADER_STAGE_VERTEX_BIT = 0b00000000000000000000000000000001
@@ -2004,9 +2058,16 @@
     VK_SHADER_STAGE_EXT_483_RESERVE_16 = 0b00000000000000010000000000000000
     VK_SHADER_STAGE_EXT_483_RESERVE_17 = 0b00000000000000100000000000000000
     VK_SHADER_STAGE_CLUSTER_CULLING_BIT_HUAWEI = 0b00000000000010000000000000000000
-converter BitsetToNumber*(flags: openArray[VkShaderStageFlagBits]): VkShaderStageFlags =
-  for flag in flags:
-    result = VkShaderStageFlags(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkShaderStageFlagBits]): VkShaderStageFlags =
+    for flag in flags:
+      result = VkShaderStageFlags(uint(result) or uint(flag))
+func toEnums*(number: VkShaderStageFlags): seq[VkShaderStageFlagBits] =
+    for value in VkShaderStageFlagBits.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
+const
+  VK_SHADER_STAGE_ALL_GRAPHICS* = 0x0000001F
+  VK_SHADER_STAGE_ALL* = 0x7FFFFFFF
 type
   VkImageUsageFlagBits* {.size: sizeof(cint).} = enum
     VK_IMAGE_USAGE_TRANSFER_SRC_BIT = 0b00000000000000000000000000000001
@@ -2032,9 +2093,13 @@
     VK_IMAGE_USAGE_SAMPLE_WEIGHT_BIT_QCOM = 0b00000000000100000000000000000000
     VK_IMAGE_USAGE_SAMPLE_BLOCK_MATCH_BIT_QCOM = 0b00000000001000000000000000000000
     VK_IMAGE_USAGE_RESERVED_22_BIT_EXT = 0b00000000010000000000000000000000
-converter BitsetToNumber*(flags: openArray[VkImageUsageFlagBits]): VkImageUsageFlags =
-  for flag in flags:
-    result = VkImageUsageFlags(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkImageUsageFlagBits]): VkImageUsageFlags =
+    for flag in flags:
+      result = VkImageUsageFlags(uint(result) or uint(flag))
+func toEnums*(number: VkImageUsageFlags): seq[VkImageUsageFlagBits] =
+    for value in VkImageUsageFlagBits.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkImageCreateFlagBits* {.size: sizeof(cint).} = enum
     VK_IMAGE_CREATE_SPARSE_BINDING_BIT = 0b00000000000000000000000000000001
@@ -2057,17 +2122,25 @@
     VK_IMAGE_CREATE_2D_VIEW_COMPATIBLE_BIT_EXT = 0b00000000000000100000000000000000
     VK_IMAGE_CREATE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_BIT_EXT = 0b00000000000001000000000000000000
     VK_IMAGE_CREATE_RESERVED_19_BIT_EXT = 0b00000000000010000000000000000000
-converter BitsetToNumber*(flags: openArray[VkImageCreateFlagBits]): VkImageCreateFlags =
-  for flag in flags:
-    result = VkImageCreateFlags(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkImageCreateFlagBits]): VkImageCreateFlags =
+    for flag in flags:
+      result = VkImageCreateFlags(uint(result) or uint(flag))
+func toEnums*(number: VkImageCreateFlags): seq[VkImageCreateFlagBits] =
+    for value in VkImageCreateFlagBits.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkImageViewCreateFlagBits* {.size: sizeof(cint).} = enum
     VK_IMAGE_VIEW_CREATE_FRAGMENT_DENSITY_MAP_DYNAMIC_BIT_EXT = 0b00000000000000000000000000000001
     VK_IMAGE_VIEW_CREATE_FRAGMENT_DENSITY_MAP_DEFERRED_BIT_EXT = 0b00000000000000000000000000000010
     VK_IMAGE_VIEW_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_EXT = 0b00000000000000000000000000000100
-converter BitsetToNumber*(flags: openArray[VkImageViewCreateFlagBits]): VkImageViewCreateFlags =
-  for flag in flags:
-    result = VkImageViewCreateFlags(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkImageViewCreateFlagBits]): VkImageViewCreateFlags =
+    for flag in flags:
+      result = VkImageViewCreateFlags(uint(result) or uint(flag))
+func toEnums*(number: VkImageViewCreateFlags): seq[VkImageViewCreateFlagBits] =
+    for value in VkImageViewCreateFlagBits.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkSamplerCreateFlagBits* {.size: sizeof(cint).} = enum
     VK_SAMPLER_CREATE_SUBSAMPLED_BIT_EXT = 0b00000000000000000000000000000001
@@ -2075,9 +2148,13 @@
     VK_SAMPLER_CREATE_NON_SEAMLESS_CUBE_MAP_BIT_EXT = 0b00000000000000000000000000000100
     VK_SAMPLER_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_EXT = 0b00000000000000000000000000001000
     VK_SAMPLER_CREATE_IMAGE_PROCESSING_BIT_QCOM = 0b00000000000000000000000000010000
-converter BitsetToNumber*(flags: openArray[VkSamplerCreateFlagBits]): VkSamplerCreateFlags =
-  for flag in flags:
-    result = VkSamplerCreateFlags(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkSamplerCreateFlagBits]): VkSamplerCreateFlags =
+    for flag in flags:
+      result = VkSamplerCreateFlags(uint(result) or uint(flag))
+func toEnums*(number: VkSamplerCreateFlags): seq[VkSamplerCreateFlagBits] =
+    for value in VkSamplerCreateFlagBits.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkPipelineCreateFlagBits* {.size: sizeof(cint).} = enum
     VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT = 0b00000000000000000000000000000001
@@ -2111,32 +2188,48 @@
     VK_PIPELINE_CREATE_RESERVED_BIT_28_NV = 0b00010000000000000000000000000000
     VK_PIPELINE_CREATE_DESCRIPTOR_BUFFER_BIT_EXT = 0b00100000000000000000000000000000
     VK_PIPELINE_CREATE_PROTECTED_ACCESS_ONLY_BIT_EXT = 0b01000000000000000000000000000000
-converter BitsetToNumber*(flags: openArray[VkPipelineCreateFlagBits]): VkPipelineCreateFlags =
-  for flag in flags:
-    result = VkPipelineCreateFlags(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkPipelineCreateFlagBits]): VkPipelineCreateFlags =
+    for flag in flags:
+      result = VkPipelineCreateFlags(uint(result) or uint(flag))
+func toEnums*(number: VkPipelineCreateFlags): seq[VkPipelineCreateFlagBits] =
+    for value in VkPipelineCreateFlagBits.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkPipelineShaderStageCreateFlagBits* {.size: sizeof(cint).} = enum
     VK_PIPELINE_SHADER_STAGE_CREATE_ALLOW_VARYING_SUBGROUP_SIZE_BIT = 0b00000000000000000000000000000001
     VK_PIPELINE_SHADER_STAGE_CREATE_REQUIRE_FULL_SUBGROUPS_BIT = 0b00000000000000000000000000000010
     VK_PIPELINE_SHADER_STAGE_CREATE_RESERVED_3_BIT_KHR = 0b00000000000000000000000000001000
-converter BitsetToNumber*(flags: openArray[VkPipelineShaderStageCreateFlagBits]): VkPipelineShaderStageCreateFlags =
-  for flag in flags:
-    result = VkPipelineShaderStageCreateFlags(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkPipelineShaderStageCreateFlagBits]): VkPipelineShaderStageCreateFlags =
+    for flag in flags:
+      result = VkPipelineShaderStageCreateFlags(uint(result) or uint(flag))
+func toEnums*(number: VkPipelineShaderStageCreateFlags): seq[VkPipelineShaderStageCreateFlagBits] =
+    for value in VkPipelineShaderStageCreateFlagBits.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkColorComponentFlagBits* {.size: sizeof(cint).} = enum
     VK_COLOR_COMPONENT_R_BIT = 0b00000000000000000000000000000001
     VK_COLOR_COMPONENT_G_BIT = 0b00000000000000000000000000000010
     VK_COLOR_COMPONENT_B_BIT = 0b00000000000000000000000000000100
     VK_COLOR_COMPONENT_A_BIT = 0b00000000000000000000000000001000
-converter BitsetToNumber*(flags: openArray[VkColorComponentFlagBits]): VkColorComponentFlags =
-  for flag in flags:
-    result = VkColorComponentFlags(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkColorComponentFlagBits]): VkColorComponentFlags =
+    for flag in flags:
+      result = VkColorComponentFlags(uint(result) or uint(flag))
+func toEnums*(number: VkColorComponentFlags): seq[VkColorComponentFlagBits] =
+    for value in VkColorComponentFlagBits.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkFenceCreateFlagBits* {.size: sizeof(cint).} = enum
     VK_FENCE_CREATE_SIGNALED_BIT = 0b00000000000000000000000000000001
-converter BitsetToNumber*(flags: openArray[VkFenceCreateFlagBits]): VkFenceCreateFlags =
-  for flag in flags:
-    result = VkFenceCreateFlags(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkFenceCreateFlagBits]): VkFenceCreateFlags =
+    for flag in flags:
+      result = VkFenceCreateFlags(uint(result) or uint(flag))
+func toEnums*(number: VkFenceCreateFlags): seq[VkFenceCreateFlagBits] =
+    for value in VkFenceCreateFlagBits.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkFormatFeatureFlagBits* {.size: sizeof(cint).} = enum
     VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT = 0b00000000000000000000000000000001
@@ -2170,15 +2263,23 @@
     VK_FORMAT_FEATURE_VIDEO_ENCODE_DPB_BIT_KHR = 0b00010000000000000000000000000000
     VK_FORMAT_FEATURE_ACCELERATION_STRUCTURE_VERTEX_BUFFER_BIT_KHR = 0b00100000000000000000000000000000
     VK_FORMAT_FEATURE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR = 0b01000000000000000000000000000000
-converter BitsetToNumber*(flags: openArray[VkFormatFeatureFlagBits]): VkFormatFeatureFlags =
-  for flag in flags:
-    result = VkFormatFeatureFlags(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkFormatFeatureFlagBits]): VkFormatFeatureFlags =
+    for flag in flags:
+      result = VkFormatFeatureFlags(uint(result) or uint(flag))
+func toEnums*(number: VkFormatFeatureFlags): seq[VkFormatFeatureFlagBits] =
+    for value in VkFormatFeatureFlagBits.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkQueryControlFlagBits* {.size: sizeof(cint).} = enum
     VK_QUERY_CONTROL_PRECISE_BIT = 0b00000000000000000000000000000001
-converter BitsetToNumber*(flags: openArray[VkQueryControlFlagBits]): VkQueryControlFlags =
-  for flag in flags:
-    result = VkQueryControlFlags(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkQueryControlFlagBits]): VkQueryControlFlags =
+    for flag in flags:
+      result = VkQueryControlFlags(uint(result) or uint(flag))
+func toEnums*(number: VkQueryControlFlags): seq[VkQueryControlFlagBits] =
+    for value in VkQueryControlFlagBits.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkQueryResultFlagBits* {.size: sizeof(cint).} = enum
     VK_QUERY_RESULT_64_BIT = 0b00000000000000000000000000000001
@@ -2186,17 +2287,25 @@
     VK_QUERY_RESULT_WITH_AVAILABILITY_BIT = 0b00000000000000000000000000000100
     VK_QUERY_RESULT_PARTIAL_BIT = 0b00000000000000000000000000001000
     VK_QUERY_RESULT_WITH_STATUS_BIT_KHR = 0b00000000000000000000000000010000
-converter BitsetToNumber*(flags: openArray[VkQueryResultFlagBits]): VkQueryResultFlags =
-  for flag in flags:
-    result = VkQueryResultFlags(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkQueryResultFlagBits]): VkQueryResultFlags =
+    for flag in flags:
+      result = VkQueryResultFlags(uint(result) or uint(flag))
+func toEnums*(number: VkQueryResultFlags): seq[VkQueryResultFlagBits] =
+    for value in VkQueryResultFlagBits.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkCommandBufferUsageFlagBits* {.size: sizeof(cint).} = enum
     VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT = 0b00000000000000000000000000000001
     VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT = 0b00000000000000000000000000000010
     VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT = 0b00000000000000000000000000000100
-converter BitsetToNumber*(flags: openArray[VkCommandBufferUsageFlagBits]): VkCommandBufferUsageFlags =
-  for flag in flags:
-    result = VkCommandBufferUsageFlags(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkCommandBufferUsageFlagBits]): VkCommandBufferUsageFlags =
+    for flag in flags:
+      result = VkCommandBufferUsageFlags(uint(result) or uint(flag))
+func toEnums*(number: VkCommandBufferUsageFlags): seq[VkCommandBufferUsageFlagBits] =
+    for value in VkCommandBufferUsageFlagBits.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkQueryPipelineStatisticFlagBits* {.size: sizeof(cint).} = enum
     VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_BIT = 0b00000000000000000000000000000001
@@ -2213,9 +2322,13 @@
     VK_QUERY_PIPELINE_STATISTIC_TASK_SHADER_INVOCATIONS_BIT_EXT = 0b00000000000000000000100000000000
     VK_QUERY_PIPELINE_STATISTIC_MESH_SHADER_INVOCATIONS_BIT_EXT = 0b00000000000000000001000000000000
     VK_QUERY_PIPELINE_STATISTIC_CLUSTER_CULLING_SHADER_INVOCATIONS_BIT_HUAWEI = 0b00000000000000000010000000000000
-converter BitsetToNumber*(flags: openArray[VkQueryPipelineStatisticFlagBits]): VkQueryPipelineStatisticFlags =
-  for flag in flags:
-    result = VkQueryPipelineStatisticFlags(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkQueryPipelineStatisticFlagBits]): VkQueryPipelineStatisticFlags =
+    for flag in flags:
+      result = VkQueryPipelineStatisticFlags(uint(result) or uint(flag))
+func toEnums*(number: VkQueryPipelineStatisticFlags): seq[VkQueryPipelineStatisticFlagBits] =
+    for value in VkQueryPipelineStatisticFlagBits.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkImageAspectFlagBits* {.size: sizeof(cint).} = enum
     VK_IMAGE_ASPECT_COLOR_BIT = 0b00000000000000000000000000000001
@@ -2229,23 +2342,35 @@
     VK_IMAGE_ASPECT_MEMORY_PLANE_1_BIT_EXT = 0b00000000000000000000000100000000
     VK_IMAGE_ASPECT_MEMORY_PLANE_2_BIT_EXT = 0b00000000000000000000001000000000
     VK_IMAGE_ASPECT_MEMORY_PLANE_3_BIT_EXT = 0b00000000000000000000010000000000
-converter BitsetToNumber*(flags: openArray[VkImageAspectFlagBits]): VkImageAspectFlags =
-  for flag in flags:
-    result = VkImageAspectFlags(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkImageAspectFlagBits]): VkImageAspectFlags =
+    for flag in flags:
+      result = VkImageAspectFlags(uint(result) or uint(flag))
+func toEnums*(number: VkImageAspectFlags): seq[VkImageAspectFlagBits] =
+    for value in VkImageAspectFlagBits.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkSparseImageFormatFlagBits* {.size: sizeof(cint).} = enum
     VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT = 0b00000000000000000000000000000001
     VK_SPARSE_IMAGE_FORMAT_ALIGNED_MIP_SIZE_BIT = 0b00000000000000000000000000000010
     VK_SPARSE_IMAGE_FORMAT_NONSTANDARD_BLOCK_SIZE_BIT = 0b00000000000000000000000000000100
-converter BitsetToNumber*(flags: openArray[VkSparseImageFormatFlagBits]): VkSparseImageFormatFlags =
-  for flag in flags:
-    result = VkSparseImageFormatFlags(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkSparseImageFormatFlagBits]): VkSparseImageFormatFlags =
+    for flag in flags:
+      result = VkSparseImageFormatFlags(uint(result) or uint(flag))
+func toEnums*(number: VkSparseImageFormatFlags): seq[VkSparseImageFormatFlagBits] =
+    for value in VkSparseImageFormatFlagBits.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkSparseMemoryBindFlagBits* {.size: sizeof(cint).} = enum
     VK_SPARSE_MEMORY_BIND_METADATA_BIT = 0b00000000000000000000000000000001
-converter BitsetToNumber*(flags: openArray[VkSparseMemoryBindFlagBits]): VkSparseMemoryBindFlags =
-  for flag in flags:
-    result = VkSparseMemoryBindFlags(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkSparseMemoryBindFlagBits]): VkSparseMemoryBindFlags =
+    for flag in flags:
+      result = VkSparseMemoryBindFlags(uint(result) or uint(flag))
+func toEnums*(number: VkSparseMemoryBindFlags): seq[VkSparseMemoryBindFlagBits] =
+    for value in VkSparseMemoryBindFlagBits.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkPipelineStageFlagBits* {.size: sizeof(cint).} = enum
     VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT = 0b00000000000000000000000000000001
@@ -2274,30 +2399,46 @@
     VK_PIPELINE_STAGE_FRAGMENT_DENSITY_PROCESS_BIT_EXT = 0b00000000100000000000000000000000
     VK_PIPELINE_STAGE_TRANSFORM_FEEDBACK_BIT_EXT = 0b00000001000000000000000000000000
     VK_PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR = 0b00000010000000000000000000000000
-converter BitsetToNumber*(flags: openArray[VkPipelineStageFlagBits]): VkPipelineStageFlags =
-  for flag in flags:
-    result = VkPipelineStageFlags(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkPipelineStageFlagBits]): VkPipelineStageFlags =
+    for flag in flags:
+      result = VkPipelineStageFlags(uint(result) or uint(flag))
+func toEnums*(number: VkPipelineStageFlags): seq[VkPipelineStageFlagBits] =
+    for value in VkPipelineStageFlagBits.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkCommandPoolCreateFlagBits* {.size: sizeof(cint).} = enum
     VK_COMMAND_POOL_CREATE_TRANSIENT_BIT = 0b00000000000000000000000000000001
     VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT = 0b00000000000000000000000000000010
     VK_COMMAND_POOL_CREATE_PROTECTED_BIT = 0b00000000000000000000000000000100
-converter BitsetToNumber*(flags: openArray[VkCommandPoolCreateFlagBits]): VkCommandPoolCreateFlags =
-  for flag in flags:
-    result = VkCommandPoolCreateFlags(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkCommandPoolCreateFlagBits]): VkCommandPoolCreateFlags =
+    for flag in flags:
+      result = VkCommandPoolCreateFlags(uint(result) or uint(flag))
+func toEnums*(number: VkCommandPoolCreateFlags): seq[VkCommandPoolCreateFlagBits] =
+    for value in VkCommandPoolCreateFlagBits.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkCommandPoolResetFlagBits* {.size: sizeof(cint).} = enum
     VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT = 0b00000000000000000000000000000001
     VK_COMMAND_POOL_RESET_RESERVED_1_BIT_COREAVI = 0b00000000000000000000000000000010
-converter BitsetToNumber*(flags: openArray[VkCommandPoolResetFlagBits]): VkCommandPoolResetFlags =
-  for flag in flags:
-    result = VkCommandPoolResetFlags(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkCommandPoolResetFlagBits]): VkCommandPoolResetFlags =
+    for flag in flags:
+      result = VkCommandPoolResetFlags(uint(result) or uint(flag))
+func toEnums*(number: VkCommandPoolResetFlags): seq[VkCommandPoolResetFlagBits] =
+    for value in VkCommandPoolResetFlagBits.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkCommandBufferResetFlagBits* {.size: sizeof(cint).} = enum
     VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT = 0b00000000000000000000000000000001
-converter BitsetToNumber*(flags: openArray[VkCommandBufferResetFlagBits]): VkCommandBufferResetFlags =
-  for flag in flags:
-    result = VkCommandBufferResetFlags(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkCommandBufferResetFlagBits]): VkCommandBufferResetFlags =
+    for flag in flags:
+      result = VkCommandBufferResetFlags(uint(result) or uint(flag))
+func toEnums*(number: VkCommandBufferResetFlags): seq[VkCommandBufferResetFlagBits] =
+    for value in VkCommandBufferResetFlagBits.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkSampleCountFlagBits* {.size: sizeof(cint).} = enum
     VK_SAMPLE_COUNT_1_BIT = 0b00000000000000000000000000000001
@@ -2307,48 +2448,74 @@
     VK_SAMPLE_COUNT_16_BIT = 0b00000000000000000000000000010000
     VK_SAMPLE_COUNT_32_BIT = 0b00000000000000000000000000100000
     VK_SAMPLE_COUNT_64_BIT = 0b00000000000000000000000001000000
-converter BitsetToNumber*(flags: openArray[VkSampleCountFlagBits]): VkSampleCountFlags =
-  for flag in flags:
-    result = VkSampleCountFlags(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkSampleCountFlagBits]): VkSampleCountFlags =
+    for flag in flags:
+      result = VkSampleCountFlags(uint(result) or uint(flag))
+func toEnums*(number: VkSampleCountFlags): seq[VkSampleCountFlagBits] =
+    for value in VkSampleCountFlagBits.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkAttachmentDescriptionFlagBits* {.size: sizeof(cint).} = enum
     VK_ATTACHMENT_DESCRIPTION_MAY_ALIAS_BIT = 0b00000000000000000000000000000001
-converter BitsetToNumber*(flags: openArray[VkAttachmentDescriptionFlagBits]): VkAttachmentDescriptionFlags =
-  for flag in flags:
-    result = VkAttachmentDescriptionFlags(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkAttachmentDescriptionFlagBits]): VkAttachmentDescriptionFlags =
+    for flag in flags:
+      result = VkAttachmentDescriptionFlags(uint(result) or uint(flag))
+func toEnums*(number: VkAttachmentDescriptionFlags): seq[VkAttachmentDescriptionFlagBits] =
+    for value in VkAttachmentDescriptionFlagBits.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkStencilFaceFlagBits* {.size: sizeof(cint).} = enum
     VK_STENCIL_FACE_FRONT_BIT = 0b00000000000000000000000000000001
     VK_STENCIL_FACE_BACK_BIT = 0b00000000000000000000000000000010
-converter BitsetToNumber*(flags: openArray[VkStencilFaceFlagBits]): VkStencilFaceFlags =
-  for flag in flags:
-    result = VkStencilFaceFlags(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkStencilFaceFlagBits]): VkStencilFaceFlags =
+    for flag in flags:
+      result = VkStencilFaceFlags(uint(result) or uint(flag))
+func toEnums*(number: VkStencilFaceFlags): seq[VkStencilFaceFlagBits] =
+    for value in VkStencilFaceFlagBits.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
+const
+  VK_STENCIL_FACE_FRONT_AND_BACK* = 0x00000003
 type
   VkDescriptorPoolCreateFlagBits* {.size: sizeof(cint).} = enum
     VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT = 0b00000000000000000000000000000001
     VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT = 0b00000000000000000000000000000010
     VK_DESCRIPTOR_POOL_CREATE_HOST_ONLY_BIT_EXT = 0b00000000000000000000000000000100
-converter BitsetToNumber*(flags: openArray[VkDescriptorPoolCreateFlagBits]): VkDescriptorPoolCreateFlags =
-  for flag in flags:
-    result = VkDescriptorPoolCreateFlags(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkDescriptorPoolCreateFlagBits]): VkDescriptorPoolCreateFlags =
+    for flag in flags:
+      result = VkDescriptorPoolCreateFlags(uint(result) or uint(flag))
+func toEnums*(number: VkDescriptorPoolCreateFlags): seq[VkDescriptorPoolCreateFlagBits] =
+    for value in VkDescriptorPoolCreateFlagBits.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkDependencyFlagBits* {.size: sizeof(cint).} = enum
     VK_DEPENDENCY_BY_REGION_BIT = 0b00000000000000000000000000000001
     VK_DEPENDENCY_VIEW_LOCAL_BIT = 0b00000000000000000000000000000010
     VK_DEPENDENCY_DEVICE_GROUP_BIT = 0b00000000000000000000000000000100
     VK_DEPENDENCY_FEEDBACK_LOOP_BIT_EXT = 0b00000000000000000000000000001000
-converter BitsetToNumber*(flags: openArray[VkDependencyFlagBits]): VkDependencyFlags =
-  for flag in flags:
-    result = VkDependencyFlags(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkDependencyFlagBits]): VkDependencyFlags =
+    for flag in flags:
+      result = VkDependencyFlags(uint(result) or uint(flag))
+func toEnums*(number: VkDependencyFlags): seq[VkDependencyFlagBits] =
+    for value in VkDependencyFlagBits.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkSemaphoreType* {.size: sizeof(cint).} = enum
     VK_SEMAPHORE_TYPE_BINARY = 0
     VK_SEMAPHORE_TYPE_TIMELINE = 1
   VkSemaphoreWaitFlagBits* {.size: sizeof(cint).} = enum
     VK_SEMAPHORE_WAIT_ANY_BIT = 0b00000000000000000000000000000001
-converter BitsetToNumber*(flags: openArray[VkSemaphoreWaitFlagBits]): VkSemaphoreWaitFlags =
-  for flag in flags:
-    result = VkSemaphoreWaitFlags(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkSemaphoreWaitFlagBits]): VkSemaphoreWaitFlags =
+    for flag in flags:
+      result = VkSemaphoreWaitFlags(uint(result) or uint(flag))
+func toEnums*(number: VkSemaphoreWaitFlags): seq[VkSemaphoreWaitFlagBits] =
+    for value in VkSemaphoreWaitFlagBits.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkPresentModeKHR* {.size: sizeof(cint).} = enum
     VK_PRESENT_MODE_IMMEDIATE_KHR = 0
@@ -2379,18 +2546,26 @@
     VK_DISPLAY_PLANE_ALPHA_GLOBAL_BIT_KHR = 0b00000000000000000000000000000010
     VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_BIT_KHR = 0b00000000000000000000000000000100
     VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_PREMULTIPLIED_BIT_KHR = 0b00000000000000000000000000001000
-converter BitsetToNumber*(flags: openArray[VkDisplayPlaneAlphaFlagBitsKHR]): VkDisplayPlaneAlphaFlagsKHR =
-  for flag in flags:
-    result = VkDisplayPlaneAlphaFlagsKHR(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkDisplayPlaneAlphaFlagBitsKHR]): VkDisplayPlaneAlphaFlagsKHR =
+    for flag in flags:
+      result = VkDisplayPlaneAlphaFlagsKHR(uint(result) or uint(flag))
+func toEnums*(number: VkDisplayPlaneAlphaFlagsKHR): seq[VkDisplayPlaneAlphaFlagBitsKHR] =
+    for value in VkDisplayPlaneAlphaFlagBitsKHR.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkCompositeAlphaFlagBitsKHR* {.size: sizeof(cint).} = enum
     VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR = 0b00000000000000000000000000000001
     VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR = 0b00000000000000000000000000000010
     VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR = 0b00000000000000000000000000000100
     VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR = 0b00000000000000000000000000001000
-converter BitsetToNumber*(flags: openArray[VkCompositeAlphaFlagBitsKHR]): VkCompositeAlphaFlagsKHR =
-  for flag in flags:
-    result = VkCompositeAlphaFlagsKHR(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkCompositeAlphaFlagBitsKHR]): VkCompositeAlphaFlagsKHR =
+    for flag in flags:
+      result = VkCompositeAlphaFlagsKHR(uint(result) or uint(flag))
+func toEnums*(number: VkCompositeAlphaFlagsKHR): seq[VkCompositeAlphaFlagBitsKHR] =
+    for value in VkCompositeAlphaFlagBitsKHR.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkSurfaceTransformFlagBitsKHR* {.size: sizeof(cint).} = enum
     VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR = 0b00000000000000000000000000000001
@@ -2402,15 +2577,23 @@
     VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR = 0b00000000000000000000000001000000
     VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR = 0b00000000000000000000000010000000
     VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR = 0b00000000000000000000000100000000
-converter BitsetToNumber*(flags: openArray[VkSurfaceTransformFlagBitsKHR]): VkSurfaceTransformFlagsKHR =
-  for flag in flags:
-    result = VkSurfaceTransformFlagsKHR(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkSurfaceTransformFlagBitsKHR]): VkSurfaceTransformFlagsKHR =
+    for flag in flags:
+      result = VkSurfaceTransformFlagsKHR(uint(result) or uint(flag))
+func toEnums*(number: VkSurfaceTransformFlagsKHR): seq[VkSurfaceTransformFlagBitsKHR] =
+    for value in VkSurfaceTransformFlagBitsKHR.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkSwapchainImageUsageFlagBitsANDROID* {.size: sizeof(cint).} = enum
     VK_SWAPCHAIN_IMAGE_USAGE_SHARED_BIT_ANDROID = 0b00000000000000000000000000000001
-converter BitsetToNumber*(flags: openArray[VkSwapchainImageUsageFlagBitsANDROID]): VkSwapchainImageUsageFlagsANDROID =
-  for flag in flags:
-    result = VkSwapchainImageUsageFlagsANDROID(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkSwapchainImageUsageFlagBitsANDROID]): VkSwapchainImageUsageFlagsANDROID =
+    for flag in flags:
+      result = VkSwapchainImageUsageFlagsANDROID(uint(result) or uint(flag))
+func toEnums*(number: VkSwapchainImageUsageFlagsANDROID): seq[VkSwapchainImageUsageFlagBitsANDROID] =
+    for value in VkSwapchainImageUsageFlagBitsANDROID.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkTimeDomainEXT* {.size: sizeof(cint).} = enum
     VK_TIME_DOMAIN_DEVICE_EXT = 0
@@ -2423,9 +2606,13 @@
     VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT = 0b00000000000000000000000000000100
     VK_DEBUG_REPORT_ERROR_BIT_EXT = 0b00000000000000000000000000001000
     VK_DEBUG_REPORT_DEBUG_BIT_EXT = 0b00000000000000000000000000010000
-converter BitsetToNumber*(flags: openArray[VkDebugReportFlagBitsEXT]): VkDebugReportFlagsEXT =
-  for flag in flags:
-    result = VkDebugReportFlagsEXT(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkDebugReportFlagBitsEXT]): VkDebugReportFlagsEXT =
+    for flag in flags:
+      result = VkDebugReportFlagsEXT(uint(result) or uint(flag))
+func toEnums*(number: VkDebugReportFlagsEXT): seq[VkDebugReportFlagBitsEXT] =
+    for value in VkDebugReportFlagBitsEXT.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkDebugReportObjectTypeEXT* {.size: sizeof(cint).} = enum
     VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT = 0
@@ -2481,17 +2668,25 @@
     VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_NV = 0b00000000000000000000000000000010
     VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_IMAGE_BIT_NV = 0b00000000000000000000000000000100
     VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_IMAGE_KMT_BIT_NV = 0b00000000000000000000000000001000
-converter BitsetToNumber*(flags: openArray[VkExternalMemoryHandleTypeFlagBitsNV]): VkExternalMemoryHandleTypeFlagsNV =
-  for flag in flags:
-    result = VkExternalMemoryHandleTypeFlagsNV(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkExternalMemoryHandleTypeFlagBitsNV]): VkExternalMemoryHandleTypeFlagsNV =
+    for flag in flags:
+      result = VkExternalMemoryHandleTypeFlagsNV(uint(result) or uint(flag))
+func toEnums*(number: VkExternalMemoryHandleTypeFlagsNV): seq[VkExternalMemoryHandleTypeFlagBitsNV] =
+    for value in VkExternalMemoryHandleTypeFlagBitsNV.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkExternalMemoryFeatureFlagBitsNV* {.size: sizeof(cint).} = enum
     VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT_NV = 0b00000000000000000000000000000001
     VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT_NV = 0b00000000000000000000000000000010
     VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT_NV = 0b00000000000000000000000000000100
-converter BitsetToNumber*(flags: openArray[VkExternalMemoryFeatureFlagBitsNV]): VkExternalMemoryFeatureFlagsNV =
-  for flag in flags:
-    result = VkExternalMemoryFeatureFlagsNV(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkExternalMemoryFeatureFlagBitsNV]): VkExternalMemoryFeatureFlagsNV =
+    for flag in flags:
+      result = VkExternalMemoryFeatureFlagsNV(uint(result) or uint(flag))
+func toEnums*(number: VkExternalMemoryFeatureFlagsNV): seq[VkExternalMemoryFeatureFlagBitsNV] =
+    for value in VkExternalMemoryFeatureFlagBitsNV.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkValidationCheckEXT* {.size: sizeof(cint).} = enum
     VK_VALIDATION_CHECK_ALL_EXT = 0
@@ -2521,23 +2716,35 @@
     VK_SUBGROUP_FEATURE_CLUSTERED_BIT = 0b00000000000000000000000001000000
     VK_SUBGROUP_FEATURE_QUAD_BIT = 0b00000000000000000000000010000000
     VK_SUBGROUP_FEATURE_PARTITIONED_BIT_NV = 0b00000000000000000000000100000000
-converter BitsetToNumber*(flags: openArray[VkSubgroupFeatureFlagBits]): VkSubgroupFeatureFlags =
-  for flag in flags:
-    result = VkSubgroupFeatureFlags(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkSubgroupFeatureFlagBits]): VkSubgroupFeatureFlags =
+    for flag in flags:
+      result = VkSubgroupFeatureFlags(uint(result) or uint(flag))
+func toEnums*(number: VkSubgroupFeatureFlags): seq[VkSubgroupFeatureFlagBits] =
+    for value in VkSubgroupFeatureFlagBits.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkIndirectCommandsLayoutUsageFlagBitsNV* {.size: sizeof(cint).} = enum
     VK_INDIRECT_COMMANDS_LAYOUT_USAGE_EXPLICIT_PREPROCESS_BIT_NV = 0b00000000000000000000000000000001
     VK_INDIRECT_COMMANDS_LAYOUT_USAGE_INDEXED_SEQUENCES_BIT_NV = 0b00000000000000000000000000000010
     VK_INDIRECT_COMMANDS_LAYOUT_USAGE_UNORDERED_SEQUENCES_BIT_NV = 0b00000000000000000000000000000100
-converter BitsetToNumber*(flags: openArray[VkIndirectCommandsLayoutUsageFlagBitsNV]): VkIndirectCommandsLayoutUsageFlagsNV =
-  for flag in flags:
-    result = VkIndirectCommandsLayoutUsageFlagsNV(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkIndirectCommandsLayoutUsageFlagBitsNV]): VkIndirectCommandsLayoutUsageFlagsNV =
+    for flag in flags:
+      result = VkIndirectCommandsLayoutUsageFlagsNV(uint(result) or uint(flag))
+func toEnums*(number: VkIndirectCommandsLayoutUsageFlagsNV): seq[VkIndirectCommandsLayoutUsageFlagBitsNV] =
+    for value in VkIndirectCommandsLayoutUsageFlagBitsNV.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkIndirectStateFlagBitsNV* {.size: sizeof(cint).} = enum
     VK_INDIRECT_STATE_FLAG_FRONTFACE_BIT_NV = 0b00000000000000000000000000000001
-converter BitsetToNumber*(flags: openArray[VkIndirectStateFlagBitsNV]): VkIndirectStateFlagsNV =
-  for flag in flags:
-    result = VkIndirectStateFlagsNV(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkIndirectStateFlagBitsNV]): VkIndirectStateFlagsNV =
+    for flag in flags:
+      result = VkIndirectStateFlagsNV(uint(result) or uint(flag))
+func toEnums*(number: VkIndirectStateFlagsNV): seq[VkIndirectStateFlagBitsNV] =
+    for value in VkIndirectStateFlagBitsNV.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkIndirectCommandsTokenTypeNV* {.size: sizeof(cint).} = enum
     VK_INDIRECT_COMMANDS_TOKEN_TYPE_SHADER_GROUP_NV = 0
@@ -2551,9 +2758,13 @@
     VK_INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_MESH_TASKS_NV = 1000328000
   VkPrivateDataSlotCreateFlagBits* {.size: sizeof(cint).} = enum
     VK_PRIVATE_DATA_SLOT_CREATE_RESERVED_0_BIT_NV = 0b00000000000000000000000000000001
-converter BitsetToNumber*(flags: openArray[VkPrivateDataSlotCreateFlagBits]): VkPrivateDataSlotCreateFlags =
-  for flag in flags:
-    result = VkPrivateDataSlotCreateFlags(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkPrivateDataSlotCreateFlagBits]): VkPrivateDataSlotCreateFlags =
+    for flag in flags:
+      result = VkPrivateDataSlotCreateFlags(uint(result) or uint(flag))
+func toEnums*(number: VkPrivateDataSlotCreateFlags): seq[VkPrivateDataSlotCreateFlagBits] =
+    for value in VkPrivateDataSlotCreateFlagBits.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkDescriptorSetLayoutCreateFlagBits* {.size: sizeof(cint).} = enum
     VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR = 0b00000000000000000000000000000001
@@ -2562,9 +2773,13 @@
     VK_DESCRIPTOR_SET_LAYOUT_CREATE_RESERVED_3_BIT_AMD = 0b00000000000000000000000000001000
     VK_DESCRIPTOR_SET_LAYOUT_CREATE_DESCRIPTOR_BUFFER_BIT_EXT = 0b00000000000000000000000000010000
     VK_DESCRIPTOR_SET_LAYOUT_CREATE_EMBEDDED_IMMUTABLE_SAMPLERS_BIT_EXT = 0b00000000000000000000000000100000
-converter BitsetToNumber*(flags: openArray[VkDescriptorSetLayoutCreateFlagBits]): VkDescriptorSetLayoutCreateFlags =
-  for flag in flags:
-    result = VkDescriptorSetLayoutCreateFlags(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkDescriptorSetLayoutCreateFlagBits]): VkDescriptorSetLayoutCreateFlags =
+    for flag in flags:
+      result = VkDescriptorSetLayoutCreateFlags(uint(result) or uint(flag))
+func toEnums*(number: VkDescriptorSetLayoutCreateFlags): seq[VkDescriptorSetLayoutCreateFlagBits] =
+    for value in VkDescriptorSetLayoutCreateFlagBits.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkExternalMemoryHandleTypeFlagBits* {.size: sizeof(cint).} = enum
     VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT = 0b00000000000000000000000000000001
@@ -2581,17 +2796,25 @@
     VK_EXTERNAL_MEMORY_HANDLE_TYPE_ZIRCON_VMO_BIT_FUCHSIA = 0b00000000000000000000100000000000
     VK_EXTERNAL_MEMORY_HANDLE_TYPE_RDMA_ADDRESS_BIT_NV = 0b00000000000000000001000000000000
     VK_EXTERNAL_MEMORY_HANDLE_TYPE_SCI_BUF_BIT_NV = 0b00000000000000000010000000000000
-converter BitsetToNumber*(flags: openArray[VkExternalMemoryHandleTypeFlagBits]): VkExternalMemoryHandleTypeFlags =
-  for flag in flags:
-    result = VkExternalMemoryHandleTypeFlags(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkExternalMemoryHandleTypeFlagBits]): VkExternalMemoryHandleTypeFlags =
+    for flag in flags:
+      result = VkExternalMemoryHandleTypeFlags(uint(result) or uint(flag))
+func toEnums*(number: VkExternalMemoryHandleTypeFlags): seq[VkExternalMemoryHandleTypeFlagBits] =
+    for value in VkExternalMemoryHandleTypeFlagBits.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkExternalMemoryFeatureFlagBits* {.size: sizeof(cint).} = enum
     VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT = 0b00000000000000000000000000000001
     VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT = 0b00000000000000000000000000000010
     VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT = 0b00000000000000000000000000000100
-converter BitsetToNumber*(flags: openArray[VkExternalMemoryFeatureFlagBits]): VkExternalMemoryFeatureFlags =
-  for flag in flags:
-    result = VkExternalMemoryFeatureFlags(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkExternalMemoryFeatureFlagBits]): VkExternalMemoryFeatureFlags =
+    for flag in flags:
+      result = VkExternalMemoryFeatureFlags(uint(result) or uint(flag))
+func toEnums*(number: VkExternalMemoryFeatureFlags): seq[VkExternalMemoryFeatureFlagBits] =
+    for value in VkExternalMemoryFeatureFlagBits.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkExternalSemaphoreHandleTypeFlagBits* {.size: sizeof(cint).} = enum
     VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT = 0b00000000000000000000000000000001
@@ -2601,22 +2824,34 @@
     VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT = 0b00000000000000000000000000010000
     VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SCI_SYNC_OBJ_BIT_NV = 0b00000000000000000000000000100000
     VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_ZIRCON_EVENT_BIT_FUCHSIA = 0b00000000000000000000000010000000
-converter BitsetToNumber*(flags: openArray[VkExternalSemaphoreHandleTypeFlagBits]): VkExternalSemaphoreHandleTypeFlags =
-  for flag in flags:
-    result = VkExternalSemaphoreHandleTypeFlags(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkExternalSemaphoreHandleTypeFlagBits]): VkExternalSemaphoreHandleTypeFlags =
+    for flag in flags:
+      result = VkExternalSemaphoreHandleTypeFlags(uint(result) or uint(flag))
+func toEnums*(number: VkExternalSemaphoreHandleTypeFlags): seq[VkExternalSemaphoreHandleTypeFlagBits] =
+    for value in VkExternalSemaphoreHandleTypeFlagBits.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkExternalSemaphoreFeatureFlagBits* {.size: sizeof(cint).} = enum
     VK_EXTERNAL_SEMAPHORE_FEATURE_EXPORTABLE_BIT = 0b00000000000000000000000000000001
     VK_EXTERNAL_SEMAPHORE_FEATURE_IMPORTABLE_BIT = 0b00000000000000000000000000000010
-converter BitsetToNumber*(flags: openArray[VkExternalSemaphoreFeatureFlagBits]): VkExternalSemaphoreFeatureFlags =
-  for flag in flags:
-    result = VkExternalSemaphoreFeatureFlags(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkExternalSemaphoreFeatureFlagBits]): VkExternalSemaphoreFeatureFlags =
+    for flag in flags:
+      result = VkExternalSemaphoreFeatureFlags(uint(result) or uint(flag))
+func toEnums*(number: VkExternalSemaphoreFeatureFlags): seq[VkExternalSemaphoreFeatureFlagBits] =
+    for value in VkExternalSemaphoreFeatureFlagBits.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkSemaphoreImportFlagBits* {.size: sizeof(cint).} = enum
     VK_SEMAPHORE_IMPORT_TEMPORARY_BIT = 0b00000000000000000000000000000001
-converter BitsetToNumber*(flags: openArray[VkSemaphoreImportFlagBits]): VkSemaphoreImportFlags =
-  for flag in flags:
-    result = VkSemaphoreImportFlags(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkSemaphoreImportFlagBits]): VkSemaphoreImportFlags =
+    for flag in flags:
+      result = VkSemaphoreImportFlags(uint(result) or uint(flag))
+func toEnums*(number: VkSemaphoreImportFlags): seq[VkSemaphoreImportFlagBits] =
+    for value in VkSemaphoreImportFlagBits.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkExternalFenceHandleTypeFlagBits* {.size: sizeof(cint).} = enum
     VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_FD_BIT = 0b00000000000000000000000000000001
@@ -2625,28 +2860,44 @@
     VK_EXTERNAL_FENCE_HANDLE_TYPE_SYNC_FD_BIT = 0b00000000000000000000000000001000
     VK_EXTERNAL_FENCE_HANDLE_TYPE_SCI_SYNC_OBJ_BIT_NV = 0b00000000000000000000000000010000
     VK_EXTERNAL_FENCE_HANDLE_TYPE_SCI_SYNC_FENCE_BIT_NV = 0b00000000000000000000000000100000
-converter BitsetToNumber*(flags: openArray[VkExternalFenceHandleTypeFlagBits]): VkExternalFenceHandleTypeFlags =
-  for flag in flags:
-    result = VkExternalFenceHandleTypeFlags(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkExternalFenceHandleTypeFlagBits]): VkExternalFenceHandleTypeFlags =
+    for flag in flags:
+      result = VkExternalFenceHandleTypeFlags(uint(result) or uint(flag))
+func toEnums*(number: VkExternalFenceHandleTypeFlags): seq[VkExternalFenceHandleTypeFlagBits] =
+    for value in VkExternalFenceHandleTypeFlagBits.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkExternalFenceFeatureFlagBits* {.size: sizeof(cint).} = enum
     VK_EXTERNAL_FENCE_FEATURE_EXPORTABLE_BIT = 0b00000000000000000000000000000001
     VK_EXTERNAL_FENCE_FEATURE_IMPORTABLE_BIT = 0b00000000000000000000000000000010
-converter BitsetToNumber*(flags: openArray[VkExternalFenceFeatureFlagBits]): VkExternalFenceFeatureFlags =
-  for flag in flags:
-    result = VkExternalFenceFeatureFlags(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkExternalFenceFeatureFlagBits]): VkExternalFenceFeatureFlags =
+    for flag in flags:
+      result = VkExternalFenceFeatureFlags(uint(result) or uint(flag))
+func toEnums*(number: VkExternalFenceFeatureFlags): seq[VkExternalFenceFeatureFlagBits] =
+    for value in VkExternalFenceFeatureFlagBits.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkFenceImportFlagBits* {.size: sizeof(cint).} = enum
     VK_FENCE_IMPORT_TEMPORARY_BIT = 0b00000000000000000000000000000001
-converter BitsetToNumber*(flags: openArray[VkFenceImportFlagBits]): VkFenceImportFlags =
-  for flag in flags:
-    result = VkFenceImportFlags(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkFenceImportFlagBits]): VkFenceImportFlags =
+    for flag in flags:
+      result = VkFenceImportFlags(uint(result) or uint(flag))
+func toEnums*(number: VkFenceImportFlags): seq[VkFenceImportFlagBits] =
+    for value in VkFenceImportFlagBits.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkSurfaceCounterFlagBitsEXT* {.size: sizeof(cint).} = enum
     VK_SURFACE_COUNTER_VBLANK_BIT_EXT = 0b00000000000000000000000000000001
-converter BitsetToNumber*(flags: openArray[VkSurfaceCounterFlagBitsEXT]): VkSurfaceCounterFlagsEXT =
-  for flag in flags:
-    result = VkSurfaceCounterFlagsEXT(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkSurfaceCounterFlagBitsEXT]): VkSurfaceCounterFlagsEXT =
+    for flag in flags:
+      result = VkSurfaceCounterFlagsEXT(uint(result) or uint(flag))
+func toEnums*(number: VkSurfaceCounterFlagsEXT): seq[VkSurfaceCounterFlagBitsEXT] =
+    for value in VkSurfaceCounterFlagBitsEXT.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkDisplayPowerStateEXT* {.size: sizeof(cint).} = enum
     VK_DISPLAY_POWER_STATE_OFF_EXT = 0
@@ -2661,26 +2912,38 @@
     VK_PEER_MEMORY_FEATURE_COPY_DST_BIT = 0b00000000000000000000000000000010
     VK_PEER_MEMORY_FEATURE_GENERIC_SRC_BIT = 0b00000000000000000000000000000100
     VK_PEER_MEMORY_FEATURE_GENERIC_DST_BIT = 0b00000000000000000000000000001000
-converter BitsetToNumber*(flags: openArray[VkPeerMemoryFeatureFlagBits]): VkPeerMemoryFeatureFlags =
-  for flag in flags:
-    result = VkPeerMemoryFeatureFlags(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkPeerMemoryFeatureFlagBits]): VkPeerMemoryFeatureFlags =
+    for flag in flags:
+      result = VkPeerMemoryFeatureFlags(uint(result) or uint(flag))
+func toEnums*(number: VkPeerMemoryFeatureFlags): seq[VkPeerMemoryFeatureFlagBits] =
+    for value in VkPeerMemoryFeatureFlagBits.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkMemoryAllocateFlagBits* {.size: sizeof(cint).} = enum
     VK_MEMORY_ALLOCATE_DEVICE_MASK_BIT = 0b00000000000000000000000000000001
     VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT = 0b00000000000000000000000000000010
     VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT = 0b00000000000000000000000000000100
-converter BitsetToNumber*(flags: openArray[VkMemoryAllocateFlagBits]): VkMemoryAllocateFlags =
-  for flag in flags:
-    result = VkMemoryAllocateFlags(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkMemoryAllocateFlagBits]): VkMemoryAllocateFlags =
+    for flag in flags:
+      result = VkMemoryAllocateFlags(uint(result) or uint(flag))
+func toEnums*(number: VkMemoryAllocateFlags): seq[VkMemoryAllocateFlagBits] =
+    for value in VkMemoryAllocateFlagBits.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkDeviceGroupPresentModeFlagBitsKHR* {.size: sizeof(cint).} = enum
     VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_BIT_KHR = 0b00000000000000000000000000000001
     VK_DEVICE_GROUP_PRESENT_MODE_REMOTE_BIT_KHR = 0b00000000000000000000000000000010
     VK_DEVICE_GROUP_PRESENT_MODE_SUM_BIT_KHR = 0b00000000000000000000000000000100
     VK_DEVICE_GROUP_PRESENT_MODE_LOCAL_MULTI_DEVICE_BIT_KHR = 0b00000000000000000000000000001000
-converter BitsetToNumber*(flags: openArray[VkDeviceGroupPresentModeFlagBitsKHR]): VkDeviceGroupPresentModeFlagsKHR =
-  for flag in flags:
-    result = VkDeviceGroupPresentModeFlagsKHR(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkDeviceGroupPresentModeFlagBitsKHR]): VkDeviceGroupPresentModeFlagsKHR =
+    for flag in flags:
+      result = VkDeviceGroupPresentModeFlagsKHR(uint(result) or uint(flag))
+func toEnums*(number: VkDeviceGroupPresentModeFlagsKHR): seq[VkDeviceGroupPresentModeFlagBitsKHR] =
+    for value in VkDeviceGroupPresentModeFlagBitsKHR.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkSwapchainCreateFlagBitsKHR* {.size: sizeof(cint).} = enum
     VK_SWAPCHAIN_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT_KHR = 0b00000000000000000000000000000001
@@ -2688,9 +2951,13 @@
     VK_SWAPCHAIN_CREATE_MUTABLE_FORMAT_BIT_KHR = 0b00000000000000000000000000000100
     VK_SWAPCHAIN_CREATE_DEFERRED_MEMORY_ALLOCATION_BIT_EXT = 0b00000000000000000000000000001000
     VK_SWAPCHAIN_CREATE_RESERVED_4_BIT_EXT = 0b00000000000000000000000000010000
-converter BitsetToNumber*(flags: openArray[VkSwapchainCreateFlagBitsKHR]): VkSwapchainCreateFlagsKHR =
-  for flag in flags:
-    result = VkSwapchainCreateFlagsKHR(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkSwapchainCreateFlagBitsKHR]): VkSwapchainCreateFlagsKHR =
+    for flag in flags:
+      result = VkSwapchainCreateFlagsKHR(uint(result) or uint(flag))
+func toEnums*(number: VkSwapchainCreateFlagsKHR): seq[VkSwapchainCreateFlagBitsKHR] =
+    for value in VkSwapchainCreateFlagBitsKHR.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkViewportCoordinateSwizzleNV* {.size: sizeof(cint).} = enum
     VK_VIEWPORT_COORDINATE_SWIZZLE_POSITIVE_X_NV = 0
@@ -2713,9 +2980,13 @@
     VK_SUBPASS_DESCRIPTION_RASTERIZATION_ORDER_ATTACHMENT_DEPTH_ACCESS_BIT_EXT = 0b00000000000000000000000000100000
     VK_SUBPASS_DESCRIPTION_RASTERIZATION_ORDER_ATTACHMENT_STENCIL_ACCESS_BIT_EXT = 0b00000000000000000000000001000000
     VK_SUBPASS_DESCRIPTION_ENABLE_LEGACY_DITHERING_BIT_EXT = 0b00000000000000000000000010000000
-converter BitsetToNumber*(flags: openArray[VkSubpassDescriptionFlagBits]): VkSubpassDescriptionFlags =
-  for flag in flags:
-    result = VkSubpassDescriptionFlags(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkSubpassDescriptionFlagBits]): VkSubpassDescriptionFlags =
+    for flag in flags:
+      result = VkSubpassDescriptionFlags(uint(result) or uint(flag))
+func toEnums*(number: VkSubpassDescriptionFlags): seq[VkSubpassDescriptionFlagBits] =
+    for value in VkSubpassDescriptionFlagBits.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkPointClippingBehavior* {.size: sizeof(cint).} = enum
     VK_POINT_CLIPPING_BEHAVIOR_ALL_CLIP_PLANES = 0
@@ -2767,18 +3038,26 @@
     VK_DEBUG_UTILS_MESSAGE_SEVERITY_INFO_BIT_EXT = 0b00000000000000000000000000010000
     VK_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT = 0b00000000000000000000000100000000
     VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT = 0b00000000000000000001000000000000
-converter BitsetToNumber*(flags: openArray[VkDebugUtilsMessageSeverityFlagBitsEXT]): VkDebugUtilsMessageSeverityFlagsEXT =
-  for flag in flags:
-    result = VkDebugUtilsMessageSeverityFlagsEXT(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkDebugUtilsMessageSeverityFlagBitsEXT]): VkDebugUtilsMessageSeverityFlagsEXT =
+    for flag in flags:
+      result = VkDebugUtilsMessageSeverityFlagsEXT(uint(result) or uint(flag))
+func toEnums*(number: VkDebugUtilsMessageSeverityFlagsEXT): seq[VkDebugUtilsMessageSeverityFlagBitsEXT] =
+    for value in VkDebugUtilsMessageSeverityFlagBitsEXT.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkDebugUtilsMessageTypeFlagBitsEXT* {.size: sizeof(cint).} = enum
     VK_DEBUG_UTILS_MESSAGE_TYPE_GENERAL_BIT_EXT = 0b00000000000000000000000000000001
     VK_DEBUG_UTILS_MESSAGE_TYPE_VALIDATION_BIT_EXT = 0b00000000000000000000000000000010
     VK_DEBUG_UTILS_MESSAGE_TYPE_PERFORMANCE_BIT_EXT = 0b00000000000000000000000000000100
     VK_DEBUG_UTILS_MESSAGE_TYPE_DEVICE_ADDRESS_BINDING_BIT_EXT = 0b00000000000000000000000000001000
-converter BitsetToNumber*(flags: openArray[VkDebugUtilsMessageTypeFlagBitsEXT]): VkDebugUtilsMessageTypeFlagsEXT =
-  for flag in flags:
-    result = VkDebugUtilsMessageTypeFlagsEXT(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkDebugUtilsMessageTypeFlagBitsEXT]): VkDebugUtilsMessageTypeFlagsEXT =
+    for flag in flags:
+      result = VkDebugUtilsMessageTypeFlagsEXT(uint(result) or uint(flag))
+func toEnums*(number: VkDebugUtilsMessageTypeFlagsEXT): seq[VkDebugUtilsMessageTypeFlagBitsEXT] =
+    for value in VkDebugUtilsMessageTypeFlagBitsEXT.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkConservativeRasterizationModeEXT* {.size: sizeof(cint).} = enum
     VK_CONSERVATIVE_RASTERIZATION_MODE_DISABLED_EXT = 0
@@ -2790,9 +3069,13 @@
     VK_DESCRIPTOR_BINDING_PARTIALLY_BOUND_BIT = 0b00000000000000000000000000000100
     VK_DESCRIPTOR_BINDING_VARIABLE_DESCRIPTOR_COUNT_BIT = 0b00000000000000000000000000001000
     VK_DESCRIPTOR_BINDING_RESERVED_4_BIT_QCOM = 0b00000000000000000000000000010000
-converter BitsetToNumber*(flags: openArray[VkDescriptorBindingFlagBits]): VkDescriptorBindingFlags =
-  for flag in flags:
-    result = VkDescriptorBindingFlags(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkDescriptorBindingFlagBits]): VkDescriptorBindingFlags =
+    for flag in flags:
+      result = VkDescriptorBindingFlags(uint(result) or uint(flag))
+func toEnums*(number: VkDescriptorBindingFlags): seq[VkDescriptorBindingFlagBits] =
+    for value in VkDescriptorBindingFlagBits.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkVendorId* {.size: sizeof(cint).} = enum
     VK_VENDOR_ID_VIV = 65537
@@ -2829,18 +3112,28 @@
     VK_DRIVER_ID_IMAGINATION_OPEN_SOURCE_MESA = 25
   VkConditionalRenderingFlagBitsEXT* {.size: sizeof(cint).} = enum
     VK_CONDITIONAL_RENDERING_INVERTED_BIT_EXT = 0b00000000000000000000000000000001
-converter BitsetToNumber*(flags: openArray[VkConditionalRenderingFlagBitsEXT]): VkConditionalRenderingFlagsEXT =
-  for flag in flags:
-    result = VkConditionalRenderingFlagsEXT(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkConditionalRenderingFlagBitsEXT]): VkConditionalRenderingFlagsEXT =
+    for flag in flags:
+      result = VkConditionalRenderingFlagsEXT(uint(result) or uint(flag))
+func toEnums*(number: VkConditionalRenderingFlagsEXT): seq[VkConditionalRenderingFlagBitsEXT] =
+    for value in VkConditionalRenderingFlagBitsEXT.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkResolveModeFlagBits* {.size: sizeof(cint).} = enum
     VK_RESOLVE_MODE_SAMPLE_ZERO_BIT = 0b00000000000000000000000000000001
     VK_RESOLVE_MODE_AVERAGE_BIT = 0b00000000000000000000000000000010
     VK_RESOLVE_MODE_MIN_BIT = 0b00000000000000000000000000000100
     VK_RESOLVE_MODE_MAX_BIT = 0b00000000000000000000000000001000
-converter BitsetToNumber*(flags: openArray[VkResolveModeFlagBits]): VkResolveModeFlags =
-  for flag in flags:
-    result = VkResolveModeFlags(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkResolveModeFlagBits]): VkResolveModeFlags =
+    for flag in flags:
+      result = VkResolveModeFlags(uint(result) or uint(flag))
+func toEnums*(number: VkResolveModeFlags): seq[VkResolveModeFlagBits] =
+    for value in VkResolveModeFlagBits.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
+const
+  VK_RESOLVE_MODE_NONE* = 0
 type
   VkShadingRatePaletteEntryNV* {.size: sizeof(cint).} = enum
     VK_SHADING_RATE_PALETTE_ENTRY_NO_INVOCATIONS_NV = 0
@@ -2867,16 +3160,24 @@
     VK_GEOMETRY_INSTANCE_FORCE_NO_OPAQUE_BIT_KHR = 0b00000000000000000000000000001000
     VK_GEOMETRY_INSTANCE_FORCE_OPACITY_MICROMAP_2_STATE_EXT = 0b00000000000000000000000000010000
     VK_GEOMETRY_INSTANCE_DISABLE_OPACITY_MICROMAPS_EXT = 0b00000000000000000000000000100000
-converter BitsetToNumber*(flags: openArray[VkGeometryInstanceFlagBitsKHR]): VkGeometryInstanceFlagsKHR =
-  for flag in flags:
-    result = VkGeometryInstanceFlagsKHR(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkGeometryInstanceFlagBitsKHR]): VkGeometryInstanceFlagsKHR =
+    for flag in flags:
+      result = VkGeometryInstanceFlagsKHR(uint(result) or uint(flag))
+func toEnums*(number: VkGeometryInstanceFlagsKHR): seq[VkGeometryInstanceFlagBitsKHR] =
+    for value in VkGeometryInstanceFlagBitsKHR.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkGeometryFlagBitsKHR* {.size: sizeof(cint).} = enum
     VK_GEOMETRY_OPAQUE_BIT_KHR = 0b00000000000000000000000000000001
     VK_GEOMETRY_NO_DUPLICATE_ANY_HIT_INVOCATION_BIT_KHR = 0b00000000000000000000000000000010
-converter BitsetToNumber*(flags: openArray[VkGeometryFlagBitsKHR]): VkGeometryFlagsKHR =
-  for flag in flags:
-    result = VkGeometryFlagsKHR(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkGeometryFlagBitsKHR]): VkGeometryFlagsKHR =
+    for flag in flags:
+      result = VkGeometryFlagsKHR(uint(result) or uint(flag))
+func toEnums*(number: VkGeometryFlagsKHR): seq[VkGeometryFlagBitsKHR] =
+    for value in VkGeometryFlagBitsKHR.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkBuildAccelerationStructureFlagBitsKHR* {.size: sizeof(cint).} = enum
     VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_UPDATE_BIT_KHR = 0b00000000000000000000000000000001
@@ -2890,17 +3191,25 @@
     VK_BUILD_ACCELERATION_STRUCTURE_ALLOW_OPACITY_MICROMAP_DATA_UPDATE_EXT = 0b00000000000000000000000100000000
     VK_BUILD_ACCELERATION_STRUCTURE_RESERVED_BIT_9_NV = 0b00000000000000000000001000000000
     VK_BUILD_ACCELERATION_STRUCTURE_RESERVED_BIT_10_NV = 0b00000000000000000000010000000000
-converter BitsetToNumber*(flags: openArray[VkBuildAccelerationStructureFlagBitsKHR]): VkBuildAccelerationStructureFlagsKHR =
-  for flag in flags:
-    result = VkBuildAccelerationStructureFlagsKHR(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkBuildAccelerationStructureFlagBitsKHR]): VkBuildAccelerationStructureFlagsKHR =
+    for flag in flags:
+      result = VkBuildAccelerationStructureFlagsKHR(uint(result) or uint(flag))
+func toEnums*(number: VkBuildAccelerationStructureFlagsKHR): seq[VkBuildAccelerationStructureFlagBitsKHR] =
+    for value in VkBuildAccelerationStructureFlagBitsKHR.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkAccelerationStructureCreateFlagBitsKHR* {.size: sizeof(cint).} = enum
     VK_ACCELERATION_STRUCTURE_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_KHR = 0b00000000000000000000000000000001
     VK_ACCELERATION_STRUCTURE_CREATE_MOTION_BIT_NV = 0b00000000000000000000000000000100
     VK_ACCELERATION_STRUCTURE_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_EXT = 0b00000000000000000000000000001000
-converter BitsetToNumber*(flags: openArray[VkAccelerationStructureCreateFlagBitsKHR]): VkAccelerationStructureCreateFlagsKHR =
-  for flag in flags:
-    result = VkAccelerationStructureCreateFlagsKHR(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkAccelerationStructureCreateFlagBitsKHR]): VkAccelerationStructureCreateFlagsKHR =
+    for flag in flags:
+      result = VkAccelerationStructureCreateFlagsKHR(uint(result) or uint(flag))
+func toEnums*(number: VkAccelerationStructureCreateFlagsKHR): seq[VkAccelerationStructureCreateFlagBitsKHR] =
+    for value in VkAccelerationStructureCreateFlagBitsKHR.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkCopyAccelerationStructureModeKHR* {.size: sizeof(cint).} = enum
     VK_COPY_ACCELERATION_STRUCTURE_MODE_CLONE_KHR = 0
@@ -2944,9 +3253,13 @@
     VK_MEMORY_OVERALLOCATION_BEHAVIOR_DISALLOWED_AMD = 2
   VkFramebufferCreateFlagBits* {.size: sizeof(cint).} = enum
     VK_FRAMEBUFFER_CREATE_IMAGELESS_BIT = 0b00000000000000000000000000000001
-converter BitsetToNumber*(flags: openArray[VkFramebufferCreateFlagBits]): VkFramebufferCreateFlags =
-  for flag in flags:
-    result = VkFramebufferCreateFlags(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkFramebufferCreateFlagBits]): VkFramebufferCreateFlags =
+    for flag in flags:
+      result = VkFramebufferCreateFlags(uint(result) or uint(flag))
+func toEnums*(number: VkFramebufferCreateFlags): seq[VkFramebufferCreateFlagBits] =
+    for value in VkFramebufferCreateFlagBits.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkScopeNV* {.size: sizeof(cint).} = enum
     VK_SCOPE_DEVICE_NV = 1
@@ -2970,17 +3283,25 @@
     VK_DEVICE_DIAGNOSTICS_CONFIG_ENABLE_RESOURCE_TRACKING_BIT_NV = 0b00000000000000000000000000000010
     VK_DEVICE_DIAGNOSTICS_CONFIG_ENABLE_AUTOMATIC_CHECKPOINTS_BIT_NV = 0b00000000000000000000000000000100
     VK_DEVICE_DIAGNOSTICS_CONFIG_ENABLE_SHADER_ERROR_REPORTING_BIT_NV = 0b00000000000000000000000000001000
-converter BitsetToNumber*(flags: openArray[VkDeviceDiagnosticsConfigFlagBitsNV]): VkDeviceDiagnosticsConfigFlagsNV =
-  for flag in flags:
-    result = VkDeviceDiagnosticsConfigFlagsNV(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkDeviceDiagnosticsConfigFlagBitsNV]): VkDeviceDiagnosticsConfigFlagsNV =
+    for flag in flags:
+      result = VkDeviceDiagnosticsConfigFlagsNV(uint(result) or uint(flag))
+func toEnums*(number: VkDeviceDiagnosticsConfigFlagsNV): seq[VkDeviceDiagnosticsConfigFlagBitsNV] =
+    for value in VkDeviceDiagnosticsConfigFlagBitsNV.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkPipelineCreationFeedbackFlagBits* {.size: sizeof(cint).} = enum
     VK_PIPELINE_CREATION_FEEDBACK_VALID_BIT = 0b00000000000000000000000000000001
     VK_PIPELINE_CREATION_FEEDBACK_APPLICATION_PIPELINE_CACHE_HIT_BIT = 0b00000000000000000000000000000010
     VK_PIPELINE_CREATION_FEEDBACK_BASE_PIPELINE_ACCELERATION_BIT = 0b00000000000000000000000000000100
-converter BitsetToNumber*(flags: openArray[VkPipelineCreationFeedbackFlagBits]): VkPipelineCreationFeedbackFlags =
-  for flag in flags:
-    result = VkPipelineCreationFeedbackFlags(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkPipelineCreationFeedbackFlagBits]): VkPipelineCreationFeedbackFlags =
+    for flag in flags:
+      result = VkPipelineCreationFeedbackFlags(uint(result) or uint(flag))
+func toEnums*(number: VkPipelineCreationFeedbackFlags): seq[VkPipelineCreationFeedbackFlagBits] =
+    for value in VkPipelineCreationFeedbackFlagBits.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkFullScreenExclusiveEXT* {.size: sizeof(cint).} = enum
     VK_FULL_SCREEN_EXCLUSIVE_DEFAULT_EXT = 0
@@ -2994,8 +3315,12 @@
   VkMemoryDecompressionMethodFlagBitsNV* {.size: 8.} = enum
     VK_MEMORY_DECOMPRESSION_METHOD_GDEFLATE_1_0_BIT_NV = 0b0000000000000000000000000000000000000000000000000000000000000001
 converter BitsetToNumber*(flags: openArray[VkMemoryDecompressionMethodFlagBitsNV]): VkMemoryDecompressionMethodFlagsNV =
-  for flag in flags:
-    result = VkMemoryDecompressionMethodFlagsNV(uint64(result) or uint(flag))
+    for flag in flags:
+      result = VkMemoryDecompressionMethodFlagsNV(int64(result) or int64(flag))
+converter NumberToBitset*(number: VkMemoryDecompressionMethodFlagsNV): seq[VkMemoryDecompressionMethodFlagBitsNV] =
+        for value in VkMemoryDecompressionMethodFlagBitsNV.items:
+          if (value.ord and int64(number)) > 0:
+            result.add value
 type
   VkPerformanceCounterUnitKHR* {.size: sizeof(cint).} = enum
     VK_PERFORMANCE_COUNTER_UNIT_GENERIC_KHR = 0
@@ -3019,9 +3344,13 @@
   VkPerformanceCounterDescriptionFlagBitsKHR* {.size: sizeof(cint).} = enum
     VK_PERFORMANCE_COUNTER_DESCRIPTION_PERFORMANCE_IMPACTING_BIT_KHR = 0b00000000000000000000000000000001
     VK_PERFORMANCE_COUNTER_DESCRIPTION_CONCURRENTLY_IMPACTED_BIT_KHR = 0b00000000000000000000000000000010
-converter BitsetToNumber*(flags: openArray[VkPerformanceCounterDescriptionFlagBitsKHR]): VkPerformanceCounterDescriptionFlagsKHR =
-  for flag in flags:
-    result = VkPerformanceCounterDescriptionFlagsKHR(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkPerformanceCounterDescriptionFlagBitsKHR]): VkPerformanceCounterDescriptionFlagsKHR =
+    for flag in flags:
+      result = VkPerformanceCounterDescriptionFlagsKHR(uint(result) or uint(flag))
+func toEnums*(number: VkPerformanceCounterDescriptionFlagsKHR): seq[VkPerformanceCounterDescriptionFlagBitsKHR] =
+    for value in VkPerformanceCounterDescriptionFlagBitsKHR.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkPerformanceConfigurationTypeINTEL* {.size: sizeof(cint).} = enum
     VK_PERFORMANCE_CONFIGURATION_TYPE_COMMAND_QUEUE_METRICS_DISCOVERY_ACTIVATED_INTEL = 0
@@ -3076,9 +3405,13 @@
     VK_TOOL_PURPOSE_MODIFYING_FEATURES_BIT = 0b00000000000000000000000000010000
     VK_TOOL_PURPOSE_DEBUG_REPORTING_BIT_EXT = 0b00000000000000000000000000100000
     VK_TOOL_PURPOSE_DEBUG_MARKERS_BIT_EXT = 0b00000000000000000000000001000000
-converter BitsetToNumber*(flags: openArray[VkToolPurposeFlagBits]): VkToolPurposeFlags =
-  for flag in flags:
-    result = VkToolPurposeFlags(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkToolPurposeFlagBits]): VkToolPurposeFlags =
+    for flag in flags:
+      result = VkToolPurposeFlags(uint(result) or uint(flag))
+func toEnums*(number: VkToolPurposeFlags): seq[VkToolPurposeFlagBits] =
+    for value in VkToolPurposeFlagBits.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkPipelineMatchControl* {.size: sizeof(cint).} = enum
     VK_PIPELINE_MATCH_CONTROL_APPLICATION_UUID_EXACT_MATCH = 0
@@ -3164,8 +3497,14 @@
     VK_ACCESS_2_MICROMAP_WRITE_BIT_EXT = 0b0000000000000000001000000000000000000000000000000000000000000000
     VK_ACCESS_2_RESERVED_46_BIT_EXT = 0b0000000000000000010000000000000000000000000000000000000000000000
 converter BitsetToNumber*(flags: openArray[VkAccessFlagBits2]): VkAccessFlags2 =
-  for flag in flags:
-    result = VkAccessFlags2(uint64(result) or uint(flag))
+    for flag in flags:
+      result = VkAccessFlags2(int64(result) or int64(flag))
+converter NumberToBitset*(number: VkAccessFlags2): seq[VkAccessFlagBits2] =
+        for value in VkAccessFlagBits2.items:
+          if (value.ord and int64(number)) > 0:
+            result.add value
+const
+  VK_ACCESS_2_NONE* = 0
 type
   VkPipelineStageFlagBits2* {.size: 8.} = enum
     VK_PIPELINE_STAGE_2_TOP_OF_PIPE_BIT = 0b0000000000000000000000000000000000000000000000000000000000000001
@@ -3210,27 +3549,45 @@
     VK_PIPELINE_STAGE_2_INVOCATION_MASK_BIT_HUAWEI = 0b0000000000000000000000010000000000000000000000000000000000000000
     VK_PIPELINE_STAGE_2_CLUSTER_CULLING_SHADER_BIT_HUAWEI = 0b0000000000000000000000100000000000000000000000000000000000000000
 converter BitsetToNumber*(flags: openArray[VkPipelineStageFlagBits2]): VkPipelineStageFlags2 =
-  for flag in flags:
-    result = VkPipelineStageFlags2(uint64(result) or uint(flag))
+    for flag in flags:
+      result = VkPipelineStageFlags2(int64(result) or int64(flag))
+converter NumberToBitset*(number: VkPipelineStageFlags2): seq[VkPipelineStageFlagBits2] =
+        for value in VkPipelineStageFlagBits2.items:
+          if (value.ord and int64(number)) > 0:
+            result.add value
+const
+  VK_PIPELINE_STAGE_2_NONE* = 0
 type
   VkSubmitFlagBits* {.size: sizeof(cint).} = enum
     VK_SUBMIT_PROTECTED_BIT = 0b00000000000000000000000000000001
-converter BitsetToNumber*(flags: openArray[VkSubmitFlagBits]): VkSubmitFlags =
-  for flag in flags:
-    result = VkSubmitFlags(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkSubmitFlagBits]): VkSubmitFlags =
+    for flag in flags:
+      result = VkSubmitFlags(uint(result) or uint(flag))
+func toEnums*(number: VkSubmitFlags): seq[VkSubmitFlagBits] =
+    for value in VkSubmitFlagBits.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkEventCreateFlagBits* {.size: sizeof(cint).} = enum
     VK_EVENT_CREATE_DEVICE_ONLY_BIT = 0b00000000000000000000000000000001
-converter BitsetToNumber*(flags: openArray[VkEventCreateFlagBits]): VkEventCreateFlags =
-  for flag in flags:
-    result = VkEventCreateFlags(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkEventCreateFlagBits]): VkEventCreateFlags =
+    for flag in flags:
+      result = VkEventCreateFlags(uint(result) or uint(flag))
+func toEnums*(number: VkEventCreateFlags): seq[VkEventCreateFlagBits] =
+    for value in VkEventCreateFlagBits.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkPipelineLayoutCreateFlagBits* {.size: sizeof(cint).} = enum
     VK_PIPELINE_LAYOUT_CREATE_RESERVED_0_BIT_AMD = 0b00000000000000000000000000000001
     VK_PIPELINE_LAYOUT_CREATE_INDEPENDENT_SETS_BIT_EXT = 0b00000000000000000000000000000010
-converter BitsetToNumber*(flags: openArray[VkPipelineLayoutCreateFlagBits]): VkPipelineLayoutCreateFlags =
-  for flag in flags:
-    result = VkPipelineLayoutCreateFlags(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkPipelineLayoutCreateFlagBits]): VkPipelineLayoutCreateFlags =
+    for flag in flags:
+      result = VkPipelineLayoutCreateFlags(uint(result) or uint(flag))
+func toEnums*(number: VkPipelineLayoutCreateFlags): seq[VkPipelineLayoutCreateFlagBits] =
+    for value in VkPipelineLayoutCreateFlagBits.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkSciSyncClientTypeNV* {.size: sizeof(cint).} = enum
     VK_SCI_SYNC_CLIENT_TYPE_SIGNALER_NV = 0
@@ -3250,31 +3607,47 @@
     VK_ACCELERATION_STRUCTURE_MOTION_INSTANCE_TYPE_SRT_MOTION_NV = 2
   VkPipelineColorBlendStateCreateFlagBits* {.size: sizeof(cint).} = enum
     VK_PIPELINE_COLOR_BLEND_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_BIT_EXT = 0b00000000000000000000000000000001
-converter BitsetToNumber*(flags: openArray[VkPipelineColorBlendStateCreateFlagBits]): VkPipelineColorBlendStateCreateFlags =
-  for flag in flags:
-    result = VkPipelineColorBlendStateCreateFlags(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkPipelineColorBlendStateCreateFlagBits]): VkPipelineColorBlendStateCreateFlags =
+    for flag in flags:
+      result = VkPipelineColorBlendStateCreateFlags(uint(result) or uint(flag))
+func toEnums*(number: VkPipelineColorBlendStateCreateFlags): seq[VkPipelineColorBlendStateCreateFlagBits] =
+    for value in VkPipelineColorBlendStateCreateFlagBits.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkPipelineDepthStencilStateCreateFlagBits* {.size: sizeof(cint).} = enum
     VK_PIPELINE_DEPTH_STENCIL_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_DEPTH_ACCESS_BIT_EXT = 0b00000000000000000000000000000001
     VK_PIPELINE_DEPTH_STENCIL_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_STENCIL_ACCESS_BIT_EXT = 0b00000000000000000000000000000010
-converter BitsetToNumber*(flags: openArray[VkPipelineDepthStencilStateCreateFlagBits]): VkPipelineDepthStencilStateCreateFlags =
-  for flag in flags:
-    result = VkPipelineDepthStencilStateCreateFlags(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkPipelineDepthStencilStateCreateFlagBits]): VkPipelineDepthStencilStateCreateFlags =
+    for flag in flags:
+      result = VkPipelineDepthStencilStateCreateFlags(uint(result) or uint(flag))
+func toEnums*(number: VkPipelineDepthStencilStateCreateFlags): seq[VkPipelineDepthStencilStateCreateFlagBits] =
+    for value in VkPipelineDepthStencilStateCreateFlagBits.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkGraphicsPipelineLibraryFlagBitsEXT* {.size: sizeof(cint).} = enum
     VK_GRAPHICS_PIPELINE_LIBRARY_VERTEX_INPUT_INTERFACE_BIT_EXT = 0b00000000000000000000000000000001
     VK_GRAPHICS_PIPELINE_LIBRARY_PRE_RASTERIZATION_SHADERS_BIT_EXT = 0b00000000000000000000000000000010
     VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT = 0b00000000000000000000000000000100
     VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_OUTPUT_INTERFACE_BIT_EXT = 0b00000000000000000000000000001000
-converter BitsetToNumber*(flags: openArray[VkGraphicsPipelineLibraryFlagBitsEXT]): VkGraphicsPipelineLibraryFlagsEXT =
-  for flag in flags:
-    result = VkGraphicsPipelineLibraryFlagsEXT(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkGraphicsPipelineLibraryFlagBitsEXT]): VkGraphicsPipelineLibraryFlagsEXT =
+    for flag in flags:
+      result = VkGraphicsPipelineLibraryFlagsEXT(uint(result) or uint(flag))
+func toEnums*(number: VkGraphicsPipelineLibraryFlagsEXT): seq[VkGraphicsPipelineLibraryFlagBitsEXT] =
+    for value in VkGraphicsPipelineLibraryFlagBitsEXT.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkDeviceAddressBindingFlagBitsEXT* {.size: sizeof(cint).} = enum
     VK_DEVICE_ADDRESS_BINDING_INTERNAL_OBJECT_BIT_EXT = 0b00000000000000000000000000000001
-converter BitsetToNumber*(flags: openArray[VkDeviceAddressBindingFlagBitsEXT]): VkDeviceAddressBindingFlagsEXT =
-  for flag in flags:
-    result = VkDeviceAddressBindingFlagsEXT(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkDeviceAddressBindingFlagBitsEXT]): VkDeviceAddressBindingFlagsEXT =
+    for flag in flags:
+      result = VkDeviceAddressBindingFlagsEXT(uint(result) or uint(flag))
+func toEnums*(number: VkDeviceAddressBindingFlagsEXT): seq[VkDeviceAddressBindingFlagBitsEXT] =
+    for value in VkDeviceAddressBindingFlagBitsEXT.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkDeviceAddressBindingTypeEXT* {.size: sizeof(cint).} = enum
     VK_DEVICE_ADDRESS_BINDING_TYPE_BIND_EXT = 0
@@ -3283,71 +3656,115 @@
     VK_PRESENT_SCALING_ONE_TO_ONE_BIT_EXT = 0b00000000000000000000000000000001
     VK_PRESENT_SCALING_ASPECT_RATIO_STRETCH_BIT_EXT = 0b00000000000000000000000000000010
     VK_PRESENT_SCALING_STRETCH_BIT_EXT = 0b00000000000000000000000000000100
-converter BitsetToNumber*(flags: openArray[VkPresentScalingFlagBitsEXT]): VkPresentScalingFlagsEXT =
-  for flag in flags:
-    result = VkPresentScalingFlagsEXT(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkPresentScalingFlagBitsEXT]): VkPresentScalingFlagsEXT =
+    for flag in flags:
+      result = VkPresentScalingFlagsEXT(uint(result) or uint(flag))
+func toEnums*(number: VkPresentScalingFlagsEXT): seq[VkPresentScalingFlagBitsEXT] =
+    for value in VkPresentScalingFlagBitsEXT.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkPresentGravityFlagBitsEXT* {.size: sizeof(cint).} = enum
     VK_PRESENT_GRAVITY_MIN_BIT_EXT = 0b00000000000000000000000000000001
     VK_PRESENT_GRAVITY_MAX_BIT_EXT = 0b00000000000000000000000000000010
     VK_PRESENT_GRAVITY_CENTERED_BIT_EXT = 0b00000000000000000000000000000100
-converter BitsetToNumber*(flags: openArray[VkPresentGravityFlagBitsEXT]): VkPresentGravityFlagsEXT =
-  for flag in flags:
-    result = VkPresentGravityFlagsEXT(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkPresentGravityFlagBitsEXT]): VkPresentGravityFlagsEXT =
+    for flag in flags:
+      result = VkPresentGravityFlagsEXT(uint(result) or uint(flag))
+func toEnums*(number: VkPresentGravityFlagsEXT): seq[VkPresentGravityFlagBitsEXT] =
+    for value in VkPresentGravityFlagBitsEXT.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkVideoCodecOperationFlagBitsKHR* {.size: sizeof(cint).} = enum
     VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR = 0b00000000000000000000000000000001
     VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR = 0b00000000000000000000000000000010
     VK_VIDEO_CODEC_OPERATION_ENCODE_H264_BIT_EXT = 0b00000000000000010000000000000000
     VK_VIDEO_CODEC_OPERATION_ENCODE_H265_BIT_EXT = 0b00000000000000100000000000000000
-converter BitsetToNumber*(flags: openArray[VkVideoCodecOperationFlagBitsKHR]): VkVideoCodecOperationFlagsKHR =
-  for flag in flags:
-    result = VkVideoCodecOperationFlagsKHR(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkVideoCodecOperationFlagBitsKHR]): VkVideoCodecOperationFlagsKHR =
+    for flag in flags:
+      result = VkVideoCodecOperationFlagsKHR(uint(result) or uint(flag))
+func toEnums*(number: VkVideoCodecOperationFlagsKHR): seq[VkVideoCodecOperationFlagBitsKHR] =
+    for value in VkVideoCodecOperationFlagBitsKHR.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
+const
+  VK_VIDEO_CODEC_OPERATION_NONE_KHR* = 0
 type
   VkVideoChromaSubsamplingFlagBitsKHR* {.size: sizeof(cint).} = enum
     VK_VIDEO_CHROMA_SUBSAMPLING_MONOCHROME_BIT_KHR = 0b00000000000000000000000000000001
     VK_VIDEO_CHROMA_SUBSAMPLING_420_BIT_KHR = 0b00000000000000000000000000000010
     VK_VIDEO_CHROMA_SUBSAMPLING_422_BIT_KHR = 0b00000000000000000000000000000100
     VK_VIDEO_CHROMA_SUBSAMPLING_444_BIT_KHR = 0b00000000000000000000000000001000
-converter BitsetToNumber*(flags: openArray[VkVideoChromaSubsamplingFlagBitsKHR]): VkVideoChromaSubsamplingFlagsKHR =
-  for flag in flags:
-    result = VkVideoChromaSubsamplingFlagsKHR(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkVideoChromaSubsamplingFlagBitsKHR]): VkVideoChromaSubsamplingFlagsKHR =
+    for flag in flags:
+      result = VkVideoChromaSubsamplingFlagsKHR(uint(result) or uint(flag))
+func toEnums*(number: VkVideoChromaSubsamplingFlagsKHR): seq[VkVideoChromaSubsamplingFlagBitsKHR] =
+    for value in VkVideoChromaSubsamplingFlagBitsKHR.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
+const
+  VK_VIDEO_CHROMA_SUBSAMPLING_INVALID_KHR* = 0
 type
   VkVideoComponentBitDepthFlagBitsKHR* {.size: sizeof(cint).} = enum
     VK_VIDEO_COMPONENT_BIT_DEPTH_8_BIT_KHR = 0b00000000000000000000000000000001
     VK_VIDEO_COMPONENT_BIT_DEPTH_10_BIT_KHR = 0b00000000000000000000000000000100
     VK_VIDEO_COMPONENT_BIT_DEPTH_12_BIT_KHR = 0b00000000000000000000000000010000
-converter BitsetToNumber*(flags: openArray[VkVideoComponentBitDepthFlagBitsKHR]): VkVideoComponentBitDepthFlagsKHR =
-  for flag in flags:
-    result = VkVideoComponentBitDepthFlagsKHR(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkVideoComponentBitDepthFlagBitsKHR]): VkVideoComponentBitDepthFlagsKHR =
+    for flag in flags:
+      result = VkVideoComponentBitDepthFlagsKHR(uint(result) or uint(flag))
+func toEnums*(number: VkVideoComponentBitDepthFlagsKHR): seq[VkVideoComponentBitDepthFlagBitsKHR] =
+    for value in VkVideoComponentBitDepthFlagBitsKHR.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
+const
+  VK_VIDEO_COMPONENT_BIT_DEPTH_INVALID_KHR* = 0
 type
   VkVideoCapabilityFlagBitsKHR* {.size: sizeof(cint).} = enum
     VK_VIDEO_CAPABILITY_PROTECTED_CONTENT_BIT_KHR = 0b00000000000000000000000000000001
     VK_VIDEO_CAPABILITY_SEPARATE_REFERENCE_IMAGES_BIT_KHR = 0b00000000000000000000000000000010
-converter BitsetToNumber*(flags: openArray[VkVideoCapabilityFlagBitsKHR]): VkVideoCapabilityFlagsKHR =
-  for flag in flags:
-    result = VkVideoCapabilityFlagsKHR(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkVideoCapabilityFlagBitsKHR]): VkVideoCapabilityFlagsKHR =
+    for flag in flags:
+      result = VkVideoCapabilityFlagsKHR(uint(result) or uint(flag))
+func toEnums*(number: VkVideoCapabilityFlagsKHR): seq[VkVideoCapabilityFlagBitsKHR] =
+    for value in VkVideoCapabilityFlagBitsKHR.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkVideoSessionCreateFlagBitsKHR* {.size: sizeof(cint).} = enum
     VK_VIDEO_SESSION_CREATE_PROTECTED_CONTENT_BIT_KHR = 0b00000000000000000000000000000001
-converter BitsetToNumber*(flags: openArray[VkVideoSessionCreateFlagBitsKHR]): VkVideoSessionCreateFlagsKHR =
-  for flag in flags:
-    result = VkVideoSessionCreateFlagsKHR(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkVideoSessionCreateFlagBitsKHR]): VkVideoSessionCreateFlagsKHR =
+    for flag in flags:
+      result = VkVideoSessionCreateFlagsKHR(uint(result) or uint(flag))
+func toEnums*(number: VkVideoSessionCreateFlagsKHR): seq[VkVideoSessionCreateFlagBitsKHR] =
+    for value in VkVideoSessionCreateFlagBitsKHR.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkVideoDecodeH264PictureLayoutFlagBitsKHR* {.size: sizeof(cint).} = enum
     VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_INTERLACED_INTERLEAVED_LINES_BIT_KHR = 0b00000000000000000000000000000001
     VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_INTERLACED_SEPARATE_PLANES_BIT_KHR = 0b00000000000000000000000000000010
-converter BitsetToNumber*(flags: openArray[VkVideoDecodeH264PictureLayoutFlagBitsKHR]): VkVideoDecodeH264PictureLayoutFlagsKHR =
-  for flag in flags:
-    result = VkVideoDecodeH264PictureLayoutFlagsKHR(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkVideoDecodeH264PictureLayoutFlagBitsKHR]): VkVideoDecodeH264PictureLayoutFlagsKHR =
+    for flag in flags:
+      result = VkVideoDecodeH264PictureLayoutFlagsKHR(uint(result) or uint(flag))
+func toEnums*(number: VkVideoDecodeH264PictureLayoutFlagsKHR): seq[VkVideoDecodeH264PictureLayoutFlagBitsKHR] =
+    for value in VkVideoDecodeH264PictureLayoutFlagBitsKHR.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
+const
+  VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_PROGRESSIVE_KHR* = 0
 type
   VkVideoCodingControlFlagBitsKHR* {.size: sizeof(cint).} = enum
     VK_VIDEO_CODING_CONTROL_RESET_BIT_KHR = 0b00000000000000000000000000000001
     VK_VIDEO_CODING_CONTROL_ENCODE_RATE_CONTROL_BIT_KHR = 0b00000000000000000000000000000010
     VK_VIDEO_CODING_CONTROL_ENCODE_RATE_CONTROL_LAYER_BIT_KHR = 0b00000000000000000000000000000100
-converter BitsetToNumber*(flags: openArray[VkVideoCodingControlFlagBitsKHR]): VkVideoCodingControlFlagsKHR =
-  for flag in flags:
-    result = VkVideoCodingControlFlagsKHR(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkVideoCodingControlFlagBitsKHR]): VkVideoCodingControlFlagsKHR =
+    for flag in flags:
+      result = VkVideoCodingControlFlagsKHR(uint(result) or uint(flag))
+func toEnums*(number: VkVideoCodingControlFlagsKHR): seq[VkVideoCodingControlFlagBitsKHR] =
+    for value in VkVideoCodingControlFlagBitsKHR.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkQueryResultStatusKHR* {.size: sizeof(cint).} = enum
     VK_QUERY_RESULT_STATUS_ERROR_KHR = -1
@@ -3357,33 +3774,55 @@
     VK_VIDEO_DECODE_USAGE_TRANSCODING_BIT_KHR = 0b00000000000000000000000000000001
     VK_VIDEO_DECODE_USAGE_OFFLINE_BIT_KHR = 0b00000000000000000000000000000010
     VK_VIDEO_DECODE_USAGE_STREAMING_BIT_KHR = 0b00000000000000000000000000000100
-converter BitsetToNumber*(flags: openArray[VkVideoDecodeUsageFlagBitsKHR]): VkVideoDecodeUsageFlagsKHR =
-  for flag in flags:
-    result = VkVideoDecodeUsageFlagsKHR(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkVideoDecodeUsageFlagBitsKHR]): VkVideoDecodeUsageFlagsKHR =
+    for flag in flags:
+      result = VkVideoDecodeUsageFlagsKHR(uint(result) or uint(flag))
+func toEnums*(number: VkVideoDecodeUsageFlagsKHR): seq[VkVideoDecodeUsageFlagBitsKHR] =
+    for value in VkVideoDecodeUsageFlagBitsKHR.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
+const
+  VK_VIDEO_DECODE_USAGE_DEFAULT_KHR* = 0
 type
   VkVideoDecodeCapabilityFlagBitsKHR* {.size: sizeof(cint).} = enum
     VK_VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_COINCIDE_BIT_KHR = 0b00000000000000000000000000000001
     VK_VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_DISTINCT_BIT_KHR = 0b00000000000000000000000000000010
-converter BitsetToNumber*(flags: openArray[VkVideoDecodeCapabilityFlagBitsKHR]): VkVideoDecodeCapabilityFlagsKHR =
-  for flag in flags:
-    result = VkVideoDecodeCapabilityFlagsKHR(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkVideoDecodeCapabilityFlagBitsKHR]): VkVideoDecodeCapabilityFlagsKHR =
+    for flag in flags:
+      result = VkVideoDecodeCapabilityFlagsKHR(uint(result) or uint(flag))
+func toEnums*(number: VkVideoDecodeCapabilityFlagsKHR): seq[VkVideoDecodeCapabilityFlagBitsKHR] =
+    for value in VkVideoDecodeCapabilityFlagBitsKHR.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkVideoEncodeUsageFlagBitsKHR* {.size: sizeof(cint).} = enum
     VK_VIDEO_ENCODE_USAGE_TRANSCODING_BIT_KHR = 0b00000000000000000000000000000001
     VK_VIDEO_ENCODE_USAGE_STREAMING_BIT_KHR = 0b00000000000000000000000000000010
     VK_VIDEO_ENCODE_USAGE_RECORDING_BIT_KHR = 0b00000000000000000000000000000100
     VK_VIDEO_ENCODE_USAGE_CONFERENCING_BIT_KHR = 0b00000000000000000000000000001000
-converter BitsetToNumber*(flags: openArray[VkVideoEncodeUsageFlagBitsKHR]): VkVideoEncodeUsageFlagsKHR =
-  for flag in flags:
-    result = VkVideoEncodeUsageFlagsKHR(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkVideoEncodeUsageFlagBitsKHR]): VkVideoEncodeUsageFlagsKHR =
+    for flag in flags:
+      result = VkVideoEncodeUsageFlagsKHR(uint(result) or uint(flag))
+func toEnums*(number: VkVideoEncodeUsageFlagsKHR): seq[VkVideoEncodeUsageFlagBitsKHR] =
+    for value in VkVideoEncodeUsageFlagBitsKHR.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
+const
+  VK_VIDEO_ENCODE_USAGE_DEFAULT_KHR* = 0
 type
   VkVideoEncodeContentFlagBitsKHR* {.size: sizeof(cint).} = enum
     VK_VIDEO_ENCODE_CONTENT_CAMERA_BIT_KHR = 0b00000000000000000000000000000001
     VK_VIDEO_ENCODE_CONTENT_DESKTOP_BIT_KHR = 0b00000000000000000000000000000010
     VK_VIDEO_ENCODE_CONTENT_RENDERED_BIT_KHR = 0b00000000000000000000000000000100
-converter BitsetToNumber*(flags: openArray[VkVideoEncodeContentFlagBitsKHR]): VkVideoEncodeContentFlagsKHR =
-  for flag in flags:
-    result = VkVideoEncodeContentFlagsKHR(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkVideoEncodeContentFlagBitsKHR]): VkVideoEncodeContentFlagsKHR =
+    for flag in flags:
+      result = VkVideoEncodeContentFlagsKHR(uint(result) or uint(flag))
+func toEnums*(number: VkVideoEncodeContentFlagsKHR): seq[VkVideoEncodeContentFlagBitsKHR] =
+    for value in VkVideoEncodeContentFlagBitsKHR.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
+const
+  VK_VIDEO_ENCODE_CONTENT_DEFAULT_KHR* = 0
 type
   VkVideoEncodeTuningModeKHR* {.size: sizeof(cint).} = enum
     VK_VIDEO_ENCODE_TUNING_MODE_DEFAULT_KHR = 0
@@ -3393,17 +3832,25 @@
     VK_VIDEO_ENCODE_TUNING_MODE_LOSSLESS_KHR = 4
   VkVideoEncodeCapabilityFlagBitsKHR* {.size: sizeof(cint).} = enum
     VK_VIDEO_ENCODE_CAPABILITY_PRECEDING_EXTERNALLY_ENCODED_BYTES_BIT_KHR = 0b00000000000000000000000000000001
-converter BitsetToNumber*(flags: openArray[VkVideoEncodeCapabilityFlagBitsKHR]): VkVideoEncodeCapabilityFlagsKHR =
-  for flag in flags:
-    result = VkVideoEncodeCapabilityFlagsKHR(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkVideoEncodeCapabilityFlagBitsKHR]): VkVideoEncodeCapabilityFlagsKHR =
+    for flag in flags:
+      result = VkVideoEncodeCapabilityFlagsKHR(uint(result) or uint(flag))
+func toEnums*(number: VkVideoEncodeCapabilityFlagsKHR): seq[VkVideoEncodeCapabilityFlagBitsKHR] =
+    for value in VkVideoEncodeCapabilityFlagBitsKHR.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkVideoEncodeRateControlModeFlagBitsKHR* {.size: sizeof(cint).} = enum
     VK_VIDEO_ENCODE_RATE_CONTROL_MODE_NONE_BIT_KHR = 0b00000000000000000000000000000001
     VK_VIDEO_ENCODE_RATE_CONTROL_MODE_CBR_BIT_KHR = 0b00000000000000000000000000000010
     VK_VIDEO_ENCODE_RATE_CONTROL_MODE_VBR_BIT_KHR = 0b00000000000000000000000000000100
-converter BitsetToNumber*(flags: openArray[VkVideoEncodeRateControlModeFlagBitsKHR]): VkVideoEncodeRateControlModeFlagsKHR =
-  for flag in flags:
-    result = VkVideoEncodeRateControlModeFlagsKHR(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkVideoEncodeRateControlModeFlagBitsKHR]): VkVideoEncodeRateControlModeFlagsKHR =
+    for flag in flags:
+      result = VkVideoEncodeRateControlModeFlagsKHR(uint(result) or uint(flag))
+func toEnums*(number: VkVideoEncodeRateControlModeFlagsKHR): seq[VkVideoEncodeRateControlModeFlagBitsKHR] =
+    for value in VkVideoEncodeRateControlModeFlagBitsKHR.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkVideoEncodeH264CapabilityFlagBitsEXT* {.size: sizeof(cint).} = enum
     VK_VIDEO_ENCODE_H264_CAPABILITY_DIRECT_8X8_INFERENCE_ENABLED_BIT_EXT = 0b00000000000000000000000000000001
@@ -3431,25 +3878,37 @@
     VK_VIDEO_ENCODE_H264_CAPABILITY_ROW_UNALIGNED_SLICE_BIT_EXT = 0b00000000010000000000000000000000
     VK_VIDEO_ENCODE_H264_CAPABILITY_DIFFERENT_SLICE_TYPE_BIT_EXT = 0b00000000100000000000000000000000
     VK_VIDEO_ENCODE_H264_CAPABILITY_B_FRAME_IN_L1_LIST_BIT_EXT = 0b00000001000000000000000000000000
-converter BitsetToNumber*(flags: openArray[VkVideoEncodeH264CapabilityFlagBitsEXT]): VkVideoEncodeH264CapabilityFlagsEXT =
-  for flag in flags:
-    result = VkVideoEncodeH264CapabilityFlagsEXT(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkVideoEncodeH264CapabilityFlagBitsEXT]): VkVideoEncodeH264CapabilityFlagsEXT =
+    for flag in flags:
+      result = VkVideoEncodeH264CapabilityFlagsEXT(uint(result) or uint(flag))
+func toEnums*(number: VkVideoEncodeH264CapabilityFlagsEXT): seq[VkVideoEncodeH264CapabilityFlagBitsEXT] =
+    for value in VkVideoEncodeH264CapabilityFlagBitsEXT.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkVideoEncodeH264InputModeFlagBitsEXT* {.size: sizeof(cint).} = enum
     VK_VIDEO_ENCODE_H264_INPUT_MODE_FRAME_BIT_EXT = 0b00000000000000000000000000000001
     VK_VIDEO_ENCODE_H264_INPUT_MODE_SLICE_BIT_EXT = 0b00000000000000000000000000000010
     VK_VIDEO_ENCODE_H264_INPUT_MODE_NON_VCL_BIT_EXT = 0b00000000000000000000000000000100
-converter BitsetToNumber*(flags: openArray[VkVideoEncodeH264InputModeFlagBitsEXT]): VkVideoEncodeH264InputModeFlagsEXT =
-  for flag in flags:
-    result = VkVideoEncodeH264InputModeFlagsEXT(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkVideoEncodeH264InputModeFlagBitsEXT]): VkVideoEncodeH264InputModeFlagsEXT =
+    for flag in flags:
+      result = VkVideoEncodeH264InputModeFlagsEXT(uint(result) or uint(flag))
+func toEnums*(number: VkVideoEncodeH264InputModeFlagsEXT): seq[VkVideoEncodeH264InputModeFlagBitsEXT] =
+    for value in VkVideoEncodeH264InputModeFlagBitsEXT.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkVideoEncodeH264OutputModeFlagBitsEXT* {.size: sizeof(cint).} = enum
     VK_VIDEO_ENCODE_H264_OUTPUT_MODE_FRAME_BIT_EXT = 0b00000000000000000000000000000001
     VK_VIDEO_ENCODE_H264_OUTPUT_MODE_SLICE_BIT_EXT = 0b00000000000000000000000000000010
     VK_VIDEO_ENCODE_H264_OUTPUT_MODE_NON_VCL_BIT_EXT = 0b00000000000000000000000000000100
-converter BitsetToNumber*(flags: openArray[VkVideoEncodeH264OutputModeFlagBitsEXT]): VkVideoEncodeH264OutputModeFlagsEXT =
-  for flag in flags:
-    result = VkVideoEncodeH264OutputModeFlagsEXT(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkVideoEncodeH264OutputModeFlagBitsEXT]): VkVideoEncodeH264OutputModeFlagsEXT =
+    for flag in flags:
+      result = VkVideoEncodeH264OutputModeFlagsEXT(uint(result) or uint(flag))
+func toEnums*(number: VkVideoEncodeH264OutputModeFlagsEXT): seq[VkVideoEncodeH264OutputModeFlagBitsEXT] =
+    for value in VkVideoEncodeH264OutputModeFlagBitsEXT.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkVideoEncodeH264RateControlStructureEXT* {.size: sizeof(cint).} = enum
     VK_VIDEO_ENCODE_H264_RATE_CONTROL_STRUCTURE_UNKNOWN_EXT = 0
@@ -3461,9 +3920,13 @@
     VK_IMAGE_CONSTRAINTS_INFO_CPU_WRITE_RARELY_FUCHSIA = 0b00000000000000000000000000000100
     VK_IMAGE_CONSTRAINTS_INFO_CPU_WRITE_OFTEN_FUCHSIA = 0b00000000000000000000000000001000
     VK_IMAGE_CONSTRAINTS_INFO_PROTECTED_OPTIONAL_FUCHSIA = 0b00000000000000000000000000010000
-converter BitsetToNumber*(flags: openArray[VkImageConstraintsInfoFlagBitsFUCHSIA]): VkImageConstraintsInfoFlagsFUCHSIA =
-  for flag in flags:
-    result = VkImageConstraintsInfoFlagsFUCHSIA(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkImageConstraintsInfoFlagBitsFUCHSIA]): VkImageConstraintsInfoFlagsFUCHSIA =
+    for flag in flags:
+      result = VkImageConstraintsInfoFlagsFUCHSIA(uint(result) or uint(flag))
+func toEnums*(number: VkImageConstraintsInfoFlagsFUCHSIA): seq[VkImageConstraintsInfoFlagBitsFUCHSIA] =
+    for value in VkImageConstraintsInfoFlagBitsFUCHSIA.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkFormatFeatureFlagBits2* {.size: 8.} = enum
     VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_BIT = 0b0000000000000000000000000000000000000000000000000000000000000001
@@ -3512,17 +3975,25 @@
     VK_FORMAT_FEATURE_2_RESERVED_44_BIT_EXT = 0b0000000000000000000100000000000000000000000000000000000000000000
     VK_FORMAT_FEATURE_2_RESERVED_45_BIT_EXT = 0b0000000000000000001000000000000000000000000000000000000000000000
 converter BitsetToNumber*(flags: openArray[VkFormatFeatureFlagBits2]): VkFormatFeatureFlags2 =
-  for flag in flags:
-    result = VkFormatFeatureFlags2(uint64(result) or uint(flag))
+    for flag in flags:
+      result = VkFormatFeatureFlags2(int64(result) or int64(flag))
+converter NumberToBitset*(number: VkFormatFeatureFlags2): seq[VkFormatFeatureFlagBits2] =
+        for value in VkFormatFeatureFlagBits2.items:
+          if (value.ord and int64(number)) > 0:
+            result.add value
 type
   VkRenderingFlagBits* {.size: sizeof(cint).} = enum
     VK_RENDERING_CONTENTS_SECONDARY_COMMAND_BUFFERS_BIT = 0b00000000000000000000000000000001
     VK_RENDERING_SUSPENDING_BIT = 0b00000000000000000000000000000010
     VK_RENDERING_RESUMING_BIT = 0b00000000000000000000000000000100
     VK_RENDERING_ENABLE_LEGACY_DITHERING_BIT_EXT = 0b00000000000000000000000000001000
-converter BitsetToNumber*(flags: openArray[VkRenderingFlagBits]): VkRenderingFlags =
-  for flag in flags:
-    result = VkRenderingFlags(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkRenderingFlagBits]): VkRenderingFlags =
+    for flag in flags:
+      result = VkRenderingFlags(uint(result) or uint(flag))
+func toEnums*(number: VkRenderingFlags): seq[VkRenderingFlagBits] =
+    for value in VkRenderingFlagBits.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkVideoEncodeH265CapabilityFlagBitsEXT* {.size: sizeof(cint).} = enum
     VK_VIDEO_ENCODE_H265_CAPABILITY_SEPARATE_COLOUR_PLANE_BIT_EXT = 0b00000000000000000000000000000001
@@ -3551,25 +4022,37 @@
     VK_VIDEO_ENCODE_H265_CAPABILITY_DEPENDENT_SLICE_SEGMENT_BIT_EXT = 0b00000000100000000000000000000000
     VK_VIDEO_ENCODE_H265_CAPABILITY_DIFFERENT_SLICE_TYPE_BIT_EXT = 0b00000001000000000000000000000000
     VK_VIDEO_ENCODE_H265_CAPABILITY_B_FRAME_IN_L1_LIST_BIT_EXT = 0b00000010000000000000000000000000
-converter BitsetToNumber*(flags: openArray[VkVideoEncodeH265CapabilityFlagBitsEXT]): VkVideoEncodeH265CapabilityFlagsEXT =
-  for flag in flags:
-    result = VkVideoEncodeH265CapabilityFlagsEXT(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkVideoEncodeH265CapabilityFlagBitsEXT]): VkVideoEncodeH265CapabilityFlagsEXT =
+    for flag in flags:
+      result = VkVideoEncodeH265CapabilityFlagsEXT(uint(result) or uint(flag))
+func toEnums*(number: VkVideoEncodeH265CapabilityFlagsEXT): seq[VkVideoEncodeH265CapabilityFlagBitsEXT] =
+    for value in VkVideoEncodeH265CapabilityFlagBitsEXT.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkVideoEncodeH265InputModeFlagBitsEXT* {.size: sizeof(cint).} = enum
     VK_VIDEO_ENCODE_H265_INPUT_MODE_FRAME_BIT_EXT = 0b00000000000000000000000000000001
     VK_VIDEO_ENCODE_H265_INPUT_MODE_SLICE_SEGMENT_BIT_EXT = 0b00000000000000000000000000000010
     VK_VIDEO_ENCODE_H265_INPUT_MODE_NON_VCL_BIT_EXT = 0b00000000000000000000000000000100
-converter BitsetToNumber*(flags: openArray[VkVideoEncodeH265InputModeFlagBitsEXT]): VkVideoEncodeH265InputModeFlagsEXT =
-  for flag in flags:
-    result = VkVideoEncodeH265InputModeFlagsEXT(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkVideoEncodeH265InputModeFlagBitsEXT]): VkVideoEncodeH265InputModeFlagsEXT =
+    for flag in flags:
+      result = VkVideoEncodeH265InputModeFlagsEXT(uint(result) or uint(flag))
+func toEnums*(number: VkVideoEncodeH265InputModeFlagsEXT): seq[VkVideoEncodeH265InputModeFlagBitsEXT] =
+    for value in VkVideoEncodeH265InputModeFlagBitsEXT.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkVideoEncodeH265OutputModeFlagBitsEXT* {.size: sizeof(cint).} = enum
     VK_VIDEO_ENCODE_H265_OUTPUT_MODE_FRAME_BIT_EXT = 0b00000000000000000000000000000001
     VK_VIDEO_ENCODE_H265_OUTPUT_MODE_SLICE_SEGMENT_BIT_EXT = 0b00000000000000000000000000000010
     VK_VIDEO_ENCODE_H265_OUTPUT_MODE_NON_VCL_BIT_EXT = 0b00000000000000000000000000000100
-converter BitsetToNumber*(flags: openArray[VkVideoEncodeH265OutputModeFlagBitsEXT]): VkVideoEncodeH265OutputModeFlagsEXT =
-  for flag in flags:
-    result = VkVideoEncodeH265OutputModeFlagsEXT(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkVideoEncodeH265OutputModeFlagBitsEXT]): VkVideoEncodeH265OutputModeFlagsEXT =
+    for flag in flags:
+      result = VkVideoEncodeH265OutputModeFlagsEXT(uint(result) or uint(flag))
+func toEnums*(number: VkVideoEncodeH265OutputModeFlagsEXT): seq[VkVideoEncodeH265OutputModeFlagBitsEXT] =
+    for value in VkVideoEncodeH265OutputModeFlagBitsEXT.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkVideoEncodeH265RateControlStructureEXT* {.size: sizeof(cint).} = enum
     VK_VIDEO_ENCODE_H265_RATE_CONTROL_STRUCTURE_UNKNOWN_EXT = 0
@@ -3579,18 +4062,26 @@
     VK_VIDEO_ENCODE_H265_CTB_SIZE_16_BIT_EXT = 0b00000000000000000000000000000001
     VK_VIDEO_ENCODE_H265_CTB_SIZE_32_BIT_EXT = 0b00000000000000000000000000000010
     VK_VIDEO_ENCODE_H265_CTB_SIZE_64_BIT_EXT = 0b00000000000000000000000000000100
-converter BitsetToNumber*(flags: openArray[VkVideoEncodeH265CtbSizeFlagBitsEXT]): VkVideoEncodeH265CtbSizeFlagsEXT =
-  for flag in flags:
-    result = VkVideoEncodeH265CtbSizeFlagsEXT(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkVideoEncodeH265CtbSizeFlagBitsEXT]): VkVideoEncodeH265CtbSizeFlagsEXT =
+    for flag in flags:
+      result = VkVideoEncodeH265CtbSizeFlagsEXT(uint(result) or uint(flag))
+func toEnums*(number: VkVideoEncodeH265CtbSizeFlagsEXT): seq[VkVideoEncodeH265CtbSizeFlagBitsEXT] =
+    for value in VkVideoEncodeH265CtbSizeFlagBitsEXT.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkVideoEncodeH265TransformBlockSizeFlagBitsEXT* {.size: sizeof(cint).} = enum
     VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_4_BIT_EXT = 0b00000000000000000000000000000001
     VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_8_BIT_EXT = 0b00000000000000000000000000000010
     VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_16_BIT_EXT = 0b00000000000000000000000000000100
     VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_32_BIT_EXT = 0b00000000000000000000000000001000
-converter BitsetToNumber*(flags: openArray[VkVideoEncodeH265TransformBlockSizeFlagBitsEXT]): VkVideoEncodeH265TransformBlockSizeFlagsEXT =
-  for flag in flags:
-    result = VkVideoEncodeH265TransformBlockSizeFlagsEXT(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkVideoEncodeH265TransformBlockSizeFlagBitsEXT]): VkVideoEncodeH265TransformBlockSizeFlagsEXT =
+    for flag in flags:
+      result = VkVideoEncodeH265TransformBlockSizeFlagsEXT(uint(result) or uint(flag))
+func toEnums*(number: VkVideoEncodeH265TransformBlockSizeFlagsEXT): seq[VkVideoEncodeH265TransformBlockSizeFlagBitsEXT] =
+    for value in VkVideoEncodeH265TransformBlockSizeFlagBitsEXT.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkExportMetalObjectTypeFlagBitsEXT* {.size: sizeof(cint).} = enum
     VK_EXPORT_METAL_OBJECT_TYPE_METAL_DEVICE_BIT_EXT = 0b00000000000000000000000000000001
@@ -3599,23 +4090,37 @@
     VK_EXPORT_METAL_OBJECT_TYPE_METAL_TEXTURE_BIT_EXT = 0b00000000000000000000000000001000
     VK_EXPORT_METAL_OBJECT_TYPE_METAL_IOSURFACE_BIT_EXT = 0b00000000000000000000000000010000
     VK_EXPORT_METAL_OBJECT_TYPE_METAL_SHARED_EVENT_BIT_EXT = 0b00000000000000000000000000100000
-converter BitsetToNumber*(flags: openArray[VkExportMetalObjectTypeFlagBitsEXT]): VkExportMetalObjectTypeFlagsEXT =
-  for flag in flags:
-    result = VkExportMetalObjectTypeFlagsEXT(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkExportMetalObjectTypeFlagBitsEXT]): VkExportMetalObjectTypeFlagsEXT =
+    for flag in flags:
+      result = VkExportMetalObjectTypeFlagsEXT(uint(result) or uint(flag))
+func toEnums*(number: VkExportMetalObjectTypeFlagsEXT): seq[VkExportMetalObjectTypeFlagBitsEXT] =
+    for value in VkExportMetalObjectTypeFlagBitsEXT.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkInstanceCreateFlagBits* {.size: sizeof(cint).} = enum
     VK_INSTANCE_CREATE_ENUMERATE_PORTABILITY_BIT_KHR = 0b00000000000000000000000000000001
-converter BitsetToNumber*(flags: openArray[VkInstanceCreateFlagBits]): VkInstanceCreateFlags =
-  for flag in flags:
-    result = VkInstanceCreateFlags(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkInstanceCreateFlagBits]): VkInstanceCreateFlags =
+    for flag in flags:
+      result = VkInstanceCreateFlags(uint(result) or uint(flag))
+func toEnums*(number: VkInstanceCreateFlags): seq[VkInstanceCreateFlagBits] =
+    for value in VkInstanceCreateFlagBits.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkImageCompressionFlagBitsEXT* {.size: sizeof(cint).} = enum
     VK_IMAGE_COMPRESSION_FIXED_RATE_DEFAULT_EXT = 0b00000000000000000000000000000001
     VK_IMAGE_COMPRESSION_FIXED_RATE_EXPLICIT_EXT = 0b00000000000000000000000000000010
     VK_IMAGE_COMPRESSION_DISABLED_EXT = 0b00000000000000000000000000000100
-converter BitsetToNumber*(flags: openArray[VkImageCompressionFlagBitsEXT]): VkImageCompressionFlagsEXT =
-  for flag in flags:
-    result = VkImageCompressionFlagsEXT(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkImageCompressionFlagBitsEXT]): VkImageCompressionFlagsEXT =
+    for flag in flags:
+      result = VkImageCompressionFlagsEXT(uint(result) or uint(flag))
+func toEnums*(number: VkImageCompressionFlagsEXT): seq[VkImageCompressionFlagBitsEXT] =
+    for value in VkImageCompressionFlagBitsEXT.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
+const
+  VK_IMAGE_COMPRESSION_DEFAULT_EXT* = 0
 type
   VkImageCompressionFixedRateFlagBitsEXT* {.size: sizeof(cint).} = enum
     VK_IMAGE_COMPRESSION_FIXED_RATE_1BPC_BIT_EXT = 0b00000000000000000000000000000001
@@ -3642,9 +4147,15 @@
     VK_IMAGE_COMPRESSION_FIXED_RATE_22BPC_BIT_EXT = 0b00000000001000000000000000000000
     VK_IMAGE_COMPRESSION_FIXED_RATE_23BPC_BIT_EXT = 0b00000000010000000000000000000000
     VK_IMAGE_COMPRESSION_FIXED_RATE_24BPC_BIT_EXT = 0b00000000100000000000000000000000
-converter BitsetToNumber*(flags: openArray[VkImageCompressionFixedRateFlagBitsEXT]): VkImageCompressionFixedRateFlagsEXT =
-  for flag in flags:
-    result = VkImageCompressionFixedRateFlagsEXT(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkImageCompressionFixedRateFlagBitsEXT]): VkImageCompressionFixedRateFlagsEXT =
+    for flag in flags:
+      result = VkImageCompressionFixedRateFlagsEXT(uint(result) or uint(flag))
+func toEnums*(number: VkImageCompressionFixedRateFlagsEXT): seq[VkImageCompressionFixedRateFlagBitsEXT] =
+    for value in VkImageCompressionFixedRateFlagBitsEXT.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
+const
+  VK_IMAGE_COMPRESSION_FIXED_RATE_NONE_EXT* = 0
 type
   VkPipelineRobustnessBufferBehaviorEXT* {.size: sizeof(cint).} = enum
     VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_DEVICE_DEFAULT_EXT = 0
@@ -3661,9 +4172,15 @@
     VK_OPTICAL_FLOW_GRID_SIZE_2X2_BIT_NV = 0b00000000000000000000000000000010
     VK_OPTICAL_FLOW_GRID_SIZE_4X4_BIT_NV = 0b00000000000000000000000000000100
     VK_OPTICAL_FLOW_GRID_SIZE_8X8_BIT_NV = 0b00000000000000000000000000001000
-converter BitsetToNumber*(flags: openArray[VkOpticalFlowGridSizeFlagBitsNV]): VkOpticalFlowGridSizeFlagsNV =
-  for flag in flags:
-    result = VkOpticalFlowGridSizeFlagsNV(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkOpticalFlowGridSizeFlagBitsNV]): VkOpticalFlowGridSizeFlagsNV =
+    for flag in flags:
+      result = VkOpticalFlowGridSizeFlagsNV(uint(result) or uint(flag))
+func toEnums*(number: VkOpticalFlowGridSizeFlagsNV): seq[VkOpticalFlowGridSizeFlagBitsNV] =
+    for value in VkOpticalFlowGridSizeFlagBitsNV.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
+const
+  VK_OPTICAL_FLOW_GRID_SIZE_UNKNOWN_NV* = 0
 type
   VkOpticalFlowUsageFlagBitsNV* {.size: sizeof(cint).} = enum
     VK_OPTICAL_FLOW_USAGE_INPUT_BIT_NV = 0b00000000000000000000000000000001
@@ -3671,9 +4188,15 @@
     VK_OPTICAL_FLOW_USAGE_HINT_BIT_NV = 0b00000000000000000000000000000100
     VK_OPTICAL_FLOW_USAGE_COST_BIT_NV = 0b00000000000000000000000000001000
     VK_OPTICAL_FLOW_USAGE_GLOBAL_FLOW_BIT_NV = 0b00000000000000000000000000010000
-converter BitsetToNumber*(flags: openArray[VkOpticalFlowUsageFlagBitsNV]): VkOpticalFlowUsageFlagsNV =
-  for flag in flags:
-    result = VkOpticalFlowUsageFlagsNV(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkOpticalFlowUsageFlagBitsNV]): VkOpticalFlowUsageFlagsNV =
+    for flag in flags:
+      result = VkOpticalFlowUsageFlagsNV(uint(result) or uint(flag))
+func toEnums*(number: VkOpticalFlowUsageFlagsNV): seq[VkOpticalFlowUsageFlagBitsNV] =
+    for value in VkOpticalFlowUsageFlagBitsNV.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
+const
+  VK_OPTICAL_FLOW_USAGE_UNKNOWN_NV* = 0
 type
   VkOpticalFlowPerformanceLevelNV* {.size: sizeof(cint).} = enum
     VK_OPTICAL_FLOW_PERFORMANCE_LEVEL_UNKNOWN_NV = 0
@@ -3696,15 +4219,23 @@
     VK_OPTICAL_FLOW_SESSION_CREATE_ENABLE_GLOBAL_FLOW_BIT_NV = 0b00000000000000000000000000000100
     VK_OPTICAL_FLOW_SESSION_CREATE_ALLOW_REGIONS_BIT_NV = 0b00000000000000000000000000001000
     VK_OPTICAL_FLOW_SESSION_CREATE_BOTH_DIRECTIONS_BIT_NV = 0b00000000000000000000000000010000
-converter BitsetToNumber*(flags: openArray[VkOpticalFlowSessionCreateFlagBitsNV]): VkOpticalFlowSessionCreateFlagsNV =
-  for flag in flags:
-    result = VkOpticalFlowSessionCreateFlagsNV(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkOpticalFlowSessionCreateFlagBitsNV]): VkOpticalFlowSessionCreateFlagsNV =
+    for flag in flags:
+      result = VkOpticalFlowSessionCreateFlagsNV(uint(result) or uint(flag))
+func toEnums*(number: VkOpticalFlowSessionCreateFlagsNV): seq[VkOpticalFlowSessionCreateFlagBitsNV] =
+    for value in VkOpticalFlowSessionCreateFlagBitsNV.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkOpticalFlowExecuteFlagBitsNV* {.size: sizeof(cint).} = enum
     VK_OPTICAL_FLOW_EXECUTE_DISABLE_TEMPORAL_HINTS_BIT_NV = 0b00000000000000000000000000000001
-converter BitsetToNumber*(flags: openArray[VkOpticalFlowExecuteFlagBitsNV]): VkOpticalFlowExecuteFlagsNV =
-  for flag in flags:
-    result = VkOpticalFlowExecuteFlagsNV(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkOpticalFlowExecuteFlagBitsNV]): VkOpticalFlowExecuteFlagsNV =
+    for flag in flags:
+      result = VkOpticalFlowExecuteFlagsNV(uint(result) or uint(flag))
+func toEnums*(number: VkOpticalFlowExecuteFlagsNV): seq[VkOpticalFlowExecuteFlagBitsNV] =
+    for value in VkOpticalFlowExecuteFlagBitsNV.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkMicromapTypeEXT* {.size: sizeof(cint).} = enum
     VK_MICROMAP_TYPE_OPACITY_MICROMAP_EXT = 0
@@ -3712,15 +4243,23 @@
     VK_BUILD_MICROMAP_PREFER_FAST_TRACE_BIT_EXT = 0b00000000000000000000000000000001
     VK_BUILD_MICROMAP_PREFER_FAST_BUILD_BIT_EXT = 0b00000000000000000000000000000010
     VK_BUILD_MICROMAP_ALLOW_COMPACTION_BIT_EXT = 0b00000000000000000000000000000100
-converter BitsetToNumber*(flags: openArray[VkBuildMicromapFlagBitsEXT]): VkBuildMicromapFlagsEXT =
-  for flag in flags:
-    result = VkBuildMicromapFlagsEXT(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkBuildMicromapFlagBitsEXT]): VkBuildMicromapFlagsEXT =
+    for flag in flags:
+      result = VkBuildMicromapFlagsEXT(uint(result) or uint(flag))
+func toEnums*(number: VkBuildMicromapFlagsEXT): seq[VkBuildMicromapFlagBitsEXT] =
+    for value in VkBuildMicromapFlagBitsEXT.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkMicromapCreateFlagBitsEXT* {.size: sizeof(cint).} = enum
     VK_MICROMAP_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_EXT = 0b00000000000000000000000000000001
-converter BitsetToNumber*(flags: openArray[VkMicromapCreateFlagBitsEXT]): VkMicromapCreateFlagsEXT =
-  for flag in flags:
-    result = VkMicromapCreateFlagsEXT(uint(result) or uint(flag))
+func toBits*(flags: openArray[VkMicromapCreateFlagBitsEXT]): VkMicromapCreateFlagsEXT =
+    for flag in flags:
+      result = VkMicromapCreateFlagsEXT(uint(result) or uint(flag))
+func toEnums*(number: VkMicromapCreateFlagsEXT): seq[VkMicromapCreateFlagBitsEXT] =
+    for value in VkMicromapCreateFlagBitsEXT.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value
 type
   VkCopyMicromapModeEXT* {.size: sizeof(cint).} = enum
     VK_COPY_MICROMAP_MODE_CLONE_EXT = 0
@@ -7521,7 +8060,7 @@
     dstAccelerationStructure*: VkAccelerationStructureKHR
     geometryCount*: uint32
     pGeometries*: ptr VkAccelerationStructureGeometryKHR
-    ppGeometries*: cstringArray
+    ppGeometries*: ptr ptr VkAccelerationStructureGeometryKHR
     scratchData*: VkDeviceOrHostAddressKHR
   VkAccelerationStructureBuildRangeInfoKHR* = object
     primitiveCount*: uint32
@@ -8218,9 +8757,9 @@
     blockDimZ*: uint32
     sharedMemBytes*: uint32
     paramCount*: csize_t
-    pParams*: void
+    pParams*: ptr pointer
     extraCount*: csize_t
-    pExtras*: void
+    pExtras*: ptr pointer
   VkPhysicalDeviceDescriptorBufferFeaturesEXT* = object
     sType*: VkStructureType
     pNext*: pointer
@@ -8654,7 +9193,7 @@
     dstMicromap*: VkMicromapEXT
     usageCountsCount*: uint32
     pUsageCounts*: ptr VkMicromapUsageEXT
-    ppUsageCounts*: cstringArray
+    ppUsageCounts*: ptr ptr VkMicromapUsageEXT
     data*: VkDeviceOrHostAddressConstKHR
     scratchData*: VkDeviceOrHostAddressKHR
     triangleArray*: VkDeviceOrHostAddressConstKHR
@@ -8724,7 +9263,7 @@
     baseTriangle*: uint32
     usageCountsCount*: uint32
     pUsageCounts*: ptr VkMicromapUsageEXT
-    ppUsageCounts*: cstringArray
+    ppUsageCounts*: ptr ptr VkMicromapUsageEXT
     micromap*: VkMicromapEXT
   VkPipelinePropertiesIdentifierEXT* = object
     sType*: VkStructureType
@@ -9033,7 +9572,7 @@
   vkDeviceWaitIdle*: proc(device: VkDevice): VkResult {.stdcall.}
   vkAllocateMemory*: proc(device: VkDevice, pAllocateInfo: ptr VkMemoryAllocateInfo, pAllocator: ptr VkAllocationCallbacks, pMemory: ptr VkDeviceMemory): VkResult {.stdcall.}
   vkFreeMemory*: proc(device: VkDevice, memory: VkDeviceMemory, pAllocator: ptr VkAllocationCallbacks): void {.stdcall.}
-  vkMapMemory*: proc(device: VkDevice, memory: VkDeviceMemory, offset: VkDeviceSize, size: VkDeviceSize, flags: VkMemoryMapFlags, ppData: void): VkResult {.stdcall.}
+  vkMapMemory*: proc(device: VkDevice, memory: VkDeviceMemory, offset: VkDeviceSize, size: VkDeviceSize, flags: VkMemoryMapFlags, ppData: ptr pointer): VkResult {.stdcall.}
   vkUnmapMemory*: proc(device: VkDevice, memory: VkDeviceMemory): void {.stdcall.}
   vkFlushMappedMemoryRanges*: proc(device: VkDevice, memoryRangeCount: uint32, pMemoryRanges: ptr VkMappedMemoryRange): VkResult {.stdcall.}
   vkInvalidateMappedMemoryRanges*: proc(device: VkDevice, memoryRangeCount: uint32, pMemoryRanges: ptr VkMappedMemoryRange): VkResult {.stdcall.}
@@ -9108,7 +9647,7 @@
   vkCmdSetScissor*: proc(commandBuffer: VkCommandBuffer, firstScissor: uint32, scissorCount: uint32, pScissors: ptr VkRect2D): void {.stdcall.}
   vkCmdSetLineWidth*: proc(commandBuffer: VkCommandBuffer, lineWidth: float32): void {.stdcall.}
   vkCmdSetDepthBias*: proc(commandBuffer: VkCommandBuffer, depthBiasConstantFactor: float32, depthBiasClamp: float32, depthBiasSlopeFactor: float32): void {.stdcall.}
-  vkCmdSetBlendConstants*: proc(commandBuffer: VkCommandBuffer, blendConstants: float32): void {.stdcall.}
+  vkCmdSetBlendConstants*: proc(commandBuffer: VkCommandBuffer, blendConstants: array[4, float32]): void {.stdcall.}
   vkCmdSetDepthBounds*: proc(commandBuffer: VkCommandBuffer, minDepthBounds: float32, maxDepthBounds: float32): void {.stdcall.}
   vkCmdSetStencilCompareMask*: proc(commandBuffer: VkCommandBuffer, faceMask: VkStencilFaceFlags, compareMask: uint32): void {.stdcall.}
   vkCmdSetStencilWriteMask*: proc(commandBuffer: VkCommandBuffer, faceMask: VkStencilFaceFlags, writeMask: uint32): void {.stdcall.}
@@ -9167,7 +9706,7 @@
   vkDeviceWaitIdle = cast[proc(device: VkDevice): VkResult {.stdcall.}](vkGetInstanceProcAddr(instance, "vkDeviceWaitIdle"))
   vkAllocateMemory = cast[proc(device: VkDevice, pAllocateInfo: ptr VkMemoryAllocateInfo, pAllocator: ptr VkAllocationCallbacks, pMemory: ptr VkDeviceMemory): VkResult {.stdcall.}](vkGetInstanceProcAddr(instance, "vkAllocateMemory"))
   vkFreeMemory = cast[proc(device: VkDevice, memory: VkDeviceMemory, pAllocator: ptr VkAllocationCallbacks): void {.stdcall.}](vkGetInstanceProcAddr(instance, "vkFreeMemory"))
-  vkMapMemory = cast[proc(device: VkDevice, memory: VkDeviceMemory, offset: VkDeviceSize, size: VkDeviceSize, flags: VkMemoryMapFlags, ppData: void): VkResult {.stdcall.}](vkGetInstanceProcAddr(instance, "vkMapMemory"))
+  vkMapMemory = cast[proc(device: VkDevice, memory: VkDeviceMemory, offset: VkDeviceSize, size: VkDeviceSize, flags: VkMemoryMapFlags, ppData: ptr pointer): VkResult {.stdcall.}](vkGetInstanceProcAddr(instance, "vkMapMemory"))
   vkUnmapMemory = cast[proc(device: VkDevice, memory: VkDeviceMemory): void {.stdcall.}](vkGetInstanceProcAddr(instance, "vkUnmapMemory"))
   vkFlushMappedMemoryRanges = cast[proc(device: VkDevice, memoryRangeCount: uint32, pMemoryRanges: ptr VkMappedMemoryRange): VkResult {.stdcall.}](vkGetInstanceProcAddr(instance, "vkFlushMappedMemoryRanges"))
   vkInvalidateMappedMemoryRanges = cast[proc(device: VkDevice, memoryRangeCount: uint32, pMemoryRanges: ptr VkMappedMemoryRange): VkResult {.stdcall.}](vkGetInstanceProcAddr(instance, "vkInvalidateMappedMemoryRanges"))
@@ -9242,7 +9781,7 @@
   vkCmdSetScissor = cast[proc(commandBuffer: VkCommandBuffer, firstScissor: uint32, scissorCount: uint32, pScissors: ptr VkRect2D): void {.stdcall.}](vkGetInstanceProcAddr(instance, "vkCmdSetScissor"))
   vkCmdSetLineWidth = cast[proc(commandBuffer: VkCommandBuffer, lineWidth: float32): void {.stdcall.}](vkGetInstanceProcAddr(instance, "vkCmdSetLineWidth"))
   vkCmdSetDepthBias = cast[proc(commandBuffer: VkCommandBuffer, depthBiasConstantFactor: float32, depthBiasClamp: float32, depthBiasSlopeFactor: float32): void {.stdcall.}](vkGetInstanceProcAddr(instance, "vkCmdSetDepthBias"))
-  vkCmdSetBlendConstants = cast[proc(commandBuffer: VkCommandBuffer, blendConstants: float32): void {.stdcall.}](vkGetInstanceProcAddr(instance, "vkCmdSetBlendConstants"))
+  vkCmdSetBlendConstants = cast[proc(commandBuffer: VkCommandBuffer, blendConstants: array[4, float32]): void {.stdcall.}](vkGetInstanceProcAddr(instance, "vkCmdSetBlendConstants"))
   vkCmdSetDepthBounds = cast[proc(commandBuffer: VkCommandBuffer, minDepthBounds: float32, maxDepthBounds: float32): void {.stdcall.}](vkGetInstanceProcAddr(instance, "vkCmdSetDepthBounds"))
   vkCmdSetStencilCompareMask = cast[proc(commandBuffer: VkCommandBuffer, faceMask: VkStencilFaceFlags, compareMask: uint32): void {.stdcall.}](vkGetInstanceProcAddr(instance, "vkCmdSetStencilCompareMask"))
   vkCmdSetStencilWriteMask = cast[proc(commandBuffer: VkCommandBuffer, faceMask: VkStencilFaceFlags, writeMask: uint32): void {.stdcall.}](vkGetInstanceProcAddr(instance, "vkCmdSetStencilWriteMask"))
@@ -9785,12 +10324,12 @@
 # extension VK_KHR_fragment_shading_rate
 var
   vkGetPhysicalDeviceFragmentShadingRatesKHR*: proc(physicalDevice: VkPhysicalDevice, pFragmentShadingRateCount: ptr uint32, pFragmentShadingRates: ptr VkPhysicalDeviceFragmentShadingRateKHR): VkResult {.stdcall.}
-  vkCmdSetFragmentShadingRateKHR*: proc(commandBuffer: VkCommandBuffer, pFragmentSize: ptr VkExtent2D, combinerOps: VkFragmentShadingRateCombinerOpKHR): void {.stdcall.}
+  vkCmdSetFragmentShadingRateKHR*: proc(commandBuffer: VkCommandBuffer, pFragmentSize: ptr VkExtent2D, combinerOps: array[2, VkFragmentShadingRateCombinerOpKHR]): void {.stdcall.}
 proc loadVK_KHR_fragment_shading_rate*(instance: VkInstance) =
   loadVK_VERSION_1_2(instance)
   loadVK_VERSION_1_1(instance)
   vkGetPhysicalDeviceFragmentShadingRatesKHR = cast[proc(physicalDevice: VkPhysicalDevice, pFragmentShadingRateCount: ptr uint32, pFragmentShadingRates: ptr VkPhysicalDeviceFragmentShadingRateKHR): VkResult {.stdcall.}](vkGetInstanceProcAddr(instance, "vkGetPhysicalDeviceFragmentShadingRatesKHR"))
-  vkCmdSetFragmentShadingRateKHR = cast[proc(commandBuffer: VkCommandBuffer, pFragmentSize: ptr VkExtent2D, combinerOps: VkFragmentShadingRateCombinerOpKHR): void {.stdcall.}](vkGetInstanceProcAddr(instance, "vkCmdSetFragmentShadingRateKHR"))
+  vkCmdSetFragmentShadingRateKHR = cast[proc(commandBuffer: VkCommandBuffer, pFragmentSize: ptr VkExtent2D, combinerOps: array[2, VkFragmentShadingRateCombinerOpKHR]): void {.stdcall.}](vkGetInstanceProcAddr(instance, "vkCmdSetFragmentShadingRateKHR"))
 
 proc loadVK_EXT_depth_clip_enable*(instance: VkInstance) =
   loadVK_VERSION_1_1(instance)
@@ -9866,11 +10405,11 @@
 # extension VK_VALVE_descriptor_set_host_mapping
 var
   vkGetDescriptorSetLayoutHostMappingInfoVALVE*: proc(device: VkDevice, pBindingReference: ptr VkDescriptorSetBindingReferenceVALVE, pHostMapping: ptr VkDescriptorSetLayoutHostMappingInfoVALVE): void {.stdcall.}
-  vkGetDescriptorSetHostMappingVALVE*: proc(device: VkDevice, descriptorSet: VkDescriptorSet, ppData: void): void {.stdcall.}
+  vkGetDescriptorSetHostMappingVALVE*: proc(device: VkDevice, descriptorSet: VkDescriptorSet, ppData: ptr pointer): void {.stdcall.}
 proc loadVK_VALVE_descriptor_set_host_mapping*(instance: VkInstance) =
   loadVK_VERSION_1_1(instance)
   vkGetDescriptorSetLayoutHostMappingInfoVALVE = cast[proc(device: VkDevice, pBindingReference: ptr VkDescriptorSetBindingReferenceVALVE, pHostMapping: ptr VkDescriptorSetLayoutHostMappingInfoVALVE): void {.stdcall.}](vkGetInstanceProcAddr(instance, "vkGetDescriptorSetLayoutHostMappingInfoVALVE"))
-  vkGetDescriptorSetHostMappingVALVE = cast[proc(device: VkDevice, descriptorSet: VkDescriptorSet, ppData: void): void {.stdcall.}](vkGetInstanceProcAddr(instance, "vkGetDescriptorSetHostMappingVALVE"))
+  vkGetDescriptorSetHostMappingVALVE = cast[proc(device: VkDevice, descriptorSet: VkDescriptorSet, ppData: ptr pointer): void {.stdcall.}](vkGetInstanceProcAddr(instance, "vkGetDescriptorSetHostMappingVALVE"))
 
 # extension VK_NV_external_memory_capabilities
 var
@@ -10474,10 +11013,10 @@
 
 # extension VK_NV_fragment_shading_rate_enums
 var
-  vkCmdSetFragmentShadingRateEnumNV*: proc(commandBuffer: VkCommandBuffer, shadingRate: VkFragmentShadingRateNV, combinerOps: VkFragmentShadingRateCombinerOpKHR): void {.stdcall.}
+  vkCmdSetFragmentShadingRateEnumNV*: proc(commandBuffer: VkCommandBuffer, shadingRate: VkFragmentShadingRateNV, combinerOps: array[2, VkFragmentShadingRateCombinerOpKHR]): void {.stdcall.}
 proc loadVK_NV_fragment_shading_rate_enums*(instance: VkInstance) =
   loadVK_KHR_fragment_shading_rate(instance)
-  vkCmdSetFragmentShadingRateEnumNV = cast[proc(commandBuffer: VkCommandBuffer, shadingRate: VkFragmentShadingRateNV, combinerOps: VkFragmentShadingRateCombinerOpKHR): void {.stdcall.}](vkGetInstanceProcAddr(instance, "vkCmdSetFragmentShadingRateEnumNV"))
+  vkCmdSetFragmentShadingRateEnumNV = cast[proc(commandBuffer: VkCommandBuffer, shadingRate: VkFragmentShadingRateNV, combinerOps: array[2, VkFragmentShadingRateCombinerOpKHR]): void {.stdcall.}](vkGetInstanceProcAddr(instance, "vkCmdSetFragmentShadingRateEnumNV"))
 
 # extension VK_AMD_display_native_hdr
 var
@@ -10506,9 +11045,9 @@
 var
   vkCreateAccelerationStructureKHR*: proc(device: VkDevice, pCreateInfo: ptr VkAccelerationStructureCreateInfoKHR, pAllocator: ptr VkAllocationCallbacks, pAccelerationStructure: ptr VkAccelerationStructureKHR): VkResult {.stdcall.}
   vkDestroyAccelerationStructureKHR*: proc(device: VkDevice, accelerationStructure: VkAccelerationStructureKHR, pAllocator: ptr VkAllocationCallbacks): void {.stdcall.}
-  vkCmdBuildAccelerationStructuresKHR*: proc(commandBuffer: VkCommandBuffer, infoCount: uint32, pInfos: ptr VkAccelerationStructureBuildGeometryInfoKHR, ppBuildRangeInfos: VkAccelerationStructureBuildRangeInfoKHR): void {.stdcall.}
-  vkCmdBuildAccelerationStructuresIndirectKHR*: proc(commandBuffer: VkCommandBuffer, infoCount: uint32, pInfos: ptr VkAccelerationStructureBuildGeometryInfoKHR, pIndirectDeviceAddresses: ptr VkDeviceAddress, pIndirectStrides: ptr uint32, ppMaxPrimitiveCounts: uint32): void {.stdcall.}
-  vkBuildAccelerationStructuresKHR*: proc(device: VkDevice, deferredOperation: VkDeferredOperationKHR, infoCount: uint32, pInfos: ptr VkAccelerationStructureBuildGeometryInfoKHR, ppBuildRangeInfos: VkAccelerationStructureBuildRangeInfoKHR): VkResult {.stdcall.}
+  vkCmdBuildAccelerationStructuresKHR*: proc(commandBuffer: VkCommandBuffer, infoCount: uint32, pInfos: ptr VkAccelerationStructureBuildGeometryInfoKHR, ppBuildRangeInfos: ptr ptr VkAccelerationStructureBuildRangeInfoKHR): void {.stdcall.}
+  vkCmdBuildAccelerationStructuresIndirectKHR*: proc(commandBuffer: VkCommandBuffer, infoCount: uint32, pInfos: ptr VkAccelerationStructureBuildGeometryInfoKHR, pIndirectDeviceAddresses: ptr VkDeviceAddress, pIndirectStrides: ptr uint32, ppMaxPrimitiveCounts: ptr ptr uint32): void {.stdcall.}
+  vkBuildAccelerationStructuresKHR*: proc(device: VkDevice, deferredOperation: VkDeferredOperationKHR, infoCount: uint32, pInfos: ptr VkAccelerationStructureBuildGeometryInfoKHR, ppBuildRangeInfos: ptr ptr VkAccelerationStructureBuildRangeInfoKHR): VkResult {.stdcall.}
   vkCopyAccelerationStructureKHR*: proc(device: VkDevice, deferredOperation: VkDeferredOperationKHR, pInfo: ptr VkCopyAccelerationStructureInfoKHR): VkResult {.stdcall.}
   vkCopyAccelerationStructureToMemoryKHR*: proc(device: VkDevice, deferredOperation: VkDeferredOperationKHR, pInfo: ptr VkCopyAccelerationStructureToMemoryInfoKHR): VkResult {.stdcall.}
   vkCopyMemoryToAccelerationStructureKHR*: proc(device: VkDevice, deferredOperation: VkDeferredOperationKHR, pInfo: ptr VkCopyMemoryToAccelerationStructureInfoKHR): VkResult {.stdcall.}
@@ -10527,9 +11066,9 @@
   loadVK_KHR_deferred_host_operations(instance)
   vkCreateAccelerationStructureKHR = cast[proc(device: VkDevice, pCreateInfo: ptr VkAccelerationStructureCreateInfoKHR, pAllocator: ptr VkAllocationCallbacks, pAccelerationStructure: ptr VkAccelerationStructureKHR): VkResult {.stdcall.}](vkGetInstanceProcAddr(instance, "vkCreateAccelerationStructureKHR"))
   vkDestroyAccelerationStructureKHR = cast[proc(device: VkDevice, accelerationStructure: VkAccelerationStructureKHR, pAllocator: ptr VkAllocationCallbacks): void {.stdcall.}](vkGetInstanceProcAddr(instance, "vkDestroyAccelerationStructureKHR"))
-  vkCmdBuildAccelerationStructuresKHR = cast[proc(commandBuffer: VkCommandBuffer, infoCount: uint32, pInfos: ptr VkAccelerationStructureBuildGeometryInfoKHR, ppBuildRangeInfos: VkAccelerationStructureBuildRangeInfoKHR): void {.stdcall.}](vkGetInstanceProcAddr(instance, "vkCmdBuildAccelerationStructuresKHR"))
-  vkCmdBuildAccelerationStructuresIndirectKHR = cast[proc(commandBuffer: VkCommandBuffer, infoCount: uint32, pInfos: ptr VkAccelerationStructureBuildGeometryInfoKHR, pIndirectDeviceAddresses: ptr VkDeviceAddress, pIndirectStrides: ptr uint32, ppMaxPrimitiveCounts: uint32): void {.stdcall.}](vkGetInstanceProcAddr(instance, "vkCmdBuildAccelerationStructuresIndirectKHR"))
-  vkBuildAccelerationStructuresKHR = cast[proc(device: VkDevice, deferredOperation: VkDeferredOperationKHR, infoCount: uint32, pInfos: ptr VkAccelerationStructureBuildGeometryInfoKHR, ppBuildRangeInfos: VkAccelerationStructureBuildRangeInfoKHR): VkResult {.stdcall.}](vkGetInstanceProcAddr(instance, "vkBuildAccelerationStructuresKHR"))
+  vkCmdBuildAccelerationStructuresKHR = cast[proc(commandBuffer: VkCommandBuffer, infoCount: uint32, pInfos: ptr VkAccelerationStructureBuildGeometryInfoKHR, ppBuildRangeInfos: ptr ptr VkAccelerationStructureBuildRangeInfoKHR): void {.stdcall.}](vkGetInstanceProcAddr(instance, "vkCmdBuildAccelerationStructuresKHR"))
+  vkCmdBuildAccelerationStructuresIndirectKHR = cast[proc(commandBuffer: VkCommandBuffer, infoCount: uint32, pInfos: ptr VkAccelerationStructureBuildGeometryInfoKHR, pIndirectDeviceAddresses: ptr VkDeviceAddress, pIndirectStrides: ptr uint32, ppMaxPrimitiveCounts: ptr ptr uint32): void {.stdcall.}](vkGetInstanceProcAddr(instance, "vkCmdBuildAccelerationStructuresIndirectKHR"))
+  vkBuildAccelerationStructuresKHR = cast[proc(device: VkDevice, deferredOperation: VkDeferredOperationKHR, infoCount: uint32, pInfos: ptr VkAccelerationStructureBuildGeometryInfoKHR, ppBuildRangeInfos: ptr ptr VkAccelerationStructureBuildRangeInfoKHR): VkResult {.stdcall.}](vkGetInstanceProcAddr(instance, "vkBuildAccelerationStructuresKHR"))
   vkCopyAccelerationStructureKHR = cast[proc(device: VkDevice, deferredOperation: VkDeferredOperationKHR, pInfo: ptr VkCopyAccelerationStructureInfoKHR): VkResult {.stdcall.}](vkGetInstanceProcAddr(instance, "vkCopyAccelerationStructureKHR"))
   vkCopyAccelerationStructureToMemoryKHR = cast[proc(device: VkDevice, deferredOperation: VkDeferredOperationKHR, pInfo: ptr VkCopyAccelerationStructureToMemoryInfoKHR): VkResult {.stdcall.}](vkGetInstanceProcAddr(instance, "vkCopyAccelerationStructureToMemoryKHR"))
   vkCopyMemoryToAccelerationStructureKHR = cast[proc(device: VkDevice, deferredOperation: VkDeferredOperationKHR, pInfo: ptr VkCopyMemoryToAccelerationStructureInfoKHR): VkResult {.stdcall.}](vkGetInstanceProcAddr(instance, "vkCopyMemoryToAccelerationStructureKHR"))
@@ -11083,4 +11622,8 @@
   vkEnumerateInstanceVersion = cast[proc(pApiVersion: ptr uint32): VkResult {.stdcall.}](vkGetInstanceProcAddr(instance, "vkEnumerateInstanceVersion"))
   vkEnumerateInstanceExtensionProperties = cast[proc(pLayerName: cstring, pPropertyCount: ptr uint32, pProperties: ptr VkExtensionProperties): VkResult {.stdcall.}](vkGetInstanceProcAddr(instance, "vkEnumerateInstanceExtensionProperties"))
   vkEnumerateInstanceLayerProperties = cast[proc(pPropertyCount: ptr uint32, pProperties: ptr VkLayerProperties): VkResult {.stdcall.}](vkGetInstanceProcAddr(instance, "vkEnumerateInstanceLayerProperties"))
-  vkCreateInstance = cast[proc(pCreateInfo: ptr VkInstanceCreateInfo, pAllocator: ptr VkAllocationCallbacks, pInstance: ptr VkInstance): VkResult {.stdcall.}](vkGetInstanceProcAddr(instance, "vkCreateInstance"))
\ No newline at end of file
+  vkCreateInstance = cast[proc(pCreateInfo: ptr VkInstanceCreateInfo, pAllocator: ptr VkAllocationCallbacks, pInstance: ptr VkInstance): VkResult {.stdcall.}](vkGetInstanceProcAddr(instance, "vkCreateInstance"))
+
+converter VkBool2NimBool*(a: VkBool32): bool = a > 0
+converter NimBool2VkBool*(a: bool): VkBool32 = VkBool32(a)
+proc `$`*(x: uint32): string {.raises: [].} = addInt(result, x)
\ No newline at end of file
--- a/src/semicongine/vulkan/platform/android.nim	Thu Feb 23 00:34:38 2023 +0700
+++ b/src/semicongine/vulkan/platform/android.nim	Fri Feb 24 01:32:45 2023 +0700
@@ -69,14 +69,14 @@
 # extension VK_ANDROID_external_memory_android_hardware_buffer
 var
   vkGetAndroidHardwareBufferPropertiesANDROID*: proc(device: VkDevice, buffer: ptr AHardwareBuffer, pProperties: ptr VkAndroidHardwareBufferPropertiesANDROID): VkResult {.stdcall.}
-  vkGetMemoryAndroidHardwareBufferANDROID*: proc(device: VkDevice, pInfo: ptr VkMemoryGetAndroidHardwareBufferInfoANDROID, pBuffer: AHardwareBuffer): VkResult {.stdcall.}
+  vkGetMemoryAndroidHardwareBufferANDROID*: proc(device: VkDevice, pInfo: ptr VkMemoryGetAndroidHardwareBufferInfoANDROID, pBuffer: ptr ptr AHardwareBuffer): VkResult {.stdcall.}
 proc loadVK_ANDROID_external_memory_android_hardware_buffer*(instance: VkInstance) =
   loadVK_VERSION_1_1(instance)
   loadVK_VERSION_1_1(instance)
   loadVK_EXT_queue_family_foreign(instance)
   loadVK_VERSION_1_1(instance)
   vkGetAndroidHardwareBufferPropertiesANDROID = cast[proc(device: VkDevice, buffer: ptr AHardwareBuffer, pProperties: ptr VkAndroidHardwareBufferPropertiesANDROID): VkResult {.stdcall.}](vkGetInstanceProcAddr(instance, "vkGetAndroidHardwareBufferPropertiesANDROID"))
-  vkGetMemoryAndroidHardwareBufferANDROID = cast[proc(device: VkDevice, pInfo: ptr VkMemoryGetAndroidHardwareBufferInfoANDROID, pBuffer: AHardwareBuffer): VkResult {.stdcall.}](vkGetInstanceProcAddr(instance, "vkGetMemoryAndroidHardwareBufferANDROID"))
+  vkGetMemoryAndroidHardwareBufferANDROID = cast[proc(device: VkDevice, pInfo: ptr VkMemoryGetAndroidHardwareBufferInfoANDROID, pBuffer: ptr ptr AHardwareBuffer): VkResult {.stdcall.}](vkGetInstanceProcAddr(instance, "vkGetMemoryAndroidHardwareBufferANDROID"))
 
 # extension VK_KHR_android_surface
 var
--- a/src/semicongine/vulkan_helpers.nim	Thu Feb 23 00:34:38 2023 +0700
+++ b/src/semicongine/vulkan_helpers.nim	Fri Feb 24 01:32:45 2023 +0700
@@ -18,11 +18,6 @@
 func addrOrNil[T](obj: var openArray[T]): ptr T =
   if obj.len > 0: addr(obj[0]) else: nil
 
-func VK_MAKE_API_VERSION*(variant: uint32, major: uint32, minor: uint32,
-    patch: uint32): uint32 {.compileTime.} =
-  (variant shl 29) or (major shl 22) or (minor shl 12) or patch
-
-
 func filterForSurfaceFormat*(formats: seq[VkSurfaceFormatKHR]): seq[
     VkSurfaceFormatKHR] =
   for format in formats:
@@ -223,9 +218,9 @@
 proc debugCallback*(
   messageSeverity: VkDebugUtilsMessageSeverityFlagBitsEXT,
   messageTypes: VkDebugUtilsMessageTypeFlagsEXT,
-  pCallbackData: VkDebugUtilsMessengerCallbackDataEXT,
+  pCallbackData: ptr VkDebugUtilsMessengerCallbackDataEXT,
   userData: pointer
-): bool {.cdecl.} =
+): VkBool32 {.cdecl.} =
   echo &"{messageSeverity}: {VkDebugUtilsMessageTypeFlagBitsEXT(messageTypes)}: {pCallbackData.pMessage}"
   return false
 
--- a/src/vulkan_api/vulkan_api_generator.nim	Thu Feb 23 00:34:38 2023 +0700
+++ b/src/vulkan_api/vulkan_api_generator.nim	Fri Feb 24 01:32:45 2023 +0700
@@ -83,6 +83,48 @@
 func tableSorted(table: Table[int, string]): seq[(int, string)] =
   result = toSeq(table.pairs)
   result.sort((a, b) => cmp(a[0], b[0]))
+func findType(declNode: XmlNode): string =
+  # examples:
+  # char** -> cstringArray
+  # void* -> pointer
+  # char* -> cstring
+  #
+  # int* -> ptr int
+  # void** -> ptr pointer
+  # int** -> ptr ptr int
+  var basetype = ""
+  var apointer = ""
+  var arraylen = ""
+  for child in declNode:
+    if child.kind == xnText:
+        if "[" in child.text:
+          if "[" in child.text and "]" in child.text:
+            arraylen = child.text.strip(chars={'[', ']'}).replace("][", "*")
+          else:
+            arraylen = declNode.child("enum")[0].text
+        else:
+          for i in 0 ..< child.text.count('*'):
+            apointer = apointer & "ptr "
+    elif child.tag == "type":
+      basetype = mapType(child[0].text)
+  if basetype == "void":
+    if apointer.count("ptr ") > 0:
+      basetype = "pointer"
+      apointer = apointer[0 ..< ^4]
+  elif basetype == "char":
+    if apointer.count("ptr ") == 1:
+      basetype = "cstring"
+      apointer = ""
+    elif apointer.count("ptr ") == 2:
+      basetype = "cstringArray"
+      apointer = ""
+    elif apointer.count("ptr ") > 2:
+      basetype = "cstringArray"
+      apointer = apointer[0 ..< ^8]
+
+  result = &"{apointer}{basetype}"
+  if arraylen != "":
+    result = &"array[{arraylen}, {result}]"
 
 # serializers
 func serializeEnum(node: XmlNode, api: XmlNode): seq[string] =
@@ -174,14 +216,18 @@
 
   # generate bitsets (normal enums in the C API, but bitfield-enums in Nim)
   elif node.attr("type") == "bitmask":
+    var predefined_enum_sets: seq[string]
     for value in node.findAll("enum"):
       if value.hasAttr("bitpos"):
         values[smartParseInt(value.attr("bitpos"))] = value.attr("name")
       elif node.attr("name") == "VkVideoEncodeRateControlModeFlagBitsKHR": # special exception, for some reason this has values instead of bitpos
         values[smartParseInt(value.attr("value"))] = value.attr("name")
+      elif value.hasAttr("value"): # create a const that has multiple bits set
+        predefined_enum_sets.add &"  {value.attr(\"name\")}* = {value.attr(\"value\")}"
+
     if values.len > 0:
       if node.hasAttr("bitwidth"):
-        result.add "  " & name & "* {.size: " & $(smartParseInt(node.attr("bitwidth")) div 8) & ".} = enum"
+        result.add "  " & name & "* {.size: 8.} = enum"
       else:
         result.add "  " & name & "* {.size: sizeof(cint).} = enum"
       for (bitpos, enumvalue) in tableSorted(values):
@@ -192,19 +238,30 @@
         let enumEntry = &"    {enumvalue} = 0b{value}"
         if not (enumEntry in result): # the specs define duplicate entries for backwards compat
           result.add enumEntry
-    let cApiName = name.replace("FlagBits", "Flags")
-    if node.hasAttr("bitwidth"): # assumes this is always 64
-      if values.len > 0:
-        result.add &"""converter BitsetToNumber*(flags: openArray[{name}]): {cApiName} =
-  for flag in flags:
-    result = {cApiName}(uint64(result) or uint(flag))"""
-        result.add "type"
-    else:
-      if values.len > 0:
-        result.add &"""converter BitsetToNumber*(flags: openArray[{name}]): {cApiName} =
-  for flag in flags:
-    result = {cApiName}(uint(result) or uint(flag))"""
-        result.add "type"
+      let cApiName = name.replace("FlagBits", "Flags")
+      if node.hasAttr("bitwidth"): # assuming this attribute is always 64
+        if values.len > 0:
+          result.add &"""converter BitsetToNumber*(flags: openArray[{name}]): {cApiName} =
+    for flag in flags:
+      result = {cApiName}(int64(result) or int64(flag))"""
+          result.add &"""converter NumberToBitset*(number: {cApiName}): seq[{name}] =
+        for value in {name}.items:
+          if (value.ord and int64(number)) > 0:
+            result.add value"""
+      else:
+        if values.len > 0:
+          result.add &"""func toBits*(flags: openArray[{name}]): {cApiName} =
+    for flag in flags:
+      result = {cApiName}(uint(result) or uint(flag))"""
+          result.add &"""func toEnums*(number: {cApiName}): seq[{name}] =
+    for value in {name}.items:
+      if (value.ord and cint(number)) > 0:
+        result.add value"""
+      if predefined_enum_sets.len > 0:
+        result.add "const"
+        result.add predefined_enum_sets
+      result.add "type"
+
 
 func serializeStruct(node: XmlNode): seq[string] =
   let name = node.attr("name")
@@ -215,24 +272,7 @@
   for member in node.findAll("member"):
     if not member.hasAttr("api") or member.attr("api") == "vulkan":
       let fieldname = member.child("name")[0].text.strip(chars={'_'})
-      var fieldtype = member.child("type")[0].text.strip(chars={'_'})
-      # detect pointers
-      for child in member:
-        if child.kind == xnText and child.text.strip() == "*":
-          fieldtype = &"ptr {mapType(fieldtype)}"
-        elif child.kind == xnText and child.text.strip() == "* const*":
-          fieldtype = "cstringArray"
-      fieldtype = mapType(fieldtype)
-      # detect arrays
-      for child in member:
-        if child.kind == xnText and child.text.endsWith("]"):
-          var thelen = ""
-          if "[" in child.text:
-            thelen = child.text.strip(chars={'[', ']'}).replace("][", "*")
-          else:
-            thelen = member.child("enum")[0].text
-          fieldtype = &"array[{thelen}, {fieldtype}]"
-      result.add &"    {mapName(fieldname)}*: {fieldtype}"
+      result.add &"    {mapName(fieldname)}*: {findType(member)}"
 
 func serializeFunctiontypes(api: XmlNode): seq[string] =
   for node in api.findAll("type"):
@@ -330,11 +370,7 @@
   for param in node:
     if param.tag == "param" and param.attr("api") in ["", "vulkan"]:
       let fieldname = param.child("name")[0].text.strip(chars={'_'})
-      var fieldtype = param.child("type")[0].text.strip(chars={'_'})
-      if param[param.len - 2].kind == xnText and param[param.len - 2].text.strip() == "*":
-        fieldtype = &"ptr {mapType(fieldtype)}"
-      fieldtype = mapType(fieldtype)
-      params.add &"{mapName(fieldname)}: {fieldtype}"
+      params.add &"{mapName(fieldname)}: {findType(param)}"
   let allparams = params.join(", ")
   return (name, &"proc({allparams}): {resulttype} {{.stdcall.}}")
 
@@ -378,6 +414,11 @@
     "basetypes": @[
       "import std/dynlib",
       "import std/tables",
+      "import std/strutils",
+      "import std/logging",
+      "import std/macros",
+      "import std/private/digitsutils",
+      "from typetraits import HoleyEnum",
       "type",
       "  VkHandle* = distinct uint",
       "  VkNonDispatchableHandle* = distinct uint",
@@ -404,6 +445,13 @@
       error "Vulkan error: ", astToStr(call), " returned ", $value
       raise newException(Exception, "Vulkan error: " & astToStr(call) &
           " returned " & $value)""",
+    """
+# custom enum iteration (for enum values > 2^16)
+macro enumFullRange(a: typed): untyped =
+  newNimNode(nnkBracket).add(a.getType[1][1..^1])
+
+iterator items[T: HoleyEnum](E: typedesc[T]): T =
+  for a in enumFullRange(E): yield a""",
     ],
     "structs": @["type"],
     "enums": @["type"],
@@ -583,11 +631,13 @@
   mainout.add "  let instance = VkInstance(0)"
   for l in GLOBAL_COMMANDS:
     mainout.add procLoads[l]
-  writeFile outdir / &"api.nim", mainout.join("\n")
-
   mainout.add ""
   mainout.add "converter VkBool2NimBool*(a: VkBool32): bool = a > 0"
   mainout.add "converter NimBool2VkBool*(a: bool): VkBool32 = VkBool32(a)"
+  mainout.add "proc `$`*(x: uint32): string {.raises: [].} = addInt(result, x)"
+
+  writeFile outdir / &"api.nim", mainout.join("\n")
+
 
   for filename, filecontent in outputFiles.pairs:
     if filename.startsWith("platform/"):