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