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