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