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