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