blob: 870f8ebec289ac3463ca31e40d7c8c08a7f75a92 [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)
Jesse Hall3dd678a2016-01-08 21:52:01 -080029define VERSION_MAJOR 1
30define VERSION_MINOR 0
Jesse Hall26763382016-05-20 07:13:52 -070031define VERSION_PATCH 13
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 Hall33faaad2016-01-24 21:00:49 -080048@extension("VK_KHR_surface") define VK_KHR_SURFACE_SPEC_VERSION 25
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080049@extension("VK_KHR_surface") define VK_KHR_SURFACE_EXTENSION_NAME "VK_KHR_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080050
Jesse Hall26763382016-05-20 07:13:52 -070051@extension("VK_KHR_swapchain") define VK_KHR_SWAPCHAIN_SPEC_VERSION 68
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080052@extension("VK_KHR_swapchain") define VK_KHR_SWAPCHAIN_EXTENSION_NAME "VK_KHR_swapchain"
Jesse Hall1356b0d2015-11-23 17:24:58 -080053
Jesse Hall543a7ff2016-01-08 16:38:30 -080054@extension("VK_KHR_display") define VK_KHR_DISPLAY_SPEC_VERSION 21
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080055@extension("VK_KHR_display") define VK_KHR_DISPLAY_EXTENSION_NAME "VK_KHR_display"
Jesse Hall1356b0d2015-11-23 17:24:58 -080056
Jesse Hall543a7ff2016-01-08 16:38:30 -080057@extension("VK_KHR_display_swapchain") define VK_KHR_DISPLAY_SWAPCHAIN_SPEC_VERSION 9
Jesse Hall0e74f002015-11-30 11:37:59 -080058@extension("VK_KHR_display_swapchain") define VK_KHR_DISPLAY_SWAPCHAIN_EXTENSION_NAME "VK_KHR_display_swapchain"
Jesse Hall1356b0d2015-11-23 17:24:58 -080059
Jesse Hall543a7ff2016-01-08 16:38:30 -080060@extension("VK_KHR_xlib_surface") define VK_KHR_XLIB_SURFACE_SPEC_VERSION 6
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080061@extension("VK_KHR_xlib_surface") define VK_KHR_XLIB_SURFACE_NAME "VK_KHR_xlib_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080062
Jesse Hall543a7ff2016-01-08 16:38:30 -080063@extension("VK_KHR_xcb_surface") define VK_KHR_XCB_SURFACE_SPEC_VERSION 6
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080064@extension("VK_KHR_xcb_surface") define VK_KHR_XCB_SURFACE_NAME "VK_KHR_xcb_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080065
Jesse Hall543a7ff2016-01-08 16:38:30 -080066@extension("VK_KHR_wayland_surface") define VK_KHR_WAYLAND_SURFACE_SPEC_VERSION 5
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080067@extension("VK_KHR_wayland_surface") define VK_KHR_WAYLAND_SURFACE_NAME "VK_KHR_wayland_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080068
Jesse Hall543a7ff2016-01-08 16:38:30 -080069@extension("VK_KHR_mir_surface") define VK_KHR_MIR_SURFACE_SPEC_VERSION 4
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080070@extension("VK_KHR_mir_surface") define VK_KHR_MIR_SURFACE_NAME "VK_KHR_mir_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080071
Jesse Hall33faaad2016-01-24 21:00:49 -080072@extension("VK_KHR_android_surface") define VK_KHR_ANDROID_SURFACE_SPEC_VERSION 6
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080073@extension("VK_KHR_android_surface") define VK_KHR_ANDROID_SURFACE_NAME "VK_KHR_android_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080074
Jesse Hall543a7ff2016-01-08 16:38:30 -080075@extension("VK_KHR_win32_surface") define VK_KHR_WIN32_SURFACE_SPEC_VERSION 5
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080076@extension("VK_KHR_win32_surface") define VK_KHR_WIN32_SURFACE_NAME "VK_KHR_win32_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080077
Chia-I Wub262ddc2016-03-22 07:38:20 +080078@extension("VK_ANDROID_native_buffer") define VK_ANDROID_NATIVE_BUFFER_SPEC_VERSION 5
79@extension("VK_ANDROID_native_buffer") define VK_ANDROID_NATIVE_BUFFER_NAME "VK_ANDROID_native_buffer"
80
Jesse Hall26763382016-05-20 07:13:52 -070081@extension("VK_EXT_debug_report") define VK_EXT_DEBUG_REPORT_SPEC_VERSION 2
Jesse Hall715b86a2016-01-16 16:34:29 -080082@extension("VK_EXT_debug_report") define VK_EXT_DEBUG_REPORT_NAME "VK_EXT_debug_report"
83
Jesse Hall26763382016-05-20 07:13:52 -070084@extension("VK_NV_glsl_shader") define VK_NV_GLSL_SHADER_SPEC_VERSION 1
85@extension("VK_NV_glsl_shader") define VK_NV_GLSL_SHADER_NAME "VK_NV_glsl_shader"
86
87@extension("VK_KHR_sampler_mirror_clamp_to_edge") define VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_SPEC_VERSION 1
88@extension("VK_KHR_sampler_mirror_clamp_to_edge") define VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_NAME "VK_KHR_sampler_mirror_clamp_to_edge"
89
90@extension("VK_IMG_filter_cubic") define VK_IMG_FILTER_CUBIC_SPEC_VERSION 1
91@extension("VK_IMG_filter_cubic") define VK_IMG_FILTER_CUBIC_NAME "VK_IMG_filter_cubic"
92
93@extension("VK_AMD_rasterization_order") define VK_AMD_RASTERIZATION_ORDER_SPEC_VERSION 1
94@extension("VK_AMD_rasterization_order") define VK_AMD_RASTERIZATION_ORDER_NAME "VK_AMD_rasterization_order"
95
96@extension("VK_EXT_debug_marker") define VK_EXT_DEBUG_MARKER_SPEC_VERSION 3
97@extension("VK_EXT_debug_marker") define VK_EXT_DEBUG_MARKER_NAME "VK_EXT_debug_marker"
98
Jesse Halld27f6aa2015-08-15 17:58:48 -070099
100/////////////
101// Types //
102/////////////
103
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700104type u32 VkBool32
105type u32 VkFlags
106type u64 VkDeviceSize
107type u32 VkSampleMask
108
Jesse Halld27f6aa2015-08-15 17:58:48 -0700109/// Dispatchable handle types.
110@dispatchHandle type u64 VkInstance
111@dispatchHandle type u64 VkPhysicalDevice
112@dispatchHandle type u64 VkDevice
113@dispatchHandle type u64 VkQueue
Jesse Hall3fbc8562015-11-29 22:10:52 -0800114@dispatchHandle type u64 VkCommandBuffer
Jesse Halld27f6aa2015-08-15 17:58:48 -0700115
116/// Non dispatchable handle types.
117@nonDispatchHandle type u64 VkDeviceMemory
Jesse Hall3fbc8562015-11-29 22:10:52 -0800118@nonDispatchHandle type u64 VkCommandPool
Jesse Halld27f6aa2015-08-15 17:58:48 -0700119@nonDispatchHandle type u64 VkBuffer
120@nonDispatchHandle type u64 VkBufferView
121@nonDispatchHandle type u64 VkImage
122@nonDispatchHandle type u64 VkImageView
Jesse Halld27f6aa2015-08-15 17:58:48 -0700123@nonDispatchHandle type u64 VkShaderModule
Jesse Halld27f6aa2015-08-15 17:58:48 -0700124@nonDispatchHandle type u64 VkPipeline
125@nonDispatchHandle type u64 VkPipelineLayout
126@nonDispatchHandle type u64 VkSampler
127@nonDispatchHandle type u64 VkDescriptorSet
128@nonDispatchHandle type u64 VkDescriptorSetLayout
129@nonDispatchHandle type u64 VkDescriptorPool
Jesse Halld27f6aa2015-08-15 17:58:48 -0700130@nonDispatchHandle type u64 VkFence
131@nonDispatchHandle type u64 VkSemaphore
132@nonDispatchHandle type u64 VkEvent
133@nonDispatchHandle type u64 VkQueryPool
134@nonDispatchHandle type u64 VkFramebuffer
135@nonDispatchHandle type u64 VkRenderPass
136@nonDispatchHandle type u64 VkPipelineCache
Jesse Hall1356b0d2015-11-23 17:24:58 -0800137
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800138@extension("VK_KHR_surface") @nonDispatchHandle type u64 VkSurfaceKHR
Jesse Hall1356b0d2015-11-23 17:24:58 -0800139
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800140@extension("VK_KHR_swapchain") @nonDispatchHandle type u64 VkSwapchainKHR
Jesse Hall1356b0d2015-11-23 17:24:58 -0800141
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800142@extension("VK_KHR_display") @nonDispatchHandle type u64 VkDisplayKHR
143@extension("VK_KHR_display") @nonDispatchHandle type u64 VkDisplayModeKHR
Jesse Halld27f6aa2015-08-15 17:58:48 -0700144
Jesse Hall715b86a2016-01-16 16:34:29 -0800145@extension("VK_EXT_debug_report") @nonDispatchHandle type u64 VkDebugReportCallbackEXT
146
Jesse Halld27f6aa2015-08-15 17:58:48 -0700147
148/////////////
149// Enums //
150/////////////
151
152enum VkImageLayout {
153 VK_IMAGE_LAYOUT_UNDEFINED = 0x00000000, /// Implicit layout an image is when its contents are undefined due to various reasons (e.g. right after creation)
154 VK_IMAGE_LAYOUT_GENERAL = 0x00000001, /// General layout when image can be used for any kind of access
155 VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL = 0x00000002, /// Optimal layout when image is only used for color attachment read/write
156 VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL = 0x00000003, /// Optimal layout when image is only used for depth/stencil attachment read/write
157 VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL = 0x00000004, /// Optimal layout when image is used for read only depth/stencil attachment and shader access
158 VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL = 0x00000005, /// Optimal layout when image is used for read only shader access
Jesse Hall3fbc8562015-11-29 22:10:52 -0800159 VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL = 0x00000006, /// Optimal layout when image is used only as source of transfer operations
160 VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL = 0x00000007, /// Optimal layout when image is used only as destination of transfer operations
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700161 VK_IMAGE_LAYOUT_PREINITIALIZED = 0x00000008, /// Initial layout used when the data is populated by the CPU
Jesse Hall1356b0d2015-11-23 17:24:58 -0800162
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800163 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800164 VK_IMAGE_LAYOUT_PRESENT_SRC_KHR = 1000001002,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700165}
166
167enum VkAttachmentLoadOp {
168 VK_ATTACHMENT_LOAD_OP_LOAD = 0x00000000,
169 VK_ATTACHMENT_LOAD_OP_CLEAR = 0x00000001,
170 VK_ATTACHMENT_LOAD_OP_DONT_CARE = 0x00000002,
171}
172
173enum VkAttachmentStoreOp {
174 VK_ATTACHMENT_STORE_OP_STORE = 0x00000000,
175 VK_ATTACHMENT_STORE_OP_DONT_CARE = 0x00000001,
176}
177
178enum VkImageType {
179 VK_IMAGE_TYPE_1D = 0x00000000,
180 VK_IMAGE_TYPE_2D = 0x00000001,
181 VK_IMAGE_TYPE_3D = 0x00000002,
182}
183
184enum VkImageTiling {
Jesse Hallc7467b72015-11-29 21:05:26 -0800185 VK_IMAGE_TILING_OPTIMAL = 0x00000000,
186 VK_IMAGE_TILING_LINEAR = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700187}
188
189enum VkImageViewType {
190 VK_IMAGE_VIEW_TYPE_1D = 0x00000000,
191 VK_IMAGE_VIEW_TYPE_2D = 0x00000001,
192 VK_IMAGE_VIEW_TYPE_3D = 0x00000002,
193 VK_IMAGE_VIEW_TYPE_CUBE = 0x00000003,
194 VK_IMAGE_VIEW_TYPE_1D_ARRAY = 0x00000004,
195 VK_IMAGE_VIEW_TYPE_2D_ARRAY = 0x00000005,
196 VK_IMAGE_VIEW_TYPE_CUBE_ARRAY = 0x00000006,
197}
198
Jesse Hall3fbc8562015-11-29 22:10:52 -0800199enum VkCommandBufferLevel {
200 VK_COMMAND_BUFFER_LEVEL_PRIMARY = 0x00000000,
201 VK_COMMAND_BUFFER_LEVEL_SECONDARY = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700202}
203
Jesse Hall65ab5522015-11-30 00:07:16 -0800204enum VkComponentSwizzle {
205 VK_COMPONENT_SWIZZLE_IDENTITY = 0x00000000,
206 VK_COMPONENT_SWIZZLE_ZERO = 0x00000001,
207 VK_COMPONENT_SWIZZLE_ONE = 0x00000002,
208 VK_COMPONENT_SWIZZLE_R = 0x00000003,
209 VK_COMPONENT_SWIZZLE_G = 0x00000004,
210 VK_COMPONENT_SWIZZLE_B = 0x00000005,
211 VK_COMPONENT_SWIZZLE_A = 0x00000006,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700212}
213
214enum VkDescriptorType {
215 VK_DESCRIPTOR_TYPE_SAMPLER = 0x00000000,
216 VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER = 0x00000001,
217 VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE = 0x00000002,
218 VK_DESCRIPTOR_TYPE_STORAGE_IMAGE = 0x00000003,
219 VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER = 0x00000004,
220 VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER = 0x00000005,
221 VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER = 0x00000006,
222 VK_DESCRIPTOR_TYPE_STORAGE_BUFFER = 0x00000007,
223 VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC = 0x00000008,
224 VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC = 0x00000009,
225 VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT = 0x0000000a,
226}
227
Jesse Halld27f6aa2015-08-15 17:58:48 -0700228enum VkQueryType {
229 VK_QUERY_TYPE_OCCLUSION = 0x00000000,
230 VK_QUERY_TYPE_PIPELINE_STATISTICS = 0x00000001, /// Optional
Jesse Halla3a7a1d2015-11-24 11:37:23 -0800231 VK_QUERY_TYPE_TIMESTAMP = 0x00000002,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700232}
233
Jesse Halld27f6aa2015-08-15 17:58:48 -0700234enum VkBorderColor {
235 VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK = 0x00000000,
236 VK_BORDER_COLOR_INT_TRANSPARENT_BLACK = 0x00000001,
237 VK_BORDER_COLOR_FLOAT_OPAQUE_BLACK = 0x00000002,
238 VK_BORDER_COLOR_INT_OPAQUE_BLACK = 0x00000003,
239 VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE = 0x00000004,
240 VK_BORDER_COLOR_INT_OPAQUE_WHITE = 0x00000005,
241}
242
243enum VkPipelineBindPoint {
Jesse Hallc7467b72015-11-29 21:05:26 -0800244 VK_PIPELINE_BIND_POINT_GRAPHICS = 0x00000000,
245 VK_PIPELINE_BIND_POINT_COMPUTE = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700246}
247
248enum VkPrimitiveTopology {
249 VK_PRIMITIVE_TOPOLOGY_POINT_LIST = 0x00000000,
250 VK_PRIMITIVE_TOPOLOGY_LINE_LIST = 0x00000001,
251 VK_PRIMITIVE_TOPOLOGY_LINE_STRIP = 0x00000002,
252 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST = 0x00000003,
253 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP = 0x00000004,
254 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN = 0x00000005,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800255 VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY = 0x00000006,
256 VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY = 0x00000007,
257 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY = 0x00000008,
258 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY = 0x00000009,
Jesse Hall091ed9e2015-11-30 00:55:29 -0800259 VK_PRIMITIVE_TOPOLOGY_PATCH_LIST = 0x0000000a,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700260}
261
262enum VkSharingMode {
263 VK_SHARING_MODE_EXCLUSIVE = 0x00000000,
264 VK_SHARING_MODE_CONCURRENT = 0x00000001,
265}
266
267enum VkIndexType {
268 VK_INDEX_TYPE_UINT16 = 0x00000000,
269 VK_INDEX_TYPE_UINT32 = 0x00000001,
270}
271
Jesse Hall23ff73f2015-11-29 14:36:39 -0800272enum VkFilter {
273 VK_FILTER_NEAREST = 0x00000000,
274 VK_FILTER_LINEAR = 0x00000001,
Jesse Hall26763382016-05-20 07:13:52 -0700275
276 //@extension("VK_IMG_filter_cubic")
277 VK_FILTER_CUBIC_IMG = 1000015000,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700278}
279
Jesse Hall23ff73f2015-11-29 14:36:39 -0800280enum VkSamplerMipmapMode {
Jesse Hall23ff73f2015-11-29 14:36:39 -0800281 VK_SAMPLER_MIPMAP_MODE_NEAREST = 0x00000001, /// Choose nearest mip level
282 VK_SAMPLER_MIPMAP_MODE_LINEAR = 0x00000002, /// Linear filter between mip levels
Jesse Halld27f6aa2015-08-15 17:58:48 -0700283}
284
Jesse Hall23ff73f2015-11-29 14:36:39 -0800285enum VkSamplerAddressMode {
Jesse Hallc7467b72015-11-29 21:05:26 -0800286 VK_SAMPLER_ADDRESS_MODE_REPEAT = 0x00000000,
287 VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT = 0x00000001,
288 VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE = 0x00000002,
289 VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER = 0x00000003,
290 VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700291}
292
293enum VkCompareOp {
294 VK_COMPARE_OP_NEVER = 0x00000000,
295 VK_COMPARE_OP_LESS = 0x00000001,
296 VK_COMPARE_OP_EQUAL = 0x00000002,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800297 VK_COMPARE_OP_LESS_OR_EQUAL = 0x00000003,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700298 VK_COMPARE_OP_GREATER = 0x00000004,
299 VK_COMPARE_OP_NOT_EQUAL = 0x00000005,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800300 VK_COMPARE_OP_GREATER_OR_EQUAL = 0x00000006,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700301 VK_COMPARE_OP_ALWAYS = 0x00000007,
302}
303
Jesse Hall65ab5522015-11-30 00:07:16 -0800304enum VkPolygonMode {
305 VK_POLYGON_MODE_FILL = 0x00000000,
306 VK_POLYGON_MODE_LINE = 0x00000001,
307 VK_POLYGON_MODE_POINT = 0x00000002,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700308}
309
310enum VkFrontFace {
Jesse Hall3fbc8562015-11-29 22:10:52 -0800311 VK_FRONT_FACE_COUNTER_CLOCKWISE = 0x00000000,
312 VK_FRONT_FACE_CLOCKWISE = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700313}
314
Jesse Hall65ab5522015-11-30 00:07:16 -0800315enum VkBlendFactor {
316 VK_BLEND_FACTOR_ZERO = 0x00000000,
317 VK_BLEND_FACTOR_ONE = 0x00000001,
318 VK_BLEND_FACTOR_SRC_COLOR = 0x00000002,
319 VK_BLEND_FACTOR_ONE_MINUS_SRC_COLOR = 0x00000003,
320 VK_BLEND_FACTOR_DST_COLOR = 0x00000004,
321 VK_BLEND_FACTOR_ONE_MINUS_DST_COLOR = 0x00000005,
322 VK_BLEND_FACTOR_SRC_ALPHA = 0x00000006,
323 VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA = 0x00000007,
324 VK_BLEND_FACTOR_DST_ALPHA = 0x00000008,
325 VK_BLEND_FACTOR_ONE_MINUS_DST_ALPHA = 0x00000009,
326 VK_BLEND_FACTOR_CONSTANT_COLOR = 0x0000000a,
327 VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR = 0x0000000b,
328 VK_BLEND_FACTOR_CONSTANT_ALPHA = 0x0000000c,
329 VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA = 0x0000000d,
330 VK_BLEND_FACTOR_SRC_ALPHA_SATURATE = 0x0000000e,
331 VK_BLEND_FACTOR_SRC1_COLOR = 0x0000000f,
332 VK_BLEND_FACTOR_ONE_MINUS_SRC1_COLOR = 0x00000010,
333 VK_BLEND_FACTOR_SRC1_ALPHA = 0x00000011,
334 VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA = 0x00000012,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700335}
336
337enum VkBlendOp {
338 VK_BLEND_OP_ADD = 0x00000000,
339 VK_BLEND_OP_SUBTRACT = 0x00000001,
340 VK_BLEND_OP_REVERSE_SUBTRACT = 0x00000002,
341 VK_BLEND_OP_MIN = 0x00000003,
342 VK_BLEND_OP_MAX = 0x00000004,
343}
344
345enum VkStencilOp {
346 VK_STENCIL_OP_KEEP = 0x00000000,
347 VK_STENCIL_OP_ZERO = 0x00000001,
348 VK_STENCIL_OP_REPLACE = 0x00000002,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800349 VK_STENCIL_OP_INCREMENT_AND_CLAMP = 0x00000003,
350 VK_STENCIL_OP_DECREMENT_AND_CLAMP = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700351 VK_STENCIL_OP_INVERT = 0x00000005,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800352 VK_STENCIL_OP_INCREMENT_AND_WRAP = 0x00000006,
353 VK_STENCIL_OP_DECREMENT_AND_WRAP = 0x00000007,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700354}
355
356enum VkLogicOp {
357 VK_LOGIC_OP_CLEAR = 0x00000000,
358 VK_LOGIC_OP_AND = 0x00000001,
359 VK_LOGIC_OP_AND_REVERSE = 0x00000002,
360 VK_LOGIC_OP_COPY = 0x00000003,
361 VK_LOGIC_OP_AND_INVERTED = 0x00000004,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800362 VK_LOGIC_OP_NO_OP = 0x00000005,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700363 VK_LOGIC_OP_XOR = 0x00000006,
364 VK_LOGIC_OP_OR = 0x00000007,
365 VK_LOGIC_OP_NOR = 0x00000008,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800366 VK_LOGIC_OP_EQUIVALENT = 0x00000009,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700367 VK_LOGIC_OP_INVERT = 0x0000000a,
368 VK_LOGIC_OP_OR_REVERSE = 0x0000000b,
369 VK_LOGIC_OP_COPY_INVERTED = 0x0000000c,
370 VK_LOGIC_OP_OR_INVERTED = 0x0000000d,
371 VK_LOGIC_OP_NAND = 0x0000000e,
372 VK_LOGIC_OP_SET = 0x0000000f,
373}
374
Jesse Hall3fbc8562015-11-29 22:10:52 -0800375enum VkSystemAllocationScope {
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800376 VK_SYSTEM_ALLOCATION_SCOPE_COMMAND = 0x00000000,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800377 VK_SYSTEM_ALLOCATION_SCOPE_OBJECT = 0x00000001,
378 VK_SYSTEM_ALLOCATION_SCOPE_CACHE = 0x00000002,
379 VK_SYSTEM_ALLOCATION_SCOPE_DEVICE = 0x00000003,
380 VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE = 0x00000004,
Jesse Hall03b6fe12015-11-24 12:44:21 -0800381}
382
Jesse Hall3fbc8562015-11-29 22:10:52 -0800383enum VkInternalAllocationType {
384 VK_INTERNAL_ALLOCATION_TYPE_EXECUTABLE = 0x00000000,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700385}
386
387enum VkPhysicalDeviceType {
388 VK_PHYSICAL_DEVICE_TYPE_OTHER = 0x00000000,
389 VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU = 0x00000001,
390 VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU = 0x00000002,
391 VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU = 0x00000003,
392 VK_PHYSICAL_DEVICE_TYPE_CPU = 0x00000004,
393}
394
Jesse Hall65ab5522015-11-30 00:07:16 -0800395enum VkVertexInputRate {
396 VK_VERTEX_INPUT_RATE_VERTEX = 0x00000000,
397 VK_VERTEX_INPUT_RATE_INSTANCE = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700398}
399
400/// Vulkan format definitions
401enum VkFormat {
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800402 VK_FORMAT_UNDEFINED = 0,
403 VK_FORMAT_R4G4_UNORM_PACK8 = 1,
404 VK_FORMAT_R4G4B4A4_UNORM_PACK16 = 2,
405 VK_FORMAT_B4G4R4A4_UNORM_PACK16 = 3,
406 VK_FORMAT_R5G6B5_UNORM_PACK16 = 4,
407 VK_FORMAT_B5G6R5_UNORM_PACK16 = 5,
408 VK_FORMAT_R5G5B5A1_UNORM_PACK16 = 6,
409 VK_FORMAT_B5G5R5A1_UNORM_PACK16 = 7,
410 VK_FORMAT_A1R5G5B5_UNORM_PACK16 = 8,
411 VK_FORMAT_R8_UNORM = 9,
412 VK_FORMAT_R8_SNORM = 10,
413 VK_FORMAT_R8_USCALED = 11,
414 VK_FORMAT_R8_SSCALED = 12,
415 VK_FORMAT_R8_UINT = 13,
416 VK_FORMAT_R8_SINT = 14,
417 VK_FORMAT_R8_SRGB = 15,
418 VK_FORMAT_R8G8_UNORM = 16,
419 VK_FORMAT_R8G8_SNORM = 17,
420 VK_FORMAT_R8G8_USCALED = 18,
421 VK_FORMAT_R8G8_SSCALED = 19,
422 VK_FORMAT_R8G8_UINT = 20,
423 VK_FORMAT_R8G8_SINT = 21,
424 VK_FORMAT_R8G8_SRGB = 22,
425 VK_FORMAT_R8G8B8_UNORM = 23,
426 VK_FORMAT_R8G8B8_SNORM = 24,
427 VK_FORMAT_R8G8B8_USCALED = 25,
428 VK_FORMAT_R8G8B8_SSCALED = 26,
429 VK_FORMAT_R8G8B8_UINT = 27,
430 VK_FORMAT_R8G8B8_SINT = 28,
431 VK_FORMAT_R8G8B8_SRGB = 29,
432 VK_FORMAT_B8G8R8_UNORM = 30,
433 VK_FORMAT_B8G8R8_SNORM = 31,
434 VK_FORMAT_B8G8R8_USCALED = 32,
435 VK_FORMAT_B8G8R8_SSCALED = 33,
436 VK_FORMAT_B8G8R8_UINT = 34,
437 VK_FORMAT_B8G8R8_SINT = 35,
438 VK_FORMAT_B8G8R8_SRGB = 36,
439 VK_FORMAT_R8G8B8A8_UNORM = 37,
440 VK_FORMAT_R8G8B8A8_SNORM = 38,
441 VK_FORMAT_R8G8B8A8_USCALED = 39,
442 VK_FORMAT_R8G8B8A8_SSCALED = 40,
443 VK_FORMAT_R8G8B8A8_UINT = 41,
444 VK_FORMAT_R8G8B8A8_SINT = 42,
445 VK_FORMAT_R8G8B8A8_SRGB = 43,
446 VK_FORMAT_B8G8R8A8_UNORM = 44,
447 VK_FORMAT_B8G8R8A8_SNORM = 45,
448 VK_FORMAT_B8G8R8A8_USCALED = 46,
449 VK_FORMAT_B8G8R8A8_SSCALED = 47,
450 VK_FORMAT_B8G8R8A8_UINT = 48,
451 VK_FORMAT_B8G8R8A8_SINT = 49,
452 VK_FORMAT_B8G8R8A8_SRGB = 50,
453 VK_FORMAT_A8B8G8R8_UNORM_PACK32 = 51,
454 VK_FORMAT_A8B8G8R8_SNORM_PACK32 = 52,
455 VK_FORMAT_A8B8G8R8_USCALED_PACK32 = 53,
456 VK_FORMAT_A8B8G8R8_SSCALED_PACK32 = 54,
457 VK_FORMAT_A8B8G8R8_UINT_PACK32 = 55,
458 VK_FORMAT_A8B8G8R8_SINT_PACK32 = 56,
459 VK_FORMAT_A8B8G8R8_SRGB_PACK32 = 57,
460 VK_FORMAT_A2R10G10B10_UNORM_PACK32 = 58,
461 VK_FORMAT_A2R10G10B10_SNORM_PACK32 = 59,
462 VK_FORMAT_A2R10G10B10_USCALED_PACK32 = 60,
463 VK_FORMAT_A2R10G10B10_SSCALED_PACK32 = 61,
464 VK_FORMAT_A2R10G10B10_UINT_PACK32 = 62,
465 VK_FORMAT_A2R10G10B10_SINT_PACK32 = 63,
466 VK_FORMAT_A2B10G10R10_UNORM_PACK32 = 64,
467 VK_FORMAT_A2B10G10R10_SNORM_PACK32 = 65,
468 VK_FORMAT_A2B10G10R10_USCALED_PACK32 = 66,
469 VK_FORMAT_A2B10G10R10_SSCALED_PACK32 = 67,
470 VK_FORMAT_A2B10G10R10_UINT_PACK32 = 68,
471 VK_FORMAT_A2B10G10R10_SINT_PACK32 = 69,
472 VK_FORMAT_R16_UNORM = 70,
473 VK_FORMAT_R16_SNORM = 71,
474 VK_FORMAT_R16_USCALED = 72,
475 VK_FORMAT_R16_SSCALED = 73,
476 VK_FORMAT_R16_UINT = 74,
477 VK_FORMAT_R16_SINT = 75,
478 VK_FORMAT_R16_SFLOAT = 76,
479 VK_FORMAT_R16G16_UNORM = 77,
480 VK_FORMAT_R16G16_SNORM = 78,
481 VK_FORMAT_R16G16_USCALED = 79,
482 VK_FORMAT_R16G16_SSCALED = 80,
483 VK_FORMAT_R16G16_UINT = 81,
484 VK_FORMAT_R16G16_SINT = 82,
485 VK_FORMAT_R16G16_SFLOAT = 83,
486 VK_FORMAT_R16G16B16_UNORM = 84,
487 VK_FORMAT_R16G16B16_SNORM = 85,
488 VK_FORMAT_R16G16B16_USCALED = 86,
489 VK_FORMAT_R16G16B16_SSCALED = 87,
490 VK_FORMAT_R16G16B16_UINT = 88,
491 VK_FORMAT_R16G16B16_SINT = 89,
492 VK_FORMAT_R16G16B16_SFLOAT = 90,
493 VK_FORMAT_R16G16B16A16_UNORM = 91,
494 VK_FORMAT_R16G16B16A16_SNORM = 92,
495 VK_FORMAT_R16G16B16A16_USCALED = 93,
496 VK_FORMAT_R16G16B16A16_SSCALED = 94,
497 VK_FORMAT_R16G16B16A16_UINT = 95,
498 VK_FORMAT_R16G16B16A16_SINT = 96,
499 VK_FORMAT_R16G16B16A16_SFLOAT = 97,
500 VK_FORMAT_R32_UINT = 98,
501 VK_FORMAT_R32_SINT = 99,
502 VK_FORMAT_R32_SFLOAT = 100,
503 VK_FORMAT_R32G32_UINT = 101,
504 VK_FORMAT_R32G32_SINT = 102,
505 VK_FORMAT_R32G32_SFLOAT = 103,
506 VK_FORMAT_R32G32B32_UINT = 104,
507 VK_FORMAT_R32G32B32_SINT = 105,
508 VK_FORMAT_R32G32B32_SFLOAT = 106,
509 VK_FORMAT_R32G32B32A32_UINT = 107,
510 VK_FORMAT_R32G32B32A32_SINT = 108,
511 VK_FORMAT_R32G32B32A32_SFLOAT = 109,
512 VK_FORMAT_R64_UINT = 110,
513 VK_FORMAT_R64_SINT = 111,
514 VK_FORMAT_R64_SFLOAT = 112,
515 VK_FORMAT_R64G64_UINT = 113,
516 VK_FORMAT_R64G64_SINT = 114,
517 VK_FORMAT_R64G64_SFLOAT = 115,
518 VK_FORMAT_R64G64B64_UINT = 116,
519 VK_FORMAT_R64G64B64_SINT = 117,
520 VK_FORMAT_R64G64B64_SFLOAT = 118,
521 VK_FORMAT_R64G64B64A64_UINT = 119,
522 VK_FORMAT_R64G64B64A64_SINT = 120,
523 VK_FORMAT_R64G64B64A64_SFLOAT = 121,
524 VK_FORMAT_B10G11R11_UFLOAT_PACK32 = 122,
525 VK_FORMAT_E5B9G9R9_UFLOAT_PACK32 = 123,
526 VK_FORMAT_D16_UNORM = 124,
527 VK_FORMAT_X8_D24_UNORM_PACK32 = 125,
528 VK_FORMAT_D32_SFLOAT = 126,
529 VK_FORMAT_S8_UINT = 127,
530 VK_FORMAT_D16_UNORM_S8_UINT = 128,
531 VK_FORMAT_D24_UNORM_S8_UINT = 129,
532 VK_FORMAT_D32_SFLOAT_S8_UINT = 130,
533 VK_FORMAT_BC1_RGB_UNORM_BLOCK = 131,
534 VK_FORMAT_BC1_RGB_SRGB_BLOCK = 132,
535 VK_FORMAT_BC1_RGBA_UNORM_BLOCK = 133,
536 VK_FORMAT_BC1_RGBA_SRGB_BLOCK = 134,
537 VK_FORMAT_BC2_UNORM_BLOCK = 135,
538 VK_FORMAT_BC2_SRGB_BLOCK = 136,
539 VK_FORMAT_BC3_UNORM_BLOCK = 137,
540 VK_FORMAT_BC3_SRGB_BLOCK = 138,
541 VK_FORMAT_BC4_UNORM_BLOCK = 139,
542 VK_FORMAT_BC4_SNORM_BLOCK = 140,
543 VK_FORMAT_BC5_UNORM_BLOCK = 141,
544 VK_FORMAT_BC5_SNORM_BLOCK = 142,
545 VK_FORMAT_BC6H_UFLOAT_BLOCK = 143,
546 VK_FORMAT_BC6H_SFLOAT_BLOCK = 144,
547 VK_FORMAT_BC7_UNORM_BLOCK = 145,
548 VK_FORMAT_BC7_SRGB_BLOCK = 146,
549 VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK = 147,
550 VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK = 148,
551 VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK = 149,
552 VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK = 150,
553 VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK = 151,
554 VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK = 152,
555 VK_FORMAT_EAC_R11_UNORM_BLOCK = 153,
556 VK_FORMAT_EAC_R11_SNORM_BLOCK = 154,
557 VK_FORMAT_EAC_R11G11_UNORM_BLOCK = 155,
558 VK_FORMAT_EAC_R11G11_SNORM_BLOCK = 156,
559 VK_FORMAT_ASTC_4x4_UNORM_BLOCK = 157,
560 VK_FORMAT_ASTC_4x4_SRGB_BLOCK = 158,
561 VK_FORMAT_ASTC_5x4_UNORM_BLOCK = 159,
562 VK_FORMAT_ASTC_5x4_SRGB_BLOCK = 160,
563 VK_FORMAT_ASTC_5x5_UNORM_BLOCK = 161,
564 VK_FORMAT_ASTC_5x5_SRGB_BLOCK = 162,
565 VK_FORMAT_ASTC_6x5_UNORM_BLOCK = 163,
566 VK_FORMAT_ASTC_6x5_SRGB_BLOCK = 164,
567 VK_FORMAT_ASTC_6x6_UNORM_BLOCK = 165,
568 VK_FORMAT_ASTC_6x6_SRGB_BLOCK = 166,
569 VK_FORMAT_ASTC_8x5_UNORM_BLOCK = 167,
570 VK_FORMAT_ASTC_8x5_SRGB_BLOCK = 168,
571 VK_FORMAT_ASTC_8x6_UNORM_BLOCK = 169,
572 VK_FORMAT_ASTC_8x6_SRGB_BLOCK = 170,
573 VK_FORMAT_ASTC_8x8_UNORM_BLOCK = 171,
574 VK_FORMAT_ASTC_8x8_SRGB_BLOCK = 172,
575 VK_FORMAT_ASTC_10x5_UNORM_BLOCK = 173,
576 VK_FORMAT_ASTC_10x5_SRGB_BLOCK = 174,
577 VK_FORMAT_ASTC_10x6_UNORM_BLOCK = 175,
578 VK_FORMAT_ASTC_10x6_SRGB_BLOCK = 176,
579 VK_FORMAT_ASTC_10x8_UNORM_BLOCK = 177,
580 VK_FORMAT_ASTC_10x8_SRGB_BLOCK = 178,
581 VK_FORMAT_ASTC_10x10_UNORM_BLOCK = 179,
582 VK_FORMAT_ASTC_10x10_SRGB_BLOCK = 180,
583 VK_FORMAT_ASTC_12x10_UNORM_BLOCK = 181,
584 VK_FORMAT_ASTC_12x10_SRGB_BLOCK = 182,
585 VK_FORMAT_ASTC_12x12_UNORM_BLOCK = 183,
586 VK_FORMAT_ASTC_12x12_SRGB_BLOCK = 184,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700587}
588
Jesse Halld27f6aa2015-08-15 17:58:48 -0700589/// Structure type enumerant
590enum VkStructureType {
591 VK_STRUCTURE_TYPE_APPLICATION_INFO = 0,
Jesse Hallc7467b72015-11-29 21:05:26 -0800592 VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO = 1,
593 VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO = 2,
594 VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO = 3,
595 VK_STRUCTURE_TYPE_SUBMIT_INFO = 4,
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800596 VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO = 5,
Jesse Hallc7467b72015-11-29 21:05:26 -0800597 VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE = 6,
598 VK_STRUCTURE_TYPE_BIND_SPARSE_INFO = 7,
599 VK_STRUCTURE_TYPE_FENCE_CREATE_INFO = 8,
600 VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO = 9,
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700601 VK_STRUCTURE_TYPE_EVENT_CREATE_INFO = 10,
Jesse Hallc7467b72015-11-29 21:05:26 -0800602 VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO = 11,
603 VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO = 12,
604 VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO = 13,
605 VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO = 14,
606 VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO = 15,
607 VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO = 16,
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800608 VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO = 17,
609 VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO = 18,
610 VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO = 19,
611 VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO = 20,
612 VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO = 21,
613 VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO = 22,
614 VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO = 23,
615 VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO = 24,
616 VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO = 25,
617 VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO = 26,
618 VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO = 27,
619 VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO = 28,
620 VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO = 29,
621 VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO = 30,
622 VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO = 31,
623 VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO = 32,
624 VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO = 33,
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800625 VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO = 34,
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800626 VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET = 35,
627 VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET = 36,
628 VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO = 37,
629 VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO = 38,
630 VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO = 39,
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800631 VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO = 40,
Jesse Hall3dd678a2016-01-08 21:52:01 -0800632 VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO = 41,
633 VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO = 42,
634 VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO = 43,
635 VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER = 44,
636 VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER = 45,
637 VK_STRUCTURE_TYPE_MEMORY_BARRIER = 46,
638 VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO = 47,
639 VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO = 48,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800640
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800641 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800642 VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR = 1000001000,
643 VK_STRUCTURE_TYPE_PRESENT_INFO_KHR = 1000001001,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800644
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800645 //@extension("VK_KHR_display")
Jesse Hallbd888842015-11-30 21:44:14 -0800646 VK_STRUCTURE_TYPE_DISPLAY_MODE_CREATE_INFO_KHR = 1000002000,
647 VK_STRUCTURE_TYPE_DISPLAY_SURFACE_CREATE_INFO_KHR = 1000002001,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800648
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800649 //@extension("VK_KHR_display_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800650 VK_STRUCTURE_TYPE_DISPLAY_DISPLAY_PRESENT_INFO_KHR = 1000003000,
Jesse Hallf9fa9a52016-01-08 16:08:51 -0800651
652 //@extension("VK_KHR_xlib_surface")
653 VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR = 1000004000,
654
655 //@extension("VK_KHR_xcb_surface")
656 VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR = 1000005000,
657
658 //@extension("VK_KHR_wayland_surface")
659 VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR = 1000006000,
660
661 //@extension("VK_KHR_mir_surface")
662 VK_STRUCTURE_TYPE_MIR_SURFACE_CREATE_INFO_KHR = 1000007000,
663
664 //@extension("VK_KHR_android_surface")
665 VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR = 1000008000,
666
667 //@extension("VK_KHR_win32_surface")
668 VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR = 1000009000,
Jesse Hall543a7ff2016-01-08 16:38:30 -0800669
Chia-I Wub262ddc2016-03-22 07:38:20 +0800670 //@extension("VK_ANDROID_native_buffer")
671 VK_STRUCTURE_TYPE_NATIVE_BUFFER_ANDROID = 1000010000,
672
Jesse Hall543a7ff2016-01-08 16:38:30 -0800673 //@extension("VK_EXT_debug_report")
Jesse Hall26763382016-05-20 07:13:52 -0700674 VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT = 1000011000,
675
676 //@extension("VK_AMD_rasterization_order")
677 VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD = 1000018000,
678
679 //@extension("VK_EXT_debug_marker")
680 VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_NAME_INFO_EXT = 1000022000,
681
682 //@extension("VK_EXT_debug_marker")
683 VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_TAG_INFO_EXT = 1000022001,
684
685 //@extension("VK_EXT_debug_marker")
686 VK_STRUCTURE_TYPE_DEBUG_MARKER_MARKER_INFO_EXT = 1000022002,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700687}
688
Jesse Hall65ab5522015-11-30 00:07:16 -0800689enum VkSubpassContents {
690 VK_SUBPASS_CONTENTS_INLINE = 0x00000000,
691 VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700692}
693
Jesse Hall543a7ff2016-01-08 16:38:30 -0800694enum VkPipelineCacheHeaderVersion {
695 VK_PIPELINE_CACHE_HEADER_VERSION_ONE = 1,
696}
697
Jesse Hallbd888842015-11-30 21:44:14 -0800698@lastUnused(-11)
Jesse Halld27f6aa2015-08-15 17:58:48 -0700699/// Error and return codes
700enum VkResult {
701 // Return codes for successful operation execution (positive values)
Jesse Hallbd888842015-11-30 21:44:14 -0800702 VK_SUCCESS = 0,
703 VK_NOT_READY = 1,
704 VK_TIMEOUT = 2,
705 VK_EVENT_SET = 3,
706 VK_EVENT_RESET = 4,
707 VK_INCOMPLETE = 5,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700708
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800709 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800710 VK_SUBOPTIMAL_KHR = 1000001003,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800711
Jesse Halld27f6aa2015-08-15 17:58:48 -0700712 // Error codes (negative values)
Jesse Hallbd888842015-11-30 21:44:14 -0800713 VK_ERROR_OUT_OF_HOST_MEMORY = 0xFFFFFFFF, // -1
714 VK_ERROR_OUT_OF_DEVICE_MEMORY = 0xFFFFFFFE, // -2
715 VK_ERROR_INITIALIZATION_FAILED = 0xFFFFFFFD, // -3
716 VK_ERROR_DEVICE_LOST = 0xFFFFFFFC, // -4
717 VK_ERROR_MEMORY_MAP_FAILED = 0xFFFFFFFB, // -5
718 VK_ERROR_LAYER_NOT_PRESENT = 0xFFFFFFFA, // -6
719 VK_ERROR_EXTENSION_NOT_PRESENT = 0xFFFFFFF9, // -7
720 VK_ERROR_FEATURE_NOT_PRESENT = 0xFFFFFFF8, // -8
721 VK_ERROR_INCOMPATIBLE_DRIVER = 0xFFFFFFF7, // -9
722 VK_ERROR_TOO_MANY_OBJECTS = 0xFFFFFFF6, // -10
723 VK_ERROR_FORMAT_NOT_SUPPORTED = 0xFFFFFFF5, // -11
Jesse Hall1356b0d2015-11-23 17:24:58 -0800724
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800725 //@extension("VK_KHR_surface")
Jesse Hallbd888842015-11-30 21:44:14 -0800726 VK_ERROR_SURFACE_LOST_KHR = 0xC4653600, // -1000000000
Jesse Halla6429252015-11-29 18:59:42 -0800727
Jesse Hall563380d2016-01-15 23:14:05 -0800728 //@extension("VK_KHR_surface")
729 VK_ERROR_NATIVE_WINDOW_IN_USE_KHR = 0xC46535FF, // -1000008001
730
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800731 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800732 VK_ERROR_OUT_OF_DATE_KHR = 0xC4653214, // -1000001004
Jesse Hall1356b0d2015-11-23 17:24:58 -0800733
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800734 //@extension("VK_KHR_display_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800735 VK_ERROR_INCOMPATIBLE_DISPLAY_KHR = 0xC4652A47, // -1000003001
Jesse Hall1356b0d2015-11-23 17:24:58 -0800736
Jesse Hall543a7ff2016-01-08 16:38:30 -0800737 //@extension("VK_EXT_debug_report")
738 VK_ERROR_VALIDATION_FAILED_EXT = 0xC4650B07, // -1000011001
Jesse Hall26763382016-05-20 07:13:52 -0700739
740 //@extension("VK_NV_glsl_shader")
741 VK_ERROR_INVALID_SHADER_NV = 0xC4650720, // -1000012000
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700742}
743
744enum VkDynamicState {
745 VK_DYNAMIC_STATE_VIEWPORT = 0x00000000,
746 VK_DYNAMIC_STATE_SCISSOR = 0x00000001,
747 VK_DYNAMIC_STATE_LINE_WIDTH = 0x00000002,
748 VK_DYNAMIC_STATE_DEPTH_BIAS = 0x00000003,
749 VK_DYNAMIC_STATE_BLEND_CONSTANTS = 0x00000004,
750 VK_DYNAMIC_STATE_DEPTH_BOUNDS = 0x00000005,
751 VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK = 0x00000006,
752 VK_DYNAMIC_STATE_STENCIL_WRITE_MASK = 0x00000007,
753 VK_DYNAMIC_STATE_STENCIL_REFERENCE = 0x00000008,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700754}
755
Jesse Hall523db342015-11-30 21:12:55 -0800756@extension("VK_KHR_surface")
Michael Lentine88594d72015-11-12 12:49:45 -0800757enum VkPresentModeKHR {
758 VK_PRESENT_MODE_IMMEDIATE_KHR = 0x00000000,
759 VK_PRESENT_MODE_MAILBOX_KHR = 0x00000001,
760 VK_PRESENT_MODE_FIFO_KHR = 0x00000002,
Jesse Hall03b6fe12015-11-24 12:44:21 -0800761 VK_PRESENT_MODE_FIFO_RELAXED_KHR = 0x00000003,
Michael Lentine88594d72015-11-12 12:49:45 -0800762}
763
Jesse Hall523db342015-11-30 21:12:55 -0800764@extension("VK_KHR_surface")
Michael Lentine88594d72015-11-12 12:49:45 -0800765enum VkColorSpaceKHR {
766 VK_COLORSPACE_SRGB_NONLINEAR_KHR = 0x00000000,
767}
Jesse Halld27f6aa2015-08-15 17:58:48 -0700768
Jesse Hall715b86a2016-01-16 16:34:29 -0800769@extension("VK_EXT_debug_report")
770enum VkDebugReportObjectTypeEXT {
771 VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT = 0,
772 VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT = 1,
773 VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT = 2,
774 VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT = 3,
775 VK_DEBUG_REPORT_OBJECT_TYPE_QUEUE_EXT = 4,
776 VK_DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT = 5,
777 VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT = 6,
778 VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT = 7,
779 VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT = 8,
780 VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT = 9,
781 VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT = 10,
782 VK_DEBUG_REPORT_OBJECT_TYPE_EVENT_EXT = 11,
783 VK_DEBUG_REPORT_OBJECT_TYPE_QUERY_POOL_EXT = 12,
784 VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_VIEW_EXT = 13,
785 VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_VIEW_EXT = 14,
786 VK_DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT = 15,
787 VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_CACHE_EXT = 16,
788 VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_LAYOUT_EXT = 17,
789 VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT = 18,
790 VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT = 19,
791 VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT_EXT = 20,
792 VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_EXT = 21,
793 VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT = 22,
794 VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT = 23,
795 VK_DEBUG_REPORT_OBJECT_TYPE_FRAMEBUFFER_EXT = 24,
796 VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_POOL_EXT = 25,
797 VK_DEBUG_REPORT_OBJECT_TYPE_SURFACE_KHR_EXT = 26,
798 VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT = 27,
799 VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_EXT = 28,
800}
801
802@extension("VK_EXT_debug_report")
803enum VkDebugReportErrorEXT {
804 VK_DEBUG_REPORT_ERROR_NONE_EXT = 0,
805 VK_DEBUG_REPORT_ERROR_CALLBACK_REF_EXT = 1,
806}
807
Jesse Hall26763382016-05-20 07:13:52 -0700808@extension("VK_AMD_rasterization_order")
809enum VkRasterizationOrderAMD {
810 VK_RASTERIZATION_ORDER_STRICT_AMD = 0,
811 VK_RASTERIZATION_ORDER_RELAXED_AMD = 1,
812}
813
Jesse Hall715b86a2016-01-16 16:34:29 -0800814
Jesse Halld27f6aa2015-08-15 17:58:48 -0700815/////////////////
816// Bitfields //
817/////////////////
818
Jesse Halld27f6aa2015-08-15 17:58:48 -0700819/// Queue capabilities
Jesse Halld8bade02015-11-24 10:24:18 -0800820type VkFlags VkQueueFlags
821bitfield VkQueueFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -0700822 VK_QUEUE_GRAPHICS_BIT = 0x00000001, /// Queue supports graphics operations
823 VK_QUEUE_COMPUTE_BIT = 0x00000002, /// Queue supports compute operations
Jesse Hall65ab5522015-11-30 00:07:16 -0800824 VK_QUEUE_TRANSFER_BIT = 0x00000004, /// Queue supports transfer operations
Jesse Hallb00daad2015-11-29 19:46:20 -0800825 VK_QUEUE_SPARSE_BINDING_BIT = 0x00000008, /// Queue supports sparse resource memory management operations
Jesse Halld27f6aa2015-08-15 17:58:48 -0700826}
827
828/// Memory properties passed into vkAllocMemory().
Jesse Halld8bade02015-11-24 10:24:18 -0800829type VkFlags VkMemoryPropertyFlags
830bitfield VkMemoryPropertyFlagBits {
Jesse Halld1af8122015-11-29 23:50:38 -0800831 VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT = 0x00000001,
832 VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT = 0x00000002,
833 VK_MEMORY_PROPERTY_HOST_COHERENT_BIT = 0x00000004,
834 VK_MEMORY_PROPERTY_HOST_CACHED_BIT = 0x00000008,
835 VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT = 0x00000010,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700836}
837
838/// Memory heap flags
Jesse Halld8bade02015-11-24 10:24:18 -0800839type VkFlags VkMemoryHeapFlags
840bitfield VkMemoryHeapFlagBits {
Jesse Halld1af8122015-11-29 23:50:38 -0800841 VK_MEMORY_HEAP_DEVICE_LOCAL_BIT = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700842}
843
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800844/// Access flags
845type VkFlags VkAccessFlags
846bitfield VkAccessFlagBits {
847 VK_ACCESS_INDIRECT_COMMAND_READ_BIT = 0x00000001,
848 VK_ACCESS_INDEX_READ_BIT = 0x00000002,
849 VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT = 0x00000004,
850 VK_ACCESS_UNIFORM_READ_BIT = 0x00000008,
851 VK_ACCESS_INPUT_ATTACHMENT_READ_BIT = 0x00000010,
852 VK_ACCESS_SHADER_READ_BIT = 0x00000020,
853 VK_ACCESS_SHADER_WRITE_BIT = 0x00000040,
854 VK_ACCESS_COLOR_ATTACHMENT_READ_BIT = 0x00000080,
855 VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT = 0x00000100,
856 VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT = 0x00000200,
857 VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT = 0x00000400,
858 VK_ACCESS_TRANSFER_READ_BIT = 0x00000800,
859 VK_ACCESS_TRANSFER_WRITE_BIT = 0x00001000,
860 VK_ACCESS_HOST_READ_BIT = 0x00002000,
861 VK_ACCESS_HOST_WRITE_BIT = 0x00004000,
862 VK_ACCESS_MEMORY_READ_BIT = 0x00008000,
863 VK_ACCESS_MEMORY_WRITE_BIT = 0x00010000,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700864}
865
866/// Buffer usage flags
Jesse Halld8bade02015-11-24 10:24:18 -0800867type VkFlags VkBufferUsageFlags
868bitfield VkBufferUsageFlagBits {
Jesse Hall3fbc8562015-11-29 22:10:52 -0800869 VK_BUFFER_USAGE_TRANSFER_SRC_BIT = 0x00000001, /// Can be used as a source of transfer operations
870 VK_BUFFER_USAGE_TRANSFER_DST_BIT = 0x00000002, /// Can be used as a destination of transfer operations
Jesse Halld27f6aa2015-08-15 17:58:48 -0700871 VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000004, /// Can be used as TBO
872 VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT = 0x00000008, /// Can be used as IBO
873 VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT = 0x00000010, /// Can be used as UBO
874 VK_BUFFER_USAGE_STORAGE_BUFFER_BIT = 0x00000020, /// Can be used as SSBO
875 VK_BUFFER_USAGE_INDEX_BUFFER_BIT = 0x00000040, /// Can be used as source of fixed function index fetch (index buffer)
876 VK_BUFFER_USAGE_VERTEX_BUFFER_BIT = 0x00000080, /// Can be used as source of fixed function vertex fetch (VBO)
877 VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT = 0x00000100, /// Can be the source of indirect parameters (e.g. indirect buffer, parameter buffer)
878}
879
880/// Buffer creation flags
Jesse Halld8bade02015-11-24 10:24:18 -0800881type VkFlags VkBufferCreateFlags
882bitfield VkBufferCreateFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700883 VK_BUFFER_CREATE_SPARSE_BINDING_BIT = 0x00000001, /// Buffer should support sparse backing
Jesse Halld27f6aa2015-08-15 17:58:48 -0700884 VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002, /// Buffer should support sparse backing with partial residency
885 VK_BUFFER_CREATE_SPARSE_ALIASED_BIT = 0x00000004, /// Buffer should support constent data access to physical memory blocks mapped into multiple locations of sparse buffers
886}
887
888/// Shader stage flags
Jesse Halld8bade02015-11-24 10:24:18 -0800889type VkFlags VkShaderStageFlags
890bitfield VkShaderStageFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -0700891 VK_SHADER_STAGE_VERTEX_BIT = 0x00000001,
Jesse Hallae38f732015-11-19 21:32:50 -0800892 VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT = 0x00000002,
893 VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700894 VK_SHADER_STAGE_GEOMETRY_BIT = 0x00000008,
895 VK_SHADER_STAGE_FRAGMENT_BIT = 0x00000010,
896 VK_SHADER_STAGE_COMPUTE_BIT = 0x00000020,
Jesse Hallc7467b72015-11-29 21:05:26 -0800897 VK_SHADER_STAGE_ALL_GRAPHICS = 0x0000001F,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700898
899 VK_SHADER_STAGE_ALL = 0x7FFFFFFF,
900}
901
Jesse Hallfbf97b02015-11-20 14:17:03 -0800902/// Descriptor pool create flags
Jesse Halld8bade02015-11-24 10:24:18 -0800903type VkFlags VkDescriptorPoolCreateFlags
904bitfield VkDescriptorPoolCreateFlagBits {
Jesse Hallfbf97b02015-11-20 14:17:03 -0800905 VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT = 0x00000001,
906}
907
908/// Descriptor pool reset flags
Jesse Halld8bade02015-11-24 10:24:18 -0800909type VkFlags VkDescriptorPoolResetFlags
Jesse Halla6429252015-11-29 18:59:42 -0800910//bitfield VkDescriptorPoolResetFlagBits {
911//}
Jesse Hallfbf97b02015-11-20 14:17:03 -0800912
Jesse Halld27f6aa2015-08-15 17:58:48 -0700913/// Image usage flags
Jesse Halld8bade02015-11-24 10:24:18 -0800914type VkFlags VkImageUsageFlags
915bitfield VkImageUsageFlagBits {
Jesse Hall3fbc8562015-11-29 22:10:52 -0800916 VK_IMAGE_USAGE_TRANSFER_SRC_BIT = 0x00000001, /// Can be used as a source of transfer operations
917 VK_IMAGE_USAGE_TRANSFER_DST_BIT = 0x00000002, /// Can be used as a destination of transfer operations
Jesse Halld27f6aa2015-08-15 17:58:48 -0700918 VK_IMAGE_USAGE_SAMPLED_BIT = 0x00000004, /// Can be sampled from (SAMPLED_IMAGE and COMBINED_IMAGE_SAMPLER descriptor types)
919 VK_IMAGE_USAGE_STORAGE_BIT = 0x00000008, /// Can be used as storage image (STORAGE_IMAGE descriptor type)
920 VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT = 0x00000010, /// Can be used as framebuffer color attachment
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700921 VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000020, /// Can be used as framebuffer depth/stencil attachment
Jesse Halld27f6aa2015-08-15 17:58:48 -0700922 VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT = 0x00000040, /// Image data not needed outside of rendering
923 VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT = 0x00000080, /// Can be used as framebuffer input attachment
924}
925
926/// Image creation flags
Jesse Halld8bade02015-11-24 10:24:18 -0800927type VkFlags VkImageCreateFlags
928bitfield VkImageCreateFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700929 VK_IMAGE_CREATE_SPARSE_BINDING_BIT = 0x00000001, /// Image should support sparse backing
Jesse Halld27f6aa2015-08-15 17:58:48 -0700930 VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002, /// Image should support sparse backing with partial residency
931 VK_IMAGE_CREATE_SPARSE_ALIASED_BIT = 0x00000004, /// Image should support constent data access to physical memory blocks mapped into multiple locations of sparse images
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700932 VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT = 0x00000008, /// Allows image views to have different format than the base image
933 VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT = 0x00000010, /// Allows creating image views with cube type from the created image
Jesse Halld27f6aa2015-08-15 17:58:48 -0700934}
935
Jesse Hallb00daad2015-11-29 19:46:20 -0800936/// Image view creation flags
Jesse Halld8bade02015-11-24 10:24:18 -0800937type VkFlags VkImageViewCreateFlags
Jesse Hallb00daad2015-11-29 19:46:20 -0800938//bitfield VkImageViewCreateFlagBits {
939//}
Jesse Halld27f6aa2015-08-15 17:58:48 -0700940
941/// Pipeline creation flags
Jesse Halld8bade02015-11-24 10:24:18 -0800942type VkFlags VkPipelineCreateFlags
943bitfield VkPipelineCreateFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -0700944 VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT = 0x00000001,
945 VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT = 0x00000002,
946 VK_PIPELINE_CREATE_DERIVATIVE_BIT = 0x00000004,
947}
948
Jesse Hall65ab5522015-11-30 00:07:16 -0800949/// Color component flags
950type VkFlags VkColorComponentFlags
951bitfield VkColorComponentFlagBits {
952 VK_COLOR_COMPONENT_R_BIT = 0x00000001,
953 VK_COLOR_COMPONENT_G_BIT = 0x00000002,
954 VK_COLOR_COMPONENT_B_BIT = 0x00000004,
955 VK_COLOR_COMPONENT_A_BIT = 0x00000008,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700956}
957
958/// Fence creation flags
Jesse Halld8bade02015-11-24 10:24:18 -0800959type VkFlags VkFenceCreateFlags
960bitfield VkFenceCreateFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -0700961 VK_FENCE_CREATE_SIGNALED_BIT = 0x00000001,
962}
963
964/// Semaphore creation flags
Jesse Halld8bade02015-11-24 10:24:18 -0800965type VkFlags VkSemaphoreCreateFlags
Jesse Halla6429252015-11-29 18:59:42 -0800966//bitfield VkSemaphoreCreateFlagBits {
967//}
Jesse Halld27f6aa2015-08-15 17:58:48 -0700968
969/// Format capability flags
Jesse Halld8bade02015-11-24 10:24:18 -0800970type VkFlags VkFormatFeatureFlags
971bitfield VkFormatFeatureFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -0700972 VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT = 0x00000001, /// Format can be used for sampled images (SAMPLED_IMAGE and COMBINED_IMAGE_SAMPLER descriptor types)
973 VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT = 0x00000002, /// Format can be used for storage images (STORAGE_IMAGE descriptor type)
974 VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT = 0x00000004, /// Format supports atomic operations in case it's used for storage images
975 VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000008, /// Format can be used for uniform texel buffers (TBOs)
976 VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT = 0x00000010, /// Format can be used for storage texel buffers (IBOs)
977 VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT = 0x00000020, /// Format supports atomic operations in case it's used for storage texel buffers
978 VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT = 0x00000040, /// Format can be used for vertex buffers (VBOs)
979 VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT = 0x00000080, /// Format can be used for color attachment images
980 VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT = 0x00000100, /// Format supports blending in case it's used for color attachment images
981 VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000200, /// Format can be used for depth/stencil attachment images
Jesse Hall3fbc8562015-11-29 22:10:52 -0800982 VK_FORMAT_FEATURE_BLIT_SRC_BIT = 0x00000400, /// Format can be used as the source image of blits with vkCommandBlitImage
983 VK_FORMAT_FEATURE_BLIT_DST_BIT = 0x00000800, /// Format can be used as the destination image of blits with vkCommandBlitImage
Jesse Hall33faaad2016-01-24 21:00:49 -0800984 VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT = 0x00001000,
Jesse Hall26763382016-05-20 07:13:52 -0700985
986 //@extension("VK_IMG_filter_cubic")
987 VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG = 0x00002000,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700988}
989
990/// Query control flags
Jesse Halld8bade02015-11-24 10:24:18 -0800991type VkFlags VkQueryControlFlags
992bitfield VkQueryControlFlagBits {
Jesse Hall65ab5522015-11-30 00:07:16 -0800993 VK_QUERY_CONTROL_PRECISE_BIT = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700994}
995
996/// Query result flags
Jesse Halld8bade02015-11-24 10:24:18 -0800997type VkFlags VkQueryResultFlags
998bitfield VkQueryResultFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -0700999 VK_QUERY_RESULT_64_BIT = 0x00000001, /// Results of the queries are written to the destination buffer as 64-bit values
1000 VK_QUERY_RESULT_WAIT_BIT = 0x00000002, /// Results of the queries are waited on before proceeding with the result copy
1001 VK_QUERY_RESULT_WITH_AVAILABILITY_BIT = 0x00000004, /// Besides the results of the query, the availability of the results is also written
1002 VK_QUERY_RESULT_PARTIAL_BIT = 0x00000008, /// Copy the partial results of the query even if the final results aren't available
1003}
1004
1005/// Shader module creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001006type VkFlags VkShaderModuleCreateFlags
Jesse Halla6429252015-11-29 18:59:42 -08001007//bitfield VkShaderModuleCreateFlagBits {
1008//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001009
Jesse Halld27f6aa2015-08-15 17:58:48 -07001010/// Event creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001011type VkFlags VkEventCreateFlags
Jesse Halla6429252015-11-29 18:59:42 -08001012//bitfield VkEventCreateFlagBits {
1013//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001014
Jesse Halla15a4bf2015-11-19 22:48:02 -08001015/// Command buffer usage flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001016type VkFlags VkCommandBufferUsageFlags
1017bitfield VkCommandBufferUsageFlagBits {
1018 VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT = 0x00000001,
1019 VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT = 0x00000002,
1020 VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001021}
1022
1023/// Pipeline statistics flags
Jesse Halld8bade02015-11-24 10:24:18 -08001024type VkFlags VkQueryPipelineStatisticFlags
1025bitfield VkQueryPipelineStatisticFlagBits {
Jesse Hallae38f732015-11-19 21:32:50 -08001026 VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_BIT = 0x00000001, /// Optional
1027 VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_PRIMITIVES_BIT = 0x00000002, /// Optional
1028 VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT = 0x00000004, /// Optional
1029 VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_INVOCATIONS_BIT = 0x00000008, /// Optional
1030 VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT = 0x00000010, /// Optional
1031 VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT = 0x00000020, /// Optional
1032 VK_QUERY_PIPELINE_STATISTIC_CLIPPING_PRIMITIVES_BIT = 0x00000040, /// Optional
1033 VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT = 0x00000080, /// Optional
1034 VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT = 0x00000100, /// Optional
1035 VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT = 0x00000200, /// Optional
1036 VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT = 0x00000400, /// Optional
Jesse Halld27f6aa2015-08-15 17:58:48 -07001037}
1038
1039/// Memory mapping flags
Jesse Halld8bade02015-11-24 10:24:18 -08001040type VkFlags VkMemoryMapFlags
Jesse Halla6429252015-11-29 18:59:42 -08001041//bitfield VkMemoryMapFlagBits {
1042//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001043
1044/// Bitfield of image aspects
Jesse Halld8bade02015-11-24 10:24:18 -08001045type VkFlags VkImageAspectFlags
1046bitfield VkImageAspectFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001047 VK_IMAGE_ASPECT_COLOR_BIT = 0x00000001,
1048 VK_IMAGE_ASPECT_DEPTH_BIT = 0x00000002,
1049 VK_IMAGE_ASPECT_STENCIL_BIT = 0x00000004,
1050 VK_IMAGE_ASPECT_METADATA_BIT = 0x00000008,
1051}
1052
1053/// Sparse memory bind flags
Jesse Halld8bade02015-11-24 10:24:18 -08001054type VkFlags VkSparseMemoryBindFlags
Jesse Hall091ed9e2015-11-30 00:55:29 -08001055bitfield VkSparseMemoryBindFlagBits {
1056 VK_SPARSE_MEMORY_BIND_METADATA_BIT = 0x00000001,
1057}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001058
1059/// Sparse image memory requirements flags
Jesse Halld8bade02015-11-24 10:24:18 -08001060type VkFlags VkSparseImageFormatFlags
1061bitfield VkSparseImageFormatFlagBits {
Jesse Hallb00daad2015-11-29 19:46:20 -08001062 VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT = 0x00000001, /// Image uses a single miptail region for all array slices
1063 VK_SPARSE_IMAGE_FORMAT_ALIGNED_MIP_SIZE_BIT = 0x00000002, /// Image requires mip levels to be an exact multiple of the sparse iamge block size for non-mip-tail levels.
1064 VK_SPARSE_IMAGE_FORMAT_NONSTANDARD_BLOCK_SIZE_BIT = 0x00000004, /// Image uses a non-standard sparse block size
Jesse Halld27f6aa2015-08-15 17:58:48 -07001065}
1066
1067/// Pipeline stages
Jesse Halld8bade02015-11-24 10:24:18 -08001068type VkFlags VkPipelineStageFlags
1069bitfield VkPipelineStageFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001070 VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT = 0x00000001, /// Before subsequent commands are processed
1071 VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT = 0x00000002, /// Draw/DispatchIndirect command fetch
1072 VK_PIPELINE_STAGE_VERTEX_INPUT_BIT = 0x00000004, /// Vertex/index fetch
1073 VK_PIPELINE_STAGE_VERTEX_SHADER_BIT = 0x00000008, /// Vertex shading
Jesse Hallae38f732015-11-19 21:32:50 -08001074 VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT = 0x00000010, /// Tessellation control shading
1075 VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT = 0x00000020, /// Tessellation evaluation shading
Jesse Halld27f6aa2015-08-15 17:58:48 -07001076 VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT = 0x00000040, /// Geometry shading
1077 VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT = 0x00000080, /// Fragment shading
1078 VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT = 0x00000100, /// Early fragment (depth/stencil) tests
1079 VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT = 0x00000200, /// Late fragment (depth/stencil) tests
1080 VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT = 0x00000400, /// Color attachment writes
1081 VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT = 0x00000800, /// Compute shading
1082 VK_PIPELINE_STAGE_TRANSFER_BIT = 0x00001000, /// Transfer/copy operations
Jesse Hall543a7ff2016-01-08 16:38:30 -08001083 VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT = 0x00002000,
1084 VK_PIPELINE_STAGE_HOST_BIT = 0x00004000, /// Indicates host (CPU) is a source/sink of the dependency
Jesse Halld27f6aa2015-08-15 17:58:48 -07001085
Jesse Hall543a7ff2016-01-08 16:38:30 -08001086 VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT = 0x00008000, /// All stages of the graphics pipeline
1087 VK_PIPELINE_STAGE_ALL_COMMANDS_BIT = 0x00010000, /// All graphics, compute, copy, and transition commands
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001088}
1089
1090/// Render pass attachment description flags
Jesse Halld8bade02015-11-24 10:24:18 -08001091type VkFlags VkAttachmentDescriptionFlags
1092bitfield VkAttachmentDescriptionFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001093 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 -07001094}
1095
1096/// Subpass description flags
Jesse Halld8bade02015-11-24 10:24:18 -08001097type VkFlags VkSubpassDescriptionFlags
1098bitfield VkSubpassDescriptionFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001099}
1100
1101/// Command pool creation flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001102type VkFlags VkCommandPoolCreateFlags
1103bitfield VkCommandPoolCreateFlagBits {
1104 VK_COMMAND_POOL_CREATE_TRANSIENT_BIT = 0x00000001, /// Command buffers have a short lifetime
1105 VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT = 0x00000002, /// Command buffers may release their memory individually
Jesse Halld27f6aa2015-08-15 17:58:48 -07001106}
1107
1108/// Command pool reset flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001109type VkFlags VkCommandPoolResetFlags
1110bitfield VkCommandPoolResetFlagBits {
1111 VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT = 0x00000001, /// Release resources owned by the pool
Jesse Halld27f6aa2015-08-15 17:58:48 -07001112}
1113
Jesse Hall3fbc8562015-11-29 22:10:52 -08001114type VkFlags VkCommandBufferResetFlags
1115bitfield VkCommandBufferResetFlagBits {
1116 VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT = 0x00000001, /// Release resources owned by the buffer
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001117}
1118
Jesse Halld8bade02015-11-24 10:24:18 -08001119type VkFlags VkSampleCountFlags
1120bitfield VkSampleCountFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001121 VK_SAMPLE_COUNT_1_BIT = 0x00000001,
1122 VK_SAMPLE_COUNT_2_BIT = 0x00000002,
1123 VK_SAMPLE_COUNT_4_BIT = 0x00000004,
1124 VK_SAMPLE_COUNT_8_BIT = 0x00000008,
1125 VK_SAMPLE_COUNT_16_BIT = 0x00000010,
1126 VK_SAMPLE_COUNT_32_BIT = 0x00000020,
1127 VK_SAMPLE_COUNT_64_BIT = 0x00000040,
1128}
1129
Jesse Halld8bade02015-11-24 10:24:18 -08001130type VkFlags VkStencilFaceFlags
1131bitfield VkStencilFaceFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001132 VK_STENCIL_FACE_FRONT_BIT = 0x00000001, /// Front face
1133 VK_STENCIL_FACE_BACK_BIT = 0x00000002, /// Back face
Jesse Hallc7467b72015-11-29 21:05:26 -08001134 VK_STENCIL_FRONT_AND_BACK = 0x00000003,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001135}
1136
Jesse Halla6429252015-11-29 18:59:42 -08001137/// Instance creation flags
1138type VkFlags VkInstanceCreateFlags
1139//bitfield VkInstanceCreateFlagBits {
1140//}
1141
1142/// Device creation flags
1143type VkFlags VkDeviceCreateFlags
1144//bitfield VkDeviceCreateFlagBits {
1145//}
1146
1147/// Device queue creation flags
1148type VkFlags VkDeviceQueueCreateFlags
1149//bitfield VkDeviceQueueCreateFlagBits {
1150//}
1151
1152/// Query pool creation flags
1153type VkFlags VkQueryPoolCreateFlags
1154//bitfield VkQueryPoolCreateFlagBits {
1155//}
1156
1157/// Buffer view creation flags
1158type VkFlags VkBufferViewCreateFlags
1159//bitfield VkBufferViewCreateFlagBits {
1160//}
1161
1162/// Pipeline cache creation flags
1163type VkFlags VkPipelineCacheCreateFlags
1164//bitfield VkPipelineCacheCreateFlagBits {
1165//}
1166
1167/// Pipeline shader stage creation flags
1168type VkFlags VkPipelineShaderStageCreateFlags
1169//bitfield VkPipelineShaderStageCreateFlagBits {
1170//}
1171
1172/// Descriptor set layout creation flags
1173type VkFlags VkDescriptorSetLayoutCreateFlags
1174//bitfield VkDescriptorSetLayoutCreateFlagBits {
1175//}
1176
1177/// Pipeline vertex input state creation flags
1178type VkFlags VkPipelineVertexInputStateCreateFlags
1179//bitfield VkPipelineVertexInputStateCreateFlagBits {
1180//}
1181
1182/// Pipeline input assembly state creation flags
1183type VkFlags VkPipelineInputAssemblyStateCreateFlags
1184//bitfield VkPipelineInputAssemblyStateCreateFlagBits {
1185//}
1186
1187/// Tessellation state creation flags
1188type VkFlags VkPipelineTessellationStateCreateFlags
1189//bitfield VkPipelineTessellationStateCreateFlagBits {
1190//}
1191
1192/// Viewport state creation flags
1193type VkFlags VkPipelineViewportStateCreateFlags
1194//bitfield VkPipelineViewportStateCreateFlagBits {
1195//}
1196
Jesse Hall3fbc8562015-11-29 22:10:52 -08001197/// Rasterization state creation flags
1198type VkFlags VkPipelineRasterizationStateCreateFlags
1199//bitfield VkPipelineRasterizationStateCreateFlagBits {
Jesse Halla6429252015-11-29 18:59:42 -08001200//}
1201
1202/// Multisample state creation flags
1203type VkFlags VkPipelineMultisampleStateCreateFlags
1204//bitfield VkPipelineMultisampleStateCreateFlagBits {
1205//}
1206
1207/// Color blend state creation flags
1208type VkFlags VkPipelineColorBlendStateCreateFlags
1209//bitfield VkPipelineColorBlendStateCreateFlagBits {
1210//}
1211
1212/// Depth/stencil state creation flags
1213type VkFlags VkPipelineDepthStencilStateCreateFlags
1214//bitfield VkPipelineDepthStencilStateCreateFlagBits {
1215//}
1216
1217/// Dynamic state creation flags
1218type VkFlags VkPipelineDynamicStateCreateFlags
1219//bitfield VkPipelineDynamicStateCreateFlagBits {
1220//}
1221
1222/// Pipeline layout creation flags
1223type VkFlags VkPipelineLayoutCreateFlags
1224//bitfield VkPipelineLayoutCreateFlagBits {
1225//}
1226
1227/// Sampler creation flags
1228type VkFlags VkSamplerCreateFlags
1229//bitfield VkSamplerCreateFlagBits {
1230//}
1231
1232/// Render pass creation flags
1233type VkFlags VkRenderPassCreateFlags
1234//bitfield VkRenderPassCreateFlagBits {
1235//}
1236
1237/// Framebuffer creation flags
1238type VkFlags VkFramebufferCreateFlags
1239//bitfield VkFramebufferCreateFlagBits {
1240//}
1241
Jesse Halldc6d36c2015-11-29 19:12:15 -08001242/// Dependency flags
1243type VkFlags VkDependencyFlags
1244bitfield VkDependencyFlagBits {
1245 VK_DEPENDENCY_BY_REGION_BIT = 0x00000001,
1246}
1247
Jesse Hallc7467b72015-11-29 21:05:26 -08001248/// Cull mode flags
1249type VkFlags VkCullModeFlags
1250bitfield VkCullModeFlagBits {
1251 VK_CULL_MODE_NONE = 0x00000000,
1252 VK_CULL_MODE_FRONT_BIT = 0x00000001,
1253 VK_CULL_MODE_BACK_BIT = 0x00000002,
1254 VK_CULL_MODE_FRONT_AND_BACK = 0x00000003,
1255}
1256
Jesse Hall523db342015-11-30 21:12:55 -08001257@extension("VK_KHR_surface")
Jesse Halld8bade02015-11-24 10:24:18 -08001258type VkFlags VkSurfaceTransformFlagsKHR
Jesse Hall523db342015-11-30 21:12:55 -08001259@extension("VK_KHR_surface")
Jesse Halld8bade02015-11-24 10:24:18 -08001260bitfield VkSurfaceTransformFlagBitsKHR {
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001261 VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR = 0x00000001,
Jesse Hall9ba8bc82015-11-30 16:22:16 -08001262 VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR = 0x00000002,
1263 VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR = 0x00000004,
1264 VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR = 0x00000008,
1265 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR = 0x00000010,
1266 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR = 0x00000020,
1267 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR = 0x00000040,
1268 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR = 0x00000080,
1269 VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR = 0x00000100,
Michael Lentine88594d72015-11-12 12:49:45 -08001270}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001271
Jesse Hall523db342015-11-30 21:12:55 -08001272@extension("VK_KHR_surface")
Jesse Halla6429252015-11-29 18:59:42 -08001273type VkFlags VkCompositeAlphaFlagsKHR
Jesse Hall523db342015-11-30 21:12:55 -08001274@extension("VK_KHR_surface")
Jesse Halla6429252015-11-29 18:59:42 -08001275bitfield VkCompositeAlphaFlagBitsKHR {
1276 VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR = 0x00000001,
1277 VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR = 0x00000002,
1278 VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR = 0x00000004,
1279 VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR = 0x00000008,
1280}
1281
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001282@extension("VK_KHR_swapchain")
1283type VkFlags VkSwapchainCreateFlagsKHR
1284//@extension("VK_KHR_swapchain")
1285//bitfield VkSwapchainCreateFlagBitsKHR {
1286//}
1287
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001288@extension("VK_KHR_display")
Jesse Halld8bade02015-11-24 10:24:18 -08001289type VkFlags VkDisplayPlaneAlphaFlagsKHR
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001290@extension("VK_KHR_display")
Jesse Halld8bade02015-11-24 10:24:18 -08001291bitfield VkDisplayPlaneAlphaFlagBitsKHR {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001292 VK_DISPLAY_PLANE_ALPHA_OPAQUE_BIT_KHR = 0x00000001,
1293 VK_DISPLAY_PLANE_ALPHA_GLOBAL_BIT_KHR = 0x00000002,
1294 VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_BIT_KHR = 0x00000004,
1295 VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_PREMULTIPLIED_BIT_KHR = 0x00000008,
Jesse Hall1356b0d2015-11-23 17:24:58 -08001296}
1297
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001298@extension("VK_KHR_display")
1299type VkFlags VkDisplaySurfaceCreateFlagsKHR
1300//@extension("VK_KHR_display")
1301//bitfield VkDisplaySurfaceCreateFlagBitsKHR {
1302//}
1303
Jesse Hall9ba8bc82015-11-30 16:22:16 -08001304@extension("VK_KHR_display")
1305type VkFlags VkDisplayModeCreateFlagsKHR
1306//@extension("VK_KHR_display")
1307//bitfield VkDisplayModeCreateFlagBitsKHR {
1308//}
1309
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001310@extension("VK_KHR_xlib_surface")
1311type VkFlags VkXlibSurfaceCreateFlagsKHR
1312//@extension("VK_KHR_xlib_surface")
1313//bitfield VkXlibSurfaceCreateFlagBitsKHR {
1314//}
1315
1316@extension("VK_KHR_xcb_surface")
1317type VkFlags VkXcbSurfaceCreateFlagsKHR
1318//@extension("VK_KHR_xcb_surface")
1319//bitfield VkXcbSurfaceCreateFlagBitsKHR {
1320//}
1321
1322@extension("VK_KHR_wayland_surface")
1323type VkFlags VkWaylandSurfaceCreateFlagsKHR
1324//@extension("VK_KHR_wayland_surface")
1325//bitfield VkWaylandSurfaceCreateFlagBitsKHR {
1326//}
1327
1328@extension("VK_KHR_mir_surface")
1329type VkFlags VkMirSurfaceCreateFlagsKHR
1330//@extension("VK_KHR_mir_surface")
1331//bitfield VkMirSurfaceCreateFlagBitsKHR {
1332//}
1333
1334@extension("VK_KHR_android_surface")
1335type VkFlags VkAndroidSurfaceCreateFlagsKHR
1336//@extension("VK_KHR_android_surface")
1337//bitfield VkAndroidSurfaceCreateFlagBitsKHR {
1338//}
1339
1340@extension("VK_KHR_win32_surface")
1341type VkFlags VkWin32SurfaceCreateFlagsKHR
1342//@extension("VK_KHR_win32_surface")
1343//bitfield VkWin32SurfaceCreateFlagBitsKHR {
1344//}
1345
Jesse Hall715b86a2016-01-16 16:34:29 -08001346@extension("VK_EXT_debug_report")
1347type VkFlags VkDebugReportFlagsEXT
1348@extension("VK_EXT_debug_report")
1349bitfield VkDebugReportFlagBitsEXT {
Jesse Halle2948d82016-02-25 04:19:32 -08001350 VK_DEBUG_REPORT_INFORMATION_BIT_EXT = 0x00000001,
1351 VK_DEBUG_REPORT_WARNING_BIT_EXT = 0x00000002,
1352 VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT = 0x00000004,
Jesse Hall715b86a2016-01-16 16:34:29 -08001353 VK_DEBUG_REPORT_ERROR_BIT_EXT = 0x00000008,
1354 VK_DEBUG_REPORT_DEBUG_BIT_EXT = 0x00000010,
1355}
1356
Jesse Hall1356b0d2015-11-23 17:24:58 -08001357
Jesse Halld27f6aa2015-08-15 17:58:48 -07001358//////////////////
1359// Structures //
1360//////////////////
1361
1362class VkOffset2D {
1363 s32 x
1364 s32 y
1365}
1366
1367class VkOffset3D {
1368 s32 x
1369 s32 y
1370 s32 z
1371}
1372
1373class VkExtent2D {
Jesse Hall3dd678a2016-01-08 21:52:01 -08001374 u32 width
1375 u32 height
Jesse Halld27f6aa2015-08-15 17:58:48 -07001376}
1377
1378class VkExtent3D {
Jesse Hall3dd678a2016-01-08 21:52:01 -08001379 u32 width
1380 u32 height
1381 u32 depth
Jesse Halld27f6aa2015-08-15 17:58:48 -07001382}
1383
1384class VkViewport {
Jesse Hall65ab5522015-11-30 00:07:16 -08001385 f32 x
1386 f32 y
Jesse Halld27f6aa2015-08-15 17:58:48 -07001387 f32 width
1388 f32 height
1389 f32 minDepth
1390 f32 maxDepth
1391}
1392
1393class VkRect2D {
1394 VkOffset2D offset
1395 VkExtent2D extent
1396}
1397
Jesse Halla15a4bf2015-11-19 22:48:02 -08001398class VkClearRect {
1399 VkRect2D rect
1400 u32 baseArrayLayer
Jesse Hall3fbc8562015-11-29 22:10:52 -08001401 u32 layerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001402}
1403
Jesse Hall65ab5522015-11-30 00:07:16 -08001404class VkComponentMapping {
1405 VkComponentSwizzle r
1406 VkComponentSwizzle g
1407 VkComponentSwizzle b
1408 VkComponentSwizzle a
Jesse Halld27f6aa2015-08-15 17:58:48 -07001409}
1410
1411class VkPhysicalDeviceProperties {
1412 u32 apiVersion
1413 u32 driverVersion
Jesse Hall65ab5522015-11-30 00:07:16 -08001414 u32 vendorID
1415 u32 deviceID
Jesse Halld27f6aa2015-08-15 17:58:48 -07001416 VkPhysicalDeviceType deviceType
Jesse Hall65ab5522015-11-30 00:07:16 -08001417 char[VK_MAX_PHYSICAL_DEVICE_NAME_SIZE] deviceName
1418 u8[VK_UUID_SIZE] pipelineCacheUUID
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001419 VkPhysicalDeviceLimits limits
1420 VkPhysicalDeviceSparseProperties sparseProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07001421}
1422
1423class VkExtensionProperties {
Jesse Hall65ab5522015-11-30 00:07:16 -08001424 char[VK_MAX_EXTENSION_NAME_SIZE] extensionName /// extension name
Jesse Halld27f6aa2015-08-15 17:58:48 -07001425 u32 specVersion /// version of the extension specification implemented
1426}
1427
1428class VkLayerProperties {
Jesse Hall65ab5522015-11-30 00:07:16 -08001429 char[VK_MAX_EXTENSION_NAME_SIZE] layerName /// layer name
Jesse Hall3fbc8562015-11-29 22:10:52 -08001430 u32 specVersion /// version of the layer specification implemented
1431 u32 implementationVersion /// build or release version of the layer's library
Jesse Hall65ab5522015-11-30 00:07:16 -08001432 char[VK_MAX_DESCRIPTION_SIZE] description /// Free-form description of the layer
Jesse Halld27f6aa2015-08-15 17:58:48 -07001433}
1434
Jesse Halla366a512015-11-19 22:30:07 -08001435class VkSubmitInfo {
Jesse Hall03b6fe12015-11-24 12:44:21 -08001436 VkStructureType sType /// Type of structure. Should be VK_STRUCTURE_TYPE_SUBMIT_INFO
1437 const void* pNext /// Next structure in chain
1438 u32 waitSemaphoreCount
Jesse Halla366a512015-11-19 22:30:07 -08001439 const VkSemaphore* pWaitSemaphores
Jesse Hall543a7ff2016-01-08 16:38:30 -08001440 const VkPipelineStageFlags* pWaitDstStageMask
Jesse Hall03b6fe12015-11-24 12:44:21 -08001441 u32 commandBufferCount
Jesse Hall3fbc8562015-11-29 22:10:52 -08001442 const VkCommandBuffer* pCommandBuffers
Jesse Hall03b6fe12015-11-24 12:44:21 -08001443 u32 signalSemaphoreCount
Jesse Halla366a512015-11-19 22:30:07 -08001444 const VkSemaphore* pSignalSemaphores
1445}
1446
Jesse Halld27f6aa2015-08-15 17:58:48 -07001447class VkApplicationInfo {
1448 VkStructureType sType /// Type of structure. Should be VK_STRUCTURE_TYPE_APPLICATION_INFO
1449 const void* pNext /// Next structure in chain
Jesse Hall3fbc8562015-11-29 22:10:52 -08001450 const char* pApplicationName
1451 u32 applicationVersion
Jesse Halld27f6aa2015-08-15 17:58:48 -07001452 const char* pEngineName
1453 u32 engineVersion
1454 u32 apiVersion
1455}
1456
Jesse Hall3fbc8562015-11-29 22:10:52 -08001457class VkAllocationCallbacks {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001458 void* pUserData
Jesse Hall3fbc8562015-11-29 22:10:52 -08001459 PFN_vkAllocationFunction pfnAllocation
1460 PFN_vkReallocationFunction pfnReallocation
Jesse Halld27f6aa2015-08-15 17:58:48 -07001461 PFN_vkFreeFunction pfnFree
Jesse Hall3fbc8562015-11-29 22:10:52 -08001462 PFN_vkInternalAllocationNotification pfnInternalAllocation
Jesse Hall03b6fe12015-11-24 12:44:21 -08001463 PFN_vkInternalFreeNotification pfnInternalFree
Jesse Halld27f6aa2015-08-15 17:58:48 -07001464}
1465
1466class VkDeviceQueueCreateInfo {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001467 VkStructureType sStype /// Should be VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO
1468 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001469 VkDeviceQueueCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001470 u32 queueFamilyIndex
Jesse Halldba27f72015-11-30 14:25:46 -08001471 u32 queueCount
Jesse Hallfbf97b02015-11-20 14:17:03 -08001472 const f32* pQueuePriorities
Jesse Halld27f6aa2015-08-15 17:58:48 -07001473}
1474
1475class VkDeviceCreateInfo {
1476 VkStructureType sType /// Should be VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO
1477 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001478 VkDeviceCreateFlags flags
Jesse Halldba27f72015-11-30 14:25:46 -08001479 u32 queueCreateInfoCount
1480 const VkDeviceQueueCreateInfo* pQueueCreateInfos
Jesse Hall3dd678a2016-01-08 21:52:01 -08001481 u32 enabledLayerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001482 const char* const* ppEnabledLayerNames /// Ordered list of layer names to be enabled
Jesse Hall3dd678a2016-01-08 21:52:01 -08001483 u32 enabledExtensionCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001484 const char* const* ppEnabledExtensionNames
1485 const VkPhysicalDeviceFeatures* pEnabledFeatures
Jesse Halld27f6aa2015-08-15 17:58:48 -07001486}
1487
1488class VkInstanceCreateInfo {
1489 VkStructureType sType /// Should be VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO
1490 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001491 VkInstanceCreateFlags flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001492 const VkApplicationInfo* pApplicationInfo
Jesse Hall3dd678a2016-01-08 21:52:01 -08001493 u32 enabledLayerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001494 const char* const* ppEnabledLayerNames /// Ordered list of layer names to be enabled
Jesse Hall3dd678a2016-01-08 21:52:01 -08001495 u32 enabledExtensionCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001496 const char* const* ppEnabledExtensionNames /// Extension names to be enabled
1497}
1498
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001499class VkQueueFamilyProperties {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001500 VkQueueFlags queueFlags /// Queue flags
1501 u32 queueCount
Jesse Hallacfa5342015-11-19 21:51:33 -08001502 u32 timestampValidBits
Jesse Hall65ab5522015-11-30 00:07:16 -08001503 VkExtent3D minImageTransferGranularity
Jesse Halld27f6aa2015-08-15 17:58:48 -07001504}
1505
1506class VkPhysicalDeviceMemoryProperties {
1507 u32 memoryTypeCount
1508 VkMemoryType[VK_MAX_MEMORY_TYPES] memoryTypes
1509 u32 memoryHeapCount
1510 VkMemoryHeap[VK_MAX_MEMORY_HEAPS] memoryHeaps
1511}
1512
Jesse Hall3fbc8562015-11-29 22:10:52 -08001513class VkMemoryAllocateInfo {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001514 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07001515 const void* pNext /// Pointer to next structure
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001516 VkDeviceSize allocationSize /// Size of memory allocation
Jesse Halld27f6aa2015-08-15 17:58:48 -07001517 u32 memoryTypeIndex /// Index of the of the memory type to allocate from
1518}
1519
1520class VkMemoryRequirements {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001521 VkDeviceSize size /// Specified in bytes
1522 VkDeviceSize alignment /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001523 u32 memoryTypeBits /// Bitfield of the allowed memory type indices into memoryTypes[] for this object
1524}
1525
1526class VkSparseImageFormatProperties {
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001527 VkImageAspectFlagBits aspectMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001528 VkExtent3D imageGranularity
1529 VkSparseImageFormatFlags flags
1530}
1531
1532class VkSparseImageMemoryRequirements {
Jesse Hallb00daad2015-11-29 19:46:20 -08001533 VkSparseImageFormatProperties formatProperties
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001534 u32 imageMipTailFirstLod
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001535 VkDeviceSize imageMipTailSize /// Specified in bytes, must be a multiple of image block size / alignment
1536 VkDeviceSize imageMipTailOffset /// Specified in bytes, must be a multiple of image block size / alignment
1537 VkDeviceSize imageMipTailStride /// Specified in bytes, must be a multiple of image block size / alignment
Jesse Halld27f6aa2015-08-15 17:58:48 -07001538}
1539
1540class VkMemoryType {
1541 VkMemoryPropertyFlags propertyFlags /// Memory properties of this memory type
1542 u32 heapIndex /// Index of the memory heap allocations of this memory type are taken from
1543}
1544
1545class VkMemoryHeap {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001546 VkDeviceSize size /// Available memory in the heap
Jesse Halld27f6aa2015-08-15 17:58:48 -07001547 VkMemoryHeapFlags flags /// Flags for the heap
1548}
1549
1550class VkMappedMemoryRange {
1551 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE
1552 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08001553 VkDeviceMemory memory /// Mapped memory object
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001554 VkDeviceSize offset /// Offset within the mapped memory the range starts from
1555 VkDeviceSize size /// Size of the range within the mapped memory
Jesse Halld27f6aa2015-08-15 17:58:48 -07001556}
1557
1558class VkFormatProperties {
1559 VkFormatFeatureFlags linearTilingFeatures /// Format features in case of linear tiling
1560 VkFormatFeatureFlags optimalTilingFeatures /// Format features in case of optimal tiling
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001561 VkFormatFeatureFlags bufferFeatures /// Format features supported by buffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07001562}
1563
1564class VkImageFormatProperties {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001565 VkExtent3D maxExtent /// max image dimensions for this resource type
1566 u32 maxMipLevels /// max number of mipmap levels for this resource type
Jesse Halla15a4bf2015-11-19 22:48:02 -08001567 u32 maxArrayLayers /// max array layers for this resource type
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001568 VkSampleCountFlags sampleCounts /// supported sample counts for this resource type
1569 VkDeviceSize maxResourceSize /// max size (in bytes) of this resource type
1570}
1571
Jesse Halla15a4bf2015-11-19 22:48:02 -08001572class VkDescriptorImageInfo {
1573 VkSampler sampler
1574 VkImageView imageView
1575 VkImageLayout imageLayout
1576}
1577
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001578class VkDescriptorBufferInfo {
1579 VkBuffer buffer /// Buffer used for this descriptor when the descriptor is UNIFORM_BUFFER[_DYNAMIC]
1580 VkDeviceSize offset /// Base offset from buffer start in bytes to update in the descriptor set.
1581 VkDeviceSize range /// Size in bytes of the buffer resource for this descriptor update.
Jesse Halld27f6aa2015-08-15 17:58:48 -07001582}
1583
Jesse Halld27f6aa2015-08-15 17:58:48 -07001584class VkWriteDescriptorSet {
1585 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET
1586 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08001587 VkDescriptorSet dstSet /// Destination descriptor set
1588 u32 dstBinding /// Binding within the destination descriptor set to write
1589 u32 dstArrayElement /// Array element within the destination binding to write
Jesse Hall03b6fe12015-11-24 12:44:21 -08001590 u32 descriptorCount /// Number of descriptors to write (determines the size of the array pointed by <pDescriptors>)
Jesse Halld27f6aa2015-08-15 17:58:48 -07001591 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 -08001592 const VkDescriptorImageInfo* pImageInfo
1593 const VkDescriptorBufferInfo* pBufferInfo
1594 const VkBufferView* pTexelBufferView
Jesse Halld27f6aa2015-08-15 17:58:48 -07001595}
1596
1597class VkCopyDescriptorSet {
1598 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET
1599 const void* pNext /// Pointer to next structure
1600 VkDescriptorSet srcSet /// Source descriptor set
1601 u32 srcBinding /// Binding within the source descriptor set to copy from
1602 u32 srcArrayElement /// Array element within the source binding to copy from
Jesse Hall3fbc8562015-11-29 22:10:52 -08001603 VkDescriptorSet dstSet /// Destination descriptor set
1604 u32 dstBinding /// Binding within the destination descriptor set to copy to
1605 u32 dstArrayElement /// Array element within the destination binding to copy to
Jesse Hall03b6fe12015-11-24 12:44:21 -08001606 u32 descriptorCount /// Number of descriptors to copy
Jesse Halld27f6aa2015-08-15 17:58:48 -07001607}
1608
1609class VkBufferCreateInfo {
1610 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO
1611 const void* pNext /// Pointer to next structure.
Jesse Halla6429252015-11-29 18:59:42 -08001612 VkBufferCreateFlags flags /// Buffer creation flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001613 VkDeviceSize size /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001614 VkBufferUsageFlags usage /// Buffer usage flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001615 VkSharingMode sharingMode
Jesse Hall03b6fe12015-11-24 12:44:21 -08001616 u32 queueFamilyIndexCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001617 const u32* pQueueFamilyIndices
1618}
1619
1620class VkBufferViewCreateInfo {
1621 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO
1622 const void* pNext /// Pointer to next structure.
Jesse Halla6429252015-11-29 18:59:42 -08001623 VkBufferViewCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001624 VkBuffer buffer
Jesse Halld27f6aa2015-08-15 17:58:48 -07001625 VkFormat format /// Optionally specifies format of elements
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001626 VkDeviceSize offset /// Specified in bytes
1627 VkDeviceSize range /// View size specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001628}
1629
1630class VkImageSubresource {
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001631 VkImageAspectFlagBits aspectMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001632 u32 mipLevel
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001633 u32 arrayLayer
Jesse Halld27f6aa2015-08-15 17:58:48 -07001634}
1635
1636class VkImageSubresourceRange {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001637 VkImageAspectFlags aspectMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001638 u32 baseMipLevel
Jesse Hall3fbc8562015-11-29 22:10:52 -08001639 u32 levelCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001640 u32 baseArrayLayer
Jesse Hall3fbc8562015-11-29 22:10:52 -08001641 u32 layerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001642}
1643
1644class VkMemoryBarrier {
1645 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MEMORY_BARRIER
1646 const void* pNext /// Pointer to next structure.
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001647 VkAccessFlags srcAccessMask
1648 VkAccessFlags dstAccessMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001649}
1650
1651class VkBufferMemoryBarrier {
1652 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER
1653 const void* pNext /// Pointer to next structure.
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001654 VkAccessFlags srcAccessMask
1655 VkAccessFlags dstAccessMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001656 u32 srcQueueFamilyIndex /// Queue family to transition ownership from
Jesse Hall3fbc8562015-11-29 22:10:52 -08001657 u32 dstQueueFamilyIndex /// Queue family to transition ownership to
Jesse Halld27f6aa2015-08-15 17:58:48 -07001658 VkBuffer buffer /// Buffer to sync
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001659 VkDeviceSize offset /// Offset within the buffer to sync
1660 VkDeviceSize size /// Amount of bytes to sync
Jesse Halld27f6aa2015-08-15 17:58:48 -07001661}
1662
1663class VkImageMemoryBarrier {
1664 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER
1665 const void* pNext /// Pointer to next structure.
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001666 VkAccessFlags srcAccessMask
1667 VkAccessFlags dstAccessMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001668 VkImageLayout oldLayout /// Current layout of the image
1669 VkImageLayout newLayout /// New layout to transition the image to
1670 u32 srcQueueFamilyIndex /// Queue family to transition ownership from
Jesse Hall3fbc8562015-11-29 22:10:52 -08001671 u32 dstQueueFamilyIndex /// Queue family to transition ownership to
Jesse Halld27f6aa2015-08-15 17:58:48 -07001672 VkImage image /// Image to sync
1673 VkImageSubresourceRange subresourceRange /// Subresource range to sync
1674}
1675
1676class VkImageCreateInfo {
1677 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO
1678 const void* pNext /// Pointer to next structure.
Jesse Halla6429252015-11-29 18:59:42 -08001679 VkImageCreateFlags flags /// Image creation flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001680 VkImageType imageType
1681 VkFormat format
1682 VkExtent3D extent
1683 u32 mipLevels
Jesse Halla15a4bf2015-11-19 22:48:02 -08001684 u32 arrayLayers
Jesse Hall091ed9e2015-11-30 00:55:29 -08001685 VkSampleCountFlagBits samples
Jesse Halld27f6aa2015-08-15 17:58:48 -07001686 VkImageTiling tiling
1687 VkImageUsageFlags usage /// Image usage flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001688 VkSharingMode sharingMode /// Cross-queue-family sharing mode
Jesse Hall03b6fe12015-11-24 12:44:21 -08001689 u32 queueFamilyIndexCount /// Number of queue families to share across
Jesse Halld27f6aa2015-08-15 17:58:48 -07001690 const u32* pQueueFamilyIndices /// Array of queue family indices to share across
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001691 VkImageLayout initialLayout /// Initial image layout for all subresources
Jesse Halld27f6aa2015-08-15 17:58:48 -07001692}
1693
1694class VkSubresourceLayout {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001695 VkDeviceSize offset /// Specified in bytes
1696 VkDeviceSize size /// Specified in bytes
1697 VkDeviceSize rowPitch /// Specified in bytes
Jesse Hall543a7ff2016-01-08 16:38:30 -08001698 VkDeviceSize arrayPitch /// Specified in bytes
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001699 VkDeviceSize depthPitch /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001700}
1701
1702class VkImageViewCreateInfo {
1703 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO
1704 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001705 VkImageViewCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001706 VkImage image
1707 VkImageViewType viewType
1708 VkFormat format
Jesse Hall65ab5522015-11-30 00:07:16 -08001709 VkComponentMapping components
Jesse Halld27f6aa2015-08-15 17:58:48 -07001710 VkImageSubresourceRange subresourceRange
Jesse Halld27f6aa2015-08-15 17:58:48 -07001711}
1712
1713class VkBufferCopy {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001714 VkDeviceSize srcOffset /// Specified in bytes
Jesse Hall3fbc8562015-11-29 22:10:52 -08001715 VkDeviceSize dstOffset /// Specified in bytes
Jesse Hallb00daad2015-11-29 19:46:20 -08001716 VkDeviceSize size /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001717}
1718
Jesse Halla6429252015-11-29 18:59:42 -08001719class VkSparseMemoryBind {
Jesse Hallb00daad2015-11-29 19:46:20 -08001720 VkDeviceSize resourceOffset /// Specified in bytes
1721 VkDeviceSize size /// Specified in bytes
Jesse Hall3fbc8562015-11-29 22:10:52 -08001722 VkDeviceMemory memory
1723 VkDeviceSize memoryOffset /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001724 VkSparseMemoryBindFlags flags
1725}
1726
Jesse Halla6429252015-11-29 18:59:42 -08001727class VkSparseImageMemoryBind {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001728 VkImageSubresource subresource
1729 VkOffset3D offset
1730 VkExtent3D extent
Jesse Hall3fbc8562015-11-29 22:10:52 -08001731 VkDeviceMemory memory
1732 VkDeviceSize memoryOffset /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001733 VkSparseMemoryBindFlags flags
1734}
1735
Jesse Halla6429252015-11-29 18:59:42 -08001736class VkSparseBufferMemoryBindInfo {
1737 VkBuffer buffer
1738 u32 bindCount
1739 const VkSparseMemoryBind* pBinds
1740}
1741
1742class VkSparseImageOpaqueMemoryBindInfo {
1743 VkImage image
1744 u32 bindCount
1745 const VkSparseMemoryBind* pBinds
1746}
1747
1748class VkSparseImageMemoryBindInfo {
1749 VkImage image
1750 u32 bindCount
1751 const VkSparseMemoryBind* pBinds
1752}
1753
1754class VkBindSparseInfo {
1755 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BIND_SPARSE_INFO
1756 const void* pNext
1757 u32 waitSemaphoreCount
1758 const VkSemaphore* pWaitSemaphores
1759 u32 numBufferBinds
1760 const VkSparseBufferMemoryBindInfo* pBufferBinds
1761 u32 numImageOpaqueBinds
1762 const VkSparseImageOpaqueMemoryBindInfo* pImageOpaqueBinds
1763 u32 numImageBinds
1764 const VkSparseImageMemoryBindInfo* pImageBinds
1765 u32 signalSemaphoreCount
1766 const VkSemaphore* pSignalSemaphores
1767}
1768
Jesse Hall65ab5522015-11-30 00:07:16 -08001769class VkImageSubresourceLayers {
1770 VkImageAspectFlags aspectMask
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001771 u32 mipLevel
Jesse Halla15a4bf2015-11-19 22:48:02 -08001772 u32 baseArrayLayer
Jesse Hall3fbc8562015-11-29 22:10:52 -08001773 u32 layerCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001774}
1775
Jesse Halld27f6aa2015-08-15 17:58:48 -07001776class VkImageCopy {
Jesse Hall65ab5522015-11-30 00:07:16 -08001777 VkImageSubresourceLayers srcSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07001778 VkOffset3D srcOffset /// Specified in pixels for both compressed and uncompressed images
Jesse Hall65ab5522015-11-30 00:07:16 -08001779 VkImageSubresourceLayers dstSubresource
Jesse Hall3fbc8562015-11-29 22:10:52 -08001780 VkOffset3D dstOffset /// Specified in pixels for both compressed and uncompressed images
Jesse Halld27f6aa2015-08-15 17:58:48 -07001781 VkExtent3D extent /// Specified in pixels for both compressed and uncompressed images
1782}
1783
1784class VkImageBlit {
Jesse Hall65ab5522015-11-30 00:07:16 -08001785 VkImageSubresourceLayers srcSubresource
Jesse Hall3dd678a2016-01-08 21:52:01 -08001786 VkOffset3D[2] srcOffsets
Jesse Hall65ab5522015-11-30 00:07:16 -08001787 VkImageSubresourceLayers dstSubresource
Jesse Hall3dd678a2016-01-08 21:52:01 -08001788 VkOffset3D[2] dstOffsets
Jesse Halld27f6aa2015-08-15 17:58:48 -07001789}
1790
1791class VkBufferImageCopy {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001792 VkDeviceSize bufferOffset /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001793 u32 bufferRowLength /// Specified in texels
1794 u32 bufferImageHeight
Jesse Hall65ab5522015-11-30 00:07:16 -08001795 VkImageSubresourceLayers imageSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07001796 VkOffset3D imageOffset /// Specified in pixels for both compressed and uncompressed images
1797 VkExtent3D imageExtent /// Specified in pixels for both compressed and uncompressed images
1798}
1799
1800class VkImageResolve {
Jesse Hall65ab5522015-11-30 00:07:16 -08001801 VkImageSubresourceLayers srcSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07001802 VkOffset3D srcOffset
Jesse Hall65ab5522015-11-30 00:07:16 -08001803 VkImageSubresourceLayers dstSubresource
Jesse Hall3fbc8562015-11-29 22:10:52 -08001804 VkOffset3D dstOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07001805 VkExtent3D extent
1806}
1807
1808class VkShaderModuleCreateInfo {
1809 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO
1810 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001811 VkShaderModuleCreateFlags flags /// Reserved
Jesse Halld27f6aa2015-08-15 17:58:48 -07001812 platform.size_t codeSize /// Specified in bytes
Jesse Halla9bb62b2015-11-21 19:31:56 -08001813 const u32* pCode /// Binary code of size codeSize
Jesse Halld27f6aa2015-08-15 17:58:48 -07001814}
1815
Jesse Halld27f6aa2015-08-15 17:58:48 -07001816class VkDescriptorSetLayoutBinding {
Jesse Hall091ed9e2015-11-30 00:55:29 -08001817 u32 binding
Jesse Halld27f6aa2015-08-15 17:58:48 -07001818 VkDescriptorType descriptorType /// Type of the descriptors in this binding
Jesse Halldba27f72015-11-30 14:25:46 -08001819 u32 descriptorCount /// Number of descriptors in this binding
Jesse Halld27f6aa2015-08-15 17:58:48 -07001820 VkShaderStageFlags stageFlags /// Shader stages this binding is visible to
1821 const VkSampler* pImmutableSamplers /// Immutable samplers (used if descriptor type is SAMPLER or COMBINED_IMAGE_SAMPLER, is either NULL or contains <count> number of elements)
1822}
1823
1824class VkDescriptorSetLayoutCreateInfo {
1825 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO
1826 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001827 VkDescriptorSetLayoutCreateFlags flags
Jesse Hall03b6fe12015-11-24 12:44:21 -08001828 u32 bindingCount /// Number of bindings in the descriptor set layout
Jesse Hall543a7ff2016-01-08 16:38:30 -08001829 const VkDescriptorSetLayoutBinding* pBindings /// Array of descriptor set layout bindings
Jesse Halld27f6aa2015-08-15 17:58:48 -07001830}
1831
Jesse Hall65ab5522015-11-30 00:07:16 -08001832class VkDescriptorPoolSize {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001833 VkDescriptorType type
Jesse Hall03b6fe12015-11-24 12:44:21 -08001834 u32 descriptorCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001835}
1836
1837class VkDescriptorPoolCreateInfo {
1838 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO
1839 const void* pNext /// Pointer to next structure
Jesse Hallfbf97b02015-11-20 14:17:03 -08001840 VkDescriptorPoolCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001841 u32 maxSets
Jesse Hall65ab5522015-11-30 00:07:16 -08001842 u32 poolSizeCount
1843 const VkDescriptorPoolSize* pPoolSizes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001844}
1845
Jesse Hall3fbc8562015-11-29 22:10:52 -08001846class VkDescriptorSetAllocateInfo {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001847 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO
Jesse Hallfbf97b02015-11-20 14:17:03 -08001848 const void* pNext /// Pointer to next structure
1849 VkDescriptorPool descriptorPool
Jesse Hall03b6fe12015-11-24 12:44:21 -08001850 u32 setCount
Jesse Hallfbf97b02015-11-20 14:17:03 -08001851 const VkDescriptorSetLayout* pSetLayouts
1852}
1853
Jesse Halld27f6aa2015-08-15 17:58:48 -07001854class VkSpecializationMapEntry {
Jesse Hall65ab5522015-11-30 00:07:16 -08001855 u32 constantID /// The SpecConstant ID specified in the BIL
Jesse Halld27f6aa2015-08-15 17:58:48 -07001856 u32 offset /// Offset of the value in the data block
Jesse Hallb00daad2015-11-29 19:46:20 -08001857 platform.size_t size /// Size in bytes of the SpecConstant
Jesse Halld27f6aa2015-08-15 17:58:48 -07001858}
1859
1860class VkSpecializationInfo {
1861 u32 mapEntryCount /// Number of entries in the map
Jesse Hallb00daad2015-11-29 19:46:20 -08001862 const VkSpecializationMapEntry* pMapEntries /// Array of map entries
Jesse Halld27f6aa2015-08-15 17:58:48 -07001863 platform.size_t dataSize /// Size in bytes of pData
1864 const void* pData /// Pointer to SpecConstant data
1865}
1866
1867class VkPipelineShaderStageCreateInfo {
1868 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO
1869 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001870 VkPipelineShaderStageCreateFlags flags
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001871 VkShaderStageFlagBits stage
1872 VkShaderModule module
1873 const char* pName
Jesse Halld27f6aa2015-08-15 17:58:48 -07001874 const VkSpecializationInfo* pSpecializationInfo
1875}
1876
1877class VkComputePipelineCreateInfo {
1878 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO
1879 const void* pNext /// Pointer to next structure
Jesse Halld27f6aa2015-08-15 17:58:48 -07001880 VkPipelineCreateFlags flags /// Pipeline creation flags
Jesse Halla6429252015-11-29 18:59:42 -08001881 VkPipelineShaderStageCreateInfo stage
Jesse Halld27f6aa2015-08-15 17:58:48 -07001882 VkPipelineLayout layout /// Interface layout of the pipeline
1883 VkPipeline basePipelineHandle /// If VK_PIPELINE_CREATE_DERIVATIVE_BIT is set and this value is nonzero, it specifies the handle of the base pipeline this is a derivative of
1884 s32 basePipelineIndex /// If VK_PIPELINE_CREATE_DERIVATIVE_BIT is set and this value is not -1, it specifies an index into pCreateInfos of the base pipeline this is a derivative of
1885}
1886
1887class VkVertexInputBindingDescription {
Jesse Hallb00daad2015-11-29 19:46:20 -08001888 u32 binding /// Vertex buffer binding id
1889 u32 stride /// Distance between vertices in bytes (0 = no advancement)
Jesse Hall65ab5522015-11-30 00:07:16 -08001890 VkVertexInputRate inputRate /// Rate at which binding is incremented
Jesse Halld27f6aa2015-08-15 17:58:48 -07001891}
1892
1893class VkVertexInputAttributeDescription {
Jesse Hallb00daad2015-11-29 19:46:20 -08001894 u32 location /// location of the shader vertex attrib
1895 u32 binding /// Vertex buffer binding id
1896 VkFormat format /// format of source data
1897 u32 offset /// Offset of first element in bytes from base of vertex
Jesse Halld27f6aa2015-08-15 17:58:48 -07001898}
1899
1900class VkPipelineVertexInputStateCreateInfo {
Jesse Hall03b6fe12015-11-24 12:44:21 -08001901 VkStructureType sType /// Should be VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO
1902 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001903 VkPipelineVertexInputStateCreateFlags flags
Jesse Hall03b6fe12015-11-24 12:44:21 -08001904 u32 vertexBindingDescriptionCount /// number of bindings
Jesse Halld27f6aa2015-08-15 17:58:48 -07001905 const VkVertexInputBindingDescription* pVertexBindingDescriptions
Jesse Hall03b6fe12015-11-24 12:44:21 -08001906 u32 vertexAttributeDescriptionCount /// number of attributes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001907 const VkVertexInputAttributeDescription* pVertexAttributeDescriptions
1908}
1909
1910class VkPipelineInputAssemblyStateCreateInfo {
1911 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO
1912 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001913 VkPipelineInputAssemblyStateCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001914 VkPrimitiveTopology topology
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001915 VkBool32 primitiveRestartEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07001916}
1917
1918class VkPipelineTessellationStateCreateInfo {
1919 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO
1920 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001921 VkPipelineTessellationStateCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001922 u32 patchControlPoints
1923}
1924
1925class VkPipelineViewportStateCreateInfo {
1926 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO
1927 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001928 VkPipelineViewportStateCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001929 u32 viewportCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001930 const VkViewport* pViewports
1931 u32 scissorCount
1932 const VkRect2D* pScissors
Jesse Halld27f6aa2015-08-15 17:58:48 -07001933}
1934
Jesse Hall3fbc8562015-11-29 22:10:52 -08001935class VkPipelineRasterizationStateCreateInfo {
Jesse Hall65ab5522015-11-30 00:07:16 -08001936 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07001937 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08001938 VkPipelineRasterizationStateCreateFlags flags
Jesse Hallae38f732015-11-19 21:32:50 -08001939 VkBool32 depthClampEnable
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001940 VkBool32 rasterizerDiscardEnable
Jesse Hall65ab5522015-11-30 00:07:16 -08001941 VkPolygonMode polygonMode /// optional (GL45)
Jesse Hallc7467b72015-11-29 21:05:26 -08001942 VkCullModeFlags cullMode
Jesse Halld27f6aa2015-08-15 17:58:48 -07001943 VkFrontFace frontFace
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001944 VkBool32 depthBiasEnable
Jesse Halla9bb62b2015-11-21 19:31:56 -08001945 f32 depthBiasConstantFactor
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001946 f32 depthBiasClamp
Jesse Halla9bb62b2015-11-21 19:31:56 -08001947 f32 depthBiasSlopeFactor
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001948 f32 lineWidth
Jesse Halld27f6aa2015-08-15 17:58:48 -07001949}
1950
1951class VkPipelineMultisampleStateCreateInfo {
1952 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO
1953 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001954 VkPipelineMultisampleStateCreateFlags flags
Jesse Hall091ed9e2015-11-30 00:55:29 -08001955 VkSampleCountFlagBits rasterizationSamples /// Number of samples used for rasterization
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001956 VkBool32 sampleShadingEnable /// optional (GL45)
Jesse Halld27f6aa2015-08-15 17:58:48 -07001957 f32 minSampleShading /// optional (GL45)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001958 const VkSampleMask* pSampleMask
Jesse Hallacfa5342015-11-19 21:51:33 -08001959 VkBool32 alphaToCoverageEnable
1960 VkBool32 alphaToOneEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07001961}
1962
1963class VkPipelineColorBlendAttachmentState {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001964 VkBool32 blendEnable
Jesse Hall65ab5522015-11-30 00:07:16 -08001965 VkBlendFactor srcColorBlendFactor
1966 VkBlendFactor dstColorBlendFactor
1967 VkBlendOp colorBlendOp
1968 VkBlendFactor srcAlphaBlendFactor
1969 VkBlendFactor dstAlphaBlendFactor
1970 VkBlendOp alphaBlendOp
1971 VkColorComponentFlags colorWriteMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001972}
1973
1974class VkPipelineColorBlendStateCreateInfo {
1975 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO
1976 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001977 VkPipelineColorBlendStateCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001978 VkBool32 logicOpEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07001979 VkLogicOp logicOp
1980 u32 attachmentCount /// # of pAttachments
1981 const VkPipelineColorBlendAttachmentState* pAttachments
Jesse Hallb00daad2015-11-29 19:46:20 -08001982 f32[4] blendConstants
Jesse Halld27f6aa2015-08-15 17:58:48 -07001983}
1984
1985class VkStencilOpState {
Jesse Hall65ab5522015-11-30 00:07:16 -08001986 VkStencilOp failOp
1987 VkStencilOp passOp
1988 VkStencilOp depthFailOp
1989 VkCompareOp compareOp
1990 u32 compareMask
1991 u32 writeMask
1992 u32 reference
Jesse Halld27f6aa2015-08-15 17:58:48 -07001993}
1994
1995class VkPipelineDepthStencilStateCreateInfo {
1996 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO
1997 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001998 VkPipelineDepthStencilStateCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001999 VkBool32 depthTestEnable
2000 VkBool32 depthWriteEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002001 VkCompareOp depthCompareOp
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002002 VkBool32 depthBoundsTestEnable /// optional (depth_bounds_test)
2003 VkBool32 stencilTestEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002004 VkStencilOpState front
2005 VkStencilOpState back
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002006 f32 minDepthBounds
2007 f32 maxDepthBounds
2008}
2009
2010class VkPipelineDynamicStateCreateInfo {
2011 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO
2012 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002013 VkPipelineDynamicStateCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002014 u32 dynamicStateCount
2015 const VkDynamicState* pDynamicStates
Jesse Halld27f6aa2015-08-15 17:58:48 -07002016}
2017
2018class VkGraphicsPipelineCreateInfo {
Jesse Halla6429252015-11-29 18:59:42 -08002019 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO
2020 const void* pNext /// Pointer to next structure
2021 VkPipelineCreateFlags flags /// Pipeline creation flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002022 u32 stageCount
Jesse Halla6429252015-11-29 18:59:42 -08002023 const VkPipelineShaderStageCreateInfo* pStages /// One entry for each active shader stage
Jesse Halld27f6aa2015-08-15 17:58:48 -07002024 const VkPipelineVertexInputStateCreateInfo* pVertexInputState
2025 const VkPipelineInputAssemblyStateCreateInfo* pInputAssemblyState
2026 const VkPipelineTessellationStateCreateInfo* pTessellationState
2027 const VkPipelineViewportStateCreateInfo* pViewportState
Jesse Hall3fbc8562015-11-29 22:10:52 -08002028 const VkPipelineRasterizationStateCreateInfo* pRasterizationState
Jesse Halld27f6aa2015-08-15 17:58:48 -07002029 const VkPipelineMultisampleStateCreateInfo* pMultisampleState
2030 const VkPipelineDepthStencilStateCreateInfo* pDepthStencilState
2031 const VkPipelineColorBlendStateCreateInfo* pColorBlendState
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002032 const VkPipelineDynamicStateCreateInfo* pDynamicState
Jesse Halla6429252015-11-29 18:59:42 -08002033 VkPipelineLayout layout /// Interface layout of the pipeline
Jesse Halld27f6aa2015-08-15 17:58:48 -07002034 VkRenderPass renderPass
2035 u32 subpass
Jesse Halla6429252015-11-29 18:59:42 -08002036 VkPipeline basePipelineHandle /// If VK_PIPELINE_CREATE_DERIVATIVE_BIT is set and this value is nonzero, it specifies the handle of the base pipeline this is a derivative of
2037 s32 basePipelineIndex /// If VK_PIPELINE_CREATE_DERIVATIVE_BIT is set and this value is not -1, it specifies an index into pCreateInfos of the base pipeline this is a derivative of
Jesse Halld27f6aa2015-08-15 17:58:48 -07002038}
2039
2040class VkPipelineCacheCreateInfo {
Jesse Hallb00daad2015-11-29 19:46:20 -08002041 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO
2042 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002043 VkPipelineCacheCreateFlags flags
Jesse Hallb00daad2015-11-29 19:46:20 -08002044 platform.size_t initialDataSize /// Size of initial data to populate cache, in bytes
2045 const void* pInitialData /// Initial data to populate cache
Jesse Halld27f6aa2015-08-15 17:58:48 -07002046}
2047
2048class VkPushConstantRange {
2049 VkShaderStageFlags stageFlags /// Which stages use the range
Jesse Hall03b6fe12015-11-24 12:44:21 -08002050 u32 offset /// Start of the range, in bytes
2051 u32 size /// Length of the range, in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002052}
2053
2054class VkPipelineLayoutCreateInfo {
2055 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO
2056 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002057 VkPipelineLayoutCreateFlags flags
Jesse Hall3dd678a2016-01-08 21:52:01 -08002058 u32 descriptorSetCount /// Number of descriptor sets interfaced by the pipeline
Jesse Halld27f6aa2015-08-15 17:58:48 -07002059 const VkDescriptorSetLayout* pSetLayouts /// Array of <setCount> number of descriptor set layout objects defining the layout of the
2060 u32 pushConstantRangeCount /// Number of push-constant ranges used by the pipeline
2061 const VkPushConstantRange* pPushConstantRanges /// Array of pushConstantRangeCount number of ranges used by various shader stages
2062}
2063
2064class VkSamplerCreateInfo {
2065 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO
2066 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002067 VkSamplerCreateFlags flags
Jesse Hall23ff73f2015-11-29 14:36:39 -08002068 VkFilter magFilter /// Filter mode for magnification
2069 VkFilter minFilter /// Filter mode for minifiation
2070 VkSamplerMipmapMode mipmapMode /// Mipmap selection mode
2071 VkSamplerAddressMode addressModeU
2072 VkSamplerAddressMode addressModeV
2073 VkSamplerAddressMode addressModeW
Jesse Halld27f6aa2015-08-15 17:58:48 -07002074 f32 mipLodBias
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002075 VkBool32 anisotropyEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002076 f32 maxAnisotropy
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002077 VkBool32 compareEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002078 VkCompareOp compareOp
2079 f32 minLod
2080 f32 maxLod
2081 VkBorderColor borderColor
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002082 VkBool32 unnormalizedCoordinates
Jesse Halld27f6aa2015-08-15 17:58:48 -07002083}
2084
Jesse Hall3fbc8562015-11-29 22:10:52 -08002085class VkCommandPoolCreateInfo {
2086 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002087 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08002088 VkCommandPoolCreateFlags flags /// Command pool creation flags
Jesse Halla6429252015-11-29 18:59:42 -08002089 u32 queueFamilyIndex
Jesse Halld27f6aa2015-08-15 17:58:48 -07002090}
2091
Jesse Hall3fbc8562015-11-29 22:10:52 -08002092class VkCommandBufferAllocateInfo {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002093 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002094 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08002095 VkCommandPool commandPool
2096 VkCommandBufferLevel level
Jesse Hall3dd678a2016-01-08 21:52:01 -08002097 u32 commandBufferCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002098}
2099
Jesse Hall3dd678a2016-01-08 21:52:01 -08002100class VkCommandBufferInheritanceInfo {
2101 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002102 const void* pNext /// Pointer to next structure
Jesse Halld27f6aa2015-08-15 17:58:48 -07002103 VkRenderPass renderPass /// Render pass for secondary command buffers
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002104 u32 subpass
Jesse Halld27f6aa2015-08-15 17:58:48 -07002105 VkFramebuffer framebuffer /// Framebuffer for secondary command buffers
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002106 VkBool32 occlusionQueryEnable
2107 VkQueryControlFlags queryFlags
2108 VkQueryPipelineStatisticFlags pipelineStatistics
Jesse Halld27f6aa2015-08-15 17:58:48 -07002109}
2110
Jesse Hall3dd678a2016-01-08 21:52:01 -08002111class VkCommandBufferBeginInfo {
2112 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO
2113 const void* pNext /// Pointer to next structure
2114 VkCommandBufferUsageFlags flags /// Command buffer usage flags
2115 const VkCommandBufferInheritanceInfo* pInheritanceInfo
2116}
2117
Jesse Halld27f6aa2015-08-15 17:58:48 -07002118class VkRenderPassBeginInfo {
2119 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO
2120 const void* pNext /// Pointer to next structure
2121 VkRenderPass renderPass
2122 VkFramebuffer framebuffer
2123 VkRect2D renderArea
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002124 u32 clearValueCount
2125 const VkClearValue* pClearValues
Jesse Halld27f6aa2015-08-15 17:58:48 -07002126}
2127
2128@union
2129/// Union allowing specification of floating point, integer, or unsigned integer color data. Actual value selected is based on image/attachment being cleared.
2130class VkClearColorValue {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002131 f32[4] float32
2132 s32[4] int32
2133 u32[4] uint32
Jesse Halld27f6aa2015-08-15 17:58:48 -07002134}
2135
2136class VkClearDepthStencilValue {
2137 f32 depth
2138 u32 stencil
2139}
2140
2141@union
2142/// Union allowing specification of color, depth, and stencil color values. Actual value selected is based on attachment being cleared.
2143class VkClearValue {
2144 VkClearColorValue color
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002145 VkClearDepthStencilValue depthStencil
Jesse Halld27f6aa2015-08-15 17:58:48 -07002146}
2147
Jesse Hallae38f732015-11-19 21:32:50 -08002148class VkClearAttachment {
2149 VkImageAspectFlags aspectMask
2150 u32 colorAttachment
2151 VkClearValue clearValue
2152}
2153
Jesse Halld27f6aa2015-08-15 17:58:48 -07002154class VkAttachmentDescription {
Jesse Halla6429252015-11-29 18:59:42 -08002155 VkAttachmentDescriptionFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002156 VkFormat format
Jesse Hall091ed9e2015-11-30 00:55:29 -08002157 VkSampleCountFlagBits samples
Jesse Halld27f6aa2015-08-15 17:58:48 -07002158 VkAttachmentLoadOp loadOp /// Load op for color or depth data
2159 VkAttachmentStoreOp storeOp /// Store op for color or depth data
2160 VkAttachmentLoadOp stencilLoadOp /// Load op for stencil data
2161 VkAttachmentStoreOp stencilStoreOp /// Store op for stencil data
2162 VkImageLayout initialLayout
2163 VkImageLayout finalLayout
2164}
2165
2166class VkAttachmentReference {
2167 u32 attachment
2168 VkImageLayout layout
2169}
2170
2171class VkSubpassDescription {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002172 VkSubpassDescriptionFlags flags
Jesse Halla6429252015-11-29 18:59:42 -08002173 VkPipelineBindPoint pipelineBindPoint /// Must be VK_PIPELINE_BIND_POINT_GRAPHICS for now
Jesse Hall03b6fe12015-11-24 12:44:21 -08002174 u32 inputAttachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002175 const VkAttachmentReference* pInputAttachments
Jesse Hall03b6fe12015-11-24 12:44:21 -08002176 u32 colorAttachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002177 const VkAttachmentReference* pColorAttachments
2178 const VkAttachmentReference* pResolveAttachments
Jesse Hallc7467b72015-11-29 21:05:26 -08002179 const VkAttachmentReference* pDepthStencilAttachment
Jesse Hall03b6fe12015-11-24 12:44:21 -08002180 u32 preserveAttachmentCount
Jesse Hall3dd678a2016-01-08 21:52:01 -08002181 const u32* pPreserveAttachments
Jesse Halld27f6aa2015-08-15 17:58:48 -07002182}
2183
2184class VkSubpassDependency {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002185 u32 srcSubpass
Jesse Hall3fbc8562015-11-29 22:10:52 -08002186 u32 dstSubpass
Jesse Halld27f6aa2015-08-15 17:58:48 -07002187 VkPipelineStageFlags srcStageMask
Jesse Hall3fbc8562015-11-29 22:10:52 -08002188 VkPipelineStageFlags dstStageMask
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002189 VkAccessFlags srcAccessMask
2190 VkAccessFlags dstAccessMask
Jesse Halldc6d36c2015-11-29 19:12:15 -08002191 VkDependencyFlags dependencyFlags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002192}
2193
2194class VkRenderPassCreateInfo {
2195 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO
2196 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002197 VkRenderPassCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002198 u32 attachmentCount
2199 const VkAttachmentDescription* pAttachments
2200 u32 subpassCount
2201 const VkSubpassDescription* pSubpasses
2202 u32 dependencyCount
2203 const VkSubpassDependency* pDependencies
2204}
2205
2206class VkEventCreateInfo {
2207 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_EVENT_CREATE_INFO
2208 const void* pNext /// Pointer to next structure
2209 VkEventCreateFlags flags /// Event creation flags
2210}
2211
2212class VkFenceCreateInfo {
2213 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_FENCE_CREATE_INFO
2214 const void* pNext /// Pointer to next structure
2215 VkFenceCreateFlags flags /// Fence creation flags
2216}
2217
2218class VkPhysicalDeviceFeatures {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002219 VkBool32 robustBufferAccess /// out of bounds buffer accesses are well defined
2220 VkBool32 fullDrawIndexUint32 /// full 32-bit range of indices for indexed draw calls
2221 VkBool32 imageCubeArray /// image views which are arrays of cube maps
2222 VkBool32 independentBlend /// blending operations are controlled per-attachment
2223 VkBool32 geometryShader /// geometry stage
2224 VkBool32 tessellationShader /// tessellation control and evaluation stage
2225 VkBool32 sampleRateShading /// per-sample shading and interpolation
Jesse Hall3fbc8562015-11-29 22:10:52 -08002226 VkBool32 dualSrcBlend /// blend operations which take two sources
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002227 VkBool32 logicOp /// logic operations
2228 VkBool32 multiDrawIndirect /// multi draw indirect
Jesse Hall543a7ff2016-01-08 16:38:30 -08002229 VkBool32 drawIndirectFirstInstance
Jesse Hallae38f732015-11-19 21:32:50 -08002230 VkBool32 depthClamp /// depth clamping
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002231 VkBool32 depthBiasClamp /// depth bias clamping
2232 VkBool32 fillModeNonSolid /// point and wireframe fill modes
2233 VkBool32 depthBounds /// depth bounds test
2234 VkBool32 wideLines /// lines with width greater than 1
2235 VkBool32 largePoints /// points with size greater than 1
Jesse Hallfbf97b02015-11-20 14:17:03 -08002236 VkBool32 alphaToOne /// The fragment alpha channel can be forced to maximum representable alpha value
2237 VkBool32 multiViewport
2238 VkBool32 samplerAnisotropy
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002239 VkBool32 textureCompressionETC2 /// ETC texture compression formats
2240 VkBool32 textureCompressionASTC_LDR /// ASTC LDR texture compression formats
2241 VkBool32 textureCompressionBC /// BC1-7 texture compressed formats
Jesse Hall65ab5522015-11-30 00:07:16 -08002242 VkBool32 occlusionQueryPrecise
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002243 VkBool32 pipelineStatisticsQuery /// pipeline statistics query
Jesse Halldc6d36c2015-11-29 19:12:15 -08002244 VkBool32 vertexPipelineStoresAndAtomics
2245 VkBool32 fragmentStoresAndAtomics
2246 VkBool32 shaderTessellationAndGeometryPointSize
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002247 VkBool32 shaderImageGatherExtended /// texture gather with run-time values and independent offsets
2248 VkBool32 shaderStorageImageExtendedFormats /// the extended set of formats can be used for storage images
2249 VkBool32 shaderStorageImageMultisample /// multisample images can be used for storage images
Jesse Halld1af8122015-11-29 23:50:38 -08002250 VkBool32 shaderStorageImageReadWithoutFormat
2251 VkBool32 shaderStorageImageWriteWithoutFormat
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002252 VkBool32 shaderUniformBufferArrayDynamicIndexing /// arrays of uniform buffers can be accessed with dynamically uniform indices
2253 VkBool32 shaderSampledImageArrayDynamicIndexing /// arrays of sampled images can be accessed with dynamically uniform indices
2254 VkBool32 shaderStorageBufferArrayDynamicIndexing /// arrays of storage buffers can be accessed with dynamically uniform indices
2255 VkBool32 shaderStorageImageArrayDynamicIndexing /// arrays of storage images can be accessed with dynamically uniform indices
2256 VkBool32 shaderClipDistance /// clip distance in shaders
2257 VkBool32 shaderCullDistance /// cull distance in shaders
2258 VkBool32 shaderFloat64 /// 64-bit floats (doubles) in shaders
2259 VkBool32 shaderInt64 /// 64-bit integers in shaders
2260 VkBool32 shaderInt16 /// 16-bit integers in shaders
2261 VkBool32 shaderResourceResidency /// shader can use texture operations that return resource residency information (requires sparseNonResident support)
Jesse Hall65ab5522015-11-30 00:07:16 -08002262 VkBool32 shaderResourceMinLod /// shader can use texture operations that specify minimum resource LOD
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002263 VkBool32 sparseBinding /// Sparse resources support: Resource memory can be managed at opaque page level rather than object level
2264 VkBool32 sparseResidencyBuffer /// Sparse resources support: GPU can access partially resident buffers
2265 VkBool32 sparseResidencyImage2D /// Sparse resources support: GPU can access partially resident 2D (non-MSAA non-DepthStencil) images
2266 VkBool32 sparseResidencyImage3D /// Sparse resources support: GPU can access partially resident 3D images
2267 VkBool32 sparseResidency2Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 2 samples
2268 VkBool32 sparseResidency4Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 4 samples
2269 VkBool32 sparseResidency8Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 8 samples
2270 VkBool32 sparseResidency16Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 16 samples
2271 VkBool32 sparseResidencyAliased /// Sparse resources support: GPU can correctly access data aliased into multiple locations (opt-in)
Jesse Halld1af8122015-11-29 23:50:38 -08002272 VkBool32 variableMultisampleRate
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002273 VkBool32 inheritedQueries
Jesse Halld27f6aa2015-08-15 17:58:48 -07002274}
2275
2276class VkPhysicalDeviceLimits {
2277 /// resource maximum sizes
2278 u32 maxImageDimension1D /// max 1D image dimension
2279 u32 maxImageDimension2D /// max 2D image dimension
2280 u32 maxImageDimension3D /// max 3D image dimension
2281 u32 maxImageDimensionCube /// max cubemap image dimension
2282 u32 maxImageArrayLayers /// max layers for image arrays
Jesse Hallb00daad2015-11-29 19:46:20 -08002283 u32 maxTexelBufferElements
Jesse Hallfbf97b02015-11-20 14:17:03 -08002284 u32 maxUniformBufferRange /// max uniform buffer size (bytes)
2285 u32 maxStorageBufferRange /// max storage buffer size (bytes)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002286 u32 maxPushConstantsSize /// max size of the push constants pool (bytes)
2287 /// memory limits
2288 u32 maxMemoryAllocationCount /// max number of device memory allocations supported
Jesse Hall091ed9e2015-11-30 00:55:29 -08002289 u32 maxSamplerAllocationCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002290 VkDeviceSize bufferImageGranularity /// Granularity (in bytes) at which buffers and images can be bound to adjacent memory for simultaneous usage
2291 VkDeviceSize sparseAddressSpaceSize /// Total address space available for sparse allocations (bytes)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002292 /// descriptor set limits
2293 u32 maxBoundDescriptorSets /// max number of descriptors sets that can be bound to a pipeline
Jesse Halld27f6aa2015-08-15 17:58:48 -07002294 u32 maxPerStageDescriptorSamplers /// max num of samplers allowed per-stage in a descriptor set
2295 u32 maxPerStageDescriptorUniformBuffers /// max num of uniform buffers allowed per-stage in a descriptor set
2296 u32 maxPerStageDescriptorStorageBuffers /// max num of storage buffers allowed per-stage in a descriptor set
2297 u32 maxPerStageDescriptorSampledImages /// max num of sampled images allowed per-stage in a descriptor set
2298 u32 maxPerStageDescriptorStorageImages /// max num of storage images allowed per-stage in a descriptor set
Jesse Halle1b12782015-11-30 11:27:32 -08002299 u32 maxPerStageDescriptorInputAttachments
Jesse Halldba27f72015-11-30 14:25:46 -08002300 u32 maxPerStageResources
Jesse Halld27f6aa2015-08-15 17:58:48 -07002301 u32 maxDescriptorSetSamplers /// max num of samplers allowed in all stages in a descriptor set
2302 u32 maxDescriptorSetUniformBuffers /// max num of uniform buffers allowed in all stages in a descriptor set
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002303 u32 maxDescriptorSetUniformBuffersDynamic /// max num of dynamic uniform buffers allowed in all stages in a descriptor set
Jesse Halld27f6aa2015-08-15 17:58:48 -07002304 u32 maxDescriptorSetStorageBuffers /// max num of storage buffers allowed in all stages in a descriptor set
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002305 u32 maxDescriptorSetStorageBuffersDynamic /// max num of dynamic storage buffers allowed in all stages in a descriptor set
Jesse Halld27f6aa2015-08-15 17:58:48 -07002306 u32 maxDescriptorSetSampledImages /// max num of sampled images allowed in all stages in a descriptor set
2307 u32 maxDescriptorSetStorageImages /// max num of storage images allowed in all stages in a descriptor set
Jesse Halle1b12782015-11-30 11:27:32 -08002308 u32 maxDescriptorSetInputAttachments
Jesse Halld27f6aa2015-08-15 17:58:48 -07002309 /// vertex stage limits
2310 u32 maxVertexInputAttributes /// max num of vertex input attribute slots
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002311 u32 maxVertexInputBindings /// max num of vertex input binding slots
Jesse Halld27f6aa2015-08-15 17:58:48 -07002312 u32 maxVertexInputAttributeOffset /// max vertex input attribute offset added to vertex buffer offset
2313 u32 maxVertexInputBindingStride /// max vertex input binding stride
2314 u32 maxVertexOutputComponents /// max num of output components written by vertex shader
2315 /// tessellation control stage limits
Jesse Hall3fbc8562015-11-29 22:10:52 -08002316 u32 maxTessellationGenerationLevel /// max level supported by tess primitive generator
Jesse Hallae38f732015-11-19 21:32:50 -08002317 u32 maxTessellationPatchSize /// max patch size (vertices)
2318 u32 maxTessellationControlPerVertexInputComponents /// max num of input components per-vertex in TCS
2319 u32 maxTessellationControlPerVertexOutputComponents /// max num of output components per-vertex in TCS
2320 u32 maxTessellationControlPerPatchOutputComponents /// max num of output components per-patch in TCS
2321 u32 maxTessellationControlTotalOutputComponents /// max total num of per-vertex and per-patch output components in TCS
2322 u32 maxTessellationEvaluationInputComponents /// max num of input components per vertex in TES
2323 u32 maxTessellationEvaluationOutputComponents /// max num of output components per vertex in TES
Jesse Halld27f6aa2015-08-15 17:58:48 -07002324 /// geometry stage limits
2325 u32 maxGeometryShaderInvocations /// max invocation count supported in geometry shader
2326 u32 maxGeometryInputComponents /// max num of input components read in geometry stage
2327 u32 maxGeometryOutputComponents /// max num of output components written in geometry stage
2328 u32 maxGeometryOutputVertices /// max num of vertices that can be emitted in geometry stage
2329 u32 maxGeometryTotalOutputComponents /// max total num of components (all vertices) written in geometry stage
2330 /// fragment stage limits
2331 u32 maxFragmentInputComponents /// max num of input compontents read in fragment stage
Jesse Hallfbf97b02015-11-20 14:17:03 -08002332 u32 maxFragmentOutputAttachments /// max num of output attachments written in fragment stage
Jesse Hall3fbc8562015-11-29 22:10:52 -08002333 u32 maxFragmentDualSrcAttachments /// max num of output attachments written when using dual source blending
Jesse Halld27f6aa2015-08-15 17:58:48 -07002334 u32 maxFragmentCombinedOutputResources /// max total num of storage buffers, storage images and output buffers
2335 /// compute stage limits
2336 u32 maxComputeSharedMemorySize /// max total storage size of work group local storage (bytes)
2337 u32[3] maxComputeWorkGroupCount /// max num of compute work groups that may be dispatched by a single command (x,y,z)
2338 u32 maxComputeWorkGroupInvocations /// max total compute invocations in a single local work group
2339 u32[3] maxComputeWorkGroupSize /// max local size of a compute work group (x,y,z)
2340
2341 u32 subPixelPrecisionBits /// num bits of subpixel precision in screen x and y
2342 u32 subTexelPrecisionBits /// num bits of subtexel precision
2343 u32 mipmapPrecisionBits /// num bits of mipmap precision
2344
2345 u32 maxDrawIndexedIndexValue /// max index value for indexed draw calls (for 32-bit indices)
Jesse Halldba27f72015-11-30 14:25:46 -08002346 u32 maxDrawIndirectCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002347
2348 f32 maxSamplerLodBias /// max absolute sampler level of detail bias
2349 f32 maxSamplerAnisotropy /// max degree of sampler anisotropy
2350
2351 u32 maxViewports /// max number of active viewports
Jesse Halld27f6aa2015-08-15 17:58:48 -07002352 u32[2] maxViewportDimensions /// max viewport dimensions (x,y)
2353 f32[2] viewportBoundsRange /// viewport bounds range (min,max)
2354 u32 viewportSubPixelBits /// num bits of subpixel precision for viewport
2355
Jesse Halldc6d36c2015-11-29 19:12:15 -08002356 platform.size_t minMemoryMapAlignment /// min required alignment of pointers returned by MapMemory (bytes)
2357 VkDeviceSize minTexelBufferOffsetAlignment /// min required alignment for texel buffer offsets (bytes)
2358 VkDeviceSize minUniformBufferOffsetAlignment /// min required alignment for uniform buffer sizes and offsets (bytes)
2359 VkDeviceSize minStorageBufferOffsetAlignment /// min required alignment for storage buffer offsets (bytes)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002360
Jesse Hallfbf97b02015-11-20 14:17:03 -08002361 s32 minTexelOffset /// min texel offset for OpTextureSampleOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07002362 u32 maxTexelOffset /// max texel offset for OpTextureSampleOffset
Jesse Hallfbf97b02015-11-20 14:17:03 -08002363 s32 minTexelGatherOffset /// min texel offset for OpTextureGatherOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07002364 u32 maxTexelGatherOffset /// max texel offset for OpTextureGatherOffset
2365 f32 minInterpolationOffset /// furthest negative offset for interpolateAtOffset
2366 f32 maxInterpolationOffset /// furthest positive offset for interpolateAtOffset
2367 u32 subPixelInterpolationOffsetBits /// num of subpixel bits for interpolateAtOffset
2368
2369 u32 maxFramebufferWidth /// max width for a framebuffer
2370 u32 maxFramebufferHeight /// max height for a framebuffer
2371 u32 maxFramebufferLayers /// max layer count for a layered framebuffer
Jesse Hall091ed9e2015-11-30 00:55:29 -08002372 VkSampleCountFlags framebufferColorSampleCounts
2373 VkSampleCountFlags framebufferDepthSampleCounts
2374 VkSampleCountFlags framebufferStencilSampleCounts
2375 VkSampleCountFlags framebufferNoAttachmentSampleCounts
Jesse Halld27f6aa2015-08-15 17:58:48 -07002376 u32 maxColorAttachments /// max num of framebuffer color attachments
2377
Jesse Hall091ed9e2015-11-30 00:55:29 -08002378 VkSampleCountFlags sampledImageColorSampleCounts
2379 VkSampleCountFlags sampledImageIntegerSampleCounts
2380 VkSampleCountFlags sampledImageDepthSampleCounts
2381 VkSampleCountFlags sampledImageStencilSampleCounts
2382 VkSampleCountFlags storageImageSampleCounts
Jesse Halld27f6aa2015-08-15 17:58:48 -07002383 u32 maxSampleMaskWords /// max num of sample mask words
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002384 VkBool32 timestampComputeAndGraphics
Jesse Halld27f6aa2015-08-15 17:58:48 -07002385
Jesse Halla9bb62b2015-11-21 19:31:56 -08002386 f32 timestampPeriod
Jesse Halld27f6aa2015-08-15 17:58:48 -07002387
2388 u32 maxClipDistances /// max number of clip distances
2389 u32 maxCullDistances /// max number of cull distances
2390 u32 maxCombinedClipAndCullDistances /// max combined number of user clipping
2391
Jesse Hallfbf97b02015-11-20 14:17:03 -08002392 u32 discreteQueuePriorities
2393
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002394 f32[2] pointSizeRange /// range (min,max) of supported point sizes
2395 f32[2] lineWidthRange /// range (min,max) of supported line widths
Jesse Halld27f6aa2015-08-15 17:58:48 -07002396 f32 pointSizeGranularity /// granularity of supported point sizes
2397 f32 lineWidthGranularity /// granularity of supported line widths
Jesse Hall03b6fe12015-11-24 12:44:21 -08002398 VkBool32 strictLines
Jesse Hall091ed9e2015-11-30 00:55:29 -08002399 VkBool32 standardSampleLocations
Jesse Halla9bb62b2015-11-21 19:31:56 -08002400
Jesse Hall65ab5522015-11-30 00:07:16 -08002401 VkDeviceSize optimalBufferCopyOffsetAlignment
2402 VkDeviceSize optimalBufferCopyRowPitchAlignment
Jesse Halldba27f72015-11-30 14:25:46 -08002403 VkDeviceSize nonCoherentAtomSize
Jesse Halld27f6aa2015-08-15 17:58:48 -07002404}
2405
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002406class VkPhysicalDeviceSparseProperties {
2407 VkBool32 residencyStandard2DBlockShape /// Sparse resources support: GPU will access all 2D (single sample) sparse resources using the standard block shapes (based on pixel format)
Jesse Hallb00daad2015-11-29 19:46:20 -08002408 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 -07002409 VkBool32 residencyStandard3DBlockShape /// Sparse resources support: GPU will access all 3D sparse resources using the standard block shapes (based on pixel format)
2410 VkBool32 residencyAlignedMipSize /// Sparse resources support: Images with mip-level dimensions that are NOT a multiple of the block size will be placed in the mip tail
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002411 VkBool32 residencyNonResidentStrict /// Sparse resources support: GPU can safely access non-resident regions of a resource, all reads return as if data is 0, writes are discarded
2412}
2413
Jesse Halld27f6aa2015-08-15 17:58:48 -07002414class VkSemaphoreCreateInfo {
2415 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO
2416 const void* pNext /// Pointer to next structure
2417 VkSemaphoreCreateFlags flags /// Semaphore creation flags
2418}
2419
2420class VkQueryPoolCreateInfo {
2421 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO
2422 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002423 VkQueryPoolCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002424 VkQueryType queryType
Jesse Hall3dd678a2016-01-08 21:52:01 -08002425 u32 queryCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002426 VkQueryPipelineStatisticFlags pipelineStatistics /// Optional
2427}
2428
2429class VkFramebufferCreateInfo {
2430 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO
2431 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002432 VkFramebufferCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002433 VkRenderPass renderPass
2434 u32 attachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002435 const VkImageView* pAttachments
Jesse Halld27f6aa2015-08-15 17:58:48 -07002436 u32 width
2437 u32 height
2438 u32 layers
2439}
2440
Jesse Hall3fbc8562015-11-29 22:10:52 -08002441class VkDrawIndirectCommand {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002442 u32 vertexCount
2443 u32 instanceCount
2444 u32 firstVertex
2445 u32 firstInstance
2446}
2447
Jesse Hall3fbc8562015-11-29 22:10:52 -08002448class VkDrawIndexedIndirectCommand {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002449 u32 indexCount
2450 u32 instanceCount
2451 u32 firstIndex
2452 s32 vertexOffset
2453 u32 firstInstance
2454}
2455
Jesse Hall3fbc8562015-11-29 22:10:52 -08002456class VkDispatchIndirectCommand {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002457 u32 x
2458 u32 y
2459 u32 z
2460}
2461
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002462@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08002463class VkSurfaceCapabilitiesKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002464 u32 minImageCount
2465 u32 maxImageCount
2466 VkExtent2D currentExtent
2467 VkExtent2D minImageExtent
2468 VkExtent2D maxImageExtent
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002469 u32 maxImageArrayLayers
Jesse Hall1356b0d2015-11-23 17:24:58 -08002470 VkSurfaceTransformFlagsKHR supportedTransforms
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002471 VkSurfaceTransformFlagBitsKHR currentTransform
Jesse Halla6429252015-11-29 18:59:42 -08002472 VkCompositeAlphaFlagsKHR supportedCompositeAlpha
Jesse Hall1356b0d2015-11-23 17:24:58 -08002473 VkImageUsageFlags supportedUsageFlags
Michael Lentine88594d72015-11-12 12:49:45 -08002474}
2475
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002476@extension("VK_KHR_surface")
Michael Lentine88594d72015-11-12 12:49:45 -08002477class VkSurfaceFormatKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002478 VkFormat format
2479 VkColorSpaceKHR colorSpace
Michael Lentine88594d72015-11-12 12:49:45 -08002480}
2481
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002482@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08002483class VkSwapchainCreateInfoKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002484 VkStructureType sType
2485 const void* pNext
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002486 VkSwapchainCreateFlagsKHR flags
Jesse Hall1356b0d2015-11-23 17:24:58 -08002487 VkSurfaceKHR surface
2488 u32 minImageCount
2489 VkFormat imageFormat
2490 VkColorSpaceKHR imageColorSpace
2491 VkExtent2D imageExtent
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002492 u32 imageArrayLayers
2493 VkImageUsageFlags imageUsage
Jesse Hall1356b0d2015-11-23 17:24:58 -08002494 VkSharingMode sharingMode
Jesse Hall03b6fe12015-11-24 12:44:21 -08002495 u32 queueFamilyIndexCount
Jesse Hall1356b0d2015-11-23 17:24:58 -08002496 const u32* pQueueFamilyIndices
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002497 VkSurfaceTransformFlagBitsKHR preTransform
2498 VkCompositeAlphaFlagBitsKHR compositeAlpha
Jesse Hall1356b0d2015-11-23 17:24:58 -08002499 VkPresentModeKHR presentMode
Jesse Hall1356b0d2015-11-23 17:24:58 -08002500 VkBool32 clipped
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002501 VkSwapchainKHR oldSwapchain
Michael Lentine88594d72015-11-12 12:49:45 -08002502}
2503
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002504@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08002505class VkPresentInfoKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002506 VkStructureType sType
2507 const void* pNext
Jesse Hallb00daad2015-11-29 19:46:20 -08002508 u32 waitSemaphoreCount
2509 const VkSemaphore* pWaitSemaphores
Jesse Hall1356b0d2015-11-23 17:24:58 -08002510 u32 swapchainCount
Jesse Hall03b6fe12015-11-24 12:44:21 -08002511 const VkSwapchainKHR* pSwapchains
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002512 const u32* pImageIndices
Jesse Halle1b12782015-11-30 11:27:32 -08002513 VkResult* pResults
Michael Lentine88594d72015-11-12 12:49:45 -08002514}
2515
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002516@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002517class VkDisplayPropertiesKHR {
2518 VkDisplayKHR display
2519 const char* displayName
2520 VkExtent2D physicalDimensions
2521 VkExtent2D physicalResolution
2522 VkSurfaceTransformFlagsKHR supportedTransforms
Jesse Hall1356b0d2015-11-23 17:24:58 -08002523 VkBool32 planeReorderPossible
Jesse Halla6429252015-11-29 18:59:42 -08002524 VkBool32 persistentContent
Michael Lentine88594d72015-11-12 12:49:45 -08002525}
2526
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002527@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08002528class VkDisplayModeParametersKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002529 VkExtent2D visibleRegion
Jesse Halla6429252015-11-29 18:59:42 -08002530 u32 refreshRate
Michael Lentine88594d72015-11-12 12:49:45 -08002531}
Jesse Halld27f6aa2015-08-15 17:58:48 -07002532
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002533@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002534class VkDisplayModePropertiesKHR {
2535 VkDisplayModeKHR displayMode
Jesse Halla6429252015-11-29 18:59:42 -08002536 VkDisplayModeParametersKHR parameters
Jesse Hall1356b0d2015-11-23 17:24:58 -08002537}
2538
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002539@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002540class VkDisplayModeCreateInfoKHR {
2541 VkStructureType sType
2542 const void* pNext
Jesse Hall9ba8bc82015-11-30 16:22:16 -08002543 VkDisplayModeCreateFlagsKHR flags
Jesse Halla6429252015-11-29 18:59:42 -08002544 VkDisplayModeParametersKHR parameters
Jesse Hall1356b0d2015-11-23 17:24:58 -08002545}
2546
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002547@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002548class VkDisplayPlanePropertiesKHR {
Jesse Halla6429252015-11-29 18:59:42 -08002549 VkDisplayKHR currentDisplay
2550 u32 currentStackIndex
2551}
2552
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002553@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08002554class VkDisplayPlaneCapabilitiesKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002555 VkDisplayPlaneAlphaFlagsKHR supportedAlpha
2556 VkOffset2D minSrcPosition
2557 VkOffset2D maxSrcPosition
2558 VkExtent2D minSrcExtent
2559 VkExtent2D maxSrcExtent
2560 VkOffset2D minDstPosition
2561 VkOffset2D maxDstPosition
2562 VkExtent2D minDstExtent
2563 VkExtent2D maxDstExtent
2564}
2565
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002566@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08002567class VkDisplaySurfaceCreateInfoKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002568 VkStructureType sType
2569 const void* pNext
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002570 VkDisplaySurfaceCreateFlagsKHR flags
Jesse Hall1356b0d2015-11-23 17:24:58 -08002571 VkDisplayModeKHR displayMode
2572 u32 planeIndex
2573 u32 planeStackIndex
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002574 VkSurfaceTransformFlagBitsKHR transform
Jesse Hall1356b0d2015-11-23 17:24:58 -08002575 f32 globalAlpha
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002576 VkDisplayPlaneAlphaFlagBitsKHR alphaMode
2577 VkExtent2D imageExtent
Jesse Hall1356b0d2015-11-23 17:24:58 -08002578}
2579
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002580@extension("VK_KHR_display_swapchain")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002581class VkDisplayPresentInfoKHR {
2582 VkStructureType sType
2583 const void* pNext
2584 VkRect2D srcRect
2585 VkRect2D dstRect
Jesse Halla6429252015-11-29 18:59:42 -08002586 VkBool32 persistent
Jesse Hall1356b0d2015-11-23 17:24:58 -08002587}
2588
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002589@extension("VK_KHR_xlib_surface")
2590class VkXlibSurfaceCreateInfoKHR {
2591 VkStructureType sType
2592 const void* pNext
2593 VkXlibSurfaceCreateFlagsKHR flags
2594 platform.Display* dpy
2595 platform.Window window
2596}
2597
2598@extension("VK_KHR_xcb_surface")
2599class VkXcbSurfaceCreateInfoKHR {
2600 VkStructureType sType
2601 const void* pNext
2602 VkXcbSurfaceCreateFlagsKHR flags
2603 platform.xcb_connection_t* connection
2604 platform.xcb_window_t window
2605}
2606
2607@extension("VK_KHR_wayland_surface")
2608class VkWaylandSurfaceCreateInfoKHR {
2609 VkStructureType sType
2610 const void* pNext
2611 VkWaylandSurfaceCreateFlagsKHR flags
2612 platform.wl_display* display
2613 platform.wl_surface* surface
2614}
2615
2616@extension("VK_KHR_mir_surface")
2617class VkMirSurfaceCreateInfoKHR {
2618 VkStructureType sType
2619 const void* pNext
2620 VkMirSurfaceCreateFlagsKHR flags
2621 platform.MirConnection* connection
2622 platform.MirSurface* mirSurface
2623}
2624
2625@extension("VK_KHR_android_surface")
2626class VkAndroidSurfaceCreateInfoKHR {
2627 VkStructureType sType
2628 const void* pNext
2629 VkAndroidSurfaceCreateFlagsKHR flags
2630 platform.ANativeWindow* window
2631}
2632
2633@extension("VK_KHR_win32_surface")
2634class VkWin32SurfaceCreateInfoKHR {
2635 VkStructureType sType
2636 const void* pNext
2637 VkWin32SurfaceCreateFlagsKHR flags
2638 platform.HINSTANCE hinstance
2639 platform.HWND hwnd
2640}
2641
Chia-I Wub262ddc2016-03-22 07:38:20 +08002642@extension("VK_ANDROID_native_buffer")
2643class VkNativeBufferANDROID {
2644 VkStructureType sType
2645 const void* pNext
2646 platform.buffer_handle_t handle
2647 int stride
2648 int format
2649 int usage
2650}
2651
Jesse Hall715b86a2016-01-16 16:34:29 -08002652@extension("VK_EXT_debug_report")
2653class VkDebugReportCallbackCreateInfoEXT {
2654 VkStructureType sType
2655 const void* pNext
2656 VkDebugReportFlagsEXT flags
2657 PFN_vkDebugReportCallbackEXT pfnCallback
2658 void* pUserData
2659}
2660
Jesse Hall26763382016-05-20 07:13:52 -07002661@extension("VK_AMD_rasterization_order")
2662class VkPipelineRasterizationStateRasterizationOrderAMD {
2663 VkStructureType sType
2664 const void* pNext
2665 VkRasterizationOrderAMD rasterizationOrder
2666}
2667
2668@extension("VK_EXT_debug_marker")
2669class VkDebugMarkerObjectNameInfoEXT {
2670 VkStructureType sType
2671 const void* pNext
2672 VkDebugReportObjectTypeEXT objectType
2673 u64 object
2674 const char* pObjectName
2675}
2676
2677@extension("VK_EXT_debug_marker")
2678class VkDebugMarkerObjectTagInfoEXT {
2679 VkStructureType sType
2680 const void* pNext
2681 VkDebugReportObjectTypeEXT objectType
2682 u64 object
2683 u64 tagName
2684 platform.size_t tagSize
2685 const void* pTag
2686}
2687
2688@extension("VK_EXT_debug_marker")
2689class VkDebugMarkerMarkerInfoEXT {
2690 VkStructureType sType
2691 const void* pNext
2692 const char* pMarkerName
2693 f32[4] color
2694}
2695
Jesse Hall1356b0d2015-11-23 17:24:58 -08002696
Jesse Halld27f6aa2015-08-15 17:58:48 -07002697////////////////
2698// Commands //
2699////////////////
2700
2701// Function pointers. TODO: add support for function pointers.
2702
2703@external type void* PFN_vkVoidFunction
2704@pfn cmd void vkVoidFunction() {
2705}
2706
Jesse Hall3fbc8562015-11-29 22:10:52 -08002707@external type void* PFN_vkAllocationFunction
2708@pfn cmd void* vkAllocationFunction(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002709 void* pUserData,
2710 platform.size_t size,
2711 platform.size_t alignment,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002712 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08002713 return ?
2714}
2715
Jesse Hall3fbc8562015-11-29 22:10:52 -08002716@external type void* PFN_vkReallocationFunction
2717@pfn cmd void* vkReallocationFunction(
Jesse Hall03b6fe12015-11-24 12:44:21 -08002718 void* pUserData,
2719 void* pOriginal,
2720 platform.size_t size,
2721 platform.size_t alignment,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002722 VkSystemAllocationScope allocationScope) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002723 return ?
2724}
2725
2726@external type void* PFN_vkFreeFunction
2727@pfn cmd void vkFreeFunction(
2728 void* pUserData,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002729 void* pMemory) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002730}
2731
Jesse Hall3fbc8562015-11-29 22:10:52 -08002732@external type void* PFN_vkInternalAllocationNotification
2733@pfn cmd void vkInternalAllocationNotification(
Jesse Hall03b6fe12015-11-24 12:44:21 -08002734 void* pUserData,
2735 platform.size_t size,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002736 VkInternalAllocationType allocationType,
2737 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08002738}
2739
2740@external type void* PFN_vkInternalFreeNotification
2741@pfn cmd void vkInternalFreeNotification(
2742 void* pUserData,
2743 platform.size_t size,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002744 VkInternalAllocationType allocationType,
2745 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08002746}
Jesse Halld27f6aa2015-08-15 17:58:48 -07002747
2748// Global functions
2749
2750@threadSafety("system")
2751cmd VkResult vkCreateInstance(
2752 const VkInstanceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002753 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002754 VkInstance* pInstance) {
2755 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO)
2756
2757 instance := ?
2758 pInstance[0] = instance
2759 State.Instances[instance] = new!InstanceObject()
2760
Jesse Hall3dd678a2016-01-08 21:52:01 -08002761 layers := pCreateInfo.ppEnabledLayerNames[0:pCreateInfo.enabledLayerCount]
2762 extensions := pCreateInfo.ppEnabledExtensionNames[0:pCreateInfo.enabledExtensionCount]
Jesse Halld27f6aa2015-08-15 17:58:48 -07002763
2764 return ?
2765}
2766
2767@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002768cmd void vkDestroyInstance(
Jesse Hall03b6fe12015-11-24 12:44:21 -08002769 VkInstance instance,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002770 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002771 instanceObject := GetInstance(instance)
2772
2773 State.Instances[instance] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07002774}
2775
2776@threadSafety("system")
2777cmd VkResult vkEnumeratePhysicalDevices(
2778 VkInstance instance,
2779 u32* pPhysicalDeviceCount,
2780 VkPhysicalDevice* pPhysicalDevices) {
2781 instanceObject := GetInstance(instance)
2782
2783 physicalDeviceCount := as!u32(?)
2784 pPhysicalDeviceCount[0] = physicalDeviceCount
2785 physicalDevices := pPhysicalDevices[0:physicalDeviceCount]
2786
2787 for i in (0 .. physicalDeviceCount) {
2788 physicalDevice := ?
2789 physicalDevices[i] = physicalDevice
2790 if !(physicalDevice in State.PhysicalDevices) {
2791 State.PhysicalDevices[physicalDevice] = new!PhysicalDeviceObject(instance: instance)
2792 }
2793 }
2794
2795 return ?
2796}
2797
2798cmd PFN_vkVoidFunction vkGetDeviceProcAddr(
2799 VkDevice device,
2800 const char* pName) {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002801 if device != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002802 device := GetDevice(device)
2803 }
2804
2805 return ?
2806}
2807
2808cmd PFN_vkVoidFunction vkGetInstanceProcAddr(
2809 VkInstance instance,
2810 const char* pName) {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002811 if instance != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002812 instanceObject := GetInstance(instance)
2813 }
2814
2815 return ?
2816}
2817
Jesse Hall606a54e2015-11-19 22:17:28 -08002818cmd void vkGetPhysicalDeviceProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002819 VkPhysicalDevice physicalDevice,
2820 VkPhysicalDeviceProperties* pProperties) {
2821 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2822
2823 properties := ?
2824 pProperties[0] = properties
Jesse Halld27f6aa2015-08-15 17:58:48 -07002825}
2826
Jesse Hall606a54e2015-11-19 22:17:28 -08002827cmd void vkGetPhysicalDeviceQueueFamilyProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002828 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08002829 u32* pQueueFamilyPropertyCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002830 VkQueueFamilyProperties* pQueueFamilyProperties) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002831 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002832 // TODO: Figure out how to express fetch-count-or-properties
2833 // This version fails 'apic validate' with 'fence not allowed in
2834 // *semantic.Branch'. Other attempts have failed with the same or other
2835 // errors.
2836 // if pQueueFamilyProperties != null {
2837 // queuesProperties := pQueueFamilyProperties[0:pCount[0]]
2838 // for i in (0 .. pCount[0]) {
2839 // queueProperties := as!VkQueueFamilyProperties(?)
2840 // queuesProperties[i] = queueProperties
2841 // }
2842 // } else {
2843 // count := ?
2844 // pCount[0] = count
2845 // }
Jesse Halld27f6aa2015-08-15 17:58:48 -07002846}
2847
Jesse Hall606a54e2015-11-19 22:17:28 -08002848cmd void vkGetPhysicalDeviceMemoryProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002849 VkPhysicalDevice physicalDevice,
2850 VkPhysicalDeviceMemoryProperties* pMemoryProperties) {
2851 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2852
2853 memoryProperties := ?
2854 pMemoryProperties[0] = memoryProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07002855}
2856
Jesse Hall606a54e2015-11-19 22:17:28 -08002857cmd void vkGetPhysicalDeviceFeatures(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002858 VkPhysicalDevice physicalDevice,
2859 VkPhysicalDeviceFeatures* pFeatures) {
2860 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2861
2862 features := ?
2863 pFeatures[0] = features
Jesse Halld27f6aa2015-08-15 17:58:48 -07002864}
2865
Jesse Hall606a54e2015-11-19 22:17:28 -08002866cmd void vkGetPhysicalDeviceFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002867 VkPhysicalDevice physicalDevice,
2868 VkFormat format,
2869 VkFormatProperties* pFormatProperties) {
2870 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2871
2872 formatProperties := ?
2873 pFormatProperties[0] = formatProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07002874}
2875
Jesse Halla9e57032015-11-30 01:03:10 -08002876cmd VkResult vkGetPhysicalDeviceImageFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002877 VkPhysicalDevice physicalDevice,
2878 VkFormat format,
2879 VkImageType type,
2880 VkImageTiling tiling,
2881 VkImageUsageFlags usage,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002882 VkImageCreateFlags flags,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002883 VkImageFormatProperties* pImageFormatProperties) {
2884 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2885
2886 imageFormatProperties := ?
2887 pImageFormatProperties[0] = imageFormatProperties
Jesse Halla9e57032015-11-30 01:03:10 -08002888
2889 return ?
Jesse Halld27f6aa2015-08-15 17:58:48 -07002890}
2891
Jesse Halld27f6aa2015-08-15 17:58:48 -07002892
2893// Device functions
2894
2895@threadSafety("system")
2896cmd VkResult vkCreateDevice(
2897 VkPhysicalDevice physicalDevice,
2898 const VkDeviceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002899 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002900 VkDevice* pDevice) {
2901 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO)
2902 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2903
2904 device := ?
2905 pDevice[0] = device
2906 State.Devices[device] = new!DeviceObject(physicalDevice: physicalDevice)
2907
2908 return ?
2909}
2910
2911@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002912cmd void vkDestroyDevice(
Jesse Hall03b6fe12015-11-24 12:44:21 -08002913 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08002914 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002915 deviceObject := GetDevice(device)
2916
2917 State.Devices[device] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07002918}
2919
2920
2921// Extension discovery functions
2922
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002923cmd VkResult vkEnumerateInstanceLayerProperties(
Jesse Hall03b6fe12015-11-24 12:44:21 -08002924 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002925 VkLayerProperties* pProperties) {
2926 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08002927 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07002928
2929 properties := pProperties[0:count]
2930 for i in (0 .. count) {
2931 property := ?
2932 properties[i] = property
2933 }
2934
2935 return ?
2936}
2937
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002938cmd VkResult vkEnumerateInstanceExtensionProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002939 const char* pLayerName,
Jesse Hall03b6fe12015-11-24 12:44:21 -08002940 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002941 VkExtensionProperties* pProperties) {
2942 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08002943 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07002944
2945 properties := pProperties[0:count]
2946 for i in (0 .. count) {
2947 property := ?
2948 properties[i] = property
2949 }
2950
2951 return ?
2952}
2953
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002954cmd VkResult vkEnumerateDeviceLayerProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002955 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08002956 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002957 VkLayerProperties* pProperties) {
2958 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2959 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08002960 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07002961
2962 properties := pProperties[0:count]
2963 for i in (0 .. count) {
2964 property := ?
2965 properties[i] = property
2966 }
2967
2968 return ?
2969}
2970
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002971cmd VkResult vkEnumerateDeviceExtensionProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002972 VkPhysicalDevice physicalDevice,
2973 const char* pLayerName,
Jesse Hall03b6fe12015-11-24 12:44:21 -08002974 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07002975 VkExtensionProperties* pProperties) {
2976 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
2977
2978 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08002979 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07002980
2981 properties := pProperties[0:count]
2982 for i in (0 .. count) {
2983 property := ?
2984 properties[i] = property
2985 }
2986
2987 return ?
2988}
2989
2990
2991// Queue functions
2992
2993@threadSafety("system")
Jesse Hall606a54e2015-11-19 22:17:28 -08002994cmd void vkGetDeviceQueue(
Jesse Halld27f6aa2015-08-15 17:58:48 -07002995 VkDevice device,
2996 u32 queueFamilyIndex,
2997 u32 queueIndex,
2998 VkQueue* pQueue) {
2999 deviceObject := GetDevice(device)
3000
3001 queue := ?
3002 pQueue[0] = queue
3003
3004 if !(queue in State.Queues) {
3005 State.Queues[queue] = new!QueueObject(device: device)
3006 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07003007}
3008
3009@threadSafety("app")
3010cmd VkResult vkQueueSubmit(
3011 VkQueue queue,
Jesse Halla366a512015-11-19 22:30:07 -08003012 u32 submitCount,
Jesse Hallb00daad2015-11-29 19:46:20 -08003013 const VkSubmitInfo* pSubmits,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003014 VkFence fence) {
3015 queueObject := GetQueue(queue)
3016
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003017 if fence != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003018 fenceObject := GetFence(fence)
3019 assert(fenceObject.device == queueObject.device)
3020 }
3021
Jesse Hall3fbc8562015-11-29 22:10:52 -08003022 // commandBuffers := pcommandBuffers[0:commandBufferCount]
3023 // for i in (0 .. commandBufferCount) {
3024 // commandBuffer := commandBuffers[i]
3025 // commandBufferObject := GetCommandBuffer(commandBuffer)
3026 // assert(commandBufferObject.device == queueObject.device)
Jesse Halla366a512015-11-19 22:30:07 -08003027 //
Jesse Hall3fbc8562015-11-29 22:10:52 -08003028 // validate("QueueCheck", commandBufferObject.queueFlags in queueObject.flags,
3029 // "vkQueueSubmit: enqueued commandBuffer requires missing queue capabilities.")
Jesse Halla366a512015-11-19 22:30:07 -08003030 // }
Jesse Halld27f6aa2015-08-15 17:58:48 -07003031
3032 return ?
3033}
3034
3035@threadSafety("system")
3036cmd VkResult vkQueueWaitIdle(
3037 VkQueue queue) {
3038 queueObject := GetQueue(queue)
3039
3040 return ?
3041}
3042
3043@threadSafety("system")
3044cmd VkResult vkDeviceWaitIdle(
3045 VkDevice device) {
3046 deviceObject := GetDevice(device)
3047
3048 return ?
3049}
3050
3051
3052// Memory functions
3053
3054@threadSafety("system")
Jesse Hall3fbc8562015-11-29 22:10:52 -08003055cmd VkResult vkAllocateMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003056 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003057 const VkMemoryAllocateInfo* pAllocateInfo,
3058 const VkAllocationCallbacks* pAllocator,
3059 VkDeviceMemory* pMemory) {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08003060 assert(pAllocateInfo.sType == VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003061 deviceObject := GetDevice(device)
3062
Jesse Hall3fbc8562015-11-29 22:10:52 -08003063 memory := ?
3064 pMemory[0] = memory
3065 State.DeviceMemories[memory] = new!DeviceMemoryObject(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003066 device: device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003067 allocationSize: pAllocateInfo[0].allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003068
3069 return ?
3070}
3071
3072@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003073cmd void vkFreeMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003074 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003075 VkDeviceMemory memory,
3076 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003077 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003078 memoryObject := GetDeviceMemory(memory)
3079 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003080
3081 // Check that no objects are still bound before freeing.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003082 validate("MemoryCheck", len(memoryObject.boundObjects) == 0,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003083 "vkFreeMemory: objects still bound")
Jesse Hall3fbc8562015-11-29 22:10:52 -08003084 validate("MemoryCheck", len(memoryObject.boundCommandBuffers) == 0,
3085 "vkFreeMemory: commandBuffers still bound")
3086 State.DeviceMemories[memory] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003087}
3088
3089@threadSafety("app")
3090cmd VkResult vkMapMemory(
3091 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003092 VkDeviceMemory memory,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003093 VkDeviceSize offset,
3094 VkDeviceSize size,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003095 VkMemoryMapFlags flags,
3096 void** ppData) {
3097 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003098 memoryObject := GetDeviceMemory(memory)
3099 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003100
3101 assert(flags == as!VkMemoryMapFlags(0))
Jesse Hall3fbc8562015-11-29 22:10:52 -08003102 assert((offset + size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003103
3104 return ?
3105}
3106
3107@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003108cmd void vkUnmapMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003109 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003110 VkDeviceMemory memory) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003111 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003112 memoryObject := GetDeviceMemory(memory)
3113 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003114}
3115
3116cmd VkResult vkFlushMappedMemoryRanges(
3117 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003118 u32 memoryRangeCount
3119 const VkMappedMemoryRange* pMemoryRanges) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003120 deviceObject := GetDevice(device)
3121
Jesse Hall3fbc8562015-11-29 22:10:52 -08003122 memoryRanges := pMemoryRanges[0:memoryRangeCount]
3123 for i in (0 .. memoryRangeCount) {
3124 memoryRange := memoryRanges[i]
3125 memoryObject := GetDeviceMemory(memoryRange.memory)
3126 assert(memoryObject.device == device)
3127 assert((memoryRange.offset + memoryRange.size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003128 }
3129
3130 return ?
3131}
3132
3133cmd VkResult vkInvalidateMappedMemoryRanges(
3134 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003135 u32 memoryRangeCount,
3136 const VkMappedMemoryRange* pMemoryRanges) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003137 deviceObject := GetDevice(device)
3138
Jesse Hall3fbc8562015-11-29 22:10:52 -08003139 memoryRanges := pMemoryRanges[0:memoryRangeCount]
3140 for i in (0 .. memoryRangeCount) {
3141 memoryRange := memoryRanges[i]
3142 memoryObject := GetDeviceMemory(memoryRange.memory)
3143 assert(memoryObject.device == device)
3144 assert((memoryRange.offset + memoryRange.size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003145 }
3146
3147 return ?
3148}
3149
3150
3151// Memory management API functions
3152
Jesse Hall606a54e2015-11-19 22:17:28 -08003153cmd void vkGetDeviceMemoryCommitment(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003154 VkDevice device,
3155 VkDeviceMemory memory,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003156 VkDeviceSize* pCommittedMemoryInBytes) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003157 deviceObject := GetDevice(device)
3158
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003159 if memory != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003160 memoryObject := GetDeviceMemory(memory)
3161 assert(memoryObject.device == device)
3162 }
3163
3164 committedMemoryInBytes := ?
3165 pCommittedMemoryInBytes[0] = committedMemoryInBytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07003166}
3167
Jesse Hall606a54e2015-11-19 22:17:28 -08003168cmd void vkGetBufferMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003169 VkDevice device,
3170 VkBuffer buffer,
3171 VkMemoryRequirements* pMemoryRequirements) {
3172 deviceObject := GetDevice(device)
3173 bufferObject := GetBuffer(buffer)
3174 assert(bufferObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003175}
3176
3177cmd VkResult vkBindBufferMemory(
3178 VkDevice device,
3179 VkBuffer buffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003180 VkDeviceMemory memory,
3181 VkDeviceSize memoryOffset) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003182 deviceObject := GetDevice(device)
3183 bufferObject := GetBuffer(buffer)
3184 assert(bufferObject.device == device)
3185
3186 // Unbind buffer from previous memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003187 if bufferObject.memory != NULL_HANDLE {
3188 memoryObject := GetDeviceMemory(bufferObject.memory)
3189 memoryObject.boundObjects[as!u64(buffer)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003190 }
3191
3192 // Bind buffer to given memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003193 if memory != NULL_HANDLE {
3194 memoryObject := GetDeviceMemory(memory)
3195 assert(memoryObject.device == device)
3196 memoryObject.boundObjects[as!u64(buffer)] = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003197 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08003198 bufferObject.memory = memory
3199 bufferObject.memoryOffset = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003200
3201 return ?
3202}
3203
Jesse Hall606a54e2015-11-19 22:17:28 -08003204cmd void vkGetImageMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003205 VkDevice device,
3206 VkImage image,
3207 VkMemoryRequirements* pMemoryRequirements) {
3208 deviceObject := GetDevice(device)
3209 imageObject := GetImage(image)
3210 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003211}
3212
3213cmd VkResult vkBindImageMemory(
3214 VkDevice device,
3215 VkImage image,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003216 VkDeviceMemory memory,
3217 VkDeviceSize memoryOffset) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003218 deviceObject := GetDevice(device)
3219 imageObject := GetImage(image)
3220 assert(imageObject.device == device)
3221
3222 // Unbind image from previous memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003223 if imageObject.memory != NULL_HANDLE {
3224 memoryObject := GetDeviceMemory(imageObject.memory)
3225 memoryObject.boundObjects[as!u64(image)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003226 }
3227
3228 // Bind image to given memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003229 if memory != NULL_HANDLE {
3230 memoryObject := GetDeviceMemory(memory)
3231 assert(memoryObject.device == device)
3232 memoryObject.boundObjects[as!u64(image)] = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003233 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08003234 imageObject.memory = memory
3235 imageObject.memoryOffset = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003236
3237 return ?
3238}
3239
Jesse Hall606a54e2015-11-19 22:17:28 -08003240cmd void vkGetImageSparseMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003241 VkDevice device,
3242 VkImage image,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003243 u32* pSparseMemoryRequirementCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003244 VkSparseImageMemoryRequirements* pSparseMemoryRequirements) {
3245 deviceObject := GetDevice(device)
3246 imageObject := GetImage(image)
3247 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003248}
3249
Jesse Hall606a54e2015-11-19 22:17:28 -08003250cmd void vkGetPhysicalDeviceSparseImageFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003251 VkPhysicalDevice physicalDevice,
3252 VkFormat format,
3253 VkImageType type,
Jesse Hall091ed9e2015-11-30 00:55:29 -08003254 VkSampleCountFlagBits samples,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003255 VkImageUsageFlags usage,
3256 VkImageTiling tiling,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003257 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003258 VkSparseImageFormatProperties* pProperties) {
3259 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003260}
3261
Jesse Halla6429252015-11-29 18:59:42 -08003262cmd VkResult vkQueueBindSparse(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003263 VkQueue queue,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003264 u32 bindInfoCount,
Jesse Halla6429252015-11-29 18:59:42 -08003265 const VkBindSparseInfo* pBindInfo,
3266 VkFence fence) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003267 queueObject := GetQueue(queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003268
3269 return ?
3270}
3271
3272
3273// Fence functions
3274
3275@threadSafety("system")
3276cmd VkResult vkCreateFence(
3277 VkDevice device,
3278 const VkFenceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003279 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003280 VkFence* pFence) {
3281 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_FENCE_CREATE_INFO)
3282 deviceObject := GetDevice(device)
3283
3284 fence := ?
3285 pFence[0] = fence
3286 State.Fences[fence] = new!FenceObject(
Jesse Halld8bade02015-11-24 10:24:18 -08003287 device: device, signaled: (pCreateInfo.flags == as!VkFenceCreateFlags(VK_FENCE_CREATE_SIGNALED_BIT)))
Jesse Halld27f6aa2015-08-15 17:58:48 -07003288
3289 return ?
3290}
3291
3292@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003293cmd void vkDestroyFence(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003294 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003295 VkFence fence,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003296 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003297 deviceObject := GetDevice(device)
3298 fenceObject := GetFence(fence)
3299 assert(fenceObject.device == device)
3300
3301 State.Fences[fence] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003302}
3303
3304@threadSafety("system")
3305cmd VkResult vkResetFences(
3306 VkDevice device,
3307 u32 fenceCount,
3308 const VkFence* pFences) {
3309 deviceObject := GetDevice(device)
3310
3311 fences := pFences[0:fenceCount]
3312 for i in (0 .. fenceCount) {
3313 fence := fences[i]
3314 fenceObject := GetFence(fence)
3315 assert(fenceObject.device == device)
3316 fenceObject.signaled = false
3317 }
3318
3319 return ?
3320}
3321
3322@threadSafety("system")
3323cmd VkResult vkGetFenceStatus(
3324 VkDevice device,
3325 VkFence fence) {
3326 deviceObject := GetDevice(device)
3327 fenceObject := GetFence(fence)
3328 assert(fenceObject.device == device)
3329
3330 return ?
3331}
3332
3333@threadSafety("system")
3334cmd VkResult vkWaitForFences(
3335 VkDevice device,
3336 u32 fenceCount,
3337 const VkFence* pFences,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003338 VkBool32 waitAll,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003339 u64 timeout) { /// timeout in nanoseconds
3340 deviceObject := GetDevice(device)
3341
3342 fences := pFences[0:fenceCount]
3343 for i in (0 .. fenceCount) {
3344 fence := fences[i]
3345 fenceObject := GetFence(fence)
3346 assert(fenceObject.device == device)
3347 }
3348
3349 return ?
3350}
3351
3352
3353// Queue semaphore functions
3354
3355@threadSafety("system")
3356cmd VkResult vkCreateSemaphore(
3357 VkDevice device,
3358 const VkSemaphoreCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003359 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003360 VkSemaphore* pSemaphore) {
3361 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO)
3362 deviceObject := GetDevice(device)
3363
3364 semaphore := ?
3365 pSemaphore[0] = semaphore
3366 State.Semaphores[semaphore] = new!SemaphoreObject(device: device)
3367
3368 return ?
3369}
3370
3371@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003372cmd void vkDestroySemaphore(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003373 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003374 VkSemaphore semaphore,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003375 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003376 deviceObject := GetDevice(device)
3377 semaphoreObject := GetSemaphore(semaphore)
3378 assert(semaphoreObject.device == device)
3379
3380 State.Semaphores[semaphore] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003381}
3382
Jesse Halld27f6aa2015-08-15 17:58:48 -07003383
3384// Event functions
3385
3386@threadSafety("system")
3387cmd VkResult vkCreateEvent(
3388 VkDevice device,
3389 const VkEventCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003390 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003391 VkEvent* pEvent) {
3392 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_EVENT_CREATE_INFO)
3393 deviceObject := GetDevice(device)
3394
3395 event := ?
3396 pEvent[0] = event
3397 State.Events[event] = new!EventObject(device: device)
3398
3399 return ?
3400}
3401
3402@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003403cmd void vkDestroyEvent(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003404 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003405 VkEvent event,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003406 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003407 deviceObject := GetDevice(device)
3408 eventObject := GetEvent(event)
3409 assert(eventObject.device == device)
3410
3411 State.Events[event] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003412}
3413
3414@threadSafety("system")
3415cmd VkResult vkGetEventStatus(
3416 VkDevice device,
3417 VkEvent event) {
3418 deviceObject := GetDevice(device)
3419 eventObject := GetEvent(event)
3420 assert(eventObject.device == device)
3421
3422 return ?
3423}
3424
3425@threadSafety("system")
3426cmd VkResult vkSetEvent(
3427 VkDevice device,
3428 VkEvent event) {
3429 deviceObject := GetDevice(device)
3430 eventObject := GetEvent(event)
3431 assert(eventObject.device == device)
3432
3433 return ?
3434}
3435
3436@threadSafety("system")
3437cmd VkResult vkResetEvent(
3438 VkDevice device,
3439 VkEvent event) {
3440 deviceObject := GetDevice(device)
3441 eventObject := GetEvent(event)
3442 assert(eventObject.device == device)
3443
3444 return ?
3445}
3446
3447
3448// Query functions
3449
3450@threadSafety("system")
3451cmd VkResult vkCreateQueryPool(
3452 VkDevice device,
3453 const VkQueryPoolCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003454 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003455 VkQueryPool* pQueryPool) {
3456 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO)
3457 deviceObject := GetDevice(device)
3458
3459 queryPool := ?
3460 pQueryPool[0] = queryPool
3461 State.QueryPools[queryPool] = new!QueryPoolObject(device: device)
3462
3463 return ?
3464}
3465
3466@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003467cmd void vkDestroyQueryPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003468 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003469 VkQueryPool queryPool,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003470 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003471 deviceObject := GetDevice(device)
3472 queryPoolObject := GetQueryPool(queryPool)
3473 assert(queryPoolObject.device == device)
3474
3475 State.QueryPools[queryPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003476}
3477
3478@threadSafety("system")
3479cmd VkResult vkGetQueryPoolResults(
3480 VkDevice device,
3481 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08003482 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003483 u32 queryCount,
Jesse Halla9bb62b2015-11-21 19:31:56 -08003484 platform.size_t dataSize,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003485 void* pData,
Jesse Halla9bb62b2015-11-21 19:31:56 -08003486 VkDeviceSize stride,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003487 VkQueryResultFlags flags) {
3488 deviceObject := GetDevice(device)
3489 queryPoolObject := GetQueryPool(queryPool)
3490 assert(queryPoolObject.device == device)
3491
Jesse Halld27f6aa2015-08-15 17:58:48 -07003492 data := pData[0:dataSize]
3493
3494 return ?
3495}
3496
3497// Buffer functions
3498
3499@threadSafety("system")
3500cmd VkResult vkCreateBuffer(
3501 VkDevice device,
3502 const VkBufferCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003503 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003504 VkBuffer* pBuffer) {
3505 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO)
3506 deviceObject := GetDevice(device)
3507
3508 buffer := ?
3509 pBuffer[0] = buffer
3510 State.Buffers[buffer] = new!BufferObject(device: device)
3511
3512 return ?
3513}
3514
3515@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003516cmd void vkDestroyBuffer(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003517 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003518 VkBuffer buffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003519 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003520 deviceObject := GetDevice(device)
3521 bufferObject := GetBuffer(buffer)
3522 assert(bufferObject.device == device)
3523
Jesse Hall3fbc8562015-11-29 22:10:52 -08003524 assert(bufferObject.memory == 0)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003525 State.Buffers[buffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003526}
3527
3528
3529// Buffer view functions
3530
3531@threadSafety("system")
3532cmd VkResult vkCreateBufferView(
3533 VkDevice device,
3534 const VkBufferViewCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003535 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003536 VkBufferView* pView) {
3537 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO)
3538 deviceObject := GetDevice(device)
3539
3540 bufferObject := GetBuffer(pCreateInfo.buffer)
3541 assert(bufferObject.device == device)
3542
3543 view := ?
3544 pView[0] = view
3545 State.BufferViews[view] = new!BufferViewObject(device: device, buffer: pCreateInfo.buffer)
3546
3547 return ?
3548}
3549
3550@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003551cmd void vkDestroyBufferView(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003552 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003553 VkBufferView bufferView,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003554 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003555 deviceObject := GetDevice(device)
3556 bufferViewObject := GetBufferView(bufferView)
3557 assert(bufferViewObject.device == device)
3558
3559 State.BufferViews[bufferView] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003560}
3561
3562
3563// Image functions
3564
3565@threadSafety("system")
3566cmd VkResult vkCreateImage(
3567 VkDevice device,
3568 const VkImageCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003569 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003570 VkImage* pImage) {
3571 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO)
3572 deviceObject := GetDevice(device)
3573
3574 image := ?
3575 pImage[0] = image
3576 State.Images[image] = new!ImageObject(device: device)
3577
3578 return ?
3579}
3580
3581@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003582cmd void vkDestroyImage(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003583 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003584 VkImage image,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003585 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003586 deviceObject := GetDevice(device)
3587 imageObject := GetImage(image)
3588 assert(imageObject.device == device)
3589
Jesse Hall3fbc8562015-11-29 22:10:52 -08003590 assert(imageObject.memory == 0)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003591 State.Images[image] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003592}
3593
Jesse Hall606a54e2015-11-19 22:17:28 -08003594cmd void vkGetImageSubresourceLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003595 VkDevice device,
3596 VkImage image,
3597 const VkImageSubresource* pSubresource,
3598 VkSubresourceLayout* pLayout) {
3599 deviceObject := GetDevice(device)
3600 imageObject := GetImage(image)
3601 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003602}
3603
3604
3605// Image view functions
3606
3607@threadSafety("system")
3608cmd VkResult vkCreateImageView(
3609 VkDevice device,
3610 const VkImageViewCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003611 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003612 VkImageView* pView) {
3613 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO)
3614 deviceObject := GetDevice(device)
3615
3616 imageObject := GetImage(pCreateInfo.image)
3617 assert(imageObject.device == device)
3618
3619 view := ?
3620 pView[0] = view
3621 State.ImageViews[view] = new!ImageViewObject(device: device, image: pCreateInfo.image)
3622
3623 return ?
3624}
3625
3626@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003627cmd void vkDestroyImageView(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003628 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003629 VkImageView imageView,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003630 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003631 deviceObject := GetDevice(device)
3632 imageViewObject := GetImageView(imageView)
3633 assert(imageViewObject.device == device)
3634
3635 State.ImageViews[imageView] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003636}
3637
3638
3639// Shader functions
3640
3641cmd VkResult vkCreateShaderModule(
3642 VkDevice device,
3643 const VkShaderModuleCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003644 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003645 VkShaderModule* pShaderModule) {
3646 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO)
3647 deviceObject := GetDevice(device)
3648
3649 shaderModule := ?
3650 pShaderModule[0] = shaderModule
3651 State.ShaderModules[shaderModule] = new!ShaderModuleObject(device: device)
3652
3653 return ?
3654}
3655
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003656cmd void vkDestroyShaderModule(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003657 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003658 VkShaderModule shaderModule,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003659 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003660 deviceObject := GetDevice(device)
3661 shaderModuleObject := GetShaderModule(shaderModule)
3662 assert(shaderModuleObject.device == device)
3663
3664 State.ShaderModules[shaderModule] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003665}
3666
Jesse Halld27f6aa2015-08-15 17:58:48 -07003667
3668// Pipeline functions
3669
3670cmd VkResult vkCreatePipelineCache(
3671 VkDevice device,
3672 const VkPipelineCacheCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003673 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003674 VkPipelineCache* pPipelineCache) {
3675 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO)
3676 deviceObject := GetDevice(device)
3677
3678 pipelineCache := ?
3679 pPipelineCache[0] = pipelineCache
3680 State.PipelineCaches[pipelineCache] = new!PipelineCacheObject(device: device)
3681
3682 return ?
3683}
3684
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003685cmd void vkDestroyPipelineCache(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003686 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003687 VkPipelineCache pipelineCache,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003688 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003689 deviceObject := GetDevice(device)
3690 pipelineCacheObject := GetPipelineCache(pipelineCache)
3691 assert(pipelineCacheObject.device == device)
3692
3693 State.PipelineCaches[pipelineCache] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003694}
3695
Jesse Halld27f6aa2015-08-15 17:58:48 -07003696cmd VkResult vkGetPipelineCacheData(
3697 VkDevice device,
3698 VkPipelineCache pipelineCache,
Jesse Halla9bb62b2015-11-21 19:31:56 -08003699 platform.size_t* pDataSize,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003700 void* pData) {
3701 deviceObject := GetDevice(device)
3702 pipelineCacheObject := GetPipelineCache(pipelineCache)
3703 assert(pipelineCacheObject.device == device)
3704
3705 return ?
3706}
3707
3708cmd VkResult vkMergePipelineCaches(
3709 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003710 VkPipelineCache dstCache,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003711 u32 srcCacheCount,
3712 const VkPipelineCache* pSrcCaches) {
3713 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003714 dstCacheObject := GetPipelineCache(dstCache)
3715 assert(dstCacheObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003716
3717 srcCaches := pSrcCaches[0:srcCacheCount]
3718 for i in (0 .. srcCacheCount) {
3719 srcCache := srcCaches[i]
3720 srcCacheObject := GetPipelineCache(srcCache)
3721 assert(srcCacheObject.device == device)
3722 }
3723
3724 return ?
3725}
3726
3727cmd VkResult vkCreateGraphicsPipelines(
3728 VkDevice device,
3729 VkPipelineCache pipelineCache,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003730 u32 createInfoCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003731 const VkGraphicsPipelineCreateInfo* pCreateInfos,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003732 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003733 VkPipeline* pPipelines) {
3734 deviceObject := GetDevice(device)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003735 if pipelineCache != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003736 pipelineCacheObject := GetPipelineCache(pipelineCache)
3737 assert(pipelineCacheObject.device == device)
3738 }
3739
Jesse Hall03b6fe12015-11-24 12:44:21 -08003740 createInfos := pCreateInfos[0:createInfoCount]
3741 pipelines := pPipelines[0:createInfoCount]
3742 for i in (0 .. createInfoCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003743 pipeline := ?
3744 pipelines[i] = pipeline
3745 State.Pipelines[pipeline] = new!PipelineObject(device: device)
3746 }
3747
3748 return ?
3749}
3750
3751cmd VkResult vkCreateComputePipelines(
3752 VkDevice device,
3753 VkPipelineCache pipelineCache,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003754 u32 createInfoCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003755 const VkComputePipelineCreateInfo* pCreateInfos,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003756 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003757 VkPipeline* pPipelines) {
3758 deviceObject := GetDevice(device)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003759 if pipelineCache != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003760 pipelineCacheObject := GetPipelineCache(pipelineCache)
3761 assert(pipelineCacheObject.device == device)
3762 }
3763
Jesse Hall03b6fe12015-11-24 12:44:21 -08003764 createInfos := pCreateInfos[0:createInfoCount]
3765 pipelines := pPipelines[0:createInfoCount]
3766 for i in (0 .. createInfoCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003767 pipeline := ?
3768 pipelines[i] = pipeline
3769 State.Pipelines[pipeline] = new!PipelineObject(device: device)
3770 }
3771
3772 return ?
3773}
3774
3775@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003776cmd void vkDestroyPipeline(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003777 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003778 VkPipeline pipeline,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003779 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003780 deviceObject := GetDevice(device)
3781 pipelineObjects := GetPipeline(pipeline)
3782 assert(pipelineObjects.device == device)
3783
3784 State.Pipelines[pipeline] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003785}
3786
3787
3788// Pipeline layout functions
3789
3790@threadSafety("system")
3791cmd VkResult vkCreatePipelineLayout(
3792 VkDevice device,
3793 const VkPipelineLayoutCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003794 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003795 VkPipelineLayout* pPipelineLayout) {
3796 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO)
3797 deviceObject := GetDevice(device)
3798
3799 pipelineLayout := ?
3800 pPipelineLayout[0] = pipelineLayout
3801 State.PipelineLayouts[pipelineLayout] = new!PipelineLayoutObject(device: device)
3802
3803 return ?
3804}
3805
3806@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003807cmd void vkDestroyPipelineLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003808 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003809 VkPipelineLayout pipelineLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003810 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003811 deviceObject := GetDevice(device)
3812 pipelineLayoutObjects := GetPipelineLayout(pipelineLayout)
3813 assert(pipelineLayoutObjects.device == device)
3814
3815 State.PipelineLayouts[pipelineLayout] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003816}
3817
3818
3819// Sampler functions
3820
3821@threadSafety("system")
3822cmd VkResult vkCreateSampler(
3823 VkDevice device,
3824 const VkSamplerCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003825 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003826 VkSampler* pSampler) {
3827 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO)
3828 deviceObject := GetDevice(device)
3829
3830 sampler := ?
3831 pSampler[0] = sampler
3832 State.Samplers[sampler] = new!SamplerObject(device: device)
3833
3834 return ?
3835}
3836
3837@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003838cmd void vkDestroySampler(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003839 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003840 VkSampler sampler,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003841 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003842 deviceObject := GetDevice(device)
3843 samplerObject := GetSampler(sampler)
3844 assert(samplerObject.device == device)
3845
3846 State.Samplers[sampler] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003847}
3848
3849
3850// Descriptor set functions
3851
3852@threadSafety("system")
3853cmd VkResult vkCreateDescriptorSetLayout(
3854 VkDevice device,
3855 const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003856 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003857 VkDescriptorSetLayout* pSetLayout) {
3858 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO)
3859 deviceObject := GetDevice(device)
3860
3861 setLayout := ?
3862 pSetLayout[0] = setLayout
3863 State.DescriptorSetLayouts[setLayout] = new!DescriptorSetLayoutObject(device: device)
3864
3865 return ?
3866}
3867
3868@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003869cmd void vkDestroyDescriptorSetLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003870 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003871 VkDescriptorSetLayout descriptorSetLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003872 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003873 deviceObject := GetDevice(device)
3874 descriptorSetLayoutObject := GetDescriptorSetLayout(descriptorSetLayout)
3875 assert(descriptorSetLayoutObject.device == device)
3876
3877 State.DescriptorSetLayouts[descriptorSetLayout] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003878}
3879
3880@threadSafety("system")
3881cmd VkResult vkCreateDescriptorPool(
3882 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003883 const VkDescriptorPoolCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003884 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003885 VkDescriptorPool* pDescriptorPool) {
3886 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO)
3887 deviceObject := GetDevice(device)
3888
3889 descriptorPool := ?
3890 pDescriptorPool[0] = descriptorPool
3891 State.DescriptorPools[descriptorPool] = new!DescriptorPoolObject(device: device)
3892
3893 return ?
3894}
3895
3896@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003897cmd void vkDestroyDescriptorPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003898 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003899 VkDescriptorPool descriptorPool,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003900 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003901 deviceObject := GetDevice(device)
3902 descriptorPoolObject := GetDescriptorPool(descriptorPool)
3903 assert(descriptorPoolObject.device == device)
3904
3905 State.DescriptorPools[descriptorPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003906}
3907
3908@threadSafety("app")
3909cmd VkResult vkResetDescriptorPool(
3910 VkDevice device,
Jesse Hallfbf97b02015-11-20 14:17:03 -08003911 VkDescriptorPool descriptorPool,
3912 VkDescriptorPoolResetFlags flags) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003913 deviceObject := GetDevice(device)
3914 descriptorPoolObject := GetDescriptorPool(descriptorPool)
3915 assert(descriptorPoolObject.device == device)
3916
3917 return ?
3918}
3919
3920@threadSafety("app")
Jesse Hall3fbc8562015-11-29 22:10:52 -08003921cmd VkResult vkAllocateDescriptorSets(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003922 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003923 const VkDescriptorSetAllocateInfo* pAllocateInfo,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003924 VkDescriptorSet* pDescriptorSets) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003925 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003926 allocInfo := pAllocateInfo[0]
Jesse Hallfbf97b02015-11-20 14:17:03 -08003927 descriptorPoolObject := GetDescriptorPool(allocInfo.descriptorPool)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003928
Jesse Hall03b6fe12015-11-24 12:44:21 -08003929 setLayouts := allocInfo.pSetLayouts[0:allocInfo.setCount]
3930 for i in (0 .. allocInfo.setCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003931 setLayout := setLayouts[i]
3932 setLayoutObject := GetDescriptorSetLayout(setLayout)
3933 assert(setLayoutObject.device == device)
3934 }
3935
Jesse Hall03b6fe12015-11-24 12:44:21 -08003936 descriptorSets := pDescriptorSets[0:allocInfo.setCount]
3937 for i in (0 .. allocInfo.setCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003938 descriptorSet := ?
3939 descriptorSets[i] = descriptorSet
3940 State.DescriptorSets[descriptorSet] = new!DescriptorSetObject(device: device)
3941 }
3942
3943 return ?
3944}
3945
Jesse Hallf09c6b12015-08-15 19:54:28 -07003946cmd VkResult vkFreeDescriptorSets(
3947 VkDevice device,
3948 VkDescriptorPool descriptorPool,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003949 u32 descriptorSetCount,
Jesse Hallf09c6b12015-08-15 19:54:28 -07003950 const VkDescriptorSet* pDescriptorSets) {
3951 deviceObject := GetDevice(device)
3952 descriptorPoolObject := GetDescriptorPool(descriptorPool)
3953
Jesse Hall03b6fe12015-11-24 12:44:21 -08003954 descriptorSets := pDescriptorSets[0:descriptorSetCount]
3955 for i in (0 .. descriptorSetCount) {
Jesse Hallf09c6b12015-08-15 19:54:28 -07003956 descriptorSet := descriptorSets[i]
3957 descriptorSetObject := GetDescriptorSet(descriptorSet)
3958 assert(descriptorSetObject.device == device)
3959 State.DescriptorSets[descriptorSet] = null
3960 }
3961
3962 return ?
3963}
3964
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003965cmd void vkUpdateDescriptorSets(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003966 VkDevice device,
Jesse Hallb00daad2015-11-29 19:46:20 -08003967 u32 descriptorWriteCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003968 const VkWriteDescriptorSet* pDescriptorWrites,
Jesse Hallb00daad2015-11-29 19:46:20 -08003969 u32 descriptorCopyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003970 const VkCopyDescriptorSet* pDescriptorCopies) {
3971 deviceObject := GetDevice(device)
3972
Jesse Hallb00daad2015-11-29 19:46:20 -08003973 descriptorWrites := pDescriptorWrites[0:descriptorWriteCount]
3974 for i in (0 .. descriptorWriteCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003975 descriptorWrite := descriptorWrites[i]
Jesse Hall3fbc8562015-11-29 22:10:52 -08003976 descriptorWriteObject := GetDescriptorSet(descriptorWrite.dstSet)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003977 assert(descriptorWriteObject.device == device)
3978 }
3979
Jesse Hallb00daad2015-11-29 19:46:20 -08003980 descriptorCopies := pDescriptorCopies[0:descriptorCopyCount]
3981 for i in (0 .. descriptorCopyCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003982 descriptorCopy := descriptorCopies[i]
Jesse Hall3fbc8562015-11-29 22:10:52 -08003983 descriptorCopyObject := GetDescriptorSet(descriptorCopy.dstSet)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003984 assert(descriptorCopyObject.device == device)
3985 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07003986}
3987
3988
3989// Framebuffer functions
3990
3991@threadSafety("system")
3992cmd VkResult vkCreateFramebuffer(
3993 VkDevice device,
3994 const VkFramebufferCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003995 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003996 VkFramebuffer* pFramebuffer) {
3997 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO)
3998 deviceObject := GetDevice(device)
3999
4000 framebuffer := ?
4001 pFramebuffer[0] = framebuffer
4002 State.Framebuffers[framebuffer] = new!FramebufferObject(device: device)
4003
4004 return ?
4005}
4006
4007@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004008cmd void vkDestroyFramebuffer(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004009 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004010 VkFramebuffer framebuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004011 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004012 deviceObject := GetDevice(device)
4013 framebufferObject := GetFramebuffer(framebuffer)
4014 assert(framebufferObject.device == device)
4015
4016 State.Framebuffers[framebuffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004017}
4018
4019
4020// Renderpass functions
4021
4022@threadSafety("system")
4023cmd VkResult vkCreateRenderPass(
4024 VkDevice device,
4025 const VkRenderPassCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004026 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004027 VkRenderPass* pRenderPass) {
4028 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO)
4029 deviceObject := GetDevice(device)
4030
4031 renderpass := ?
4032 pRenderPass[0] = renderpass
4033 State.RenderPasses[renderpass] = new!RenderPassObject(device: device)
4034
4035 return ?
4036}
4037
4038@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004039cmd void vkDestroyRenderPass(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004040 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004041 VkRenderPass renderPass,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004042 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004043 deviceObject := GetDevice(device)
4044 renderPassObject := GetRenderPass(renderPass)
4045 assert(renderPassObject.device == device)
4046
4047 State.RenderPasses[renderPass] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004048}
4049
Jesse Hall606a54e2015-11-19 22:17:28 -08004050cmd void vkGetRenderAreaGranularity(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004051 VkDevice device,
4052 VkRenderPass renderPass,
4053 VkExtent2D* pGranularity) {
4054 deviceObject := GetDevice(device)
4055 renderPassObject := GetRenderPass(renderPass)
4056
4057 granularity := ?
4058 pGranularity[0] = granularity
Jesse Halld27f6aa2015-08-15 17:58:48 -07004059}
4060
4061// Command pool functions
4062
4063cmd VkResult vkCreateCommandPool(
4064 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004065 const VkCommandPoolCreateInfo* pCreateInfo,
4066 const VkAllocationCallbacks* pAllocator,
4067 VkCommandPool* pCommandPool) {
4068 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004069 deviceObject := GetDevice(device)
4070
Jesse Hall3fbc8562015-11-29 22:10:52 -08004071 commandPool := ?
4072 pCommandPool[0] = commandPool
4073 State.CommandPools[commandPool] = new!CommandPoolObject(device: device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004074
4075 return ?
4076}
4077
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004078cmd void vkDestroyCommandPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004079 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004080 VkCommandPool commandPool,
4081 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004082 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004083 commandPoolObject := GetCommandPool(commandPool)
4084 assert(commandPoolObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004085
Jesse Hall3fbc8562015-11-29 22:10:52 -08004086 State.CommandPools[commandPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004087}
4088
4089cmd VkResult vkResetCommandPool(
4090 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004091 VkCommandPool commandPool,
4092 VkCommandPoolResetFlags flags) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004093 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004094 commandPoolObject := GetCommandPool(commandPool)
4095 assert(commandPoolObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004096
4097 return ?
4098}
4099
4100// Command buffer functions
4101
Jesse Hall3fbc8562015-11-29 22:10:52 -08004102macro void bindCommandBuffer(VkCommandBuffer commandBuffer, any obj, VkDeviceMemory memory) {
4103 memoryObject := GetDeviceMemory(memory)
4104 memoryObject.boundCommandBuffers[commandBuffer] = commandBuffer
Jesse Halld27f6aa2015-08-15 17:58:48 -07004105
Jesse Hall3fbc8562015-11-29 22:10:52 -08004106 commandBufferObject := GetCommandBuffer(commandBuffer)
4107 commandBufferObject.boundObjects[as!u64(obj)] = memory
Jesse Halld27f6aa2015-08-15 17:58:48 -07004108}
4109
Jesse Hall3fbc8562015-11-29 22:10:52 -08004110macro void unbindCommandBuffer(VkCommandBuffer commandBuffer, any obj, VkDeviceMemory memory) {
4111 memoryObject := GetDeviceMemory(memory)
4112 memoryObject.boundCommandBuffers[commandBuffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004113
Jesse Hall3fbc8562015-11-29 22:10:52 -08004114 commandBufferObject := GetCommandBuffer(commandBuffer)
4115 commandBufferObject.boundObjects[as!u64(obj)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004116}
4117
4118@threadSafety("system")
Jesse Hall3fbc8562015-11-29 22:10:52 -08004119cmd VkResult vkAllocateCommandBuffers(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004120 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004121 const VkCommandBufferAllocateInfo* pAllocateInfo,
4122 VkCommandBuffer* pCommandBuffers) {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08004123 assert(pAllocateInfo[0].sType == VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004124
Jesse Hall3dd678a2016-01-08 21:52:01 -08004125 count := pAllocateInfo[0].commandBufferCount
Jesse Hall3fbc8562015-11-29 22:10:52 -08004126 commandBuffers := pCommandBuffers[0:count]
Jesse Hallfbf97b02015-11-20 14:17:03 -08004127 for i in (0 .. count) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004128 commandBuffer := ?
4129 commandBuffers[i] = commandBuffer
4130 State.CommandBuffers[commandBuffer] = new!CommandBufferObject(device: device)
Jesse Hallfbf97b02015-11-20 14:17:03 -08004131 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07004132
4133 return ?
4134}
4135
4136@threadSafety("system")
Jesse Hallfbf97b02015-11-20 14:17:03 -08004137cmd void vkFreeCommandBuffers(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004138 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004139 VkCommandPool commandPool,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004140 u32 commandBufferCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004141 const VkCommandBuffer* pCommandBuffers) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004142 deviceObject := GetDevice(device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004143
Jesse Hall3fbc8562015-11-29 22:10:52 -08004144 commandBuffers := pCommandBuffers[0:commandBufferCount]
Jesse Hall03b6fe12015-11-24 12:44:21 -08004145 for i in (0 .. commandBufferCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004146 commandBufferObject := GetCommandBuffer(commandBuffers[i])
4147 assert(commandBufferObject.device == device)
Jesse Hallfbf97b02015-11-20 14:17:03 -08004148 // TODO: iterate over boundObjects and clear memory bindings
Jesse Hall3fbc8562015-11-29 22:10:52 -08004149 State.CommandBuffers[commandBuffers[i]] = null
Jesse Hallfbf97b02015-11-20 14:17:03 -08004150 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07004151}
4152
4153@threadSafety("app")
4154cmd VkResult vkBeginCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004155 VkCommandBuffer commandBuffer,
4156 const VkCommandBufferBeginInfo* pBeginInfo) {
4157 assert(pBeginInfo.sType == VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO)
4158 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004159
4160 // TODO: iterate over boundObjects and clear memory bindings
4161
4162 return ?
4163}
4164
4165@threadSafety("app")
4166cmd VkResult vkEndCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004167 VkCommandBuffer commandBuffer) {
4168 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004169
4170 return ?
4171}
4172
4173@threadSafety("app")
4174cmd VkResult vkResetCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004175 VkCommandBuffer commandBuffer,
4176 VkCommandBufferResetFlags flags) {
4177 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004178
4179 // TODO: iterate over boundObjects and clear memory bindings
4180
4181 return ?
4182}
4183
4184
4185// Command buffer building functions
4186
4187@threadSafety("app")
4188cmd void vkCmdBindPipeline(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004189 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004190 VkPipelineBindPoint pipelineBindPoint,
4191 VkPipeline pipeline) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004192 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004193 pipelineObject := GetPipeline(pipeline)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004194 assert(commandBufferObject.device == pipelineObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004195
Jesse Halld8bade02015-11-24 10:24:18 -08004196 queue := switch (pipelineBindPoint) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004197 case VK_PIPELINE_BIND_POINT_COMPUTE: VK_QUEUE_COMPUTE_BIT
4198 case VK_PIPELINE_BIND_POINT_GRAPHICS: VK_QUEUE_GRAPHICS_BIT
4199 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08004200 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004201}
4202
4203@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004204cmd void vkCmdSetViewport(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004205 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004206 u32 firstViewport,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004207 u32 viewportCount,
4208 const VkViewport* pViewports) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004209 commandBufferObject := GetCommandBuffer(commandBuffer)
4210 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004211}
4212
4213@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004214cmd void vkCmdSetScissor(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004215 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004216 u32 firstScissor,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004217 u32 scissorCount,
4218 const VkRect2D* pScissors) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004219 commandBufferObject := GetCommandBuffer(commandBuffer)
4220 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004221}
4222
4223@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004224cmd void vkCmdSetLineWidth(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004225 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004226 f32 lineWidth) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004227 commandBufferObject := GetCommandBuffer(commandBuffer)
4228 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004229}
4230
4231@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004232cmd void vkCmdSetDepthBias(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004233 VkCommandBuffer commandBuffer,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004234 f32 depthBiasConstantFactor,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004235 f32 depthBiasClamp,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004236 f32 depthBiasSlopeFactor) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004237 commandBufferObject := GetCommandBuffer(commandBuffer)
4238 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004239}
Jesse Halld27f6aa2015-08-15 17:58:48 -07004240
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004241@threadSafety("app")
4242cmd void vkCmdSetBlendConstants(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004243 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004244 // TODO(jessehall): apic only supports 'const' on pointer types. Using
4245 // an annotation as a quick hack to pass this to the template without
4246 // having to modify the AST and semantic model.
Jesse Hallb00daad2015-11-29 19:46:20 -08004247 @readonly f32[4] blendConstants) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004248 commandBufferObject := GetCommandBuffer(commandBuffer)
4249 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004250}
4251
4252@threadSafety("app")
4253cmd void vkCmdSetDepthBounds(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004254 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004255 f32 minDepthBounds,
4256 f32 maxDepthBounds) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004257 commandBufferObject := GetCommandBuffer(commandBuffer)
4258 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004259}
4260
4261@threadSafety("app")
4262cmd void vkCmdSetStencilCompareMask(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004263 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004264 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08004265 u32 compareMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004266 commandBufferObject := GetCommandBuffer(commandBuffer)
4267 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004268}
4269
4270@threadSafety("app")
4271cmd void vkCmdSetStencilWriteMask(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004272 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004273 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08004274 u32 writeMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004275 commandBufferObject := GetCommandBuffer(commandBuffer)
4276 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004277}
4278
4279@threadSafety("app")
4280cmd void vkCmdSetStencilReference(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004281 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004282 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08004283 u32 reference) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004284 commandBufferObject := GetCommandBuffer(commandBuffer)
4285 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004286}
4287
4288@threadSafety("app")
4289cmd void vkCmdBindDescriptorSets(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004290 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004291 VkPipelineBindPoint pipelineBindPoint,
4292 VkPipelineLayout layout,
4293 u32 firstSet,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004294 u32 descriptorSetCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004295 const VkDescriptorSet* pDescriptorSets,
4296 u32 dynamicOffsetCount,
4297 const u32* pDynamicOffsets) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004298 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004299
Jesse Hall03b6fe12015-11-24 12:44:21 -08004300 descriptorSets := pDescriptorSets[0:descriptorSetCount]
4301 for i in (0 .. descriptorSetCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004302 descriptorSet := descriptorSets[i]
4303 descriptorSetObject := GetDescriptorSet(descriptorSet)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004304 assert(commandBufferObject.device == descriptorSetObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004305 }
4306
4307 dynamicOffsets := pDynamicOffsets[0:dynamicOffsetCount]
4308 for i in (0 .. dynamicOffsetCount) {
4309 dynamicOffset := dynamicOffsets[i]
4310 }
4311
Jesse Halld8bade02015-11-24 10:24:18 -08004312 queue := switch (pipelineBindPoint) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004313 case VK_PIPELINE_BIND_POINT_COMPUTE: VK_QUEUE_COMPUTE_BIT
4314 case VK_PIPELINE_BIND_POINT_GRAPHICS: VK_QUEUE_GRAPHICS_BIT
4315 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08004316 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004317}
4318
4319@threadSafety("app")
4320cmd void vkCmdBindIndexBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004321 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004322 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004323 VkDeviceSize offset,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004324 VkIndexType indexType) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004325 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004326 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004327 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004328
Jesse Hall3fbc8562015-11-29 22:10:52 -08004329 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004330
Jesse Hall3fbc8562015-11-29 22:10:52 -08004331 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004332}
4333
4334@threadSafety("app")
4335cmd void vkCmdBindVertexBuffers(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004336 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004337 u32 firstBinding,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004338 u32 bindingCount,
4339 const VkBuffer* pBuffers,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004340 const VkDeviceSize* pOffsets) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004341 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004342
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004343 // TODO: check if not [firstBinding:firstBinding+bindingCount]
Jesse Halld27f6aa2015-08-15 17:58:48 -07004344 buffers := pBuffers[0:bindingCount]
4345 offsets := pOffsets[0:bindingCount]
4346 for i in (0 .. bindingCount) {
4347 buffer := buffers[i]
4348 offset := offsets[i]
4349 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004350 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004351
Jesse Hall3fbc8562015-11-29 22:10:52 -08004352 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004353 }
4354
Jesse Hall3fbc8562015-11-29 22:10:52 -08004355 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004356}
4357
4358@threadSafety("app")
4359cmd void vkCmdDraw(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004360 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004361 u32 vertexCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004362 u32 instanceCount,
4363 u32 firstVertex,
4364 u32 firstInstance) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004365 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004366
Jesse Hall3fbc8562015-11-29 22:10:52 -08004367 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004368}
4369
4370@threadSafety("app")
4371cmd void vkCmdDrawIndexed(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004372 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004373 u32 indexCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004374 u32 instanceCount,
4375 u32 firstIndex,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004376 s32 vertexOffset,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004377 u32 firstInstance) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004378 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004379
Jesse Hall3fbc8562015-11-29 22:10:52 -08004380 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004381}
4382
4383@threadSafety("app")
4384cmd void vkCmdDrawIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004385 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004386 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004387 VkDeviceSize offset,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004388 u32 drawCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004389 u32 stride) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004390 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004391 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004392 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004393
Jesse Hall3fbc8562015-11-29 22:10:52 -08004394 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004395
Jesse Hall3fbc8562015-11-29 22:10:52 -08004396 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004397}
4398
4399@threadSafety("app")
4400cmd void vkCmdDrawIndexedIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004401 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004402 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004403 VkDeviceSize offset,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004404 u32 drawCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004405 u32 stride) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004406 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004407 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004408 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004409
Jesse Hall3fbc8562015-11-29 22:10:52 -08004410 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004411
Jesse Hall3fbc8562015-11-29 22:10:52 -08004412 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004413}
4414
4415@threadSafety("app")
4416cmd void vkCmdDispatch(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004417 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004418 u32 x,
4419 u32 y,
4420 u32 z) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004421 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004422
Jesse Hall3fbc8562015-11-29 22:10:52 -08004423 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_COMPUTE_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004424}
4425
4426@threadSafety("app")
4427cmd void vkCmdDispatchIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004428 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004429 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004430 VkDeviceSize offset) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004431 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004432 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004433 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004434
Jesse Hall3fbc8562015-11-29 22:10:52 -08004435 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004436
Jesse Hall3fbc8562015-11-29 22:10:52 -08004437 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_COMPUTE_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004438}
4439
4440@threadSafety("app")
4441cmd void vkCmdCopyBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004442 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004443 VkBuffer srcBuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004444 VkBuffer dstBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004445 u32 regionCount,
4446 const VkBufferCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004447 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004448 srcBufferObject := GetBuffer(srcBuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004449 dstBufferObject := GetBuffer(dstBuffer)
4450 assert(commandBufferObject.device == srcBufferObject.device)
4451 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004452
4453 regions := pRegions[0:regionCount]
4454 for i in (0 .. regionCount) {
4455 region := regions[i]
4456 }
4457
Jesse Hall3fbc8562015-11-29 22:10:52 -08004458 bindCommandBuffer(commandBuffer, srcBuffer, srcBufferObject.memory)
4459 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004460
Jesse Hall65ab5522015-11-30 00:07:16 -08004461 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004462}
4463
4464@threadSafety("app")
4465cmd void vkCmdCopyImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004466 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004467 VkImage srcImage,
4468 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004469 VkImage dstImage,
4470 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004471 u32 regionCount,
4472 const VkImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004473 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004474 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004475 dstImageObject := GetImage(dstImage)
4476 assert(commandBufferObject.device == srcImageObject.device)
4477 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004478
4479 regions := pRegions[0:regionCount]
4480 for i in (0 .. regionCount) {
4481 region := regions[i]
4482 }
4483
Jesse Hall3fbc8562015-11-29 22:10:52 -08004484 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
4485 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004486
Jesse Hall65ab5522015-11-30 00:07:16 -08004487 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004488}
4489
4490@threadSafety("app")
4491cmd void vkCmdBlitImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004492 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004493 VkImage srcImage,
4494 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004495 VkImage dstImage,
4496 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004497 u32 regionCount,
4498 const VkImageBlit* pRegions,
Jesse Hall23ff73f2015-11-29 14:36:39 -08004499 VkFilter filter) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004500 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004501 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004502 dstImageObject := GetImage(dstImage)
4503 assert(commandBufferObject.device == srcImageObject.device)
4504 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004505
4506 regions := pRegions[0:regionCount]
4507 for i in (0 .. regionCount) {
4508 region := regions[i]
4509 }
4510
Jesse Hall3fbc8562015-11-29 22:10:52 -08004511 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
4512 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004513
Jesse Hall3fbc8562015-11-29 22:10:52 -08004514 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004515}
4516
4517@threadSafety("app")
4518cmd void vkCmdCopyBufferToImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004519 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004520 VkBuffer srcBuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004521 VkImage dstImage,
4522 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004523 u32 regionCount,
4524 const VkBufferImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004525 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004526 srcBufferObject := GetBuffer(srcBuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004527 dstImageObject := GetImage(dstImage)
4528 assert(commandBufferObject.device == srcBufferObject.device)
4529 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004530
4531 regions := pRegions[0:regionCount]
4532 for i in (0 .. regionCount) {
4533 region := regions[i]
4534 }
4535
Jesse Hall3fbc8562015-11-29 22:10:52 -08004536 bindCommandBuffer(commandBuffer, srcBuffer, srcBufferObject.memory)
4537 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004538
Jesse Hall65ab5522015-11-30 00:07:16 -08004539 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004540}
4541
4542@threadSafety("app")
4543cmd void vkCmdCopyImageToBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004544 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004545 VkImage srcImage,
4546 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004547 VkBuffer dstBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004548 u32 regionCount,
4549 const VkBufferImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004550 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004551 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004552 dstBufferObject := GetBuffer(dstBuffer)
4553 assert(commandBufferObject.device == srcImageObject.device)
4554 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004555
4556 regions := pRegions[0:regionCount]
4557 for i in (0 .. regionCount) {
4558 region := regions[i]
4559 }
4560
Jesse Hall3fbc8562015-11-29 22:10:52 -08004561 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
4562 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004563
Jesse Hall65ab5522015-11-30 00:07:16 -08004564 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004565}
4566
4567@threadSafety("app")
4568cmd void vkCmdUpdateBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004569 VkCommandBuffer commandBuffer,
4570 VkBuffer dstBuffer,
4571 VkDeviceSize dstOffset,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004572 VkDeviceSize dataSize,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004573 const u32* pData) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004574 commandBufferObject := GetCommandBuffer(commandBuffer)
4575 dstBufferObject := GetBuffer(dstBuffer)
4576 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004577
4578 data := pData[0:dataSize]
4579
Jesse Hall3fbc8562015-11-29 22:10:52 -08004580 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004581
Jesse Hall65ab5522015-11-30 00:07:16 -08004582 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004583}
4584
4585@threadSafety("app")
4586cmd void vkCmdFillBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004587 VkCommandBuffer commandBuffer,
4588 VkBuffer dstBuffer,
4589 VkDeviceSize dstOffset,
Jesse Hallb00daad2015-11-29 19:46:20 -08004590 VkDeviceSize size,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004591 u32 data) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004592 commandBufferObject := GetCommandBuffer(commandBuffer)
4593 dstBufferObject := GetBuffer(dstBuffer)
4594 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004595
Jesse Hall65ab5522015-11-30 00:07:16 -08004596 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004597}
4598
4599@threadSafety("app")
4600cmd void vkCmdClearColorImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004601 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004602 VkImage image,
4603 VkImageLayout imageLayout,
4604 const VkClearColorValue* pColor,
4605 u32 rangeCount,
4606 const VkImageSubresourceRange* pRanges) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004607 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004608 imageObject := GetImage(image)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004609 assert(commandBufferObject.device == imageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004610
4611 ranges := pRanges[0:rangeCount]
4612 for i in (0 .. rangeCount) {
4613 range := ranges[i]
4614 }
4615
Jesse Hall3fbc8562015-11-29 22:10:52 -08004616 bindCommandBuffer(commandBuffer, image, imageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004617
Jesse Hall3fbc8562015-11-29 22:10:52 -08004618 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004619}
4620
4621@threadSafety("app")
4622cmd void vkCmdClearDepthStencilImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004623 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004624 VkImage image,
4625 VkImageLayout imageLayout,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004626 const VkClearDepthStencilValue* pDepthStencil,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004627 u32 rangeCount,
4628 const VkImageSubresourceRange* pRanges) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004629 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004630 imageObject := GetImage(image)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004631 assert(commandBufferObject.device == imageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004632
4633 ranges := pRanges[0:rangeCount]
4634 for i in (0 .. rangeCount) {
4635 range := ranges[i]
4636 }
4637
Jesse Hall3fbc8562015-11-29 22:10:52 -08004638 bindCommandBuffer(commandBuffer, image, imageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004639
Jesse Hall3fbc8562015-11-29 22:10:52 -08004640 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004641}
4642
4643@threadSafety("app")
Jesse Hallae38f732015-11-19 21:32:50 -08004644cmd void vkCmdClearAttachments(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004645 VkCommandBuffer commandBuffer,
Jesse Hallae38f732015-11-19 21:32:50 -08004646 u32 attachmentCount,
4647 const VkClearAttachment* pAttachments,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004648 u32 rectCount,
Jesse Halla15a4bf2015-11-19 22:48:02 -08004649 const VkClearRect* pRects) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004650 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004651
4652 rects := pRects[0:rectCount]
4653 for i in (0 .. rectCount) {
4654 rect := rects[i]
4655 }
4656
Jesse Hall3fbc8562015-11-29 22:10:52 -08004657 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004658}
4659
4660@threadSafety("app")
4661cmd void vkCmdResolveImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004662 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004663 VkImage srcImage,
4664 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004665 VkImage dstImage,
4666 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004667 u32 regionCount,
4668 const VkImageResolve* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004669 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004670 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004671 dstImageObject := GetImage(dstImage)
4672 assert(commandBufferObject.device == srcImageObject.device)
4673 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004674
4675 regions := pRegions[0:regionCount]
4676 for i in (0 .. regionCount) {
4677 region := regions[i]
4678 }
4679
Jesse Hall3fbc8562015-11-29 22:10:52 -08004680 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
4681 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004682
Jesse Hall3fbc8562015-11-29 22:10:52 -08004683 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004684}
4685
4686@threadSafety("app")
4687cmd void vkCmdSetEvent(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004688 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004689 VkEvent event,
4690 VkPipelineStageFlags stageMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004691 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004692 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004693 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004694}
4695
4696@threadSafety("app")
4697cmd void vkCmdResetEvent(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004698 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004699 VkEvent event,
4700 VkPipelineStageFlags stageMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004701 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004702 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004703 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004704}
4705
4706@threadSafety("app")
4707cmd void vkCmdWaitEvents(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004708 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004709 u32 eventCount,
4710 const VkEvent* pEvents,
4711 VkPipelineStageFlags srcStageMask,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004712 VkPipelineStageFlags dstStageMask,
4713 u32 memoryBarrierCount,
Jesse Hall3dd678a2016-01-08 21:52:01 -08004714 const VkMemoryBarrier* pMemoryBarriers,
4715 u32 bufferMemoryBarrierCount,
4716 const VkBufferMemoryBarrier* pBufferMemoryBarriers,
4717 u32 imageMemoryBarrierCount,
4718 const VkImageMemoryBarrier* pImageMemoryBarriers) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004719 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004720
4721 events := pEvents[0:eventCount]
4722 for i in (0 .. eventCount) {
4723 event := events[i]
4724 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004725 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004726 }
4727
Jesse Hall3dd678a2016-01-08 21:52:01 -08004728 memoryBarriers := pMemoryBarriers[0:memoryBarrierCount]
Jesse Hall3fbc8562015-11-29 22:10:52 -08004729 for i in (0 .. memoryBarrierCount) {
Jesse Hall3dd678a2016-01-08 21:52:01 -08004730 memoryBarrier := memoryBarriers[i]
4731 }
4732 bufferMemoryBarriers := pBufferMemoryBarriers[0:bufferMemoryBarrierCount]
4733 for i in (0 .. bufferMemoryBarrierCount) {
4734 bufferMemoryBarrier := bufferMemoryBarriers[i]
4735 bufferObject := GetBuffer(bufferMemoryBarrier.buffer)
4736 assert(bufferObject.device == commandBufferObject.device)
4737 }
4738 imageMemoryBarriers := pImageMemoryBarriers[0:imageMemoryBarrierCount]
4739 for i in (0 .. imageMemoryBarrierCount) {
4740 imageMemoryBarrier := imageMemoryBarriers[i]
4741 imageObject := GetImage(imageMemoryBarrier.image)
4742 assert(imageObject.device == commandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004743 }
4744}
4745
4746@threadSafety("app")
4747cmd void vkCmdPipelineBarrier(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004748 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004749 VkPipelineStageFlags srcStageMask,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004750 VkPipelineStageFlags dstStageMask,
Jesse Halldc6d36c2015-11-29 19:12:15 -08004751 VkDependencyFlags dependencyFlags,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004752 u32 memoryBarrierCount,
Jesse Hall3dd678a2016-01-08 21:52:01 -08004753 const VkMemoryBarrier* pMemoryBarriers,
4754 u32 bufferMemoryBarrierCount,
4755 const VkBufferMemoryBarrier* pBufferMemoryBarriers,
4756 u32 imageMemoryBarrierCount,
4757 const VkImageMemoryBarrier* pImageMemoryBarriers) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004758 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004759
Jesse Hall3dd678a2016-01-08 21:52:01 -08004760 memoryBarriers := pMemoryBarriers[0:memoryBarrierCount]
Jesse Hall3fbc8562015-11-29 22:10:52 -08004761 for i in (0 .. memoryBarrierCount) {
Jesse Hall3dd678a2016-01-08 21:52:01 -08004762 memoryBarrier := memoryBarriers[i]
4763 }
4764 bufferMemoryBarriers := pBufferMemoryBarriers[0:bufferMemoryBarrierCount]
4765 for i in (0 .. bufferMemoryBarrierCount) {
4766 bufferMemoryBarrier := bufferMemoryBarriers[i]
4767 bufferObject := GetBuffer(bufferMemoryBarrier.buffer)
4768 assert(bufferObject.device == commandBufferObject.device)
4769 }
4770 imageMemoryBarriers := pImageMemoryBarriers[0:imageMemoryBarrierCount]
4771 for i in (0 .. imageMemoryBarrierCount) {
4772 imageMemoryBarrier := imageMemoryBarriers[i]
4773 imageObject := GetImage(imageMemoryBarrier.image)
4774 assert(imageObject.device == commandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004775 }
4776}
4777
4778@threadSafety("app")
4779cmd void vkCmdBeginQuery(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004780 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004781 VkQueryPool queryPool,
Jesse Hall3dd678a2016-01-08 21:52:01 -08004782 u32 query,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004783 VkQueryControlFlags flags) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004784 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004785 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004786 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004787}
4788
4789@threadSafety("app")
4790cmd void vkCmdEndQuery(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004791 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004792 VkQueryPool queryPool,
Jesse Hall3dd678a2016-01-08 21:52:01 -08004793 u32 query) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004794 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004795 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004796 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004797}
4798
4799@threadSafety("app")
4800cmd void vkCmdResetQueryPool(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004801 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004802 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004803 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004804 u32 queryCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004805 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004806 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004807 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004808}
4809
4810@threadSafety("app")
4811cmd void vkCmdWriteTimestamp(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004812 VkCommandBuffer commandBuffer,
Jesse Hall6f39a6d2015-11-24 11:08:36 -08004813 VkPipelineStageFlagBits pipelineStage,
Jesse Halla3a7a1d2015-11-24 11:37:23 -08004814 VkQueryPool queryPool,
Jesse Hall3dd678a2016-01-08 21:52:01 -08004815 u32 query) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004816 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halla3a7a1d2015-11-24 11:37:23 -08004817 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004818 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004819}
4820
4821@threadSafety("app")
4822cmd void vkCmdCopyQueryPoolResults(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004823 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004824 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004825 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004826 u32 queryCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004827 VkBuffer dstBuffer,
4828 VkDeviceSize dstOffset,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004829 VkDeviceSize stride,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004830 VkQueryResultFlags flags) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004831 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004832 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004833 dstBufferObject := GetBuffer(dstBuffer)
4834 assert(commandBufferObject.device == queryPoolObject.device)
4835 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004836}
4837
4838cmd void vkCmdPushConstants(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004839 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004840 VkPipelineLayout layout,
4841 VkShaderStageFlags stageFlags,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004842 u32 offset,
4843 u32 size,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08004844 const void* pValues) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004845 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004846 layoutObject := GetPipelineLayout(layout)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004847 assert(commandBufferObject.device == layoutObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004848}
4849
4850@threadSafety("app")
4851cmd void vkCmdBeginRenderPass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004852 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004853 const VkRenderPassBeginInfo* pRenderPassBegin,
Jesse Hall65ab5522015-11-30 00:07:16 -08004854 VkSubpassContents contents) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004855 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004856 renderPassObject := GetRenderPass(pRenderPassBegin.renderPass)
4857 framebufferObject := GetFramebuffer(pRenderPassBegin.framebuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004858 assert(commandBufferObject.device == renderPassObject.device)
4859 assert(commandBufferObject.device == framebufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004860
Jesse Hall3fbc8562015-11-29 22:10:52 -08004861 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004862}
4863
4864cmd void vkCmdNextSubpass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004865 VkCommandBuffer commandBuffer,
Jesse Hall65ab5522015-11-30 00:07:16 -08004866 VkSubpassContents contents) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004867 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004868}
4869
4870@threadSafety("app")
4871cmd void vkCmdEndRenderPass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004872 VkCommandBuffer commandBuffer) {
4873 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004874
Jesse Hall3fbc8562015-11-29 22:10:52 -08004875 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004876}
4877
4878cmd void vkCmdExecuteCommands(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004879 VkCommandBuffer commandBuffer,
Jesse Hall3dd678a2016-01-08 21:52:01 -08004880 u32 commandBufferCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004881 const VkCommandBuffer* pCommandBuffers) {
4882 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004883
Jesse Hall3dd678a2016-01-08 21:52:01 -08004884 commandBuffers := pCommandBuffers[0:commandBufferCount]
4885 for i in (0 .. commandBufferCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004886 secondaryCommandBuffer := commandBuffers[i]
4887 secondaryCommandBufferObject := GetCommandBuffer(secondaryCommandBuffer)
4888 assert(commandBufferObject.device == secondaryCommandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004889 }
4890}
4891
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004892@extension("VK_KHR_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08004893cmd void vkDestroySurfaceKHR(
4894 VkInstance instance,
Jesse Hall0e74f002015-11-30 11:37:59 -08004895 VkSurfaceKHR surface,
4896 const VkAllocationCallbacks* pAllocator) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08004897 instanceObject := GetInstance(instance)
4898 surfaceObject := GetSurface(surface)
4899 assert(surfaceObject.instance == instance)
Michael Lentine88594d72015-11-12 12:49:45 -08004900
Jesse Hall1356b0d2015-11-23 17:24:58 -08004901 State.Surfaces[surface] = null
Jesse Hall2818f932015-11-19 21:19:17 -08004902}
4903
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004904@extension("VK_KHR_surface")
Jesse Halla6429252015-11-29 18:59:42 -08004905cmd VkResult vkGetPhysicalDeviceSurfaceSupportKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08004906 VkPhysicalDevice physicalDevice,
4907 u32 queueFamilyIndex,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004908 VkSurfaceKHR surface,
Jesse Hallb00daad2015-11-29 19:46:20 -08004909 VkBool32* pSupported) {
4910 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08004911
4912 return ?
4913}
4914
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004915@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08004916cmd VkResult vkGetPhysicalDeviceSurfaceCapabilitiesKHR(
4917 VkPhysicalDevice physicalDevice,
4918 VkSurfaceKHR surface,
4919 VkSurfaceCapabilitiesKHR* pSurfaceCapabilities) {
4920 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
4921
4922 surfaceCapabilities := ?
4923 pSurfaceCapabilities[0] = surfaceCapabilities
4924
4925 return ?
4926}
4927
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004928@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08004929cmd VkResult vkGetPhysicalDeviceSurfaceFormatsKHR(
4930 VkPhysicalDevice physicalDevice,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004931 VkSurfaceKHR surface,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004932 u32* pSurfaceFormatCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004933 VkSurfaceFormatKHR* pSurfaceFormats) {
Jesse Hallb00daad2015-11-29 19:46:20 -08004934 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08004935
4936 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08004937 pSurfaceFormatCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08004938 surfaceFormats := pSurfaceFormats[0:count]
4939
4940 for i in (0 .. count) {
4941 surfaceFormat := ?
4942 surfaceFormats[i] = surfaceFormat
4943 }
4944
4945 return ?
4946}
4947
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004948@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08004949cmd VkResult vkGetPhysicalDeviceSurfacePresentModesKHR(
4950 VkPhysicalDevice physicalDevice,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004951 VkSurfaceKHR surface,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004952 u32* pPresentModeCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08004953 VkPresentModeKHR* pPresentModes) {
Jesse Hallb00daad2015-11-29 19:46:20 -08004954 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08004955
4956 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08004957 pPresentModeCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08004958 presentModes := pPresentModes[0:count]
4959
4960 for i in (0 .. count) {
4961 presentMode := ?
4962 presentModes[i] = presentMode
4963 }
4964
4965 return ?
4966}
4967
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004968@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08004969cmd VkResult vkCreateSwapchainKHR(
4970 VkDevice device,
4971 const VkSwapchainCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08004972 const VkAllocationCallbacks* pAllocator,
Michael Lentine88594d72015-11-12 12:49:45 -08004973 VkSwapchainKHR* pSwapchain) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08004974 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR)
Michael Lentine88594d72015-11-12 12:49:45 -08004975 deviceObject := GetDevice(device)
4976
4977 swapchain := ?
4978 pSwapchain[0] = swapchain
4979 State.Swapchains[swapchain] = new!SwapchainObject(device: device)
4980
4981 return ?
4982}
4983
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004984@extension("VK_KHR_swapchain")
Jesse Hall1356b0d2015-11-23 17:24:58 -08004985cmd void vkDestroySwapchainKHR(
Michael Lentine88594d72015-11-12 12:49:45 -08004986 VkDevice device,
Jesse Hall0e74f002015-11-30 11:37:59 -08004987 VkSwapchainKHR swapchain,
4988 const VkAllocationCallbacks* pAllocator) {
Michael Lentine88594d72015-11-12 12:49:45 -08004989 deviceObject := GetDevice(device)
4990 swapchainObject := GetSwapchain(swapchain)
4991 assert(swapchainObject.device == device)
4992
4993 State.Swapchains[swapchain] = null
Michael Lentine88594d72015-11-12 12:49:45 -08004994}
4995
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08004996@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08004997cmd VkResult vkGetSwapchainImagesKHR(
4998 VkDevice device,
4999 VkSwapchainKHR swapchain,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005000 u32* pSwapchainImageCount,
Michael Lentine88594d72015-11-12 12:49:45 -08005001 VkImage* pSwapchainImages) {
5002 deviceObject := GetDevice(device)
5003
5004 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08005005 pSwapchainImageCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08005006 swapchainImages := pSwapchainImages[0:count]
5007
5008 for i in (0 .. count) {
5009 swapchainImage := ?
5010 swapchainImages[i] = swapchainImage
Jesse Hall1356b0d2015-11-23 17:24:58 -08005011 State.Images[swapchainImage] = new!ImageObject(device: device)
Michael Lentine88594d72015-11-12 12:49:45 -08005012 }
5013
5014 return ?
5015}
5016
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005017@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005018cmd VkResult vkAcquireNextImageKHR(
5019 VkDevice device,
5020 VkSwapchainKHR swapchain,
5021 u64 timeout,
5022 VkSemaphore semaphore,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005023 VkFence fence,
Michael Lentine88594d72015-11-12 12:49:45 -08005024 u32* pImageIndex) {
5025 deviceObject := GetDevice(device)
5026 swapchainObject := GetSwapchain(swapchain)
5027
5028 imageIndex := ?
5029 pImageIndex[0] = imageIndex
5030
5031 return ?
5032}
5033
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005034@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005035cmd VkResult vkQueuePresentKHR(
5036 VkQueue queue,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08005037 const VkPresentInfoKHR* pPresentInfo) {
Michael Lentine88594d72015-11-12 12:49:45 -08005038 queueObject := GetQueue(queue)
5039
5040 presentInfo := ?
5041 pPresentInfo[0] = presentInfo
5042
5043 return ?
5044}
5045
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005046@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005047cmd VkResult vkGetPhysicalDeviceDisplayPropertiesKHR(
5048 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005049 u32* pPropertyCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005050 VkDisplayPropertiesKHR* pProperties) {
5051 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5052 return ?
5053}
5054
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005055@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005056cmd VkResult vkGetPhysicalDeviceDisplayPlanePropertiesKHR(
5057 VkPhysicalDevice physicalDevice,
5058 u32* pPropertyCount,
5059 VkDisplayPlanePropertiesKHR* pProperties) {
5060 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5061 return ?
5062}
5063
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005064@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005065cmd VkResult vkGetDisplayPlaneSupportedDisplaysKHR(
5066 VkPhysicalDevice physicalDevice,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005067 u32 planeIndex,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08005068 u32* pDisplayCount,
5069 VkDisplayKHR* pDisplays) {
Jesse Halla6429252015-11-29 18:59:42 -08005070 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5071 return ?
5072}
5073
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005074@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005075cmd VkResult vkGetDisplayModePropertiesKHR(
5076 VkPhysicalDevice physicalDevice,
5077 VkDisplayKHR display,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005078 u32* pPropertyCount,
5079 VkDisplayModePropertiesKHR* pProperties) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005080 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5081 return ?
5082}
5083
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005084@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005085cmd VkResult vkCreateDisplayModeKHR(
5086 VkPhysicalDevice physicalDevice,
5087 VkDisplayKHR display,
5088 const VkDisplayModeCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005089 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005090 VkDisplayModeKHR* pMode) {
5091 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5092 return ?
5093}
5094
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005095@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005096cmd VkResult vkGetDisplayPlaneCapabilitiesKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005097 VkPhysicalDevice physicalDevice,
Jesse Hall9ba8bc82015-11-30 16:22:16 -08005098 VkDisplayModeKHR mode,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005099 u32 planeIndex,
Jesse Halla6429252015-11-29 18:59:42 -08005100 VkDisplayPlaneCapabilitiesKHR* pCapabilities) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005101 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5102 return ?
5103}
5104
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005105@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005106cmd VkResult vkCreateDisplayPlaneSurfaceKHR(
5107 VkInstance instance,
5108 const VkDisplaySurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005109 const VkAllocationCallbacks* pAllocator,
Jesse Halla6429252015-11-29 18:59:42 -08005110 VkSurfaceKHR* pSurface) {
5111 return ?
5112}
5113
Jesse Hall9ba8bc82015-11-30 16:22:16 -08005114@extension("VK_KHR_display_swapchain")
5115cmd VkResult vkCreateSharedSwapchainsKHR(
5116 VkDevice device,
5117 u32 swapchainCount,
5118 const VkSwapchainCreateInfoKHR* pCreateInfos,
5119 const VkAllocationCallbacks* pAllocator,
5120 VkSwapchainKHR* pSwapchains) {
5121 return ?
5122}
5123
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005124@extension("VK_KHR_xlib_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005125cmd VkResult vkCreateXlibSurfaceKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005126 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005127 const VkXlibSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005128 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005129 VkSurfaceKHR* pSurface) {
5130 instanceObject := GetInstance(instance)
5131 return ?
5132}
5133
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005134@extension("VK_KHR_xlib_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005135cmd VkBool32 vkGetPhysicalDeviceXlibPresentationSupportKHR(
5136 VkPhysicalDevice physicalDevice,
5137 u32 queueFamilyIndex,
5138 platform.Display* dpy,
Jesse Hall65ab5522015-11-30 00:07:16 -08005139 platform.VisualID visualID) {
Jesse Halla6429252015-11-29 18:59:42 -08005140 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5141 return ?
5142}
5143
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005144@extension("VK_KHR_xcb_surface")
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005145cmd VkResult vkCreateXcbSurfaceKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005146 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005147 const VkXcbSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005148 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005149 VkSurfaceKHR* pSurface) {
5150 instanceObject := GetInstance(instance)
5151 return ?
5152}
5153
Jesse Hall523db342015-11-30 21:12:55 -08005154@extension("VK_KHR_xcb_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005155cmd VkBool32 vkGetPhysicalDeviceXcbPresentationSupportKHR(
5156 VkPhysicalDevice physicalDevice,
5157 u32 queueFamilyIndex,
5158 platform.xcb_connection_t* connection,
5159 platform.xcb_visualid_t visual_id) {
5160 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5161 return ?
5162}
5163
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005164@extension("VK_KHR_wayland_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005165cmd VkResult vkCreateWaylandSurfaceKHR(
5166 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005167 const VkWaylandSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005168 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005169 VkSurfaceKHR* pSurface) {
5170 instanceObject := GetInstance(instance)
5171 return ?
5172}
5173
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005174@extension("VK_KHR_wayland_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005175cmd VkBool32 vkGetPhysicalDeviceWaylandPresentationSupportKHR(
5176 VkPhysicalDevice physicalDevice,
5177 u32 queueFamilyIndex,
5178 platform.wl_display* display) {
5179 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5180 return ?
5181}
5182
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005183@extension("VK_KHR_mir_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005184cmd VkResult vkCreateMirSurfaceKHR(
5185 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005186 const VkMirSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005187 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005188 VkSurfaceKHR* pSurface) {
5189 instanceObject := GetInstance(instance)
5190 return ?
5191}
5192
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005193@extension("VK_KHR_mir_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005194cmd VkBool32 vkGetPhysicalDeviceMirPresentationSupportKHR(
5195 VkPhysicalDevice physicalDevice,
5196 u32 queueFamilyIndex,
5197 platform.MirConnection* connection) {
5198 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5199 return ?
5200}
5201
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005202@extension("VK_KHR_android_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005203cmd VkResult vkCreateAndroidSurfaceKHR(
5204 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005205 const VkAndroidSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005206 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005207 VkSurfaceKHR* pSurface) {
5208 instanceObject := GetInstance(instance)
5209 return ?
5210}
5211
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005212@extension("VK_KHR_win32_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005213cmd VkResult vkCreateWin32SurfaceKHR(
5214 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005215 const VkWin32SurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005216 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005217 VkSurfaceKHR* pSurface) {
5218 instanceObject := GetInstance(instance)
5219 return ?
5220}
5221
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005222@extension("VK_KHR_win32_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005223cmd VkResult vkGetPhysicalDeviceWin32PresentationSupportKHR(
5224 VkPhysicalDevice physicalDevice,
5225 u32 queueFamilyIndex) {
Jesse Halle2948d82016-02-25 04:19:32 -08005226 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Jesse Halla6429252015-11-29 18:59:42 -08005227 return ?
5228}
5229
Chia-I Wub262ddc2016-03-22 07:38:20 +08005230@extension("VK_ANDROID_native_buffer")
5231cmd VkResult vkGetSwapchainGrallocUsageANDROID(
5232 VkDevice device,
5233 VkFormat format,
5234 VkImageUsageFlags imageUsage,
5235 int* grallocUsage) {
5236 return ?
5237}
5238
5239@extension("VK_ANDROID_native_buffer")
5240cmd VkResult vkAcquireImageANDROID(
5241 VkDevice device,
5242 VkImage image,
5243 int nativeFenceFd,
5244 VkSemaphore semaphore,
5245 VkFence fence) {
5246 return ?
5247}
5248
5249@extension("VK_ANDROID_native_buffer")
5250cmd VkResult vkQueueSignalReleaseImageANDROID(
5251 VkQueue queue,
5252 u32 waitSemaphoreCount,
5253 const VkSemaphore* pWaitSemaphores,
5254 VkImage image,
5255 int* pNativeFenceFd) {
5256 return ?
5257}
5258
Jesse Hall715b86a2016-01-16 16:34:29 -08005259@extension("VK_EXT_debug_report")
5260@external type void* PFN_vkDebugReportCallbackEXT
5261@extension("VK_EXT_debug_report")
5262@pfn cmd VkBool32 vkDebugReportCallbackEXT(
5263 VkDebugReportFlagsEXT flags,
5264 VkDebugReportObjectTypeEXT objectType,
5265 u64 object,
5266 platform.size_t location,
5267 s32 messageCode,
5268 const char* pLayerPrefix,
5269 const char* pMessage,
5270 void* pUserData) {
5271 return ?
5272}
5273
5274@extension("VK_EXT_debug_report")
5275cmd VkResult vkCreateDebugReportCallbackEXT(
5276 VkInstance instance,
5277 const VkDebugReportCallbackCreateInfoEXT* pCreateInfo,
5278 const VkAllocationCallbacks* pAllocator,
5279 VkDebugReportCallbackEXT* pCallback) {
5280 return ?
5281}
5282
5283@extension("VK_EXT_debug_report")
5284cmd void vkDestroyDebugReportCallbackEXT(
5285 VkInstance instance,
5286 VkDebugReportCallbackEXT callback,
5287 const VkAllocationCallbacks* pAllocator) {
5288}
5289
5290@extension("VK_EXT_debug_report")
5291cmd void vkDebugReportMessageEXT(
5292 VkInstance instance,
5293 VkDebugReportFlagsEXT flags,
5294 VkDebugReportObjectTypeEXT objectType,
5295 u64 object,
5296 platform.size_t location,
5297 s32 messageCode,
5298 const char* pLayerPrefix,
5299 const char* pMessage) {
5300}
5301
Jesse Hall26763382016-05-20 07:13:52 -07005302@extension("VK_EXT_debug_marker")
5303cmd VkResult vkDebugMarkerSetObjectTagEXT(
5304 VkDevice device,
5305 VkDebugMarkerObjectTagInfoEXT* pTagInfo) {
5306 return ?
5307}
5308
5309@extension("VK_EXT_debug_marker")
5310cmd VkResult vkDebugMarkerSetObjectNameEXT(
5311 VkDevice device,
5312 VkDebugMarkerObjectNameInfoEXT* pNameInfo) {
5313 return ?
5314}
5315
5316@extension("VK_EXT_debug_marker")
5317cmd void vkCmdDebugMarkerBeginEXT(
5318 VkCommandBuffer commandBuffer,
5319 VkDebugMarkerMarkerInfoEXT* pMarkerInfo) {
5320}
5321
5322@extension("VK_EXT_debug_marker")
5323cmd void vkCmdDebugMarkerEndEXT(
5324 VkCommandBuffer commandBuffer) {
5325}
5326
5327@extension("VK_EXT_debug_marker")
5328cmd void vkCmdDebugMarkerInsertEXT(
5329 VkCommandBuffer commandBuffer,
5330 VkDebugMarkerMarkerInfoEXT* pMarkerInfo) {
5331}
5332
Jesse Halld27f6aa2015-08-15 17:58:48 -07005333
5334////////////////
5335// Validation //
5336////////////////
5337
5338extern void validate(string layerName, bool condition, string message)
5339
5340
5341/////////////////////////////
5342// Internal State Tracking //
5343/////////////////////////////
5344
5345StateObject State
5346
5347@internal class StateObject {
5348 // Dispatchable objects.
5349 map!(VkInstance, ref!InstanceObject) Instances
5350 map!(VkPhysicalDevice, ref!PhysicalDeviceObject) PhysicalDevices
5351 map!(VkDevice, ref!DeviceObject) Devices
5352 map!(VkQueue, ref!QueueObject) Queues
Jesse Hall3fbc8562015-11-29 22:10:52 -08005353 map!(VkCommandBuffer, ref!CommandBufferObject) CommandBuffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07005354
5355 // Non-dispatchable objects.
5356 map!(VkDeviceMemory, ref!DeviceMemoryObject) DeviceMemories
5357 map!(VkBuffer, ref!BufferObject) Buffers
5358 map!(VkBufferView, ref!BufferViewObject) BufferViews
5359 map!(VkImage, ref!ImageObject) Images
5360 map!(VkImageView, ref!ImageViewObject) ImageViews
Jesse Halld27f6aa2015-08-15 17:58:48 -07005361 map!(VkShaderModule, ref!ShaderModuleObject) ShaderModules
Jesse Halld27f6aa2015-08-15 17:58:48 -07005362 map!(VkPipeline, ref!PipelineObject) Pipelines
5363 map!(VkPipelineLayout, ref!PipelineLayoutObject) PipelineLayouts
5364 map!(VkSampler, ref!SamplerObject) Samplers
5365 map!(VkDescriptorSet, ref!DescriptorSetObject) DescriptorSets
5366 map!(VkDescriptorSetLayout, ref!DescriptorSetLayoutObject) DescriptorSetLayouts
5367 map!(VkDescriptorPool, ref!DescriptorPoolObject) DescriptorPools
Jesse Halld27f6aa2015-08-15 17:58:48 -07005368 map!(VkFence, ref!FenceObject) Fences
5369 map!(VkSemaphore, ref!SemaphoreObject) Semaphores
5370 map!(VkEvent, ref!EventObject) Events
5371 map!(VkQueryPool, ref!QueryPoolObject) QueryPools
5372 map!(VkFramebuffer, ref!FramebufferObject) Framebuffers
5373 map!(VkRenderPass, ref!RenderPassObject) RenderPasses
5374 map!(VkPipelineCache, ref!PipelineCacheObject) PipelineCaches
Jesse Hall3fbc8562015-11-29 22:10:52 -08005375 map!(VkCommandPool, ref!CommandPoolObject) CommandPools
Jesse Hall1356b0d2015-11-23 17:24:58 -08005376 map!(VkSurfaceKHR, ref!SurfaceObject) Surfaces
Michael Lentine88594d72015-11-12 12:49:45 -08005377 map!(VkSwapchainKHR, ref!SwapchainObject) Swapchains
Jesse Halld27f6aa2015-08-15 17:58:48 -07005378}
5379
5380@internal class InstanceObject {
5381}
5382
5383@internal class PhysicalDeviceObject {
5384 VkInstance instance
5385}
5386
5387@internal class DeviceObject {
5388 VkPhysicalDevice physicalDevice
5389}
5390
5391@internal class QueueObject {
5392 VkDevice device
5393 VkQueueFlags flags
5394}
5395
Jesse Hall3fbc8562015-11-29 22:10:52 -08005396@internal class CommandBufferObject {
Jesse Halld27f6aa2015-08-15 17:58:48 -07005397 VkDevice device
5398 map!(u64, VkDeviceMemory) boundObjects
5399 VkQueueFlags queueFlags
5400}
5401
5402@internal class DeviceMemoryObject {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005403 VkDevice device
5404 VkDeviceSize allocationSize
5405 map!(u64, VkDeviceSize) boundObjects
5406 map!(VkCommandBuffer, VkCommandBuffer) boundCommandBuffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07005407}
5408
5409@internal class BufferObject {
5410 VkDevice device
Jesse Hall3fbc8562015-11-29 22:10:52 -08005411 VkDeviceMemory memory
5412 VkDeviceSize memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07005413}
5414
5415@internal class BufferViewObject {
5416 VkDevice device
5417 VkBuffer buffer
5418}
5419
5420@internal class ImageObject {
5421 VkDevice device
Jesse Hall3fbc8562015-11-29 22:10:52 -08005422 VkDeviceMemory memory
5423 VkDeviceSize memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07005424}
5425
5426@internal class ImageViewObject {
5427 VkDevice device
5428 VkImage image
5429}
5430
Jesse Halld27f6aa2015-08-15 17:58:48 -07005431@internal class ShaderObject {
5432 VkDevice device
5433}
5434
5435@internal class ShaderModuleObject {
5436 VkDevice device
5437}
5438
5439@internal class PipelineObject {
5440 VkDevice device
5441}
5442
5443@internal class PipelineLayoutObject {
5444 VkDevice device
5445}
5446
5447@internal class SamplerObject {
5448 VkDevice device
5449}
5450
5451@internal class DescriptorSetObject {
5452 VkDevice device
5453}
5454
5455@internal class DescriptorSetLayoutObject {
5456 VkDevice device
5457}
5458
5459@internal class DescriptorPoolObject {
5460 VkDevice device
5461}
5462
Jesse Halld27f6aa2015-08-15 17:58:48 -07005463@internal class FenceObject {
5464 VkDevice device
5465 bool signaled
5466}
5467
5468@internal class SemaphoreObject {
5469 VkDevice device
5470}
5471
5472@internal class EventObject {
5473 VkDevice device
5474}
5475
5476@internal class QueryPoolObject {
5477 VkDevice device
5478}
5479
5480@internal class FramebufferObject {
5481 VkDevice device
5482}
5483
5484@internal class RenderPassObject {
5485 VkDevice device
5486}
5487
5488@internal class PipelineCacheObject {
5489 VkDevice device
5490}
5491
Jesse Hall3fbc8562015-11-29 22:10:52 -08005492@internal class CommandPoolObject {
Jesse Halld27f6aa2015-08-15 17:58:48 -07005493 VkDevice device
5494}
5495
Jesse Hall1356b0d2015-11-23 17:24:58 -08005496@internal class SurfaceObject {
5497 VkInstance instance
5498}
5499
Michael Lentine88594d72015-11-12 12:49:45 -08005500@internal class SwapchainObject {
5501 VkDevice device
5502}
5503
Jesse Halld27f6aa2015-08-15 17:58:48 -07005504macro ref!InstanceObject GetInstance(VkInstance instance) {
5505 assert(instance in State.Instances)
5506 return State.Instances[instance]
5507}
5508
5509macro ref!PhysicalDeviceObject GetPhysicalDevice(VkPhysicalDevice physicalDevice) {
5510 assert(physicalDevice in State.PhysicalDevices)
5511 return State.PhysicalDevices[physicalDevice]
5512}
5513
5514macro ref!DeviceObject GetDevice(VkDevice device) {
5515 assert(device in State.Devices)
5516 return State.Devices[device]
5517}
5518
5519macro ref!QueueObject GetQueue(VkQueue queue) {
5520 assert(queue in State.Queues)
5521 return State.Queues[queue]
5522}
5523
Jesse Hall3fbc8562015-11-29 22:10:52 -08005524macro ref!CommandBufferObject GetCommandBuffer(VkCommandBuffer commandBuffer) {
5525 assert(commandBuffer in State.CommandBuffers)
5526 return State.CommandBuffers[commandBuffer]
Jesse Halld27f6aa2015-08-15 17:58:48 -07005527}
5528
Jesse Hall3fbc8562015-11-29 22:10:52 -08005529macro ref!DeviceMemoryObject GetDeviceMemory(VkDeviceMemory memory) {
5530 assert(memory in State.DeviceMemories)
5531 return State.DeviceMemories[memory]
Jesse Halld27f6aa2015-08-15 17:58:48 -07005532}
5533
5534macro ref!BufferObject GetBuffer(VkBuffer buffer) {
5535 assert(buffer in State.Buffers)
5536 return State.Buffers[buffer]
5537}
5538
5539macro ref!BufferViewObject GetBufferView(VkBufferView bufferView) {
5540 assert(bufferView in State.BufferViews)
5541 return State.BufferViews[bufferView]
5542}
5543
5544macro ref!ImageObject GetImage(VkImage image) {
5545 assert(image in State.Images)
5546 return State.Images[image]
5547}
5548
5549macro ref!ImageViewObject GetImageView(VkImageView imageView) {
5550 assert(imageView in State.ImageViews)
5551 return State.ImageViews[imageView]
5552}
5553
Jesse Halld27f6aa2015-08-15 17:58:48 -07005554macro ref!ShaderModuleObject GetShaderModule(VkShaderModule shaderModule) {
5555 assert(shaderModule in State.ShaderModules)
5556 return State.ShaderModules[shaderModule]
5557}
5558
5559macro ref!PipelineObject GetPipeline(VkPipeline pipeline) {
5560 assert(pipeline in State.Pipelines)
5561 return State.Pipelines[pipeline]
5562}
5563
5564macro ref!PipelineLayoutObject GetPipelineLayout(VkPipelineLayout pipelineLayout) {
5565 assert(pipelineLayout in State.PipelineLayouts)
5566 return State.PipelineLayouts[pipelineLayout]
5567}
5568
5569macro ref!SamplerObject GetSampler(VkSampler sampler) {
5570 assert(sampler in State.Samplers)
5571 return State.Samplers[sampler]
5572}
5573
5574macro ref!DescriptorSetObject GetDescriptorSet(VkDescriptorSet descriptorSet) {
5575 assert(descriptorSet in State.DescriptorSets)
5576 return State.DescriptorSets[descriptorSet]
5577}
5578
5579macro ref!DescriptorSetLayoutObject GetDescriptorSetLayout(VkDescriptorSetLayout descriptorSetLayout) {
5580 assert(descriptorSetLayout in State.DescriptorSetLayouts)
5581 return State.DescriptorSetLayouts[descriptorSetLayout]
5582}
5583
5584macro ref!DescriptorPoolObject GetDescriptorPool(VkDescriptorPool descriptorPool) {
5585 assert(descriptorPool in State.DescriptorPools)
5586 return State.DescriptorPools[descriptorPool]
5587}
5588
Jesse Halld27f6aa2015-08-15 17:58:48 -07005589macro ref!FenceObject GetFence(VkFence fence) {
5590 assert(fence in State.Fences)
5591 return State.Fences[fence]
5592}
5593
5594macro ref!SemaphoreObject GetSemaphore(VkSemaphore semaphore) {
5595 assert(semaphore in State.Semaphores)
5596 return State.Semaphores[semaphore]
5597}
5598
5599macro ref!EventObject GetEvent(VkEvent event) {
5600 assert(event in State.Events)
5601 return State.Events[event]
5602}
5603
5604macro ref!QueryPoolObject GetQueryPool(VkQueryPool queryPool) {
5605 assert(queryPool in State.QueryPools)
5606 return State.QueryPools[queryPool]
5607}
5608
5609macro ref!FramebufferObject GetFramebuffer(VkFramebuffer framebuffer) {
5610 assert(framebuffer in State.Framebuffers)
5611 return State.Framebuffers[framebuffer]
5612}
5613
5614macro ref!RenderPassObject GetRenderPass(VkRenderPass renderPass) {
5615 assert(renderPass in State.RenderPasses)
5616 return State.RenderPasses[renderPass]
5617}
5618
5619macro ref!PipelineCacheObject GetPipelineCache(VkPipelineCache pipelineCache) {
5620 assert(pipelineCache in State.PipelineCaches)
5621 return State.PipelineCaches[pipelineCache]
5622}
5623
Jesse Hall3fbc8562015-11-29 22:10:52 -08005624macro ref!CommandPoolObject GetCommandPool(VkCommandPool commandPool) {
5625 assert(commandPool in State.CommandPools)
5626 return State.CommandPools[commandPool]
Jesse Hallf09c6b12015-08-15 19:54:28 -07005627}
Michael Lentine88594d72015-11-12 12:49:45 -08005628
Jesse Hall1356b0d2015-11-23 17:24:58 -08005629macro ref!SurfaceObject GetSurface(VkSurfaceKHR surface) {
5630 assert(surface in State.Surfaces)
5631 return State.Surfaces[surface]
5632}
5633
Michael Lentine88594d72015-11-12 12:49:45 -08005634macro ref!SwapchainObject GetSwapchain(VkSwapchainKHR swapchain) {
5635 assert(swapchain in State.Swapchains)
5636 return State.Swapchains[swapchain]
5637}
Jesse Halld8bade02015-11-24 10:24:18 -08005638
5639macro VkQueueFlags AddQueueFlag(VkQueueFlags flags, VkQueueFlagBits bit) {
5640 return as!VkQueueFlags(as!u32(flags) | as!u32(bit))
5641}