Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1 | // Copyright (c) 2015 The Khronos Group Inc. |
| 2 | // |
| 3 | // Permission is hereby granted, free of charge, to any person obtaining a |
| 4 | // copy of this software and/or associated documentation files (the |
| 5 | // "Materials"), to deal in the Materials without restriction, including |
| 6 | // without limitation the rights to use, copy, modify, merge, publish, |
| 7 | // distribute, sublicense, and/or sell copies of the Materials, and to |
| 8 | // permit persons to whom the Materials are furnished to do so, subject to |
| 9 | // the following conditions: |
| 10 | // |
| 11 | // The above copyright notice and this permission notice shall be included |
| 12 | // in all copies or substantial portions of the Materials. |
| 13 | // |
| 14 | // THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
| 15 | // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 16 | // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
| 17 | // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY |
| 18 | // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, |
| 19 | // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE |
| 20 | // MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. |
| 21 | |
| 22 | import platform "platform.api" |
| 23 | |
| 24 | /////////////// |
| 25 | // Constants // |
| 26 | /////////////// |
| 27 | |
| 28 | // API version (major.minor.patch) |
| 29 | define VERSION_MAJOR 0 |
Jesse Hall | 543a7ff | 2016-01-08 16:38:30 -0800 | [diff] [blame^] | 30 | define VERSION_MINOR 221 |
Jesse Hall | f9fa9a5 | 2016-01-08 16:08:51 -0800 | [diff] [blame] | 31 | define VERSION_PATCH 0 |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 32 | |
| 33 | // API limits |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 34 | define VK_MAX_PHYSICAL_DEVICE_NAME_SIZE 256 |
| 35 | define VK_UUID_SIZE 16 |
| 36 | define VK_MAX_EXTENSION_NAME_SIZE 256 |
| 37 | define VK_MAX_DESCRIPTION_SIZE 256 |
| 38 | define VK_MAX_MEMORY_TYPES 32 |
| 39 | define VK_MAX_MEMORY_HEAPS 16 /// The maximum number of unique memory heaps, each of which supporting 1 or more memory types. |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 40 | |
| 41 | // API keywords |
| 42 | define VK_TRUE 1 |
| 43 | define VK_FALSE 0 |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 44 | |
| 45 | // API keyword, but needs special handling by some templates |
| 46 | define NULL_HANDLE 0 |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 47 | |
Jesse Hall | 543a7ff | 2016-01-08 16:38:30 -0800 | [diff] [blame^] | 48 | @extension("VK_KHR_surface") define VK_KHR_SURFACE_SPEC_VERSION 24 |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 49 | @extension("VK_KHR_surface") define VK_KHR_SURFACE_EXTENSION_NAME "VK_KHR_surface" |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 50 | |
Jesse Hall | 543a7ff | 2016-01-08 16:38:30 -0800 | [diff] [blame^] | 51 | @extension("VK_KHR_swapchain") define VK_KHR_SWAPCHAIN_SPEC_VERSION 67 |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 52 | @extension("VK_KHR_swapchain") define VK_KHR_SWAPCHAIN_EXTENSION_NAME "VK_KHR_swapchain" |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 53 | |
Jesse Hall | 543a7ff | 2016-01-08 16:38:30 -0800 | [diff] [blame^] | 54 | @extension("VK_KHR_display") define VK_KHR_DISPLAY_SPEC_VERSION 21 |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 55 | @extension("VK_KHR_display") define VK_KHR_DISPLAY_EXTENSION_NAME "VK_KHR_display" |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 56 | |
Jesse Hall | 543a7ff | 2016-01-08 16:38:30 -0800 | [diff] [blame^] | 57 | @extension("VK_KHR_display_swapchain") define VK_KHR_DISPLAY_SWAPCHAIN_SPEC_VERSION 9 |
Jesse Hall | 0e74f00 | 2015-11-30 11:37:59 -0800 | [diff] [blame] | 58 | @extension("VK_KHR_display_swapchain") define VK_KHR_DISPLAY_SWAPCHAIN_EXTENSION_NAME "VK_KHR_display_swapchain" |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 59 | |
Jesse Hall | 543a7ff | 2016-01-08 16:38:30 -0800 | [diff] [blame^] | 60 | @extension("VK_KHR_xlib_surface") define VK_KHR_XLIB_SURFACE_SPEC_VERSION 6 |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 61 | @extension("VK_KHR_xlib_surface") define VK_KHR_XLIB_SURFACE_NAME "VK_KHR_xlib_surface" |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 62 | |
Jesse Hall | 543a7ff | 2016-01-08 16:38:30 -0800 | [diff] [blame^] | 63 | @extension("VK_KHR_xcb_surface") define VK_KHR_XCB_SURFACE_SPEC_VERSION 6 |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 64 | @extension("VK_KHR_xcb_surface") define VK_KHR_XCB_SURFACE_NAME "VK_KHR_xcb_surface" |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 65 | |
Jesse Hall | 543a7ff | 2016-01-08 16:38:30 -0800 | [diff] [blame^] | 66 | @extension("VK_KHR_wayland_surface") define VK_KHR_WAYLAND_SURFACE_SPEC_VERSION 5 |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 67 | @extension("VK_KHR_wayland_surface") define VK_KHR_WAYLAND_SURFACE_NAME "VK_KHR_wayland_surface" |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 68 | |
Jesse Hall | 543a7ff | 2016-01-08 16:38:30 -0800 | [diff] [blame^] | 69 | @extension("VK_KHR_mir_surface") define VK_KHR_MIR_SURFACE_SPEC_VERSION 4 |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 70 | @extension("VK_KHR_mir_surface") define VK_KHR_MIR_SURFACE_NAME "VK_KHR_mir_surface" |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 71 | |
Jesse Hall | 543a7ff | 2016-01-08 16:38:30 -0800 | [diff] [blame^] | 72 | @extension("VK_KHR_android_surface") define VK_KHR_ANDROID_SURFACE_SPEC_VERSION 5 |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 73 | @extension("VK_KHR_android_surface") define VK_KHR_ANDROID_SURFACE_NAME "VK_KHR_android_surface" |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 74 | |
Jesse Hall | 543a7ff | 2016-01-08 16:38:30 -0800 | [diff] [blame^] | 75 | @extension("VK_KHR_win32_surface") define VK_KHR_WIN32_SURFACE_SPEC_VERSION 5 |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 76 | @extension("VK_KHR_win32_surface") define VK_KHR_WIN32_SURFACE_NAME "VK_KHR_win32_surface" |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 77 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 78 | |
| 79 | ///////////// |
| 80 | // Types // |
| 81 | ///////////// |
| 82 | |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 83 | type u32 VkBool32 |
| 84 | type u32 VkFlags |
| 85 | type u64 VkDeviceSize |
| 86 | type u32 VkSampleMask |
| 87 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 88 | /// Dispatchable handle types. |
| 89 | @dispatchHandle type u64 VkInstance |
| 90 | @dispatchHandle type u64 VkPhysicalDevice |
| 91 | @dispatchHandle type u64 VkDevice |
| 92 | @dispatchHandle type u64 VkQueue |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 93 | @dispatchHandle type u64 VkCommandBuffer |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 94 | |
| 95 | /// Non dispatchable handle types. |
| 96 | @nonDispatchHandle type u64 VkDeviceMemory |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 97 | @nonDispatchHandle type u64 VkCommandPool |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 98 | @nonDispatchHandle type u64 VkBuffer |
| 99 | @nonDispatchHandle type u64 VkBufferView |
| 100 | @nonDispatchHandle type u64 VkImage |
| 101 | @nonDispatchHandle type u64 VkImageView |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 102 | @nonDispatchHandle type u64 VkShaderModule |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 103 | @nonDispatchHandle type u64 VkPipeline |
| 104 | @nonDispatchHandle type u64 VkPipelineLayout |
| 105 | @nonDispatchHandle type u64 VkSampler |
| 106 | @nonDispatchHandle type u64 VkDescriptorSet |
| 107 | @nonDispatchHandle type u64 VkDescriptorSetLayout |
| 108 | @nonDispatchHandle type u64 VkDescriptorPool |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 109 | @nonDispatchHandle type u64 VkFence |
| 110 | @nonDispatchHandle type u64 VkSemaphore |
| 111 | @nonDispatchHandle type u64 VkEvent |
| 112 | @nonDispatchHandle type u64 VkQueryPool |
| 113 | @nonDispatchHandle type u64 VkFramebuffer |
| 114 | @nonDispatchHandle type u64 VkRenderPass |
| 115 | @nonDispatchHandle type u64 VkPipelineCache |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 116 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 117 | @extension("VK_KHR_surface") @nonDispatchHandle type u64 VkSurfaceKHR |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 118 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 119 | @extension("VK_KHR_swapchain") @nonDispatchHandle type u64 VkSwapchainKHR |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 120 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 121 | @extension("VK_KHR_display") @nonDispatchHandle type u64 VkDisplayKHR |
| 122 | @extension("VK_KHR_display") @nonDispatchHandle type u64 VkDisplayModeKHR |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 123 | |
| 124 | |
| 125 | ///////////// |
| 126 | // Enums // |
| 127 | ///////////// |
| 128 | |
| 129 | enum VkImageLayout { |
| 130 | VK_IMAGE_LAYOUT_UNDEFINED = 0x00000000, /// Implicit layout an image is when its contents are undefined due to various reasons (e.g. right after creation) |
| 131 | VK_IMAGE_LAYOUT_GENERAL = 0x00000001, /// General layout when image can be used for any kind of access |
| 132 | VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL = 0x00000002, /// Optimal layout when image is only used for color attachment read/write |
| 133 | VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL = 0x00000003, /// Optimal layout when image is only used for depth/stencil attachment read/write |
| 134 | VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL = 0x00000004, /// Optimal layout when image is used for read only depth/stencil attachment and shader access |
| 135 | VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL = 0x00000005, /// Optimal layout when image is used for read only shader access |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 136 | VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL = 0x00000006, /// Optimal layout when image is used only as source of transfer operations |
| 137 | VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL = 0x00000007, /// Optimal layout when image is used only as destination of transfer operations |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 138 | VK_IMAGE_LAYOUT_PREINITIALIZED = 0x00000008, /// Initial layout used when the data is populated by the CPU |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 139 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 140 | //@extension("VK_KHR_swapchain") |
Jesse Hall | bd88884 | 2015-11-30 21:44:14 -0800 | [diff] [blame] | 141 | VK_IMAGE_LAYOUT_PRESENT_SRC_KHR = 1000001002, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 142 | } |
| 143 | |
| 144 | enum VkAttachmentLoadOp { |
| 145 | VK_ATTACHMENT_LOAD_OP_LOAD = 0x00000000, |
| 146 | VK_ATTACHMENT_LOAD_OP_CLEAR = 0x00000001, |
| 147 | VK_ATTACHMENT_LOAD_OP_DONT_CARE = 0x00000002, |
| 148 | } |
| 149 | |
| 150 | enum VkAttachmentStoreOp { |
| 151 | VK_ATTACHMENT_STORE_OP_STORE = 0x00000000, |
| 152 | VK_ATTACHMENT_STORE_OP_DONT_CARE = 0x00000001, |
| 153 | } |
| 154 | |
| 155 | enum VkImageType { |
| 156 | VK_IMAGE_TYPE_1D = 0x00000000, |
| 157 | VK_IMAGE_TYPE_2D = 0x00000001, |
| 158 | VK_IMAGE_TYPE_3D = 0x00000002, |
| 159 | } |
| 160 | |
| 161 | enum VkImageTiling { |
Jesse Hall | c7467b7 | 2015-11-29 21:05:26 -0800 | [diff] [blame] | 162 | VK_IMAGE_TILING_OPTIMAL = 0x00000000, |
| 163 | VK_IMAGE_TILING_LINEAR = 0x00000001, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 164 | } |
| 165 | |
| 166 | enum VkImageViewType { |
| 167 | VK_IMAGE_VIEW_TYPE_1D = 0x00000000, |
| 168 | VK_IMAGE_VIEW_TYPE_2D = 0x00000001, |
| 169 | VK_IMAGE_VIEW_TYPE_3D = 0x00000002, |
| 170 | VK_IMAGE_VIEW_TYPE_CUBE = 0x00000003, |
| 171 | VK_IMAGE_VIEW_TYPE_1D_ARRAY = 0x00000004, |
| 172 | VK_IMAGE_VIEW_TYPE_2D_ARRAY = 0x00000005, |
| 173 | VK_IMAGE_VIEW_TYPE_CUBE_ARRAY = 0x00000006, |
| 174 | } |
| 175 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 176 | enum VkCommandBufferLevel { |
| 177 | VK_COMMAND_BUFFER_LEVEL_PRIMARY = 0x00000000, |
| 178 | VK_COMMAND_BUFFER_LEVEL_SECONDARY = 0x00000001, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 179 | } |
| 180 | |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 181 | enum VkComponentSwizzle { |
| 182 | VK_COMPONENT_SWIZZLE_IDENTITY = 0x00000000, |
| 183 | VK_COMPONENT_SWIZZLE_ZERO = 0x00000001, |
| 184 | VK_COMPONENT_SWIZZLE_ONE = 0x00000002, |
| 185 | VK_COMPONENT_SWIZZLE_R = 0x00000003, |
| 186 | VK_COMPONENT_SWIZZLE_G = 0x00000004, |
| 187 | VK_COMPONENT_SWIZZLE_B = 0x00000005, |
| 188 | VK_COMPONENT_SWIZZLE_A = 0x00000006, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 189 | } |
| 190 | |
| 191 | enum VkDescriptorType { |
| 192 | VK_DESCRIPTOR_TYPE_SAMPLER = 0x00000000, |
| 193 | VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER = 0x00000001, |
| 194 | VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE = 0x00000002, |
| 195 | VK_DESCRIPTOR_TYPE_STORAGE_IMAGE = 0x00000003, |
| 196 | VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER = 0x00000004, |
| 197 | VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER = 0x00000005, |
| 198 | VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER = 0x00000006, |
| 199 | VK_DESCRIPTOR_TYPE_STORAGE_BUFFER = 0x00000007, |
| 200 | VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC = 0x00000008, |
| 201 | VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC = 0x00000009, |
| 202 | VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT = 0x0000000a, |
| 203 | } |
| 204 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 205 | enum VkQueryType { |
| 206 | VK_QUERY_TYPE_OCCLUSION = 0x00000000, |
| 207 | VK_QUERY_TYPE_PIPELINE_STATISTICS = 0x00000001, /// Optional |
Jesse Hall | a3a7a1d | 2015-11-24 11:37:23 -0800 | [diff] [blame] | 208 | VK_QUERY_TYPE_TIMESTAMP = 0x00000002, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 209 | } |
| 210 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 211 | enum VkBorderColor { |
| 212 | VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK = 0x00000000, |
| 213 | VK_BORDER_COLOR_INT_TRANSPARENT_BLACK = 0x00000001, |
| 214 | VK_BORDER_COLOR_FLOAT_OPAQUE_BLACK = 0x00000002, |
| 215 | VK_BORDER_COLOR_INT_OPAQUE_BLACK = 0x00000003, |
| 216 | VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE = 0x00000004, |
| 217 | VK_BORDER_COLOR_INT_OPAQUE_WHITE = 0x00000005, |
| 218 | } |
| 219 | |
| 220 | enum VkPipelineBindPoint { |
Jesse Hall | c7467b7 | 2015-11-29 21:05:26 -0800 | [diff] [blame] | 221 | VK_PIPELINE_BIND_POINT_GRAPHICS = 0x00000000, |
| 222 | VK_PIPELINE_BIND_POINT_COMPUTE = 0x00000001, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 223 | } |
| 224 | |
| 225 | enum VkPrimitiveTopology { |
| 226 | VK_PRIMITIVE_TOPOLOGY_POINT_LIST = 0x00000000, |
| 227 | VK_PRIMITIVE_TOPOLOGY_LINE_LIST = 0x00000001, |
| 228 | VK_PRIMITIVE_TOPOLOGY_LINE_STRIP = 0x00000002, |
| 229 | VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST = 0x00000003, |
| 230 | VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP = 0x00000004, |
| 231 | VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN = 0x00000005, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 232 | VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY = 0x00000006, |
| 233 | VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY = 0x00000007, |
| 234 | VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY = 0x00000008, |
| 235 | VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY = 0x00000009, |
Jesse Hall | 091ed9e | 2015-11-30 00:55:29 -0800 | [diff] [blame] | 236 | VK_PRIMITIVE_TOPOLOGY_PATCH_LIST = 0x0000000a, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 237 | } |
| 238 | |
| 239 | enum VkSharingMode { |
| 240 | VK_SHARING_MODE_EXCLUSIVE = 0x00000000, |
| 241 | VK_SHARING_MODE_CONCURRENT = 0x00000001, |
| 242 | } |
| 243 | |
| 244 | enum VkIndexType { |
| 245 | VK_INDEX_TYPE_UINT16 = 0x00000000, |
| 246 | VK_INDEX_TYPE_UINT32 = 0x00000001, |
| 247 | } |
| 248 | |
Jesse Hall | 23ff73f | 2015-11-29 14:36:39 -0800 | [diff] [blame] | 249 | enum VkFilter { |
| 250 | VK_FILTER_NEAREST = 0x00000000, |
| 251 | VK_FILTER_LINEAR = 0x00000001, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 252 | } |
| 253 | |
Jesse Hall | 23ff73f | 2015-11-29 14:36:39 -0800 | [diff] [blame] | 254 | enum VkSamplerMipmapMode { |
| 255 | VK_SAMPLER_MIPMAP_MODE_BASE = 0x00000000, /// Always choose base level |
| 256 | VK_SAMPLER_MIPMAP_MODE_NEAREST = 0x00000001, /// Choose nearest mip level |
| 257 | VK_SAMPLER_MIPMAP_MODE_LINEAR = 0x00000002, /// Linear filter between mip levels |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 258 | } |
| 259 | |
Jesse Hall | 23ff73f | 2015-11-29 14:36:39 -0800 | [diff] [blame] | 260 | enum VkSamplerAddressMode { |
Jesse Hall | c7467b7 | 2015-11-29 21:05:26 -0800 | [diff] [blame] | 261 | VK_SAMPLER_ADDRESS_MODE_REPEAT = 0x00000000, |
| 262 | VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT = 0x00000001, |
| 263 | VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE = 0x00000002, |
| 264 | VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER = 0x00000003, |
| 265 | VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE = 0x00000004, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 266 | } |
| 267 | |
| 268 | enum VkCompareOp { |
| 269 | VK_COMPARE_OP_NEVER = 0x00000000, |
| 270 | VK_COMPARE_OP_LESS = 0x00000001, |
| 271 | VK_COMPARE_OP_EQUAL = 0x00000002, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 272 | VK_COMPARE_OP_LESS_OR_EQUAL = 0x00000003, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 273 | VK_COMPARE_OP_GREATER = 0x00000004, |
| 274 | VK_COMPARE_OP_NOT_EQUAL = 0x00000005, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 275 | VK_COMPARE_OP_GREATER_OR_EQUAL = 0x00000006, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 276 | VK_COMPARE_OP_ALWAYS = 0x00000007, |
| 277 | } |
| 278 | |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 279 | enum VkPolygonMode { |
| 280 | VK_POLYGON_MODE_FILL = 0x00000000, |
| 281 | VK_POLYGON_MODE_LINE = 0x00000001, |
| 282 | VK_POLYGON_MODE_POINT = 0x00000002, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 283 | } |
| 284 | |
| 285 | enum VkFrontFace { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 286 | VK_FRONT_FACE_COUNTER_CLOCKWISE = 0x00000000, |
| 287 | VK_FRONT_FACE_CLOCKWISE = 0x00000001, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 288 | } |
| 289 | |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 290 | enum VkBlendFactor { |
| 291 | VK_BLEND_FACTOR_ZERO = 0x00000000, |
| 292 | VK_BLEND_FACTOR_ONE = 0x00000001, |
| 293 | VK_BLEND_FACTOR_SRC_COLOR = 0x00000002, |
| 294 | VK_BLEND_FACTOR_ONE_MINUS_SRC_COLOR = 0x00000003, |
| 295 | VK_BLEND_FACTOR_DST_COLOR = 0x00000004, |
| 296 | VK_BLEND_FACTOR_ONE_MINUS_DST_COLOR = 0x00000005, |
| 297 | VK_BLEND_FACTOR_SRC_ALPHA = 0x00000006, |
| 298 | VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA = 0x00000007, |
| 299 | VK_BLEND_FACTOR_DST_ALPHA = 0x00000008, |
| 300 | VK_BLEND_FACTOR_ONE_MINUS_DST_ALPHA = 0x00000009, |
| 301 | VK_BLEND_FACTOR_CONSTANT_COLOR = 0x0000000a, |
| 302 | VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR = 0x0000000b, |
| 303 | VK_BLEND_FACTOR_CONSTANT_ALPHA = 0x0000000c, |
| 304 | VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA = 0x0000000d, |
| 305 | VK_BLEND_FACTOR_SRC_ALPHA_SATURATE = 0x0000000e, |
| 306 | VK_BLEND_FACTOR_SRC1_COLOR = 0x0000000f, |
| 307 | VK_BLEND_FACTOR_ONE_MINUS_SRC1_COLOR = 0x00000010, |
| 308 | VK_BLEND_FACTOR_SRC1_ALPHA = 0x00000011, |
| 309 | VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA = 0x00000012, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 310 | } |
| 311 | |
| 312 | enum VkBlendOp { |
| 313 | VK_BLEND_OP_ADD = 0x00000000, |
| 314 | VK_BLEND_OP_SUBTRACT = 0x00000001, |
| 315 | VK_BLEND_OP_REVERSE_SUBTRACT = 0x00000002, |
| 316 | VK_BLEND_OP_MIN = 0x00000003, |
| 317 | VK_BLEND_OP_MAX = 0x00000004, |
| 318 | } |
| 319 | |
| 320 | enum VkStencilOp { |
| 321 | VK_STENCIL_OP_KEEP = 0x00000000, |
| 322 | VK_STENCIL_OP_ZERO = 0x00000001, |
| 323 | VK_STENCIL_OP_REPLACE = 0x00000002, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 324 | VK_STENCIL_OP_INCREMENT_AND_CLAMP = 0x00000003, |
| 325 | VK_STENCIL_OP_DECREMENT_AND_CLAMP = 0x00000004, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 326 | VK_STENCIL_OP_INVERT = 0x00000005, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 327 | VK_STENCIL_OP_INCREMENT_AND_WRAP = 0x00000006, |
| 328 | VK_STENCIL_OP_DECREMENT_AND_WRAP = 0x00000007, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 329 | } |
| 330 | |
| 331 | enum VkLogicOp { |
| 332 | VK_LOGIC_OP_CLEAR = 0x00000000, |
| 333 | VK_LOGIC_OP_AND = 0x00000001, |
| 334 | VK_LOGIC_OP_AND_REVERSE = 0x00000002, |
| 335 | VK_LOGIC_OP_COPY = 0x00000003, |
| 336 | VK_LOGIC_OP_AND_INVERTED = 0x00000004, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 337 | VK_LOGIC_OP_NO_OP = 0x00000005, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 338 | VK_LOGIC_OP_XOR = 0x00000006, |
| 339 | VK_LOGIC_OP_OR = 0x00000007, |
| 340 | VK_LOGIC_OP_NOR = 0x00000008, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 341 | VK_LOGIC_OP_EQUIVALENT = 0x00000009, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 342 | VK_LOGIC_OP_INVERT = 0x0000000a, |
| 343 | VK_LOGIC_OP_OR_REVERSE = 0x0000000b, |
| 344 | VK_LOGIC_OP_COPY_INVERTED = 0x0000000c, |
| 345 | VK_LOGIC_OP_OR_INVERTED = 0x0000000d, |
| 346 | VK_LOGIC_OP_NAND = 0x0000000e, |
| 347 | VK_LOGIC_OP_SET = 0x0000000f, |
| 348 | } |
| 349 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 350 | enum VkSystemAllocationScope { |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 351 | VK_SYSTEM_ALLOCATION_SCOPE_COMMAND = 0x00000000, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 352 | VK_SYSTEM_ALLOCATION_SCOPE_OBJECT = 0x00000001, |
| 353 | VK_SYSTEM_ALLOCATION_SCOPE_CACHE = 0x00000002, |
| 354 | VK_SYSTEM_ALLOCATION_SCOPE_DEVICE = 0x00000003, |
| 355 | VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE = 0x00000004, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 356 | } |
| 357 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 358 | enum VkInternalAllocationType { |
| 359 | VK_INTERNAL_ALLOCATION_TYPE_EXECUTABLE = 0x00000000, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 360 | } |
| 361 | |
| 362 | enum VkPhysicalDeviceType { |
| 363 | VK_PHYSICAL_DEVICE_TYPE_OTHER = 0x00000000, |
| 364 | VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU = 0x00000001, |
| 365 | VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU = 0x00000002, |
| 366 | VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU = 0x00000003, |
| 367 | VK_PHYSICAL_DEVICE_TYPE_CPU = 0x00000004, |
| 368 | } |
| 369 | |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 370 | enum VkVertexInputRate { |
| 371 | VK_VERTEX_INPUT_RATE_VERTEX = 0x00000000, |
| 372 | VK_VERTEX_INPUT_RATE_INSTANCE = 0x00000001, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 373 | } |
| 374 | |
| 375 | /// Vulkan format definitions |
| 376 | enum VkFormat { |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 377 | VK_FORMAT_UNDEFINED = 0, |
| 378 | VK_FORMAT_R4G4_UNORM_PACK8 = 1, |
| 379 | VK_FORMAT_R4G4B4A4_UNORM_PACK16 = 2, |
| 380 | VK_FORMAT_B4G4R4A4_UNORM_PACK16 = 3, |
| 381 | VK_FORMAT_R5G6B5_UNORM_PACK16 = 4, |
| 382 | VK_FORMAT_B5G6R5_UNORM_PACK16 = 5, |
| 383 | VK_FORMAT_R5G5B5A1_UNORM_PACK16 = 6, |
| 384 | VK_FORMAT_B5G5R5A1_UNORM_PACK16 = 7, |
| 385 | VK_FORMAT_A1R5G5B5_UNORM_PACK16 = 8, |
| 386 | VK_FORMAT_R8_UNORM = 9, |
| 387 | VK_FORMAT_R8_SNORM = 10, |
| 388 | VK_FORMAT_R8_USCALED = 11, |
| 389 | VK_FORMAT_R8_SSCALED = 12, |
| 390 | VK_FORMAT_R8_UINT = 13, |
| 391 | VK_FORMAT_R8_SINT = 14, |
| 392 | VK_FORMAT_R8_SRGB = 15, |
| 393 | VK_FORMAT_R8G8_UNORM = 16, |
| 394 | VK_FORMAT_R8G8_SNORM = 17, |
| 395 | VK_FORMAT_R8G8_USCALED = 18, |
| 396 | VK_FORMAT_R8G8_SSCALED = 19, |
| 397 | VK_FORMAT_R8G8_UINT = 20, |
| 398 | VK_FORMAT_R8G8_SINT = 21, |
| 399 | VK_FORMAT_R8G8_SRGB = 22, |
| 400 | VK_FORMAT_R8G8B8_UNORM = 23, |
| 401 | VK_FORMAT_R8G8B8_SNORM = 24, |
| 402 | VK_FORMAT_R8G8B8_USCALED = 25, |
| 403 | VK_FORMAT_R8G8B8_SSCALED = 26, |
| 404 | VK_FORMAT_R8G8B8_UINT = 27, |
| 405 | VK_FORMAT_R8G8B8_SINT = 28, |
| 406 | VK_FORMAT_R8G8B8_SRGB = 29, |
| 407 | VK_FORMAT_B8G8R8_UNORM = 30, |
| 408 | VK_FORMAT_B8G8R8_SNORM = 31, |
| 409 | VK_FORMAT_B8G8R8_USCALED = 32, |
| 410 | VK_FORMAT_B8G8R8_SSCALED = 33, |
| 411 | VK_FORMAT_B8G8R8_UINT = 34, |
| 412 | VK_FORMAT_B8G8R8_SINT = 35, |
| 413 | VK_FORMAT_B8G8R8_SRGB = 36, |
| 414 | VK_FORMAT_R8G8B8A8_UNORM = 37, |
| 415 | VK_FORMAT_R8G8B8A8_SNORM = 38, |
| 416 | VK_FORMAT_R8G8B8A8_USCALED = 39, |
| 417 | VK_FORMAT_R8G8B8A8_SSCALED = 40, |
| 418 | VK_FORMAT_R8G8B8A8_UINT = 41, |
| 419 | VK_FORMAT_R8G8B8A8_SINT = 42, |
| 420 | VK_FORMAT_R8G8B8A8_SRGB = 43, |
| 421 | VK_FORMAT_B8G8R8A8_UNORM = 44, |
| 422 | VK_FORMAT_B8G8R8A8_SNORM = 45, |
| 423 | VK_FORMAT_B8G8R8A8_USCALED = 46, |
| 424 | VK_FORMAT_B8G8R8A8_SSCALED = 47, |
| 425 | VK_FORMAT_B8G8R8A8_UINT = 48, |
| 426 | VK_FORMAT_B8G8R8A8_SINT = 49, |
| 427 | VK_FORMAT_B8G8R8A8_SRGB = 50, |
| 428 | VK_FORMAT_A8B8G8R8_UNORM_PACK32 = 51, |
| 429 | VK_FORMAT_A8B8G8R8_SNORM_PACK32 = 52, |
| 430 | VK_FORMAT_A8B8G8R8_USCALED_PACK32 = 53, |
| 431 | VK_FORMAT_A8B8G8R8_SSCALED_PACK32 = 54, |
| 432 | VK_FORMAT_A8B8G8R8_UINT_PACK32 = 55, |
| 433 | VK_FORMAT_A8B8G8R8_SINT_PACK32 = 56, |
| 434 | VK_FORMAT_A8B8G8R8_SRGB_PACK32 = 57, |
| 435 | VK_FORMAT_A2R10G10B10_UNORM_PACK32 = 58, |
| 436 | VK_FORMAT_A2R10G10B10_SNORM_PACK32 = 59, |
| 437 | VK_FORMAT_A2R10G10B10_USCALED_PACK32 = 60, |
| 438 | VK_FORMAT_A2R10G10B10_SSCALED_PACK32 = 61, |
| 439 | VK_FORMAT_A2R10G10B10_UINT_PACK32 = 62, |
| 440 | VK_FORMAT_A2R10G10B10_SINT_PACK32 = 63, |
| 441 | VK_FORMAT_A2B10G10R10_UNORM_PACK32 = 64, |
| 442 | VK_FORMAT_A2B10G10R10_SNORM_PACK32 = 65, |
| 443 | VK_FORMAT_A2B10G10R10_USCALED_PACK32 = 66, |
| 444 | VK_FORMAT_A2B10G10R10_SSCALED_PACK32 = 67, |
| 445 | VK_FORMAT_A2B10G10R10_UINT_PACK32 = 68, |
| 446 | VK_FORMAT_A2B10G10R10_SINT_PACK32 = 69, |
| 447 | VK_FORMAT_R16_UNORM = 70, |
| 448 | VK_FORMAT_R16_SNORM = 71, |
| 449 | VK_FORMAT_R16_USCALED = 72, |
| 450 | VK_FORMAT_R16_SSCALED = 73, |
| 451 | VK_FORMAT_R16_UINT = 74, |
| 452 | VK_FORMAT_R16_SINT = 75, |
| 453 | VK_FORMAT_R16_SFLOAT = 76, |
| 454 | VK_FORMAT_R16G16_UNORM = 77, |
| 455 | VK_FORMAT_R16G16_SNORM = 78, |
| 456 | VK_FORMAT_R16G16_USCALED = 79, |
| 457 | VK_FORMAT_R16G16_SSCALED = 80, |
| 458 | VK_FORMAT_R16G16_UINT = 81, |
| 459 | VK_FORMAT_R16G16_SINT = 82, |
| 460 | VK_FORMAT_R16G16_SFLOAT = 83, |
| 461 | VK_FORMAT_R16G16B16_UNORM = 84, |
| 462 | VK_FORMAT_R16G16B16_SNORM = 85, |
| 463 | VK_FORMAT_R16G16B16_USCALED = 86, |
| 464 | VK_FORMAT_R16G16B16_SSCALED = 87, |
| 465 | VK_FORMAT_R16G16B16_UINT = 88, |
| 466 | VK_FORMAT_R16G16B16_SINT = 89, |
| 467 | VK_FORMAT_R16G16B16_SFLOAT = 90, |
| 468 | VK_FORMAT_R16G16B16A16_UNORM = 91, |
| 469 | VK_FORMAT_R16G16B16A16_SNORM = 92, |
| 470 | VK_FORMAT_R16G16B16A16_USCALED = 93, |
| 471 | VK_FORMAT_R16G16B16A16_SSCALED = 94, |
| 472 | VK_FORMAT_R16G16B16A16_UINT = 95, |
| 473 | VK_FORMAT_R16G16B16A16_SINT = 96, |
| 474 | VK_FORMAT_R16G16B16A16_SFLOAT = 97, |
| 475 | VK_FORMAT_R32_UINT = 98, |
| 476 | VK_FORMAT_R32_SINT = 99, |
| 477 | VK_FORMAT_R32_SFLOAT = 100, |
| 478 | VK_FORMAT_R32G32_UINT = 101, |
| 479 | VK_FORMAT_R32G32_SINT = 102, |
| 480 | VK_FORMAT_R32G32_SFLOAT = 103, |
| 481 | VK_FORMAT_R32G32B32_UINT = 104, |
| 482 | VK_FORMAT_R32G32B32_SINT = 105, |
| 483 | VK_FORMAT_R32G32B32_SFLOAT = 106, |
| 484 | VK_FORMAT_R32G32B32A32_UINT = 107, |
| 485 | VK_FORMAT_R32G32B32A32_SINT = 108, |
| 486 | VK_FORMAT_R32G32B32A32_SFLOAT = 109, |
| 487 | VK_FORMAT_R64_UINT = 110, |
| 488 | VK_FORMAT_R64_SINT = 111, |
| 489 | VK_FORMAT_R64_SFLOAT = 112, |
| 490 | VK_FORMAT_R64G64_UINT = 113, |
| 491 | VK_FORMAT_R64G64_SINT = 114, |
| 492 | VK_FORMAT_R64G64_SFLOAT = 115, |
| 493 | VK_FORMAT_R64G64B64_UINT = 116, |
| 494 | VK_FORMAT_R64G64B64_SINT = 117, |
| 495 | VK_FORMAT_R64G64B64_SFLOAT = 118, |
| 496 | VK_FORMAT_R64G64B64A64_UINT = 119, |
| 497 | VK_FORMAT_R64G64B64A64_SINT = 120, |
| 498 | VK_FORMAT_R64G64B64A64_SFLOAT = 121, |
| 499 | VK_FORMAT_B10G11R11_UFLOAT_PACK32 = 122, |
| 500 | VK_FORMAT_E5B9G9R9_UFLOAT_PACK32 = 123, |
| 501 | VK_FORMAT_D16_UNORM = 124, |
| 502 | VK_FORMAT_X8_D24_UNORM_PACK32 = 125, |
| 503 | VK_FORMAT_D32_SFLOAT = 126, |
| 504 | VK_FORMAT_S8_UINT = 127, |
| 505 | VK_FORMAT_D16_UNORM_S8_UINT = 128, |
| 506 | VK_FORMAT_D24_UNORM_S8_UINT = 129, |
| 507 | VK_FORMAT_D32_SFLOAT_S8_UINT = 130, |
| 508 | VK_FORMAT_BC1_RGB_UNORM_BLOCK = 131, |
| 509 | VK_FORMAT_BC1_RGB_SRGB_BLOCK = 132, |
| 510 | VK_FORMAT_BC1_RGBA_UNORM_BLOCK = 133, |
| 511 | VK_FORMAT_BC1_RGBA_SRGB_BLOCK = 134, |
| 512 | VK_FORMAT_BC2_UNORM_BLOCK = 135, |
| 513 | VK_FORMAT_BC2_SRGB_BLOCK = 136, |
| 514 | VK_FORMAT_BC3_UNORM_BLOCK = 137, |
| 515 | VK_FORMAT_BC3_SRGB_BLOCK = 138, |
| 516 | VK_FORMAT_BC4_UNORM_BLOCK = 139, |
| 517 | VK_FORMAT_BC4_SNORM_BLOCK = 140, |
| 518 | VK_FORMAT_BC5_UNORM_BLOCK = 141, |
| 519 | VK_FORMAT_BC5_SNORM_BLOCK = 142, |
| 520 | VK_FORMAT_BC6H_UFLOAT_BLOCK = 143, |
| 521 | VK_FORMAT_BC6H_SFLOAT_BLOCK = 144, |
| 522 | VK_FORMAT_BC7_UNORM_BLOCK = 145, |
| 523 | VK_FORMAT_BC7_SRGB_BLOCK = 146, |
| 524 | VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK = 147, |
| 525 | VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK = 148, |
| 526 | VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK = 149, |
| 527 | VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK = 150, |
| 528 | VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK = 151, |
| 529 | VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK = 152, |
| 530 | VK_FORMAT_EAC_R11_UNORM_BLOCK = 153, |
| 531 | VK_FORMAT_EAC_R11_SNORM_BLOCK = 154, |
| 532 | VK_FORMAT_EAC_R11G11_UNORM_BLOCK = 155, |
| 533 | VK_FORMAT_EAC_R11G11_SNORM_BLOCK = 156, |
| 534 | VK_FORMAT_ASTC_4x4_UNORM_BLOCK = 157, |
| 535 | VK_FORMAT_ASTC_4x4_SRGB_BLOCK = 158, |
| 536 | VK_FORMAT_ASTC_5x4_UNORM_BLOCK = 159, |
| 537 | VK_FORMAT_ASTC_5x4_SRGB_BLOCK = 160, |
| 538 | VK_FORMAT_ASTC_5x5_UNORM_BLOCK = 161, |
| 539 | VK_FORMAT_ASTC_5x5_SRGB_BLOCK = 162, |
| 540 | VK_FORMAT_ASTC_6x5_UNORM_BLOCK = 163, |
| 541 | VK_FORMAT_ASTC_6x5_SRGB_BLOCK = 164, |
| 542 | VK_FORMAT_ASTC_6x6_UNORM_BLOCK = 165, |
| 543 | VK_FORMAT_ASTC_6x6_SRGB_BLOCK = 166, |
| 544 | VK_FORMAT_ASTC_8x5_UNORM_BLOCK = 167, |
| 545 | VK_FORMAT_ASTC_8x5_SRGB_BLOCK = 168, |
| 546 | VK_FORMAT_ASTC_8x6_UNORM_BLOCK = 169, |
| 547 | VK_FORMAT_ASTC_8x6_SRGB_BLOCK = 170, |
| 548 | VK_FORMAT_ASTC_8x8_UNORM_BLOCK = 171, |
| 549 | VK_FORMAT_ASTC_8x8_SRGB_BLOCK = 172, |
| 550 | VK_FORMAT_ASTC_10x5_UNORM_BLOCK = 173, |
| 551 | VK_FORMAT_ASTC_10x5_SRGB_BLOCK = 174, |
| 552 | VK_FORMAT_ASTC_10x6_UNORM_BLOCK = 175, |
| 553 | VK_FORMAT_ASTC_10x6_SRGB_BLOCK = 176, |
| 554 | VK_FORMAT_ASTC_10x8_UNORM_BLOCK = 177, |
| 555 | VK_FORMAT_ASTC_10x8_SRGB_BLOCK = 178, |
| 556 | VK_FORMAT_ASTC_10x10_UNORM_BLOCK = 179, |
| 557 | VK_FORMAT_ASTC_10x10_SRGB_BLOCK = 180, |
| 558 | VK_FORMAT_ASTC_12x10_UNORM_BLOCK = 181, |
| 559 | VK_FORMAT_ASTC_12x10_SRGB_BLOCK = 182, |
| 560 | VK_FORMAT_ASTC_12x12_UNORM_BLOCK = 183, |
| 561 | VK_FORMAT_ASTC_12x12_SRGB_BLOCK = 184, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 562 | } |
| 563 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 564 | /// Structure type enumerant |
| 565 | enum VkStructureType { |
| 566 | VK_STRUCTURE_TYPE_APPLICATION_INFO = 0, |
Jesse Hall | c7467b7 | 2015-11-29 21:05:26 -0800 | [diff] [blame] | 567 | VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO = 1, |
| 568 | VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO = 2, |
| 569 | VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO = 3, |
| 570 | VK_STRUCTURE_TYPE_SUBMIT_INFO = 4, |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 571 | VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO = 5, |
Jesse Hall | c7467b7 | 2015-11-29 21:05:26 -0800 | [diff] [blame] | 572 | VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE = 6, |
| 573 | VK_STRUCTURE_TYPE_BIND_SPARSE_INFO = 7, |
| 574 | VK_STRUCTURE_TYPE_FENCE_CREATE_INFO = 8, |
| 575 | VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO = 9, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 576 | VK_STRUCTURE_TYPE_EVENT_CREATE_INFO = 10, |
Jesse Hall | c7467b7 | 2015-11-29 21:05:26 -0800 | [diff] [blame] | 577 | VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO = 11, |
| 578 | VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO = 12, |
| 579 | VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO = 13, |
| 580 | VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO = 14, |
| 581 | VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO = 15, |
| 582 | VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO = 16, |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 583 | VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO = 17, |
| 584 | VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO = 18, |
| 585 | VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO = 19, |
| 586 | VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO = 20, |
| 587 | VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO = 21, |
| 588 | VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO = 22, |
| 589 | VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO = 23, |
| 590 | VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO = 24, |
| 591 | VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO = 25, |
| 592 | VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO = 26, |
| 593 | VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO = 27, |
| 594 | VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO = 28, |
| 595 | VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO = 29, |
| 596 | VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO = 30, |
| 597 | VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO = 31, |
| 598 | VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO = 32, |
| 599 | VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO = 33, |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 600 | VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO = 34, |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 601 | VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET = 35, |
| 602 | VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET = 36, |
| 603 | VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO = 37, |
| 604 | VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO = 38, |
| 605 | VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO = 39, |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 606 | VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO = 40, |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 607 | VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO = 41, |
| 608 | VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO = 42, |
| 609 | VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER = 43, |
| 610 | VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER = 44, |
| 611 | VK_STRUCTURE_TYPE_MEMORY_BARRIER = 45, |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 612 | VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO = 46, |
| 613 | VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO = 47, |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 614 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 615 | //@extension("VK_KHR_swapchain") |
Jesse Hall | bd88884 | 2015-11-30 21:44:14 -0800 | [diff] [blame] | 616 | VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR = 1000001000, |
| 617 | VK_STRUCTURE_TYPE_PRESENT_INFO_KHR = 1000001001, |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 618 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 619 | //@extension("VK_KHR_display") |
Jesse Hall | bd88884 | 2015-11-30 21:44:14 -0800 | [diff] [blame] | 620 | VK_STRUCTURE_TYPE_DISPLAY_MODE_CREATE_INFO_KHR = 1000002000, |
| 621 | VK_STRUCTURE_TYPE_DISPLAY_SURFACE_CREATE_INFO_KHR = 1000002001, |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 622 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 623 | //@extension("VK_KHR_display_swapchain") |
Jesse Hall | bd88884 | 2015-11-30 21:44:14 -0800 | [diff] [blame] | 624 | VK_STRUCTURE_TYPE_DISPLAY_DISPLAY_PRESENT_INFO_KHR = 1000003000, |
Jesse Hall | f9fa9a5 | 2016-01-08 16:08:51 -0800 | [diff] [blame] | 625 | |
| 626 | //@extension("VK_KHR_xlib_surface") |
| 627 | VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR = 1000004000, |
| 628 | |
| 629 | //@extension("VK_KHR_xcb_surface") |
| 630 | VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR = 1000005000, |
| 631 | |
| 632 | //@extension("VK_KHR_wayland_surface") |
| 633 | VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR = 1000006000, |
| 634 | |
| 635 | //@extension("VK_KHR_mir_surface") |
| 636 | VK_STRUCTURE_TYPE_MIR_SURFACE_CREATE_INFO_KHR = 1000007000, |
| 637 | |
| 638 | //@extension("VK_KHR_android_surface") |
| 639 | VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR = 1000008000, |
| 640 | |
| 641 | //@extension("VK_KHR_win32_surface") |
| 642 | VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR = 1000009000, |
Jesse Hall | 543a7ff | 2016-01-08 16:38:30 -0800 | [diff] [blame^] | 643 | |
| 644 | //@extension("VK_EXT_debug_report") |
| 645 | VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT = 1000011000, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 646 | } |
| 647 | |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 648 | enum VkSubpassContents { |
| 649 | VK_SUBPASS_CONTENTS_INLINE = 0x00000000, |
| 650 | VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS = 0x00000001, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 651 | } |
| 652 | |
Jesse Hall | 543a7ff | 2016-01-08 16:38:30 -0800 | [diff] [blame^] | 653 | enum VkPipelineCacheHeaderVersion { |
| 654 | VK_PIPELINE_CACHE_HEADER_VERSION_ONE = 1, |
| 655 | } |
| 656 | |
Jesse Hall | bd88884 | 2015-11-30 21:44:14 -0800 | [diff] [blame] | 657 | @lastUnused(-11) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 658 | /// Error and return codes |
| 659 | enum VkResult { |
| 660 | // Return codes for successful operation execution (positive values) |
Jesse Hall | bd88884 | 2015-11-30 21:44:14 -0800 | [diff] [blame] | 661 | VK_SUCCESS = 0, |
| 662 | VK_NOT_READY = 1, |
| 663 | VK_TIMEOUT = 2, |
| 664 | VK_EVENT_SET = 3, |
| 665 | VK_EVENT_RESET = 4, |
| 666 | VK_INCOMPLETE = 5, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 667 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 668 | //@extension("VK_KHR_swapchain") |
Jesse Hall | bd88884 | 2015-11-30 21:44:14 -0800 | [diff] [blame] | 669 | VK_SUBOPTIMAL_KHR = 1000001003, |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 670 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 671 | // Error codes (negative values) |
Jesse Hall | bd88884 | 2015-11-30 21:44:14 -0800 | [diff] [blame] | 672 | VK_ERROR_OUT_OF_HOST_MEMORY = 0xFFFFFFFF, // -1 |
| 673 | VK_ERROR_OUT_OF_DEVICE_MEMORY = 0xFFFFFFFE, // -2 |
| 674 | VK_ERROR_INITIALIZATION_FAILED = 0xFFFFFFFD, // -3 |
| 675 | VK_ERROR_DEVICE_LOST = 0xFFFFFFFC, // -4 |
| 676 | VK_ERROR_MEMORY_MAP_FAILED = 0xFFFFFFFB, // -5 |
| 677 | VK_ERROR_LAYER_NOT_PRESENT = 0xFFFFFFFA, // -6 |
| 678 | VK_ERROR_EXTENSION_NOT_PRESENT = 0xFFFFFFF9, // -7 |
| 679 | VK_ERROR_FEATURE_NOT_PRESENT = 0xFFFFFFF8, // -8 |
| 680 | VK_ERROR_INCOMPATIBLE_DRIVER = 0xFFFFFFF7, // -9 |
| 681 | VK_ERROR_TOO_MANY_OBJECTS = 0xFFFFFFF6, // -10 |
| 682 | VK_ERROR_FORMAT_NOT_SUPPORTED = 0xFFFFFFF5, // -11 |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 683 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 684 | //@extension("VK_KHR_surface") |
Jesse Hall | bd88884 | 2015-11-30 21:44:14 -0800 | [diff] [blame] | 685 | VK_ERROR_SURFACE_LOST_KHR = 0xC4653600, // -1000000000 |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 686 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 687 | //@extension("VK_KHR_swapchain") |
Jesse Hall | bd88884 | 2015-11-30 21:44:14 -0800 | [diff] [blame] | 688 | VK_ERROR_OUT_OF_DATE_KHR = 0xC4653214, // -1000001004 |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 689 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 690 | //@extension("VK_KHR_display_swapchain") |
Jesse Hall | bd88884 | 2015-11-30 21:44:14 -0800 | [diff] [blame] | 691 | VK_ERROR_INCOMPATIBLE_DISPLAY_KHR = 0xC4652A47, // -1000003001 |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 692 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 693 | //@extension("VK_KHR_android_surface") |
Jesse Hall | bd88884 | 2015-11-30 21:44:14 -0800 | [diff] [blame] | 694 | VK_ERROR_NATIVE_WINDOW_IN_USE_KHR = 0xC46516C0, // -1000008000 |
Jesse Hall | 543a7ff | 2016-01-08 16:38:30 -0800 | [diff] [blame^] | 695 | |
| 696 | //@extension("VK_EXT_debug_report") |
| 697 | VK_ERROR_VALIDATION_FAILED_EXT = 0xC4650B07, // -1000011001 |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 698 | } |
| 699 | |
| 700 | enum VkDynamicState { |
| 701 | VK_DYNAMIC_STATE_VIEWPORT = 0x00000000, |
| 702 | VK_DYNAMIC_STATE_SCISSOR = 0x00000001, |
| 703 | VK_DYNAMIC_STATE_LINE_WIDTH = 0x00000002, |
| 704 | VK_DYNAMIC_STATE_DEPTH_BIAS = 0x00000003, |
| 705 | VK_DYNAMIC_STATE_BLEND_CONSTANTS = 0x00000004, |
| 706 | VK_DYNAMIC_STATE_DEPTH_BOUNDS = 0x00000005, |
| 707 | VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK = 0x00000006, |
| 708 | VK_DYNAMIC_STATE_STENCIL_WRITE_MASK = 0x00000007, |
| 709 | VK_DYNAMIC_STATE_STENCIL_REFERENCE = 0x00000008, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 710 | } |
| 711 | |
Jesse Hall | 523db34 | 2015-11-30 21:12:55 -0800 | [diff] [blame] | 712 | @extension("VK_KHR_surface") |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 713 | enum VkPresentModeKHR { |
| 714 | VK_PRESENT_MODE_IMMEDIATE_KHR = 0x00000000, |
| 715 | VK_PRESENT_MODE_MAILBOX_KHR = 0x00000001, |
| 716 | VK_PRESENT_MODE_FIFO_KHR = 0x00000002, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 717 | VK_PRESENT_MODE_FIFO_RELAXED_KHR = 0x00000003, |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 718 | } |
| 719 | |
Jesse Hall | 523db34 | 2015-11-30 21:12:55 -0800 | [diff] [blame] | 720 | @extension("VK_KHR_surface") |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 721 | enum VkColorSpaceKHR { |
| 722 | VK_COLORSPACE_SRGB_NONLINEAR_KHR = 0x00000000, |
| 723 | } |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 724 | |
| 725 | ///////////////// |
| 726 | // Bitfields // |
| 727 | ///////////////// |
| 728 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 729 | /// Queue capabilities |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 730 | type VkFlags VkQueueFlags |
| 731 | bitfield VkQueueFlagBits { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 732 | VK_QUEUE_GRAPHICS_BIT = 0x00000001, /// Queue supports graphics operations |
| 733 | VK_QUEUE_COMPUTE_BIT = 0x00000002, /// Queue supports compute operations |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 734 | VK_QUEUE_TRANSFER_BIT = 0x00000004, /// Queue supports transfer operations |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 735 | VK_QUEUE_SPARSE_BINDING_BIT = 0x00000008, /// Queue supports sparse resource memory management operations |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 736 | } |
| 737 | |
| 738 | /// Memory properties passed into vkAllocMemory(). |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 739 | type VkFlags VkMemoryPropertyFlags |
| 740 | bitfield VkMemoryPropertyFlagBits { |
Jesse Hall | d1af812 | 2015-11-29 23:50:38 -0800 | [diff] [blame] | 741 | VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT = 0x00000001, |
| 742 | VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT = 0x00000002, |
| 743 | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT = 0x00000004, |
| 744 | VK_MEMORY_PROPERTY_HOST_CACHED_BIT = 0x00000008, |
| 745 | VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT = 0x00000010, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 746 | } |
| 747 | |
| 748 | /// Memory heap flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 749 | type VkFlags VkMemoryHeapFlags |
| 750 | bitfield VkMemoryHeapFlagBits { |
Jesse Hall | d1af812 | 2015-11-29 23:50:38 -0800 | [diff] [blame] | 751 | VK_MEMORY_HEAP_DEVICE_LOCAL_BIT = 0x00000001, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 752 | } |
| 753 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 754 | /// Access flags |
| 755 | type VkFlags VkAccessFlags |
| 756 | bitfield VkAccessFlagBits { |
| 757 | VK_ACCESS_INDIRECT_COMMAND_READ_BIT = 0x00000001, |
| 758 | VK_ACCESS_INDEX_READ_BIT = 0x00000002, |
| 759 | VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT = 0x00000004, |
| 760 | VK_ACCESS_UNIFORM_READ_BIT = 0x00000008, |
| 761 | VK_ACCESS_INPUT_ATTACHMENT_READ_BIT = 0x00000010, |
| 762 | VK_ACCESS_SHADER_READ_BIT = 0x00000020, |
| 763 | VK_ACCESS_SHADER_WRITE_BIT = 0x00000040, |
| 764 | VK_ACCESS_COLOR_ATTACHMENT_READ_BIT = 0x00000080, |
| 765 | VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT = 0x00000100, |
| 766 | VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT = 0x00000200, |
| 767 | VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT = 0x00000400, |
| 768 | VK_ACCESS_TRANSFER_READ_BIT = 0x00000800, |
| 769 | VK_ACCESS_TRANSFER_WRITE_BIT = 0x00001000, |
| 770 | VK_ACCESS_HOST_READ_BIT = 0x00002000, |
| 771 | VK_ACCESS_HOST_WRITE_BIT = 0x00004000, |
| 772 | VK_ACCESS_MEMORY_READ_BIT = 0x00008000, |
| 773 | VK_ACCESS_MEMORY_WRITE_BIT = 0x00010000, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 774 | } |
| 775 | |
| 776 | /// Buffer usage flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 777 | type VkFlags VkBufferUsageFlags |
| 778 | bitfield VkBufferUsageFlagBits { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 779 | VK_BUFFER_USAGE_TRANSFER_SRC_BIT = 0x00000001, /// Can be used as a source of transfer operations |
| 780 | VK_BUFFER_USAGE_TRANSFER_DST_BIT = 0x00000002, /// Can be used as a destination of transfer operations |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 781 | VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000004, /// Can be used as TBO |
| 782 | VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT = 0x00000008, /// Can be used as IBO |
| 783 | VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT = 0x00000010, /// Can be used as UBO |
| 784 | VK_BUFFER_USAGE_STORAGE_BUFFER_BIT = 0x00000020, /// Can be used as SSBO |
| 785 | VK_BUFFER_USAGE_INDEX_BUFFER_BIT = 0x00000040, /// Can be used as source of fixed function index fetch (index buffer) |
| 786 | VK_BUFFER_USAGE_VERTEX_BUFFER_BIT = 0x00000080, /// Can be used as source of fixed function vertex fetch (VBO) |
| 787 | VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT = 0x00000100, /// Can be the source of indirect parameters (e.g. indirect buffer, parameter buffer) |
| 788 | } |
| 789 | |
| 790 | /// Buffer creation flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 791 | type VkFlags VkBufferCreateFlags |
| 792 | bitfield VkBufferCreateFlagBits { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 793 | VK_BUFFER_CREATE_SPARSE_BINDING_BIT = 0x00000001, /// Buffer should support sparse backing |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 794 | VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002, /// Buffer should support sparse backing with partial residency |
| 795 | VK_BUFFER_CREATE_SPARSE_ALIASED_BIT = 0x00000004, /// Buffer should support constent data access to physical memory blocks mapped into multiple locations of sparse buffers |
| 796 | } |
| 797 | |
| 798 | /// Shader stage flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 799 | type VkFlags VkShaderStageFlags |
| 800 | bitfield VkShaderStageFlagBits { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 801 | VK_SHADER_STAGE_VERTEX_BIT = 0x00000001, |
Jesse Hall | ae38f73 | 2015-11-19 21:32:50 -0800 | [diff] [blame] | 802 | VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT = 0x00000002, |
| 803 | VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT = 0x00000004, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 804 | VK_SHADER_STAGE_GEOMETRY_BIT = 0x00000008, |
| 805 | VK_SHADER_STAGE_FRAGMENT_BIT = 0x00000010, |
| 806 | VK_SHADER_STAGE_COMPUTE_BIT = 0x00000020, |
Jesse Hall | c7467b7 | 2015-11-29 21:05:26 -0800 | [diff] [blame] | 807 | VK_SHADER_STAGE_ALL_GRAPHICS = 0x0000001F, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 808 | |
| 809 | VK_SHADER_STAGE_ALL = 0x7FFFFFFF, |
| 810 | } |
| 811 | |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 812 | /// Descriptor pool create flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 813 | type VkFlags VkDescriptorPoolCreateFlags |
| 814 | bitfield VkDescriptorPoolCreateFlagBits { |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 815 | VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT = 0x00000001, |
| 816 | } |
| 817 | |
| 818 | /// Descriptor pool reset flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 819 | type VkFlags VkDescriptorPoolResetFlags |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 820 | //bitfield VkDescriptorPoolResetFlagBits { |
| 821 | //} |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 822 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 823 | /// Image usage flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 824 | type VkFlags VkImageUsageFlags |
| 825 | bitfield VkImageUsageFlagBits { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 826 | VK_IMAGE_USAGE_TRANSFER_SRC_BIT = 0x00000001, /// Can be used as a source of transfer operations |
| 827 | VK_IMAGE_USAGE_TRANSFER_DST_BIT = 0x00000002, /// Can be used as a destination of transfer operations |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 828 | VK_IMAGE_USAGE_SAMPLED_BIT = 0x00000004, /// Can be sampled from (SAMPLED_IMAGE and COMBINED_IMAGE_SAMPLER descriptor types) |
| 829 | VK_IMAGE_USAGE_STORAGE_BIT = 0x00000008, /// Can be used as storage image (STORAGE_IMAGE descriptor type) |
| 830 | VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT = 0x00000010, /// Can be used as framebuffer color attachment |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 831 | VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000020, /// Can be used as framebuffer depth/stencil attachment |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 832 | VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT = 0x00000040, /// Image data not needed outside of rendering |
| 833 | VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT = 0x00000080, /// Can be used as framebuffer input attachment |
| 834 | } |
| 835 | |
| 836 | /// Image creation flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 837 | type VkFlags VkImageCreateFlags |
| 838 | bitfield VkImageCreateFlagBits { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 839 | VK_IMAGE_CREATE_SPARSE_BINDING_BIT = 0x00000001, /// Image should support sparse backing |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 840 | VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002, /// Image should support sparse backing with partial residency |
| 841 | VK_IMAGE_CREATE_SPARSE_ALIASED_BIT = 0x00000004, /// Image should support constent data access to physical memory blocks mapped into multiple locations of sparse images |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 842 | VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT = 0x00000008, /// Allows image views to have different format than the base image |
| 843 | VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT = 0x00000010, /// Allows creating image views with cube type from the created image |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 844 | } |
| 845 | |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 846 | /// Image view creation flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 847 | type VkFlags VkImageViewCreateFlags |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 848 | //bitfield VkImageViewCreateFlagBits { |
| 849 | //} |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 850 | |
| 851 | /// Pipeline creation flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 852 | type VkFlags VkPipelineCreateFlags |
| 853 | bitfield VkPipelineCreateFlagBits { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 854 | VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT = 0x00000001, |
| 855 | VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT = 0x00000002, |
| 856 | VK_PIPELINE_CREATE_DERIVATIVE_BIT = 0x00000004, |
| 857 | } |
| 858 | |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 859 | /// Color component flags |
| 860 | type VkFlags VkColorComponentFlags |
| 861 | bitfield VkColorComponentFlagBits { |
| 862 | VK_COLOR_COMPONENT_R_BIT = 0x00000001, |
| 863 | VK_COLOR_COMPONENT_G_BIT = 0x00000002, |
| 864 | VK_COLOR_COMPONENT_B_BIT = 0x00000004, |
| 865 | VK_COLOR_COMPONENT_A_BIT = 0x00000008, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 866 | } |
| 867 | |
| 868 | /// Fence creation flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 869 | type VkFlags VkFenceCreateFlags |
| 870 | bitfield VkFenceCreateFlagBits { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 871 | VK_FENCE_CREATE_SIGNALED_BIT = 0x00000001, |
| 872 | } |
| 873 | |
| 874 | /// Semaphore creation flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 875 | type VkFlags VkSemaphoreCreateFlags |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 876 | //bitfield VkSemaphoreCreateFlagBits { |
| 877 | //} |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 878 | |
| 879 | /// Format capability flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 880 | type VkFlags VkFormatFeatureFlags |
| 881 | bitfield VkFormatFeatureFlagBits { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 882 | VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT = 0x00000001, /// Format can be used for sampled images (SAMPLED_IMAGE and COMBINED_IMAGE_SAMPLER descriptor types) |
| 883 | VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT = 0x00000002, /// Format can be used for storage images (STORAGE_IMAGE descriptor type) |
| 884 | VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT = 0x00000004, /// Format supports atomic operations in case it's used for storage images |
| 885 | VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000008, /// Format can be used for uniform texel buffers (TBOs) |
| 886 | VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT = 0x00000010, /// Format can be used for storage texel buffers (IBOs) |
| 887 | VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT = 0x00000020, /// Format supports atomic operations in case it's used for storage texel buffers |
| 888 | VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT = 0x00000040, /// Format can be used for vertex buffers (VBOs) |
| 889 | VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT = 0x00000080, /// Format can be used for color attachment images |
| 890 | VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT = 0x00000100, /// Format supports blending in case it's used for color attachment images |
| 891 | VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000200, /// Format can be used for depth/stencil attachment images |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 892 | VK_FORMAT_FEATURE_BLIT_SRC_BIT = 0x00000400, /// Format can be used as the source image of blits with vkCommandBlitImage |
| 893 | VK_FORMAT_FEATURE_BLIT_DST_BIT = 0x00000800, /// Format can be used as the destination image of blits with vkCommandBlitImage |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 894 | } |
| 895 | |
| 896 | /// Query control flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 897 | type VkFlags VkQueryControlFlags |
| 898 | bitfield VkQueryControlFlagBits { |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 899 | VK_QUERY_CONTROL_PRECISE_BIT = 0x00000001, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 900 | } |
| 901 | |
| 902 | /// Query result flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 903 | type VkFlags VkQueryResultFlags |
| 904 | bitfield VkQueryResultFlagBits { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 905 | VK_QUERY_RESULT_64_BIT = 0x00000001, /// Results of the queries are written to the destination buffer as 64-bit values |
| 906 | VK_QUERY_RESULT_WAIT_BIT = 0x00000002, /// Results of the queries are waited on before proceeding with the result copy |
| 907 | VK_QUERY_RESULT_WITH_AVAILABILITY_BIT = 0x00000004, /// Besides the results of the query, the availability of the results is also written |
| 908 | VK_QUERY_RESULT_PARTIAL_BIT = 0x00000008, /// Copy the partial results of the query even if the final results aren't available |
| 909 | } |
| 910 | |
| 911 | /// Shader module creation flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 912 | type VkFlags VkShaderModuleCreateFlags |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 913 | //bitfield VkShaderModuleCreateFlagBits { |
| 914 | //} |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 915 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 916 | /// Event creation flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 917 | type VkFlags VkEventCreateFlags |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 918 | //bitfield VkEventCreateFlagBits { |
| 919 | //} |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 920 | |
Jesse Hall | a15a4bf | 2015-11-19 22:48:02 -0800 | [diff] [blame] | 921 | /// Command buffer usage flags |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 922 | type VkFlags VkCommandBufferUsageFlags |
| 923 | bitfield VkCommandBufferUsageFlagBits { |
| 924 | VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT = 0x00000001, |
| 925 | VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT = 0x00000002, |
| 926 | VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT = 0x00000004, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 927 | } |
| 928 | |
| 929 | /// Pipeline statistics flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 930 | type VkFlags VkQueryPipelineStatisticFlags |
| 931 | bitfield VkQueryPipelineStatisticFlagBits { |
Jesse Hall | ae38f73 | 2015-11-19 21:32:50 -0800 | [diff] [blame] | 932 | VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_BIT = 0x00000001, /// Optional |
| 933 | VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_PRIMITIVES_BIT = 0x00000002, /// Optional |
| 934 | VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT = 0x00000004, /// Optional |
| 935 | VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_INVOCATIONS_BIT = 0x00000008, /// Optional |
| 936 | VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT = 0x00000010, /// Optional |
| 937 | VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT = 0x00000020, /// Optional |
| 938 | VK_QUERY_PIPELINE_STATISTIC_CLIPPING_PRIMITIVES_BIT = 0x00000040, /// Optional |
| 939 | VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT = 0x00000080, /// Optional |
| 940 | VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT = 0x00000100, /// Optional |
| 941 | VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT = 0x00000200, /// Optional |
| 942 | VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT = 0x00000400, /// Optional |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 943 | } |
| 944 | |
| 945 | /// Memory mapping flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 946 | type VkFlags VkMemoryMapFlags |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 947 | //bitfield VkMemoryMapFlagBits { |
| 948 | //} |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 949 | |
| 950 | /// Bitfield of image aspects |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 951 | type VkFlags VkImageAspectFlags |
| 952 | bitfield VkImageAspectFlagBits { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 953 | VK_IMAGE_ASPECT_COLOR_BIT = 0x00000001, |
| 954 | VK_IMAGE_ASPECT_DEPTH_BIT = 0x00000002, |
| 955 | VK_IMAGE_ASPECT_STENCIL_BIT = 0x00000004, |
| 956 | VK_IMAGE_ASPECT_METADATA_BIT = 0x00000008, |
| 957 | } |
| 958 | |
| 959 | /// Sparse memory bind flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 960 | type VkFlags VkSparseMemoryBindFlags |
Jesse Hall | 091ed9e | 2015-11-30 00:55:29 -0800 | [diff] [blame] | 961 | bitfield VkSparseMemoryBindFlagBits { |
| 962 | VK_SPARSE_MEMORY_BIND_METADATA_BIT = 0x00000001, |
| 963 | } |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 964 | |
| 965 | /// Sparse image memory requirements flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 966 | type VkFlags VkSparseImageFormatFlags |
| 967 | bitfield VkSparseImageFormatFlagBits { |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 968 | VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT = 0x00000001, /// Image uses a single miptail region for all array slices |
| 969 | VK_SPARSE_IMAGE_FORMAT_ALIGNED_MIP_SIZE_BIT = 0x00000002, /// Image requires mip levels to be an exact multiple of the sparse iamge block size for non-mip-tail levels. |
| 970 | VK_SPARSE_IMAGE_FORMAT_NONSTANDARD_BLOCK_SIZE_BIT = 0x00000004, /// Image uses a non-standard sparse block size |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 971 | } |
| 972 | |
| 973 | /// Pipeline stages |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 974 | type VkFlags VkPipelineStageFlags |
| 975 | bitfield VkPipelineStageFlagBits { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 976 | VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT = 0x00000001, /// Before subsequent commands are processed |
| 977 | VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT = 0x00000002, /// Draw/DispatchIndirect command fetch |
| 978 | VK_PIPELINE_STAGE_VERTEX_INPUT_BIT = 0x00000004, /// Vertex/index fetch |
| 979 | VK_PIPELINE_STAGE_VERTEX_SHADER_BIT = 0x00000008, /// Vertex shading |
Jesse Hall | ae38f73 | 2015-11-19 21:32:50 -0800 | [diff] [blame] | 980 | VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT = 0x00000010, /// Tessellation control shading |
| 981 | VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT = 0x00000020, /// Tessellation evaluation shading |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 982 | VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT = 0x00000040, /// Geometry shading |
| 983 | VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT = 0x00000080, /// Fragment shading |
| 984 | VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT = 0x00000100, /// Early fragment (depth/stencil) tests |
| 985 | VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT = 0x00000200, /// Late fragment (depth/stencil) tests |
| 986 | VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT = 0x00000400, /// Color attachment writes |
| 987 | VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT = 0x00000800, /// Compute shading |
| 988 | VK_PIPELINE_STAGE_TRANSFER_BIT = 0x00001000, /// Transfer/copy operations |
Jesse Hall | 543a7ff | 2016-01-08 16:38:30 -0800 | [diff] [blame^] | 989 | VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT = 0x00002000, |
| 990 | VK_PIPELINE_STAGE_HOST_BIT = 0x00004000, /// Indicates host (CPU) is a source/sink of the dependency |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 991 | |
Jesse Hall | 543a7ff | 2016-01-08 16:38:30 -0800 | [diff] [blame^] | 992 | VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT = 0x00008000, /// All stages of the graphics pipeline |
| 993 | VK_PIPELINE_STAGE_ALL_COMMANDS_BIT = 0x00010000, /// All graphics, compute, copy, and transition commands |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 994 | } |
| 995 | |
| 996 | /// Render pass attachment description flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 997 | type VkFlags VkAttachmentDescriptionFlags |
| 998 | bitfield VkAttachmentDescriptionFlagBits { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 999 | VK_ATTACHMENT_DESCRIPTION_MAY_ALIAS_BIT = 0x00000001, /// The attachment may alias physical memory of another attachment in the same renderpass |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1000 | } |
| 1001 | |
| 1002 | /// Subpass description flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1003 | type VkFlags VkSubpassDescriptionFlags |
| 1004 | bitfield VkSubpassDescriptionFlagBits { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1005 | } |
| 1006 | |
| 1007 | /// Command pool creation flags |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1008 | type VkFlags VkCommandPoolCreateFlags |
| 1009 | bitfield VkCommandPoolCreateFlagBits { |
| 1010 | VK_COMMAND_POOL_CREATE_TRANSIENT_BIT = 0x00000001, /// Command buffers have a short lifetime |
| 1011 | VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT = 0x00000002, /// Command buffers may release their memory individually |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1012 | } |
| 1013 | |
| 1014 | /// Command pool reset flags |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1015 | type VkFlags VkCommandPoolResetFlags |
| 1016 | bitfield VkCommandPoolResetFlagBits { |
| 1017 | VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT = 0x00000001, /// Release resources owned by the pool |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1018 | } |
| 1019 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1020 | type VkFlags VkCommandBufferResetFlags |
| 1021 | bitfield VkCommandBufferResetFlagBits { |
| 1022 | VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT = 0x00000001, /// Release resources owned by the buffer |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1023 | } |
| 1024 | |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1025 | type VkFlags VkSampleCountFlags |
| 1026 | bitfield VkSampleCountFlagBits { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1027 | VK_SAMPLE_COUNT_1_BIT = 0x00000001, |
| 1028 | VK_SAMPLE_COUNT_2_BIT = 0x00000002, |
| 1029 | VK_SAMPLE_COUNT_4_BIT = 0x00000004, |
| 1030 | VK_SAMPLE_COUNT_8_BIT = 0x00000008, |
| 1031 | VK_SAMPLE_COUNT_16_BIT = 0x00000010, |
| 1032 | VK_SAMPLE_COUNT_32_BIT = 0x00000020, |
| 1033 | VK_SAMPLE_COUNT_64_BIT = 0x00000040, |
| 1034 | } |
| 1035 | |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1036 | type VkFlags VkStencilFaceFlags |
| 1037 | bitfield VkStencilFaceFlagBits { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1038 | VK_STENCIL_FACE_FRONT_BIT = 0x00000001, /// Front face |
| 1039 | VK_STENCIL_FACE_BACK_BIT = 0x00000002, /// Back face |
Jesse Hall | c7467b7 | 2015-11-29 21:05:26 -0800 | [diff] [blame] | 1040 | VK_STENCIL_FRONT_AND_BACK = 0x00000003, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1041 | } |
| 1042 | |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 1043 | /// Instance creation flags |
| 1044 | type VkFlags VkInstanceCreateFlags |
| 1045 | //bitfield VkInstanceCreateFlagBits { |
| 1046 | //} |
| 1047 | |
| 1048 | /// Device creation flags |
| 1049 | type VkFlags VkDeviceCreateFlags |
| 1050 | //bitfield VkDeviceCreateFlagBits { |
| 1051 | //} |
| 1052 | |
| 1053 | /// Device queue creation flags |
| 1054 | type VkFlags VkDeviceQueueCreateFlags |
| 1055 | //bitfield VkDeviceQueueCreateFlagBits { |
| 1056 | //} |
| 1057 | |
| 1058 | /// Query pool creation flags |
| 1059 | type VkFlags VkQueryPoolCreateFlags |
| 1060 | //bitfield VkQueryPoolCreateFlagBits { |
| 1061 | //} |
| 1062 | |
| 1063 | /// Buffer view creation flags |
| 1064 | type VkFlags VkBufferViewCreateFlags |
| 1065 | //bitfield VkBufferViewCreateFlagBits { |
| 1066 | //} |
| 1067 | |
| 1068 | /// Pipeline cache creation flags |
| 1069 | type VkFlags VkPipelineCacheCreateFlags |
| 1070 | //bitfield VkPipelineCacheCreateFlagBits { |
| 1071 | //} |
| 1072 | |
| 1073 | /// Pipeline shader stage creation flags |
| 1074 | type VkFlags VkPipelineShaderStageCreateFlags |
| 1075 | //bitfield VkPipelineShaderStageCreateFlagBits { |
| 1076 | //} |
| 1077 | |
| 1078 | /// Descriptor set layout creation flags |
| 1079 | type VkFlags VkDescriptorSetLayoutCreateFlags |
| 1080 | //bitfield VkDescriptorSetLayoutCreateFlagBits { |
| 1081 | //} |
| 1082 | |
| 1083 | /// Pipeline vertex input state creation flags |
| 1084 | type VkFlags VkPipelineVertexInputStateCreateFlags |
| 1085 | //bitfield VkPipelineVertexInputStateCreateFlagBits { |
| 1086 | //} |
| 1087 | |
| 1088 | /// Pipeline input assembly state creation flags |
| 1089 | type VkFlags VkPipelineInputAssemblyStateCreateFlags |
| 1090 | //bitfield VkPipelineInputAssemblyStateCreateFlagBits { |
| 1091 | //} |
| 1092 | |
| 1093 | /// Tessellation state creation flags |
| 1094 | type VkFlags VkPipelineTessellationStateCreateFlags |
| 1095 | //bitfield VkPipelineTessellationStateCreateFlagBits { |
| 1096 | //} |
| 1097 | |
| 1098 | /// Viewport state creation flags |
| 1099 | type VkFlags VkPipelineViewportStateCreateFlags |
| 1100 | //bitfield VkPipelineViewportStateCreateFlagBits { |
| 1101 | //} |
| 1102 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1103 | /// Rasterization state creation flags |
| 1104 | type VkFlags VkPipelineRasterizationStateCreateFlags |
| 1105 | //bitfield VkPipelineRasterizationStateCreateFlagBits { |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 1106 | //} |
| 1107 | |
| 1108 | /// Multisample state creation flags |
| 1109 | type VkFlags VkPipelineMultisampleStateCreateFlags |
| 1110 | //bitfield VkPipelineMultisampleStateCreateFlagBits { |
| 1111 | //} |
| 1112 | |
| 1113 | /// Color blend state creation flags |
| 1114 | type VkFlags VkPipelineColorBlendStateCreateFlags |
| 1115 | //bitfield VkPipelineColorBlendStateCreateFlagBits { |
| 1116 | //} |
| 1117 | |
| 1118 | /// Depth/stencil state creation flags |
| 1119 | type VkFlags VkPipelineDepthStencilStateCreateFlags |
| 1120 | //bitfield VkPipelineDepthStencilStateCreateFlagBits { |
| 1121 | //} |
| 1122 | |
| 1123 | /// Dynamic state creation flags |
| 1124 | type VkFlags VkPipelineDynamicStateCreateFlags |
| 1125 | //bitfield VkPipelineDynamicStateCreateFlagBits { |
| 1126 | //} |
| 1127 | |
| 1128 | /// Pipeline layout creation flags |
| 1129 | type VkFlags VkPipelineLayoutCreateFlags |
| 1130 | //bitfield VkPipelineLayoutCreateFlagBits { |
| 1131 | //} |
| 1132 | |
| 1133 | /// Sampler creation flags |
| 1134 | type VkFlags VkSamplerCreateFlags |
| 1135 | //bitfield VkSamplerCreateFlagBits { |
| 1136 | //} |
| 1137 | |
| 1138 | /// Render pass creation flags |
| 1139 | type VkFlags VkRenderPassCreateFlags |
| 1140 | //bitfield VkRenderPassCreateFlagBits { |
| 1141 | //} |
| 1142 | |
| 1143 | /// Framebuffer creation flags |
| 1144 | type VkFlags VkFramebufferCreateFlags |
| 1145 | //bitfield VkFramebufferCreateFlagBits { |
| 1146 | //} |
| 1147 | |
Jesse Hall | dc6d36c | 2015-11-29 19:12:15 -0800 | [diff] [blame] | 1148 | /// Dependency flags |
| 1149 | type VkFlags VkDependencyFlags |
| 1150 | bitfield VkDependencyFlagBits { |
| 1151 | VK_DEPENDENCY_BY_REGION_BIT = 0x00000001, |
| 1152 | } |
| 1153 | |
Jesse Hall | c7467b7 | 2015-11-29 21:05:26 -0800 | [diff] [blame] | 1154 | /// Cull mode flags |
| 1155 | type VkFlags VkCullModeFlags |
| 1156 | bitfield VkCullModeFlagBits { |
| 1157 | VK_CULL_MODE_NONE = 0x00000000, |
| 1158 | VK_CULL_MODE_FRONT_BIT = 0x00000001, |
| 1159 | VK_CULL_MODE_BACK_BIT = 0x00000002, |
| 1160 | VK_CULL_MODE_FRONT_AND_BACK = 0x00000003, |
| 1161 | } |
| 1162 | |
Jesse Hall | 523db34 | 2015-11-30 21:12:55 -0800 | [diff] [blame] | 1163 | @extension("VK_KHR_surface") |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1164 | type VkFlags VkSurfaceTransformFlagsKHR |
Jesse Hall | 523db34 | 2015-11-30 21:12:55 -0800 | [diff] [blame] | 1165 | @extension("VK_KHR_surface") |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1166 | bitfield VkSurfaceTransformFlagBitsKHR { |
Jesse Hall | f9fa9a5 | 2016-01-08 16:08:51 -0800 | [diff] [blame] | 1167 | VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR = 0x00000001, |
Jesse Hall | 9ba8bc8 | 2015-11-30 16:22:16 -0800 | [diff] [blame] | 1168 | VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR = 0x00000002, |
| 1169 | VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR = 0x00000004, |
| 1170 | VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR = 0x00000008, |
| 1171 | VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR = 0x00000010, |
| 1172 | VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR = 0x00000020, |
| 1173 | VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR = 0x00000040, |
| 1174 | VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR = 0x00000080, |
| 1175 | VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR = 0x00000100, |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 1176 | } |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1177 | |
Jesse Hall | 523db34 | 2015-11-30 21:12:55 -0800 | [diff] [blame] | 1178 | @extension("VK_KHR_surface") |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 1179 | type VkFlags VkCompositeAlphaFlagsKHR |
Jesse Hall | 523db34 | 2015-11-30 21:12:55 -0800 | [diff] [blame] | 1180 | @extension("VK_KHR_surface") |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 1181 | bitfield VkCompositeAlphaFlagBitsKHR { |
| 1182 | VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR = 0x00000001, |
| 1183 | VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR = 0x00000002, |
| 1184 | VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR = 0x00000004, |
| 1185 | VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR = 0x00000008, |
| 1186 | } |
| 1187 | |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 1188 | @extension("VK_KHR_swapchain") |
| 1189 | type VkFlags VkSwapchainCreateFlagsKHR |
| 1190 | //@extension("VK_KHR_swapchain") |
| 1191 | //bitfield VkSwapchainCreateFlagBitsKHR { |
| 1192 | //} |
| 1193 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 1194 | @extension("VK_KHR_display") |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1195 | type VkFlags VkDisplayPlaneAlphaFlagsKHR |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 1196 | @extension("VK_KHR_display") |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1197 | bitfield VkDisplayPlaneAlphaFlagBitsKHR { |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 1198 | VK_DISPLAY_PLANE_ALPHA_OPAQUE_BIT_KHR = 0x00000001, |
| 1199 | VK_DISPLAY_PLANE_ALPHA_GLOBAL_BIT_KHR = 0x00000002, |
| 1200 | VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_BIT_KHR = 0x00000004, |
| 1201 | VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_PREMULTIPLIED_BIT_KHR = 0x00000008, |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 1202 | } |
| 1203 | |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 1204 | @extension("VK_KHR_display") |
| 1205 | type VkFlags VkDisplaySurfaceCreateFlagsKHR |
| 1206 | //@extension("VK_KHR_display") |
| 1207 | //bitfield VkDisplaySurfaceCreateFlagBitsKHR { |
| 1208 | //} |
| 1209 | |
Jesse Hall | 9ba8bc8 | 2015-11-30 16:22:16 -0800 | [diff] [blame] | 1210 | @extension("VK_KHR_display") |
| 1211 | type VkFlags VkDisplayModeCreateFlagsKHR |
| 1212 | //@extension("VK_KHR_display") |
| 1213 | //bitfield VkDisplayModeCreateFlagBitsKHR { |
| 1214 | //} |
| 1215 | |
Jesse Hall | f9fa9a5 | 2016-01-08 16:08:51 -0800 | [diff] [blame] | 1216 | @extension("VK_KHR_xlib_surface") |
| 1217 | type VkFlags VkXlibSurfaceCreateFlagsKHR |
| 1218 | //@extension("VK_KHR_xlib_surface") |
| 1219 | //bitfield VkXlibSurfaceCreateFlagBitsKHR { |
| 1220 | //} |
| 1221 | |
| 1222 | @extension("VK_KHR_xcb_surface") |
| 1223 | type VkFlags VkXcbSurfaceCreateFlagsKHR |
| 1224 | //@extension("VK_KHR_xcb_surface") |
| 1225 | //bitfield VkXcbSurfaceCreateFlagBitsKHR { |
| 1226 | //} |
| 1227 | |
| 1228 | @extension("VK_KHR_wayland_surface") |
| 1229 | type VkFlags VkWaylandSurfaceCreateFlagsKHR |
| 1230 | //@extension("VK_KHR_wayland_surface") |
| 1231 | //bitfield VkWaylandSurfaceCreateFlagBitsKHR { |
| 1232 | //} |
| 1233 | |
| 1234 | @extension("VK_KHR_mir_surface") |
| 1235 | type VkFlags VkMirSurfaceCreateFlagsKHR |
| 1236 | //@extension("VK_KHR_mir_surface") |
| 1237 | //bitfield VkMirSurfaceCreateFlagBitsKHR { |
| 1238 | //} |
| 1239 | |
| 1240 | @extension("VK_KHR_android_surface") |
| 1241 | type VkFlags VkAndroidSurfaceCreateFlagsKHR |
| 1242 | //@extension("VK_KHR_android_surface") |
| 1243 | //bitfield VkAndroidSurfaceCreateFlagBitsKHR { |
| 1244 | //} |
| 1245 | |
| 1246 | @extension("VK_KHR_win32_surface") |
| 1247 | type VkFlags VkWin32SurfaceCreateFlagsKHR |
| 1248 | //@extension("VK_KHR_win32_surface") |
| 1249 | //bitfield VkWin32SurfaceCreateFlagBitsKHR { |
| 1250 | //} |
| 1251 | |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 1252 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1253 | ////////////////// |
| 1254 | // Structures // |
| 1255 | ////////////////// |
| 1256 | |
| 1257 | class VkOffset2D { |
| 1258 | s32 x |
| 1259 | s32 y |
| 1260 | } |
| 1261 | |
| 1262 | class VkOffset3D { |
| 1263 | s32 x |
| 1264 | s32 y |
| 1265 | s32 z |
| 1266 | } |
| 1267 | |
| 1268 | class VkExtent2D { |
| 1269 | s32 width |
| 1270 | s32 height |
| 1271 | } |
| 1272 | |
| 1273 | class VkExtent3D { |
| 1274 | s32 width |
| 1275 | s32 height |
| 1276 | s32 depth |
| 1277 | } |
| 1278 | |
| 1279 | class VkViewport { |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 1280 | f32 x |
| 1281 | f32 y |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1282 | f32 width |
| 1283 | f32 height |
| 1284 | f32 minDepth |
| 1285 | f32 maxDepth |
| 1286 | } |
| 1287 | |
| 1288 | class VkRect2D { |
| 1289 | VkOffset2D offset |
| 1290 | VkExtent2D extent |
| 1291 | } |
| 1292 | |
Jesse Hall | a15a4bf | 2015-11-19 22:48:02 -0800 | [diff] [blame] | 1293 | class VkClearRect { |
| 1294 | VkRect2D rect |
| 1295 | u32 baseArrayLayer |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1296 | u32 layerCount |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1297 | } |
| 1298 | |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 1299 | class VkComponentMapping { |
| 1300 | VkComponentSwizzle r |
| 1301 | VkComponentSwizzle g |
| 1302 | VkComponentSwizzle b |
| 1303 | VkComponentSwizzle a |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1304 | } |
| 1305 | |
| 1306 | class VkPhysicalDeviceProperties { |
| 1307 | u32 apiVersion |
| 1308 | u32 driverVersion |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 1309 | u32 vendorID |
| 1310 | u32 deviceID |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1311 | VkPhysicalDeviceType deviceType |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 1312 | char[VK_MAX_PHYSICAL_DEVICE_NAME_SIZE] deviceName |
| 1313 | u8[VK_UUID_SIZE] pipelineCacheUUID |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1314 | VkPhysicalDeviceLimits limits |
| 1315 | VkPhysicalDeviceSparseProperties sparseProperties |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1316 | } |
| 1317 | |
| 1318 | class VkExtensionProperties { |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 1319 | char[VK_MAX_EXTENSION_NAME_SIZE] extensionName /// extension name |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1320 | u32 specVersion /// version of the extension specification implemented |
| 1321 | } |
| 1322 | |
| 1323 | class VkLayerProperties { |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 1324 | char[VK_MAX_EXTENSION_NAME_SIZE] layerName /// layer name |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1325 | u32 specVersion /// version of the layer specification implemented |
| 1326 | u32 implementationVersion /// build or release version of the layer's library |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 1327 | char[VK_MAX_DESCRIPTION_SIZE] description /// Free-form description of the layer |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1328 | } |
| 1329 | |
Jesse Hall | a366a51 | 2015-11-19 22:30:07 -0800 | [diff] [blame] | 1330 | class VkSubmitInfo { |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 1331 | VkStructureType sType /// Type of structure. Should be VK_STRUCTURE_TYPE_SUBMIT_INFO |
| 1332 | const void* pNext /// Next structure in chain |
| 1333 | u32 waitSemaphoreCount |
Jesse Hall | a366a51 | 2015-11-19 22:30:07 -0800 | [diff] [blame] | 1334 | const VkSemaphore* pWaitSemaphores |
Jesse Hall | 543a7ff | 2016-01-08 16:38:30 -0800 | [diff] [blame^] | 1335 | const VkPipelineStageFlags* pWaitDstStageMask |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 1336 | u32 commandBufferCount |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1337 | const VkCommandBuffer* pCommandBuffers |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 1338 | u32 signalSemaphoreCount |
Jesse Hall | a366a51 | 2015-11-19 22:30:07 -0800 | [diff] [blame] | 1339 | const VkSemaphore* pSignalSemaphores |
| 1340 | } |
| 1341 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1342 | class VkApplicationInfo { |
| 1343 | VkStructureType sType /// Type of structure. Should be VK_STRUCTURE_TYPE_APPLICATION_INFO |
| 1344 | const void* pNext /// Next structure in chain |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1345 | const char* pApplicationName |
| 1346 | u32 applicationVersion |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1347 | const char* pEngineName |
| 1348 | u32 engineVersion |
| 1349 | u32 apiVersion |
| 1350 | } |
| 1351 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1352 | class VkAllocationCallbacks { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1353 | void* pUserData |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1354 | PFN_vkAllocationFunction pfnAllocation |
| 1355 | PFN_vkReallocationFunction pfnReallocation |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1356 | PFN_vkFreeFunction pfnFree |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1357 | PFN_vkInternalAllocationNotification pfnInternalAllocation |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 1358 | PFN_vkInternalFreeNotification pfnInternalFree |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1359 | } |
| 1360 | |
| 1361 | class VkDeviceQueueCreateInfo { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1362 | VkStructureType sStype /// Should be VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO |
| 1363 | const void* pNext /// Pointer to next structure |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 1364 | VkDeviceQueueCreateFlags flags |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1365 | u32 queueFamilyIndex |
Jesse Hall | dba27f7 | 2015-11-30 14:25:46 -0800 | [diff] [blame] | 1366 | u32 queueCount |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 1367 | const f32* pQueuePriorities |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1368 | } |
| 1369 | |
| 1370 | class VkDeviceCreateInfo { |
| 1371 | VkStructureType sType /// Should be VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO |
| 1372 | const void* pNext /// Pointer to next structure |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 1373 | VkDeviceCreateFlags flags |
Jesse Hall | dba27f7 | 2015-11-30 14:25:46 -0800 | [diff] [blame] | 1374 | u32 queueCreateInfoCount |
| 1375 | const VkDeviceQueueCreateInfo* pQueueCreateInfos |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 1376 | u32 enabledLayerNameCount |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1377 | const char* const* ppEnabledLayerNames /// Ordered list of layer names to be enabled |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 1378 | u32 enabledExtensionNameCount |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1379 | const char* const* ppEnabledExtensionNames |
| 1380 | const VkPhysicalDeviceFeatures* pEnabledFeatures |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1381 | } |
| 1382 | |
| 1383 | class VkInstanceCreateInfo { |
| 1384 | VkStructureType sType /// Should be VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO |
| 1385 | const void* pNext /// Pointer to next structure |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 1386 | VkInstanceCreateFlags flags |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1387 | const VkApplicationInfo* pApplicationInfo |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 1388 | u32 enabledLayerNameCount |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1389 | const char* const* ppEnabledLayerNames /// Ordered list of layer names to be enabled |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 1390 | u32 enabledExtensionNameCount |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1391 | const char* const* ppEnabledExtensionNames /// Extension names to be enabled |
| 1392 | } |
| 1393 | |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1394 | class VkQueueFamilyProperties { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1395 | VkQueueFlags queueFlags /// Queue flags |
| 1396 | u32 queueCount |
Jesse Hall | acfa534 | 2015-11-19 21:51:33 -0800 | [diff] [blame] | 1397 | u32 timestampValidBits |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 1398 | VkExtent3D minImageTransferGranularity |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1399 | } |
| 1400 | |
| 1401 | class VkPhysicalDeviceMemoryProperties { |
| 1402 | u32 memoryTypeCount |
| 1403 | VkMemoryType[VK_MAX_MEMORY_TYPES] memoryTypes |
| 1404 | u32 memoryHeapCount |
| 1405 | VkMemoryHeap[VK_MAX_MEMORY_HEAPS] memoryHeaps |
| 1406 | } |
| 1407 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1408 | class VkMemoryAllocateInfo { |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 1409 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1410 | const void* pNext /// Pointer to next structure |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1411 | VkDeviceSize allocationSize /// Size of memory allocation |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1412 | u32 memoryTypeIndex /// Index of the of the memory type to allocate from |
| 1413 | } |
| 1414 | |
| 1415 | class VkMemoryRequirements { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1416 | VkDeviceSize size /// Specified in bytes |
| 1417 | VkDeviceSize alignment /// Specified in bytes |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1418 | u32 memoryTypeBits /// Bitfield of the allowed memory type indices into memoryTypes[] for this object |
| 1419 | } |
| 1420 | |
| 1421 | class VkSparseImageFormatProperties { |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 1422 | VkImageAspectFlagBits aspectMask |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1423 | VkExtent3D imageGranularity |
| 1424 | VkSparseImageFormatFlags flags |
| 1425 | } |
| 1426 | |
| 1427 | class VkSparseImageMemoryRequirements { |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 1428 | VkSparseImageFormatProperties formatProperties |
Jesse Hall | f9fa9a5 | 2016-01-08 16:08:51 -0800 | [diff] [blame] | 1429 | u32 imageMipTailFirstLod |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1430 | VkDeviceSize imageMipTailSize /// Specified in bytes, must be a multiple of image block size / alignment |
| 1431 | VkDeviceSize imageMipTailOffset /// Specified in bytes, must be a multiple of image block size / alignment |
| 1432 | VkDeviceSize imageMipTailStride /// Specified in bytes, must be a multiple of image block size / alignment |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1433 | } |
| 1434 | |
| 1435 | class VkMemoryType { |
| 1436 | VkMemoryPropertyFlags propertyFlags /// Memory properties of this memory type |
| 1437 | u32 heapIndex /// Index of the memory heap allocations of this memory type are taken from |
| 1438 | } |
| 1439 | |
| 1440 | class VkMemoryHeap { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1441 | VkDeviceSize size /// Available memory in the heap |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1442 | VkMemoryHeapFlags flags /// Flags for the heap |
| 1443 | } |
| 1444 | |
| 1445 | class VkMappedMemoryRange { |
| 1446 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE |
| 1447 | const void* pNext /// Pointer to next structure |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1448 | VkDeviceMemory memory /// Mapped memory object |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1449 | VkDeviceSize offset /// Offset within the mapped memory the range starts from |
| 1450 | VkDeviceSize size /// Size of the range within the mapped memory |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1451 | } |
| 1452 | |
| 1453 | class VkFormatProperties { |
| 1454 | VkFormatFeatureFlags linearTilingFeatures /// Format features in case of linear tiling |
| 1455 | VkFormatFeatureFlags optimalTilingFeatures /// Format features in case of optimal tiling |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1456 | VkFormatFeatureFlags bufferFeatures /// Format features supported by buffers |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1457 | } |
| 1458 | |
| 1459 | class VkImageFormatProperties { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1460 | VkExtent3D maxExtent /// max image dimensions for this resource type |
| 1461 | u32 maxMipLevels /// max number of mipmap levels for this resource type |
Jesse Hall | a15a4bf | 2015-11-19 22:48:02 -0800 | [diff] [blame] | 1462 | u32 maxArrayLayers /// max array layers for this resource type |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1463 | VkSampleCountFlags sampleCounts /// supported sample counts for this resource type |
| 1464 | VkDeviceSize maxResourceSize /// max size (in bytes) of this resource type |
| 1465 | } |
| 1466 | |
Jesse Hall | a15a4bf | 2015-11-19 22:48:02 -0800 | [diff] [blame] | 1467 | class VkDescriptorImageInfo { |
| 1468 | VkSampler sampler |
| 1469 | VkImageView imageView |
| 1470 | VkImageLayout imageLayout |
| 1471 | } |
| 1472 | |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1473 | class VkDescriptorBufferInfo { |
| 1474 | VkBuffer buffer /// Buffer used for this descriptor when the descriptor is UNIFORM_BUFFER[_DYNAMIC] |
| 1475 | VkDeviceSize offset /// Base offset from buffer start in bytes to update in the descriptor set. |
| 1476 | VkDeviceSize range /// Size in bytes of the buffer resource for this descriptor update. |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1477 | } |
| 1478 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1479 | class VkWriteDescriptorSet { |
| 1480 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET |
| 1481 | const void* pNext /// Pointer to next structure |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1482 | VkDescriptorSet dstSet /// Destination descriptor set |
| 1483 | u32 dstBinding /// Binding within the destination descriptor set to write |
| 1484 | u32 dstArrayElement /// Array element within the destination binding to write |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 1485 | u32 descriptorCount /// Number of descriptors to write (determines the size of the array pointed by <pDescriptors>) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1486 | VkDescriptorType descriptorType /// Descriptor type to write (determines which fields of the array pointed by <pDescriptors> are going to be used) |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 1487 | const VkDescriptorImageInfo* pImageInfo |
| 1488 | const VkDescriptorBufferInfo* pBufferInfo |
| 1489 | const VkBufferView* pTexelBufferView |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1490 | } |
| 1491 | |
| 1492 | class VkCopyDescriptorSet { |
| 1493 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET |
| 1494 | const void* pNext /// Pointer to next structure |
| 1495 | VkDescriptorSet srcSet /// Source descriptor set |
| 1496 | u32 srcBinding /// Binding within the source descriptor set to copy from |
| 1497 | u32 srcArrayElement /// Array element within the source binding to copy from |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1498 | VkDescriptorSet dstSet /// Destination descriptor set |
| 1499 | u32 dstBinding /// Binding within the destination descriptor set to copy to |
| 1500 | u32 dstArrayElement /// Array element within the destination binding to copy to |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 1501 | u32 descriptorCount /// Number of descriptors to copy |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1502 | } |
| 1503 | |
| 1504 | class VkBufferCreateInfo { |
| 1505 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO |
| 1506 | const void* pNext /// Pointer to next structure. |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 1507 | VkBufferCreateFlags flags /// Buffer creation flags |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1508 | VkDeviceSize size /// Specified in bytes |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1509 | VkBufferUsageFlags usage /// Buffer usage flags |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1510 | VkSharingMode sharingMode |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 1511 | u32 queueFamilyIndexCount |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1512 | const u32* pQueueFamilyIndices |
| 1513 | } |
| 1514 | |
| 1515 | class VkBufferViewCreateInfo { |
| 1516 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO |
| 1517 | const void* pNext /// Pointer to next structure. |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 1518 | VkBufferViewCreateFlags flags |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1519 | VkBuffer buffer |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1520 | VkFormat format /// Optionally specifies format of elements |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1521 | VkDeviceSize offset /// Specified in bytes |
| 1522 | VkDeviceSize range /// View size specified in bytes |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1523 | } |
| 1524 | |
| 1525 | class VkImageSubresource { |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 1526 | VkImageAspectFlagBits aspectMask |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1527 | u32 mipLevel |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1528 | u32 arrayLayer |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1529 | } |
| 1530 | |
| 1531 | class VkImageSubresourceRange { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1532 | VkImageAspectFlags aspectMask |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1533 | u32 baseMipLevel |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1534 | u32 levelCount |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1535 | u32 baseArrayLayer |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1536 | u32 layerCount |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1537 | } |
| 1538 | |
| 1539 | class VkMemoryBarrier { |
| 1540 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MEMORY_BARRIER |
| 1541 | const void* pNext /// Pointer to next structure. |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 1542 | VkAccessFlags srcAccessMask |
| 1543 | VkAccessFlags dstAccessMask |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1544 | } |
| 1545 | |
| 1546 | class VkBufferMemoryBarrier { |
| 1547 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER |
| 1548 | const void* pNext /// Pointer to next structure. |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 1549 | VkAccessFlags srcAccessMask |
| 1550 | VkAccessFlags dstAccessMask |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1551 | u32 srcQueueFamilyIndex /// Queue family to transition ownership from |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1552 | u32 dstQueueFamilyIndex /// Queue family to transition ownership to |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1553 | VkBuffer buffer /// Buffer to sync |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1554 | VkDeviceSize offset /// Offset within the buffer to sync |
| 1555 | VkDeviceSize size /// Amount of bytes to sync |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1556 | } |
| 1557 | |
| 1558 | class VkImageMemoryBarrier { |
| 1559 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER |
| 1560 | const void* pNext /// Pointer to next structure. |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 1561 | VkAccessFlags srcAccessMask |
| 1562 | VkAccessFlags dstAccessMask |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1563 | VkImageLayout oldLayout /// Current layout of the image |
| 1564 | VkImageLayout newLayout /// New layout to transition the image to |
| 1565 | u32 srcQueueFamilyIndex /// Queue family to transition ownership from |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1566 | u32 dstQueueFamilyIndex /// Queue family to transition ownership to |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1567 | VkImage image /// Image to sync |
| 1568 | VkImageSubresourceRange subresourceRange /// Subresource range to sync |
| 1569 | } |
| 1570 | |
| 1571 | class VkImageCreateInfo { |
| 1572 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO |
| 1573 | const void* pNext /// Pointer to next structure. |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 1574 | VkImageCreateFlags flags /// Image creation flags |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1575 | VkImageType imageType |
| 1576 | VkFormat format |
| 1577 | VkExtent3D extent |
| 1578 | u32 mipLevels |
Jesse Hall | a15a4bf | 2015-11-19 22:48:02 -0800 | [diff] [blame] | 1579 | u32 arrayLayers |
Jesse Hall | 091ed9e | 2015-11-30 00:55:29 -0800 | [diff] [blame] | 1580 | VkSampleCountFlagBits samples |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1581 | VkImageTiling tiling |
| 1582 | VkImageUsageFlags usage /// Image usage flags |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1583 | VkSharingMode sharingMode /// Cross-queue-family sharing mode |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 1584 | u32 queueFamilyIndexCount /// Number of queue families to share across |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1585 | const u32* pQueueFamilyIndices /// Array of queue family indices to share across |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1586 | VkImageLayout initialLayout /// Initial image layout for all subresources |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1587 | } |
| 1588 | |
| 1589 | class VkSubresourceLayout { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1590 | VkDeviceSize offset /// Specified in bytes |
| 1591 | VkDeviceSize size /// Specified in bytes |
| 1592 | VkDeviceSize rowPitch /// Specified in bytes |
Jesse Hall | 543a7ff | 2016-01-08 16:38:30 -0800 | [diff] [blame^] | 1593 | VkDeviceSize arrayPitch /// Specified in bytes |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1594 | VkDeviceSize depthPitch /// Specified in bytes |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1595 | } |
| 1596 | |
| 1597 | class VkImageViewCreateInfo { |
| 1598 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO |
| 1599 | const void* pNext /// Pointer to next structure |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 1600 | VkImageViewCreateFlags flags |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1601 | VkImage image |
| 1602 | VkImageViewType viewType |
| 1603 | VkFormat format |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 1604 | VkComponentMapping components |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1605 | VkImageSubresourceRange subresourceRange |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1606 | } |
| 1607 | |
| 1608 | class VkBufferCopy { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1609 | VkDeviceSize srcOffset /// Specified in bytes |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1610 | VkDeviceSize dstOffset /// Specified in bytes |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 1611 | VkDeviceSize size /// Specified in bytes |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1612 | } |
| 1613 | |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 1614 | class VkSparseMemoryBind { |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 1615 | VkDeviceSize resourceOffset /// Specified in bytes |
| 1616 | VkDeviceSize size /// Specified in bytes |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1617 | VkDeviceMemory memory |
| 1618 | VkDeviceSize memoryOffset /// Specified in bytes |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1619 | VkSparseMemoryBindFlags flags |
| 1620 | } |
| 1621 | |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 1622 | class VkSparseImageMemoryBind { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1623 | VkImageSubresource subresource |
| 1624 | VkOffset3D offset |
| 1625 | VkExtent3D extent |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1626 | VkDeviceMemory memory |
| 1627 | VkDeviceSize memoryOffset /// Specified in bytes |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1628 | VkSparseMemoryBindFlags flags |
| 1629 | } |
| 1630 | |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 1631 | class VkSparseBufferMemoryBindInfo { |
| 1632 | VkBuffer buffer |
| 1633 | u32 bindCount |
| 1634 | const VkSparseMemoryBind* pBinds |
| 1635 | } |
| 1636 | |
| 1637 | class VkSparseImageOpaqueMemoryBindInfo { |
| 1638 | VkImage image |
| 1639 | u32 bindCount |
| 1640 | const VkSparseMemoryBind* pBinds |
| 1641 | } |
| 1642 | |
| 1643 | class VkSparseImageMemoryBindInfo { |
| 1644 | VkImage image |
| 1645 | u32 bindCount |
| 1646 | const VkSparseMemoryBind* pBinds |
| 1647 | } |
| 1648 | |
| 1649 | class VkBindSparseInfo { |
| 1650 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BIND_SPARSE_INFO |
| 1651 | const void* pNext |
| 1652 | u32 waitSemaphoreCount |
| 1653 | const VkSemaphore* pWaitSemaphores |
| 1654 | u32 numBufferBinds |
| 1655 | const VkSparseBufferMemoryBindInfo* pBufferBinds |
| 1656 | u32 numImageOpaqueBinds |
| 1657 | const VkSparseImageOpaqueMemoryBindInfo* pImageOpaqueBinds |
| 1658 | u32 numImageBinds |
| 1659 | const VkSparseImageMemoryBindInfo* pImageBinds |
| 1660 | u32 signalSemaphoreCount |
| 1661 | const VkSemaphore* pSignalSemaphores |
| 1662 | } |
| 1663 | |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 1664 | class VkImageSubresourceLayers { |
| 1665 | VkImageAspectFlags aspectMask |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1666 | u32 mipLevel |
Jesse Hall | a15a4bf | 2015-11-19 22:48:02 -0800 | [diff] [blame] | 1667 | u32 baseArrayLayer |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1668 | u32 layerCount |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1669 | } |
| 1670 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1671 | class VkImageCopy { |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 1672 | VkImageSubresourceLayers srcSubresource |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1673 | VkOffset3D srcOffset /// Specified in pixels for both compressed and uncompressed images |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 1674 | VkImageSubresourceLayers dstSubresource |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1675 | VkOffset3D dstOffset /// Specified in pixels for both compressed and uncompressed images |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1676 | VkExtent3D extent /// Specified in pixels for both compressed and uncompressed images |
| 1677 | } |
| 1678 | |
| 1679 | class VkImageBlit { |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 1680 | VkImageSubresourceLayers srcSubresource |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1681 | VkOffset3D srcOffset /// Specified in pixels for both compressed and uncompressed images |
| 1682 | VkExtent3D srcExtent /// Specified in pixels for both compressed and uncompressed images |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 1683 | VkImageSubresourceLayers dstSubresource |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1684 | VkOffset3D dstOffset /// Specified in pixels for both compressed and uncompressed images |
| 1685 | VkExtent3D dstExtent /// Specified in pixels for both compressed and uncompressed images |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1686 | } |
| 1687 | |
| 1688 | class VkBufferImageCopy { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1689 | VkDeviceSize bufferOffset /// Specified in bytes |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1690 | u32 bufferRowLength /// Specified in texels |
| 1691 | u32 bufferImageHeight |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 1692 | VkImageSubresourceLayers imageSubresource |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1693 | VkOffset3D imageOffset /// Specified in pixels for both compressed and uncompressed images |
| 1694 | VkExtent3D imageExtent /// Specified in pixels for both compressed and uncompressed images |
| 1695 | } |
| 1696 | |
| 1697 | class VkImageResolve { |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 1698 | VkImageSubresourceLayers srcSubresource |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1699 | VkOffset3D srcOffset |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 1700 | VkImageSubresourceLayers dstSubresource |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1701 | VkOffset3D dstOffset |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1702 | VkExtent3D extent |
| 1703 | } |
| 1704 | |
| 1705 | class VkShaderModuleCreateInfo { |
| 1706 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO |
| 1707 | const void* pNext /// Pointer to next structure |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 1708 | VkShaderModuleCreateFlags flags /// Reserved |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1709 | platform.size_t codeSize /// Specified in bytes |
Jesse Hall | a9bb62b | 2015-11-21 19:31:56 -0800 | [diff] [blame] | 1710 | const u32* pCode /// Binary code of size codeSize |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1711 | } |
| 1712 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1713 | class VkDescriptorSetLayoutBinding { |
Jesse Hall | 091ed9e | 2015-11-30 00:55:29 -0800 | [diff] [blame] | 1714 | u32 binding |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1715 | VkDescriptorType descriptorType /// Type of the descriptors in this binding |
Jesse Hall | dba27f7 | 2015-11-30 14:25:46 -0800 | [diff] [blame] | 1716 | u32 descriptorCount /// Number of descriptors in this binding |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1717 | VkShaderStageFlags stageFlags /// Shader stages this binding is visible to |
| 1718 | const VkSampler* pImmutableSamplers /// Immutable samplers (used if descriptor type is SAMPLER or COMBINED_IMAGE_SAMPLER, is either NULL or contains <count> number of elements) |
| 1719 | } |
| 1720 | |
| 1721 | class VkDescriptorSetLayoutCreateInfo { |
| 1722 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO |
| 1723 | const void* pNext /// Pointer to next structure |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 1724 | VkDescriptorSetLayoutCreateFlags flags |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 1725 | u32 bindingCount /// Number of bindings in the descriptor set layout |
Jesse Hall | 543a7ff | 2016-01-08 16:38:30 -0800 | [diff] [blame^] | 1726 | const VkDescriptorSetLayoutBinding* pBindings /// Array of descriptor set layout bindings |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1727 | } |
| 1728 | |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 1729 | class VkDescriptorPoolSize { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1730 | VkDescriptorType type |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 1731 | u32 descriptorCount |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1732 | } |
| 1733 | |
| 1734 | class VkDescriptorPoolCreateInfo { |
| 1735 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO |
| 1736 | const void* pNext /// Pointer to next structure |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 1737 | VkDescriptorPoolCreateFlags flags |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1738 | u32 maxSets |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 1739 | u32 poolSizeCount |
| 1740 | const VkDescriptorPoolSize* pPoolSizes |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1741 | } |
| 1742 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1743 | class VkDescriptorSetAllocateInfo { |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 1744 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 1745 | const void* pNext /// Pointer to next structure |
| 1746 | VkDescriptorPool descriptorPool |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 1747 | u32 setCount |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 1748 | const VkDescriptorSetLayout* pSetLayouts |
| 1749 | } |
| 1750 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1751 | class VkSpecializationMapEntry { |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 1752 | u32 constantID /// The SpecConstant ID specified in the BIL |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1753 | u32 offset /// Offset of the value in the data block |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 1754 | platform.size_t size /// Size in bytes of the SpecConstant |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1755 | } |
| 1756 | |
| 1757 | class VkSpecializationInfo { |
| 1758 | u32 mapEntryCount /// Number of entries in the map |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 1759 | const VkSpecializationMapEntry* pMapEntries /// Array of map entries |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1760 | platform.size_t dataSize /// Size in bytes of pData |
| 1761 | const void* pData /// Pointer to SpecConstant data |
| 1762 | } |
| 1763 | |
| 1764 | class VkPipelineShaderStageCreateInfo { |
| 1765 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO |
| 1766 | const void* pNext /// Pointer to next structure |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 1767 | VkPipelineShaderStageCreateFlags flags |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 1768 | VkShaderStageFlagBits stage |
| 1769 | VkShaderModule module |
| 1770 | const char* pName |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1771 | const VkSpecializationInfo* pSpecializationInfo |
| 1772 | } |
| 1773 | |
| 1774 | class VkComputePipelineCreateInfo { |
| 1775 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO |
| 1776 | const void* pNext /// Pointer to next structure |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1777 | VkPipelineCreateFlags flags /// Pipeline creation flags |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 1778 | VkPipelineShaderStageCreateInfo stage |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1779 | VkPipelineLayout layout /// Interface layout of the pipeline |
| 1780 | VkPipeline basePipelineHandle /// If VK_PIPELINE_CREATE_DERIVATIVE_BIT is set and this value is nonzero, it specifies the handle of the base pipeline this is a derivative of |
| 1781 | s32 basePipelineIndex /// If VK_PIPELINE_CREATE_DERIVATIVE_BIT is set and this value is not -1, it specifies an index into pCreateInfos of the base pipeline this is a derivative of |
| 1782 | } |
| 1783 | |
| 1784 | class VkVertexInputBindingDescription { |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 1785 | u32 binding /// Vertex buffer binding id |
| 1786 | u32 stride /// Distance between vertices in bytes (0 = no advancement) |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 1787 | VkVertexInputRate inputRate /// Rate at which binding is incremented |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1788 | } |
| 1789 | |
| 1790 | class VkVertexInputAttributeDescription { |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 1791 | u32 location /// location of the shader vertex attrib |
| 1792 | u32 binding /// Vertex buffer binding id |
| 1793 | VkFormat format /// format of source data |
| 1794 | u32 offset /// Offset of first element in bytes from base of vertex |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1795 | } |
| 1796 | |
| 1797 | class VkPipelineVertexInputStateCreateInfo { |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 1798 | VkStructureType sType /// Should be VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO |
| 1799 | const void* pNext /// Pointer to next structure |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 1800 | VkPipelineVertexInputStateCreateFlags flags |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 1801 | u32 vertexBindingDescriptionCount /// number of bindings |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1802 | const VkVertexInputBindingDescription* pVertexBindingDescriptions |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 1803 | u32 vertexAttributeDescriptionCount /// number of attributes |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1804 | const VkVertexInputAttributeDescription* pVertexAttributeDescriptions |
| 1805 | } |
| 1806 | |
| 1807 | class VkPipelineInputAssemblyStateCreateInfo { |
| 1808 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO |
| 1809 | const void* pNext /// Pointer to next structure |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 1810 | VkPipelineInputAssemblyStateCreateFlags flags |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1811 | VkPrimitiveTopology topology |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1812 | VkBool32 primitiveRestartEnable |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1813 | } |
| 1814 | |
| 1815 | class VkPipelineTessellationStateCreateInfo { |
| 1816 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO |
| 1817 | const void* pNext /// Pointer to next structure |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 1818 | VkPipelineTessellationStateCreateFlags flags |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1819 | u32 patchControlPoints |
| 1820 | } |
| 1821 | |
| 1822 | class VkPipelineViewportStateCreateInfo { |
| 1823 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO |
| 1824 | const void* pNext /// Pointer to next structure |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 1825 | VkPipelineViewportStateCreateFlags flags |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1826 | u32 viewportCount |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1827 | const VkViewport* pViewports |
| 1828 | u32 scissorCount |
| 1829 | const VkRect2D* pScissors |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1830 | } |
| 1831 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1832 | class VkPipelineRasterizationStateCreateInfo { |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 1833 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1834 | const void* pNext /// Pointer to next structure |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1835 | VkPipelineRasterizationStateCreateFlags flags |
Jesse Hall | ae38f73 | 2015-11-19 21:32:50 -0800 | [diff] [blame] | 1836 | VkBool32 depthClampEnable |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1837 | VkBool32 rasterizerDiscardEnable |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 1838 | VkPolygonMode polygonMode /// optional (GL45) |
Jesse Hall | c7467b7 | 2015-11-29 21:05:26 -0800 | [diff] [blame] | 1839 | VkCullModeFlags cullMode |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1840 | VkFrontFace frontFace |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1841 | VkBool32 depthBiasEnable |
Jesse Hall | a9bb62b | 2015-11-21 19:31:56 -0800 | [diff] [blame] | 1842 | f32 depthBiasConstantFactor |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1843 | f32 depthBiasClamp |
Jesse Hall | a9bb62b | 2015-11-21 19:31:56 -0800 | [diff] [blame] | 1844 | f32 depthBiasSlopeFactor |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1845 | f32 lineWidth |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1846 | } |
| 1847 | |
| 1848 | class VkPipelineMultisampleStateCreateInfo { |
| 1849 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO |
| 1850 | const void* pNext /// Pointer to next structure |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 1851 | VkPipelineMultisampleStateCreateFlags flags |
Jesse Hall | 091ed9e | 2015-11-30 00:55:29 -0800 | [diff] [blame] | 1852 | VkSampleCountFlagBits rasterizationSamples /// Number of samples used for rasterization |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1853 | VkBool32 sampleShadingEnable /// optional (GL45) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1854 | f32 minSampleShading /// optional (GL45) |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1855 | const VkSampleMask* pSampleMask |
Jesse Hall | acfa534 | 2015-11-19 21:51:33 -0800 | [diff] [blame] | 1856 | VkBool32 alphaToCoverageEnable |
| 1857 | VkBool32 alphaToOneEnable |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1858 | } |
| 1859 | |
| 1860 | class VkPipelineColorBlendAttachmentState { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1861 | VkBool32 blendEnable |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 1862 | VkBlendFactor srcColorBlendFactor |
| 1863 | VkBlendFactor dstColorBlendFactor |
| 1864 | VkBlendOp colorBlendOp |
| 1865 | VkBlendFactor srcAlphaBlendFactor |
| 1866 | VkBlendFactor dstAlphaBlendFactor |
| 1867 | VkBlendOp alphaBlendOp |
| 1868 | VkColorComponentFlags colorWriteMask |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1869 | } |
| 1870 | |
| 1871 | class VkPipelineColorBlendStateCreateInfo { |
| 1872 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO |
| 1873 | const void* pNext /// Pointer to next structure |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 1874 | VkPipelineColorBlendStateCreateFlags flags |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1875 | VkBool32 logicOpEnable |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1876 | VkLogicOp logicOp |
| 1877 | u32 attachmentCount /// # of pAttachments |
| 1878 | const VkPipelineColorBlendAttachmentState* pAttachments |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 1879 | f32[4] blendConstants |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1880 | } |
| 1881 | |
| 1882 | class VkStencilOpState { |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 1883 | VkStencilOp failOp |
| 1884 | VkStencilOp passOp |
| 1885 | VkStencilOp depthFailOp |
| 1886 | VkCompareOp compareOp |
| 1887 | u32 compareMask |
| 1888 | u32 writeMask |
| 1889 | u32 reference |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1890 | } |
| 1891 | |
| 1892 | class VkPipelineDepthStencilStateCreateInfo { |
| 1893 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO |
| 1894 | const void* pNext /// Pointer to next structure |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 1895 | VkPipelineDepthStencilStateCreateFlags flags |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1896 | VkBool32 depthTestEnable |
| 1897 | VkBool32 depthWriteEnable |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1898 | VkCompareOp depthCompareOp |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1899 | VkBool32 depthBoundsTestEnable /// optional (depth_bounds_test) |
| 1900 | VkBool32 stencilTestEnable |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1901 | VkStencilOpState front |
| 1902 | VkStencilOpState back |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1903 | f32 minDepthBounds |
| 1904 | f32 maxDepthBounds |
| 1905 | } |
| 1906 | |
| 1907 | class VkPipelineDynamicStateCreateInfo { |
| 1908 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO |
| 1909 | const void* pNext /// Pointer to next structure |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 1910 | VkPipelineDynamicStateCreateFlags flags |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1911 | u32 dynamicStateCount |
| 1912 | const VkDynamicState* pDynamicStates |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1913 | } |
| 1914 | |
| 1915 | class VkGraphicsPipelineCreateInfo { |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 1916 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO |
| 1917 | const void* pNext /// Pointer to next structure |
| 1918 | VkPipelineCreateFlags flags /// Pipeline creation flags |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1919 | u32 stageCount |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 1920 | const VkPipelineShaderStageCreateInfo* pStages /// One entry for each active shader stage |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1921 | const VkPipelineVertexInputStateCreateInfo* pVertexInputState |
| 1922 | const VkPipelineInputAssemblyStateCreateInfo* pInputAssemblyState |
| 1923 | const VkPipelineTessellationStateCreateInfo* pTessellationState |
| 1924 | const VkPipelineViewportStateCreateInfo* pViewportState |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1925 | const VkPipelineRasterizationStateCreateInfo* pRasterizationState |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1926 | const VkPipelineMultisampleStateCreateInfo* pMultisampleState |
| 1927 | const VkPipelineDepthStencilStateCreateInfo* pDepthStencilState |
| 1928 | const VkPipelineColorBlendStateCreateInfo* pColorBlendState |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1929 | const VkPipelineDynamicStateCreateInfo* pDynamicState |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 1930 | VkPipelineLayout layout /// Interface layout of the pipeline |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1931 | VkRenderPass renderPass |
| 1932 | u32 subpass |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 1933 | VkPipeline basePipelineHandle /// If VK_PIPELINE_CREATE_DERIVATIVE_BIT is set and this value is nonzero, it specifies the handle of the base pipeline this is a derivative of |
| 1934 | s32 basePipelineIndex /// If VK_PIPELINE_CREATE_DERIVATIVE_BIT is set and this value is not -1, it specifies an index into pCreateInfos of the base pipeline this is a derivative of |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1935 | } |
| 1936 | |
| 1937 | class VkPipelineCacheCreateInfo { |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 1938 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO |
| 1939 | const void* pNext /// Pointer to next structure |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 1940 | VkPipelineCacheCreateFlags flags |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 1941 | platform.size_t initialDataSize /// Size of initial data to populate cache, in bytes |
| 1942 | const void* pInitialData /// Initial data to populate cache |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1943 | } |
| 1944 | |
| 1945 | class VkPushConstantRange { |
| 1946 | VkShaderStageFlags stageFlags /// Which stages use the range |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 1947 | u32 offset /// Start of the range, in bytes |
| 1948 | u32 size /// Length of the range, in bytes |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1949 | } |
| 1950 | |
| 1951 | class VkPipelineLayoutCreateInfo { |
| 1952 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO |
| 1953 | const void* pNext /// Pointer to next structure |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 1954 | VkPipelineLayoutCreateFlags flags |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 1955 | u32 setLayoutCount /// Number of descriptor sets interfaced by the pipeline |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1956 | const VkDescriptorSetLayout* pSetLayouts /// Array of <setCount> number of descriptor set layout objects defining the layout of the |
| 1957 | u32 pushConstantRangeCount /// Number of push-constant ranges used by the pipeline |
| 1958 | const VkPushConstantRange* pPushConstantRanges /// Array of pushConstantRangeCount number of ranges used by various shader stages |
| 1959 | } |
| 1960 | |
| 1961 | class VkSamplerCreateInfo { |
| 1962 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO |
| 1963 | const void* pNext /// Pointer to next structure |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 1964 | VkSamplerCreateFlags flags |
Jesse Hall | 23ff73f | 2015-11-29 14:36:39 -0800 | [diff] [blame] | 1965 | VkFilter magFilter /// Filter mode for magnification |
| 1966 | VkFilter minFilter /// Filter mode for minifiation |
| 1967 | VkSamplerMipmapMode mipmapMode /// Mipmap selection mode |
| 1968 | VkSamplerAddressMode addressModeU |
| 1969 | VkSamplerAddressMode addressModeV |
| 1970 | VkSamplerAddressMode addressModeW |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1971 | f32 mipLodBias |
Jesse Hall | f9fa9a5 | 2016-01-08 16:08:51 -0800 | [diff] [blame] | 1972 | VkBool32 anisotropyEnable |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1973 | f32 maxAnisotropy |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1974 | VkBool32 compareEnable |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1975 | VkCompareOp compareOp |
| 1976 | f32 minLod |
| 1977 | f32 maxLod |
| 1978 | VkBorderColor borderColor |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1979 | VkBool32 unnormalizedCoordinates |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1980 | } |
| 1981 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1982 | class VkCommandPoolCreateInfo { |
| 1983 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1984 | const void* pNext /// Pointer to next structure |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1985 | VkCommandPoolCreateFlags flags /// Command pool creation flags |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 1986 | u32 queueFamilyIndex |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1987 | } |
| 1988 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1989 | class VkCommandBufferAllocateInfo { |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 1990 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1991 | const void* pNext /// Pointer to next structure |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1992 | VkCommandPool commandPool |
| 1993 | VkCommandBufferLevel level |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 1994 | u32 bufferCount |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1995 | } |
| 1996 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 1997 | class VkCommandBufferBeginInfo { |
| 1998 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1999 | const void* pNext /// Pointer to next structure |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2000 | VkCommandBufferUsageFlags flags /// Command buffer usage flags |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2001 | VkRenderPass renderPass /// Render pass for secondary command buffers |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2002 | u32 subpass |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2003 | VkFramebuffer framebuffer /// Framebuffer for secondary command buffers |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 2004 | VkBool32 occlusionQueryEnable |
| 2005 | VkQueryControlFlags queryFlags |
| 2006 | VkQueryPipelineStatisticFlags pipelineStatistics |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2007 | } |
| 2008 | |
| 2009 | class VkRenderPassBeginInfo { |
| 2010 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO |
| 2011 | const void* pNext /// Pointer to next structure |
| 2012 | VkRenderPass renderPass |
| 2013 | VkFramebuffer framebuffer |
| 2014 | VkRect2D renderArea |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2015 | u32 clearValueCount |
| 2016 | const VkClearValue* pClearValues |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2017 | } |
| 2018 | |
| 2019 | @union |
| 2020 | /// Union allowing specification of floating point, integer, or unsigned integer color data. Actual value selected is based on image/attachment being cleared. |
| 2021 | class VkClearColorValue { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2022 | f32[4] float32 |
| 2023 | s32[4] int32 |
| 2024 | u32[4] uint32 |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2025 | } |
| 2026 | |
| 2027 | class VkClearDepthStencilValue { |
| 2028 | f32 depth |
| 2029 | u32 stencil |
| 2030 | } |
| 2031 | |
| 2032 | @union |
| 2033 | /// Union allowing specification of color, depth, and stencil color values. Actual value selected is based on attachment being cleared. |
| 2034 | class VkClearValue { |
| 2035 | VkClearColorValue color |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2036 | VkClearDepthStencilValue depthStencil |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2037 | } |
| 2038 | |
Jesse Hall | ae38f73 | 2015-11-19 21:32:50 -0800 | [diff] [blame] | 2039 | class VkClearAttachment { |
| 2040 | VkImageAspectFlags aspectMask |
| 2041 | u32 colorAttachment |
| 2042 | VkClearValue clearValue |
| 2043 | } |
| 2044 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2045 | class VkAttachmentDescription { |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2046 | VkAttachmentDescriptionFlags flags |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2047 | VkFormat format |
Jesse Hall | 091ed9e | 2015-11-30 00:55:29 -0800 | [diff] [blame] | 2048 | VkSampleCountFlagBits samples |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2049 | VkAttachmentLoadOp loadOp /// Load op for color or depth data |
| 2050 | VkAttachmentStoreOp storeOp /// Store op for color or depth data |
| 2051 | VkAttachmentLoadOp stencilLoadOp /// Load op for stencil data |
| 2052 | VkAttachmentStoreOp stencilStoreOp /// Store op for stencil data |
| 2053 | VkImageLayout initialLayout |
| 2054 | VkImageLayout finalLayout |
| 2055 | } |
| 2056 | |
| 2057 | class VkAttachmentReference { |
| 2058 | u32 attachment |
| 2059 | VkImageLayout layout |
| 2060 | } |
| 2061 | |
| 2062 | class VkSubpassDescription { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2063 | VkSubpassDescriptionFlags flags |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2064 | VkPipelineBindPoint pipelineBindPoint /// Must be VK_PIPELINE_BIND_POINT_GRAPHICS for now |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 2065 | u32 inputAttachmentCount |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2066 | const VkAttachmentReference* pInputAttachments |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 2067 | u32 colorAttachmentCount |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2068 | const VkAttachmentReference* pColorAttachments |
| 2069 | const VkAttachmentReference* pResolveAttachments |
Jesse Hall | c7467b7 | 2015-11-29 21:05:26 -0800 | [diff] [blame] | 2070 | const VkAttachmentReference* pDepthStencilAttachment |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 2071 | u32 preserveAttachmentCount |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2072 | const VkAttachmentReference* pPreserveAttachments |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2073 | } |
| 2074 | |
| 2075 | class VkSubpassDependency { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2076 | u32 srcSubpass |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2077 | u32 dstSubpass |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2078 | VkPipelineStageFlags srcStageMask |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2079 | VkPipelineStageFlags dstStageMask |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 2080 | VkAccessFlags srcAccessMask |
| 2081 | VkAccessFlags dstAccessMask |
Jesse Hall | dc6d36c | 2015-11-29 19:12:15 -0800 | [diff] [blame] | 2082 | VkDependencyFlags dependencyFlags |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2083 | } |
| 2084 | |
| 2085 | class VkRenderPassCreateInfo { |
| 2086 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO |
| 2087 | const void* pNext /// Pointer to next structure |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2088 | VkRenderPassCreateFlags flags |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2089 | u32 attachmentCount |
| 2090 | const VkAttachmentDescription* pAttachments |
| 2091 | u32 subpassCount |
| 2092 | const VkSubpassDescription* pSubpasses |
| 2093 | u32 dependencyCount |
| 2094 | const VkSubpassDependency* pDependencies |
| 2095 | } |
| 2096 | |
| 2097 | class VkEventCreateInfo { |
| 2098 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_EVENT_CREATE_INFO |
| 2099 | const void* pNext /// Pointer to next structure |
| 2100 | VkEventCreateFlags flags /// Event creation flags |
| 2101 | } |
| 2102 | |
| 2103 | class VkFenceCreateInfo { |
| 2104 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_FENCE_CREATE_INFO |
| 2105 | const void* pNext /// Pointer to next structure |
| 2106 | VkFenceCreateFlags flags /// Fence creation flags |
| 2107 | } |
| 2108 | |
| 2109 | class VkPhysicalDeviceFeatures { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2110 | VkBool32 robustBufferAccess /// out of bounds buffer accesses are well defined |
| 2111 | VkBool32 fullDrawIndexUint32 /// full 32-bit range of indices for indexed draw calls |
| 2112 | VkBool32 imageCubeArray /// image views which are arrays of cube maps |
| 2113 | VkBool32 independentBlend /// blending operations are controlled per-attachment |
| 2114 | VkBool32 geometryShader /// geometry stage |
| 2115 | VkBool32 tessellationShader /// tessellation control and evaluation stage |
| 2116 | VkBool32 sampleRateShading /// per-sample shading and interpolation |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2117 | VkBool32 dualSrcBlend /// blend operations which take two sources |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2118 | VkBool32 logicOp /// logic operations |
| 2119 | VkBool32 multiDrawIndirect /// multi draw indirect |
Jesse Hall | 543a7ff | 2016-01-08 16:38:30 -0800 | [diff] [blame^] | 2120 | VkBool32 drawIndirectFirstInstance |
Jesse Hall | ae38f73 | 2015-11-19 21:32:50 -0800 | [diff] [blame] | 2121 | VkBool32 depthClamp /// depth clamping |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2122 | VkBool32 depthBiasClamp /// depth bias clamping |
| 2123 | VkBool32 fillModeNonSolid /// point and wireframe fill modes |
| 2124 | VkBool32 depthBounds /// depth bounds test |
| 2125 | VkBool32 wideLines /// lines with width greater than 1 |
| 2126 | VkBool32 largePoints /// points with size greater than 1 |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 2127 | VkBool32 alphaToOne /// The fragment alpha channel can be forced to maximum representable alpha value |
| 2128 | VkBool32 multiViewport |
| 2129 | VkBool32 samplerAnisotropy |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2130 | VkBool32 textureCompressionETC2 /// ETC texture compression formats |
| 2131 | VkBool32 textureCompressionASTC_LDR /// ASTC LDR texture compression formats |
| 2132 | VkBool32 textureCompressionBC /// BC1-7 texture compressed formats |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 2133 | VkBool32 occlusionQueryPrecise |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2134 | VkBool32 pipelineStatisticsQuery /// pipeline statistics query |
Jesse Hall | dc6d36c | 2015-11-29 19:12:15 -0800 | [diff] [blame] | 2135 | VkBool32 vertexPipelineStoresAndAtomics |
| 2136 | VkBool32 fragmentStoresAndAtomics |
| 2137 | VkBool32 shaderTessellationAndGeometryPointSize |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2138 | VkBool32 shaderImageGatherExtended /// texture gather with run-time values and independent offsets |
| 2139 | VkBool32 shaderStorageImageExtendedFormats /// the extended set of formats can be used for storage images |
| 2140 | VkBool32 shaderStorageImageMultisample /// multisample images can be used for storage images |
Jesse Hall | d1af812 | 2015-11-29 23:50:38 -0800 | [diff] [blame] | 2141 | VkBool32 shaderStorageImageReadWithoutFormat |
| 2142 | VkBool32 shaderStorageImageWriteWithoutFormat |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2143 | VkBool32 shaderUniformBufferArrayDynamicIndexing /// arrays of uniform buffers can be accessed with dynamically uniform indices |
| 2144 | VkBool32 shaderSampledImageArrayDynamicIndexing /// arrays of sampled images can be accessed with dynamically uniform indices |
| 2145 | VkBool32 shaderStorageBufferArrayDynamicIndexing /// arrays of storage buffers can be accessed with dynamically uniform indices |
| 2146 | VkBool32 shaderStorageImageArrayDynamicIndexing /// arrays of storage images can be accessed with dynamically uniform indices |
| 2147 | VkBool32 shaderClipDistance /// clip distance in shaders |
| 2148 | VkBool32 shaderCullDistance /// cull distance in shaders |
| 2149 | VkBool32 shaderFloat64 /// 64-bit floats (doubles) in shaders |
| 2150 | VkBool32 shaderInt64 /// 64-bit integers in shaders |
| 2151 | VkBool32 shaderInt16 /// 16-bit integers in shaders |
| 2152 | VkBool32 shaderResourceResidency /// shader can use texture operations that return resource residency information (requires sparseNonResident support) |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 2153 | VkBool32 shaderResourceMinLod /// shader can use texture operations that specify minimum resource LOD |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2154 | VkBool32 sparseBinding /// Sparse resources support: Resource memory can be managed at opaque page level rather than object level |
| 2155 | VkBool32 sparseResidencyBuffer /// Sparse resources support: GPU can access partially resident buffers |
| 2156 | VkBool32 sparseResidencyImage2D /// Sparse resources support: GPU can access partially resident 2D (non-MSAA non-DepthStencil) images |
| 2157 | VkBool32 sparseResidencyImage3D /// Sparse resources support: GPU can access partially resident 3D images |
| 2158 | VkBool32 sparseResidency2Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 2 samples |
| 2159 | VkBool32 sparseResidency4Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 4 samples |
| 2160 | VkBool32 sparseResidency8Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 8 samples |
| 2161 | VkBool32 sparseResidency16Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 16 samples |
| 2162 | VkBool32 sparseResidencyAliased /// Sparse resources support: GPU can correctly access data aliased into multiple locations (opt-in) |
Jesse Hall | d1af812 | 2015-11-29 23:50:38 -0800 | [diff] [blame] | 2163 | VkBool32 variableMultisampleRate |
Jesse Hall | f9fa9a5 | 2016-01-08 16:08:51 -0800 | [diff] [blame] | 2164 | VkBool32 inheritedQueries |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2165 | } |
| 2166 | |
| 2167 | class VkPhysicalDeviceLimits { |
| 2168 | /// resource maximum sizes |
| 2169 | u32 maxImageDimension1D /// max 1D image dimension |
| 2170 | u32 maxImageDimension2D /// max 2D image dimension |
| 2171 | u32 maxImageDimension3D /// max 3D image dimension |
| 2172 | u32 maxImageDimensionCube /// max cubemap image dimension |
| 2173 | u32 maxImageArrayLayers /// max layers for image arrays |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 2174 | u32 maxTexelBufferElements |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 2175 | u32 maxUniformBufferRange /// max uniform buffer size (bytes) |
| 2176 | u32 maxStorageBufferRange /// max storage buffer size (bytes) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2177 | u32 maxPushConstantsSize /// max size of the push constants pool (bytes) |
| 2178 | /// memory limits |
| 2179 | u32 maxMemoryAllocationCount /// max number of device memory allocations supported |
Jesse Hall | 091ed9e | 2015-11-30 00:55:29 -0800 | [diff] [blame] | 2180 | u32 maxSamplerAllocationCount |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2181 | VkDeviceSize bufferImageGranularity /// Granularity (in bytes) at which buffers and images can be bound to adjacent memory for simultaneous usage |
| 2182 | VkDeviceSize sparseAddressSpaceSize /// Total address space available for sparse allocations (bytes) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2183 | /// descriptor set limits |
| 2184 | u32 maxBoundDescriptorSets /// max number of descriptors sets that can be bound to a pipeline |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2185 | u32 maxPerStageDescriptorSamplers /// max num of samplers allowed per-stage in a descriptor set |
| 2186 | u32 maxPerStageDescriptorUniformBuffers /// max num of uniform buffers allowed per-stage in a descriptor set |
| 2187 | u32 maxPerStageDescriptorStorageBuffers /// max num of storage buffers allowed per-stage in a descriptor set |
| 2188 | u32 maxPerStageDescriptorSampledImages /// max num of sampled images allowed per-stage in a descriptor set |
| 2189 | u32 maxPerStageDescriptorStorageImages /// max num of storage images allowed per-stage in a descriptor set |
Jesse Hall | e1b1278 | 2015-11-30 11:27:32 -0800 | [diff] [blame] | 2190 | u32 maxPerStageDescriptorInputAttachments |
Jesse Hall | dba27f7 | 2015-11-30 14:25:46 -0800 | [diff] [blame] | 2191 | u32 maxPerStageResources |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2192 | u32 maxDescriptorSetSamplers /// max num of samplers allowed in all stages in a descriptor set |
| 2193 | u32 maxDescriptorSetUniformBuffers /// max num of uniform buffers allowed in all stages in a descriptor set |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2194 | u32 maxDescriptorSetUniformBuffersDynamic /// max num of dynamic uniform buffers allowed in all stages in a descriptor set |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2195 | u32 maxDescriptorSetStorageBuffers /// max num of storage buffers allowed in all stages in a descriptor set |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2196 | u32 maxDescriptorSetStorageBuffersDynamic /// max num of dynamic storage buffers allowed in all stages in a descriptor set |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2197 | u32 maxDescriptorSetSampledImages /// max num of sampled images allowed in all stages in a descriptor set |
| 2198 | u32 maxDescriptorSetStorageImages /// max num of storage images allowed in all stages in a descriptor set |
Jesse Hall | e1b1278 | 2015-11-30 11:27:32 -0800 | [diff] [blame] | 2199 | u32 maxDescriptorSetInputAttachments |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2200 | /// vertex stage limits |
| 2201 | u32 maxVertexInputAttributes /// max num of vertex input attribute slots |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2202 | u32 maxVertexInputBindings /// max num of vertex input binding slots |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2203 | u32 maxVertexInputAttributeOffset /// max vertex input attribute offset added to vertex buffer offset |
| 2204 | u32 maxVertexInputBindingStride /// max vertex input binding stride |
| 2205 | u32 maxVertexOutputComponents /// max num of output components written by vertex shader |
| 2206 | /// tessellation control stage limits |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2207 | u32 maxTessellationGenerationLevel /// max level supported by tess primitive generator |
Jesse Hall | ae38f73 | 2015-11-19 21:32:50 -0800 | [diff] [blame] | 2208 | u32 maxTessellationPatchSize /// max patch size (vertices) |
| 2209 | u32 maxTessellationControlPerVertexInputComponents /// max num of input components per-vertex in TCS |
| 2210 | u32 maxTessellationControlPerVertexOutputComponents /// max num of output components per-vertex in TCS |
| 2211 | u32 maxTessellationControlPerPatchOutputComponents /// max num of output components per-patch in TCS |
| 2212 | u32 maxTessellationControlTotalOutputComponents /// max total num of per-vertex and per-patch output components in TCS |
| 2213 | u32 maxTessellationEvaluationInputComponents /// max num of input components per vertex in TES |
| 2214 | u32 maxTessellationEvaluationOutputComponents /// max num of output components per vertex in TES |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2215 | /// geometry stage limits |
| 2216 | u32 maxGeometryShaderInvocations /// max invocation count supported in geometry shader |
| 2217 | u32 maxGeometryInputComponents /// max num of input components read in geometry stage |
| 2218 | u32 maxGeometryOutputComponents /// max num of output components written in geometry stage |
| 2219 | u32 maxGeometryOutputVertices /// max num of vertices that can be emitted in geometry stage |
| 2220 | u32 maxGeometryTotalOutputComponents /// max total num of components (all vertices) written in geometry stage |
| 2221 | /// fragment stage limits |
| 2222 | u32 maxFragmentInputComponents /// max num of input compontents read in fragment stage |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 2223 | u32 maxFragmentOutputAttachments /// max num of output attachments written in fragment stage |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2224 | u32 maxFragmentDualSrcAttachments /// max num of output attachments written when using dual source blending |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2225 | u32 maxFragmentCombinedOutputResources /// max total num of storage buffers, storage images and output buffers |
| 2226 | /// compute stage limits |
| 2227 | u32 maxComputeSharedMemorySize /// max total storage size of work group local storage (bytes) |
| 2228 | u32[3] maxComputeWorkGroupCount /// max num of compute work groups that may be dispatched by a single command (x,y,z) |
| 2229 | u32 maxComputeWorkGroupInvocations /// max total compute invocations in a single local work group |
| 2230 | u32[3] maxComputeWorkGroupSize /// max local size of a compute work group (x,y,z) |
| 2231 | |
| 2232 | u32 subPixelPrecisionBits /// num bits of subpixel precision in screen x and y |
| 2233 | u32 subTexelPrecisionBits /// num bits of subtexel precision |
| 2234 | u32 mipmapPrecisionBits /// num bits of mipmap precision |
| 2235 | |
| 2236 | u32 maxDrawIndexedIndexValue /// max index value for indexed draw calls (for 32-bit indices) |
Jesse Hall | dba27f7 | 2015-11-30 14:25:46 -0800 | [diff] [blame] | 2237 | u32 maxDrawIndirectCount |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2238 | |
| 2239 | f32 maxSamplerLodBias /// max absolute sampler level of detail bias |
| 2240 | f32 maxSamplerAnisotropy /// max degree of sampler anisotropy |
| 2241 | |
| 2242 | u32 maxViewports /// max number of active viewports |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2243 | u32[2] maxViewportDimensions /// max viewport dimensions (x,y) |
| 2244 | f32[2] viewportBoundsRange /// viewport bounds range (min,max) |
| 2245 | u32 viewportSubPixelBits /// num bits of subpixel precision for viewport |
| 2246 | |
Jesse Hall | dc6d36c | 2015-11-29 19:12:15 -0800 | [diff] [blame] | 2247 | platform.size_t minMemoryMapAlignment /// min required alignment of pointers returned by MapMemory (bytes) |
| 2248 | VkDeviceSize minTexelBufferOffsetAlignment /// min required alignment for texel buffer offsets (bytes) |
| 2249 | VkDeviceSize minUniformBufferOffsetAlignment /// min required alignment for uniform buffer sizes and offsets (bytes) |
| 2250 | VkDeviceSize minStorageBufferOffsetAlignment /// min required alignment for storage buffer offsets (bytes) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2251 | |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 2252 | s32 minTexelOffset /// min texel offset for OpTextureSampleOffset |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2253 | u32 maxTexelOffset /// max texel offset for OpTextureSampleOffset |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 2254 | s32 minTexelGatherOffset /// min texel offset for OpTextureGatherOffset |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2255 | u32 maxTexelGatherOffset /// max texel offset for OpTextureGatherOffset |
| 2256 | f32 minInterpolationOffset /// furthest negative offset for interpolateAtOffset |
| 2257 | f32 maxInterpolationOffset /// furthest positive offset for interpolateAtOffset |
| 2258 | u32 subPixelInterpolationOffsetBits /// num of subpixel bits for interpolateAtOffset |
| 2259 | |
| 2260 | u32 maxFramebufferWidth /// max width for a framebuffer |
| 2261 | u32 maxFramebufferHeight /// max height for a framebuffer |
| 2262 | u32 maxFramebufferLayers /// max layer count for a layered framebuffer |
Jesse Hall | 091ed9e | 2015-11-30 00:55:29 -0800 | [diff] [blame] | 2263 | VkSampleCountFlags framebufferColorSampleCounts |
| 2264 | VkSampleCountFlags framebufferDepthSampleCounts |
| 2265 | VkSampleCountFlags framebufferStencilSampleCounts |
| 2266 | VkSampleCountFlags framebufferNoAttachmentSampleCounts |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2267 | u32 maxColorAttachments /// max num of framebuffer color attachments |
| 2268 | |
Jesse Hall | 091ed9e | 2015-11-30 00:55:29 -0800 | [diff] [blame] | 2269 | VkSampleCountFlags sampledImageColorSampleCounts |
| 2270 | VkSampleCountFlags sampledImageIntegerSampleCounts |
| 2271 | VkSampleCountFlags sampledImageDepthSampleCounts |
| 2272 | VkSampleCountFlags sampledImageStencilSampleCounts |
| 2273 | VkSampleCountFlags storageImageSampleCounts |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2274 | u32 maxSampleMaskWords /// max num of sample mask words |
Jesse Hall | f9fa9a5 | 2016-01-08 16:08:51 -0800 | [diff] [blame] | 2275 | VkBool32 timestampComputeAndGraphics |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2276 | |
Jesse Hall | a9bb62b | 2015-11-21 19:31:56 -0800 | [diff] [blame] | 2277 | f32 timestampPeriod |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2278 | |
| 2279 | u32 maxClipDistances /// max number of clip distances |
| 2280 | u32 maxCullDistances /// max number of cull distances |
| 2281 | u32 maxCombinedClipAndCullDistances /// max combined number of user clipping |
| 2282 | |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 2283 | u32 discreteQueuePriorities |
| 2284 | |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2285 | f32[2] pointSizeRange /// range (min,max) of supported point sizes |
| 2286 | f32[2] lineWidthRange /// range (min,max) of supported line widths |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2287 | f32 pointSizeGranularity /// granularity of supported point sizes |
| 2288 | f32 lineWidthGranularity /// granularity of supported line widths |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 2289 | VkBool32 strictLines |
Jesse Hall | 091ed9e | 2015-11-30 00:55:29 -0800 | [diff] [blame] | 2290 | VkBool32 standardSampleLocations |
Jesse Hall | a9bb62b | 2015-11-21 19:31:56 -0800 | [diff] [blame] | 2291 | |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 2292 | VkDeviceSize optimalBufferCopyOffsetAlignment |
| 2293 | VkDeviceSize optimalBufferCopyRowPitchAlignment |
Jesse Hall | dba27f7 | 2015-11-30 14:25:46 -0800 | [diff] [blame] | 2294 | VkDeviceSize nonCoherentAtomSize |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2295 | } |
| 2296 | |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2297 | class VkPhysicalDeviceSparseProperties { |
| 2298 | VkBool32 residencyStandard2DBlockShape /// Sparse resources support: GPU will access all 2D (single sample) sparse resources using the standard block shapes (based on pixel format) |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 2299 | VkBool32 residencyStandard2DMultisampleBlockShape /// Sparse resources support: GPU will access all 2D (multisample) sparse resources using the standard block shapes (based on pixel format) |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2300 | VkBool32 residencyStandard3DBlockShape /// Sparse resources support: GPU will access all 3D sparse resources using the standard block shapes (based on pixel format) |
| 2301 | VkBool32 residencyAlignedMipSize /// Sparse resources support: Images with mip-level dimensions that are NOT a multiple of the block size will be placed in the mip tail |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2302 | VkBool32 residencyNonResidentStrict /// Sparse resources support: GPU can safely access non-resident regions of a resource, all reads return as if data is 0, writes are discarded |
| 2303 | } |
| 2304 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2305 | class VkSemaphoreCreateInfo { |
| 2306 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO |
| 2307 | const void* pNext /// Pointer to next structure |
| 2308 | VkSemaphoreCreateFlags flags /// Semaphore creation flags |
| 2309 | } |
| 2310 | |
| 2311 | class VkQueryPoolCreateInfo { |
| 2312 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO |
| 2313 | const void* pNext /// Pointer to next structure |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2314 | VkQueryPoolCreateFlags flags |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2315 | VkQueryType queryType |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 2316 | u32 entryCount |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2317 | VkQueryPipelineStatisticFlags pipelineStatistics /// Optional |
| 2318 | } |
| 2319 | |
| 2320 | class VkFramebufferCreateInfo { |
| 2321 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO |
| 2322 | const void* pNext /// Pointer to next structure |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2323 | VkFramebufferCreateFlags flags |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2324 | VkRenderPass renderPass |
| 2325 | u32 attachmentCount |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2326 | const VkImageView* pAttachments |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2327 | u32 width |
| 2328 | u32 height |
| 2329 | u32 layers |
| 2330 | } |
| 2331 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2332 | class VkDrawIndirectCommand { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2333 | u32 vertexCount |
| 2334 | u32 instanceCount |
| 2335 | u32 firstVertex |
| 2336 | u32 firstInstance |
| 2337 | } |
| 2338 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2339 | class VkDrawIndexedIndirectCommand { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2340 | u32 indexCount |
| 2341 | u32 instanceCount |
| 2342 | u32 firstIndex |
| 2343 | s32 vertexOffset |
| 2344 | u32 firstInstance |
| 2345 | } |
| 2346 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2347 | class VkDispatchIndirectCommand { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2348 | u32 x |
| 2349 | u32 y |
| 2350 | u32 z |
| 2351 | } |
| 2352 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 2353 | @extension("VK_KHR_surface") |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 2354 | class VkSurfaceCapabilitiesKHR { |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2355 | u32 minImageCount |
| 2356 | u32 maxImageCount |
| 2357 | VkExtent2D currentExtent |
| 2358 | VkExtent2D minImageExtent |
| 2359 | VkExtent2D maxImageExtent |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 2360 | u32 maxImageArrayLayers |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2361 | VkSurfaceTransformFlagsKHR supportedTransforms |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 2362 | VkSurfaceTransformFlagBitsKHR currentTransform |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2363 | VkCompositeAlphaFlagsKHR supportedCompositeAlpha |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2364 | VkImageUsageFlags supportedUsageFlags |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 2365 | } |
| 2366 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 2367 | @extension("VK_KHR_surface") |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 2368 | class VkSurfaceFormatKHR { |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2369 | VkFormat format |
| 2370 | VkColorSpaceKHR colorSpace |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 2371 | } |
| 2372 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 2373 | @extension("VK_KHR_swapchain") |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 2374 | class VkSwapchainCreateInfoKHR { |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2375 | VkStructureType sType |
| 2376 | const void* pNext |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 2377 | VkSwapchainCreateFlagsKHR flags |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2378 | VkSurfaceKHR surface |
| 2379 | u32 minImageCount |
| 2380 | VkFormat imageFormat |
| 2381 | VkColorSpaceKHR imageColorSpace |
| 2382 | VkExtent2D imageExtent |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 2383 | u32 imageArrayLayers |
| 2384 | VkImageUsageFlags imageUsage |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2385 | VkSharingMode sharingMode |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 2386 | u32 queueFamilyIndexCount |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2387 | const u32* pQueueFamilyIndices |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 2388 | VkSurfaceTransformFlagBitsKHR preTransform |
| 2389 | VkCompositeAlphaFlagBitsKHR compositeAlpha |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2390 | VkPresentModeKHR presentMode |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2391 | VkBool32 clipped |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 2392 | VkSwapchainKHR oldSwapchain |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 2393 | } |
| 2394 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 2395 | @extension("VK_KHR_swapchain") |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 2396 | class VkPresentInfoKHR { |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2397 | VkStructureType sType |
| 2398 | const void* pNext |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 2399 | u32 waitSemaphoreCount |
| 2400 | const VkSemaphore* pWaitSemaphores |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2401 | u32 swapchainCount |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 2402 | const VkSwapchainKHR* pSwapchains |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 2403 | const u32* pImageIndices |
Jesse Hall | e1b1278 | 2015-11-30 11:27:32 -0800 | [diff] [blame] | 2404 | VkResult* pResults |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 2405 | } |
| 2406 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 2407 | @extension("VK_KHR_display") |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2408 | class VkDisplayPropertiesKHR { |
| 2409 | VkDisplayKHR display |
| 2410 | const char* displayName |
| 2411 | VkExtent2D physicalDimensions |
| 2412 | VkExtent2D physicalResolution |
| 2413 | VkSurfaceTransformFlagsKHR supportedTransforms |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2414 | VkBool32 planeReorderPossible |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2415 | VkBool32 persistentContent |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 2416 | } |
| 2417 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 2418 | @extension("VK_KHR_display") |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2419 | class VkDisplayModeParametersKHR { |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2420 | VkExtent2D visibleRegion |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2421 | u32 refreshRate |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 2422 | } |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2423 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 2424 | @extension("VK_KHR_display") |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2425 | class VkDisplayModePropertiesKHR { |
| 2426 | VkDisplayModeKHR displayMode |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2427 | VkDisplayModeParametersKHR parameters |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2428 | } |
| 2429 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 2430 | @extension("VK_KHR_display") |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2431 | class VkDisplayModeCreateInfoKHR { |
| 2432 | VkStructureType sType |
| 2433 | const void* pNext |
Jesse Hall | 9ba8bc8 | 2015-11-30 16:22:16 -0800 | [diff] [blame] | 2434 | VkDisplayModeCreateFlagsKHR flags |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2435 | VkDisplayModeParametersKHR parameters |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2436 | } |
| 2437 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 2438 | @extension("VK_KHR_display") |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2439 | class VkDisplayPlanePropertiesKHR { |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2440 | VkDisplayKHR currentDisplay |
| 2441 | u32 currentStackIndex |
| 2442 | } |
| 2443 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 2444 | @extension("VK_KHR_display") |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2445 | class VkDisplayPlaneCapabilitiesKHR { |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2446 | VkDisplayPlaneAlphaFlagsKHR supportedAlpha |
| 2447 | VkOffset2D minSrcPosition |
| 2448 | VkOffset2D maxSrcPosition |
| 2449 | VkExtent2D minSrcExtent |
| 2450 | VkExtent2D maxSrcExtent |
| 2451 | VkOffset2D minDstPosition |
| 2452 | VkOffset2D maxDstPosition |
| 2453 | VkExtent2D minDstExtent |
| 2454 | VkExtent2D maxDstExtent |
| 2455 | } |
| 2456 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 2457 | @extension("VK_KHR_display") |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2458 | class VkDisplaySurfaceCreateInfoKHR { |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2459 | VkStructureType sType |
| 2460 | const void* pNext |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 2461 | VkDisplaySurfaceCreateFlagsKHR flags |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2462 | VkDisplayModeKHR displayMode |
| 2463 | u32 planeIndex |
| 2464 | u32 planeStackIndex |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 2465 | VkSurfaceTransformFlagBitsKHR transform |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2466 | f32 globalAlpha |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 2467 | VkDisplayPlaneAlphaFlagBitsKHR alphaMode |
| 2468 | VkExtent2D imageExtent |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2469 | } |
| 2470 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 2471 | @extension("VK_KHR_display_swapchain") |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2472 | class VkDisplayPresentInfoKHR { |
| 2473 | VkStructureType sType |
| 2474 | const void* pNext |
| 2475 | VkRect2D srcRect |
| 2476 | VkRect2D dstRect |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 2477 | VkBool32 persistent |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2478 | } |
| 2479 | |
Jesse Hall | f9fa9a5 | 2016-01-08 16:08:51 -0800 | [diff] [blame] | 2480 | @extension("VK_KHR_xlib_surface") |
| 2481 | class VkXlibSurfaceCreateInfoKHR { |
| 2482 | VkStructureType sType |
| 2483 | const void* pNext |
| 2484 | VkXlibSurfaceCreateFlagsKHR flags |
| 2485 | platform.Display* dpy |
| 2486 | platform.Window window |
| 2487 | } |
| 2488 | |
| 2489 | @extension("VK_KHR_xcb_surface") |
| 2490 | class VkXcbSurfaceCreateInfoKHR { |
| 2491 | VkStructureType sType |
| 2492 | const void* pNext |
| 2493 | VkXcbSurfaceCreateFlagsKHR flags |
| 2494 | platform.xcb_connection_t* connection |
| 2495 | platform.xcb_window_t window |
| 2496 | } |
| 2497 | |
| 2498 | @extension("VK_KHR_wayland_surface") |
| 2499 | class VkWaylandSurfaceCreateInfoKHR { |
| 2500 | VkStructureType sType |
| 2501 | const void* pNext |
| 2502 | VkWaylandSurfaceCreateFlagsKHR flags |
| 2503 | platform.wl_display* display |
| 2504 | platform.wl_surface* surface |
| 2505 | } |
| 2506 | |
| 2507 | @extension("VK_KHR_mir_surface") |
| 2508 | class VkMirSurfaceCreateInfoKHR { |
| 2509 | VkStructureType sType |
| 2510 | const void* pNext |
| 2511 | VkMirSurfaceCreateFlagsKHR flags |
| 2512 | platform.MirConnection* connection |
| 2513 | platform.MirSurface* mirSurface |
| 2514 | } |
| 2515 | |
| 2516 | @extension("VK_KHR_android_surface") |
| 2517 | class VkAndroidSurfaceCreateInfoKHR { |
| 2518 | VkStructureType sType |
| 2519 | const void* pNext |
| 2520 | VkAndroidSurfaceCreateFlagsKHR flags |
| 2521 | platform.ANativeWindow* window |
| 2522 | } |
| 2523 | |
| 2524 | @extension("VK_KHR_win32_surface") |
| 2525 | class VkWin32SurfaceCreateInfoKHR { |
| 2526 | VkStructureType sType |
| 2527 | const void* pNext |
| 2528 | VkWin32SurfaceCreateFlagsKHR flags |
| 2529 | platform.HINSTANCE hinstance |
| 2530 | platform.HWND hwnd |
| 2531 | } |
| 2532 | |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2533 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2534 | //////////////// |
| 2535 | // Commands // |
| 2536 | //////////////// |
| 2537 | |
| 2538 | // Function pointers. TODO: add support for function pointers. |
| 2539 | |
| 2540 | @external type void* PFN_vkVoidFunction |
| 2541 | @pfn cmd void vkVoidFunction() { |
| 2542 | } |
| 2543 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2544 | @external type void* PFN_vkAllocationFunction |
| 2545 | @pfn cmd void* vkAllocationFunction( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2546 | void* pUserData, |
| 2547 | platform.size_t size, |
| 2548 | platform.size_t alignment, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2549 | VkSystemAllocationScope allocationScope) { |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 2550 | return ? |
| 2551 | } |
| 2552 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2553 | @external type void* PFN_vkReallocationFunction |
| 2554 | @pfn cmd void* vkReallocationFunction( |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 2555 | void* pUserData, |
| 2556 | void* pOriginal, |
| 2557 | platform.size_t size, |
| 2558 | platform.size_t alignment, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2559 | VkSystemAllocationScope allocationScope) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2560 | return ? |
| 2561 | } |
| 2562 | |
| 2563 | @external type void* PFN_vkFreeFunction |
| 2564 | @pfn cmd void vkFreeFunction( |
| 2565 | void* pUserData, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2566 | void* pMemory) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2567 | } |
| 2568 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2569 | @external type void* PFN_vkInternalAllocationNotification |
| 2570 | @pfn cmd void vkInternalAllocationNotification( |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 2571 | void* pUserData, |
| 2572 | platform.size_t size, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2573 | VkInternalAllocationType allocationType, |
| 2574 | VkSystemAllocationScope allocationScope) { |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 2575 | } |
| 2576 | |
| 2577 | @external type void* PFN_vkInternalFreeNotification |
| 2578 | @pfn cmd void vkInternalFreeNotification( |
| 2579 | void* pUserData, |
| 2580 | platform.size_t size, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2581 | VkInternalAllocationType allocationType, |
| 2582 | VkSystemAllocationScope allocationScope) { |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 2583 | } |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2584 | |
| 2585 | // Global functions |
| 2586 | |
| 2587 | @threadSafety("system") |
| 2588 | cmd VkResult vkCreateInstance( |
| 2589 | const VkInstanceCreateInfo* pCreateInfo, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2590 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2591 | VkInstance* pInstance) { |
| 2592 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO) |
| 2593 | |
| 2594 | instance := ? |
| 2595 | pInstance[0] = instance |
| 2596 | State.Instances[instance] = new!InstanceObject() |
| 2597 | |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 2598 | layers := pCreateInfo.ppEnabledLayerNames[0:pCreateInfo.enabledLayerNameCount] |
| 2599 | extensions := pCreateInfo.ppEnabledExtensionNames[0:pCreateInfo.enabledExtensionNameCount] |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2600 | |
| 2601 | return ? |
| 2602 | } |
| 2603 | |
| 2604 | @threadSafety("system") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2605 | cmd void vkDestroyInstance( |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 2606 | VkInstance instance, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2607 | const VkAllocationCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2608 | instanceObject := GetInstance(instance) |
| 2609 | |
| 2610 | State.Instances[instance] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2611 | } |
| 2612 | |
| 2613 | @threadSafety("system") |
| 2614 | cmd VkResult vkEnumeratePhysicalDevices( |
| 2615 | VkInstance instance, |
| 2616 | u32* pPhysicalDeviceCount, |
| 2617 | VkPhysicalDevice* pPhysicalDevices) { |
| 2618 | instanceObject := GetInstance(instance) |
| 2619 | |
| 2620 | physicalDeviceCount := as!u32(?) |
| 2621 | pPhysicalDeviceCount[0] = physicalDeviceCount |
| 2622 | physicalDevices := pPhysicalDevices[0:physicalDeviceCount] |
| 2623 | |
| 2624 | for i in (0 .. physicalDeviceCount) { |
| 2625 | physicalDevice := ? |
| 2626 | physicalDevices[i] = physicalDevice |
| 2627 | if !(physicalDevice in State.PhysicalDevices) { |
| 2628 | State.PhysicalDevices[physicalDevice] = new!PhysicalDeviceObject(instance: instance) |
| 2629 | } |
| 2630 | } |
| 2631 | |
| 2632 | return ? |
| 2633 | } |
| 2634 | |
| 2635 | cmd PFN_vkVoidFunction vkGetDeviceProcAddr( |
| 2636 | VkDevice device, |
| 2637 | const char* pName) { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2638 | if device != NULL_HANDLE { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2639 | device := GetDevice(device) |
| 2640 | } |
| 2641 | |
| 2642 | return ? |
| 2643 | } |
| 2644 | |
| 2645 | cmd PFN_vkVoidFunction vkGetInstanceProcAddr( |
| 2646 | VkInstance instance, |
| 2647 | const char* pName) { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2648 | if instance != NULL_HANDLE { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2649 | instanceObject := GetInstance(instance) |
| 2650 | } |
| 2651 | |
| 2652 | return ? |
| 2653 | } |
| 2654 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 2655 | cmd void vkGetPhysicalDeviceProperties( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2656 | VkPhysicalDevice physicalDevice, |
| 2657 | VkPhysicalDeviceProperties* pProperties) { |
| 2658 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
| 2659 | |
| 2660 | properties := ? |
| 2661 | pProperties[0] = properties |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2662 | } |
| 2663 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 2664 | cmd void vkGetPhysicalDeviceQueueFamilyProperties( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2665 | VkPhysicalDevice physicalDevice, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 2666 | u32* pQueueFamilyPropertyCount, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2667 | VkQueueFamilyProperties* pQueueFamilyProperties) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2668 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2669 | // TODO: Figure out how to express fetch-count-or-properties |
| 2670 | // This version fails 'apic validate' with 'fence not allowed in |
| 2671 | // *semantic.Branch'. Other attempts have failed with the same or other |
| 2672 | // errors. |
| 2673 | // if pQueueFamilyProperties != null { |
| 2674 | // queuesProperties := pQueueFamilyProperties[0:pCount[0]] |
| 2675 | // for i in (0 .. pCount[0]) { |
| 2676 | // queueProperties := as!VkQueueFamilyProperties(?) |
| 2677 | // queuesProperties[i] = queueProperties |
| 2678 | // } |
| 2679 | // } else { |
| 2680 | // count := ? |
| 2681 | // pCount[0] = count |
| 2682 | // } |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2683 | } |
| 2684 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 2685 | cmd void vkGetPhysicalDeviceMemoryProperties( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2686 | VkPhysicalDevice physicalDevice, |
| 2687 | VkPhysicalDeviceMemoryProperties* pMemoryProperties) { |
| 2688 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
| 2689 | |
| 2690 | memoryProperties := ? |
| 2691 | pMemoryProperties[0] = memoryProperties |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2692 | } |
| 2693 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 2694 | cmd void vkGetPhysicalDeviceFeatures( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2695 | VkPhysicalDevice physicalDevice, |
| 2696 | VkPhysicalDeviceFeatures* pFeatures) { |
| 2697 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
| 2698 | |
| 2699 | features := ? |
| 2700 | pFeatures[0] = features |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2701 | } |
| 2702 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 2703 | cmd void vkGetPhysicalDeviceFormatProperties( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2704 | VkPhysicalDevice physicalDevice, |
| 2705 | VkFormat format, |
| 2706 | VkFormatProperties* pFormatProperties) { |
| 2707 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
| 2708 | |
| 2709 | formatProperties := ? |
| 2710 | pFormatProperties[0] = formatProperties |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2711 | } |
| 2712 | |
Jesse Hall | a9e5703 | 2015-11-30 01:03:10 -0800 | [diff] [blame] | 2713 | cmd VkResult vkGetPhysicalDeviceImageFormatProperties( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2714 | VkPhysicalDevice physicalDevice, |
| 2715 | VkFormat format, |
| 2716 | VkImageType type, |
| 2717 | VkImageTiling tiling, |
| 2718 | VkImageUsageFlags usage, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2719 | VkImageCreateFlags flags, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2720 | VkImageFormatProperties* pImageFormatProperties) { |
| 2721 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
| 2722 | |
| 2723 | imageFormatProperties := ? |
| 2724 | pImageFormatProperties[0] = imageFormatProperties |
Jesse Hall | a9e5703 | 2015-11-30 01:03:10 -0800 | [diff] [blame] | 2725 | |
| 2726 | return ? |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2727 | } |
| 2728 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2729 | |
| 2730 | // Device functions |
| 2731 | |
| 2732 | @threadSafety("system") |
| 2733 | cmd VkResult vkCreateDevice( |
| 2734 | VkPhysicalDevice physicalDevice, |
| 2735 | const VkDeviceCreateInfo* pCreateInfo, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2736 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2737 | VkDevice* pDevice) { |
| 2738 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO) |
| 2739 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
| 2740 | |
| 2741 | device := ? |
| 2742 | pDevice[0] = device |
| 2743 | State.Devices[device] = new!DeviceObject(physicalDevice: physicalDevice) |
| 2744 | |
| 2745 | return ? |
| 2746 | } |
| 2747 | |
| 2748 | @threadSafety("system") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2749 | cmd void vkDestroyDevice( |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 2750 | VkDevice device, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2751 | const VkAllocationCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2752 | deviceObject := GetDevice(device) |
| 2753 | |
| 2754 | State.Devices[device] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2755 | } |
| 2756 | |
| 2757 | |
| 2758 | // Extension discovery functions |
| 2759 | |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2760 | cmd VkResult vkEnumerateInstanceLayerProperties( |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 2761 | u32* pPropertyCount, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2762 | VkLayerProperties* pProperties) { |
| 2763 | count := as!u32(?) |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 2764 | pPropertyCount[0] = count |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2765 | |
| 2766 | properties := pProperties[0:count] |
| 2767 | for i in (0 .. count) { |
| 2768 | property := ? |
| 2769 | properties[i] = property |
| 2770 | } |
| 2771 | |
| 2772 | return ? |
| 2773 | } |
| 2774 | |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2775 | cmd VkResult vkEnumerateInstanceExtensionProperties( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2776 | const char* pLayerName, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 2777 | u32* pPropertyCount, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2778 | VkExtensionProperties* pProperties) { |
| 2779 | count := as!u32(?) |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 2780 | pPropertyCount[0] = count |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2781 | |
| 2782 | properties := pProperties[0:count] |
| 2783 | for i in (0 .. count) { |
| 2784 | property := ? |
| 2785 | properties[i] = property |
| 2786 | } |
| 2787 | |
| 2788 | return ? |
| 2789 | } |
| 2790 | |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2791 | cmd VkResult vkEnumerateDeviceLayerProperties( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2792 | VkPhysicalDevice physicalDevice, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 2793 | u32* pPropertyCount, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2794 | VkLayerProperties* pProperties) { |
| 2795 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
| 2796 | count := as!u32(?) |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 2797 | pPropertyCount[0] = count |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2798 | |
| 2799 | properties := pProperties[0:count] |
| 2800 | for i in (0 .. count) { |
| 2801 | property := ? |
| 2802 | properties[i] = property |
| 2803 | } |
| 2804 | |
| 2805 | return ? |
| 2806 | } |
| 2807 | |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2808 | cmd VkResult vkEnumerateDeviceExtensionProperties( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2809 | VkPhysicalDevice physicalDevice, |
| 2810 | const char* pLayerName, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 2811 | u32* pPropertyCount, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2812 | VkExtensionProperties* pProperties) { |
| 2813 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
| 2814 | |
| 2815 | count := as!u32(?) |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 2816 | pPropertyCount[0] = count |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2817 | |
| 2818 | properties := pProperties[0:count] |
| 2819 | for i in (0 .. count) { |
| 2820 | property := ? |
| 2821 | properties[i] = property |
| 2822 | } |
| 2823 | |
| 2824 | return ? |
| 2825 | } |
| 2826 | |
| 2827 | |
| 2828 | // Queue functions |
| 2829 | |
| 2830 | @threadSafety("system") |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 2831 | cmd void vkGetDeviceQueue( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2832 | VkDevice device, |
| 2833 | u32 queueFamilyIndex, |
| 2834 | u32 queueIndex, |
| 2835 | VkQueue* pQueue) { |
| 2836 | deviceObject := GetDevice(device) |
| 2837 | |
| 2838 | queue := ? |
| 2839 | pQueue[0] = queue |
| 2840 | |
| 2841 | if !(queue in State.Queues) { |
| 2842 | State.Queues[queue] = new!QueueObject(device: device) |
| 2843 | } |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2844 | } |
| 2845 | |
| 2846 | @threadSafety("app") |
| 2847 | cmd VkResult vkQueueSubmit( |
| 2848 | VkQueue queue, |
Jesse Hall | a366a51 | 2015-11-19 22:30:07 -0800 | [diff] [blame] | 2849 | u32 submitCount, |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 2850 | const VkSubmitInfo* pSubmits, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2851 | VkFence fence) { |
| 2852 | queueObject := GetQueue(queue) |
| 2853 | |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2854 | if fence != NULL_HANDLE { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2855 | fenceObject := GetFence(fence) |
| 2856 | assert(fenceObject.device == queueObject.device) |
| 2857 | } |
| 2858 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2859 | // commandBuffers := pcommandBuffers[0:commandBufferCount] |
| 2860 | // for i in (0 .. commandBufferCount) { |
| 2861 | // commandBuffer := commandBuffers[i] |
| 2862 | // commandBufferObject := GetCommandBuffer(commandBuffer) |
| 2863 | // assert(commandBufferObject.device == queueObject.device) |
Jesse Hall | a366a51 | 2015-11-19 22:30:07 -0800 | [diff] [blame] | 2864 | // |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2865 | // validate("QueueCheck", commandBufferObject.queueFlags in queueObject.flags, |
| 2866 | // "vkQueueSubmit: enqueued commandBuffer requires missing queue capabilities.") |
Jesse Hall | a366a51 | 2015-11-19 22:30:07 -0800 | [diff] [blame] | 2867 | // } |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2868 | |
| 2869 | return ? |
| 2870 | } |
| 2871 | |
| 2872 | @threadSafety("system") |
| 2873 | cmd VkResult vkQueueWaitIdle( |
| 2874 | VkQueue queue) { |
| 2875 | queueObject := GetQueue(queue) |
| 2876 | |
| 2877 | return ? |
| 2878 | } |
| 2879 | |
| 2880 | @threadSafety("system") |
| 2881 | cmd VkResult vkDeviceWaitIdle( |
| 2882 | VkDevice device) { |
| 2883 | deviceObject := GetDevice(device) |
| 2884 | |
| 2885 | return ? |
| 2886 | } |
| 2887 | |
| 2888 | |
| 2889 | // Memory functions |
| 2890 | |
| 2891 | @threadSafety("system") |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2892 | cmd VkResult vkAllocateMemory( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2893 | VkDevice device, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2894 | const VkMemoryAllocateInfo* pAllocateInfo, |
| 2895 | const VkAllocationCallbacks* pAllocator, |
| 2896 | VkDeviceMemory* pMemory) { |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 2897 | assert(pAllocateInfo.sType == VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2898 | deviceObject := GetDevice(device) |
| 2899 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2900 | memory := ? |
| 2901 | pMemory[0] = memory |
| 2902 | State.DeviceMemories[memory] = new!DeviceMemoryObject( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2903 | device: device, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2904 | allocationSize: pAllocateInfo[0].allocationSize) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2905 | |
| 2906 | return ? |
| 2907 | } |
| 2908 | |
| 2909 | @threadSafety("system") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2910 | cmd void vkFreeMemory( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2911 | VkDevice device, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2912 | VkDeviceMemory memory, |
| 2913 | const VkAllocationCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2914 | deviceObject := GetDevice(device) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2915 | memoryObject := GetDeviceMemory(memory) |
| 2916 | assert(memoryObject.device == device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2917 | |
| 2918 | // Check that no objects are still bound before freeing. |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2919 | validate("MemoryCheck", len(memoryObject.boundObjects) == 0, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2920 | "vkFreeMemory: objects still bound") |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2921 | validate("MemoryCheck", len(memoryObject.boundCommandBuffers) == 0, |
| 2922 | "vkFreeMemory: commandBuffers still bound") |
| 2923 | State.DeviceMemories[memory] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2924 | } |
| 2925 | |
| 2926 | @threadSafety("app") |
| 2927 | cmd VkResult vkMapMemory( |
| 2928 | VkDevice device, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2929 | VkDeviceMemory memory, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2930 | VkDeviceSize offset, |
| 2931 | VkDeviceSize size, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2932 | VkMemoryMapFlags flags, |
| 2933 | void** ppData) { |
| 2934 | deviceObject := GetDevice(device) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2935 | memoryObject := GetDeviceMemory(memory) |
| 2936 | assert(memoryObject.device == device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2937 | |
| 2938 | assert(flags == as!VkMemoryMapFlags(0)) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2939 | assert((offset + size) <= memoryObject.allocationSize) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2940 | |
| 2941 | return ? |
| 2942 | } |
| 2943 | |
| 2944 | @threadSafety("app") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2945 | cmd void vkUnmapMemory( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2946 | VkDevice device, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2947 | VkDeviceMemory memory) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2948 | deviceObject := GetDevice(device) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2949 | memoryObject := GetDeviceMemory(memory) |
| 2950 | assert(memoryObject.device == device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2951 | } |
| 2952 | |
| 2953 | cmd VkResult vkFlushMappedMemoryRanges( |
| 2954 | VkDevice device, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2955 | u32 memoryRangeCount |
| 2956 | const VkMappedMemoryRange* pMemoryRanges) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2957 | deviceObject := GetDevice(device) |
| 2958 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2959 | memoryRanges := pMemoryRanges[0:memoryRangeCount] |
| 2960 | for i in (0 .. memoryRangeCount) { |
| 2961 | memoryRange := memoryRanges[i] |
| 2962 | memoryObject := GetDeviceMemory(memoryRange.memory) |
| 2963 | assert(memoryObject.device == device) |
| 2964 | assert((memoryRange.offset + memoryRange.size) <= memoryObject.allocationSize) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2965 | } |
| 2966 | |
| 2967 | return ? |
| 2968 | } |
| 2969 | |
| 2970 | cmd VkResult vkInvalidateMappedMemoryRanges( |
| 2971 | VkDevice device, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2972 | u32 memoryRangeCount, |
| 2973 | const VkMappedMemoryRange* pMemoryRanges) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2974 | deviceObject := GetDevice(device) |
| 2975 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 2976 | memoryRanges := pMemoryRanges[0:memoryRangeCount] |
| 2977 | for i in (0 .. memoryRangeCount) { |
| 2978 | memoryRange := memoryRanges[i] |
| 2979 | memoryObject := GetDeviceMemory(memoryRange.memory) |
| 2980 | assert(memoryObject.device == device) |
| 2981 | assert((memoryRange.offset + memoryRange.size) <= memoryObject.allocationSize) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2982 | } |
| 2983 | |
| 2984 | return ? |
| 2985 | } |
| 2986 | |
| 2987 | |
| 2988 | // Memory management API functions |
| 2989 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 2990 | cmd void vkGetDeviceMemoryCommitment( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2991 | VkDevice device, |
| 2992 | VkDeviceMemory memory, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2993 | VkDeviceSize* pCommittedMemoryInBytes) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2994 | deviceObject := GetDevice(device) |
| 2995 | |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2996 | if memory != NULL_HANDLE { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2997 | memoryObject := GetDeviceMemory(memory) |
| 2998 | assert(memoryObject.device == device) |
| 2999 | } |
| 3000 | |
| 3001 | committedMemoryInBytes := ? |
| 3002 | pCommittedMemoryInBytes[0] = committedMemoryInBytes |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3003 | } |
| 3004 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 3005 | cmd void vkGetBufferMemoryRequirements( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3006 | VkDevice device, |
| 3007 | VkBuffer buffer, |
| 3008 | VkMemoryRequirements* pMemoryRequirements) { |
| 3009 | deviceObject := GetDevice(device) |
| 3010 | bufferObject := GetBuffer(buffer) |
| 3011 | assert(bufferObject.device == device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3012 | } |
| 3013 | |
| 3014 | cmd VkResult vkBindBufferMemory( |
| 3015 | VkDevice device, |
| 3016 | VkBuffer buffer, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3017 | VkDeviceMemory memory, |
| 3018 | VkDeviceSize memoryOffset) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3019 | deviceObject := GetDevice(device) |
| 3020 | bufferObject := GetBuffer(buffer) |
| 3021 | assert(bufferObject.device == device) |
| 3022 | |
| 3023 | // Unbind buffer from previous memory object, if not VK_NULL_HANDLE. |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3024 | if bufferObject.memory != NULL_HANDLE { |
| 3025 | memoryObject := GetDeviceMemory(bufferObject.memory) |
| 3026 | memoryObject.boundObjects[as!u64(buffer)] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3027 | } |
| 3028 | |
| 3029 | // Bind buffer to given memory object, if not VK_NULL_HANDLE. |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3030 | if memory != NULL_HANDLE { |
| 3031 | memoryObject := GetDeviceMemory(memory) |
| 3032 | assert(memoryObject.device == device) |
| 3033 | memoryObject.boundObjects[as!u64(buffer)] = memoryOffset |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3034 | } |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3035 | bufferObject.memory = memory |
| 3036 | bufferObject.memoryOffset = memoryOffset |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3037 | |
| 3038 | return ? |
| 3039 | } |
| 3040 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 3041 | cmd void vkGetImageMemoryRequirements( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3042 | VkDevice device, |
| 3043 | VkImage image, |
| 3044 | VkMemoryRequirements* pMemoryRequirements) { |
| 3045 | deviceObject := GetDevice(device) |
| 3046 | imageObject := GetImage(image) |
| 3047 | assert(imageObject.device == device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3048 | } |
| 3049 | |
| 3050 | cmd VkResult vkBindImageMemory( |
| 3051 | VkDevice device, |
| 3052 | VkImage image, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3053 | VkDeviceMemory memory, |
| 3054 | VkDeviceSize memoryOffset) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3055 | deviceObject := GetDevice(device) |
| 3056 | imageObject := GetImage(image) |
| 3057 | assert(imageObject.device == device) |
| 3058 | |
| 3059 | // Unbind image from previous memory object, if not VK_NULL_HANDLE. |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3060 | if imageObject.memory != NULL_HANDLE { |
| 3061 | memoryObject := GetDeviceMemory(imageObject.memory) |
| 3062 | memoryObject.boundObjects[as!u64(image)] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3063 | } |
| 3064 | |
| 3065 | // Bind image to given memory object, if not VK_NULL_HANDLE. |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3066 | if memory != NULL_HANDLE { |
| 3067 | memoryObject := GetDeviceMemory(memory) |
| 3068 | assert(memoryObject.device == device) |
| 3069 | memoryObject.boundObjects[as!u64(image)] = memoryOffset |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3070 | } |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3071 | imageObject.memory = memory |
| 3072 | imageObject.memoryOffset = memoryOffset |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3073 | |
| 3074 | return ? |
| 3075 | } |
| 3076 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 3077 | cmd void vkGetImageSparseMemoryRequirements( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3078 | VkDevice device, |
| 3079 | VkImage image, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 3080 | u32* pSparseMemoryRequirementCount, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3081 | VkSparseImageMemoryRequirements* pSparseMemoryRequirements) { |
| 3082 | deviceObject := GetDevice(device) |
| 3083 | imageObject := GetImage(image) |
| 3084 | assert(imageObject.device == device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3085 | } |
| 3086 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 3087 | cmd void vkGetPhysicalDeviceSparseImageFormatProperties( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3088 | VkPhysicalDevice physicalDevice, |
| 3089 | VkFormat format, |
| 3090 | VkImageType type, |
Jesse Hall | 091ed9e | 2015-11-30 00:55:29 -0800 | [diff] [blame] | 3091 | VkSampleCountFlagBits samples, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3092 | VkImageUsageFlags usage, |
| 3093 | VkImageTiling tiling, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 3094 | u32* pPropertyCount, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3095 | VkSparseImageFormatProperties* pProperties) { |
| 3096 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3097 | } |
| 3098 | |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 3099 | cmd VkResult vkQueueBindSparse( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3100 | VkQueue queue, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 3101 | u32 bindInfoCount, |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 3102 | const VkBindSparseInfo* pBindInfo, |
| 3103 | VkFence fence) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3104 | queueObject := GetQueue(queue) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3105 | |
| 3106 | return ? |
| 3107 | } |
| 3108 | |
| 3109 | |
| 3110 | // Fence functions |
| 3111 | |
| 3112 | @threadSafety("system") |
| 3113 | cmd VkResult vkCreateFence( |
| 3114 | VkDevice device, |
| 3115 | const VkFenceCreateInfo* pCreateInfo, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3116 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3117 | VkFence* pFence) { |
| 3118 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_FENCE_CREATE_INFO) |
| 3119 | deviceObject := GetDevice(device) |
| 3120 | |
| 3121 | fence := ? |
| 3122 | pFence[0] = fence |
| 3123 | State.Fences[fence] = new!FenceObject( |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 3124 | device: device, signaled: (pCreateInfo.flags == as!VkFenceCreateFlags(VK_FENCE_CREATE_SIGNALED_BIT))) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3125 | |
| 3126 | return ? |
| 3127 | } |
| 3128 | |
| 3129 | @threadSafety("system") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3130 | cmd void vkDestroyFence( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3131 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 3132 | VkFence fence, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3133 | const VkAllocationCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3134 | deviceObject := GetDevice(device) |
| 3135 | fenceObject := GetFence(fence) |
| 3136 | assert(fenceObject.device == device) |
| 3137 | |
| 3138 | State.Fences[fence] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3139 | } |
| 3140 | |
| 3141 | @threadSafety("system") |
| 3142 | cmd VkResult vkResetFences( |
| 3143 | VkDevice device, |
| 3144 | u32 fenceCount, |
| 3145 | const VkFence* pFences) { |
| 3146 | deviceObject := GetDevice(device) |
| 3147 | |
| 3148 | fences := pFences[0:fenceCount] |
| 3149 | for i in (0 .. fenceCount) { |
| 3150 | fence := fences[i] |
| 3151 | fenceObject := GetFence(fence) |
| 3152 | assert(fenceObject.device == device) |
| 3153 | fenceObject.signaled = false |
| 3154 | } |
| 3155 | |
| 3156 | return ? |
| 3157 | } |
| 3158 | |
| 3159 | @threadSafety("system") |
| 3160 | cmd VkResult vkGetFenceStatus( |
| 3161 | VkDevice device, |
| 3162 | VkFence fence) { |
| 3163 | deviceObject := GetDevice(device) |
| 3164 | fenceObject := GetFence(fence) |
| 3165 | assert(fenceObject.device == device) |
| 3166 | |
| 3167 | return ? |
| 3168 | } |
| 3169 | |
| 3170 | @threadSafety("system") |
| 3171 | cmd VkResult vkWaitForFences( |
| 3172 | VkDevice device, |
| 3173 | u32 fenceCount, |
| 3174 | const VkFence* pFences, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3175 | VkBool32 waitAll, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3176 | u64 timeout) { /// timeout in nanoseconds |
| 3177 | deviceObject := GetDevice(device) |
| 3178 | |
| 3179 | fences := pFences[0:fenceCount] |
| 3180 | for i in (0 .. fenceCount) { |
| 3181 | fence := fences[i] |
| 3182 | fenceObject := GetFence(fence) |
| 3183 | assert(fenceObject.device == device) |
| 3184 | } |
| 3185 | |
| 3186 | return ? |
| 3187 | } |
| 3188 | |
| 3189 | |
| 3190 | // Queue semaphore functions |
| 3191 | |
| 3192 | @threadSafety("system") |
| 3193 | cmd VkResult vkCreateSemaphore( |
| 3194 | VkDevice device, |
| 3195 | const VkSemaphoreCreateInfo* pCreateInfo, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3196 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3197 | VkSemaphore* pSemaphore) { |
| 3198 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO) |
| 3199 | deviceObject := GetDevice(device) |
| 3200 | |
| 3201 | semaphore := ? |
| 3202 | pSemaphore[0] = semaphore |
| 3203 | State.Semaphores[semaphore] = new!SemaphoreObject(device: device) |
| 3204 | |
| 3205 | return ? |
| 3206 | } |
| 3207 | |
| 3208 | @threadSafety("system") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3209 | cmd void vkDestroySemaphore( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3210 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 3211 | VkSemaphore semaphore, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3212 | const VkAllocationCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3213 | deviceObject := GetDevice(device) |
| 3214 | semaphoreObject := GetSemaphore(semaphore) |
| 3215 | assert(semaphoreObject.device == device) |
| 3216 | |
| 3217 | State.Semaphores[semaphore] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3218 | } |
| 3219 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3220 | |
| 3221 | // Event functions |
| 3222 | |
| 3223 | @threadSafety("system") |
| 3224 | cmd VkResult vkCreateEvent( |
| 3225 | VkDevice device, |
| 3226 | const VkEventCreateInfo* pCreateInfo, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3227 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3228 | VkEvent* pEvent) { |
| 3229 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_EVENT_CREATE_INFO) |
| 3230 | deviceObject := GetDevice(device) |
| 3231 | |
| 3232 | event := ? |
| 3233 | pEvent[0] = event |
| 3234 | State.Events[event] = new!EventObject(device: device) |
| 3235 | |
| 3236 | return ? |
| 3237 | } |
| 3238 | |
| 3239 | @threadSafety("system") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3240 | cmd void vkDestroyEvent( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3241 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 3242 | VkEvent event, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3243 | const VkAllocationCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3244 | deviceObject := GetDevice(device) |
| 3245 | eventObject := GetEvent(event) |
| 3246 | assert(eventObject.device == device) |
| 3247 | |
| 3248 | State.Events[event] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3249 | } |
| 3250 | |
| 3251 | @threadSafety("system") |
| 3252 | cmd VkResult vkGetEventStatus( |
| 3253 | VkDevice device, |
| 3254 | VkEvent event) { |
| 3255 | deviceObject := GetDevice(device) |
| 3256 | eventObject := GetEvent(event) |
| 3257 | assert(eventObject.device == device) |
| 3258 | |
| 3259 | return ? |
| 3260 | } |
| 3261 | |
| 3262 | @threadSafety("system") |
| 3263 | cmd VkResult vkSetEvent( |
| 3264 | VkDevice device, |
| 3265 | VkEvent event) { |
| 3266 | deviceObject := GetDevice(device) |
| 3267 | eventObject := GetEvent(event) |
| 3268 | assert(eventObject.device == device) |
| 3269 | |
| 3270 | return ? |
| 3271 | } |
| 3272 | |
| 3273 | @threadSafety("system") |
| 3274 | cmd VkResult vkResetEvent( |
| 3275 | VkDevice device, |
| 3276 | VkEvent event) { |
| 3277 | deviceObject := GetDevice(device) |
| 3278 | eventObject := GetEvent(event) |
| 3279 | assert(eventObject.device == device) |
| 3280 | |
| 3281 | return ? |
| 3282 | } |
| 3283 | |
| 3284 | |
| 3285 | // Query functions |
| 3286 | |
| 3287 | @threadSafety("system") |
| 3288 | cmd VkResult vkCreateQueryPool( |
| 3289 | VkDevice device, |
| 3290 | const VkQueryPoolCreateInfo* pCreateInfo, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3291 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3292 | VkQueryPool* pQueryPool) { |
| 3293 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO) |
| 3294 | deviceObject := GetDevice(device) |
| 3295 | |
| 3296 | queryPool := ? |
| 3297 | pQueryPool[0] = queryPool |
| 3298 | State.QueryPools[queryPool] = new!QueryPoolObject(device: device) |
| 3299 | |
| 3300 | return ? |
| 3301 | } |
| 3302 | |
| 3303 | @threadSafety("system") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3304 | cmd void vkDestroyQueryPool( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3305 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 3306 | VkQueryPool queryPool, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3307 | const VkAllocationCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3308 | deviceObject := GetDevice(device) |
| 3309 | queryPoolObject := GetQueryPool(queryPool) |
| 3310 | assert(queryPoolObject.device == device) |
| 3311 | |
| 3312 | State.QueryPools[queryPool] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3313 | } |
| 3314 | |
| 3315 | @threadSafety("system") |
| 3316 | cmd VkResult vkGetQueryPoolResults( |
| 3317 | VkDevice device, |
| 3318 | VkQueryPool queryPool, |
Jesse Hall | f9fa9a5 | 2016-01-08 16:08:51 -0800 | [diff] [blame] | 3319 | u32 firstQuery, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3320 | u32 queryCount, |
Jesse Hall | a9bb62b | 2015-11-21 19:31:56 -0800 | [diff] [blame] | 3321 | platform.size_t dataSize, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3322 | void* pData, |
Jesse Hall | a9bb62b | 2015-11-21 19:31:56 -0800 | [diff] [blame] | 3323 | VkDeviceSize stride, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3324 | VkQueryResultFlags flags) { |
| 3325 | deviceObject := GetDevice(device) |
| 3326 | queryPoolObject := GetQueryPool(queryPool) |
| 3327 | assert(queryPoolObject.device == device) |
| 3328 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3329 | data := pData[0:dataSize] |
| 3330 | |
| 3331 | return ? |
| 3332 | } |
| 3333 | |
| 3334 | // Buffer functions |
| 3335 | |
| 3336 | @threadSafety("system") |
| 3337 | cmd VkResult vkCreateBuffer( |
| 3338 | VkDevice device, |
| 3339 | const VkBufferCreateInfo* pCreateInfo, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3340 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3341 | VkBuffer* pBuffer) { |
| 3342 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO) |
| 3343 | deviceObject := GetDevice(device) |
| 3344 | |
| 3345 | buffer := ? |
| 3346 | pBuffer[0] = buffer |
| 3347 | State.Buffers[buffer] = new!BufferObject(device: device) |
| 3348 | |
| 3349 | return ? |
| 3350 | } |
| 3351 | |
| 3352 | @threadSafety("system") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3353 | cmd void vkDestroyBuffer( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3354 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 3355 | VkBuffer buffer, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3356 | const VkAllocationCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3357 | deviceObject := GetDevice(device) |
| 3358 | bufferObject := GetBuffer(buffer) |
| 3359 | assert(bufferObject.device == device) |
| 3360 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3361 | assert(bufferObject.memory == 0) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3362 | State.Buffers[buffer] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3363 | } |
| 3364 | |
| 3365 | |
| 3366 | // Buffer view functions |
| 3367 | |
| 3368 | @threadSafety("system") |
| 3369 | cmd VkResult vkCreateBufferView( |
| 3370 | VkDevice device, |
| 3371 | const VkBufferViewCreateInfo* pCreateInfo, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3372 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3373 | VkBufferView* pView) { |
| 3374 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO) |
| 3375 | deviceObject := GetDevice(device) |
| 3376 | |
| 3377 | bufferObject := GetBuffer(pCreateInfo.buffer) |
| 3378 | assert(bufferObject.device == device) |
| 3379 | |
| 3380 | view := ? |
| 3381 | pView[0] = view |
| 3382 | State.BufferViews[view] = new!BufferViewObject(device: device, buffer: pCreateInfo.buffer) |
| 3383 | |
| 3384 | return ? |
| 3385 | } |
| 3386 | |
| 3387 | @threadSafety("system") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3388 | cmd void vkDestroyBufferView( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3389 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 3390 | VkBufferView bufferView, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3391 | const VkAllocationCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3392 | deviceObject := GetDevice(device) |
| 3393 | bufferViewObject := GetBufferView(bufferView) |
| 3394 | assert(bufferViewObject.device == device) |
| 3395 | |
| 3396 | State.BufferViews[bufferView] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3397 | } |
| 3398 | |
| 3399 | |
| 3400 | // Image functions |
| 3401 | |
| 3402 | @threadSafety("system") |
| 3403 | cmd VkResult vkCreateImage( |
| 3404 | VkDevice device, |
| 3405 | const VkImageCreateInfo* pCreateInfo, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3406 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3407 | VkImage* pImage) { |
| 3408 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO) |
| 3409 | deviceObject := GetDevice(device) |
| 3410 | |
| 3411 | image := ? |
| 3412 | pImage[0] = image |
| 3413 | State.Images[image] = new!ImageObject(device: device) |
| 3414 | |
| 3415 | return ? |
| 3416 | } |
| 3417 | |
| 3418 | @threadSafety("system") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3419 | cmd void vkDestroyImage( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3420 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 3421 | VkImage image, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3422 | const VkAllocationCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3423 | deviceObject := GetDevice(device) |
| 3424 | imageObject := GetImage(image) |
| 3425 | assert(imageObject.device == device) |
| 3426 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3427 | assert(imageObject.memory == 0) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3428 | State.Images[image] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3429 | } |
| 3430 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 3431 | cmd void vkGetImageSubresourceLayout( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3432 | VkDevice device, |
| 3433 | VkImage image, |
| 3434 | const VkImageSubresource* pSubresource, |
| 3435 | VkSubresourceLayout* pLayout) { |
| 3436 | deviceObject := GetDevice(device) |
| 3437 | imageObject := GetImage(image) |
| 3438 | assert(imageObject.device == device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3439 | } |
| 3440 | |
| 3441 | |
| 3442 | // Image view functions |
| 3443 | |
| 3444 | @threadSafety("system") |
| 3445 | cmd VkResult vkCreateImageView( |
| 3446 | VkDevice device, |
| 3447 | const VkImageViewCreateInfo* pCreateInfo, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3448 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3449 | VkImageView* pView) { |
| 3450 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO) |
| 3451 | deviceObject := GetDevice(device) |
| 3452 | |
| 3453 | imageObject := GetImage(pCreateInfo.image) |
| 3454 | assert(imageObject.device == device) |
| 3455 | |
| 3456 | view := ? |
| 3457 | pView[0] = view |
| 3458 | State.ImageViews[view] = new!ImageViewObject(device: device, image: pCreateInfo.image) |
| 3459 | |
| 3460 | return ? |
| 3461 | } |
| 3462 | |
| 3463 | @threadSafety("system") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3464 | cmd void vkDestroyImageView( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3465 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 3466 | VkImageView imageView, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3467 | const VkAllocationCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3468 | deviceObject := GetDevice(device) |
| 3469 | imageViewObject := GetImageView(imageView) |
| 3470 | assert(imageViewObject.device == device) |
| 3471 | |
| 3472 | State.ImageViews[imageView] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3473 | } |
| 3474 | |
| 3475 | |
| 3476 | // Shader functions |
| 3477 | |
| 3478 | cmd VkResult vkCreateShaderModule( |
| 3479 | VkDevice device, |
| 3480 | const VkShaderModuleCreateInfo* pCreateInfo, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3481 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3482 | VkShaderModule* pShaderModule) { |
| 3483 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO) |
| 3484 | deviceObject := GetDevice(device) |
| 3485 | |
| 3486 | shaderModule := ? |
| 3487 | pShaderModule[0] = shaderModule |
| 3488 | State.ShaderModules[shaderModule] = new!ShaderModuleObject(device: device) |
| 3489 | |
| 3490 | return ? |
| 3491 | } |
| 3492 | |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3493 | cmd void vkDestroyShaderModule( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3494 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 3495 | VkShaderModule shaderModule, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3496 | const VkAllocationCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3497 | deviceObject := GetDevice(device) |
| 3498 | shaderModuleObject := GetShaderModule(shaderModule) |
| 3499 | assert(shaderModuleObject.device == device) |
| 3500 | |
| 3501 | State.ShaderModules[shaderModule] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3502 | } |
| 3503 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3504 | |
| 3505 | // Pipeline functions |
| 3506 | |
| 3507 | cmd VkResult vkCreatePipelineCache( |
| 3508 | VkDevice device, |
| 3509 | const VkPipelineCacheCreateInfo* pCreateInfo, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3510 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3511 | VkPipelineCache* pPipelineCache) { |
| 3512 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO) |
| 3513 | deviceObject := GetDevice(device) |
| 3514 | |
| 3515 | pipelineCache := ? |
| 3516 | pPipelineCache[0] = pipelineCache |
| 3517 | State.PipelineCaches[pipelineCache] = new!PipelineCacheObject(device: device) |
| 3518 | |
| 3519 | return ? |
| 3520 | } |
| 3521 | |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3522 | cmd void vkDestroyPipelineCache( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3523 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 3524 | VkPipelineCache pipelineCache, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3525 | const VkAllocationCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3526 | deviceObject := GetDevice(device) |
| 3527 | pipelineCacheObject := GetPipelineCache(pipelineCache) |
| 3528 | assert(pipelineCacheObject.device == device) |
| 3529 | |
| 3530 | State.PipelineCaches[pipelineCache] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3531 | } |
| 3532 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3533 | cmd VkResult vkGetPipelineCacheData( |
| 3534 | VkDevice device, |
| 3535 | VkPipelineCache pipelineCache, |
Jesse Hall | a9bb62b | 2015-11-21 19:31:56 -0800 | [diff] [blame] | 3536 | platform.size_t* pDataSize, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3537 | void* pData) { |
| 3538 | deviceObject := GetDevice(device) |
| 3539 | pipelineCacheObject := GetPipelineCache(pipelineCache) |
| 3540 | assert(pipelineCacheObject.device == device) |
| 3541 | |
| 3542 | return ? |
| 3543 | } |
| 3544 | |
| 3545 | cmd VkResult vkMergePipelineCaches( |
| 3546 | VkDevice device, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3547 | VkPipelineCache dstCache, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3548 | u32 srcCacheCount, |
| 3549 | const VkPipelineCache* pSrcCaches) { |
| 3550 | deviceObject := GetDevice(device) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3551 | dstCacheObject := GetPipelineCache(dstCache) |
| 3552 | assert(dstCacheObject.device == device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3553 | |
| 3554 | srcCaches := pSrcCaches[0:srcCacheCount] |
| 3555 | for i in (0 .. srcCacheCount) { |
| 3556 | srcCache := srcCaches[i] |
| 3557 | srcCacheObject := GetPipelineCache(srcCache) |
| 3558 | assert(srcCacheObject.device == device) |
| 3559 | } |
| 3560 | |
| 3561 | return ? |
| 3562 | } |
| 3563 | |
| 3564 | cmd VkResult vkCreateGraphicsPipelines( |
| 3565 | VkDevice device, |
| 3566 | VkPipelineCache pipelineCache, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 3567 | u32 createInfoCount, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3568 | const VkGraphicsPipelineCreateInfo* pCreateInfos, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3569 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3570 | VkPipeline* pPipelines) { |
| 3571 | deviceObject := GetDevice(device) |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3572 | if pipelineCache != NULL_HANDLE { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3573 | pipelineCacheObject := GetPipelineCache(pipelineCache) |
| 3574 | assert(pipelineCacheObject.device == device) |
| 3575 | } |
| 3576 | |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 3577 | createInfos := pCreateInfos[0:createInfoCount] |
| 3578 | pipelines := pPipelines[0:createInfoCount] |
| 3579 | for i in (0 .. createInfoCount) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3580 | pipeline := ? |
| 3581 | pipelines[i] = pipeline |
| 3582 | State.Pipelines[pipeline] = new!PipelineObject(device: device) |
| 3583 | } |
| 3584 | |
| 3585 | return ? |
| 3586 | } |
| 3587 | |
| 3588 | cmd VkResult vkCreateComputePipelines( |
| 3589 | VkDevice device, |
| 3590 | VkPipelineCache pipelineCache, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 3591 | u32 createInfoCount, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3592 | const VkComputePipelineCreateInfo* pCreateInfos, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3593 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3594 | VkPipeline* pPipelines) { |
| 3595 | deviceObject := GetDevice(device) |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3596 | if pipelineCache != NULL_HANDLE { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3597 | pipelineCacheObject := GetPipelineCache(pipelineCache) |
| 3598 | assert(pipelineCacheObject.device == device) |
| 3599 | } |
| 3600 | |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 3601 | createInfos := pCreateInfos[0:createInfoCount] |
| 3602 | pipelines := pPipelines[0:createInfoCount] |
| 3603 | for i in (0 .. createInfoCount) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3604 | pipeline := ? |
| 3605 | pipelines[i] = pipeline |
| 3606 | State.Pipelines[pipeline] = new!PipelineObject(device: device) |
| 3607 | } |
| 3608 | |
| 3609 | return ? |
| 3610 | } |
| 3611 | |
| 3612 | @threadSafety("system") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3613 | cmd void vkDestroyPipeline( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3614 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 3615 | VkPipeline pipeline, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3616 | const VkAllocationCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3617 | deviceObject := GetDevice(device) |
| 3618 | pipelineObjects := GetPipeline(pipeline) |
| 3619 | assert(pipelineObjects.device == device) |
| 3620 | |
| 3621 | State.Pipelines[pipeline] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3622 | } |
| 3623 | |
| 3624 | |
| 3625 | // Pipeline layout functions |
| 3626 | |
| 3627 | @threadSafety("system") |
| 3628 | cmd VkResult vkCreatePipelineLayout( |
| 3629 | VkDevice device, |
| 3630 | const VkPipelineLayoutCreateInfo* pCreateInfo, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3631 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3632 | VkPipelineLayout* pPipelineLayout) { |
| 3633 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO) |
| 3634 | deviceObject := GetDevice(device) |
| 3635 | |
| 3636 | pipelineLayout := ? |
| 3637 | pPipelineLayout[0] = pipelineLayout |
| 3638 | State.PipelineLayouts[pipelineLayout] = new!PipelineLayoutObject(device: device) |
| 3639 | |
| 3640 | return ? |
| 3641 | } |
| 3642 | |
| 3643 | @threadSafety("system") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3644 | cmd void vkDestroyPipelineLayout( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3645 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 3646 | VkPipelineLayout pipelineLayout, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3647 | const VkAllocationCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3648 | deviceObject := GetDevice(device) |
| 3649 | pipelineLayoutObjects := GetPipelineLayout(pipelineLayout) |
| 3650 | assert(pipelineLayoutObjects.device == device) |
| 3651 | |
| 3652 | State.PipelineLayouts[pipelineLayout] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3653 | } |
| 3654 | |
| 3655 | |
| 3656 | // Sampler functions |
| 3657 | |
| 3658 | @threadSafety("system") |
| 3659 | cmd VkResult vkCreateSampler( |
| 3660 | VkDevice device, |
| 3661 | const VkSamplerCreateInfo* pCreateInfo, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3662 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3663 | VkSampler* pSampler) { |
| 3664 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO) |
| 3665 | deviceObject := GetDevice(device) |
| 3666 | |
| 3667 | sampler := ? |
| 3668 | pSampler[0] = sampler |
| 3669 | State.Samplers[sampler] = new!SamplerObject(device: device) |
| 3670 | |
| 3671 | return ? |
| 3672 | } |
| 3673 | |
| 3674 | @threadSafety("system") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3675 | cmd void vkDestroySampler( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3676 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 3677 | VkSampler sampler, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3678 | const VkAllocationCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3679 | deviceObject := GetDevice(device) |
| 3680 | samplerObject := GetSampler(sampler) |
| 3681 | assert(samplerObject.device == device) |
| 3682 | |
| 3683 | State.Samplers[sampler] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3684 | } |
| 3685 | |
| 3686 | |
| 3687 | // Descriptor set functions |
| 3688 | |
| 3689 | @threadSafety("system") |
| 3690 | cmd VkResult vkCreateDescriptorSetLayout( |
| 3691 | VkDevice device, |
| 3692 | const VkDescriptorSetLayoutCreateInfo* pCreateInfo, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3693 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3694 | VkDescriptorSetLayout* pSetLayout) { |
| 3695 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO) |
| 3696 | deviceObject := GetDevice(device) |
| 3697 | |
| 3698 | setLayout := ? |
| 3699 | pSetLayout[0] = setLayout |
| 3700 | State.DescriptorSetLayouts[setLayout] = new!DescriptorSetLayoutObject(device: device) |
| 3701 | |
| 3702 | return ? |
| 3703 | } |
| 3704 | |
| 3705 | @threadSafety("system") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3706 | cmd void vkDestroyDescriptorSetLayout( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3707 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 3708 | VkDescriptorSetLayout descriptorSetLayout, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3709 | const VkAllocationCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3710 | deviceObject := GetDevice(device) |
| 3711 | descriptorSetLayoutObject := GetDescriptorSetLayout(descriptorSetLayout) |
| 3712 | assert(descriptorSetLayoutObject.device == device) |
| 3713 | |
| 3714 | State.DescriptorSetLayouts[descriptorSetLayout] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3715 | } |
| 3716 | |
| 3717 | @threadSafety("system") |
| 3718 | cmd VkResult vkCreateDescriptorPool( |
| 3719 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 3720 | const VkDescriptorPoolCreateInfo* pCreateInfo, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3721 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3722 | VkDescriptorPool* pDescriptorPool) { |
| 3723 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO) |
| 3724 | deviceObject := GetDevice(device) |
| 3725 | |
| 3726 | descriptorPool := ? |
| 3727 | pDescriptorPool[0] = descriptorPool |
| 3728 | State.DescriptorPools[descriptorPool] = new!DescriptorPoolObject(device: device) |
| 3729 | |
| 3730 | return ? |
| 3731 | } |
| 3732 | |
| 3733 | @threadSafety("system") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3734 | cmd void vkDestroyDescriptorPool( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3735 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 3736 | VkDescriptorPool descriptorPool, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3737 | const VkAllocationCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3738 | deviceObject := GetDevice(device) |
| 3739 | descriptorPoolObject := GetDescriptorPool(descriptorPool) |
| 3740 | assert(descriptorPoolObject.device == device) |
| 3741 | |
| 3742 | State.DescriptorPools[descriptorPool] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3743 | } |
| 3744 | |
| 3745 | @threadSafety("app") |
| 3746 | cmd VkResult vkResetDescriptorPool( |
| 3747 | VkDevice device, |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 3748 | VkDescriptorPool descriptorPool, |
| 3749 | VkDescriptorPoolResetFlags flags) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3750 | deviceObject := GetDevice(device) |
| 3751 | descriptorPoolObject := GetDescriptorPool(descriptorPool) |
| 3752 | assert(descriptorPoolObject.device == device) |
| 3753 | |
| 3754 | return ? |
| 3755 | } |
| 3756 | |
| 3757 | @threadSafety("app") |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3758 | cmd VkResult vkAllocateDescriptorSets( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3759 | VkDevice device, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3760 | const VkDescriptorSetAllocateInfo* pAllocateInfo, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3761 | VkDescriptorSet* pDescriptorSets) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3762 | deviceObject := GetDevice(device) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3763 | allocInfo := pAllocateInfo[0] |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 3764 | descriptorPoolObject := GetDescriptorPool(allocInfo.descriptorPool) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3765 | |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 3766 | setLayouts := allocInfo.pSetLayouts[0:allocInfo.setCount] |
| 3767 | for i in (0 .. allocInfo.setCount) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3768 | setLayout := setLayouts[i] |
| 3769 | setLayoutObject := GetDescriptorSetLayout(setLayout) |
| 3770 | assert(setLayoutObject.device == device) |
| 3771 | } |
| 3772 | |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 3773 | descriptorSets := pDescriptorSets[0:allocInfo.setCount] |
| 3774 | for i in (0 .. allocInfo.setCount) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3775 | descriptorSet := ? |
| 3776 | descriptorSets[i] = descriptorSet |
| 3777 | State.DescriptorSets[descriptorSet] = new!DescriptorSetObject(device: device) |
| 3778 | } |
| 3779 | |
| 3780 | return ? |
| 3781 | } |
| 3782 | |
Jesse Hall | f09c6b1 | 2015-08-15 19:54:28 -0700 | [diff] [blame] | 3783 | cmd VkResult vkFreeDescriptorSets( |
| 3784 | VkDevice device, |
| 3785 | VkDescriptorPool descriptorPool, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 3786 | u32 descriptorSetCount, |
Jesse Hall | f09c6b1 | 2015-08-15 19:54:28 -0700 | [diff] [blame] | 3787 | const VkDescriptorSet* pDescriptorSets) { |
| 3788 | deviceObject := GetDevice(device) |
| 3789 | descriptorPoolObject := GetDescriptorPool(descriptorPool) |
| 3790 | |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 3791 | descriptorSets := pDescriptorSets[0:descriptorSetCount] |
| 3792 | for i in (0 .. descriptorSetCount) { |
Jesse Hall | f09c6b1 | 2015-08-15 19:54:28 -0700 | [diff] [blame] | 3793 | descriptorSet := descriptorSets[i] |
| 3794 | descriptorSetObject := GetDescriptorSet(descriptorSet) |
| 3795 | assert(descriptorSetObject.device == device) |
| 3796 | State.DescriptorSets[descriptorSet] = null |
| 3797 | } |
| 3798 | |
| 3799 | return ? |
| 3800 | } |
| 3801 | |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3802 | cmd void vkUpdateDescriptorSets( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3803 | VkDevice device, |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 3804 | u32 descriptorWriteCount, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3805 | const VkWriteDescriptorSet* pDescriptorWrites, |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 3806 | u32 descriptorCopyCount, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3807 | const VkCopyDescriptorSet* pDescriptorCopies) { |
| 3808 | deviceObject := GetDevice(device) |
| 3809 | |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 3810 | descriptorWrites := pDescriptorWrites[0:descriptorWriteCount] |
| 3811 | for i in (0 .. descriptorWriteCount) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3812 | descriptorWrite := descriptorWrites[i] |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3813 | descriptorWriteObject := GetDescriptorSet(descriptorWrite.dstSet) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3814 | assert(descriptorWriteObject.device == device) |
| 3815 | } |
| 3816 | |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 3817 | descriptorCopies := pDescriptorCopies[0:descriptorCopyCount] |
| 3818 | for i in (0 .. descriptorCopyCount) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3819 | descriptorCopy := descriptorCopies[i] |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3820 | descriptorCopyObject := GetDescriptorSet(descriptorCopy.dstSet) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3821 | assert(descriptorCopyObject.device == device) |
| 3822 | } |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3823 | } |
| 3824 | |
| 3825 | |
| 3826 | // Framebuffer functions |
| 3827 | |
| 3828 | @threadSafety("system") |
| 3829 | cmd VkResult vkCreateFramebuffer( |
| 3830 | VkDevice device, |
| 3831 | const VkFramebufferCreateInfo* pCreateInfo, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3832 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3833 | VkFramebuffer* pFramebuffer) { |
| 3834 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO) |
| 3835 | deviceObject := GetDevice(device) |
| 3836 | |
| 3837 | framebuffer := ? |
| 3838 | pFramebuffer[0] = framebuffer |
| 3839 | State.Framebuffers[framebuffer] = new!FramebufferObject(device: device) |
| 3840 | |
| 3841 | return ? |
| 3842 | } |
| 3843 | |
| 3844 | @threadSafety("system") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3845 | cmd void vkDestroyFramebuffer( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3846 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 3847 | VkFramebuffer framebuffer, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3848 | const VkAllocationCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3849 | deviceObject := GetDevice(device) |
| 3850 | framebufferObject := GetFramebuffer(framebuffer) |
| 3851 | assert(framebufferObject.device == device) |
| 3852 | |
| 3853 | State.Framebuffers[framebuffer] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3854 | } |
| 3855 | |
| 3856 | |
| 3857 | // Renderpass functions |
| 3858 | |
| 3859 | @threadSafety("system") |
| 3860 | cmd VkResult vkCreateRenderPass( |
| 3861 | VkDevice device, |
| 3862 | const VkRenderPassCreateInfo* pCreateInfo, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3863 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3864 | VkRenderPass* pRenderPass) { |
| 3865 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO) |
| 3866 | deviceObject := GetDevice(device) |
| 3867 | |
| 3868 | renderpass := ? |
| 3869 | pRenderPass[0] = renderpass |
| 3870 | State.RenderPasses[renderpass] = new!RenderPassObject(device: device) |
| 3871 | |
| 3872 | return ? |
| 3873 | } |
| 3874 | |
| 3875 | @threadSafety("system") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3876 | cmd void vkDestroyRenderPass( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3877 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 3878 | VkRenderPass renderPass, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3879 | const VkAllocationCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3880 | deviceObject := GetDevice(device) |
| 3881 | renderPassObject := GetRenderPass(renderPass) |
| 3882 | assert(renderPassObject.device == device) |
| 3883 | |
| 3884 | State.RenderPasses[renderPass] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3885 | } |
| 3886 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 3887 | cmd void vkGetRenderAreaGranularity( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3888 | VkDevice device, |
| 3889 | VkRenderPass renderPass, |
| 3890 | VkExtent2D* pGranularity) { |
| 3891 | deviceObject := GetDevice(device) |
| 3892 | renderPassObject := GetRenderPass(renderPass) |
| 3893 | |
| 3894 | granularity := ? |
| 3895 | pGranularity[0] = granularity |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3896 | } |
| 3897 | |
| 3898 | // Command pool functions |
| 3899 | |
| 3900 | cmd VkResult vkCreateCommandPool( |
| 3901 | VkDevice device, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3902 | const VkCommandPoolCreateInfo* pCreateInfo, |
| 3903 | const VkAllocationCallbacks* pAllocator, |
| 3904 | VkCommandPool* pCommandPool) { |
| 3905 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3906 | deviceObject := GetDevice(device) |
| 3907 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3908 | commandPool := ? |
| 3909 | pCommandPool[0] = commandPool |
| 3910 | State.CommandPools[commandPool] = new!CommandPoolObject(device: device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3911 | |
| 3912 | return ? |
| 3913 | } |
| 3914 | |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3915 | cmd void vkDestroyCommandPool( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3916 | VkDevice device, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3917 | VkCommandPool commandPool, |
| 3918 | const VkAllocationCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3919 | deviceObject := GetDevice(device) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3920 | commandPoolObject := GetCommandPool(commandPool) |
| 3921 | assert(commandPoolObject.device == device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3922 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3923 | State.CommandPools[commandPool] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3924 | } |
| 3925 | |
| 3926 | cmd VkResult vkResetCommandPool( |
| 3927 | VkDevice device, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3928 | VkCommandPool commandPool, |
| 3929 | VkCommandPoolResetFlags flags) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3930 | deviceObject := GetDevice(device) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3931 | commandPoolObject := GetCommandPool(commandPool) |
| 3932 | assert(commandPoolObject.device == device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3933 | |
| 3934 | return ? |
| 3935 | } |
| 3936 | |
| 3937 | // Command buffer functions |
| 3938 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3939 | macro void bindCommandBuffer(VkCommandBuffer commandBuffer, any obj, VkDeviceMemory memory) { |
| 3940 | memoryObject := GetDeviceMemory(memory) |
| 3941 | memoryObject.boundCommandBuffers[commandBuffer] = commandBuffer |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3942 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3943 | commandBufferObject := GetCommandBuffer(commandBuffer) |
| 3944 | commandBufferObject.boundObjects[as!u64(obj)] = memory |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3945 | } |
| 3946 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3947 | macro void unbindCommandBuffer(VkCommandBuffer commandBuffer, any obj, VkDeviceMemory memory) { |
| 3948 | memoryObject := GetDeviceMemory(memory) |
| 3949 | memoryObject.boundCommandBuffers[commandBuffer] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3950 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3951 | commandBufferObject := GetCommandBuffer(commandBuffer) |
| 3952 | commandBufferObject.boundObjects[as!u64(obj)] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3953 | } |
| 3954 | |
| 3955 | @threadSafety("system") |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3956 | cmd VkResult vkAllocateCommandBuffers( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3957 | VkDevice device, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3958 | const VkCommandBufferAllocateInfo* pAllocateInfo, |
| 3959 | VkCommandBuffer* pCommandBuffers) { |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 3960 | assert(pAllocateInfo[0].sType == VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3961 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3962 | count := pAllocateInfo[0].bufferCount |
| 3963 | commandBuffers := pCommandBuffers[0:count] |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 3964 | for i in (0 .. count) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3965 | commandBuffer := ? |
| 3966 | commandBuffers[i] = commandBuffer |
| 3967 | State.CommandBuffers[commandBuffer] = new!CommandBufferObject(device: device) |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 3968 | } |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3969 | |
| 3970 | return ? |
| 3971 | } |
| 3972 | |
| 3973 | @threadSafety("system") |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 3974 | cmd void vkFreeCommandBuffers( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3975 | VkDevice device, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3976 | VkCommandPool commandPool, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 3977 | u32 commandBufferCount, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3978 | const VkCommandBuffer* pCommandBuffers) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3979 | deviceObject := GetDevice(device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3980 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3981 | commandBuffers := pCommandBuffers[0:commandBufferCount] |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 3982 | for i in (0 .. commandBufferCount) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3983 | commandBufferObject := GetCommandBuffer(commandBuffers[i]) |
| 3984 | assert(commandBufferObject.device == device) |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 3985 | // TODO: iterate over boundObjects and clear memory bindings |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3986 | State.CommandBuffers[commandBuffers[i]] = null |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 3987 | } |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3988 | } |
| 3989 | |
| 3990 | @threadSafety("app") |
| 3991 | cmd VkResult vkBeginCommandBuffer( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 3992 | VkCommandBuffer commandBuffer, |
| 3993 | const VkCommandBufferBeginInfo* pBeginInfo) { |
| 3994 | assert(pBeginInfo.sType == VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO) |
| 3995 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3996 | |
| 3997 | // TODO: iterate over boundObjects and clear memory bindings |
| 3998 | |
| 3999 | return ? |
| 4000 | } |
| 4001 | |
| 4002 | @threadSafety("app") |
| 4003 | cmd VkResult vkEndCommandBuffer( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4004 | VkCommandBuffer commandBuffer) { |
| 4005 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4006 | |
| 4007 | return ? |
| 4008 | } |
| 4009 | |
| 4010 | @threadSafety("app") |
| 4011 | cmd VkResult vkResetCommandBuffer( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4012 | VkCommandBuffer commandBuffer, |
| 4013 | VkCommandBufferResetFlags flags) { |
| 4014 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4015 | |
| 4016 | // TODO: iterate over boundObjects and clear memory bindings |
| 4017 | |
| 4018 | return ? |
| 4019 | } |
| 4020 | |
| 4021 | |
| 4022 | // Command buffer building functions |
| 4023 | |
| 4024 | @threadSafety("app") |
| 4025 | cmd void vkCmdBindPipeline( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4026 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4027 | VkPipelineBindPoint pipelineBindPoint, |
| 4028 | VkPipeline pipeline) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4029 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4030 | pipelineObject := GetPipeline(pipeline) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4031 | assert(commandBufferObject.device == pipelineObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4032 | |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 4033 | queue := switch (pipelineBindPoint) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4034 | case VK_PIPELINE_BIND_POINT_COMPUTE: VK_QUEUE_COMPUTE_BIT |
| 4035 | case VK_PIPELINE_BIND_POINT_GRAPHICS: VK_QUEUE_GRAPHICS_BIT |
| 4036 | } |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4037 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, queue) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4038 | } |
| 4039 | |
| 4040 | @threadSafety("app") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4041 | cmd void vkCmdSetViewport( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4042 | VkCommandBuffer commandBuffer, |
Jesse Hall | f9fa9a5 | 2016-01-08 16:08:51 -0800 | [diff] [blame] | 4043 | u32 firstViewport, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4044 | u32 viewportCount, |
| 4045 | const VkViewport* pViewports) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4046 | commandBufferObject := GetCommandBuffer(commandBuffer) |
| 4047 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4048 | } |
| 4049 | |
| 4050 | @threadSafety("app") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4051 | cmd void vkCmdSetScissor( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4052 | VkCommandBuffer commandBuffer, |
Jesse Hall | f9fa9a5 | 2016-01-08 16:08:51 -0800 | [diff] [blame] | 4053 | u32 firstScissor, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4054 | u32 scissorCount, |
| 4055 | const VkRect2D* pScissors) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4056 | commandBufferObject := GetCommandBuffer(commandBuffer) |
| 4057 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4058 | } |
| 4059 | |
| 4060 | @threadSafety("app") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4061 | cmd void vkCmdSetLineWidth( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4062 | VkCommandBuffer commandBuffer, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4063 | f32 lineWidth) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4064 | commandBufferObject := GetCommandBuffer(commandBuffer) |
| 4065 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4066 | } |
| 4067 | |
| 4068 | @threadSafety("app") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4069 | cmd void vkCmdSetDepthBias( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4070 | VkCommandBuffer commandBuffer, |
Jesse Hall | a9bb62b | 2015-11-21 19:31:56 -0800 | [diff] [blame] | 4071 | f32 depthBiasConstantFactor, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4072 | f32 depthBiasClamp, |
Jesse Hall | a9bb62b | 2015-11-21 19:31:56 -0800 | [diff] [blame] | 4073 | f32 depthBiasSlopeFactor) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4074 | commandBufferObject := GetCommandBuffer(commandBuffer) |
| 4075 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4076 | } |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4077 | |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4078 | @threadSafety("app") |
| 4079 | cmd void vkCmdSetBlendConstants( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4080 | VkCommandBuffer commandBuffer, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4081 | // TODO(jessehall): apic only supports 'const' on pointer types. Using |
| 4082 | // an annotation as a quick hack to pass this to the template without |
| 4083 | // having to modify the AST and semantic model. |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 4084 | @readonly f32[4] blendConstants) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4085 | commandBufferObject := GetCommandBuffer(commandBuffer) |
| 4086 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4087 | } |
| 4088 | |
| 4089 | @threadSafety("app") |
| 4090 | cmd void vkCmdSetDepthBounds( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4091 | VkCommandBuffer commandBuffer, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4092 | f32 minDepthBounds, |
| 4093 | f32 maxDepthBounds) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4094 | commandBufferObject := GetCommandBuffer(commandBuffer) |
| 4095 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4096 | } |
| 4097 | |
| 4098 | @threadSafety("app") |
| 4099 | cmd void vkCmdSetStencilCompareMask( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4100 | VkCommandBuffer commandBuffer, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4101 | VkStencilFaceFlags faceMask, |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 4102 | u32 compareMask) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4103 | commandBufferObject := GetCommandBuffer(commandBuffer) |
| 4104 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4105 | } |
| 4106 | |
| 4107 | @threadSafety("app") |
| 4108 | cmd void vkCmdSetStencilWriteMask( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4109 | VkCommandBuffer commandBuffer, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4110 | VkStencilFaceFlags faceMask, |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 4111 | u32 writeMask) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4112 | commandBufferObject := GetCommandBuffer(commandBuffer) |
| 4113 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4114 | } |
| 4115 | |
| 4116 | @threadSafety("app") |
| 4117 | cmd void vkCmdSetStencilReference( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4118 | VkCommandBuffer commandBuffer, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4119 | VkStencilFaceFlags faceMask, |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 4120 | u32 reference) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4121 | commandBufferObject := GetCommandBuffer(commandBuffer) |
| 4122 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4123 | } |
| 4124 | |
| 4125 | @threadSafety("app") |
| 4126 | cmd void vkCmdBindDescriptorSets( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4127 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4128 | VkPipelineBindPoint pipelineBindPoint, |
| 4129 | VkPipelineLayout layout, |
| 4130 | u32 firstSet, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 4131 | u32 descriptorSetCount, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4132 | const VkDescriptorSet* pDescriptorSets, |
| 4133 | u32 dynamicOffsetCount, |
| 4134 | const u32* pDynamicOffsets) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4135 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4136 | |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 4137 | descriptorSets := pDescriptorSets[0:descriptorSetCount] |
| 4138 | for i in (0 .. descriptorSetCount) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4139 | descriptorSet := descriptorSets[i] |
| 4140 | descriptorSetObject := GetDescriptorSet(descriptorSet) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4141 | assert(commandBufferObject.device == descriptorSetObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4142 | } |
| 4143 | |
| 4144 | dynamicOffsets := pDynamicOffsets[0:dynamicOffsetCount] |
| 4145 | for i in (0 .. dynamicOffsetCount) { |
| 4146 | dynamicOffset := dynamicOffsets[i] |
| 4147 | } |
| 4148 | |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 4149 | queue := switch (pipelineBindPoint) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4150 | case VK_PIPELINE_BIND_POINT_COMPUTE: VK_QUEUE_COMPUTE_BIT |
| 4151 | case VK_PIPELINE_BIND_POINT_GRAPHICS: VK_QUEUE_GRAPHICS_BIT |
| 4152 | } |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4153 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, queue) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4154 | } |
| 4155 | |
| 4156 | @threadSafety("app") |
| 4157 | cmd void vkCmdBindIndexBuffer( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4158 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4159 | VkBuffer buffer, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4160 | VkDeviceSize offset, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4161 | VkIndexType indexType) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4162 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4163 | bufferObject := GetBuffer(buffer) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4164 | assert(commandBufferObject.device == bufferObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4165 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4166 | bindCommandBuffer(commandBuffer, buffer, bufferObject.memory) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4167 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4168 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4169 | } |
| 4170 | |
| 4171 | @threadSafety("app") |
| 4172 | cmd void vkCmdBindVertexBuffers( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4173 | VkCommandBuffer commandBuffer, |
Jesse Hall | f9fa9a5 | 2016-01-08 16:08:51 -0800 | [diff] [blame] | 4174 | u32 firstBinding, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4175 | u32 bindingCount, |
| 4176 | const VkBuffer* pBuffers, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4177 | const VkDeviceSize* pOffsets) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4178 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4179 | |
Jesse Hall | f9fa9a5 | 2016-01-08 16:08:51 -0800 | [diff] [blame] | 4180 | // TODO: check if not [firstBinding:firstBinding+bindingCount] |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4181 | buffers := pBuffers[0:bindingCount] |
| 4182 | offsets := pOffsets[0:bindingCount] |
| 4183 | for i in (0 .. bindingCount) { |
| 4184 | buffer := buffers[i] |
| 4185 | offset := offsets[i] |
| 4186 | bufferObject := GetBuffer(buffer) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4187 | assert(commandBufferObject.device == bufferObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4188 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4189 | bindCommandBuffer(commandBuffer, buffer, bufferObject.memory) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4190 | } |
| 4191 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4192 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4193 | } |
| 4194 | |
| 4195 | @threadSafety("app") |
| 4196 | cmd void vkCmdDraw( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4197 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4198 | u32 vertexCount, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4199 | u32 instanceCount, |
| 4200 | u32 firstVertex, |
| 4201 | u32 firstInstance) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4202 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4203 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4204 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4205 | } |
| 4206 | |
| 4207 | @threadSafety("app") |
| 4208 | cmd void vkCmdDrawIndexed( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4209 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4210 | u32 indexCount, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4211 | u32 instanceCount, |
| 4212 | u32 firstIndex, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4213 | s32 vertexOffset, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4214 | u32 firstInstance) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4215 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4216 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4217 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4218 | } |
| 4219 | |
| 4220 | @threadSafety("app") |
| 4221 | cmd void vkCmdDrawIndirect( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4222 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4223 | VkBuffer buffer, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4224 | VkDeviceSize offset, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 4225 | u32 drawCount, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4226 | u32 stride) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4227 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4228 | bufferObject := GetBuffer(buffer) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4229 | assert(commandBufferObject.device == bufferObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4230 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4231 | bindCommandBuffer(commandBuffer, buffer, bufferObject.memory) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4232 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4233 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4234 | } |
| 4235 | |
| 4236 | @threadSafety("app") |
| 4237 | cmd void vkCmdDrawIndexedIndirect( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4238 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4239 | VkBuffer buffer, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4240 | VkDeviceSize offset, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 4241 | u32 drawCount, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4242 | u32 stride) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4243 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4244 | bufferObject := GetBuffer(buffer) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4245 | assert(commandBufferObject.device == bufferObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4246 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4247 | bindCommandBuffer(commandBuffer, buffer, bufferObject.memory) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4248 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4249 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4250 | } |
| 4251 | |
| 4252 | @threadSafety("app") |
| 4253 | cmd void vkCmdDispatch( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4254 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4255 | u32 x, |
| 4256 | u32 y, |
| 4257 | u32 z) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4258 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4259 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4260 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_COMPUTE_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4261 | } |
| 4262 | |
| 4263 | @threadSafety("app") |
| 4264 | cmd void vkCmdDispatchIndirect( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4265 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4266 | VkBuffer buffer, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4267 | VkDeviceSize offset) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4268 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4269 | bufferObject := GetBuffer(buffer) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4270 | assert(commandBufferObject.device == bufferObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4271 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4272 | bindCommandBuffer(commandBuffer, buffer, bufferObject.memory) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4273 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4274 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_COMPUTE_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4275 | } |
| 4276 | |
| 4277 | @threadSafety("app") |
| 4278 | cmd void vkCmdCopyBuffer( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4279 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4280 | VkBuffer srcBuffer, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4281 | VkBuffer dstBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4282 | u32 regionCount, |
| 4283 | const VkBufferCopy* pRegions) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4284 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4285 | srcBufferObject := GetBuffer(srcBuffer) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4286 | dstBufferObject := GetBuffer(dstBuffer) |
| 4287 | assert(commandBufferObject.device == srcBufferObject.device) |
| 4288 | assert(commandBufferObject.device == dstBufferObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4289 | |
| 4290 | regions := pRegions[0:regionCount] |
| 4291 | for i in (0 .. regionCount) { |
| 4292 | region := regions[i] |
| 4293 | } |
| 4294 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4295 | bindCommandBuffer(commandBuffer, srcBuffer, srcBufferObject.memory) |
| 4296 | bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4297 | |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 4298 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4299 | } |
| 4300 | |
| 4301 | @threadSafety("app") |
| 4302 | cmd void vkCmdCopyImage( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4303 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4304 | VkImage srcImage, |
| 4305 | VkImageLayout srcImageLayout, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4306 | VkImage dstImage, |
| 4307 | VkImageLayout dstImageLayout, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4308 | u32 regionCount, |
| 4309 | const VkImageCopy* pRegions) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4310 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4311 | srcImageObject := GetImage(srcImage) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4312 | dstImageObject := GetImage(dstImage) |
| 4313 | assert(commandBufferObject.device == srcImageObject.device) |
| 4314 | assert(commandBufferObject.device == dstImageObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4315 | |
| 4316 | regions := pRegions[0:regionCount] |
| 4317 | for i in (0 .. regionCount) { |
| 4318 | region := regions[i] |
| 4319 | } |
| 4320 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4321 | bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory) |
| 4322 | bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4323 | |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 4324 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4325 | } |
| 4326 | |
| 4327 | @threadSafety("app") |
| 4328 | cmd void vkCmdBlitImage( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4329 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4330 | VkImage srcImage, |
| 4331 | VkImageLayout srcImageLayout, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4332 | VkImage dstImage, |
| 4333 | VkImageLayout dstImageLayout, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4334 | u32 regionCount, |
| 4335 | const VkImageBlit* pRegions, |
Jesse Hall | 23ff73f | 2015-11-29 14:36:39 -0800 | [diff] [blame] | 4336 | VkFilter filter) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4337 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4338 | srcImageObject := GetImage(srcImage) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4339 | dstImageObject := GetImage(dstImage) |
| 4340 | assert(commandBufferObject.device == srcImageObject.device) |
| 4341 | assert(commandBufferObject.device == dstImageObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4342 | |
| 4343 | regions := pRegions[0:regionCount] |
| 4344 | for i in (0 .. regionCount) { |
| 4345 | region := regions[i] |
| 4346 | } |
| 4347 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4348 | bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory) |
| 4349 | bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4350 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4351 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4352 | } |
| 4353 | |
| 4354 | @threadSafety("app") |
| 4355 | cmd void vkCmdCopyBufferToImage( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4356 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4357 | VkBuffer srcBuffer, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4358 | VkImage dstImage, |
| 4359 | VkImageLayout dstImageLayout, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4360 | u32 regionCount, |
| 4361 | const VkBufferImageCopy* pRegions) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4362 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4363 | srcBufferObject := GetBuffer(srcBuffer) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4364 | dstImageObject := GetImage(dstImage) |
| 4365 | assert(commandBufferObject.device == srcBufferObject.device) |
| 4366 | assert(commandBufferObject.device == dstImageObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4367 | |
| 4368 | regions := pRegions[0:regionCount] |
| 4369 | for i in (0 .. regionCount) { |
| 4370 | region := regions[i] |
| 4371 | } |
| 4372 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4373 | bindCommandBuffer(commandBuffer, srcBuffer, srcBufferObject.memory) |
| 4374 | bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4375 | |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 4376 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4377 | } |
| 4378 | |
| 4379 | @threadSafety("app") |
| 4380 | cmd void vkCmdCopyImageToBuffer( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4381 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4382 | VkImage srcImage, |
| 4383 | VkImageLayout srcImageLayout, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4384 | VkBuffer dstBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4385 | u32 regionCount, |
| 4386 | const VkBufferImageCopy* pRegions) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4387 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4388 | srcImageObject := GetImage(srcImage) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4389 | dstBufferObject := GetBuffer(dstBuffer) |
| 4390 | assert(commandBufferObject.device == srcImageObject.device) |
| 4391 | assert(commandBufferObject.device == dstBufferObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4392 | |
| 4393 | regions := pRegions[0:regionCount] |
| 4394 | for i in (0 .. regionCount) { |
| 4395 | region := regions[i] |
| 4396 | } |
| 4397 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4398 | bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory) |
| 4399 | bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4400 | |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 4401 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4402 | } |
| 4403 | |
| 4404 | @threadSafety("app") |
| 4405 | cmd void vkCmdUpdateBuffer( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4406 | VkCommandBuffer commandBuffer, |
| 4407 | VkBuffer dstBuffer, |
| 4408 | VkDeviceSize dstOffset, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4409 | VkDeviceSize dataSize, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4410 | const u32* pData) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4411 | commandBufferObject := GetCommandBuffer(commandBuffer) |
| 4412 | dstBufferObject := GetBuffer(dstBuffer) |
| 4413 | assert(commandBufferObject.device == dstBufferObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4414 | |
| 4415 | data := pData[0:dataSize] |
| 4416 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4417 | bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4418 | |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 4419 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4420 | } |
| 4421 | |
| 4422 | @threadSafety("app") |
| 4423 | cmd void vkCmdFillBuffer( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4424 | VkCommandBuffer commandBuffer, |
| 4425 | VkBuffer dstBuffer, |
| 4426 | VkDeviceSize dstOffset, |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 4427 | VkDeviceSize size, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4428 | u32 data) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4429 | commandBufferObject := GetCommandBuffer(commandBuffer) |
| 4430 | dstBufferObject := GetBuffer(dstBuffer) |
| 4431 | assert(commandBufferObject.device == dstBufferObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4432 | |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 4433 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4434 | } |
| 4435 | |
| 4436 | @threadSafety("app") |
| 4437 | cmd void vkCmdClearColorImage( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4438 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4439 | VkImage image, |
| 4440 | VkImageLayout imageLayout, |
| 4441 | const VkClearColorValue* pColor, |
| 4442 | u32 rangeCount, |
| 4443 | const VkImageSubresourceRange* pRanges) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4444 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4445 | imageObject := GetImage(image) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4446 | assert(commandBufferObject.device == imageObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4447 | |
| 4448 | ranges := pRanges[0:rangeCount] |
| 4449 | for i in (0 .. rangeCount) { |
| 4450 | range := ranges[i] |
| 4451 | } |
| 4452 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4453 | bindCommandBuffer(commandBuffer, image, imageObject.memory) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4454 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4455 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4456 | } |
| 4457 | |
| 4458 | @threadSafety("app") |
| 4459 | cmd void vkCmdClearDepthStencilImage( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4460 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4461 | VkImage image, |
| 4462 | VkImageLayout imageLayout, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4463 | const VkClearDepthStencilValue* pDepthStencil, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4464 | u32 rangeCount, |
| 4465 | const VkImageSubresourceRange* pRanges) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4466 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4467 | imageObject := GetImage(image) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4468 | assert(commandBufferObject.device == imageObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4469 | |
| 4470 | ranges := pRanges[0:rangeCount] |
| 4471 | for i in (0 .. rangeCount) { |
| 4472 | range := ranges[i] |
| 4473 | } |
| 4474 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4475 | bindCommandBuffer(commandBuffer, image, imageObject.memory) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4476 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4477 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4478 | } |
| 4479 | |
| 4480 | @threadSafety("app") |
Jesse Hall | ae38f73 | 2015-11-19 21:32:50 -0800 | [diff] [blame] | 4481 | cmd void vkCmdClearAttachments( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4482 | VkCommandBuffer commandBuffer, |
Jesse Hall | ae38f73 | 2015-11-19 21:32:50 -0800 | [diff] [blame] | 4483 | u32 attachmentCount, |
| 4484 | const VkClearAttachment* pAttachments, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4485 | u32 rectCount, |
Jesse Hall | a15a4bf | 2015-11-19 22:48:02 -0800 | [diff] [blame] | 4486 | const VkClearRect* pRects) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4487 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4488 | |
| 4489 | rects := pRects[0:rectCount] |
| 4490 | for i in (0 .. rectCount) { |
| 4491 | rect := rects[i] |
| 4492 | } |
| 4493 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4494 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4495 | } |
| 4496 | |
| 4497 | @threadSafety("app") |
| 4498 | cmd void vkCmdResolveImage( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4499 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4500 | VkImage srcImage, |
| 4501 | VkImageLayout srcImageLayout, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4502 | VkImage dstImage, |
| 4503 | VkImageLayout dstImageLayout, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4504 | u32 regionCount, |
| 4505 | const VkImageResolve* pRegions) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4506 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4507 | srcImageObject := GetImage(srcImage) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4508 | dstImageObject := GetImage(dstImage) |
| 4509 | assert(commandBufferObject.device == srcImageObject.device) |
| 4510 | assert(commandBufferObject.device == dstImageObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4511 | |
| 4512 | regions := pRegions[0:regionCount] |
| 4513 | for i in (0 .. regionCount) { |
| 4514 | region := regions[i] |
| 4515 | } |
| 4516 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4517 | bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory) |
| 4518 | bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4519 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4520 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4521 | } |
| 4522 | |
| 4523 | @threadSafety("app") |
| 4524 | cmd void vkCmdSetEvent( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4525 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4526 | VkEvent event, |
| 4527 | VkPipelineStageFlags stageMask) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4528 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4529 | eventObject := GetEvent(event) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4530 | assert(commandBufferObject.device == eventObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4531 | } |
| 4532 | |
| 4533 | @threadSafety("app") |
| 4534 | cmd void vkCmdResetEvent( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4535 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4536 | VkEvent event, |
| 4537 | VkPipelineStageFlags stageMask) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4538 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4539 | eventObject := GetEvent(event) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4540 | assert(commandBufferObject.device == eventObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4541 | } |
| 4542 | |
| 4543 | @threadSafety("app") |
| 4544 | cmd void vkCmdWaitEvents( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4545 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4546 | u32 eventCount, |
| 4547 | const VkEvent* pEvents, |
| 4548 | VkPipelineStageFlags srcStageMask, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4549 | VkPipelineStageFlags dstStageMask, |
| 4550 | u32 memoryBarrierCount, |
| 4551 | const void* const* ppMemoryBarriers) { |
| 4552 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4553 | |
| 4554 | events := pEvents[0:eventCount] |
| 4555 | for i in (0 .. eventCount) { |
| 4556 | event := events[i] |
| 4557 | eventObject := GetEvent(event) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4558 | assert(commandBufferObject.device == eventObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4559 | } |
| 4560 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4561 | pMemoryBarriers := ppMemoryBarriers[0:memoryBarrierCount] |
| 4562 | for i in (0 .. memoryBarrierCount) { |
| 4563 | switch as!VkMemoryBarrier const*(pMemoryBarriers[i])[0].sType { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4564 | case VK_STRUCTURE_TYPE_MEMORY_BARRIER: { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4565 | memoryBarrier := as!VkMemoryBarrier const*(pMemoryBarriers[i])[0] |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4566 | } |
| 4567 | case VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER: { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4568 | imageMemoryBarrier := as!VkImageMemoryBarrier const*(pMemoryBarriers[i])[0] |
| 4569 | imageObject := GetImage(imageMemoryBarrier.image) |
| 4570 | assert(imageObject.device == commandBufferObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4571 | } |
| 4572 | case VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER: { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4573 | bufferMemoryBarrier := as!VkBufferMemoryBarrier const*(pMemoryBarriers[i])[0] |
| 4574 | bufferObject := GetBuffer(bufferMemoryBarrier.buffer) |
| 4575 | assert(bufferObject.device == commandBufferObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4576 | } |
| 4577 | } |
| 4578 | } |
| 4579 | } |
| 4580 | |
| 4581 | @threadSafety("app") |
| 4582 | cmd void vkCmdPipelineBarrier( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4583 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4584 | VkPipelineStageFlags srcStageMask, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4585 | VkPipelineStageFlags dstStageMask, |
Jesse Hall | dc6d36c | 2015-11-29 19:12:15 -0800 | [diff] [blame] | 4586 | VkDependencyFlags dependencyFlags, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4587 | u32 memoryBarrierCount, |
| 4588 | const void* const* ppMemoryBarriers) { |
| 4589 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4590 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4591 | pMemoryBarriers := ppMemoryBarriers[0:memoryBarrierCount] |
| 4592 | for i in (0 .. memoryBarrierCount) { |
| 4593 | switch as!VkMemoryBarrier const*(pMemoryBarriers[i])[0].sType { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4594 | case VK_STRUCTURE_TYPE_MEMORY_BARRIER: { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4595 | memoryBarrier := as!VkMemoryBarrier const*(pMemoryBarriers[i])[0] |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4596 | } |
| 4597 | case VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER: { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4598 | imageMemoryBarrier := as!VkImageMemoryBarrier const*(pMemoryBarriers[i])[0] |
| 4599 | imageObject := GetImage(imageMemoryBarrier.image) |
| 4600 | assert(imageObject.device == commandBufferObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4601 | } |
| 4602 | case VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER: { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4603 | bufferMemoryBarrier := as!VkBufferMemoryBarrier const*(pMemoryBarriers[i])[0] |
| 4604 | bufferObject := GetBuffer(bufferMemoryBarrier.buffer) |
| 4605 | assert(bufferObject.device == commandBufferObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4606 | } |
| 4607 | } |
| 4608 | } |
| 4609 | } |
| 4610 | |
| 4611 | @threadSafety("app") |
| 4612 | cmd void vkCmdBeginQuery( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4613 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4614 | VkQueryPool queryPool, |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 4615 | u32 entry, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4616 | VkQueryControlFlags flags) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4617 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4618 | queryPoolObject := GetQueryPool(queryPool) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4619 | assert(commandBufferObject.device == queryPoolObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4620 | } |
| 4621 | |
| 4622 | @threadSafety("app") |
| 4623 | cmd void vkCmdEndQuery( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4624 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4625 | VkQueryPool queryPool, |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 4626 | u32 entry) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4627 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4628 | queryPoolObject := GetQueryPool(queryPool) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4629 | assert(commandBufferObject.device == queryPoolObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4630 | } |
| 4631 | |
| 4632 | @threadSafety("app") |
| 4633 | cmd void vkCmdResetQueryPool( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4634 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4635 | VkQueryPool queryPool, |
Jesse Hall | f9fa9a5 | 2016-01-08 16:08:51 -0800 | [diff] [blame] | 4636 | u32 firstQuery, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4637 | u32 queryCount) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4638 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4639 | queryPoolObject := GetQueryPool(queryPool) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4640 | assert(commandBufferObject.device == queryPoolObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4641 | } |
| 4642 | |
| 4643 | @threadSafety("app") |
| 4644 | cmd void vkCmdWriteTimestamp( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4645 | VkCommandBuffer commandBuffer, |
Jesse Hall | 6f39a6d | 2015-11-24 11:08:36 -0800 | [diff] [blame] | 4646 | VkPipelineStageFlagBits pipelineStage, |
Jesse Hall | a3a7a1d | 2015-11-24 11:37:23 -0800 | [diff] [blame] | 4647 | VkQueryPool queryPool, |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 4648 | u32 entry) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4649 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | a3a7a1d | 2015-11-24 11:37:23 -0800 | [diff] [blame] | 4650 | queryPoolObject := GetQueryPool(queryPool) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4651 | assert(commandBufferObject.device == queryPoolObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4652 | } |
| 4653 | |
| 4654 | @threadSafety("app") |
| 4655 | cmd void vkCmdCopyQueryPoolResults( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4656 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4657 | VkQueryPool queryPool, |
Jesse Hall | f9fa9a5 | 2016-01-08 16:08:51 -0800 | [diff] [blame] | 4658 | u32 firstQuery, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4659 | u32 queryCount, |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4660 | VkBuffer dstBuffer, |
| 4661 | VkDeviceSize dstOffset, |
Jesse Hall | a9bb62b | 2015-11-21 19:31:56 -0800 | [diff] [blame] | 4662 | VkDeviceSize stride, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4663 | VkQueryResultFlags flags) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4664 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4665 | queryPoolObject := GetQueryPool(queryPool) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4666 | dstBufferObject := GetBuffer(dstBuffer) |
| 4667 | assert(commandBufferObject.device == queryPoolObject.device) |
| 4668 | assert(commandBufferObject.device == dstBufferObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4669 | } |
| 4670 | |
| 4671 | cmd void vkCmdPushConstants( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4672 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4673 | VkPipelineLayout layout, |
| 4674 | VkShaderStageFlags stageFlags, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 4675 | u32 offset, |
| 4676 | u32 size, |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 4677 | const void* pValues) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4678 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4679 | layoutObject := GetPipelineLayout(layout) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4680 | assert(commandBufferObject.device == layoutObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4681 | } |
| 4682 | |
| 4683 | @threadSafety("app") |
| 4684 | cmd void vkCmdBeginRenderPass( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4685 | VkCommandBuffer commandBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4686 | const VkRenderPassBeginInfo* pRenderPassBegin, |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 4687 | VkSubpassContents contents) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4688 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4689 | renderPassObject := GetRenderPass(pRenderPassBegin.renderPass) |
| 4690 | framebufferObject := GetFramebuffer(pRenderPassBegin.framebuffer) |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4691 | assert(commandBufferObject.device == renderPassObject.device) |
| 4692 | assert(commandBufferObject.device == framebufferObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4693 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4694 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4695 | } |
| 4696 | |
| 4697 | cmd void vkCmdNextSubpass( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4698 | VkCommandBuffer commandBuffer, |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 4699 | VkSubpassContents contents) { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4700 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4701 | } |
| 4702 | |
| 4703 | @threadSafety("app") |
| 4704 | cmd void vkCmdEndRenderPass( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4705 | VkCommandBuffer commandBuffer) { |
| 4706 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4707 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4708 | commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4709 | } |
| 4710 | |
| 4711 | cmd void vkCmdExecuteCommands( |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4712 | VkCommandBuffer commandBuffer, |
| 4713 | u32 commandBuffersCount, |
| 4714 | const VkCommandBuffer* pCommandBuffers) { |
| 4715 | commandBufferObject := GetCommandBuffer(commandBuffer) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4716 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 4717 | commandBuffers := pCommandBuffers[0:commandBuffersCount] |
| 4718 | for i in (0 .. commandBuffersCount) { |
| 4719 | secondaryCommandBuffer := commandBuffers[i] |
| 4720 | secondaryCommandBufferObject := GetCommandBuffer(secondaryCommandBuffer) |
| 4721 | assert(commandBufferObject.device == secondaryCommandBufferObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4722 | } |
| 4723 | } |
| 4724 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 4725 | @extension("VK_KHR_surface") |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 4726 | cmd void vkDestroySurfaceKHR( |
| 4727 | VkInstance instance, |
Jesse Hall | 0e74f00 | 2015-11-30 11:37:59 -0800 | [diff] [blame] | 4728 | VkSurfaceKHR surface, |
| 4729 | const VkAllocationCallbacks* pAllocator) { |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 4730 | instanceObject := GetInstance(instance) |
| 4731 | surfaceObject := GetSurface(surface) |
| 4732 | assert(surfaceObject.instance == instance) |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 4733 | |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 4734 | State.Surfaces[surface] = null |
Jesse Hall | 2818f93 | 2015-11-19 21:19:17 -0800 | [diff] [blame] | 4735 | } |
| 4736 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 4737 | @extension("VK_KHR_surface") |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 4738 | cmd VkResult vkGetPhysicalDeviceSurfaceSupportKHR( |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 4739 | VkPhysicalDevice physicalDevice, |
| 4740 | u32 queueFamilyIndex, |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 4741 | VkSurfaceKHR surface, |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 4742 | VkBool32* pSupported) { |
| 4743 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 4744 | |
| 4745 | return ? |
| 4746 | } |
| 4747 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 4748 | @extension("VK_KHR_surface") |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 4749 | cmd VkResult vkGetPhysicalDeviceSurfaceCapabilitiesKHR( |
| 4750 | VkPhysicalDevice physicalDevice, |
| 4751 | VkSurfaceKHR surface, |
| 4752 | VkSurfaceCapabilitiesKHR* pSurfaceCapabilities) { |
| 4753 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
| 4754 | |
| 4755 | surfaceCapabilities := ? |
| 4756 | pSurfaceCapabilities[0] = surfaceCapabilities |
| 4757 | |
| 4758 | return ? |
| 4759 | } |
| 4760 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 4761 | @extension("VK_KHR_surface") |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 4762 | cmd VkResult vkGetPhysicalDeviceSurfaceFormatsKHR( |
| 4763 | VkPhysicalDevice physicalDevice, |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 4764 | VkSurfaceKHR surface, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 4765 | u32* pSurfaceFormatCount, |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 4766 | VkSurfaceFormatKHR* pSurfaceFormats) { |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 4767 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 4768 | |
| 4769 | count := as!u32(?) |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 4770 | pSurfaceFormatCount[0] = count |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 4771 | surfaceFormats := pSurfaceFormats[0:count] |
| 4772 | |
| 4773 | for i in (0 .. count) { |
| 4774 | surfaceFormat := ? |
| 4775 | surfaceFormats[i] = surfaceFormat |
| 4776 | } |
| 4777 | |
| 4778 | return ? |
| 4779 | } |
| 4780 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 4781 | @extension("VK_KHR_surface") |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 4782 | cmd VkResult vkGetPhysicalDeviceSurfacePresentModesKHR( |
| 4783 | VkPhysicalDevice physicalDevice, |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 4784 | VkSurfaceKHR surface, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 4785 | u32* pPresentModeCount, |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 4786 | VkPresentModeKHR* pPresentModes) { |
Jesse Hall | b00daad | 2015-11-29 19:46:20 -0800 | [diff] [blame] | 4787 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 4788 | |
| 4789 | count := as!u32(?) |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 4790 | pPresentModeCount[0] = count |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 4791 | presentModes := pPresentModes[0:count] |
| 4792 | |
| 4793 | for i in (0 .. count) { |
| 4794 | presentMode := ? |
| 4795 | presentModes[i] = presentMode |
| 4796 | } |
| 4797 | |
| 4798 | return ? |
| 4799 | } |
| 4800 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 4801 | @extension("VK_KHR_swapchain") |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 4802 | cmd VkResult vkCreateSwapchainKHR( |
| 4803 | VkDevice device, |
| 4804 | const VkSwapchainCreateInfoKHR* pCreateInfo, |
Jesse Hall | 0e74f00 | 2015-11-30 11:37:59 -0800 | [diff] [blame] | 4805 | const VkAllocationCallbacks* pAllocator, |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 4806 | VkSwapchainKHR* pSwapchain) { |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 4807 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR) |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 4808 | deviceObject := GetDevice(device) |
| 4809 | |
| 4810 | swapchain := ? |
| 4811 | pSwapchain[0] = swapchain |
| 4812 | State.Swapchains[swapchain] = new!SwapchainObject(device: device) |
| 4813 | |
| 4814 | return ? |
| 4815 | } |
| 4816 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 4817 | @extension("VK_KHR_swapchain") |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 4818 | cmd void vkDestroySwapchainKHR( |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 4819 | VkDevice device, |
Jesse Hall | 0e74f00 | 2015-11-30 11:37:59 -0800 | [diff] [blame] | 4820 | VkSwapchainKHR swapchain, |
| 4821 | const VkAllocationCallbacks* pAllocator) { |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 4822 | deviceObject := GetDevice(device) |
| 4823 | swapchainObject := GetSwapchain(swapchain) |
| 4824 | assert(swapchainObject.device == device) |
| 4825 | |
| 4826 | State.Swapchains[swapchain] = null |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 4827 | } |
| 4828 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 4829 | @extension("VK_KHR_swapchain") |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 4830 | cmd VkResult vkGetSwapchainImagesKHR( |
| 4831 | VkDevice device, |
| 4832 | VkSwapchainKHR swapchain, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 4833 | u32* pSwapchainImageCount, |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 4834 | VkImage* pSwapchainImages) { |
| 4835 | deviceObject := GetDevice(device) |
| 4836 | |
| 4837 | count := as!u32(?) |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 4838 | pSwapchainImageCount[0] = count |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 4839 | swapchainImages := pSwapchainImages[0:count] |
| 4840 | |
| 4841 | for i in (0 .. count) { |
| 4842 | swapchainImage := ? |
| 4843 | swapchainImages[i] = swapchainImage |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 4844 | State.Images[swapchainImage] = new!ImageObject(device: device) |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 4845 | } |
| 4846 | |
| 4847 | return ? |
| 4848 | } |
| 4849 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 4850 | @extension("VK_KHR_swapchain") |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 4851 | cmd VkResult vkAcquireNextImageKHR( |
| 4852 | VkDevice device, |
| 4853 | VkSwapchainKHR swapchain, |
| 4854 | u64 timeout, |
| 4855 | VkSemaphore semaphore, |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 4856 | VkFence fence, |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 4857 | u32* pImageIndex) { |
| 4858 | deviceObject := GetDevice(device) |
| 4859 | swapchainObject := GetSwapchain(swapchain) |
| 4860 | |
| 4861 | imageIndex := ? |
| 4862 | pImageIndex[0] = imageIndex |
| 4863 | |
| 4864 | return ? |
| 4865 | } |
| 4866 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 4867 | @extension("VK_KHR_swapchain") |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 4868 | cmd VkResult vkQueuePresentKHR( |
| 4869 | VkQueue queue, |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 4870 | const VkPresentInfoKHR* pPresentInfo) { |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 4871 | queueObject := GetQueue(queue) |
| 4872 | |
| 4873 | presentInfo := ? |
| 4874 | pPresentInfo[0] = presentInfo |
| 4875 | |
| 4876 | return ? |
| 4877 | } |
| 4878 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 4879 | @extension("VK_KHR_display") |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 4880 | cmd VkResult vkGetPhysicalDeviceDisplayPropertiesKHR( |
| 4881 | VkPhysicalDevice physicalDevice, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 4882 | u32* pPropertyCount, |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 4883 | VkDisplayPropertiesKHR* pProperties) { |
| 4884 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
| 4885 | return ? |
| 4886 | } |
| 4887 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 4888 | @extension("VK_KHR_display") |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 4889 | cmd VkResult vkGetPhysicalDeviceDisplayPlanePropertiesKHR( |
| 4890 | VkPhysicalDevice physicalDevice, |
| 4891 | u32* pPropertyCount, |
| 4892 | VkDisplayPlanePropertiesKHR* pProperties) { |
| 4893 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
| 4894 | return ? |
| 4895 | } |
| 4896 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 4897 | @extension("VK_KHR_display") |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 4898 | cmd VkResult vkGetDisplayPlaneSupportedDisplaysKHR( |
| 4899 | VkPhysicalDevice physicalDevice, |
Jesse Hall | f4ab2b1 | 2015-11-30 16:04:55 -0800 | [diff] [blame] | 4900 | u32* pDisplayCount, |
| 4901 | VkDisplayKHR* pDisplays) { |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 4902 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
| 4903 | return ? |
| 4904 | } |
| 4905 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 4906 | @extension("VK_KHR_display") |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 4907 | cmd VkResult vkGetDisplayModePropertiesKHR( |
| 4908 | VkPhysicalDevice physicalDevice, |
| 4909 | VkDisplayKHR display, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame] | 4910 | u32* pPropertyCount, |
| 4911 | VkDisplayModePropertiesKHR* pProperties) { |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 4912 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
| 4913 | return ? |
| 4914 | } |
| 4915 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 4916 | @extension("VK_KHR_display") |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 4917 | cmd VkResult vkCreateDisplayModeKHR( |
| 4918 | VkPhysicalDevice physicalDevice, |
| 4919 | VkDisplayKHR display, |
| 4920 | const VkDisplayModeCreateInfoKHR* pCreateInfo, |
Jesse Hall | 0e74f00 | 2015-11-30 11:37:59 -0800 | [diff] [blame] | 4921 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 4922 | VkDisplayModeKHR* pMode) { |
| 4923 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
| 4924 | return ? |
| 4925 | } |
| 4926 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 4927 | @extension("VK_KHR_display") |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 4928 | cmd VkResult vkGetDisplayPlaneCapabilitiesKHR( |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 4929 | VkPhysicalDevice physicalDevice, |
Jesse Hall | 9ba8bc8 | 2015-11-30 16:22:16 -0800 | [diff] [blame] | 4930 | VkDisplayModeKHR mode, |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 4931 | u32 planeIndex, |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 4932 | VkDisplayPlaneCapabilitiesKHR* pCapabilities) { |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 4933 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
| 4934 | return ? |
| 4935 | } |
| 4936 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 4937 | @extension("VK_KHR_display") |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 4938 | cmd VkResult vkCreateDisplayPlaneSurfaceKHR( |
| 4939 | VkInstance instance, |
| 4940 | const VkDisplaySurfaceCreateInfoKHR* pCreateInfo, |
Jesse Hall | 0e74f00 | 2015-11-30 11:37:59 -0800 | [diff] [blame] | 4941 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 4942 | VkSurfaceKHR* pSurface) { |
| 4943 | return ? |
| 4944 | } |
| 4945 | |
Jesse Hall | 9ba8bc8 | 2015-11-30 16:22:16 -0800 | [diff] [blame] | 4946 | @extension("VK_KHR_display_swapchain") |
| 4947 | cmd VkResult vkCreateSharedSwapchainsKHR( |
| 4948 | VkDevice device, |
| 4949 | u32 swapchainCount, |
| 4950 | const VkSwapchainCreateInfoKHR* pCreateInfos, |
| 4951 | const VkAllocationCallbacks* pAllocator, |
| 4952 | VkSwapchainKHR* pSwapchains) { |
| 4953 | return ? |
| 4954 | } |
| 4955 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 4956 | @extension("VK_KHR_xlib_surface") |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 4957 | cmd VkResult vkCreateXlibSurfaceKHR( |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 4958 | VkInstance instance, |
Jesse Hall | f9fa9a5 | 2016-01-08 16:08:51 -0800 | [diff] [blame] | 4959 | const VkXlibSurfaceCreateInfoKHR* pCreateInfo, |
Jesse Hall | 0e74f00 | 2015-11-30 11:37:59 -0800 | [diff] [blame] | 4960 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 4961 | VkSurfaceKHR* pSurface) { |
| 4962 | instanceObject := GetInstance(instance) |
| 4963 | return ? |
| 4964 | } |
| 4965 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 4966 | @extension("VK_KHR_xlib_surface") |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 4967 | cmd VkBool32 vkGetPhysicalDeviceXlibPresentationSupportKHR( |
| 4968 | VkPhysicalDevice physicalDevice, |
| 4969 | u32 queueFamilyIndex, |
| 4970 | platform.Display* dpy, |
Jesse Hall | 65ab552 | 2015-11-30 00:07:16 -0800 | [diff] [blame] | 4971 | platform.VisualID visualID) { |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 4972 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
| 4973 | return ? |
| 4974 | } |
| 4975 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 4976 | @extension("VK_KHR_xcb_surface") |
Jesse Hall | f9fa9a5 | 2016-01-08 16:08:51 -0800 | [diff] [blame] | 4977 | cmd VkResult vkCreateXcbSurfaceKHR( |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 4978 | VkInstance instance, |
Jesse Hall | f9fa9a5 | 2016-01-08 16:08:51 -0800 | [diff] [blame] | 4979 | const VkXcbSurfaceCreateInfoKHR* pCreateInfo, |
Jesse Hall | 0e74f00 | 2015-11-30 11:37:59 -0800 | [diff] [blame] | 4980 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 4981 | VkSurfaceKHR* pSurface) { |
| 4982 | instanceObject := GetInstance(instance) |
| 4983 | return ? |
| 4984 | } |
| 4985 | |
Jesse Hall | 523db34 | 2015-11-30 21:12:55 -0800 | [diff] [blame] | 4986 | @extension("VK_KHR_xcb_surface") |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 4987 | cmd VkBool32 vkGetPhysicalDeviceXcbPresentationSupportKHR( |
| 4988 | VkPhysicalDevice physicalDevice, |
| 4989 | u32 queueFamilyIndex, |
| 4990 | platform.xcb_connection_t* connection, |
| 4991 | platform.xcb_visualid_t visual_id) { |
| 4992 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
| 4993 | return ? |
| 4994 | } |
| 4995 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 4996 | @extension("VK_KHR_wayland_surface") |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 4997 | cmd VkResult vkCreateWaylandSurfaceKHR( |
| 4998 | VkInstance instance, |
Jesse Hall | f9fa9a5 | 2016-01-08 16:08:51 -0800 | [diff] [blame] | 4999 | const VkWaylandSurfaceCreateInfoKHR* pCreateInfo, |
Jesse Hall | 0e74f00 | 2015-11-30 11:37:59 -0800 | [diff] [blame] | 5000 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5001 | VkSurfaceKHR* pSurface) { |
| 5002 | instanceObject := GetInstance(instance) |
| 5003 | return ? |
| 5004 | } |
| 5005 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 5006 | @extension("VK_KHR_wayland_surface") |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 5007 | cmd VkBool32 vkGetPhysicalDeviceWaylandPresentationSupportKHR( |
| 5008 | VkPhysicalDevice physicalDevice, |
| 5009 | u32 queueFamilyIndex, |
| 5010 | platform.wl_display* display) { |
| 5011 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
| 5012 | return ? |
| 5013 | } |
| 5014 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 5015 | @extension("VK_KHR_mir_surface") |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5016 | cmd VkResult vkCreateMirSurfaceKHR( |
| 5017 | VkInstance instance, |
Jesse Hall | f9fa9a5 | 2016-01-08 16:08:51 -0800 | [diff] [blame] | 5018 | const VkMirSurfaceCreateInfoKHR* pCreateInfo, |
Jesse Hall | 0e74f00 | 2015-11-30 11:37:59 -0800 | [diff] [blame] | 5019 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5020 | VkSurfaceKHR* pSurface) { |
| 5021 | instanceObject := GetInstance(instance) |
| 5022 | return ? |
| 5023 | } |
| 5024 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 5025 | @extension("VK_KHR_mir_surface") |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 5026 | cmd VkBool32 vkGetPhysicalDeviceMirPresentationSupportKHR( |
| 5027 | VkPhysicalDevice physicalDevice, |
| 5028 | u32 queueFamilyIndex, |
| 5029 | platform.MirConnection* connection) { |
| 5030 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
| 5031 | return ? |
| 5032 | } |
| 5033 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 5034 | @extension("VK_KHR_android_surface") |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5035 | cmd VkResult vkCreateAndroidSurfaceKHR( |
| 5036 | VkInstance instance, |
Jesse Hall | f9fa9a5 | 2016-01-08 16:08:51 -0800 | [diff] [blame] | 5037 | const VkAndroidSurfaceCreateInfoKHR* pCreateInfo, |
Jesse Hall | 0e74f00 | 2015-11-30 11:37:59 -0800 | [diff] [blame] | 5038 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5039 | VkSurfaceKHR* pSurface) { |
| 5040 | instanceObject := GetInstance(instance) |
| 5041 | return ? |
| 5042 | } |
| 5043 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 5044 | @extension("VK_KHR_win32_surface") |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5045 | cmd VkResult vkCreateWin32SurfaceKHR( |
| 5046 | VkInstance instance, |
Jesse Hall | f9fa9a5 | 2016-01-08 16:08:51 -0800 | [diff] [blame] | 5047 | const VkWin32SurfaceCreateInfoKHR* pCreateInfo, |
Jesse Hall | 0e74f00 | 2015-11-30 11:37:59 -0800 | [diff] [blame] | 5048 | const VkAllocationCallbacks* pAllocator, |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5049 | VkSurfaceKHR* pSurface) { |
| 5050 | instanceObject := GetInstance(instance) |
| 5051 | return ? |
| 5052 | } |
| 5053 | |
Jesse Hall | 3e0dc8f | 2015-11-30 00:42:57 -0800 | [diff] [blame] | 5054 | @extension("VK_KHR_win32_surface") |
Jesse Hall | a642925 | 2015-11-29 18:59:42 -0800 | [diff] [blame] | 5055 | cmd VkResult vkGetPhysicalDeviceWin32PresentationSupportKHR( |
| 5056 | VkPhysicalDevice physicalDevice, |
| 5057 | u32 queueFamilyIndex) { |
| 5058 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
| 5059 | return ? |
| 5060 | } |
| 5061 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5062 | |
| 5063 | //////////////// |
| 5064 | // Validation // |
| 5065 | //////////////// |
| 5066 | |
| 5067 | extern void validate(string layerName, bool condition, string message) |
| 5068 | |
| 5069 | |
| 5070 | ///////////////////////////// |
| 5071 | // Internal State Tracking // |
| 5072 | ///////////////////////////// |
| 5073 | |
| 5074 | StateObject State |
| 5075 | |
| 5076 | @internal class StateObject { |
| 5077 | // Dispatchable objects. |
| 5078 | map!(VkInstance, ref!InstanceObject) Instances |
| 5079 | map!(VkPhysicalDevice, ref!PhysicalDeviceObject) PhysicalDevices |
| 5080 | map!(VkDevice, ref!DeviceObject) Devices |
| 5081 | map!(VkQueue, ref!QueueObject) Queues |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5082 | map!(VkCommandBuffer, ref!CommandBufferObject) CommandBuffers |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5083 | |
| 5084 | // Non-dispatchable objects. |
| 5085 | map!(VkDeviceMemory, ref!DeviceMemoryObject) DeviceMemories |
| 5086 | map!(VkBuffer, ref!BufferObject) Buffers |
| 5087 | map!(VkBufferView, ref!BufferViewObject) BufferViews |
| 5088 | map!(VkImage, ref!ImageObject) Images |
| 5089 | map!(VkImageView, ref!ImageViewObject) ImageViews |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5090 | map!(VkShaderModule, ref!ShaderModuleObject) ShaderModules |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5091 | map!(VkPipeline, ref!PipelineObject) Pipelines |
| 5092 | map!(VkPipelineLayout, ref!PipelineLayoutObject) PipelineLayouts |
| 5093 | map!(VkSampler, ref!SamplerObject) Samplers |
| 5094 | map!(VkDescriptorSet, ref!DescriptorSetObject) DescriptorSets |
| 5095 | map!(VkDescriptorSetLayout, ref!DescriptorSetLayoutObject) DescriptorSetLayouts |
| 5096 | map!(VkDescriptorPool, ref!DescriptorPoolObject) DescriptorPools |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5097 | map!(VkFence, ref!FenceObject) Fences |
| 5098 | map!(VkSemaphore, ref!SemaphoreObject) Semaphores |
| 5099 | map!(VkEvent, ref!EventObject) Events |
| 5100 | map!(VkQueryPool, ref!QueryPoolObject) QueryPools |
| 5101 | map!(VkFramebuffer, ref!FramebufferObject) Framebuffers |
| 5102 | map!(VkRenderPass, ref!RenderPassObject) RenderPasses |
| 5103 | map!(VkPipelineCache, ref!PipelineCacheObject) PipelineCaches |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5104 | map!(VkCommandPool, ref!CommandPoolObject) CommandPools |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5105 | map!(VkSurfaceKHR, ref!SurfaceObject) Surfaces |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 5106 | map!(VkSwapchainKHR, ref!SwapchainObject) Swapchains |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5107 | } |
| 5108 | |
| 5109 | @internal class InstanceObject { |
| 5110 | } |
| 5111 | |
| 5112 | @internal class PhysicalDeviceObject { |
| 5113 | VkInstance instance |
| 5114 | } |
| 5115 | |
| 5116 | @internal class DeviceObject { |
| 5117 | VkPhysicalDevice physicalDevice |
| 5118 | } |
| 5119 | |
| 5120 | @internal class QueueObject { |
| 5121 | VkDevice device |
| 5122 | VkQueueFlags flags |
| 5123 | } |
| 5124 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5125 | @internal class CommandBufferObject { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5126 | VkDevice device |
| 5127 | map!(u64, VkDeviceMemory) boundObjects |
| 5128 | VkQueueFlags queueFlags |
| 5129 | } |
| 5130 | |
| 5131 | @internal class DeviceMemoryObject { |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5132 | VkDevice device |
| 5133 | VkDeviceSize allocationSize |
| 5134 | map!(u64, VkDeviceSize) boundObjects |
| 5135 | map!(VkCommandBuffer, VkCommandBuffer) boundCommandBuffers |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5136 | } |
| 5137 | |
| 5138 | @internal class BufferObject { |
| 5139 | VkDevice device |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5140 | VkDeviceMemory memory |
| 5141 | VkDeviceSize memoryOffset |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5142 | } |
| 5143 | |
| 5144 | @internal class BufferViewObject { |
| 5145 | VkDevice device |
| 5146 | VkBuffer buffer |
| 5147 | } |
| 5148 | |
| 5149 | @internal class ImageObject { |
| 5150 | VkDevice device |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5151 | VkDeviceMemory memory |
| 5152 | VkDeviceSize memoryOffset |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5153 | } |
| 5154 | |
| 5155 | @internal class ImageViewObject { |
| 5156 | VkDevice device |
| 5157 | VkImage image |
| 5158 | } |
| 5159 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5160 | @internal class ShaderObject { |
| 5161 | VkDevice device |
| 5162 | } |
| 5163 | |
| 5164 | @internal class ShaderModuleObject { |
| 5165 | VkDevice device |
| 5166 | } |
| 5167 | |
| 5168 | @internal class PipelineObject { |
| 5169 | VkDevice device |
| 5170 | } |
| 5171 | |
| 5172 | @internal class PipelineLayoutObject { |
| 5173 | VkDevice device |
| 5174 | } |
| 5175 | |
| 5176 | @internal class SamplerObject { |
| 5177 | VkDevice device |
| 5178 | } |
| 5179 | |
| 5180 | @internal class DescriptorSetObject { |
| 5181 | VkDevice device |
| 5182 | } |
| 5183 | |
| 5184 | @internal class DescriptorSetLayoutObject { |
| 5185 | VkDevice device |
| 5186 | } |
| 5187 | |
| 5188 | @internal class DescriptorPoolObject { |
| 5189 | VkDevice device |
| 5190 | } |
| 5191 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5192 | @internal class FenceObject { |
| 5193 | VkDevice device |
| 5194 | bool signaled |
| 5195 | } |
| 5196 | |
| 5197 | @internal class SemaphoreObject { |
| 5198 | VkDevice device |
| 5199 | } |
| 5200 | |
| 5201 | @internal class EventObject { |
| 5202 | VkDevice device |
| 5203 | } |
| 5204 | |
| 5205 | @internal class QueryPoolObject { |
| 5206 | VkDevice device |
| 5207 | } |
| 5208 | |
| 5209 | @internal class FramebufferObject { |
| 5210 | VkDevice device |
| 5211 | } |
| 5212 | |
| 5213 | @internal class RenderPassObject { |
| 5214 | VkDevice device |
| 5215 | } |
| 5216 | |
| 5217 | @internal class PipelineCacheObject { |
| 5218 | VkDevice device |
| 5219 | } |
| 5220 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5221 | @internal class CommandPoolObject { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5222 | VkDevice device |
| 5223 | } |
| 5224 | |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5225 | @internal class SurfaceObject { |
| 5226 | VkInstance instance |
| 5227 | } |
| 5228 | |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 5229 | @internal class SwapchainObject { |
| 5230 | VkDevice device |
| 5231 | } |
| 5232 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5233 | macro ref!InstanceObject GetInstance(VkInstance instance) { |
| 5234 | assert(instance in State.Instances) |
| 5235 | return State.Instances[instance] |
| 5236 | } |
| 5237 | |
| 5238 | macro ref!PhysicalDeviceObject GetPhysicalDevice(VkPhysicalDevice physicalDevice) { |
| 5239 | assert(physicalDevice in State.PhysicalDevices) |
| 5240 | return State.PhysicalDevices[physicalDevice] |
| 5241 | } |
| 5242 | |
| 5243 | macro ref!DeviceObject GetDevice(VkDevice device) { |
| 5244 | assert(device in State.Devices) |
| 5245 | return State.Devices[device] |
| 5246 | } |
| 5247 | |
| 5248 | macro ref!QueueObject GetQueue(VkQueue queue) { |
| 5249 | assert(queue in State.Queues) |
| 5250 | return State.Queues[queue] |
| 5251 | } |
| 5252 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5253 | macro ref!CommandBufferObject GetCommandBuffer(VkCommandBuffer commandBuffer) { |
| 5254 | assert(commandBuffer in State.CommandBuffers) |
| 5255 | return State.CommandBuffers[commandBuffer] |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5256 | } |
| 5257 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5258 | macro ref!DeviceMemoryObject GetDeviceMemory(VkDeviceMemory memory) { |
| 5259 | assert(memory in State.DeviceMemories) |
| 5260 | return State.DeviceMemories[memory] |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5261 | } |
| 5262 | |
| 5263 | macro ref!BufferObject GetBuffer(VkBuffer buffer) { |
| 5264 | assert(buffer in State.Buffers) |
| 5265 | return State.Buffers[buffer] |
| 5266 | } |
| 5267 | |
| 5268 | macro ref!BufferViewObject GetBufferView(VkBufferView bufferView) { |
| 5269 | assert(bufferView in State.BufferViews) |
| 5270 | return State.BufferViews[bufferView] |
| 5271 | } |
| 5272 | |
| 5273 | macro ref!ImageObject GetImage(VkImage image) { |
| 5274 | assert(image in State.Images) |
| 5275 | return State.Images[image] |
| 5276 | } |
| 5277 | |
| 5278 | macro ref!ImageViewObject GetImageView(VkImageView imageView) { |
| 5279 | assert(imageView in State.ImageViews) |
| 5280 | return State.ImageViews[imageView] |
| 5281 | } |
| 5282 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5283 | macro ref!ShaderModuleObject GetShaderModule(VkShaderModule shaderModule) { |
| 5284 | assert(shaderModule in State.ShaderModules) |
| 5285 | return State.ShaderModules[shaderModule] |
| 5286 | } |
| 5287 | |
| 5288 | macro ref!PipelineObject GetPipeline(VkPipeline pipeline) { |
| 5289 | assert(pipeline in State.Pipelines) |
| 5290 | return State.Pipelines[pipeline] |
| 5291 | } |
| 5292 | |
| 5293 | macro ref!PipelineLayoutObject GetPipelineLayout(VkPipelineLayout pipelineLayout) { |
| 5294 | assert(pipelineLayout in State.PipelineLayouts) |
| 5295 | return State.PipelineLayouts[pipelineLayout] |
| 5296 | } |
| 5297 | |
| 5298 | macro ref!SamplerObject GetSampler(VkSampler sampler) { |
| 5299 | assert(sampler in State.Samplers) |
| 5300 | return State.Samplers[sampler] |
| 5301 | } |
| 5302 | |
| 5303 | macro ref!DescriptorSetObject GetDescriptorSet(VkDescriptorSet descriptorSet) { |
| 5304 | assert(descriptorSet in State.DescriptorSets) |
| 5305 | return State.DescriptorSets[descriptorSet] |
| 5306 | } |
| 5307 | |
| 5308 | macro ref!DescriptorSetLayoutObject GetDescriptorSetLayout(VkDescriptorSetLayout descriptorSetLayout) { |
| 5309 | assert(descriptorSetLayout in State.DescriptorSetLayouts) |
| 5310 | return State.DescriptorSetLayouts[descriptorSetLayout] |
| 5311 | } |
| 5312 | |
| 5313 | macro ref!DescriptorPoolObject GetDescriptorPool(VkDescriptorPool descriptorPool) { |
| 5314 | assert(descriptorPool in State.DescriptorPools) |
| 5315 | return State.DescriptorPools[descriptorPool] |
| 5316 | } |
| 5317 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 5318 | macro ref!FenceObject GetFence(VkFence fence) { |
| 5319 | assert(fence in State.Fences) |
| 5320 | return State.Fences[fence] |
| 5321 | } |
| 5322 | |
| 5323 | macro ref!SemaphoreObject GetSemaphore(VkSemaphore semaphore) { |
| 5324 | assert(semaphore in State.Semaphores) |
| 5325 | return State.Semaphores[semaphore] |
| 5326 | } |
| 5327 | |
| 5328 | macro ref!EventObject GetEvent(VkEvent event) { |
| 5329 | assert(event in State.Events) |
| 5330 | return State.Events[event] |
| 5331 | } |
| 5332 | |
| 5333 | macro ref!QueryPoolObject GetQueryPool(VkQueryPool queryPool) { |
| 5334 | assert(queryPool in State.QueryPools) |
| 5335 | return State.QueryPools[queryPool] |
| 5336 | } |
| 5337 | |
| 5338 | macro ref!FramebufferObject GetFramebuffer(VkFramebuffer framebuffer) { |
| 5339 | assert(framebuffer in State.Framebuffers) |
| 5340 | return State.Framebuffers[framebuffer] |
| 5341 | } |
| 5342 | |
| 5343 | macro ref!RenderPassObject GetRenderPass(VkRenderPass renderPass) { |
| 5344 | assert(renderPass in State.RenderPasses) |
| 5345 | return State.RenderPasses[renderPass] |
| 5346 | } |
| 5347 | |
| 5348 | macro ref!PipelineCacheObject GetPipelineCache(VkPipelineCache pipelineCache) { |
| 5349 | assert(pipelineCache in State.PipelineCaches) |
| 5350 | return State.PipelineCaches[pipelineCache] |
| 5351 | } |
| 5352 | |
Jesse Hall | 3fbc856 | 2015-11-29 22:10:52 -0800 | [diff] [blame] | 5353 | macro ref!CommandPoolObject GetCommandPool(VkCommandPool commandPool) { |
| 5354 | assert(commandPool in State.CommandPools) |
| 5355 | return State.CommandPools[commandPool] |
Jesse Hall | f09c6b1 | 2015-08-15 19:54:28 -0700 | [diff] [blame] | 5356 | } |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 5357 | |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5358 | macro ref!SurfaceObject GetSurface(VkSurfaceKHR surface) { |
| 5359 | assert(surface in State.Surfaces) |
| 5360 | return State.Surfaces[surface] |
| 5361 | } |
| 5362 | |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 5363 | macro ref!SwapchainObject GetSwapchain(VkSwapchainKHR swapchain) { |
| 5364 | assert(swapchain in State.Swapchains) |
| 5365 | return State.Swapchains[swapchain] |
| 5366 | } |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 5367 | |
| 5368 | macro VkQueueFlags AddQueueFlag(VkQueueFlags flags, VkQueueFlagBits bit) { |
| 5369 | return as!VkQueueFlags(as!u32(flags) | as!u32(bit)) |
| 5370 | } |