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