blob: 25ed560dc75f2dc8a7724fe66434ef57c40a1c20 [file] [log] [blame]
Jesse Halld27f6aa2015-08-15 17:58:48 -07001// 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
22import platform "platform.api"
23
24///////////////
25// Constants //
26///////////////
27
28// API version (major.minor.patch)
29define VERSION_MAJOR 0
Jesse Hall543a7ff2016-01-08 16:38:30 -080030define VERSION_MINOR 221
Jesse Hallf9fa9a52016-01-08 16:08:51 -080031define VERSION_PATCH 0
Jesse Halld27f6aa2015-08-15 17:58:48 -070032
33// API limits
Jesse Hall65ab5522015-11-30 00:07:16 -080034define VK_MAX_PHYSICAL_DEVICE_NAME_SIZE 256
35define VK_UUID_SIZE 16
36define VK_MAX_EXTENSION_NAME_SIZE 256
37define VK_MAX_DESCRIPTION_SIZE 256
38define VK_MAX_MEMORY_TYPES 32
39define VK_MAX_MEMORY_HEAPS 16 /// The maximum number of unique memory heaps, each of which supporting 1 or more memory types.
Jesse Halld27f6aa2015-08-15 17:58:48 -070040
41// API keywords
42define VK_TRUE 1
43define VK_FALSE 0
Jesse Hall5ae3abb2015-10-08 14:00:22 -070044
45// API keyword, but needs special handling by some templates
46define NULL_HANDLE 0
Jesse Halld27f6aa2015-08-15 17:58:48 -070047
Jesse Hall543a7ff2016-01-08 16:38:30 -080048@extension("VK_KHR_surface") define VK_KHR_SURFACE_SPEC_VERSION 24
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080049@extension("VK_KHR_surface") define VK_KHR_SURFACE_EXTENSION_NAME "VK_KHR_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080050
Jesse Hall543a7ff2016-01-08 16:38:30 -080051@extension("VK_KHR_swapchain") define VK_KHR_SWAPCHAIN_SPEC_VERSION 67
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080052@extension("VK_KHR_swapchain") define VK_KHR_SWAPCHAIN_EXTENSION_NAME "VK_KHR_swapchain"
Jesse Hall1356b0d2015-11-23 17:24:58 -080053
Jesse Hall543a7ff2016-01-08 16:38:30 -080054@extension("VK_KHR_display") define VK_KHR_DISPLAY_SPEC_VERSION 21
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080055@extension("VK_KHR_display") define VK_KHR_DISPLAY_EXTENSION_NAME "VK_KHR_display"
Jesse Hall1356b0d2015-11-23 17:24:58 -080056
Jesse Hall543a7ff2016-01-08 16:38:30 -080057@extension("VK_KHR_display_swapchain") define VK_KHR_DISPLAY_SWAPCHAIN_SPEC_VERSION 9
Jesse Hall0e74f002015-11-30 11:37:59 -080058@extension("VK_KHR_display_swapchain") define VK_KHR_DISPLAY_SWAPCHAIN_EXTENSION_NAME "VK_KHR_display_swapchain"
Jesse Hall1356b0d2015-11-23 17:24:58 -080059
Jesse Hall543a7ff2016-01-08 16:38:30 -080060@extension("VK_KHR_xlib_surface") define VK_KHR_XLIB_SURFACE_SPEC_VERSION 6
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080061@extension("VK_KHR_xlib_surface") define VK_KHR_XLIB_SURFACE_NAME "VK_KHR_xlib_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080062
Jesse Hall543a7ff2016-01-08 16:38:30 -080063@extension("VK_KHR_xcb_surface") define VK_KHR_XCB_SURFACE_SPEC_VERSION 6
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080064@extension("VK_KHR_xcb_surface") define VK_KHR_XCB_SURFACE_NAME "VK_KHR_xcb_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080065
Jesse Hall543a7ff2016-01-08 16:38:30 -080066@extension("VK_KHR_wayland_surface") define VK_KHR_WAYLAND_SURFACE_SPEC_VERSION 5
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080067@extension("VK_KHR_wayland_surface") define VK_KHR_WAYLAND_SURFACE_NAME "VK_KHR_wayland_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080068
Jesse Hall543a7ff2016-01-08 16:38:30 -080069@extension("VK_KHR_mir_surface") define VK_KHR_MIR_SURFACE_SPEC_VERSION 4
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080070@extension("VK_KHR_mir_surface") define VK_KHR_MIR_SURFACE_NAME "VK_KHR_mir_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080071
Jesse Hall543a7ff2016-01-08 16:38:30 -080072@extension("VK_KHR_android_surface") define VK_KHR_ANDROID_SURFACE_SPEC_VERSION 5
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080073@extension("VK_KHR_android_surface") define VK_KHR_ANDROID_SURFACE_NAME "VK_KHR_android_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080074
Jesse Hall543a7ff2016-01-08 16:38:30 -080075@extension("VK_KHR_win32_surface") define VK_KHR_WIN32_SURFACE_SPEC_VERSION 5
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080076@extension("VK_KHR_win32_surface") define VK_KHR_WIN32_SURFACE_NAME "VK_KHR_win32_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080077
Jesse Halld27f6aa2015-08-15 17:58:48 -070078
79/////////////
80// Types //
81/////////////
82
Jesse Hall5ae3abb2015-10-08 14:00:22 -070083type u32 VkBool32
84type u32 VkFlags
85type u64 VkDeviceSize
86type u32 VkSampleMask
87
Jesse Halld27f6aa2015-08-15 17:58:48 -070088/// Dispatchable handle types.
89@dispatchHandle type u64 VkInstance
90@dispatchHandle type u64 VkPhysicalDevice
91@dispatchHandle type u64 VkDevice
92@dispatchHandle type u64 VkQueue
Jesse Hall3fbc8562015-11-29 22:10:52 -080093@dispatchHandle type u64 VkCommandBuffer
Jesse Halld27f6aa2015-08-15 17:58:48 -070094
95/// Non dispatchable handle types.
96@nonDispatchHandle type u64 VkDeviceMemory
Jesse Hall3fbc8562015-11-29 22:10:52 -080097@nonDispatchHandle type u64 VkCommandPool
Jesse Halld27f6aa2015-08-15 17:58:48 -070098@nonDispatchHandle type u64 VkBuffer
99@nonDispatchHandle type u64 VkBufferView
100@nonDispatchHandle type u64 VkImage
101@nonDispatchHandle type u64 VkImageView
Jesse Halld27f6aa2015-08-15 17:58:48 -0700102@nonDispatchHandle type u64 VkShaderModule
Jesse Halld27f6aa2015-08-15 17:58:48 -0700103@nonDispatchHandle type u64 VkPipeline
104@nonDispatchHandle type u64 VkPipelineLayout
105@nonDispatchHandle type u64 VkSampler
106@nonDispatchHandle type u64 VkDescriptorSet
107@nonDispatchHandle type u64 VkDescriptorSetLayout
108@nonDispatchHandle type u64 VkDescriptorPool
Jesse Halld27f6aa2015-08-15 17:58:48 -0700109@nonDispatchHandle type u64 VkFence
110@nonDispatchHandle type u64 VkSemaphore
111@nonDispatchHandle type u64 VkEvent
112@nonDispatchHandle type u64 VkQueryPool
113@nonDispatchHandle type u64 VkFramebuffer
114@nonDispatchHandle type u64 VkRenderPass
115@nonDispatchHandle type u64 VkPipelineCache
Jesse Hall1356b0d2015-11-23 17:24:58 -0800116
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800117@extension("VK_KHR_surface") @nonDispatchHandle type u64 VkSurfaceKHR
Jesse Hall1356b0d2015-11-23 17:24:58 -0800118
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800119@extension("VK_KHR_swapchain") @nonDispatchHandle type u64 VkSwapchainKHR
Jesse Hall1356b0d2015-11-23 17:24:58 -0800120
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800121@extension("VK_KHR_display") @nonDispatchHandle type u64 VkDisplayKHR
122@extension("VK_KHR_display") @nonDispatchHandle type u64 VkDisplayModeKHR
Jesse Halld27f6aa2015-08-15 17:58:48 -0700123
124
125/////////////
126// Enums //
127/////////////
128
129enum VkImageLayout {
130 VK_IMAGE_LAYOUT_UNDEFINED = 0x00000000, /// Implicit layout an image is when its contents are undefined due to various reasons (e.g. right after creation)
131 VK_IMAGE_LAYOUT_GENERAL = 0x00000001, /// General layout when image can be used for any kind of access
132 VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL = 0x00000002, /// Optimal layout when image is only used for color attachment read/write
133 VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL = 0x00000003, /// Optimal layout when image is only used for depth/stencil attachment read/write
134 VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL = 0x00000004, /// Optimal layout when image is used for read only depth/stencil attachment and shader access
135 VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL = 0x00000005, /// Optimal layout when image is used for read only shader access
Jesse Hall3fbc8562015-11-29 22:10:52 -0800136 VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL = 0x00000006, /// Optimal layout when image is used only as source of transfer operations
137 VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL = 0x00000007, /// Optimal layout when image is used only as destination of transfer operations
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700138 VK_IMAGE_LAYOUT_PREINITIALIZED = 0x00000008, /// Initial layout used when the data is populated by the CPU
Jesse Hall1356b0d2015-11-23 17:24:58 -0800139
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800140 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800141 VK_IMAGE_LAYOUT_PRESENT_SRC_KHR = 1000001002,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700142}
143
144enum VkAttachmentLoadOp {
145 VK_ATTACHMENT_LOAD_OP_LOAD = 0x00000000,
146 VK_ATTACHMENT_LOAD_OP_CLEAR = 0x00000001,
147 VK_ATTACHMENT_LOAD_OP_DONT_CARE = 0x00000002,
148}
149
150enum VkAttachmentStoreOp {
151 VK_ATTACHMENT_STORE_OP_STORE = 0x00000000,
152 VK_ATTACHMENT_STORE_OP_DONT_CARE = 0x00000001,
153}
154
155enum VkImageType {
156 VK_IMAGE_TYPE_1D = 0x00000000,
157 VK_IMAGE_TYPE_2D = 0x00000001,
158 VK_IMAGE_TYPE_3D = 0x00000002,
159}
160
161enum VkImageTiling {
Jesse Hallc7467b72015-11-29 21:05:26 -0800162 VK_IMAGE_TILING_OPTIMAL = 0x00000000,
163 VK_IMAGE_TILING_LINEAR = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700164}
165
166enum VkImageViewType {
167 VK_IMAGE_VIEW_TYPE_1D = 0x00000000,
168 VK_IMAGE_VIEW_TYPE_2D = 0x00000001,
169 VK_IMAGE_VIEW_TYPE_3D = 0x00000002,
170 VK_IMAGE_VIEW_TYPE_CUBE = 0x00000003,
171 VK_IMAGE_VIEW_TYPE_1D_ARRAY = 0x00000004,
172 VK_IMAGE_VIEW_TYPE_2D_ARRAY = 0x00000005,
173 VK_IMAGE_VIEW_TYPE_CUBE_ARRAY = 0x00000006,
174}
175
Jesse Hall3fbc8562015-11-29 22:10:52 -0800176enum VkCommandBufferLevel {
177 VK_COMMAND_BUFFER_LEVEL_PRIMARY = 0x00000000,
178 VK_COMMAND_BUFFER_LEVEL_SECONDARY = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700179}
180
Jesse Hall65ab5522015-11-30 00:07:16 -0800181enum VkComponentSwizzle {
182 VK_COMPONENT_SWIZZLE_IDENTITY = 0x00000000,
183 VK_COMPONENT_SWIZZLE_ZERO = 0x00000001,
184 VK_COMPONENT_SWIZZLE_ONE = 0x00000002,
185 VK_COMPONENT_SWIZZLE_R = 0x00000003,
186 VK_COMPONENT_SWIZZLE_G = 0x00000004,
187 VK_COMPONENT_SWIZZLE_B = 0x00000005,
188 VK_COMPONENT_SWIZZLE_A = 0x00000006,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700189}
190
191enum VkDescriptorType {
192 VK_DESCRIPTOR_TYPE_SAMPLER = 0x00000000,
193 VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER = 0x00000001,
194 VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE = 0x00000002,
195 VK_DESCRIPTOR_TYPE_STORAGE_IMAGE = 0x00000003,
196 VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER = 0x00000004,
197 VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER = 0x00000005,
198 VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER = 0x00000006,
199 VK_DESCRIPTOR_TYPE_STORAGE_BUFFER = 0x00000007,
200 VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC = 0x00000008,
201 VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC = 0x00000009,
202 VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT = 0x0000000a,
203}
204
Jesse Halld27f6aa2015-08-15 17:58:48 -0700205enum VkQueryType {
206 VK_QUERY_TYPE_OCCLUSION = 0x00000000,
207 VK_QUERY_TYPE_PIPELINE_STATISTICS = 0x00000001, /// Optional
Jesse Halla3a7a1d2015-11-24 11:37:23 -0800208 VK_QUERY_TYPE_TIMESTAMP = 0x00000002,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700209}
210
Jesse Halld27f6aa2015-08-15 17:58:48 -0700211enum VkBorderColor {
212 VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK = 0x00000000,
213 VK_BORDER_COLOR_INT_TRANSPARENT_BLACK = 0x00000001,
214 VK_BORDER_COLOR_FLOAT_OPAQUE_BLACK = 0x00000002,
215 VK_BORDER_COLOR_INT_OPAQUE_BLACK = 0x00000003,
216 VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE = 0x00000004,
217 VK_BORDER_COLOR_INT_OPAQUE_WHITE = 0x00000005,
218}
219
220enum VkPipelineBindPoint {
Jesse Hallc7467b72015-11-29 21:05:26 -0800221 VK_PIPELINE_BIND_POINT_GRAPHICS = 0x00000000,
222 VK_PIPELINE_BIND_POINT_COMPUTE = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700223}
224
225enum VkPrimitiveTopology {
226 VK_PRIMITIVE_TOPOLOGY_POINT_LIST = 0x00000000,
227 VK_PRIMITIVE_TOPOLOGY_LINE_LIST = 0x00000001,
228 VK_PRIMITIVE_TOPOLOGY_LINE_STRIP = 0x00000002,
229 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST = 0x00000003,
230 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP = 0x00000004,
231 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN = 0x00000005,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800232 VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY = 0x00000006,
233 VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY = 0x00000007,
234 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY = 0x00000008,
235 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY = 0x00000009,
Jesse Hall091ed9e2015-11-30 00:55:29 -0800236 VK_PRIMITIVE_TOPOLOGY_PATCH_LIST = 0x0000000a,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700237}
238
239enum VkSharingMode {
240 VK_SHARING_MODE_EXCLUSIVE = 0x00000000,
241 VK_SHARING_MODE_CONCURRENT = 0x00000001,
242}
243
244enum VkIndexType {
245 VK_INDEX_TYPE_UINT16 = 0x00000000,
246 VK_INDEX_TYPE_UINT32 = 0x00000001,
247}
248
Jesse Hall23ff73f2015-11-29 14:36:39 -0800249enum VkFilter {
250 VK_FILTER_NEAREST = 0x00000000,
251 VK_FILTER_LINEAR = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700252}
253
Jesse Hall23ff73f2015-11-29 14:36:39 -0800254enum VkSamplerMipmapMode {
255 VK_SAMPLER_MIPMAP_MODE_BASE = 0x00000000, /// Always choose base level
256 VK_SAMPLER_MIPMAP_MODE_NEAREST = 0x00000001, /// Choose nearest mip level
257 VK_SAMPLER_MIPMAP_MODE_LINEAR = 0x00000002, /// Linear filter between mip levels
Jesse Halld27f6aa2015-08-15 17:58:48 -0700258}
259
Jesse Hall23ff73f2015-11-29 14:36:39 -0800260enum VkSamplerAddressMode {
Jesse Hallc7467b72015-11-29 21:05:26 -0800261 VK_SAMPLER_ADDRESS_MODE_REPEAT = 0x00000000,
262 VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT = 0x00000001,
263 VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE = 0x00000002,
264 VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER = 0x00000003,
265 VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700266}
267
268enum VkCompareOp {
269 VK_COMPARE_OP_NEVER = 0x00000000,
270 VK_COMPARE_OP_LESS = 0x00000001,
271 VK_COMPARE_OP_EQUAL = 0x00000002,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800272 VK_COMPARE_OP_LESS_OR_EQUAL = 0x00000003,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700273 VK_COMPARE_OP_GREATER = 0x00000004,
274 VK_COMPARE_OP_NOT_EQUAL = 0x00000005,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800275 VK_COMPARE_OP_GREATER_OR_EQUAL = 0x00000006,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700276 VK_COMPARE_OP_ALWAYS = 0x00000007,
277}
278
Jesse Hall65ab5522015-11-30 00:07:16 -0800279enum VkPolygonMode {
280 VK_POLYGON_MODE_FILL = 0x00000000,
281 VK_POLYGON_MODE_LINE = 0x00000001,
282 VK_POLYGON_MODE_POINT = 0x00000002,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700283}
284
285enum VkFrontFace {
Jesse Hall3fbc8562015-11-29 22:10:52 -0800286 VK_FRONT_FACE_COUNTER_CLOCKWISE = 0x00000000,
287 VK_FRONT_FACE_CLOCKWISE = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700288}
289
Jesse Hall65ab5522015-11-30 00:07:16 -0800290enum VkBlendFactor {
291 VK_BLEND_FACTOR_ZERO = 0x00000000,
292 VK_BLEND_FACTOR_ONE = 0x00000001,
293 VK_BLEND_FACTOR_SRC_COLOR = 0x00000002,
294 VK_BLEND_FACTOR_ONE_MINUS_SRC_COLOR = 0x00000003,
295 VK_BLEND_FACTOR_DST_COLOR = 0x00000004,
296 VK_BLEND_FACTOR_ONE_MINUS_DST_COLOR = 0x00000005,
297 VK_BLEND_FACTOR_SRC_ALPHA = 0x00000006,
298 VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA = 0x00000007,
299 VK_BLEND_FACTOR_DST_ALPHA = 0x00000008,
300 VK_BLEND_FACTOR_ONE_MINUS_DST_ALPHA = 0x00000009,
301 VK_BLEND_FACTOR_CONSTANT_COLOR = 0x0000000a,
302 VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR = 0x0000000b,
303 VK_BLEND_FACTOR_CONSTANT_ALPHA = 0x0000000c,
304 VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA = 0x0000000d,
305 VK_BLEND_FACTOR_SRC_ALPHA_SATURATE = 0x0000000e,
306 VK_BLEND_FACTOR_SRC1_COLOR = 0x0000000f,
307 VK_BLEND_FACTOR_ONE_MINUS_SRC1_COLOR = 0x00000010,
308 VK_BLEND_FACTOR_SRC1_ALPHA = 0x00000011,
309 VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA = 0x00000012,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700310}
311
312enum VkBlendOp {
313 VK_BLEND_OP_ADD = 0x00000000,
314 VK_BLEND_OP_SUBTRACT = 0x00000001,
315 VK_BLEND_OP_REVERSE_SUBTRACT = 0x00000002,
316 VK_BLEND_OP_MIN = 0x00000003,
317 VK_BLEND_OP_MAX = 0x00000004,
318}
319
320enum VkStencilOp {
321 VK_STENCIL_OP_KEEP = 0x00000000,
322 VK_STENCIL_OP_ZERO = 0x00000001,
323 VK_STENCIL_OP_REPLACE = 0x00000002,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800324 VK_STENCIL_OP_INCREMENT_AND_CLAMP = 0x00000003,
325 VK_STENCIL_OP_DECREMENT_AND_CLAMP = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700326 VK_STENCIL_OP_INVERT = 0x00000005,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800327 VK_STENCIL_OP_INCREMENT_AND_WRAP = 0x00000006,
328 VK_STENCIL_OP_DECREMENT_AND_WRAP = 0x00000007,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700329}
330
331enum VkLogicOp {
332 VK_LOGIC_OP_CLEAR = 0x00000000,
333 VK_LOGIC_OP_AND = 0x00000001,
334 VK_LOGIC_OP_AND_REVERSE = 0x00000002,
335 VK_LOGIC_OP_COPY = 0x00000003,
336 VK_LOGIC_OP_AND_INVERTED = 0x00000004,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800337 VK_LOGIC_OP_NO_OP = 0x00000005,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700338 VK_LOGIC_OP_XOR = 0x00000006,
339 VK_LOGIC_OP_OR = 0x00000007,
340 VK_LOGIC_OP_NOR = 0x00000008,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800341 VK_LOGIC_OP_EQUIVALENT = 0x00000009,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700342 VK_LOGIC_OP_INVERT = 0x0000000a,
343 VK_LOGIC_OP_OR_REVERSE = 0x0000000b,
344 VK_LOGIC_OP_COPY_INVERTED = 0x0000000c,
345 VK_LOGIC_OP_OR_INVERTED = 0x0000000d,
346 VK_LOGIC_OP_NAND = 0x0000000e,
347 VK_LOGIC_OP_SET = 0x0000000f,
348}
349
Jesse Hall3fbc8562015-11-29 22:10:52 -0800350enum VkSystemAllocationScope {
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800351 VK_SYSTEM_ALLOCATION_SCOPE_COMMAND = 0x00000000,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800352 VK_SYSTEM_ALLOCATION_SCOPE_OBJECT = 0x00000001,
353 VK_SYSTEM_ALLOCATION_SCOPE_CACHE = 0x00000002,
354 VK_SYSTEM_ALLOCATION_SCOPE_DEVICE = 0x00000003,
355 VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE = 0x00000004,
Jesse Hall03b6fe12015-11-24 12:44:21 -0800356}
357
Jesse Hall3fbc8562015-11-29 22:10:52 -0800358enum VkInternalAllocationType {
359 VK_INTERNAL_ALLOCATION_TYPE_EXECUTABLE = 0x00000000,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700360}
361
362enum VkPhysicalDeviceType {
363 VK_PHYSICAL_DEVICE_TYPE_OTHER = 0x00000000,
364 VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU = 0x00000001,
365 VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU = 0x00000002,
366 VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU = 0x00000003,
367 VK_PHYSICAL_DEVICE_TYPE_CPU = 0x00000004,
368}
369
Jesse Hall65ab5522015-11-30 00:07:16 -0800370enum VkVertexInputRate {
371 VK_VERTEX_INPUT_RATE_VERTEX = 0x00000000,
372 VK_VERTEX_INPUT_RATE_INSTANCE = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700373}
374
375/// Vulkan format definitions
376enum VkFormat {
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800377 VK_FORMAT_UNDEFINED = 0,
378 VK_FORMAT_R4G4_UNORM_PACK8 = 1,
379 VK_FORMAT_R4G4B4A4_UNORM_PACK16 = 2,
380 VK_FORMAT_B4G4R4A4_UNORM_PACK16 = 3,
381 VK_FORMAT_R5G6B5_UNORM_PACK16 = 4,
382 VK_FORMAT_B5G6R5_UNORM_PACK16 = 5,
383 VK_FORMAT_R5G5B5A1_UNORM_PACK16 = 6,
384 VK_FORMAT_B5G5R5A1_UNORM_PACK16 = 7,
385 VK_FORMAT_A1R5G5B5_UNORM_PACK16 = 8,
386 VK_FORMAT_R8_UNORM = 9,
387 VK_FORMAT_R8_SNORM = 10,
388 VK_FORMAT_R8_USCALED = 11,
389 VK_FORMAT_R8_SSCALED = 12,
390 VK_FORMAT_R8_UINT = 13,
391 VK_FORMAT_R8_SINT = 14,
392 VK_FORMAT_R8_SRGB = 15,
393 VK_FORMAT_R8G8_UNORM = 16,
394 VK_FORMAT_R8G8_SNORM = 17,
395 VK_FORMAT_R8G8_USCALED = 18,
396 VK_FORMAT_R8G8_SSCALED = 19,
397 VK_FORMAT_R8G8_UINT = 20,
398 VK_FORMAT_R8G8_SINT = 21,
399 VK_FORMAT_R8G8_SRGB = 22,
400 VK_FORMAT_R8G8B8_UNORM = 23,
401 VK_FORMAT_R8G8B8_SNORM = 24,
402 VK_FORMAT_R8G8B8_USCALED = 25,
403 VK_FORMAT_R8G8B8_SSCALED = 26,
404 VK_FORMAT_R8G8B8_UINT = 27,
405 VK_FORMAT_R8G8B8_SINT = 28,
406 VK_FORMAT_R8G8B8_SRGB = 29,
407 VK_FORMAT_B8G8R8_UNORM = 30,
408 VK_FORMAT_B8G8R8_SNORM = 31,
409 VK_FORMAT_B8G8R8_USCALED = 32,
410 VK_FORMAT_B8G8R8_SSCALED = 33,
411 VK_FORMAT_B8G8R8_UINT = 34,
412 VK_FORMAT_B8G8R8_SINT = 35,
413 VK_FORMAT_B8G8R8_SRGB = 36,
414 VK_FORMAT_R8G8B8A8_UNORM = 37,
415 VK_FORMAT_R8G8B8A8_SNORM = 38,
416 VK_FORMAT_R8G8B8A8_USCALED = 39,
417 VK_FORMAT_R8G8B8A8_SSCALED = 40,
418 VK_FORMAT_R8G8B8A8_UINT = 41,
419 VK_FORMAT_R8G8B8A8_SINT = 42,
420 VK_FORMAT_R8G8B8A8_SRGB = 43,
421 VK_FORMAT_B8G8R8A8_UNORM = 44,
422 VK_FORMAT_B8G8R8A8_SNORM = 45,
423 VK_FORMAT_B8G8R8A8_USCALED = 46,
424 VK_FORMAT_B8G8R8A8_SSCALED = 47,
425 VK_FORMAT_B8G8R8A8_UINT = 48,
426 VK_FORMAT_B8G8R8A8_SINT = 49,
427 VK_FORMAT_B8G8R8A8_SRGB = 50,
428 VK_FORMAT_A8B8G8R8_UNORM_PACK32 = 51,
429 VK_FORMAT_A8B8G8R8_SNORM_PACK32 = 52,
430 VK_FORMAT_A8B8G8R8_USCALED_PACK32 = 53,
431 VK_FORMAT_A8B8G8R8_SSCALED_PACK32 = 54,
432 VK_FORMAT_A8B8G8R8_UINT_PACK32 = 55,
433 VK_FORMAT_A8B8G8R8_SINT_PACK32 = 56,
434 VK_FORMAT_A8B8G8R8_SRGB_PACK32 = 57,
435 VK_FORMAT_A2R10G10B10_UNORM_PACK32 = 58,
436 VK_FORMAT_A2R10G10B10_SNORM_PACK32 = 59,
437 VK_FORMAT_A2R10G10B10_USCALED_PACK32 = 60,
438 VK_FORMAT_A2R10G10B10_SSCALED_PACK32 = 61,
439 VK_FORMAT_A2R10G10B10_UINT_PACK32 = 62,
440 VK_FORMAT_A2R10G10B10_SINT_PACK32 = 63,
441 VK_FORMAT_A2B10G10R10_UNORM_PACK32 = 64,
442 VK_FORMAT_A2B10G10R10_SNORM_PACK32 = 65,
443 VK_FORMAT_A2B10G10R10_USCALED_PACK32 = 66,
444 VK_FORMAT_A2B10G10R10_SSCALED_PACK32 = 67,
445 VK_FORMAT_A2B10G10R10_UINT_PACK32 = 68,
446 VK_FORMAT_A2B10G10R10_SINT_PACK32 = 69,
447 VK_FORMAT_R16_UNORM = 70,
448 VK_FORMAT_R16_SNORM = 71,
449 VK_FORMAT_R16_USCALED = 72,
450 VK_FORMAT_R16_SSCALED = 73,
451 VK_FORMAT_R16_UINT = 74,
452 VK_FORMAT_R16_SINT = 75,
453 VK_FORMAT_R16_SFLOAT = 76,
454 VK_FORMAT_R16G16_UNORM = 77,
455 VK_FORMAT_R16G16_SNORM = 78,
456 VK_FORMAT_R16G16_USCALED = 79,
457 VK_FORMAT_R16G16_SSCALED = 80,
458 VK_FORMAT_R16G16_UINT = 81,
459 VK_FORMAT_R16G16_SINT = 82,
460 VK_FORMAT_R16G16_SFLOAT = 83,
461 VK_FORMAT_R16G16B16_UNORM = 84,
462 VK_FORMAT_R16G16B16_SNORM = 85,
463 VK_FORMAT_R16G16B16_USCALED = 86,
464 VK_FORMAT_R16G16B16_SSCALED = 87,
465 VK_FORMAT_R16G16B16_UINT = 88,
466 VK_FORMAT_R16G16B16_SINT = 89,
467 VK_FORMAT_R16G16B16_SFLOAT = 90,
468 VK_FORMAT_R16G16B16A16_UNORM = 91,
469 VK_FORMAT_R16G16B16A16_SNORM = 92,
470 VK_FORMAT_R16G16B16A16_USCALED = 93,
471 VK_FORMAT_R16G16B16A16_SSCALED = 94,
472 VK_FORMAT_R16G16B16A16_UINT = 95,
473 VK_FORMAT_R16G16B16A16_SINT = 96,
474 VK_FORMAT_R16G16B16A16_SFLOAT = 97,
475 VK_FORMAT_R32_UINT = 98,
476 VK_FORMAT_R32_SINT = 99,
477 VK_FORMAT_R32_SFLOAT = 100,
478 VK_FORMAT_R32G32_UINT = 101,
479 VK_FORMAT_R32G32_SINT = 102,
480 VK_FORMAT_R32G32_SFLOAT = 103,
481 VK_FORMAT_R32G32B32_UINT = 104,
482 VK_FORMAT_R32G32B32_SINT = 105,
483 VK_FORMAT_R32G32B32_SFLOAT = 106,
484 VK_FORMAT_R32G32B32A32_UINT = 107,
485 VK_FORMAT_R32G32B32A32_SINT = 108,
486 VK_FORMAT_R32G32B32A32_SFLOAT = 109,
487 VK_FORMAT_R64_UINT = 110,
488 VK_FORMAT_R64_SINT = 111,
489 VK_FORMAT_R64_SFLOAT = 112,
490 VK_FORMAT_R64G64_UINT = 113,
491 VK_FORMAT_R64G64_SINT = 114,
492 VK_FORMAT_R64G64_SFLOAT = 115,
493 VK_FORMAT_R64G64B64_UINT = 116,
494 VK_FORMAT_R64G64B64_SINT = 117,
495 VK_FORMAT_R64G64B64_SFLOAT = 118,
496 VK_FORMAT_R64G64B64A64_UINT = 119,
497 VK_FORMAT_R64G64B64A64_SINT = 120,
498 VK_FORMAT_R64G64B64A64_SFLOAT = 121,
499 VK_FORMAT_B10G11R11_UFLOAT_PACK32 = 122,
500 VK_FORMAT_E5B9G9R9_UFLOAT_PACK32 = 123,
501 VK_FORMAT_D16_UNORM = 124,
502 VK_FORMAT_X8_D24_UNORM_PACK32 = 125,
503 VK_FORMAT_D32_SFLOAT = 126,
504 VK_FORMAT_S8_UINT = 127,
505 VK_FORMAT_D16_UNORM_S8_UINT = 128,
506 VK_FORMAT_D24_UNORM_S8_UINT = 129,
507 VK_FORMAT_D32_SFLOAT_S8_UINT = 130,
508 VK_FORMAT_BC1_RGB_UNORM_BLOCK = 131,
509 VK_FORMAT_BC1_RGB_SRGB_BLOCK = 132,
510 VK_FORMAT_BC1_RGBA_UNORM_BLOCK = 133,
511 VK_FORMAT_BC1_RGBA_SRGB_BLOCK = 134,
512 VK_FORMAT_BC2_UNORM_BLOCK = 135,
513 VK_FORMAT_BC2_SRGB_BLOCK = 136,
514 VK_FORMAT_BC3_UNORM_BLOCK = 137,
515 VK_FORMAT_BC3_SRGB_BLOCK = 138,
516 VK_FORMAT_BC4_UNORM_BLOCK = 139,
517 VK_FORMAT_BC4_SNORM_BLOCK = 140,
518 VK_FORMAT_BC5_UNORM_BLOCK = 141,
519 VK_FORMAT_BC5_SNORM_BLOCK = 142,
520 VK_FORMAT_BC6H_UFLOAT_BLOCK = 143,
521 VK_FORMAT_BC6H_SFLOAT_BLOCK = 144,
522 VK_FORMAT_BC7_UNORM_BLOCK = 145,
523 VK_FORMAT_BC7_SRGB_BLOCK = 146,
524 VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK = 147,
525 VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK = 148,
526 VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK = 149,
527 VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK = 150,
528 VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK = 151,
529 VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK = 152,
530 VK_FORMAT_EAC_R11_UNORM_BLOCK = 153,
531 VK_FORMAT_EAC_R11_SNORM_BLOCK = 154,
532 VK_FORMAT_EAC_R11G11_UNORM_BLOCK = 155,
533 VK_FORMAT_EAC_R11G11_SNORM_BLOCK = 156,
534 VK_FORMAT_ASTC_4x4_UNORM_BLOCK = 157,
535 VK_FORMAT_ASTC_4x4_SRGB_BLOCK = 158,
536 VK_FORMAT_ASTC_5x4_UNORM_BLOCK = 159,
537 VK_FORMAT_ASTC_5x4_SRGB_BLOCK = 160,
538 VK_FORMAT_ASTC_5x5_UNORM_BLOCK = 161,
539 VK_FORMAT_ASTC_5x5_SRGB_BLOCK = 162,
540 VK_FORMAT_ASTC_6x5_UNORM_BLOCK = 163,
541 VK_FORMAT_ASTC_6x5_SRGB_BLOCK = 164,
542 VK_FORMAT_ASTC_6x6_UNORM_BLOCK = 165,
543 VK_FORMAT_ASTC_6x6_SRGB_BLOCK = 166,
544 VK_FORMAT_ASTC_8x5_UNORM_BLOCK = 167,
545 VK_FORMAT_ASTC_8x5_SRGB_BLOCK = 168,
546 VK_FORMAT_ASTC_8x6_UNORM_BLOCK = 169,
547 VK_FORMAT_ASTC_8x6_SRGB_BLOCK = 170,
548 VK_FORMAT_ASTC_8x8_UNORM_BLOCK = 171,
549 VK_FORMAT_ASTC_8x8_SRGB_BLOCK = 172,
550 VK_FORMAT_ASTC_10x5_UNORM_BLOCK = 173,
551 VK_FORMAT_ASTC_10x5_SRGB_BLOCK = 174,
552 VK_FORMAT_ASTC_10x6_UNORM_BLOCK = 175,
553 VK_FORMAT_ASTC_10x6_SRGB_BLOCK = 176,
554 VK_FORMAT_ASTC_10x8_UNORM_BLOCK = 177,
555 VK_FORMAT_ASTC_10x8_SRGB_BLOCK = 178,
556 VK_FORMAT_ASTC_10x10_UNORM_BLOCK = 179,
557 VK_FORMAT_ASTC_10x10_SRGB_BLOCK = 180,
558 VK_FORMAT_ASTC_12x10_UNORM_BLOCK = 181,
559 VK_FORMAT_ASTC_12x10_SRGB_BLOCK = 182,
560 VK_FORMAT_ASTC_12x12_UNORM_BLOCK = 183,
561 VK_FORMAT_ASTC_12x12_SRGB_BLOCK = 184,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700562}
563
Jesse Halld27f6aa2015-08-15 17:58:48 -0700564/// Structure type enumerant
565enum VkStructureType {
566 VK_STRUCTURE_TYPE_APPLICATION_INFO = 0,
Jesse Hallc7467b72015-11-29 21:05:26 -0800567 VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO = 1,
568 VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO = 2,
569 VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO = 3,
570 VK_STRUCTURE_TYPE_SUBMIT_INFO = 4,
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800571 VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO = 5,
Jesse Hallc7467b72015-11-29 21:05:26 -0800572 VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE = 6,
573 VK_STRUCTURE_TYPE_BIND_SPARSE_INFO = 7,
574 VK_STRUCTURE_TYPE_FENCE_CREATE_INFO = 8,
575 VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO = 9,
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700576 VK_STRUCTURE_TYPE_EVENT_CREATE_INFO = 10,
Jesse Hallc7467b72015-11-29 21:05:26 -0800577 VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO = 11,
578 VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO = 12,
579 VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO = 13,
580 VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO = 14,
581 VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO = 15,
582 VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO = 16,
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800583 VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO = 17,
584 VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO = 18,
585 VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO = 19,
586 VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO = 20,
587 VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO = 21,
588 VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO = 22,
589 VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO = 23,
590 VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO = 24,
591 VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO = 25,
592 VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO = 26,
593 VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO = 27,
594 VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO = 28,
595 VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO = 29,
596 VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO = 30,
597 VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO = 31,
598 VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO = 32,
599 VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO = 33,
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800600 VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO = 34,
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800601 VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET = 35,
602 VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET = 36,
603 VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO = 37,
604 VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO = 38,
605 VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO = 39,
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800606 VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO = 40,
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800607 VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO = 41,
608 VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO = 42,
609 VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER = 43,
610 VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER = 44,
611 VK_STRUCTURE_TYPE_MEMORY_BARRIER = 45,
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800612 VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO = 46,
613 VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO = 47,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800614
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800615 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800616 VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR = 1000001000,
617 VK_STRUCTURE_TYPE_PRESENT_INFO_KHR = 1000001001,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800618
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800619 //@extension("VK_KHR_display")
Jesse Hallbd888842015-11-30 21:44:14 -0800620 VK_STRUCTURE_TYPE_DISPLAY_MODE_CREATE_INFO_KHR = 1000002000,
621 VK_STRUCTURE_TYPE_DISPLAY_SURFACE_CREATE_INFO_KHR = 1000002001,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800622
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800623 //@extension("VK_KHR_display_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800624 VK_STRUCTURE_TYPE_DISPLAY_DISPLAY_PRESENT_INFO_KHR = 1000003000,
Jesse Hallf9fa9a52016-01-08 16:08:51 -0800625
626 //@extension("VK_KHR_xlib_surface")
627 VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR = 1000004000,
628
629 //@extension("VK_KHR_xcb_surface")
630 VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR = 1000005000,
631
632 //@extension("VK_KHR_wayland_surface")
633 VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR = 1000006000,
634
635 //@extension("VK_KHR_mir_surface")
636 VK_STRUCTURE_TYPE_MIR_SURFACE_CREATE_INFO_KHR = 1000007000,
637
638 //@extension("VK_KHR_android_surface")
639 VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR = 1000008000,
640
641 //@extension("VK_KHR_win32_surface")
642 VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR = 1000009000,
Jesse Hall543a7ff2016-01-08 16:38:30 -0800643
644 //@extension("VK_EXT_debug_report")
645 VK_STRUCTURE_TYPE_DEBUG_REPORT_CREATE_INFO_EXT = 1000011000,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700646}
647
Jesse Hall65ab5522015-11-30 00:07:16 -0800648enum VkSubpassContents {
649 VK_SUBPASS_CONTENTS_INLINE = 0x00000000,
650 VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700651}
652
Jesse Hall543a7ff2016-01-08 16:38:30 -0800653enum VkPipelineCacheHeaderVersion {
654 VK_PIPELINE_CACHE_HEADER_VERSION_ONE = 1,
655}
656
Jesse Hallbd888842015-11-30 21:44:14 -0800657@lastUnused(-11)
Jesse Halld27f6aa2015-08-15 17:58:48 -0700658/// Error and return codes
659enum VkResult {
660 // Return codes for successful operation execution (positive values)
Jesse Hallbd888842015-11-30 21:44:14 -0800661 VK_SUCCESS = 0,
662 VK_NOT_READY = 1,
663 VK_TIMEOUT = 2,
664 VK_EVENT_SET = 3,
665 VK_EVENT_RESET = 4,
666 VK_INCOMPLETE = 5,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700667
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800668 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800669 VK_SUBOPTIMAL_KHR = 1000001003,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800670
Jesse Halld27f6aa2015-08-15 17:58:48 -0700671 // Error codes (negative values)
Jesse Hallbd888842015-11-30 21:44:14 -0800672 VK_ERROR_OUT_OF_HOST_MEMORY = 0xFFFFFFFF, // -1
673 VK_ERROR_OUT_OF_DEVICE_MEMORY = 0xFFFFFFFE, // -2
674 VK_ERROR_INITIALIZATION_FAILED = 0xFFFFFFFD, // -3
675 VK_ERROR_DEVICE_LOST = 0xFFFFFFFC, // -4
676 VK_ERROR_MEMORY_MAP_FAILED = 0xFFFFFFFB, // -5
677 VK_ERROR_LAYER_NOT_PRESENT = 0xFFFFFFFA, // -6
678 VK_ERROR_EXTENSION_NOT_PRESENT = 0xFFFFFFF9, // -7
679 VK_ERROR_FEATURE_NOT_PRESENT = 0xFFFFFFF8, // -8
680 VK_ERROR_INCOMPATIBLE_DRIVER = 0xFFFFFFF7, // -9
681 VK_ERROR_TOO_MANY_OBJECTS = 0xFFFFFFF6, // -10
682 VK_ERROR_FORMAT_NOT_SUPPORTED = 0xFFFFFFF5, // -11
Jesse Hall1356b0d2015-11-23 17:24:58 -0800683
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800684 //@extension("VK_KHR_surface")
Jesse Hallbd888842015-11-30 21:44:14 -0800685 VK_ERROR_SURFACE_LOST_KHR = 0xC4653600, // -1000000000
Jesse Halla6429252015-11-29 18:59:42 -0800686
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800687 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800688 VK_ERROR_OUT_OF_DATE_KHR = 0xC4653214, // -1000001004
Jesse Hall1356b0d2015-11-23 17:24:58 -0800689
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800690 //@extension("VK_KHR_display_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800691 VK_ERROR_INCOMPATIBLE_DISPLAY_KHR = 0xC4652A47, // -1000003001
Jesse Hall1356b0d2015-11-23 17:24:58 -0800692
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800693 //@extension("VK_KHR_android_surface")
Jesse Hallbd888842015-11-30 21:44:14 -0800694 VK_ERROR_NATIVE_WINDOW_IN_USE_KHR = 0xC46516C0, // -1000008000
Jesse Hall543a7ff2016-01-08 16:38:30 -0800695
696 //@extension("VK_EXT_debug_report")
697 VK_ERROR_VALIDATION_FAILED_EXT = 0xC4650B07, // -1000011001
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700698}
699
700enum VkDynamicState {
701 VK_DYNAMIC_STATE_VIEWPORT = 0x00000000,
702 VK_DYNAMIC_STATE_SCISSOR = 0x00000001,
703 VK_DYNAMIC_STATE_LINE_WIDTH = 0x00000002,
704 VK_DYNAMIC_STATE_DEPTH_BIAS = 0x00000003,
705 VK_DYNAMIC_STATE_BLEND_CONSTANTS = 0x00000004,
706 VK_DYNAMIC_STATE_DEPTH_BOUNDS = 0x00000005,
707 VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK = 0x00000006,
708 VK_DYNAMIC_STATE_STENCIL_WRITE_MASK = 0x00000007,
709 VK_DYNAMIC_STATE_STENCIL_REFERENCE = 0x00000008,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700710}
711
Jesse Hall523db342015-11-30 21:12:55 -0800712@extension("VK_KHR_surface")
Michael Lentine88594d72015-11-12 12:49:45 -0800713enum VkPresentModeKHR {
714 VK_PRESENT_MODE_IMMEDIATE_KHR = 0x00000000,
715 VK_PRESENT_MODE_MAILBOX_KHR = 0x00000001,
716 VK_PRESENT_MODE_FIFO_KHR = 0x00000002,
Jesse Hall03b6fe12015-11-24 12:44:21 -0800717 VK_PRESENT_MODE_FIFO_RELAXED_KHR = 0x00000003,
Michael Lentine88594d72015-11-12 12:49:45 -0800718}
719
Jesse Hall523db342015-11-30 21:12:55 -0800720@extension("VK_KHR_surface")
Michael Lentine88594d72015-11-12 12:49:45 -0800721enum VkColorSpaceKHR {
722 VK_COLORSPACE_SRGB_NONLINEAR_KHR = 0x00000000,
723}
Jesse Halld27f6aa2015-08-15 17:58:48 -0700724
725/////////////////
726// Bitfields //
727/////////////////
728
Jesse Halld27f6aa2015-08-15 17:58:48 -0700729/// Queue capabilities
Jesse Halld8bade02015-11-24 10:24:18 -0800730type VkFlags VkQueueFlags
731bitfield VkQueueFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -0700732 VK_QUEUE_GRAPHICS_BIT = 0x00000001, /// Queue supports graphics operations
733 VK_QUEUE_COMPUTE_BIT = 0x00000002, /// Queue supports compute operations
Jesse Hall65ab5522015-11-30 00:07:16 -0800734 VK_QUEUE_TRANSFER_BIT = 0x00000004, /// Queue supports transfer operations
Jesse Hallb00daad2015-11-29 19:46:20 -0800735 VK_QUEUE_SPARSE_BINDING_BIT = 0x00000008, /// Queue supports sparse resource memory management operations
Jesse Halld27f6aa2015-08-15 17:58:48 -0700736}
737
738/// Memory properties passed into vkAllocMemory().
Jesse Halld8bade02015-11-24 10:24:18 -0800739type VkFlags VkMemoryPropertyFlags
740bitfield VkMemoryPropertyFlagBits {
Jesse Halld1af8122015-11-29 23:50:38 -0800741 VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT = 0x00000001,
742 VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT = 0x00000002,
743 VK_MEMORY_PROPERTY_HOST_COHERENT_BIT = 0x00000004,
744 VK_MEMORY_PROPERTY_HOST_CACHED_BIT = 0x00000008,
745 VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT = 0x00000010,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700746}
747
748/// Memory heap flags
Jesse Halld8bade02015-11-24 10:24:18 -0800749type VkFlags VkMemoryHeapFlags
750bitfield VkMemoryHeapFlagBits {
Jesse Halld1af8122015-11-29 23:50:38 -0800751 VK_MEMORY_HEAP_DEVICE_LOCAL_BIT = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700752}
753
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800754/// Access flags
755type VkFlags VkAccessFlags
756bitfield VkAccessFlagBits {
757 VK_ACCESS_INDIRECT_COMMAND_READ_BIT = 0x00000001,
758 VK_ACCESS_INDEX_READ_BIT = 0x00000002,
759 VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT = 0x00000004,
760 VK_ACCESS_UNIFORM_READ_BIT = 0x00000008,
761 VK_ACCESS_INPUT_ATTACHMENT_READ_BIT = 0x00000010,
762 VK_ACCESS_SHADER_READ_BIT = 0x00000020,
763 VK_ACCESS_SHADER_WRITE_BIT = 0x00000040,
764 VK_ACCESS_COLOR_ATTACHMENT_READ_BIT = 0x00000080,
765 VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT = 0x00000100,
766 VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT = 0x00000200,
767 VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT = 0x00000400,
768 VK_ACCESS_TRANSFER_READ_BIT = 0x00000800,
769 VK_ACCESS_TRANSFER_WRITE_BIT = 0x00001000,
770 VK_ACCESS_HOST_READ_BIT = 0x00002000,
771 VK_ACCESS_HOST_WRITE_BIT = 0x00004000,
772 VK_ACCESS_MEMORY_READ_BIT = 0x00008000,
773 VK_ACCESS_MEMORY_WRITE_BIT = 0x00010000,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700774}
775
776/// Buffer usage flags
Jesse Halld8bade02015-11-24 10:24:18 -0800777type VkFlags VkBufferUsageFlags
778bitfield VkBufferUsageFlagBits {
Jesse Hall3fbc8562015-11-29 22:10:52 -0800779 VK_BUFFER_USAGE_TRANSFER_SRC_BIT = 0x00000001, /// Can be used as a source of transfer operations
780 VK_BUFFER_USAGE_TRANSFER_DST_BIT = 0x00000002, /// Can be used as a destination of transfer operations
Jesse Halld27f6aa2015-08-15 17:58:48 -0700781 VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000004, /// Can be used as TBO
782 VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT = 0x00000008, /// Can be used as IBO
783 VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT = 0x00000010, /// Can be used as UBO
784 VK_BUFFER_USAGE_STORAGE_BUFFER_BIT = 0x00000020, /// Can be used as SSBO
785 VK_BUFFER_USAGE_INDEX_BUFFER_BIT = 0x00000040, /// Can be used as source of fixed function index fetch (index buffer)
786 VK_BUFFER_USAGE_VERTEX_BUFFER_BIT = 0x00000080, /// Can be used as source of fixed function vertex fetch (VBO)
787 VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT = 0x00000100, /// Can be the source of indirect parameters (e.g. indirect buffer, parameter buffer)
788}
789
790/// Buffer creation flags
Jesse Halld8bade02015-11-24 10:24:18 -0800791type VkFlags VkBufferCreateFlags
792bitfield VkBufferCreateFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700793 VK_BUFFER_CREATE_SPARSE_BINDING_BIT = 0x00000001, /// Buffer should support sparse backing
Jesse Halld27f6aa2015-08-15 17:58:48 -0700794 VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002, /// Buffer should support sparse backing with partial residency
795 VK_BUFFER_CREATE_SPARSE_ALIASED_BIT = 0x00000004, /// Buffer should support constent data access to physical memory blocks mapped into multiple locations of sparse buffers
796}
797
798/// Shader stage flags
Jesse Halld8bade02015-11-24 10:24:18 -0800799type VkFlags VkShaderStageFlags
800bitfield VkShaderStageFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -0700801 VK_SHADER_STAGE_VERTEX_BIT = 0x00000001,
Jesse Hallae38f732015-11-19 21:32:50 -0800802 VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT = 0x00000002,
803 VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700804 VK_SHADER_STAGE_GEOMETRY_BIT = 0x00000008,
805 VK_SHADER_STAGE_FRAGMENT_BIT = 0x00000010,
806 VK_SHADER_STAGE_COMPUTE_BIT = 0x00000020,
Jesse Hallc7467b72015-11-29 21:05:26 -0800807 VK_SHADER_STAGE_ALL_GRAPHICS = 0x0000001F,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700808
809 VK_SHADER_STAGE_ALL = 0x7FFFFFFF,
810}
811
Jesse Hallfbf97b02015-11-20 14:17:03 -0800812/// Descriptor pool create flags
Jesse Halld8bade02015-11-24 10:24:18 -0800813type VkFlags VkDescriptorPoolCreateFlags
814bitfield VkDescriptorPoolCreateFlagBits {
Jesse Hallfbf97b02015-11-20 14:17:03 -0800815 VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT = 0x00000001,
816}
817
818/// Descriptor pool reset flags
Jesse Halld8bade02015-11-24 10:24:18 -0800819type VkFlags VkDescriptorPoolResetFlags
Jesse Halla6429252015-11-29 18:59:42 -0800820//bitfield VkDescriptorPoolResetFlagBits {
821//}
Jesse Hallfbf97b02015-11-20 14:17:03 -0800822
Jesse Halld27f6aa2015-08-15 17:58:48 -0700823/// Image usage flags
Jesse Halld8bade02015-11-24 10:24:18 -0800824type VkFlags VkImageUsageFlags
825bitfield VkImageUsageFlagBits {
Jesse Hall3fbc8562015-11-29 22:10:52 -0800826 VK_IMAGE_USAGE_TRANSFER_SRC_BIT = 0x00000001, /// Can be used as a source of transfer operations
827 VK_IMAGE_USAGE_TRANSFER_DST_BIT = 0x00000002, /// Can be used as a destination of transfer operations
Jesse Halld27f6aa2015-08-15 17:58:48 -0700828 VK_IMAGE_USAGE_SAMPLED_BIT = 0x00000004, /// Can be sampled from (SAMPLED_IMAGE and COMBINED_IMAGE_SAMPLER descriptor types)
829 VK_IMAGE_USAGE_STORAGE_BIT = 0x00000008, /// Can be used as storage image (STORAGE_IMAGE descriptor type)
830 VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT = 0x00000010, /// Can be used as framebuffer color attachment
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700831 VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000020, /// Can be used as framebuffer depth/stencil attachment
Jesse Halld27f6aa2015-08-15 17:58:48 -0700832 VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT = 0x00000040, /// Image data not needed outside of rendering
833 VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT = 0x00000080, /// Can be used as framebuffer input attachment
834}
835
836/// Image creation flags
Jesse Halld8bade02015-11-24 10:24:18 -0800837type VkFlags VkImageCreateFlags
838bitfield VkImageCreateFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700839 VK_IMAGE_CREATE_SPARSE_BINDING_BIT = 0x00000001, /// Image should support sparse backing
Jesse Halld27f6aa2015-08-15 17:58:48 -0700840 VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002, /// Image should support sparse backing with partial residency
841 VK_IMAGE_CREATE_SPARSE_ALIASED_BIT = 0x00000004, /// Image should support constent data access to physical memory blocks mapped into multiple locations of sparse images
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700842 VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT = 0x00000008, /// Allows image views to have different format than the base image
843 VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT = 0x00000010, /// Allows creating image views with cube type from the created image
Jesse Halld27f6aa2015-08-15 17:58:48 -0700844}
845
Jesse Hallb00daad2015-11-29 19:46:20 -0800846/// Image view creation flags
Jesse Halld8bade02015-11-24 10:24:18 -0800847type VkFlags VkImageViewCreateFlags
Jesse Hallb00daad2015-11-29 19:46:20 -0800848//bitfield VkImageViewCreateFlagBits {
849//}
Jesse Halld27f6aa2015-08-15 17:58:48 -0700850
851/// Pipeline creation flags
Jesse Halld8bade02015-11-24 10:24:18 -0800852type VkFlags VkPipelineCreateFlags
853bitfield VkPipelineCreateFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -0700854 VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT = 0x00000001,
855 VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT = 0x00000002,
856 VK_PIPELINE_CREATE_DERIVATIVE_BIT = 0x00000004,
857}
858
Jesse Hall65ab5522015-11-30 00:07:16 -0800859/// Color component flags
860type VkFlags VkColorComponentFlags
861bitfield VkColorComponentFlagBits {
862 VK_COLOR_COMPONENT_R_BIT = 0x00000001,
863 VK_COLOR_COMPONENT_G_BIT = 0x00000002,
864 VK_COLOR_COMPONENT_B_BIT = 0x00000004,
865 VK_COLOR_COMPONENT_A_BIT = 0x00000008,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700866}
867
868/// Fence creation flags
Jesse Halld8bade02015-11-24 10:24:18 -0800869type VkFlags VkFenceCreateFlags
870bitfield VkFenceCreateFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -0700871 VK_FENCE_CREATE_SIGNALED_BIT = 0x00000001,
872}
873
874/// Semaphore creation flags
Jesse Halld8bade02015-11-24 10:24:18 -0800875type VkFlags VkSemaphoreCreateFlags
Jesse Halla6429252015-11-29 18:59:42 -0800876//bitfield VkSemaphoreCreateFlagBits {
877//}
Jesse Halld27f6aa2015-08-15 17:58:48 -0700878
879/// Format capability flags
Jesse Halld8bade02015-11-24 10:24:18 -0800880type VkFlags VkFormatFeatureFlags
881bitfield VkFormatFeatureFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -0700882 VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT = 0x00000001, /// Format can be used for sampled images (SAMPLED_IMAGE and COMBINED_IMAGE_SAMPLER descriptor types)
883 VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT = 0x00000002, /// Format can be used for storage images (STORAGE_IMAGE descriptor type)
884 VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT = 0x00000004, /// Format supports atomic operations in case it's used for storage images
885 VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000008, /// Format can be used for uniform texel buffers (TBOs)
886 VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT = 0x00000010, /// Format can be used for storage texel buffers (IBOs)
887 VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT = 0x00000020, /// Format supports atomic operations in case it's used for storage texel buffers
888 VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT = 0x00000040, /// Format can be used for vertex buffers (VBOs)
889 VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT = 0x00000080, /// Format can be used for color attachment images
890 VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT = 0x00000100, /// Format supports blending in case it's used for color attachment images
891 VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000200, /// Format can be used for depth/stencil attachment images
Jesse Hall3fbc8562015-11-29 22:10:52 -0800892 VK_FORMAT_FEATURE_BLIT_SRC_BIT = 0x00000400, /// Format can be used as the source image of blits with vkCommandBlitImage
893 VK_FORMAT_FEATURE_BLIT_DST_BIT = 0x00000800, /// Format can be used as the destination image of blits with vkCommandBlitImage
Jesse Halld27f6aa2015-08-15 17:58:48 -0700894}
895
896/// Query control flags
Jesse Halld8bade02015-11-24 10:24:18 -0800897type VkFlags VkQueryControlFlags
898bitfield VkQueryControlFlagBits {
Jesse Hall65ab5522015-11-30 00:07:16 -0800899 VK_QUERY_CONTROL_PRECISE_BIT = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700900}
901
902/// Query result flags
Jesse Halld8bade02015-11-24 10:24:18 -0800903type VkFlags VkQueryResultFlags
904bitfield VkQueryResultFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -0700905 VK_QUERY_RESULT_64_BIT = 0x00000001, /// Results of the queries are written to the destination buffer as 64-bit values
906 VK_QUERY_RESULT_WAIT_BIT = 0x00000002, /// Results of the queries are waited on before proceeding with the result copy
907 VK_QUERY_RESULT_WITH_AVAILABILITY_BIT = 0x00000004, /// Besides the results of the query, the availability of the results is also written
908 VK_QUERY_RESULT_PARTIAL_BIT = 0x00000008, /// Copy the partial results of the query even if the final results aren't available
909}
910
911/// Shader module creation flags
Jesse Halld8bade02015-11-24 10:24:18 -0800912type VkFlags VkShaderModuleCreateFlags
Jesse Halla6429252015-11-29 18:59:42 -0800913//bitfield VkShaderModuleCreateFlagBits {
914//}
Jesse Halld27f6aa2015-08-15 17:58:48 -0700915
Jesse Halld27f6aa2015-08-15 17:58:48 -0700916/// Event creation flags
Jesse Halld8bade02015-11-24 10:24:18 -0800917type VkFlags VkEventCreateFlags
Jesse Halla6429252015-11-29 18:59:42 -0800918//bitfield VkEventCreateFlagBits {
919//}
Jesse Halld27f6aa2015-08-15 17:58:48 -0700920
Jesse Halla15a4bf2015-11-19 22:48:02 -0800921/// Command buffer usage flags
Jesse Hall3fbc8562015-11-29 22:10:52 -0800922type VkFlags VkCommandBufferUsageFlags
923bitfield VkCommandBufferUsageFlagBits {
924 VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT = 0x00000001,
925 VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT = 0x00000002,
926 VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700927}
928
929/// Pipeline statistics flags
Jesse Halld8bade02015-11-24 10:24:18 -0800930type VkFlags VkQueryPipelineStatisticFlags
931bitfield VkQueryPipelineStatisticFlagBits {
Jesse Hallae38f732015-11-19 21:32:50 -0800932 VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_BIT = 0x00000001, /// Optional
933 VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_PRIMITIVES_BIT = 0x00000002, /// Optional
934 VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT = 0x00000004, /// Optional
935 VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_INVOCATIONS_BIT = 0x00000008, /// Optional
936 VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT = 0x00000010, /// Optional
937 VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT = 0x00000020, /// Optional
938 VK_QUERY_PIPELINE_STATISTIC_CLIPPING_PRIMITIVES_BIT = 0x00000040, /// Optional
939 VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT = 0x00000080, /// Optional
940 VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT = 0x00000100, /// Optional
941 VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT = 0x00000200, /// Optional
942 VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT = 0x00000400, /// Optional
Jesse Halld27f6aa2015-08-15 17:58:48 -0700943}
944
945/// Memory mapping flags
Jesse Halld8bade02015-11-24 10:24:18 -0800946type VkFlags VkMemoryMapFlags
Jesse Halla6429252015-11-29 18:59:42 -0800947//bitfield VkMemoryMapFlagBits {
948//}
Jesse Halld27f6aa2015-08-15 17:58:48 -0700949
950/// Bitfield of image aspects
Jesse Halld8bade02015-11-24 10:24:18 -0800951type VkFlags VkImageAspectFlags
952bitfield VkImageAspectFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -0700953 VK_IMAGE_ASPECT_COLOR_BIT = 0x00000001,
954 VK_IMAGE_ASPECT_DEPTH_BIT = 0x00000002,
955 VK_IMAGE_ASPECT_STENCIL_BIT = 0x00000004,
956 VK_IMAGE_ASPECT_METADATA_BIT = 0x00000008,
957}
958
959/// Sparse memory bind flags
Jesse Halld8bade02015-11-24 10:24:18 -0800960type VkFlags VkSparseMemoryBindFlags
Jesse Hall091ed9e2015-11-30 00:55:29 -0800961bitfield VkSparseMemoryBindFlagBits {
962 VK_SPARSE_MEMORY_BIND_METADATA_BIT = 0x00000001,
963}
Jesse Halld27f6aa2015-08-15 17:58:48 -0700964
965/// Sparse image memory requirements flags
Jesse Halld8bade02015-11-24 10:24:18 -0800966type VkFlags VkSparseImageFormatFlags
967bitfield VkSparseImageFormatFlagBits {
Jesse Hallb00daad2015-11-29 19:46:20 -0800968 VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT = 0x00000001, /// Image uses a single miptail region for all array slices
969 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.
970 VK_SPARSE_IMAGE_FORMAT_NONSTANDARD_BLOCK_SIZE_BIT = 0x00000004, /// Image uses a non-standard sparse block size
Jesse Halld27f6aa2015-08-15 17:58:48 -0700971}
972
973/// Pipeline stages
Jesse Halld8bade02015-11-24 10:24:18 -0800974type VkFlags VkPipelineStageFlags
975bitfield VkPipelineStageFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -0700976 VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT = 0x00000001, /// Before subsequent commands are processed
977 VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT = 0x00000002, /// Draw/DispatchIndirect command fetch
978 VK_PIPELINE_STAGE_VERTEX_INPUT_BIT = 0x00000004, /// Vertex/index fetch
979 VK_PIPELINE_STAGE_VERTEX_SHADER_BIT = 0x00000008, /// Vertex shading
Jesse Hallae38f732015-11-19 21:32:50 -0800980 VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT = 0x00000010, /// Tessellation control shading
981 VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT = 0x00000020, /// Tessellation evaluation shading
Jesse Halld27f6aa2015-08-15 17:58:48 -0700982 VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT = 0x00000040, /// Geometry shading
983 VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT = 0x00000080, /// Fragment shading
984 VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT = 0x00000100, /// Early fragment (depth/stencil) tests
985 VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT = 0x00000200, /// Late fragment (depth/stencil) tests
986 VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT = 0x00000400, /// Color attachment writes
987 VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT = 0x00000800, /// Compute shading
988 VK_PIPELINE_STAGE_TRANSFER_BIT = 0x00001000, /// Transfer/copy operations
Jesse Hall543a7ff2016-01-08 16:38:30 -0800989 VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT = 0x00002000,
990 VK_PIPELINE_STAGE_HOST_BIT = 0x00004000, /// Indicates host (CPU) is a source/sink of the dependency
Jesse Halld27f6aa2015-08-15 17:58:48 -0700991
Jesse Hall543a7ff2016-01-08 16:38:30 -0800992 VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT = 0x00008000, /// All stages of the graphics pipeline
993 VK_PIPELINE_STAGE_ALL_COMMANDS_BIT = 0x00010000, /// All graphics, compute, copy, and transition commands
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700994}
995
996/// Render pass attachment description flags
Jesse Halld8bade02015-11-24 10:24:18 -0800997type VkFlags VkAttachmentDescriptionFlags
998bitfield VkAttachmentDescriptionFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700999 VK_ATTACHMENT_DESCRIPTION_MAY_ALIAS_BIT = 0x00000001, /// The attachment may alias physical memory of another attachment in the same renderpass
Jesse Halld27f6aa2015-08-15 17:58:48 -07001000}
1001
1002/// Subpass description flags
Jesse Halld8bade02015-11-24 10:24:18 -08001003type VkFlags VkSubpassDescriptionFlags
1004bitfield VkSubpassDescriptionFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001005}
1006
1007/// Command pool creation flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001008type VkFlags VkCommandPoolCreateFlags
1009bitfield VkCommandPoolCreateFlagBits {
1010 VK_COMMAND_POOL_CREATE_TRANSIENT_BIT = 0x00000001, /// Command buffers have a short lifetime
1011 VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT = 0x00000002, /// Command buffers may release their memory individually
Jesse Halld27f6aa2015-08-15 17:58:48 -07001012}
1013
1014/// Command pool reset flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001015type VkFlags VkCommandPoolResetFlags
1016bitfield VkCommandPoolResetFlagBits {
1017 VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT = 0x00000001, /// Release resources owned by the pool
Jesse Halld27f6aa2015-08-15 17:58:48 -07001018}
1019
Jesse Hall3fbc8562015-11-29 22:10:52 -08001020type VkFlags VkCommandBufferResetFlags
1021bitfield VkCommandBufferResetFlagBits {
1022 VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT = 0x00000001, /// Release resources owned by the buffer
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001023}
1024
Jesse Halld8bade02015-11-24 10:24:18 -08001025type VkFlags VkSampleCountFlags
1026bitfield VkSampleCountFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001027 VK_SAMPLE_COUNT_1_BIT = 0x00000001,
1028 VK_SAMPLE_COUNT_2_BIT = 0x00000002,
1029 VK_SAMPLE_COUNT_4_BIT = 0x00000004,
1030 VK_SAMPLE_COUNT_8_BIT = 0x00000008,
1031 VK_SAMPLE_COUNT_16_BIT = 0x00000010,
1032 VK_SAMPLE_COUNT_32_BIT = 0x00000020,
1033 VK_SAMPLE_COUNT_64_BIT = 0x00000040,
1034}
1035
Jesse Halld8bade02015-11-24 10:24:18 -08001036type VkFlags VkStencilFaceFlags
1037bitfield VkStencilFaceFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001038 VK_STENCIL_FACE_FRONT_BIT = 0x00000001, /// Front face
1039 VK_STENCIL_FACE_BACK_BIT = 0x00000002, /// Back face
Jesse Hallc7467b72015-11-29 21:05:26 -08001040 VK_STENCIL_FRONT_AND_BACK = 0x00000003,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001041}
1042
Jesse Halla6429252015-11-29 18:59:42 -08001043/// Instance creation flags
1044type VkFlags VkInstanceCreateFlags
1045//bitfield VkInstanceCreateFlagBits {
1046//}
1047
1048/// Device creation flags
1049type VkFlags VkDeviceCreateFlags
1050//bitfield VkDeviceCreateFlagBits {
1051//}
1052
1053/// Device queue creation flags
1054type VkFlags VkDeviceQueueCreateFlags
1055//bitfield VkDeviceQueueCreateFlagBits {
1056//}
1057
1058/// Query pool creation flags
1059type VkFlags VkQueryPoolCreateFlags
1060//bitfield VkQueryPoolCreateFlagBits {
1061//}
1062
1063/// Buffer view creation flags
1064type VkFlags VkBufferViewCreateFlags
1065//bitfield VkBufferViewCreateFlagBits {
1066//}
1067
1068/// Pipeline cache creation flags
1069type VkFlags VkPipelineCacheCreateFlags
1070//bitfield VkPipelineCacheCreateFlagBits {
1071//}
1072
1073/// Pipeline shader stage creation flags
1074type VkFlags VkPipelineShaderStageCreateFlags
1075//bitfield VkPipelineShaderStageCreateFlagBits {
1076//}
1077
1078/// Descriptor set layout creation flags
1079type VkFlags VkDescriptorSetLayoutCreateFlags
1080//bitfield VkDescriptorSetLayoutCreateFlagBits {
1081//}
1082
1083/// Pipeline vertex input state creation flags
1084type VkFlags VkPipelineVertexInputStateCreateFlags
1085//bitfield VkPipelineVertexInputStateCreateFlagBits {
1086//}
1087
1088/// Pipeline input assembly state creation flags
1089type VkFlags VkPipelineInputAssemblyStateCreateFlags
1090//bitfield VkPipelineInputAssemblyStateCreateFlagBits {
1091//}
1092
1093/// Tessellation state creation flags
1094type VkFlags VkPipelineTessellationStateCreateFlags
1095//bitfield VkPipelineTessellationStateCreateFlagBits {
1096//}
1097
1098/// Viewport state creation flags
1099type VkFlags VkPipelineViewportStateCreateFlags
1100//bitfield VkPipelineViewportStateCreateFlagBits {
1101//}
1102
Jesse Hall3fbc8562015-11-29 22:10:52 -08001103/// Rasterization state creation flags
1104type VkFlags VkPipelineRasterizationStateCreateFlags
1105//bitfield VkPipelineRasterizationStateCreateFlagBits {
Jesse Halla6429252015-11-29 18:59:42 -08001106//}
1107
1108/// Multisample state creation flags
1109type VkFlags VkPipelineMultisampleStateCreateFlags
1110//bitfield VkPipelineMultisampleStateCreateFlagBits {
1111//}
1112
1113/// Color blend state creation flags
1114type VkFlags VkPipelineColorBlendStateCreateFlags
1115//bitfield VkPipelineColorBlendStateCreateFlagBits {
1116//}
1117
1118/// Depth/stencil state creation flags
1119type VkFlags VkPipelineDepthStencilStateCreateFlags
1120//bitfield VkPipelineDepthStencilStateCreateFlagBits {
1121//}
1122
1123/// Dynamic state creation flags
1124type VkFlags VkPipelineDynamicStateCreateFlags
1125//bitfield VkPipelineDynamicStateCreateFlagBits {
1126//}
1127
1128/// Pipeline layout creation flags
1129type VkFlags VkPipelineLayoutCreateFlags
1130//bitfield VkPipelineLayoutCreateFlagBits {
1131//}
1132
1133/// Sampler creation flags
1134type VkFlags VkSamplerCreateFlags
1135//bitfield VkSamplerCreateFlagBits {
1136//}
1137
1138/// Render pass creation flags
1139type VkFlags VkRenderPassCreateFlags
1140//bitfield VkRenderPassCreateFlagBits {
1141//}
1142
1143/// Framebuffer creation flags
1144type VkFlags VkFramebufferCreateFlags
1145//bitfield VkFramebufferCreateFlagBits {
1146//}
1147
Jesse Halldc6d36c2015-11-29 19:12:15 -08001148/// Dependency flags
1149type VkFlags VkDependencyFlags
1150bitfield VkDependencyFlagBits {
1151 VK_DEPENDENCY_BY_REGION_BIT = 0x00000001,
1152}
1153
Jesse Hallc7467b72015-11-29 21:05:26 -08001154/// Cull mode flags
1155type VkFlags VkCullModeFlags
1156bitfield VkCullModeFlagBits {
1157 VK_CULL_MODE_NONE = 0x00000000,
1158 VK_CULL_MODE_FRONT_BIT = 0x00000001,
1159 VK_CULL_MODE_BACK_BIT = 0x00000002,
1160 VK_CULL_MODE_FRONT_AND_BACK = 0x00000003,
1161}
1162
Jesse Hall523db342015-11-30 21:12:55 -08001163@extension("VK_KHR_surface")
Jesse Halld8bade02015-11-24 10:24:18 -08001164type VkFlags VkSurfaceTransformFlagsKHR
Jesse Hall523db342015-11-30 21:12:55 -08001165@extension("VK_KHR_surface")
Jesse Halld8bade02015-11-24 10:24:18 -08001166bitfield VkSurfaceTransformFlagBitsKHR {
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001167 VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR = 0x00000001,
Jesse Hall9ba8bc82015-11-30 16:22:16 -08001168 VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR = 0x00000002,
1169 VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR = 0x00000004,
1170 VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR = 0x00000008,
1171 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR = 0x00000010,
1172 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR = 0x00000020,
1173 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR = 0x00000040,
1174 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR = 0x00000080,
1175 VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR = 0x00000100,
Michael Lentine88594d72015-11-12 12:49:45 -08001176}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001177
Jesse Hall523db342015-11-30 21:12:55 -08001178@extension("VK_KHR_surface")
Jesse Halla6429252015-11-29 18:59:42 -08001179type VkFlags VkCompositeAlphaFlagsKHR
Jesse Hall523db342015-11-30 21:12:55 -08001180@extension("VK_KHR_surface")
Jesse Halla6429252015-11-29 18:59:42 -08001181bitfield VkCompositeAlphaFlagBitsKHR {
1182 VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR = 0x00000001,
1183 VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR = 0x00000002,
1184 VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR = 0x00000004,
1185 VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR = 0x00000008,
1186}
1187
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001188@extension("VK_KHR_swapchain")
1189type VkFlags VkSwapchainCreateFlagsKHR
1190//@extension("VK_KHR_swapchain")
1191//bitfield VkSwapchainCreateFlagBitsKHR {
1192//}
1193
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001194@extension("VK_KHR_display")
Jesse Halld8bade02015-11-24 10:24:18 -08001195type VkFlags VkDisplayPlaneAlphaFlagsKHR
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001196@extension("VK_KHR_display")
Jesse Halld8bade02015-11-24 10:24:18 -08001197bitfield VkDisplayPlaneAlphaFlagBitsKHR {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001198 VK_DISPLAY_PLANE_ALPHA_OPAQUE_BIT_KHR = 0x00000001,
1199 VK_DISPLAY_PLANE_ALPHA_GLOBAL_BIT_KHR = 0x00000002,
1200 VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_BIT_KHR = 0x00000004,
1201 VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_PREMULTIPLIED_BIT_KHR = 0x00000008,
Jesse Hall1356b0d2015-11-23 17:24:58 -08001202}
1203
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001204@extension("VK_KHR_display")
1205type VkFlags VkDisplaySurfaceCreateFlagsKHR
1206//@extension("VK_KHR_display")
1207//bitfield VkDisplaySurfaceCreateFlagBitsKHR {
1208//}
1209
Jesse Hall9ba8bc82015-11-30 16:22:16 -08001210@extension("VK_KHR_display")
1211type VkFlags VkDisplayModeCreateFlagsKHR
1212//@extension("VK_KHR_display")
1213//bitfield VkDisplayModeCreateFlagBitsKHR {
1214//}
1215
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001216@extension("VK_KHR_xlib_surface")
1217type VkFlags VkXlibSurfaceCreateFlagsKHR
1218//@extension("VK_KHR_xlib_surface")
1219//bitfield VkXlibSurfaceCreateFlagBitsKHR {
1220//}
1221
1222@extension("VK_KHR_xcb_surface")
1223type VkFlags VkXcbSurfaceCreateFlagsKHR
1224//@extension("VK_KHR_xcb_surface")
1225//bitfield VkXcbSurfaceCreateFlagBitsKHR {
1226//}
1227
1228@extension("VK_KHR_wayland_surface")
1229type VkFlags VkWaylandSurfaceCreateFlagsKHR
1230//@extension("VK_KHR_wayland_surface")
1231//bitfield VkWaylandSurfaceCreateFlagBitsKHR {
1232//}
1233
1234@extension("VK_KHR_mir_surface")
1235type VkFlags VkMirSurfaceCreateFlagsKHR
1236//@extension("VK_KHR_mir_surface")
1237//bitfield VkMirSurfaceCreateFlagBitsKHR {
1238//}
1239
1240@extension("VK_KHR_android_surface")
1241type VkFlags VkAndroidSurfaceCreateFlagsKHR
1242//@extension("VK_KHR_android_surface")
1243//bitfield VkAndroidSurfaceCreateFlagBitsKHR {
1244//}
1245
1246@extension("VK_KHR_win32_surface")
1247type VkFlags VkWin32SurfaceCreateFlagsKHR
1248//@extension("VK_KHR_win32_surface")
1249//bitfield VkWin32SurfaceCreateFlagBitsKHR {
1250//}
1251
Jesse Hall1356b0d2015-11-23 17:24:58 -08001252
Jesse Halld27f6aa2015-08-15 17:58:48 -07001253//////////////////
1254// Structures //
1255//////////////////
1256
1257class VkOffset2D {
1258 s32 x
1259 s32 y
1260}
1261
1262class VkOffset3D {
1263 s32 x
1264 s32 y
1265 s32 z
1266}
1267
1268class VkExtent2D {
1269 s32 width
1270 s32 height
1271}
1272
1273class VkExtent3D {
1274 s32 width
1275 s32 height
1276 s32 depth
1277}
1278
1279class VkViewport {
Jesse Hall65ab5522015-11-30 00:07:16 -08001280 f32 x
1281 f32 y
Jesse Halld27f6aa2015-08-15 17:58:48 -07001282 f32 width
1283 f32 height
1284 f32 minDepth
1285 f32 maxDepth
1286}
1287
1288class VkRect2D {
1289 VkOffset2D offset
1290 VkExtent2D extent
1291}
1292
Jesse Halla15a4bf2015-11-19 22:48:02 -08001293class VkClearRect {
1294 VkRect2D rect
1295 u32 baseArrayLayer
Jesse Hall3fbc8562015-11-29 22:10:52 -08001296 u32 layerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001297}
1298
Jesse Hall65ab5522015-11-30 00:07:16 -08001299class VkComponentMapping {
1300 VkComponentSwizzle r
1301 VkComponentSwizzle g
1302 VkComponentSwizzle b
1303 VkComponentSwizzle a
Jesse Halld27f6aa2015-08-15 17:58:48 -07001304}
1305
1306class VkPhysicalDeviceProperties {
1307 u32 apiVersion
1308 u32 driverVersion
Jesse Hall65ab5522015-11-30 00:07:16 -08001309 u32 vendorID
1310 u32 deviceID
Jesse Halld27f6aa2015-08-15 17:58:48 -07001311 VkPhysicalDeviceType deviceType
Jesse Hall65ab5522015-11-30 00:07:16 -08001312 char[VK_MAX_PHYSICAL_DEVICE_NAME_SIZE] deviceName
1313 u8[VK_UUID_SIZE] pipelineCacheUUID
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001314 VkPhysicalDeviceLimits limits
1315 VkPhysicalDeviceSparseProperties sparseProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07001316}
1317
1318class VkExtensionProperties {
Jesse Hall65ab5522015-11-30 00:07:16 -08001319 char[VK_MAX_EXTENSION_NAME_SIZE] extensionName /// extension name
Jesse Halld27f6aa2015-08-15 17:58:48 -07001320 u32 specVersion /// version of the extension specification implemented
1321}
1322
1323class VkLayerProperties {
Jesse Hall65ab5522015-11-30 00:07:16 -08001324 char[VK_MAX_EXTENSION_NAME_SIZE] layerName /// layer name
Jesse Hall3fbc8562015-11-29 22:10:52 -08001325 u32 specVersion /// version of the layer specification implemented
1326 u32 implementationVersion /// build or release version of the layer's library
Jesse Hall65ab5522015-11-30 00:07:16 -08001327 char[VK_MAX_DESCRIPTION_SIZE] description /// Free-form description of the layer
Jesse Halld27f6aa2015-08-15 17:58:48 -07001328}
1329
Jesse Halla366a512015-11-19 22:30:07 -08001330class VkSubmitInfo {
Jesse Hall03b6fe12015-11-24 12:44:21 -08001331 VkStructureType sType /// Type of structure. Should be VK_STRUCTURE_TYPE_SUBMIT_INFO
1332 const void* pNext /// Next structure in chain
1333 u32 waitSemaphoreCount
Jesse Halla366a512015-11-19 22:30:07 -08001334 const VkSemaphore* pWaitSemaphores
Jesse Hall543a7ff2016-01-08 16:38:30 -08001335 const VkPipelineStageFlags* pWaitDstStageMask
Jesse Hall03b6fe12015-11-24 12:44:21 -08001336 u32 commandBufferCount
Jesse Hall3fbc8562015-11-29 22:10:52 -08001337 const VkCommandBuffer* pCommandBuffers
Jesse Hall03b6fe12015-11-24 12:44:21 -08001338 u32 signalSemaphoreCount
Jesse Halla366a512015-11-19 22:30:07 -08001339 const VkSemaphore* pSignalSemaphores
1340}
1341
Jesse Halld27f6aa2015-08-15 17:58:48 -07001342class VkApplicationInfo {
1343 VkStructureType sType /// Type of structure. Should be VK_STRUCTURE_TYPE_APPLICATION_INFO
1344 const void* pNext /// Next structure in chain
Jesse Hall3fbc8562015-11-29 22:10:52 -08001345 const char* pApplicationName
1346 u32 applicationVersion
Jesse Halld27f6aa2015-08-15 17:58:48 -07001347 const char* pEngineName
1348 u32 engineVersion
1349 u32 apiVersion
1350}
1351
Jesse Hall3fbc8562015-11-29 22:10:52 -08001352class VkAllocationCallbacks {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001353 void* pUserData
Jesse Hall3fbc8562015-11-29 22:10:52 -08001354 PFN_vkAllocationFunction pfnAllocation
1355 PFN_vkReallocationFunction pfnReallocation
Jesse Halld27f6aa2015-08-15 17:58:48 -07001356 PFN_vkFreeFunction pfnFree
Jesse Hall3fbc8562015-11-29 22:10:52 -08001357 PFN_vkInternalAllocationNotification pfnInternalAllocation
Jesse Hall03b6fe12015-11-24 12:44:21 -08001358 PFN_vkInternalFreeNotification pfnInternalFree
Jesse Halld27f6aa2015-08-15 17:58:48 -07001359}
1360
1361class VkDeviceQueueCreateInfo {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001362 VkStructureType sStype /// Should be VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO
1363 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001364 VkDeviceQueueCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001365 u32 queueFamilyIndex
Jesse Halldba27f72015-11-30 14:25:46 -08001366 u32 queueCount
Jesse Hallfbf97b02015-11-20 14:17:03 -08001367 const f32* pQueuePriorities
Jesse Halld27f6aa2015-08-15 17:58:48 -07001368}
1369
1370class VkDeviceCreateInfo {
1371 VkStructureType sType /// Should be VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO
1372 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001373 VkDeviceCreateFlags flags
Jesse Halldba27f72015-11-30 14:25:46 -08001374 u32 queueCreateInfoCount
1375 const VkDeviceQueueCreateInfo* pQueueCreateInfos
Jesse Hall03b6fe12015-11-24 12:44:21 -08001376 u32 enabledLayerNameCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001377 const char* const* ppEnabledLayerNames /// Ordered list of layer names to be enabled
Jesse Hall03b6fe12015-11-24 12:44:21 -08001378 u32 enabledExtensionNameCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001379 const char* const* ppEnabledExtensionNames
1380 const VkPhysicalDeviceFeatures* pEnabledFeatures
Jesse Halld27f6aa2015-08-15 17:58:48 -07001381}
1382
1383class VkInstanceCreateInfo {
1384 VkStructureType sType /// Should be VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO
1385 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001386 VkInstanceCreateFlags flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001387 const VkApplicationInfo* pApplicationInfo
Jesse Hall03b6fe12015-11-24 12:44:21 -08001388 u32 enabledLayerNameCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001389 const char* const* ppEnabledLayerNames /// Ordered list of layer names to be enabled
Jesse Hall03b6fe12015-11-24 12:44:21 -08001390 u32 enabledExtensionNameCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001391 const char* const* ppEnabledExtensionNames /// Extension names to be enabled
1392}
1393
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001394class VkQueueFamilyProperties {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001395 VkQueueFlags queueFlags /// Queue flags
1396 u32 queueCount
Jesse Hallacfa5342015-11-19 21:51:33 -08001397 u32 timestampValidBits
Jesse Hall65ab5522015-11-30 00:07:16 -08001398 VkExtent3D minImageTransferGranularity
Jesse Halld27f6aa2015-08-15 17:58:48 -07001399}
1400
1401class VkPhysicalDeviceMemoryProperties {
1402 u32 memoryTypeCount
1403 VkMemoryType[VK_MAX_MEMORY_TYPES] memoryTypes
1404 u32 memoryHeapCount
1405 VkMemoryHeap[VK_MAX_MEMORY_HEAPS] memoryHeaps
1406}
1407
Jesse Hall3fbc8562015-11-29 22:10:52 -08001408class VkMemoryAllocateInfo {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001409 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07001410 const void* pNext /// Pointer to next structure
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001411 VkDeviceSize allocationSize /// Size of memory allocation
Jesse Halld27f6aa2015-08-15 17:58:48 -07001412 u32 memoryTypeIndex /// Index of the of the memory type to allocate from
1413}
1414
1415class VkMemoryRequirements {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001416 VkDeviceSize size /// Specified in bytes
1417 VkDeviceSize alignment /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001418 u32 memoryTypeBits /// Bitfield of the allowed memory type indices into memoryTypes[] for this object
1419}
1420
1421class VkSparseImageFormatProperties {
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001422 VkImageAspectFlagBits aspectMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001423 VkExtent3D imageGranularity
1424 VkSparseImageFormatFlags flags
1425}
1426
1427class VkSparseImageMemoryRequirements {
Jesse Hallb00daad2015-11-29 19:46:20 -08001428 VkSparseImageFormatProperties formatProperties
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001429 u32 imageMipTailFirstLod
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001430 VkDeviceSize imageMipTailSize /// Specified in bytes, must be a multiple of image block size / alignment
1431 VkDeviceSize imageMipTailOffset /// Specified in bytes, must be a multiple of image block size / alignment
1432 VkDeviceSize imageMipTailStride /// Specified in bytes, must be a multiple of image block size / alignment
Jesse Halld27f6aa2015-08-15 17:58:48 -07001433}
1434
1435class VkMemoryType {
1436 VkMemoryPropertyFlags propertyFlags /// Memory properties of this memory type
1437 u32 heapIndex /// Index of the memory heap allocations of this memory type are taken from
1438}
1439
1440class VkMemoryHeap {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001441 VkDeviceSize size /// Available memory in the heap
Jesse Halld27f6aa2015-08-15 17:58:48 -07001442 VkMemoryHeapFlags flags /// Flags for the heap
1443}
1444
1445class VkMappedMemoryRange {
1446 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE
1447 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08001448 VkDeviceMemory memory /// Mapped memory object
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001449 VkDeviceSize offset /// Offset within the mapped memory the range starts from
1450 VkDeviceSize size /// Size of the range within the mapped memory
Jesse Halld27f6aa2015-08-15 17:58:48 -07001451}
1452
1453class VkFormatProperties {
1454 VkFormatFeatureFlags linearTilingFeatures /// Format features in case of linear tiling
1455 VkFormatFeatureFlags optimalTilingFeatures /// Format features in case of optimal tiling
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001456 VkFormatFeatureFlags bufferFeatures /// Format features supported by buffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07001457}
1458
1459class VkImageFormatProperties {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001460 VkExtent3D maxExtent /// max image dimensions for this resource type
1461 u32 maxMipLevels /// max number of mipmap levels for this resource type
Jesse Halla15a4bf2015-11-19 22:48:02 -08001462 u32 maxArrayLayers /// max array layers for this resource type
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001463 VkSampleCountFlags sampleCounts /// supported sample counts for this resource type
1464 VkDeviceSize maxResourceSize /// max size (in bytes) of this resource type
1465}
1466
Jesse Halla15a4bf2015-11-19 22:48:02 -08001467class VkDescriptorImageInfo {
1468 VkSampler sampler
1469 VkImageView imageView
1470 VkImageLayout imageLayout
1471}
1472
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001473class VkDescriptorBufferInfo {
1474 VkBuffer buffer /// Buffer used for this descriptor when the descriptor is UNIFORM_BUFFER[_DYNAMIC]
1475 VkDeviceSize offset /// Base offset from buffer start in bytes to update in the descriptor set.
1476 VkDeviceSize range /// Size in bytes of the buffer resource for this descriptor update.
Jesse Halld27f6aa2015-08-15 17:58:48 -07001477}
1478
Jesse Halld27f6aa2015-08-15 17:58:48 -07001479class VkWriteDescriptorSet {
1480 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET
1481 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08001482 VkDescriptorSet dstSet /// Destination descriptor set
1483 u32 dstBinding /// Binding within the destination descriptor set to write
1484 u32 dstArrayElement /// Array element within the destination binding to write
Jesse Hall03b6fe12015-11-24 12:44:21 -08001485 u32 descriptorCount /// Number of descriptors to write (determines the size of the array pointed by <pDescriptors>)
Jesse Halld27f6aa2015-08-15 17:58:48 -07001486 VkDescriptorType descriptorType /// Descriptor type to write (determines which fields of the array pointed by <pDescriptors> are going to be used)
Jesse Hallfbf97b02015-11-20 14:17:03 -08001487 const VkDescriptorImageInfo* pImageInfo
1488 const VkDescriptorBufferInfo* pBufferInfo
1489 const VkBufferView* pTexelBufferView
Jesse Halld27f6aa2015-08-15 17:58:48 -07001490}
1491
1492class VkCopyDescriptorSet {
1493 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET
1494 const void* pNext /// Pointer to next structure
1495 VkDescriptorSet srcSet /// Source descriptor set
1496 u32 srcBinding /// Binding within the source descriptor set to copy from
1497 u32 srcArrayElement /// Array element within the source binding to copy from
Jesse Hall3fbc8562015-11-29 22:10:52 -08001498 VkDescriptorSet dstSet /// Destination descriptor set
1499 u32 dstBinding /// Binding within the destination descriptor set to copy to
1500 u32 dstArrayElement /// Array element within the destination binding to copy to
Jesse Hall03b6fe12015-11-24 12:44:21 -08001501 u32 descriptorCount /// Number of descriptors to copy
Jesse Halld27f6aa2015-08-15 17:58:48 -07001502}
1503
1504class VkBufferCreateInfo {
1505 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO
1506 const void* pNext /// Pointer to next structure.
Jesse Halla6429252015-11-29 18:59:42 -08001507 VkBufferCreateFlags flags /// Buffer creation flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001508 VkDeviceSize size /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001509 VkBufferUsageFlags usage /// Buffer usage flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001510 VkSharingMode sharingMode
Jesse Hall03b6fe12015-11-24 12:44:21 -08001511 u32 queueFamilyIndexCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001512 const u32* pQueueFamilyIndices
1513}
1514
1515class VkBufferViewCreateInfo {
1516 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO
1517 const void* pNext /// Pointer to next structure.
Jesse Halla6429252015-11-29 18:59:42 -08001518 VkBufferViewCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001519 VkBuffer buffer
Jesse Halld27f6aa2015-08-15 17:58:48 -07001520 VkFormat format /// Optionally specifies format of elements
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001521 VkDeviceSize offset /// Specified in bytes
1522 VkDeviceSize range /// View size specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001523}
1524
1525class VkImageSubresource {
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001526 VkImageAspectFlagBits aspectMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001527 u32 mipLevel
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001528 u32 arrayLayer
Jesse Halld27f6aa2015-08-15 17:58:48 -07001529}
1530
1531class VkImageSubresourceRange {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001532 VkImageAspectFlags aspectMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001533 u32 baseMipLevel
Jesse Hall3fbc8562015-11-29 22:10:52 -08001534 u32 levelCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001535 u32 baseArrayLayer
Jesse Hall3fbc8562015-11-29 22:10:52 -08001536 u32 layerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001537}
1538
1539class VkMemoryBarrier {
1540 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MEMORY_BARRIER
1541 const void* pNext /// Pointer to next structure.
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001542 VkAccessFlags srcAccessMask
1543 VkAccessFlags dstAccessMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001544}
1545
1546class VkBufferMemoryBarrier {
1547 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER
1548 const void* pNext /// Pointer to next structure.
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001549 VkAccessFlags srcAccessMask
1550 VkAccessFlags dstAccessMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001551 u32 srcQueueFamilyIndex /// Queue family to transition ownership from
Jesse Hall3fbc8562015-11-29 22:10:52 -08001552 u32 dstQueueFamilyIndex /// Queue family to transition ownership to
Jesse Halld27f6aa2015-08-15 17:58:48 -07001553 VkBuffer buffer /// Buffer to sync
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001554 VkDeviceSize offset /// Offset within the buffer to sync
1555 VkDeviceSize size /// Amount of bytes to sync
Jesse Halld27f6aa2015-08-15 17:58:48 -07001556}
1557
1558class VkImageMemoryBarrier {
1559 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER
1560 const void* pNext /// Pointer to next structure.
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001561 VkAccessFlags srcAccessMask
1562 VkAccessFlags dstAccessMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001563 VkImageLayout oldLayout /// Current layout of the image
1564 VkImageLayout newLayout /// New layout to transition the image to
1565 u32 srcQueueFamilyIndex /// Queue family to transition ownership from
Jesse Hall3fbc8562015-11-29 22:10:52 -08001566 u32 dstQueueFamilyIndex /// Queue family to transition ownership to
Jesse Halld27f6aa2015-08-15 17:58:48 -07001567 VkImage image /// Image to sync
1568 VkImageSubresourceRange subresourceRange /// Subresource range to sync
1569}
1570
1571class VkImageCreateInfo {
1572 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO
1573 const void* pNext /// Pointer to next structure.
Jesse Halla6429252015-11-29 18:59:42 -08001574 VkImageCreateFlags flags /// Image creation flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001575 VkImageType imageType
1576 VkFormat format
1577 VkExtent3D extent
1578 u32 mipLevels
Jesse Halla15a4bf2015-11-19 22:48:02 -08001579 u32 arrayLayers
Jesse Hall091ed9e2015-11-30 00:55:29 -08001580 VkSampleCountFlagBits samples
Jesse Halld27f6aa2015-08-15 17:58:48 -07001581 VkImageTiling tiling
1582 VkImageUsageFlags usage /// Image usage flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001583 VkSharingMode sharingMode /// Cross-queue-family sharing mode
Jesse Hall03b6fe12015-11-24 12:44:21 -08001584 u32 queueFamilyIndexCount /// Number of queue families to share across
Jesse Halld27f6aa2015-08-15 17:58:48 -07001585 const u32* pQueueFamilyIndices /// Array of queue family indices to share across
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001586 VkImageLayout initialLayout /// Initial image layout for all subresources
Jesse Halld27f6aa2015-08-15 17:58:48 -07001587}
1588
1589class VkSubresourceLayout {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001590 VkDeviceSize offset /// Specified in bytes
1591 VkDeviceSize size /// Specified in bytes
1592 VkDeviceSize rowPitch /// Specified in bytes
Jesse Hall543a7ff2016-01-08 16:38:30 -08001593 VkDeviceSize arrayPitch /// Specified in bytes
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001594 VkDeviceSize depthPitch /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001595}
1596
1597class VkImageViewCreateInfo {
1598 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO
1599 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001600 VkImageViewCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001601 VkImage image
1602 VkImageViewType viewType
1603 VkFormat format
Jesse Hall65ab5522015-11-30 00:07:16 -08001604 VkComponentMapping components
Jesse Halld27f6aa2015-08-15 17:58:48 -07001605 VkImageSubresourceRange subresourceRange
Jesse Halld27f6aa2015-08-15 17:58:48 -07001606}
1607
1608class VkBufferCopy {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001609 VkDeviceSize srcOffset /// Specified in bytes
Jesse Hall3fbc8562015-11-29 22:10:52 -08001610 VkDeviceSize dstOffset /// Specified in bytes
Jesse Hallb00daad2015-11-29 19:46:20 -08001611 VkDeviceSize size /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001612}
1613
Jesse Halla6429252015-11-29 18:59:42 -08001614class VkSparseMemoryBind {
Jesse Hallb00daad2015-11-29 19:46:20 -08001615 VkDeviceSize resourceOffset /// Specified in bytes
1616 VkDeviceSize size /// Specified in bytes
Jesse Hall3fbc8562015-11-29 22:10:52 -08001617 VkDeviceMemory memory
1618 VkDeviceSize memoryOffset /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001619 VkSparseMemoryBindFlags flags
1620}
1621
Jesse Halla6429252015-11-29 18:59:42 -08001622class VkSparseImageMemoryBind {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001623 VkImageSubresource subresource
1624 VkOffset3D offset
1625 VkExtent3D extent
Jesse Hall3fbc8562015-11-29 22:10:52 -08001626 VkDeviceMemory memory
1627 VkDeviceSize memoryOffset /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001628 VkSparseMemoryBindFlags flags
1629}
1630
Jesse Halla6429252015-11-29 18:59:42 -08001631class VkSparseBufferMemoryBindInfo {
1632 VkBuffer buffer
1633 u32 bindCount
1634 const VkSparseMemoryBind* pBinds
1635}
1636
1637class VkSparseImageOpaqueMemoryBindInfo {
1638 VkImage image
1639 u32 bindCount
1640 const VkSparseMemoryBind* pBinds
1641}
1642
1643class VkSparseImageMemoryBindInfo {
1644 VkImage image
1645 u32 bindCount
1646 const VkSparseMemoryBind* pBinds
1647}
1648
1649class VkBindSparseInfo {
1650 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BIND_SPARSE_INFO
1651 const void* pNext
1652 u32 waitSemaphoreCount
1653 const VkSemaphore* pWaitSemaphores
1654 u32 numBufferBinds
1655 const VkSparseBufferMemoryBindInfo* pBufferBinds
1656 u32 numImageOpaqueBinds
1657 const VkSparseImageOpaqueMemoryBindInfo* pImageOpaqueBinds
1658 u32 numImageBinds
1659 const VkSparseImageMemoryBindInfo* pImageBinds
1660 u32 signalSemaphoreCount
1661 const VkSemaphore* pSignalSemaphores
1662}
1663
Jesse Hall65ab5522015-11-30 00:07:16 -08001664class VkImageSubresourceLayers {
1665 VkImageAspectFlags aspectMask
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001666 u32 mipLevel
Jesse Halla15a4bf2015-11-19 22:48:02 -08001667 u32 baseArrayLayer
Jesse Hall3fbc8562015-11-29 22:10:52 -08001668 u32 layerCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001669}
1670
Jesse Halld27f6aa2015-08-15 17:58:48 -07001671class VkImageCopy {
Jesse Hall65ab5522015-11-30 00:07:16 -08001672 VkImageSubresourceLayers srcSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07001673 VkOffset3D srcOffset /// Specified in pixels for both compressed and uncompressed images
Jesse Hall65ab5522015-11-30 00:07:16 -08001674 VkImageSubresourceLayers dstSubresource
Jesse Hall3fbc8562015-11-29 22:10:52 -08001675 VkOffset3D dstOffset /// Specified in pixels for both compressed and uncompressed images
Jesse Halld27f6aa2015-08-15 17:58:48 -07001676 VkExtent3D extent /// Specified in pixels for both compressed and uncompressed images
1677}
1678
1679class VkImageBlit {
Jesse Hall65ab5522015-11-30 00:07:16 -08001680 VkImageSubresourceLayers srcSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07001681 VkOffset3D srcOffset /// Specified in pixels for both compressed and uncompressed images
1682 VkExtent3D srcExtent /// Specified in pixels for both compressed and uncompressed images
Jesse Hall65ab5522015-11-30 00:07:16 -08001683 VkImageSubresourceLayers dstSubresource
Jesse Hall3fbc8562015-11-29 22:10:52 -08001684 VkOffset3D dstOffset /// Specified in pixels for both compressed and uncompressed images
1685 VkExtent3D dstExtent /// Specified in pixels for both compressed and uncompressed images
Jesse Halld27f6aa2015-08-15 17:58:48 -07001686}
1687
1688class VkBufferImageCopy {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001689 VkDeviceSize bufferOffset /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001690 u32 bufferRowLength /// Specified in texels
1691 u32 bufferImageHeight
Jesse Hall65ab5522015-11-30 00:07:16 -08001692 VkImageSubresourceLayers imageSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07001693 VkOffset3D imageOffset /// Specified in pixels for both compressed and uncompressed images
1694 VkExtent3D imageExtent /// Specified in pixels for both compressed and uncompressed images
1695}
1696
1697class VkImageResolve {
Jesse Hall65ab5522015-11-30 00:07:16 -08001698 VkImageSubresourceLayers srcSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07001699 VkOffset3D srcOffset
Jesse Hall65ab5522015-11-30 00:07:16 -08001700 VkImageSubresourceLayers dstSubresource
Jesse Hall3fbc8562015-11-29 22:10:52 -08001701 VkOffset3D dstOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07001702 VkExtent3D extent
1703}
1704
1705class VkShaderModuleCreateInfo {
1706 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO
1707 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001708 VkShaderModuleCreateFlags flags /// Reserved
Jesse Halld27f6aa2015-08-15 17:58:48 -07001709 platform.size_t codeSize /// Specified in bytes
Jesse Halla9bb62b2015-11-21 19:31:56 -08001710 const u32* pCode /// Binary code of size codeSize
Jesse Halld27f6aa2015-08-15 17:58:48 -07001711}
1712
Jesse Halld27f6aa2015-08-15 17:58:48 -07001713class VkDescriptorSetLayoutBinding {
Jesse Hall091ed9e2015-11-30 00:55:29 -08001714 u32 binding
Jesse Halld27f6aa2015-08-15 17:58:48 -07001715 VkDescriptorType descriptorType /// Type of the descriptors in this binding
Jesse Halldba27f72015-11-30 14:25:46 -08001716 u32 descriptorCount /// Number of descriptors in this binding
Jesse Halld27f6aa2015-08-15 17:58:48 -07001717 VkShaderStageFlags stageFlags /// Shader stages this binding is visible to
1718 const VkSampler* pImmutableSamplers /// Immutable samplers (used if descriptor type is SAMPLER or COMBINED_IMAGE_SAMPLER, is either NULL or contains <count> number of elements)
1719}
1720
1721class VkDescriptorSetLayoutCreateInfo {
1722 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO
1723 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001724 VkDescriptorSetLayoutCreateFlags flags
Jesse Hall03b6fe12015-11-24 12:44:21 -08001725 u32 bindingCount /// Number of bindings in the descriptor set layout
Jesse Hall543a7ff2016-01-08 16:38:30 -08001726 const VkDescriptorSetLayoutBinding* pBindings /// Array of descriptor set layout bindings
Jesse Halld27f6aa2015-08-15 17:58:48 -07001727}
1728
Jesse Hall65ab5522015-11-30 00:07:16 -08001729class VkDescriptorPoolSize {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001730 VkDescriptorType type
Jesse Hall03b6fe12015-11-24 12:44:21 -08001731 u32 descriptorCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001732}
1733
1734class VkDescriptorPoolCreateInfo {
1735 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO
1736 const void* pNext /// Pointer to next structure
Jesse Hallfbf97b02015-11-20 14:17:03 -08001737 VkDescriptorPoolCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001738 u32 maxSets
Jesse Hall65ab5522015-11-30 00:07:16 -08001739 u32 poolSizeCount
1740 const VkDescriptorPoolSize* pPoolSizes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001741}
1742
Jesse Hall3fbc8562015-11-29 22:10:52 -08001743class VkDescriptorSetAllocateInfo {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001744 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO
Jesse Hallfbf97b02015-11-20 14:17:03 -08001745 const void* pNext /// Pointer to next structure
1746 VkDescriptorPool descriptorPool
Jesse Hall03b6fe12015-11-24 12:44:21 -08001747 u32 setCount
Jesse Hallfbf97b02015-11-20 14:17:03 -08001748 const VkDescriptorSetLayout* pSetLayouts
1749}
1750
Jesse Halld27f6aa2015-08-15 17:58:48 -07001751class VkSpecializationMapEntry {
Jesse Hall65ab5522015-11-30 00:07:16 -08001752 u32 constantID /// The SpecConstant ID specified in the BIL
Jesse Halld27f6aa2015-08-15 17:58:48 -07001753 u32 offset /// Offset of the value in the data block
Jesse Hallb00daad2015-11-29 19:46:20 -08001754 platform.size_t size /// Size in bytes of the SpecConstant
Jesse Halld27f6aa2015-08-15 17:58:48 -07001755}
1756
1757class VkSpecializationInfo {
1758 u32 mapEntryCount /// Number of entries in the map
Jesse Hallb00daad2015-11-29 19:46:20 -08001759 const VkSpecializationMapEntry* pMapEntries /// Array of map entries
Jesse Halld27f6aa2015-08-15 17:58:48 -07001760 platform.size_t dataSize /// Size in bytes of pData
1761 const void* pData /// Pointer to SpecConstant data
1762}
1763
1764class VkPipelineShaderStageCreateInfo {
1765 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO
1766 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001767 VkPipelineShaderStageCreateFlags flags
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001768 VkShaderStageFlagBits stage
1769 VkShaderModule module
1770 const char* pName
Jesse Halld27f6aa2015-08-15 17:58:48 -07001771 const VkSpecializationInfo* pSpecializationInfo
1772}
1773
1774class VkComputePipelineCreateInfo {
1775 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO
1776 const void* pNext /// Pointer to next structure
Jesse Halld27f6aa2015-08-15 17:58:48 -07001777 VkPipelineCreateFlags flags /// Pipeline creation flags
Jesse Halla6429252015-11-29 18:59:42 -08001778 VkPipelineShaderStageCreateInfo stage
Jesse Halld27f6aa2015-08-15 17:58:48 -07001779 VkPipelineLayout layout /// Interface layout of the pipeline
1780 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
1781 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
1782}
1783
1784class VkVertexInputBindingDescription {
Jesse Hallb00daad2015-11-29 19:46:20 -08001785 u32 binding /// Vertex buffer binding id
1786 u32 stride /// Distance between vertices in bytes (0 = no advancement)
Jesse Hall65ab5522015-11-30 00:07:16 -08001787 VkVertexInputRate inputRate /// Rate at which binding is incremented
Jesse Halld27f6aa2015-08-15 17:58:48 -07001788}
1789
1790class VkVertexInputAttributeDescription {
Jesse Hallb00daad2015-11-29 19:46:20 -08001791 u32 location /// location of the shader vertex attrib
1792 u32 binding /// Vertex buffer binding id
1793 VkFormat format /// format of source data
1794 u32 offset /// Offset of first element in bytes from base of vertex
Jesse Halld27f6aa2015-08-15 17:58:48 -07001795}
1796
1797class VkPipelineVertexInputStateCreateInfo {
Jesse Hall03b6fe12015-11-24 12:44:21 -08001798 VkStructureType sType /// Should be VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO
1799 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001800 VkPipelineVertexInputStateCreateFlags flags
Jesse Hall03b6fe12015-11-24 12:44:21 -08001801 u32 vertexBindingDescriptionCount /// number of bindings
Jesse Halld27f6aa2015-08-15 17:58:48 -07001802 const VkVertexInputBindingDescription* pVertexBindingDescriptions
Jesse Hall03b6fe12015-11-24 12:44:21 -08001803 u32 vertexAttributeDescriptionCount /// number of attributes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001804 const VkVertexInputAttributeDescription* pVertexAttributeDescriptions
1805}
1806
1807class VkPipelineInputAssemblyStateCreateInfo {
1808 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO
1809 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001810 VkPipelineInputAssemblyStateCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001811 VkPrimitiveTopology topology
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001812 VkBool32 primitiveRestartEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07001813}
1814
1815class VkPipelineTessellationStateCreateInfo {
1816 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO
1817 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001818 VkPipelineTessellationStateCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001819 u32 patchControlPoints
1820}
1821
1822class VkPipelineViewportStateCreateInfo {
1823 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO
1824 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001825 VkPipelineViewportStateCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001826 u32 viewportCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001827 const VkViewport* pViewports
1828 u32 scissorCount
1829 const VkRect2D* pScissors
Jesse Halld27f6aa2015-08-15 17:58:48 -07001830}
1831
Jesse Hall3fbc8562015-11-29 22:10:52 -08001832class VkPipelineRasterizationStateCreateInfo {
Jesse Hall65ab5522015-11-30 00:07:16 -08001833 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07001834 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08001835 VkPipelineRasterizationStateCreateFlags flags
Jesse Hallae38f732015-11-19 21:32:50 -08001836 VkBool32 depthClampEnable
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001837 VkBool32 rasterizerDiscardEnable
Jesse Hall65ab5522015-11-30 00:07:16 -08001838 VkPolygonMode polygonMode /// optional (GL45)
Jesse Hallc7467b72015-11-29 21:05:26 -08001839 VkCullModeFlags cullMode
Jesse Halld27f6aa2015-08-15 17:58:48 -07001840 VkFrontFace frontFace
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001841 VkBool32 depthBiasEnable
Jesse Halla9bb62b2015-11-21 19:31:56 -08001842 f32 depthBiasConstantFactor
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001843 f32 depthBiasClamp
Jesse Halla9bb62b2015-11-21 19:31:56 -08001844 f32 depthBiasSlopeFactor
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001845 f32 lineWidth
Jesse Halld27f6aa2015-08-15 17:58:48 -07001846}
1847
1848class VkPipelineMultisampleStateCreateInfo {
1849 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO
1850 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001851 VkPipelineMultisampleStateCreateFlags flags
Jesse Hall091ed9e2015-11-30 00:55:29 -08001852 VkSampleCountFlagBits rasterizationSamples /// Number of samples used for rasterization
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001853 VkBool32 sampleShadingEnable /// optional (GL45)
Jesse Halld27f6aa2015-08-15 17:58:48 -07001854 f32 minSampleShading /// optional (GL45)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001855 const VkSampleMask* pSampleMask
Jesse Hallacfa5342015-11-19 21:51:33 -08001856 VkBool32 alphaToCoverageEnable
1857 VkBool32 alphaToOneEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07001858}
1859
1860class VkPipelineColorBlendAttachmentState {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001861 VkBool32 blendEnable
Jesse Hall65ab5522015-11-30 00:07:16 -08001862 VkBlendFactor srcColorBlendFactor
1863 VkBlendFactor dstColorBlendFactor
1864 VkBlendOp colorBlendOp
1865 VkBlendFactor srcAlphaBlendFactor
1866 VkBlendFactor dstAlphaBlendFactor
1867 VkBlendOp alphaBlendOp
1868 VkColorComponentFlags colorWriteMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001869}
1870
1871class VkPipelineColorBlendStateCreateInfo {
1872 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO
1873 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001874 VkPipelineColorBlendStateCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001875 VkBool32 logicOpEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07001876 VkLogicOp logicOp
1877 u32 attachmentCount /// # of pAttachments
1878 const VkPipelineColorBlendAttachmentState* pAttachments
Jesse Hallb00daad2015-11-29 19:46:20 -08001879 f32[4] blendConstants
Jesse Halld27f6aa2015-08-15 17:58:48 -07001880}
1881
1882class VkStencilOpState {
Jesse Hall65ab5522015-11-30 00:07:16 -08001883 VkStencilOp failOp
1884 VkStencilOp passOp
1885 VkStencilOp depthFailOp
1886 VkCompareOp compareOp
1887 u32 compareMask
1888 u32 writeMask
1889 u32 reference
Jesse Halld27f6aa2015-08-15 17:58:48 -07001890}
1891
1892class VkPipelineDepthStencilStateCreateInfo {
1893 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO
1894 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001895 VkPipelineDepthStencilStateCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001896 VkBool32 depthTestEnable
1897 VkBool32 depthWriteEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07001898 VkCompareOp depthCompareOp
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001899 VkBool32 depthBoundsTestEnable /// optional (depth_bounds_test)
1900 VkBool32 stencilTestEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07001901 VkStencilOpState front
1902 VkStencilOpState back
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001903 f32 minDepthBounds
1904 f32 maxDepthBounds
1905}
1906
1907class VkPipelineDynamicStateCreateInfo {
1908 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO
1909 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001910 VkPipelineDynamicStateCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001911 u32 dynamicStateCount
1912 const VkDynamicState* pDynamicStates
Jesse Halld27f6aa2015-08-15 17:58:48 -07001913}
1914
1915class VkGraphicsPipelineCreateInfo {
Jesse Halla6429252015-11-29 18:59:42 -08001916 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO
1917 const void* pNext /// Pointer to next structure
1918 VkPipelineCreateFlags flags /// Pipeline creation flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001919 u32 stageCount
Jesse Halla6429252015-11-29 18:59:42 -08001920 const VkPipelineShaderStageCreateInfo* pStages /// One entry for each active shader stage
Jesse Halld27f6aa2015-08-15 17:58:48 -07001921 const VkPipelineVertexInputStateCreateInfo* pVertexInputState
1922 const VkPipelineInputAssemblyStateCreateInfo* pInputAssemblyState
1923 const VkPipelineTessellationStateCreateInfo* pTessellationState
1924 const VkPipelineViewportStateCreateInfo* pViewportState
Jesse Hall3fbc8562015-11-29 22:10:52 -08001925 const VkPipelineRasterizationStateCreateInfo* pRasterizationState
Jesse Halld27f6aa2015-08-15 17:58:48 -07001926 const VkPipelineMultisampleStateCreateInfo* pMultisampleState
1927 const VkPipelineDepthStencilStateCreateInfo* pDepthStencilState
1928 const VkPipelineColorBlendStateCreateInfo* pColorBlendState
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001929 const VkPipelineDynamicStateCreateInfo* pDynamicState
Jesse Halla6429252015-11-29 18:59:42 -08001930 VkPipelineLayout layout /// Interface layout of the pipeline
Jesse Halld27f6aa2015-08-15 17:58:48 -07001931 VkRenderPass renderPass
1932 u32 subpass
Jesse Halla6429252015-11-29 18:59:42 -08001933 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
1934 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 Halld27f6aa2015-08-15 17:58:48 -07001935}
1936
1937class VkPipelineCacheCreateInfo {
Jesse Hallb00daad2015-11-29 19:46:20 -08001938 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO
1939 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001940 VkPipelineCacheCreateFlags flags
Jesse Hallb00daad2015-11-29 19:46:20 -08001941 platform.size_t initialDataSize /// Size of initial data to populate cache, in bytes
1942 const void* pInitialData /// Initial data to populate cache
Jesse Halld27f6aa2015-08-15 17:58:48 -07001943}
1944
1945class VkPushConstantRange {
1946 VkShaderStageFlags stageFlags /// Which stages use the range
Jesse Hall03b6fe12015-11-24 12:44:21 -08001947 u32 offset /// Start of the range, in bytes
1948 u32 size /// Length of the range, in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001949}
1950
1951class VkPipelineLayoutCreateInfo {
1952 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO
1953 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001954 VkPipelineLayoutCreateFlags flags
Jesse Hall03b6fe12015-11-24 12:44:21 -08001955 u32 setLayoutCount /// Number of descriptor sets interfaced by the pipeline
Jesse Halld27f6aa2015-08-15 17:58:48 -07001956 const VkDescriptorSetLayout* pSetLayouts /// Array of <setCount> number of descriptor set layout objects defining the layout of the
1957 u32 pushConstantRangeCount /// Number of push-constant ranges used by the pipeline
1958 const VkPushConstantRange* pPushConstantRanges /// Array of pushConstantRangeCount number of ranges used by various shader stages
1959}
1960
1961class VkSamplerCreateInfo {
1962 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO
1963 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001964 VkSamplerCreateFlags flags
Jesse Hall23ff73f2015-11-29 14:36:39 -08001965 VkFilter magFilter /// Filter mode for magnification
1966 VkFilter minFilter /// Filter mode for minifiation
1967 VkSamplerMipmapMode mipmapMode /// Mipmap selection mode
1968 VkSamplerAddressMode addressModeU
1969 VkSamplerAddressMode addressModeV
1970 VkSamplerAddressMode addressModeW
Jesse Halld27f6aa2015-08-15 17:58:48 -07001971 f32 mipLodBias
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001972 VkBool32 anisotropyEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07001973 f32 maxAnisotropy
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001974 VkBool32 compareEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07001975 VkCompareOp compareOp
1976 f32 minLod
1977 f32 maxLod
1978 VkBorderColor borderColor
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001979 VkBool32 unnormalizedCoordinates
Jesse Halld27f6aa2015-08-15 17:58:48 -07001980}
1981
Jesse Hall3fbc8562015-11-29 22:10:52 -08001982class VkCommandPoolCreateInfo {
1983 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07001984 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08001985 VkCommandPoolCreateFlags flags /// Command pool creation flags
Jesse Halla6429252015-11-29 18:59:42 -08001986 u32 queueFamilyIndex
Jesse Halld27f6aa2015-08-15 17:58:48 -07001987}
1988
Jesse Hall3fbc8562015-11-29 22:10:52 -08001989class VkCommandBufferAllocateInfo {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001990 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07001991 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08001992 VkCommandPool commandPool
1993 VkCommandBufferLevel level
Jesse Hall03b6fe12015-11-24 12:44:21 -08001994 u32 bufferCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001995}
1996
Jesse Hall3fbc8562015-11-29 22:10:52 -08001997class VkCommandBufferBeginInfo {
1998 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07001999 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08002000 VkCommandBufferUsageFlags flags /// Command buffer usage flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002001 VkRenderPass renderPass /// Render pass for secondary command buffers
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002002 u32 subpass
Jesse Halld27f6aa2015-08-15 17:58:48 -07002003 VkFramebuffer framebuffer /// Framebuffer for secondary command buffers
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002004 VkBool32 occlusionQueryEnable
2005 VkQueryControlFlags queryFlags
2006 VkQueryPipelineStatisticFlags pipelineStatistics
Jesse Halld27f6aa2015-08-15 17:58:48 -07002007}
2008
2009class VkRenderPassBeginInfo {
2010 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO
2011 const void* pNext /// Pointer to next structure
2012 VkRenderPass renderPass
2013 VkFramebuffer framebuffer
2014 VkRect2D renderArea
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002015 u32 clearValueCount
2016 const VkClearValue* pClearValues
Jesse Halld27f6aa2015-08-15 17:58:48 -07002017}
2018
2019@union
2020/// Union allowing specification of floating point, integer, or unsigned integer color data. Actual value selected is based on image/attachment being cleared.
2021class VkClearColorValue {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002022 f32[4] float32
2023 s32[4] int32
2024 u32[4] uint32
Jesse Halld27f6aa2015-08-15 17:58:48 -07002025}
2026
2027class VkClearDepthStencilValue {
2028 f32 depth
2029 u32 stencil
2030}
2031
2032@union
2033/// Union allowing specification of color, depth, and stencil color values. Actual value selected is based on attachment being cleared.
2034class VkClearValue {
2035 VkClearColorValue color
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002036 VkClearDepthStencilValue depthStencil
Jesse Halld27f6aa2015-08-15 17:58:48 -07002037}
2038
Jesse Hallae38f732015-11-19 21:32:50 -08002039class VkClearAttachment {
2040 VkImageAspectFlags aspectMask
2041 u32 colorAttachment
2042 VkClearValue clearValue
2043}
2044
Jesse Halld27f6aa2015-08-15 17:58:48 -07002045class VkAttachmentDescription {
Jesse Halla6429252015-11-29 18:59:42 -08002046 VkAttachmentDescriptionFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002047 VkFormat format
Jesse Hall091ed9e2015-11-30 00:55:29 -08002048 VkSampleCountFlagBits samples
Jesse Halld27f6aa2015-08-15 17:58:48 -07002049 VkAttachmentLoadOp loadOp /// Load op for color or depth data
2050 VkAttachmentStoreOp storeOp /// Store op for color or depth data
2051 VkAttachmentLoadOp stencilLoadOp /// Load op for stencil data
2052 VkAttachmentStoreOp stencilStoreOp /// Store op for stencil data
2053 VkImageLayout initialLayout
2054 VkImageLayout finalLayout
2055}
2056
2057class VkAttachmentReference {
2058 u32 attachment
2059 VkImageLayout layout
2060}
2061
2062class VkSubpassDescription {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002063 VkSubpassDescriptionFlags flags
Jesse Halla6429252015-11-29 18:59:42 -08002064 VkPipelineBindPoint pipelineBindPoint /// Must be VK_PIPELINE_BIND_POINT_GRAPHICS for now
Jesse Hall03b6fe12015-11-24 12:44:21 -08002065 u32 inputAttachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002066 const VkAttachmentReference* pInputAttachments
Jesse Hall03b6fe12015-11-24 12:44:21 -08002067 u32 colorAttachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002068 const VkAttachmentReference* pColorAttachments
2069 const VkAttachmentReference* pResolveAttachments
Jesse Hallc7467b72015-11-29 21:05:26 -08002070 const VkAttachmentReference* pDepthStencilAttachment
Jesse Hall03b6fe12015-11-24 12:44:21 -08002071 u32 preserveAttachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002072 const VkAttachmentReference* pPreserveAttachments
Jesse Halld27f6aa2015-08-15 17:58:48 -07002073}
2074
2075class VkSubpassDependency {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002076 u32 srcSubpass
Jesse Hall3fbc8562015-11-29 22:10:52 -08002077 u32 dstSubpass
Jesse Halld27f6aa2015-08-15 17:58:48 -07002078 VkPipelineStageFlags srcStageMask
Jesse Hall3fbc8562015-11-29 22:10:52 -08002079 VkPipelineStageFlags dstStageMask
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002080 VkAccessFlags srcAccessMask
2081 VkAccessFlags dstAccessMask
Jesse Halldc6d36c2015-11-29 19:12:15 -08002082 VkDependencyFlags dependencyFlags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002083}
2084
2085class VkRenderPassCreateInfo {
2086 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO
2087 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002088 VkRenderPassCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002089 u32 attachmentCount
2090 const VkAttachmentDescription* pAttachments
2091 u32 subpassCount
2092 const VkSubpassDescription* pSubpasses
2093 u32 dependencyCount
2094 const VkSubpassDependency* pDependencies
2095}
2096
2097class VkEventCreateInfo {
2098 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_EVENT_CREATE_INFO
2099 const void* pNext /// Pointer to next structure
2100 VkEventCreateFlags flags /// Event creation flags
2101}
2102
2103class VkFenceCreateInfo {
2104 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_FENCE_CREATE_INFO
2105 const void* pNext /// Pointer to next structure
2106 VkFenceCreateFlags flags /// Fence creation flags
2107}
2108
2109class VkPhysicalDeviceFeatures {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002110 VkBool32 robustBufferAccess /// out of bounds buffer accesses are well defined
2111 VkBool32 fullDrawIndexUint32 /// full 32-bit range of indices for indexed draw calls
2112 VkBool32 imageCubeArray /// image views which are arrays of cube maps
2113 VkBool32 independentBlend /// blending operations are controlled per-attachment
2114 VkBool32 geometryShader /// geometry stage
2115 VkBool32 tessellationShader /// tessellation control and evaluation stage
2116 VkBool32 sampleRateShading /// per-sample shading and interpolation
Jesse Hall3fbc8562015-11-29 22:10:52 -08002117 VkBool32 dualSrcBlend /// blend operations which take two sources
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002118 VkBool32 logicOp /// logic operations
2119 VkBool32 multiDrawIndirect /// multi draw indirect
Jesse Hall543a7ff2016-01-08 16:38:30 -08002120 VkBool32 drawIndirectFirstInstance
Jesse Hallae38f732015-11-19 21:32:50 -08002121 VkBool32 depthClamp /// depth clamping
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002122 VkBool32 depthBiasClamp /// depth bias clamping
2123 VkBool32 fillModeNonSolid /// point and wireframe fill modes
2124 VkBool32 depthBounds /// depth bounds test
2125 VkBool32 wideLines /// lines with width greater than 1
2126 VkBool32 largePoints /// points with size greater than 1
Jesse Hallfbf97b02015-11-20 14:17:03 -08002127 VkBool32 alphaToOne /// The fragment alpha channel can be forced to maximum representable alpha value
2128 VkBool32 multiViewport
2129 VkBool32 samplerAnisotropy
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002130 VkBool32 textureCompressionETC2 /// ETC texture compression formats
2131 VkBool32 textureCompressionASTC_LDR /// ASTC LDR texture compression formats
2132 VkBool32 textureCompressionBC /// BC1-7 texture compressed formats
Jesse Hall65ab5522015-11-30 00:07:16 -08002133 VkBool32 occlusionQueryPrecise
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002134 VkBool32 pipelineStatisticsQuery /// pipeline statistics query
Jesse Halldc6d36c2015-11-29 19:12:15 -08002135 VkBool32 vertexPipelineStoresAndAtomics
2136 VkBool32 fragmentStoresAndAtomics
2137 VkBool32 shaderTessellationAndGeometryPointSize
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002138 VkBool32 shaderImageGatherExtended /// texture gather with run-time values and independent offsets
2139 VkBool32 shaderStorageImageExtendedFormats /// the extended set of formats can be used for storage images
2140 VkBool32 shaderStorageImageMultisample /// multisample images can be used for storage images
Jesse Halld1af8122015-11-29 23:50:38 -08002141 VkBool32 shaderStorageImageReadWithoutFormat
2142 VkBool32 shaderStorageImageWriteWithoutFormat
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002143 VkBool32 shaderUniformBufferArrayDynamicIndexing /// arrays of uniform buffers can be accessed with dynamically uniform indices
2144 VkBool32 shaderSampledImageArrayDynamicIndexing /// arrays of sampled images can be accessed with dynamically uniform indices
2145 VkBool32 shaderStorageBufferArrayDynamicIndexing /// arrays of storage buffers can be accessed with dynamically uniform indices
2146 VkBool32 shaderStorageImageArrayDynamicIndexing /// arrays of storage images can be accessed with dynamically uniform indices
2147 VkBool32 shaderClipDistance /// clip distance in shaders
2148 VkBool32 shaderCullDistance /// cull distance in shaders
2149 VkBool32 shaderFloat64 /// 64-bit floats (doubles) in shaders
2150 VkBool32 shaderInt64 /// 64-bit integers in shaders
2151 VkBool32 shaderInt16 /// 16-bit integers in shaders
2152 VkBool32 shaderResourceResidency /// shader can use texture operations that return resource residency information (requires sparseNonResident support)
Jesse Hall65ab5522015-11-30 00:07:16 -08002153 VkBool32 shaderResourceMinLod /// shader can use texture operations that specify minimum resource LOD
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002154 VkBool32 sparseBinding /// Sparse resources support: Resource memory can be managed at opaque page level rather than object level
2155 VkBool32 sparseResidencyBuffer /// Sparse resources support: GPU can access partially resident buffers
2156 VkBool32 sparseResidencyImage2D /// Sparse resources support: GPU can access partially resident 2D (non-MSAA non-DepthStencil) images
2157 VkBool32 sparseResidencyImage3D /// Sparse resources support: GPU can access partially resident 3D images
2158 VkBool32 sparseResidency2Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 2 samples
2159 VkBool32 sparseResidency4Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 4 samples
2160 VkBool32 sparseResidency8Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 8 samples
2161 VkBool32 sparseResidency16Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 16 samples
2162 VkBool32 sparseResidencyAliased /// Sparse resources support: GPU can correctly access data aliased into multiple locations (opt-in)
Jesse Halld1af8122015-11-29 23:50:38 -08002163 VkBool32 variableMultisampleRate
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002164 VkBool32 inheritedQueries
Jesse Halld27f6aa2015-08-15 17:58:48 -07002165}
2166
2167class VkPhysicalDeviceLimits {
2168 /// resource maximum sizes
2169 u32 maxImageDimension1D /// max 1D image dimension
2170 u32 maxImageDimension2D /// max 2D image dimension
2171 u32 maxImageDimension3D /// max 3D image dimension
2172 u32 maxImageDimensionCube /// max cubemap image dimension
2173 u32 maxImageArrayLayers /// max layers for image arrays
Jesse Hallb00daad2015-11-29 19:46:20 -08002174 u32 maxTexelBufferElements
Jesse Hallfbf97b02015-11-20 14:17:03 -08002175 u32 maxUniformBufferRange /// max uniform buffer size (bytes)
2176 u32 maxStorageBufferRange /// max storage buffer size (bytes)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002177 u32 maxPushConstantsSize /// max size of the push constants pool (bytes)
2178 /// memory limits
2179 u32 maxMemoryAllocationCount /// max number of device memory allocations supported
Jesse Hall091ed9e2015-11-30 00:55:29 -08002180 u32 maxSamplerAllocationCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002181 VkDeviceSize bufferImageGranularity /// Granularity (in bytes) at which buffers and images can be bound to adjacent memory for simultaneous usage
2182 VkDeviceSize sparseAddressSpaceSize /// Total address space available for sparse allocations (bytes)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002183 /// descriptor set limits
2184 u32 maxBoundDescriptorSets /// max number of descriptors sets that can be bound to a pipeline
Jesse Halld27f6aa2015-08-15 17:58:48 -07002185 u32 maxPerStageDescriptorSamplers /// max num of samplers allowed per-stage in a descriptor set
2186 u32 maxPerStageDescriptorUniformBuffers /// max num of uniform buffers allowed per-stage in a descriptor set
2187 u32 maxPerStageDescriptorStorageBuffers /// max num of storage buffers allowed per-stage in a descriptor set
2188 u32 maxPerStageDescriptorSampledImages /// max num of sampled images allowed per-stage in a descriptor set
2189 u32 maxPerStageDescriptorStorageImages /// max num of storage images allowed per-stage in a descriptor set
Jesse Halle1b12782015-11-30 11:27:32 -08002190 u32 maxPerStageDescriptorInputAttachments
Jesse Halldba27f72015-11-30 14:25:46 -08002191 u32 maxPerStageResources
Jesse Halld27f6aa2015-08-15 17:58:48 -07002192 u32 maxDescriptorSetSamplers /// max num of samplers allowed in all stages in a descriptor set
2193 u32 maxDescriptorSetUniformBuffers /// max num of uniform buffers allowed in all stages in a descriptor set
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002194 u32 maxDescriptorSetUniformBuffersDynamic /// max num of dynamic uniform buffers allowed in all stages in a descriptor set
Jesse Halld27f6aa2015-08-15 17:58:48 -07002195 u32 maxDescriptorSetStorageBuffers /// max num of storage buffers allowed in all stages in a descriptor set
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002196 u32 maxDescriptorSetStorageBuffersDynamic /// max num of dynamic storage buffers allowed in all stages in a descriptor set
Jesse Halld27f6aa2015-08-15 17:58:48 -07002197 u32 maxDescriptorSetSampledImages /// max num of sampled images allowed in all stages in a descriptor set
2198 u32 maxDescriptorSetStorageImages /// max num of storage images allowed in all stages in a descriptor set
Jesse Halle1b12782015-11-30 11:27:32 -08002199 u32 maxDescriptorSetInputAttachments
Jesse Halld27f6aa2015-08-15 17:58:48 -07002200 /// vertex stage limits
2201 u32 maxVertexInputAttributes /// max num of vertex input attribute slots
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002202 u32 maxVertexInputBindings /// max num of vertex input binding slots
Jesse Halld27f6aa2015-08-15 17:58:48 -07002203 u32 maxVertexInputAttributeOffset /// max vertex input attribute offset added to vertex buffer offset
2204 u32 maxVertexInputBindingStride /// max vertex input binding stride
2205 u32 maxVertexOutputComponents /// max num of output components written by vertex shader
2206 /// tessellation control stage limits
Jesse Hall3fbc8562015-11-29 22:10:52 -08002207 u32 maxTessellationGenerationLevel /// max level supported by tess primitive generator
Jesse Hallae38f732015-11-19 21:32:50 -08002208 u32 maxTessellationPatchSize /// max patch size (vertices)
2209 u32 maxTessellationControlPerVertexInputComponents /// max num of input components per-vertex in TCS
2210 u32 maxTessellationControlPerVertexOutputComponents /// max num of output components per-vertex in TCS
2211 u32 maxTessellationControlPerPatchOutputComponents /// max num of output components per-patch in TCS
2212 u32 maxTessellationControlTotalOutputComponents /// max total num of per-vertex and per-patch output components in TCS
2213 u32 maxTessellationEvaluationInputComponents /// max num of input components per vertex in TES
2214 u32 maxTessellationEvaluationOutputComponents /// max num of output components per vertex in TES
Jesse Halld27f6aa2015-08-15 17:58:48 -07002215 /// geometry stage limits
2216 u32 maxGeometryShaderInvocations /// max invocation count supported in geometry shader
2217 u32 maxGeometryInputComponents /// max num of input components read in geometry stage
2218 u32 maxGeometryOutputComponents /// max num of output components written in geometry stage
2219 u32 maxGeometryOutputVertices /// max num of vertices that can be emitted in geometry stage
2220 u32 maxGeometryTotalOutputComponents /// max total num of components (all vertices) written in geometry stage
2221 /// fragment stage limits
2222 u32 maxFragmentInputComponents /// max num of input compontents read in fragment stage
Jesse Hallfbf97b02015-11-20 14:17:03 -08002223 u32 maxFragmentOutputAttachments /// max num of output attachments written in fragment stage
Jesse Hall3fbc8562015-11-29 22:10:52 -08002224 u32 maxFragmentDualSrcAttachments /// max num of output attachments written when using dual source blending
Jesse Halld27f6aa2015-08-15 17:58:48 -07002225 u32 maxFragmentCombinedOutputResources /// max total num of storage buffers, storage images and output buffers
2226 /// compute stage limits
2227 u32 maxComputeSharedMemorySize /// max total storage size of work group local storage (bytes)
2228 u32[3] maxComputeWorkGroupCount /// max num of compute work groups that may be dispatched by a single command (x,y,z)
2229 u32 maxComputeWorkGroupInvocations /// max total compute invocations in a single local work group
2230 u32[3] maxComputeWorkGroupSize /// max local size of a compute work group (x,y,z)
2231
2232 u32 subPixelPrecisionBits /// num bits of subpixel precision in screen x and y
2233 u32 subTexelPrecisionBits /// num bits of subtexel precision
2234 u32 mipmapPrecisionBits /// num bits of mipmap precision
2235
2236 u32 maxDrawIndexedIndexValue /// max index value for indexed draw calls (for 32-bit indices)
Jesse Halldba27f72015-11-30 14:25:46 -08002237 u32 maxDrawIndirectCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002238
2239 f32 maxSamplerLodBias /// max absolute sampler level of detail bias
2240 f32 maxSamplerAnisotropy /// max degree of sampler anisotropy
2241
2242 u32 maxViewports /// max number of active viewports
Jesse Halld27f6aa2015-08-15 17:58:48 -07002243 u32[2] maxViewportDimensions /// max viewport dimensions (x,y)
2244 f32[2] viewportBoundsRange /// viewport bounds range (min,max)
2245 u32 viewportSubPixelBits /// num bits of subpixel precision for viewport
2246
Jesse Halldc6d36c2015-11-29 19:12:15 -08002247 platform.size_t minMemoryMapAlignment /// min required alignment of pointers returned by MapMemory (bytes)
2248 VkDeviceSize minTexelBufferOffsetAlignment /// min required alignment for texel buffer offsets (bytes)
2249 VkDeviceSize minUniformBufferOffsetAlignment /// min required alignment for uniform buffer sizes and offsets (bytes)
2250 VkDeviceSize minStorageBufferOffsetAlignment /// min required alignment for storage buffer offsets (bytes)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002251
Jesse Hallfbf97b02015-11-20 14:17:03 -08002252 s32 minTexelOffset /// min texel offset for OpTextureSampleOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07002253 u32 maxTexelOffset /// max texel offset for OpTextureSampleOffset
Jesse Hallfbf97b02015-11-20 14:17:03 -08002254 s32 minTexelGatherOffset /// min texel offset for OpTextureGatherOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07002255 u32 maxTexelGatherOffset /// max texel offset for OpTextureGatherOffset
2256 f32 minInterpolationOffset /// furthest negative offset for interpolateAtOffset
2257 f32 maxInterpolationOffset /// furthest positive offset for interpolateAtOffset
2258 u32 subPixelInterpolationOffsetBits /// num of subpixel bits for interpolateAtOffset
2259
2260 u32 maxFramebufferWidth /// max width for a framebuffer
2261 u32 maxFramebufferHeight /// max height for a framebuffer
2262 u32 maxFramebufferLayers /// max layer count for a layered framebuffer
Jesse Hall091ed9e2015-11-30 00:55:29 -08002263 VkSampleCountFlags framebufferColorSampleCounts
2264 VkSampleCountFlags framebufferDepthSampleCounts
2265 VkSampleCountFlags framebufferStencilSampleCounts
2266 VkSampleCountFlags framebufferNoAttachmentSampleCounts
Jesse Halld27f6aa2015-08-15 17:58:48 -07002267 u32 maxColorAttachments /// max num of framebuffer color attachments
2268
Jesse Hall091ed9e2015-11-30 00:55:29 -08002269 VkSampleCountFlags sampledImageColorSampleCounts
2270 VkSampleCountFlags sampledImageIntegerSampleCounts
2271 VkSampleCountFlags sampledImageDepthSampleCounts
2272 VkSampleCountFlags sampledImageStencilSampleCounts
2273 VkSampleCountFlags storageImageSampleCounts
Jesse Halld27f6aa2015-08-15 17:58:48 -07002274 u32 maxSampleMaskWords /// max num of sample mask words
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002275 VkBool32 timestampComputeAndGraphics
Jesse Halld27f6aa2015-08-15 17:58:48 -07002276
Jesse Halla9bb62b2015-11-21 19:31:56 -08002277 f32 timestampPeriod
Jesse Halld27f6aa2015-08-15 17:58:48 -07002278
2279 u32 maxClipDistances /// max number of clip distances
2280 u32 maxCullDistances /// max number of cull distances
2281 u32 maxCombinedClipAndCullDistances /// max combined number of user clipping
2282
Jesse Hallfbf97b02015-11-20 14:17:03 -08002283 u32 discreteQueuePriorities
2284
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002285 f32[2] pointSizeRange /// range (min,max) of supported point sizes
2286 f32[2] lineWidthRange /// range (min,max) of supported line widths
Jesse Halld27f6aa2015-08-15 17:58:48 -07002287 f32 pointSizeGranularity /// granularity of supported point sizes
2288 f32 lineWidthGranularity /// granularity of supported line widths
Jesse Hall03b6fe12015-11-24 12:44:21 -08002289 VkBool32 strictLines
Jesse Hall091ed9e2015-11-30 00:55:29 -08002290 VkBool32 standardSampleLocations
Jesse Halla9bb62b2015-11-21 19:31:56 -08002291
Jesse Hall65ab5522015-11-30 00:07:16 -08002292 VkDeviceSize optimalBufferCopyOffsetAlignment
2293 VkDeviceSize optimalBufferCopyRowPitchAlignment
Jesse Halldba27f72015-11-30 14:25:46 -08002294 VkDeviceSize nonCoherentAtomSize
Jesse Halld27f6aa2015-08-15 17:58:48 -07002295}
2296
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002297class VkPhysicalDeviceSparseProperties {
2298 VkBool32 residencyStandard2DBlockShape /// Sparse resources support: GPU will access all 2D (single sample) sparse resources using the standard block shapes (based on pixel format)
Jesse Hallb00daad2015-11-29 19:46:20 -08002299 VkBool32 residencyStandard2DMultisampleBlockShape /// Sparse resources support: GPU will access all 2D (multisample) sparse resources using the standard block shapes (based on pixel format)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002300 VkBool32 residencyStandard3DBlockShape /// Sparse resources support: GPU will access all 3D sparse resources using the standard block shapes (based on pixel format)
2301 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 Hall5ae3abb2015-10-08 14:00:22 -07002302 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
2303}
2304
Jesse Halld27f6aa2015-08-15 17:58:48 -07002305class VkSemaphoreCreateInfo {
2306 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO
2307 const void* pNext /// Pointer to next structure
2308 VkSemaphoreCreateFlags flags /// Semaphore creation flags
2309}
2310
2311class VkQueryPoolCreateInfo {
2312 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO
2313 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002314 VkQueryPoolCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002315 VkQueryType queryType
Jesse Hall65ab5522015-11-30 00:07:16 -08002316 u32 entryCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002317 VkQueryPipelineStatisticFlags pipelineStatistics /// Optional
2318}
2319
2320class VkFramebufferCreateInfo {
2321 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO
2322 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002323 VkFramebufferCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002324 VkRenderPass renderPass
2325 u32 attachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002326 const VkImageView* pAttachments
Jesse Halld27f6aa2015-08-15 17:58:48 -07002327 u32 width
2328 u32 height
2329 u32 layers
2330}
2331
Jesse Hall3fbc8562015-11-29 22:10:52 -08002332class VkDrawIndirectCommand {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002333 u32 vertexCount
2334 u32 instanceCount
2335 u32 firstVertex
2336 u32 firstInstance
2337}
2338
Jesse Hall3fbc8562015-11-29 22:10:52 -08002339class VkDrawIndexedIndirectCommand {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002340 u32 indexCount
2341 u32 instanceCount
2342 u32 firstIndex
2343 s32 vertexOffset
2344 u32 firstInstance
2345}
2346
Jesse Hall3fbc8562015-11-29 22:10:52 -08002347class VkDispatchIndirectCommand {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002348 u32 x
2349 u32 y
2350 u32 z
2351}
2352
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002353@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08002354class VkSurfaceCapabilitiesKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002355 u32 minImageCount
2356 u32 maxImageCount
2357 VkExtent2D currentExtent
2358 VkExtent2D minImageExtent
2359 VkExtent2D maxImageExtent
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002360 u32 maxImageArrayLayers
Jesse Hall1356b0d2015-11-23 17:24:58 -08002361 VkSurfaceTransformFlagsKHR supportedTransforms
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002362 VkSurfaceTransformFlagBitsKHR currentTransform
Jesse Halla6429252015-11-29 18:59:42 -08002363 VkCompositeAlphaFlagsKHR supportedCompositeAlpha
Jesse Hall1356b0d2015-11-23 17:24:58 -08002364 VkImageUsageFlags supportedUsageFlags
Michael Lentine88594d72015-11-12 12:49:45 -08002365}
2366
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002367@extension("VK_KHR_surface")
Michael Lentine88594d72015-11-12 12:49:45 -08002368class VkSurfaceFormatKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002369 VkFormat format
2370 VkColorSpaceKHR colorSpace
Michael Lentine88594d72015-11-12 12:49:45 -08002371}
2372
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002373@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08002374class VkSwapchainCreateInfoKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002375 VkStructureType sType
2376 const void* pNext
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002377 VkSwapchainCreateFlagsKHR flags
Jesse Hall1356b0d2015-11-23 17:24:58 -08002378 VkSurfaceKHR surface
2379 u32 minImageCount
2380 VkFormat imageFormat
2381 VkColorSpaceKHR imageColorSpace
2382 VkExtent2D imageExtent
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002383 u32 imageArrayLayers
2384 VkImageUsageFlags imageUsage
Jesse Hall1356b0d2015-11-23 17:24:58 -08002385 VkSharingMode sharingMode
Jesse Hall03b6fe12015-11-24 12:44:21 -08002386 u32 queueFamilyIndexCount
Jesse Hall1356b0d2015-11-23 17:24:58 -08002387 const u32* pQueueFamilyIndices
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002388 VkSurfaceTransformFlagBitsKHR preTransform
2389 VkCompositeAlphaFlagBitsKHR compositeAlpha
Jesse Hall1356b0d2015-11-23 17:24:58 -08002390 VkPresentModeKHR presentMode
Jesse Hall1356b0d2015-11-23 17:24:58 -08002391 VkBool32 clipped
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002392 VkSwapchainKHR oldSwapchain
Michael Lentine88594d72015-11-12 12:49:45 -08002393}
2394
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002395@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08002396class VkPresentInfoKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002397 VkStructureType sType
2398 const void* pNext
Jesse Hallb00daad2015-11-29 19:46:20 -08002399 u32 waitSemaphoreCount
2400 const VkSemaphore* pWaitSemaphores
Jesse Hall1356b0d2015-11-23 17:24:58 -08002401 u32 swapchainCount
Jesse Hall03b6fe12015-11-24 12:44:21 -08002402 const VkSwapchainKHR* pSwapchains
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002403 const u32* pImageIndices
Jesse Halle1b12782015-11-30 11:27:32 -08002404 VkResult* pResults
Michael Lentine88594d72015-11-12 12:49:45 -08002405}
2406
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002407@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002408class VkDisplayPropertiesKHR {
2409 VkDisplayKHR display
2410 const char* displayName
2411 VkExtent2D physicalDimensions
2412 VkExtent2D physicalResolution
2413 VkSurfaceTransformFlagsKHR supportedTransforms
Jesse Hall1356b0d2015-11-23 17:24:58 -08002414 VkBool32 planeReorderPossible
Jesse Halla6429252015-11-29 18:59:42 -08002415 VkBool32 persistentContent
Michael Lentine88594d72015-11-12 12:49:45 -08002416}
2417
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002418@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08002419class VkDisplayModeParametersKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002420 VkExtent2D visibleRegion
Jesse Halla6429252015-11-29 18:59:42 -08002421 u32 refreshRate
Michael Lentine88594d72015-11-12 12:49:45 -08002422}
Jesse Halld27f6aa2015-08-15 17:58:48 -07002423
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002424@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002425class VkDisplayModePropertiesKHR {
2426 VkDisplayModeKHR displayMode
Jesse Halla6429252015-11-29 18:59:42 -08002427 VkDisplayModeParametersKHR parameters
Jesse Hall1356b0d2015-11-23 17:24:58 -08002428}
2429
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002430@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002431class VkDisplayModeCreateInfoKHR {
2432 VkStructureType sType
2433 const void* pNext
Jesse Hall9ba8bc82015-11-30 16:22:16 -08002434 VkDisplayModeCreateFlagsKHR flags
Jesse Halla6429252015-11-29 18:59:42 -08002435 VkDisplayModeParametersKHR parameters
Jesse Hall1356b0d2015-11-23 17:24:58 -08002436}
2437
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002438@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002439class VkDisplayPlanePropertiesKHR {
Jesse Halla6429252015-11-29 18:59:42 -08002440 VkDisplayKHR currentDisplay
2441 u32 currentStackIndex
2442}
2443
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002444@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08002445class VkDisplayPlaneCapabilitiesKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002446 VkDisplayPlaneAlphaFlagsKHR supportedAlpha
2447 VkOffset2D minSrcPosition
2448 VkOffset2D maxSrcPosition
2449 VkExtent2D minSrcExtent
2450 VkExtent2D maxSrcExtent
2451 VkOffset2D minDstPosition
2452 VkOffset2D maxDstPosition
2453 VkExtent2D minDstExtent
2454 VkExtent2D maxDstExtent
2455}
2456
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002457@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08002458class VkDisplaySurfaceCreateInfoKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002459 VkStructureType sType
2460 const void* pNext
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002461 VkDisplaySurfaceCreateFlagsKHR flags
Jesse Hall1356b0d2015-11-23 17:24:58 -08002462 VkDisplayModeKHR displayMode
2463 u32 planeIndex
2464 u32 planeStackIndex
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002465 VkSurfaceTransformFlagBitsKHR transform
Jesse Hall1356b0d2015-11-23 17:24:58 -08002466 f32 globalAlpha
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002467 VkDisplayPlaneAlphaFlagBitsKHR alphaMode
2468 VkExtent2D imageExtent
Jesse Hall1356b0d2015-11-23 17:24:58 -08002469}
2470
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002471@extension("VK_KHR_display_swapchain")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002472class VkDisplayPresentInfoKHR {
2473 VkStructureType sType
2474 const void* pNext
2475 VkRect2D srcRect
2476 VkRect2D dstRect
Jesse Halla6429252015-11-29 18:59:42 -08002477 VkBool32 persistent
Jesse Hall1356b0d2015-11-23 17:24:58 -08002478}
2479
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002480@extension("VK_KHR_xlib_surface")
2481class VkXlibSurfaceCreateInfoKHR {
2482 VkStructureType sType
2483 const void* pNext
2484 VkXlibSurfaceCreateFlagsKHR flags
2485 platform.Display* dpy
2486 platform.Window window
2487}
2488
2489@extension("VK_KHR_xcb_surface")
2490class VkXcbSurfaceCreateInfoKHR {
2491 VkStructureType sType
2492 const void* pNext
2493 VkXcbSurfaceCreateFlagsKHR flags
2494 platform.xcb_connection_t* connection
2495 platform.xcb_window_t window
2496}
2497
2498@extension("VK_KHR_wayland_surface")
2499class VkWaylandSurfaceCreateInfoKHR {
2500 VkStructureType sType
2501 const void* pNext
2502 VkWaylandSurfaceCreateFlagsKHR flags
2503 platform.wl_display* display
2504 platform.wl_surface* surface
2505}
2506
2507@extension("VK_KHR_mir_surface")
2508class VkMirSurfaceCreateInfoKHR {
2509 VkStructureType sType
2510 const void* pNext
2511 VkMirSurfaceCreateFlagsKHR flags
2512 platform.MirConnection* connection
2513 platform.MirSurface* mirSurface
2514}
2515
2516@extension("VK_KHR_android_surface")
2517class VkAndroidSurfaceCreateInfoKHR {
2518 VkStructureType sType
2519 const void* pNext
2520 VkAndroidSurfaceCreateFlagsKHR flags
2521 platform.ANativeWindow* window
2522}
2523
2524@extension("VK_KHR_win32_surface")
2525class VkWin32SurfaceCreateInfoKHR {
2526 VkStructureType sType
2527 const void* pNext
2528 VkWin32SurfaceCreateFlagsKHR flags
2529 platform.HINSTANCE hinstance
2530 platform.HWND hwnd
2531}
2532
Jesse Hall1356b0d2015-11-23 17:24:58 -08002533
Jesse Halld27f6aa2015-08-15 17:58:48 -07002534////////////////
2535// Commands //
2536////////////////
2537
2538// Function pointers. TODO: add support for function pointers.
2539
2540@external type void* PFN_vkVoidFunction
2541@pfn cmd void vkVoidFunction() {
2542}
2543
Jesse Hall3fbc8562015-11-29 22:10:52 -08002544@external type void* PFN_vkAllocationFunction
2545@pfn cmd void* vkAllocationFunction(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002546 void* pUserData,
2547 platform.size_t size,
2548 platform.size_t alignment,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002549 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08002550 return ?
2551}
2552
Jesse Hall3fbc8562015-11-29 22:10:52 -08002553@external type void* PFN_vkReallocationFunction
2554@pfn cmd void* vkReallocationFunction(
Jesse Hall03b6fe12015-11-24 12:44:21 -08002555 void* pUserData,
2556 void* pOriginal,
2557 platform.size_t size,
2558 platform.size_t alignment,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002559 VkSystemAllocationScope allocationScope) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002560 return ?
2561}
2562
2563@external type void* PFN_vkFreeFunction
2564@pfn cmd void vkFreeFunction(
2565 void* pUserData,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002566 void* pMemory) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002567}
2568
Jesse Hall3fbc8562015-11-29 22:10:52 -08002569@external type void* PFN_vkInternalAllocationNotification
2570@pfn cmd void vkInternalAllocationNotification(
Jesse Hall03b6fe12015-11-24 12:44:21 -08002571 void* pUserData,
2572 platform.size_t size,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002573 VkInternalAllocationType allocationType,
2574 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08002575}
2576
2577@external type void* PFN_vkInternalFreeNotification
2578@pfn cmd void vkInternalFreeNotification(
2579 void* pUserData,
2580 platform.size_t size,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002581 VkInternalAllocationType allocationType,
2582 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08002583}
Jesse Halld27f6aa2015-08-15 17:58:48 -07002584
2585// Global functions
2586
2587@threadSafety("system")
2588cmd VkResult vkCreateInstance(
2589 const VkInstanceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002590 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002591 VkInstance* pInstance) {
2592 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO)
2593
2594 instance := ?
2595 pInstance[0] = instance
2596 State.Instances[instance] = new!InstanceObject()
2597
Jesse Hall03b6fe12015-11-24 12:44:21 -08002598 layers := pCreateInfo.ppEnabledLayerNames[0:pCreateInfo.enabledLayerNameCount]
2599 extensions := pCreateInfo.ppEnabledExtensionNames[0:pCreateInfo.enabledExtensionNameCount]
Jesse Halld27f6aa2015-08-15 17:58:48 -07002600
2601 return ?
2602}
2603
2604@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002605cmd void vkDestroyInstance(
Jesse Hall03b6fe12015-11-24 12:44:21 -08002606 VkInstance instance,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002607 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002608 instanceObject := GetInstance(instance)
2609
2610 State.Instances[instance] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07002611}
2612
2613@threadSafety("system")
2614cmd VkResult vkEnumeratePhysicalDevices(
2615 VkInstance instance,
2616 u32* pPhysicalDeviceCount,
2617 VkPhysicalDevice* pPhysicalDevices) {
2618 instanceObject := GetInstance(instance)
2619
2620 physicalDeviceCount := as!u32(?)
2621 pPhysicalDeviceCount[0] = physicalDeviceCount
2622 physicalDevices := pPhysicalDevices[0:physicalDeviceCount]
2623
2624 for i in (0 .. physicalDeviceCount) {
2625 physicalDevice := ?
2626 physicalDevices[i] = physicalDevice
2627 if !(physicalDevice in State.PhysicalDevices) {
2628 State.PhysicalDevices[physicalDevice] = new!PhysicalDeviceObject(instance: instance)
2629 }
2630 }
2631
2632 return ?
2633}
2634
2635cmd PFN_vkVoidFunction vkGetDeviceProcAddr(
2636 VkDevice device,
2637 const char* pName) {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002638 if device != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002639 device := GetDevice(device)
2640 }
2641
2642 return ?
2643}
2644
2645cmd PFN_vkVoidFunction vkGetInstanceProcAddr(
2646 VkInstance instance,
2647 const char* pName) {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002648 if instance != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002649 instanceObject := GetInstance(instance)
2650 }
2651
2652 return ?
2653}
2654
Jesse Hall606a54e2015-11-19 22:17:28 -08002655cmd void vkGetPhysicalDeviceProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002656 VkPhysicalDevice physicalDevice,
2657 VkPhysicalDeviceProperties* pProperties) {
2658 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2659
2660 properties := ?
2661 pProperties[0] = properties
Jesse Halld27f6aa2015-08-15 17:58:48 -07002662}
2663
Jesse Hall606a54e2015-11-19 22:17:28 -08002664cmd void vkGetPhysicalDeviceQueueFamilyProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002665 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08002666 u32* pQueueFamilyPropertyCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002667 VkQueueFamilyProperties* pQueueFamilyProperties) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002668 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002669 // TODO: Figure out how to express fetch-count-or-properties
2670 // This version fails 'apic validate' with 'fence not allowed in
2671 // *semantic.Branch'. Other attempts have failed with the same or other
2672 // errors.
2673 // if pQueueFamilyProperties != null {
2674 // queuesProperties := pQueueFamilyProperties[0:pCount[0]]
2675 // for i in (0 .. pCount[0]) {
2676 // queueProperties := as!VkQueueFamilyProperties(?)
2677 // queuesProperties[i] = queueProperties
2678 // }
2679 // } else {
2680 // count := ?
2681 // pCount[0] = count
2682 // }
Jesse Halld27f6aa2015-08-15 17:58:48 -07002683}
2684
Jesse Hall606a54e2015-11-19 22:17:28 -08002685cmd void vkGetPhysicalDeviceMemoryProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002686 VkPhysicalDevice physicalDevice,
2687 VkPhysicalDeviceMemoryProperties* pMemoryProperties) {
2688 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2689
2690 memoryProperties := ?
2691 pMemoryProperties[0] = memoryProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07002692}
2693
Jesse Hall606a54e2015-11-19 22:17:28 -08002694cmd void vkGetPhysicalDeviceFeatures(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002695 VkPhysicalDevice physicalDevice,
2696 VkPhysicalDeviceFeatures* pFeatures) {
2697 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2698
2699 features := ?
2700 pFeatures[0] = features
Jesse Halld27f6aa2015-08-15 17:58:48 -07002701}
2702
Jesse Hall606a54e2015-11-19 22:17:28 -08002703cmd void vkGetPhysicalDeviceFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002704 VkPhysicalDevice physicalDevice,
2705 VkFormat format,
2706 VkFormatProperties* pFormatProperties) {
2707 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2708
2709 formatProperties := ?
2710 pFormatProperties[0] = formatProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07002711}
2712
Jesse Halla9e57032015-11-30 01:03:10 -08002713cmd VkResult vkGetPhysicalDeviceImageFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002714 VkPhysicalDevice physicalDevice,
2715 VkFormat format,
2716 VkImageType type,
2717 VkImageTiling tiling,
2718 VkImageUsageFlags usage,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002719 VkImageCreateFlags flags,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002720 VkImageFormatProperties* pImageFormatProperties) {
2721 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2722
2723 imageFormatProperties := ?
2724 pImageFormatProperties[0] = imageFormatProperties
Jesse Halla9e57032015-11-30 01:03:10 -08002725
2726 return ?
Jesse Halld27f6aa2015-08-15 17:58:48 -07002727}
2728
Jesse Halld27f6aa2015-08-15 17:58:48 -07002729
2730// Device functions
2731
2732@threadSafety("system")
2733cmd VkResult vkCreateDevice(
2734 VkPhysicalDevice physicalDevice,
2735 const VkDeviceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002736 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002737 VkDevice* pDevice) {
2738 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO)
2739 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2740
2741 device := ?
2742 pDevice[0] = device
2743 State.Devices[device] = new!DeviceObject(physicalDevice: physicalDevice)
2744
2745 return ?
2746}
2747
2748@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002749cmd void vkDestroyDevice(
Jesse Hall03b6fe12015-11-24 12:44:21 -08002750 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002751 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002752 deviceObject := GetDevice(device)
2753
2754 State.Devices[device] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07002755}
2756
2757
2758// Extension discovery functions
2759
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002760cmd VkResult vkEnumerateInstanceLayerProperties(
Jesse Hall03b6fe12015-11-24 12:44:21 -08002761 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002762 VkLayerProperties* pProperties) {
2763 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08002764 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07002765
2766 properties := pProperties[0:count]
2767 for i in (0 .. count) {
2768 property := ?
2769 properties[i] = property
2770 }
2771
2772 return ?
2773}
2774
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002775cmd VkResult vkEnumerateInstanceExtensionProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002776 const char* pLayerName,
Jesse Hall03b6fe12015-11-24 12:44:21 -08002777 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002778 VkExtensionProperties* pProperties) {
2779 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08002780 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07002781
2782 properties := pProperties[0:count]
2783 for i in (0 .. count) {
2784 property := ?
2785 properties[i] = property
2786 }
2787
2788 return ?
2789}
2790
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002791cmd VkResult vkEnumerateDeviceLayerProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002792 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08002793 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002794 VkLayerProperties* pProperties) {
2795 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2796 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08002797 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07002798
2799 properties := pProperties[0:count]
2800 for i in (0 .. count) {
2801 property := ?
2802 properties[i] = property
2803 }
2804
2805 return ?
2806}
2807
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002808cmd VkResult vkEnumerateDeviceExtensionProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002809 VkPhysicalDevice physicalDevice,
2810 const char* pLayerName,
Jesse Hall03b6fe12015-11-24 12:44:21 -08002811 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002812 VkExtensionProperties* pProperties) {
2813 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2814
2815 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08002816 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07002817
2818 properties := pProperties[0:count]
2819 for i in (0 .. count) {
2820 property := ?
2821 properties[i] = property
2822 }
2823
2824 return ?
2825}
2826
2827
2828// Queue functions
2829
2830@threadSafety("system")
Jesse Hall606a54e2015-11-19 22:17:28 -08002831cmd void vkGetDeviceQueue(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002832 VkDevice device,
2833 u32 queueFamilyIndex,
2834 u32 queueIndex,
2835 VkQueue* pQueue) {
2836 deviceObject := GetDevice(device)
2837
2838 queue := ?
2839 pQueue[0] = queue
2840
2841 if !(queue in State.Queues) {
2842 State.Queues[queue] = new!QueueObject(device: device)
2843 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07002844}
2845
2846@threadSafety("app")
2847cmd VkResult vkQueueSubmit(
2848 VkQueue queue,
Jesse Halla366a512015-11-19 22:30:07 -08002849 u32 submitCount,
Jesse Hallb00daad2015-11-29 19:46:20 -08002850 const VkSubmitInfo* pSubmits,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002851 VkFence fence) {
2852 queueObject := GetQueue(queue)
2853
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002854 if fence != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002855 fenceObject := GetFence(fence)
2856 assert(fenceObject.device == queueObject.device)
2857 }
2858
Jesse Hall3fbc8562015-11-29 22:10:52 -08002859 // commandBuffers := pcommandBuffers[0:commandBufferCount]
2860 // for i in (0 .. commandBufferCount) {
2861 // commandBuffer := commandBuffers[i]
2862 // commandBufferObject := GetCommandBuffer(commandBuffer)
2863 // assert(commandBufferObject.device == queueObject.device)
Jesse Halla366a512015-11-19 22:30:07 -08002864 //
Jesse Hall3fbc8562015-11-29 22:10:52 -08002865 // validate("QueueCheck", commandBufferObject.queueFlags in queueObject.flags,
2866 // "vkQueueSubmit: enqueued commandBuffer requires missing queue capabilities.")
Jesse Halla366a512015-11-19 22:30:07 -08002867 // }
Jesse Halld27f6aa2015-08-15 17:58:48 -07002868
2869 return ?
2870}
2871
2872@threadSafety("system")
2873cmd VkResult vkQueueWaitIdle(
2874 VkQueue queue) {
2875 queueObject := GetQueue(queue)
2876
2877 return ?
2878}
2879
2880@threadSafety("system")
2881cmd VkResult vkDeviceWaitIdle(
2882 VkDevice device) {
2883 deviceObject := GetDevice(device)
2884
2885 return ?
2886}
2887
2888
2889// Memory functions
2890
2891@threadSafety("system")
Jesse Hall3fbc8562015-11-29 22:10:52 -08002892cmd VkResult vkAllocateMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002893 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002894 const VkMemoryAllocateInfo* pAllocateInfo,
2895 const VkAllocationCallbacks* pAllocator,
2896 VkDeviceMemory* pMemory) {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002897 assert(pAllocateInfo.sType == VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002898 deviceObject := GetDevice(device)
2899
Jesse Hall3fbc8562015-11-29 22:10:52 -08002900 memory := ?
2901 pMemory[0] = memory
2902 State.DeviceMemories[memory] = new!DeviceMemoryObject(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002903 device: device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002904 allocationSize: pAllocateInfo[0].allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002905
2906 return ?
2907}
2908
2909@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002910cmd void vkFreeMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002911 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002912 VkDeviceMemory memory,
2913 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002914 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08002915 memoryObject := GetDeviceMemory(memory)
2916 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002917
2918 // Check that no objects are still bound before freeing.
Jesse Hall3fbc8562015-11-29 22:10:52 -08002919 validate("MemoryCheck", len(memoryObject.boundObjects) == 0,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002920 "vkFreeMemory: objects still bound")
Jesse Hall3fbc8562015-11-29 22:10:52 -08002921 validate("MemoryCheck", len(memoryObject.boundCommandBuffers) == 0,
2922 "vkFreeMemory: commandBuffers still bound")
2923 State.DeviceMemories[memory] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07002924}
2925
2926@threadSafety("app")
2927cmd VkResult vkMapMemory(
2928 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002929 VkDeviceMemory memory,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002930 VkDeviceSize offset,
2931 VkDeviceSize size,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002932 VkMemoryMapFlags flags,
2933 void** ppData) {
2934 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08002935 memoryObject := GetDeviceMemory(memory)
2936 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002937
2938 assert(flags == as!VkMemoryMapFlags(0))
Jesse Hall3fbc8562015-11-29 22:10:52 -08002939 assert((offset + size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002940
2941 return ?
2942}
2943
2944@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002945cmd void vkUnmapMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002946 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002947 VkDeviceMemory memory) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002948 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08002949 memoryObject := GetDeviceMemory(memory)
2950 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002951}
2952
2953cmd VkResult vkFlushMappedMemoryRanges(
2954 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002955 u32 memoryRangeCount
2956 const VkMappedMemoryRange* pMemoryRanges) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002957 deviceObject := GetDevice(device)
2958
Jesse Hall3fbc8562015-11-29 22:10:52 -08002959 memoryRanges := pMemoryRanges[0:memoryRangeCount]
2960 for i in (0 .. memoryRangeCount) {
2961 memoryRange := memoryRanges[i]
2962 memoryObject := GetDeviceMemory(memoryRange.memory)
2963 assert(memoryObject.device == device)
2964 assert((memoryRange.offset + memoryRange.size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002965 }
2966
2967 return ?
2968}
2969
2970cmd VkResult vkInvalidateMappedMemoryRanges(
2971 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002972 u32 memoryRangeCount,
2973 const VkMappedMemoryRange* pMemoryRanges) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002974 deviceObject := GetDevice(device)
2975
Jesse Hall3fbc8562015-11-29 22:10:52 -08002976 memoryRanges := pMemoryRanges[0:memoryRangeCount]
2977 for i in (0 .. memoryRangeCount) {
2978 memoryRange := memoryRanges[i]
2979 memoryObject := GetDeviceMemory(memoryRange.memory)
2980 assert(memoryObject.device == device)
2981 assert((memoryRange.offset + memoryRange.size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002982 }
2983
2984 return ?
2985}
2986
2987
2988// Memory management API functions
2989
Jesse Hall606a54e2015-11-19 22:17:28 -08002990cmd void vkGetDeviceMemoryCommitment(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002991 VkDevice device,
2992 VkDeviceMemory memory,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002993 VkDeviceSize* pCommittedMemoryInBytes) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002994 deviceObject := GetDevice(device)
2995
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002996 if memory != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002997 memoryObject := GetDeviceMemory(memory)
2998 assert(memoryObject.device == device)
2999 }
3000
3001 committedMemoryInBytes := ?
3002 pCommittedMemoryInBytes[0] = committedMemoryInBytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07003003}
3004
Jesse Hall606a54e2015-11-19 22:17:28 -08003005cmd void vkGetBufferMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003006 VkDevice device,
3007 VkBuffer buffer,
3008 VkMemoryRequirements* pMemoryRequirements) {
3009 deviceObject := GetDevice(device)
3010 bufferObject := GetBuffer(buffer)
3011 assert(bufferObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003012}
3013
3014cmd VkResult vkBindBufferMemory(
3015 VkDevice device,
3016 VkBuffer buffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003017 VkDeviceMemory memory,
3018 VkDeviceSize memoryOffset) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003019 deviceObject := GetDevice(device)
3020 bufferObject := GetBuffer(buffer)
3021 assert(bufferObject.device == device)
3022
3023 // Unbind buffer from previous memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003024 if bufferObject.memory != NULL_HANDLE {
3025 memoryObject := GetDeviceMemory(bufferObject.memory)
3026 memoryObject.boundObjects[as!u64(buffer)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003027 }
3028
3029 // Bind buffer to given memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003030 if memory != NULL_HANDLE {
3031 memoryObject := GetDeviceMemory(memory)
3032 assert(memoryObject.device == device)
3033 memoryObject.boundObjects[as!u64(buffer)] = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003034 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08003035 bufferObject.memory = memory
3036 bufferObject.memoryOffset = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003037
3038 return ?
3039}
3040
Jesse Hall606a54e2015-11-19 22:17:28 -08003041cmd void vkGetImageMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003042 VkDevice device,
3043 VkImage image,
3044 VkMemoryRequirements* pMemoryRequirements) {
3045 deviceObject := GetDevice(device)
3046 imageObject := GetImage(image)
3047 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003048}
3049
3050cmd VkResult vkBindImageMemory(
3051 VkDevice device,
3052 VkImage image,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003053 VkDeviceMemory memory,
3054 VkDeviceSize memoryOffset) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003055 deviceObject := GetDevice(device)
3056 imageObject := GetImage(image)
3057 assert(imageObject.device == device)
3058
3059 // Unbind image from previous memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003060 if imageObject.memory != NULL_HANDLE {
3061 memoryObject := GetDeviceMemory(imageObject.memory)
3062 memoryObject.boundObjects[as!u64(image)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003063 }
3064
3065 // Bind image to given memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003066 if memory != NULL_HANDLE {
3067 memoryObject := GetDeviceMemory(memory)
3068 assert(memoryObject.device == device)
3069 memoryObject.boundObjects[as!u64(image)] = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003070 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08003071 imageObject.memory = memory
3072 imageObject.memoryOffset = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003073
3074 return ?
3075}
3076
Jesse Hall606a54e2015-11-19 22:17:28 -08003077cmd void vkGetImageSparseMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003078 VkDevice device,
3079 VkImage image,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003080 u32* pSparseMemoryRequirementCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003081 VkSparseImageMemoryRequirements* pSparseMemoryRequirements) {
3082 deviceObject := GetDevice(device)
3083 imageObject := GetImage(image)
3084 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003085}
3086
Jesse Hall606a54e2015-11-19 22:17:28 -08003087cmd void vkGetPhysicalDeviceSparseImageFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003088 VkPhysicalDevice physicalDevice,
3089 VkFormat format,
3090 VkImageType type,
Jesse Hall091ed9e2015-11-30 00:55:29 -08003091 VkSampleCountFlagBits samples,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003092 VkImageUsageFlags usage,
3093 VkImageTiling tiling,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003094 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003095 VkSparseImageFormatProperties* pProperties) {
3096 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003097}
3098
Jesse Halla6429252015-11-29 18:59:42 -08003099cmd VkResult vkQueueBindSparse(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003100 VkQueue queue,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003101 u32 bindInfoCount,
Jesse Halla6429252015-11-29 18:59:42 -08003102 const VkBindSparseInfo* pBindInfo,
3103 VkFence fence) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003104 queueObject := GetQueue(queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003105
3106 return ?
3107}
3108
3109
3110// Fence functions
3111
3112@threadSafety("system")
3113cmd VkResult vkCreateFence(
3114 VkDevice device,
3115 const VkFenceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003116 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003117 VkFence* pFence) {
3118 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_FENCE_CREATE_INFO)
3119 deviceObject := GetDevice(device)
3120
3121 fence := ?
3122 pFence[0] = fence
3123 State.Fences[fence] = new!FenceObject(
Jesse Halld8bade02015-11-24 10:24:18 -08003124 device: device, signaled: (pCreateInfo.flags == as!VkFenceCreateFlags(VK_FENCE_CREATE_SIGNALED_BIT)))
Jesse Halld27f6aa2015-08-15 17:58:48 -07003125
3126 return ?
3127}
3128
3129@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003130cmd void vkDestroyFence(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003131 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003132 VkFence fence,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003133 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003134 deviceObject := GetDevice(device)
3135 fenceObject := GetFence(fence)
3136 assert(fenceObject.device == device)
3137
3138 State.Fences[fence] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003139}
3140
3141@threadSafety("system")
3142cmd VkResult vkResetFences(
3143 VkDevice device,
3144 u32 fenceCount,
3145 const VkFence* pFences) {
3146 deviceObject := GetDevice(device)
3147
3148 fences := pFences[0:fenceCount]
3149 for i in (0 .. fenceCount) {
3150 fence := fences[i]
3151 fenceObject := GetFence(fence)
3152 assert(fenceObject.device == device)
3153 fenceObject.signaled = false
3154 }
3155
3156 return ?
3157}
3158
3159@threadSafety("system")
3160cmd VkResult vkGetFenceStatus(
3161 VkDevice device,
3162 VkFence fence) {
3163 deviceObject := GetDevice(device)
3164 fenceObject := GetFence(fence)
3165 assert(fenceObject.device == device)
3166
3167 return ?
3168}
3169
3170@threadSafety("system")
3171cmd VkResult vkWaitForFences(
3172 VkDevice device,
3173 u32 fenceCount,
3174 const VkFence* pFences,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003175 VkBool32 waitAll,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003176 u64 timeout) { /// timeout in nanoseconds
3177 deviceObject := GetDevice(device)
3178
3179 fences := pFences[0:fenceCount]
3180 for i in (0 .. fenceCount) {
3181 fence := fences[i]
3182 fenceObject := GetFence(fence)
3183 assert(fenceObject.device == device)
3184 }
3185
3186 return ?
3187}
3188
3189
3190// Queue semaphore functions
3191
3192@threadSafety("system")
3193cmd VkResult vkCreateSemaphore(
3194 VkDevice device,
3195 const VkSemaphoreCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003196 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003197 VkSemaphore* pSemaphore) {
3198 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO)
3199 deviceObject := GetDevice(device)
3200
3201 semaphore := ?
3202 pSemaphore[0] = semaphore
3203 State.Semaphores[semaphore] = new!SemaphoreObject(device: device)
3204
3205 return ?
3206}
3207
3208@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003209cmd void vkDestroySemaphore(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003210 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003211 VkSemaphore semaphore,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003212 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003213 deviceObject := GetDevice(device)
3214 semaphoreObject := GetSemaphore(semaphore)
3215 assert(semaphoreObject.device == device)
3216
3217 State.Semaphores[semaphore] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003218}
3219
Jesse Halld27f6aa2015-08-15 17:58:48 -07003220
3221// Event functions
3222
3223@threadSafety("system")
3224cmd VkResult vkCreateEvent(
3225 VkDevice device,
3226 const VkEventCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003227 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003228 VkEvent* pEvent) {
3229 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_EVENT_CREATE_INFO)
3230 deviceObject := GetDevice(device)
3231
3232 event := ?
3233 pEvent[0] = event
3234 State.Events[event] = new!EventObject(device: device)
3235
3236 return ?
3237}
3238
3239@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003240cmd void vkDestroyEvent(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003241 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003242 VkEvent event,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003243 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003244 deviceObject := GetDevice(device)
3245 eventObject := GetEvent(event)
3246 assert(eventObject.device == device)
3247
3248 State.Events[event] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003249}
3250
3251@threadSafety("system")
3252cmd VkResult vkGetEventStatus(
3253 VkDevice device,
3254 VkEvent event) {
3255 deviceObject := GetDevice(device)
3256 eventObject := GetEvent(event)
3257 assert(eventObject.device == device)
3258
3259 return ?
3260}
3261
3262@threadSafety("system")
3263cmd VkResult vkSetEvent(
3264 VkDevice device,
3265 VkEvent event) {
3266 deviceObject := GetDevice(device)
3267 eventObject := GetEvent(event)
3268 assert(eventObject.device == device)
3269
3270 return ?
3271}
3272
3273@threadSafety("system")
3274cmd VkResult vkResetEvent(
3275 VkDevice device,
3276 VkEvent event) {
3277 deviceObject := GetDevice(device)
3278 eventObject := GetEvent(event)
3279 assert(eventObject.device == device)
3280
3281 return ?
3282}
3283
3284
3285// Query functions
3286
3287@threadSafety("system")
3288cmd VkResult vkCreateQueryPool(
3289 VkDevice device,
3290 const VkQueryPoolCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003291 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003292 VkQueryPool* pQueryPool) {
3293 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO)
3294 deviceObject := GetDevice(device)
3295
3296 queryPool := ?
3297 pQueryPool[0] = queryPool
3298 State.QueryPools[queryPool] = new!QueryPoolObject(device: device)
3299
3300 return ?
3301}
3302
3303@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003304cmd void vkDestroyQueryPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003305 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003306 VkQueryPool queryPool,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003307 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003308 deviceObject := GetDevice(device)
3309 queryPoolObject := GetQueryPool(queryPool)
3310 assert(queryPoolObject.device == device)
3311
3312 State.QueryPools[queryPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003313}
3314
3315@threadSafety("system")
3316cmd VkResult vkGetQueryPoolResults(
3317 VkDevice device,
3318 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08003319 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003320 u32 queryCount,
Jesse Halla9bb62b2015-11-21 19:31:56 -08003321 platform.size_t dataSize,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003322 void* pData,
Jesse Halla9bb62b2015-11-21 19:31:56 -08003323 VkDeviceSize stride,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003324 VkQueryResultFlags flags) {
3325 deviceObject := GetDevice(device)
3326 queryPoolObject := GetQueryPool(queryPool)
3327 assert(queryPoolObject.device == device)
3328
Jesse Halld27f6aa2015-08-15 17:58:48 -07003329 data := pData[0:dataSize]
3330
3331 return ?
3332}
3333
3334// Buffer functions
3335
3336@threadSafety("system")
3337cmd VkResult vkCreateBuffer(
3338 VkDevice device,
3339 const VkBufferCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003340 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003341 VkBuffer* pBuffer) {
3342 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO)
3343 deviceObject := GetDevice(device)
3344
3345 buffer := ?
3346 pBuffer[0] = buffer
3347 State.Buffers[buffer] = new!BufferObject(device: device)
3348
3349 return ?
3350}
3351
3352@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003353cmd void vkDestroyBuffer(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003354 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003355 VkBuffer buffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003356 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003357 deviceObject := GetDevice(device)
3358 bufferObject := GetBuffer(buffer)
3359 assert(bufferObject.device == device)
3360
Jesse Hall3fbc8562015-11-29 22:10:52 -08003361 assert(bufferObject.memory == 0)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003362 State.Buffers[buffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003363}
3364
3365
3366// Buffer view functions
3367
3368@threadSafety("system")
3369cmd VkResult vkCreateBufferView(
3370 VkDevice device,
3371 const VkBufferViewCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003372 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003373 VkBufferView* pView) {
3374 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO)
3375 deviceObject := GetDevice(device)
3376
3377 bufferObject := GetBuffer(pCreateInfo.buffer)
3378 assert(bufferObject.device == device)
3379
3380 view := ?
3381 pView[0] = view
3382 State.BufferViews[view] = new!BufferViewObject(device: device, buffer: pCreateInfo.buffer)
3383
3384 return ?
3385}
3386
3387@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003388cmd void vkDestroyBufferView(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003389 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003390 VkBufferView bufferView,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003391 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003392 deviceObject := GetDevice(device)
3393 bufferViewObject := GetBufferView(bufferView)
3394 assert(bufferViewObject.device == device)
3395
3396 State.BufferViews[bufferView] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003397}
3398
3399
3400// Image functions
3401
3402@threadSafety("system")
3403cmd VkResult vkCreateImage(
3404 VkDevice device,
3405 const VkImageCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003406 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003407 VkImage* pImage) {
3408 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO)
3409 deviceObject := GetDevice(device)
3410
3411 image := ?
3412 pImage[0] = image
3413 State.Images[image] = new!ImageObject(device: device)
3414
3415 return ?
3416}
3417
3418@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003419cmd void vkDestroyImage(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003420 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003421 VkImage image,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003422 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003423 deviceObject := GetDevice(device)
3424 imageObject := GetImage(image)
3425 assert(imageObject.device == device)
3426
Jesse Hall3fbc8562015-11-29 22:10:52 -08003427 assert(imageObject.memory == 0)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003428 State.Images[image] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003429}
3430
Jesse Hall606a54e2015-11-19 22:17:28 -08003431cmd void vkGetImageSubresourceLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003432 VkDevice device,
3433 VkImage image,
3434 const VkImageSubresource* pSubresource,
3435 VkSubresourceLayout* pLayout) {
3436 deviceObject := GetDevice(device)
3437 imageObject := GetImage(image)
3438 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003439}
3440
3441
3442// Image view functions
3443
3444@threadSafety("system")
3445cmd VkResult vkCreateImageView(
3446 VkDevice device,
3447 const VkImageViewCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003448 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003449 VkImageView* pView) {
3450 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO)
3451 deviceObject := GetDevice(device)
3452
3453 imageObject := GetImage(pCreateInfo.image)
3454 assert(imageObject.device == device)
3455
3456 view := ?
3457 pView[0] = view
3458 State.ImageViews[view] = new!ImageViewObject(device: device, image: pCreateInfo.image)
3459
3460 return ?
3461}
3462
3463@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003464cmd void vkDestroyImageView(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003465 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003466 VkImageView imageView,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003467 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003468 deviceObject := GetDevice(device)
3469 imageViewObject := GetImageView(imageView)
3470 assert(imageViewObject.device == device)
3471
3472 State.ImageViews[imageView] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003473}
3474
3475
3476// Shader functions
3477
3478cmd VkResult vkCreateShaderModule(
3479 VkDevice device,
3480 const VkShaderModuleCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003481 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003482 VkShaderModule* pShaderModule) {
3483 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO)
3484 deviceObject := GetDevice(device)
3485
3486 shaderModule := ?
3487 pShaderModule[0] = shaderModule
3488 State.ShaderModules[shaderModule] = new!ShaderModuleObject(device: device)
3489
3490 return ?
3491}
3492
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003493cmd void vkDestroyShaderModule(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003494 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003495 VkShaderModule shaderModule,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003496 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003497 deviceObject := GetDevice(device)
3498 shaderModuleObject := GetShaderModule(shaderModule)
3499 assert(shaderModuleObject.device == device)
3500
3501 State.ShaderModules[shaderModule] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003502}
3503
Jesse Halld27f6aa2015-08-15 17:58:48 -07003504
3505// Pipeline functions
3506
3507cmd VkResult vkCreatePipelineCache(
3508 VkDevice device,
3509 const VkPipelineCacheCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003510 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003511 VkPipelineCache* pPipelineCache) {
3512 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO)
3513 deviceObject := GetDevice(device)
3514
3515 pipelineCache := ?
3516 pPipelineCache[0] = pipelineCache
3517 State.PipelineCaches[pipelineCache] = new!PipelineCacheObject(device: device)
3518
3519 return ?
3520}
3521
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003522cmd void vkDestroyPipelineCache(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003523 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003524 VkPipelineCache pipelineCache,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003525 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003526 deviceObject := GetDevice(device)
3527 pipelineCacheObject := GetPipelineCache(pipelineCache)
3528 assert(pipelineCacheObject.device == device)
3529
3530 State.PipelineCaches[pipelineCache] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003531}
3532
Jesse Halld27f6aa2015-08-15 17:58:48 -07003533cmd VkResult vkGetPipelineCacheData(
3534 VkDevice device,
3535 VkPipelineCache pipelineCache,
Jesse Halla9bb62b2015-11-21 19:31:56 -08003536 platform.size_t* pDataSize,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003537 void* pData) {
3538 deviceObject := GetDevice(device)
3539 pipelineCacheObject := GetPipelineCache(pipelineCache)
3540 assert(pipelineCacheObject.device == device)
3541
3542 return ?
3543}
3544
3545cmd VkResult vkMergePipelineCaches(
3546 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003547 VkPipelineCache dstCache,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003548 u32 srcCacheCount,
3549 const VkPipelineCache* pSrcCaches) {
3550 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003551 dstCacheObject := GetPipelineCache(dstCache)
3552 assert(dstCacheObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003553
3554 srcCaches := pSrcCaches[0:srcCacheCount]
3555 for i in (0 .. srcCacheCount) {
3556 srcCache := srcCaches[i]
3557 srcCacheObject := GetPipelineCache(srcCache)
3558 assert(srcCacheObject.device == device)
3559 }
3560
3561 return ?
3562}
3563
3564cmd VkResult vkCreateGraphicsPipelines(
3565 VkDevice device,
3566 VkPipelineCache pipelineCache,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003567 u32 createInfoCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003568 const VkGraphicsPipelineCreateInfo* pCreateInfos,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003569 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003570 VkPipeline* pPipelines) {
3571 deviceObject := GetDevice(device)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003572 if pipelineCache != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003573 pipelineCacheObject := GetPipelineCache(pipelineCache)
3574 assert(pipelineCacheObject.device == device)
3575 }
3576
Jesse Hall03b6fe12015-11-24 12:44:21 -08003577 createInfos := pCreateInfos[0:createInfoCount]
3578 pipelines := pPipelines[0:createInfoCount]
3579 for i in (0 .. createInfoCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003580 pipeline := ?
3581 pipelines[i] = pipeline
3582 State.Pipelines[pipeline] = new!PipelineObject(device: device)
3583 }
3584
3585 return ?
3586}
3587
3588cmd VkResult vkCreateComputePipelines(
3589 VkDevice device,
3590 VkPipelineCache pipelineCache,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003591 u32 createInfoCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003592 const VkComputePipelineCreateInfo* pCreateInfos,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003593 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003594 VkPipeline* pPipelines) {
3595 deviceObject := GetDevice(device)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003596 if pipelineCache != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003597 pipelineCacheObject := GetPipelineCache(pipelineCache)
3598 assert(pipelineCacheObject.device == device)
3599 }
3600
Jesse Hall03b6fe12015-11-24 12:44:21 -08003601 createInfos := pCreateInfos[0:createInfoCount]
3602 pipelines := pPipelines[0:createInfoCount]
3603 for i in (0 .. createInfoCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003604 pipeline := ?
3605 pipelines[i] = pipeline
3606 State.Pipelines[pipeline] = new!PipelineObject(device: device)
3607 }
3608
3609 return ?
3610}
3611
3612@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003613cmd void vkDestroyPipeline(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003614 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003615 VkPipeline pipeline,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003616 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003617 deviceObject := GetDevice(device)
3618 pipelineObjects := GetPipeline(pipeline)
3619 assert(pipelineObjects.device == device)
3620
3621 State.Pipelines[pipeline] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003622}
3623
3624
3625// Pipeline layout functions
3626
3627@threadSafety("system")
3628cmd VkResult vkCreatePipelineLayout(
3629 VkDevice device,
3630 const VkPipelineLayoutCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003631 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003632 VkPipelineLayout* pPipelineLayout) {
3633 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO)
3634 deviceObject := GetDevice(device)
3635
3636 pipelineLayout := ?
3637 pPipelineLayout[0] = pipelineLayout
3638 State.PipelineLayouts[pipelineLayout] = new!PipelineLayoutObject(device: device)
3639
3640 return ?
3641}
3642
3643@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003644cmd void vkDestroyPipelineLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003645 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003646 VkPipelineLayout pipelineLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003647 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003648 deviceObject := GetDevice(device)
3649 pipelineLayoutObjects := GetPipelineLayout(pipelineLayout)
3650 assert(pipelineLayoutObjects.device == device)
3651
3652 State.PipelineLayouts[pipelineLayout] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003653}
3654
3655
3656// Sampler functions
3657
3658@threadSafety("system")
3659cmd VkResult vkCreateSampler(
3660 VkDevice device,
3661 const VkSamplerCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003662 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003663 VkSampler* pSampler) {
3664 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO)
3665 deviceObject := GetDevice(device)
3666
3667 sampler := ?
3668 pSampler[0] = sampler
3669 State.Samplers[sampler] = new!SamplerObject(device: device)
3670
3671 return ?
3672}
3673
3674@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003675cmd void vkDestroySampler(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003676 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003677 VkSampler sampler,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003678 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003679 deviceObject := GetDevice(device)
3680 samplerObject := GetSampler(sampler)
3681 assert(samplerObject.device == device)
3682
3683 State.Samplers[sampler] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003684}
3685
3686
3687// Descriptor set functions
3688
3689@threadSafety("system")
3690cmd VkResult vkCreateDescriptorSetLayout(
3691 VkDevice device,
3692 const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003693 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003694 VkDescriptorSetLayout* pSetLayout) {
3695 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO)
3696 deviceObject := GetDevice(device)
3697
3698 setLayout := ?
3699 pSetLayout[0] = setLayout
3700 State.DescriptorSetLayouts[setLayout] = new!DescriptorSetLayoutObject(device: device)
3701
3702 return ?
3703}
3704
3705@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003706cmd void vkDestroyDescriptorSetLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003707 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003708 VkDescriptorSetLayout descriptorSetLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003709 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003710 deviceObject := GetDevice(device)
3711 descriptorSetLayoutObject := GetDescriptorSetLayout(descriptorSetLayout)
3712 assert(descriptorSetLayoutObject.device == device)
3713
3714 State.DescriptorSetLayouts[descriptorSetLayout] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003715}
3716
3717@threadSafety("system")
3718cmd VkResult vkCreateDescriptorPool(
3719 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003720 const VkDescriptorPoolCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003721 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003722 VkDescriptorPool* pDescriptorPool) {
3723 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO)
3724 deviceObject := GetDevice(device)
3725
3726 descriptorPool := ?
3727 pDescriptorPool[0] = descriptorPool
3728 State.DescriptorPools[descriptorPool] = new!DescriptorPoolObject(device: device)
3729
3730 return ?
3731}
3732
3733@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003734cmd void vkDestroyDescriptorPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003735 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003736 VkDescriptorPool descriptorPool,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003737 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003738 deviceObject := GetDevice(device)
3739 descriptorPoolObject := GetDescriptorPool(descriptorPool)
3740 assert(descriptorPoolObject.device == device)
3741
3742 State.DescriptorPools[descriptorPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003743}
3744
3745@threadSafety("app")
3746cmd VkResult vkResetDescriptorPool(
3747 VkDevice device,
Jesse Hallfbf97b02015-11-20 14:17:03 -08003748 VkDescriptorPool descriptorPool,
3749 VkDescriptorPoolResetFlags flags) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003750 deviceObject := GetDevice(device)
3751 descriptorPoolObject := GetDescriptorPool(descriptorPool)
3752 assert(descriptorPoolObject.device == device)
3753
3754 return ?
3755}
3756
3757@threadSafety("app")
Jesse Hall3fbc8562015-11-29 22:10:52 -08003758cmd VkResult vkAllocateDescriptorSets(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003759 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003760 const VkDescriptorSetAllocateInfo* pAllocateInfo,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003761 VkDescriptorSet* pDescriptorSets) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003762 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003763 allocInfo := pAllocateInfo[0]
Jesse Hallfbf97b02015-11-20 14:17:03 -08003764 descriptorPoolObject := GetDescriptorPool(allocInfo.descriptorPool)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003765
Jesse Hall03b6fe12015-11-24 12:44:21 -08003766 setLayouts := allocInfo.pSetLayouts[0:allocInfo.setCount]
3767 for i in (0 .. allocInfo.setCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003768 setLayout := setLayouts[i]
3769 setLayoutObject := GetDescriptorSetLayout(setLayout)
3770 assert(setLayoutObject.device == device)
3771 }
3772
Jesse Hall03b6fe12015-11-24 12:44:21 -08003773 descriptorSets := pDescriptorSets[0:allocInfo.setCount]
3774 for i in (0 .. allocInfo.setCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003775 descriptorSet := ?
3776 descriptorSets[i] = descriptorSet
3777 State.DescriptorSets[descriptorSet] = new!DescriptorSetObject(device: device)
3778 }
3779
3780 return ?
3781}
3782
Jesse Hallf09c6b12015-08-15 19:54:28 -07003783cmd VkResult vkFreeDescriptorSets(
3784 VkDevice device,
3785 VkDescriptorPool descriptorPool,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003786 u32 descriptorSetCount,
Jesse Hallf09c6b12015-08-15 19:54:28 -07003787 const VkDescriptorSet* pDescriptorSets) {
3788 deviceObject := GetDevice(device)
3789 descriptorPoolObject := GetDescriptorPool(descriptorPool)
3790
Jesse Hall03b6fe12015-11-24 12:44:21 -08003791 descriptorSets := pDescriptorSets[0:descriptorSetCount]
3792 for i in (0 .. descriptorSetCount) {
Jesse Hallf09c6b12015-08-15 19:54:28 -07003793 descriptorSet := descriptorSets[i]
3794 descriptorSetObject := GetDescriptorSet(descriptorSet)
3795 assert(descriptorSetObject.device == device)
3796 State.DescriptorSets[descriptorSet] = null
3797 }
3798
3799 return ?
3800}
3801
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003802cmd void vkUpdateDescriptorSets(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003803 VkDevice device,
Jesse Hallb00daad2015-11-29 19:46:20 -08003804 u32 descriptorWriteCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003805 const VkWriteDescriptorSet* pDescriptorWrites,
Jesse Hallb00daad2015-11-29 19:46:20 -08003806 u32 descriptorCopyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003807 const VkCopyDescriptorSet* pDescriptorCopies) {
3808 deviceObject := GetDevice(device)
3809
Jesse Hallb00daad2015-11-29 19:46:20 -08003810 descriptorWrites := pDescriptorWrites[0:descriptorWriteCount]
3811 for i in (0 .. descriptorWriteCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003812 descriptorWrite := descriptorWrites[i]
Jesse Hall3fbc8562015-11-29 22:10:52 -08003813 descriptorWriteObject := GetDescriptorSet(descriptorWrite.dstSet)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003814 assert(descriptorWriteObject.device == device)
3815 }
3816
Jesse Hallb00daad2015-11-29 19:46:20 -08003817 descriptorCopies := pDescriptorCopies[0:descriptorCopyCount]
3818 for i in (0 .. descriptorCopyCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003819 descriptorCopy := descriptorCopies[i]
Jesse Hall3fbc8562015-11-29 22:10:52 -08003820 descriptorCopyObject := GetDescriptorSet(descriptorCopy.dstSet)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003821 assert(descriptorCopyObject.device == device)
3822 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07003823}
3824
3825
3826// Framebuffer functions
3827
3828@threadSafety("system")
3829cmd VkResult vkCreateFramebuffer(
3830 VkDevice device,
3831 const VkFramebufferCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003832 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003833 VkFramebuffer* pFramebuffer) {
3834 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO)
3835 deviceObject := GetDevice(device)
3836
3837 framebuffer := ?
3838 pFramebuffer[0] = framebuffer
3839 State.Framebuffers[framebuffer] = new!FramebufferObject(device: device)
3840
3841 return ?
3842}
3843
3844@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003845cmd void vkDestroyFramebuffer(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003846 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003847 VkFramebuffer framebuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003848 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003849 deviceObject := GetDevice(device)
3850 framebufferObject := GetFramebuffer(framebuffer)
3851 assert(framebufferObject.device == device)
3852
3853 State.Framebuffers[framebuffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003854}
3855
3856
3857// Renderpass functions
3858
3859@threadSafety("system")
3860cmd VkResult vkCreateRenderPass(
3861 VkDevice device,
3862 const VkRenderPassCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003863 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003864 VkRenderPass* pRenderPass) {
3865 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO)
3866 deviceObject := GetDevice(device)
3867
3868 renderpass := ?
3869 pRenderPass[0] = renderpass
3870 State.RenderPasses[renderpass] = new!RenderPassObject(device: device)
3871
3872 return ?
3873}
3874
3875@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003876cmd void vkDestroyRenderPass(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003877 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003878 VkRenderPass renderPass,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003879 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003880 deviceObject := GetDevice(device)
3881 renderPassObject := GetRenderPass(renderPass)
3882 assert(renderPassObject.device == device)
3883
3884 State.RenderPasses[renderPass] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003885}
3886
Jesse Hall606a54e2015-11-19 22:17:28 -08003887cmd void vkGetRenderAreaGranularity(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003888 VkDevice device,
3889 VkRenderPass renderPass,
3890 VkExtent2D* pGranularity) {
3891 deviceObject := GetDevice(device)
3892 renderPassObject := GetRenderPass(renderPass)
3893
3894 granularity := ?
3895 pGranularity[0] = granularity
Jesse Halld27f6aa2015-08-15 17:58:48 -07003896}
3897
3898// Command pool functions
3899
3900cmd VkResult vkCreateCommandPool(
3901 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003902 const VkCommandPoolCreateInfo* pCreateInfo,
3903 const VkAllocationCallbacks* pAllocator,
3904 VkCommandPool* pCommandPool) {
3905 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003906 deviceObject := GetDevice(device)
3907
Jesse Hall3fbc8562015-11-29 22:10:52 -08003908 commandPool := ?
3909 pCommandPool[0] = commandPool
3910 State.CommandPools[commandPool] = new!CommandPoolObject(device: device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003911
3912 return ?
3913}
3914
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003915cmd void vkDestroyCommandPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003916 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003917 VkCommandPool commandPool,
3918 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003919 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003920 commandPoolObject := GetCommandPool(commandPool)
3921 assert(commandPoolObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003922
Jesse Hall3fbc8562015-11-29 22:10:52 -08003923 State.CommandPools[commandPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003924}
3925
3926cmd VkResult vkResetCommandPool(
3927 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003928 VkCommandPool commandPool,
3929 VkCommandPoolResetFlags flags) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003930 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003931 commandPoolObject := GetCommandPool(commandPool)
3932 assert(commandPoolObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003933
3934 return ?
3935}
3936
3937// Command buffer functions
3938
Jesse Hall3fbc8562015-11-29 22:10:52 -08003939macro void bindCommandBuffer(VkCommandBuffer commandBuffer, any obj, VkDeviceMemory memory) {
3940 memoryObject := GetDeviceMemory(memory)
3941 memoryObject.boundCommandBuffers[commandBuffer] = commandBuffer
Jesse Halld27f6aa2015-08-15 17:58:48 -07003942
Jesse Hall3fbc8562015-11-29 22:10:52 -08003943 commandBufferObject := GetCommandBuffer(commandBuffer)
3944 commandBufferObject.boundObjects[as!u64(obj)] = memory
Jesse Halld27f6aa2015-08-15 17:58:48 -07003945}
3946
Jesse Hall3fbc8562015-11-29 22:10:52 -08003947macro void unbindCommandBuffer(VkCommandBuffer commandBuffer, any obj, VkDeviceMemory memory) {
3948 memoryObject := GetDeviceMemory(memory)
3949 memoryObject.boundCommandBuffers[commandBuffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003950
Jesse Hall3fbc8562015-11-29 22:10:52 -08003951 commandBufferObject := GetCommandBuffer(commandBuffer)
3952 commandBufferObject.boundObjects[as!u64(obj)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003953}
3954
3955@threadSafety("system")
Jesse Hall3fbc8562015-11-29 22:10:52 -08003956cmd VkResult vkAllocateCommandBuffers(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003957 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003958 const VkCommandBufferAllocateInfo* pAllocateInfo,
3959 VkCommandBuffer* pCommandBuffers) {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08003960 assert(pAllocateInfo[0].sType == VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003961
Jesse Hall3fbc8562015-11-29 22:10:52 -08003962 count := pAllocateInfo[0].bufferCount
3963 commandBuffers := pCommandBuffers[0:count]
Jesse Hallfbf97b02015-11-20 14:17:03 -08003964 for i in (0 .. count) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08003965 commandBuffer := ?
3966 commandBuffers[i] = commandBuffer
3967 State.CommandBuffers[commandBuffer] = new!CommandBufferObject(device: device)
Jesse Hallfbf97b02015-11-20 14:17:03 -08003968 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07003969
3970 return ?
3971}
3972
3973@threadSafety("system")
Jesse Hallfbf97b02015-11-20 14:17:03 -08003974cmd void vkFreeCommandBuffers(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003975 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003976 VkCommandPool commandPool,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003977 u32 commandBufferCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003978 const VkCommandBuffer* pCommandBuffers) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003979 deviceObject := GetDevice(device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003980
Jesse Hall3fbc8562015-11-29 22:10:52 -08003981 commandBuffers := pCommandBuffers[0:commandBufferCount]
Jesse Hall03b6fe12015-11-24 12:44:21 -08003982 for i in (0 .. commandBufferCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08003983 commandBufferObject := GetCommandBuffer(commandBuffers[i])
3984 assert(commandBufferObject.device == device)
Jesse Hallfbf97b02015-11-20 14:17:03 -08003985 // TODO: iterate over boundObjects and clear memory bindings
Jesse Hall3fbc8562015-11-29 22:10:52 -08003986 State.CommandBuffers[commandBuffers[i]] = null
Jesse Hallfbf97b02015-11-20 14:17:03 -08003987 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07003988}
3989
3990@threadSafety("app")
3991cmd VkResult vkBeginCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08003992 VkCommandBuffer commandBuffer,
3993 const VkCommandBufferBeginInfo* pBeginInfo) {
3994 assert(pBeginInfo.sType == VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO)
3995 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003996
3997 // TODO: iterate over boundObjects and clear memory bindings
3998
3999 return ?
4000}
4001
4002@threadSafety("app")
4003cmd VkResult vkEndCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004004 VkCommandBuffer commandBuffer) {
4005 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004006
4007 return ?
4008}
4009
4010@threadSafety("app")
4011cmd VkResult vkResetCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004012 VkCommandBuffer commandBuffer,
4013 VkCommandBufferResetFlags flags) {
4014 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004015
4016 // TODO: iterate over boundObjects and clear memory bindings
4017
4018 return ?
4019}
4020
4021
4022// Command buffer building functions
4023
4024@threadSafety("app")
4025cmd void vkCmdBindPipeline(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004026 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004027 VkPipelineBindPoint pipelineBindPoint,
4028 VkPipeline pipeline) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004029 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004030 pipelineObject := GetPipeline(pipeline)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004031 assert(commandBufferObject.device == pipelineObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004032
Jesse Halld8bade02015-11-24 10:24:18 -08004033 queue := switch (pipelineBindPoint) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004034 case VK_PIPELINE_BIND_POINT_COMPUTE: VK_QUEUE_COMPUTE_BIT
4035 case VK_PIPELINE_BIND_POINT_GRAPHICS: VK_QUEUE_GRAPHICS_BIT
4036 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08004037 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004038}
4039
4040@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004041cmd void vkCmdSetViewport(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004042 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004043 u32 firstViewport,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004044 u32 viewportCount,
4045 const VkViewport* pViewports) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004046 commandBufferObject := GetCommandBuffer(commandBuffer)
4047 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004048}
4049
4050@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004051cmd void vkCmdSetScissor(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004052 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004053 u32 firstScissor,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004054 u32 scissorCount,
4055 const VkRect2D* pScissors) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004056 commandBufferObject := GetCommandBuffer(commandBuffer)
4057 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004058}
4059
4060@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004061cmd void vkCmdSetLineWidth(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004062 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004063 f32 lineWidth) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004064 commandBufferObject := GetCommandBuffer(commandBuffer)
4065 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004066}
4067
4068@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004069cmd void vkCmdSetDepthBias(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004070 VkCommandBuffer commandBuffer,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004071 f32 depthBiasConstantFactor,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004072 f32 depthBiasClamp,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004073 f32 depthBiasSlopeFactor) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004074 commandBufferObject := GetCommandBuffer(commandBuffer)
4075 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004076}
Jesse Halld27f6aa2015-08-15 17:58:48 -07004077
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004078@threadSafety("app")
4079cmd void vkCmdSetBlendConstants(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004080 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004081 // TODO(jessehall): apic only supports 'const' on pointer types. Using
4082 // an annotation as a quick hack to pass this to the template without
4083 // having to modify the AST and semantic model.
Jesse Hallb00daad2015-11-29 19:46:20 -08004084 @readonly f32[4] blendConstants) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004085 commandBufferObject := GetCommandBuffer(commandBuffer)
4086 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004087}
4088
4089@threadSafety("app")
4090cmd void vkCmdSetDepthBounds(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004091 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004092 f32 minDepthBounds,
4093 f32 maxDepthBounds) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004094 commandBufferObject := GetCommandBuffer(commandBuffer)
4095 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004096}
4097
4098@threadSafety("app")
4099cmd void vkCmdSetStencilCompareMask(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004100 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004101 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08004102 u32 compareMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004103 commandBufferObject := GetCommandBuffer(commandBuffer)
4104 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004105}
4106
4107@threadSafety("app")
4108cmd void vkCmdSetStencilWriteMask(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004109 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004110 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08004111 u32 writeMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004112 commandBufferObject := GetCommandBuffer(commandBuffer)
4113 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004114}
4115
4116@threadSafety("app")
4117cmd void vkCmdSetStencilReference(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004118 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004119 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08004120 u32 reference) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004121 commandBufferObject := GetCommandBuffer(commandBuffer)
4122 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004123}
4124
4125@threadSafety("app")
4126cmd void vkCmdBindDescriptorSets(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004127 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004128 VkPipelineBindPoint pipelineBindPoint,
4129 VkPipelineLayout layout,
4130 u32 firstSet,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004131 u32 descriptorSetCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004132 const VkDescriptorSet* pDescriptorSets,
4133 u32 dynamicOffsetCount,
4134 const u32* pDynamicOffsets) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004135 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004136
Jesse Hall03b6fe12015-11-24 12:44:21 -08004137 descriptorSets := pDescriptorSets[0:descriptorSetCount]
4138 for i in (0 .. descriptorSetCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004139 descriptorSet := descriptorSets[i]
4140 descriptorSetObject := GetDescriptorSet(descriptorSet)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004141 assert(commandBufferObject.device == descriptorSetObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004142 }
4143
4144 dynamicOffsets := pDynamicOffsets[0:dynamicOffsetCount]
4145 for i in (0 .. dynamicOffsetCount) {
4146 dynamicOffset := dynamicOffsets[i]
4147 }
4148
Jesse Halld8bade02015-11-24 10:24:18 -08004149 queue := switch (pipelineBindPoint) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004150 case VK_PIPELINE_BIND_POINT_COMPUTE: VK_QUEUE_COMPUTE_BIT
4151 case VK_PIPELINE_BIND_POINT_GRAPHICS: VK_QUEUE_GRAPHICS_BIT
4152 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08004153 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004154}
4155
4156@threadSafety("app")
4157cmd void vkCmdBindIndexBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004158 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004159 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004160 VkDeviceSize offset,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004161 VkIndexType indexType) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004162 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004163 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004164 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004165
Jesse Hall3fbc8562015-11-29 22:10:52 -08004166 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004167
Jesse Hall3fbc8562015-11-29 22:10:52 -08004168 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004169}
4170
4171@threadSafety("app")
4172cmd void vkCmdBindVertexBuffers(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004173 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004174 u32 firstBinding,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004175 u32 bindingCount,
4176 const VkBuffer* pBuffers,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004177 const VkDeviceSize* pOffsets) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004178 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004179
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004180 // TODO: check if not [firstBinding:firstBinding+bindingCount]
Jesse Halld27f6aa2015-08-15 17:58:48 -07004181 buffers := pBuffers[0:bindingCount]
4182 offsets := pOffsets[0:bindingCount]
4183 for i in (0 .. bindingCount) {
4184 buffer := buffers[i]
4185 offset := offsets[i]
4186 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004187 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004188
Jesse Hall3fbc8562015-11-29 22:10:52 -08004189 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004190 }
4191
Jesse Hall3fbc8562015-11-29 22:10:52 -08004192 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004193}
4194
4195@threadSafety("app")
4196cmd void vkCmdDraw(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004197 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004198 u32 vertexCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004199 u32 instanceCount,
4200 u32 firstVertex,
4201 u32 firstInstance) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004202 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004203
Jesse Hall3fbc8562015-11-29 22:10:52 -08004204 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004205}
4206
4207@threadSafety("app")
4208cmd void vkCmdDrawIndexed(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004209 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004210 u32 indexCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004211 u32 instanceCount,
4212 u32 firstIndex,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004213 s32 vertexOffset,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004214 u32 firstInstance) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004215 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004216
Jesse Hall3fbc8562015-11-29 22:10:52 -08004217 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004218}
4219
4220@threadSafety("app")
4221cmd void vkCmdDrawIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004222 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004223 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004224 VkDeviceSize offset,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004225 u32 drawCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004226 u32 stride) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004227 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004228 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004229 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004230
Jesse Hall3fbc8562015-11-29 22:10:52 -08004231 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004232
Jesse Hall3fbc8562015-11-29 22:10:52 -08004233 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004234}
4235
4236@threadSafety("app")
4237cmd void vkCmdDrawIndexedIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004238 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004239 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004240 VkDeviceSize offset,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004241 u32 drawCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004242 u32 stride) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004243 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004244 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004245 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004246
Jesse Hall3fbc8562015-11-29 22:10:52 -08004247 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004248
Jesse Hall3fbc8562015-11-29 22:10:52 -08004249 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004250}
4251
4252@threadSafety("app")
4253cmd void vkCmdDispatch(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004254 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004255 u32 x,
4256 u32 y,
4257 u32 z) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004258 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004259
Jesse Hall3fbc8562015-11-29 22:10:52 -08004260 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_COMPUTE_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004261}
4262
4263@threadSafety("app")
4264cmd void vkCmdDispatchIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004265 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004266 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004267 VkDeviceSize offset) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004268 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004269 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004270 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004271
Jesse Hall3fbc8562015-11-29 22:10:52 -08004272 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004273
Jesse Hall3fbc8562015-11-29 22:10:52 -08004274 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_COMPUTE_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004275}
4276
4277@threadSafety("app")
4278cmd void vkCmdCopyBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004279 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004280 VkBuffer srcBuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004281 VkBuffer dstBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004282 u32 regionCount,
4283 const VkBufferCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004284 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004285 srcBufferObject := GetBuffer(srcBuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004286 dstBufferObject := GetBuffer(dstBuffer)
4287 assert(commandBufferObject.device == srcBufferObject.device)
4288 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004289
4290 regions := pRegions[0:regionCount]
4291 for i in (0 .. regionCount) {
4292 region := regions[i]
4293 }
4294
Jesse Hall3fbc8562015-11-29 22:10:52 -08004295 bindCommandBuffer(commandBuffer, srcBuffer, srcBufferObject.memory)
4296 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004297
Jesse Hall65ab5522015-11-30 00:07:16 -08004298 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004299}
4300
4301@threadSafety("app")
4302cmd void vkCmdCopyImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004303 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004304 VkImage srcImage,
4305 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004306 VkImage dstImage,
4307 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004308 u32 regionCount,
4309 const VkImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004310 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004311 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004312 dstImageObject := GetImage(dstImage)
4313 assert(commandBufferObject.device == srcImageObject.device)
4314 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004315
4316 regions := pRegions[0:regionCount]
4317 for i in (0 .. regionCount) {
4318 region := regions[i]
4319 }
4320
Jesse Hall3fbc8562015-11-29 22:10:52 -08004321 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
4322 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004323
Jesse Hall65ab5522015-11-30 00:07:16 -08004324 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004325}
4326
4327@threadSafety("app")
4328cmd void vkCmdBlitImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004329 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004330 VkImage srcImage,
4331 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004332 VkImage dstImage,
4333 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004334 u32 regionCount,
4335 const VkImageBlit* pRegions,
Jesse Hall23ff73f2015-11-29 14:36:39 -08004336 VkFilter filter) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004337 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004338 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004339 dstImageObject := GetImage(dstImage)
4340 assert(commandBufferObject.device == srcImageObject.device)
4341 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004342
4343 regions := pRegions[0:regionCount]
4344 for i in (0 .. regionCount) {
4345 region := regions[i]
4346 }
4347
Jesse Hall3fbc8562015-11-29 22:10:52 -08004348 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
4349 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004350
Jesse Hall3fbc8562015-11-29 22:10:52 -08004351 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004352}
4353
4354@threadSafety("app")
4355cmd void vkCmdCopyBufferToImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004356 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004357 VkBuffer srcBuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004358 VkImage dstImage,
4359 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004360 u32 regionCount,
4361 const VkBufferImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004362 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004363 srcBufferObject := GetBuffer(srcBuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004364 dstImageObject := GetImage(dstImage)
4365 assert(commandBufferObject.device == srcBufferObject.device)
4366 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004367
4368 regions := pRegions[0:regionCount]
4369 for i in (0 .. regionCount) {
4370 region := regions[i]
4371 }
4372
Jesse Hall3fbc8562015-11-29 22:10:52 -08004373 bindCommandBuffer(commandBuffer, srcBuffer, srcBufferObject.memory)
4374 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004375
Jesse Hall65ab5522015-11-30 00:07:16 -08004376 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004377}
4378
4379@threadSafety("app")
4380cmd void vkCmdCopyImageToBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004381 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004382 VkImage srcImage,
4383 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004384 VkBuffer dstBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004385 u32 regionCount,
4386 const VkBufferImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004387 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004388 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004389 dstBufferObject := GetBuffer(dstBuffer)
4390 assert(commandBufferObject.device == srcImageObject.device)
4391 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004392
4393 regions := pRegions[0:regionCount]
4394 for i in (0 .. regionCount) {
4395 region := regions[i]
4396 }
4397
Jesse Hall3fbc8562015-11-29 22:10:52 -08004398 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
4399 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004400
Jesse Hall65ab5522015-11-30 00:07:16 -08004401 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004402}
4403
4404@threadSafety("app")
4405cmd void vkCmdUpdateBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004406 VkCommandBuffer commandBuffer,
4407 VkBuffer dstBuffer,
4408 VkDeviceSize dstOffset,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004409 VkDeviceSize dataSize,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004410 const u32* pData) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004411 commandBufferObject := GetCommandBuffer(commandBuffer)
4412 dstBufferObject := GetBuffer(dstBuffer)
4413 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004414
4415 data := pData[0:dataSize]
4416
Jesse Hall3fbc8562015-11-29 22:10:52 -08004417 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004418
Jesse Hall65ab5522015-11-30 00:07:16 -08004419 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004420}
4421
4422@threadSafety("app")
4423cmd void vkCmdFillBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004424 VkCommandBuffer commandBuffer,
4425 VkBuffer dstBuffer,
4426 VkDeviceSize dstOffset,
Jesse Hallb00daad2015-11-29 19:46:20 -08004427 VkDeviceSize size,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004428 u32 data) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004429 commandBufferObject := GetCommandBuffer(commandBuffer)
4430 dstBufferObject := GetBuffer(dstBuffer)
4431 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004432
Jesse Hall65ab5522015-11-30 00:07:16 -08004433 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004434}
4435
4436@threadSafety("app")
4437cmd void vkCmdClearColorImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004438 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004439 VkImage image,
4440 VkImageLayout imageLayout,
4441 const VkClearColorValue* pColor,
4442 u32 rangeCount,
4443 const VkImageSubresourceRange* pRanges) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004444 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004445 imageObject := GetImage(image)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004446 assert(commandBufferObject.device == imageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004447
4448 ranges := pRanges[0:rangeCount]
4449 for i in (0 .. rangeCount) {
4450 range := ranges[i]
4451 }
4452
Jesse Hall3fbc8562015-11-29 22:10:52 -08004453 bindCommandBuffer(commandBuffer, image, imageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004454
Jesse Hall3fbc8562015-11-29 22:10:52 -08004455 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004456}
4457
4458@threadSafety("app")
4459cmd void vkCmdClearDepthStencilImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004460 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004461 VkImage image,
4462 VkImageLayout imageLayout,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004463 const VkClearDepthStencilValue* pDepthStencil,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004464 u32 rangeCount,
4465 const VkImageSubresourceRange* pRanges) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004466 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004467 imageObject := GetImage(image)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004468 assert(commandBufferObject.device == imageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004469
4470 ranges := pRanges[0:rangeCount]
4471 for i in (0 .. rangeCount) {
4472 range := ranges[i]
4473 }
4474
Jesse Hall3fbc8562015-11-29 22:10:52 -08004475 bindCommandBuffer(commandBuffer, image, imageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004476
Jesse Hall3fbc8562015-11-29 22:10:52 -08004477 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004478}
4479
4480@threadSafety("app")
Jesse Hallae38f732015-11-19 21:32:50 -08004481cmd void vkCmdClearAttachments(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004482 VkCommandBuffer commandBuffer,
Jesse Hallae38f732015-11-19 21:32:50 -08004483 u32 attachmentCount,
4484 const VkClearAttachment* pAttachments,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004485 u32 rectCount,
Jesse Halla15a4bf2015-11-19 22:48:02 -08004486 const VkClearRect* pRects) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004487 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004488
4489 rects := pRects[0:rectCount]
4490 for i in (0 .. rectCount) {
4491 rect := rects[i]
4492 }
4493
Jesse Hall3fbc8562015-11-29 22:10:52 -08004494 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004495}
4496
4497@threadSafety("app")
4498cmd void vkCmdResolveImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004499 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004500 VkImage srcImage,
4501 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004502 VkImage dstImage,
4503 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004504 u32 regionCount,
4505 const VkImageResolve* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004506 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004507 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004508 dstImageObject := GetImage(dstImage)
4509 assert(commandBufferObject.device == srcImageObject.device)
4510 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004511
4512 regions := pRegions[0:regionCount]
4513 for i in (0 .. regionCount) {
4514 region := regions[i]
4515 }
4516
Jesse Hall3fbc8562015-11-29 22:10:52 -08004517 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
4518 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004519
Jesse Hall3fbc8562015-11-29 22:10:52 -08004520 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004521}
4522
4523@threadSafety("app")
4524cmd void vkCmdSetEvent(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004525 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004526 VkEvent event,
4527 VkPipelineStageFlags stageMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004528 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004529 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004530 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004531}
4532
4533@threadSafety("app")
4534cmd void vkCmdResetEvent(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004535 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004536 VkEvent event,
4537 VkPipelineStageFlags stageMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004538 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004539 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004540 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004541}
4542
4543@threadSafety("app")
4544cmd void vkCmdWaitEvents(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004545 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004546 u32 eventCount,
4547 const VkEvent* pEvents,
4548 VkPipelineStageFlags srcStageMask,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004549 VkPipelineStageFlags dstStageMask,
4550 u32 memoryBarrierCount,
4551 const void* const* ppMemoryBarriers) {
4552 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004553
4554 events := pEvents[0:eventCount]
4555 for i in (0 .. eventCount) {
4556 event := events[i]
4557 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004558 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004559 }
4560
Jesse Hall3fbc8562015-11-29 22:10:52 -08004561 pMemoryBarriers := ppMemoryBarriers[0:memoryBarrierCount]
4562 for i in (0 .. memoryBarrierCount) {
4563 switch as!VkMemoryBarrier const*(pMemoryBarriers[i])[0].sType {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004564 case VK_STRUCTURE_TYPE_MEMORY_BARRIER: {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004565 memoryBarrier := as!VkMemoryBarrier const*(pMemoryBarriers[i])[0]
Jesse Halld27f6aa2015-08-15 17:58:48 -07004566 }
4567 case VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER: {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004568 imageMemoryBarrier := as!VkImageMemoryBarrier const*(pMemoryBarriers[i])[0]
4569 imageObject := GetImage(imageMemoryBarrier.image)
4570 assert(imageObject.device == commandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004571 }
4572 case VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER: {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004573 bufferMemoryBarrier := as!VkBufferMemoryBarrier const*(pMemoryBarriers[i])[0]
4574 bufferObject := GetBuffer(bufferMemoryBarrier.buffer)
4575 assert(bufferObject.device == commandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004576 }
4577 }
4578 }
4579}
4580
4581@threadSafety("app")
4582cmd void vkCmdPipelineBarrier(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004583 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004584 VkPipelineStageFlags srcStageMask,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004585 VkPipelineStageFlags dstStageMask,
Jesse Halldc6d36c2015-11-29 19:12:15 -08004586 VkDependencyFlags dependencyFlags,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004587 u32 memoryBarrierCount,
4588 const void* const* ppMemoryBarriers) {
4589 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004590
Jesse Hall3fbc8562015-11-29 22:10:52 -08004591 pMemoryBarriers := ppMemoryBarriers[0:memoryBarrierCount]
4592 for i in (0 .. memoryBarrierCount) {
4593 switch as!VkMemoryBarrier const*(pMemoryBarriers[i])[0].sType {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004594 case VK_STRUCTURE_TYPE_MEMORY_BARRIER: {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004595 memoryBarrier := as!VkMemoryBarrier const*(pMemoryBarriers[i])[0]
Jesse Halld27f6aa2015-08-15 17:58:48 -07004596 }
4597 case VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER: {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004598 imageMemoryBarrier := as!VkImageMemoryBarrier const*(pMemoryBarriers[i])[0]
4599 imageObject := GetImage(imageMemoryBarrier.image)
4600 assert(imageObject.device == commandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004601 }
4602 case VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER: {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004603 bufferMemoryBarrier := as!VkBufferMemoryBarrier const*(pMemoryBarriers[i])[0]
4604 bufferObject := GetBuffer(bufferMemoryBarrier.buffer)
4605 assert(bufferObject.device == commandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004606 }
4607 }
4608 }
4609}
4610
4611@threadSafety("app")
4612cmd void vkCmdBeginQuery(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004613 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004614 VkQueryPool queryPool,
Jesse Hall65ab5522015-11-30 00:07:16 -08004615 u32 entry,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004616 VkQueryControlFlags flags) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004617 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004618 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004619 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004620}
4621
4622@threadSafety("app")
4623cmd void vkCmdEndQuery(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004624 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004625 VkQueryPool queryPool,
Jesse Hall65ab5522015-11-30 00:07:16 -08004626 u32 entry) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004627 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004628 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004629 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004630}
4631
4632@threadSafety("app")
4633cmd void vkCmdResetQueryPool(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004634 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004635 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004636 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004637 u32 queryCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004638 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004639 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004640 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004641}
4642
4643@threadSafety("app")
4644cmd void vkCmdWriteTimestamp(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004645 VkCommandBuffer commandBuffer,
Jesse Hall6f39a6d2015-11-24 11:08:36 -08004646 VkPipelineStageFlagBits pipelineStage,
Jesse Halla3a7a1d2015-11-24 11:37:23 -08004647 VkQueryPool queryPool,
Jesse Hall65ab5522015-11-30 00:07:16 -08004648 u32 entry) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004649 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halla3a7a1d2015-11-24 11:37:23 -08004650 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004651 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004652}
4653
4654@threadSafety("app")
4655cmd void vkCmdCopyQueryPoolResults(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004656 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004657 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004658 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004659 u32 queryCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004660 VkBuffer dstBuffer,
4661 VkDeviceSize dstOffset,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004662 VkDeviceSize stride,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004663 VkQueryResultFlags flags) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004664 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004665 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004666 dstBufferObject := GetBuffer(dstBuffer)
4667 assert(commandBufferObject.device == queryPoolObject.device)
4668 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004669}
4670
4671cmd void vkCmdPushConstants(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004672 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004673 VkPipelineLayout layout,
4674 VkShaderStageFlags stageFlags,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004675 u32 offset,
4676 u32 size,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08004677 const void* pValues) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004678 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004679 layoutObject := GetPipelineLayout(layout)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004680 assert(commandBufferObject.device == layoutObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004681}
4682
4683@threadSafety("app")
4684cmd void vkCmdBeginRenderPass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004685 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004686 const VkRenderPassBeginInfo* pRenderPassBegin,
Jesse Hall65ab5522015-11-30 00:07:16 -08004687 VkSubpassContents contents) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004688 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004689 renderPassObject := GetRenderPass(pRenderPassBegin.renderPass)
4690 framebufferObject := GetFramebuffer(pRenderPassBegin.framebuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004691 assert(commandBufferObject.device == renderPassObject.device)
4692 assert(commandBufferObject.device == framebufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004693
Jesse Hall3fbc8562015-11-29 22:10:52 -08004694 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004695}
4696
4697cmd void vkCmdNextSubpass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004698 VkCommandBuffer commandBuffer,
Jesse Hall65ab5522015-11-30 00:07:16 -08004699 VkSubpassContents contents) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004700 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004701}
4702
4703@threadSafety("app")
4704cmd void vkCmdEndRenderPass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004705 VkCommandBuffer commandBuffer) {
4706 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004707
Jesse Hall3fbc8562015-11-29 22:10:52 -08004708 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004709}
4710
4711cmd void vkCmdExecuteCommands(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004712 VkCommandBuffer commandBuffer,
4713 u32 commandBuffersCount,
4714 const VkCommandBuffer* pCommandBuffers) {
4715 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004716
Jesse Hall3fbc8562015-11-29 22:10:52 -08004717 commandBuffers := pCommandBuffers[0:commandBuffersCount]
4718 for i in (0 .. commandBuffersCount) {
4719 secondaryCommandBuffer := commandBuffers[i]
4720 secondaryCommandBufferObject := GetCommandBuffer(secondaryCommandBuffer)
4721 assert(commandBufferObject.device == secondaryCommandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004722 }
4723}
4724
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004725@extension("VK_KHR_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08004726cmd void vkDestroySurfaceKHR(
4727 VkInstance instance,
Jesse Hall0e74f002015-11-30 11:37:59 -08004728 VkSurfaceKHR surface,
4729 const VkAllocationCallbacks* pAllocator) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08004730 instanceObject := GetInstance(instance)
4731 surfaceObject := GetSurface(surface)
4732 assert(surfaceObject.instance == instance)
Michael Lentine88594d72015-11-12 12:49:45 -08004733
Jesse Hall1356b0d2015-11-23 17:24:58 -08004734 State.Surfaces[surface] = null
Jesse Hall2818f932015-11-19 21:19:17 -08004735}
4736
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004737@extension("VK_KHR_surface")
Jesse Halla6429252015-11-29 18:59:42 -08004738cmd VkResult vkGetPhysicalDeviceSurfaceSupportKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08004739 VkPhysicalDevice physicalDevice,
4740 u32 queueFamilyIndex,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004741 VkSurfaceKHR surface,
Jesse Hallb00daad2015-11-29 19:46:20 -08004742 VkBool32* pSupported) {
4743 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08004744
4745 return ?
4746}
4747
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004748@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08004749cmd VkResult vkGetPhysicalDeviceSurfaceCapabilitiesKHR(
4750 VkPhysicalDevice physicalDevice,
4751 VkSurfaceKHR surface,
4752 VkSurfaceCapabilitiesKHR* pSurfaceCapabilities) {
4753 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
4754
4755 surfaceCapabilities := ?
4756 pSurfaceCapabilities[0] = surfaceCapabilities
4757
4758 return ?
4759}
4760
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004761@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08004762cmd VkResult vkGetPhysicalDeviceSurfaceFormatsKHR(
4763 VkPhysicalDevice physicalDevice,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004764 VkSurfaceKHR surface,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004765 u32* pSurfaceFormatCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004766 VkSurfaceFormatKHR* pSurfaceFormats) {
Jesse Hallb00daad2015-11-29 19:46:20 -08004767 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08004768
4769 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08004770 pSurfaceFormatCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08004771 surfaceFormats := pSurfaceFormats[0:count]
4772
4773 for i in (0 .. count) {
4774 surfaceFormat := ?
4775 surfaceFormats[i] = surfaceFormat
4776 }
4777
4778 return ?
4779}
4780
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004781@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08004782cmd VkResult vkGetPhysicalDeviceSurfacePresentModesKHR(
4783 VkPhysicalDevice physicalDevice,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004784 VkSurfaceKHR surface,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004785 u32* pPresentModeCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004786 VkPresentModeKHR* pPresentModes) {
Jesse Hallb00daad2015-11-29 19:46:20 -08004787 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08004788
4789 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08004790 pPresentModeCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08004791 presentModes := pPresentModes[0:count]
4792
4793 for i in (0 .. count) {
4794 presentMode := ?
4795 presentModes[i] = presentMode
4796 }
4797
4798 return ?
4799}
4800
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004801@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08004802cmd VkResult vkCreateSwapchainKHR(
4803 VkDevice device,
4804 const VkSwapchainCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08004805 const VkAllocationCallbacks* pAllocator,
Michael Lentine88594d72015-11-12 12:49:45 -08004806 VkSwapchainKHR* pSwapchain) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08004807 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR)
Michael Lentine88594d72015-11-12 12:49:45 -08004808 deviceObject := GetDevice(device)
4809
4810 swapchain := ?
4811 pSwapchain[0] = swapchain
4812 State.Swapchains[swapchain] = new!SwapchainObject(device: device)
4813
4814 return ?
4815}
4816
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004817@extension("VK_KHR_swapchain")
Jesse Hall1356b0d2015-11-23 17:24:58 -08004818cmd void vkDestroySwapchainKHR(
Michael Lentine88594d72015-11-12 12:49:45 -08004819 VkDevice device,
Jesse Hall0e74f002015-11-30 11:37:59 -08004820 VkSwapchainKHR swapchain,
4821 const VkAllocationCallbacks* pAllocator) {
Michael Lentine88594d72015-11-12 12:49:45 -08004822 deviceObject := GetDevice(device)
4823 swapchainObject := GetSwapchain(swapchain)
4824 assert(swapchainObject.device == device)
4825
4826 State.Swapchains[swapchain] = null
Michael Lentine88594d72015-11-12 12:49:45 -08004827}
4828
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004829@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08004830cmd VkResult vkGetSwapchainImagesKHR(
4831 VkDevice device,
4832 VkSwapchainKHR swapchain,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004833 u32* pSwapchainImageCount,
Michael Lentine88594d72015-11-12 12:49:45 -08004834 VkImage* pSwapchainImages) {
4835 deviceObject := GetDevice(device)
4836
4837 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08004838 pSwapchainImageCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08004839 swapchainImages := pSwapchainImages[0:count]
4840
4841 for i in (0 .. count) {
4842 swapchainImage := ?
4843 swapchainImages[i] = swapchainImage
Jesse Hall1356b0d2015-11-23 17:24:58 -08004844 State.Images[swapchainImage] = new!ImageObject(device: device)
Michael Lentine88594d72015-11-12 12:49:45 -08004845 }
4846
4847 return ?
4848}
4849
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004850@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08004851cmd VkResult vkAcquireNextImageKHR(
4852 VkDevice device,
4853 VkSwapchainKHR swapchain,
4854 u64 timeout,
4855 VkSemaphore semaphore,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004856 VkFence fence,
Michael Lentine88594d72015-11-12 12:49:45 -08004857 u32* pImageIndex) {
4858 deviceObject := GetDevice(device)
4859 swapchainObject := GetSwapchain(swapchain)
4860
4861 imageIndex := ?
4862 pImageIndex[0] = imageIndex
4863
4864 return ?
4865}
4866
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004867@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08004868cmd VkResult vkQueuePresentKHR(
4869 VkQueue queue,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08004870 const VkPresentInfoKHR* pPresentInfo) {
Michael Lentine88594d72015-11-12 12:49:45 -08004871 queueObject := GetQueue(queue)
4872
4873 presentInfo := ?
4874 pPresentInfo[0] = presentInfo
4875
4876 return ?
4877}
4878
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004879@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08004880cmd VkResult vkGetPhysicalDeviceDisplayPropertiesKHR(
4881 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004882 u32* pPropertyCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004883 VkDisplayPropertiesKHR* pProperties) {
4884 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
4885 return ?
4886}
4887
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004888@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08004889cmd VkResult vkGetPhysicalDeviceDisplayPlanePropertiesKHR(
4890 VkPhysicalDevice physicalDevice,
4891 u32* pPropertyCount,
4892 VkDisplayPlanePropertiesKHR* pProperties) {
4893 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
4894 return ?
4895}
4896
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004897@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08004898cmd VkResult vkGetDisplayPlaneSupportedDisplaysKHR(
4899 VkPhysicalDevice physicalDevice,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08004900 u32* pDisplayCount,
4901 VkDisplayKHR* pDisplays) {
Jesse Halla6429252015-11-29 18:59:42 -08004902 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
4903 return ?
4904}
4905
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004906@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08004907cmd VkResult vkGetDisplayModePropertiesKHR(
4908 VkPhysicalDevice physicalDevice,
4909 VkDisplayKHR display,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004910 u32* pPropertyCount,
4911 VkDisplayModePropertiesKHR* pProperties) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08004912 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
4913 return ?
4914}
4915
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004916@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08004917cmd VkResult vkCreateDisplayModeKHR(
4918 VkPhysicalDevice physicalDevice,
4919 VkDisplayKHR display,
4920 const VkDisplayModeCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08004921 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004922 VkDisplayModeKHR* pMode) {
4923 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
4924 return ?
4925}
4926
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004927@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08004928cmd VkResult vkGetDisplayPlaneCapabilitiesKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08004929 VkPhysicalDevice physicalDevice,
Jesse Hall9ba8bc82015-11-30 16:22:16 -08004930 VkDisplayModeKHR mode,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004931 u32 planeIndex,
Jesse Halla6429252015-11-29 18:59:42 -08004932 VkDisplayPlaneCapabilitiesKHR* pCapabilities) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08004933 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
4934 return ?
4935}
4936
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004937@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08004938cmd VkResult vkCreateDisplayPlaneSurfaceKHR(
4939 VkInstance instance,
4940 const VkDisplaySurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08004941 const VkAllocationCallbacks* pAllocator,
Jesse Halla6429252015-11-29 18:59:42 -08004942 VkSurfaceKHR* pSurface) {
4943 return ?
4944}
4945
Jesse Hall9ba8bc82015-11-30 16:22:16 -08004946@extension("VK_KHR_display_swapchain")
4947cmd VkResult vkCreateSharedSwapchainsKHR(
4948 VkDevice device,
4949 u32 swapchainCount,
4950 const VkSwapchainCreateInfoKHR* pCreateInfos,
4951 const VkAllocationCallbacks* pAllocator,
4952 VkSwapchainKHR* pSwapchains) {
4953 return ?
4954}
4955
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004956@extension("VK_KHR_xlib_surface")
Jesse Halla6429252015-11-29 18:59:42 -08004957cmd VkResult vkCreateXlibSurfaceKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08004958 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004959 const VkXlibSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08004960 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004961 VkSurfaceKHR* pSurface) {
4962 instanceObject := GetInstance(instance)
4963 return ?
4964}
4965
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004966@extension("VK_KHR_xlib_surface")
Jesse Halla6429252015-11-29 18:59:42 -08004967cmd VkBool32 vkGetPhysicalDeviceXlibPresentationSupportKHR(
4968 VkPhysicalDevice physicalDevice,
4969 u32 queueFamilyIndex,
4970 platform.Display* dpy,
Jesse Hall65ab5522015-11-30 00:07:16 -08004971 platform.VisualID visualID) {
Jesse Halla6429252015-11-29 18:59:42 -08004972 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
4973 return ?
4974}
4975
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004976@extension("VK_KHR_xcb_surface")
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004977cmd VkResult vkCreateXcbSurfaceKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08004978 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004979 const VkXcbSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08004980 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004981 VkSurfaceKHR* pSurface) {
4982 instanceObject := GetInstance(instance)
4983 return ?
4984}
4985
Jesse Hall523db342015-11-30 21:12:55 -08004986@extension("VK_KHR_xcb_surface")
Jesse Halla6429252015-11-29 18:59:42 -08004987cmd VkBool32 vkGetPhysicalDeviceXcbPresentationSupportKHR(
4988 VkPhysicalDevice physicalDevice,
4989 u32 queueFamilyIndex,
4990 platform.xcb_connection_t* connection,
4991 platform.xcb_visualid_t visual_id) {
4992 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
4993 return ?
4994}
4995
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004996@extension("VK_KHR_wayland_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08004997cmd VkResult vkCreateWaylandSurfaceKHR(
4998 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004999 const VkWaylandSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005000 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005001 VkSurfaceKHR* pSurface) {
5002 instanceObject := GetInstance(instance)
5003 return ?
5004}
5005
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005006@extension("VK_KHR_wayland_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005007cmd VkBool32 vkGetPhysicalDeviceWaylandPresentationSupportKHR(
5008 VkPhysicalDevice physicalDevice,
5009 u32 queueFamilyIndex,
5010 platform.wl_display* display) {
5011 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5012 return ?
5013}
5014
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005015@extension("VK_KHR_mir_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005016cmd VkResult vkCreateMirSurfaceKHR(
5017 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005018 const VkMirSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005019 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005020 VkSurfaceKHR* pSurface) {
5021 instanceObject := GetInstance(instance)
5022 return ?
5023}
5024
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005025@extension("VK_KHR_mir_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005026cmd VkBool32 vkGetPhysicalDeviceMirPresentationSupportKHR(
5027 VkPhysicalDevice physicalDevice,
5028 u32 queueFamilyIndex,
5029 platform.MirConnection* connection) {
5030 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5031 return ?
5032}
5033
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005034@extension("VK_KHR_android_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005035cmd VkResult vkCreateAndroidSurfaceKHR(
5036 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005037 const VkAndroidSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005038 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005039 VkSurfaceKHR* pSurface) {
5040 instanceObject := GetInstance(instance)
5041 return ?
5042}
5043
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005044@extension("VK_KHR_win32_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005045cmd VkResult vkCreateWin32SurfaceKHR(
5046 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005047 const VkWin32SurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005048 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005049 VkSurfaceKHR* pSurface) {
5050 instanceObject := GetInstance(instance)
5051 return ?
5052}
5053
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005054@extension("VK_KHR_win32_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005055cmd VkResult vkGetPhysicalDeviceWin32PresentationSupportKHR(
5056 VkPhysicalDevice physicalDevice,
5057 u32 queueFamilyIndex) {
5058 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5059 return ?
5060}
5061
Jesse Halld27f6aa2015-08-15 17:58:48 -07005062
5063////////////////
5064// Validation //
5065////////////////
5066
5067extern void validate(string layerName, bool condition, string message)
5068
5069
5070/////////////////////////////
5071// Internal State Tracking //
5072/////////////////////////////
5073
5074StateObject State
5075
5076@internal class StateObject {
5077 // Dispatchable objects.
5078 map!(VkInstance, ref!InstanceObject) Instances
5079 map!(VkPhysicalDevice, ref!PhysicalDeviceObject) PhysicalDevices
5080 map!(VkDevice, ref!DeviceObject) Devices
5081 map!(VkQueue, ref!QueueObject) Queues
Jesse Hall3fbc8562015-11-29 22:10:52 -08005082 map!(VkCommandBuffer, ref!CommandBufferObject) CommandBuffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07005083
5084 // Non-dispatchable objects.
5085 map!(VkDeviceMemory, ref!DeviceMemoryObject) DeviceMemories
5086 map!(VkBuffer, ref!BufferObject) Buffers
5087 map!(VkBufferView, ref!BufferViewObject) BufferViews
5088 map!(VkImage, ref!ImageObject) Images
5089 map!(VkImageView, ref!ImageViewObject) ImageViews
Jesse Halld27f6aa2015-08-15 17:58:48 -07005090 map!(VkShaderModule, ref!ShaderModuleObject) ShaderModules
Jesse Halld27f6aa2015-08-15 17:58:48 -07005091 map!(VkPipeline, ref!PipelineObject) Pipelines
5092 map!(VkPipelineLayout, ref!PipelineLayoutObject) PipelineLayouts
5093 map!(VkSampler, ref!SamplerObject) Samplers
5094 map!(VkDescriptorSet, ref!DescriptorSetObject) DescriptorSets
5095 map!(VkDescriptorSetLayout, ref!DescriptorSetLayoutObject) DescriptorSetLayouts
5096 map!(VkDescriptorPool, ref!DescriptorPoolObject) DescriptorPools
Jesse Halld27f6aa2015-08-15 17:58:48 -07005097 map!(VkFence, ref!FenceObject) Fences
5098 map!(VkSemaphore, ref!SemaphoreObject) Semaphores
5099 map!(VkEvent, ref!EventObject) Events
5100 map!(VkQueryPool, ref!QueryPoolObject) QueryPools
5101 map!(VkFramebuffer, ref!FramebufferObject) Framebuffers
5102 map!(VkRenderPass, ref!RenderPassObject) RenderPasses
5103 map!(VkPipelineCache, ref!PipelineCacheObject) PipelineCaches
Jesse Hall3fbc8562015-11-29 22:10:52 -08005104 map!(VkCommandPool, ref!CommandPoolObject) CommandPools
Jesse Hall1356b0d2015-11-23 17:24:58 -08005105 map!(VkSurfaceKHR, ref!SurfaceObject) Surfaces
Michael Lentine88594d72015-11-12 12:49:45 -08005106 map!(VkSwapchainKHR, ref!SwapchainObject) Swapchains
Jesse Halld27f6aa2015-08-15 17:58:48 -07005107}
5108
5109@internal class InstanceObject {
5110}
5111
5112@internal class PhysicalDeviceObject {
5113 VkInstance instance
5114}
5115
5116@internal class DeviceObject {
5117 VkPhysicalDevice physicalDevice
5118}
5119
5120@internal class QueueObject {
5121 VkDevice device
5122 VkQueueFlags flags
5123}
5124
Jesse Hall3fbc8562015-11-29 22:10:52 -08005125@internal class CommandBufferObject {
Jesse Halld27f6aa2015-08-15 17:58:48 -07005126 VkDevice device
5127 map!(u64, VkDeviceMemory) boundObjects
5128 VkQueueFlags queueFlags
5129}
5130
5131@internal class DeviceMemoryObject {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005132 VkDevice device
5133 VkDeviceSize allocationSize
5134 map!(u64, VkDeviceSize) boundObjects
5135 map!(VkCommandBuffer, VkCommandBuffer) boundCommandBuffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07005136}
5137
5138@internal class BufferObject {
5139 VkDevice device
Jesse Hall3fbc8562015-11-29 22:10:52 -08005140 VkDeviceMemory memory
5141 VkDeviceSize memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07005142}
5143
5144@internal class BufferViewObject {
5145 VkDevice device
5146 VkBuffer buffer
5147}
5148
5149@internal class ImageObject {
5150 VkDevice device
Jesse Hall3fbc8562015-11-29 22:10:52 -08005151 VkDeviceMemory memory
5152 VkDeviceSize memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07005153}
5154
5155@internal class ImageViewObject {
5156 VkDevice device
5157 VkImage image
5158}
5159
Jesse Halld27f6aa2015-08-15 17:58:48 -07005160@internal class ShaderObject {
5161 VkDevice device
5162}
5163
5164@internal class ShaderModuleObject {
5165 VkDevice device
5166}
5167
5168@internal class PipelineObject {
5169 VkDevice device
5170}
5171
5172@internal class PipelineLayoutObject {
5173 VkDevice device
5174}
5175
5176@internal class SamplerObject {
5177 VkDevice device
5178}
5179
5180@internal class DescriptorSetObject {
5181 VkDevice device
5182}
5183
5184@internal class DescriptorSetLayoutObject {
5185 VkDevice device
5186}
5187
5188@internal class DescriptorPoolObject {
5189 VkDevice device
5190}
5191
Jesse Halld27f6aa2015-08-15 17:58:48 -07005192@internal class FenceObject {
5193 VkDevice device
5194 bool signaled
5195}
5196
5197@internal class SemaphoreObject {
5198 VkDevice device
5199}
5200
5201@internal class EventObject {
5202 VkDevice device
5203}
5204
5205@internal class QueryPoolObject {
5206 VkDevice device
5207}
5208
5209@internal class FramebufferObject {
5210 VkDevice device
5211}
5212
5213@internal class RenderPassObject {
5214 VkDevice device
5215}
5216
5217@internal class PipelineCacheObject {
5218 VkDevice device
5219}
5220
Jesse Hall3fbc8562015-11-29 22:10:52 -08005221@internal class CommandPoolObject {
Jesse Halld27f6aa2015-08-15 17:58:48 -07005222 VkDevice device
5223}
5224
Jesse Hall1356b0d2015-11-23 17:24:58 -08005225@internal class SurfaceObject {
5226 VkInstance instance
5227}
5228
Michael Lentine88594d72015-11-12 12:49:45 -08005229@internal class SwapchainObject {
5230 VkDevice device
5231}
5232
Jesse Halld27f6aa2015-08-15 17:58:48 -07005233macro ref!InstanceObject GetInstance(VkInstance instance) {
5234 assert(instance in State.Instances)
5235 return State.Instances[instance]
5236}
5237
5238macro ref!PhysicalDeviceObject GetPhysicalDevice(VkPhysicalDevice physicalDevice) {
5239 assert(physicalDevice in State.PhysicalDevices)
5240 return State.PhysicalDevices[physicalDevice]
5241}
5242
5243macro ref!DeviceObject GetDevice(VkDevice device) {
5244 assert(device in State.Devices)
5245 return State.Devices[device]
5246}
5247
5248macro ref!QueueObject GetQueue(VkQueue queue) {
5249 assert(queue in State.Queues)
5250 return State.Queues[queue]
5251}
5252
Jesse Hall3fbc8562015-11-29 22:10:52 -08005253macro ref!CommandBufferObject GetCommandBuffer(VkCommandBuffer commandBuffer) {
5254 assert(commandBuffer in State.CommandBuffers)
5255 return State.CommandBuffers[commandBuffer]
Jesse Halld27f6aa2015-08-15 17:58:48 -07005256}
5257
Jesse Hall3fbc8562015-11-29 22:10:52 -08005258macro ref!DeviceMemoryObject GetDeviceMemory(VkDeviceMemory memory) {
5259 assert(memory in State.DeviceMemories)
5260 return State.DeviceMemories[memory]
Jesse Halld27f6aa2015-08-15 17:58:48 -07005261}
5262
5263macro ref!BufferObject GetBuffer(VkBuffer buffer) {
5264 assert(buffer in State.Buffers)
5265 return State.Buffers[buffer]
5266}
5267
5268macro ref!BufferViewObject GetBufferView(VkBufferView bufferView) {
5269 assert(bufferView in State.BufferViews)
5270 return State.BufferViews[bufferView]
5271}
5272
5273macro ref!ImageObject GetImage(VkImage image) {
5274 assert(image in State.Images)
5275 return State.Images[image]
5276}
5277
5278macro ref!ImageViewObject GetImageView(VkImageView imageView) {
5279 assert(imageView in State.ImageViews)
5280 return State.ImageViews[imageView]
5281}
5282
Jesse Halld27f6aa2015-08-15 17:58:48 -07005283macro ref!ShaderModuleObject GetShaderModule(VkShaderModule shaderModule) {
5284 assert(shaderModule in State.ShaderModules)
5285 return State.ShaderModules[shaderModule]
5286}
5287
5288macro ref!PipelineObject GetPipeline(VkPipeline pipeline) {
5289 assert(pipeline in State.Pipelines)
5290 return State.Pipelines[pipeline]
5291}
5292
5293macro ref!PipelineLayoutObject GetPipelineLayout(VkPipelineLayout pipelineLayout) {
5294 assert(pipelineLayout in State.PipelineLayouts)
5295 return State.PipelineLayouts[pipelineLayout]
5296}
5297
5298macro ref!SamplerObject GetSampler(VkSampler sampler) {
5299 assert(sampler in State.Samplers)
5300 return State.Samplers[sampler]
5301}
5302
5303macro ref!DescriptorSetObject GetDescriptorSet(VkDescriptorSet descriptorSet) {
5304 assert(descriptorSet in State.DescriptorSets)
5305 return State.DescriptorSets[descriptorSet]
5306}
5307
5308macro ref!DescriptorSetLayoutObject GetDescriptorSetLayout(VkDescriptorSetLayout descriptorSetLayout) {
5309 assert(descriptorSetLayout in State.DescriptorSetLayouts)
5310 return State.DescriptorSetLayouts[descriptorSetLayout]
5311}
5312
5313macro ref!DescriptorPoolObject GetDescriptorPool(VkDescriptorPool descriptorPool) {
5314 assert(descriptorPool in State.DescriptorPools)
5315 return State.DescriptorPools[descriptorPool]
5316}
5317
Jesse Halld27f6aa2015-08-15 17:58:48 -07005318macro ref!FenceObject GetFence(VkFence fence) {
5319 assert(fence in State.Fences)
5320 return State.Fences[fence]
5321}
5322
5323macro ref!SemaphoreObject GetSemaphore(VkSemaphore semaphore) {
5324 assert(semaphore in State.Semaphores)
5325 return State.Semaphores[semaphore]
5326}
5327
5328macro ref!EventObject GetEvent(VkEvent event) {
5329 assert(event in State.Events)
5330 return State.Events[event]
5331}
5332
5333macro ref!QueryPoolObject GetQueryPool(VkQueryPool queryPool) {
5334 assert(queryPool in State.QueryPools)
5335 return State.QueryPools[queryPool]
5336}
5337
5338macro ref!FramebufferObject GetFramebuffer(VkFramebuffer framebuffer) {
5339 assert(framebuffer in State.Framebuffers)
5340 return State.Framebuffers[framebuffer]
5341}
5342
5343macro ref!RenderPassObject GetRenderPass(VkRenderPass renderPass) {
5344 assert(renderPass in State.RenderPasses)
5345 return State.RenderPasses[renderPass]
5346}
5347
5348macro ref!PipelineCacheObject GetPipelineCache(VkPipelineCache pipelineCache) {
5349 assert(pipelineCache in State.PipelineCaches)
5350 return State.PipelineCaches[pipelineCache]
5351}
5352
Jesse Hall3fbc8562015-11-29 22:10:52 -08005353macro ref!CommandPoolObject GetCommandPool(VkCommandPool commandPool) {
5354 assert(commandPool in State.CommandPools)
5355 return State.CommandPools[commandPool]
Jesse Hallf09c6b12015-08-15 19:54:28 -07005356}
Michael Lentine88594d72015-11-12 12:49:45 -08005357
Jesse Hall1356b0d2015-11-23 17:24:58 -08005358macro ref!SurfaceObject GetSurface(VkSurfaceKHR surface) {
5359 assert(surface in State.Surfaces)
5360 return State.Surfaces[surface]
5361}
5362
Michael Lentine88594d72015-11-12 12:49:45 -08005363macro ref!SwapchainObject GetSwapchain(VkSwapchainKHR swapchain) {
5364 assert(swapchain in State.Swapchains)
5365 return State.Swapchains[swapchain]
5366}
Jesse Halld8bade02015-11-24 10:24:18 -08005367
5368macro VkQueueFlags AddQueueFlag(VkQueueFlags flags, VkQueueFlagBits bit) {
5369 return as!VkQueueFlags(as!u32(flags) | as!u32(bit))
5370}