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 | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 30 | define VERSION_MINOR 188 |
Jesse Hall | ae38f73 | 2015-11-19 21:32:50 -0800 | [diff] [blame] | 31 | define VERSION_PATCH 0 |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 32 | |
| 33 | // API limits |
| 34 | define VK_MAX_PHYSICAL_DEVICE_NAME 256 |
| 35 | define VK_UUID_LENGTH 16 |
| 36 | define VK_MAX_EXTENSION_NAME 256 |
| 37 | define VK_MAX_DESCRIPTION 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. |
| 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 | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 48 | @extension("VK_EXT_KHR_surface") define VK_EXT_KHR_SURFACE_REVISION 19 |
| 49 | @extension("VK_EXT_KHR_surface") define VK_EXT_KHR_SURFACE_EXTENSION_NUMBER 1 |
| 50 | @extension("VK_EXT_KHR_surface") define VK_EXT_KHR_SURFACE_EXTENSION_NAME "VK_EXT_KHR_surface" |
| 51 | |
| 52 | @extension("VK_EXT_KHR_swapchain") define VK_EXT_KHR_SWAPCHAIN_REVISION 59 |
| 53 | @extension("VK_EXT_KHR_swapchain") define VK_EXT_KHR_SWAPCHAIN_EXTENSION_NUMBER 2 |
| 54 | @extension("VK_EXT_KHR_swapchain") define VK_EXT_KHR_SWAPCHAIN_EXTENSION_NAME "VK_EXT_KHR_swapchain" |
| 55 | |
| 56 | @extension("VK_EXT_KHR_display") define VK_EXT_KHR_DISPLAY_REVISION 16 |
| 57 | @extension("VK_EXT_KHR_display") define VK_EXT_KHR_DISPLAY_EXTENSION_NUMBER 3 |
| 58 | @extension("VK_EXT_KHR_display") define VK_EXT_KHR_DISPLAY_EXTENSION_NAME "VK_EXT_KHR_display" |
| 59 | |
| 60 | @extension("VK_EXT_KHR_display_swapchain") define VK_EXT_KHR_DISPLAY_REVISION 14 |
| 61 | @extension("VK_EXT_KHR_display_swapchain") define VK_EXT_KHR_DISPLAY_EXTENSION_NUMBER 4 |
| 62 | @extension("VK_EXT_KHR_display_swapchain") define VK_EXT_KHR_DISPLAY_EXTENSION_NAME "VK_EXT_KHR_display_swapchain" |
| 63 | |
| 64 | @extension("VK_EXT_KHR_x11_surface") define VK_EXT_KHR_X11_SURFACE_REVISION 1 |
| 65 | @extension("VK_EXT_KHR_x11_surface") define VK_EXT_KHR_X11_SURFACE_NUMBER 4 |
| 66 | @extension("VK_EXT_KHR_x11_surface") define VK_EXT_KHR_X11_SURFACE_NAME "VK_EXT_KHR_x11_surface" |
| 67 | |
| 68 | @extension("VK_EXT_KHR_xcb_surface") define VK_EXT_KHR_XCB_SURFACE_REVISION 1 |
| 69 | @extension("VK_EXT_KHR_xcb_surface") define VK_EXT_KHR_XCB_SURFACE_NUMBER 6 |
| 70 | @extension("VK_EXT_KHR_xcb_surface") define VK_EXT_KHR_XCB_SURFACE_NAME "VK_EXT_KHR_xcb_surface" |
| 71 | |
| 72 | @extension("VK_EXT_KHR_wayland_surface") define VK_EXT_KHR_WAYLAND_SURFACE_REVISION 1 |
| 73 | @extension("VK_EXT_KHR_wayland_surface") define VK_EXT_KHR_WAYLAND_SURFACE_NUMBER 7 |
| 74 | @extension("VK_EXT_KHR_wayland_surface") define VK_EXT_KHR_WAYLAND_SURFACE_NAME "VK_EXT_KHR_wayland_surface" |
| 75 | |
| 76 | @extension("VK_EXT_KHR_mir_surface") define VK_EXT_KHR_MIR_SURFACE_REVISION 1 |
| 77 | @extension("VK_EXT_KHR_mir_surface") define VK_EXT_KHR_MIR_SURFACE_NUMBER 8 |
| 78 | @extension("VK_EXT_KHR_mir_surface") define VK_EXT_KHR_MIR_SURFACE_NAME "VK_EXT_KHR_mir_surface" |
| 79 | |
| 80 | @extension("VK_EXT_KHR_android_surface") define VK_EXT_KHR_ANDROID_SURFACE_REVISION 1 |
| 81 | @extension("VK_EXT_KHR_android_surface") define VK_EXT_KHR_ANDROID_SURFACE_NUMBER 8 |
| 82 | @extension("VK_EXT_KHR_android_surface") define VK_EXT_KHR_ANDROID_SURFACE_NAME "VK_EXT_KHR_android_surface" |
| 83 | |
| 84 | @extension("VK_EXT_KHR_win32_surface") define VK_EXT_KHR_WIN32_SURFACE_REVISION 1 |
| 85 | @extension("VK_EXT_KHR_win32_surface") define VK_EXT_KHR_WIN32_SURFACE_NUMBER 9 |
| 86 | @extension("VK_EXT_KHR_win32_surface") define VK_EXT_KHR_WIN32_SURFACE_NAME "VK_EXT_KHR_win32_surface" |
| 87 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 88 | |
| 89 | ///////////// |
| 90 | // Types // |
| 91 | ///////////// |
| 92 | |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 93 | type u32 VkBool32 |
| 94 | type u32 VkFlags |
| 95 | type u64 VkDeviceSize |
| 96 | type u32 VkSampleMask |
| 97 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 98 | /// Dispatchable handle types. |
| 99 | @dispatchHandle type u64 VkInstance |
| 100 | @dispatchHandle type u64 VkPhysicalDevice |
| 101 | @dispatchHandle type u64 VkDevice |
| 102 | @dispatchHandle type u64 VkQueue |
| 103 | @dispatchHandle type u64 VkCmdBuffer |
| 104 | |
| 105 | /// Non dispatchable handle types. |
| 106 | @nonDispatchHandle type u64 VkDeviceMemory |
| 107 | @nonDispatchHandle type u64 VkCmdPool |
| 108 | @nonDispatchHandle type u64 VkBuffer |
| 109 | @nonDispatchHandle type u64 VkBufferView |
| 110 | @nonDispatchHandle type u64 VkImage |
| 111 | @nonDispatchHandle type u64 VkImageView |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 112 | @nonDispatchHandle type u64 VkShaderModule |
| 113 | @nonDispatchHandle type u64 VkShader |
| 114 | @nonDispatchHandle type u64 VkPipeline |
| 115 | @nonDispatchHandle type u64 VkPipelineLayout |
| 116 | @nonDispatchHandle type u64 VkSampler |
| 117 | @nonDispatchHandle type u64 VkDescriptorSet |
| 118 | @nonDispatchHandle type u64 VkDescriptorSetLayout |
| 119 | @nonDispatchHandle type u64 VkDescriptorPool |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 120 | @nonDispatchHandle type u64 VkFence |
| 121 | @nonDispatchHandle type u64 VkSemaphore |
| 122 | @nonDispatchHandle type u64 VkEvent |
| 123 | @nonDispatchHandle type u64 VkQueryPool |
| 124 | @nonDispatchHandle type u64 VkFramebuffer |
| 125 | @nonDispatchHandle type u64 VkRenderPass |
| 126 | @nonDispatchHandle type u64 VkPipelineCache |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 127 | |
| 128 | @extension("VK_EXT_KHR_surface") @nonDispatchHandle type u64 VkSurfaceKHR |
| 129 | |
| 130 | @extension("VK_EXT_KHR_swapchain") @nonDispatchHandle type u64 VkSwapchainKHR |
| 131 | |
| 132 | @extension("VK_EXT_KHR_display") @nonDispatchHandle type u64 VkDisplayKHR |
| 133 | @extension("VK_EXT_KHR_display") @nonDispatchHandle type u64 VkDisplayModeKHR |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 134 | |
| 135 | |
| 136 | ///////////// |
| 137 | // Enums // |
| 138 | ///////////// |
| 139 | |
| 140 | enum VkImageLayout { |
| 141 | VK_IMAGE_LAYOUT_UNDEFINED = 0x00000000, /// Implicit layout an image is when its contents are undefined due to various reasons (e.g. right after creation) |
| 142 | VK_IMAGE_LAYOUT_GENERAL = 0x00000001, /// General layout when image can be used for any kind of access |
| 143 | VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL = 0x00000002, /// Optimal layout when image is only used for color attachment read/write |
| 144 | VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL = 0x00000003, /// Optimal layout when image is only used for depth/stencil attachment read/write |
| 145 | VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL = 0x00000004, /// Optimal layout when image is used for read only depth/stencil attachment and shader access |
| 146 | VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL = 0x00000005, /// Optimal layout when image is used for read only shader access |
| 147 | VK_IMAGE_LAYOUT_TRANSFER_SOURCE_OPTIMAL = 0x00000006, /// Optimal layout when image is used only as source of transfer operations |
| 148 | VK_IMAGE_LAYOUT_TRANSFER_DESTINATION_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] | 149 | 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] | 150 | |
| 151 | //@extension("VK_EXT_KHR_swapchain") |
| 152 | VK_IMAGE_LAYOUT_PRESENT_SOURCE_KHR = 0xc0000802, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 153 | } |
| 154 | |
| 155 | enum VkAttachmentLoadOp { |
| 156 | VK_ATTACHMENT_LOAD_OP_LOAD = 0x00000000, |
| 157 | VK_ATTACHMENT_LOAD_OP_CLEAR = 0x00000001, |
| 158 | VK_ATTACHMENT_LOAD_OP_DONT_CARE = 0x00000002, |
| 159 | } |
| 160 | |
| 161 | enum VkAttachmentStoreOp { |
| 162 | VK_ATTACHMENT_STORE_OP_STORE = 0x00000000, |
| 163 | VK_ATTACHMENT_STORE_OP_DONT_CARE = 0x00000001, |
| 164 | } |
| 165 | |
| 166 | enum VkImageType { |
| 167 | VK_IMAGE_TYPE_1D = 0x00000000, |
| 168 | VK_IMAGE_TYPE_2D = 0x00000001, |
| 169 | VK_IMAGE_TYPE_3D = 0x00000002, |
| 170 | } |
| 171 | |
| 172 | enum VkImageTiling { |
| 173 | VK_IMAGE_TILING_LINEAR = 0x00000000, |
| 174 | VK_IMAGE_TILING_OPTIMAL = 0x00000001, |
| 175 | } |
| 176 | |
| 177 | enum VkImageViewType { |
| 178 | VK_IMAGE_VIEW_TYPE_1D = 0x00000000, |
| 179 | VK_IMAGE_VIEW_TYPE_2D = 0x00000001, |
| 180 | VK_IMAGE_VIEW_TYPE_3D = 0x00000002, |
| 181 | VK_IMAGE_VIEW_TYPE_CUBE = 0x00000003, |
| 182 | VK_IMAGE_VIEW_TYPE_1D_ARRAY = 0x00000004, |
| 183 | VK_IMAGE_VIEW_TYPE_2D_ARRAY = 0x00000005, |
| 184 | VK_IMAGE_VIEW_TYPE_CUBE_ARRAY = 0x00000006, |
| 185 | } |
| 186 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 187 | enum VkCmdBufferLevel { |
| 188 | VK_CMD_BUFFER_LEVEL_PRIMARY = 0x00000000, |
| 189 | VK_CMD_BUFFER_LEVEL_SECONDARY = 0x00000001, |
| 190 | } |
| 191 | |
| 192 | enum VkChannelSwizzle { |
| 193 | VK_CHANNEL_SWIZZLE_ZERO = 0x00000000, |
| 194 | VK_CHANNEL_SWIZZLE_ONE = 0x00000001, |
| 195 | VK_CHANNEL_SWIZZLE_R = 0x00000002, |
| 196 | VK_CHANNEL_SWIZZLE_G = 0x00000003, |
| 197 | VK_CHANNEL_SWIZZLE_B = 0x00000004, |
| 198 | VK_CHANNEL_SWIZZLE_A = 0x00000005, |
| 199 | } |
| 200 | |
| 201 | enum VkDescriptorType { |
| 202 | VK_DESCRIPTOR_TYPE_SAMPLER = 0x00000000, |
| 203 | VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER = 0x00000001, |
| 204 | VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE = 0x00000002, |
| 205 | VK_DESCRIPTOR_TYPE_STORAGE_IMAGE = 0x00000003, |
| 206 | VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER = 0x00000004, |
| 207 | VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER = 0x00000005, |
| 208 | VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER = 0x00000006, |
| 209 | VK_DESCRIPTOR_TYPE_STORAGE_BUFFER = 0x00000007, |
| 210 | VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC = 0x00000008, |
| 211 | VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC = 0x00000009, |
| 212 | VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT = 0x0000000a, |
| 213 | } |
| 214 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 215 | enum VkQueryType { |
| 216 | VK_QUERY_TYPE_OCCLUSION = 0x00000000, |
| 217 | VK_QUERY_TYPE_PIPELINE_STATISTICS = 0x00000001, /// Optional |
Jesse Hall | a3a7a1d | 2015-11-24 11:37:23 -0800 | [diff] [blame] | 218 | VK_QUERY_TYPE_TIMESTAMP = 0x00000002, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 219 | } |
| 220 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 221 | enum VkBorderColor { |
| 222 | VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK = 0x00000000, |
| 223 | VK_BORDER_COLOR_INT_TRANSPARENT_BLACK = 0x00000001, |
| 224 | VK_BORDER_COLOR_FLOAT_OPAQUE_BLACK = 0x00000002, |
| 225 | VK_BORDER_COLOR_INT_OPAQUE_BLACK = 0x00000003, |
| 226 | VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE = 0x00000004, |
| 227 | VK_BORDER_COLOR_INT_OPAQUE_WHITE = 0x00000005, |
| 228 | } |
| 229 | |
| 230 | enum VkPipelineBindPoint { |
| 231 | VK_PIPELINE_BIND_POINT_COMPUTE = 0x00000000, |
| 232 | VK_PIPELINE_BIND_POINT_GRAPHICS = 0x00000001, |
| 233 | } |
| 234 | |
| 235 | enum VkPrimitiveTopology { |
| 236 | VK_PRIMITIVE_TOPOLOGY_POINT_LIST = 0x00000000, |
| 237 | VK_PRIMITIVE_TOPOLOGY_LINE_LIST = 0x00000001, |
| 238 | VK_PRIMITIVE_TOPOLOGY_LINE_STRIP = 0x00000002, |
| 239 | VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST = 0x00000003, |
| 240 | VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP = 0x00000004, |
| 241 | VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN = 0x00000005, |
| 242 | VK_PRIMITIVE_TOPOLOGY_LINE_LIST_ADJ = 0x00000006, |
| 243 | VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_ADJ = 0x00000007, |
| 244 | VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_ADJ = 0x00000008, |
| 245 | VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_ADJ = 0x00000009, |
| 246 | VK_PRIMITIVE_TOPOLOGY_PATCH = 0x0000000a, |
| 247 | } |
| 248 | |
| 249 | enum VkSharingMode { |
| 250 | VK_SHARING_MODE_EXCLUSIVE = 0x00000000, |
| 251 | VK_SHARING_MODE_CONCURRENT = 0x00000001, |
| 252 | } |
| 253 | |
| 254 | enum VkIndexType { |
| 255 | VK_INDEX_TYPE_UINT16 = 0x00000000, |
| 256 | VK_INDEX_TYPE_UINT32 = 0x00000001, |
| 257 | } |
| 258 | |
| 259 | enum VkTexFilter { |
| 260 | VK_TEX_FILTER_NEAREST = 0x00000000, |
| 261 | VK_TEX_FILTER_LINEAR = 0x00000001, |
| 262 | } |
| 263 | |
| 264 | enum VkTexMipmapMode { |
| 265 | VK_TEX_MIPMAP_MODE_BASE = 0x00000000, /// Always choose base level |
| 266 | VK_TEX_MIPMAP_MODE_NEAREST = 0x00000001, /// Choose nearest mip level |
| 267 | VK_TEX_MIPMAP_MODE_LINEAR = 0x00000002, /// Linear filter between mip levels |
| 268 | } |
| 269 | |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 270 | enum VkTexAddressMode { |
| 271 | VK_TEX_ADDRESS_MODE_WRAP = 0x00000000, |
| 272 | VK_TEX_ADDRESS_MODE_MIRROR = 0x00000001, |
| 273 | VK_TEX_ADDRESS_MODE_CLAMP = 0x00000002, |
| 274 | VK_TEX_ADDRESS_MODE_MIRROR_ONCE = 0x00000003, |
| 275 | VK_TEX_ADDRESS_MODE_CLAMP_BORDER = 0x00000004, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 276 | } |
| 277 | |
| 278 | enum VkCompareOp { |
| 279 | VK_COMPARE_OP_NEVER = 0x00000000, |
| 280 | VK_COMPARE_OP_LESS = 0x00000001, |
| 281 | VK_COMPARE_OP_EQUAL = 0x00000002, |
| 282 | VK_COMPARE_OP_LESS_EQUAL = 0x00000003, |
| 283 | VK_COMPARE_OP_GREATER = 0x00000004, |
| 284 | VK_COMPARE_OP_NOT_EQUAL = 0x00000005, |
| 285 | VK_COMPARE_OP_GREATER_EQUAL = 0x00000006, |
| 286 | VK_COMPARE_OP_ALWAYS = 0x00000007, |
| 287 | } |
| 288 | |
| 289 | enum VkFillMode { |
| 290 | VK_FILL_MODE_POINTS = 0x00000000, |
| 291 | VK_FILL_MODE_WIREFRAME = 0x00000001, |
| 292 | VK_FILL_MODE_SOLID = 0x00000002, |
| 293 | } |
| 294 | |
| 295 | enum VkCullMode { |
| 296 | VK_CULL_MODE_NONE = 0x00000000, |
| 297 | VK_CULL_MODE_FRONT = 0x00000001, |
| 298 | VK_CULL_MODE_BACK = 0x00000002, |
| 299 | VK_CULL_MODE_FRONT_AND_BACK = 0x00000003, |
| 300 | } |
| 301 | |
| 302 | enum VkFrontFace { |
| 303 | VK_FRONT_FACE_CCW = 0x00000000, |
| 304 | VK_FRONT_FACE_CW = 0x00000001, |
| 305 | } |
| 306 | |
| 307 | enum VkBlend { |
| 308 | VK_BLEND_ZERO = 0x00000000, |
| 309 | VK_BLEND_ONE = 0x00000001, |
| 310 | VK_BLEND_SRC_COLOR = 0x00000002, |
| 311 | VK_BLEND_ONE_MINUS_SRC_COLOR = 0x00000003, |
| 312 | VK_BLEND_DEST_COLOR = 0x00000004, |
| 313 | VK_BLEND_ONE_MINUS_DEST_COLOR = 0x00000005, |
| 314 | VK_BLEND_SRC_ALPHA = 0x00000006, |
| 315 | VK_BLEND_ONE_MINUS_SRC_ALPHA = 0x00000007, |
| 316 | VK_BLEND_DEST_ALPHA = 0x00000008, |
| 317 | VK_BLEND_ONE_MINUS_DEST_ALPHA = 0x00000009, |
| 318 | VK_BLEND_CONSTANT_COLOR = 0x0000000a, |
| 319 | VK_BLEND_ONE_MINUS_CONSTANT_COLOR = 0x0000000b, |
| 320 | VK_BLEND_CONSTANT_ALPHA = 0x0000000c, |
| 321 | VK_BLEND_ONE_MINUS_CONSTANT_ALPHA = 0x0000000d, |
| 322 | VK_BLEND_SRC_ALPHA_SATURATE = 0x0000000e, |
| 323 | VK_BLEND_SRC1_COLOR = 0x0000000f, |
| 324 | VK_BLEND_ONE_MINUS_SRC1_COLOR = 0x00000010, |
| 325 | VK_BLEND_SRC1_ALPHA = 0x00000011, |
| 326 | VK_BLEND_ONE_MINUS_SRC1_ALPHA = 0x00000012, |
| 327 | } |
| 328 | |
| 329 | enum VkBlendOp { |
| 330 | VK_BLEND_OP_ADD = 0x00000000, |
| 331 | VK_BLEND_OP_SUBTRACT = 0x00000001, |
| 332 | VK_BLEND_OP_REVERSE_SUBTRACT = 0x00000002, |
| 333 | VK_BLEND_OP_MIN = 0x00000003, |
| 334 | VK_BLEND_OP_MAX = 0x00000004, |
| 335 | } |
| 336 | |
| 337 | enum VkStencilOp { |
| 338 | VK_STENCIL_OP_KEEP = 0x00000000, |
| 339 | VK_STENCIL_OP_ZERO = 0x00000001, |
| 340 | VK_STENCIL_OP_REPLACE = 0x00000002, |
| 341 | VK_STENCIL_OP_INC_CLAMP = 0x00000003, |
| 342 | VK_STENCIL_OP_DEC_CLAMP = 0x00000004, |
| 343 | VK_STENCIL_OP_INVERT = 0x00000005, |
| 344 | VK_STENCIL_OP_INC_WRAP = 0x00000006, |
| 345 | VK_STENCIL_OP_DEC_WRAP = 0x00000007, |
| 346 | } |
| 347 | |
| 348 | enum VkLogicOp { |
| 349 | VK_LOGIC_OP_CLEAR = 0x00000000, |
| 350 | VK_LOGIC_OP_AND = 0x00000001, |
| 351 | VK_LOGIC_OP_AND_REVERSE = 0x00000002, |
| 352 | VK_LOGIC_OP_COPY = 0x00000003, |
| 353 | VK_LOGIC_OP_AND_INVERTED = 0x00000004, |
| 354 | VK_LOGIC_OP_NOOP = 0x00000005, |
| 355 | VK_LOGIC_OP_XOR = 0x00000006, |
| 356 | VK_LOGIC_OP_OR = 0x00000007, |
| 357 | VK_LOGIC_OP_NOR = 0x00000008, |
| 358 | VK_LOGIC_OP_EQUIV = 0x00000009, |
| 359 | VK_LOGIC_OP_INVERT = 0x0000000a, |
| 360 | VK_LOGIC_OP_OR_REVERSE = 0x0000000b, |
| 361 | VK_LOGIC_OP_COPY_INVERTED = 0x0000000c, |
| 362 | VK_LOGIC_OP_OR_INVERTED = 0x0000000d, |
| 363 | VK_LOGIC_OP_NAND = 0x0000000e, |
| 364 | VK_LOGIC_OP_SET = 0x0000000f, |
| 365 | } |
| 366 | |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 367 | enum VkSystemAllocScope { |
| 368 | VK_SYSTEM_ALLOC_SCOPE_FUNCTION = 0x00000000, |
| 369 | VK_SYSTEM_ALLOC_SCOPE_OBJECT = 0x00000001, |
| 370 | VK_SYSTEM_ALLOC_SCOPE_CACHE = 0x00000002, |
| 371 | VK_SYSTEM_ALLOC_SCOPE_DEVICE = 0x00000003, |
| 372 | VK_SYSTEM_ALLOC_SCOPE_INSTANCE = 0x00000004, |
| 373 | } |
| 374 | |
| 375 | enum VkInternalAllocType { |
| 376 | VK_INTERNAL_ALLOC_TYPE_EXECUTABLE = 0x00000000, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 377 | } |
| 378 | |
| 379 | enum VkPhysicalDeviceType { |
| 380 | VK_PHYSICAL_DEVICE_TYPE_OTHER = 0x00000000, |
| 381 | VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU = 0x00000001, |
| 382 | VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU = 0x00000002, |
| 383 | VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU = 0x00000003, |
| 384 | VK_PHYSICAL_DEVICE_TYPE_CPU = 0x00000004, |
| 385 | } |
| 386 | |
| 387 | enum VkVertexInputStepRate { |
| 388 | VK_VERTEX_INPUT_STEP_RATE_VERTEX = 0x00000000, |
| 389 | VK_VERTEX_INPUT_STEP_RATE_INSTANCE = 0x00000001, |
| 390 | } |
| 391 | |
| 392 | /// Vulkan format definitions |
| 393 | enum VkFormat { |
| 394 | VK_FORMAT_UNDEFINED = 0x00000000, |
| 395 | VK_FORMAT_R4G4_UNORM = 0x00000001, |
| 396 | VK_FORMAT_R4G4_USCALED = 0x00000002, |
| 397 | VK_FORMAT_R4G4B4A4_UNORM = 0x00000003, |
| 398 | VK_FORMAT_R4G4B4A4_USCALED = 0x00000004, |
| 399 | VK_FORMAT_R5G6B5_UNORM = 0x00000005, |
| 400 | VK_FORMAT_R5G6B5_USCALED = 0x00000006, |
| 401 | VK_FORMAT_R5G5B5A1_UNORM = 0x00000007, |
| 402 | VK_FORMAT_R5G5B5A1_USCALED = 0x00000008, |
| 403 | VK_FORMAT_R8_UNORM = 0x00000009, |
| 404 | VK_FORMAT_R8_SNORM = 0x0000000A, |
| 405 | VK_FORMAT_R8_USCALED = 0x0000000B, |
| 406 | VK_FORMAT_R8_SSCALED = 0x0000000C, |
| 407 | VK_FORMAT_R8_UINT = 0x0000000D, |
| 408 | VK_FORMAT_R8_SINT = 0x0000000E, |
| 409 | VK_FORMAT_R8_SRGB = 0x0000000F, |
| 410 | VK_FORMAT_R8G8_UNORM = 0x00000010, |
| 411 | VK_FORMAT_R8G8_SNORM = 0x00000011, |
| 412 | VK_FORMAT_R8G8_USCALED = 0x00000012, |
| 413 | VK_FORMAT_R8G8_SSCALED = 0x00000013, |
| 414 | VK_FORMAT_R8G8_UINT = 0x00000014, |
| 415 | VK_FORMAT_R8G8_SINT = 0x00000015, |
| 416 | VK_FORMAT_R8G8_SRGB = 0x00000016, |
| 417 | VK_FORMAT_R8G8B8_UNORM = 0x00000017, |
| 418 | VK_FORMAT_R8G8B8_SNORM = 0x00000018, |
| 419 | VK_FORMAT_R8G8B8_USCALED = 0x00000019, |
| 420 | VK_FORMAT_R8G8B8_SSCALED = 0x0000001A, |
| 421 | VK_FORMAT_R8G8B8_UINT = 0x0000001B, |
| 422 | VK_FORMAT_R8G8B8_SINT = 0x0000001C, |
| 423 | VK_FORMAT_R8G8B8_SRGB = 0x0000001D, |
| 424 | VK_FORMAT_R8G8B8A8_UNORM = 0x0000001E, |
| 425 | VK_FORMAT_R8G8B8A8_SNORM = 0x0000001F, |
| 426 | VK_FORMAT_R8G8B8A8_USCALED = 0x00000020, |
| 427 | VK_FORMAT_R8G8B8A8_SSCALED = 0x00000021, |
| 428 | VK_FORMAT_R8G8B8A8_UINT = 0x00000022, |
| 429 | VK_FORMAT_R8G8B8A8_SINT = 0x00000023, |
| 430 | VK_FORMAT_R8G8B8A8_SRGB = 0x00000024, |
| 431 | VK_FORMAT_R10G10B10A2_UNORM = 0x00000025, |
| 432 | VK_FORMAT_R10G10B10A2_SNORM = 0x00000026, |
| 433 | VK_FORMAT_R10G10B10A2_USCALED = 0x00000027, |
| 434 | VK_FORMAT_R10G10B10A2_SSCALED = 0x00000028, |
| 435 | VK_FORMAT_R10G10B10A2_UINT = 0x00000029, |
| 436 | VK_FORMAT_R10G10B10A2_SINT = 0x0000002A, |
| 437 | VK_FORMAT_R16_UNORM = 0x0000002B, |
| 438 | VK_FORMAT_R16_SNORM = 0x0000002C, |
| 439 | VK_FORMAT_R16_USCALED = 0x0000002D, |
| 440 | VK_FORMAT_R16_SSCALED = 0x0000002E, |
| 441 | VK_FORMAT_R16_UINT = 0x0000002F, |
| 442 | VK_FORMAT_R16_SINT = 0x00000030, |
| 443 | VK_FORMAT_R16_SFLOAT = 0x00000031, |
| 444 | VK_FORMAT_R16G16_UNORM = 0x00000032, |
| 445 | VK_FORMAT_R16G16_SNORM = 0x00000033, |
| 446 | VK_FORMAT_R16G16_USCALED = 0x00000034, |
| 447 | VK_FORMAT_R16G16_SSCALED = 0x00000035, |
| 448 | VK_FORMAT_R16G16_UINT = 0x00000036, |
| 449 | VK_FORMAT_R16G16_SINT = 0x00000037, |
| 450 | VK_FORMAT_R16G16_SFLOAT = 0x00000038, |
| 451 | VK_FORMAT_R16G16B16_UNORM = 0x00000039, |
| 452 | VK_FORMAT_R16G16B16_SNORM = 0x0000003A, |
| 453 | VK_FORMAT_R16G16B16_USCALED = 0x0000003B, |
| 454 | VK_FORMAT_R16G16B16_SSCALED = 0x0000003C, |
| 455 | VK_FORMAT_R16G16B16_UINT = 0x0000003D, |
| 456 | VK_FORMAT_R16G16B16_SINT = 0x0000003E, |
| 457 | VK_FORMAT_R16G16B16_SFLOAT = 0x0000003F, |
| 458 | VK_FORMAT_R16G16B16A16_UNORM = 0x00000040, |
| 459 | VK_FORMAT_R16G16B16A16_SNORM = 0x00000041, |
| 460 | VK_FORMAT_R16G16B16A16_USCALED = 0x00000042, |
| 461 | VK_FORMAT_R16G16B16A16_SSCALED = 0x00000043, |
| 462 | VK_FORMAT_R16G16B16A16_UINT = 0x00000044, |
| 463 | VK_FORMAT_R16G16B16A16_SINT = 0x00000045, |
| 464 | VK_FORMAT_R16G16B16A16_SFLOAT = 0x00000046, |
| 465 | VK_FORMAT_R32_UINT = 0x00000047, |
| 466 | VK_FORMAT_R32_SINT = 0x00000048, |
| 467 | VK_FORMAT_R32_SFLOAT = 0x00000049, |
| 468 | VK_FORMAT_R32G32_UINT = 0x0000004A, |
| 469 | VK_FORMAT_R32G32_SINT = 0x0000004B, |
| 470 | VK_FORMAT_R32G32_SFLOAT = 0x0000004C, |
| 471 | VK_FORMAT_R32G32B32_UINT = 0x0000004D, |
| 472 | VK_FORMAT_R32G32B32_SINT = 0x0000004E, |
| 473 | VK_FORMAT_R32G32B32_SFLOAT = 0x0000004F, |
| 474 | VK_FORMAT_R32G32B32A32_UINT = 0x00000050, |
| 475 | VK_FORMAT_R32G32B32A32_SINT = 0x00000051, |
| 476 | VK_FORMAT_R32G32B32A32_SFLOAT = 0x00000052, |
| 477 | VK_FORMAT_R64_SFLOAT = 0x00000053, |
| 478 | VK_FORMAT_R64G64_SFLOAT = 0x00000054, |
| 479 | VK_FORMAT_R64G64B64_SFLOAT = 0x00000055, |
| 480 | VK_FORMAT_R64G64B64A64_SFLOAT = 0x00000056, |
| 481 | VK_FORMAT_R11G11B10_UFLOAT = 0x00000057, |
| 482 | VK_FORMAT_R9G9B9E5_UFLOAT = 0x00000058, |
| 483 | VK_FORMAT_D16_UNORM = 0x00000059, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 484 | VK_FORMAT_D24_UNORM_X8 = 0x0000005A, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 485 | VK_FORMAT_D32_SFLOAT = 0x0000005B, |
| 486 | VK_FORMAT_S8_UINT = 0x0000005C, |
| 487 | VK_FORMAT_D16_UNORM_S8_UINT = 0x0000005D, |
| 488 | VK_FORMAT_D24_UNORM_S8_UINT = 0x0000005E, |
| 489 | VK_FORMAT_D32_SFLOAT_S8_UINT = 0x0000005F, |
| 490 | VK_FORMAT_BC1_RGB_UNORM = 0x00000060, |
| 491 | VK_FORMAT_BC1_RGB_SRGB = 0x00000061, |
| 492 | VK_FORMAT_BC1_RGBA_UNORM = 0x00000062, |
| 493 | VK_FORMAT_BC1_RGBA_SRGB = 0x00000063, |
| 494 | VK_FORMAT_BC2_UNORM = 0x00000064, |
| 495 | VK_FORMAT_BC2_SRGB = 0x00000065, |
| 496 | VK_FORMAT_BC3_UNORM = 0x00000066, |
| 497 | VK_FORMAT_BC3_SRGB = 0x00000067, |
| 498 | VK_FORMAT_BC4_UNORM = 0x00000068, |
| 499 | VK_FORMAT_BC4_SNORM = 0x00000069, |
| 500 | VK_FORMAT_BC5_UNORM = 0x0000006A, |
| 501 | VK_FORMAT_BC5_SNORM = 0x0000006B, |
| 502 | VK_FORMAT_BC6H_UFLOAT = 0x0000006C, |
| 503 | VK_FORMAT_BC6H_SFLOAT = 0x0000006D, |
| 504 | VK_FORMAT_BC7_UNORM = 0x0000006E, |
| 505 | VK_FORMAT_BC7_SRGB = 0x0000006F, |
| 506 | VK_FORMAT_ETC2_R8G8B8_UNORM = 0x00000070, |
| 507 | VK_FORMAT_ETC2_R8G8B8_SRGB = 0x00000071, |
| 508 | VK_FORMAT_ETC2_R8G8B8A1_UNORM = 0x00000072, |
| 509 | VK_FORMAT_ETC2_R8G8B8A1_SRGB = 0x00000073, |
| 510 | VK_FORMAT_ETC2_R8G8B8A8_UNORM = 0x00000074, |
| 511 | VK_FORMAT_ETC2_R8G8B8A8_SRGB = 0x00000075, |
| 512 | VK_FORMAT_EAC_R11_UNORM = 0x00000076, |
| 513 | VK_FORMAT_EAC_R11_SNORM = 0x00000077, |
| 514 | VK_FORMAT_EAC_R11G11_UNORM = 0x00000078, |
| 515 | VK_FORMAT_EAC_R11G11_SNORM = 0x00000079, |
| 516 | VK_FORMAT_ASTC_4x4_UNORM = 0x0000007A, |
| 517 | VK_FORMAT_ASTC_4x4_SRGB = 0x0000007B, |
| 518 | VK_FORMAT_ASTC_5x4_UNORM = 0x0000007C, |
| 519 | VK_FORMAT_ASTC_5x4_SRGB = 0x0000007D, |
| 520 | VK_FORMAT_ASTC_5x5_UNORM = 0x0000007E, |
| 521 | VK_FORMAT_ASTC_5x5_SRGB = 0x0000007F, |
| 522 | VK_FORMAT_ASTC_6x5_UNORM = 0x00000080, |
| 523 | VK_FORMAT_ASTC_6x5_SRGB = 0x00000081, |
| 524 | VK_FORMAT_ASTC_6x6_UNORM = 0x00000082, |
| 525 | VK_FORMAT_ASTC_6x6_SRGB = 0x00000083, |
| 526 | VK_FORMAT_ASTC_8x5_UNORM = 0x00000084, |
| 527 | VK_FORMAT_ASTC_8x5_SRGB = 0x00000085, |
| 528 | VK_FORMAT_ASTC_8x6_UNORM = 0x00000086, |
| 529 | VK_FORMAT_ASTC_8x6_SRGB = 0x00000087, |
| 530 | VK_FORMAT_ASTC_8x8_UNORM = 0x00000088, |
| 531 | VK_FORMAT_ASTC_8x8_SRGB = 0x00000089, |
| 532 | VK_FORMAT_ASTC_10x5_UNORM = 0x0000008A, |
| 533 | VK_FORMAT_ASTC_10x5_SRGB = 0x0000008B, |
| 534 | VK_FORMAT_ASTC_10x6_UNORM = 0x0000008C, |
| 535 | VK_FORMAT_ASTC_10x6_SRGB = 0x0000008D, |
| 536 | VK_FORMAT_ASTC_10x8_UNORM = 0x0000008E, |
| 537 | VK_FORMAT_ASTC_10x8_SRGB = 0x0000008F, |
| 538 | VK_FORMAT_ASTC_10x10_UNORM = 0x00000090, |
| 539 | VK_FORMAT_ASTC_10x10_SRGB = 0x00000091, |
| 540 | VK_FORMAT_ASTC_12x10_UNORM = 0x00000092, |
| 541 | VK_FORMAT_ASTC_12x10_SRGB = 0x00000093, |
| 542 | VK_FORMAT_ASTC_12x12_UNORM = 0x00000094, |
| 543 | VK_FORMAT_ASTC_12x12_SRGB = 0x00000095, |
| 544 | VK_FORMAT_B4G4R4A4_UNORM = 0x00000096, |
| 545 | VK_FORMAT_B5G5R5A1_UNORM = 0x00000097, |
| 546 | VK_FORMAT_B5G6R5_UNORM = 0x00000098, |
| 547 | VK_FORMAT_B5G6R5_USCALED = 0x00000099, |
| 548 | VK_FORMAT_B8G8R8_UNORM = 0x0000009A, |
| 549 | VK_FORMAT_B8G8R8_SNORM = 0x0000009B, |
| 550 | VK_FORMAT_B8G8R8_USCALED = 0x0000009C, |
| 551 | VK_FORMAT_B8G8R8_SSCALED = 0x0000009D, |
| 552 | VK_FORMAT_B8G8R8_UINT = 0x0000009E, |
| 553 | VK_FORMAT_B8G8R8_SINT = 0x0000009F, |
| 554 | VK_FORMAT_B8G8R8_SRGB = 0x000000A0, |
| 555 | VK_FORMAT_B8G8R8A8_UNORM = 0x000000A1, |
| 556 | VK_FORMAT_B8G8R8A8_SNORM = 0x000000A2, |
| 557 | VK_FORMAT_B8G8R8A8_USCALED = 0x000000A3, |
| 558 | VK_FORMAT_B8G8R8A8_SSCALED = 0x000000A4, |
| 559 | VK_FORMAT_B8G8R8A8_UINT = 0x000000A5, |
| 560 | VK_FORMAT_B8G8R8A8_SINT = 0x000000A6, |
| 561 | VK_FORMAT_B8G8R8A8_SRGB = 0x000000A7, |
| 562 | VK_FORMAT_B10G10R10A2_UNORM = 0x000000A8, |
| 563 | VK_FORMAT_B10G10R10A2_SNORM = 0x000000A9, |
| 564 | VK_FORMAT_B10G10R10A2_USCALED = 0x000000AA, |
| 565 | VK_FORMAT_B10G10R10A2_SSCALED = 0x000000AB, |
| 566 | VK_FORMAT_B10G10R10A2_UINT = 0x000000AC, |
| 567 | VK_FORMAT_B10G10R10A2_SINT = 0x000000AD, |
| 568 | } |
| 569 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 570 | /// Structure type enumerant |
| 571 | enum VkStructureType { |
| 572 | VK_STRUCTURE_TYPE_APPLICATION_INFO = 0, |
| 573 | VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO = 1, |
| 574 | VK_STRUCTURE_TYPE_MEMORY_ALLOC_INFO = 2, |
| 575 | VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO = 3, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 576 | VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO = 4, |
| 577 | VK_STRUCTURE_TYPE_SHADER_CREATE_INFO = 5, |
| 578 | VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO = 6, |
| 579 | VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO = 7, |
| 580 | VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO = 8, |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 581 | VK_STRUCTURE_TYPE_CMD_BUFFER_ALLOC_INFO = 9, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 582 | VK_STRUCTURE_TYPE_EVENT_CREATE_INFO = 10, |
| 583 | VK_STRUCTURE_TYPE_FENCE_CREATE_INFO = 11, |
| 584 | VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO = 12, |
| 585 | VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO = 13, |
| 586 | VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO = 14, |
| 587 | VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO = 15, |
| 588 | VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO = 16, |
| 589 | VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO = 17, |
| 590 | VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO = 18, |
| 591 | VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO = 19, |
| 592 | VK_STRUCTURE_TYPE_PIPELINE_RASTER_STATE_CREATE_INFO = 20, |
| 593 | VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO = 21, |
| 594 | VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO = 22, |
| 595 | VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO = 23, |
| 596 | VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO = 24, |
| 597 | VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO = 25, |
| 598 | VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO = 26, |
| 599 | VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO = 27, |
| 600 | VK_STRUCTURE_TYPE_CMD_BUFFER_BEGIN_INFO = 28, |
| 601 | VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO = 29, |
| 602 | VK_STRUCTURE_TYPE_MEMORY_BARRIER = 30, |
| 603 | VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER = 31, |
| 604 | VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER = 32, |
| 605 | VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO = 33, |
| 606 | VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET = 34, |
| 607 | VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET = 35, |
| 608 | VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO = 36, |
| 609 | VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO = 37, |
| 610 | VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE = 38, |
| 611 | VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO = 39, |
| 612 | VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION = 40, |
| 613 | VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION = 41, |
| 614 | VK_STRUCTURE_TYPE_SUBPASS_DEPENDENCY = 42, |
| 615 | VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO = 43, |
| 616 | VK_STRUCTURE_TYPE_CMD_POOL_CREATE_INFO = 44, |
| 617 | VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO = 45, |
| 618 | VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO = 46, |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 619 | VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOC_INFO = 47, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 620 | VK_STRUCTURE_TYPE_SUBMIT_INFO = 48, |
| 621 | VK_STRUCTURE_TYPE_LAYER_INSTANCE_CREATE_INFO = 49, |
| 622 | VK_STRUCTURE_TYPE_LAYER_DEVICE_CREATE_INFO = 50, |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 623 | |
| 624 | //@extension("VK_EXT_KHR_swapchain") |
| 625 | VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR = 0xc0000801, |
| 626 | |
| 627 | //@extension("VK_EXT_KHR_display") |
| 628 | VK_STRUCTURE_TYPE_DISPLAY_MODE_CREATE_INFO_KHR = 0xc0000c00, |
| 629 | VK_STRUCTURE_TYPE_SURFACE_DESCRIPTION_DISPLAY_PLAN_KHR = 0xc0000c01, |
| 630 | |
| 631 | //@extension("VK_EXT_KHR_display_swapchain") |
| 632 | VK_STRUCTURE_TYPE_DISPLAY_SWAPCHAIN_CREATE_INFO_KHR = 0xc0001000, |
| 633 | VK_STRUCTURE_TYPE_DISPLAY_DISPLAY_PRESENT_INFO_KHR = 0xc0001001, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 634 | } |
| 635 | |
| 636 | enum VkRenderPassContents { |
| 637 | VK_RENDER_PASS_CONTENTS_INLINE = 0x00000000, |
| 638 | VK_RENDER_PASS_CONTENTS_SECONDARY_CMD_BUFFERS = 0x00000001, |
| 639 | } |
| 640 | |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 641 | @lastUnused(-8) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 642 | /// Error and return codes |
| 643 | enum VkResult { |
| 644 | // Return codes for successful operation execution (positive values) |
| 645 | VK_SUCCESS = 0x00000000, |
Jesse Hall | a15a4bf | 2015-11-19 22:48:02 -0800 | [diff] [blame] | 646 | VK_NOT_READY = 0x00000001, |
| 647 | VK_TIMEOUT = 0x00000002, |
| 648 | VK_EVENT_SET = 0x00000003, |
| 649 | VK_EVENT_RESET = 0x00000004, |
| 650 | VK_INCOMPLETE = 0x00000005, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 651 | |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 652 | //@extension("VK_EXT_KHR_swapchain") |
| 653 | VK_SUBOPTIMAL_KHR = 0x40000403, |
| 654 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 655 | // Error codes (negative values) |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 656 | VK_ERROR_OUT_OF_HOST_MEMORY = 0xFFFFFFFF, |
| 657 | VK_ERROR_OUT_OF_DEVICE_MEMORY = 0xFFFFFFFE, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 658 | VK_ERROR_INITIALIZATION_FAILED = 0xFFFFFFFD, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 659 | VK_ERROR_DEVICE_LOST = 0xFFFFFFFC, |
| 660 | VK_ERROR_MEMORY_MAP_FAILED = 0xFFFFFFFB, |
| 661 | VK_ERROR_LAYER_NOT_PRESENT = 0xFFFFFFFA, |
| 662 | VK_ERROR_EXTENSION_NOT_PRESENT = 0xFFFFFFF9, |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 663 | VK_ERROR_FEATURE_NOT_PRESENT = 0xFFFFFFF8, |
| 664 | VK_ERROR_INCOMPATIBLE_DRIVER = 0xFFFFFFF7, |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 665 | |
| 666 | //@extension("VK_EXT_KHR_swapchain") |
| 667 | VK_ERROR_OUT_OF_DATE_KHR = 0xC0000804, |
| 668 | |
| 669 | //@extension("VK_EXT_KHR_display_swapchain") |
| 670 | VK_ERROR_INCOMPATIBLE_DISPLAY_KHR = 0xC0001002, |
| 671 | |
| 672 | //@extension("VK_EXT_KHR_android_surface") |
| 673 | VK_ERROR_INVALID_ANDROID_WINDOW_KHR = 0xC002400, |
| 674 | VK_ERROR_ANDROID_WINDOW_IN_USE_KHR = 0xC002401, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 675 | } |
| 676 | |
| 677 | enum VkDynamicState { |
| 678 | VK_DYNAMIC_STATE_VIEWPORT = 0x00000000, |
| 679 | VK_DYNAMIC_STATE_SCISSOR = 0x00000001, |
| 680 | VK_DYNAMIC_STATE_LINE_WIDTH = 0x00000002, |
| 681 | VK_DYNAMIC_STATE_DEPTH_BIAS = 0x00000003, |
| 682 | VK_DYNAMIC_STATE_BLEND_CONSTANTS = 0x00000004, |
| 683 | VK_DYNAMIC_STATE_DEPTH_BOUNDS = 0x00000005, |
| 684 | VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK = 0x00000006, |
| 685 | VK_DYNAMIC_STATE_STENCIL_WRITE_MASK = 0x00000007, |
| 686 | VK_DYNAMIC_STATE_STENCIL_REFERENCE = 0x00000008, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 687 | } |
| 688 | |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 689 | @extension("VK_EXT_KHR_surface") |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 690 | enum VkSurfaceTransformKHR { |
| 691 | VK_SURFACE_TRANSFORM_NONE_KHR = 0x00000000, |
| 692 | VK_SURFACE_TRANSFORM_ROT90_KHR = 0x00000001, |
| 693 | VK_SURFACE_TRANSFORM_ROT180_KHR = 0x00000002, |
| 694 | VK_SURFACE_TRANSFORM_ROT270_KHR = 0x00000003, |
| 695 | VK_SURFACE_TRANSFORM_HMIRROR_KHR = 0x00000004, |
| 696 | VK_SURFACE_TRANSFORM_HMIRROR_ROT90_KHR = 0x00000005, |
| 697 | VK_SURFACE_TRANSFORM_HMIRROR_ROT180_KHR = 0x00000006, |
| 698 | VK_SURFACE_TRANSFORM_HMIRROR_ROT270_KHR = 0x00000007, |
| 699 | VK_SURFACE_TRANSFORM_INHERIT_KHR = 0x00000008, |
| 700 | } |
| 701 | |
| 702 | @extension("VK_EXT_KHR_swapchain") |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 703 | enum VkPresentModeKHR { |
| 704 | VK_PRESENT_MODE_IMMEDIATE_KHR = 0x00000000, |
| 705 | VK_PRESENT_MODE_MAILBOX_KHR = 0x00000001, |
| 706 | VK_PRESENT_MODE_FIFO_KHR = 0x00000002, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 707 | VK_PRESENT_MODE_FIFO_RELAXED_KHR = 0x00000003, |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 708 | } |
| 709 | |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 710 | @extension("VK_EXT_KHR_swapchain") |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 711 | enum VkColorSpaceKHR { |
| 712 | VK_COLORSPACE_SRGB_NONLINEAR_KHR = 0x00000000, |
| 713 | } |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 714 | |
| 715 | ///////////////// |
| 716 | // Bitfields // |
| 717 | ///////////////// |
| 718 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 719 | /// Queue capabilities |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 720 | type VkFlags VkQueueFlags |
| 721 | bitfield VkQueueFlagBits { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 722 | VK_QUEUE_GRAPHICS_BIT = 0x00000001, /// Queue supports graphics operations |
| 723 | VK_QUEUE_COMPUTE_BIT = 0x00000002, /// Queue supports compute operations |
| 724 | VK_QUEUE_DMA_BIT = 0x00000004, /// Queue supports DMA operations |
| 725 | VK_QUEUE_SPARSE_MEMMGR_BIT = 0x00000008, /// Queue supports sparse resource memory management operations |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 726 | } |
| 727 | |
| 728 | /// Memory properties passed into vkAllocMemory(). |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 729 | type VkFlags VkMemoryPropertyFlags |
| 730 | bitfield VkMemoryPropertyFlagBits { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 731 | VK_MEMORY_PROPERTY_DEVICE_ONLY = 0x00000000, /// If otherwise stated, then allocate memory on device |
| 732 | VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT = 0x00000001, /// Memory should be mappable by host |
| 733 | VK_MEMORY_PROPERTY_HOST_NON_COHERENT_BIT = 0x00000002, /// Memory may not have i/o coherency so vkFlushMappedMemoryRanges and vkInvalidateMappedMemoryRanges must be used flush/invalidate host cache |
| 734 | /// vkInvalidateMappedMemoryRanges must be used flush/invalidate host cache |
| 735 | VK_MEMORY_PROPERTY_HOST_UNCACHED_BIT = 0x00000004, /// Memory should not be cached by the host |
Jesse Hall | acfa534 | 2015-11-19 21:51:33 -0800 | [diff] [blame] | 736 | VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT = 0x00000008, /// Memory may be allocated by the driver when it is required |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 737 | } |
| 738 | |
| 739 | /// Memory heap flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 740 | type VkFlags VkMemoryHeapFlags |
| 741 | bitfield VkMemoryHeapFlagBits { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 742 | VK_MEMORY_HEAP_HOST_LOCAL_BIT = 0x00000001, /// If set, heap represents host memory |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 743 | } |
| 744 | |
| 745 | /// Memory output flags passed to resource transition commands |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 746 | type VkFlags VkMemoryOutputFlags |
| 747 | bitfield VkMemoryOutputFlagBits { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 748 | VK_MEMORY_OUTPUT_HOST_WRITE_BIT = 0x00000001, /// Controls output coherency of host writes |
| 749 | VK_MEMORY_OUTPUT_SHADER_WRITE_BIT = 0x00000002, /// Controls output coherency of generic shader writes |
| 750 | VK_MEMORY_OUTPUT_COLOR_ATTACHMENT_BIT = 0x00000004, /// Controls output coherency of color attachment writes |
| 751 | VK_MEMORY_OUTPUT_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000008, /// Controls output coherency of depth/stencil attachment writes |
| 752 | VK_MEMORY_OUTPUT_TRANSFER_BIT = 0x00000010, /// Controls output coherency of transfer operations |
| 753 | } |
| 754 | |
| 755 | /// Memory input flags passed to resource transition commands |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 756 | type VkFlags VkMemoryInputFlags |
| 757 | bitfield VkMemoryInputFlagBits { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 758 | VK_MEMORY_INPUT_HOST_READ_BIT = 0x00000001, /// Controls input coherency of host reads |
| 759 | VK_MEMORY_INPUT_INDIRECT_COMMAND_BIT = 0x00000002, /// Controls input coherency of indirect command reads |
| 760 | VK_MEMORY_INPUT_INDEX_FETCH_BIT = 0x00000004, /// Controls input coherency of index fetches |
| 761 | VK_MEMORY_INPUT_VERTEX_ATTRIBUTE_FETCH_BIT = 0x00000008, /// Controls input coherency of vertex attribute fetches |
| 762 | VK_MEMORY_INPUT_UNIFORM_READ_BIT = 0x00000010, /// Controls input coherency of uniform buffer reads |
| 763 | VK_MEMORY_INPUT_SHADER_READ_BIT = 0x00000020, /// Controls input coherency of generic shader reads |
| 764 | VK_MEMORY_INPUT_COLOR_ATTACHMENT_BIT = 0x00000040, /// Controls input coherency of color attachment reads |
| 765 | VK_MEMORY_INPUT_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000080, /// Controls input coherency of depth/stencil attachment reads |
| 766 | VK_MEMORY_INPUT_INPUT_ATTACHMENT_BIT = 0x00000100, /// Controls input coherency of input attachment reads |
| 767 | VK_MEMORY_INPUT_TRANSFER_BIT = 0x00000200, /// Controls input coherency of transfer operations |
| 768 | } |
| 769 | |
| 770 | /// Buffer usage flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 771 | type VkFlags VkBufferUsageFlags |
| 772 | bitfield VkBufferUsageFlagBits { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 773 | VK_BUFFER_USAGE_TRANSFER_SOURCE_BIT = 0x00000001, /// Can be used as a source of transfer operations |
| 774 | VK_BUFFER_USAGE_TRANSFER_DESTINATION_BIT = 0x00000002, /// Can be used as a destination of transfer operations |
| 775 | VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000004, /// Can be used as TBO |
| 776 | VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT = 0x00000008, /// Can be used as IBO |
| 777 | VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT = 0x00000010, /// Can be used as UBO |
| 778 | VK_BUFFER_USAGE_STORAGE_BUFFER_BIT = 0x00000020, /// Can be used as SSBO |
| 779 | VK_BUFFER_USAGE_INDEX_BUFFER_BIT = 0x00000040, /// Can be used as source of fixed function index fetch (index buffer) |
| 780 | VK_BUFFER_USAGE_VERTEX_BUFFER_BIT = 0x00000080, /// Can be used as source of fixed function vertex fetch (VBO) |
| 781 | VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT = 0x00000100, /// Can be the source of indirect parameters (e.g. indirect buffer, parameter buffer) |
| 782 | } |
| 783 | |
| 784 | /// Buffer creation flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 785 | type VkFlags VkBufferCreateFlags |
| 786 | bitfield VkBufferCreateFlagBits { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 787 | VK_BUFFER_CREATE_SPARSE_BINDING_BIT = 0x00000001, /// Buffer should support sparse backing |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 788 | VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002, /// Buffer should support sparse backing with partial residency |
| 789 | VK_BUFFER_CREATE_SPARSE_ALIASED_BIT = 0x00000004, /// Buffer should support constent data access to physical memory blocks mapped into multiple locations of sparse buffers |
| 790 | } |
| 791 | |
| 792 | /// Shader stage flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 793 | type VkFlags VkShaderStageFlags |
| 794 | bitfield VkShaderStageFlagBits { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 795 | VK_SHADER_STAGE_VERTEX_BIT = 0x00000001, |
Jesse Hall | ae38f73 | 2015-11-19 21:32:50 -0800 | [diff] [blame] | 796 | VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT = 0x00000002, |
| 797 | VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT = 0x00000004, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 798 | VK_SHADER_STAGE_GEOMETRY_BIT = 0x00000008, |
| 799 | VK_SHADER_STAGE_FRAGMENT_BIT = 0x00000010, |
| 800 | VK_SHADER_STAGE_COMPUTE_BIT = 0x00000020, |
| 801 | |
| 802 | VK_SHADER_STAGE_ALL = 0x7FFFFFFF, |
| 803 | } |
| 804 | |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 805 | /// Descriptor pool create flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 806 | type VkFlags VkDescriptorPoolCreateFlags |
| 807 | bitfield VkDescriptorPoolCreateFlagBits { |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 808 | VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT = 0x00000001, |
| 809 | } |
| 810 | |
| 811 | /// Descriptor pool reset flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 812 | type VkFlags VkDescriptorPoolResetFlags |
| 813 | bitfield VkDescriptorPoolResetFlagBits { |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 814 | } |
| 815 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 816 | /// Image usage flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 817 | type VkFlags VkImageUsageFlags |
| 818 | bitfield VkImageUsageFlagBits { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 819 | VK_IMAGE_USAGE_TRANSFER_SOURCE_BIT = 0x00000001, /// Can be used as a source of transfer operations |
| 820 | VK_IMAGE_USAGE_TRANSFER_DESTINATION_BIT = 0x00000002, /// Can be used as a destination of transfer operations |
| 821 | VK_IMAGE_USAGE_SAMPLED_BIT = 0x00000004, /// Can be sampled from (SAMPLED_IMAGE and COMBINED_IMAGE_SAMPLER descriptor types) |
| 822 | VK_IMAGE_USAGE_STORAGE_BIT = 0x00000008, /// Can be used as storage image (STORAGE_IMAGE descriptor type) |
| 823 | 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] | 824 | 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] | 825 | VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT = 0x00000040, /// Image data not needed outside of rendering |
| 826 | VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT = 0x00000080, /// Can be used as framebuffer input attachment |
| 827 | } |
| 828 | |
| 829 | /// Image creation flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 830 | type VkFlags VkImageCreateFlags |
| 831 | bitfield VkImageCreateFlagBits { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 832 | VK_IMAGE_CREATE_SPARSE_BINDING_BIT = 0x00000001, /// Image should support sparse backing |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 833 | VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002, /// Image should support sparse backing with partial residency |
| 834 | 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] | 835 | VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT = 0x00000008, /// Allows image views to have different format than the base image |
| 836 | 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] | 837 | } |
| 838 | |
| 839 | /// Framebuffer attachment view creation flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 840 | type VkFlags VkImageViewCreateFlags |
| 841 | bitfield VkImageViewCreateFlagBits { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 842 | VK_IMAGE_VIEW_CREATE_READ_ONLY_DEPTH_BIT = 0x00000001, |
| 843 | VK_IMAGE_VIEW_CREATE_READ_ONLY_STENCIL_BIT = 0x00000002, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 844 | } |
| 845 | |
| 846 | /// Pipeline creation flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 847 | type VkFlags VkPipelineCreateFlags |
| 848 | bitfield VkPipelineCreateFlagBits { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 849 | VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT = 0x00000001, |
| 850 | VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT = 0x00000002, |
| 851 | VK_PIPELINE_CREATE_DERIVATIVE_BIT = 0x00000004, |
| 852 | } |
| 853 | |
| 854 | /// Channel flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 855 | type VkFlags VkChannelFlags |
| 856 | bitfield VkChannelFlagBits { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 857 | VK_CHANNEL_R_BIT = 0x00000001, |
| 858 | VK_CHANNEL_G_BIT = 0x00000002, |
| 859 | VK_CHANNEL_B_BIT = 0x00000004, |
| 860 | VK_CHANNEL_A_BIT = 0x00000008, |
| 861 | } |
| 862 | |
| 863 | /// Fence creation flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 864 | type VkFlags VkFenceCreateFlags |
| 865 | bitfield VkFenceCreateFlagBits { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 866 | VK_FENCE_CREATE_SIGNALED_BIT = 0x00000001, |
| 867 | } |
| 868 | |
| 869 | /// Semaphore creation flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 870 | type VkFlags VkSemaphoreCreateFlags |
| 871 | bitfield VkSemaphoreCreateFlagBits { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 872 | } |
| 873 | |
| 874 | /// Format capability flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 875 | type VkFlags VkFormatFeatureFlags |
| 876 | bitfield VkFormatFeatureFlagBits { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 877 | VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT = 0x00000001, /// Format can be used for sampled images (SAMPLED_IMAGE and COMBINED_IMAGE_SAMPLER descriptor types) |
| 878 | VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT = 0x00000002, /// Format can be used for storage images (STORAGE_IMAGE descriptor type) |
| 879 | VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT = 0x00000004, /// Format supports atomic operations in case it's used for storage images |
| 880 | VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000008, /// Format can be used for uniform texel buffers (TBOs) |
| 881 | VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT = 0x00000010, /// Format can be used for storage texel buffers (IBOs) |
| 882 | VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT = 0x00000020, /// Format supports atomic operations in case it's used for storage texel buffers |
| 883 | VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT = 0x00000040, /// Format can be used for vertex buffers (VBOs) |
| 884 | VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT = 0x00000080, /// Format can be used for color attachment images |
| 885 | VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT = 0x00000100, /// Format supports blending in case it's used for color attachment images |
| 886 | VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000200, /// Format can be used for depth/stencil attachment images |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 887 | VK_FORMAT_FEATURE_BLIT_SOURCE_BIT = 0x00000400, /// Format can be used as the source image of blits with vkCmdBlitImage |
| 888 | VK_FORMAT_FEATURE_BLIT_DESTINATION_BIT = 0x00000800, /// Format can be used as the destination image of blits with vkCmdBlitImage |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 889 | } |
| 890 | |
| 891 | /// Query control flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 892 | type VkFlags VkQueryControlFlags |
| 893 | bitfield VkQueryControlFlagBits { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 894 | VK_QUERY_CONTROL_CONSERVATIVE_BIT = 0x00000001, /// Allow conservative results to be collected by the query |
| 895 | } |
| 896 | |
| 897 | /// Query result flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 898 | type VkFlags VkQueryResultFlags |
| 899 | bitfield VkQueryResultFlagBits { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 900 | VK_QUERY_RESULT_DEFAULT = 0x00000000, /// Results of the queries are immediately written to the destination buffer as 32-bit values |
| 901 | VK_QUERY_RESULT_64_BIT = 0x00000001, /// Results of the queries are written to the destination buffer as 64-bit values |
| 902 | VK_QUERY_RESULT_WAIT_BIT = 0x00000002, /// Results of the queries are waited on before proceeding with the result copy |
| 903 | VK_QUERY_RESULT_WITH_AVAILABILITY_BIT = 0x00000004, /// Besides the results of the query, the availability of the results is also written |
| 904 | VK_QUERY_RESULT_PARTIAL_BIT = 0x00000008, /// Copy the partial results of the query even if the final results aren't available |
| 905 | } |
| 906 | |
| 907 | /// Shader module creation flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 908 | type VkFlags VkShaderModuleCreateFlags |
| 909 | bitfield VkShaderModuleCreateFlagBits { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 910 | } |
| 911 | |
| 912 | /// Shader creation flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 913 | type VkFlags VkShaderCreateFlags |
| 914 | bitfield VkShaderCreateFlagBits { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 915 | } |
| 916 | |
| 917 | /// Event creation flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 918 | type VkFlags VkEventCreateFlags |
| 919 | bitfield VkEventCreateFlagBits { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 920 | } |
| 921 | |
Jesse Hall | a15a4bf | 2015-11-19 22:48:02 -0800 | [diff] [blame] | 922 | /// Command buffer usage flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 923 | type VkFlags VkCmdBufferUsageFlags |
| 924 | bitfield VkCmdBufferUsageFlagBits { |
Jesse Hall | a15a4bf | 2015-11-19 22:48:02 -0800 | [diff] [blame] | 925 | VK_CMD_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT = 0x00000001, |
| 926 | VK_CMD_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT = 0x00000002, |
| 927 | VK_CMD_BUFFER_USAGE_SIMULTANEOUS_USE_BIT = 0x00000004, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 928 | } |
| 929 | |
| 930 | /// Pipeline statistics flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 931 | type VkFlags VkQueryPipelineStatisticFlags |
| 932 | bitfield VkQueryPipelineStatisticFlagBits { |
Jesse Hall | ae38f73 | 2015-11-19 21:32:50 -0800 | [diff] [blame] | 933 | VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_BIT = 0x00000001, /// Optional |
| 934 | VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_PRIMITIVES_BIT = 0x00000002, /// Optional |
| 935 | VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT = 0x00000004, /// Optional |
| 936 | VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_INVOCATIONS_BIT = 0x00000008, /// Optional |
| 937 | VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT = 0x00000010, /// Optional |
| 938 | VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT = 0x00000020, /// Optional |
| 939 | VK_QUERY_PIPELINE_STATISTIC_CLIPPING_PRIMITIVES_BIT = 0x00000040, /// Optional |
| 940 | VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT = 0x00000080, /// Optional |
| 941 | VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT = 0x00000100, /// Optional |
| 942 | VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT = 0x00000200, /// Optional |
| 943 | VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT = 0x00000400, /// Optional |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 944 | } |
| 945 | |
| 946 | /// Memory mapping flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 947 | type VkFlags VkMemoryMapFlags |
| 948 | bitfield VkMemoryMapFlagBits { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 949 | } |
| 950 | |
| 951 | /// Bitfield of image aspects |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 952 | type VkFlags VkImageAspectFlags |
| 953 | bitfield VkImageAspectFlagBits { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 954 | VK_IMAGE_ASPECT_COLOR_BIT = 0x00000001, |
| 955 | VK_IMAGE_ASPECT_DEPTH_BIT = 0x00000002, |
| 956 | VK_IMAGE_ASPECT_STENCIL_BIT = 0x00000004, |
| 957 | VK_IMAGE_ASPECT_METADATA_BIT = 0x00000008, |
| 958 | } |
| 959 | |
| 960 | /// Sparse memory bind flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 961 | type VkFlags VkSparseMemoryBindFlags |
| 962 | bitfield VkSparseMemoryBindFlagBits { |
Jesse Hall | a9bb62b | 2015-11-21 19:31:56 -0800 | [diff] [blame] | 963 | VK_SPARSE_MEMORY_BIND_REPLICATE_BLOCK_BIT = 0x00000001, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 964 | } |
| 965 | |
| 966 | /// Sparse image memory requirements flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 967 | type VkFlags VkSparseImageFormatFlags |
| 968 | bitfield VkSparseImageFormatFlagBits { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 969 | VK_SPARSE_IMAGE_FMT_SINGLE_MIPTAIL_BIT = 0x00000001, /// Image uses a single miptail region for all array slices |
| 970 | VK_SPARSE_IMAGE_FMT_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. |
| 971 | VK_SPARSE_IMAGE_FMT_NONSTD_BLOCK_SIZE_BIT = 0x00000004, /// Image uses a non-standard sparse block size |
| 972 | } |
| 973 | |
| 974 | /// Pipeline stages |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 975 | type VkFlags VkPipelineStageFlags |
| 976 | bitfield VkPipelineStageFlagBits { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 977 | VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT = 0x00000001, /// Before subsequent commands are processed |
| 978 | VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT = 0x00000002, /// Draw/DispatchIndirect command fetch |
| 979 | VK_PIPELINE_STAGE_VERTEX_INPUT_BIT = 0x00000004, /// Vertex/index fetch |
| 980 | VK_PIPELINE_STAGE_VERTEX_SHADER_BIT = 0x00000008, /// Vertex shading |
Jesse Hall | ae38f73 | 2015-11-19 21:32:50 -0800 | [diff] [blame] | 981 | VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT = 0x00000010, /// Tessellation control shading |
| 982 | VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT = 0x00000020, /// Tessellation evaluation shading |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 983 | VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT = 0x00000040, /// Geometry shading |
| 984 | VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT = 0x00000080, /// Fragment shading |
| 985 | VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT = 0x00000100, /// Early fragment (depth/stencil) tests |
| 986 | VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT = 0x00000200, /// Late fragment (depth/stencil) tests |
| 987 | VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT = 0x00000400, /// Color attachment writes |
| 988 | VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT = 0x00000800, /// Compute shading |
| 989 | VK_PIPELINE_STAGE_TRANSFER_BIT = 0x00001000, /// Transfer/copy operations |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 990 | VK_PIPELINE_STAGE_HOST_BIT = 0x00002000, /// Indicates host (CPU) is a source/sink of the dependency |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 991 | |
| 992 | VK_PIPELINE_STAGE_ALL_GRAPHICS = 0x000007FF, /// All stages of the graphics pipeline |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 993 | VK_PIPELINE_STAGE_ALL_GPU_COMMANDS = 0x00001FFF, /// All graphics, compute, copy, and transition commands |
| 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 | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1008 | type VkFlags VkCmdPoolCreateFlags |
| 1009 | bitfield VkCmdPoolCreateFlagBits { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1010 | VK_CMD_POOL_CREATE_TRANSIENT_BIT = 0x00000001, /// Command buffers have a short lifetime |
| 1011 | VK_CMD_POOL_CREATE_RESET_COMMAND_BUFFER_BIT = 0x00000002, /// Command buffers may release their memory individually |
| 1012 | } |
| 1013 | |
| 1014 | /// Command pool reset flags |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1015 | type VkFlags VkCmdPoolResetFlags |
| 1016 | bitfield VkCmdPoolResetFlagBits { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1017 | VK_CMD_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 | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1020 | type VkFlags VkCmdBufferResetFlags |
| 1021 | bitfield VkCmdBufferResetFlagBits { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1022 | VK_CMD_BUFFER_RESET_RELEASE_RESOURCES_BIT = 0x00000001, /// Release resources owned by the buffer |
| 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_NONE = 0x00000000, /// No faces |
| 1039 | VK_STENCIL_FACE_FRONT_BIT = 0x00000001, /// Front face |
| 1040 | VK_STENCIL_FACE_BACK_BIT = 0x00000002, /// Back face |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1041 | } |
| 1042 | |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 1043 | @extension("VK_EXT_KHR_swapchain") |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1044 | type VkFlags VkSurfaceTransformFlagsKHR |
| 1045 | @extension("VK_EXT_KHR_swapchain") |
| 1046 | bitfield VkSurfaceTransformFlagBitsKHR { |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 1047 | VK_SURFACE_TRANSFORM_NONE_BIT_KHR = 0x00000001, |
| 1048 | VK_SURFACE_TRANSFORM_ROT90_BIT_KHR = 0x00000002, |
| 1049 | VK_SURFACE_TRANSFORM_ROT180_BIT_KHR = 0x00000004, |
| 1050 | VK_SURFACE_TRANSFORM_ROT270_BIT_KHR = 0x00000008, |
| 1051 | VK_SURFACE_TRANSFORM_HMIRROR_BIT_KHR = 0x00000010, |
| 1052 | VK_SURFACE_TRANSFORM_HMIRROR_ROT90_BIT_KHR = 0x00000020, |
| 1053 | VK_SURFACE_TRANSFORM_HMIRROR_ROT180_BIT_KHR = 0x00000040, |
| 1054 | VK_SURFACE_TRANSFORM_HMIRROR_ROT270_BIT_KHR = 0x00000080, |
| 1055 | VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR = 0x00000100, |
| 1056 | } |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1057 | |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 1058 | @extension("VK_EXT_KHR_display") |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1059 | type VkFlags VkDisplayPlaneAlphaFlagsKHR |
| 1060 | @extension("VK_EXT_KHR_display") |
| 1061 | bitfield VkDisplayPlaneAlphaFlagBitsKHR { |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 1062 | VK_DISPLAY_PLANE_ALPHA_GLOBAL_BIT_KHR = 0x00000001, |
| 1063 | VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_BIT_KHR = 0x00000002, |
| 1064 | VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_PREMULTIPLIED_BIT_KHR = 0x00000004, |
| 1065 | } |
| 1066 | |
| 1067 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1068 | ////////////////// |
| 1069 | // Structures // |
| 1070 | ////////////////// |
| 1071 | |
| 1072 | class VkOffset2D { |
| 1073 | s32 x |
| 1074 | s32 y |
| 1075 | } |
| 1076 | |
| 1077 | class VkOffset3D { |
| 1078 | s32 x |
| 1079 | s32 y |
| 1080 | s32 z |
| 1081 | } |
| 1082 | |
| 1083 | class VkExtent2D { |
| 1084 | s32 width |
| 1085 | s32 height |
| 1086 | } |
| 1087 | |
| 1088 | class VkExtent3D { |
| 1089 | s32 width |
| 1090 | s32 height |
| 1091 | s32 depth |
| 1092 | } |
| 1093 | |
| 1094 | class VkViewport { |
| 1095 | f32 originX |
| 1096 | f32 originY |
| 1097 | f32 width |
| 1098 | f32 height |
| 1099 | f32 minDepth |
| 1100 | f32 maxDepth |
| 1101 | } |
| 1102 | |
| 1103 | class VkRect2D { |
| 1104 | VkOffset2D offset |
| 1105 | VkExtent2D extent |
| 1106 | } |
| 1107 | |
Jesse Hall | a15a4bf | 2015-11-19 22:48:02 -0800 | [diff] [blame] | 1108 | class VkClearRect { |
| 1109 | VkRect2D rect |
| 1110 | u32 baseArrayLayer |
| 1111 | u32 numLayers |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1112 | } |
| 1113 | |
| 1114 | class VkChannelMapping { |
| 1115 | VkChannelSwizzle r |
| 1116 | VkChannelSwizzle g |
| 1117 | VkChannelSwizzle b |
| 1118 | VkChannelSwizzle a |
| 1119 | } |
| 1120 | |
| 1121 | class VkPhysicalDeviceProperties { |
| 1122 | u32 apiVersion |
| 1123 | u32 driverVersion |
| 1124 | u32 vendorId |
| 1125 | u32 deviceId |
| 1126 | VkPhysicalDeviceType deviceType |
| 1127 | char[VK_MAX_PHYSICAL_DEVICE_NAME] deviceName |
| 1128 | u8[VK_UUID_LENGTH] pipelineCacheUUID |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1129 | VkPhysicalDeviceLimits limits |
| 1130 | VkPhysicalDeviceSparseProperties sparseProperties |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1131 | } |
| 1132 | |
| 1133 | class VkExtensionProperties { |
| 1134 | char[VK_MAX_EXTENSION_NAME] extName /// extension name |
| 1135 | u32 specVersion /// version of the extension specification implemented |
| 1136 | } |
| 1137 | |
| 1138 | class VkLayerProperties { |
| 1139 | char[VK_MAX_EXTENSION_NAME] layerName /// layer name |
| 1140 | u32 specVersion /// version of the layer specification implemented |
| 1141 | u32 implVersion /// build or release version of the layer's library |
Jesse Hall | f09c6b1 | 2015-08-15 19:54:28 -0700 | [diff] [blame] | 1142 | char[VK_MAX_DESCRIPTION] description /// Free-form description of the layer |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1143 | } |
| 1144 | |
Jesse Hall | a366a51 | 2015-11-19 22:30:07 -0800 | [diff] [blame] | 1145 | class VkSubmitInfo { |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 1146 | VkStructureType sType /// Type of structure. Should be VK_STRUCTURE_TYPE_SUBMIT_INFO |
| 1147 | const void* pNext /// Next structure in chain |
| 1148 | u32 waitSemaphoreCount |
Jesse Hall | a366a51 | 2015-11-19 22:30:07 -0800 | [diff] [blame] | 1149 | const VkSemaphore* pWaitSemaphores |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 1150 | u32 commandBufferCount |
Jesse Hall | a366a51 | 2015-11-19 22:30:07 -0800 | [diff] [blame] | 1151 | const VkCmdBuffer* pCommandBuffers |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 1152 | u32 signalSemaphoreCount |
Jesse Hall | a366a51 | 2015-11-19 22:30:07 -0800 | [diff] [blame] | 1153 | const VkSemaphore* pSignalSemaphores |
| 1154 | } |
| 1155 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1156 | class VkApplicationInfo { |
| 1157 | VkStructureType sType /// Type of structure. Should be VK_STRUCTURE_TYPE_APPLICATION_INFO |
| 1158 | const void* pNext /// Next structure in chain |
| 1159 | const char* pAppName |
| 1160 | u32 appVersion |
| 1161 | const char* pEngineName |
| 1162 | u32 engineVersion |
| 1163 | u32 apiVersion |
| 1164 | } |
| 1165 | |
| 1166 | class VkAllocCallbacks { |
| 1167 | void* pUserData |
| 1168 | PFN_vkAllocFunction pfnAlloc |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 1169 | PFN_vkReallocFunction pfnRealloc |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1170 | PFN_vkFreeFunction pfnFree |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 1171 | PFN_vkInternalAllocNotification pfnInternalAlloc |
| 1172 | PFN_vkInternalFreeNotification pfnInternalFree |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1173 | } |
| 1174 | |
| 1175 | class VkDeviceQueueCreateInfo { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1176 | VkStructureType sStype /// Should be VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO |
| 1177 | const void* pNext /// Pointer to next structure |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1178 | u32 queueFamilyIndex |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 1179 | u32 queuePriorityCount |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 1180 | const f32* pQueuePriorities |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1181 | } |
| 1182 | |
| 1183 | class VkDeviceCreateInfo { |
| 1184 | VkStructureType sType /// Should be VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO |
| 1185 | const void* pNext /// Pointer to next structure |
Jesse Hall | ae38f73 | 2015-11-19 21:32:50 -0800 | [diff] [blame] | 1186 | u32 requestedQueueRecordCount |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1187 | const VkDeviceQueueCreateInfo* pRequestedQueues |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 1188 | u32 enabledLayerNameCount |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1189 | const char* const* ppEnabledLayerNames /// Ordered list of layer names to be enabled |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 1190 | u32 enabledExtensionNameCount |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1191 | const char* const* ppEnabledExtensionNames |
| 1192 | const VkPhysicalDeviceFeatures* pEnabledFeatures |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1193 | } |
| 1194 | |
| 1195 | class VkInstanceCreateInfo { |
| 1196 | VkStructureType sType /// Should be VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO |
| 1197 | const void* pNext /// Pointer to next structure |
| 1198 | const VkApplicationInfo* pAppInfo |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 1199 | u32 enabledLayerNameCount |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1200 | const char* const* ppEnabledLayerNames /// Ordered list of layer names to be enabled |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 1201 | u32 enabledExtensionNameCount |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1202 | const char* const* ppEnabledExtensionNames /// Extension names to be enabled |
| 1203 | } |
| 1204 | |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1205 | class VkQueueFamilyProperties { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1206 | VkQueueFlags queueFlags /// Queue flags |
| 1207 | u32 queueCount |
Jesse Hall | acfa534 | 2015-11-19 21:51:33 -0800 | [diff] [blame] | 1208 | u32 timestampValidBits |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1209 | } |
| 1210 | |
| 1211 | class VkPhysicalDeviceMemoryProperties { |
| 1212 | u32 memoryTypeCount |
| 1213 | VkMemoryType[VK_MAX_MEMORY_TYPES] memoryTypes |
| 1214 | u32 memoryHeapCount |
| 1215 | VkMemoryHeap[VK_MAX_MEMORY_HEAPS] memoryHeaps |
| 1216 | } |
| 1217 | |
| 1218 | class VkMemoryAllocInfo { |
| 1219 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MEMORY_ALLOC_INFO |
| 1220 | const void* pNext /// Pointer to next structure |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1221 | VkDeviceSize allocationSize /// Size of memory allocation |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1222 | u32 memoryTypeIndex /// Index of the of the memory type to allocate from |
| 1223 | } |
| 1224 | |
| 1225 | class VkMemoryRequirements { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1226 | VkDeviceSize size /// Specified in bytes |
| 1227 | VkDeviceSize alignment /// Specified in bytes |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1228 | u32 memoryTypeBits /// Bitfield of the allowed memory type indices into memoryTypes[] for this object |
| 1229 | } |
| 1230 | |
| 1231 | class VkSparseImageFormatProperties { |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1232 | VkImageAspectFlagBits aspect |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1233 | VkExtent3D imageGranularity |
| 1234 | VkSparseImageFormatFlags flags |
| 1235 | } |
| 1236 | |
| 1237 | class VkSparseImageMemoryRequirements { |
| 1238 | VkSparseImageFormatProperties formatProps |
| 1239 | u32 imageMipTailStartLOD |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1240 | VkDeviceSize imageMipTailSize /// Specified in bytes, must be a multiple of image block size / alignment |
| 1241 | VkDeviceSize imageMipTailOffset /// Specified in bytes, must be a multiple of image block size / alignment |
| 1242 | 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] | 1243 | } |
| 1244 | |
| 1245 | class VkMemoryType { |
| 1246 | VkMemoryPropertyFlags propertyFlags /// Memory properties of this memory type |
| 1247 | u32 heapIndex /// Index of the memory heap allocations of this memory type are taken from |
| 1248 | } |
| 1249 | |
| 1250 | class VkMemoryHeap { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1251 | VkDeviceSize size /// Available memory in the heap |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1252 | VkMemoryHeapFlags flags /// Flags for the heap |
| 1253 | } |
| 1254 | |
| 1255 | class VkMappedMemoryRange { |
| 1256 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE |
| 1257 | const void* pNext /// Pointer to next structure |
| 1258 | VkDeviceMemory mem /// Mapped memory object |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1259 | VkDeviceSize offset /// Offset within the mapped memory the range starts from |
| 1260 | VkDeviceSize size /// Size of the range within the mapped memory |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1261 | } |
| 1262 | |
| 1263 | class VkFormatProperties { |
| 1264 | VkFormatFeatureFlags linearTilingFeatures /// Format features in case of linear tiling |
| 1265 | VkFormatFeatureFlags optimalTilingFeatures /// Format features in case of optimal tiling |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1266 | VkFormatFeatureFlags bufferFeatures /// Format features supported by buffers |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1267 | } |
| 1268 | |
| 1269 | class VkImageFormatProperties { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1270 | VkExtent3D maxExtent /// max image dimensions for this resource type |
| 1271 | u32 maxMipLevels /// max number of mipmap levels for this resource type |
Jesse Hall | a15a4bf | 2015-11-19 22:48:02 -0800 | [diff] [blame] | 1272 | u32 maxArrayLayers /// max array layers for this resource type |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1273 | VkSampleCountFlags sampleCounts /// supported sample counts for this resource type |
| 1274 | VkDeviceSize maxResourceSize /// max size (in bytes) of this resource type |
| 1275 | } |
| 1276 | |
Jesse Hall | a15a4bf | 2015-11-19 22:48:02 -0800 | [diff] [blame] | 1277 | class VkDescriptorImageInfo { |
| 1278 | VkSampler sampler |
| 1279 | VkImageView imageView |
| 1280 | VkImageLayout imageLayout |
| 1281 | } |
| 1282 | |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1283 | class VkDescriptorBufferInfo { |
| 1284 | VkBuffer buffer /// Buffer used for this descriptor when the descriptor is UNIFORM_BUFFER[_DYNAMIC] |
| 1285 | VkDeviceSize offset /// Base offset from buffer start in bytes to update in the descriptor set. |
| 1286 | 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] | 1287 | } |
| 1288 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1289 | class VkWriteDescriptorSet { |
| 1290 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET |
| 1291 | const void* pNext /// Pointer to next structure |
| 1292 | VkDescriptorSet destSet /// Destination descriptor set |
| 1293 | u32 destBinding /// Binding within the destination descriptor set to write |
| 1294 | u32 destArrayElement /// Array element within the destination binding to write |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 1295 | 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] | 1296 | 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] | 1297 | const VkDescriptorImageInfo* pImageInfo |
| 1298 | const VkDescriptorBufferInfo* pBufferInfo |
| 1299 | const VkBufferView* pTexelBufferView |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1300 | } |
| 1301 | |
| 1302 | class VkCopyDescriptorSet { |
| 1303 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET |
| 1304 | const void* pNext /// Pointer to next structure |
| 1305 | VkDescriptorSet srcSet /// Source descriptor set |
| 1306 | u32 srcBinding /// Binding within the source descriptor set to copy from |
| 1307 | u32 srcArrayElement /// Array element within the source binding to copy from |
| 1308 | VkDescriptorSet destSet /// Destination descriptor set |
| 1309 | u32 destBinding /// Binding within the destination descriptor set to copy to |
| 1310 | u32 destArrayElement /// Array element within the destination binding to copy to |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 1311 | u32 descriptorCount /// Number of descriptors to copy |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1312 | } |
| 1313 | |
| 1314 | class VkBufferCreateInfo { |
| 1315 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO |
| 1316 | const void* pNext /// Pointer to next structure. |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1317 | VkDeviceSize size /// Specified in bytes |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1318 | VkBufferUsageFlags usage /// Buffer usage flags |
| 1319 | VkBufferCreateFlags flags /// Buffer creation flags |
| 1320 | VkSharingMode sharingMode |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 1321 | u32 queueFamilyIndexCount |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1322 | const u32* pQueueFamilyIndices |
| 1323 | } |
| 1324 | |
| 1325 | class VkBufferViewCreateInfo { |
| 1326 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO |
| 1327 | const void* pNext /// Pointer to next structure. |
| 1328 | VkBuffer buffer |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1329 | VkFormat format /// Optionally specifies format of elements |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1330 | VkDeviceSize offset /// Specified in bytes |
| 1331 | VkDeviceSize range /// View size specified in bytes |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1332 | } |
| 1333 | |
| 1334 | class VkImageSubresource { |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1335 | VkImageAspectFlagBits aspect |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1336 | u32 mipLevel |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1337 | u32 arrayLayer |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1338 | } |
| 1339 | |
| 1340 | class VkImageSubresourceRange { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1341 | VkImageAspectFlags aspectMask |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1342 | u32 baseMipLevel |
Jesse Hall | a15a4bf | 2015-11-19 22:48:02 -0800 | [diff] [blame] | 1343 | u32 numLevels |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1344 | u32 baseArrayLayer |
Jesse Hall | a15a4bf | 2015-11-19 22:48:02 -0800 | [diff] [blame] | 1345 | u32 numLayers |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1346 | } |
| 1347 | |
| 1348 | class VkMemoryBarrier { |
| 1349 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MEMORY_BARRIER |
| 1350 | const void* pNext /// Pointer to next structure. |
| 1351 | VkMemoryOutputFlags outputMask /// Outputs the barrier should sync |
| 1352 | VkMemoryInputFlags inputMask /// Inputs the barrier should sync to |
| 1353 | } |
| 1354 | |
| 1355 | class VkBufferMemoryBarrier { |
| 1356 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER |
| 1357 | const void* pNext /// Pointer to next structure. |
| 1358 | VkMemoryOutputFlags outputMask /// Outputs the barrier should sync |
| 1359 | VkMemoryInputFlags inputMask /// Inputs the barrier should sync to |
| 1360 | u32 srcQueueFamilyIndex /// Queue family to transition ownership from |
| 1361 | u32 destQueueFamilyIndex /// Queue family to transition ownership to |
| 1362 | VkBuffer buffer /// Buffer to sync |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1363 | VkDeviceSize offset /// Offset within the buffer to sync |
| 1364 | VkDeviceSize size /// Amount of bytes to sync |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1365 | } |
| 1366 | |
| 1367 | class VkImageMemoryBarrier { |
| 1368 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER |
| 1369 | const void* pNext /// Pointer to next structure. |
| 1370 | VkMemoryOutputFlags outputMask /// Outputs the barrier should sync |
| 1371 | VkMemoryInputFlags inputMask /// Inputs the barrier should sync to |
| 1372 | VkImageLayout oldLayout /// Current layout of the image |
| 1373 | VkImageLayout newLayout /// New layout to transition the image to |
| 1374 | u32 srcQueueFamilyIndex /// Queue family to transition ownership from |
| 1375 | u32 destQueueFamilyIndex /// Queue family to transition ownership to |
| 1376 | VkImage image /// Image to sync |
| 1377 | VkImageSubresourceRange subresourceRange /// Subresource range to sync |
| 1378 | } |
| 1379 | |
| 1380 | class VkImageCreateInfo { |
| 1381 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO |
| 1382 | const void* pNext /// Pointer to next structure. |
| 1383 | VkImageType imageType |
| 1384 | VkFormat format |
| 1385 | VkExtent3D extent |
| 1386 | u32 mipLevels |
Jesse Hall | a15a4bf | 2015-11-19 22:48:02 -0800 | [diff] [blame] | 1387 | u32 arrayLayers |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1388 | u32 samples |
| 1389 | VkImageTiling tiling |
| 1390 | VkImageUsageFlags usage /// Image usage flags |
| 1391 | VkImageCreateFlags flags /// Image creation flags |
| 1392 | VkSharingMode sharingMode /// Cross-queue-family sharing mode |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 1393 | u32 queueFamilyIndexCount /// Number of queue families to share across |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1394 | const u32* pQueueFamilyIndices /// Array of queue family indices to share across |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1395 | VkImageLayout initialLayout /// Initial image layout for all subresources |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1396 | } |
| 1397 | |
| 1398 | class VkSubresourceLayout { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1399 | VkDeviceSize offset /// Specified in bytes |
| 1400 | VkDeviceSize size /// Specified in bytes |
| 1401 | VkDeviceSize rowPitch /// Specified in bytes |
| 1402 | VkDeviceSize depthPitch /// Specified in bytes |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1403 | } |
| 1404 | |
| 1405 | class VkImageViewCreateInfo { |
| 1406 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO |
| 1407 | const void* pNext /// Pointer to next structure |
| 1408 | VkImage image |
| 1409 | VkImageViewType viewType |
| 1410 | VkFormat format |
| 1411 | VkChannelMapping channels |
| 1412 | VkImageSubresourceRange subresourceRange |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1413 | VkImageViewCreateFlags flags |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1414 | } |
| 1415 | |
| 1416 | class VkBufferCopy { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1417 | VkDeviceSize srcOffset /// Specified in bytes |
| 1418 | VkDeviceSize destOffset /// Specified in bytes |
| 1419 | VkDeviceSize copySize /// Specified in bytes |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1420 | } |
| 1421 | |
| 1422 | class VkSparseMemoryBindInfo { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1423 | VkDeviceSize rangeOffset /// Specified in bytes |
| 1424 | VkDeviceSize rangeSize /// Specified in bytes |
| 1425 | VkDeviceSize memOffset /// Specified in bytes |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1426 | VkDeviceMemory mem |
| 1427 | VkSparseMemoryBindFlags flags |
| 1428 | } |
| 1429 | |
| 1430 | class VkSparseImageMemoryBindInfo { |
| 1431 | VkImageSubresource subresource |
| 1432 | VkOffset3D offset |
| 1433 | VkExtent3D extent |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1434 | VkDeviceSize memOffset /// Specified in bytes |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1435 | VkDeviceMemory mem |
| 1436 | VkSparseMemoryBindFlags flags |
| 1437 | } |
| 1438 | |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1439 | class VkImageSubresourceCopy { |
Jesse Hall | a15a4bf | 2015-11-19 22:48:02 -0800 | [diff] [blame] | 1440 | VkImageAspectFlags aspect |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1441 | u32 mipLevel |
Jesse Hall | a15a4bf | 2015-11-19 22:48:02 -0800 | [diff] [blame] | 1442 | u32 baseArrayLayer |
| 1443 | u32 numLayers |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1444 | } |
| 1445 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1446 | class VkImageCopy { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1447 | VkImageSubresourceCopy srcSubresource |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1448 | VkOffset3D srcOffset /// Specified in pixels for both compressed and uncompressed images |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1449 | VkImageSubresourceCopy destSubresource |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1450 | VkOffset3D destOffset /// Specified in pixels for both compressed and uncompressed images |
| 1451 | VkExtent3D extent /// Specified in pixels for both compressed and uncompressed images |
| 1452 | } |
| 1453 | |
| 1454 | class VkImageBlit { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1455 | VkImageSubresourceCopy srcSubresource |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1456 | VkOffset3D srcOffset /// Specified in pixels for both compressed and uncompressed images |
| 1457 | VkExtent3D srcExtent /// Specified in pixels for both compressed and uncompressed images |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1458 | VkImageSubresourceCopy destSubresource |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1459 | VkOffset3D destOffset /// Specified in pixels for both compressed and uncompressed images |
| 1460 | VkExtent3D destExtent /// Specified in pixels for both compressed and uncompressed images |
| 1461 | } |
| 1462 | |
| 1463 | class VkBufferImageCopy { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1464 | VkDeviceSize bufferOffset /// Specified in bytes |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1465 | u32 bufferRowLength /// Specified in texels |
| 1466 | u32 bufferImageHeight |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1467 | VkImageSubresourceCopy imageSubresource |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1468 | VkOffset3D imageOffset /// Specified in pixels for both compressed and uncompressed images |
| 1469 | VkExtent3D imageExtent /// Specified in pixels for both compressed and uncompressed images |
| 1470 | } |
| 1471 | |
| 1472 | class VkImageResolve { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1473 | VkImageSubresourceCopy srcSubresource |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1474 | VkOffset3D srcOffset |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1475 | VkImageSubresourceCopy destSubresource |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1476 | VkOffset3D destOffset |
| 1477 | VkExtent3D extent |
| 1478 | } |
| 1479 | |
| 1480 | class VkShaderModuleCreateInfo { |
| 1481 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO |
| 1482 | const void* pNext /// Pointer to next structure |
| 1483 | platform.size_t codeSize /// Specified in bytes |
Jesse Hall | a9bb62b | 2015-11-21 19:31:56 -0800 | [diff] [blame] | 1484 | const u32* pCode /// Binary code of size codeSize |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1485 | VkShaderModuleCreateFlags flags /// Reserved |
| 1486 | } |
| 1487 | |
| 1488 | class VkShaderCreateInfo { |
| 1489 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SHADER_CREATE_INFO |
| 1490 | const void* pNext /// Pointer to next structure |
| 1491 | VkShaderModule module /// Module containing entry point |
| 1492 | const char* pName /// Null-terminated entry point name |
| 1493 | VkShaderCreateFlags flags /// Reserved |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 1494 | VkShaderStageFlagBits stage |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1495 | } |
| 1496 | |
| 1497 | class VkDescriptorSetLayoutBinding { |
| 1498 | VkDescriptorType descriptorType /// Type of the descriptors in this binding |
| 1499 | u32 arraySize /// Number of descriptors in this binding |
| 1500 | VkShaderStageFlags stageFlags /// Shader stages this binding is visible to |
| 1501 | const VkSampler* pImmutableSamplers /// Immutable samplers (used if descriptor type is SAMPLER or COMBINED_IMAGE_SAMPLER, is either NULL or contains <count> number of elements) |
| 1502 | } |
| 1503 | |
| 1504 | class VkDescriptorSetLayoutCreateInfo { |
| 1505 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO |
| 1506 | const void* pNext /// Pointer to next structure |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 1507 | u32 bindingCount /// Number of bindings in the descriptor set layout |
| 1508 | const VkDescriptorSetLayoutBinding* pBindings /// Array of descriptor set layout bindings |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1509 | } |
| 1510 | |
| 1511 | class VkDescriptorTypeCount { |
| 1512 | VkDescriptorType type |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 1513 | u32 descriptorCount |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1514 | } |
| 1515 | |
| 1516 | class VkDescriptorPoolCreateInfo { |
| 1517 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO |
| 1518 | const void* pNext /// Pointer to next structure |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 1519 | VkDescriptorPoolCreateFlags flags |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1520 | u32 maxSets |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 1521 | u32 typeCount |
| 1522 | const VkDescriptorTypeCount* pTypeCounts |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1523 | } |
| 1524 | |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 1525 | class VkDescriptorSetAllocInfo { |
| 1526 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOC_INFO |
| 1527 | const void* pNext /// Pointer to next structure |
| 1528 | VkDescriptorPool descriptorPool |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 1529 | u32 setCount |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 1530 | const VkDescriptorSetLayout* pSetLayouts |
| 1531 | } |
| 1532 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1533 | class VkSpecializationMapEntry { |
| 1534 | u32 constantId /// The SpecConstant ID specified in the BIL |
| 1535 | platform.size_t size /// Size in bytes of the SpecConstant |
| 1536 | u32 offset /// Offset of the value in the data block |
| 1537 | } |
| 1538 | |
| 1539 | class VkSpecializationInfo { |
| 1540 | u32 mapEntryCount /// Number of entries in the map |
| 1541 | const VkSpecializationMapEntry* pMap /// Array of map entries |
| 1542 | platform.size_t dataSize /// Size in bytes of pData |
| 1543 | const void* pData /// Pointer to SpecConstant data |
| 1544 | } |
| 1545 | |
| 1546 | class VkPipelineShaderStageCreateInfo { |
| 1547 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO |
| 1548 | const void* pNext /// Pointer to next structure |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1549 | VkShader shader |
| 1550 | const VkSpecializationInfo* pSpecializationInfo |
| 1551 | } |
| 1552 | |
| 1553 | class VkComputePipelineCreateInfo { |
| 1554 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO |
| 1555 | const void* pNext /// Pointer to next structure |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1556 | VkPipelineShaderStageCreateInfo stage |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1557 | VkPipelineCreateFlags flags /// Pipeline creation flags |
| 1558 | VkPipelineLayout layout /// Interface layout of the pipeline |
| 1559 | 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 |
| 1560 | 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 |
| 1561 | } |
| 1562 | |
| 1563 | class VkVertexInputBindingDescription { |
| 1564 | u32 binding /// Vertex buffer binding id |
| 1565 | u32 strideInBytes /// Distance between vertices in bytes (0 = no advancement) |
| 1566 | VkVertexInputStepRate stepRate /// Rate at which binding is incremented |
| 1567 | } |
| 1568 | |
| 1569 | class VkVertexInputAttributeDescription { |
| 1570 | u32 location /// location of the shader vertex attrib |
| 1571 | u32 binding /// Vertex buffer binding id |
| 1572 | VkFormat format /// format of source data |
| 1573 | u32 offsetInBytes /// Offset of first element in bytes from base of vertex |
| 1574 | } |
| 1575 | |
| 1576 | class VkPipelineVertexInputStateCreateInfo { |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 1577 | VkStructureType sType /// Should be VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO |
| 1578 | const void* pNext /// Pointer to next structure |
| 1579 | u32 vertexBindingDescriptionCount /// number of bindings |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1580 | const VkVertexInputBindingDescription* pVertexBindingDescriptions |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 1581 | u32 vertexAttributeDescriptionCount /// number of attributes |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1582 | const VkVertexInputAttributeDescription* pVertexAttributeDescriptions |
| 1583 | } |
| 1584 | |
| 1585 | class VkPipelineInputAssemblyStateCreateInfo { |
| 1586 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO |
| 1587 | const void* pNext /// Pointer to next structure |
| 1588 | VkPrimitiveTopology topology |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1589 | VkBool32 primitiveRestartEnable |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1590 | } |
| 1591 | |
| 1592 | class VkPipelineTessellationStateCreateInfo { |
| 1593 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO |
| 1594 | const void* pNext /// Pointer to next structure |
| 1595 | u32 patchControlPoints |
| 1596 | } |
| 1597 | |
| 1598 | class VkPipelineViewportStateCreateInfo { |
| 1599 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO |
| 1600 | const void* pNext /// Pointer to next structure |
| 1601 | u32 viewportCount |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1602 | const VkViewport* pViewports |
| 1603 | u32 scissorCount |
| 1604 | const VkRect2D* pScissors |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1605 | } |
| 1606 | |
| 1607 | class VkPipelineRasterStateCreateInfo { |
| 1608 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_RASTER_STATE_CREATE_INFO |
| 1609 | const void* pNext /// Pointer to next structure |
Jesse Hall | ae38f73 | 2015-11-19 21:32:50 -0800 | [diff] [blame] | 1610 | VkBool32 depthClampEnable |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1611 | VkBool32 rasterizerDiscardEnable |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1612 | VkFillMode fillMode /// optional (GL45) |
| 1613 | VkCullMode cullMode |
| 1614 | VkFrontFace frontFace |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1615 | VkBool32 depthBiasEnable |
Jesse Hall | a9bb62b | 2015-11-21 19:31:56 -0800 | [diff] [blame] | 1616 | f32 depthBiasConstantFactor |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1617 | f32 depthBiasClamp |
Jesse Hall | a9bb62b | 2015-11-21 19:31:56 -0800 | [diff] [blame] | 1618 | f32 depthBiasSlopeFactor |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1619 | f32 lineWidth |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1620 | } |
| 1621 | |
| 1622 | class VkPipelineMultisampleStateCreateInfo { |
| 1623 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO |
| 1624 | const void* pNext /// Pointer to next structure |
| 1625 | u32 rasterSamples /// Number of samples used for rasterization |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1626 | VkBool32 sampleShadingEnable /// optional (GL45) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1627 | f32 minSampleShading /// optional (GL45) |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1628 | const VkSampleMask* pSampleMask |
Jesse Hall | acfa534 | 2015-11-19 21:51:33 -0800 | [diff] [blame] | 1629 | VkBool32 alphaToCoverageEnable |
| 1630 | VkBool32 alphaToOneEnable |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1631 | } |
| 1632 | |
| 1633 | class VkPipelineColorBlendAttachmentState { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1634 | VkBool32 blendEnable |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1635 | VkBlend srcBlendColor |
| 1636 | VkBlend destBlendColor |
| 1637 | VkBlendOp blendOpColor |
| 1638 | VkBlend srcBlendAlpha |
| 1639 | VkBlend destBlendAlpha |
| 1640 | VkBlendOp blendOpAlpha |
| 1641 | VkChannelFlags channelWriteMask |
| 1642 | } |
| 1643 | |
| 1644 | class VkPipelineColorBlendStateCreateInfo { |
| 1645 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO |
| 1646 | const void* pNext /// Pointer to next structure |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1647 | VkBool32 logicOpEnable |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1648 | VkLogicOp logicOp |
| 1649 | u32 attachmentCount /// # of pAttachments |
| 1650 | const VkPipelineColorBlendAttachmentState* pAttachments |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1651 | f32[4] blendConst |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1652 | } |
| 1653 | |
| 1654 | class VkStencilOpState { |
| 1655 | VkStencilOp stencilFailOp |
| 1656 | VkStencilOp stencilPassOp |
| 1657 | VkStencilOp stencilDepthFailOp |
| 1658 | VkCompareOp stencilCompareOp |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1659 | u32 stencilCompareMask |
| 1660 | u32 stencilWriteMask |
| 1661 | u32 stencilReference |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1662 | } |
| 1663 | |
| 1664 | class VkPipelineDepthStencilStateCreateInfo { |
| 1665 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO |
| 1666 | const void* pNext /// Pointer to next structure |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1667 | VkBool32 depthTestEnable |
| 1668 | VkBool32 depthWriteEnable |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1669 | VkCompareOp depthCompareOp |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1670 | VkBool32 depthBoundsTestEnable /// optional (depth_bounds_test) |
| 1671 | VkBool32 stencilTestEnable |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1672 | VkStencilOpState front |
| 1673 | VkStencilOpState back |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1674 | f32 minDepthBounds |
| 1675 | f32 maxDepthBounds |
| 1676 | } |
| 1677 | |
| 1678 | class VkPipelineDynamicStateCreateInfo { |
| 1679 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO |
| 1680 | const void* pNext /// Pointer to next structure |
| 1681 | u32 dynamicStateCount |
| 1682 | const VkDynamicState* pDynamicStates |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1683 | } |
| 1684 | |
| 1685 | class VkGraphicsPipelineCreateInfo { |
| 1686 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO |
| 1687 | const void* pNext /// Pointer to next structure |
| 1688 | u32 stageCount |
| 1689 | const VkPipelineShaderStageCreateInfo* pStages /// One entry for each active shader stage |
| 1690 | const VkPipelineVertexInputStateCreateInfo* pVertexInputState |
| 1691 | const VkPipelineInputAssemblyStateCreateInfo* pInputAssemblyState |
| 1692 | const VkPipelineTessellationStateCreateInfo* pTessellationState |
| 1693 | const VkPipelineViewportStateCreateInfo* pViewportState |
| 1694 | const VkPipelineRasterStateCreateInfo* pRasterState |
| 1695 | const VkPipelineMultisampleStateCreateInfo* pMultisampleState |
| 1696 | const VkPipelineDepthStencilStateCreateInfo* pDepthStencilState |
| 1697 | const VkPipelineColorBlendStateCreateInfo* pColorBlendState |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1698 | const VkPipelineDynamicStateCreateInfo* pDynamicState |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1699 | VkPipelineCreateFlags flags /// Pipeline creation flags |
| 1700 | VkPipelineLayout layout /// Interface layout of the pipeline |
| 1701 | VkRenderPass renderPass |
| 1702 | u32 subpass |
| 1703 | 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 |
| 1704 | 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 |
| 1705 | } |
| 1706 | |
| 1707 | class VkPipelineCacheCreateInfo { |
| 1708 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO |
| 1709 | const void* pNext /// Pointer to next structure |
| 1710 | platform.size_t initialSize /// Size of initial data to populate cache, in bytes |
| 1711 | const void* initialData /// Initial data to populate cache |
| 1712 | platform.size_t maxSize /// Maximum size cache can grow to, in bytes. If zero, then the cache may grow without bound. |
| 1713 | } |
| 1714 | |
| 1715 | class VkPushConstantRange { |
| 1716 | VkShaderStageFlags stageFlags /// Which stages use the range |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 1717 | u32 offset /// Start of the range, in bytes |
| 1718 | u32 size /// Length of the range, in bytes |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1719 | } |
| 1720 | |
| 1721 | class VkPipelineLayoutCreateInfo { |
| 1722 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO |
| 1723 | const void* pNext /// Pointer to next structure |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 1724 | u32 setLayoutCount /// Number of descriptor sets interfaced by the pipeline |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1725 | const VkDescriptorSetLayout* pSetLayouts /// Array of <setCount> number of descriptor set layout objects defining the layout of the |
| 1726 | u32 pushConstantRangeCount /// Number of push-constant ranges used by the pipeline |
| 1727 | const VkPushConstantRange* pPushConstantRanges /// Array of pushConstantRangeCount number of ranges used by various shader stages |
| 1728 | } |
| 1729 | |
| 1730 | class VkSamplerCreateInfo { |
| 1731 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO |
| 1732 | const void* pNext /// Pointer to next structure |
| 1733 | VkTexFilter magFilter /// Filter mode for magnification |
| 1734 | VkTexFilter minFilter /// Filter mode for minifiation |
| 1735 | VkTexMipmapMode mipMode /// Mipmap selection mode |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1736 | VkTexAddressMode addressModeU |
| 1737 | VkTexAddressMode addressModeV |
| 1738 | VkTexAddressMode addressModeW |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1739 | f32 mipLodBias |
| 1740 | f32 maxAnisotropy |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1741 | VkBool32 compareEnable |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1742 | VkCompareOp compareOp |
| 1743 | f32 minLod |
| 1744 | f32 maxLod |
| 1745 | VkBorderColor borderColor |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1746 | VkBool32 unnormalizedCoordinates |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1747 | } |
| 1748 | |
| 1749 | class VkCmdPoolCreateInfo { |
| 1750 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_CMD_POOL_CREATE_INFO |
| 1751 | const void* pNext /// Pointer to next structure |
| 1752 | u32 queueFamilyIndex |
| 1753 | VkCmdPoolCreateFlags flags /// Command pool creation flags |
| 1754 | } |
| 1755 | |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 1756 | class VkCmdBufferAllocInfo { |
| 1757 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_CMD_BUFFER_ALLOC_INFO |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1758 | const void* pNext /// Pointer to next structure |
| 1759 | VkCmdPool cmdPool |
| 1760 | VkCmdBufferLevel level |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 1761 | u32 bufferCount |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1762 | } |
| 1763 | |
| 1764 | class VkCmdBufferBeginInfo { |
| 1765 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_CMD_BUFFER_BEGIN_INFO |
| 1766 | const void* pNext /// Pointer to next structure |
Jesse Hall | a15a4bf | 2015-11-19 22:48:02 -0800 | [diff] [blame] | 1767 | VkCmdBufferUsageFlags flags /// Command buffer usage flags |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1768 | VkRenderPass renderPass /// Render pass for secondary command buffers |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1769 | u32 subpass |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1770 | VkFramebuffer framebuffer /// Framebuffer for secondary command buffers |
| 1771 | } |
| 1772 | |
| 1773 | class VkRenderPassBeginInfo { |
| 1774 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO |
| 1775 | const void* pNext /// Pointer to next structure |
| 1776 | VkRenderPass renderPass |
| 1777 | VkFramebuffer framebuffer |
| 1778 | VkRect2D renderArea |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1779 | u32 clearValueCount |
| 1780 | const VkClearValue* pClearValues |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1781 | } |
| 1782 | |
| 1783 | @union |
| 1784 | /// Union allowing specification of floating point, integer, or unsigned integer color data. Actual value selected is based on image/attachment being cleared. |
| 1785 | class VkClearColorValue { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1786 | f32[4] float32 |
| 1787 | s32[4] int32 |
| 1788 | u32[4] uint32 |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1789 | } |
| 1790 | |
| 1791 | class VkClearDepthStencilValue { |
| 1792 | f32 depth |
| 1793 | u32 stencil |
| 1794 | } |
| 1795 | |
| 1796 | @union |
| 1797 | /// Union allowing specification of color, depth, and stencil color values. Actual value selected is based on attachment being cleared. |
| 1798 | class VkClearValue { |
| 1799 | VkClearColorValue color |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1800 | VkClearDepthStencilValue depthStencil |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1801 | } |
| 1802 | |
Jesse Hall | ae38f73 | 2015-11-19 21:32:50 -0800 | [diff] [blame] | 1803 | class VkClearAttachment { |
| 1804 | VkImageAspectFlags aspectMask |
| 1805 | u32 colorAttachment |
| 1806 | VkClearValue clearValue |
| 1807 | } |
| 1808 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1809 | class VkAttachmentDescription { |
| 1810 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION |
| 1811 | const void* pNext /// Pointer to next structure |
| 1812 | VkFormat format |
| 1813 | u32 samples |
| 1814 | VkAttachmentLoadOp loadOp /// Load op for color or depth data |
| 1815 | VkAttachmentStoreOp storeOp /// Store op for color or depth data |
| 1816 | VkAttachmentLoadOp stencilLoadOp /// Load op for stencil data |
| 1817 | VkAttachmentStoreOp stencilStoreOp /// Store op for stencil data |
| 1818 | VkImageLayout initialLayout |
| 1819 | VkImageLayout finalLayout |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1820 | VkAttachmentDescriptionFlags flags |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1821 | } |
| 1822 | |
| 1823 | class VkAttachmentReference { |
| 1824 | u32 attachment |
| 1825 | VkImageLayout layout |
| 1826 | } |
| 1827 | |
| 1828 | class VkSubpassDescription { |
| 1829 | VkStructureType sType /// Must be VK_STRUCTURE_SUBPASS_DESCRIPTION |
| 1830 | const void* pNext /// Pointer to next structure |
| 1831 | VkPipelineBindPoint pipelineBindPoint /// Must be VK_PIPELINE_BIND_POINT_GRAPHICS for now |
| 1832 | VkSubpassDescriptionFlags flags |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 1833 | u32 inputAttachmentCount |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1834 | const VkAttachmentReference* pInputAttachments |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 1835 | u32 colorAttachmentCount |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1836 | const VkAttachmentReference* pColorAttachments |
| 1837 | const VkAttachmentReference* pResolveAttachments |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1838 | VkAttachmentReference depthStencilAttachment |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 1839 | u32 preserveAttachmentCount |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1840 | const VkAttachmentReference* pPreserveAttachments |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1841 | } |
| 1842 | |
| 1843 | class VkSubpassDependency { |
| 1844 | VkStructureType sType /// Must be VK_STRUCTURE_SUBPASS_DEPENDENCY |
| 1845 | const void* pNext /// Pointer to next structure |
| 1846 | u32 srcSubpass |
| 1847 | u32 destSubpass |
| 1848 | VkPipelineStageFlags srcStageMask |
| 1849 | VkPipelineStageFlags destStageMask |
| 1850 | VkMemoryOutputFlags outputMask |
| 1851 | VkMemoryInputFlags inputMask |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1852 | VkBool32 byRegion |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1853 | } |
| 1854 | |
| 1855 | class VkRenderPassCreateInfo { |
| 1856 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO |
| 1857 | const void* pNext /// Pointer to next structure |
| 1858 | u32 attachmentCount |
| 1859 | const VkAttachmentDescription* pAttachments |
| 1860 | u32 subpassCount |
| 1861 | const VkSubpassDescription* pSubpasses |
| 1862 | u32 dependencyCount |
| 1863 | const VkSubpassDependency* pDependencies |
| 1864 | } |
| 1865 | |
| 1866 | class VkEventCreateInfo { |
| 1867 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_EVENT_CREATE_INFO |
| 1868 | const void* pNext /// Pointer to next structure |
| 1869 | VkEventCreateFlags flags /// Event creation flags |
| 1870 | } |
| 1871 | |
| 1872 | class VkFenceCreateInfo { |
| 1873 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_FENCE_CREATE_INFO |
| 1874 | const void* pNext /// Pointer to next structure |
| 1875 | VkFenceCreateFlags flags /// Fence creation flags |
| 1876 | } |
| 1877 | |
| 1878 | class VkPhysicalDeviceFeatures { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1879 | VkBool32 robustBufferAccess /// out of bounds buffer accesses are well defined |
| 1880 | VkBool32 fullDrawIndexUint32 /// full 32-bit range of indices for indexed draw calls |
| 1881 | VkBool32 imageCubeArray /// image views which are arrays of cube maps |
| 1882 | VkBool32 independentBlend /// blending operations are controlled per-attachment |
| 1883 | VkBool32 geometryShader /// geometry stage |
| 1884 | VkBool32 tessellationShader /// tessellation control and evaluation stage |
| 1885 | VkBool32 sampleRateShading /// per-sample shading and interpolation |
| 1886 | VkBool32 dualSourceBlend /// blend operations which take two sources |
| 1887 | VkBool32 logicOp /// logic operations |
| 1888 | VkBool32 multiDrawIndirect /// multi draw indirect |
Jesse Hall | ae38f73 | 2015-11-19 21:32:50 -0800 | [diff] [blame] | 1889 | VkBool32 depthClamp /// depth clamping |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1890 | VkBool32 depthBiasClamp /// depth bias clamping |
| 1891 | VkBool32 fillModeNonSolid /// point and wireframe fill modes |
| 1892 | VkBool32 depthBounds /// depth bounds test |
| 1893 | VkBool32 wideLines /// lines with width greater than 1 |
| 1894 | VkBool32 largePoints /// points with size greater than 1 |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 1895 | VkBool32 alphaToOne /// The fragment alpha channel can be forced to maximum representable alpha value |
| 1896 | VkBool32 multiViewport |
| 1897 | VkBool32 samplerAnisotropy |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1898 | VkBool32 textureCompressionETC2 /// ETC texture compression formats |
| 1899 | VkBool32 textureCompressionASTC_LDR /// ASTC LDR texture compression formats |
| 1900 | VkBool32 textureCompressionBC /// BC1-7 texture compressed formats |
| 1901 | VkBool32 occlusionQueryNonConservative /// non-conservative (exact) occlusion queries |
| 1902 | VkBool32 pipelineStatisticsQuery /// pipeline statistics query |
| 1903 | VkBool32 vertexSideEffects /// storage buffers and images in vertex stage |
| 1904 | VkBool32 tessellationSideEffects /// storage buffers and images in tessellation stage |
| 1905 | VkBool32 geometrySideEffects /// storage buffers and images in geometry stage |
| 1906 | VkBool32 fragmentSideEffects /// storage buffers and images in fragment stage |
| 1907 | VkBool32 shaderTessellationPointSize /// tessellation stage can export point size |
| 1908 | VkBool32 shaderGeometryPointSize /// geometry stage can export point size |
| 1909 | VkBool32 shaderImageGatherExtended /// texture gather with run-time values and independent offsets |
| 1910 | VkBool32 shaderStorageImageExtendedFormats /// the extended set of formats can be used for storage images |
| 1911 | VkBool32 shaderStorageImageMultisample /// multisample images can be used for storage images |
| 1912 | VkBool32 shaderUniformBufferArrayDynamicIndexing /// arrays of uniform buffers can be accessed with dynamically uniform indices |
| 1913 | VkBool32 shaderSampledImageArrayDynamicIndexing /// arrays of sampled images can be accessed with dynamically uniform indices |
| 1914 | VkBool32 shaderStorageBufferArrayDynamicIndexing /// arrays of storage buffers can be accessed with dynamically uniform indices |
| 1915 | VkBool32 shaderStorageImageArrayDynamicIndexing /// arrays of storage images can be accessed with dynamically uniform indices |
| 1916 | VkBool32 shaderClipDistance /// clip distance in shaders |
| 1917 | VkBool32 shaderCullDistance /// cull distance in shaders |
| 1918 | VkBool32 shaderFloat64 /// 64-bit floats (doubles) in shaders |
| 1919 | VkBool32 shaderInt64 /// 64-bit integers in shaders |
| 1920 | VkBool32 shaderInt16 /// 16-bit integers in shaders |
| 1921 | VkBool32 shaderResourceResidency /// shader can use texture operations that return resource residency information (requires sparseNonResident support) |
| 1922 | VkBool32 shaderResourceMinLOD /// shader can use texture operations that specify minimum resource LOD |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1923 | VkBool32 sparseBinding /// Sparse resources support: Resource memory can be managed at opaque page level rather than object level |
| 1924 | VkBool32 sparseResidencyBuffer /// Sparse resources support: GPU can access partially resident buffers |
| 1925 | VkBool32 sparseResidencyImage2D /// Sparse resources support: GPU can access partially resident 2D (non-MSAA non-DepthStencil) images |
| 1926 | VkBool32 sparseResidencyImage3D /// Sparse resources support: GPU can access partially resident 3D images |
| 1927 | VkBool32 sparseResidency2Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 2 samples |
| 1928 | VkBool32 sparseResidency4Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 4 samples |
| 1929 | VkBool32 sparseResidency8Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 8 samples |
| 1930 | VkBool32 sparseResidency16Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 16 samples |
| 1931 | VkBool32 sparseResidencyAliased /// Sparse resources support: GPU can correctly access data aliased into multiple locations (opt-in) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1932 | } |
| 1933 | |
| 1934 | class VkPhysicalDeviceLimits { |
| 1935 | /// resource maximum sizes |
| 1936 | u32 maxImageDimension1D /// max 1D image dimension |
| 1937 | u32 maxImageDimension2D /// max 2D image dimension |
| 1938 | u32 maxImageDimension3D /// max 3D image dimension |
| 1939 | u32 maxImageDimensionCube /// max cubemap image dimension |
| 1940 | u32 maxImageArrayLayers /// max layers for image arrays |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1941 | VkSampleCountFlags sampleCounts /// sample counts supported for all images supporting rendering and sampling |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1942 | u32 maxTexelBufferSize /// max texel buffer size (bytes) |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 1943 | u32 maxUniformBufferRange /// max uniform buffer size (bytes) |
| 1944 | u32 maxStorageBufferRange /// max storage buffer size (bytes) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1945 | u32 maxPushConstantsSize /// max size of the push constants pool (bytes) |
| 1946 | /// memory limits |
| 1947 | u32 maxMemoryAllocationCount /// max number of device memory allocations supported |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1948 | VkDeviceSize bufferImageGranularity /// Granularity (in bytes) at which buffers and images can be bound to adjacent memory for simultaneous usage |
| 1949 | VkDeviceSize sparseAddressSpaceSize /// Total address space available for sparse allocations (bytes) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1950 | /// descriptor set limits |
| 1951 | 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] | 1952 | u32 maxPerStageDescriptorSamplers /// max num of samplers allowed per-stage in a descriptor set |
| 1953 | u32 maxPerStageDescriptorUniformBuffers /// max num of uniform buffers allowed per-stage in a descriptor set |
| 1954 | u32 maxPerStageDescriptorStorageBuffers /// max num of storage buffers allowed per-stage in a descriptor set |
| 1955 | u32 maxPerStageDescriptorSampledImages /// max num of sampled images allowed per-stage in a descriptor set |
| 1956 | u32 maxPerStageDescriptorStorageImages /// max num of storage images allowed per-stage in a descriptor set |
| 1957 | u32 maxDescriptorSetSamplers /// max num of samplers allowed in all stages in a descriptor set |
| 1958 | 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] | 1959 | 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] | 1960 | 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] | 1961 | 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] | 1962 | u32 maxDescriptorSetSampledImages /// max num of sampled images allowed in all stages in a descriptor set |
| 1963 | u32 maxDescriptorSetStorageImages /// max num of storage images allowed in all stages in a descriptor set |
| 1964 | /// vertex stage limits |
| 1965 | u32 maxVertexInputAttributes /// max num of vertex input attribute slots |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 1966 | u32 maxVertexInputBindings /// max num of vertex input binding slots |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1967 | u32 maxVertexInputAttributeOffset /// max vertex input attribute offset added to vertex buffer offset |
| 1968 | u32 maxVertexInputBindingStride /// max vertex input binding stride |
| 1969 | u32 maxVertexOutputComponents /// max num of output components written by vertex shader |
| 1970 | /// tessellation control stage limits |
Jesse Hall | ae38f73 | 2015-11-19 21:32:50 -0800 | [diff] [blame] | 1971 | u32 maxTessellationGenLevel /// max level supported by tess primitive generator |
| 1972 | u32 maxTessellationPatchSize /// max patch size (vertices) |
| 1973 | u32 maxTessellationControlPerVertexInputComponents /// max num of input components per-vertex in TCS |
| 1974 | u32 maxTessellationControlPerVertexOutputComponents /// max num of output components per-vertex in TCS |
| 1975 | u32 maxTessellationControlPerPatchOutputComponents /// max num of output components per-patch in TCS |
| 1976 | u32 maxTessellationControlTotalOutputComponents /// max total num of per-vertex and per-patch output components in TCS |
| 1977 | u32 maxTessellationEvaluationInputComponents /// max num of input components per vertex in TES |
| 1978 | u32 maxTessellationEvaluationOutputComponents /// max num of output components per vertex in TES |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1979 | /// geometry stage limits |
| 1980 | u32 maxGeometryShaderInvocations /// max invocation count supported in geometry shader |
| 1981 | u32 maxGeometryInputComponents /// max num of input components read in geometry stage |
| 1982 | u32 maxGeometryOutputComponents /// max num of output components written in geometry stage |
| 1983 | u32 maxGeometryOutputVertices /// max num of vertices that can be emitted in geometry stage |
| 1984 | u32 maxGeometryTotalOutputComponents /// max total num of components (all vertices) written in geometry stage |
| 1985 | /// fragment stage limits |
| 1986 | u32 maxFragmentInputComponents /// max num of input compontents read in fragment stage |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 1987 | u32 maxFragmentOutputAttachments /// max num of output attachments written in fragment stage |
| 1988 | u32 maxFragmentDualSourceAttachments /// max num of output attachments written when using dual source blending |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 1989 | u32 maxFragmentCombinedOutputResources /// max total num of storage buffers, storage images and output buffers |
| 1990 | /// compute stage limits |
| 1991 | u32 maxComputeSharedMemorySize /// max total storage size of work group local storage (bytes) |
| 1992 | u32[3] maxComputeWorkGroupCount /// max num of compute work groups that may be dispatched by a single command (x,y,z) |
| 1993 | u32 maxComputeWorkGroupInvocations /// max total compute invocations in a single local work group |
| 1994 | u32[3] maxComputeWorkGroupSize /// max local size of a compute work group (x,y,z) |
| 1995 | |
| 1996 | u32 subPixelPrecisionBits /// num bits of subpixel precision in screen x and y |
| 1997 | u32 subTexelPrecisionBits /// num bits of subtexel precision |
| 1998 | u32 mipmapPrecisionBits /// num bits of mipmap precision |
| 1999 | |
| 2000 | u32 maxDrawIndexedIndexValue /// max index value for indexed draw calls (for 32-bit indices) |
| 2001 | u32 maxDrawIndirectInstanceCount /// max instance count for indirect draw calls |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2002 | |
| 2003 | f32 maxSamplerLodBias /// max absolute sampler level of detail bias |
| 2004 | f32 maxSamplerAnisotropy /// max degree of sampler anisotropy |
| 2005 | |
| 2006 | u32 maxViewports /// max number of active viewports |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2007 | u32[2] maxViewportDimensions /// max viewport dimensions (x,y) |
| 2008 | f32[2] viewportBoundsRange /// viewport bounds range (min,max) |
| 2009 | u32 viewportSubPixelBits /// num bits of subpixel precision for viewport |
| 2010 | |
| 2011 | u32 minMemoryMapAlignment /// min required alignment of pointers returned by MapMemory (bytes) |
Jesse Hall | f09c6b1 | 2015-08-15 19:54:28 -0700 | [diff] [blame] | 2012 | u32 minTexelBufferOffsetAlignment /// min required alignment for texel buffer offsets (bytes) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2013 | u32 minUniformBufferOffsetAlignment /// min required alignment for uniform buffer sizes and offsets (bytes) |
| 2014 | u32 minStorageBufferOffsetAlignment /// min required alignment for storage buffer offsets (bytes) |
| 2015 | |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 2016 | s32 minTexelOffset /// min texel offset for OpTextureSampleOffset |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2017 | u32 maxTexelOffset /// max texel offset for OpTextureSampleOffset |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 2018 | s32 minTexelGatherOffset /// min texel offset for OpTextureGatherOffset |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2019 | u32 maxTexelGatherOffset /// max texel offset for OpTextureGatherOffset |
| 2020 | f32 minInterpolationOffset /// furthest negative offset for interpolateAtOffset |
| 2021 | f32 maxInterpolationOffset /// furthest positive offset for interpolateAtOffset |
| 2022 | u32 subPixelInterpolationOffsetBits /// num of subpixel bits for interpolateAtOffset |
| 2023 | |
| 2024 | u32 maxFramebufferWidth /// max width for a framebuffer |
| 2025 | u32 maxFramebufferHeight /// max height for a framebuffer |
| 2026 | u32 maxFramebufferLayers /// max layer count for a layered framebuffer |
| 2027 | u32 maxFramebufferColorSamples /// max color sample count for a framebuffer |
| 2028 | u32 maxFramebufferDepthSamples /// max depth sample count for a framebuffer |
| 2029 | u32 maxFramebufferStencilSamples /// max stencil sample count for a framebuffer |
| 2030 | u32 maxColorAttachments /// max num of framebuffer color attachments |
| 2031 | |
| 2032 | u32 maxSampledImageColorSamples /// max num of color samples for a non-integer sampled image |
| 2033 | u32 maxSampledImageDepthSamples /// max num of depth/stencil samples for a sampled image |
| 2034 | u32 maxSampledImageIntegerSamples /// max num of samples supported for an integer image |
| 2035 | u32 maxStorageImageSamples /// max num of samples for a storage image |
| 2036 | u32 maxSampleMaskWords /// max num of sample mask words |
| 2037 | |
Jesse Hall | a9bb62b | 2015-11-21 19:31:56 -0800 | [diff] [blame] | 2038 | f32 timestampPeriod |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2039 | |
| 2040 | u32 maxClipDistances /// max number of clip distances |
| 2041 | u32 maxCullDistances /// max number of cull distances |
| 2042 | u32 maxCombinedClipAndCullDistances /// max combined number of user clipping |
| 2043 | |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 2044 | u32 discreteQueuePriorities |
| 2045 | |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2046 | f32[2] pointSizeRange /// range (min,max) of supported point sizes |
| 2047 | f32[2] lineWidthRange /// range (min,max) of supported line widths |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2048 | f32 pointSizeGranularity /// granularity of supported point sizes |
| 2049 | f32 lineWidthGranularity /// granularity of supported line widths |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 2050 | VkBool32 strictLines |
Jesse Hall | a9bb62b | 2015-11-21 19:31:56 -0800 | [diff] [blame] | 2051 | |
| 2052 | u32 recommendedBufferCopyOffsetAlignment |
| 2053 | u32 recommendedBufferCopyRowPitchAlignment |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2054 | } |
| 2055 | |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2056 | class VkPhysicalDeviceSparseProperties { |
| 2057 | VkBool32 residencyStandard2DBlockShape /// Sparse resources support: GPU will access all 2D (single sample) sparse resources using the standard block shapes (based on pixel format) |
| 2058 | VkBool32 residencyStandard2DMSBlockShape /// Sparse resources support: GPU will access all 2D (multisample) sparse resources using the standard block shapes (based on pixel format) |
| 2059 | VkBool32 residencyStandard3DBlockShape /// Sparse resources support: GPU will access all 3D sparse resources using the standard block shapes (based on pixel format) |
| 2060 | 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 |
| 2061 | VkBool32 residencyNonResident /// Sparse resources support: GPU can safely access non-resident regions of a resource, read values from read-write resources are undefined |
| 2062 | 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 |
| 2063 | } |
| 2064 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2065 | class VkSemaphoreCreateInfo { |
| 2066 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO |
| 2067 | const void* pNext /// Pointer to next structure |
| 2068 | VkSemaphoreCreateFlags flags /// Semaphore creation flags |
| 2069 | } |
| 2070 | |
| 2071 | class VkQueryPoolCreateInfo { |
| 2072 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO |
| 2073 | const void* pNext /// Pointer to next structure |
| 2074 | VkQueryType queryType |
| 2075 | u32 slots |
| 2076 | VkQueryPipelineStatisticFlags pipelineStatistics /// Optional |
| 2077 | } |
| 2078 | |
| 2079 | class VkFramebufferCreateInfo { |
| 2080 | VkStructureType sType /// Must be VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO |
| 2081 | const void* pNext /// Pointer to next structure |
| 2082 | VkRenderPass renderPass |
| 2083 | u32 attachmentCount |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2084 | const VkImageView* pAttachments |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2085 | u32 width |
| 2086 | u32 height |
| 2087 | u32 layers |
| 2088 | } |
| 2089 | |
| 2090 | class VkDrawIndirectCmd { |
| 2091 | u32 vertexCount |
| 2092 | u32 instanceCount |
| 2093 | u32 firstVertex |
| 2094 | u32 firstInstance |
| 2095 | } |
| 2096 | |
| 2097 | class VkDrawIndexedIndirectCmd { |
| 2098 | u32 indexCount |
| 2099 | u32 instanceCount |
| 2100 | u32 firstIndex |
| 2101 | s32 vertexOffset |
| 2102 | u32 firstInstance |
| 2103 | } |
| 2104 | |
| 2105 | class VkDispatchIndirectCmd { |
| 2106 | u32 x |
| 2107 | u32 y |
| 2108 | u32 z |
| 2109 | } |
| 2110 | |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2111 | @extension("VK_EXT_KHR_swapchain") |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 2112 | class VkSurfacePropertiesKHR { |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2113 | u32 minImageCount |
| 2114 | u32 maxImageCount |
| 2115 | VkExtent2D currentExtent |
| 2116 | VkExtent2D minImageExtent |
| 2117 | VkExtent2D maxImageExtent |
| 2118 | VkSurfaceTransformFlagsKHR supportedTransforms |
| 2119 | VkSurfaceTransformKHR currentTransform |
| 2120 | u32 maxImageArraySize |
| 2121 | VkImageUsageFlags supportedUsageFlags |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 2122 | } |
| 2123 | |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2124 | @extension("VK_EXT_KHR_swapchain") |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 2125 | class VkSurfaceFormatKHR { |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2126 | VkFormat format |
| 2127 | VkColorSpaceKHR colorSpace |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 2128 | } |
| 2129 | |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2130 | @extension("VK_EXT_KHR_swapchain") |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 2131 | class VkSwapchainCreateInfoKHR { |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2132 | VkStructureType sType |
| 2133 | const void* pNext |
| 2134 | VkSurfaceKHR surface |
| 2135 | u32 minImageCount |
| 2136 | VkFormat imageFormat |
| 2137 | VkColorSpaceKHR imageColorSpace |
| 2138 | VkExtent2D imageExtent |
| 2139 | VkImageUsageFlags imageUsageFlags |
| 2140 | VkSurfaceTransformKHR preTransform |
| 2141 | u32 imageArraySize |
| 2142 | VkSharingMode sharingMode |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 2143 | u32 queueFamilyIndexCount |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2144 | const u32* pQueueFamilyIndices |
| 2145 | VkPresentModeKHR presentMode |
| 2146 | VkSwapchainKHR oldSwapchain |
| 2147 | VkBool32 clipped |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 2148 | } |
| 2149 | |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2150 | @extension("VK_EXT_KHR_swapchain") |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 2151 | class VkPresentInfoKHR { |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2152 | VkStructureType sType |
| 2153 | const void* pNext |
| 2154 | u32 swapchainCount |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 2155 | const VkSwapchainKHR* pSwapchains |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2156 | const u32* imageIndices |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 2157 | } |
| 2158 | |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2159 | @extension("VK_EXT_KHR_display") |
| 2160 | class VkDisplayPropertiesKHR { |
| 2161 | VkDisplayKHR display |
| 2162 | const char* displayName |
| 2163 | VkExtent2D physicalDimensions |
| 2164 | VkExtent2D physicalResolution |
| 2165 | VkSurfaceTransformFlagsKHR supportedTransforms |
| 2166 | u32 planeCount |
| 2167 | VkBool32 planeReorderPossible |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 2168 | } |
| 2169 | |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2170 | @extension("VK_EXT_KHR_display") |
| 2171 | class VkDisplayTimingKHR { |
| 2172 | u32 pixelClock |
| 2173 | VkExtent2D visibleRegion |
| 2174 | VkExtent2D totalRegion |
| 2175 | VkExtent2D physicalDimensions |
| 2176 | u32 hSyncStart |
| 2177 | u32 hSyncEnd |
| 2178 | u32 vSyncStart |
| 2179 | u32 vSyncEnd |
| 2180 | VkBool32 interlaced |
| 2181 | VkBool32 doublescan |
| 2182 | VkBool32 hSyncPos |
| 2183 | VkBool32 vSyncPos |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 2184 | } |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2185 | |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 2186 | @extension("VK_EXT_KHR_display") |
| 2187 | class VkDisplayModePropertiesKHR { |
| 2188 | VkDisplayModeKHR displayMode |
| 2189 | VkDisplayTimingKHR timing |
| 2190 | } |
| 2191 | |
| 2192 | @extension("VK_EXT_KHR_display") |
| 2193 | class VkDisplayModeCreateInfoKHR { |
| 2194 | VkStructureType sType |
| 2195 | const void* pNext |
| 2196 | VkDisplayTimingKHR timing |
| 2197 | } |
| 2198 | |
| 2199 | @extension("VK_EXT_KHR_display") |
| 2200 | class VkDisplayPlanePropertiesKHR { |
| 2201 | VkDisplayPlaneAlphaFlagsKHR supportedAlpha |
| 2202 | VkOffset2D minSrcPosition |
| 2203 | VkOffset2D maxSrcPosition |
| 2204 | VkExtent2D minSrcExtent |
| 2205 | VkExtent2D maxSrcExtent |
| 2206 | VkOffset2D minDstPosition |
| 2207 | VkOffset2D maxDstPosition |
| 2208 | VkExtent2D minDstExtent |
| 2209 | VkExtent2D maxDstExtent |
| 2210 | } |
| 2211 | |
| 2212 | @extension("VK_EXT_KHR_display") |
| 2213 | class VkSurfaceDescriptionDisplayPlaneKHR { |
| 2214 | VkStructureType sType |
| 2215 | const void* pNext |
| 2216 | VkDisplayModeKHR displayMode |
| 2217 | u32 planeIndex |
| 2218 | u32 planeStackIndex |
| 2219 | VkSurfaceTransformKHR transform |
| 2220 | f32 globalAlpha |
| 2221 | VkDisplayPlaneAlphaFlagsKHR alphaMode |
| 2222 | VkExtent2D imageSize |
| 2223 | } |
| 2224 | |
| 2225 | @extension("VK_EXT_KHR_display_swapchain") |
| 2226 | class VkDisplaySwapchainCreateInfoKHR { |
| 2227 | VkStructureType sType |
| 2228 | const void* pNext |
| 2229 | const VkSwapchainCreateInfoKHR* pNextSwapchainCreateInfo |
| 2230 | } |
| 2231 | |
| 2232 | @extension("VK_EXT_KHR_display_swapchain") |
| 2233 | class VkDisplayPresentInfoKHR { |
| 2234 | VkStructureType sType |
| 2235 | const void* pNext |
| 2236 | VkRect2D srcRect |
| 2237 | VkRect2D dstRect |
| 2238 | } |
| 2239 | |
| 2240 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2241 | //////////////// |
| 2242 | // Commands // |
| 2243 | //////////////// |
| 2244 | |
| 2245 | // Function pointers. TODO: add support for function pointers. |
| 2246 | |
| 2247 | @external type void* PFN_vkVoidFunction |
| 2248 | @pfn cmd void vkVoidFunction() { |
| 2249 | } |
| 2250 | |
| 2251 | @external type void* PFN_vkAllocFunction |
| 2252 | @pfn cmd void* vkAllocFunction( |
| 2253 | void* pUserData, |
| 2254 | platform.size_t size, |
| 2255 | platform.size_t alignment, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 2256 | VkSystemAllocScope allocScope) { |
| 2257 | return ? |
| 2258 | } |
| 2259 | |
| 2260 | @external type void* PFN_vkReallocFunction |
| 2261 | @pfn cmd void* vkReallocFunction( |
| 2262 | void* pUserData, |
| 2263 | void* pOriginal, |
| 2264 | platform.size_t size, |
| 2265 | platform.size_t alignment, |
| 2266 | VkSystemAllocScope allocScope) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2267 | return ? |
| 2268 | } |
| 2269 | |
| 2270 | @external type void* PFN_vkFreeFunction |
| 2271 | @pfn cmd void vkFreeFunction( |
| 2272 | void* pUserData, |
| 2273 | void* pMem) { |
| 2274 | } |
| 2275 | |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 2276 | @external type void* PFN_vkInternalAllocNotification |
| 2277 | @pfn cmd void vkInternalAllocNotification( |
| 2278 | void* pUserData, |
| 2279 | platform.size_t size, |
| 2280 | VkInternalAllocType allocType, |
| 2281 | VkSystemAllocScope allocScope) { |
| 2282 | } |
| 2283 | |
| 2284 | @external type void* PFN_vkInternalFreeNotification |
| 2285 | @pfn cmd void vkInternalFreeNotification( |
| 2286 | void* pUserData, |
| 2287 | platform.size_t size, |
| 2288 | VkInternalAllocType allocType, |
| 2289 | VkSystemAllocScope allocScope) { |
| 2290 | } |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2291 | |
| 2292 | // Global functions |
| 2293 | |
| 2294 | @threadSafety("system") |
| 2295 | cmd VkResult vkCreateInstance( |
| 2296 | const VkInstanceCreateInfo* pCreateInfo, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 2297 | const VkAllocCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2298 | VkInstance* pInstance) { |
| 2299 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO) |
| 2300 | |
| 2301 | instance := ? |
| 2302 | pInstance[0] = instance |
| 2303 | State.Instances[instance] = new!InstanceObject() |
| 2304 | |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 2305 | layers := pCreateInfo.ppEnabledLayerNames[0:pCreateInfo.enabledLayerNameCount] |
| 2306 | extensions := pCreateInfo.ppEnabledExtensionNames[0:pCreateInfo.enabledExtensionNameCount] |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2307 | |
| 2308 | return ? |
| 2309 | } |
| 2310 | |
| 2311 | @threadSafety("system") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2312 | cmd void vkDestroyInstance( |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 2313 | VkInstance instance, |
| 2314 | const VkAllocCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2315 | instanceObject := GetInstance(instance) |
| 2316 | |
| 2317 | State.Instances[instance] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2318 | } |
| 2319 | |
| 2320 | @threadSafety("system") |
| 2321 | cmd VkResult vkEnumeratePhysicalDevices( |
| 2322 | VkInstance instance, |
| 2323 | u32* pPhysicalDeviceCount, |
| 2324 | VkPhysicalDevice* pPhysicalDevices) { |
| 2325 | instanceObject := GetInstance(instance) |
| 2326 | |
| 2327 | physicalDeviceCount := as!u32(?) |
| 2328 | pPhysicalDeviceCount[0] = physicalDeviceCount |
| 2329 | physicalDevices := pPhysicalDevices[0:physicalDeviceCount] |
| 2330 | |
| 2331 | for i in (0 .. physicalDeviceCount) { |
| 2332 | physicalDevice := ? |
| 2333 | physicalDevices[i] = physicalDevice |
| 2334 | if !(physicalDevice in State.PhysicalDevices) { |
| 2335 | State.PhysicalDevices[physicalDevice] = new!PhysicalDeviceObject(instance: instance) |
| 2336 | } |
| 2337 | } |
| 2338 | |
| 2339 | return ? |
| 2340 | } |
| 2341 | |
| 2342 | cmd PFN_vkVoidFunction vkGetDeviceProcAddr( |
| 2343 | VkDevice device, |
| 2344 | const char* pName) { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2345 | if device != NULL_HANDLE { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2346 | device := GetDevice(device) |
| 2347 | } |
| 2348 | |
| 2349 | return ? |
| 2350 | } |
| 2351 | |
| 2352 | cmd PFN_vkVoidFunction vkGetInstanceProcAddr( |
| 2353 | VkInstance instance, |
| 2354 | const char* pName) { |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2355 | if instance != NULL_HANDLE { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2356 | instanceObject := GetInstance(instance) |
| 2357 | } |
| 2358 | |
| 2359 | return ? |
| 2360 | } |
| 2361 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 2362 | cmd void vkGetPhysicalDeviceProperties( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2363 | VkPhysicalDevice physicalDevice, |
| 2364 | VkPhysicalDeviceProperties* pProperties) { |
| 2365 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
| 2366 | |
| 2367 | properties := ? |
| 2368 | pProperties[0] = properties |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2369 | } |
| 2370 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 2371 | cmd void vkGetPhysicalDeviceQueueFamilyProperties( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2372 | VkPhysicalDevice physicalDevice, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 2373 | u32* pQueueFamilyPropertyCount, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2374 | VkQueueFamilyProperties* pQueueFamilyProperties) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2375 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2376 | // TODO: Figure out how to express fetch-count-or-properties |
| 2377 | // This version fails 'apic validate' with 'fence not allowed in |
| 2378 | // *semantic.Branch'. Other attempts have failed with the same or other |
| 2379 | // errors. |
| 2380 | // if pQueueFamilyProperties != null { |
| 2381 | // queuesProperties := pQueueFamilyProperties[0:pCount[0]] |
| 2382 | // for i in (0 .. pCount[0]) { |
| 2383 | // queueProperties := as!VkQueueFamilyProperties(?) |
| 2384 | // queuesProperties[i] = queueProperties |
| 2385 | // } |
| 2386 | // } else { |
| 2387 | // count := ? |
| 2388 | // pCount[0] = count |
| 2389 | // } |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2390 | } |
| 2391 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 2392 | cmd void vkGetPhysicalDeviceMemoryProperties( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2393 | VkPhysicalDevice physicalDevice, |
| 2394 | VkPhysicalDeviceMemoryProperties* pMemoryProperties) { |
| 2395 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
| 2396 | |
| 2397 | memoryProperties := ? |
| 2398 | pMemoryProperties[0] = memoryProperties |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2399 | } |
| 2400 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 2401 | cmd void vkGetPhysicalDeviceFeatures( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2402 | VkPhysicalDevice physicalDevice, |
| 2403 | VkPhysicalDeviceFeatures* pFeatures) { |
| 2404 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
| 2405 | |
| 2406 | features := ? |
| 2407 | pFeatures[0] = features |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2408 | } |
| 2409 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 2410 | cmd void vkGetPhysicalDeviceFormatProperties( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2411 | VkPhysicalDevice physicalDevice, |
| 2412 | VkFormat format, |
| 2413 | VkFormatProperties* pFormatProperties) { |
| 2414 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
| 2415 | |
| 2416 | formatProperties := ? |
| 2417 | pFormatProperties[0] = formatProperties |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2418 | } |
| 2419 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 2420 | cmd void vkGetPhysicalDeviceImageFormatProperties( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2421 | VkPhysicalDevice physicalDevice, |
| 2422 | VkFormat format, |
| 2423 | VkImageType type, |
| 2424 | VkImageTiling tiling, |
| 2425 | VkImageUsageFlags usage, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2426 | VkImageCreateFlags flags, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2427 | VkImageFormatProperties* pImageFormatProperties) { |
| 2428 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
| 2429 | |
| 2430 | imageFormatProperties := ? |
| 2431 | pImageFormatProperties[0] = imageFormatProperties |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2432 | } |
| 2433 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2434 | |
| 2435 | // Device functions |
| 2436 | |
| 2437 | @threadSafety("system") |
| 2438 | cmd VkResult vkCreateDevice( |
| 2439 | VkPhysicalDevice physicalDevice, |
| 2440 | const VkDeviceCreateInfo* pCreateInfo, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 2441 | const VkAllocCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2442 | VkDevice* pDevice) { |
| 2443 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO) |
| 2444 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
| 2445 | |
| 2446 | device := ? |
| 2447 | pDevice[0] = device |
| 2448 | State.Devices[device] = new!DeviceObject(physicalDevice: physicalDevice) |
| 2449 | |
| 2450 | return ? |
| 2451 | } |
| 2452 | |
| 2453 | @threadSafety("system") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2454 | cmd void vkDestroyDevice( |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 2455 | VkDevice device, |
| 2456 | const VkAllocCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2457 | deviceObject := GetDevice(device) |
| 2458 | |
| 2459 | State.Devices[device] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2460 | } |
| 2461 | |
| 2462 | |
| 2463 | // Extension discovery functions |
| 2464 | |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2465 | cmd VkResult vkEnumerateInstanceLayerProperties( |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 2466 | u32* pPropertyCount, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2467 | VkLayerProperties* pProperties) { |
| 2468 | count := as!u32(?) |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 2469 | pPropertyCount[0] = count |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2470 | |
| 2471 | properties := pProperties[0:count] |
| 2472 | for i in (0 .. count) { |
| 2473 | property := ? |
| 2474 | properties[i] = property |
| 2475 | } |
| 2476 | |
| 2477 | return ? |
| 2478 | } |
| 2479 | |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2480 | cmd VkResult vkEnumerateInstanceExtensionProperties( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2481 | const char* pLayerName, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 2482 | u32* pPropertyCount, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2483 | VkExtensionProperties* pProperties) { |
| 2484 | count := as!u32(?) |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 2485 | pPropertyCount[0] = count |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2486 | |
| 2487 | properties := pProperties[0:count] |
| 2488 | for i in (0 .. count) { |
| 2489 | property := ? |
| 2490 | properties[i] = property |
| 2491 | } |
| 2492 | |
| 2493 | return ? |
| 2494 | } |
| 2495 | |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2496 | cmd VkResult vkEnumerateDeviceLayerProperties( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2497 | VkPhysicalDevice physicalDevice, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 2498 | u32* pPropertyCount, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2499 | VkLayerProperties* pProperties) { |
| 2500 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
| 2501 | count := as!u32(?) |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 2502 | pPropertyCount[0] = count |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2503 | |
| 2504 | properties := pProperties[0:count] |
| 2505 | for i in (0 .. count) { |
| 2506 | property := ? |
| 2507 | properties[i] = property |
| 2508 | } |
| 2509 | |
| 2510 | return ? |
| 2511 | } |
| 2512 | |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2513 | cmd VkResult vkEnumerateDeviceExtensionProperties( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2514 | VkPhysicalDevice physicalDevice, |
| 2515 | const char* pLayerName, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 2516 | u32* pPropertyCount, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2517 | VkExtensionProperties* pProperties) { |
| 2518 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
| 2519 | |
| 2520 | count := as!u32(?) |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 2521 | pPropertyCount[0] = count |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2522 | |
| 2523 | properties := pProperties[0:count] |
| 2524 | for i in (0 .. count) { |
| 2525 | property := ? |
| 2526 | properties[i] = property |
| 2527 | } |
| 2528 | |
| 2529 | return ? |
| 2530 | } |
| 2531 | |
| 2532 | |
| 2533 | // Queue functions |
| 2534 | |
| 2535 | @threadSafety("system") |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 2536 | cmd void vkGetDeviceQueue( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2537 | VkDevice device, |
| 2538 | u32 queueFamilyIndex, |
| 2539 | u32 queueIndex, |
| 2540 | VkQueue* pQueue) { |
| 2541 | deviceObject := GetDevice(device) |
| 2542 | |
| 2543 | queue := ? |
| 2544 | pQueue[0] = queue |
| 2545 | |
| 2546 | if !(queue in State.Queues) { |
| 2547 | State.Queues[queue] = new!QueueObject(device: device) |
| 2548 | } |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2549 | } |
| 2550 | |
| 2551 | @threadSafety("app") |
| 2552 | cmd VkResult vkQueueSubmit( |
| 2553 | VkQueue queue, |
Jesse Hall | a366a51 | 2015-11-19 22:30:07 -0800 | [diff] [blame] | 2554 | u32 submitCount, |
| 2555 | const VkSubmitInfo* pSubmitInfo, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2556 | VkFence fence) { |
| 2557 | queueObject := GetQueue(queue) |
| 2558 | |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2559 | if fence != NULL_HANDLE { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2560 | fenceObject := GetFence(fence) |
| 2561 | assert(fenceObject.device == queueObject.device) |
| 2562 | } |
| 2563 | |
Jesse Hall | a366a51 | 2015-11-19 22:30:07 -0800 | [diff] [blame] | 2564 | // cmdBuffers := pCmdBuffers[0:cmdBufferCount] |
| 2565 | // for i in (0 .. cmdBufferCount) { |
| 2566 | // cmdBuffer := cmdBuffers[i] |
| 2567 | // cmdBufferObject := GetCmdBuffer(cmdBuffer) |
| 2568 | // assert(cmdBufferObject.device == queueObject.device) |
| 2569 | // |
| 2570 | // validate("QueueCheck", cmdBufferObject.queueFlags in queueObject.flags, |
| 2571 | // "vkQueueSubmit: enqueued cmdBuffer requires missing queue capabilities.") |
| 2572 | // } |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2573 | |
| 2574 | return ? |
| 2575 | } |
| 2576 | |
| 2577 | @threadSafety("system") |
| 2578 | cmd VkResult vkQueueWaitIdle( |
| 2579 | VkQueue queue) { |
| 2580 | queueObject := GetQueue(queue) |
| 2581 | |
| 2582 | return ? |
| 2583 | } |
| 2584 | |
| 2585 | @threadSafety("system") |
| 2586 | cmd VkResult vkDeviceWaitIdle( |
| 2587 | VkDevice device) { |
| 2588 | deviceObject := GetDevice(device) |
| 2589 | |
| 2590 | return ? |
| 2591 | } |
| 2592 | |
| 2593 | |
| 2594 | // Memory functions |
| 2595 | |
| 2596 | @threadSafety("system") |
| 2597 | cmd VkResult vkAllocMemory( |
| 2598 | VkDevice device, |
| 2599 | const VkMemoryAllocInfo* pAllocInfo, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 2600 | const VkAllocCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2601 | VkDeviceMemory* pMem) { |
| 2602 | assert(pAllocInfo.sType == VK_STRUCTURE_TYPE_MEMORY_ALLOC_INFO) |
| 2603 | deviceObject := GetDevice(device) |
| 2604 | |
| 2605 | mem := ? |
| 2606 | pMem[0] = mem |
| 2607 | State.DeviceMemories[mem] = new!DeviceMemoryObject( |
| 2608 | device: device, |
| 2609 | allocationSize: pAllocInfo[0].allocationSize) |
| 2610 | |
| 2611 | return ? |
| 2612 | } |
| 2613 | |
| 2614 | @threadSafety("system") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2615 | cmd void vkFreeMemory( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2616 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 2617 | VkDeviceMemory mem, |
| 2618 | const VkAllocCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2619 | deviceObject := GetDevice(device) |
| 2620 | memObject := GetDeviceMemory(mem) |
| 2621 | assert(memObject.device == device) |
| 2622 | |
| 2623 | // Check that no objects are still bound before freeing. |
| 2624 | validate("MemoryCheck", len(memObject.boundObjects) == 0, |
| 2625 | "vkFreeMemory: objects still bound") |
| 2626 | validate("MemoryCheck", len(memObject.boundCommandBuffers) == 0, |
| 2627 | "vkFreeMemory: cmdBuffers still bound") |
| 2628 | State.DeviceMemories[mem] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2629 | } |
| 2630 | |
| 2631 | @threadSafety("app") |
| 2632 | cmd VkResult vkMapMemory( |
| 2633 | VkDevice device, |
| 2634 | VkDeviceMemory mem, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2635 | VkDeviceSize offset, |
| 2636 | VkDeviceSize size, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2637 | VkMemoryMapFlags flags, |
| 2638 | void** ppData) { |
| 2639 | deviceObject := GetDevice(device) |
| 2640 | memObject := GetDeviceMemory(mem) |
| 2641 | assert(memObject.device == device) |
| 2642 | |
| 2643 | assert(flags == as!VkMemoryMapFlags(0)) |
| 2644 | assert((offset + size) <= memObject.allocationSize) |
| 2645 | |
| 2646 | return ? |
| 2647 | } |
| 2648 | |
| 2649 | @threadSafety("app") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2650 | cmd void vkUnmapMemory( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2651 | VkDevice device, |
| 2652 | VkDeviceMemory mem) { |
| 2653 | deviceObject := GetDevice(device) |
| 2654 | memObject := GetDeviceMemory(mem) |
| 2655 | assert(memObject.device == device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2656 | } |
| 2657 | |
| 2658 | cmd VkResult vkFlushMappedMemoryRanges( |
| 2659 | VkDevice device, |
| 2660 | u32 memRangeCount |
| 2661 | const VkMappedMemoryRange* pMemRanges) { |
| 2662 | deviceObject := GetDevice(device) |
| 2663 | |
| 2664 | memRanges := pMemRanges[0:memRangeCount] |
| 2665 | for i in (0 .. memRangeCount) { |
| 2666 | memRange := memRanges[i] |
| 2667 | memObject := GetDeviceMemory(memRange.mem) |
| 2668 | assert(memObject.device == device) |
| 2669 | assert((memRange.offset + memRange.size) <= memObject.allocationSize) |
| 2670 | } |
| 2671 | |
| 2672 | return ? |
| 2673 | } |
| 2674 | |
| 2675 | cmd VkResult vkInvalidateMappedMemoryRanges( |
| 2676 | VkDevice device, |
| 2677 | u32 memRangeCount, |
| 2678 | const VkMappedMemoryRange* pMemRanges) { |
| 2679 | deviceObject := GetDevice(device) |
| 2680 | |
| 2681 | memRanges := pMemRanges[0:memRangeCount] |
| 2682 | for i in (0 .. memRangeCount) { |
| 2683 | memRange := memRanges[i] |
| 2684 | memObject := GetDeviceMemory(memRange.mem) |
| 2685 | assert(memObject.device == device) |
| 2686 | assert((memRange.offset + memRange.size) <= memObject.allocationSize) |
| 2687 | } |
| 2688 | |
| 2689 | return ? |
| 2690 | } |
| 2691 | |
| 2692 | |
| 2693 | // Memory management API functions |
| 2694 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 2695 | cmd void vkGetDeviceMemoryCommitment( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2696 | VkDevice device, |
| 2697 | VkDeviceMemory memory, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2698 | VkDeviceSize* pCommittedMemoryInBytes) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2699 | deviceObject := GetDevice(device) |
| 2700 | |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2701 | if memory != NULL_HANDLE { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2702 | memoryObject := GetDeviceMemory(memory) |
| 2703 | assert(memoryObject.device == device) |
| 2704 | } |
| 2705 | |
| 2706 | committedMemoryInBytes := ? |
| 2707 | pCommittedMemoryInBytes[0] = committedMemoryInBytes |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2708 | } |
| 2709 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 2710 | cmd void vkGetBufferMemoryRequirements( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2711 | VkDevice device, |
| 2712 | VkBuffer buffer, |
| 2713 | VkMemoryRequirements* pMemoryRequirements) { |
| 2714 | deviceObject := GetDevice(device) |
| 2715 | bufferObject := GetBuffer(buffer) |
| 2716 | assert(bufferObject.device == device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2717 | } |
| 2718 | |
| 2719 | cmd VkResult vkBindBufferMemory( |
| 2720 | VkDevice device, |
| 2721 | VkBuffer buffer, |
| 2722 | VkDeviceMemory mem, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2723 | VkDeviceSize memOffset) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2724 | deviceObject := GetDevice(device) |
| 2725 | bufferObject := GetBuffer(buffer) |
| 2726 | assert(bufferObject.device == device) |
| 2727 | |
| 2728 | // Unbind buffer from previous memory object, if not VK_NULL_HANDLE. |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2729 | if bufferObject.mem != NULL_HANDLE { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2730 | memObject := GetDeviceMemory(bufferObject.mem) |
| 2731 | memObject.boundObjects[as!u64(buffer)] = null |
| 2732 | } |
| 2733 | |
| 2734 | // Bind buffer to given memory object, if not VK_NULL_HANDLE. |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2735 | if mem != NULL_HANDLE { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2736 | memObject := GetDeviceMemory(mem) |
| 2737 | assert(memObject.device == device) |
| 2738 | memObject.boundObjects[as!u64(buffer)] = memOffset |
| 2739 | } |
| 2740 | bufferObject.mem = mem |
| 2741 | bufferObject.memOffset = memOffset |
| 2742 | |
| 2743 | return ? |
| 2744 | } |
| 2745 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 2746 | cmd void vkGetImageMemoryRequirements( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2747 | VkDevice device, |
| 2748 | VkImage image, |
| 2749 | VkMemoryRequirements* pMemoryRequirements) { |
| 2750 | deviceObject := GetDevice(device) |
| 2751 | imageObject := GetImage(image) |
| 2752 | assert(imageObject.device == device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2753 | } |
| 2754 | |
| 2755 | cmd VkResult vkBindImageMemory( |
| 2756 | VkDevice device, |
| 2757 | VkImage image, |
| 2758 | VkDeviceMemory mem, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2759 | VkDeviceSize memOffset) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2760 | deviceObject := GetDevice(device) |
| 2761 | imageObject := GetImage(image) |
| 2762 | assert(imageObject.device == device) |
| 2763 | |
| 2764 | // Unbind image from previous memory object, if not VK_NULL_HANDLE. |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2765 | if imageObject.mem != NULL_HANDLE { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2766 | memObject := GetDeviceMemory(imageObject.mem) |
| 2767 | memObject.boundObjects[as!u64(image)] = null |
| 2768 | } |
| 2769 | |
| 2770 | // Bind image to given memory object, if not VK_NULL_HANDLE. |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2771 | if mem != NULL_HANDLE { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2772 | memObject := GetDeviceMemory(mem) |
| 2773 | assert(memObject.device == device) |
| 2774 | memObject.boundObjects[as!u64(image)] = memOffset |
| 2775 | } |
| 2776 | imageObject.mem = mem |
| 2777 | imageObject.memOffset = memOffset |
| 2778 | |
| 2779 | return ? |
| 2780 | } |
| 2781 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 2782 | cmd void vkGetImageSparseMemoryRequirements( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2783 | VkDevice device, |
| 2784 | VkImage image, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 2785 | u32* pSparseMemoryRequirementCount, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2786 | VkSparseImageMemoryRequirements* pSparseMemoryRequirements) { |
| 2787 | deviceObject := GetDevice(device) |
| 2788 | imageObject := GetImage(image) |
| 2789 | assert(imageObject.device == device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2790 | } |
| 2791 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 2792 | cmd void vkGetPhysicalDeviceSparseImageFormatProperties( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2793 | VkPhysicalDevice physicalDevice, |
| 2794 | VkFormat format, |
| 2795 | VkImageType type, |
| 2796 | u32 samples, |
| 2797 | VkImageUsageFlags usage, |
| 2798 | VkImageTiling tiling, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 2799 | u32* pPropertyCount, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2800 | VkSparseImageFormatProperties* pProperties) { |
| 2801 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2802 | } |
| 2803 | |
| 2804 | cmd VkResult vkQueueBindSparseBufferMemory( |
| 2805 | VkQueue queue, |
| 2806 | VkBuffer buffer, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 2807 | u32 bindInfoCount, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2808 | const VkSparseMemoryBindInfo* pBindInfo) { |
| 2809 | queueObject := GetQueue(queue) |
| 2810 | bufferObject := GetBuffer(buffer) |
| 2811 | assert(bufferObject.device == queueObject.device) |
| 2812 | |
| 2813 | return ? |
| 2814 | } |
| 2815 | |
| 2816 | cmd VkResult vkQueueBindSparseImageOpaqueMemory( |
| 2817 | VkQueue queue, |
| 2818 | VkImage image, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 2819 | u32 bindInfoCount, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2820 | const VkSparseMemoryBindInfo* pBindInfo) { |
| 2821 | queueObject := GetQueue(queue) |
| 2822 | imageObject := GetImage(image) |
| 2823 | assert(imageObject.device == queueObject.device) |
| 2824 | |
| 2825 | return ? |
| 2826 | } |
| 2827 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2828 | cmd VkResult vkQueueBindSparseImageMemory( |
| 2829 | VkQueue queue, |
| 2830 | VkImage image, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 2831 | u32 bindInfoCount, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2832 | const VkSparseImageMemoryBindInfo* pBindInfo) { |
| 2833 | queueObject := GetQueue(queue) |
| 2834 | imageObject := GetImage(image) |
| 2835 | |
| 2836 | return ? |
| 2837 | } |
| 2838 | |
| 2839 | |
| 2840 | // Fence functions |
| 2841 | |
| 2842 | @threadSafety("system") |
| 2843 | cmd VkResult vkCreateFence( |
| 2844 | VkDevice device, |
| 2845 | const VkFenceCreateInfo* pCreateInfo, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 2846 | const VkAllocCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2847 | VkFence* pFence) { |
| 2848 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_FENCE_CREATE_INFO) |
| 2849 | deviceObject := GetDevice(device) |
| 2850 | |
| 2851 | fence := ? |
| 2852 | pFence[0] = fence |
| 2853 | State.Fences[fence] = new!FenceObject( |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 2854 | device: device, signaled: (pCreateInfo.flags == as!VkFenceCreateFlags(VK_FENCE_CREATE_SIGNALED_BIT))) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2855 | |
| 2856 | return ? |
| 2857 | } |
| 2858 | |
| 2859 | @threadSafety("system") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2860 | cmd void vkDestroyFence( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2861 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 2862 | VkFence fence, |
| 2863 | const VkAllocCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2864 | deviceObject := GetDevice(device) |
| 2865 | fenceObject := GetFence(fence) |
| 2866 | assert(fenceObject.device == device) |
| 2867 | |
| 2868 | State.Fences[fence] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2869 | } |
| 2870 | |
| 2871 | @threadSafety("system") |
| 2872 | cmd VkResult vkResetFences( |
| 2873 | VkDevice device, |
| 2874 | u32 fenceCount, |
| 2875 | const VkFence* pFences) { |
| 2876 | deviceObject := GetDevice(device) |
| 2877 | |
| 2878 | fences := pFences[0:fenceCount] |
| 2879 | for i in (0 .. fenceCount) { |
| 2880 | fence := fences[i] |
| 2881 | fenceObject := GetFence(fence) |
| 2882 | assert(fenceObject.device == device) |
| 2883 | fenceObject.signaled = false |
| 2884 | } |
| 2885 | |
| 2886 | return ? |
| 2887 | } |
| 2888 | |
| 2889 | @threadSafety("system") |
| 2890 | cmd VkResult vkGetFenceStatus( |
| 2891 | VkDevice device, |
| 2892 | VkFence fence) { |
| 2893 | deviceObject := GetDevice(device) |
| 2894 | fenceObject := GetFence(fence) |
| 2895 | assert(fenceObject.device == device) |
| 2896 | |
| 2897 | return ? |
| 2898 | } |
| 2899 | |
| 2900 | @threadSafety("system") |
| 2901 | cmd VkResult vkWaitForFences( |
| 2902 | VkDevice device, |
| 2903 | u32 fenceCount, |
| 2904 | const VkFence* pFences, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2905 | VkBool32 waitAll, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2906 | u64 timeout) { /// timeout in nanoseconds |
| 2907 | deviceObject := GetDevice(device) |
| 2908 | |
| 2909 | fences := pFences[0:fenceCount] |
| 2910 | for i in (0 .. fenceCount) { |
| 2911 | fence := fences[i] |
| 2912 | fenceObject := GetFence(fence) |
| 2913 | assert(fenceObject.device == device) |
| 2914 | } |
| 2915 | |
| 2916 | return ? |
| 2917 | } |
| 2918 | |
| 2919 | |
| 2920 | // Queue semaphore functions |
| 2921 | |
| 2922 | @threadSafety("system") |
| 2923 | cmd VkResult vkCreateSemaphore( |
| 2924 | VkDevice device, |
| 2925 | const VkSemaphoreCreateInfo* pCreateInfo, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 2926 | const VkAllocCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2927 | VkSemaphore* pSemaphore) { |
| 2928 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO) |
| 2929 | deviceObject := GetDevice(device) |
| 2930 | |
| 2931 | semaphore := ? |
| 2932 | pSemaphore[0] = semaphore |
| 2933 | State.Semaphores[semaphore] = new!SemaphoreObject(device: device) |
| 2934 | |
| 2935 | return ? |
| 2936 | } |
| 2937 | |
| 2938 | @threadSafety("system") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2939 | cmd void vkDestroySemaphore( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2940 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 2941 | VkSemaphore semaphore, |
| 2942 | const VkAllocCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2943 | deviceObject := GetDevice(device) |
| 2944 | semaphoreObject := GetSemaphore(semaphore) |
| 2945 | assert(semaphoreObject.device == device) |
| 2946 | |
| 2947 | State.Semaphores[semaphore] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2948 | } |
| 2949 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2950 | |
| 2951 | // Event functions |
| 2952 | |
| 2953 | @threadSafety("system") |
| 2954 | cmd VkResult vkCreateEvent( |
| 2955 | VkDevice device, |
| 2956 | const VkEventCreateInfo* pCreateInfo, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 2957 | const VkAllocCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2958 | VkEvent* pEvent) { |
| 2959 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_EVENT_CREATE_INFO) |
| 2960 | deviceObject := GetDevice(device) |
| 2961 | |
| 2962 | event := ? |
| 2963 | pEvent[0] = event |
| 2964 | State.Events[event] = new!EventObject(device: device) |
| 2965 | |
| 2966 | return ? |
| 2967 | } |
| 2968 | |
| 2969 | @threadSafety("system") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 2970 | cmd void vkDestroyEvent( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2971 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 2972 | VkEvent event, |
| 2973 | const VkAllocCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2974 | deviceObject := GetDevice(device) |
| 2975 | eventObject := GetEvent(event) |
| 2976 | assert(eventObject.device == device) |
| 2977 | |
| 2978 | State.Events[event] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 2979 | } |
| 2980 | |
| 2981 | @threadSafety("system") |
| 2982 | cmd VkResult vkGetEventStatus( |
| 2983 | VkDevice device, |
| 2984 | VkEvent event) { |
| 2985 | deviceObject := GetDevice(device) |
| 2986 | eventObject := GetEvent(event) |
| 2987 | assert(eventObject.device == device) |
| 2988 | |
| 2989 | return ? |
| 2990 | } |
| 2991 | |
| 2992 | @threadSafety("system") |
| 2993 | cmd VkResult vkSetEvent( |
| 2994 | VkDevice device, |
| 2995 | VkEvent event) { |
| 2996 | deviceObject := GetDevice(device) |
| 2997 | eventObject := GetEvent(event) |
| 2998 | assert(eventObject.device == device) |
| 2999 | |
| 3000 | return ? |
| 3001 | } |
| 3002 | |
| 3003 | @threadSafety("system") |
| 3004 | cmd VkResult vkResetEvent( |
| 3005 | VkDevice device, |
| 3006 | VkEvent event) { |
| 3007 | deviceObject := GetDevice(device) |
| 3008 | eventObject := GetEvent(event) |
| 3009 | assert(eventObject.device == device) |
| 3010 | |
| 3011 | return ? |
| 3012 | } |
| 3013 | |
| 3014 | |
| 3015 | // Query functions |
| 3016 | |
| 3017 | @threadSafety("system") |
| 3018 | cmd VkResult vkCreateQueryPool( |
| 3019 | VkDevice device, |
| 3020 | const VkQueryPoolCreateInfo* pCreateInfo, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 3021 | const VkAllocCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3022 | VkQueryPool* pQueryPool) { |
| 3023 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO) |
| 3024 | deviceObject := GetDevice(device) |
| 3025 | |
| 3026 | queryPool := ? |
| 3027 | pQueryPool[0] = queryPool |
| 3028 | State.QueryPools[queryPool] = new!QueryPoolObject(device: device) |
| 3029 | |
| 3030 | return ? |
| 3031 | } |
| 3032 | |
| 3033 | @threadSafety("system") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3034 | cmd void vkDestroyQueryPool( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3035 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 3036 | VkQueryPool queryPool, |
| 3037 | const VkAllocCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3038 | deviceObject := GetDevice(device) |
| 3039 | queryPoolObject := GetQueryPool(queryPool) |
| 3040 | assert(queryPoolObject.device == device) |
| 3041 | |
| 3042 | State.QueryPools[queryPool] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3043 | } |
| 3044 | |
| 3045 | @threadSafety("system") |
| 3046 | cmd VkResult vkGetQueryPoolResults( |
| 3047 | VkDevice device, |
| 3048 | VkQueryPool queryPool, |
| 3049 | u32 startQuery, |
| 3050 | u32 queryCount, |
Jesse Hall | a9bb62b | 2015-11-21 19:31:56 -0800 | [diff] [blame] | 3051 | platform.size_t dataSize, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3052 | void* pData, |
Jesse Hall | a9bb62b | 2015-11-21 19:31:56 -0800 | [diff] [blame] | 3053 | VkDeviceSize stride, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3054 | VkQueryResultFlags flags) { |
| 3055 | deviceObject := GetDevice(device) |
| 3056 | queryPoolObject := GetQueryPool(queryPool) |
| 3057 | assert(queryPoolObject.device == device) |
| 3058 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3059 | data := pData[0:dataSize] |
| 3060 | |
| 3061 | return ? |
| 3062 | } |
| 3063 | |
| 3064 | // Buffer functions |
| 3065 | |
| 3066 | @threadSafety("system") |
| 3067 | cmd VkResult vkCreateBuffer( |
| 3068 | VkDevice device, |
| 3069 | const VkBufferCreateInfo* pCreateInfo, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 3070 | const VkAllocCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3071 | VkBuffer* pBuffer) { |
| 3072 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO) |
| 3073 | deviceObject := GetDevice(device) |
| 3074 | |
| 3075 | buffer := ? |
| 3076 | pBuffer[0] = buffer |
| 3077 | State.Buffers[buffer] = new!BufferObject(device: device) |
| 3078 | |
| 3079 | return ? |
| 3080 | } |
| 3081 | |
| 3082 | @threadSafety("system") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3083 | cmd void vkDestroyBuffer( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3084 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 3085 | VkBuffer buffer, |
| 3086 | const VkAllocCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3087 | deviceObject := GetDevice(device) |
| 3088 | bufferObject := GetBuffer(buffer) |
| 3089 | assert(bufferObject.device == device) |
| 3090 | |
| 3091 | assert(bufferObject.mem == 0) |
| 3092 | State.Buffers[buffer] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3093 | } |
| 3094 | |
| 3095 | |
| 3096 | // Buffer view functions |
| 3097 | |
| 3098 | @threadSafety("system") |
| 3099 | cmd VkResult vkCreateBufferView( |
| 3100 | VkDevice device, |
| 3101 | const VkBufferViewCreateInfo* pCreateInfo, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 3102 | const VkAllocCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3103 | VkBufferView* pView) { |
| 3104 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO) |
| 3105 | deviceObject := GetDevice(device) |
| 3106 | |
| 3107 | bufferObject := GetBuffer(pCreateInfo.buffer) |
| 3108 | assert(bufferObject.device == device) |
| 3109 | |
| 3110 | view := ? |
| 3111 | pView[0] = view |
| 3112 | State.BufferViews[view] = new!BufferViewObject(device: device, buffer: pCreateInfo.buffer) |
| 3113 | |
| 3114 | return ? |
| 3115 | } |
| 3116 | |
| 3117 | @threadSafety("system") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3118 | cmd void vkDestroyBufferView( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3119 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 3120 | VkBufferView bufferView, |
| 3121 | const VkAllocCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3122 | deviceObject := GetDevice(device) |
| 3123 | bufferViewObject := GetBufferView(bufferView) |
| 3124 | assert(bufferViewObject.device == device) |
| 3125 | |
| 3126 | State.BufferViews[bufferView] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3127 | } |
| 3128 | |
| 3129 | |
| 3130 | // Image functions |
| 3131 | |
| 3132 | @threadSafety("system") |
| 3133 | cmd VkResult vkCreateImage( |
| 3134 | VkDevice device, |
| 3135 | const VkImageCreateInfo* pCreateInfo, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 3136 | const VkAllocCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3137 | VkImage* pImage) { |
| 3138 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO) |
| 3139 | deviceObject := GetDevice(device) |
| 3140 | |
| 3141 | image := ? |
| 3142 | pImage[0] = image |
| 3143 | State.Images[image] = new!ImageObject(device: device) |
| 3144 | |
| 3145 | return ? |
| 3146 | } |
| 3147 | |
| 3148 | @threadSafety("system") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3149 | cmd void vkDestroyImage( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3150 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 3151 | VkImage image, |
| 3152 | const VkAllocCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3153 | deviceObject := GetDevice(device) |
| 3154 | imageObject := GetImage(image) |
| 3155 | assert(imageObject.device == device) |
| 3156 | |
| 3157 | assert(imageObject.mem == 0) |
| 3158 | State.Images[image] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3159 | } |
| 3160 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 3161 | cmd void vkGetImageSubresourceLayout( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3162 | VkDevice device, |
| 3163 | VkImage image, |
| 3164 | const VkImageSubresource* pSubresource, |
| 3165 | VkSubresourceLayout* pLayout) { |
| 3166 | deviceObject := GetDevice(device) |
| 3167 | imageObject := GetImage(image) |
| 3168 | assert(imageObject.device == device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3169 | } |
| 3170 | |
| 3171 | |
| 3172 | // Image view functions |
| 3173 | |
| 3174 | @threadSafety("system") |
| 3175 | cmd VkResult vkCreateImageView( |
| 3176 | VkDevice device, |
| 3177 | const VkImageViewCreateInfo* pCreateInfo, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 3178 | const VkAllocCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3179 | VkImageView* pView) { |
| 3180 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO) |
| 3181 | deviceObject := GetDevice(device) |
| 3182 | |
| 3183 | imageObject := GetImage(pCreateInfo.image) |
| 3184 | assert(imageObject.device == device) |
| 3185 | |
| 3186 | view := ? |
| 3187 | pView[0] = view |
| 3188 | State.ImageViews[view] = new!ImageViewObject(device: device, image: pCreateInfo.image) |
| 3189 | |
| 3190 | return ? |
| 3191 | } |
| 3192 | |
| 3193 | @threadSafety("system") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3194 | cmd void vkDestroyImageView( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3195 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 3196 | VkImageView imageView, |
| 3197 | const VkAllocCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3198 | deviceObject := GetDevice(device) |
| 3199 | imageViewObject := GetImageView(imageView) |
| 3200 | assert(imageViewObject.device == device) |
| 3201 | |
| 3202 | State.ImageViews[imageView] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3203 | } |
| 3204 | |
| 3205 | |
| 3206 | // Shader functions |
| 3207 | |
| 3208 | cmd VkResult vkCreateShaderModule( |
| 3209 | VkDevice device, |
| 3210 | const VkShaderModuleCreateInfo* pCreateInfo, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 3211 | const VkAllocCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3212 | VkShaderModule* pShaderModule) { |
| 3213 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO) |
| 3214 | deviceObject := GetDevice(device) |
| 3215 | |
| 3216 | shaderModule := ? |
| 3217 | pShaderModule[0] = shaderModule |
| 3218 | State.ShaderModules[shaderModule] = new!ShaderModuleObject(device: device) |
| 3219 | |
| 3220 | return ? |
| 3221 | } |
| 3222 | |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3223 | cmd void vkDestroyShaderModule( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3224 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 3225 | VkShaderModule shaderModule, |
| 3226 | const VkAllocCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3227 | deviceObject := GetDevice(device) |
| 3228 | shaderModuleObject := GetShaderModule(shaderModule) |
| 3229 | assert(shaderModuleObject.device == device) |
| 3230 | |
| 3231 | State.ShaderModules[shaderModule] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3232 | } |
| 3233 | |
| 3234 | @threadSafety("system") |
| 3235 | cmd VkResult vkCreateShader( |
| 3236 | VkDevice device, |
| 3237 | const VkShaderCreateInfo* pCreateInfo, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 3238 | const VkAllocCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3239 | VkShader* pShader) { |
| 3240 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SHADER_CREATE_INFO) |
| 3241 | deviceObject := GetDevice(device) |
| 3242 | |
| 3243 | shader := ? |
| 3244 | pShader[0] = shader |
| 3245 | State.Shaders[shader] = new!ShaderObject(device: device) |
| 3246 | |
| 3247 | return ? |
| 3248 | } |
| 3249 | |
| 3250 | @threadSafety("system") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3251 | cmd void vkDestroyShader( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3252 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 3253 | VkShader shader, |
| 3254 | const VkAllocCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3255 | deviceObject := GetDevice(device) |
| 3256 | shaderObject := GetShader(shader) |
| 3257 | assert(shaderObject.device == device) |
| 3258 | |
| 3259 | State.Shaders[shader] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3260 | } |
| 3261 | |
| 3262 | |
| 3263 | // Pipeline functions |
| 3264 | |
| 3265 | cmd VkResult vkCreatePipelineCache( |
| 3266 | VkDevice device, |
| 3267 | const VkPipelineCacheCreateInfo* pCreateInfo, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 3268 | const VkAllocCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3269 | VkPipelineCache* pPipelineCache) { |
| 3270 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO) |
| 3271 | deviceObject := GetDevice(device) |
| 3272 | |
| 3273 | pipelineCache := ? |
| 3274 | pPipelineCache[0] = pipelineCache |
| 3275 | State.PipelineCaches[pipelineCache] = new!PipelineCacheObject(device: device) |
| 3276 | |
| 3277 | return ? |
| 3278 | } |
| 3279 | |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3280 | cmd void vkDestroyPipelineCache( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3281 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 3282 | VkPipelineCache pipelineCache, |
| 3283 | const VkAllocCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3284 | deviceObject := GetDevice(device) |
| 3285 | pipelineCacheObject := GetPipelineCache(pipelineCache) |
| 3286 | assert(pipelineCacheObject.device == device) |
| 3287 | |
| 3288 | State.PipelineCaches[pipelineCache] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3289 | } |
| 3290 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3291 | cmd VkResult vkGetPipelineCacheData( |
| 3292 | VkDevice device, |
| 3293 | VkPipelineCache pipelineCache, |
Jesse Hall | a9bb62b | 2015-11-21 19:31:56 -0800 | [diff] [blame] | 3294 | platform.size_t* pDataSize, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3295 | void* pData) { |
| 3296 | deviceObject := GetDevice(device) |
| 3297 | pipelineCacheObject := GetPipelineCache(pipelineCache) |
| 3298 | assert(pipelineCacheObject.device == device) |
| 3299 | |
| 3300 | return ? |
| 3301 | } |
| 3302 | |
| 3303 | cmd VkResult vkMergePipelineCaches( |
| 3304 | VkDevice device, |
| 3305 | VkPipelineCache destCache, |
| 3306 | u32 srcCacheCount, |
| 3307 | const VkPipelineCache* pSrcCaches) { |
| 3308 | deviceObject := GetDevice(device) |
| 3309 | destCacheObject := GetPipelineCache(destCache) |
| 3310 | assert(destCacheObject.device == device) |
| 3311 | |
| 3312 | srcCaches := pSrcCaches[0:srcCacheCount] |
| 3313 | for i in (0 .. srcCacheCount) { |
| 3314 | srcCache := srcCaches[i] |
| 3315 | srcCacheObject := GetPipelineCache(srcCache) |
| 3316 | assert(srcCacheObject.device == device) |
| 3317 | } |
| 3318 | |
| 3319 | return ? |
| 3320 | } |
| 3321 | |
| 3322 | cmd VkResult vkCreateGraphicsPipelines( |
| 3323 | VkDevice device, |
| 3324 | VkPipelineCache pipelineCache, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 3325 | u32 createInfoCount, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3326 | const VkGraphicsPipelineCreateInfo* pCreateInfos, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 3327 | const VkAllocCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3328 | VkPipeline* pPipelines) { |
| 3329 | deviceObject := GetDevice(device) |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3330 | if pipelineCache != NULL_HANDLE { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3331 | pipelineCacheObject := GetPipelineCache(pipelineCache) |
| 3332 | assert(pipelineCacheObject.device == device) |
| 3333 | } |
| 3334 | |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 3335 | createInfos := pCreateInfos[0:createInfoCount] |
| 3336 | pipelines := pPipelines[0:createInfoCount] |
| 3337 | for i in (0 .. createInfoCount) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3338 | pipeline := ? |
| 3339 | pipelines[i] = pipeline |
| 3340 | State.Pipelines[pipeline] = new!PipelineObject(device: device) |
| 3341 | } |
| 3342 | |
| 3343 | return ? |
| 3344 | } |
| 3345 | |
| 3346 | cmd VkResult vkCreateComputePipelines( |
| 3347 | VkDevice device, |
| 3348 | VkPipelineCache pipelineCache, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 3349 | u32 createInfoCount, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3350 | const VkComputePipelineCreateInfo* pCreateInfos, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 3351 | const VkAllocCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3352 | VkPipeline* pPipelines) { |
| 3353 | deviceObject := GetDevice(device) |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3354 | if pipelineCache != NULL_HANDLE { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3355 | pipelineCacheObject := GetPipelineCache(pipelineCache) |
| 3356 | assert(pipelineCacheObject.device == device) |
| 3357 | } |
| 3358 | |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 3359 | createInfos := pCreateInfos[0:createInfoCount] |
| 3360 | pipelines := pPipelines[0:createInfoCount] |
| 3361 | for i in (0 .. createInfoCount) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3362 | pipeline := ? |
| 3363 | pipelines[i] = pipeline |
| 3364 | State.Pipelines[pipeline] = new!PipelineObject(device: device) |
| 3365 | } |
| 3366 | |
| 3367 | return ? |
| 3368 | } |
| 3369 | |
| 3370 | @threadSafety("system") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3371 | cmd void vkDestroyPipeline( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3372 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 3373 | VkPipeline pipeline, |
| 3374 | const VkAllocCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3375 | deviceObject := GetDevice(device) |
| 3376 | pipelineObjects := GetPipeline(pipeline) |
| 3377 | assert(pipelineObjects.device == device) |
| 3378 | |
| 3379 | State.Pipelines[pipeline] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3380 | } |
| 3381 | |
| 3382 | |
| 3383 | // Pipeline layout functions |
| 3384 | |
| 3385 | @threadSafety("system") |
| 3386 | cmd VkResult vkCreatePipelineLayout( |
| 3387 | VkDevice device, |
| 3388 | const VkPipelineLayoutCreateInfo* pCreateInfo, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 3389 | const VkAllocCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3390 | VkPipelineLayout* pPipelineLayout) { |
| 3391 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO) |
| 3392 | deviceObject := GetDevice(device) |
| 3393 | |
| 3394 | pipelineLayout := ? |
| 3395 | pPipelineLayout[0] = pipelineLayout |
| 3396 | State.PipelineLayouts[pipelineLayout] = new!PipelineLayoutObject(device: device) |
| 3397 | |
| 3398 | return ? |
| 3399 | } |
| 3400 | |
| 3401 | @threadSafety("system") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3402 | cmd void vkDestroyPipelineLayout( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3403 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 3404 | VkPipelineLayout pipelineLayout, |
| 3405 | const VkAllocCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3406 | deviceObject := GetDevice(device) |
| 3407 | pipelineLayoutObjects := GetPipelineLayout(pipelineLayout) |
| 3408 | assert(pipelineLayoutObjects.device == device) |
| 3409 | |
| 3410 | State.PipelineLayouts[pipelineLayout] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3411 | } |
| 3412 | |
| 3413 | |
| 3414 | // Sampler functions |
| 3415 | |
| 3416 | @threadSafety("system") |
| 3417 | cmd VkResult vkCreateSampler( |
| 3418 | VkDevice device, |
| 3419 | const VkSamplerCreateInfo* pCreateInfo, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 3420 | const VkAllocCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3421 | VkSampler* pSampler) { |
| 3422 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO) |
| 3423 | deviceObject := GetDevice(device) |
| 3424 | |
| 3425 | sampler := ? |
| 3426 | pSampler[0] = sampler |
| 3427 | State.Samplers[sampler] = new!SamplerObject(device: device) |
| 3428 | |
| 3429 | return ? |
| 3430 | } |
| 3431 | |
| 3432 | @threadSafety("system") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3433 | cmd void vkDestroySampler( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3434 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 3435 | VkSampler sampler, |
| 3436 | const VkAllocCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3437 | deviceObject := GetDevice(device) |
| 3438 | samplerObject := GetSampler(sampler) |
| 3439 | assert(samplerObject.device == device) |
| 3440 | |
| 3441 | State.Samplers[sampler] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3442 | } |
| 3443 | |
| 3444 | |
| 3445 | // Descriptor set functions |
| 3446 | |
| 3447 | @threadSafety("system") |
| 3448 | cmd VkResult vkCreateDescriptorSetLayout( |
| 3449 | VkDevice device, |
| 3450 | const VkDescriptorSetLayoutCreateInfo* pCreateInfo, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 3451 | const VkAllocCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3452 | VkDescriptorSetLayout* pSetLayout) { |
| 3453 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO) |
| 3454 | deviceObject := GetDevice(device) |
| 3455 | |
| 3456 | setLayout := ? |
| 3457 | pSetLayout[0] = setLayout |
| 3458 | State.DescriptorSetLayouts[setLayout] = new!DescriptorSetLayoutObject(device: device) |
| 3459 | |
| 3460 | return ? |
| 3461 | } |
| 3462 | |
| 3463 | @threadSafety("system") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3464 | cmd void vkDestroyDescriptorSetLayout( |
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 | VkDescriptorSetLayout descriptorSetLayout, |
| 3467 | const VkAllocCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3468 | deviceObject := GetDevice(device) |
| 3469 | descriptorSetLayoutObject := GetDescriptorSetLayout(descriptorSetLayout) |
| 3470 | assert(descriptorSetLayoutObject.device == device) |
| 3471 | |
| 3472 | State.DescriptorSetLayouts[descriptorSetLayout] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3473 | } |
| 3474 | |
| 3475 | @threadSafety("system") |
| 3476 | cmd VkResult vkCreateDescriptorPool( |
| 3477 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 3478 | const VkDescriptorPoolCreateInfo* pCreateInfo, |
| 3479 | const VkAllocCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3480 | VkDescriptorPool* pDescriptorPool) { |
| 3481 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO) |
| 3482 | deviceObject := GetDevice(device) |
| 3483 | |
| 3484 | descriptorPool := ? |
| 3485 | pDescriptorPool[0] = descriptorPool |
| 3486 | State.DescriptorPools[descriptorPool] = new!DescriptorPoolObject(device: device) |
| 3487 | |
| 3488 | return ? |
| 3489 | } |
| 3490 | |
| 3491 | @threadSafety("system") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3492 | cmd void vkDestroyDescriptorPool( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3493 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 3494 | VkDescriptorPool descriptorPool, |
| 3495 | const VkAllocCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3496 | deviceObject := GetDevice(device) |
| 3497 | descriptorPoolObject := GetDescriptorPool(descriptorPool) |
| 3498 | assert(descriptorPoolObject.device == device) |
| 3499 | |
| 3500 | State.DescriptorPools[descriptorPool] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3501 | } |
| 3502 | |
| 3503 | @threadSafety("app") |
| 3504 | cmd VkResult vkResetDescriptorPool( |
| 3505 | VkDevice device, |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 3506 | VkDescriptorPool descriptorPool, |
| 3507 | VkDescriptorPoolResetFlags flags) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3508 | deviceObject := GetDevice(device) |
| 3509 | descriptorPoolObject := GetDescriptorPool(descriptorPool) |
| 3510 | assert(descriptorPoolObject.device == device) |
| 3511 | |
| 3512 | return ? |
| 3513 | } |
| 3514 | |
| 3515 | @threadSafety("app") |
| 3516 | cmd VkResult vkAllocDescriptorSets( |
| 3517 | VkDevice device, |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 3518 | const VkDescriptorSetAllocInfo* pAllocInfo, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3519 | VkDescriptorSet* pDescriptorSets) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3520 | deviceObject := GetDevice(device) |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 3521 | allocInfo := pAllocInfo[0] |
| 3522 | descriptorPoolObject := GetDescriptorPool(allocInfo.descriptorPool) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3523 | |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 3524 | setLayouts := allocInfo.pSetLayouts[0:allocInfo.setCount] |
| 3525 | for i in (0 .. allocInfo.setCount) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3526 | setLayout := setLayouts[i] |
| 3527 | setLayoutObject := GetDescriptorSetLayout(setLayout) |
| 3528 | assert(setLayoutObject.device == device) |
| 3529 | } |
| 3530 | |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 3531 | descriptorSets := pDescriptorSets[0:allocInfo.setCount] |
| 3532 | for i in (0 .. allocInfo.setCount) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3533 | descriptorSet := ? |
| 3534 | descriptorSets[i] = descriptorSet |
| 3535 | State.DescriptorSets[descriptorSet] = new!DescriptorSetObject(device: device) |
| 3536 | } |
| 3537 | |
| 3538 | return ? |
| 3539 | } |
| 3540 | |
Jesse Hall | f09c6b1 | 2015-08-15 19:54:28 -0700 | [diff] [blame] | 3541 | cmd VkResult vkFreeDescriptorSets( |
| 3542 | VkDevice device, |
| 3543 | VkDescriptorPool descriptorPool, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 3544 | u32 descriptorSetCount, |
Jesse Hall | f09c6b1 | 2015-08-15 19:54:28 -0700 | [diff] [blame] | 3545 | const VkDescriptorSet* pDescriptorSets) { |
| 3546 | deviceObject := GetDevice(device) |
| 3547 | descriptorPoolObject := GetDescriptorPool(descriptorPool) |
| 3548 | |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 3549 | descriptorSets := pDescriptorSets[0:descriptorSetCount] |
| 3550 | for i in (0 .. descriptorSetCount) { |
Jesse Hall | f09c6b1 | 2015-08-15 19:54:28 -0700 | [diff] [blame] | 3551 | descriptorSet := descriptorSets[i] |
| 3552 | descriptorSetObject := GetDescriptorSet(descriptorSet) |
| 3553 | assert(descriptorSetObject.device == device) |
| 3554 | State.DescriptorSets[descriptorSet] = null |
| 3555 | } |
| 3556 | |
| 3557 | return ? |
| 3558 | } |
| 3559 | |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3560 | cmd void vkUpdateDescriptorSets( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3561 | VkDevice device, |
| 3562 | u32 writeCount, |
| 3563 | const VkWriteDescriptorSet* pDescriptorWrites, |
| 3564 | u32 copyCount, |
| 3565 | const VkCopyDescriptorSet* pDescriptorCopies) { |
| 3566 | deviceObject := GetDevice(device) |
| 3567 | |
| 3568 | descriptorWrites := pDescriptorWrites[0:writeCount] |
| 3569 | for i in (0 .. writeCount) { |
| 3570 | descriptorWrite := descriptorWrites[i] |
| 3571 | descriptorWriteObject := GetDescriptorSet(descriptorWrite.destSet) |
| 3572 | assert(descriptorWriteObject.device == device) |
| 3573 | } |
| 3574 | |
| 3575 | descriptorCopies := pDescriptorCopies[0:copyCount] |
| 3576 | for i in (0 .. copyCount) { |
| 3577 | descriptorCopy := descriptorCopies[i] |
| 3578 | descriptorCopyObject := GetDescriptorSet(descriptorCopy.destSet) |
| 3579 | assert(descriptorCopyObject.device == device) |
| 3580 | } |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3581 | } |
| 3582 | |
| 3583 | |
| 3584 | // Framebuffer functions |
| 3585 | |
| 3586 | @threadSafety("system") |
| 3587 | cmd VkResult vkCreateFramebuffer( |
| 3588 | VkDevice device, |
| 3589 | const VkFramebufferCreateInfo* pCreateInfo, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 3590 | const VkAllocCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3591 | VkFramebuffer* pFramebuffer) { |
| 3592 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO) |
| 3593 | deviceObject := GetDevice(device) |
| 3594 | |
| 3595 | framebuffer := ? |
| 3596 | pFramebuffer[0] = framebuffer |
| 3597 | State.Framebuffers[framebuffer] = new!FramebufferObject(device: device) |
| 3598 | |
| 3599 | return ? |
| 3600 | } |
| 3601 | |
| 3602 | @threadSafety("system") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3603 | cmd void vkDestroyFramebuffer( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3604 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 3605 | VkFramebuffer framebuffer, |
| 3606 | const VkAllocCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3607 | deviceObject := GetDevice(device) |
| 3608 | framebufferObject := GetFramebuffer(framebuffer) |
| 3609 | assert(framebufferObject.device == device) |
| 3610 | |
| 3611 | State.Framebuffers[framebuffer] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3612 | } |
| 3613 | |
| 3614 | |
| 3615 | // Renderpass functions |
| 3616 | |
| 3617 | @threadSafety("system") |
| 3618 | cmd VkResult vkCreateRenderPass( |
| 3619 | VkDevice device, |
| 3620 | const VkRenderPassCreateInfo* pCreateInfo, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 3621 | const VkAllocCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3622 | VkRenderPass* pRenderPass) { |
| 3623 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO) |
| 3624 | deviceObject := GetDevice(device) |
| 3625 | |
| 3626 | renderpass := ? |
| 3627 | pRenderPass[0] = renderpass |
| 3628 | State.RenderPasses[renderpass] = new!RenderPassObject(device: device) |
| 3629 | |
| 3630 | return ? |
| 3631 | } |
| 3632 | |
| 3633 | @threadSafety("system") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3634 | cmd void vkDestroyRenderPass( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3635 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 3636 | VkRenderPass renderPass, |
| 3637 | const VkAllocCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3638 | deviceObject := GetDevice(device) |
| 3639 | renderPassObject := GetRenderPass(renderPass) |
| 3640 | assert(renderPassObject.device == device) |
| 3641 | |
| 3642 | State.RenderPasses[renderPass] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3643 | } |
| 3644 | |
Jesse Hall | 606a54e | 2015-11-19 22:17:28 -0800 | [diff] [blame] | 3645 | cmd void vkGetRenderAreaGranularity( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3646 | VkDevice device, |
| 3647 | VkRenderPass renderPass, |
| 3648 | VkExtent2D* pGranularity) { |
| 3649 | deviceObject := GetDevice(device) |
| 3650 | renderPassObject := GetRenderPass(renderPass) |
| 3651 | |
| 3652 | granularity := ? |
| 3653 | pGranularity[0] = granularity |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3654 | } |
| 3655 | |
| 3656 | // Command pool functions |
| 3657 | |
| 3658 | cmd VkResult vkCreateCommandPool( |
| 3659 | VkDevice device, |
| 3660 | const VkCmdPoolCreateInfo* pCreateInfo, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 3661 | const VkAllocCallbacks* pAllocator, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3662 | VkCmdPool* pCmdPool) { |
| 3663 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_CMD_POOL_CREATE_INFO) |
| 3664 | deviceObject := GetDevice(device) |
| 3665 | |
| 3666 | cmdPool := ? |
| 3667 | pCmdPool[0] = cmdPool |
| 3668 | State.CmdPools[cmdPool] = new!CmdPoolObject(device: device) |
| 3669 | |
| 3670 | return ? |
| 3671 | } |
| 3672 | |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3673 | cmd void vkDestroyCommandPool( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3674 | VkDevice device, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 3675 | VkCmdPool cmdPool, |
| 3676 | const VkAllocCallbacks* pAllocator) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3677 | deviceObject := GetDevice(device) |
| 3678 | cmdPoolObject := GetCmdPool(cmdPool) |
| 3679 | assert(cmdPoolObject.device == device) |
| 3680 | |
| 3681 | State.CmdPools[cmdPool] = null |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3682 | } |
| 3683 | |
| 3684 | cmd VkResult vkResetCommandPool( |
| 3685 | VkDevice device, |
| 3686 | VkCmdPool cmdPool, |
| 3687 | VkCmdPoolResetFlags flags) { |
| 3688 | deviceObject := GetDevice(device) |
| 3689 | cmdPoolObject := GetCmdPool(cmdPool) |
| 3690 | assert(cmdPoolObject.device == device) |
| 3691 | |
| 3692 | return ? |
| 3693 | } |
| 3694 | |
| 3695 | // Command buffer functions |
| 3696 | |
| 3697 | macro void bindCmdBuffer(VkCmdBuffer cmdBuffer, any obj, VkDeviceMemory mem) { |
| 3698 | memoryObject := GetDeviceMemory(mem) |
| 3699 | memoryObject.boundCommandBuffers[cmdBuffer] = cmdBuffer |
| 3700 | |
| 3701 | cmdBufferObject := GetCmdBuffer(cmdBuffer) |
| 3702 | cmdBufferObject.boundObjects[as!u64(obj)] = mem |
| 3703 | } |
| 3704 | |
| 3705 | macro void unbindCmdBuffer(VkCmdBuffer cmdBuffer, any obj, VkDeviceMemory mem) { |
| 3706 | memoryObject := GetDeviceMemory(mem) |
| 3707 | memoryObject.boundCommandBuffers[cmdBuffer] = null |
| 3708 | |
| 3709 | cmdBufferObject := GetCmdBuffer(cmdBuffer) |
| 3710 | cmdBufferObject.boundObjects[as!u64(obj)] = null |
| 3711 | } |
| 3712 | |
| 3713 | @threadSafety("system") |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 3714 | cmd VkResult vkAllocCommandBuffers( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3715 | VkDevice device, |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 3716 | const VkCmdBufferAllocInfo* pAllocInfo, |
| 3717 | VkCmdBuffer* pCmdBuffers) { |
| 3718 | assert(pAllocInfo[0].sType == VK_STRUCTURE_TYPE_CMD_BUFFER_ALLOC_INFO) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3719 | |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 3720 | count := pAllocInfo[0].bufferCount |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 3721 | cmdBuffers := pCmdBuffers[0:count] |
| 3722 | for i in (0 .. count) { |
| 3723 | cmdBuffer := ? |
| 3724 | cmdBuffers[i] = cmdBuffer |
| 3725 | State.CmdBuffers[cmdBuffer] = new!CmdBufferObject(device: device) |
| 3726 | } |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3727 | |
| 3728 | return ? |
| 3729 | } |
| 3730 | |
| 3731 | @threadSafety("system") |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 3732 | cmd void vkFreeCommandBuffers( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3733 | VkDevice device, |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 3734 | VkCmdPool cmdPool, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 3735 | u32 commandBufferCount, |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 3736 | const VkCmdBuffer* pCommandBuffers) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3737 | deviceObject := GetDevice(device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3738 | |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 3739 | cmdBuffers := pCommandBuffers[0:commandBufferCount] |
| 3740 | for i in (0 .. commandBufferCount) { |
Jesse Hall | fbf97b0 | 2015-11-20 14:17:03 -0800 | [diff] [blame] | 3741 | cmdBufferObject := GetCmdBuffer(cmdBuffers[i]) |
| 3742 | assert(cmdBufferObject.device == device) |
| 3743 | // TODO: iterate over boundObjects and clear memory bindings |
| 3744 | State.CmdBuffers[cmdBuffers[i]] = null |
| 3745 | } |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3746 | } |
| 3747 | |
| 3748 | @threadSafety("app") |
| 3749 | cmd VkResult vkBeginCommandBuffer( |
| 3750 | VkCmdBuffer cmdBuffer, |
| 3751 | const VkCmdBufferBeginInfo* pBeginInfo) { |
| 3752 | assert(pBeginInfo.sType == VK_STRUCTURE_TYPE_CMD_BUFFER_BEGIN_INFO) |
| 3753 | cmdBufferObject := GetCmdBuffer(cmdBuffer) |
| 3754 | |
| 3755 | // TODO: iterate over boundObjects and clear memory bindings |
| 3756 | |
| 3757 | return ? |
| 3758 | } |
| 3759 | |
| 3760 | @threadSafety("app") |
| 3761 | cmd VkResult vkEndCommandBuffer( |
| 3762 | VkCmdBuffer cmdBuffer) { |
| 3763 | cmdBufferObject := GetCmdBuffer(cmdBuffer) |
| 3764 | |
| 3765 | return ? |
| 3766 | } |
| 3767 | |
| 3768 | @threadSafety("app") |
| 3769 | cmd VkResult vkResetCommandBuffer( |
| 3770 | VkCmdBuffer cmdBuffer, |
| 3771 | VkCmdBufferResetFlags flags) { |
| 3772 | cmdBufferObject := GetCmdBuffer(cmdBuffer) |
| 3773 | |
| 3774 | // TODO: iterate over boundObjects and clear memory bindings |
| 3775 | |
| 3776 | return ? |
| 3777 | } |
| 3778 | |
| 3779 | |
| 3780 | // Command buffer building functions |
| 3781 | |
| 3782 | @threadSafety("app") |
| 3783 | cmd void vkCmdBindPipeline( |
| 3784 | VkCmdBuffer cmdBuffer, |
| 3785 | VkPipelineBindPoint pipelineBindPoint, |
| 3786 | VkPipeline pipeline) { |
| 3787 | cmdBufferObject := GetCmdBuffer(cmdBuffer) |
| 3788 | pipelineObject := GetPipeline(pipeline) |
| 3789 | assert(cmdBufferObject.device == pipelineObject.device) |
| 3790 | |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 3791 | queue := switch (pipelineBindPoint) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3792 | case VK_PIPELINE_BIND_POINT_COMPUTE: VK_QUEUE_COMPUTE_BIT |
| 3793 | case VK_PIPELINE_BIND_POINT_GRAPHICS: VK_QUEUE_GRAPHICS_BIT |
| 3794 | } |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 3795 | cmdBufferObject.queueFlags = AddQueueFlag(cmdBufferObject.queueFlags, queue) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3796 | } |
| 3797 | |
| 3798 | @threadSafety("app") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3799 | cmd void vkCmdSetViewport( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3800 | VkCmdBuffer cmdBuffer, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3801 | u32 viewportCount, |
| 3802 | const VkViewport* pViewports) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3803 | cmdBufferObject := GetCmdBuffer(cmdBuffer) |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 3804 | cmdBufferObject.queueFlags = AddQueueFlag(cmdBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3805 | } |
| 3806 | |
| 3807 | @threadSafety("app") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3808 | cmd void vkCmdSetScissor( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3809 | VkCmdBuffer cmdBuffer, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3810 | u32 scissorCount, |
| 3811 | const VkRect2D* pScissors) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3812 | cmdBufferObject := GetCmdBuffer(cmdBuffer) |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 3813 | cmdBufferObject.queueFlags = AddQueueFlag(cmdBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3814 | } |
| 3815 | |
| 3816 | @threadSafety("app") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3817 | cmd void vkCmdSetLineWidth( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3818 | VkCmdBuffer cmdBuffer, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3819 | f32 lineWidth) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3820 | cmdBufferObject := GetCmdBuffer(cmdBuffer) |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 3821 | cmdBufferObject.queueFlags = AddQueueFlag(cmdBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3822 | } |
| 3823 | |
| 3824 | @threadSafety("app") |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3825 | cmd void vkCmdSetDepthBias( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3826 | VkCmdBuffer cmdBuffer, |
Jesse Hall | a9bb62b | 2015-11-21 19:31:56 -0800 | [diff] [blame] | 3827 | f32 depthBiasConstantFactor, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3828 | f32 depthBiasClamp, |
Jesse Hall | a9bb62b | 2015-11-21 19:31:56 -0800 | [diff] [blame] | 3829 | f32 depthBiasSlopeFactor) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3830 | cmdBufferObject := GetCmdBuffer(cmdBuffer) |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 3831 | cmdBufferObject.queueFlags = AddQueueFlag(cmdBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3832 | } |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3833 | |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3834 | @threadSafety("app") |
| 3835 | cmd void vkCmdSetBlendConstants( |
| 3836 | VkCmdBuffer cmdBuffer, |
| 3837 | // TODO(jessehall): apic only supports 'const' on pointer types. Using |
| 3838 | // an annotation as a quick hack to pass this to the template without |
| 3839 | // having to modify the AST and semantic model. |
| 3840 | @readonly f32[4] blendConst) { |
| 3841 | cmdBufferObject := GetCmdBuffer(cmdBuffer) |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 3842 | cmdBufferObject.queueFlags = AddQueueFlag(cmdBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3843 | } |
| 3844 | |
| 3845 | @threadSafety("app") |
| 3846 | cmd void vkCmdSetDepthBounds( |
| 3847 | VkCmdBuffer cmdBuffer, |
| 3848 | f32 minDepthBounds, |
| 3849 | f32 maxDepthBounds) { |
| 3850 | cmdBufferObject := GetCmdBuffer(cmdBuffer) |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 3851 | cmdBufferObject.queueFlags = AddQueueFlag(cmdBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3852 | } |
| 3853 | |
| 3854 | @threadSafety("app") |
| 3855 | cmd void vkCmdSetStencilCompareMask( |
| 3856 | VkCmdBuffer cmdBuffer, |
| 3857 | VkStencilFaceFlags faceMask, |
| 3858 | u32 stencilCompareMask) { |
| 3859 | cmdBufferObject := GetCmdBuffer(cmdBuffer) |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 3860 | cmdBufferObject.queueFlags = AddQueueFlag(cmdBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3861 | } |
| 3862 | |
| 3863 | @threadSafety("app") |
| 3864 | cmd void vkCmdSetStencilWriteMask( |
| 3865 | VkCmdBuffer cmdBuffer, |
| 3866 | VkStencilFaceFlags faceMask, |
| 3867 | u32 stencilWriteMask) { |
| 3868 | cmdBufferObject := GetCmdBuffer(cmdBuffer) |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 3869 | cmdBufferObject.queueFlags = AddQueueFlag(cmdBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3870 | } |
| 3871 | |
| 3872 | @threadSafety("app") |
| 3873 | cmd void vkCmdSetStencilReference( |
| 3874 | VkCmdBuffer cmdBuffer, |
| 3875 | VkStencilFaceFlags faceMask, |
| 3876 | u32 stencilReference) { |
| 3877 | cmdBufferObject := GetCmdBuffer(cmdBuffer) |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 3878 | cmdBufferObject.queueFlags = AddQueueFlag(cmdBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3879 | } |
| 3880 | |
| 3881 | @threadSafety("app") |
| 3882 | cmd void vkCmdBindDescriptorSets( |
| 3883 | VkCmdBuffer cmdBuffer, |
| 3884 | VkPipelineBindPoint pipelineBindPoint, |
| 3885 | VkPipelineLayout layout, |
| 3886 | u32 firstSet, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 3887 | u32 descriptorSetCount, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3888 | const VkDescriptorSet* pDescriptorSets, |
| 3889 | u32 dynamicOffsetCount, |
| 3890 | const u32* pDynamicOffsets) { |
| 3891 | cmdBufferObject := GetCmdBuffer(cmdBuffer) |
| 3892 | |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 3893 | descriptorSets := pDescriptorSets[0:descriptorSetCount] |
| 3894 | for i in (0 .. descriptorSetCount) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3895 | descriptorSet := descriptorSets[i] |
| 3896 | descriptorSetObject := GetDescriptorSet(descriptorSet) |
| 3897 | assert(cmdBufferObject.device == descriptorSetObject.device) |
| 3898 | } |
| 3899 | |
| 3900 | dynamicOffsets := pDynamicOffsets[0:dynamicOffsetCount] |
| 3901 | for i in (0 .. dynamicOffsetCount) { |
| 3902 | dynamicOffset := dynamicOffsets[i] |
| 3903 | } |
| 3904 | |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 3905 | queue := switch (pipelineBindPoint) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3906 | case VK_PIPELINE_BIND_POINT_COMPUTE: VK_QUEUE_COMPUTE_BIT |
| 3907 | case VK_PIPELINE_BIND_POINT_GRAPHICS: VK_QUEUE_GRAPHICS_BIT |
| 3908 | } |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 3909 | cmdBufferObject.queueFlags = AddQueueFlag(cmdBufferObject.queueFlags, queue) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3910 | } |
| 3911 | |
| 3912 | @threadSafety("app") |
| 3913 | cmd void vkCmdBindIndexBuffer( |
| 3914 | VkCmdBuffer cmdBuffer, |
| 3915 | VkBuffer buffer, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3916 | VkDeviceSize offset, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3917 | VkIndexType indexType) { |
| 3918 | cmdBufferObject := GetCmdBuffer(cmdBuffer) |
| 3919 | bufferObject := GetBuffer(buffer) |
| 3920 | assert(cmdBufferObject.device == bufferObject.device) |
| 3921 | |
| 3922 | bindCmdBuffer(cmdBuffer, buffer, bufferObject.mem) |
| 3923 | |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 3924 | cmdBufferObject.queueFlags = AddQueueFlag(cmdBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3925 | } |
| 3926 | |
| 3927 | @threadSafety("app") |
| 3928 | cmd void vkCmdBindVertexBuffers( |
| 3929 | VkCmdBuffer cmdBuffer, |
| 3930 | u32 startBinding, |
| 3931 | u32 bindingCount, |
| 3932 | const VkBuffer* pBuffers, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3933 | const VkDeviceSize* pOffsets) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3934 | cmdBufferObject := GetCmdBuffer(cmdBuffer) |
| 3935 | |
| 3936 | // TODO: check if not [startBinding:startBinding+bindingCount] |
| 3937 | buffers := pBuffers[0:bindingCount] |
| 3938 | offsets := pOffsets[0:bindingCount] |
| 3939 | for i in (0 .. bindingCount) { |
| 3940 | buffer := buffers[i] |
| 3941 | offset := offsets[i] |
| 3942 | bufferObject := GetBuffer(buffer) |
| 3943 | assert(cmdBufferObject.device == bufferObject.device) |
| 3944 | |
| 3945 | bindCmdBuffer(cmdBuffer, buffer, bufferObject.mem) |
| 3946 | } |
| 3947 | |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 3948 | cmdBufferObject.queueFlags = AddQueueFlag(cmdBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3949 | } |
| 3950 | |
| 3951 | @threadSafety("app") |
| 3952 | cmd void vkCmdDraw( |
| 3953 | VkCmdBuffer cmdBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3954 | u32 vertexCount, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3955 | u32 instanceCount, |
| 3956 | u32 firstVertex, |
| 3957 | u32 firstInstance) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3958 | cmdBufferObject := GetCmdBuffer(cmdBuffer) |
| 3959 | |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 3960 | cmdBufferObject.queueFlags = AddQueueFlag(cmdBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3961 | } |
| 3962 | |
| 3963 | @threadSafety("app") |
| 3964 | cmd void vkCmdDrawIndexed( |
| 3965 | VkCmdBuffer cmdBuffer, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3966 | u32 indexCount, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3967 | u32 instanceCount, |
| 3968 | u32 firstIndex, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3969 | s32 vertexOffset, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3970 | u32 firstInstance) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3971 | cmdBufferObject := GetCmdBuffer(cmdBuffer) |
| 3972 | |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 3973 | cmdBufferObject.queueFlags = AddQueueFlag(cmdBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3974 | } |
| 3975 | |
| 3976 | @threadSafety("app") |
| 3977 | cmd void vkCmdDrawIndirect( |
| 3978 | VkCmdBuffer cmdBuffer, |
| 3979 | VkBuffer buffer, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3980 | VkDeviceSize offset, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 3981 | u32 drawCount, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3982 | u32 stride) { |
| 3983 | cmdBufferObject := GetCmdBuffer(cmdBuffer) |
| 3984 | bufferObject := GetBuffer(buffer) |
| 3985 | assert(cmdBufferObject.device == bufferObject.device) |
| 3986 | |
| 3987 | bindCmdBuffer(cmdBuffer, buffer, bufferObject.mem) |
| 3988 | |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 3989 | cmdBufferObject.queueFlags = AddQueueFlag(cmdBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3990 | } |
| 3991 | |
| 3992 | @threadSafety("app") |
| 3993 | cmd void vkCmdDrawIndexedIndirect( |
| 3994 | VkCmdBuffer cmdBuffer, |
| 3995 | VkBuffer buffer, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 3996 | VkDeviceSize offset, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 3997 | u32 drawCount, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 3998 | u32 stride) { |
| 3999 | cmdBufferObject := GetCmdBuffer(cmdBuffer) |
| 4000 | bufferObject := GetBuffer(buffer) |
| 4001 | assert(cmdBufferObject.device == bufferObject.device) |
| 4002 | |
| 4003 | bindCmdBuffer(cmdBuffer, buffer, bufferObject.mem) |
| 4004 | |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 4005 | cmdBufferObject.queueFlags = AddQueueFlag(cmdBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4006 | } |
| 4007 | |
| 4008 | @threadSafety("app") |
| 4009 | cmd void vkCmdDispatch( |
| 4010 | VkCmdBuffer cmdBuffer, |
| 4011 | u32 x, |
| 4012 | u32 y, |
| 4013 | u32 z) { |
| 4014 | cmdBufferObject := GetCmdBuffer(cmdBuffer) |
| 4015 | |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 4016 | cmdBufferObject.queueFlags = AddQueueFlag(cmdBufferObject.queueFlags, VK_QUEUE_COMPUTE_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4017 | } |
| 4018 | |
| 4019 | @threadSafety("app") |
| 4020 | cmd void vkCmdDispatchIndirect( |
| 4021 | VkCmdBuffer cmdBuffer, |
| 4022 | VkBuffer buffer, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4023 | VkDeviceSize offset) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4024 | cmdBufferObject := GetCmdBuffer(cmdBuffer) |
| 4025 | bufferObject := GetBuffer(buffer) |
| 4026 | assert(cmdBufferObject.device == bufferObject.device) |
| 4027 | |
| 4028 | bindCmdBuffer(cmdBuffer, buffer, bufferObject.mem) |
| 4029 | |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 4030 | cmdBufferObject.queueFlags = AddQueueFlag(cmdBufferObject.queueFlags, VK_QUEUE_COMPUTE_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4031 | } |
| 4032 | |
| 4033 | @threadSafety("app") |
| 4034 | cmd void vkCmdCopyBuffer( |
| 4035 | VkCmdBuffer cmdBuffer, |
| 4036 | VkBuffer srcBuffer, |
| 4037 | VkBuffer destBuffer, |
| 4038 | u32 regionCount, |
| 4039 | const VkBufferCopy* pRegions) { |
| 4040 | cmdBufferObject := GetCmdBuffer(cmdBuffer) |
| 4041 | srcBufferObject := GetBuffer(srcBuffer) |
| 4042 | destBufferObject := GetBuffer(destBuffer) |
| 4043 | assert(cmdBufferObject.device == srcBufferObject.device) |
| 4044 | assert(cmdBufferObject.device == destBufferObject.device) |
| 4045 | |
| 4046 | regions := pRegions[0:regionCount] |
| 4047 | for i in (0 .. regionCount) { |
| 4048 | region := regions[i] |
| 4049 | } |
| 4050 | |
| 4051 | bindCmdBuffer(cmdBuffer, srcBuffer, srcBufferObject.mem) |
| 4052 | bindCmdBuffer(cmdBuffer, destBuffer, destBufferObject.mem) |
| 4053 | |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 4054 | cmdBufferObject.queueFlags = AddQueueFlag(cmdBufferObject.queueFlags, VK_QUEUE_DMA_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4055 | } |
| 4056 | |
| 4057 | @threadSafety("app") |
| 4058 | cmd void vkCmdCopyImage( |
| 4059 | VkCmdBuffer cmdBuffer, |
| 4060 | VkImage srcImage, |
| 4061 | VkImageLayout srcImageLayout, |
| 4062 | VkImage destImage, |
| 4063 | VkImageLayout destImageLayout, |
| 4064 | u32 regionCount, |
| 4065 | const VkImageCopy* pRegions) { |
| 4066 | cmdBufferObject := GetCmdBuffer(cmdBuffer) |
| 4067 | srcImageObject := GetImage(srcImage) |
| 4068 | destImageObject := GetImage(destImage) |
| 4069 | assert(cmdBufferObject.device == srcImageObject.device) |
| 4070 | assert(cmdBufferObject.device == destImageObject.device) |
| 4071 | |
| 4072 | regions := pRegions[0:regionCount] |
| 4073 | for i in (0 .. regionCount) { |
| 4074 | region := regions[i] |
| 4075 | } |
| 4076 | |
| 4077 | bindCmdBuffer(cmdBuffer, srcImage, srcImageObject.mem) |
| 4078 | bindCmdBuffer(cmdBuffer, destImage, destImageObject.mem) |
| 4079 | |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 4080 | cmdBufferObject.queueFlags = AddQueueFlag(cmdBufferObject.queueFlags, VK_QUEUE_DMA_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4081 | } |
| 4082 | |
| 4083 | @threadSafety("app") |
| 4084 | cmd void vkCmdBlitImage( |
| 4085 | VkCmdBuffer cmdBuffer, |
| 4086 | VkImage srcImage, |
| 4087 | VkImageLayout srcImageLayout, |
| 4088 | VkImage destImage, |
| 4089 | VkImageLayout destImageLayout, |
| 4090 | u32 regionCount, |
| 4091 | const VkImageBlit* pRegions, |
| 4092 | VkTexFilter filter) { |
| 4093 | cmdBufferObject := GetCmdBuffer(cmdBuffer) |
| 4094 | srcImageObject := GetImage(srcImage) |
| 4095 | destImageObject := GetImage(destImage) |
| 4096 | assert(cmdBufferObject.device == srcImageObject.device) |
| 4097 | assert(cmdBufferObject.device == destImageObject.device) |
| 4098 | |
| 4099 | regions := pRegions[0:regionCount] |
| 4100 | for i in (0 .. regionCount) { |
| 4101 | region := regions[i] |
| 4102 | } |
| 4103 | |
| 4104 | bindCmdBuffer(cmdBuffer, srcImage, srcImageObject.mem) |
| 4105 | bindCmdBuffer(cmdBuffer, destImage, destImageObject.mem) |
| 4106 | |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 4107 | cmdBufferObject.queueFlags = AddQueueFlag(cmdBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4108 | } |
| 4109 | |
| 4110 | @threadSafety("app") |
| 4111 | cmd void vkCmdCopyBufferToImage( |
| 4112 | VkCmdBuffer cmdBuffer, |
| 4113 | VkBuffer srcBuffer, |
| 4114 | VkImage destImage, |
| 4115 | VkImageLayout destImageLayout, |
| 4116 | u32 regionCount, |
| 4117 | const VkBufferImageCopy* pRegions) { |
| 4118 | cmdBufferObject := GetCmdBuffer(cmdBuffer) |
| 4119 | srcBufferObject := GetBuffer(srcBuffer) |
| 4120 | destImageObject := GetImage(destImage) |
| 4121 | assert(cmdBufferObject.device == srcBufferObject.device) |
| 4122 | assert(cmdBufferObject.device == destImageObject.device) |
| 4123 | |
| 4124 | regions := pRegions[0:regionCount] |
| 4125 | for i in (0 .. regionCount) { |
| 4126 | region := regions[i] |
| 4127 | } |
| 4128 | |
| 4129 | bindCmdBuffer(cmdBuffer, srcBuffer, srcBufferObject.mem) |
| 4130 | bindCmdBuffer(cmdBuffer, destImage, destImageObject.mem) |
| 4131 | |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 4132 | cmdBufferObject.queueFlags = AddQueueFlag(cmdBufferObject.queueFlags, VK_QUEUE_DMA_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4133 | } |
| 4134 | |
| 4135 | @threadSafety("app") |
| 4136 | cmd void vkCmdCopyImageToBuffer( |
| 4137 | VkCmdBuffer cmdBuffer, |
| 4138 | VkImage srcImage, |
| 4139 | VkImageLayout srcImageLayout, |
| 4140 | VkBuffer destBuffer, |
| 4141 | u32 regionCount, |
| 4142 | const VkBufferImageCopy* pRegions) { |
| 4143 | cmdBufferObject := GetCmdBuffer(cmdBuffer) |
| 4144 | srcImageObject := GetImage(srcImage) |
| 4145 | destBufferObject := GetBuffer(destBuffer) |
| 4146 | assert(cmdBufferObject.device == srcImageObject.device) |
| 4147 | assert(cmdBufferObject.device == destBufferObject.device) |
| 4148 | |
| 4149 | regions := pRegions[0:regionCount] |
| 4150 | for i in (0 .. regionCount) { |
| 4151 | region := regions[i] |
| 4152 | } |
| 4153 | |
| 4154 | bindCmdBuffer(cmdBuffer, srcImage, srcImageObject.mem) |
| 4155 | bindCmdBuffer(cmdBuffer, destBuffer, destBufferObject.mem) |
| 4156 | |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 4157 | cmdBufferObject.queueFlags = AddQueueFlag(cmdBufferObject.queueFlags, VK_QUEUE_DMA_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4158 | } |
| 4159 | |
| 4160 | @threadSafety("app") |
| 4161 | cmd void vkCmdUpdateBuffer( |
| 4162 | VkCmdBuffer cmdBuffer, |
| 4163 | VkBuffer destBuffer, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4164 | VkDeviceSize destOffset, |
| 4165 | VkDeviceSize dataSize, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4166 | const u32* pData) { |
| 4167 | cmdBufferObject := GetCmdBuffer(cmdBuffer) |
| 4168 | destBufferObject := GetBuffer(destBuffer) |
| 4169 | assert(cmdBufferObject.device == destBufferObject.device) |
| 4170 | |
| 4171 | data := pData[0:dataSize] |
| 4172 | |
| 4173 | bindCmdBuffer(cmdBuffer, destBuffer, destBufferObject.mem) |
| 4174 | |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 4175 | cmdBufferObject.queueFlags = AddQueueFlag(cmdBufferObject.queueFlags, VK_QUEUE_DMA_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4176 | } |
| 4177 | |
| 4178 | @threadSafety("app") |
| 4179 | cmd void vkCmdFillBuffer( |
| 4180 | VkCmdBuffer cmdBuffer, |
| 4181 | VkBuffer destBuffer, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4182 | VkDeviceSize destOffset, |
| 4183 | VkDeviceSize fillSize, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4184 | u32 data) { |
| 4185 | cmdBufferObject := GetCmdBuffer(cmdBuffer) |
| 4186 | destBufferObject := GetBuffer(destBuffer) |
| 4187 | assert(cmdBufferObject.device == destBufferObject.device) |
| 4188 | |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 4189 | cmdBufferObject.queueFlags = AddQueueFlag(cmdBufferObject.queueFlags, VK_QUEUE_DMA_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4190 | } |
| 4191 | |
| 4192 | @threadSafety("app") |
| 4193 | cmd void vkCmdClearColorImage( |
| 4194 | VkCmdBuffer cmdBuffer, |
| 4195 | VkImage image, |
| 4196 | VkImageLayout imageLayout, |
| 4197 | const VkClearColorValue* pColor, |
| 4198 | u32 rangeCount, |
| 4199 | const VkImageSubresourceRange* pRanges) { |
| 4200 | cmdBufferObject := GetCmdBuffer(cmdBuffer) |
| 4201 | imageObject := GetImage(image) |
| 4202 | assert(cmdBufferObject.device == imageObject.device) |
| 4203 | |
| 4204 | ranges := pRanges[0:rangeCount] |
| 4205 | for i in (0 .. rangeCount) { |
| 4206 | range := ranges[i] |
| 4207 | } |
| 4208 | |
| 4209 | bindCmdBuffer(cmdBuffer, image, imageObject.mem) |
| 4210 | |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 4211 | cmdBufferObject.queueFlags = AddQueueFlag(cmdBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4212 | } |
| 4213 | |
| 4214 | @threadSafety("app") |
| 4215 | cmd void vkCmdClearDepthStencilImage( |
| 4216 | VkCmdBuffer cmdBuffer, |
| 4217 | VkImage image, |
| 4218 | VkImageLayout imageLayout, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4219 | const VkClearDepthStencilValue* pDepthStencil, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4220 | u32 rangeCount, |
| 4221 | const VkImageSubresourceRange* pRanges) { |
| 4222 | cmdBufferObject := GetCmdBuffer(cmdBuffer) |
| 4223 | imageObject := GetImage(image) |
| 4224 | assert(cmdBufferObject.device == imageObject.device) |
| 4225 | |
| 4226 | ranges := pRanges[0:rangeCount] |
| 4227 | for i in (0 .. rangeCount) { |
| 4228 | range := ranges[i] |
| 4229 | } |
| 4230 | |
| 4231 | bindCmdBuffer(cmdBuffer, image, imageObject.mem) |
| 4232 | |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 4233 | cmdBufferObject.queueFlags = AddQueueFlag(cmdBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4234 | } |
| 4235 | |
| 4236 | @threadSafety("app") |
Jesse Hall | ae38f73 | 2015-11-19 21:32:50 -0800 | [diff] [blame] | 4237 | cmd void vkCmdClearAttachments( |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4238 | VkCmdBuffer cmdBuffer, |
Jesse Hall | ae38f73 | 2015-11-19 21:32:50 -0800 | [diff] [blame] | 4239 | u32 attachmentCount, |
| 4240 | const VkClearAttachment* pAttachments, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4241 | u32 rectCount, |
Jesse Hall | a15a4bf | 2015-11-19 22:48:02 -0800 | [diff] [blame] | 4242 | const VkClearRect* pRects) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4243 | cmdBufferObject := GetCmdBuffer(cmdBuffer) |
| 4244 | |
| 4245 | rects := pRects[0:rectCount] |
| 4246 | for i in (0 .. rectCount) { |
| 4247 | rect := rects[i] |
| 4248 | } |
| 4249 | |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 4250 | cmdBufferObject.queueFlags = AddQueueFlag(cmdBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4251 | } |
| 4252 | |
| 4253 | @threadSafety("app") |
| 4254 | cmd void vkCmdResolveImage( |
| 4255 | VkCmdBuffer cmdBuffer, |
| 4256 | VkImage srcImage, |
| 4257 | VkImageLayout srcImageLayout, |
| 4258 | VkImage destImage, |
| 4259 | VkImageLayout destImageLayout, |
| 4260 | u32 regionCount, |
| 4261 | const VkImageResolve* pRegions) { |
| 4262 | cmdBufferObject := GetCmdBuffer(cmdBuffer) |
| 4263 | srcImageObject := GetImage(srcImage) |
| 4264 | destImageObject := GetImage(destImage) |
| 4265 | assert(cmdBufferObject.device == srcImageObject.device) |
| 4266 | assert(cmdBufferObject.device == destImageObject.device) |
| 4267 | |
| 4268 | regions := pRegions[0:regionCount] |
| 4269 | for i in (0 .. regionCount) { |
| 4270 | region := regions[i] |
| 4271 | } |
| 4272 | |
| 4273 | bindCmdBuffer(cmdBuffer, srcImage, srcImageObject.mem) |
| 4274 | bindCmdBuffer(cmdBuffer, destImage, destImageObject.mem) |
| 4275 | |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 4276 | cmdBufferObject.queueFlags = AddQueueFlag(cmdBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4277 | } |
| 4278 | |
| 4279 | @threadSafety("app") |
| 4280 | cmd void vkCmdSetEvent( |
| 4281 | VkCmdBuffer cmdBuffer, |
| 4282 | VkEvent event, |
| 4283 | VkPipelineStageFlags stageMask) { |
| 4284 | cmdBufferObject := GetCmdBuffer(cmdBuffer) |
| 4285 | eventObject := GetEvent(event) |
| 4286 | assert(cmdBufferObject.device == eventObject.device) |
| 4287 | } |
| 4288 | |
| 4289 | @threadSafety("app") |
| 4290 | cmd void vkCmdResetEvent( |
| 4291 | VkCmdBuffer cmdBuffer, |
| 4292 | VkEvent event, |
| 4293 | VkPipelineStageFlags stageMask) { |
| 4294 | cmdBufferObject := GetCmdBuffer(cmdBuffer) |
| 4295 | eventObject := GetEvent(event) |
| 4296 | assert(cmdBufferObject.device == eventObject.device) |
| 4297 | } |
| 4298 | |
| 4299 | @threadSafety("app") |
| 4300 | cmd void vkCmdWaitEvents( |
| 4301 | VkCmdBuffer cmdBuffer, |
| 4302 | u32 eventCount, |
| 4303 | const VkEvent* pEvents, |
| 4304 | VkPipelineStageFlags srcStageMask, |
| 4305 | VkPipelineStageFlags destStageMask, |
| 4306 | u32 memBarrierCount, |
| 4307 | const void* const* ppMemBarriers) { |
| 4308 | cmdBufferObject := GetCmdBuffer(cmdBuffer) |
| 4309 | |
| 4310 | events := pEvents[0:eventCount] |
| 4311 | for i in (0 .. eventCount) { |
| 4312 | event := events[i] |
| 4313 | eventObject := GetEvent(event) |
| 4314 | assert(cmdBufferObject.device == eventObject.device) |
| 4315 | } |
| 4316 | |
| 4317 | pMemBarriers := ppMemBarriers[0:memBarrierCount] |
| 4318 | for i in (0 .. memBarrierCount) { |
| 4319 | switch as!VkMemoryBarrier const*(pMemBarriers[i])[0].sType { |
| 4320 | case VK_STRUCTURE_TYPE_MEMORY_BARRIER: { |
| 4321 | memBarrier := as!VkMemoryBarrier const*(pMemBarriers[i])[0] |
| 4322 | } |
| 4323 | case VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER: { |
| 4324 | imageMemBarrier := as!VkImageMemoryBarrier const*(pMemBarriers[i])[0] |
| 4325 | imageObject := GetImage(imageMemBarrier.image) |
| 4326 | assert(imageObject.device == cmdBufferObject.device) |
| 4327 | } |
| 4328 | case VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER: { |
| 4329 | bufferMemBarrier := as!VkBufferMemoryBarrier const*(pMemBarriers[i])[0] |
| 4330 | bufferObject := GetBuffer(bufferMemBarrier.buffer) |
| 4331 | assert(bufferObject.device == cmdBufferObject.device) |
| 4332 | } |
| 4333 | } |
| 4334 | } |
| 4335 | } |
| 4336 | |
| 4337 | @threadSafety("app") |
| 4338 | cmd void vkCmdPipelineBarrier( |
| 4339 | VkCmdBuffer cmdBuffer, |
| 4340 | VkPipelineStageFlags srcStageMask, |
| 4341 | VkPipelineStageFlags destStageMask, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4342 | VkBool32 byRegion, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4343 | u32 memBarrierCount, |
| 4344 | const void* const* ppMemBarriers) { |
| 4345 | cmdBufferObject := GetCmdBuffer(cmdBuffer) |
| 4346 | |
| 4347 | pMemBarriers := ppMemBarriers[0:memBarrierCount] |
| 4348 | for i in (0 .. memBarrierCount) { |
| 4349 | switch as!VkMemoryBarrier const*(pMemBarriers[i])[0].sType { |
| 4350 | case VK_STRUCTURE_TYPE_MEMORY_BARRIER: { |
| 4351 | memBarrier := as!VkMemoryBarrier const*(pMemBarriers[i])[0] |
| 4352 | } |
| 4353 | case VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER: { |
| 4354 | imageMemBarrier := as!VkImageMemoryBarrier const*(pMemBarriers[i])[0] |
| 4355 | imageObject := GetImage(imageMemBarrier.image) |
| 4356 | assert(imageObject.device == cmdBufferObject.device) |
| 4357 | } |
| 4358 | case VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER: { |
| 4359 | bufferMemBarrier := as!VkBufferMemoryBarrier const*(pMemBarriers[i])[0] |
| 4360 | bufferObject := GetBuffer(bufferMemBarrier.buffer) |
| 4361 | assert(bufferObject.device == cmdBufferObject.device) |
| 4362 | } |
| 4363 | } |
| 4364 | } |
| 4365 | } |
| 4366 | |
| 4367 | @threadSafety("app") |
| 4368 | cmd void vkCmdBeginQuery( |
| 4369 | VkCmdBuffer cmdBuffer, |
| 4370 | VkQueryPool queryPool, |
| 4371 | u32 slot, |
| 4372 | VkQueryControlFlags flags) { |
| 4373 | cmdBufferObject := GetCmdBuffer(cmdBuffer) |
| 4374 | queryPoolObject := GetQueryPool(queryPool) |
| 4375 | assert(cmdBufferObject.device == queryPoolObject.device) |
| 4376 | } |
| 4377 | |
| 4378 | @threadSafety("app") |
| 4379 | cmd void vkCmdEndQuery( |
| 4380 | VkCmdBuffer cmdBuffer, |
| 4381 | VkQueryPool queryPool, |
| 4382 | u32 slot) { |
| 4383 | cmdBufferObject := GetCmdBuffer(cmdBuffer) |
| 4384 | queryPoolObject := GetQueryPool(queryPool) |
| 4385 | assert(cmdBufferObject.device == queryPoolObject.device) |
| 4386 | } |
| 4387 | |
| 4388 | @threadSafety("app") |
| 4389 | cmd void vkCmdResetQueryPool( |
| 4390 | VkCmdBuffer cmdBuffer, |
| 4391 | VkQueryPool queryPool, |
| 4392 | u32 startQuery, |
| 4393 | u32 queryCount) { |
| 4394 | cmdBufferObject := GetCmdBuffer(cmdBuffer) |
| 4395 | queryPoolObject := GetQueryPool(queryPool) |
| 4396 | assert(cmdBufferObject.device == queryPoolObject.device) |
| 4397 | } |
| 4398 | |
| 4399 | @threadSafety("app") |
| 4400 | cmd void vkCmdWriteTimestamp( |
| 4401 | VkCmdBuffer cmdBuffer, |
Jesse Hall | 6f39a6d | 2015-11-24 11:08:36 -0800 | [diff] [blame] | 4402 | VkPipelineStageFlagBits pipelineStage, |
Jesse Hall | a3a7a1d | 2015-11-24 11:37:23 -0800 | [diff] [blame] | 4403 | VkQueryPool queryPool, |
| 4404 | u32 slot) { |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4405 | cmdBufferObject := GetCmdBuffer(cmdBuffer) |
Jesse Hall | a3a7a1d | 2015-11-24 11:37:23 -0800 | [diff] [blame] | 4406 | queryPoolObject := GetQueryPool(queryPool) |
| 4407 | assert(cmdBufferObject.device == queryPoolObject.device) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4408 | } |
| 4409 | |
| 4410 | @threadSafety("app") |
| 4411 | cmd void vkCmdCopyQueryPoolResults( |
| 4412 | VkCmdBuffer cmdBuffer, |
| 4413 | VkQueryPool queryPool, |
| 4414 | u32 startQuery, |
| 4415 | u32 queryCount, |
| 4416 | VkBuffer destBuffer, |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4417 | VkDeviceSize destOffset, |
Jesse Hall | a9bb62b | 2015-11-21 19:31:56 -0800 | [diff] [blame] | 4418 | VkDeviceSize stride, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4419 | VkQueryResultFlags flags) { |
| 4420 | cmdBufferObject := GetCmdBuffer(cmdBuffer) |
| 4421 | queryPoolObject := GetQueryPool(queryPool) |
| 4422 | destBufferObject := GetBuffer(destBuffer) |
| 4423 | assert(cmdBufferObject.device == queryPoolObject.device) |
| 4424 | assert(cmdBufferObject.device == destBufferObject.device) |
| 4425 | } |
| 4426 | |
| 4427 | cmd void vkCmdPushConstants( |
| 4428 | VkCmdBuffer cmdBuffer, |
| 4429 | VkPipelineLayout layout, |
| 4430 | VkShaderStageFlags stageFlags, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 4431 | u32 offset, |
| 4432 | u32 size, |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4433 | const void* values) { |
| 4434 | cmdBufferObject := GetCmdBuffer(cmdBuffer) |
| 4435 | layoutObject := GetPipelineLayout(layout) |
| 4436 | assert(cmdBufferObject.device == layoutObject.device) |
| 4437 | } |
| 4438 | |
| 4439 | @threadSafety("app") |
| 4440 | cmd void vkCmdBeginRenderPass( |
| 4441 | VkCmdBuffer cmdBuffer, |
| 4442 | const VkRenderPassBeginInfo* pRenderPassBegin, |
| 4443 | VkRenderPassContents contents) { |
| 4444 | cmdBufferObject := GetCmdBuffer(cmdBuffer) |
| 4445 | renderPassObject := GetRenderPass(pRenderPassBegin.renderPass) |
| 4446 | framebufferObject := GetFramebuffer(pRenderPassBegin.framebuffer) |
| 4447 | assert(cmdBufferObject.device == renderPassObject.device) |
| 4448 | assert(cmdBufferObject.device == framebufferObject.device) |
| 4449 | |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 4450 | cmdBufferObject.queueFlags = AddQueueFlag(cmdBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4451 | } |
| 4452 | |
| 4453 | cmd void vkCmdNextSubpass( |
| 4454 | VkCmdBuffer cmdBuffer, |
| 4455 | VkRenderPassContents contents) { |
| 4456 | cmdBufferObject := GetCmdBuffer(cmdBuffer) |
| 4457 | } |
| 4458 | |
| 4459 | @threadSafety("app") |
| 4460 | cmd void vkCmdEndRenderPass( |
| 4461 | VkCmdBuffer cmdBuffer) { |
| 4462 | cmdBufferObject := GetCmdBuffer(cmdBuffer) |
| 4463 | |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 4464 | cmdBufferObject.queueFlags = AddQueueFlag(cmdBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT) |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4465 | } |
| 4466 | |
| 4467 | cmd void vkCmdExecuteCommands( |
| 4468 | VkCmdBuffer cmdBuffer, |
| 4469 | u32 cmdBuffersCount, |
| 4470 | const VkCmdBuffer* pCmdBuffers) { |
| 4471 | cmdBufferObject := GetCmdBuffer(cmdBuffer) |
| 4472 | |
| 4473 | cmdBuffers := pCmdBuffers[0:cmdBuffersCount] |
| 4474 | for i in (0 .. cmdBuffersCount) { |
| 4475 | secondaryCmdBuffer := cmdBuffers[i] |
| 4476 | secondaryCmdBufferObject := GetCmdBuffer(secondaryCmdBuffer) |
| 4477 | assert(cmdBufferObject.device == secondaryCmdBufferObject.device) |
| 4478 | } |
| 4479 | } |
| 4480 | |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 4481 | @extension("VK_EXT_KHR_surface") |
| 4482 | cmd void vkDestroySurfaceKHR( |
| 4483 | VkInstance instance, |
| 4484 | VkSurfaceKHR surface) { |
| 4485 | instanceObject := GetInstance(instance) |
| 4486 | surfaceObject := GetSurface(surface) |
| 4487 | assert(surfaceObject.instance == instance) |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 4488 | |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 4489 | State.Surfaces[surface] = null |
Jesse Hall | 2818f93 | 2015-11-19 21:19:17 -0800 | [diff] [blame] | 4490 | } |
| 4491 | |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 4492 | @extension("VK_EXT_KHR_surface") |
| 4493 | cmd VkBool32 vkGetPhysicalDeviceSurfaceSupportKHR( |
| 4494 | VkPhysicalDevice physicalDevice, |
| 4495 | u32 queueFamilyIndex, |
| 4496 | VkSurfaceKHR surface) { |
| 4497 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
| 4498 | |
| 4499 | //supported := ? |
| 4500 | |
| 4501 | return ?//supported |
| 4502 | } |
| 4503 | |
| 4504 | @extension("VK_EXT_KHR_swapchain") |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 4505 | cmd VkResult vkGetSurfacePropertiesKHR( |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 4506 | VkDevice device, |
| 4507 | VkSurfaceKHR surface, |
| 4508 | VkSurfacePropertiesKHR* pSurfaceProperties) { |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 4509 | deviceObject := GetDevice(device) |
| 4510 | |
| 4511 | surfaceProperties := ? |
| 4512 | pSurfaceProperties[0] = surfaceProperties |
| 4513 | |
| 4514 | return ? |
| 4515 | } |
| 4516 | |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 4517 | @extension("VK_EXT_KHR_swapchain") |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 4518 | cmd VkResult vkGetSurfaceFormatsKHR( |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 4519 | VkDevice device, |
| 4520 | VkSurfaceKHR surface, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 4521 | u32* pSurfaceFormatCount, |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 4522 | VkSurfaceFormatKHR* pSurfaceFormats) { |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 4523 | deviceObject := GetDevice(device) |
| 4524 | |
| 4525 | count := as!u32(?) |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 4526 | pSurfaceFormatCount[0] = count |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 4527 | surfaceFormats := pSurfaceFormats[0:count] |
| 4528 | |
| 4529 | for i in (0 .. count) { |
| 4530 | surfaceFormat := ? |
| 4531 | surfaceFormats[i] = surfaceFormat |
| 4532 | } |
| 4533 | |
| 4534 | return ? |
| 4535 | } |
| 4536 | |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 4537 | @extension("VK_EXT_KHR_swapchain") |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 4538 | cmd VkResult vkGetSurfacePresentModesKHR( |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 4539 | VkDevice device, |
| 4540 | VkSurfaceKHR surface, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 4541 | u32* pPresentModeCount, |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 4542 | VkPresentModeKHR* pPresentModes) { |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 4543 | deviceObject := GetDevice(device) |
| 4544 | |
| 4545 | count := as!u32(?) |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 4546 | pPresentModeCount[0] = count |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 4547 | presentModes := pPresentModes[0:count] |
| 4548 | |
| 4549 | for i in (0 .. count) { |
| 4550 | presentMode := ? |
| 4551 | presentModes[i] = presentMode |
| 4552 | } |
| 4553 | |
| 4554 | return ? |
| 4555 | } |
| 4556 | |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 4557 | @extension("VK_EXT_KHR_swapchain") |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 4558 | cmd VkResult vkCreateSwapchainKHR( |
| 4559 | VkDevice device, |
| 4560 | const VkSwapchainCreateInfoKHR* pCreateInfo, |
| 4561 | VkSwapchainKHR* pSwapchain) { |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 4562 | assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR) |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 4563 | deviceObject := GetDevice(device) |
| 4564 | |
| 4565 | swapchain := ? |
| 4566 | pSwapchain[0] = swapchain |
| 4567 | State.Swapchains[swapchain] = new!SwapchainObject(device: device) |
| 4568 | |
| 4569 | return ? |
| 4570 | } |
| 4571 | |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 4572 | @extension("VK_EXT_KHR_swapchain") |
| 4573 | cmd void vkDestroySwapchainKHR( |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 4574 | VkDevice device, |
| 4575 | VkSwapchainKHR swapchain) { |
| 4576 | deviceObject := GetDevice(device) |
| 4577 | swapchainObject := GetSwapchain(swapchain) |
| 4578 | assert(swapchainObject.device == device) |
| 4579 | |
| 4580 | State.Swapchains[swapchain] = null |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 4581 | } |
| 4582 | |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 4583 | @extension("VK_EXT_KHR_swapchain") |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 4584 | cmd VkResult vkGetSwapchainImagesKHR( |
| 4585 | VkDevice device, |
| 4586 | VkSwapchainKHR swapchain, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 4587 | u32* pSwapchainImageCount, |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 4588 | VkImage* pSwapchainImages) { |
| 4589 | deviceObject := GetDevice(device) |
| 4590 | |
| 4591 | count := as!u32(?) |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 4592 | pSwapchainImageCount[0] = count |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 4593 | swapchainImages := pSwapchainImages[0:count] |
| 4594 | |
| 4595 | for i in (0 .. count) { |
| 4596 | swapchainImage := ? |
| 4597 | swapchainImages[i] = swapchainImage |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 4598 | State.Images[swapchainImage] = new!ImageObject(device: device) |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 4599 | } |
| 4600 | |
| 4601 | return ? |
| 4602 | } |
| 4603 | |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 4604 | @extension("VK_EXT_KHR_swapchain") |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 4605 | cmd VkResult vkAcquireNextImageKHR( |
| 4606 | VkDevice device, |
| 4607 | VkSwapchainKHR swapchain, |
| 4608 | u64 timeout, |
| 4609 | VkSemaphore semaphore, |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 4610 | VkFence fence, |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 4611 | u32* pImageIndex) { |
| 4612 | deviceObject := GetDevice(device) |
| 4613 | swapchainObject := GetSwapchain(swapchain) |
| 4614 | |
| 4615 | imageIndex := ? |
| 4616 | pImageIndex[0] = imageIndex |
| 4617 | |
| 4618 | return ? |
| 4619 | } |
| 4620 | |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 4621 | @extension("VK_EXT_KHR_swapchain") |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 4622 | cmd VkResult vkQueuePresentKHR( |
| 4623 | VkQueue queue, |
| 4624 | VkPresentInfoKHR* pPresentInfo) { |
| 4625 | queueObject := GetQueue(queue) |
| 4626 | |
| 4627 | presentInfo := ? |
| 4628 | pPresentInfo[0] = presentInfo |
| 4629 | |
| 4630 | return ? |
| 4631 | } |
| 4632 | |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 4633 | @extension("VK_EXT_KHR_display") |
| 4634 | cmd VkResult vkGetPhysicalDeviceDisplayPropertiesKHR( |
| 4635 | VkPhysicalDevice physicalDevice, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 4636 | u32* pPropertyCount, |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 4637 | VkDisplayPropertiesKHR* pProperties) { |
| 4638 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
| 4639 | return ? |
| 4640 | } |
| 4641 | |
| 4642 | @extension("VK_EXT_KHR_display") |
| 4643 | cmd VkResult vkGetDisplayModePropertiesKHR( |
| 4644 | VkPhysicalDevice physicalDevice, |
| 4645 | VkDisplayKHR display, |
Jesse Hall | 03b6fe1 | 2015-11-24 12:44:21 -0800 | [diff] [blame^] | 4646 | u32* pPropertyCount, |
| 4647 | VkDisplayModePropertiesKHR* pProperties) { |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 4648 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
| 4649 | return ? |
| 4650 | } |
| 4651 | |
| 4652 | @extension("VK_EXT_KHR_display") |
| 4653 | cmd VkResult vkCreateDisplayModeKHR( |
| 4654 | VkPhysicalDevice physicalDevice, |
| 4655 | VkDisplayKHR display, |
| 4656 | const VkDisplayModeCreateInfoKHR* pCreateInfo, |
| 4657 | VkDisplayModeKHR* pMode) { |
| 4658 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
| 4659 | return ? |
| 4660 | } |
| 4661 | |
| 4662 | @extension("VK_EXT_KHR_display") |
| 4663 | cmd VkResult vkGetDisplayPlanePropertiesKHR( |
| 4664 | VkPhysicalDevice physicalDevice, |
| 4665 | VkDisplayKHR display, |
| 4666 | VkDisplayModeKHR mode, |
| 4667 | u32 planeIndex, |
| 4668 | VkDisplayPlanePropertiesKHR* pProperties) { |
| 4669 | physicalDeviceObject := GetPhysicalDevice(physicalDevice) |
| 4670 | return ? |
| 4671 | } |
| 4672 | |
| 4673 | @extension("VK_EXT_KHR_x11_surface") |
| 4674 | cmd VkResult vkCreateX11SurfaceKHR( |
| 4675 | VkInstance instance, |
| 4676 | platform.Display* dpy, |
| 4677 | platform.Window root, |
| 4678 | platform.Window window, |
| 4679 | VkSurfaceKHR* pSurface) { |
| 4680 | instanceObject := GetInstance(instance) |
| 4681 | return ? |
| 4682 | } |
| 4683 | |
| 4684 | @extension("VK_EXT_KHR_xcb_surface") |
| 4685 | cmd VkResult vkCreateXCBSurfaceKHR( |
| 4686 | VkInstance instance, |
| 4687 | platform.xcb_connection_t* connection, |
| 4688 | platform.xcb_window_t root, |
| 4689 | platform.xcb_window_t window, |
| 4690 | VkSurfaceKHR* pSurface) { |
| 4691 | instanceObject := GetInstance(instance) |
| 4692 | return ? |
| 4693 | } |
| 4694 | |
| 4695 | @extension("VK_EXT_KHR_wayland_surface") |
| 4696 | cmd VkResult vkCreateWaylandSurfaceKHR( |
| 4697 | VkInstance instance, |
| 4698 | platform.wl_display* display, |
| 4699 | platform.wl_surface* surface, |
| 4700 | VkSurfaceKHR* pSurface) { |
| 4701 | instanceObject := GetInstance(instance) |
| 4702 | return ? |
| 4703 | } |
| 4704 | |
| 4705 | @extension("VK_EXT_KHR_mir_surface") |
| 4706 | cmd VkResult vkCreateMirSurfaceKHR( |
| 4707 | VkInstance instance, |
| 4708 | platform.MirConnection* connection, |
| 4709 | platform.MirSurface* mirSurface, |
| 4710 | VkSurfaceKHR* pSurface) { |
| 4711 | instanceObject := GetInstance(instance) |
| 4712 | return ? |
| 4713 | } |
| 4714 | |
| 4715 | @extension("VK_EXT_KHR_android_surface") |
| 4716 | cmd VkResult vkCreateAndroidSurfaceKHR( |
| 4717 | VkInstance instance, |
| 4718 | platform.ANativeWindow* window |
| 4719 | VkSurfaceKHR* pSurface) { |
| 4720 | instanceObject := GetInstance(instance) |
| 4721 | return ? |
| 4722 | } |
| 4723 | |
| 4724 | @extension("VK_EXT_KHR_win32_surface") |
| 4725 | cmd VkResult vkCreateWin32SurfaceKHR( |
| 4726 | VkInstance instance, |
| 4727 | platform.HINSTANCE hinstance, |
| 4728 | platform.HWND hwnd, |
| 4729 | VkSurfaceKHR* pSurface) { |
| 4730 | instanceObject := GetInstance(instance) |
| 4731 | return ? |
| 4732 | } |
| 4733 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4734 | |
| 4735 | //////////////// |
| 4736 | // Validation // |
| 4737 | //////////////// |
| 4738 | |
| 4739 | extern void validate(string layerName, bool condition, string message) |
| 4740 | |
| 4741 | |
| 4742 | ///////////////////////////// |
| 4743 | // Internal State Tracking // |
| 4744 | ///////////////////////////// |
| 4745 | |
| 4746 | StateObject State |
| 4747 | |
| 4748 | @internal class StateObject { |
| 4749 | // Dispatchable objects. |
| 4750 | map!(VkInstance, ref!InstanceObject) Instances |
| 4751 | map!(VkPhysicalDevice, ref!PhysicalDeviceObject) PhysicalDevices |
| 4752 | map!(VkDevice, ref!DeviceObject) Devices |
| 4753 | map!(VkQueue, ref!QueueObject) Queues |
| 4754 | map!(VkCmdBuffer, ref!CmdBufferObject) CmdBuffers |
| 4755 | |
| 4756 | // Non-dispatchable objects. |
| 4757 | map!(VkDeviceMemory, ref!DeviceMemoryObject) DeviceMemories |
| 4758 | map!(VkBuffer, ref!BufferObject) Buffers |
| 4759 | map!(VkBufferView, ref!BufferViewObject) BufferViews |
| 4760 | map!(VkImage, ref!ImageObject) Images |
| 4761 | map!(VkImageView, ref!ImageViewObject) ImageViews |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4762 | map!(VkShaderModule, ref!ShaderModuleObject) ShaderModules |
| 4763 | map!(VkShader, ref!ShaderObject) Shaders |
| 4764 | map!(VkPipeline, ref!PipelineObject) Pipelines |
| 4765 | map!(VkPipelineLayout, ref!PipelineLayoutObject) PipelineLayouts |
| 4766 | map!(VkSampler, ref!SamplerObject) Samplers |
| 4767 | map!(VkDescriptorSet, ref!DescriptorSetObject) DescriptorSets |
| 4768 | map!(VkDescriptorSetLayout, ref!DescriptorSetLayoutObject) DescriptorSetLayouts |
| 4769 | map!(VkDescriptorPool, ref!DescriptorPoolObject) DescriptorPools |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4770 | map!(VkFence, ref!FenceObject) Fences |
| 4771 | map!(VkSemaphore, ref!SemaphoreObject) Semaphores |
| 4772 | map!(VkEvent, ref!EventObject) Events |
| 4773 | map!(VkQueryPool, ref!QueryPoolObject) QueryPools |
| 4774 | map!(VkFramebuffer, ref!FramebufferObject) Framebuffers |
| 4775 | map!(VkRenderPass, ref!RenderPassObject) RenderPasses |
| 4776 | map!(VkPipelineCache, ref!PipelineCacheObject) PipelineCaches |
| 4777 | map!(VkCmdPool, ref!CmdPoolObject) CmdPools |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 4778 | map!(VkSurfaceKHR, ref!SurfaceObject) Surfaces |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 4779 | map!(VkSwapchainKHR, ref!SwapchainObject) Swapchains |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4780 | } |
| 4781 | |
| 4782 | @internal class InstanceObject { |
| 4783 | } |
| 4784 | |
| 4785 | @internal class PhysicalDeviceObject { |
| 4786 | VkInstance instance |
| 4787 | } |
| 4788 | |
| 4789 | @internal class DeviceObject { |
| 4790 | VkPhysicalDevice physicalDevice |
| 4791 | } |
| 4792 | |
| 4793 | @internal class QueueObject { |
| 4794 | VkDevice device |
| 4795 | VkQueueFlags flags |
| 4796 | } |
| 4797 | |
| 4798 | @internal class CmdBufferObject { |
| 4799 | VkDevice device |
| 4800 | map!(u64, VkDeviceMemory) boundObjects |
| 4801 | VkQueueFlags queueFlags |
| 4802 | } |
| 4803 | |
| 4804 | @internal class DeviceMemoryObject { |
| 4805 | VkDevice device |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4806 | VkDeviceSize allocationSize |
| 4807 | map!(u64, VkDeviceSize ) boundObjects |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4808 | map!(VkCmdBuffer, VkCmdBuffer) boundCommandBuffers |
| 4809 | } |
| 4810 | |
| 4811 | @internal class BufferObject { |
| 4812 | VkDevice device |
| 4813 | VkDeviceMemory mem |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4814 | VkDeviceSize memOffset |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4815 | } |
| 4816 | |
| 4817 | @internal class BufferViewObject { |
| 4818 | VkDevice device |
| 4819 | VkBuffer buffer |
| 4820 | } |
| 4821 | |
| 4822 | @internal class ImageObject { |
| 4823 | VkDevice device |
| 4824 | VkDeviceMemory mem |
Jesse Hall | 5ae3abb | 2015-10-08 14:00:22 -0700 | [diff] [blame] | 4825 | VkDeviceSize memOffset |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4826 | } |
| 4827 | |
| 4828 | @internal class ImageViewObject { |
| 4829 | VkDevice device |
| 4830 | VkImage image |
| 4831 | } |
| 4832 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4833 | @internal class ShaderObject { |
| 4834 | VkDevice device |
| 4835 | } |
| 4836 | |
| 4837 | @internal class ShaderModuleObject { |
| 4838 | VkDevice device |
| 4839 | } |
| 4840 | |
| 4841 | @internal class PipelineObject { |
| 4842 | VkDevice device |
| 4843 | } |
| 4844 | |
| 4845 | @internal class PipelineLayoutObject { |
| 4846 | VkDevice device |
| 4847 | } |
| 4848 | |
| 4849 | @internal class SamplerObject { |
| 4850 | VkDevice device |
| 4851 | } |
| 4852 | |
| 4853 | @internal class DescriptorSetObject { |
| 4854 | VkDevice device |
| 4855 | } |
| 4856 | |
| 4857 | @internal class DescriptorSetLayoutObject { |
| 4858 | VkDevice device |
| 4859 | } |
| 4860 | |
| 4861 | @internal class DescriptorPoolObject { |
| 4862 | VkDevice device |
| 4863 | } |
| 4864 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4865 | @internal class FenceObject { |
| 4866 | VkDevice device |
| 4867 | bool signaled |
| 4868 | } |
| 4869 | |
| 4870 | @internal class SemaphoreObject { |
| 4871 | VkDevice device |
| 4872 | } |
| 4873 | |
| 4874 | @internal class EventObject { |
| 4875 | VkDevice device |
| 4876 | } |
| 4877 | |
| 4878 | @internal class QueryPoolObject { |
| 4879 | VkDevice device |
| 4880 | } |
| 4881 | |
| 4882 | @internal class FramebufferObject { |
| 4883 | VkDevice device |
| 4884 | } |
| 4885 | |
| 4886 | @internal class RenderPassObject { |
| 4887 | VkDevice device |
| 4888 | } |
| 4889 | |
| 4890 | @internal class PipelineCacheObject { |
| 4891 | VkDevice device |
| 4892 | } |
| 4893 | |
| 4894 | @internal class CmdPoolObject { |
| 4895 | VkDevice device |
| 4896 | } |
| 4897 | |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 4898 | @internal class SurfaceObject { |
| 4899 | VkInstance instance |
| 4900 | } |
| 4901 | |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 4902 | @internal class SwapchainObject { |
| 4903 | VkDevice device |
| 4904 | } |
| 4905 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4906 | macro ref!InstanceObject GetInstance(VkInstance instance) { |
| 4907 | assert(instance in State.Instances) |
| 4908 | return State.Instances[instance] |
| 4909 | } |
| 4910 | |
| 4911 | macro ref!PhysicalDeviceObject GetPhysicalDevice(VkPhysicalDevice physicalDevice) { |
| 4912 | assert(physicalDevice in State.PhysicalDevices) |
| 4913 | return State.PhysicalDevices[physicalDevice] |
| 4914 | } |
| 4915 | |
| 4916 | macro ref!DeviceObject GetDevice(VkDevice device) { |
| 4917 | assert(device in State.Devices) |
| 4918 | return State.Devices[device] |
| 4919 | } |
| 4920 | |
| 4921 | macro ref!QueueObject GetQueue(VkQueue queue) { |
| 4922 | assert(queue in State.Queues) |
| 4923 | return State.Queues[queue] |
| 4924 | } |
| 4925 | |
| 4926 | macro ref!CmdBufferObject GetCmdBuffer(VkCmdBuffer cmdBuffer) { |
| 4927 | assert(cmdBuffer in State.CmdBuffers) |
| 4928 | return State.CmdBuffers[cmdBuffer] |
| 4929 | } |
| 4930 | |
| 4931 | macro ref!DeviceMemoryObject GetDeviceMemory(VkDeviceMemory mem) { |
| 4932 | assert(mem in State.DeviceMemories) |
| 4933 | return State.DeviceMemories[mem] |
| 4934 | } |
| 4935 | |
| 4936 | macro ref!BufferObject GetBuffer(VkBuffer buffer) { |
| 4937 | assert(buffer in State.Buffers) |
| 4938 | return State.Buffers[buffer] |
| 4939 | } |
| 4940 | |
| 4941 | macro ref!BufferViewObject GetBufferView(VkBufferView bufferView) { |
| 4942 | assert(bufferView in State.BufferViews) |
| 4943 | return State.BufferViews[bufferView] |
| 4944 | } |
| 4945 | |
| 4946 | macro ref!ImageObject GetImage(VkImage image) { |
| 4947 | assert(image in State.Images) |
| 4948 | return State.Images[image] |
| 4949 | } |
| 4950 | |
| 4951 | macro ref!ImageViewObject GetImageView(VkImageView imageView) { |
| 4952 | assert(imageView in State.ImageViews) |
| 4953 | return State.ImageViews[imageView] |
| 4954 | } |
| 4955 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4956 | macro ref!ShaderObject GetShader(VkShader shader) { |
| 4957 | assert(shader in State.Shaders) |
| 4958 | return State.Shaders[shader] |
| 4959 | } |
| 4960 | |
| 4961 | macro ref!ShaderModuleObject GetShaderModule(VkShaderModule shaderModule) { |
| 4962 | assert(shaderModule in State.ShaderModules) |
| 4963 | return State.ShaderModules[shaderModule] |
| 4964 | } |
| 4965 | |
| 4966 | macro ref!PipelineObject GetPipeline(VkPipeline pipeline) { |
| 4967 | assert(pipeline in State.Pipelines) |
| 4968 | return State.Pipelines[pipeline] |
| 4969 | } |
| 4970 | |
| 4971 | macro ref!PipelineLayoutObject GetPipelineLayout(VkPipelineLayout pipelineLayout) { |
| 4972 | assert(pipelineLayout in State.PipelineLayouts) |
| 4973 | return State.PipelineLayouts[pipelineLayout] |
| 4974 | } |
| 4975 | |
| 4976 | macro ref!SamplerObject GetSampler(VkSampler sampler) { |
| 4977 | assert(sampler in State.Samplers) |
| 4978 | return State.Samplers[sampler] |
| 4979 | } |
| 4980 | |
| 4981 | macro ref!DescriptorSetObject GetDescriptorSet(VkDescriptorSet descriptorSet) { |
| 4982 | assert(descriptorSet in State.DescriptorSets) |
| 4983 | return State.DescriptorSets[descriptorSet] |
| 4984 | } |
| 4985 | |
| 4986 | macro ref!DescriptorSetLayoutObject GetDescriptorSetLayout(VkDescriptorSetLayout descriptorSetLayout) { |
| 4987 | assert(descriptorSetLayout in State.DescriptorSetLayouts) |
| 4988 | return State.DescriptorSetLayouts[descriptorSetLayout] |
| 4989 | } |
| 4990 | |
| 4991 | macro ref!DescriptorPoolObject GetDescriptorPool(VkDescriptorPool descriptorPool) { |
| 4992 | assert(descriptorPool in State.DescriptorPools) |
| 4993 | return State.DescriptorPools[descriptorPool] |
| 4994 | } |
| 4995 | |
Jesse Hall | d27f6aa | 2015-08-15 17:58:48 -0700 | [diff] [blame] | 4996 | macro ref!FenceObject GetFence(VkFence fence) { |
| 4997 | assert(fence in State.Fences) |
| 4998 | return State.Fences[fence] |
| 4999 | } |
| 5000 | |
| 5001 | macro ref!SemaphoreObject GetSemaphore(VkSemaphore semaphore) { |
| 5002 | assert(semaphore in State.Semaphores) |
| 5003 | return State.Semaphores[semaphore] |
| 5004 | } |
| 5005 | |
| 5006 | macro ref!EventObject GetEvent(VkEvent event) { |
| 5007 | assert(event in State.Events) |
| 5008 | return State.Events[event] |
| 5009 | } |
| 5010 | |
| 5011 | macro ref!QueryPoolObject GetQueryPool(VkQueryPool queryPool) { |
| 5012 | assert(queryPool in State.QueryPools) |
| 5013 | return State.QueryPools[queryPool] |
| 5014 | } |
| 5015 | |
| 5016 | macro ref!FramebufferObject GetFramebuffer(VkFramebuffer framebuffer) { |
| 5017 | assert(framebuffer in State.Framebuffers) |
| 5018 | return State.Framebuffers[framebuffer] |
| 5019 | } |
| 5020 | |
| 5021 | macro ref!RenderPassObject GetRenderPass(VkRenderPass renderPass) { |
| 5022 | assert(renderPass in State.RenderPasses) |
| 5023 | return State.RenderPasses[renderPass] |
| 5024 | } |
| 5025 | |
| 5026 | macro ref!PipelineCacheObject GetPipelineCache(VkPipelineCache pipelineCache) { |
| 5027 | assert(pipelineCache in State.PipelineCaches) |
| 5028 | return State.PipelineCaches[pipelineCache] |
| 5029 | } |
| 5030 | |
| 5031 | macro ref!CmdPoolObject GetCmdPool(VkCmdPool cmdPool) { |
| 5032 | assert(cmdPool in State.CmdPools) |
| 5033 | return State.CmdPools[cmdPool] |
Jesse Hall | f09c6b1 | 2015-08-15 19:54:28 -0700 | [diff] [blame] | 5034 | } |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 5035 | |
Jesse Hall | 1356b0d | 2015-11-23 17:24:58 -0800 | [diff] [blame] | 5036 | macro ref!SurfaceObject GetSurface(VkSurfaceKHR surface) { |
| 5037 | assert(surface in State.Surfaces) |
| 5038 | return State.Surfaces[surface] |
| 5039 | } |
| 5040 | |
Michael Lentine | 88594d7 | 2015-11-12 12:49:45 -0800 | [diff] [blame] | 5041 | macro ref!SwapchainObject GetSwapchain(VkSwapchainKHR swapchain) { |
| 5042 | assert(swapchain in State.Swapchains) |
| 5043 | return State.Swapchains[swapchain] |
| 5044 | } |
Jesse Hall | d8bade0 | 2015-11-24 10:24:18 -0800 | [diff] [blame] | 5045 | |
| 5046 | macro VkQueueFlags AddQueueFlag(VkQueueFlags flags, VkQueueFlagBits bit) { |
| 5047 | return as!VkQueueFlags(as!u32(flags) | as!u32(bit)) |
| 5048 | } |