blob: b3410767158ee7818787953f996ca8df16a6d13b [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 Hallf9fa9a52016-01-08 16:08:51 -080030define VERSION_MINOR 213
31define 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 Hallf4ab2b12015-11-30 16:04:55 -080048@extension("VK_KHR_surface") define VK_KHR_SURFACE_REVISION 24
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080049@extension("VK_KHR_surface") define VK_KHR_SURFACE_EXTENSION_NUMBER 1
50@extension("VK_KHR_surface") define VK_KHR_SURFACE_EXTENSION_NAME "VK_KHR_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080051
Jesse Hallf4ab2b12015-11-30 16:04:55 -080052@extension("VK_KHR_swapchain") define VK_KHR_SWAPCHAIN_REVISION 67
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080053@extension("VK_KHR_swapchain") define VK_KHR_SWAPCHAIN_EXTENSION_NUMBER 2
54@extension("VK_KHR_swapchain") define VK_KHR_SWAPCHAIN_EXTENSION_NAME "VK_KHR_swapchain"
Jesse Hall1356b0d2015-11-23 17:24:58 -080055
Jesse Hallf4ab2b12015-11-30 16:04:55 -080056@extension("VK_KHR_display") define VK_KHR_DISPLAY_REVISION 21
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080057@extension("VK_KHR_display") define VK_KHR_DISPLAY_EXTENSION_NUMBER 3
58@extension("VK_KHR_display") define VK_KHR_DISPLAY_EXTENSION_NAME "VK_KHR_display"
Jesse Hall1356b0d2015-11-23 17:24:58 -080059
Jesse Hall9ba8bc82015-11-30 16:22:16 -080060@extension("VK_KHR_display_swapchain") define VK_KHR_DISPLAY_SWAPCHAIN_REVISION 9
Jesse Hall0e74f002015-11-30 11:37:59 -080061@extension("VK_KHR_display_swapchain") define VK_KHR_DISPLAY_SWAPCHAIN_EXTENSION_NUMBER 4
62@extension("VK_KHR_display_swapchain") define VK_KHR_DISPLAY_SWAPCHAIN_EXTENSION_NAME "VK_KHR_display_swapchain"
Jesse Hall1356b0d2015-11-23 17:24:58 -080063
Jesse Hallf9fa9a52016-01-08 16:08:51 -080064@extension("VK_KHR_xlib_surface") define VK_KHR_XLIB_SURFACE_REVISION 6
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080065@extension("VK_KHR_xlib_surface") define VK_KHR_XLIB_SURFACE_NUMBER 5
66@extension("VK_KHR_xlib_surface") define VK_KHR_XLIB_SURFACE_NAME "VK_KHR_xlib_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080067
Jesse Hallf9fa9a52016-01-08 16:08:51 -080068@extension("VK_KHR_xcb_surface") define VK_KHR_XCB_SURFACE_REVISION 6
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080069@extension("VK_KHR_xcb_surface") define VK_KHR_XCB_SURFACE_NUMBER 6
70@extension("VK_KHR_xcb_surface") define VK_KHR_XCB_SURFACE_NAME "VK_KHR_xcb_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080071
Jesse Hallf9fa9a52016-01-08 16:08:51 -080072@extension("VK_KHR_wayland_surface") define VK_KHR_WAYLAND_SURFACE_REVISION 5
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080073@extension("VK_KHR_wayland_surface") define VK_KHR_WAYLAND_SURFACE_NUMBER 7
74@extension("VK_KHR_wayland_surface") define VK_KHR_WAYLAND_SURFACE_NAME "VK_KHR_wayland_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080075
Jesse Hall0e74f002015-11-30 11:37:59 -080076@extension("VK_KHR_mir_surface") define VK_KHR_MIR_SURFACE_REVISION 4
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080077@extension("VK_KHR_mir_surface") define VK_KHR_MIR_SURFACE_NUMBER 8
78@extension("VK_KHR_mir_surface") define VK_KHR_MIR_SURFACE_NAME "VK_KHR_mir_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080079
Jesse Hallf9fa9a52016-01-08 16:08:51 -080080@extension("VK_KHR_android_surface") define VK_KHR_ANDROID_SURFACE_REVISION 5
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080081@extension("VK_KHR_android_surface") define VK_KHR_ANDROID_SURFACE_NUMBER 8
82@extension("VK_KHR_android_surface") define VK_KHR_ANDROID_SURFACE_NAME "VK_KHR_android_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080083
Jesse Hallf9fa9a52016-01-08 16:08:51 -080084@extension("VK_KHR_win32_surface") define VK_KHR_WIN32_SURFACE_REVISION 5
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080085@extension("VK_KHR_win32_surface") define VK_KHR_WIN32_SURFACE_NUMBER 9
86@extension("VK_KHR_win32_surface") define VK_KHR_WIN32_SURFACE_NAME "VK_KHR_win32_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080087
Jesse Halld27f6aa2015-08-15 17:58:48 -070088
89/////////////
90// Types //
91/////////////
92
Jesse Hall5ae3abb2015-10-08 14:00:22 -070093type u32 VkBool32
94type u32 VkFlags
95type u64 VkDeviceSize
96type u32 VkSampleMask
97
Jesse Halld27f6aa2015-08-15 17:58:48 -070098/// Dispatchable handle types.
99@dispatchHandle type u64 VkInstance
100@dispatchHandle type u64 VkPhysicalDevice
101@dispatchHandle type u64 VkDevice
102@dispatchHandle type u64 VkQueue
Jesse Hall3fbc8562015-11-29 22:10:52 -0800103@dispatchHandle type u64 VkCommandBuffer
Jesse Halld27f6aa2015-08-15 17:58:48 -0700104
105/// Non dispatchable handle types.
106@nonDispatchHandle type u64 VkDeviceMemory
Jesse Hall3fbc8562015-11-29 22:10:52 -0800107@nonDispatchHandle type u64 VkCommandPool
Jesse Halld27f6aa2015-08-15 17:58:48 -0700108@nonDispatchHandle type u64 VkBuffer
109@nonDispatchHandle type u64 VkBufferView
110@nonDispatchHandle type u64 VkImage
111@nonDispatchHandle type u64 VkImageView
Jesse Halld27f6aa2015-08-15 17:58:48 -0700112@nonDispatchHandle type u64 VkShaderModule
Jesse Halld27f6aa2015-08-15 17:58:48 -0700113@nonDispatchHandle type u64 VkPipeline
114@nonDispatchHandle type u64 VkPipelineLayout
115@nonDispatchHandle type u64 VkSampler
116@nonDispatchHandle type u64 VkDescriptorSet
117@nonDispatchHandle type u64 VkDescriptorSetLayout
118@nonDispatchHandle type u64 VkDescriptorPool
Jesse Halld27f6aa2015-08-15 17:58:48 -0700119@nonDispatchHandle type u64 VkFence
120@nonDispatchHandle type u64 VkSemaphore
121@nonDispatchHandle type u64 VkEvent
122@nonDispatchHandle type u64 VkQueryPool
123@nonDispatchHandle type u64 VkFramebuffer
124@nonDispatchHandle type u64 VkRenderPass
125@nonDispatchHandle type u64 VkPipelineCache
Jesse Hall1356b0d2015-11-23 17:24:58 -0800126
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800127@extension("VK_KHR_surface") @nonDispatchHandle type u64 VkSurfaceKHR
Jesse Hall1356b0d2015-11-23 17:24:58 -0800128
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800129@extension("VK_KHR_swapchain") @nonDispatchHandle type u64 VkSwapchainKHR
Jesse Hall1356b0d2015-11-23 17:24:58 -0800130
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800131@extension("VK_KHR_display") @nonDispatchHandle type u64 VkDisplayKHR
132@extension("VK_KHR_display") @nonDispatchHandle type u64 VkDisplayModeKHR
Jesse Halld27f6aa2015-08-15 17:58:48 -0700133
134
135/////////////
136// Enums //
137/////////////
138
139enum VkImageLayout {
140 VK_IMAGE_LAYOUT_UNDEFINED = 0x00000000, /// Implicit layout an image is when its contents are undefined due to various reasons (e.g. right after creation)
141 VK_IMAGE_LAYOUT_GENERAL = 0x00000001, /// General layout when image can be used for any kind of access
142 VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL = 0x00000002, /// Optimal layout when image is only used for color attachment read/write
143 VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL = 0x00000003, /// Optimal layout when image is only used for depth/stencil attachment read/write
144 VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL = 0x00000004, /// Optimal layout when image is used for read only depth/stencil attachment and shader access
145 VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL = 0x00000005, /// Optimal layout when image is used for read only shader access
Jesse Hall3fbc8562015-11-29 22:10:52 -0800146 VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL = 0x00000006, /// Optimal layout when image is used only as source of transfer operations
147 VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL = 0x00000007, /// Optimal layout when image is used only as destination of transfer operations
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700148 VK_IMAGE_LAYOUT_PREINITIALIZED = 0x00000008, /// Initial layout used when the data is populated by the CPU
Jesse Hall1356b0d2015-11-23 17:24:58 -0800149
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800150 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800151 VK_IMAGE_LAYOUT_PRESENT_SRC_KHR = 1000001002,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700152}
153
154enum VkAttachmentLoadOp {
155 VK_ATTACHMENT_LOAD_OP_LOAD = 0x00000000,
156 VK_ATTACHMENT_LOAD_OP_CLEAR = 0x00000001,
157 VK_ATTACHMENT_LOAD_OP_DONT_CARE = 0x00000002,
158}
159
160enum VkAttachmentStoreOp {
161 VK_ATTACHMENT_STORE_OP_STORE = 0x00000000,
162 VK_ATTACHMENT_STORE_OP_DONT_CARE = 0x00000001,
163}
164
165enum VkImageType {
166 VK_IMAGE_TYPE_1D = 0x00000000,
167 VK_IMAGE_TYPE_2D = 0x00000001,
168 VK_IMAGE_TYPE_3D = 0x00000002,
169}
170
171enum VkImageTiling {
Jesse Hallc7467b72015-11-29 21:05:26 -0800172 VK_IMAGE_TILING_OPTIMAL = 0x00000000,
173 VK_IMAGE_TILING_LINEAR = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700174}
175
176enum VkImageViewType {
177 VK_IMAGE_VIEW_TYPE_1D = 0x00000000,
178 VK_IMAGE_VIEW_TYPE_2D = 0x00000001,
179 VK_IMAGE_VIEW_TYPE_3D = 0x00000002,
180 VK_IMAGE_VIEW_TYPE_CUBE = 0x00000003,
181 VK_IMAGE_VIEW_TYPE_1D_ARRAY = 0x00000004,
182 VK_IMAGE_VIEW_TYPE_2D_ARRAY = 0x00000005,
183 VK_IMAGE_VIEW_TYPE_CUBE_ARRAY = 0x00000006,
184}
185
Jesse Hall3fbc8562015-11-29 22:10:52 -0800186enum VkCommandBufferLevel {
187 VK_COMMAND_BUFFER_LEVEL_PRIMARY = 0x00000000,
188 VK_COMMAND_BUFFER_LEVEL_SECONDARY = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700189}
190
Jesse Hall65ab5522015-11-30 00:07:16 -0800191enum VkComponentSwizzle {
192 VK_COMPONENT_SWIZZLE_IDENTITY = 0x00000000,
193 VK_COMPONENT_SWIZZLE_ZERO = 0x00000001,
194 VK_COMPONENT_SWIZZLE_ONE = 0x00000002,
195 VK_COMPONENT_SWIZZLE_R = 0x00000003,
196 VK_COMPONENT_SWIZZLE_G = 0x00000004,
197 VK_COMPONENT_SWIZZLE_B = 0x00000005,
198 VK_COMPONENT_SWIZZLE_A = 0x00000006,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700199}
200
201enum VkDescriptorType {
202 VK_DESCRIPTOR_TYPE_SAMPLER = 0x00000000,
203 VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER = 0x00000001,
204 VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE = 0x00000002,
205 VK_DESCRIPTOR_TYPE_STORAGE_IMAGE = 0x00000003,
206 VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER = 0x00000004,
207 VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER = 0x00000005,
208 VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER = 0x00000006,
209 VK_DESCRIPTOR_TYPE_STORAGE_BUFFER = 0x00000007,
210 VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC = 0x00000008,
211 VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC = 0x00000009,
212 VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT = 0x0000000a,
213}
214
Jesse Halld27f6aa2015-08-15 17:58:48 -0700215enum VkQueryType {
216 VK_QUERY_TYPE_OCCLUSION = 0x00000000,
217 VK_QUERY_TYPE_PIPELINE_STATISTICS = 0x00000001, /// Optional
Jesse Halla3a7a1d2015-11-24 11:37:23 -0800218 VK_QUERY_TYPE_TIMESTAMP = 0x00000002,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700219}
220
Jesse Halld27f6aa2015-08-15 17:58:48 -0700221enum VkBorderColor {
222 VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK = 0x00000000,
223 VK_BORDER_COLOR_INT_TRANSPARENT_BLACK = 0x00000001,
224 VK_BORDER_COLOR_FLOAT_OPAQUE_BLACK = 0x00000002,
225 VK_BORDER_COLOR_INT_OPAQUE_BLACK = 0x00000003,
226 VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE = 0x00000004,
227 VK_BORDER_COLOR_INT_OPAQUE_WHITE = 0x00000005,
228}
229
230enum VkPipelineBindPoint {
Jesse Hallc7467b72015-11-29 21:05:26 -0800231 VK_PIPELINE_BIND_POINT_GRAPHICS = 0x00000000,
232 VK_PIPELINE_BIND_POINT_COMPUTE = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700233}
234
235enum VkPrimitiveTopology {
236 VK_PRIMITIVE_TOPOLOGY_POINT_LIST = 0x00000000,
237 VK_PRIMITIVE_TOPOLOGY_LINE_LIST = 0x00000001,
238 VK_PRIMITIVE_TOPOLOGY_LINE_STRIP = 0x00000002,
239 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST = 0x00000003,
240 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP = 0x00000004,
241 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN = 0x00000005,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800242 VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY = 0x00000006,
243 VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY = 0x00000007,
244 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY = 0x00000008,
245 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY = 0x00000009,
Jesse Hall091ed9e2015-11-30 00:55:29 -0800246 VK_PRIMITIVE_TOPOLOGY_PATCH_LIST = 0x0000000a,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700247}
248
249enum VkSharingMode {
250 VK_SHARING_MODE_EXCLUSIVE = 0x00000000,
251 VK_SHARING_MODE_CONCURRENT = 0x00000001,
252}
253
254enum VkIndexType {
255 VK_INDEX_TYPE_UINT16 = 0x00000000,
256 VK_INDEX_TYPE_UINT32 = 0x00000001,
257}
258
Jesse Hall23ff73f2015-11-29 14:36:39 -0800259enum VkFilter {
260 VK_FILTER_NEAREST = 0x00000000,
261 VK_FILTER_LINEAR = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700262}
263
Jesse Hall23ff73f2015-11-29 14:36:39 -0800264enum VkSamplerMipmapMode {
265 VK_SAMPLER_MIPMAP_MODE_BASE = 0x00000000, /// Always choose base level
266 VK_SAMPLER_MIPMAP_MODE_NEAREST = 0x00000001, /// Choose nearest mip level
267 VK_SAMPLER_MIPMAP_MODE_LINEAR = 0x00000002, /// Linear filter between mip levels
Jesse Halld27f6aa2015-08-15 17:58:48 -0700268}
269
Jesse Hall23ff73f2015-11-29 14:36:39 -0800270enum VkSamplerAddressMode {
Jesse Hallc7467b72015-11-29 21:05:26 -0800271 VK_SAMPLER_ADDRESS_MODE_REPEAT = 0x00000000,
272 VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT = 0x00000001,
273 VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE = 0x00000002,
274 VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER = 0x00000003,
275 VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700276}
277
278enum VkCompareOp {
279 VK_COMPARE_OP_NEVER = 0x00000000,
280 VK_COMPARE_OP_LESS = 0x00000001,
281 VK_COMPARE_OP_EQUAL = 0x00000002,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800282 VK_COMPARE_OP_LESS_OR_EQUAL = 0x00000003,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700283 VK_COMPARE_OP_GREATER = 0x00000004,
284 VK_COMPARE_OP_NOT_EQUAL = 0x00000005,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800285 VK_COMPARE_OP_GREATER_OR_EQUAL = 0x00000006,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700286 VK_COMPARE_OP_ALWAYS = 0x00000007,
287}
288
Jesse Hall65ab5522015-11-30 00:07:16 -0800289enum VkPolygonMode {
290 VK_POLYGON_MODE_FILL = 0x00000000,
291 VK_POLYGON_MODE_LINE = 0x00000001,
292 VK_POLYGON_MODE_POINT = 0x00000002,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700293}
294
295enum VkFrontFace {
Jesse Hall3fbc8562015-11-29 22:10:52 -0800296 VK_FRONT_FACE_COUNTER_CLOCKWISE = 0x00000000,
297 VK_FRONT_FACE_CLOCKWISE = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700298}
299
Jesse Hall65ab5522015-11-30 00:07:16 -0800300enum VkBlendFactor {
301 VK_BLEND_FACTOR_ZERO = 0x00000000,
302 VK_BLEND_FACTOR_ONE = 0x00000001,
303 VK_BLEND_FACTOR_SRC_COLOR = 0x00000002,
304 VK_BLEND_FACTOR_ONE_MINUS_SRC_COLOR = 0x00000003,
305 VK_BLEND_FACTOR_DST_COLOR = 0x00000004,
306 VK_BLEND_FACTOR_ONE_MINUS_DST_COLOR = 0x00000005,
307 VK_BLEND_FACTOR_SRC_ALPHA = 0x00000006,
308 VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA = 0x00000007,
309 VK_BLEND_FACTOR_DST_ALPHA = 0x00000008,
310 VK_BLEND_FACTOR_ONE_MINUS_DST_ALPHA = 0x00000009,
311 VK_BLEND_FACTOR_CONSTANT_COLOR = 0x0000000a,
312 VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR = 0x0000000b,
313 VK_BLEND_FACTOR_CONSTANT_ALPHA = 0x0000000c,
314 VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA = 0x0000000d,
315 VK_BLEND_FACTOR_SRC_ALPHA_SATURATE = 0x0000000e,
316 VK_BLEND_FACTOR_SRC1_COLOR = 0x0000000f,
317 VK_BLEND_FACTOR_ONE_MINUS_SRC1_COLOR = 0x00000010,
318 VK_BLEND_FACTOR_SRC1_ALPHA = 0x00000011,
319 VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA = 0x00000012,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700320}
321
322enum VkBlendOp {
323 VK_BLEND_OP_ADD = 0x00000000,
324 VK_BLEND_OP_SUBTRACT = 0x00000001,
325 VK_BLEND_OP_REVERSE_SUBTRACT = 0x00000002,
326 VK_BLEND_OP_MIN = 0x00000003,
327 VK_BLEND_OP_MAX = 0x00000004,
328}
329
330enum VkStencilOp {
331 VK_STENCIL_OP_KEEP = 0x00000000,
332 VK_STENCIL_OP_ZERO = 0x00000001,
333 VK_STENCIL_OP_REPLACE = 0x00000002,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800334 VK_STENCIL_OP_INCREMENT_AND_CLAMP = 0x00000003,
335 VK_STENCIL_OP_DECREMENT_AND_CLAMP = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700336 VK_STENCIL_OP_INVERT = 0x00000005,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800337 VK_STENCIL_OP_INCREMENT_AND_WRAP = 0x00000006,
338 VK_STENCIL_OP_DECREMENT_AND_WRAP = 0x00000007,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700339}
340
341enum VkLogicOp {
342 VK_LOGIC_OP_CLEAR = 0x00000000,
343 VK_LOGIC_OP_AND = 0x00000001,
344 VK_LOGIC_OP_AND_REVERSE = 0x00000002,
345 VK_LOGIC_OP_COPY = 0x00000003,
346 VK_LOGIC_OP_AND_INVERTED = 0x00000004,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800347 VK_LOGIC_OP_NO_OP = 0x00000005,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700348 VK_LOGIC_OP_XOR = 0x00000006,
349 VK_LOGIC_OP_OR = 0x00000007,
350 VK_LOGIC_OP_NOR = 0x00000008,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800351 VK_LOGIC_OP_EQUIVALENT = 0x00000009,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700352 VK_LOGIC_OP_INVERT = 0x0000000a,
353 VK_LOGIC_OP_OR_REVERSE = 0x0000000b,
354 VK_LOGIC_OP_COPY_INVERTED = 0x0000000c,
355 VK_LOGIC_OP_OR_INVERTED = 0x0000000d,
356 VK_LOGIC_OP_NAND = 0x0000000e,
357 VK_LOGIC_OP_SET = 0x0000000f,
358}
359
Jesse Hall3fbc8562015-11-29 22:10:52 -0800360enum VkSystemAllocationScope {
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800361 VK_SYSTEM_ALLOCATION_SCOPE_COMMAND = 0x00000000,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800362 VK_SYSTEM_ALLOCATION_SCOPE_OBJECT = 0x00000001,
363 VK_SYSTEM_ALLOCATION_SCOPE_CACHE = 0x00000002,
364 VK_SYSTEM_ALLOCATION_SCOPE_DEVICE = 0x00000003,
365 VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE = 0x00000004,
Jesse Hall03b6fe12015-11-24 12:44:21 -0800366}
367
Jesse Hall3fbc8562015-11-29 22:10:52 -0800368enum VkInternalAllocationType {
369 VK_INTERNAL_ALLOCATION_TYPE_EXECUTABLE = 0x00000000,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700370}
371
372enum VkPhysicalDeviceType {
373 VK_PHYSICAL_DEVICE_TYPE_OTHER = 0x00000000,
374 VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU = 0x00000001,
375 VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU = 0x00000002,
376 VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU = 0x00000003,
377 VK_PHYSICAL_DEVICE_TYPE_CPU = 0x00000004,
378}
379
Jesse Hall65ab5522015-11-30 00:07:16 -0800380enum VkVertexInputRate {
381 VK_VERTEX_INPUT_RATE_VERTEX = 0x00000000,
382 VK_VERTEX_INPUT_RATE_INSTANCE = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700383}
384
385/// Vulkan format definitions
386enum VkFormat {
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800387 VK_FORMAT_UNDEFINED = 0,
388 VK_FORMAT_R4G4_UNORM_PACK8 = 1,
389 VK_FORMAT_R4G4B4A4_UNORM_PACK16 = 2,
390 VK_FORMAT_B4G4R4A4_UNORM_PACK16 = 3,
391 VK_FORMAT_R5G6B5_UNORM_PACK16 = 4,
392 VK_FORMAT_B5G6R5_UNORM_PACK16 = 5,
393 VK_FORMAT_R5G5B5A1_UNORM_PACK16 = 6,
394 VK_FORMAT_B5G5R5A1_UNORM_PACK16 = 7,
395 VK_FORMAT_A1R5G5B5_UNORM_PACK16 = 8,
396 VK_FORMAT_R8_UNORM = 9,
397 VK_FORMAT_R8_SNORM = 10,
398 VK_FORMAT_R8_USCALED = 11,
399 VK_FORMAT_R8_SSCALED = 12,
400 VK_FORMAT_R8_UINT = 13,
401 VK_FORMAT_R8_SINT = 14,
402 VK_FORMAT_R8_SRGB = 15,
403 VK_FORMAT_R8G8_UNORM = 16,
404 VK_FORMAT_R8G8_SNORM = 17,
405 VK_FORMAT_R8G8_USCALED = 18,
406 VK_FORMAT_R8G8_SSCALED = 19,
407 VK_FORMAT_R8G8_UINT = 20,
408 VK_FORMAT_R8G8_SINT = 21,
409 VK_FORMAT_R8G8_SRGB = 22,
410 VK_FORMAT_R8G8B8_UNORM = 23,
411 VK_FORMAT_R8G8B8_SNORM = 24,
412 VK_FORMAT_R8G8B8_USCALED = 25,
413 VK_FORMAT_R8G8B8_SSCALED = 26,
414 VK_FORMAT_R8G8B8_UINT = 27,
415 VK_FORMAT_R8G8B8_SINT = 28,
416 VK_FORMAT_R8G8B8_SRGB = 29,
417 VK_FORMAT_B8G8R8_UNORM = 30,
418 VK_FORMAT_B8G8R8_SNORM = 31,
419 VK_FORMAT_B8G8R8_USCALED = 32,
420 VK_FORMAT_B8G8R8_SSCALED = 33,
421 VK_FORMAT_B8G8R8_UINT = 34,
422 VK_FORMAT_B8G8R8_SINT = 35,
423 VK_FORMAT_B8G8R8_SRGB = 36,
424 VK_FORMAT_R8G8B8A8_UNORM = 37,
425 VK_FORMAT_R8G8B8A8_SNORM = 38,
426 VK_FORMAT_R8G8B8A8_USCALED = 39,
427 VK_FORMAT_R8G8B8A8_SSCALED = 40,
428 VK_FORMAT_R8G8B8A8_UINT = 41,
429 VK_FORMAT_R8G8B8A8_SINT = 42,
430 VK_FORMAT_R8G8B8A8_SRGB = 43,
431 VK_FORMAT_B8G8R8A8_UNORM = 44,
432 VK_FORMAT_B8G8R8A8_SNORM = 45,
433 VK_FORMAT_B8G8R8A8_USCALED = 46,
434 VK_FORMAT_B8G8R8A8_SSCALED = 47,
435 VK_FORMAT_B8G8R8A8_UINT = 48,
436 VK_FORMAT_B8G8R8A8_SINT = 49,
437 VK_FORMAT_B8G8R8A8_SRGB = 50,
438 VK_FORMAT_A8B8G8R8_UNORM_PACK32 = 51,
439 VK_FORMAT_A8B8G8R8_SNORM_PACK32 = 52,
440 VK_FORMAT_A8B8G8R8_USCALED_PACK32 = 53,
441 VK_FORMAT_A8B8G8R8_SSCALED_PACK32 = 54,
442 VK_FORMAT_A8B8G8R8_UINT_PACK32 = 55,
443 VK_FORMAT_A8B8G8R8_SINT_PACK32 = 56,
444 VK_FORMAT_A8B8G8R8_SRGB_PACK32 = 57,
445 VK_FORMAT_A2R10G10B10_UNORM_PACK32 = 58,
446 VK_FORMAT_A2R10G10B10_SNORM_PACK32 = 59,
447 VK_FORMAT_A2R10G10B10_USCALED_PACK32 = 60,
448 VK_FORMAT_A2R10G10B10_SSCALED_PACK32 = 61,
449 VK_FORMAT_A2R10G10B10_UINT_PACK32 = 62,
450 VK_FORMAT_A2R10G10B10_SINT_PACK32 = 63,
451 VK_FORMAT_A2B10G10R10_UNORM_PACK32 = 64,
452 VK_FORMAT_A2B10G10R10_SNORM_PACK32 = 65,
453 VK_FORMAT_A2B10G10R10_USCALED_PACK32 = 66,
454 VK_FORMAT_A2B10G10R10_SSCALED_PACK32 = 67,
455 VK_FORMAT_A2B10G10R10_UINT_PACK32 = 68,
456 VK_FORMAT_A2B10G10R10_SINT_PACK32 = 69,
457 VK_FORMAT_R16_UNORM = 70,
458 VK_FORMAT_R16_SNORM = 71,
459 VK_FORMAT_R16_USCALED = 72,
460 VK_FORMAT_R16_SSCALED = 73,
461 VK_FORMAT_R16_UINT = 74,
462 VK_FORMAT_R16_SINT = 75,
463 VK_FORMAT_R16_SFLOAT = 76,
464 VK_FORMAT_R16G16_UNORM = 77,
465 VK_FORMAT_R16G16_SNORM = 78,
466 VK_FORMAT_R16G16_USCALED = 79,
467 VK_FORMAT_R16G16_SSCALED = 80,
468 VK_FORMAT_R16G16_UINT = 81,
469 VK_FORMAT_R16G16_SINT = 82,
470 VK_FORMAT_R16G16_SFLOAT = 83,
471 VK_FORMAT_R16G16B16_UNORM = 84,
472 VK_FORMAT_R16G16B16_SNORM = 85,
473 VK_FORMAT_R16G16B16_USCALED = 86,
474 VK_FORMAT_R16G16B16_SSCALED = 87,
475 VK_FORMAT_R16G16B16_UINT = 88,
476 VK_FORMAT_R16G16B16_SINT = 89,
477 VK_FORMAT_R16G16B16_SFLOAT = 90,
478 VK_FORMAT_R16G16B16A16_UNORM = 91,
479 VK_FORMAT_R16G16B16A16_SNORM = 92,
480 VK_FORMAT_R16G16B16A16_USCALED = 93,
481 VK_FORMAT_R16G16B16A16_SSCALED = 94,
482 VK_FORMAT_R16G16B16A16_UINT = 95,
483 VK_FORMAT_R16G16B16A16_SINT = 96,
484 VK_FORMAT_R16G16B16A16_SFLOAT = 97,
485 VK_FORMAT_R32_UINT = 98,
486 VK_FORMAT_R32_SINT = 99,
487 VK_FORMAT_R32_SFLOAT = 100,
488 VK_FORMAT_R32G32_UINT = 101,
489 VK_FORMAT_R32G32_SINT = 102,
490 VK_FORMAT_R32G32_SFLOAT = 103,
491 VK_FORMAT_R32G32B32_UINT = 104,
492 VK_FORMAT_R32G32B32_SINT = 105,
493 VK_FORMAT_R32G32B32_SFLOAT = 106,
494 VK_FORMAT_R32G32B32A32_UINT = 107,
495 VK_FORMAT_R32G32B32A32_SINT = 108,
496 VK_FORMAT_R32G32B32A32_SFLOAT = 109,
497 VK_FORMAT_R64_UINT = 110,
498 VK_FORMAT_R64_SINT = 111,
499 VK_FORMAT_R64_SFLOAT = 112,
500 VK_FORMAT_R64G64_UINT = 113,
501 VK_FORMAT_R64G64_SINT = 114,
502 VK_FORMAT_R64G64_SFLOAT = 115,
503 VK_FORMAT_R64G64B64_UINT = 116,
504 VK_FORMAT_R64G64B64_SINT = 117,
505 VK_FORMAT_R64G64B64_SFLOAT = 118,
506 VK_FORMAT_R64G64B64A64_UINT = 119,
507 VK_FORMAT_R64G64B64A64_SINT = 120,
508 VK_FORMAT_R64G64B64A64_SFLOAT = 121,
509 VK_FORMAT_B10G11R11_UFLOAT_PACK32 = 122,
510 VK_FORMAT_E5B9G9R9_UFLOAT_PACK32 = 123,
511 VK_FORMAT_D16_UNORM = 124,
512 VK_FORMAT_X8_D24_UNORM_PACK32 = 125,
513 VK_FORMAT_D32_SFLOAT = 126,
514 VK_FORMAT_S8_UINT = 127,
515 VK_FORMAT_D16_UNORM_S8_UINT = 128,
516 VK_FORMAT_D24_UNORM_S8_UINT = 129,
517 VK_FORMAT_D32_SFLOAT_S8_UINT = 130,
518 VK_FORMAT_BC1_RGB_UNORM_BLOCK = 131,
519 VK_FORMAT_BC1_RGB_SRGB_BLOCK = 132,
520 VK_FORMAT_BC1_RGBA_UNORM_BLOCK = 133,
521 VK_FORMAT_BC1_RGBA_SRGB_BLOCK = 134,
522 VK_FORMAT_BC2_UNORM_BLOCK = 135,
523 VK_FORMAT_BC2_SRGB_BLOCK = 136,
524 VK_FORMAT_BC3_UNORM_BLOCK = 137,
525 VK_FORMAT_BC3_SRGB_BLOCK = 138,
526 VK_FORMAT_BC4_UNORM_BLOCK = 139,
527 VK_FORMAT_BC4_SNORM_BLOCK = 140,
528 VK_FORMAT_BC5_UNORM_BLOCK = 141,
529 VK_FORMAT_BC5_SNORM_BLOCK = 142,
530 VK_FORMAT_BC6H_UFLOAT_BLOCK = 143,
531 VK_FORMAT_BC6H_SFLOAT_BLOCK = 144,
532 VK_FORMAT_BC7_UNORM_BLOCK = 145,
533 VK_FORMAT_BC7_SRGB_BLOCK = 146,
534 VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK = 147,
535 VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK = 148,
536 VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK = 149,
537 VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK = 150,
538 VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK = 151,
539 VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK = 152,
540 VK_FORMAT_EAC_R11_UNORM_BLOCK = 153,
541 VK_FORMAT_EAC_R11_SNORM_BLOCK = 154,
542 VK_FORMAT_EAC_R11G11_UNORM_BLOCK = 155,
543 VK_FORMAT_EAC_R11G11_SNORM_BLOCK = 156,
544 VK_FORMAT_ASTC_4x4_UNORM_BLOCK = 157,
545 VK_FORMAT_ASTC_4x4_SRGB_BLOCK = 158,
546 VK_FORMAT_ASTC_5x4_UNORM_BLOCK = 159,
547 VK_FORMAT_ASTC_5x4_SRGB_BLOCK = 160,
548 VK_FORMAT_ASTC_5x5_UNORM_BLOCK = 161,
549 VK_FORMAT_ASTC_5x5_SRGB_BLOCK = 162,
550 VK_FORMAT_ASTC_6x5_UNORM_BLOCK = 163,
551 VK_FORMAT_ASTC_6x5_SRGB_BLOCK = 164,
552 VK_FORMAT_ASTC_6x6_UNORM_BLOCK = 165,
553 VK_FORMAT_ASTC_6x6_SRGB_BLOCK = 166,
554 VK_FORMAT_ASTC_8x5_UNORM_BLOCK = 167,
555 VK_FORMAT_ASTC_8x5_SRGB_BLOCK = 168,
556 VK_FORMAT_ASTC_8x6_UNORM_BLOCK = 169,
557 VK_FORMAT_ASTC_8x6_SRGB_BLOCK = 170,
558 VK_FORMAT_ASTC_8x8_UNORM_BLOCK = 171,
559 VK_FORMAT_ASTC_8x8_SRGB_BLOCK = 172,
560 VK_FORMAT_ASTC_10x5_UNORM_BLOCK = 173,
561 VK_FORMAT_ASTC_10x5_SRGB_BLOCK = 174,
562 VK_FORMAT_ASTC_10x6_UNORM_BLOCK = 175,
563 VK_FORMAT_ASTC_10x6_SRGB_BLOCK = 176,
564 VK_FORMAT_ASTC_10x8_UNORM_BLOCK = 177,
565 VK_FORMAT_ASTC_10x8_SRGB_BLOCK = 178,
566 VK_FORMAT_ASTC_10x10_UNORM_BLOCK = 179,
567 VK_FORMAT_ASTC_10x10_SRGB_BLOCK = 180,
568 VK_FORMAT_ASTC_12x10_UNORM_BLOCK = 181,
569 VK_FORMAT_ASTC_12x10_SRGB_BLOCK = 182,
570 VK_FORMAT_ASTC_12x12_UNORM_BLOCK = 183,
571 VK_FORMAT_ASTC_12x12_SRGB_BLOCK = 184,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700572}
573
Jesse Halld27f6aa2015-08-15 17:58:48 -0700574/// Structure type enumerant
575enum VkStructureType {
576 VK_STRUCTURE_TYPE_APPLICATION_INFO = 0,
Jesse Hallc7467b72015-11-29 21:05:26 -0800577 VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO = 1,
578 VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO = 2,
579 VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO = 3,
580 VK_STRUCTURE_TYPE_SUBMIT_INFO = 4,
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800581 VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO = 5,
Jesse Hallc7467b72015-11-29 21:05:26 -0800582 VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE = 6,
583 VK_STRUCTURE_TYPE_BIND_SPARSE_INFO = 7,
584 VK_STRUCTURE_TYPE_FENCE_CREATE_INFO = 8,
585 VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO = 9,
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700586 VK_STRUCTURE_TYPE_EVENT_CREATE_INFO = 10,
Jesse Hallc7467b72015-11-29 21:05:26 -0800587 VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO = 11,
588 VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO = 12,
589 VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO = 13,
590 VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO = 14,
591 VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO = 15,
592 VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO = 16,
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800593 VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO = 17,
594 VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO = 18,
595 VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO = 19,
596 VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO = 20,
597 VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO = 21,
598 VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO = 22,
599 VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO = 23,
600 VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO = 24,
601 VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO = 25,
602 VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO = 26,
603 VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO = 27,
604 VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO = 28,
605 VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO = 29,
606 VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO = 30,
607 VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO = 31,
608 VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO = 32,
609 VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO = 33,
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800610 VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO = 34,
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800611 VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET = 35,
612 VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET = 36,
613 VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO = 37,
614 VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO = 38,
615 VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO = 39,
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800616 VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO = 40,
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800617 VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO = 41,
618 VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO = 42,
619 VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER = 43,
620 VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER = 44,
621 VK_STRUCTURE_TYPE_MEMORY_BARRIER = 45,
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800622 VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO = 46,
623 VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO = 47,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800624
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800625 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800626 VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR = 1000001000,
627 VK_STRUCTURE_TYPE_PRESENT_INFO_KHR = 1000001001,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800628
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800629 //@extension("VK_KHR_display")
Jesse Hallbd888842015-11-30 21:44:14 -0800630 VK_STRUCTURE_TYPE_DISPLAY_MODE_CREATE_INFO_KHR = 1000002000,
631 VK_STRUCTURE_TYPE_DISPLAY_SURFACE_CREATE_INFO_KHR = 1000002001,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800632
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800633 //@extension("VK_KHR_display_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800634 VK_STRUCTURE_TYPE_DISPLAY_DISPLAY_PRESENT_INFO_KHR = 1000003000,
Jesse Hallf9fa9a52016-01-08 16:08:51 -0800635
636 //@extension("VK_KHR_xlib_surface")
637 VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR = 1000004000,
638
639 //@extension("VK_KHR_xcb_surface")
640 VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR = 1000005000,
641
642 //@extension("VK_KHR_wayland_surface")
643 VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR = 1000006000,
644
645 //@extension("VK_KHR_mir_surface")
646 VK_STRUCTURE_TYPE_MIR_SURFACE_CREATE_INFO_KHR = 1000007000,
647
648 //@extension("VK_KHR_android_surface")
649 VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR = 1000008000,
650
651 //@extension("VK_KHR_win32_surface")
652 VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR = 1000009000,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700653}
654
Jesse Hall65ab5522015-11-30 00:07:16 -0800655enum VkSubpassContents {
656 VK_SUBPASS_CONTENTS_INLINE = 0x00000000,
657 VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700658}
659
Jesse Hallbd888842015-11-30 21:44:14 -0800660@lastUnused(-11)
Jesse Halld27f6aa2015-08-15 17:58:48 -0700661/// Error and return codes
662enum VkResult {
663 // Return codes for successful operation execution (positive values)
Jesse Hallbd888842015-11-30 21:44:14 -0800664 VK_SUCCESS = 0,
665 VK_NOT_READY = 1,
666 VK_TIMEOUT = 2,
667 VK_EVENT_SET = 3,
668 VK_EVENT_RESET = 4,
669 VK_INCOMPLETE = 5,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700670
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800671 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800672 VK_SUBOPTIMAL_KHR = 1000001003,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800673
Jesse Halld27f6aa2015-08-15 17:58:48 -0700674 // Error codes (negative values)
Jesse Hallbd888842015-11-30 21:44:14 -0800675 VK_ERROR_OUT_OF_HOST_MEMORY = 0xFFFFFFFF, // -1
676 VK_ERROR_OUT_OF_DEVICE_MEMORY = 0xFFFFFFFE, // -2
677 VK_ERROR_INITIALIZATION_FAILED = 0xFFFFFFFD, // -3
678 VK_ERROR_DEVICE_LOST = 0xFFFFFFFC, // -4
679 VK_ERROR_MEMORY_MAP_FAILED = 0xFFFFFFFB, // -5
680 VK_ERROR_LAYER_NOT_PRESENT = 0xFFFFFFFA, // -6
681 VK_ERROR_EXTENSION_NOT_PRESENT = 0xFFFFFFF9, // -7
682 VK_ERROR_FEATURE_NOT_PRESENT = 0xFFFFFFF8, // -8
683 VK_ERROR_INCOMPATIBLE_DRIVER = 0xFFFFFFF7, // -9
684 VK_ERROR_TOO_MANY_OBJECTS = 0xFFFFFFF6, // -10
685 VK_ERROR_FORMAT_NOT_SUPPORTED = 0xFFFFFFF5, // -11
Jesse Hall1356b0d2015-11-23 17:24:58 -0800686
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800687 //@extension("VK_KHR_surface")
Jesse Hallbd888842015-11-30 21:44:14 -0800688 VK_ERROR_SURFACE_LOST_KHR = 0xC4653600, // -1000000000
Jesse Halla6429252015-11-29 18:59:42 -0800689
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800690 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800691 VK_ERROR_OUT_OF_DATE_KHR = 0xC4653214, // -1000001004
Jesse Hall1356b0d2015-11-23 17:24:58 -0800692
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800693 //@extension("VK_KHR_display_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800694 VK_ERROR_INCOMPATIBLE_DISPLAY_KHR = 0xC4652A47, // -1000003001
Jesse Hall1356b0d2015-11-23 17:24:58 -0800695
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800696 //@extension("VK_KHR_android_surface")
Jesse Hallbd888842015-11-30 21:44:14 -0800697 VK_ERROR_NATIVE_WINDOW_IN_USE_KHR = 0xC46516C0, // -1000008000
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_DEFAULT = 0x00000000, /// Results of the queries are immediately written to the destination buffer as 32-bit values
906 VK_QUERY_RESULT_64_BIT = 0x00000001, /// Results of the queries are written to the destination buffer as 64-bit values
907 VK_QUERY_RESULT_WAIT_BIT = 0x00000002, /// Results of the queries are waited on before proceeding with the result copy
908 VK_QUERY_RESULT_WITH_AVAILABILITY_BIT = 0x00000004, /// Besides the results of the query, the availability of the results is also written
909 VK_QUERY_RESULT_PARTIAL_BIT = 0x00000008, /// Copy the partial results of the query even if the final results aren't available
910}
911
912/// Shader module creation flags
Jesse Halld8bade02015-11-24 10:24:18 -0800913type VkFlags VkShaderModuleCreateFlags
Jesse Halla6429252015-11-29 18:59:42 -0800914//bitfield VkShaderModuleCreateFlagBits {
915//}
Jesse Halld27f6aa2015-08-15 17:58:48 -0700916
Jesse Halld27f6aa2015-08-15 17:58:48 -0700917/// Event creation flags
Jesse Halld8bade02015-11-24 10:24:18 -0800918type VkFlags VkEventCreateFlags
Jesse Halla6429252015-11-29 18:59:42 -0800919//bitfield VkEventCreateFlagBits {
920//}
Jesse Halld27f6aa2015-08-15 17:58:48 -0700921
Jesse Halla15a4bf2015-11-19 22:48:02 -0800922/// Command buffer usage flags
Jesse Hall3fbc8562015-11-29 22:10:52 -0800923type VkFlags VkCommandBufferUsageFlags
924bitfield VkCommandBufferUsageFlagBits {
925 VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT = 0x00000001,
926 VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT = 0x00000002,
927 VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700928}
929
930/// Pipeline statistics flags
Jesse Halld8bade02015-11-24 10:24:18 -0800931type VkFlags VkQueryPipelineStatisticFlags
932bitfield VkQueryPipelineStatisticFlagBits {
Jesse Hallae38f732015-11-19 21:32:50 -0800933 VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_BIT = 0x00000001, /// Optional
934 VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_PRIMITIVES_BIT = 0x00000002, /// Optional
935 VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT = 0x00000004, /// Optional
936 VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_INVOCATIONS_BIT = 0x00000008, /// Optional
937 VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT = 0x00000010, /// Optional
938 VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT = 0x00000020, /// Optional
939 VK_QUERY_PIPELINE_STATISTIC_CLIPPING_PRIMITIVES_BIT = 0x00000040, /// Optional
940 VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT = 0x00000080, /// Optional
941 VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT = 0x00000100, /// Optional
942 VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT = 0x00000200, /// Optional
943 VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT = 0x00000400, /// Optional
Jesse Halld27f6aa2015-08-15 17:58:48 -0700944}
945
946/// Memory mapping flags
Jesse Halld8bade02015-11-24 10:24:18 -0800947type VkFlags VkMemoryMapFlags
Jesse Halla6429252015-11-29 18:59:42 -0800948//bitfield VkMemoryMapFlagBits {
949//}
Jesse Halld27f6aa2015-08-15 17:58:48 -0700950
951/// Bitfield of image aspects
Jesse Halld8bade02015-11-24 10:24:18 -0800952type VkFlags VkImageAspectFlags
953bitfield VkImageAspectFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -0700954 VK_IMAGE_ASPECT_COLOR_BIT = 0x00000001,
955 VK_IMAGE_ASPECT_DEPTH_BIT = 0x00000002,
956 VK_IMAGE_ASPECT_STENCIL_BIT = 0x00000004,
957 VK_IMAGE_ASPECT_METADATA_BIT = 0x00000008,
958}
959
960/// Sparse memory bind flags
Jesse Halld8bade02015-11-24 10:24:18 -0800961type VkFlags VkSparseMemoryBindFlags
Jesse Hall091ed9e2015-11-30 00:55:29 -0800962bitfield VkSparseMemoryBindFlagBits {
963 VK_SPARSE_MEMORY_BIND_METADATA_BIT = 0x00000001,
964}
Jesse Halld27f6aa2015-08-15 17:58:48 -0700965
966/// Sparse image memory requirements flags
Jesse Halld8bade02015-11-24 10:24:18 -0800967type VkFlags VkSparseImageFormatFlags
968bitfield VkSparseImageFormatFlagBits {
Jesse Hallb00daad2015-11-29 19:46:20 -0800969 VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT = 0x00000001, /// Image uses a single miptail region for all array slices
970 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.
971 VK_SPARSE_IMAGE_FORMAT_NONSTANDARD_BLOCK_SIZE_BIT = 0x00000004, /// Image uses a non-standard sparse block size
Jesse Halld27f6aa2015-08-15 17:58:48 -0700972}
973
974/// Pipeline stages
Jesse Halld8bade02015-11-24 10:24:18 -0800975type VkFlags VkPipelineStageFlags
976bitfield VkPipelineStageFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -0700977 VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT = 0x00000001, /// Before subsequent commands are processed
978 VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT = 0x00000002, /// Draw/DispatchIndirect command fetch
979 VK_PIPELINE_STAGE_VERTEX_INPUT_BIT = 0x00000004, /// Vertex/index fetch
980 VK_PIPELINE_STAGE_VERTEX_SHADER_BIT = 0x00000008, /// Vertex shading
Jesse Hallae38f732015-11-19 21:32:50 -0800981 VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT = 0x00000010, /// Tessellation control shading
982 VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT = 0x00000020, /// Tessellation evaluation shading
Jesse Halld27f6aa2015-08-15 17:58:48 -0700983 VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT = 0x00000040, /// Geometry shading
984 VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT = 0x00000080, /// Fragment shading
985 VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT = 0x00000100, /// Early fragment (depth/stencil) tests
986 VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT = 0x00000200, /// Late fragment (depth/stencil) tests
987 VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT = 0x00000400, /// Color attachment writes
988 VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT = 0x00000800, /// Compute shading
989 VK_PIPELINE_STAGE_TRANSFER_BIT = 0x00001000, /// Transfer/copy operations
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700990 VK_PIPELINE_STAGE_HOST_BIT = 0x00002000, /// Indicates host (CPU) is a source/sink of the dependency
Jesse Halld27f6aa2015-08-15 17:58:48 -0700991
Jesse Hall091ed9e2015-11-30 00:55:29 -0800992 VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT = 0x00004000, /// All stages of the graphics pipeline
993 VK_PIPELINE_STAGE_ALL_COMMANDS_BIT = 0x00008000, /// 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_NONE = 0x00000000, /// No faces
1039 VK_STENCIL_FACE_FRONT_BIT = 0x00000001, /// Front face
1040 VK_STENCIL_FACE_BACK_BIT = 0x00000002, /// Back face
Jesse Hallc7467b72015-11-29 21:05:26 -08001041 VK_STENCIL_FRONT_AND_BACK = 0x00000003,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001042}
1043
Jesse Halla6429252015-11-29 18:59:42 -08001044/// Instance creation flags
1045type VkFlags VkInstanceCreateFlags
1046//bitfield VkInstanceCreateFlagBits {
1047//}
1048
1049/// Device creation flags
1050type VkFlags VkDeviceCreateFlags
1051//bitfield VkDeviceCreateFlagBits {
1052//}
1053
1054/// Device queue creation flags
1055type VkFlags VkDeviceQueueCreateFlags
1056//bitfield VkDeviceQueueCreateFlagBits {
1057//}
1058
1059/// Query pool creation flags
1060type VkFlags VkQueryPoolCreateFlags
1061//bitfield VkQueryPoolCreateFlagBits {
1062//}
1063
1064/// Buffer view creation flags
1065type VkFlags VkBufferViewCreateFlags
1066//bitfield VkBufferViewCreateFlagBits {
1067//}
1068
1069/// Pipeline cache creation flags
1070type VkFlags VkPipelineCacheCreateFlags
1071//bitfield VkPipelineCacheCreateFlagBits {
1072//}
1073
1074/// Pipeline shader stage creation flags
1075type VkFlags VkPipelineShaderStageCreateFlags
1076//bitfield VkPipelineShaderStageCreateFlagBits {
1077//}
1078
1079/// Descriptor set layout creation flags
1080type VkFlags VkDescriptorSetLayoutCreateFlags
1081//bitfield VkDescriptorSetLayoutCreateFlagBits {
1082//}
1083
1084/// Pipeline vertex input state creation flags
1085type VkFlags VkPipelineVertexInputStateCreateFlags
1086//bitfield VkPipelineVertexInputStateCreateFlagBits {
1087//}
1088
1089/// Pipeline input assembly state creation flags
1090type VkFlags VkPipelineInputAssemblyStateCreateFlags
1091//bitfield VkPipelineInputAssemblyStateCreateFlagBits {
1092//}
1093
1094/// Tessellation state creation flags
1095type VkFlags VkPipelineTessellationStateCreateFlags
1096//bitfield VkPipelineTessellationStateCreateFlagBits {
1097//}
1098
1099/// Viewport state creation flags
1100type VkFlags VkPipelineViewportStateCreateFlags
1101//bitfield VkPipelineViewportStateCreateFlagBits {
1102//}
1103
Jesse Hall3fbc8562015-11-29 22:10:52 -08001104/// Rasterization state creation flags
1105type VkFlags VkPipelineRasterizationStateCreateFlags
1106//bitfield VkPipelineRasterizationStateCreateFlagBits {
Jesse Halla6429252015-11-29 18:59:42 -08001107//}
1108
1109/// Multisample state creation flags
1110type VkFlags VkPipelineMultisampleStateCreateFlags
1111//bitfield VkPipelineMultisampleStateCreateFlagBits {
1112//}
1113
1114/// Color blend state creation flags
1115type VkFlags VkPipelineColorBlendStateCreateFlags
1116//bitfield VkPipelineColorBlendStateCreateFlagBits {
1117//}
1118
1119/// Depth/stencil state creation flags
1120type VkFlags VkPipelineDepthStencilStateCreateFlags
1121//bitfield VkPipelineDepthStencilStateCreateFlagBits {
1122//}
1123
1124/// Dynamic state creation flags
1125type VkFlags VkPipelineDynamicStateCreateFlags
1126//bitfield VkPipelineDynamicStateCreateFlagBits {
1127//}
1128
1129/// Pipeline layout creation flags
1130type VkFlags VkPipelineLayoutCreateFlags
1131//bitfield VkPipelineLayoutCreateFlagBits {
1132//}
1133
1134/// Sampler creation flags
1135type VkFlags VkSamplerCreateFlags
1136//bitfield VkSamplerCreateFlagBits {
1137//}
1138
1139/// Render pass creation flags
1140type VkFlags VkRenderPassCreateFlags
1141//bitfield VkRenderPassCreateFlagBits {
1142//}
1143
1144/// Framebuffer creation flags
1145type VkFlags VkFramebufferCreateFlags
1146//bitfield VkFramebufferCreateFlagBits {
1147//}
1148
Jesse Halldc6d36c2015-11-29 19:12:15 -08001149/// Dependency flags
1150type VkFlags VkDependencyFlags
1151bitfield VkDependencyFlagBits {
1152 VK_DEPENDENCY_BY_REGION_BIT = 0x00000001,
1153}
1154
Jesse Hallc7467b72015-11-29 21:05:26 -08001155/// Cull mode flags
1156type VkFlags VkCullModeFlags
1157bitfield VkCullModeFlagBits {
1158 VK_CULL_MODE_NONE = 0x00000000,
1159 VK_CULL_MODE_FRONT_BIT = 0x00000001,
1160 VK_CULL_MODE_BACK_BIT = 0x00000002,
1161 VK_CULL_MODE_FRONT_AND_BACK = 0x00000003,
1162}
1163
Jesse Hall523db342015-11-30 21:12:55 -08001164@extension("VK_KHR_surface")
Jesse Halld8bade02015-11-24 10:24:18 -08001165type VkFlags VkSurfaceTransformFlagsKHR
Jesse Hall523db342015-11-30 21:12:55 -08001166@extension("VK_KHR_surface")
Jesse Halld8bade02015-11-24 10:24:18 -08001167bitfield VkSurfaceTransformFlagBitsKHR {
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001168 VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR = 0x00000001,
Jesse Hall9ba8bc82015-11-30 16:22:16 -08001169 VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR = 0x00000002,
1170 VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR = 0x00000004,
1171 VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR = 0x00000008,
1172 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR = 0x00000010,
1173 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR = 0x00000020,
1174 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR = 0x00000040,
1175 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR = 0x00000080,
1176 VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR = 0x00000100,
Michael Lentine88594d72015-11-12 12:49:45 -08001177}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001178
Jesse Hall523db342015-11-30 21:12:55 -08001179@extension("VK_KHR_surface")
Jesse Halla6429252015-11-29 18:59:42 -08001180type VkFlags VkCompositeAlphaFlagsKHR
Jesse Hall523db342015-11-30 21:12:55 -08001181@extension("VK_KHR_surface")
Jesse Halla6429252015-11-29 18:59:42 -08001182bitfield VkCompositeAlphaFlagBitsKHR {
1183 VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR = 0x00000001,
1184 VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR = 0x00000002,
1185 VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR = 0x00000004,
1186 VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR = 0x00000008,
1187}
1188
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001189@extension("VK_KHR_swapchain")
1190type VkFlags VkSwapchainCreateFlagsKHR
1191//@extension("VK_KHR_swapchain")
1192//bitfield VkSwapchainCreateFlagBitsKHR {
1193//}
1194
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001195@extension("VK_KHR_display")
Jesse Halld8bade02015-11-24 10:24:18 -08001196type VkFlags VkDisplayPlaneAlphaFlagsKHR
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001197@extension("VK_KHR_display")
Jesse Halld8bade02015-11-24 10:24:18 -08001198bitfield VkDisplayPlaneAlphaFlagBitsKHR {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001199 VK_DISPLAY_PLANE_ALPHA_OPAQUE_BIT_KHR = 0x00000001,
1200 VK_DISPLAY_PLANE_ALPHA_GLOBAL_BIT_KHR = 0x00000002,
1201 VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_BIT_KHR = 0x00000004,
1202 VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_PREMULTIPLIED_BIT_KHR = 0x00000008,
Jesse Hall1356b0d2015-11-23 17:24:58 -08001203}
1204
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001205@extension("VK_KHR_display")
1206type VkFlags VkDisplaySurfaceCreateFlagsKHR
1207//@extension("VK_KHR_display")
1208//bitfield VkDisplaySurfaceCreateFlagBitsKHR {
1209//}
1210
Jesse Hall9ba8bc82015-11-30 16:22:16 -08001211@extension("VK_KHR_display")
1212type VkFlags VkDisplayModeCreateFlagsKHR
1213//@extension("VK_KHR_display")
1214//bitfield VkDisplayModeCreateFlagBitsKHR {
1215//}
1216
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001217@extension("VK_KHR_xlib_surface")
1218type VkFlags VkXlibSurfaceCreateFlagsKHR
1219//@extension("VK_KHR_xlib_surface")
1220//bitfield VkXlibSurfaceCreateFlagBitsKHR {
1221//}
1222
1223@extension("VK_KHR_xcb_surface")
1224type VkFlags VkXcbSurfaceCreateFlagsKHR
1225//@extension("VK_KHR_xcb_surface")
1226//bitfield VkXcbSurfaceCreateFlagBitsKHR {
1227//}
1228
1229@extension("VK_KHR_wayland_surface")
1230type VkFlags VkWaylandSurfaceCreateFlagsKHR
1231//@extension("VK_KHR_wayland_surface")
1232//bitfield VkWaylandSurfaceCreateFlagBitsKHR {
1233//}
1234
1235@extension("VK_KHR_mir_surface")
1236type VkFlags VkMirSurfaceCreateFlagsKHR
1237//@extension("VK_KHR_mir_surface")
1238//bitfield VkMirSurfaceCreateFlagBitsKHR {
1239//}
1240
1241@extension("VK_KHR_android_surface")
1242type VkFlags VkAndroidSurfaceCreateFlagsKHR
1243//@extension("VK_KHR_android_surface")
1244//bitfield VkAndroidSurfaceCreateFlagBitsKHR {
1245//}
1246
1247@extension("VK_KHR_win32_surface")
1248type VkFlags VkWin32SurfaceCreateFlagsKHR
1249//@extension("VK_KHR_win32_surface")
1250//bitfield VkWin32SurfaceCreateFlagBitsKHR {
1251//}
1252
Jesse Hall1356b0d2015-11-23 17:24:58 -08001253
Jesse Halld27f6aa2015-08-15 17:58:48 -07001254//////////////////
1255// Structures //
1256//////////////////
1257
1258class VkOffset2D {
1259 s32 x
1260 s32 y
1261}
1262
1263class VkOffset3D {
1264 s32 x
1265 s32 y
1266 s32 z
1267}
1268
1269class VkExtent2D {
1270 s32 width
1271 s32 height
1272}
1273
1274class VkExtent3D {
1275 s32 width
1276 s32 height
1277 s32 depth
1278}
1279
1280class VkViewport {
Jesse Hall65ab5522015-11-30 00:07:16 -08001281 f32 x
1282 f32 y
Jesse Halld27f6aa2015-08-15 17:58:48 -07001283 f32 width
1284 f32 height
1285 f32 minDepth
1286 f32 maxDepth
1287}
1288
1289class VkRect2D {
1290 VkOffset2D offset
1291 VkExtent2D extent
1292}
1293
Jesse Halla15a4bf2015-11-19 22:48:02 -08001294class VkClearRect {
1295 VkRect2D rect
1296 u32 baseArrayLayer
Jesse Hall3fbc8562015-11-29 22:10:52 -08001297 u32 layerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001298}
1299
Jesse Hall65ab5522015-11-30 00:07:16 -08001300class VkComponentMapping {
1301 VkComponentSwizzle r
1302 VkComponentSwizzle g
1303 VkComponentSwizzle b
1304 VkComponentSwizzle a
Jesse Halld27f6aa2015-08-15 17:58:48 -07001305}
1306
1307class VkPhysicalDeviceProperties {
1308 u32 apiVersion
1309 u32 driverVersion
Jesse Hall65ab5522015-11-30 00:07:16 -08001310 u32 vendorID
1311 u32 deviceID
Jesse Halld27f6aa2015-08-15 17:58:48 -07001312 VkPhysicalDeviceType deviceType
Jesse Hall65ab5522015-11-30 00:07:16 -08001313 char[VK_MAX_PHYSICAL_DEVICE_NAME_SIZE] deviceName
1314 u8[VK_UUID_SIZE] pipelineCacheUUID
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001315 VkPhysicalDeviceLimits limits
1316 VkPhysicalDeviceSparseProperties sparseProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07001317}
1318
1319class VkExtensionProperties {
Jesse Hall65ab5522015-11-30 00:07:16 -08001320 char[VK_MAX_EXTENSION_NAME_SIZE] extensionName /// extension name
Jesse Halld27f6aa2015-08-15 17:58:48 -07001321 u32 specVersion /// version of the extension specification implemented
1322}
1323
1324class VkLayerProperties {
Jesse Hall65ab5522015-11-30 00:07:16 -08001325 char[VK_MAX_EXTENSION_NAME_SIZE] layerName /// layer name
Jesse Hall3fbc8562015-11-29 22:10:52 -08001326 u32 specVersion /// version of the layer specification implemented
1327 u32 implementationVersion /// build or release version of the layer's library
Jesse Hall65ab5522015-11-30 00:07:16 -08001328 char[VK_MAX_DESCRIPTION_SIZE] description /// Free-form description of the layer
Jesse Halld27f6aa2015-08-15 17:58:48 -07001329}
1330
Jesse Halla366a512015-11-19 22:30:07 -08001331class VkSubmitInfo {
Jesse Hall03b6fe12015-11-24 12:44:21 -08001332 VkStructureType sType /// Type of structure. Should be VK_STRUCTURE_TYPE_SUBMIT_INFO
1333 const void* pNext /// Next structure in chain
1334 u32 waitSemaphoreCount
Jesse Halla366a512015-11-19 22:30:07 -08001335 const VkSemaphore* pWaitSemaphores
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
1593 VkDeviceSize depthPitch /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001594}
1595
1596class VkImageViewCreateInfo {
1597 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO
1598 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001599 VkImageViewCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001600 VkImage image
1601 VkImageViewType viewType
1602 VkFormat format
Jesse Hall65ab5522015-11-30 00:07:16 -08001603 VkComponentMapping components
Jesse Halld27f6aa2015-08-15 17:58:48 -07001604 VkImageSubresourceRange subresourceRange
Jesse Halld27f6aa2015-08-15 17:58:48 -07001605}
1606
1607class VkBufferCopy {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001608 VkDeviceSize srcOffset /// Specified in bytes
Jesse Hall3fbc8562015-11-29 22:10:52 -08001609 VkDeviceSize dstOffset /// Specified in bytes
Jesse Hallb00daad2015-11-29 19:46:20 -08001610 VkDeviceSize size /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001611}
1612
Jesse Halla6429252015-11-29 18:59:42 -08001613class VkSparseMemoryBind {
Jesse Hallb00daad2015-11-29 19:46:20 -08001614 VkDeviceSize resourceOffset /// Specified in bytes
1615 VkDeviceSize size /// Specified in bytes
Jesse Hall3fbc8562015-11-29 22:10:52 -08001616 VkDeviceMemory memory
1617 VkDeviceSize memoryOffset /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001618 VkSparseMemoryBindFlags flags
1619}
1620
Jesse Halla6429252015-11-29 18:59:42 -08001621class VkSparseImageMemoryBind {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001622 VkImageSubresource subresource
1623 VkOffset3D offset
1624 VkExtent3D extent
Jesse Hall3fbc8562015-11-29 22:10:52 -08001625 VkDeviceMemory memory
1626 VkDeviceSize memoryOffset /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001627 VkSparseMemoryBindFlags flags
1628}
1629
Jesse Halla6429252015-11-29 18:59:42 -08001630class VkSparseBufferMemoryBindInfo {
1631 VkBuffer buffer
1632 u32 bindCount
1633 const VkSparseMemoryBind* pBinds
1634}
1635
1636class VkSparseImageOpaqueMemoryBindInfo {
1637 VkImage image
1638 u32 bindCount
1639 const VkSparseMemoryBind* pBinds
1640}
1641
1642class VkSparseImageMemoryBindInfo {
1643 VkImage image
1644 u32 bindCount
1645 const VkSparseMemoryBind* pBinds
1646}
1647
1648class VkBindSparseInfo {
1649 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BIND_SPARSE_INFO
1650 const void* pNext
1651 u32 waitSemaphoreCount
1652 const VkSemaphore* pWaitSemaphores
1653 u32 numBufferBinds
1654 const VkSparseBufferMemoryBindInfo* pBufferBinds
1655 u32 numImageOpaqueBinds
1656 const VkSparseImageOpaqueMemoryBindInfo* pImageOpaqueBinds
1657 u32 numImageBinds
1658 const VkSparseImageMemoryBindInfo* pImageBinds
1659 u32 signalSemaphoreCount
1660 const VkSemaphore* pSignalSemaphores
1661}
1662
Jesse Hall65ab5522015-11-30 00:07:16 -08001663class VkImageSubresourceLayers {
1664 VkImageAspectFlags aspectMask
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001665 u32 mipLevel
Jesse Halla15a4bf2015-11-19 22:48:02 -08001666 u32 baseArrayLayer
Jesse Hall3fbc8562015-11-29 22:10:52 -08001667 u32 layerCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001668}
1669
Jesse Halld27f6aa2015-08-15 17:58:48 -07001670class VkImageCopy {
Jesse Hall65ab5522015-11-30 00:07:16 -08001671 VkImageSubresourceLayers srcSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07001672 VkOffset3D srcOffset /// Specified in pixels for both compressed and uncompressed images
Jesse Hall65ab5522015-11-30 00:07:16 -08001673 VkImageSubresourceLayers dstSubresource
Jesse Hall3fbc8562015-11-29 22:10:52 -08001674 VkOffset3D dstOffset /// Specified in pixels for both compressed and uncompressed images
Jesse Halld27f6aa2015-08-15 17:58:48 -07001675 VkExtent3D extent /// Specified in pixels for both compressed and uncompressed images
1676}
1677
1678class VkImageBlit {
Jesse Hall65ab5522015-11-30 00:07:16 -08001679 VkImageSubresourceLayers srcSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07001680 VkOffset3D srcOffset /// Specified in pixels for both compressed and uncompressed images
1681 VkExtent3D srcExtent /// Specified in pixels for both compressed and uncompressed images
Jesse Hall65ab5522015-11-30 00:07:16 -08001682 VkImageSubresourceLayers dstSubresource
Jesse Hall3fbc8562015-11-29 22:10:52 -08001683 VkOffset3D dstOffset /// Specified in pixels for both compressed and uncompressed images
1684 VkExtent3D dstExtent /// Specified in pixels for both compressed and uncompressed images
Jesse Halld27f6aa2015-08-15 17:58:48 -07001685}
1686
1687class VkBufferImageCopy {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001688 VkDeviceSize bufferOffset /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001689 u32 bufferRowLength /// Specified in texels
1690 u32 bufferImageHeight
Jesse Hall65ab5522015-11-30 00:07:16 -08001691 VkImageSubresourceLayers imageSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07001692 VkOffset3D imageOffset /// Specified in pixels for both compressed and uncompressed images
1693 VkExtent3D imageExtent /// Specified in pixels for both compressed and uncompressed images
1694}
1695
1696class VkImageResolve {
Jesse Hall65ab5522015-11-30 00:07:16 -08001697 VkImageSubresourceLayers srcSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07001698 VkOffset3D srcOffset
Jesse Hall65ab5522015-11-30 00:07:16 -08001699 VkImageSubresourceLayers dstSubresource
Jesse Hall3fbc8562015-11-29 22:10:52 -08001700 VkOffset3D dstOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07001701 VkExtent3D extent
1702}
1703
1704class VkShaderModuleCreateInfo {
1705 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO
1706 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001707 VkShaderModuleCreateFlags flags /// Reserved
Jesse Halld27f6aa2015-08-15 17:58:48 -07001708 platform.size_t codeSize /// Specified in bytes
Jesse Halla9bb62b2015-11-21 19:31:56 -08001709 const u32* pCode /// Binary code of size codeSize
Jesse Halld27f6aa2015-08-15 17:58:48 -07001710}
1711
Jesse Halld27f6aa2015-08-15 17:58:48 -07001712class VkDescriptorSetLayoutBinding {
Jesse Hall091ed9e2015-11-30 00:55:29 -08001713 u32 binding
Jesse Halld27f6aa2015-08-15 17:58:48 -07001714 VkDescriptorType descriptorType /// Type of the descriptors in this binding
Jesse Halldba27f72015-11-30 14:25:46 -08001715 u32 descriptorCount /// Number of descriptors in this binding
Jesse Halld27f6aa2015-08-15 17:58:48 -07001716 VkShaderStageFlags stageFlags /// Shader stages this binding is visible to
1717 const VkSampler* pImmutableSamplers /// Immutable samplers (used if descriptor type is SAMPLER or COMBINED_IMAGE_SAMPLER, is either NULL or contains <count> number of elements)
1718}
1719
1720class VkDescriptorSetLayoutCreateInfo {
1721 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO
1722 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001723 VkDescriptorSetLayoutCreateFlags flags
Jesse Hall03b6fe12015-11-24 12:44:21 -08001724 u32 bindingCount /// Number of bindings in the descriptor set layout
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001725 const VkDescriptorSetLayoutBinding* pBinding /// Array of descriptor set layout bindings
Jesse Halld27f6aa2015-08-15 17:58:48 -07001726}
1727
Jesse Hall65ab5522015-11-30 00:07:16 -08001728class VkDescriptorPoolSize {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001729 VkDescriptorType type
Jesse Hall03b6fe12015-11-24 12:44:21 -08001730 u32 descriptorCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001731}
1732
1733class VkDescriptorPoolCreateInfo {
1734 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO
1735 const void* pNext /// Pointer to next structure
Jesse Hallfbf97b02015-11-20 14:17:03 -08001736 VkDescriptorPoolCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001737 u32 maxSets
Jesse Hall65ab5522015-11-30 00:07:16 -08001738 u32 poolSizeCount
1739 const VkDescriptorPoolSize* pPoolSizes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001740}
1741
Jesse Hall3fbc8562015-11-29 22:10:52 -08001742class VkDescriptorSetAllocateInfo {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001743 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO
Jesse Hallfbf97b02015-11-20 14:17:03 -08001744 const void* pNext /// Pointer to next structure
1745 VkDescriptorPool descriptorPool
Jesse Hall03b6fe12015-11-24 12:44:21 -08001746 u32 setCount
Jesse Hallfbf97b02015-11-20 14:17:03 -08001747 const VkDescriptorSetLayout* pSetLayouts
1748}
1749
Jesse Halld27f6aa2015-08-15 17:58:48 -07001750class VkSpecializationMapEntry {
Jesse Hall65ab5522015-11-30 00:07:16 -08001751 u32 constantID /// The SpecConstant ID specified in the BIL
Jesse Halld27f6aa2015-08-15 17:58:48 -07001752 u32 offset /// Offset of the value in the data block
Jesse Hallb00daad2015-11-29 19:46:20 -08001753 platform.size_t size /// Size in bytes of the SpecConstant
Jesse Halld27f6aa2015-08-15 17:58:48 -07001754}
1755
1756class VkSpecializationInfo {
1757 u32 mapEntryCount /// Number of entries in the map
Jesse Hallb00daad2015-11-29 19:46:20 -08001758 const VkSpecializationMapEntry* pMapEntries /// Array of map entries
Jesse Halld27f6aa2015-08-15 17:58:48 -07001759 platform.size_t dataSize /// Size in bytes of pData
1760 const void* pData /// Pointer to SpecConstant data
1761}
1762
1763class VkPipelineShaderStageCreateInfo {
1764 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO
1765 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001766 VkPipelineShaderStageCreateFlags flags
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001767 VkShaderStageFlagBits stage
1768 VkShaderModule module
1769 const char* pName
Jesse Halld27f6aa2015-08-15 17:58:48 -07001770 const VkSpecializationInfo* pSpecializationInfo
1771}
1772
1773class VkComputePipelineCreateInfo {
1774 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO
1775 const void* pNext /// Pointer to next structure
Jesse Halld27f6aa2015-08-15 17:58:48 -07001776 VkPipelineCreateFlags flags /// Pipeline creation flags
Jesse Halla6429252015-11-29 18:59:42 -08001777 VkPipelineShaderStageCreateInfo stage
Jesse Halld27f6aa2015-08-15 17:58:48 -07001778 VkPipelineLayout layout /// Interface layout of the pipeline
1779 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
1780 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
1781}
1782
1783class VkVertexInputBindingDescription {
Jesse Hallb00daad2015-11-29 19:46:20 -08001784 u32 binding /// Vertex buffer binding id
1785 u32 stride /// Distance between vertices in bytes (0 = no advancement)
Jesse Hall65ab5522015-11-30 00:07:16 -08001786 VkVertexInputRate inputRate /// Rate at which binding is incremented
Jesse Halld27f6aa2015-08-15 17:58:48 -07001787}
1788
1789class VkVertexInputAttributeDescription {
Jesse Hallb00daad2015-11-29 19:46:20 -08001790 u32 location /// location of the shader vertex attrib
1791 u32 binding /// Vertex buffer binding id
1792 VkFormat format /// format of source data
1793 u32 offset /// Offset of first element in bytes from base of vertex
Jesse Halld27f6aa2015-08-15 17:58:48 -07001794}
1795
1796class VkPipelineVertexInputStateCreateInfo {
Jesse Hall03b6fe12015-11-24 12:44:21 -08001797 VkStructureType sType /// Should be VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO
1798 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001799 VkPipelineVertexInputStateCreateFlags flags
Jesse Hall03b6fe12015-11-24 12:44:21 -08001800 u32 vertexBindingDescriptionCount /// number of bindings
Jesse Halld27f6aa2015-08-15 17:58:48 -07001801 const VkVertexInputBindingDescription* pVertexBindingDescriptions
Jesse Hall03b6fe12015-11-24 12:44:21 -08001802 u32 vertexAttributeDescriptionCount /// number of attributes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001803 const VkVertexInputAttributeDescription* pVertexAttributeDescriptions
1804}
1805
1806class VkPipelineInputAssemblyStateCreateInfo {
1807 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO
1808 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001809 VkPipelineInputAssemblyStateCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001810 VkPrimitiveTopology topology
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001811 VkBool32 primitiveRestartEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07001812}
1813
1814class VkPipelineTessellationStateCreateInfo {
1815 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO
1816 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001817 VkPipelineTessellationStateCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001818 u32 patchControlPoints
1819}
1820
1821class VkPipelineViewportStateCreateInfo {
1822 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO
1823 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001824 VkPipelineViewportStateCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001825 u32 viewportCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001826 const VkViewport* pViewports
1827 u32 scissorCount
1828 const VkRect2D* pScissors
Jesse Halld27f6aa2015-08-15 17:58:48 -07001829}
1830
Jesse Hall3fbc8562015-11-29 22:10:52 -08001831class VkPipelineRasterizationStateCreateInfo {
Jesse Hall65ab5522015-11-30 00:07:16 -08001832 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07001833 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08001834 VkPipelineRasterizationStateCreateFlags flags
Jesse Hallae38f732015-11-19 21:32:50 -08001835 VkBool32 depthClampEnable
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001836 VkBool32 rasterizerDiscardEnable
Jesse Hall65ab5522015-11-30 00:07:16 -08001837 VkPolygonMode polygonMode /// optional (GL45)
Jesse Hallc7467b72015-11-29 21:05:26 -08001838 VkCullModeFlags cullMode
Jesse Halld27f6aa2015-08-15 17:58:48 -07001839 VkFrontFace frontFace
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001840 VkBool32 depthBiasEnable
Jesse Halla9bb62b2015-11-21 19:31:56 -08001841 f32 depthBiasConstantFactor
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001842 f32 depthBiasClamp
Jesse Halla9bb62b2015-11-21 19:31:56 -08001843 f32 depthBiasSlopeFactor
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001844 f32 lineWidth
Jesse Halld27f6aa2015-08-15 17:58:48 -07001845}
1846
1847class VkPipelineMultisampleStateCreateInfo {
1848 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO
1849 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001850 VkPipelineMultisampleStateCreateFlags flags
Jesse Hall091ed9e2015-11-30 00:55:29 -08001851 VkSampleCountFlagBits rasterizationSamples /// Number of samples used for rasterization
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001852 VkBool32 sampleShadingEnable /// optional (GL45)
Jesse Halld27f6aa2015-08-15 17:58:48 -07001853 f32 minSampleShading /// optional (GL45)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001854 const VkSampleMask* pSampleMask
Jesse Hallacfa5342015-11-19 21:51:33 -08001855 VkBool32 alphaToCoverageEnable
1856 VkBool32 alphaToOneEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07001857}
1858
1859class VkPipelineColorBlendAttachmentState {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001860 VkBool32 blendEnable
Jesse Hall65ab5522015-11-30 00:07:16 -08001861 VkBlendFactor srcColorBlendFactor
1862 VkBlendFactor dstColorBlendFactor
1863 VkBlendOp colorBlendOp
1864 VkBlendFactor srcAlphaBlendFactor
1865 VkBlendFactor dstAlphaBlendFactor
1866 VkBlendOp alphaBlendOp
1867 VkColorComponentFlags colorWriteMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001868}
1869
1870class VkPipelineColorBlendStateCreateInfo {
1871 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO
1872 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001873 VkPipelineColorBlendStateCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001874 VkBool32 logicOpEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07001875 VkLogicOp logicOp
1876 u32 attachmentCount /// # of pAttachments
1877 const VkPipelineColorBlendAttachmentState* pAttachments
Jesse Hallb00daad2015-11-29 19:46:20 -08001878 f32[4] blendConstants
Jesse Halld27f6aa2015-08-15 17:58:48 -07001879}
1880
1881class VkStencilOpState {
Jesse Hall65ab5522015-11-30 00:07:16 -08001882 VkStencilOp failOp
1883 VkStencilOp passOp
1884 VkStencilOp depthFailOp
1885 VkCompareOp compareOp
1886 u32 compareMask
1887 u32 writeMask
1888 u32 reference
Jesse Halld27f6aa2015-08-15 17:58:48 -07001889}
1890
1891class VkPipelineDepthStencilStateCreateInfo {
1892 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO
1893 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001894 VkPipelineDepthStencilStateCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001895 VkBool32 depthTestEnable
1896 VkBool32 depthWriteEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07001897 VkCompareOp depthCompareOp
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001898 VkBool32 depthBoundsTestEnable /// optional (depth_bounds_test)
1899 VkBool32 stencilTestEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07001900 VkStencilOpState front
1901 VkStencilOpState back
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001902 f32 minDepthBounds
1903 f32 maxDepthBounds
1904}
1905
1906class VkPipelineDynamicStateCreateInfo {
1907 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO
1908 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001909 VkPipelineDynamicStateCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001910 u32 dynamicStateCount
1911 const VkDynamicState* pDynamicStates
Jesse Halld27f6aa2015-08-15 17:58:48 -07001912}
1913
1914class VkGraphicsPipelineCreateInfo {
Jesse Halla6429252015-11-29 18:59:42 -08001915 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO
1916 const void* pNext /// Pointer to next structure
1917 VkPipelineCreateFlags flags /// Pipeline creation flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001918 u32 stageCount
Jesse Halla6429252015-11-29 18:59:42 -08001919 const VkPipelineShaderStageCreateInfo* pStages /// One entry for each active shader stage
Jesse Halld27f6aa2015-08-15 17:58:48 -07001920 const VkPipelineVertexInputStateCreateInfo* pVertexInputState
1921 const VkPipelineInputAssemblyStateCreateInfo* pInputAssemblyState
1922 const VkPipelineTessellationStateCreateInfo* pTessellationState
1923 const VkPipelineViewportStateCreateInfo* pViewportState
Jesse Hall3fbc8562015-11-29 22:10:52 -08001924 const VkPipelineRasterizationStateCreateInfo* pRasterizationState
Jesse Halld27f6aa2015-08-15 17:58:48 -07001925 const VkPipelineMultisampleStateCreateInfo* pMultisampleState
1926 const VkPipelineDepthStencilStateCreateInfo* pDepthStencilState
1927 const VkPipelineColorBlendStateCreateInfo* pColorBlendState
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001928 const VkPipelineDynamicStateCreateInfo* pDynamicState
Jesse Halla6429252015-11-29 18:59:42 -08001929 VkPipelineLayout layout /// Interface layout of the pipeline
Jesse Halld27f6aa2015-08-15 17:58:48 -07001930 VkRenderPass renderPass
1931 u32 subpass
Jesse Halla6429252015-11-29 18:59:42 -08001932 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
1933 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 -07001934}
1935
1936class VkPipelineCacheCreateInfo {
Jesse Hallb00daad2015-11-29 19:46:20 -08001937 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO
1938 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001939 VkPipelineCacheCreateFlags flags
Jesse Hallb00daad2015-11-29 19:46:20 -08001940 platform.size_t initialDataSize /// Size of initial data to populate cache, in bytes
1941 const void* pInitialData /// Initial data to populate cache
Jesse Halld27f6aa2015-08-15 17:58:48 -07001942}
1943
1944class VkPushConstantRange {
1945 VkShaderStageFlags stageFlags /// Which stages use the range
Jesse Hall03b6fe12015-11-24 12:44:21 -08001946 u32 offset /// Start of the range, in bytes
1947 u32 size /// Length of the range, in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001948}
1949
1950class VkPipelineLayoutCreateInfo {
1951 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO
1952 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001953 VkPipelineLayoutCreateFlags flags
Jesse Hall03b6fe12015-11-24 12:44:21 -08001954 u32 setLayoutCount /// Number of descriptor sets interfaced by the pipeline
Jesse Halld27f6aa2015-08-15 17:58:48 -07001955 const VkDescriptorSetLayout* pSetLayouts /// Array of <setCount> number of descriptor set layout objects defining the layout of the
1956 u32 pushConstantRangeCount /// Number of push-constant ranges used by the pipeline
1957 const VkPushConstantRange* pPushConstantRanges /// Array of pushConstantRangeCount number of ranges used by various shader stages
1958}
1959
1960class VkSamplerCreateInfo {
1961 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO
1962 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001963 VkSamplerCreateFlags flags
Jesse Hall23ff73f2015-11-29 14:36:39 -08001964 VkFilter magFilter /// Filter mode for magnification
1965 VkFilter minFilter /// Filter mode for minifiation
1966 VkSamplerMipmapMode mipmapMode /// Mipmap selection mode
1967 VkSamplerAddressMode addressModeU
1968 VkSamplerAddressMode addressModeV
1969 VkSamplerAddressMode addressModeW
Jesse Halld27f6aa2015-08-15 17:58:48 -07001970 f32 mipLodBias
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001971 VkBool32 anisotropyEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07001972 f32 maxAnisotropy
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001973 VkBool32 compareEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07001974 VkCompareOp compareOp
1975 f32 minLod
1976 f32 maxLod
1977 VkBorderColor borderColor
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001978 VkBool32 unnormalizedCoordinates
Jesse Halld27f6aa2015-08-15 17:58:48 -07001979}
1980
Jesse Hall3fbc8562015-11-29 22:10:52 -08001981class VkCommandPoolCreateInfo {
1982 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07001983 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08001984 VkCommandPoolCreateFlags flags /// Command pool creation flags
Jesse Halla6429252015-11-29 18:59:42 -08001985 u32 queueFamilyIndex
Jesse Halld27f6aa2015-08-15 17:58:48 -07001986}
1987
Jesse Hall3fbc8562015-11-29 22:10:52 -08001988class VkCommandBufferAllocateInfo {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001989 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07001990 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08001991 VkCommandPool commandPool
1992 VkCommandBufferLevel level
Jesse Hall03b6fe12015-11-24 12:44:21 -08001993 u32 bufferCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001994}
1995
Jesse Hall3fbc8562015-11-29 22:10:52 -08001996class VkCommandBufferBeginInfo {
1997 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07001998 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08001999 VkCommandBufferUsageFlags flags /// Command buffer usage flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002000 VkRenderPass renderPass /// Render pass for secondary command buffers
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002001 u32 subpass
Jesse Halld27f6aa2015-08-15 17:58:48 -07002002 VkFramebuffer framebuffer /// Framebuffer for secondary command buffers
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002003 VkBool32 occlusionQueryEnable
2004 VkQueryControlFlags queryFlags
2005 VkQueryPipelineStatisticFlags pipelineStatistics
Jesse Halld27f6aa2015-08-15 17:58:48 -07002006}
2007
2008class VkRenderPassBeginInfo {
2009 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO
2010 const void* pNext /// Pointer to next structure
2011 VkRenderPass renderPass
2012 VkFramebuffer framebuffer
2013 VkRect2D renderArea
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002014 u32 clearValueCount
2015 const VkClearValue* pClearValues
Jesse Halld27f6aa2015-08-15 17:58:48 -07002016}
2017
2018@union
2019/// Union allowing specification of floating point, integer, or unsigned integer color data. Actual value selected is based on image/attachment being cleared.
2020class VkClearColorValue {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002021 f32[4] float32
2022 s32[4] int32
2023 u32[4] uint32
Jesse Halld27f6aa2015-08-15 17:58:48 -07002024}
2025
2026class VkClearDepthStencilValue {
2027 f32 depth
2028 u32 stencil
2029}
2030
2031@union
2032/// Union allowing specification of color, depth, and stencil color values. Actual value selected is based on attachment being cleared.
2033class VkClearValue {
2034 VkClearColorValue color
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002035 VkClearDepthStencilValue depthStencil
Jesse Halld27f6aa2015-08-15 17:58:48 -07002036}
2037
Jesse Hallae38f732015-11-19 21:32:50 -08002038class VkClearAttachment {
2039 VkImageAspectFlags aspectMask
2040 u32 colorAttachment
2041 VkClearValue clearValue
2042}
2043
Jesse Halld27f6aa2015-08-15 17:58:48 -07002044class VkAttachmentDescription {
Jesse Halla6429252015-11-29 18:59:42 -08002045 VkAttachmentDescriptionFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002046 VkFormat format
Jesse Hall091ed9e2015-11-30 00:55:29 -08002047 VkSampleCountFlagBits samples
Jesse Halld27f6aa2015-08-15 17:58:48 -07002048 VkAttachmentLoadOp loadOp /// Load op for color or depth data
2049 VkAttachmentStoreOp storeOp /// Store op for color or depth data
2050 VkAttachmentLoadOp stencilLoadOp /// Load op for stencil data
2051 VkAttachmentStoreOp stencilStoreOp /// Store op for stencil data
2052 VkImageLayout initialLayout
2053 VkImageLayout finalLayout
2054}
2055
2056class VkAttachmentReference {
2057 u32 attachment
2058 VkImageLayout layout
2059}
2060
2061class VkSubpassDescription {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002062 VkSubpassDescriptionFlags flags
Jesse Halla6429252015-11-29 18:59:42 -08002063 VkPipelineBindPoint pipelineBindPoint /// Must be VK_PIPELINE_BIND_POINT_GRAPHICS for now
Jesse Hall03b6fe12015-11-24 12:44:21 -08002064 u32 inputAttachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002065 const VkAttachmentReference* pInputAttachments
Jesse Hall03b6fe12015-11-24 12:44:21 -08002066 u32 colorAttachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002067 const VkAttachmentReference* pColorAttachments
2068 const VkAttachmentReference* pResolveAttachments
Jesse Hallc7467b72015-11-29 21:05:26 -08002069 const VkAttachmentReference* pDepthStencilAttachment
Jesse Hall03b6fe12015-11-24 12:44:21 -08002070 u32 preserveAttachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002071 const VkAttachmentReference* pPreserveAttachments
Jesse Halld27f6aa2015-08-15 17:58:48 -07002072}
2073
2074class VkSubpassDependency {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002075 u32 srcSubpass
Jesse Hall3fbc8562015-11-29 22:10:52 -08002076 u32 dstSubpass
Jesse Halld27f6aa2015-08-15 17:58:48 -07002077 VkPipelineStageFlags srcStageMask
Jesse Hall3fbc8562015-11-29 22:10:52 -08002078 VkPipelineStageFlags dstStageMask
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002079 VkAccessFlags srcAccessMask
2080 VkAccessFlags dstAccessMask
Jesse Halldc6d36c2015-11-29 19:12:15 -08002081 VkDependencyFlags dependencyFlags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002082}
2083
2084class VkRenderPassCreateInfo {
2085 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO
2086 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002087 VkRenderPassCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002088 u32 attachmentCount
2089 const VkAttachmentDescription* pAttachments
2090 u32 subpassCount
2091 const VkSubpassDescription* pSubpasses
2092 u32 dependencyCount
2093 const VkSubpassDependency* pDependencies
2094}
2095
2096class VkEventCreateInfo {
2097 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_EVENT_CREATE_INFO
2098 const void* pNext /// Pointer to next structure
2099 VkEventCreateFlags flags /// Event creation flags
2100}
2101
2102class VkFenceCreateInfo {
2103 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_FENCE_CREATE_INFO
2104 const void* pNext /// Pointer to next structure
2105 VkFenceCreateFlags flags /// Fence creation flags
2106}
2107
2108class VkPhysicalDeviceFeatures {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002109 VkBool32 robustBufferAccess /// out of bounds buffer accesses are well defined
2110 VkBool32 fullDrawIndexUint32 /// full 32-bit range of indices for indexed draw calls
2111 VkBool32 imageCubeArray /// image views which are arrays of cube maps
2112 VkBool32 independentBlend /// blending operations are controlled per-attachment
2113 VkBool32 geometryShader /// geometry stage
2114 VkBool32 tessellationShader /// tessellation control and evaluation stage
2115 VkBool32 sampleRateShading /// per-sample shading and interpolation
Jesse Hall3fbc8562015-11-29 22:10:52 -08002116 VkBool32 dualSrcBlend /// blend operations which take two sources
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002117 VkBool32 logicOp /// logic operations
2118 VkBool32 multiDrawIndirect /// multi draw indirect
Jesse Hallae38f732015-11-19 21:32:50 -08002119 VkBool32 depthClamp /// depth clamping
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002120 VkBool32 depthBiasClamp /// depth bias clamping
2121 VkBool32 fillModeNonSolid /// point and wireframe fill modes
2122 VkBool32 depthBounds /// depth bounds test
2123 VkBool32 wideLines /// lines with width greater than 1
2124 VkBool32 largePoints /// points with size greater than 1
Jesse Hallfbf97b02015-11-20 14:17:03 -08002125 VkBool32 alphaToOne /// The fragment alpha channel can be forced to maximum representable alpha value
2126 VkBool32 multiViewport
2127 VkBool32 samplerAnisotropy
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002128 VkBool32 textureCompressionETC2 /// ETC texture compression formats
2129 VkBool32 textureCompressionASTC_LDR /// ASTC LDR texture compression formats
2130 VkBool32 textureCompressionBC /// BC1-7 texture compressed formats
Jesse Hall65ab5522015-11-30 00:07:16 -08002131 VkBool32 occlusionQueryPrecise
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002132 VkBool32 pipelineStatisticsQuery /// pipeline statistics query
Jesse Halldc6d36c2015-11-29 19:12:15 -08002133 VkBool32 vertexPipelineStoresAndAtomics
2134 VkBool32 fragmentStoresAndAtomics
2135 VkBool32 shaderTessellationAndGeometryPointSize
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002136 VkBool32 shaderImageGatherExtended /// texture gather with run-time values and independent offsets
2137 VkBool32 shaderStorageImageExtendedFormats /// the extended set of formats can be used for storage images
2138 VkBool32 shaderStorageImageMultisample /// multisample images can be used for storage images
Jesse Halld1af8122015-11-29 23:50:38 -08002139 VkBool32 shaderStorageImageReadWithoutFormat
2140 VkBool32 shaderStorageImageWriteWithoutFormat
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002141 VkBool32 shaderUniformBufferArrayDynamicIndexing /// arrays of uniform buffers can be accessed with dynamically uniform indices
2142 VkBool32 shaderSampledImageArrayDynamicIndexing /// arrays of sampled images can be accessed with dynamically uniform indices
2143 VkBool32 shaderStorageBufferArrayDynamicIndexing /// arrays of storage buffers can be accessed with dynamically uniform indices
2144 VkBool32 shaderStorageImageArrayDynamicIndexing /// arrays of storage images can be accessed with dynamically uniform indices
2145 VkBool32 shaderClipDistance /// clip distance in shaders
2146 VkBool32 shaderCullDistance /// cull distance in shaders
2147 VkBool32 shaderFloat64 /// 64-bit floats (doubles) in shaders
2148 VkBool32 shaderInt64 /// 64-bit integers in shaders
2149 VkBool32 shaderInt16 /// 16-bit integers in shaders
2150 VkBool32 shaderResourceResidency /// shader can use texture operations that return resource residency information (requires sparseNonResident support)
Jesse Hall65ab5522015-11-30 00:07:16 -08002151 VkBool32 shaderResourceMinLod /// shader can use texture operations that specify minimum resource LOD
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002152 VkBool32 sparseBinding /// Sparse resources support: Resource memory can be managed at opaque page level rather than object level
2153 VkBool32 sparseResidencyBuffer /// Sparse resources support: GPU can access partially resident buffers
2154 VkBool32 sparseResidencyImage2D /// Sparse resources support: GPU can access partially resident 2D (non-MSAA non-DepthStencil) images
2155 VkBool32 sparseResidencyImage3D /// Sparse resources support: GPU can access partially resident 3D images
2156 VkBool32 sparseResidency2Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 2 samples
2157 VkBool32 sparseResidency4Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 4 samples
2158 VkBool32 sparseResidency8Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 8 samples
2159 VkBool32 sparseResidency16Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 16 samples
2160 VkBool32 sparseResidencyAliased /// Sparse resources support: GPU can correctly access data aliased into multiple locations (opt-in)
Jesse Halld1af8122015-11-29 23:50:38 -08002161 VkBool32 variableMultisampleRate
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002162 VkBool32 inheritedQueries
Jesse Halld27f6aa2015-08-15 17:58:48 -07002163}
2164
2165class VkPhysicalDeviceLimits {
2166 /// resource maximum sizes
2167 u32 maxImageDimension1D /// max 1D image dimension
2168 u32 maxImageDimension2D /// max 2D image dimension
2169 u32 maxImageDimension3D /// max 3D image dimension
2170 u32 maxImageDimensionCube /// max cubemap image dimension
2171 u32 maxImageArrayLayers /// max layers for image arrays
Jesse Hallb00daad2015-11-29 19:46:20 -08002172 u32 maxTexelBufferElements
Jesse Hallfbf97b02015-11-20 14:17:03 -08002173 u32 maxUniformBufferRange /// max uniform buffer size (bytes)
2174 u32 maxStorageBufferRange /// max storage buffer size (bytes)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002175 u32 maxPushConstantsSize /// max size of the push constants pool (bytes)
2176 /// memory limits
2177 u32 maxMemoryAllocationCount /// max number of device memory allocations supported
Jesse Hall091ed9e2015-11-30 00:55:29 -08002178 u32 maxSamplerAllocationCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002179 VkDeviceSize bufferImageGranularity /// Granularity (in bytes) at which buffers and images can be bound to adjacent memory for simultaneous usage
2180 VkDeviceSize sparseAddressSpaceSize /// Total address space available for sparse allocations (bytes)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002181 /// descriptor set limits
2182 u32 maxBoundDescriptorSets /// max number of descriptors sets that can be bound to a pipeline
Jesse Halld27f6aa2015-08-15 17:58:48 -07002183 u32 maxPerStageDescriptorSamplers /// max num of samplers allowed per-stage in a descriptor set
2184 u32 maxPerStageDescriptorUniformBuffers /// max num of uniform buffers allowed per-stage in a descriptor set
2185 u32 maxPerStageDescriptorStorageBuffers /// max num of storage buffers allowed per-stage in a descriptor set
2186 u32 maxPerStageDescriptorSampledImages /// max num of sampled images allowed per-stage in a descriptor set
2187 u32 maxPerStageDescriptorStorageImages /// max num of storage images allowed per-stage in a descriptor set
Jesse Halle1b12782015-11-30 11:27:32 -08002188 u32 maxPerStageDescriptorInputAttachments
Jesse Halldba27f72015-11-30 14:25:46 -08002189 u32 maxPerStageResources
Jesse Halld27f6aa2015-08-15 17:58:48 -07002190 u32 maxDescriptorSetSamplers /// max num of samplers allowed in all stages in a descriptor set
2191 u32 maxDescriptorSetUniformBuffers /// max num of uniform buffers allowed in all stages in a descriptor set
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002192 u32 maxDescriptorSetUniformBuffersDynamic /// max num of dynamic uniform buffers allowed in all stages in a descriptor set
Jesse Halld27f6aa2015-08-15 17:58:48 -07002193 u32 maxDescriptorSetStorageBuffers /// max num of storage buffers allowed in all stages in a descriptor set
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002194 u32 maxDescriptorSetStorageBuffersDynamic /// max num of dynamic storage buffers allowed in all stages in a descriptor set
Jesse Halld27f6aa2015-08-15 17:58:48 -07002195 u32 maxDescriptorSetSampledImages /// max num of sampled images allowed in all stages in a descriptor set
2196 u32 maxDescriptorSetStorageImages /// max num of storage images allowed in all stages in a descriptor set
Jesse Halle1b12782015-11-30 11:27:32 -08002197 u32 maxDescriptorSetInputAttachments
Jesse Halld27f6aa2015-08-15 17:58:48 -07002198 /// vertex stage limits
2199 u32 maxVertexInputAttributes /// max num of vertex input attribute slots
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002200 u32 maxVertexInputBindings /// max num of vertex input binding slots
Jesse Halld27f6aa2015-08-15 17:58:48 -07002201 u32 maxVertexInputAttributeOffset /// max vertex input attribute offset added to vertex buffer offset
2202 u32 maxVertexInputBindingStride /// max vertex input binding stride
2203 u32 maxVertexOutputComponents /// max num of output components written by vertex shader
2204 /// tessellation control stage limits
Jesse Hall3fbc8562015-11-29 22:10:52 -08002205 u32 maxTessellationGenerationLevel /// max level supported by tess primitive generator
Jesse Hallae38f732015-11-19 21:32:50 -08002206 u32 maxTessellationPatchSize /// max patch size (vertices)
2207 u32 maxTessellationControlPerVertexInputComponents /// max num of input components per-vertex in TCS
2208 u32 maxTessellationControlPerVertexOutputComponents /// max num of output components per-vertex in TCS
2209 u32 maxTessellationControlPerPatchOutputComponents /// max num of output components per-patch in TCS
2210 u32 maxTessellationControlTotalOutputComponents /// max total num of per-vertex and per-patch output components in TCS
2211 u32 maxTessellationEvaluationInputComponents /// max num of input components per vertex in TES
2212 u32 maxTessellationEvaluationOutputComponents /// max num of output components per vertex in TES
Jesse Halld27f6aa2015-08-15 17:58:48 -07002213 /// geometry stage limits
2214 u32 maxGeometryShaderInvocations /// max invocation count supported in geometry shader
2215 u32 maxGeometryInputComponents /// max num of input components read in geometry stage
2216 u32 maxGeometryOutputComponents /// max num of output components written in geometry stage
2217 u32 maxGeometryOutputVertices /// max num of vertices that can be emitted in geometry stage
2218 u32 maxGeometryTotalOutputComponents /// max total num of components (all vertices) written in geometry stage
2219 /// fragment stage limits
2220 u32 maxFragmentInputComponents /// max num of input compontents read in fragment stage
Jesse Hallfbf97b02015-11-20 14:17:03 -08002221 u32 maxFragmentOutputAttachments /// max num of output attachments written in fragment stage
Jesse Hall3fbc8562015-11-29 22:10:52 -08002222 u32 maxFragmentDualSrcAttachments /// max num of output attachments written when using dual source blending
Jesse Halld27f6aa2015-08-15 17:58:48 -07002223 u32 maxFragmentCombinedOutputResources /// max total num of storage buffers, storage images and output buffers
2224 /// compute stage limits
2225 u32 maxComputeSharedMemorySize /// max total storage size of work group local storage (bytes)
2226 u32[3] maxComputeWorkGroupCount /// max num of compute work groups that may be dispatched by a single command (x,y,z)
2227 u32 maxComputeWorkGroupInvocations /// max total compute invocations in a single local work group
2228 u32[3] maxComputeWorkGroupSize /// max local size of a compute work group (x,y,z)
2229
2230 u32 subPixelPrecisionBits /// num bits of subpixel precision in screen x and y
2231 u32 subTexelPrecisionBits /// num bits of subtexel precision
2232 u32 mipmapPrecisionBits /// num bits of mipmap precision
2233
2234 u32 maxDrawIndexedIndexValue /// max index value for indexed draw calls (for 32-bit indices)
Jesse Halldba27f72015-11-30 14:25:46 -08002235 u32 maxDrawIndirectCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002236
2237 f32 maxSamplerLodBias /// max absolute sampler level of detail bias
2238 f32 maxSamplerAnisotropy /// max degree of sampler anisotropy
2239
2240 u32 maxViewports /// max number of active viewports
Jesse Halld27f6aa2015-08-15 17:58:48 -07002241 u32[2] maxViewportDimensions /// max viewport dimensions (x,y)
2242 f32[2] viewportBoundsRange /// viewport bounds range (min,max)
2243 u32 viewportSubPixelBits /// num bits of subpixel precision for viewport
2244
Jesse Halldc6d36c2015-11-29 19:12:15 -08002245 platform.size_t minMemoryMapAlignment /// min required alignment of pointers returned by MapMemory (bytes)
2246 VkDeviceSize minTexelBufferOffsetAlignment /// min required alignment for texel buffer offsets (bytes)
2247 VkDeviceSize minUniformBufferOffsetAlignment /// min required alignment for uniform buffer sizes and offsets (bytes)
2248 VkDeviceSize minStorageBufferOffsetAlignment /// min required alignment for storage buffer offsets (bytes)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002249
Jesse Hallfbf97b02015-11-20 14:17:03 -08002250 s32 minTexelOffset /// min texel offset for OpTextureSampleOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07002251 u32 maxTexelOffset /// max texel offset for OpTextureSampleOffset
Jesse Hallfbf97b02015-11-20 14:17:03 -08002252 s32 minTexelGatherOffset /// min texel offset for OpTextureGatherOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07002253 u32 maxTexelGatherOffset /// max texel offset for OpTextureGatherOffset
2254 f32 minInterpolationOffset /// furthest negative offset for interpolateAtOffset
2255 f32 maxInterpolationOffset /// furthest positive offset for interpolateAtOffset
2256 u32 subPixelInterpolationOffsetBits /// num of subpixel bits for interpolateAtOffset
2257
2258 u32 maxFramebufferWidth /// max width for a framebuffer
2259 u32 maxFramebufferHeight /// max height for a framebuffer
2260 u32 maxFramebufferLayers /// max layer count for a layered framebuffer
Jesse Hall091ed9e2015-11-30 00:55:29 -08002261 VkSampleCountFlags framebufferColorSampleCounts
2262 VkSampleCountFlags framebufferDepthSampleCounts
2263 VkSampleCountFlags framebufferStencilSampleCounts
2264 VkSampleCountFlags framebufferNoAttachmentSampleCounts
Jesse Halld27f6aa2015-08-15 17:58:48 -07002265 u32 maxColorAttachments /// max num of framebuffer color attachments
2266
Jesse Hall091ed9e2015-11-30 00:55:29 -08002267 VkSampleCountFlags sampledImageColorSampleCounts
2268 VkSampleCountFlags sampledImageIntegerSampleCounts
2269 VkSampleCountFlags sampledImageDepthSampleCounts
2270 VkSampleCountFlags sampledImageStencilSampleCounts
2271 VkSampleCountFlags storageImageSampleCounts
Jesse Halld27f6aa2015-08-15 17:58:48 -07002272 u32 maxSampleMaskWords /// max num of sample mask words
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002273 VkBool32 timestampComputeAndGraphics
Jesse Halld27f6aa2015-08-15 17:58:48 -07002274
Jesse Halla9bb62b2015-11-21 19:31:56 -08002275 f32 timestampPeriod
Jesse Halld27f6aa2015-08-15 17:58:48 -07002276
2277 u32 maxClipDistances /// max number of clip distances
2278 u32 maxCullDistances /// max number of cull distances
2279 u32 maxCombinedClipAndCullDistances /// max combined number of user clipping
2280
Jesse Hallfbf97b02015-11-20 14:17:03 -08002281 u32 discreteQueuePriorities
2282
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002283 f32[2] pointSizeRange /// range (min,max) of supported point sizes
2284 f32[2] lineWidthRange /// range (min,max) of supported line widths
Jesse Halld27f6aa2015-08-15 17:58:48 -07002285 f32 pointSizeGranularity /// granularity of supported point sizes
2286 f32 lineWidthGranularity /// granularity of supported line widths
Jesse Hall03b6fe12015-11-24 12:44:21 -08002287 VkBool32 strictLines
Jesse Hall091ed9e2015-11-30 00:55:29 -08002288 VkBool32 standardSampleLocations
Jesse Halla9bb62b2015-11-21 19:31:56 -08002289
Jesse Hall65ab5522015-11-30 00:07:16 -08002290 VkDeviceSize optimalBufferCopyOffsetAlignment
2291 VkDeviceSize optimalBufferCopyRowPitchAlignment
Jesse Halldba27f72015-11-30 14:25:46 -08002292 VkDeviceSize nonCoherentAtomSize
Jesse Halld27f6aa2015-08-15 17:58:48 -07002293}
2294
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002295class VkPhysicalDeviceSparseProperties {
2296 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 -08002297 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 -07002298 VkBool32 residencyStandard3DBlockShape /// Sparse resources support: GPU will access all 3D sparse resources using the standard block shapes (based on pixel format)
2299 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 -07002300 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
2301}
2302
Jesse Halld27f6aa2015-08-15 17:58:48 -07002303class VkSemaphoreCreateInfo {
2304 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO
2305 const void* pNext /// Pointer to next structure
2306 VkSemaphoreCreateFlags flags /// Semaphore creation flags
2307}
2308
2309class VkQueryPoolCreateInfo {
2310 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO
2311 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002312 VkQueryPoolCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002313 VkQueryType queryType
Jesse Hall65ab5522015-11-30 00:07:16 -08002314 u32 entryCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002315 VkQueryPipelineStatisticFlags pipelineStatistics /// Optional
2316}
2317
2318class VkFramebufferCreateInfo {
2319 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO
2320 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002321 VkFramebufferCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002322 VkRenderPass renderPass
2323 u32 attachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002324 const VkImageView* pAttachments
Jesse Halld27f6aa2015-08-15 17:58:48 -07002325 u32 width
2326 u32 height
2327 u32 layers
2328}
2329
Jesse Hall3fbc8562015-11-29 22:10:52 -08002330class VkDrawIndirectCommand {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002331 u32 vertexCount
2332 u32 instanceCount
2333 u32 firstVertex
2334 u32 firstInstance
2335}
2336
Jesse Hall3fbc8562015-11-29 22:10:52 -08002337class VkDrawIndexedIndirectCommand {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002338 u32 indexCount
2339 u32 instanceCount
2340 u32 firstIndex
2341 s32 vertexOffset
2342 u32 firstInstance
2343}
2344
Jesse Hall3fbc8562015-11-29 22:10:52 -08002345class VkDispatchIndirectCommand {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002346 u32 x
2347 u32 y
2348 u32 z
2349}
2350
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002351@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08002352class VkSurfaceCapabilitiesKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002353 u32 minImageCount
2354 u32 maxImageCount
2355 VkExtent2D currentExtent
2356 VkExtent2D minImageExtent
2357 VkExtent2D maxImageExtent
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002358 u32 maxImageArrayLayers
Jesse Hall1356b0d2015-11-23 17:24:58 -08002359 VkSurfaceTransformFlagsKHR supportedTransforms
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002360 VkSurfaceTransformFlagBitsKHR currentTransform
Jesse Halla6429252015-11-29 18:59:42 -08002361 VkCompositeAlphaFlagsKHR supportedCompositeAlpha
Jesse Hall1356b0d2015-11-23 17:24:58 -08002362 VkImageUsageFlags supportedUsageFlags
Michael Lentine88594d72015-11-12 12:49:45 -08002363}
2364
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002365@extension("VK_KHR_surface")
Michael Lentine88594d72015-11-12 12:49:45 -08002366class VkSurfaceFormatKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002367 VkFormat format
2368 VkColorSpaceKHR colorSpace
Michael Lentine88594d72015-11-12 12:49:45 -08002369}
2370
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002371@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08002372class VkSwapchainCreateInfoKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002373 VkStructureType sType
2374 const void* pNext
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002375 VkSwapchainCreateFlagsKHR flags
Jesse Hall1356b0d2015-11-23 17:24:58 -08002376 VkSurfaceKHR surface
2377 u32 minImageCount
2378 VkFormat imageFormat
2379 VkColorSpaceKHR imageColorSpace
2380 VkExtent2D imageExtent
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002381 u32 imageArrayLayers
2382 VkImageUsageFlags imageUsage
Jesse Hall1356b0d2015-11-23 17:24:58 -08002383 VkSharingMode sharingMode
Jesse Hall03b6fe12015-11-24 12:44:21 -08002384 u32 queueFamilyIndexCount
Jesse Hall1356b0d2015-11-23 17:24:58 -08002385 const u32* pQueueFamilyIndices
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002386 VkSurfaceTransformFlagBitsKHR preTransform
2387 VkCompositeAlphaFlagBitsKHR compositeAlpha
Jesse Hall1356b0d2015-11-23 17:24:58 -08002388 VkPresentModeKHR presentMode
Jesse Hall1356b0d2015-11-23 17:24:58 -08002389 VkBool32 clipped
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002390 VkSwapchainKHR oldSwapchain
Michael Lentine88594d72015-11-12 12:49:45 -08002391}
2392
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002393@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08002394class VkPresentInfoKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002395 VkStructureType sType
2396 const void* pNext
Jesse Hallb00daad2015-11-29 19:46:20 -08002397 u32 waitSemaphoreCount
2398 const VkSemaphore* pWaitSemaphores
Jesse Hall1356b0d2015-11-23 17:24:58 -08002399 u32 swapchainCount
Jesse Hall03b6fe12015-11-24 12:44:21 -08002400 const VkSwapchainKHR* pSwapchains
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002401 const u32* pImageIndices
Jesse Halle1b12782015-11-30 11:27:32 -08002402 VkResult* pResults
Michael Lentine88594d72015-11-12 12:49:45 -08002403}
2404
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002405@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002406class VkDisplayPropertiesKHR {
2407 VkDisplayKHR display
2408 const char* displayName
2409 VkExtent2D physicalDimensions
2410 VkExtent2D physicalResolution
2411 VkSurfaceTransformFlagsKHR supportedTransforms
Jesse Hall1356b0d2015-11-23 17:24:58 -08002412 VkBool32 planeReorderPossible
Jesse Halla6429252015-11-29 18:59:42 -08002413 VkBool32 persistentContent
Michael Lentine88594d72015-11-12 12:49:45 -08002414}
2415
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002416@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08002417class VkDisplayModeParametersKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002418 VkExtent2D visibleRegion
Jesse Halla6429252015-11-29 18:59:42 -08002419 u32 refreshRate
Michael Lentine88594d72015-11-12 12:49:45 -08002420}
Jesse Halld27f6aa2015-08-15 17:58:48 -07002421
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002422@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002423class VkDisplayModePropertiesKHR {
2424 VkDisplayModeKHR displayMode
Jesse Halla6429252015-11-29 18:59:42 -08002425 VkDisplayModeParametersKHR parameters
Jesse Hall1356b0d2015-11-23 17:24:58 -08002426}
2427
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002428@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002429class VkDisplayModeCreateInfoKHR {
2430 VkStructureType sType
2431 const void* pNext
Jesse Hall9ba8bc82015-11-30 16:22:16 -08002432 VkDisplayModeCreateFlagsKHR flags
Jesse Halla6429252015-11-29 18:59:42 -08002433 VkDisplayModeParametersKHR parameters
Jesse Hall1356b0d2015-11-23 17:24:58 -08002434}
2435
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002436@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002437class VkDisplayPlanePropertiesKHR {
Jesse Halla6429252015-11-29 18:59:42 -08002438 VkDisplayKHR currentDisplay
2439 u32 currentStackIndex
2440}
2441
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002442@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08002443class VkDisplayPlaneCapabilitiesKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002444 VkDisplayPlaneAlphaFlagsKHR supportedAlpha
2445 VkOffset2D minSrcPosition
2446 VkOffset2D maxSrcPosition
2447 VkExtent2D minSrcExtent
2448 VkExtent2D maxSrcExtent
2449 VkOffset2D minDstPosition
2450 VkOffset2D maxDstPosition
2451 VkExtent2D minDstExtent
2452 VkExtent2D maxDstExtent
2453}
2454
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002455@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08002456class VkDisplaySurfaceCreateInfoKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002457 VkStructureType sType
2458 const void* pNext
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002459 VkDisplaySurfaceCreateFlagsKHR flags
Jesse Hall1356b0d2015-11-23 17:24:58 -08002460 VkDisplayModeKHR displayMode
2461 u32 planeIndex
2462 u32 planeStackIndex
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002463 VkSurfaceTransformFlagBitsKHR transform
Jesse Hall1356b0d2015-11-23 17:24:58 -08002464 f32 globalAlpha
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002465 VkDisplayPlaneAlphaFlagBitsKHR alphaMode
2466 VkExtent2D imageExtent
Jesse Hall1356b0d2015-11-23 17:24:58 -08002467}
2468
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002469@extension("VK_KHR_display_swapchain")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002470class VkDisplayPresentInfoKHR {
2471 VkStructureType sType
2472 const void* pNext
2473 VkRect2D srcRect
2474 VkRect2D dstRect
Jesse Halla6429252015-11-29 18:59:42 -08002475 VkBool32 persistent
Jesse Hall1356b0d2015-11-23 17:24:58 -08002476}
2477
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002478@extension("VK_KHR_xlib_surface")
2479class VkXlibSurfaceCreateInfoKHR {
2480 VkStructureType sType
2481 const void* pNext
2482 VkXlibSurfaceCreateFlagsKHR flags
2483 platform.Display* dpy
2484 platform.Window window
2485}
2486
2487@extension("VK_KHR_xcb_surface")
2488class VkXcbSurfaceCreateInfoKHR {
2489 VkStructureType sType
2490 const void* pNext
2491 VkXcbSurfaceCreateFlagsKHR flags
2492 platform.xcb_connection_t* connection
2493 platform.xcb_window_t window
2494}
2495
2496@extension("VK_KHR_wayland_surface")
2497class VkWaylandSurfaceCreateInfoKHR {
2498 VkStructureType sType
2499 const void* pNext
2500 VkWaylandSurfaceCreateFlagsKHR flags
2501 platform.wl_display* display
2502 platform.wl_surface* surface
2503}
2504
2505@extension("VK_KHR_mir_surface")
2506class VkMirSurfaceCreateInfoKHR {
2507 VkStructureType sType
2508 const void* pNext
2509 VkMirSurfaceCreateFlagsKHR flags
2510 platform.MirConnection* connection
2511 platform.MirSurface* mirSurface
2512}
2513
2514@extension("VK_KHR_android_surface")
2515class VkAndroidSurfaceCreateInfoKHR {
2516 VkStructureType sType
2517 const void* pNext
2518 VkAndroidSurfaceCreateFlagsKHR flags
2519 platform.ANativeWindow* window
2520}
2521
2522@extension("VK_KHR_win32_surface")
2523class VkWin32SurfaceCreateInfoKHR {
2524 VkStructureType sType
2525 const void* pNext
2526 VkWin32SurfaceCreateFlagsKHR flags
2527 platform.HINSTANCE hinstance
2528 platform.HWND hwnd
2529}
2530
Jesse Hall1356b0d2015-11-23 17:24:58 -08002531
Jesse Halld27f6aa2015-08-15 17:58:48 -07002532////////////////
2533// Commands //
2534////////////////
2535
2536// Function pointers. TODO: add support for function pointers.
2537
2538@external type void* PFN_vkVoidFunction
2539@pfn cmd void vkVoidFunction() {
2540}
2541
Jesse Hall3fbc8562015-11-29 22:10:52 -08002542@external type void* PFN_vkAllocationFunction
2543@pfn cmd void* vkAllocationFunction(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002544 void* pUserData,
2545 platform.size_t size,
2546 platform.size_t alignment,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002547 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08002548 return ?
2549}
2550
Jesse Hall3fbc8562015-11-29 22:10:52 -08002551@external type void* PFN_vkReallocationFunction
2552@pfn cmd void* vkReallocationFunction(
Jesse Hall03b6fe12015-11-24 12:44:21 -08002553 void* pUserData,
2554 void* pOriginal,
2555 platform.size_t size,
2556 platform.size_t alignment,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002557 VkSystemAllocationScope allocationScope) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002558 return ?
2559}
2560
2561@external type void* PFN_vkFreeFunction
2562@pfn cmd void vkFreeFunction(
2563 void* pUserData,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002564 void* pMemory) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002565}
2566
Jesse Hall3fbc8562015-11-29 22:10:52 -08002567@external type void* PFN_vkInternalAllocationNotification
2568@pfn cmd void vkInternalAllocationNotification(
Jesse Hall03b6fe12015-11-24 12:44:21 -08002569 void* pUserData,
2570 platform.size_t size,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002571 VkInternalAllocationType allocationType,
2572 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08002573}
2574
2575@external type void* PFN_vkInternalFreeNotification
2576@pfn cmd void vkInternalFreeNotification(
2577 void* pUserData,
2578 platform.size_t size,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002579 VkInternalAllocationType allocationType,
2580 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08002581}
Jesse Halld27f6aa2015-08-15 17:58:48 -07002582
2583// Global functions
2584
2585@threadSafety("system")
2586cmd VkResult vkCreateInstance(
2587 const VkInstanceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002588 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002589 VkInstance* pInstance) {
2590 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO)
2591
2592 instance := ?
2593 pInstance[0] = instance
2594 State.Instances[instance] = new!InstanceObject()
2595
Jesse Hall03b6fe12015-11-24 12:44:21 -08002596 layers := pCreateInfo.ppEnabledLayerNames[0:pCreateInfo.enabledLayerNameCount]
2597 extensions := pCreateInfo.ppEnabledExtensionNames[0:pCreateInfo.enabledExtensionNameCount]
Jesse Halld27f6aa2015-08-15 17:58:48 -07002598
2599 return ?
2600}
2601
2602@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002603cmd void vkDestroyInstance(
Jesse Hall03b6fe12015-11-24 12:44:21 -08002604 VkInstance instance,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002605 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002606 instanceObject := GetInstance(instance)
2607
2608 State.Instances[instance] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07002609}
2610
2611@threadSafety("system")
2612cmd VkResult vkEnumeratePhysicalDevices(
2613 VkInstance instance,
2614 u32* pPhysicalDeviceCount,
2615 VkPhysicalDevice* pPhysicalDevices) {
2616 instanceObject := GetInstance(instance)
2617
2618 physicalDeviceCount := as!u32(?)
2619 pPhysicalDeviceCount[0] = physicalDeviceCount
2620 physicalDevices := pPhysicalDevices[0:physicalDeviceCount]
2621
2622 for i in (0 .. physicalDeviceCount) {
2623 physicalDevice := ?
2624 physicalDevices[i] = physicalDevice
2625 if !(physicalDevice in State.PhysicalDevices) {
2626 State.PhysicalDevices[physicalDevice] = new!PhysicalDeviceObject(instance: instance)
2627 }
2628 }
2629
2630 return ?
2631}
2632
2633cmd PFN_vkVoidFunction vkGetDeviceProcAddr(
2634 VkDevice device,
2635 const char* pName) {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002636 if device != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002637 device := GetDevice(device)
2638 }
2639
2640 return ?
2641}
2642
2643cmd PFN_vkVoidFunction vkGetInstanceProcAddr(
2644 VkInstance instance,
2645 const char* pName) {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002646 if instance != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002647 instanceObject := GetInstance(instance)
2648 }
2649
2650 return ?
2651}
2652
Jesse Hall606a54e2015-11-19 22:17:28 -08002653cmd void vkGetPhysicalDeviceProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002654 VkPhysicalDevice physicalDevice,
2655 VkPhysicalDeviceProperties* pProperties) {
2656 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2657
2658 properties := ?
2659 pProperties[0] = properties
Jesse Halld27f6aa2015-08-15 17:58:48 -07002660}
2661
Jesse Hall606a54e2015-11-19 22:17:28 -08002662cmd void vkGetPhysicalDeviceQueueFamilyProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002663 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08002664 u32* pQueueFamilyPropertyCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002665 VkQueueFamilyProperties* pQueueFamilyProperties) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002666 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002667 // TODO: Figure out how to express fetch-count-or-properties
2668 // This version fails 'apic validate' with 'fence not allowed in
2669 // *semantic.Branch'. Other attempts have failed with the same or other
2670 // errors.
2671 // if pQueueFamilyProperties != null {
2672 // queuesProperties := pQueueFamilyProperties[0:pCount[0]]
2673 // for i in (0 .. pCount[0]) {
2674 // queueProperties := as!VkQueueFamilyProperties(?)
2675 // queuesProperties[i] = queueProperties
2676 // }
2677 // } else {
2678 // count := ?
2679 // pCount[0] = count
2680 // }
Jesse Halld27f6aa2015-08-15 17:58:48 -07002681}
2682
Jesse Hall606a54e2015-11-19 22:17:28 -08002683cmd void vkGetPhysicalDeviceMemoryProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002684 VkPhysicalDevice physicalDevice,
2685 VkPhysicalDeviceMemoryProperties* pMemoryProperties) {
2686 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2687
2688 memoryProperties := ?
2689 pMemoryProperties[0] = memoryProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07002690}
2691
Jesse Hall606a54e2015-11-19 22:17:28 -08002692cmd void vkGetPhysicalDeviceFeatures(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002693 VkPhysicalDevice physicalDevice,
2694 VkPhysicalDeviceFeatures* pFeatures) {
2695 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2696
2697 features := ?
2698 pFeatures[0] = features
Jesse Halld27f6aa2015-08-15 17:58:48 -07002699}
2700
Jesse Hall606a54e2015-11-19 22:17:28 -08002701cmd void vkGetPhysicalDeviceFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002702 VkPhysicalDevice physicalDevice,
2703 VkFormat format,
2704 VkFormatProperties* pFormatProperties) {
2705 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2706
2707 formatProperties := ?
2708 pFormatProperties[0] = formatProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07002709}
2710
Jesse Halla9e57032015-11-30 01:03:10 -08002711cmd VkResult vkGetPhysicalDeviceImageFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002712 VkPhysicalDevice physicalDevice,
2713 VkFormat format,
2714 VkImageType type,
2715 VkImageTiling tiling,
2716 VkImageUsageFlags usage,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002717 VkImageCreateFlags flags,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002718 VkImageFormatProperties* pImageFormatProperties) {
2719 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2720
2721 imageFormatProperties := ?
2722 pImageFormatProperties[0] = imageFormatProperties
Jesse Halla9e57032015-11-30 01:03:10 -08002723
2724 return ?
Jesse Halld27f6aa2015-08-15 17:58:48 -07002725}
2726
Jesse Halld27f6aa2015-08-15 17:58:48 -07002727
2728// Device functions
2729
2730@threadSafety("system")
2731cmd VkResult vkCreateDevice(
2732 VkPhysicalDevice physicalDevice,
2733 const VkDeviceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002734 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002735 VkDevice* pDevice) {
2736 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO)
2737 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2738
2739 device := ?
2740 pDevice[0] = device
2741 State.Devices[device] = new!DeviceObject(physicalDevice: physicalDevice)
2742
2743 return ?
2744}
2745
2746@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002747cmd void vkDestroyDevice(
Jesse Hall03b6fe12015-11-24 12:44:21 -08002748 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002749 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002750 deviceObject := GetDevice(device)
2751
2752 State.Devices[device] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07002753}
2754
2755
2756// Extension discovery functions
2757
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002758cmd VkResult vkEnumerateInstanceLayerProperties(
Jesse Hall03b6fe12015-11-24 12:44:21 -08002759 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002760 VkLayerProperties* pProperties) {
2761 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08002762 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07002763
2764 properties := pProperties[0:count]
2765 for i in (0 .. count) {
2766 property := ?
2767 properties[i] = property
2768 }
2769
2770 return ?
2771}
2772
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002773cmd VkResult vkEnumerateInstanceExtensionProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002774 const char* pLayerName,
Jesse Hall03b6fe12015-11-24 12:44:21 -08002775 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002776 VkExtensionProperties* pProperties) {
2777 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08002778 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07002779
2780 properties := pProperties[0:count]
2781 for i in (0 .. count) {
2782 property := ?
2783 properties[i] = property
2784 }
2785
2786 return ?
2787}
2788
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002789cmd VkResult vkEnumerateDeviceLayerProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002790 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08002791 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002792 VkLayerProperties* pProperties) {
2793 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2794 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08002795 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07002796
2797 properties := pProperties[0:count]
2798 for i in (0 .. count) {
2799 property := ?
2800 properties[i] = property
2801 }
2802
2803 return ?
2804}
2805
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002806cmd VkResult vkEnumerateDeviceExtensionProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002807 VkPhysicalDevice physicalDevice,
2808 const char* pLayerName,
Jesse Hall03b6fe12015-11-24 12:44:21 -08002809 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002810 VkExtensionProperties* pProperties) {
2811 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2812
2813 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08002814 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07002815
2816 properties := pProperties[0:count]
2817 for i in (0 .. count) {
2818 property := ?
2819 properties[i] = property
2820 }
2821
2822 return ?
2823}
2824
2825
2826// Queue functions
2827
2828@threadSafety("system")
Jesse Hall606a54e2015-11-19 22:17:28 -08002829cmd void vkGetDeviceQueue(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002830 VkDevice device,
2831 u32 queueFamilyIndex,
2832 u32 queueIndex,
2833 VkQueue* pQueue) {
2834 deviceObject := GetDevice(device)
2835
2836 queue := ?
2837 pQueue[0] = queue
2838
2839 if !(queue in State.Queues) {
2840 State.Queues[queue] = new!QueueObject(device: device)
2841 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07002842}
2843
2844@threadSafety("app")
2845cmd VkResult vkQueueSubmit(
2846 VkQueue queue,
Jesse Halla366a512015-11-19 22:30:07 -08002847 u32 submitCount,
Jesse Hallb00daad2015-11-29 19:46:20 -08002848 const VkSubmitInfo* pSubmits,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002849 VkFence fence) {
2850 queueObject := GetQueue(queue)
2851
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002852 if fence != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002853 fenceObject := GetFence(fence)
2854 assert(fenceObject.device == queueObject.device)
2855 }
2856
Jesse Hall3fbc8562015-11-29 22:10:52 -08002857 // commandBuffers := pcommandBuffers[0:commandBufferCount]
2858 // for i in (0 .. commandBufferCount) {
2859 // commandBuffer := commandBuffers[i]
2860 // commandBufferObject := GetCommandBuffer(commandBuffer)
2861 // assert(commandBufferObject.device == queueObject.device)
Jesse Halla366a512015-11-19 22:30:07 -08002862 //
Jesse Hall3fbc8562015-11-29 22:10:52 -08002863 // validate("QueueCheck", commandBufferObject.queueFlags in queueObject.flags,
2864 // "vkQueueSubmit: enqueued commandBuffer requires missing queue capabilities.")
Jesse Halla366a512015-11-19 22:30:07 -08002865 // }
Jesse Halld27f6aa2015-08-15 17:58:48 -07002866
2867 return ?
2868}
2869
2870@threadSafety("system")
2871cmd VkResult vkQueueWaitIdle(
2872 VkQueue queue) {
2873 queueObject := GetQueue(queue)
2874
2875 return ?
2876}
2877
2878@threadSafety("system")
2879cmd VkResult vkDeviceWaitIdle(
2880 VkDevice device) {
2881 deviceObject := GetDevice(device)
2882
2883 return ?
2884}
2885
2886
2887// Memory functions
2888
2889@threadSafety("system")
Jesse Hall3fbc8562015-11-29 22:10:52 -08002890cmd VkResult vkAllocateMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002891 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002892 const VkMemoryAllocateInfo* pAllocateInfo,
2893 const VkAllocationCallbacks* pAllocator,
2894 VkDeviceMemory* pMemory) {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002895 assert(pAllocateInfo.sType == VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002896 deviceObject := GetDevice(device)
2897
Jesse Hall3fbc8562015-11-29 22:10:52 -08002898 memory := ?
2899 pMemory[0] = memory
2900 State.DeviceMemories[memory] = new!DeviceMemoryObject(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002901 device: device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002902 allocationSize: pAllocateInfo[0].allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002903
2904 return ?
2905}
2906
2907@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002908cmd void vkFreeMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002909 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002910 VkDeviceMemory memory,
2911 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002912 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08002913 memoryObject := GetDeviceMemory(memory)
2914 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002915
2916 // Check that no objects are still bound before freeing.
Jesse Hall3fbc8562015-11-29 22:10:52 -08002917 validate("MemoryCheck", len(memoryObject.boundObjects) == 0,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002918 "vkFreeMemory: objects still bound")
Jesse Hall3fbc8562015-11-29 22:10:52 -08002919 validate("MemoryCheck", len(memoryObject.boundCommandBuffers) == 0,
2920 "vkFreeMemory: commandBuffers still bound")
2921 State.DeviceMemories[memory] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07002922}
2923
2924@threadSafety("app")
2925cmd VkResult vkMapMemory(
2926 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002927 VkDeviceMemory memory,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002928 VkDeviceSize offset,
2929 VkDeviceSize size,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002930 VkMemoryMapFlags flags,
2931 void** ppData) {
2932 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08002933 memoryObject := GetDeviceMemory(memory)
2934 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002935
2936 assert(flags == as!VkMemoryMapFlags(0))
Jesse Hall3fbc8562015-11-29 22:10:52 -08002937 assert((offset + size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002938
2939 return ?
2940}
2941
2942@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002943cmd void vkUnmapMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002944 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002945 VkDeviceMemory memory) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002946 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08002947 memoryObject := GetDeviceMemory(memory)
2948 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002949}
2950
2951cmd VkResult vkFlushMappedMemoryRanges(
2952 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002953 u32 memoryRangeCount
2954 const VkMappedMemoryRange* pMemoryRanges) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002955 deviceObject := GetDevice(device)
2956
Jesse Hall3fbc8562015-11-29 22:10:52 -08002957 memoryRanges := pMemoryRanges[0:memoryRangeCount]
2958 for i in (0 .. memoryRangeCount) {
2959 memoryRange := memoryRanges[i]
2960 memoryObject := GetDeviceMemory(memoryRange.memory)
2961 assert(memoryObject.device == device)
2962 assert((memoryRange.offset + memoryRange.size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002963 }
2964
2965 return ?
2966}
2967
2968cmd VkResult vkInvalidateMappedMemoryRanges(
2969 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002970 u32 memoryRangeCount,
2971 const VkMappedMemoryRange* pMemoryRanges) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002972 deviceObject := GetDevice(device)
2973
Jesse Hall3fbc8562015-11-29 22:10:52 -08002974 memoryRanges := pMemoryRanges[0:memoryRangeCount]
2975 for i in (0 .. memoryRangeCount) {
2976 memoryRange := memoryRanges[i]
2977 memoryObject := GetDeviceMemory(memoryRange.memory)
2978 assert(memoryObject.device == device)
2979 assert((memoryRange.offset + memoryRange.size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002980 }
2981
2982 return ?
2983}
2984
2985
2986// Memory management API functions
2987
Jesse Hall606a54e2015-11-19 22:17:28 -08002988cmd void vkGetDeviceMemoryCommitment(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002989 VkDevice device,
2990 VkDeviceMemory memory,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002991 VkDeviceSize* pCommittedMemoryInBytes) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002992 deviceObject := GetDevice(device)
2993
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002994 if memory != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002995 memoryObject := GetDeviceMemory(memory)
2996 assert(memoryObject.device == device)
2997 }
2998
2999 committedMemoryInBytes := ?
3000 pCommittedMemoryInBytes[0] = committedMemoryInBytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07003001}
3002
Jesse Hall606a54e2015-11-19 22:17:28 -08003003cmd void vkGetBufferMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003004 VkDevice device,
3005 VkBuffer buffer,
3006 VkMemoryRequirements* pMemoryRequirements) {
3007 deviceObject := GetDevice(device)
3008 bufferObject := GetBuffer(buffer)
3009 assert(bufferObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003010}
3011
3012cmd VkResult vkBindBufferMemory(
3013 VkDevice device,
3014 VkBuffer buffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003015 VkDeviceMemory memory,
3016 VkDeviceSize memoryOffset) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003017 deviceObject := GetDevice(device)
3018 bufferObject := GetBuffer(buffer)
3019 assert(bufferObject.device == device)
3020
3021 // Unbind buffer from previous memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003022 if bufferObject.memory != NULL_HANDLE {
3023 memoryObject := GetDeviceMemory(bufferObject.memory)
3024 memoryObject.boundObjects[as!u64(buffer)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003025 }
3026
3027 // Bind buffer to given memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003028 if memory != NULL_HANDLE {
3029 memoryObject := GetDeviceMemory(memory)
3030 assert(memoryObject.device == device)
3031 memoryObject.boundObjects[as!u64(buffer)] = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003032 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08003033 bufferObject.memory = memory
3034 bufferObject.memoryOffset = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003035
3036 return ?
3037}
3038
Jesse Hall606a54e2015-11-19 22:17:28 -08003039cmd void vkGetImageMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003040 VkDevice device,
3041 VkImage image,
3042 VkMemoryRequirements* pMemoryRequirements) {
3043 deviceObject := GetDevice(device)
3044 imageObject := GetImage(image)
3045 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003046}
3047
3048cmd VkResult vkBindImageMemory(
3049 VkDevice device,
3050 VkImage image,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003051 VkDeviceMemory memory,
3052 VkDeviceSize memoryOffset) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003053 deviceObject := GetDevice(device)
3054 imageObject := GetImage(image)
3055 assert(imageObject.device == device)
3056
3057 // Unbind image from previous memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003058 if imageObject.memory != NULL_HANDLE {
3059 memoryObject := GetDeviceMemory(imageObject.memory)
3060 memoryObject.boundObjects[as!u64(image)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003061 }
3062
3063 // Bind image to given memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003064 if memory != NULL_HANDLE {
3065 memoryObject := GetDeviceMemory(memory)
3066 assert(memoryObject.device == device)
3067 memoryObject.boundObjects[as!u64(image)] = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003068 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08003069 imageObject.memory = memory
3070 imageObject.memoryOffset = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003071
3072 return ?
3073}
3074
Jesse Hall606a54e2015-11-19 22:17:28 -08003075cmd void vkGetImageSparseMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003076 VkDevice device,
3077 VkImage image,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003078 u32* pSparseMemoryRequirementCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003079 VkSparseImageMemoryRequirements* pSparseMemoryRequirements) {
3080 deviceObject := GetDevice(device)
3081 imageObject := GetImage(image)
3082 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003083}
3084
Jesse Hall606a54e2015-11-19 22:17:28 -08003085cmd void vkGetPhysicalDeviceSparseImageFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003086 VkPhysicalDevice physicalDevice,
3087 VkFormat format,
3088 VkImageType type,
Jesse Hall091ed9e2015-11-30 00:55:29 -08003089 VkSampleCountFlagBits samples,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003090 VkImageUsageFlags usage,
3091 VkImageTiling tiling,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003092 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003093 VkSparseImageFormatProperties* pProperties) {
3094 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003095}
3096
Jesse Halla6429252015-11-29 18:59:42 -08003097cmd VkResult vkQueueBindSparse(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003098 VkQueue queue,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003099 u32 bindInfoCount,
Jesse Halla6429252015-11-29 18:59:42 -08003100 const VkBindSparseInfo* pBindInfo,
3101 VkFence fence) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003102 queueObject := GetQueue(queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003103
3104 return ?
3105}
3106
3107
3108// Fence functions
3109
3110@threadSafety("system")
3111cmd VkResult vkCreateFence(
3112 VkDevice device,
3113 const VkFenceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003114 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003115 VkFence* pFence) {
3116 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_FENCE_CREATE_INFO)
3117 deviceObject := GetDevice(device)
3118
3119 fence := ?
3120 pFence[0] = fence
3121 State.Fences[fence] = new!FenceObject(
Jesse Halld8bade02015-11-24 10:24:18 -08003122 device: device, signaled: (pCreateInfo.flags == as!VkFenceCreateFlags(VK_FENCE_CREATE_SIGNALED_BIT)))
Jesse Halld27f6aa2015-08-15 17:58:48 -07003123
3124 return ?
3125}
3126
3127@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003128cmd void vkDestroyFence(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003129 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003130 VkFence fence,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003131 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003132 deviceObject := GetDevice(device)
3133 fenceObject := GetFence(fence)
3134 assert(fenceObject.device == device)
3135
3136 State.Fences[fence] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003137}
3138
3139@threadSafety("system")
3140cmd VkResult vkResetFences(
3141 VkDevice device,
3142 u32 fenceCount,
3143 const VkFence* pFences) {
3144 deviceObject := GetDevice(device)
3145
3146 fences := pFences[0:fenceCount]
3147 for i in (0 .. fenceCount) {
3148 fence := fences[i]
3149 fenceObject := GetFence(fence)
3150 assert(fenceObject.device == device)
3151 fenceObject.signaled = false
3152 }
3153
3154 return ?
3155}
3156
3157@threadSafety("system")
3158cmd VkResult vkGetFenceStatus(
3159 VkDevice device,
3160 VkFence fence) {
3161 deviceObject := GetDevice(device)
3162 fenceObject := GetFence(fence)
3163 assert(fenceObject.device == device)
3164
3165 return ?
3166}
3167
3168@threadSafety("system")
3169cmd VkResult vkWaitForFences(
3170 VkDevice device,
3171 u32 fenceCount,
3172 const VkFence* pFences,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003173 VkBool32 waitAll,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003174 u64 timeout) { /// timeout in nanoseconds
3175 deviceObject := GetDevice(device)
3176
3177 fences := pFences[0:fenceCount]
3178 for i in (0 .. fenceCount) {
3179 fence := fences[i]
3180 fenceObject := GetFence(fence)
3181 assert(fenceObject.device == device)
3182 }
3183
3184 return ?
3185}
3186
3187
3188// Queue semaphore functions
3189
3190@threadSafety("system")
3191cmd VkResult vkCreateSemaphore(
3192 VkDevice device,
3193 const VkSemaphoreCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003194 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003195 VkSemaphore* pSemaphore) {
3196 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO)
3197 deviceObject := GetDevice(device)
3198
3199 semaphore := ?
3200 pSemaphore[0] = semaphore
3201 State.Semaphores[semaphore] = new!SemaphoreObject(device: device)
3202
3203 return ?
3204}
3205
3206@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003207cmd void vkDestroySemaphore(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003208 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003209 VkSemaphore semaphore,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003210 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003211 deviceObject := GetDevice(device)
3212 semaphoreObject := GetSemaphore(semaphore)
3213 assert(semaphoreObject.device == device)
3214
3215 State.Semaphores[semaphore] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003216}
3217
Jesse Halld27f6aa2015-08-15 17:58:48 -07003218
3219// Event functions
3220
3221@threadSafety("system")
3222cmd VkResult vkCreateEvent(
3223 VkDevice device,
3224 const VkEventCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003225 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003226 VkEvent* pEvent) {
3227 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_EVENT_CREATE_INFO)
3228 deviceObject := GetDevice(device)
3229
3230 event := ?
3231 pEvent[0] = event
3232 State.Events[event] = new!EventObject(device: device)
3233
3234 return ?
3235}
3236
3237@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003238cmd void vkDestroyEvent(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003239 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003240 VkEvent event,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003241 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003242 deviceObject := GetDevice(device)
3243 eventObject := GetEvent(event)
3244 assert(eventObject.device == device)
3245
3246 State.Events[event] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003247}
3248
3249@threadSafety("system")
3250cmd VkResult vkGetEventStatus(
3251 VkDevice device,
3252 VkEvent event) {
3253 deviceObject := GetDevice(device)
3254 eventObject := GetEvent(event)
3255 assert(eventObject.device == device)
3256
3257 return ?
3258}
3259
3260@threadSafety("system")
3261cmd VkResult vkSetEvent(
3262 VkDevice device,
3263 VkEvent event) {
3264 deviceObject := GetDevice(device)
3265 eventObject := GetEvent(event)
3266 assert(eventObject.device == device)
3267
3268 return ?
3269}
3270
3271@threadSafety("system")
3272cmd VkResult vkResetEvent(
3273 VkDevice device,
3274 VkEvent event) {
3275 deviceObject := GetDevice(device)
3276 eventObject := GetEvent(event)
3277 assert(eventObject.device == device)
3278
3279 return ?
3280}
3281
3282
3283// Query functions
3284
3285@threadSafety("system")
3286cmd VkResult vkCreateQueryPool(
3287 VkDevice device,
3288 const VkQueryPoolCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003289 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003290 VkQueryPool* pQueryPool) {
3291 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO)
3292 deviceObject := GetDevice(device)
3293
3294 queryPool := ?
3295 pQueryPool[0] = queryPool
3296 State.QueryPools[queryPool] = new!QueryPoolObject(device: device)
3297
3298 return ?
3299}
3300
3301@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003302cmd void vkDestroyQueryPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003303 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003304 VkQueryPool queryPool,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003305 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003306 deviceObject := GetDevice(device)
3307 queryPoolObject := GetQueryPool(queryPool)
3308 assert(queryPoolObject.device == device)
3309
3310 State.QueryPools[queryPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003311}
3312
3313@threadSafety("system")
3314cmd VkResult vkGetQueryPoolResults(
3315 VkDevice device,
3316 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08003317 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003318 u32 queryCount,
Jesse Halla9bb62b2015-11-21 19:31:56 -08003319 platform.size_t dataSize,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003320 void* pData,
Jesse Halla9bb62b2015-11-21 19:31:56 -08003321 VkDeviceSize stride,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003322 VkQueryResultFlags flags) {
3323 deviceObject := GetDevice(device)
3324 queryPoolObject := GetQueryPool(queryPool)
3325 assert(queryPoolObject.device == device)
3326
Jesse Halld27f6aa2015-08-15 17:58:48 -07003327 data := pData[0:dataSize]
3328
3329 return ?
3330}
3331
3332// Buffer functions
3333
3334@threadSafety("system")
3335cmd VkResult vkCreateBuffer(
3336 VkDevice device,
3337 const VkBufferCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003338 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003339 VkBuffer* pBuffer) {
3340 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO)
3341 deviceObject := GetDevice(device)
3342
3343 buffer := ?
3344 pBuffer[0] = buffer
3345 State.Buffers[buffer] = new!BufferObject(device: device)
3346
3347 return ?
3348}
3349
3350@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003351cmd void vkDestroyBuffer(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003352 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003353 VkBuffer buffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003354 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003355 deviceObject := GetDevice(device)
3356 bufferObject := GetBuffer(buffer)
3357 assert(bufferObject.device == device)
3358
Jesse Hall3fbc8562015-11-29 22:10:52 -08003359 assert(bufferObject.memory == 0)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003360 State.Buffers[buffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003361}
3362
3363
3364// Buffer view functions
3365
3366@threadSafety("system")
3367cmd VkResult vkCreateBufferView(
3368 VkDevice device,
3369 const VkBufferViewCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003370 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003371 VkBufferView* pView) {
3372 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO)
3373 deviceObject := GetDevice(device)
3374
3375 bufferObject := GetBuffer(pCreateInfo.buffer)
3376 assert(bufferObject.device == device)
3377
3378 view := ?
3379 pView[0] = view
3380 State.BufferViews[view] = new!BufferViewObject(device: device, buffer: pCreateInfo.buffer)
3381
3382 return ?
3383}
3384
3385@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003386cmd void vkDestroyBufferView(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003387 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003388 VkBufferView bufferView,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003389 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003390 deviceObject := GetDevice(device)
3391 bufferViewObject := GetBufferView(bufferView)
3392 assert(bufferViewObject.device == device)
3393
3394 State.BufferViews[bufferView] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003395}
3396
3397
3398// Image functions
3399
3400@threadSafety("system")
3401cmd VkResult vkCreateImage(
3402 VkDevice device,
3403 const VkImageCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003404 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003405 VkImage* pImage) {
3406 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO)
3407 deviceObject := GetDevice(device)
3408
3409 image := ?
3410 pImage[0] = image
3411 State.Images[image] = new!ImageObject(device: device)
3412
3413 return ?
3414}
3415
3416@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003417cmd void vkDestroyImage(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003418 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003419 VkImage image,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003420 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003421 deviceObject := GetDevice(device)
3422 imageObject := GetImage(image)
3423 assert(imageObject.device == device)
3424
Jesse Hall3fbc8562015-11-29 22:10:52 -08003425 assert(imageObject.memory == 0)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003426 State.Images[image] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003427}
3428
Jesse Hall606a54e2015-11-19 22:17:28 -08003429cmd void vkGetImageSubresourceLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003430 VkDevice device,
3431 VkImage image,
3432 const VkImageSubresource* pSubresource,
3433 VkSubresourceLayout* pLayout) {
3434 deviceObject := GetDevice(device)
3435 imageObject := GetImage(image)
3436 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003437}
3438
3439
3440// Image view functions
3441
3442@threadSafety("system")
3443cmd VkResult vkCreateImageView(
3444 VkDevice device,
3445 const VkImageViewCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003446 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003447 VkImageView* pView) {
3448 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO)
3449 deviceObject := GetDevice(device)
3450
3451 imageObject := GetImage(pCreateInfo.image)
3452 assert(imageObject.device == device)
3453
3454 view := ?
3455 pView[0] = view
3456 State.ImageViews[view] = new!ImageViewObject(device: device, image: pCreateInfo.image)
3457
3458 return ?
3459}
3460
3461@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003462cmd void vkDestroyImageView(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003463 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003464 VkImageView imageView,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003465 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003466 deviceObject := GetDevice(device)
3467 imageViewObject := GetImageView(imageView)
3468 assert(imageViewObject.device == device)
3469
3470 State.ImageViews[imageView] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003471}
3472
3473
3474// Shader functions
3475
3476cmd VkResult vkCreateShaderModule(
3477 VkDevice device,
3478 const VkShaderModuleCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003479 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003480 VkShaderModule* pShaderModule) {
3481 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO)
3482 deviceObject := GetDevice(device)
3483
3484 shaderModule := ?
3485 pShaderModule[0] = shaderModule
3486 State.ShaderModules[shaderModule] = new!ShaderModuleObject(device: device)
3487
3488 return ?
3489}
3490
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003491cmd void vkDestroyShaderModule(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003492 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003493 VkShaderModule shaderModule,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003494 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003495 deviceObject := GetDevice(device)
3496 shaderModuleObject := GetShaderModule(shaderModule)
3497 assert(shaderModuleObject.device == device)
3498
3499 State.ShaderModules[shaderModule] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003500}
3501
Jesse Halld27f6aa2015-08-15 17:58:48 -07003502
3503// Pipeline functions
3504
3505cmd VkResult vkCreatePipelineCache(
3506 VkDevice device,
3507 const VkPipelineCacheCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003508 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003509 VkPipelineCache* pPipelineCache) {
3510 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO)
3511 deviceObject := GetDevice(device)
3512
3513 pipelineCache := ?
3514 pPipelineCache[0] = pipelineCache
3515 State.PipelineCaches[pipelineCache] = new!PipelineCacheObject(device: device)
3516
3517 return ?
3518}
3519
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003520cmd void vkDestroyPipelineCache(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003521 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003522 VkPipelineCache pipelineCache,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003523 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003524 deviceObject := GetDevice(device)
3525 pipelineCacheObject := GetPipelineCache(pipelineCache)
3526 assert(pipelineCacheObject.device == device)
3527
3528 State.PipelineCaches[pipelineCache] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003529}
3530
Jesse Halld27f6aa2015-08-15 17:58:48 -07003531cmd VkResult vkGetPipelineCacheData(
3532 VkDevice device,
3533 VkPipelineCache pipelineCache,
Jesse Halla9bb62b2015-11-21 19:31:56 -08003534 platform.size_t* pDataSize,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003535 void* pData) {
3536 deviceObject := GetDevice(device)
3537 pipelineCacheObject := GetPipelineCache(pipelineCache)
3538 assert(pipelineCacheObject.device == device)
3539
3540 return ?
3541}
3542
3543cmd VkResult vkMergePipelineCaches(
3544 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003545 VkPipelineCache dstCache,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003546 u32 srcCacheCount,
3547 const VkPipelineCache* pSrcCaches) {
3548 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003549 dstCacheObject := GetPipelineCache(dstCache)
3550 assert(dstCacheObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003551
3552 srcCaches := pSrcCaches[0:srcCacheCount]
3553 for i in (0 .. srcCacheCount) {
3554 srcCache := srcCaches[i]
3555 srcCacheObject := GetPipelineCache(srcCache)
3556 assert(srcCacheObject.device == device)
3557 }
3558
3559 return ?
3560}
3561
3562cmd VkResult vkCreateGraphicsPipelines(
3563 VkDevice device,
3564 VkPipelineCache pipelineCache,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003565 u32 createInfoCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003566 const VkGraphicsPipelineCreateInfo* pCreateInfos,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003567 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003568 VkPipeline* pPipelines) {
3569 deviceObject := GetDevice(device)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003570 if pipelineCache != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003571 pipelineCacheObject := GetPipelineCache(pipelineCache)
3572 assert(pipelineCacheObject.device == device)
3573 }
3574
Jesse Hall03b6fe12015-11-24 12:44:21 -08003575 createInfos := pCreateInfos[0:createInfoCount]
3576 pipelines := pPipelines[0:createInfoCount]
3577 for i in (0 .. createInfoCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003578 pipeline := ?
3579 pipelines[i] = pipeline
3580 State.Pipelines[pipeline] = new!PipelineObject(device: device)
3581 }
3582
3583 return ?
3584}
3585
3586cmd VkResult vkCreateComputePipelines(
3587 VkDevice device,
3588 VkPipelineCache pipelineCache,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003589 u32 createInfoCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003590 const VkComputePipelineCreateInfo* pCreateInfos,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003591 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003592 VkPipeline* pPipelines) {
3593 deviceObject := GetDevice(device)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003594 if pipelineCache != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003595 pipelineCacheObject := GetPipelineCache(pipelineCache)
3596 assert(pipelineCacheObject.device == device)
3597 }
3598
Jesse Hall03b6fe12015-11-24 12:44:21 -08003599 createInfos := pCreateInfos[0:createInfoCount]
3600 pipelines := pPipelines[0:createInfoCount]
3601 for i in (0 .. createInfoCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003602 pipeline := ?
3603 pipelines[i] = pipeline
3604 State.Pipelines[pipeline] = new!PipelineObject(device: device)
3605 }
3606
3607 return ?
3608}
3609
3610@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003611cmd void vkDestroyPipeline(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003612 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003613 VkPipeline pipeline,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003614 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003615 deviceObject := GetDevice(device)
3616 pipelineObjects := GetPipeline(pipeline)
3617 assert(pipelineObjects.device == device)
3618
3619 State.Pipelines[pipeline] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003620}
3621
3622
3623// Pipeline layout functions
3624
3625@threadSafety("system")
3626cmd VkResult vkCreatePipelineLayout(
3627 VkDevice device,
3628 const VkPipelineLayoutCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003629 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003630 VkPipelineLayout* pPipelineLayout) {
3631 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO)
3632 deviceObject := GetDevice(device)
3633
3634 pipelineLayout := ?
3635 pPipelineLayout[0] = pipelineLayout
3636 State.PipelineLayouts[pipelineLayout] = new!PipelineLayoutObject(device: device)
3637
3638 return ?
3639}
3640
3641@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003642cmd void vkDestroyPipelineLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003643 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003644 VkPipelineLayout pipelineLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003645 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003646 deviceObject := GetDevice(device)
3647 pipelineLayoutObjects := GetPipelineLayout(pipelineLayout)
3648 assert(pipelineLayoutObjects.device == device)
3649
3650 State.PipelineLayouts[pipelineLayout] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003651}
3652
3653
3654// Sampler functions
3655
3656@threadSafety("system")
3657cmd VkResult vkCreateSampler(
3658 VkDevice device,
3659 const VkSamplerCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003660 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003661 VkSampler* pSampler) {
3662 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO)
3663 deviceObject := GetDevice(device)
3664
3665 sampler := ?
3666 pSampler[0] = sampler
3667 State.Samplers[sampler] = new!SamplerObject(device: device)
3668
3669 return ?
3670}
3671
3672@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003673cmd void vkDestroySampler(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003674 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003675 VkSampler sampler,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003676 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003677 deviceObject := GetDevice(device)
3678 samplerObject := GetSampler(sampler)
3679 assert(samplerObject.device == device)
3680
3681 State.Samplers[sampler] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003682}
3683
3684
3685// Descriptor set functions
3686
3687@threadSafety("system")
3688cmd VkResult vkCreateDescriptorSetLayout(
3689 VkDevice device,
3690 const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003691 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003692 VkDescriptorSetLayout* pSetLayout) {
3693 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO)
3694 deviceObject := GetDevice(device)
3695
3696 setLayout := ?
3697 pSetLayout[0] = setLayout
3698 State.DescriptorSetLayouts[setLayout] = new!DescriptorSetLayoutObject(device: device)
3699
3700 return ?
3701}
3702
3703@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003704cmd void vkDestroyDescriptorSetLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003705 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003706 VkDescriptorSetLayout descriptorSetLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003707 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003708 deviceObject := GetDevice(device)
3709 descriptorSetLayoutObject := GetDescriptorSetLayout(descriptorSetLayout)
3710 assert(descriptorSetLayoutObject.device == device)
3711
3712 State.DescriptorSetLayouts[descriptorSetLayout] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003713}
3714
3715@threadSafety("system")
3716cmd VkResult vkCreateDescriptorPool(
3717 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003718 const VkDescriptorPoolCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003719 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003720 VkDescriptorPool* pDescriptorPool) {
3721 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO)
3722 deviceObject := GetDevice(device)
3723
3724 descriptorPool := ?
3725 pDescriptorPool[0] = descriptorPool
3726 State.DescriptorPools[descriptorPool] = new!DescriptorPoolObject(device: device)
3727
3728 return ?
3729}
3730
3731@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003732cmd void vkDestroyDescriptorPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003733 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003734 VkDescriptorPool descriptorPool,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003735 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003736 deviceObject := GetDevice(device)
3737 descriptorPoolObject := GetDescriptorPool(descriptorPool)
3738 assert(descriptorPoolObject.device == device)
3739
3740 State.DescriptorPools[descriptorPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003741}
3742
3743@threadSafety("app")
3744cmd VkResult vkResetDescriptorPool(
3745 VkDevice device,
Jesse Hallfbf97b02015-11-20 14:17:03 -08003746 VkDescriptorPool descriptorPool,
3747 VkDescriptorPoolResetFlags flags) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003748 deviceObject := GetDevice(device)
3749 descriptorPoolObject := GetDescriptorPool(descriptorPool)
3750 assert(descriptorPoolObject.device == device)
3751
3752 return ?
3753}
3754
3755@threadSafety("app")
Jesse Hall3fbc8562015-11-29 22:10:52 -08003756cmd VkResult vkAllocateDescriptorSets(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003757 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003758 const VkDescriptorSetAllocateInfo* pAllocateInfo,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003759 VkDescriptorSet* pDescriptorSets) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003760 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003761 allocInfo := pAllocateInfo[0]
Jesse Hallfbf97b02015-11-20 14:17:03 -08003762 descriptorPoolObject := GetDescriptorPool(allocInfo.descriptorPool)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003763
Jesse Hall03b6fe12015-11-24 12:44:21 -08003764 setLayouts := allocInfo.pSetLayouts[0:allocInfo.setCount]
3765 for i in (0 .. allocInfo.setCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003766 setLayout := setLayouts[i]
3767 setLayoutObject := GetDescriptorSetLayout(setLayout)
3768 assert(setLayoutObject.device == device)
3769 }
3770
Jesse Hall03b6fe12015-11-24 12:44:21 -08003771 descriptorSets := pDescriptorSets[0:allocInfo.setCount]
3772 for i in (0 .. allocInfo.setCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003773 descriptorSet := ?
3774 descriptorSets[i] = descriptorSet
3775 State.DescriptorSets[descriptorSet] = new!DescriptorSetObject(device: device)
3776 }
3777
3778 return ?
3779}
3780
Jesse Hallf09c6b12015-08-15 19:54:28 -07003781cmd VkResult vkFreeDescriptorSets(
3782 VkDevice device,
3783 VkDescriptorPool descriptorPool,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003784 u32 descriptorSetCount,
Jesse Hallf09c6b12015-08-15 19:54:28 -07003785 const VkDescriptorSet* pDescriptorSets) {
3786 deviceObject := GetDevice(device)
3787 descriptorPoolObject := GetDescriptorPool(descriptorPool)
3788
Jesse Hall03b6fe12015-11-24 12:44:21 -08003789 descriptorSets := pDescriptorSets[0:descriptorSetCount]
3790 for i in (0 .. descriptorSetCount) {
Jesse Hallf09c6b12015-08-15 19:54:28 -07003791 descriptorSet := descriptorSets[i]
3792 descriptorSetObject := GetDescriptorSet(descriptorSet)
3793 assert(descriptorSetObject.device == device)
3794 State.DescriptorSets[descriptorSet] = null
3795 }
3796
3797 return ?
3798}
3799
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003800cmd void vkUpdateDescriptorSets(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003801 VkDevice device,
Jesse Hallb00daad2015-11-29 19:46:20 -08003802 u32 descriptorWriteCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003803 const VkWriteDescriptorSet* pDescriptorWrites,
Jesse Hallb00daad2015-11-29 19:46:20 -08003804 u32 descriptorCopyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003805 const VkCopyDescriptorSet* pDescriptorCopies) {
3806 deviceObject := GetDevice(device)
3807
Jesse Hallb00daad2015-11-29 19:46:20 -08003808 descriptorWrites := pDescriptorWrites[0:descriptorWriteCount]
3809 for i in (0 .. descriptorWriteCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003810 descriptorWrite := descriptorWrites[i]
Jesse Hall3fbc8562015-11-29 22:10:52 -08003811 descriptorWriteObject := GetDescriptorSet(descriptorWrite.dstSet)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003812 assert(descriptorWriteObject.device == device)
3813 }
3814
Jesse Hallb00daad2015-11-29 19:46:20 -08003815 descriptorCopies := pDescriptorCopies[0:descriptorCopyCount]
3816 for i in (0 .. descriptorCopyCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003817 descriptorCopy := descriptorCopies[i]
Jesse Hall3fbc8562015-11-29 22:10:52 -08003818 descriptorCopyObject := GetDescriptorSet(descriptorCopy.dstSet)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003819 assert(descriptorCopyObject.device == device)
3820 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07003821}
3822
3823
3824// Framebuffer functions
3825
3826@threadSafety("system")
3827cmd VkResult vkCreateFramebuffer(
3828 VkDevice device,
3829 const VkFramebufferCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003830 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003831 VkFramebuffer* pFramebuffer) {
3832 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO)
3833 deviceObject := GetDevice(device)
3834
3835 framebuffer := ?
3836 pFramebuffer[0] = framebuffer
3837 State.Framebuffers[framebuffer] = new!FramebufferObject(device: device)
3838
3839 return ?
3840}
3841
3842@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003843cmd void vkDestroyFramebuffer(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003844 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003845 VkFramebuffer framebuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003846 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003847 deviceObject := GetDevice(device)
3848 framebufferObject := GetFramebuffer(framebuffer)
3849 assert(framebufferObject.device == device)
3850
3851 State.Framebuffers[framebuffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003852}
3853
3854
3855// Renderpass functions
3856
3857@threadSafety("system")
3858cmd VkResult vkCreateRenderPass(
3859 VkDevice device,
3860 const VkRenderPassCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003861 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003862 VkRenderPass* pRenderPass) {
3863 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO)
3864 deviceObject := GetDevice(device)
3865
3866 renderpass := ?
3867 pRenderPass[0] = renderpass
3868 State.RenderPasses[renderpass] = new!RenderPassObject(device: device)
3869
3870 return ?
3871}
3872
3873@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003874cmd void vkDestroyRenderPass(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003875 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003876 VkRenderPass renderPass,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003877 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003878 deviceObject := GetDevice(device)
3879 renderPassObject := GetRenderPass(renderPass)
3880 assert(renderPassObject.device == device)
3881
3882 State.RenderPasses[renderPass] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003883}
3884
Jesse Hall606a54e2015-11-19 22:17:28 -08003885cmd void vkGetRenderAreaGranularity(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003886 VkDevice device,
3887 VkRenderPass renderPass,
3888 VkExtent2D* pGranularity) {
3889 deviceObject := GetDevice(device)
3890 renderPassObject := GetRenderPass(renderPass)
3891
3892 granularity := ?
3893 pGranularity[0] = granularity
Jesse Halld27f6aa2015-08-15 17:58:48 -07003894}
3895
3896// Command pool functions
3897
3898cmd VkResult vkCreateCommandPool(
3899 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003900 const VkCommandPoolCreateInfo* pCreateInfo,
3901 const VkAllocationCallbacks* pAllocator,
3902 VkCommandPool* pCommandPool) {
3903 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003904 deviceObject := GetDevice(device)
3905
Jesse Hall3fbc8562015-11-29 22:10:52 -08003906 commandPool := ?
3907 pCommandPool[0] = commandPool
3908 State.CommandPools[commandPool] = new!CommandPoolObject(device: device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003909
3910 return ?
3911}
3912
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003913cmd void vkDestroyCommandPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003914 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003915 VkCommandPool commandPool,
3916 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003917 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003918 commandPoolObject := GetCommandPool(commandPool)
3919 assert(commandPoolObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003920
Jesse Hall3fbc8562015-11-29 22:10:52 -08003921 State.CommandPools[commandPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003922}
3923
3924cmd VkResult vkResetCommandPool(
3925 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003926 VkCommandPool commandPool,
3927 VkCommandPoolResetFlags flags) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003928 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003929 commandPoolObject := GetCommandPool(commandPool)
3930 assert(commandPoolObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003931
3932 return ?
3933}
3934
3935// Command buffer functions
3936
Jesse Hall3fbc8562015-11-29 22:10:52 -08003937macro void bindCommandBuffer(VkCommandBuffer commandBuffer, any obj, VkDeviceMemory memory) {
3938 memoryObject := GetDeviceMemory(memory)
3939 memoryObject.boundCommandBuffers[commandBuffer] = commandBuffer
Jesse Halld27f6aa2015-08-15 17:58:48 -07003940
Jesse Hall3fbc8562015-11-29 22:10:52 -08003941 commandBufferObject := GetCommandBuffer(commandBuffer)
3942 commandBufferObject.boundObjects[as!u64(obj)] = memory
Jesse Halld27f6aa2015-08-15 17:58:48 -07003943}
3944
Jesse Hall3fbc8562015-11-29 22:10:52 -08003945macro void unbindCommandBuffer(VkCommandBuffer commandBuffer, any obj, VkDeviceMemory memory) {
3946 memoryObject := GetDeviceMemory(memory)
3947 memoryObject.boundCommandBuffers[commandBuffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003948
Jesse Hall3fbc8562015-11-29 22:10:52 -08003949 commandBufferObject := GetCommandBuffer(commandBuffer)
3950 commandBufferObject.boundObjects[as!u64(obj)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003951}
3952
3953@threadSafety("system")
Jesse Hall3fbc8562015-11-29 22:10:52 -08003954cmd VkResult vkAllocateCommandBuffers(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003955 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003956 const VkCommandBufferAllocateInfo* pAllocateInfo,
3957 VkCommandBuffer* pCommandBuffers) {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08003958 assert(pAllocateInfo[0].sType == VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003959
Jesse Hall3fbc8562015-11-29 22:10:52 -08003960 count := pAllocateInfo[0].bufferCount
3961 commandBuffers := pCommandBuffers[0:count]
Jesse Hallfbf97b02015-11-20 14:17:03 -08003962 for i in (0 .. count) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08003963 commandBuffer := ?
3964 commandBuffers[i] = commandBuffer
3965 State.CommandBuffers[commandBuffer] = new!CommandBufferObject(device: device)
Jesse Hallfbf97b02015-11-20 14:17:03 -08003966 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07003967
3968 return ?
3969}
3970
3971@threadSafety("system")
Jesse Hallfbf97b02015-11-20 14:17:03 -08003972cmd void vkFreeCommandBuffers(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003973 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003974 VkCommandPool commandPool,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003975 u32 commandBufferCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003976 const VkCommandBuffer* pCommandBuffers) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003977 deviceObject := GetDevice(device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003978
Jesse Hall3fbc8562015-11-29 22:10:52 -08003979 commandBuffers := pCommandBuffers[0:commandBufferCount]
Jesse Hall03b6fe12015-11-24 12:44:21 -08003980 for i in (0 .. commandBufferCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08003981 commandBufferObject := GetCommandBuffer(commandBuffers[i])
3982 assert(commandBufferObject.device == device)
Jesse Hallfbf97b02015-11-20 14:17:03 -08003983 // TODO: iterate over boundObjects and clear memory bindings
Jesse Hall3fbc8562015-11-29 22:10:52 -08003984 State.CommandBuffers[commandBuffers[i]] = null
Jesse Hallfbf97b02015-11-20 14:17:03 -08003985 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07003986}
3987
3988@threadSafety("app")
3989cmd VkResult vkBeginCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08003990 VkCommandBuffer commandBuffer,
3991 const VkCommandBufferBeginInfo* pBeginInfo) {
3992 assert(pBeginInfo.sType == VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO)
3993 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003994
3995 // TODO: iterate over boundObjects and clear memory bindings
3996
3997 return ?
3998}
3999
4000@threadSafety("app")
4001cmd VkResult vkEndCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004002 VkCommandBuffer commandBuffer) {
4003 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004004
4005 return ?
4006}
4007
4008@threadSafety("app")
4009cmd VkResult vkResetCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004010 VkCommandBuffer commandBuffer,
4011 VkCommandBufferResetFlags flags) {
4012 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004013
4014 // TODO: iterate over boundObjects and clear memory bindings
4015
4016 return ?
4017}
4018
4019
4020// Command buffer building functions
4021
4022@threadSafety("app")
4023cmd void vkCmdBindPipeline(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004024 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004025 VkPipelineBindPoint pipelineBindPoint,
4026 VkPipeline pipeline) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004027 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004028 pipelineObject := GetPipeline(pipeline)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004029 assert(commandBufferObject.device == pipelineObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004030
Jesse Halld8bade02015-11-24 10:24:18 -08004031 queue := switch (pipelineBindPoint) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004032 case VK_PIPELINE_BIND_POINT_COMPUTE: VK_QUEUE_COMPUTE_BIT
4033 case VK_PIPELINE_BIND_POINT_GRAPHICS: VK_QUEUE_GRAPHICS_BIT
4034 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08004035 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004036}
4037
4038@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004039cmd void vkCmdSetViewport(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004040 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004041 u32 firstViewport,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004042 u32 viewportCount,
4043 const VkViewport* pViewports) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004044 commandBufferObject := GetCommandBuffer(commandBuffer)
4045 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004046}
4047
4048@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004049cmd void vkCmdSetScissor(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004050 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004051 u32 firstScissor,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004052 u32 scissorCount,
4053 const VkRect2D* pScissors) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004054 commandBufferObject := GetCommandBuffer(commandBuffer)
4055 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004056}
4057
4058@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004059cmd void vkCmdSetLineWidth(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004060 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004061 f32 lineWidth) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004062 commandBufferObject := GetCommandBuffer(commandBuffer)
4063 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004064}
4065
4066@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004067cmd void vkCmdSetDepthBias(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004068 VkCommandBuffer commandBuffer,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004069 f32 depthBiasConstantFactor,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004070 f32 depthBiasClamp,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004071 f32 depthBiasSlopeFactor) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004072 commandBufferObject := GetCommandBuffer(commandBuffer)
4073 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004074}
Jesse Halld27f6aa2015-08-15 17:58:48 -07004075
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004076@threadSafety("app")
4077cmd void vkCmdSetBlendConstants(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004078 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004079 // TODO(jessehall): apic only supports 'const' on pointer types. Using
4080 // an annotation as a quick hack to pass this to the template without
4081 // having to modify the AST and semantic model.
Jesse Hallb00daad2015-11-29 19:46:20 -08004082 @readonly f32[4] blendConstants) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004083 commandBufferObject := GetCommandBuffer(commandBuffer)
4084 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004085}
4086
4087@threadSafety("app")
4088cmd void vkCmdSetDepthBounds(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004089 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004090 f32 minDepthBounds,
4091 f32 maxDepthBounds) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004092 commandBufferObject := GetCommandBuffer(commandBuffer)
4093 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004094}
4095
4096@threadSafety("app")
4097cmd void vkCmdSetStencilCompareMask(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004098 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004099 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08004100 u32 compareMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004101 commandBufferObject := GetCommandBuffer(commandBuffer)
4102 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004103}
4104
4105@threadSafety("app")
4106cmd void vkCmdSetStencilWriteMask(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004107 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004108 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08004109 u32 writeMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004110 commandBufferObject := GetCommandBuffer(commandBuffer)
4111 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004112}
4113
4114@threadSafety("app")
4115cmd void vkCmdSetStencilReference(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004116 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004117 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08004118 u32 reference) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004119 commandBufferObject := GetCommandBuffer(commandBuffer)
4120 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004121}
4122
4123@threadSafety("app")
4124cmd void vkCmdBindDescriptorSets(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004125 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004126 VkPipelineBindPoint pipelineBindPoint,
4127 VkPipelineLayout layout,
4128 u32 firstSet,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004129 u32 descriptorSetCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004130 const VkDescriptorSet* pDescriptorSets,
4131 u32 dynamicOffsetCount,
4132 const u32* pDynamicOffsets) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004133 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004134
Jesse Hall03b6fe12015-11-24 12:44:21 -08004135 descriptorSets := pDescriptorSets[0:descriptorSetCount]
4136 for i in (0 .. descriptorSetCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004137 descriptorSet := descriptorSets[i]
4138 descriptorSetObject := GetDescriptorSet(descriptorSet)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004139 assert(commandBufferObject.device == descriptorSetObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004140 }
4141
4142 dynamicOffsets := pDynamicOffsets[0:dynamicOffsetCount]
4143 for i in (0 .. dynamicOffsetCount) {
4144 dynamicOffset := dynamicOffsets[i]
4145 }
4146
Jesse Halld8bade02015-11-24 10:24:18 -08004147 queue := switch (pipelineBindPoint) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004148 case VK_PIPELINE_BIND_POINT_COMPUTE: VK_QUEUE_COMPUTE_BIT
4149 case VK_PIPELINE_BIND_POINT_GRAPHICS: VK_QUEUE_GRAPHICS_BIT
4150 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08004151 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004152}
4153
4154@threadSafety("app")
4155cmd void vkCmdBindIndexBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004156 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004157 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004158 VkDeviceSize offset,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004159 VkIndexType indexType) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004160 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004161 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004162 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004163
Jesse Hall3fbc8562015-11-29 22:10:52 -08004164 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004165
Jesse Hall3fbc8562015-11-29 22:10:52 -08004166 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004167}
4168
4169@threadSafety("app")
4170cmd void vkCmdBindVertexBuffers(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004171 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004172 u32 firstBinding,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004173 u32 bindingCount,
4174 const VkBuffer* pBuffers,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004175 const VkDeviceSize* pOffsets) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004176 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004177
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004178 // TODO: check if not [firstBinding:firstBinding+bindingCount]
Jesse Halld27f6aa2015-08-15 17:58:48 -07004179 buffers := pBuffers[0:bindingCount]
4180 offsets := pOffsets[0:bindingCount]
4181 for i in (0 .. bindingCount) {
4182 buffer := buffers[i]
4183 offset := offsets[i]
4184 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004185 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004186
Jesse Hall3fbc8562015-11-29 22:10:52 -08004187 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004188 }
4189
Jesse Hall3fbc8562015-11-29 22:10:52 -08004190 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004191}
4192
4193@threadSafety("app")
4194cmd void vkCmdDraw(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004195 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004196 u32 vertexCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004197 u32 instanceCount,
4198 u32 firstVertex,
4199 u32 firstInstance) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004200 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004201
Jesse Hall3fbc8562015-11-29 22:10:52 -08004202 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004203}
4204
4205@threadSafety("app")
4206cmd void vkCmdDrawIndexed(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004207 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004208 u32 indexCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004209 u32 instanceCount,
4210 u32 firstIndex,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004211 s32 vertexOffset,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004212 u32 firstInstance) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004213 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004214
Jesse Hall3fbc8562015-11-29 22:10:52 -08004215 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004216}
4217
4218@threadSafety("app")
4219cmd void vkCmdDrawIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004220 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004221 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004222 VkDeviceSize offset,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004223 u32 drawCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004224 u32 stride) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004225 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004226 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004227 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004228
Jesse Hall3fbc8562015-11-29 22:10:52 -08004229 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004230
Jesse Hall3fbc8562015-11-29 22:10:52 -08004231 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004232}
4233
4234@threadSafety("app")
4235cmd void vkCmdDrawIndexedIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004236 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004237 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004238 VkDeviceSize offset,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004239 u32 drawCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004240 u32 stride) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004241 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004242 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004243 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004244
Jesse Hall3fbc8562015-11-29 22:10:52 -08004245 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004246
Jesse Hall3fbc8562015-11-29 22:10:52 -08004247 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004248}
4249
4250@threadSafety("app")
4251cmd void vkCmdDispatch(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004252 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004253 u32 x,
4254 u32 y,
4255 u32 z) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004256 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004257
Jesse Hall3fbc8562015-11-29 22:10:52 -08004258 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_COMPUTE_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004259}
4260
4261@threadSafety("app")
4262cmd void vkCmdDispatchIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004263 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004264 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004265 VkDeviceSize offset) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004266 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004267 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004268 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004269
Jesse Hall3fbc8562015-11-29 22:10:52 -08004270 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004271
Jesse Hall3fbc8562015-11-29 22:10:52 -08004272 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_COMPUTE_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004273}
4274
4275@threadSafety("app")
4276cmd void vkCmdCopyBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004277 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004278 VkBuffer srcBuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004279 VkBuffer dstBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004280 u32 regionCount,
4281 const VkBufferCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004282 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004283 srcBufferObject := GetBuffer(srcBuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004284 dstBufferObject := GetBuffer(dstBuffer)
4285 assert(commandBufferObject.device == srcBufferObject.device)
4286 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004287
4288 regions := pRegions[0:regionCount]
4289 for i in (0 .. regionCount) {
4290 region := regions[i]
4291 }
4292
Jesse Hall3fbc8562015-11-29 22:10:52 -08004293 bindCommandBuffer(commandBuffer, srcBuffer, srcBufferObject.memory)
4294 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004295
Jesse Hall65ab5522015-11-30 00:07:16 -08004296 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004297}
4298
4299@threadSafety("app")
4300cmd void vkCmdCopyImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004301 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004302 VkImage srcImage,
4303 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004304 VkImage dstImage,
4305 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004306 u32 regionCount,
4307 const VkImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004308 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004309 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004310 dstImageObject := GetImage(dstImage)
4311 assert(commandBufferObject.device == srcImageObject.device)
4312 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004313
4314 regions := pRegions[0:regionCount]
4315 for i in (0 .. regionCount) {
4316 region := regions[i]
4317 }
4318
Jesse Hall3fbc8562015-11-29 22:10:52 -08004319 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
4320 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004321
Jesse Hall65ab5522015-11-30 00:07:16 -08004322 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004323}
4324
4325@threadSafety("app")
4326cmd void vkCmdBlitImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004327 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004328 VkImage srcImage,
4329 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004330 VkImage dstImage,
4331 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004332 u32 regionCount,
4333 const VkImageBlit* pRegions,
Jesse Hall23ff73f2015-11-29 14:36:39 -08004334 VkFilter filter) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004335 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004336 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004337 dstImageObject := GetImage(dstImage)
4338 assert(commandBufferObject.device == srcImageObject.device)
4339 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004340
4341 regions := pRegions[0:regionCount]
4342 for i in (0 .. regionCount) {
4343 region := regions[i]
4344 }
4345
Jesse Hall3fbc8562015-11-29 22:10:52 -08004346 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
4347 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004348
Jesse Hall3fbc8562015-11-29 22:10:52 -08004349 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004350}
4351
4352@threadSafety("app")
4353cmd void vkCmdCopyBufferToImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004354 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004355 VkBuffer srcBuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004356 VkImage dstImage,
4357 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004358 u32 regionCount,
4359 const VkBufferImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004360 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004361 srcBufferObject := GetBuffer(srcBuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004362 dstImageObject := GetImage(dstImage)
4363 assert(commandBufferObject.device == srcBufferObject.device)
4364 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004365
4366 regions := pRegions[0:regionCount]
4367 for i in (0 .. regionCount) {
4368 region := regions[i]
4369 }
4370
Jesse Hall3fbc8562015-11-29 22:10:52 -08004371 bindCommandBuffer(commandBuffer, srcBuffer, srcBufferObject.memory)
4372 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004373
Jesse Hall65ab5522015-11-30 00:07:16 -08004374 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004375}
4376
4377@threadSafety("app")
4378cmd void vkCmdCopyImageToBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004379 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004380 VkImage srcImage,
4381 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004382 VkBuffer dstBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004383 u32 regionCount,
4384 const VkBufferImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004385 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004386 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004387 dstBufferObject := GetBuffer(dstBuffer)
4388 assert(commandBufferObject.device == srcImageObject.device)
4389 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004390
4391 regions := pRegions[0:regionCount]
4392 for i in (0 .. regionCount) {
4393 region := regions[i]
4394 }
4395
Jesse Hall3fbc8562015-11-29 22:10:52 -08004396 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
4397 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004398
Jesse Hall65ab5522015-11-30 00:07:16 -08004399 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004400}
4401
4402@threadSafety("app")
4403cmd void vkCmdUpdateBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004404 VkCommandBuffer commandBuffer,
4405 VkBuffer dstBuffer,
4406 VkDeviceSize dstOffset,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004407 VkDeviceSize dataSize,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004408 const u32* pData) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004409 commandBufferObject := GetCommandBuffer(commandBuffer)
4410 dstBufferObject := GetBuffer(dstBuffer)
4411 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004412
4413 data := pData[0:dataSize]
4414
Jesse Hall3fbc8562015-11-29 22:10:52 -08004415 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004416
Jesse Hall65ab5522015-11-30 00:07:16 -08004417 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004418}
4419
4420@threadSafety("app")
4421cmd void vkCmdFillBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004422 VkCommandBuffer commandBuffer,
4423 VkBuffer dstBuffer,
4424 VkDeviceSize dstOffset,
Jesse Hallb00daad2015-11-29 19:46:20 -08004425 VkDeviceSize size,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004426 u32 data) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004427 commandBufferObject := GetCommandBuffer(commandBuffer)
4428 dstBufferObject := GetBuffer(dstBuffer)
4429 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004430
Jesse Hall65ab5522015-11-30 00:07:16 -08004431 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004432}
4433
4434@threadSafety("app")
4435cmd void vkCmdClearColorImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004436 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004437 VkImage image,
4438 VkImageLayout imageLayout,
4439 const VkClearColorValue* pColor,
4440 u32 rangeCount,
4441 const VkImageSubresourceRange* pRanges) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004442 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004443 imageObject := GetImage(image)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004444 assert(commandBufferObject.device == imageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004445
4446 ranges := pRanges[0:rangeCount]
4447 for i in (0 .. rangeCount) {
4448 range := ranges[i]
4449 }
4450
Jesse Hall3fbc8562015-11-29 22:10:52 -08004451 bindCommandBuffer(commandBuffer, image, imageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004452
Jesse Hall3fbc8562015-11-29 22:10:52 -08004453 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004454}
4455
4456@threadSafety("app")
4457cmd void vkCmdClearDepthStencilImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004458 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004459 VkImage image,
4460 VkImageLayout imageLayout,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004461 const VkClearDepthStencilValue* pDepthStencil,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004462 u32 rangeCount,
4463 const VkImageSubresourceRange* pRanges) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004464 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004465 imageObject := GetImage(image)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004466 assert(commandBufferObject.device == imageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004467
4468 ranges := pRanges[0:rangeCount]
4469 for i in (0 .. rangeCount) {
4470 range := ranges[i]
4471 }
4472
Jesse Hall3fbc8562015-11-29 22:10:52 -08004473 bindCommandBuffer(commandBuffer, image, imageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004474
Jesse Hall3fbc8562015-11-29 22:10:52 -08004475 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004476}
4477
4478@threadSafety("app")
Jesse Hallae38f732015-11-19 21:32:50 -08004479cmd void vkCmdClearAttachments(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004480 VkCommandBuffer commandBuffer,
Jesse Hallae38f732015-11-19 21:32:50 -08004481 u32 attachmentCount,
4482 const VkClearAttachment* pAttachments,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004483 u32 rectCount,
Jesse Halla15a4bf2015-11-19 22:48:02 -08004484 const VkClearRect* pRects) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004485 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004486
4487 rects := pRects[0:rectCount]
4488 for i in (0 .. rectCount) {
4489 rect := rects[i]
4490 }
4491
Jesse Hall3fbc8562015-11-29 22:10:52 -08004492 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004493}
4494
4495@threadSafety("app")
4496cmd void vkCmdResolveImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004497 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004498 VkImage srcImage,
4499 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004500 VkImage dstImage,
4501 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004502 u32 regionCount,
4503 const VkImageResolve* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004504 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004505 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004506 dstImageObject := GetImage(dstImage)
4507 assert(commandBufferObject.device == srcImageObject.device)
4508 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004509
4510 regions := pRegions[0:regionCount]
4511 for i in (0 .. regionCount) {
4512 region := regions[i]
4513 }
4514
Jesse Hall3fbc8562015-11-29 22:10:52 -08004515 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
4516 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004517
Jesse Hall3fbc8562015-11-29 22:10:52 -08004518 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004519}
4520
4521@threadSafety("app")
4522cmd void vkCmdSetEvent(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004523 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004524 VkEvent event,
4525 VkPipelineStageFlags stageMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004526 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004527 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004528 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004529}
4530
4531@threadSafety("app")
4532cmd void vkCmdResetEvent(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004533 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004534 VkEvent event,
4535 VkPipelineStageFlags stageMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004536 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004537 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004538 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004539}
4540
4541@threadSafety("app")
4542cmd void vkCmdWaitEvents(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004543 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004544 u32 eventCount,
4545 const VkEvent* pEvents,
4546 VkPipelineStageFlags srcStageMask,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004547 VkPipelineStageFlags dstStageMask,
4548 u32 memoryBarrierCount,
4549 const void* const* ppMemoryBarriers) {
4550 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004551
4552 events := pEvents[0:eventCount]
4553 for i in (0 .. eventCount) {
4554 event := events[i]
4555 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004556 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004557 }
4558
Jesse Hall3fbc8562015-11-29 22:10:52 -08004559 pMemoryBarriers := ppMemoryBarriers[0:memoryBarrierCount]
4560 for i in (0 .. memoryBarrierCount) {
4561 switch as!VkMemoryBarrier const*(pMemoryBarriers[i])[0].sType {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004562 case VK_STRUCTURE_TYPE_MEMORY_BARRIER: {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004563 memoryBarrier := as!VkMemoryBarrier const*(pMemoryBarriers[i])[0]
Jesse Halld27f6aa2015-08-15 17:58:48 -07004564 }
4565 case VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER: {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004566 imageMemoryBarrier := as!VkImageMemoryBarrier const*(pMemoryBarriers[i])[0]
4567 imageObject := GetImage(imageMemoryBarrier.image)
4568 assert(imageObject.device == commandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004569 }
4570 case VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER: {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004571 bufferMemoryBarrier := as!VkBufferMemoryBarrier const*(pMemoryBarriers[i])[0]
4572 bufferObject := GetBuffer(bufferMemoryBarrier.buffer)
4573 assert(bufferObject.device == commandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004574 }
4575 }
4576 }
4577}
4578
4579@threadSafety("app")
4580cmd void vkCmdPipelineBarrier(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004581 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004582 VkPipelineStageFlags srcStageMask,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004583 VkPipelineStageFlags dstStageMask,
Jesse Halldc6d36c2015-11-29 19:12:15 -08004584 VkDependencyFlags dependencyFlags,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004585 u32 memoryBarrierCount,
4586 const void* const* ppMemoryBarriers) {
4587 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004588
Jesse Hall3fbc8562015-11-29 22:10:52 -08004589 pMemoryBarriers := ppMemoryBarriers[0:memoryBarrierCount]
4590 for i in (0 .. memoryBarrierCount) {
4591 switch as!VkMemoryBarrier const*(pMemoryBarriers[i])[0].sType {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004592 case VK_STRUCTURE_TYPE_MEMORY_BARRIER: {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004593 memoryBarrier := as!VkMemoryBarrier const*(pMemoryBarriers[i])[0]
Jesse Halld27f6aa2015-08-15 17:58:48 -07004594 }
4595 case VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER: {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004596 imageMemoryBarrier := as!VkImageMemoryBarrier const*(pMemoryBarriers[i])[0]
4597 imageObject := GetImage(imageMemoryBarrier.image)
4598 assert(imageObject.device == commandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004599 }
4600 case VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER: {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004601 bufferMemoryBarrier := as!VkBufferMemoryBarrier const*(pMemoryBarriers[i])[0]
4602 bufferObject := GetBuffer(bufferMemoryBarrier.buffer)
4603 assert(bufferObject.device == commandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004604 }
4605 }
4606 }
4607}
4608
4609@threadSafety("app")
4610cmd void vkCmdBeginQuery(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004611 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004612 VkQueryPool queryPool,
Jesse Hall65ab5522015-11-30 00:07:16 -08004613 u32 entry,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004614 VkQueryControlFlags flags) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004615 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004616 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004617 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004618}
4619
4620@threadSafety("app")
4621cmd void vkCmdEndQuery(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004622 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004623 VkQueryPool queryPool,
Jesse Hall65ab5522015-11-30 00:07:16 -08004624 u32 entry) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004625 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004626 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004627 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004628}
4629
4630@threadSafety("app")
4631cmd void vkCmdResetQueryPool(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004632 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004633 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004634 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004635 u32 queryCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004636 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004637 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004638 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004639}
4640
4641@threadSafety("app")
4642cmd void vkCmdWriteTimestamp(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004643 VkCommandBuffer commandBuffer,
Jesse Hall6f39a6d2015-11-24 11:08:36 -08004644 VkPipelineStageFlagBits pipelineStage,
Jesse Halla3a7a1d2015-11-24 11:37:23 -08004645 VkQueryPool queryPool,
Jesse Hall65ab5522015-11-30 00:07:16 -08004646 u32 entry) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004647 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halla3a7a1d2015-11-24 11:37:23 -08004648 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004649 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004650}
4651
4652@threadSafety("app")
4653cmd void vkCmdCopyQueryPoolResults(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004654 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004655 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004656 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004657 u32 queryCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004658 VkBuffer dstBuffer,
4659 VkDeviceSize dstOffset,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004660 VkDeviceSize stride,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004661 VkQueryResultFlags flags) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004662 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004663 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004664 dstBufferObject := GetBuffer(dstBuffer)
4665 assert(commandBufferObject.device == queryPoolObject.device)
4666 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004667}
4668
4669cmd void vkCmdPushConstants(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004670 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004671 VkPipelineLayout layout,
4672 VkShaderStageFlags stageFlags,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004673 u32 offset,
4674 u32 size,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08004675 const void* pValues) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004676 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004677 layoutObject := GetPipelineLayout(layout)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004678 assert(commandBufferObject.device == layoutObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004679}
4680
4681@threadSafety("app")
4682cmd void vkCmdBeginRenderPass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004683 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004684 const VkRenderPassBeginInfo* pRenderPassBegin,
Jesse Hall65ab5522015-11-30 00:07:16 -08004685 VkSubpassContents contents) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004686 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004687 renderPassObject := GetRenderPass(pRenderPassBegin.renderPass)
4688 framebufferObject := GetFramebuffer(pRenderPassBegin.framebuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004689 assert(commandBufferObject.device == renderPassObject.device)
4690 assert(commandBufferObject.device == framebufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004691
Jesse Hall3fbc8562015-11-29 22:10:52 -08004692 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004693}
4694
4695cmd void vkCmdNextSubpass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004696 VkCommandBuffer commandBuffer,
Jesse Hall65ab5522015-11-30 00:07:16 -08004697 VkSubpassContents contents) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004698 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004699}
4700
4701@threadSafety("app")
4702cmd void vkCmdEndRenderPass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004703 VkCommandBuffer commandBuffer) {
4704 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004705
Jesse Hall3fbc8562015-11-29 22:10:52 -08004706 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004707}
4708
4709cmd void vkCmdExecuteCommands(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004710 VkCommandBuffer commandBuffer,
4711 u32 commandBuffersCount,
4712 const VkCommandBuffer* pCommandBuffers) {
4713 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004714
Jesse Hall3fbc8562015-11-29 22:10:52 -08004715 commandBuffers := pCommandBuffers[0:commandBuffersCount]
4716 for i in (0 .. commandBuffersCount) {
4717 secondaryCommandBuffer := commandBuffers[i]
4718 secondaryCommandBufferObject := GetCommandBuffer(secondaryCommandBuffer)
4719 assert(commandBufferObject.device == secondaryCommandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004720 }
4721}
4722
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004723@extension("VK_KHR_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08004724cmd void vkDestroySurfaceKHR(
4725 VkInstance instance,
Jesse Hall0e74f002015-11-30 11:37:59 -08004726 VkSurfaceKHR surface,
4727 const VkAllocationCallbacks* pAllocator) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08004728 instanceObject := GetInstance(instance)
4729 surfaceObject := GetSurface(surface)
4730 assert(surfaceObject.instance == instance)
Michael Lentine88594d72015-11-12 12:49:45 -08004731
Jesse Hall1356b0d2015-11-23 17:24:58 -08004732 State.Surfaces[surface] = null
Jesse Hall2818f932015-11-19 21:19:17 -08004733}
4734
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004735@extension("VK_KHR_surface")
Jesse Halla6429252015-11-29 18:59:42 -08004736cmd VkResult vkGetPhysicalDeviceSurfaceSupportKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08004737 VkPhysicalDevice physicalDevice,
4738 u32 queueFamilyIndex,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004739 VkSurfaceKHR surface,
Jesse Hallb00daad2015-11-29 19:46:20 -08004740 VkBool32* pSupported) {
4741 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08004742
4743 return ?
4744}
4745
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004746@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08004747cmd VkResult vkGetPhysicalDeviceSurfaceCapabilitiesKHR(
4748 VkPhysicalDevice physicalDevice,
4749 VkSurfaceKHR surface,
4750 VkSurfaceCapabilitiesKHR* pSurfaceCapabilities) {
4751 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
4752
4753 surfaceCapabilities := ?
4754 pSurfaceCapabilities[0] = surfaceCapabilities
4755
4756 return ?
4757}
4758
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004759@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08004760cmd VkResult vkGetPhysicalDeviceSurfaceFormatsKHR(
4761 VkPhysicalDevice physicalDevice,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004762 VkSurfaceKHR surface,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004763 u32* pSurfaceFormatCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004764 VkSurfaceFormatKHR* pSurfaceFormats) {
Jesse Hallb00daad2015-11-29 19:46:20 -08004765 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08004766
4767 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08004768 pSurfaceFormatCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08004769 surfaceFormats := pSurfaceFormats[0:count]
4770
4771 for i in (0 .. count) {
4772 surfaceFormat := ?
4773 surfaceFormats[i] = surfaceFormat
4774 }
4775
4776 return ?
4777}
4778
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004779@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08004780cmd VkResult vkGetPhysicalDeviceSurfacePresentModesKHR(
4781 VkPhysicalDevice physicalDevice,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004782 VkSurfaceKHR surface,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004783 u32* pPresentModeCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004784 VkPresentModeKHR* pPresentModes) {
Jesse Hallb00daad2015-11-29 19:46:20 -08004785 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08004786
4787 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08004788 pPresentModeCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08004789 presentModes := pPresentModes[0:count]
4790
4791 for i in (0 .. count) {
4792 presentMode := ?
4793 presentModes[i] = presentMode
4794 }
4795
4796 return ?
4797}
4798
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004799@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08004800cmd VkResult vkCreateSwapchainKHR(
4801 VkDevice device,
4802 const VkSwapchainCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08004803 const VkAllocationCallbacks* pAllocator,
Michael Lentine88594d72015-11-12 12:49:45 -08004804 VkSwapchainKHR* pSwapchain) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08004805 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR)
Michael Lentine88594d72015-11-12 12:49:45 -08004806 deviceObject := GetDevice(device)
4807
4808 swapchain := ?
4809 pSwapchain[0] = swapchain
4810 State.Swapchains[swapchain] = new!SwapchainObject(device: device)
4811
4812 return ?
4813}
4814
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004815@extension("VK_KHR_swapchain")
Jesse Hall1356b0d2015-11-23 17:24:58 -08004816cmd void vkDestroySwapchainKHR(
Michael Lentine88594d72015-11-12 12:49:45 -08004817 VkDevice device,
Jesse Hall0e74f002015-11-30 11:37:59 -08004818 VkSwapchainKHR swapchain,
4819 const VkAllocationCallbacks* pAllocator) {
Michael Lentine88594d72015-11-12 12:49:45 -08004820 deviceObject := GetDevice(device)
4821 swapchainObject := GetSwapchain(swapchain)
4822 assert(swapchainObject.device == device)
4823
4824 State.Swapchains[swapchain] = null
Michael Lentine88594d72015-11-12 12:49:45 -08004825}
4826
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004827@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08004828cmd VkResult vkGetSwapchainImagesKHR(
4829 VkDevice device,
4830 VkSwapchainKHR swapchain,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004831 u32* pSwapchainImageCount,
Michael Lentine88594d72015-11-12 12:49:45 -08004832 VkImage* pSwapchainImages) {
4833 deviceObject := GetDevice(device)
4834
4835 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08004836 pSwapchainImageCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08004837 swapchainImages := pSwapchainImages[0:count]
4838
4839 for i in (0 .. count) {
4840 swapchainImage := ?
4841 swapchainImages[i] = swapchainImage
Jesse Hall1356b0d2015-11-23 17:24:58 -08004842 State.Images[swapchainImage] = new!ImageObject(device: device)
Michael Lentine88594d72015-11-12 12:49:45 -08004843 }
4844
4845 return ?
4846}
4847
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004848@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08004849cmd VkResult vkAcquireNextImageKHR(
4850 VkDevice device,
4851 VkSwapchainKHR swapchain,
4852 u64 timeout,
4853 VkSemaphore semaphore,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004854 VkFence fence,
Michael Lentine88594d72015-11-12 12:49:45 -08004855 u32* pImageIndex) {
4856 deviceObject := GetDevice(device)
4857 swapchainObject := GetSwapchain(swapchain)
4858
4859 imageIndex := ?
4860 pImageIndex[0] = imageIndex
4861
4862 return ?
4863}
4864
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004865@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08004866cmd VkResult vkQueuePresentKHR(
4867 VkQueue queue,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08004868 const VkPresentInfoKHR* pPresentInfo) {
Michael Lentine88594d72015-11-12 12:49:45 -08004869 queueObject := GetQueue(queue)
4870
4871 presentInfo := ?
4872 pPresentInfo[0] = presentInfo
4873
4874 return ?
4875}
4876
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004877@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08004878cmd VkResult vkGetPhysicalDeviceDisplayPropertiesKHR(
4879 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004880 u32* pPropertyCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004881 VkDisplayPropertiesKHR* pProperties) {
4882 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
4883 return ?
4884}
4885
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004886@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08004887cmd VkResult vkGetPhysicalDeviceDisplayPlanePropertiesKHR(
4888 VkPhysicalDevice physicalDevice,
4889 u32* pPropertyCount,
4890 VkDisplayPlanePropertiesKHR* pProperties) {
4891 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
4892 return ?
4893}
4894
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004895@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08004896cmd VkResult vkGetDisplayPlaneSupportedDisplaysKHR(
4897 VkPhysicalDevice physicalDevice,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08004898 u32* pDisplayCount,
4899 VkDisplayKHR* pDisplays) {
Jesse Halla6429252015-11-29 18:59:42 -08004900 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
4901 return ?
4902}
4903
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004904@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08004905cmd VkResult vkGetDisplayModePropertiesKHR(
4906 VkPhysicalDevice physicalDevice,
4907 VkDisplayKHR display,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004908 u32* pPropertyCount,
4909 VkDisplayModePropertiesKHR* pProperties) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08004910 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
4911 return ?
4912}
4913
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004914@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08004915cmd VkResult vkCreateDisplayModeKHR(
4916 VkPhysicalDevice physicalDevice,
4917 VkDisplayKHR display,
4918 const VkDisplayModeCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08004919 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004920 VkDisplayModeKHR* pMode) {
4921 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
4922 return ?
4923}
4924
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004925@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08004926cmd VkResult vkGetDisplayPlaneCapabilitiesKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08004927 VkPhysicalDevice physicalDevice,
Jesse Hall9ba8bc82015-11-30 16:22:16 -08004928 VkDisplayModeKHR mode,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004929 u32 planeIndex,
Jesse Halla6429252015-11-29 18:59:42 -08004930 VkDisplayPlaneCapabilitiesKHR* pCapabilities) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08004931 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
4932 return ?
4933}
4934
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004935@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08004936cmd VkResult vkCreateDisplayPlaneSurfaceKHR(
4937 VkInstance instance,
4938 const VkDisplaySurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08004939 const VkAllocationCallbacks* pAllocator,
Jesse Halla6429252015-11-29 18:59:42 -08004940 VkSurfaceKHR* pSurface) {
4941 return ?
4942}
4943
Jesse Hall9ba8bc82015-11-30 16:22:16 -08004944@extension("VK_KHR_display_swapchain")
4945cmd VkResult vkCreateSharedSwapchainsKHR(
4946 VkDevice device,
4947 u32 swapchainCount,
4948 const VkSwapchainCreateInfoKHR* pCreateInfos,
4949 const VkAllocationCallbacks* pAllocator,
4950 VkSwapchainKHR* pSwapchains) {
4951 return ?
4952}
4953
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004954@extension("VK_KHR_xlib_surface")
Jesse Halla6429252015-11-29 18:59:42 -08004955cmd VkResult vkCreateXlibSurfaceKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08004956 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004957 const VkXlibSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08004958 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004959 VkSurfaceKHR* pSurface) {
4960 instanceObject := GetInstance(instance)
4961 return ?
4962}
4963
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004964@extension("VK_KHR_xlib_surface")
Jesse Halla6429252015-11-29 18:59:42 -08004965cmd VkBool32 vkGetPhysicalDeviceXlibPresentationSupportKHR(
4966 VkPhysicalDevice physicalDevice,
4967 u32 queueFamilyIndex,
4968 platform.Display* dpy,
Jesse Hall65ab5522015-11-30 00:07:16 -08004969 platform.VisualID visualID) {
Jesse Halla6429252015-11-29 18:59:42 -08004970 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
4971 return ?
4972}
4973
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004974@extension("VK_KHR_xcb_surface")
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004975cmd VkResult vkCreateXcbSurfaceKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08004976 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004977 const VkXcbSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08004978 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004979 VkSurfaceKHR* pSurface) {
4980 instanceObject := GetInstance(instance)
4981 return ?
4982}
4983
Jesse Hall523db342015-11-30 21:12:55 -08004984@extension("VK_KHR_xcb_surface")
Jesse Halla6429252015-11-29 18:59:42 -08004985cmd VkBool32 vkGetPhysicalDeviceXcbPresentationSupportKHR(
4986 VkPhysicalDevice physicalDevice,
4987 u32 queueFamilyIndex,
4988 platform.xcb_connection_t* connection,
4989 platform.xcb_visualid_t visual_id) {
4990 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
4991 return ?
4992}
4993
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004994@extension("VK_KHR_wayland_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08004995cmd VkResult vkCreateWaylandSurfaceKHR(
4996 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004997 const VkWaylandSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08004998 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004999 VkSurfaceKHR* pSurface) {
5000 instanceObject := GetInstance(instance)
5001 return ?
5002}
5003
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005004@extension("VK_KHR_wayland_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005005cmd VkBool32 vkGetPhysicalDeviceWaylandPresentationSupportKHR(
5006 VkPhysicalDevice physicalDevice,
5007 u32 queueFamilyIndex,
5008 platform.wl_display* display) {
5009 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5010 return ?
5011}
5012
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005013@extension("VK_KHR_mir_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005014cmd VkResult vkCreateMirSurfaceKHR(
5015 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005016 const VkMirSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005017 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005018 VkSurfaceKHR* pSurface) {
5019 instanceObject := GetInstance(instance)
5020 return ?
5021}
5022
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005023@extension("VK_KHR_mir_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005024cmd VkBool32 vkGetPhysicalDeviceMirPresentationSupportKHR(
5025 VkPhysicalDevice physicalDevice,
5026 u32 queueFamilyIndex,
5027 platform.MirConnection* connection) {
5028 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5029 return ?
5030}
5031
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005032@extension("VK_KHR_android_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005033cmd VkResult vkCreateAndroidSurfaceKHR(
5034 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005035 const VkAndroidSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005036 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005037 VkSurfaceKHR* pSurface) {
5038 instanceObject := GetInstance(instance)
5039 return ?
5040}
5041
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005042@extension("VK_KHR_win32_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005043cmd VkResult vkCreateWin32SurfaceKHR(
5044 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005045 const VkWin32SurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005046 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005047 VkSurfaceKHR* pSurface) {
5048 instanceObject := GetInstance(instance)
5049 return ?
5050}
5051
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005052@extension("VK_KHR_win32_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005053cmd VkResult vkGetPhysicalDeviceWin32PresentationSupportKHR(
5054 VkPhysicalDevice physicalDevice,
5055 u32 queueFamilyIndex) {
5056 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5057 return ?
5058}
5059
Jesse Halld27f6aa2015-08-15 17:58:48 -07005060
5061////////////////
5062// Validation //
5063////////////////
5064
5065extern void validate(string layerName, bool condition, string message)
5066
5067
5068/////////////////////////////
5069// Internal State Tracking //
5070/////////////////////////////
5071
5072StateObject State
5073
5074@internal class StateObject {
5075 // Dispatchable objects.
5076 map!(VkInstance, ref!InstanceObject) Instances
5077 map!(VkPhysicalDevice, ref!PhysicalDeviceObject) PhysicalDevices
5078 map!(VkDevice, ref!DeviceObject) Devices
5079 map!(VkQueue, ref!QueueObject) Queues
Jesse Hall3fbc8562015-11-29 22:10:52 -08005080 map!(VkCommandBuffer, ref!CommandBufferObject) CommandBuffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07005081
5082 // Non-dispatchable objects.
5083 map!(VkDeviceMemory, ref!DeviceMemoryObject) DeviceMemories
5084 map!(VkBuffer, ref!BufferObject) Buffers
5085 map!(VkBufferView, ref!BufferViewObject) BufferViews
5086 map!(VkImage, ref!ImageObject) Images
5087 map!(VkImageView, ref!ImageViewObject) ImageViews
Jesse Halld27f6aa2015-08-15 17:58:48 -07005088 map!(VkShaderModule, ref!ShaderModuleObject) ShaderModules
Jesse Halld27f6aa2015-08-15 17:58:48 -07005089 map!(VkPipeline, ref!PipelineObject) Pipelines
5090 map!(VkPipelineLayout, ref!PipelineLayoutObject) PipelineLayouts
5091 map!(VkSampler, ref!SamplerObject) Samplers
5092 map!(VkDescriptorSet, ref!DescriptorSetObject) DescriptorSets
5093 map!(VkDescriptorSetLayout, ref!DescriptorSetLayoutObject) DescriptorSetLayouts
5094 map!(VkDescriptorPool, ref!DescriptorPoolObject) DescriptorPools
Jesse Halld27f6aa2015-08-15 17:58:48 -07005095 map!(VkFence, ref!FenceObject) Fences
5096 map!(VkSemaphore, ref!SemaphoreObject) Semaphores
5097 map!(VkEvent, ref!EventObject) Events
5098 map!(VkQueryPool, ref!QueryPoolObject) QueryPools
5099 map!(VkFramebuffer, ref!FramebufferObject) Framebuffers
5100 map!(VkRenderPass, ref!RenderPassObject) RenderPasses
5101 map!(VkPipelineCache, ref!PipelineCacheObject) PipelineCaches
Jesse Hall3fbc8562015-11-29 22:10:52 -08005102 map!(VkCommandPool, ref!CommandPoolObject) CommandPools
Jesse Hall1356b0d2015-11-23 17:24:58 -08005103 map!(VkSurfaceKHR, ref!SurfaceObject) Surfaces
Michael Lentine88594d72015-11-12 12:49:45 -08005104 map!(VkSwapchainKHR, ref!SwapchainObject) Swapchains
Jesse Halld27f6aa2015-08-15 17:58:48 -07005105}
5106
5107@internal class InstanceObject {
5108}
5109
5110@internal class PhysicalDeviceObject {
5111 VkInstance instance
5112}
5113
5114@internal class DeviceObject {
5115 VkPhysicalDevice physicalDevice
5116}
5117
5118@internal class QueueObject {
5119 VkDevice device
5120 VkQueueFlags flags
5121}
5122
Jesse Hall3fbc8562015-11-29 22:10:52 -08005123@internal class CommandBufferObject {
Jesse Halld27f6aa2015-08-15 17:58:48 -07005124 VkDevice device
5125 map!(u64, VkDeviceMemory) boundObjects
5126 VkQueueFlags queueFlags
5127}
5128
5129@internal class DeviceMemoryObject {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005130 VkDevice device
5131 VkDeviceSize allocationSize
5132 map!(u64, VkDeviceSize) boundObjects
5133 map!(VkCommandBuffer, VkCommandBuffer) boundCommandBuffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07005134}
5135
5136@internal class BufferObject {
5137 VkDevice device
Jesse Hall3fbc8562015-11-29 22:10:52 -08005138 VkDeviceMemory memory
5139 VkDeviceSize memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07005140}
5141
5142@internal class BufferViewObject {
5143 VkDevice device
5144 VkBuffer buffer
5145}
5146
5147@internal class ImageObject {
5148 VkDevice device
Jesse Hall3fbc8562015-11-29 22:10:52 -08005149 VkDeviceMemory memory
5150 VkDeviceSize memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07005151}
5152
5153@internal class ImageViewObject {
5154 VkDevice device
5155 VkImage image
5156}
5157
Jesse Halld27f6aa2015-08-15 17:58:48 -07005158@internal class ShaderObject {
5159 VkDevice device
5160}
5161
5162@internal class ShaderModuleObject {
5163 VkDevice device
5164}
5165
5166@internal class PipelineObject {
5167 VkDevice device
5168}
5169
5170@internal class PipelineLayoutObject {
5171 VkDevice device
5172}
5173
5174@internal class SamplerObject {
5175 VkDevice device
5176}
5177
5178@internal class DescriptorSetObject {
5179 VkDevice device
5180}
5181
5182@internal class DescriptorSetLayoutObject {
5183 VkDevice device
5184}
5185
5186@internal class DescriptorPoolObject {
5187 VkDevice device
5188}
5189
Jesse Halld27f6aa2015-08-15 17:58:48 -07005190@internal class FenceObject {
5191 VkDevice device
5192 bool signaled
5193}
5194
5195@internal class SemaphoreObject {
5196 VkDevice device
5197}
5198
5199@internal class EventObject {
5200 VkDevice device
5201}
5202
5203@internal class QueryPoolObject {
5204 VkDevice device
5205}
5206
5207@internal class FramebufferObject {
5208 VkDevice device
5209}
5210
5211@internal class RenderPassObject {
5212 VkDevice device
5213}
5214
5215@internal class PipelineCacheObject {
5216 VkDevice device
5217}
5218
Jesse Hall3fbc8562015-11-29 22:10:52 -08005219@internal class CommandPoolObject {
Jesse Halld27f6aa2015-08-15 17:58:48 -07005220 VkDevice device
5221}
5222
Jesse Hall1356b0d2015-11-23 17:24:58 -08005223@internal class SurfaceObject {
5224 VkInstance instance
5225}
5226
Michael Lentine88594d72015-11-12 12:49:45 -08005227@internal class SwapchainObject {
5228 VkDevice device
5229}
5230
Jesse Halld27f6aa2015-08-15 17:58:48 -07005231macro ref!InstanceObject GetInstance(VkInstance instance) {
5232 assert(instance in State.Instances)
5233 return State.Instances[instance]
5234}
5235
5236macro ref!PhysicalDeviceObject GetPhysicalDevice(VkPhysicalDevice physicalDevice) {
5237 assert(physicalDevice in State.PhysicalDevices)
5238 return State.PhysicalDevices[physicalDevice]
5239}
5240
5241macro ref!DeviceObject GetDevice(VkDevice device) {
5242 assert(device in State.Devices)
5243 return State.Devices[device]
5244}
5245
5246macro ref!QueueObject GetQueue(VkQueue queue) {
5247 assert(queue in State.Queues)
5248 return State.Queues[queue]
5249}
5250
Jesse Hall3fbc8562015-11-29 22:10:52 -08005251macro ref!CommandBufferObject GetCommandBuffer(VkCommandBuffer commandBuffer) {
5252 assert(commandBuffer in State.CommandBuffers)
5253 return State.CommandBuffers[commandBuffer]
Jesse Halld27f6aa2015-08-15 17:58:48 -07005254}
5255
Jesse Hall3fbc8562015-11-29 22:10:52 -08005256macro ref!DeviceMemoryObject GetDeviceMemory(VkDeviceMemory memory) {
5257 assert(memory in State.DeviceMemories)
5258 return State.DeviceMemories[memory]
Jesse Halld27f6aa2015-08-15 17:58:48 -07005259}
5260
5261macro ref!BufferObject GetBuffer(VkBuffer buffer) {
5262 assert(buffer in State.Buffers)
5263 return State.Buffers[buffer]
5264}
5265
5266macro ref!BufferViewObject GetBufferView(VkBufferView bufferView) {
5267 assert(bufferView in State.BufferViews)
5268 return State.BufferViews[bufferView]
5269}
5270
5271macro ref!ImageObject GetImage(VkImage image) {
5272 assert(image in State.Images)
5273 return State.Images[image]
5274}
5275
5276macro ref!ImageViewObject GetImageView(VkImageView imageView) {
5277 assert(imageView in State.ImageViews)
5278 return State.ImageViews[imageView]
5279}
5280
Jesse Halld27f6aa2015-08-15 17:58:48 -07005281macro ref!ShaderModuleObject GetShaderModule(VkShaderModule shaderModule) {
5282 assert(shaderModule in State.ShaderModules)
5283 return State.ShaderModules[shaderModule]
5284}
5285
5286macro ref!PipelineObject GetPipeline(VkPipeline pipeline) {
5287 assert(pipeline in State.Pipelines)
5288 return State.Pipelines[pipeline]
5289}
5290
5291macro ref!PipelineLayoutObject GetPipelineLayout(VkPipelineLayout pipelineLayout) {
5292 assert(pipelineLayout in State.PipelineLayouts)
5293 return State.PipelineLayouts[pipelineLayout]
5294}
5295
5296macro ref!SamplerObject GetSampler(VkSampler sampler) {
5297 assert(sampler in State.Samplers)
5298 return State.Samplers[sampler]
5299}
5300
5301macro ref!DescriptorSetObject GetDescriptorSet(VkDescriptorSet descriptorSet) {
5302 assert(descriptorSet in State.DescriptorSets)
5303 return State.DescriptorSets[descriptorSet]
5304}
5305
5306macro ref!DescriptorSetLayoutObject GetDescriptorSetLayout(VkDescriptorSetLayout descriptorSetLayout) {
5307 assert(descriptorSetLayout in State.DescriptorSetLayouts)
5308 return State.DescriptorSetLayouts[descriptorSetLayout]
5309}
5310
5311macro ref!DescriptorPoolObject GetDescriptorPool(VkDescriptorPool descriptorPool) {
5312 assert(descriptorPool in State.DescriptorPools)
5313 return State.DescriptorPools[descriptorPool]
5314}
5315
Jesse Halld27f6aa2015-08-15 17:58:48 -07005316macro ref!FenceObject GetFence(VkFence fence) {
5317 assert(fence in State.Fences)
5318 return State.Fences[fence]
5319}
5320
5321macro ref!SemaphoreObject GetSemaphore(VkSemaphore semaphore) {
5322 assert(semaphore in State.Semaphores)
5323 return State.Semaphores[semaphore]
5324}
5325
5326macro ref!EventObject GetEvent(VkEvent event) {
5327 assert(event in State.Events)
5328 return State.Events[event]
5329}
5330
5331macro ref!QueryPoolObject GetQueryPool(VkQueryPool queryPool) {
5332 assert(queryPool in State.QueryPools)
5333 return State.QueryPools[queryPool]
5334}
5335
5336macro ref!FramebufferObject GetFramebuffer(VkFramebuffer framebuffer) {
5337 assert(framebuffer in State.Framebuffers)
5338 return State.Framebuffers[framebuffer]
5339}
5340
5341macro ref!RenderPassObject GetRenderPass(VkRenderPass renderPass) {
5342 assert(renderPass in State.RenderPasses)
5343 return State.RenderPasses[renderPass]
5344}
5345
5346macro ref!PipelineCacheObject GetPipelineCache(VkPipelineCache pipelineCache) {
5347 assert(pipelineCache in State.PipelineCaches)
5348 return State.PipelineCaches[pipelineCache]
5349}
5350
Jesse Hall3fbc8562015-11-29 22:10:52 -08005351macro ref!CommandPoolObject GetCommandPool(VkCommandPool commandPool) {
5352 assert(commandPool in State.CommandPools)
5353 return State.CommandPools[commandPool]
Jesse Hallf09c6b12015-08-15 19:54:28 -07005354}
Michael Lentine88594d72015-11-12 12:49:45 -08005355
Jesse Hall1356b0d2015-11-23 17:24:58 -08005356macro ref!SurfaceObject GetSurface(VkSurfaceKHR surface) {
5357 assert(surface in State.Surfaces)
5358 return State.Surfaces[surface]
5359}
5360
Michael Lentine88594d72015-11-12 12:49:45 -08005361macro ref!SwapchainObject GetSwapchain(VkSwapchainKHR swapchain) {
5362 assert(swapchain in State.Swapchains)
5363 return State.Swapchains[swapchain]
5364}
Jesse Halld8bade02015-11-24 10:24:18 -08005365
5366macro VkQueueFlags AddQueueFlag(VkQueueFlags flags, VkQueueFlagBits bit) {
5367 return as!VkQueueFlags(as!u32(flags) | as!u32(bit))
5368}