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