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