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