blob: c8752c46de82df30b715cc00ee0fa817ac10715e [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 Hall08e2f482017-03-06 15:22:17 -080031define VERSION_PATCH 39
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 Halleb02c472017-02-24 15:13:45 -080048// 1
Jesse Hall33faaad2016-01-24 21:00:49 -080049@extension("VK_KHR_surface") define VK_KHR_SURFACE_SPEC_VERSION 25
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080050@extension("VK_KHR_surface") define VK_KHR_SURFACE_EXTENSION_NAME "VK_KHR_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080051
Jesse Halleb02c472017-02-24 15:13:45 -080052// 2
Jesse Hall26763382016-05-20 07:13:52 -070053@extension("VK_KHR_swapchain") define VK_KHR_SWAPCHAIN_SPEC_VERSION 68
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080054@extension("VK_KHR_swapchain") define VK_KHR_SWAPCHAIN_EXTENSION_NAME "VK_KHR_swapchain"
Jesse Hall1356b0d2015-11-23 17:24:58 -080055
Jesse Halleb02c472017-02-24 15:13:45 -080056// 3
Jesse Hall543a7ff2016-01-08 16:38:30 -080057@extension("VK_KHR_display") define VK_KHR_DISPLAY_SPEC_VERSION 21
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080058@extension("VK_KHR_display") define VK_KHR_DISPLAY_EXTENSION_NAME "VK_KHR_display"
Jesse Hall1356b0d2015-11-23 17:24:58 -080059
Jesse Halleb02c472017-02-24 15:13:45 -080060// 4
Jesse Hall543a7ff2016-01-08 16:38:30 -080061@extension("VK_KHR_display_swapchain") define VK_KHR_DISPLAY_SWAPCHAIN_SPEC_VERSION 9
Jesse Hall0e74f002015-11-30 11:37:59 -080062@extension("VK_KHR_display_swapchain") define VK_KHR_DISPLAY_SWAPCHAIN_EXTENSION_NAME "VK_KHR_display_swapchain"
Jesse Hall1356b0d2015-11-23 17:24:58 -080063
Jesse Halleb02c472017-02-24 15:13:45 -080064// 5
Jesse Hall543a7ff2016-01-08 16:38:30 -080065@extension("VK_KHR_xlib_surface") define VK_KHR_XLIB_SURFACE_SPEC_VERSION 6
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080066@extension("VK_KHR_xlib_surface") define VK_KHR_XLIB_SURFACE_NAME "VK_KHR_xlib_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080067
Jesse Halleb02c472017-02-24 15:13:45 -080068// 6
Jesse Hall543a7ff2016-01-08 16:38:30 -080069@extension("VK_KHR_xcb_surface") define VK_KHR_XCB_SURFACE_SPEC_VERSION 6
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080070@extension("VK_KHR_xcb_surface") define VK_KHR_XCB_SURFACE_NAME "VK_KHR_xcb_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080071
Jesse Halleb02c472017-02-24 15:13:45 -080072// 7
Jesse Hall543a7ff2016-01-08 16:38:30 -080073@extension("VK_KHR_wayland_surface") define VK_KHR_WAYLAND_SURFACE_SPEC_VERSION 5
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080074@extension("VK_KHR_wayland_surface") define VK_KHR_WAYLAND_SURFACE_NAME "VK_KHR_wayland_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080075
Jesse Halleb02c472017-02-24 15:13:45 -080076// 8
Jesse Hall543a7ff2016-01-08 16:38:30 -080077@extension("VK_KHR_mir_surface") define VK_KHR_MIR_SURFACE_SPEC_VERSION 4
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080078@extension("VK_KHR_mir_surface") define VK_KHR_MIR_SURFACE_NAME "VK_KHR_mir_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080079
Jesse Halleb02c472017-02-24 15:13:45 -080080// 9
Jesse Hall33faaad2016-01-24 21:00:49 -080081@extension("VK_KHR_android_surface") define VK_KHR_ANDROID_SURFACE_SPEC_VERSION 6
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080082@extension("VK_KHR_android_surface") define VK_KHR_ANDROID_SURFACE_NAME "VK_KHR_android_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080083
Jesse Halleb02c472017-02-24 15:13:45 -080084// 10
Jesse Hall543a7ff2016-01-08 16:38:30 -080085@extension("VK_KHR_win32_surface") define VK_KHR_WIN32_SURFACE_SPEC_VERSION 5
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080086@extension("VK_KHR_win32_surface") define VK_KHR_WIN32_SURFACE_NAME "VK_KHR_win32_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080087
Jesse Halleb02c472017-02-24 15:13:45 -080088// 11
Chia-I Wub262ddc2016-03-22 07:38:20 +080089@extension("VK_ANDROID_native_buffer") define VK_ANDROID_NATIVE_BUFFER_SPEC_VERSION 5
90@extension("VK_ANDROID_native_buffer") define VK_ANDROID_NATIVE_BUFFER_NAME "VK_ANDROID_native_buffer"
91
Jesse Halleb02c472017-02-24 15:13:45 -080092// 12
93@extension("VK_EXT_debug_report") define VK_EXT_DEBUG_REPORT_SPEC_VERSION 4
Jesse Hall715b86a2016-01-16 16:34:29 -080094@extension("VK_EXT_debug_report") define VK_EXT_DEBUG_REPORT_NAME "VK_EXT_debug_report"
95
Jesse Halleb02c472017-02-24 15:13:45 -080096// 13
Jesse Hall26763382016-05-20 07:13:52 -070097@extension("VK_NV_glsl_shader") define VK_NV_GLSL_SHADER_SPEC_VERSION 1
98@extension("VK_NV_glsl_shader") define VK_NV_GLSL_SHADER_NAME "VK_NV_glsl_shader"
99
Jesse Halleb02c472017-02-24 15:13:45 -0800100// 15
Jesse Hall26763382016-05-20 07:13:52 -0700101@extension("VK_KHR_sampler_mirror_clamp_to_edge") define VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_SPEC_VERSION 1
102@extension("VK_KHR_sampler_mirror_clamp_to_edge") define VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_NAME "VK_KHR_sampler_mirror_clamp_to_edge"
103
Jesse Halleb02c472017-02-24 15:13:45 -0800104// 16
Jesse Hall26763382016-05-20 07:13:52 -0700105@extension("VK_IMG_filter_cubic") define VK_IMG_FILTER_CUBIC_SPEC_VERSION 1
106@extension("VK_IMG_filter_cubic") define VK_IMG_FILTER_CUBIC_NAME "VK_IMG_filter_cubic"
107
Jesse Halleb02c472017-02-24 15:13:45 -0800108// 19
Jesse Hall26763382016-05-20 07:13:52 -0700109@extension("VK_AMD_rasterization_order") define VK_AMD_RASTERIZATION_ORDER_SPEC_VERSION 1
110@extension("VK_AMD_rasterization_order") define VK_AMD_RASTERIZATION_ORDER_NAME "VK_AMD_rasterization_order"
111
Jesse Halleb02c472017-02-24 15:13:45 -0800112// 21
Jesse Hall3f5499b2016-07-26 15:20:40 -0700113@extension("VK_AMD_shader_trinary_minmax") define VK_AMD_SHADER_TRINARY_MINMAX_SPEC_VERSION 1
114@extension("VK_AMD_shader_trinary_minmax") define VK_AMD_SHADER_TRINARY_MINMAX_EXTENSION_NAME "VK_AMD_shader_trinary_minmax"
115
Jesse Halleb02c472017-02-24 15:13:45 -0800116// 22
Jesse Hall3f5499b2016-07-26 15:20:40 -0700117@extension("VK_AMD_shader_explicit_vertex_parameter") define VK_AMD_SHADER_EXPLICIT_VERTEX_PARAMETER_SPEC_VERSION 1
118@extension("VK_AMD_shader_explicit_vertex_parameter") define VK_AMD_SHADER_EXPLICIT_VERTEX_PARAMETER_EXTENSION_NAME "VK_AMD_shader_explicit_vertex_parameter"
119
Jesse Halleb02c472017-02-24 15:13:45 -0800120// 23
Jesse Hall26763382016-05-20 07:13:52 -0700121@extension("VK_EXT_debug_marker") define VK_EXT_DEBUG_MARKER_SPEC_VERSION 3
122@extension("VK_EXT_debug_marker") define VK_EXT_DEBUG_MARKER_NAME "VK_EXT_debug_marker"
123
Jesse Halleb02c472017-02-24 15:13:45 -0800124// 26
Jesse Hall3f5499b2016-07-26 15:20:40 -0700125@extension("VK_AMD_gcn_shader") define VK_AMD_GCN_SHADER_SPEC_VERSION 1
126@extension("VK_AMD_gcn_shader") define VK_AMD_GCN_SHADER_EXTENSION_NAME "VK_AMD_gcn_shader"
127
Jesse Halleb02c472017-02-24 15:13:45 -0800128// 27
Jesse Hall3f5499b2016-07-26 15:20:40 -0700129@extension("VK_NV_dedicated_allocation") define VK_NV_DEDICATED_ALLOCATION_SPEC_VERSION 1
130@extension("VK_NV_dedicated_allocation") define VK_NV_DEDICATED_ALLOCATION_EXTENSION_NAME "VK_NV_dedicated_allocation"
131
Jesse Halleb02c472017-02-24 15:13:45 -0800132// 28
133@extension("VK_IMG_format_pvrtc") define VK_IMG_FORMAT_PVRTC_SPEC_VERSION 1
134@extension("VK_IMG_format_pvrtc") define VK_IMG_FORMAT_PVRTC_EXTENSION_NAME "VK_IMG_format_pvrtc"
135
136// 34
137@extension("VK_AMD_draw_indirect_count") define VK_AMD_DRAW_INDIRECT_COUNT_SPEC_VERSION 1
138@extension("VK_AMD_draw_indirect_count") define VK_AMD_DRAW_INDIRECT_COUNT_EXTENSION_NAME "VK_AMD_draw_indirect_count"
139
140// 36
141@extension("VK_AMD_negative_viewport_height") define VK_AMD_NEGATIVE_VIEWPORT_HEIGHT_SPEC_VERSION 1
142@extension("VK_AMD_negative_viewport_height") define VK_AMD_NEGATIVE_VIEWPORT_HEIGHT_EXTENSION_NAME "VK_AMD_negative_viewport_height"
143
144// 37
145@extension("VK_AMD_gpu_shader_half_float") define VK_AMD_GPU_SHADER_HALF_FLOAT_SPEC_VERSION 1
146@extension("VK_AMD_gpu_shader_half_float") define VK_AMD_GPU_SHADER_HALF_FLOAT_EXTENSION_NAME "VK_AMD_gpu_shader_half_float"
147
148// 38
149@extension("VK_AMD_shader_ballot") define VK_AMD_SHADER_BALLOT_SPEC_VERSION 1
150@extension("VK_AMD_shader_ballot") define VK_AMD_SHADER_BALLOT_EXTENSION_NAME "VK_AMD_shader_ballot"
151
152// 56
153@extension("VK_NV_external_memory_capabilities") define VK_NV_EXTERNAL_MEMORY_CAPABILITIES_SPEC_VERSION 1
154@extension("VK_NV_external_memory_capabilities") define VK_NV_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME "VK_NV_external_memory_capabilities"
155
156// 57
157@extension("VK_NV_external_memory") define VK_NV_EXTERNAL_MEMORY_SPEC_VERSION 1
158@extension("VK_NV_external_memory") define VK_NV_EXTERNAL_MEMORY_EXTENSION_NAME "VK_NV_external_memory"
159
160// 58
161@extension("VK_NV_external_memory_win32") define VK_NV_EXTERNAL_MEMORY_WIN32_SPEC_VERSION 1
162@extension("VK_NV_external_memory_win32") define VK_NV_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME "VK_NV_external_memory_win32"
163
164// 59
165@extension("VK_NV_win32_keyed_mutex") define VK_NV_WIN32_KEYED_MUTEX_SPEC_VERSION 1
166@extension("VK_NV_win32_keyed_mutex") define VK_NV_WIN32_KEYED_MUTEX_EXTENSION_NAME "VK_NV_win32_keyed_mutex"
167
Jesse Hall08e2f482017-03-06 15:22:17 -0800168// 60
169@extension("VK_KHR_get_physical_device_properties2") define VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_SPEC_VERSION 1
170@extension("VK_KHR_get_physical_device_properties2") define VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME "VK_KHR_get_physical_device_properties2"
171
Jesse Halleb02c472017-02-24 15:13:45 -0800172// 62
173@extension("VK_EXT_validation_flags") define VK_EXT_VALIDATION_FLAGS_SPEC_VERSION 1
174@extension("VK_EXT_validation_flags") define VK_EXT_VALIDATION_FLAGS_EXTENSION_NAME "VK_EXT_validation_flags"
175
Jesse Hall08e2f482017-03-06 15:22:17 -0800176// 63
177@extension("VK_NN_vi_surface") define VK_NN_VI_SURFACE_SPEC_VERSION 1
178@extension("VK_NN_vi_surface") define VK_NN_VI_SURFACE_EXTENSION_NAME "VK_NN_vi_surface"
179
180// 64
181@extension("VK_KHR_shader_draw_parameters") define VK_KHR_SHADER_DRAW_PARAMETERS_SPEC_VERSION 1
182@extension("VK_KHR_shader_draw_parameters") define VK_KHR_SHADER_DRAW_PARAMETERS_EXTENSION_NAME "VK_KHR_shader_draw_parameters"
183
184// 65
185@extension("VK_EXT_shader_subgroup_ballot") define VK_EXT_SHADER_SUBGROUP_BALLOT_SPEC_VERSION 1
186@extension("VK_EXT_shader_subgroup_ballot") define VK_EXT_SHADER_SUBGROUP_BALLOT_EXTENSION_NAME "VK_EXT_shader_subgroup_ballot"
187
188// 66
189@extension("VK_EXT_shader_subgroup_vote") define VK_EXT_SHADER_SUBGROUP_VOTE_SPEC_VERSION 1
190@extension("VK_EXT_shader_subgroup_vote") define VK_EXT_SHADER_SUBGROUP_VOTE_EXTENSION_NAME "VK_EXT_shader_subgroup_vote"
191
192// 70
193@extension("VK_KHR_maintenance1") define VK_KHR_MAINTENANCE1_SPEC_VERSION 1
194@extension("VK_KHR_maintenance1") define VK_KHR_MAINTENANCE1_EXTENSION_NAME "VK_KHR_maintenance1"
195
Jesse Halleb02c472017-02-24 15:13:45 -0800196// 87
197@extension("VK_NVX_device_generated_commands") define VK_NVX_DEVICE_GENERATED_COMMANDS_SPEC_VERSION 1
198@extension("VK_NVX_device_generated_commands") define VK_NVX_DEVICE_GENERATED_COMMANDS_EXTENSION_NAME "VK_NVX_device_generated_commands"
199
Jesse Hall08e2f482017-03-06 15:22:17 -0800200// 89
201@extension("VK_EXT_direct_mode_display") define VK_EXT_DIRECT_MODE_DISPLAY_SPEC_VERSION 1
202@extension("VK_EXT_direct_mode_display") define VK_EXT_DIRECT_MODE_DISPLAY_EXTENSION_NAME "VK_EXT_direct_mode_display"
203
204// 90
205@extension("VK_EXT_acquire_xlib_display") define VK_EXT_ACQUIRE_XLIB_DISPLAY_SPEC_VERSION 1
206@extension("VK_EXT_acquire_xlib_display") define VK_EXT_ACQUIRE_XLIB_DISPLAY_EXTENSION_NAME "VK_EXT_acquire_xlib_display"
207
208// 91
209@extension("VK_EXT_display_surface_counter") define VK_EXT_DISPLAY_SURFACE_COUNTER_SPEC_VERSION 1
210@extension("VK_EXT_display_surface_counter") define VK_EXT_DISPLAY_SURFACE_COUNTER_EXTENSION_NAME "VK_EXT_display_surface_counter"
211
212// 92
213@extension("VK_EXT_display_control") define VK_EXT_DISPLAY_CONTROL_SPEC_VERSION 1
214@extension("VK_EXT_display_control") define VK_EXT_DISPLAY_CONTROL_COUNTER_EXTENSION_NAME "VK_EXT_display_control"
215
216// 105
217@extension("VK_EXT_swapchain_colorspace") define VK_EXT_SWAPCHAIN_COLORSPACE_SPEC_VERSION 1
218@extension("VK_EXT_swapchain_colorspace") define VK_EXT_SWAPCHAIN_COLORSPACE_COUNTER_EXTENSION_NAME "VK_EXT_swapchain_colorspace"
Jesse Halld27f6aa2015-08-15 17:58:48 -0700219
220/////////////
221// Types //
222/////////////
223
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700224type u32 VkBool32
225type u32 VkFlags
226type u64 VkDeviceSize
227type u32 VkSampleMask
228
Jesse Halld27f6aa2015-08-15 17:58:48 -0700229/// Dispatchable handle types.
230@dispatchHandle type u64 VkInstance
231@dispatchHandle type u64 VkPhysicalDevice
232@dispatchHandle type u64 VkDevice
233@dispatchHandle type u64 VkQueue
Jesse Hall3fbc8562015-11-29 22:10:52 -0800234@dispatchHandle type u64 VkCommandBuffer
Jesse Halld27f6aa2015-08-15 17:58:48 -0700235
236/// Non dispatchable handle types.
237@nonDispatchHandle type u64 VkDeviceMemory
Jesse Hall3fbc8562015-11-29 22:10:52 -0800238@nonDispatchHandle type u64 VkCommandPool
Jesse Halld27f6aa2015-08-15 17:58:48 -0700239@nonDispatchHandle type u64 VkBuffer
240@nonDispatchHandle type u64 VkBufferView
241@nonDispatchHandle type u64 VkImage
242@nonDispatchHandle type u64 VkImageView
Jesse Halld27f6aa2015-08-15 17:58:48 -0700243@nonDispatchHandle type u64 VkShaderModule
Jesse Halld27f6aa2015-08-15 17:58:48 -0700244@nonDispatchHandle type u64 VkPipeline
245@nonDispatchHandle type u64 VkPipelineLayout
246@nonDispatchHandle type u64 VkSampler
247@nonDispatchHandle type u64 VkDescriptorSet
248@nonDispatchHandle type u64 VkDescriptorSetLayout
249@nonDispatchHandle type u64 VkDescriptorPool
Jesse Halld27f6aa2015-08-15 17:58:48 -0700250@nonDispatchHandle type u64 VkFence
251@nonDispatchHandle type u64 VkSemaphore
252@nonDispatchHandle type u64 VkEvent
253@nonDispatchHandle type u64 VkQueryPool
254@nonDispatchHandle type u64 VkFramebuffer
255@nonDispatchHandle type u64 VkRenderPass
256@nonDispatchHandle type u64 VkPipelineCache
Jesse Hall1356b0d2015-11-23 17:24:58 -0800257
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800258@extension("VK_KHR_surface") @nonDispatchHandle type u64 VkSurfaceKHR
Jesse Hall1356b0d2015-11-23 17:24:58 -0800259
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800260@extension("VK_KHR_swapchain") @nonDispatchHandle type u64 VkSwapchainKHR
Jesse Hall1356b0d2015-11-23 17:24:58 -0800261
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800262@extension("VK_KHR_display") @nonDispatchHandle type u64 VkDisplayKHR
263@extension("VK_KHR_display") @nonDispatchHandle type u64 VkDisplayModeKHR
Jesse Halld27f6aa2015-08-15 17:58:48 -0700264
Jesse Hall715b86a2016-01-16 16:34:29 -0800265@extension("VK_EXT_debug_report") @nonDispatchHandle type u64 VkDebugReportCallbackEXT
266
Jesse Halleb02c472017-02-24 15:13:45 -0800267@extension("VK_NVX_device_generated_commands") @nonDispatchHandle type u64 VkObjectTableNVX
268@extension("VK_NVX_device_generated_commands") @nonDispatchHandle type u64 VkIndirectCommandsLayoutNVX
269
Jesse Halld27f6aa2015-08-15 17:58:48 -0700270
271/////////////
272// Enums //
273/////////////
274
275enum VkImageLayout {
276 VK_IMAGE_LAYOUT_UNDEFINED = 0x00000000, /// Implicit layout an image is when its contents are undefined due to various reasons (e.g. right after creation)
277 VK_IMAGE_LAYOUT_GENERAL = 0x00000001, /// General layout when image can be used for any kind of access
278 VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL = 0x00000002, /// Optimal layout when image is only used for color attachment read/write
279 VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL = 0x00000003, /// Optimal layout when image is only used for depth/stencil attachment read/write
280 VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL = 0x00000004, /// Optimal layout when image is used for read only depth/stencil attachment and shader access
281 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 -0800282 VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL = 0x00000006, /// Optimal layout when image is used only as source of transfer operations
283 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 -0700284 VK_IMAGE_LAYOUT_PREINITIALIZED = 0x00000008, /// Initial layout used when the data is populated by the CPU
Jesse Hall1356b0d2015-11-23 17:24:58 -0800285
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800286 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800287 VK_IMAGE_LAYOUT_PRESENT_SRC_KHR = 1000001002,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700288}
289
290enum VkAttachmentLoadOp {
291 VK_ATTACHMENT_LOAD_OP_LOAD = 0x00000000,
292 VK_ATTACHMENT_LOAD_OP_CLEAR = 0x00000001,
293 VK_ATTACHMENT_LOAD_OP_DONT_CARE = 0x00000002,
294}
295
296enum VkAttachmentStoreOp {
297 VK_ATTACHMENT_STORE_OP_STORE = 0x00000000,
298 VK_ATTACHMENT_STORE_OP_DONT_CARE = 0x00000001,
299}
300
301enum VkImageType {
302 VK_IMAGE_TYPE_1D = 0x00000000,
303 VK_IMAGE_TYPE_2D = 0x00000001,
304 VK_IMAGE_TYPE_3D = 0x00000002,
305}
306
307enum VkImageTiling {
Jesse Hallc7467b72015-11-29 21:05:26 -0800308 VK_IMAGE_TILING_OPTIMAL = 0x00000000,
309 VK_IMAGE_TILING_LINEAR = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700310}
311
312enum VkImageViewType {
313 VK_IMAGE_VIEW_TYPE_1D = 0x00000000,
314 VK_IMAGE_VIEW_TYPE_2D = 0x00000001,
315 VK_IMAGE_VIEW_TYPE_3D = 0x00000002,
316 VK_IMAGE_VIEW_TYPE_CUBE = 0x00000003,
317 VK_IMAGE_VIEW_TYPE_1D_ARRAY = 0x00000004,
318 VK_IMAGE_VIEW_TYPE_2D_ARRAY = 0x00000005,
319 VK_IMAGE_VIEW_TYPE_CUBE_ARRAY = 0x00000006,
320}
321
Jesse Hall3fbc8562015-11-29 22:10:52 -0800322enum VkCommandBufferLevel {
323 VK_COMMAND_BUFFER_LEVEL_PRIMARY = 0x00000000,
324 VK_COMMAND_BUFFER_LEVEL_SECONDARY = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700325}
326
Jesse Hall65ab5522015-11-30 00:07:16 -0800327enum VkComponentSwizzle {
328 VK_COMPONENT_SWIZZLE_IDENTITY = 0x00000000,
329 VK_COMPONENT_SWIZZLE_ZERO = 0x00000001,
330 VK_COMPONENT_SWIZZLE_ONE = 0x00000002,
331 VK_COMPONENT_SWIZZLE_R = 0x00000003,
332 VK_COMPONENT_SWIZZLE_G = 0x00000004,
333 VK_COMPONENT_SWIZZLE_B = 0x00000005,
334 VK_COMPONENT_SWIZZLE_A = 0x00000006,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700335}
336
337enum VkDescriptorType {
338 VK_DESCRIPTOR_TYPE_SAMPLER = 0x00000000,
339 VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER = 0x00000001,
340 VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE = 0x00000002,
341 VK_DESCRIPTOR_TYPE_STORAGE_IMAGE = 0x00000003,
342 VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER = 0x00000004,
343 VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER = 0x00000005,
344 VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER = 0x00000006,
345 VK_DESCRIPTOR_TYPE_STORAGE_BUFFER = 0x00000007,
346 VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC = 0x00000008,
347 VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC = 0x00000009,
348 VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT = 0x0000000a,
349}
350
Jesse Halld27f6aa2015-08-15 17:58:48 -0700351enum VkQueryType {
352 VK_QUERY_TYPE_OCCLUSION = 0x00000000,
353 VK_QUERY_TYPE_PIPELINE_STATISTICS = 0x00000001, /// Optional
Jesse Halla3a7a1d2015-11-24 11:37:23 -0800354 VK_QUERY_TYPE_TIMESTAMP = 0x00000002,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700355}
356
Jesse Halld27f6aa2015-08-15 17:58:48 -0700357enum VkBorderColor {
358 VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK = 0x00000000,
359 VK_BORDER_COLOR_INT_TRANSPARENT_BLACK = 0x00000001,
360 VK_BORDER_COLOR_FLOAT_OPAQUE_BLACK = 0x00000002,
361 VK_BORDER_COLOR_INT_OPAQUE_BLACK = 0x00000003,
362 VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE = 0x00000004,
363 VK_BORDER_COLOR_INT_OPAQUE_WHITE = 0x00000005,
364}
365
366enum VkPipelineBindPoint {
Jesse Hallc7467b72015-11-29 21:05:26 -0800367 VK_PIPELINE_BIND_POINT_GRAPHICS = 0x00000000,
368 VK_PIPELINE_BIND_POINT_COMPUTE = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700369}
370
371enum VkPrimitiveTopology {
372 VK_PRIMITIVE_TOPOLOGY_POINT_LIST = 0x00000000,
373 VK_PRIMITIVE_TOPOLOGY_LINE_LIST = 0x00000001,
374 VK_PRIMITIVE_TOPOLOGY_LINE_STRIP = 0x00000002,
375 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST = 0x00000003,
376 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP = 0x00000004,
377 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN = 0x00000005,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800378 VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY = 0x00000006,
379 VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY = 0x00000007,
380 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY = 0x00000008,
381 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY = 0x00000009,
Jesse Hall091ed9e2015-11-30 00:55:29 -0800382 VK_PRIMITIVE_TOPOLOGY_PATCH_LIST = 0x0000000a,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700383}
384
385enum VkSharingMode {
386 VK_SHARING_MODE_EXCLUSIVE = 0x00000000,
387 VK_SHARING_MODE_CONCURRENT = 0x00000001,
388}
389
390enum VkIndexType {
391 VK_INDEX_TYPE_UINT16 = 0x00000000,
392 VK_INDEX_TYPE_UINT32 = 0x00000001,
393}
394
Jesse Hall23ff73f2015-11-29 14:36:39 -0800395enum VkFilter {
396 VK_FILTER_NEAREST = 0x00000000,
397 VK_FILTER_LINEAR = 0x00000001,
Jesse Hall26763382016-05-20 07:13:52 -0700398
399 //@extension("VK_IMG_filter_cubic")
400 VK_FILTER_CUBIC_IMG = 1000015000,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700401}
402
Jesse Hall23ff73f2015-11-29 14:36:39 -0800403enum VkSamplerMipmapMode {
Jesse Hall23ff73f2015-11-29 14:36:39 -0800404 VK_SAMPLER_MIPMAP_MODE_NEAREST = 0x00000001, /// Choose nearest mip level
405 VK_SAMPLER_MIPMAP_MODE_LINEAR = 0x00000002, /// Linear filter between mip levels
Jesse Halld27f6aa2015-08-15 17:58:48 -0700406}
407
Jesse Hall23ff73f2015-11-29 14:36:39 -0800408enum VkSamplerAddressMode {
Jesse Hallc7467b72015-11-29 21:05:26 -0800409 VK_SAMPLER_ADDRESS_MODE_REPEAT = 0x00000000,
410 VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT = 0x00000001,
411 VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE = 0x00000002,
412 VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER = 0x00000003,
413 VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700414}
415
416enum VkCompareOp {
417 VK_COMPARE_OP_NEVER = 0x00000000,
418 VK_COMPARE_OP_LESS = 0x00000001,
419 VK_COMPARE_OP_EQUAL = 0x00000002,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800420 VK_COMPARE_OP_LESS_OR_EQUAL = 0x00000003,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700421 VK_COMPARE_OP_GREATER = 0x00000004,
422 VK_COMPARE_OP_NOT_EQUAL = 0x00000005,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800423 VK_COMPARE_OP_GREATER_OR_EQUAL = 0x00000006,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700424 VK_COMPARE_OP_ALWAYS = 0x00000007,
425}
426
Jesse Hall65ab5522015-11-30 00:07:16 -0800427enum VkPolygonMode {
428 VK_POLYGON_MODE_FILL = 0x00000000,
429 VK_POLYGON_MODE_LINE = 0x00000001,
430 VK_POLYGON_MODE_POINT = 0x00000002,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700431}
432
433enum VkFrontFace {
Jesse Hall3fbc8562015-11-29 22:10:52 -0800434 VK_FRONT_FACE_COUNTER_CLOCKWISE = 0x00000000,
435 VK_FRONT_FACE_CLOCKWISE = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700436}
437
Jesse Hall65ab5522015-11-30 00:07:16 -0800438enum VkBlendFactor {
439 VK_BLEND_FACTOR_ZERO = 0x00000000,
440 VK_BLEND_FACTOR_ONE = 0x00000001,
441 VK_BLEND_FACTOR_SRC_COLOR = 0x00000002,
442 VK_BLEND_FACTOR_ONE_MINUS_SRC_COLOR = 0x00000003,
443 VK_BLEND_FACTOR_DST_COLOR = 0x00000004,
444 VK_BLEND_FACTOR_ONE_MINUS_DST_COLOR = 0x00000005,
445 VK_BLEND_FACTOR_SRC_ALPHA = 0x00000006,
446 VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA = 0x00000007,
447 VK_BLEND_FACTOR_DST_ALPHA = 0x00000008,
448 VK_BLEND_FACTOR_ONE_MINUS_DST_ALPHA = 0x00000009,
449 VK_BLEND_FACTOR_CONSTANT_COLOR = 0x0000000a,
450 VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR = 0x0000000b,
451 VK_BLEND_FACTOR_CONSTANT_ALPHA = 0x0000000c,
452 VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA = 0x0000000d,
453 VK_BLEND_FACTOR_SRC_ALPHA_SATURATE = 0x0000000e,
454 VK_BLEND_FACTOR_SRC1_COLOR = 0x0000000f,
455 VK_BLEND_FACTOR_ONE_MINUS_SRC1_COLOR = 0x00000010,
456 VK_BLEND_FACTOR_SRC1_ALPHA = 0x00000011,
457 VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA = 0x00000012,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700458}
459
460enum VkBlendOp {
461 VK_BLEND_OP_ADD = 0x00000000,
462 VK_BLEND_OP_SUBTRACT = 0x00000001,
463 VK_BLEND_OP_REVERSE_SUBTRACT = 0x00000002,
464 VK_BLEND_OP_MIN = 0x00000003,
465 VK_BLEND_OP_MAX = 0x00000004,
466}
467
468enum VkStencilOp {
469 VK_STENCIL_OP_KEEP = 0x00000000,
470 VK_STENCIL_OP_ZERO = 0x00000001,
471 VK_STENCIL_OP_REPLACE = 0x00000002,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800472 VK_STENCIL_OP_INCREMENT_AND_CLAMP = 0x00000003,
473 VK_STENCIL_OP_DECREMENT_AND_CLAMP = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700474 VK_STENCIL_OP_INVERT = 0x00000005,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800475 VK_STENCIL_OP_INCREMENT_AND_WRAP = 0x00000006,
476 VK_STENCIL_OP_DECREMENT_AND_WRAP = 0x00000007,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700477}
478
479enum VkLogicOp {
480 VK_LOGIC_OP_CLEAR = 0x00000000,
481 VK_LOGIC_OP_AND = 0x00000001,
482 VK_LOGIC_OP_AND_REVERSE = 0x00000002,
483 VK_LOGIC_OP_COPY = 0x00000003,
484 VK_LOGIC_OP_AND_INVERTED = 0x00000004,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800485 VK_LOGIC_OP_NO_OP = 0x00000005,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700486 VK_LOGIC_OP_XOR = 0x00000006,
487 VK_LOGIC_OP_OR = 0x00000007,
488 VK_LOGIC_OP_NOR = 0x00000008,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800489 VK_LOGIC_OP_EQUIVALENT = 0x00000009,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700490 VK_LOGIC_OP_INVERT = 0x0000000a,
491 VK_LOGIC_OP_OR_REVERSE = 0x0000000b,
492 VK_LOGIC_OP_COPY_INVERTED = 0x0000000c,
493 VK_LOGIC_OP_OR_INVERTED = 0x0000000d,
494 VK_LOGIC_OP_NAND = 0x0000000e,
495 VK_LOGIC_OP_SET = 0x0000000f,
496}
497
Jesse Hall3fbc8562015-11-29 22:10:52 -0800498enum VkSystemAllocationScope {
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800499 VK_SYSTEM_ALLOCATION_SCOPE_COMMAND = 0x00000000,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800500 VK_SYSTEM_ALLOCATION_SCOPE_OBJECT = 0x00000001,
501 VK_SYSTEM_ALLOCATION_SCOPE_CACHE = 0x00000002,
502 VK_SYSTEM_ALLOCATION_SCOPE_DEVICE = 0x00000003,
503 VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE = 0x00000004,
Jesse Hall03b6fe12015-11-24 12:44:21 -0800504}
505
Jesse Hall3fbc8562015-11-29 22:10:52 -0800506enum VkInternalAllocationType {
507 VK_INTERNAL_ALLOCATION_TYPE_EXECUTABLE = 0x00000000,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700508}
509
510enum VkPhysicalDeviceType {
511 VK_PHYSICAL_DEVICE_TYPE_OTHER = 0x00000000,
512 VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU = 0x00000001,
513 VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU = 0x00000002,
514 VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU = 0x00000003,
515 VK_PHYSICAL_DEVICE_TYPE_CPU = 0x00000004,
516}
517
Jesse Hall65ab5522015-11-30 00:07:16 -0800518enum VkVertexInputRate {
519 VK_VERTEX_INPUT_RATE_VERTEX = 0x00000000,
520 VK_VERTEX_INPUT_RATE_INSTANCE = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700521}
522
523/// Vulkan format definitions
524enum VkFormat {
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800525 VK_FORMAT_UNDEFINED = 0,
526 VK_FORMAT_R4G4_UNORM_PACK8 = 1,
527 VK_FORMAT_R4G4B4A4_UNORM_PACK16 = 2,
528 VK_FORMAT_B4G4R4A4_UNORM_PACK16 = 3,
529 VK_FORMAT_R5G6B5_UNORM_PACK16 = 4,
530 VK_FORMAT_B5G6R5_UNORM_PACK16 = 5,
531 VK_FORMAT_R5G5B5A1_UNORM_PACK16 = 6,
532 VK_FORMAT_B5G5R5A1_UNORM_PACK16 = 7,
533 VK_FORMAT_A1R5G5B5_UNORM_PACK16 = 8,
534 VK_FORMAT_R8_UNORM = 9,
535 VK_FORMAT_R8_SNORM = 10,
536 VK_FORMAT_R8_USCALED = 11,
537 VK_FORMAT_R8_SSCALED = 12,
538 VK_FORMAT_R8_UINT = 13,
539 VK_FORMAT_R8_SINT = 14,
540 VK_FORMAT_R8_SRGB = 15,
541 VK_FORMAT_R8G8_UNORM = 16,
542 VK_FORMAT_R8G8_SNORM = 17,
543 VK_FORMAT_R8G8_USCALED = 18,
544 VK_FORMAT_R8G8_SSCALED = 19,
545 VK_FORMAT_R8G8_UINT = 20,
546 VK_FORMAT_R8G8_SINT = 21,
547 VK_FORMAT_R8G8_SRGB = 22,
548 VK_FORMAT_R8G8B8_UNORM = 23,
549 VK_FORMAT_R8G8B8_SNORM = 24,
550 VK_FORMAT_R8G8B8_USCALED = 25,
551 VK_FORMAT_R8G8B8_SSCALED = 26,
552 VK_FORMAT_R8G8B8_UINT = 27,
553 VK_FORMAT_R8G8B8_SINT = 28,
554 VK_FORMAT_R8G8B8_SRGB = 29,
555 VK_FORMAT_B8G8R8_UNORM = 30,
556 VK_FORMAT_B8G8R8_SNORM = 31,
557 VK_FORMAT_B8G8R8_USCALED = 32,
558 VK_FORMAT_B8G8R8_SSCALED = 33,
559 VK_FORMAT_B8G8R8_UINT = 34,
560 VK_FORMAT_B8G8R8_SINT = 35,
561 VK_FORMAT_B8G8R8_SRGB = 36,
562 VK_FORMAT_R8G8B8A8_UNORM = 37,
563 VK_FORMAT_R8G8B8A8_SNORM = 38,
564 VK_FORMAT_R8G8B8A8_USCALED = 39,
565 VK_FORMAT_R8G8B8A8_SSCALED = 40,
566 VK_FORMAT_R8G8B8A8_UINT = 41,
567 VK_FORMAT_R8G8B8A8_SINT = 42,
568 VK_FORMAT_R8G8B8A8_SRGB = 43,
569 VK_FORMAT_B8G8R8A8_UNORM = 44,
570 VK_FORMAT_B8G8R8A8_SNORM = 45,
571 VK_FORMAT_B8G8R8A8_USCALED = 46,
572 VK_FORMAT_B8G8R8A8_SSCALED = 47,
573 VK_FORMAT_B8G8R8A8_UINT = 48,
574 VK_FORMAT_B8G8R8A8_SINT = 49,
575 VK_FORMAT_B8G8R8A8_SRGB = 50,
576 VK_FORMAT_A8B8G8R8_UNORM_PACK32 = 51,
577 VK_FORMAT_A8B8G8R8_SNORM_PACK32 = 52,
578 VK_FORMAT_A8B8G8R8_USCALED_PACK32 = 53,
579 VK_FORMAT_A8B8G8R8_SSCALED_PACK32 = 54,
580 VK_FORMAT_A8B8G8R8_UINT_PACK32 = 55,
581 VK_FORMAT_A8B8G8R8_SINT_PACK32 = 56,
582 VK_FORMAT_A8B8G8R8_SRGB_PACK32 = 57,
583 VK_FORMAT_A2R10G10B10_UNORM_PACK32 = 58,
584 VK_FORMAT_A2R10G10B10_SNORM_PACK32 = 59,
585 VK_FORMAT_A2R10G10B10_USCALED_PACK32 = 60,
586 VK_FORMAT_A2R10G10B10_SSCALED_PACK32 = 61,
587 VK_FORMAT_A2R10G10B10_UINT_PACK32 = 62,
588 VK_FORMAT_A2R10G10B10_SINT_PACK32 = 63,
589 VK_FORMAT_A2B10G10R10_UNORM_PACK32 = 64,
590 VK_FORMAT_A2B10G10R10_SNORM_PACK32 = 65,
591 VK_FORMAT_A2B10G10R10_USCALED_PACK32 = 66,
592 VK_FORMAT_A2B10G10R10_SSCALED_PACK32 = 67,
593 VK_FORMAT_A2B10G10R10_UINT_PACK32 = 68,
594 VK_FORMAT_A2B10G10R10_SINT_PACK32 = 69,
595 VK_FORMAT_R16_UNORM = 70,
596 VK_FORMAT_R16_SNORM = 71,
597 VK_FORMAT_R16_USCALED = 72,
598 VK_FORMAT_R16_SSCALED = 73,
599 VK_FORMAT_R16_UINT = 74,
600 VK_FORMAT_R16_SINT = 75,
601 VK_FORMAT_R16_SFLOAT = 76,
602 VK_FORMAT_R16G16_UNORM = 77,
603 VK_FORMAT_R16G16_SNORM = 78,
604 VK_FORMAT_R16G16_USCALED = 79,
605 VK_FORMAT_R16G16_SSCALED = 80,
606 VK_FORMAT_R16G16_UINT = 81,
607 VK_FORMAT_R16G16_SINT = 82,
608 VK_FORMAT_R16G16_SFLOAT = 83,
609 VK_FORMAT_R16G16B16_UNORM = 84,
610 VK_FORMAT_R16G16B16_SNORM = 85,
611 VK_FORMAT_R16G16B16_USCALED = 86,
612 VK_FORMAT_R16G16B16_SSCALED = 87,
613 VK_FORMAT_R16G16B16_UINT = 88,
614 VK_FORMAT_R16G16B16_SINT = 89,
615 VK_FORMAT_R16G16B16_SFLOAT = 90,
616 VK_FORMAT_R16G16B16A16_UNORM = 91,
617 VK_FORMAT_R16G16B16A16_SNORM = 92,
618 VK_FORMAT_R16G16B16A16_USCALED = 93,
619 VK_FORMAT_R16G16B16A16_SSCALED = 94,
620 VK_FORMAT_R16G16B16A16_UINT = 95,
621 VK_FORMAT_R16G16B16A16_SINT = 96,
622 VK_FORMAT_R16G16B16A16_SFLOAT = 97,
623 VK_FORMAT_R32_UINT = 98,
624 VK_FORMAT_R32_SINT = 99,
625 VK_FORMAT_R32_SFLOAT = 100,
626 VK_FORMAT_R32G32_UINT = 101,
627 VK_FORMAT_R32G32_SINT = 102,
628 VK_FORMAT_R32G32_SFLOAT = 103,
629 VK_FORMAT_R32G32B32_UINT = 104,
630 VK_FORMAT_R32G32B32_SINT = 105,
631 VK_FORMAT_R32G32B32_SFLOAT = 106,
632 VK_FORMAT_R32G32B32A32_UINT = 107,
633 VK_FORMAT_R32G32B32A32_SINT = 108,
634 VK_FORMAT_R32G32B32A32_SFLOAT = 109,
635 VK_FORMAT_R64_UINT = 110,
636 VK_FORMAT_R64_SINT = 111,
637 VK_FORMAT_R64_SFLOAT = 112,
638 VK_FORMAT_R64G64_UINT = 113,
639 VK_FORMAT_R64G64_SINT = 114,
640 VK_FORMAT_R64G64_SFLOAT = 115,
641 VK_FORMAT_R64G64B64_UINT = 116,
642 VK_FORMAT_R64G64B64_SINT = 117,
643 VK_FORMAT_R64G64B64_SFLOAT = 118,
644 VK_FORMAT_R64G64B64A64_UINT = 119,
645 VK_FORMAT_R64G64B64A64_SINT = 120,
646 VK_FORMAT_R64G64B64A64_SFLOAT = 121,
647 VK_FORMAT_B10G11R11_UFLOAT_PACK32 = 122,
648 VK_FORMAT_E5B9G9R9_UFLOAT_PACK32 = 123,
649 VK_FORMAT_D16_UNORM = 124,
650 VK_FORMAT_X8_D24_UNORM_PACK32 = 125,
651 VK_FORMAT_D32_SFLOAT = 126,
652 VK_FORMAT_S8_UINT = 127,
653 VK_FORMAT_D16_UNORM_S8_UINT = 128,
654 VK_FORMAT_D24_UNORM_S8_UINT = 129,
655 VK_FORMAT_D32_SFLOAT_S8_UINT = 130,
656 VK_FORMAT_BC1_RGB_UNORM_BLOCK = 131,
657 VK_FORMAT_BC1_RGB_SRGB_BLOCK = 132,
658 VK_FORMAT_BC1_RGBA_UNORM_BLOCK = 133,
659 VK_FORMAT_BC1_RGBA_SRGB_BLOCK = 134,
660 VK_FORMAT_BC2_UNORM_BLOCK = 135,
661 VK_FORMAT_BC2_SRGB_BLOCK = 136,
662 VK_FORMAT_BC3_UNORM_BLOCK = 137,
663 VK_FORMAT_BC3_SRGB_BLOCK = 138,
664 VK_FORMAT_BC4_UNORM_BLOCK = 139,
665 VK_FORMAT_BC4_SNORM_BLOCK = 140,
666 VK_FORMAT_BC5_UNORM_BLOCK = 141,
667 VK_FORMAT_BC5_SNORM_BLOCK = 142,
668 VK_FORMAT_BC6H_UFLOAT_BLOCK = 143,
669 VK_FORMAT_BC6H_SFLOAT_BLOCK = 144,
670 VK_FORMAT_BC7_UNORM_BLOCK = 145,
671 VK_FORMAT_BC7_SRGB_BLOCK = 146,
672 VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK = 147,
673 VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK = 148,
674 VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK = 149,
675 VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK = 150,
676 VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK = 151,
677 VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK = 152,
678 VK_FORMAT_EAC_R11_UNORM_BLOCK = 153,
679 VK_FORMAT_EAC_R11_SNORM_BLOCK = 154,
680 VK_FORMAT_EAC_R11G11_UNORM_BLOCK = 155,
681 VK_FORMAT_EAC_R11G11_SNORM_BLOCK = 156,
682 VK_FORMAT_ASTC_4x4_UNORM_BLOCK = 157,
683 VK_FORMAT_ASTC_4x4_SRGB_BLOCK = 158,
684 VK_FORMAT_ASTC_5x4_UNORM_BLOCK = 159,
685 VK_FORMAT_ASTC_5x4_SRGB_BLOCK = 160,
686 VK_FORMAT_ASTC_5x5_UNORM_BLOCK = 161,
687 VK_FORMAT_ASTC_5x5_SRGB_BLOCK = 162,
688 VK_FORMAT_ASTC_6x5_UNORM_BLOCK = 163,
689 VK_FORMAT_ASTC_6x5_SRGB_BLOCK = 164,
690 VK_FORMAT_ASTC_6x6_UNORM_BLOCK = 165,
691 VK_FORMAT_ASTC_6x6_SRGB_BLOCK = 166,
692 VK_FORMAT_ASTC_8x5_UNORM_BLOCK = 167,
693 VK_FORMAT_ASTC_8x5_SRGB_BLOCK = 168,
694 VK_FORMAT_ASTC_8x6_UNORM_BLOCK = 169,
695 VK_FORMAT_ASTC_8x6_SRGB_BLOCK = 170,
696 VK_FORMAT_ASTC_8x8_UNORM_BLOCK = 171,
697 VK_FORMAT_ASTC_8x8_SRGB_BLOCK = 172,
698 VK_FORMAT_ASTC_10x5_UNORM_BLOCK = 173,
699 VK_FORMAT_ASTC_10x5_SRGB_BLOCK = 174,
700 VK_FORMAT_ASTC_10x6_UNORM_BLOCK = 175,
701 VK_FORMAT_ASTC_10x6_SRGB_BLOCK = 176,
702 VK_FORMAT_ASTC_10x8_UNORM_BLOCK = 177,
703 VK_FORMAT_ASTC_10x8_SRGB_BLOCK = 178,
704 VK_FORMAT_ASTC_10x10_UNORM_BLOCK = 179,
705 VK_FORMAT_ASTC_10x10_SRGB_BLOCK = 180,
706 VK_FORMAT_ASTC_12x10_UNORM_BLOCK = 181,
707 VK_FORMAT_ASTC_12x10_SRGB_BLOCK = 182,
708 VK_FORMAT_ASTC_12x12_UNORM_BLOCK = 183,
709 VK_FORMAT_ASTC_12x12_SRGB_BLOCK = 184,
Jesse Halleb02c472017-02-24 15:13:45 -0800710
711 //@extension("VK_IMG_format_pvrtc")
712 VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG = 1000054000,
713 VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG = 1000054001,
714 VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG = 1000054002,
715 VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG = 1000054003,
716 VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG = 1000054004,
717 VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG = 1000054005,
718 VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG = 1000054006,
719 VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG = 1000054007,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700720}
721
Jesse Halld27f6aa2015-08-15 17:58:48 -0700722/// Structure type enumerant
723enum VkStructureType {
724 VK_STRUCTURE_TYPE_APPLICATION_INFO = 0,
Jesse Hallc7467b72015-11-29 21:05:26 -0800725 VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO = 1,
726 VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO = 2,
727 VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO = 3,
728 VK_STRUCTURE_TYPE_SUBMIT_INFO = 4,
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800729 VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO = 5,
Jesse Hallc7467b72015-11-29 21:05:26 -0800730 VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE = 6,
731 VK_STRUCTURE_TYPE_BIND_SPARSE_INFO = 7,
732 VK_STRUCTURE_TYPE_FENCE_CREATE_INFO = 8,
733 VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO = 9,
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700734 VK_STRUCTURE_TYPE_EVENT_CREATE_INFO = 10,
Jesse Hallc7467b72015-11-29 21:05:26 -0800735 VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO = 11,
736 VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO = 12,
737 VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO = 13,
738 VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO = 14,
739 VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO = 15,
740 VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO = 16,
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800741 VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO = 17,
742 VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO = 18,
743 VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO = 19,
744 VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO = 20,
745 VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO = 21,
746 VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO = 22,
747 VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO = 23,
748 VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO = 24,
749 VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO = 25,
750 VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO = 26,
751 VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO = 27,
752 VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO = 28,
753 VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO = 29,
754 VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO = 30,
755 VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO = 31,
756 VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO = 32,
757 VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO = 33,
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800758 VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO = 34,
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800759 VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET = 35,
760 VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET = 36,
761 VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO = 37,
762 VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO = 38,
763 VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO = 39,
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800764 VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO = 40,
Jesse Hall3dd678a2016-01-08 21:52:01 -0800765 VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO = 41,
766 VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO = 42,
767 VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO = 43,
768 VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER = 44,
769 VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER = 45,
770 VK_STRUCTURE_TYPE_MEMORY_BARRIER = 46,
771 VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO = 47,
772 VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO = 48,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800773
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800774 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800775 VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR = 1000001000,
776 VK_STRUCTURE_TYPE_PRESENT_INFO_KHR = 1000001001,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800777
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800778 //@extension("VK_KHR_display")
Jesse Hallbd888842015-11-30 21:44:14 -0800779 VK_STRUCTURE_TYPE_DISPLAY_MODE_CREATE_INFO_KHR = 1000002000,
780 VK_STRUCTURE_TYPE_DISPLAY_SURFACE_CREATE_INFO_KHR = 1000002001,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800781
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800782 //@extension("VK_KHR_display_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800783 VK_STRUCTURE_TYPE_DISPLAY_DISPLAY_PRESENT_INFO_KHR = 1000003000,
Jesse Hallf9fa9a52016-01-08 16:08:51 -0800784
785 //@extension("VK_KHR_xlib_surface")
786 VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR = 1000004000,
787
788 //@extension("VK_KHR_xcb_surface")
789 VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR = 1000005000,
790
791 //@extension("VK_KHR_wayland_surface")
792 VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR = 1000006000,
793
794 //@extension("VK_KHR_mir_surface")
795 VK_STRUCTURE_TYPE_MIR_SURFACE_CREATE_INFO_KHR = 1000007000,
796
797 //@extension("VK_KHR_android_surface")
798 VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR = 1000008000,
799
800 //@extension("VK_KHR_win32_surface")
801 VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR = 1000009000,
Jesse Hall543a7ff2016-01-08 16:38:30 -0800802
Chia-I Wub262ddc2016-03-22 07:38:20 +0800803 //@extension("VK_ANDROID_native_buffer")
804 VK_STRUCTURE_TYPE_NATIVE_BUFFER_ANDROID = 1000010000,
805
Jesse Hall543a7ff2016-01-08 16:38:30 -0800806 //@extension("VK_EXT_debug_report")
Jesse Hall26763382016-05-20 07:13:52 -0700807 VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT = 1000011000,
808
809 //@extension("VK_AMD_rasterization_order")
810 VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD = 1000018000,
811
812 //@extension("VK_EXT_debug_marker")
813 VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_NAME_INFO_EXT = 1000022000,
Jesse Hall26763382016-05-20 07:13:52 -0700814 VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_TAG_INFO_EXT = 1000022001,
Jesse Hall26763382016-05-20 07:13:52 -0700815 VK_STRUCTURE_TYPE_DEBUG_MARKER_MARKER_INFO_EXT = 1000022002,
Jesse Hall3f5499b2016-07-26 15:20:40 -0700816
817 //@extension("VK_NV_dedicated_allocation")
818 VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV = 1000026000,
Jesse Hall3f5499b2016-07-26 15:20:40 -0700819 VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV = 1000026001,
Jesse Hall3f5499b2016-07-26 15:20:40 -0700820 VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV = 1000026002,
Jesse Halleb02c472017-02-24 15:13:45 -0800821
822 //@extension("VK_NV_external_memory")
823 VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_NV = 1000056000,
824 VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_NV = 1000056001,
825
826 //@extension("VK_NV_external_memory_win32")
827 VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_NV = 1000057000,
828 VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_NV = 1000057001,
829
830 //@extension("VK_NV_win32_keyed_mutex")
831 VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_NV = 1000058000,
832
Jesse Hall08e2f482017-03-06 15:22:17 -0800833 //@extension("VK_KHR_get_physical_device_properties2")
834 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR = 1000059000,
835 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR = 1000059001,
836 VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2_KHR = 1000059002,
837 VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2_KHR = 1000059003,
838 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2_KHR = 1000059004,
839 VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2_KHR = 1000059005,
840 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2_KHR = 1000059006,
841 VK_STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2_KHR = 1000059007,
842 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2_KHR = 1000059008,
843
Jesse Halleb02c472017-02-24 15:13:45 -0800844 //@extension("VK_EXT_validation_flags")
845 VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT = 1000061000,
846
Jesse Hall08e2f482017-03-06 15:22:17 -0800847 //@extension("VK_NN_vi_surface")
848 VK_STRUCTURE_TYPE_VI_SURFACE_CREATE_INFO_NN = 1000062000,
849
Jesse Halleb02c472017-02-24 15:13:45 -0800850 //@extension("VK_NVX_device_generated_commands")
851 VK_STRUCTURE_TYPE_OBJECT_TABLE_CREATE_INFO_NVX = 1000086000,
852 VK_STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_CREATE_INFO_NVX = 1000086001,
853 VK_STRUCTURE_TYPE_CMD_PROCESS_COMMANDS_INFO_NVX = 1000086002,
854 VK_STRUCTURE_TYPE_CMD_RESERVE_SPACE_FOR_COMMANDS_INFO_NVX = 1000086003,
855 VK_STRUCTURE_TYPE_DEVICE_GENERATED_COMMANDS_LIMITS_NVX = 1000086004,
856 VK_STRUCTURE_TYPE_DEVICE_GENERATED_COMMANDS_FEATURES_NVX = 1000086005,
Jesse Hall08e2f482017-03-06 15:22:17 -0800857
858 //@extension("VK_EXT_display_surface_counter")
859 VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES2_EXT = 1000090000,
860
861 //@extension("VK_EXT_display_control")
862 VK_STRUCTURE_TYPE_DISPLAY_POWER_INFO_EXT = 1000091000,
863 VK_STRUCTURE_TYPE_DEVICE_EVENT_INFO_EXT = 1000091001,
864 VK_STRUCTURE_TYPE_DISPLAY_EVENT_INFO_EXT = 1000091002,
865 VK_STRUCTURE_TYPE_SWAPCHAIN_COUNTER_CREATE_INFO_EXT = 1000091003,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700866}
867
Jesse Hall65ab5522015-11-30 00:07:16 -0800868enum VkSubpassContents {
869 VK_SUBPASS_CONTENTS_INLINE = 0x00000000,
870 VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700871}
872
Jesse Hall543a7ff2016-01-08 16:38:30 -0800873enum VkPipelineCacheHeaderVersion {
874 VK_PIPELINE_CACHE_HEADER_VERSION_ONE = 1,
875}
876
Jesse Hallbd888842015-11-30 21:44:14 -0800877@lastUnused(-11)
Jesse Halld27f6aa2015-08-15 17:58:48 -0700878/// Error and return codes
879enum VkResult {
880 // Return codes for successful operation execution (positive values)
Jesse Hallbd888842015-11-30 21:44:14 -0800881 VK_SUCCESS = 0,
882 VK_NOT_READY = 1,
883 VK_TIMEOUT = 2,
884 VK_EVENT_SET = 3,
885 VK_EVENT_RESET = 4,
886 VK_INCOMPLETE = 5,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700887
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800888 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800889 VK_SUBOPTIMAL_KHR = 1000001003,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800890
Jesse Halld27f6aa2015-08-15 17:58:48 -0700891 // Error codes (negative values)
Jesse Hallbd888842015-11-30 21:44:14 -0800892 VK_ERROR_OUT_OF_HOST_MEMORY = 0xFFFFFFFF, // -1
893 VK_ERROR_OUT_OF_DEVICE_MEMORY = 0xFFFFFFFE, // -2
894 VK_ERROR_INITIALIZATION_FAILED = 0xFFFFFFFD, // -3
895 VK_ERROR_DEVICE_LOST = 0xFFFFFFFC, // -4
896 VK_ERROR_MEMORY_MAP_FAILED = 0xFFFFFFFB, // -5
897 VK_ERROR_LAYER_NOT_PRESENT = 0xFFFFFFFA, // -6
898 VK_ERROR_EXTENSION_NOT_PRESENT = 0xFFFFFFF9, // -7
899 VK_ERROR_FEATURE_NOT_PRESENT = 0xFFFFFFF8, // -8
900 VK_ERROR_INCOMPATIBLE_DRIVER = 0xFFFFFFF7, // -9
901 VK_ERROR_TOO_MANY_OBJECTS = 0xFFFFFFF6, // -10
902 VK_ERROR_FORMAT_NOT_SUPPORTED = 0xFFFFFFF5, // -11
Jesse Hall3f5499b2016-07-26 15:20:40 -0700903 VK_ERROR_FRAGMENTED_POOL = 0xFFFFFFF4, // -12
Jesse Hall1356b0d2015-11-23 17:24:58 -0800904
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800905 //@extension("VK_KHR_surface")
Jesse Hallbd888842015-11-30 21:44:14 -0800906 VK_ERROR_SURFACE_LOST_KHR = 0xC4653600, // -1000000000
Jesse Halla6429252015-11-29 18:59:42 -0800907
Jesse Hall563380d2016-01-15 23:14:05 -0800908 //@extension("VK_KHR_surface")
909 VK_ERROR_NATIVE_WINDOW_IN_USE_KHR = 0xC46535FF, // -1000008001
910
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800911 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800912 VK_ERROR_OUT_OF_DATE_KHR = 0xC4653214, // -1000001004
Jesse Hall1356b0d2015-11-23 17:24:58 -0800913
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800914 //@extension("VK_KHR_display_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800915 VK_ERROR_INCOMPATIBLE_DISPLAY_KHR = 0xC4652A47, // -1000003001
Jesse Hall1356b0d2015-11-23 17:24:58 -0800916
Jesse Hall543a7ff2016-01-08 16:38:30 -0800917 //@extension("VK_EXT_debug_report")
918 VK_ERROR_VALIDATION_FAILED_EXT = 0xC4650B07, // -1000011001
Jesse Hall26763382016-05-20 07:13:52 -0700919
920 //@extension("VK_NV_glsl_shader")
921 VK_ERROR_INVALID_SHADER_NV = 0xC4650720, // -1000012000
Jesse Hall08e2f482017-03-06 15:22:17 -0800922
923 //@extension("VK_KHR_maintenance1")
924 VK_ERROR_OUT_OF_POOL_MEMORY_KHR = 0xC4642878, // -1000069000
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700925}
926
927enum VkDynamicState {
928 VK_DYNAMIC_STATE_VIEWPORT = 0x00000000,
929 VK_DYNAMIC_STATE_SCISSOR = 0x00000001,
930 VK_DYNAMIC_STATE_LINE_WIDTH = 0x00000002,
931 VK_DYNAMIC_STATE_DEPTH_BIAS = 0x00000003,
932 VK_DYNAMIC_STATE_BLEND_CONSTANTS = 0x00000004,
933 VK_DYNAMIC_STATE_DEPTH_BOUNDS = 0x00000005,
934 VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK = 0x00000006,
935 VK_DYNAMIC_STATE_STENCIL_WRITE_MASK = 0x00000007,
936 VK_DYNAMIC_STATE_STENCIL_REFERENCE = 0x00000008,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700937}
938
Jesse Hall523db342015-11-30 21:12:55 -0800939@extension("VK_KHR_surface")
Michael Lentine88594d72015-11-12 12:49:45 -0800940enum VkPresentModeKHR {
941 VK_PRESENT_MODE_IMMEDIATE_KHR = 0x00000000,
942 VK_PRESENT_MODE_MAILBOX_KHR = 0x00000001,
943 VK_PRESENT_MODE_FIFO_KHR = 0x00000002,
Jesse Hall03b6fe12015-11-24 12:44:21 -0800944 VK_PRESENT_MODE_FIFO_RELAXED_KHR = 0x00000003,
Michael Lentine88594d72015-11-12 12:49:45 -0800945}
946
Jesse Hall523db342015-11-30 21:12:55 -0800947@extension("VK_KHR_surface")
Michael Lentine88594d72015-11-12 12:49:45 -0800948enum VkColorSpaceKHR {
949 VK_COLORSPACE_SRGB_NONLINEAR_KHR = 0x00000000,
Jesse Hall08e2f482017-03-06 15:22:17 -0800950
951 //@extension("VK_EXT_swapchain_colorspace")
952 VK_COLOR_SPACE_DISPLAY_P3_LINEAR_EXT = 1000104001,
953 VK_COLOR_SPACE_DISPLAY_P3_NONLINEAR_EXT = 1000104002,
954 VK_COLOR_SPACE_SCRGB_LINEAR_EXT = 1000104003,
955 VK_COLOR_SPACE_SCRGB_NONLINEAR_EXT = 1000104004,
956 VK_COLOR_SPACE_DCI_P3_LINEAR_EXT = 1000104005,
957 VK_COLOR_SPACE_DCI_P3_NONLINEAR_EXT = 1000104006,
958 VK_COLOR_SPACE_BT709_LINEAR_EXT = 1000104007,
959 VK_COLOR_SPACE_BT709_NONLINEAR_EXT = 1000104008,
960 VK_COLOR_SPACE_BT2020_LINEAR_EXT = 1000104009,
961 VK_COLOR_SPACE_BT2020_NONLINEAR_EXT = 1000104010,
962 VK_COLOR_SPACE_ADOBERGB_LINEAR_EXT = 1000104011,
963 VK_COLOR_SPACE_ADOBERGB_NONLINEAR_EXT = 1000104012,
Michael Lentine88594d72015-11-12 12:49:45 -0800964}
Jesse Halld27f6aa2015-08-15 17:58:48 -0700965
Jesse Hall715b86a2016-01-16 16:34:29 -0800966@extension("VK_EXT_debug_report")
967enum VkDebugReportObjectTypeEXT {
968 VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT = 0,
969 VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT = 1,
970 VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT = 2,
971 VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT = 3,
972 VK_DEBUG_REPORT_OBJECT_TYPE_QUEUE_EXT = 4,
973 VK_DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT = 5,
974 VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT = 6,
975 VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT = 7,
976 VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT = 8,
977 VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT = 9,
978 VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT = 10,
979 VK_DEBUG_REPORT_OBJECT_TYPE_EVENT_EXT = 11,
980 VK_DEBUG_REPORT_OBJECT_TYPE_QUERY_POOL_EXT = 12,
981 VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_VIEW_EXT = 13,
982 VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_VIEW_EXT = 14,
983 VK_DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT = 15,
984 VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_CACHE_EXT = 16,
985 VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_LAYOUT_EXT = 17,
986 VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT = 18,
987 VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT = 19,
988 VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT_EXT = 20,
989 VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_EXT = 21,
990 VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT = 22,
991 VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT = 23,
992 VK_DEBUG_REPORT_OBJECT_TYPE_FRAMEBUFFER_EXT = 24,
993 VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_POOL_EXT = 25,
994 VK_DEBUG_REPORT_OBJECT_TYPE_SURFACE_KHR_EXT = 26,
995 VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT = 27,
996 VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_EXT = 28,
Jesse Halleb02c472017-02-24 15:13:45 -0800997 VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_KHR_EXT = 29,
998 VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_MODE_KHR_EXT = 30,
999 VK_DEBUG_REPORT_OBJECT_TYPE_OBJECT_TABLE_NVX_EXT = 31,
1000 VK_DEBUG_REPORT_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NVX_EXT = 32,
Jesse Hall715b86a2016-01-16 16:34:29 -08001001}
1002
1003@extension("VK_EXT_debug_report")
1004enum VkDebugReportErrorEXT {
1005 VK_DEBUG_REPORT_ERROR_NONE_EXT = 0,
1006 VK_DEBUG_REPORT_ERROR_CALLBACK_REF_EXT = 1,
1007}
1008
Jesse Hall26763382016-05-20 07:13:52 -07001009@extension("VK_AMD_rasterization_order")
1010enum VkRasterizationOrderAMD {
1011 VK_RASTERIZATION_ORDER_STRICT_AMD = 0,
1012 VK_RASTERIZATION_ORDER_RELAXED_AMD = 1,
1013}
1014
Jesse Halleb02c472017-02-24 15:13:45 -08001015@extension("VK_EXT_validation_flags")
1016enum VkValidationCheckEXT {
1017 VK_VALIDATION_CHECK_ALL_EXT = 0,
1018}
1019
1020@extension("VK_NVX_device_generated_commands")
1021enum VkIndirectCommandsTokenTypeNVX {
1022 VK_INDIRECT_COMMANDS_TOKEN_PIPELINE_NVX = 0,
1023 VK_INDIRECT_COMMANDS_TOKEN_DESCRIPTOR_SET_NVX = 1,
1024 VK_INDIRECT_COMMANDS_TOKEN_INDEX_BUFFER_NVX = 2,
1025 VK_INDIRECT_COMMANDS_TOKEN_VERTEX_BUFFER_NVX = 3,
1026 VK_INDIRECT_COMMANDS_TOKEN_PUSH_CONSTANT_NVX = 4,
1027 VK_INDIRECT_COMMANDS_TOKEN_DRAW_INDEXED_NVX = 5,
1028 VK_INDIRECT_COMMANDS_TOKEN_DRAW_NVX = 6,
1029 VK_INDIRECT_COMMANDS_TOKEN_DISPATCH_NVX = 7,
1030}
1031
1032@extension("VK_NVX_device_generated_commands")
1033enum VkObjectEntryTypeNVX {
1034 VK_OBJECT_ENTRY_DESCRIPTOR_SET_NVX = 0,
1035 VK_OBJECT_ENTRY_PIPELINE_NVX = 1,
1036 VK_OBJECT_ENTRY_INDEX_BUFFER_NVX = 2,
1037 VK_OBJECT_ENTRY_VERTEX_BUFFER_NVX = 3,
1038 VK_OBJECT_ENTRY_PUSH_CONSTANT_NVX = 4,
1039}
Jesse Hall715b86a2016-01-16 16:34:29 -08001040
Jesse Hall08e2f482017-03-06 15:22:17 -08001041@extension("VK_EXT_display_control")
1042enum VkDisplayPowerStateEXT {
1043 VK_DISPLAY_POWER_STATE_OFF_EXT = 0,
1044 VK_DISPLAY_POWER_STATE_SUSPEND_EXT = 1,
1045 VK_DISPLAY_POWER_STATE_ON_EXT = 2,
1046}
1047
1048@extension("VK_EXT_display_control")
1049enum VkDeviceEventTypeEXT {
1050 VK_DEVICE_EVENT_TYPE_DISPLAY_HOTPLUG_EXT = 0,
1051}
1052
1053@extension("VK_EXT_display_control")
1054enum VkDisplayEventTypeEXT {
1055 VK_DISPLAY_EVENT_TYPE_FIRST_PIXEL_OUT_EXT = 0,
1056}
1057
Jesse Halld27f6aa2015-08-15 17:58:48 -07001058/////////////////
1059// Bitfields //
1060/////////////////
1061
Jesse Halld27f6aa2015-08-15 17:58:48 -07001062/// Queue capabilities
Jesse Halld8bade02015-11-24 10:24:18 -08001063type VkFlags VkQueueFlags
1064bitfield VkQueueFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001065 VK_QUEUE_GRAPHICS_BIT = 0x00000001, /// Queue supports graphics operations
1066 VK_QUEUE_COMPUTE_BIT = 0x00000002, /// Queue supports compute operations
Jesse Hall65ab5522015-11-30 00:07:16 -08001067 VK_QUEUE_TRANSFER_BIT = 0x00000004, /// Queue supports transfer operations
Jesse Hallb00daad2015-11-29 19:46:20 -08001068 VK_QUEUE_SPARSE_BINDING_BIT = 0x00000008, /// Queue supports sparse resource memory management operations
Jesse Halld27f6aa2015-08-15 17:58:48 -07001069}
1070
1071/// Memory properties passed into vkAllocMemory().
Jesse Halld8bade02015-11-24 10:24:18 -08001072type VkFlags VkMemoryPropertyFlags
1073bitfield VkMemoryPropertyFlagBits {
Jesse Halld1af8122015-11-29 23:50:38 -08001074 VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT = 0x00000001,
1075 VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT = 0x00000002,
1076 VK_MEMORY_PROPERTY_HOST_COHERENT_BIT = 0x00000004,
1077 VK_MEMORY_PROPERTY_HOST_CACHED_BIT = 0x00000008,
1078 VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT = 0x00000010,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001079}
1080
1081/// Memory heap flags
Jesse Halld8bade02015-11-24 10:24:18 -08001082type VkFlags VkMemoryHeapFlags
1083bitfield VkMemoryHeapFlagBits {
Jesse Halld1af8122015-11-29 23:50:38 -08001084 VK_MEMORY_HEAP_DEVICE_LOCAL_BIT = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001085}
1086
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001087/// Access flags
1088type VkFlags VkAccessFlags
1089bitfield VkAccessFlagBits {
1090 VK_ACCESS_INDIRECT_COMMAND_READ_BIT = 0x00000001,
1091 VK_ACCESS_INDEX_READ_BIT = 0x00000002,
1092 VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT = 0x00000004,
1093 VK_ACCESS_UNIFORM_READ_BIT = 0x00000008,
1094 VK_ACCESS_INPUT_ATTACHMENT_READ_BIT = 0x00000010,
1095 VK_ACCESS_SHADER_READ_BIT = 0x00000020,
1096 VK_ACCESS_SHADER_WRITE_BIT = 0x00000040,
1097 VK_ACCESS_COLOR_ATTACHMENT_READ_BIT = 0x00000080,
1098 VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT = 0x00000100,
1099 VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT = 0x00000200,
1100 VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT = 0x00000400,
1101 VK_ACCESS_TRANSFER_READ_BIT = 0x00000800,
1102 VK_ACCESS_TRANSFER_WRITE_BIT = 0x00001000,
1103 VK_ACCESS_HOST_READ_BIT = 0x00002000,
1104 VK_ACCESS_HOST_WRITE_BIT = 0x00004000,
1105 VK_ACCESS_MEMORY_READ_BIT = 0x00008000,
1106 VK_ACCESS_MEMORY_WRITE_BIT = 0x00010000,
Jesse Halleb02c472017-02-24 15:13:45 -08001107
1108 //@extension("VK_NVX_device_generated_commands")
1109 VK_ACCESS_COMMAND_PROCESS_READ_BIT_NVX = 0x00020000,
1110 VK_ACCESS_COMMAND_PROCESS_WRITE_BIT_NVX = 0x00040000,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001111}
1112
1113/// Buffer usage flags
Jesse Halld8bade02015-11-24 10:24:18 -08001114type VkFlags VkBufferUsageFlags
1115bitfield VkBufferUsageFlagBits {
Jesse Hall3fbc8562015-11-29 22:10:52 -08001116 VK_BUFFER_USAGE_TRANSFER_SRC_BIT = 0x00000001, /// Can be used as a source of transfer operations
1117 VK_BUFFER_USAGE_TRANSFER_DST_BIT = 0x00000002, /// Can be used as a destination of transfer operations
Jesse Halld27f6aa2015-08-15 17:58:48 -07001118 VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000004, /// Can be used as TBO
1119 VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT = 0x00000008, /// Can be used as IBO
1120 VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT = 0x00000010, /// Can be used as UBO
1121 VK_BUFFER_USAGE_STORAGE_BUFFER_BIT = 0x00000020, /// Can be used as SSBO
1122 VK_BUFFER_USAGE_INDEX_BUFFER_BIT = 0x00000040, /// Can be used as source of fixed function index fetch (index buffer)
1123 VK_BUFFER_USAGE_VERTEX_BUFFER_BIT = 0x00000080, /// Can be used as source of fixed function vertex fetch (VBO)
1124 VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT = 0x00000100, /// Can be the source of indirect parameters (e.g. indirect buffer, parameter buffer)
1125}
1126
1127/// Buffer creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001128type VkFlags VkBufferCreateFlags
1129bitfield VkBufferCreateFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001130 VK_BUFFER_CREATE_SPARSE_BINDING_BIT = 0x00000001, /// Buffer should support sparse backing
Jesse Halld27f6aa2015-08-15 17:58:48 -07001131 VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002, /// Buffer should support sparse backing with partial residency
1132 VK_BUFFER_CREATE_SPARSE_ALIASED_BIT = 0x00000004, /// Buffer should support constent data access to physical memory blocks mapped into multiple locations of sparse buffers
1133}
1134
1135/// Shader stage flags
Jesse Halld8bade02015-11-24 10:24:18 -08001136type VkFlags VkShaderStageFlags
1137bitfield VkShaderStageFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001138 VK_SHADER_STAGE_VERTEX_BIT = 0x00000001,
Jesse Hallae38f732015-11-19 21:32:50 -08001139 VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT = 0x00000002,
1140 VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001141 VK_SHADER_STAGE_GEOMETRY_BIT = 0x00000008,
1142 VK_SHADER_STAGE_FRAGMENT_BIT = 0x00000010,
1143 VK_SHADER_STAGE_COMPUTE_BIT = 0x00000020,
Jesse Hallc7467b72015-11-29 21:05:26 -08001144 VK_SHADER_STAGE_ALL_GRAPHICS = 0x0000001F,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001145
1146 VK_SHADER_STAGE_ALL = 0x7FFFFFFF,
1147}
1148
Jesse Hallfbf97b02015-11-20 14:17:03 -08001149/// Descriptor pool create flags
Jesse Halld8bade02015-11-24 10:24:18 -08001150type VkFlags VkDescriptorPoolCreateFlags
1151bitfield VkDescriptorPoolCreateFlagBits {
Jesse Hallfbf97b02015-11-20 14:17:03 -08001152 VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT = 0x00000001,
1153}
1154
1155/// Descriptor pool reset flags
Jesse Halld8bade02015-11-24 10:24:18 -08001156type VkFlags VkDescriptorPoolResetFlags
Jesse Halla6429252015-11-29 18:59:42 -08001157//bitfield VkDescriptorPoolResetFlagBits {
1158//}
Jesse Hallfbf97b02015-11-20 14:17:03 -08001159
Jesse Halld27f6aa2015-08-15 17:58:48 -07001160/// Image usage flags
Jesse Halld8bade02015-11-24 10:24:18 -08001161type VkFlags VkImageUsageFlags
1162bitfield VkImageUsageFlagBits {
Jesse Hall3fbc8562015-11-29 22:10:52 -08001163 VK_IMAGE_USAGE_TRANSFER_SRC_BIT = 0x00000001, /// Can be used as a source of transfer operations
1164 VK_IMAGE_USAGE_TRANSFER_DST_BIT = 0x00000002, /// Can be used as a destination of transfer operations
Jesse Halld27f6aa2015-08-15 17:58:48 -07001165 VK_IMAGE_USAGE_SAMPLED_BIT = 0x00000004, /// Can be sampled from (SAMPLED_IMAGE and COMBINED_IMAGE_SAMPLER descriptor types)
1166 VK_IMAGE_USAGE_STORAGE_BIT = 0x00000008, /// Can be used as storage image (STORAGE_IMAGE descriptor type)
1167 VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT = 0x00000010, /// Can be used as framebuffer color attachment
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001168 VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000020, /// Can be used as framebuffer depth/stencil attachment
Jesse Halld27f6aa2015-08-15 17:58:48 -07001169 VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT = 0x00000040, /// Image data not needed outside of rendering
1170 VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT = 0x00000080, /// Can be used as framebuffer input attachment
1171}
1172
1173/// Image creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001174type VkFlags VkImageCreateFlags
1175bitfield VkImageCreateFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001176 VK_IMAGE_CREATE_SPARSE_BINDING_BIT = 0x00000001, /// Image should support sparse backing
Jesse Halld27f6aa2015-08-15 17:58:48 -07001177 VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002, /// Image should support sparse backing with partial residency
1178 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 -07001179 VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT = 0x00000008, /// Allows image views to have different format than the base image
1180 VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT = 0x00000010, /// Allows creating image views with cube type from the created image
Jesse Hall08e2f482017-03-06 15:22:17 -08001181
1182 //@extension("VK_KHR_maintenance1")
1183 VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT_KHR = 0x00000020,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001184}
1185
Jesse Hallb00daad2015-11-29 19:46:20 -08001186/// Image view creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001187type VkFlags VkImageViewCreateFlags
Jesse Hallb00daad2015-11-29 19:46:20 -08001188//bitfield VkImageViewCreateFlagBits {
1189//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001190
1191/// Pipeline creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001192type VkFlags VkPipelineCreateFlags
1193bitfield VkPipelineCreateFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001194 VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT = 0x00000001,
1195 VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT = 0x00000002,
1196 VK_PIPELINE_CREATE_DERIVATIVE_BIT = 0x00000004,
1197}
1198
Jesse Hall65ab5522015-11-30 00:07:16 -08001199/// Color component flags
1200type VkFlags VkColorComponentFlags
1201bitfield VkColorComponentFlagBits {
1202 VK_COLOR_COMPONENT_R_BIT = 0x00000001,
1203 VK_COLOR_COMPONENT_G_BIT = 0x00000002,
1204 VK_COLOR_COMPONENT_B_BIT = 0x00000004,
1205 VK_COLOR_COMPONENT_A_BIT = 0x00000008,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001206}
1207
1208/// Fence creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001209type VkFlags VkFenceCreateFlags
1210bitfield VkFenceCreateFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001211 VK_FENCE_CREATE_SIGNALED_BIT = 0x00000001,
1212}
1213
1214/// Semaphore creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001215type VkFlags VkSemaphoreCreateFlags
Jesse Halla6429252015-11-29 18:59:42 -08001216//bitfield VkSemaphoreCreateFlagBits {
1217//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001218
1219/// Format capability flags
Jesse Halld8bade02015-11-24 10:24:18 -08001220type VkFlags VkFormatFeatureFlags
1221bitfield VkFormatFeatureFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001222 VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT = 0x00000001, /// Format can be used for sampled images (SAMPLED_IMAGE and COMBINED_IMAGE_SAMPLER descriptor types)
1223 VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT = 0x00000002, /// Format can be used for storage images (STORAGE_IMAGE descriptor type)
1224 VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT = 0x00000004, /// Format supports atomic operations in case it's used for storage images
1225 VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000008, /// Format can be used for uniform texel buffers (TBOs)
1226 VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT = 0x00000010, /// Format can be used for storage texel buffers (IBOs)
1227 VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT = 0x00000020, /// Format supports atomic operations in case it's used for storage texel buffers
1228 VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT = 0x00000040, /// Format can be used for vertex buffers (VBOs)
1229 VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT = 0x00000080, /// Format can be used for color attachment images
1230 VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT = 0x00000100, /// Format supports blending in case it's used for color attachment images
1231 VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000200, /// Format can be used for depth/stencil attachment images
Jesse Hall3fbc8562015-11-29 22:10:52 -08001232 VK_FORMAT_FEATURE_BLIT_SRC_BIT = 0x00000400, /// Format can be used as the source image of blits with vkCommandBlitImage
1233 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 -08001234 VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT = 0x00001000,
Jesse Hall26763382016-05-20 07:13:52 -07001235
1236 //@extension("VK_IMG_filter_cubic")
1237 VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG = 0x00002000,
Jesse Hall08e2f482017-03-06 15:22:17 -08001238
1239 //@extension("VK_KHR_maintenance1")
1240 VK_FORMAT_FEATURE_TRANSFER_SRC_BIT_KHR = 0x00004000,
1241 VK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR = 0x00008000,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001242}
1243
1244/// Query control flags
Jesse Halld8bade02015-11-24 10:24:18 -08001245type VkFlags VkQueryControlFlags
1246bitfield VkQueryControlFlagBits {
Jesse Hall65ab5522015-11-30 00:07:16 -08001247 VK_QUERY_CONTROL_PRECISE_BIT = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001248}
1249
1250/// Query result flags
Jesse Halld8bade02015-11-24 10:24:18 -08001251type VkFlags VkQueryResultFlags
1252bitfield VkQueryResultFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001253 VK_QUERY_RESULT_64_BIT = 0x00000001, /// Results of the queries are written to the destination buffer as 64-bit values
1254 VK_QUERY_RESULT_WAIT_BIT = 0x00000002, /// Results of the queries are waited on before proceeding with the result copy
1255 VK_QUERY_RESULT_WITH_AVAILABILITY_BIT = 0x00000004, /// Besides the results of the query, the availability of the results is also written
1256 VK_QUERY_RESULT_PARTIAL_BIT = 0x00000008, /// Copy the partial results of the query even if the final results aren't available
1257}
1258
1259/// Shader module creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001260type VkFlags VkShaderModuleCreateFlags
Jesse Halla6429252015-11-29 18:59:42 -08001261//bitfield VkShaderModuleCreateFlagBits {
1262//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001263
Jesse Halld27f6aa2015-08-15 17:58:48 -07001264/// Event creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001265type VkFlags VkEventCreateFlags
Jesse Halla6429252015-11-29 18:59:42 -08001266//bitfield VkEventCreateFlagBits {
1267//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001268
Jesse Halla15a4bf2015-11-19 22:48:02 -08001269/// Command buffer usage flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001270type VkFlags VkCommandBufferUsageFlags
1271bitfield VkCommandBufferUsageFlagBits {
1272 VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT = 0x00000001,
1273 VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT = 0x00000002,
1274 VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001275}
1276
1277/// Pipeline statistics flags
Jesse Halld8bade02015-11-24 10:24:18 -08001278type VkFlags VkQueryPipelineStatisticFlags
1279bitfield VkQueryPipelineStatisticFlagBits {
Jesse Hallae38f732015-11-19 21:32:50 -08001280 VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_BIT = 0x00000001, /// Optional
1281 VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_PRIMITIVES_BIT = 0x00000002, /// Optional
1282 VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT = 0x00000004, /// Optional
1283 VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_INVOCATIONS_BIT = 0x00000008, /// Optional
1284 VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT = 0x00000010, /// Optional
1285 VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT = 0x00000020, /// Optional
1286 VK_QUERY_PIPELINE_STATISTIC_CLIPPING_PRIMITIVES_BIT = 0x00000040, /// Optional
1287 VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT = 0x00000080, /// Optional
1288 VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT = 0x00000100, /// Optional
1289 VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT = 0x00000200, /// Optional
1290 VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT = 0x00000400, /// Optional
Jesse Halld27f6aa2015-08-15 17:58:48 -07001291}
1292
1293/// Memory mapping flags
Jesse Halld8bade02015-11-24 10:24:18 -08001294type VkFlags VkMemoryMapFlags
Jesse Halla6429252015-11-29 18:59:42 -08001295//bitfield VkMemoryMapFlagBits {
1296//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001297
1298/// Bitfield of image aspects
Jesse Halld8bade02015-11-24 10:24:18 -08001299type VkFlags VkImageAspectFlags
1300bitfield VkImageAspectFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001301 VK_IMAGE_ASPECT_COLOR_BIT = 0x00000001,
1302 VK_IMAGE_ASPECT_DEPTH_BIT = 0x00000002,
1303 VK_IMAGE_ASPECT_STENCIL_BIT = 0x00000004,
1304 VK_IMAGE_ASPECT_METADATA_BIT = 0x00000008,
1305}
1306
1307/// Sparse memory bind flags
Jesse Halld8bade02015-11-24 10:24:18 -08001308type VkFlags VkSparseMemoryBindFlags
Jesse Hall091ed9e2015-11-30 00:55:29 -08001309bitfield VkSparseMemoryBindFlagBits {
1310 VK_SPARSE_MEMORY_BIND_METADATA_BIT = 0x00000001,
1311}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001312
1313/// Sparse image memory requirements flags
Jesse Halld8bade02015-11-24 10:24:18 -08001314type VkFlags VkSparseImageFormatFlags
1315bitfield VkSparseImageFormatFlagBits {
Jesse Hallb00daad2015-11-29 19:46:20 -08001316 VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT = 0x00000001, /// Image uses a single miptail region for all array slices
1317 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.
1318 VK_SPARSE_IMAGE_FORMAT_NONSTANDARD_BLOCK_SIZE_BIT = 0x00000004, /// Image uses a non-standard sparse block size
Jesse Halld27f6aa2015-08-15 17:58:48 -07001319}
1320
1321/// Pipeline stages
Jesse Halld8bade02015-11-24 10:24:18 -08001322type VkFlags VkPipelineStageFlags
1323bitfield VkPipelineStageFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001324 VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT = 0x00000001, /// Before subsequent commands are processed
1325 VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT = 0x00000002, /// Draw/DispatchIndirect command fetch
1326 VK_PIPELINE_STAGE_VERTEX_INPUT_BIT = 0x00000004, /// Vertex/index fetch
1327 VK_PIPELINE_STAGE_VERTEX_SHADER_BIT = 0x00000008, /// Vertex shading
Jesse Hallae38f732015-11-19 21:32:50 -08001328 VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT = 0x00000010, /// Tessellation control shading
1329 VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT = 0x00000020, /// Tessellation evaluation shading
Jesse Halld27f6aa2015-08-15 17:58:48 -07001330 VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT = 0x00000040, /// Geometry shading
1331 VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT = 0x00000080, /// Fragment shading
1332 VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT = 0x00000100, /// Early fragment (depth/stencil) tests
1333 VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT = 0x00000200, /// Late fragment (depth/stencil) tests
1334 VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT = 0x00000400, /// Color attachment writes
1335 VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT = 0x00000800, /// Compute shading
1336 VK_PIPELINE_STAGE_TRANSFER_BIT = 0x00001000, /// Transfer/copy operations
Jesse Hall543a7ff2016-01-08 16:38:30 -08001337 VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT = 0x00002000,
1338 VK_PIPELINE_STAGE_HOST_BIT = 0x00004000, /// Indicates host (CPU) is a source/sink of the dependency
Jesse Halld27f6aa2015-08-15 17:58:48 -07001339
Jesse Hall543a7ff2016-01-08 16:38:30 -08001340 VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT = 0x00008000, /// All stages of the graphics pipeline
1341 VK_PIPELINE_STAGE_ALL_COMMANDS_BIT = 0x00010000, /// All graphics, compute, copy, and transition commands
Jesse Halleb02c472017-02-24 15:13:45 -08001342
1343 //@extension("VK_NVX_device_generated_commands")
1344 VK_PIPELINE_STAGE_COMMAND_PROCESS_BIT_NVX = 0x00020000,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001345}
1346
1347/// Render pass attachment description flags
Jesse Halld8bade02015-11-24 10:24:18 -08001348type VkFlags VkAttachmentDescriptionFlags
1349bitfield VkAttachmentDescriptionFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001350 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 -07001351}
1352
1353/// Subpass description flags
Jesse Halld8bade02015-11-24 10:24:18 -08001354type VkFlags VkSubpassDescriptionFlags
1355bitfield VkSubpassDescriptionFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001356}
1357
1358/// Command pool creation flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001359type VkFlags VkCommandPoolCreateFlags
1360bitfield VkCommandPoolCreateFlagBits {
1361 VK_COMMAND_POOL_CREATE_TRANSIENT_BIT = 0x00000001, /// Command buffers have a short lifetime
1362 VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT = 0x00000002, /// Command buffers may release their memory individually
Jesse Halld27f6aa2015-08-15 17:58:48 -07001363}
1364
1365/// Command pool reset flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001366type VkFlags VkCommandPoolResetFlags
1367bitfield VkCommandPoolResetFlagBits {
1368 VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT = 0x00000001, /// Release resources owned by the pool
Jesse Halld27f6aa2015-08-15 17:58:48 -07001369}
1370
Jesse Hall3fbc8562015-11-29 22:10:52 -08001371type VkFlags VkCommandBufferResetFlags
1372bitfield VkCommandBufferResetFlagBits {
1373 VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT = 0x00000001, /// Release resources owned by the buffer
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001374}
1375
Jesse Halld8bade02015-11-24 10:24:18 -08001376type VkFlags VkSampleCountFlags
1377bitfield VkSampleCountFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001378 VK_SAMPLE_COUNT_1_BIT = 0x00000001,
1379 VK_SAMPLE_COUNT_2_BIT = 0x00000002,
1380 VK_SAMPLE_COUNT_4_BIT = 0x00000004,
1381 VK_SAMPLE_COUNT_8_BIT = 0x00000008,
1382 VK_SAMPLE_COUNT_16_BIT = 0x00000010,
1383 VK_SAMPLE_COUNT_32_BIT = 0x00000020,
1384 VK_SAMPLE_COUNT_64_BIT = 0x00000040,
1385}
1386
Jesse Halld8bade02015-11-24 10:24:18 -08001387type VkFlags VkStencilFaceFlags
1388bitfield VkStencilFaceFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001389 VK_STENCIL_FACE_FRONT_BIT = 0x00000001, /// Front face
1390 VK_STENCIL_FACE_BACK_BIT = 0x00000002, /// Back face
Jesse Hallc7467b72015-11-29 21:05:26 -08001391 VK_STENCIL_FRONT_AND_BACK = 0x00000003,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001392}
1393
Jesse Halla6429252015-11-29 18:59:42 -08001394/// Instance creation flags
1395type VkFlags VkInstanceCreateFlags
1396//bitfield VkInstanceCreateFlagBits {
1397//}
1398
1399/// Device creation flags
1400type VkFlags VkDeviceCreateFlags
1401//bitfield VkDeviceCreateFlagBits {
1402//}
1403
1404/// Device queue creation flags
1405type VkFlags VkDeviceQueueCreateFlags
1406//bitfield VkDeviceQueueCreateFlagBits {
1407//}
1408
1409/// Query pool creation flags
1410type VkFlags VkQueryPoolCreateFlags
1411//bitfield VkQueryPoolCreateFlagBits {
1412//}
1413
1414/// Buffer view creation flags
1415type VkFlags VkBufferViewCreateFlags
1416//bitfield VkBufferViewCreateFlagBits {
1417//}
1418
1419/// Pipeline cache creation flags
1420type VkFlags VkPipelineCacheCreateFlags
1421//bitfield VkPipelineCacheCreateFlagBits {
1422//}
1423
1424/// Pipeline shader stage creation flags
1425type VkFlags VkPipelineShaderStageCreateFlags
1426//bitfield VkPipelineShaderStageCreateFlagBits {
1427//}
1428
1429/// Descriptor set layout creation flags
1430type VkFlags VkDescriptorSetLayoutCreateFlags
1431//bitfield VkDescriptorSetLayoutCreateFlagBits {
1432//}
1433
1434/// Pipeline vertex input state creation flags
1435type VkFlags VkPipelineVertexInputStateCreateFlags
1436//bitfield VkPipelineVertexInputStateCreateFlagBits {
1437//}
1438
1439/// Pipeline input assembly state creation flags
1440type VkFlags VkPipelineInputAssemblyStateCreateFlags
1441//bitfield VkPipelineInputAssemblyStateCreateFlagBits {
1442//}
1443
1444/// Tessellation state creation flags
1445type VkFlags VkPipelineTessellationStateCreateFlags
1446//bitfield VkPipelineTessellationStateCreateFlagBits {
1447//}
1448
1449/// Viewport state creation flags
1450type VkFlags VkPipelineViewportStateCreateFlags
1451//bitfield VkPipelineViewportStateCreateFlagBits {
1452//}
1453
Jesse Hall3fbc8562015-11-29 22:10:52 -08001454/// Rasterization state creation flags
1455type VkFlags VkPipelineRasterizationStateCreateFlags
1456//bitfield VkPipelineRasterizationStateCreateFlagBits {
Jesse Halla6429252015-11-29 18:59:42 -08001457//}
1458
1459/// Multisample state creation flags
1460type VkFlags VkPipelineMultisampleStateCreateFlags
1461//bitfield VkPipelineMultisampleStateCreateFlagBits {
1462//}
1463
1464/// Color blend state creation flags
1465type VkFlags VkPipelineColorBlendStateCreateFlags
1466//bitfield VkPipelineColorBlendStateCreateFlagBits {
1467//}
1468
1469/// Depth/stencil state creation flags
1470type VkFlags VkPipelineDepthStencilStateCreateFlags
1471//bitfield VkPipelineDepthStencilStateCreateFlagBits {
1472//}
1473
1474/// Dynamic state creation flags
1475type VkFlags VkPipelineDynamicStateCreateFlags
1476//bitfield VkPipelineDynamicStateCreateFlagBits {
1477//}
1478
1479/// Pipeline layout creation flags
1480type VkFlags VkPipelineLayoutCreateFlags
1481//bitfield VkPipelineLayoutCreateFlagBits {
1482//}
1483
1484/// Sampler creation flags
1485type VkFlags VkSamplerCreateFlags
1486//bitfield VkSamplerCreateFlagBits {
1487//}
1488
1489/// Render pass creation flags
1490type VkFlags VkRenderPassCreateFlags
1491//bitfield VkRenderPassCreateFlagBits {
1492//}
1493
1494/// Framebuffer creation flags
1495type VkFlags VkFramebufferCreateFlags
1496//bitfield VkFramebufferCreateFlagBits {
1497//}
1498
Jesse Halldc6d36c2015-11-29 19:12:15 -08001499/// Dependency flags
1500type VkFlags VkDependencyFlags
1501bitfield VkDependencyFlagBits {
1502 VK_DEPENDENCY_BY_REGION_BIT = 0x00000001,
1503}
1504
Jesse Hallc7467b72015-11-29 21:05:26 -08001505/// Cull mode flags
1506type VkFlags VkCullModeFlags
1507bitfield VkCullModeFlagBits {
1508 VK_CULL_MODE_NONE = 0x00000000,
1509 VK_CULL_MODE_FRONT_BIT = 0x00000001,
1510 VK_CULL_MODE_BACK_BIT = 0x00000002,
1511 VK_CULL_MODE_FRONT_AND_BACK = 0x00000003,
1512}
1513
Jesse Hall523db342015-11-30 21:12:55 -08001514@extension("VK_KHR_surface")
Jesse Halld8bade02015-11-24 10:24:18 -08001515type VkFlags VkSurfaceTransformFlagsKHR
Jesse Hall523db342015-11-30 21:12:55 -08001516@extension("VK_KHR_surface")
Jesse Halld8bade02015-11-24 10:24:18 -08001517bitfield VkSurfaceTransformFlagBitsKHR {
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001518 VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR = 0x00000001,
Jesse Hall9ba8bc82015-11-30 16:22:16 -08001519 VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR = 0x00000002,
1520 VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR = 0x00000004,
1521 VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR = 0x00000008,
1522 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR = 0x00000010,
1523 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR = 0x00000020,
1524 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR = 0x00000040,
1525 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR = 0x00000080,
1526 VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR = 0x00000100,
Michael Lentine88594d72015-11-12 12:49:45 -08001527}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001528
Jesse Hall523db342015-11-30 21:12:55 -08001529@extension("VK_KHR_surface")
Jesse Halla6429252015-11-29 18:59:42 -08001530type VkFlags VkCompositeAlphaFlagsKHR
Jesse Hall523db342015-11-30 21:12:55 -08001531@extension("VK_KHR_surface")
Jesse Halla6429252015-11-29 18:59:42 -08001532bitfield VkCompositeAlphaFlagBitsKHR {
1533 VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR = 0x00000001,
1534 VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR = 0x00000002,
1535 VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR = 0x00000004,
1536 VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR = 0x00000008,
1537}
1538
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001539@extension("VK_KHR_swapchain")
1540type VkFlags VkSwapchainCreateFlagsKHR
1541//@extension("VK_KHR_swapchain")
1542//bitfield VkSwapchainCreateFlagBitsKHR {
1543//}
1544
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001545@extension("VK_KHR_display")
Jesse Halld8bade02015-11-24 10:24:18 -08001546type VkFlags VkDisplayPlaneAlphaFlagsKHR
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001547@extension("VK_KHR_display")
Jesse Halld8bade02015-11-24 10:24:18 -08001548bitfield VkDisplayPlaneAlphaFlagBitsKHR {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001549 VK_DISPLAY_PLANE_ALPHA_OPAQUE_BIT_KHR = 0x00000001,
1550 VK_DISPLAY_PLANE_ALPHA_GLOBAL_BIT_KHR = 0x00000002,
1551 VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_BIT_KHR = 0x00000004,
1552 VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_PREMULTIPLIED_BIT_KHR = 0x00000008,
Jesse Hall1356b0d2015-11-23 17:24:58 -08001553}
1554
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001555@extension("VK_KHR_display")
1556type VkFlags VkDisplaySurfaceCreateFlagsKHR
1557//@extension("VK_KHR_display")
1558//bitfield VkDisplaySurfaceCreateFlagBitsKHR {
1559//}
1560
Jesse Hall9ba8bc82015-11-30 16:22:16 -08001561@extension("VK_KHR_display")
1562type VkFlags VkDisplayModeCreateFlagsKHR
1563//@extension("VK_KHR_display")
1564//bitfield VkDisplayModeCreateFlagBitsKHR {
1565//}
1566
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001567@extension("VK_KHR_xlib_surface")
1568type VkFlags VkXlibSurfaceCreateFlagsKHR
1569//@extension("VK_KHR_xlib_surface")
1570//bitfield VkXlibSurfaceCreateFlagBitsKHR {
1571//}
1572
1573@extension("VK_KHR_xcb_surface")
1574type VkFlags VkXcbSurfaceCreateFlagsKHR
1575//@extension("VK_KHR_xcb_surface")
1576//bitfield VkXcbSurfaceCreateFlagBitsKHR {
1577//}
1578
1579@extension("VK_KHR_wayland_surface")
1580type VkFlags VkWaylandSurfaceCreateFlagsKHR
1581//@extension("VK_KHR_wayland_surface")
1582//bitfield VkWaylandSurfaceCreateFlagBitsKHR {
1583//}
1584
1585@extension("VK_KHR_mir_surface")
1586type VkFlags VkMirSurfaceCreateFlagsKHR
1587//@extension("VK_KHR_mir_surface")
1588//bitfield VkMirSurfaceCreateFlagBitsKHR {
1589//}
1590
1591@extension("VK_KHR_android_surface")
1592type VkFlags VkAndroidSurfaceCreateFlagsKHR
1593//@extension("VK_KHR_android_surface")
1594//bitfield VkAndroidSurfaceCreateFlagBitsKHR {
1595//}
1596
1597@extension("VK_KHR_win32_surface")
1598type VkFlags VkWin32SurfaceCreateFlagsKHR
1599//@extension("VK_KHR_win32_surface")
1600//bitfield VkWin32SurfaceCreateFlagBitsKHR {
1601//}
1602
Jesse Hall715b86a2016-01-16 16:34:29 -08001603@extension("VK_EXT_debug_report")
1604type VkFlags VkDebugReportFlagsEXT
1605@extension("VK_EXT_debug_report")
1606bitfield VkDebugReportFlagBitsEXT {
Jesse Halle2948d82016-02-25 04:19:32 -08001607 VK_DEBUG_REPORT_INFORMATION_BIT_EXT = 0x00000001,
1608 VK_DEBUG_REPORT_WARNING_BIT_EXT = 0x00000002,
1609 VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT = 0x00000004,
Jesse Hall715b86a2016-01-16 16:34:29 -08001610 VK_DEBUG_REPORT_ERROR_BIT_EXT = 0x00000008,
1611 VK_DEBUG_REPORT_DEBUG_BIT_EXT = 0x00000010,
1612}
1613
Jesse Halleb02c472017-02-24 15:13:45 -08001614@extension("VK_NV_external_memory_capabilities")
1615type VkFlags VkExternalMemoryHandleTypeFlagsNV
1616@extension("VK_NV_external_memory_capabilities")
1617bitfield VkExternalMemoryHandleTypeFlagBitsNV {
1618 VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_NV = 0x00000001,
1619 VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_NV = 0x00000002,
1620 VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_IMAGE_BIT_NV = 0x00000004,
1621 VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_IMAGE_KMT_BIT_NV = 0x00000008,
1622}
1623
1624@extension("VK_NV_external_memory_capabilities")
1625type VkFlags VkExternalMemoryFeatureFlagsNV
1626@extension("VK_NV_external_memory_capabilities")
1627bitfield VkExternalMemoryFeatureFlagBitsNV {
1628 VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT_NV = 0x00000001,
1629 VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT_NV = 0x00000002,
1630 VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT_NV = 0x00000004,
1631}
1632
Jesse Hall08e2f482017-03-06 15:22:17 -08001633@extension("VK_NN_vi_surface")
1634type VkFlags VkViSurfaceCreateFlagsNN
1635//@extension("VK_NN_vi_surface")
1636//bitfield VkViSurfaceCreateFlagBitsNN {
1637//}
1638
1639@extension("VK_KHR_maintenance1")
1640type VkFlags VkCommandPoolTrimFlagsKHR
1641//@extension("VK_KHR_maintenance1")
1642//bitfield VkCommandPoolTrimFlagBitsKHR {
1643//}
1644
Jesse Halleb02c472017-02-24 15:13:45 -08001645@extension("VK_NVX_device_generated_commands")
1646type VkFlags VkIndirectCommandsLayoutUsageFlagsNVX
1647@extension("VK_NVX_device_generated_commands")
1648bitfield VkIndirectCommandsLayoutUsageFlagBitsNVX {
1649 VK_INDIRECT_COMMANDS_LAYOUT_USAGE_UNORDERED_SEQUENCES_BIT_NVX = 0x00000001,
1650 VK_INDIRECT_COMMANDS_LAYOUT_USAGE_SPARSE_SEQUENCES_BIT_NVX = 0x00000002,
1651 VK_INDIRECT_COMMANDS_LAYOUT_USAGE_EMPTY_EXECUTIONS_BIT_NVX = 0x00000004,
1652 VK_INDIRECT_COMMANDS_LAYOUT_USAGE_INDEXED_SEQUENCES_BIT_NVX = 0x00000008,
1653}
1654
1655@extension("VK_NVX_device_generated_commands")
1656type VkFlags VkObjectEntryUsageFlagsNVX
1657@extension("VK_NVX_device_generated_commands")
1658bitfield VkObjectEntryUsageFlagBitsNVX {
1659 VK_OBJECT_ENTRY_USAGE_GRAPHICS_BIT_NVX = 0x00000001,
1660 VK_OBJECT_ENTRY_USAGE_COMPUTE_BIT_NVX = 0x00000002,
1661}
1662
Jesse Hall08e2f482017-03-06 15:22:17 -08001663@extension("VK_EXT_display_surface_counter")
1664type VkFlags VkSurfaceCounterFlagsEXT
1665@extension("VK_EXT_display_surface_counter")
1666bitfield VkSurfaceCounterFlagBitsEXT {
1667 VK_SURFACE_COUNTER_VBLANK_EXT = 0x00000001,
1668}
Jesse Hall1356b0d2015-11-23 17:24:58 -08001669
Jesse Halld27f6aa2015-08-15 17:58:48 -07001670//////////////////
1671// Structures //
1672//////////////////
1673
1674class VkOffset2D {
1675 s32 x
1676 s32 y
1677}
1678
1679class VkOffset3D {
1680 s32 x
1681 s32 y
1682 s32 z
1683}
1684
1685class VkExtent2D {
Jesse Hall3dd678a2016-01-08 21:52:01 -08001686 u32 width
1687 u32 height
Jesse Halld27f6aa2015-08-15 17:58:48 -07001688}
1689
1690class VkExtent3D {
Jesse Hall3dd678a2016-01-08 21:52:01 -08001691 u32 width
1692 u32 height
1693 u32 depth
Jesse Halld27f6aa2015-08-15 17:58:48 -07001694}
1695
1696class VkViewport {
Jesse Hall65ab5522015-11-30 00:07:16 -08001697 f32 x
1698 f32 y
Jesse Halld27f6aa2015-08-15 17:58:48 -07001699 f32 width
1700 f32 height
1701 f32 minDepth
1702 f32 maxDepth
1703}
1704
1705class VkRect2D {
1706 VkOffset2D offset
1707 VkExtent2D extent
1708}
1709
Jesse Halla15a4bf2015-11-19 22:48:02 -08001710class VkClearRect {
1711 VkRect2D rect
1712 u32 baseArrayLayer
Jesse Hall3fbc8562015-11-29 22:10:52 -08001713 u32 layerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001714}
1715
Jesse Hall65ab5522015-11-30 00:07:16 -08001716class VkComponentMapping {
1717 VkComponentSwizzle r
1718 VkComponentSwizzle g
1719 VkComponentSwizzle b
1720 VkComponentSwizzle a
Jesse Halld27f6aa2015-08-15 17:58:48 -07001721}
1722
1723class VkPhysicalDeviceProperties {
1724 u32 apiVersion
1725 u32 driverVersion
Jesse Hall65ab5522015-11-30 00:07:16 -08001726 u32 vendorID
1727 u32 deviceID
Jesse Halld27f6aa2015-08-15 17:58:48 -07001728 VkPhysicalDeviceType deviceType
Jesse Hall65ab5522015-11-30 00:07:16 -08001729 char[VK_MAX_PHYSICAL_DEVICE_NAME_SIZE] deviceName
1730 u8[VK_UUID_SIZE] pipelineCacheUUID
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001731 VkPhysicalDeviceLimits limits
1732 VkPhysicalDeviceSparseProperties sparseProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07001733}
1734
1735class VkExtensionProperties {
Jesse Hall65ab5522015-11-30 00:07:16 -08001736 char[VK_MAX_EXTENSION_NAME_SIZE] extensionName /// extension name
Jesse Halld27f6aa2015-08-15 17:58:48 -07001737 u32 specVersion /// version of the extension specification implemented
1738}
1739
1740class VkLayerProperties {
Jesse Hall65ab5522015-11-30 00:07:16 -08001741 char[VK_MAX_EXTENSION_NAME_SIZE] layerName /// layer name
Jesse Hall3fbc8562015-11-29 22:10:52 -08001742 u32 specVersion /// version of the layer specification implemented
1743 u32 implementationVersion /// build or release version of the layer's library
Jesse Hall65ab5522015-11-30 00:07:16 -08001744 char[VK_MAX_DESCRIPTION_SIZE] description /// Free-form description of the layer
Jesse Halld27f6aa2015-08-15 17:58:48 -07001745}
1746
Jesse Halla366a512015-11-19 22:30:07 -08001747class VkSubmitInfo {
Jesse Hall03b6fe12015-11-24 12:44:21 -08001748 VkStructureType sType /// Type of structure. Should be VK_STRUCTURE_TYPE_SUBMIT_INFO
1749 const void* pNext /// Next structure in chain
1750 u32 waitSemaphoreCount
Jesse Halla366a512015-11-19 22:30:07 -08001751 const VkSemaphore* pWaitSemaphores
Jesse Hall543a7ff2016-01-08 16:38:30 -08001752 const VkPipelineStageFlags* pWaitDstStageMask
Jesse Hall03b6fe12015-11-24 12:44:21 -08001753 u32 commandBufferCount
Jesse Hall3fbc8562015-11-29 22:10:52 -08001754 const VkCommandBuffer* pCommandBuffers
Jesse Hall03b6fe12015-11-24 12:44:21 -08001755 u32 signalSemaphoreCount
Jesse Halla366a512015-11-19 22:30:07 -08001756 const VkSemaphore* pSignalSemaphores
1757}
1758
Jesse Halld27f6aa2015-08-15 17:58:48 -07001759class VkApplicationInfo {
1760 VkStructureType sType /// Type of structure. Should be VK_STRUCTURE_TYPE_APPLICATION_INFO
1761 const void* pNext /// Next structure in chain
Jesse Hall3fbc8562015-11-29 22:10:52 -08001762 const char* pApplicationName
1763 u32 applicationVersion
Jesse Halld27f6aa2015-08-15 17:58:48 -07001764 const char* pEngineName
1765 u32 engineVersion
1766 u32 apiVersion
1767}
1768
Jesse Hall3fbc8562015-11-29 22:10:52 -08001769class VkAllocationCallbacks {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001770 void* pUserData
Jesse Hall3fbc8562015-11-29 22:10:52 -08001771 PFN_vkAllocationFunction pfnAllocation
1772 PFN_vkReallocationFunction pfnReallocation
Jesse Halld27f6aa2015-08-15 17:58:48 -07001773 PFN_vkFreeFunction pfnFree
Jesse Hall3fbc8562015-11-29 22:10:52 -08001774 PFN_vkInternalAllocationNotification pfnInternalAllocation
Jesse Hall03b6fe12015-11-24 12:44:21 -08001775 PFN_vkInternalFreeNotification pfnInternalFree
Jesse Halld27f6aa2015-08-15 17:58:48 -07001776}
1777
1778class VkDeviceQueueCreateInfo {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001779 VkStructureType sStype /// Should be VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO
1780 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001781 VkDeviceQueueCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001782 u32 queueFamilyIndex
Jesse Halldba27f72015-11-30 14:25:46 -08001783 u32 queueCount
Jesse Hallfbf97b02015-11-20 14:17:03 -08001784 const f32* pQueuePriorities
Jesse Halld27f6aa2015-08-15 17:58:48 -07001785}
1786
1787class VkDeviceCreateInfo {
1788 VkStructureType sType /// Should be VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO
1789 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001790 VkDeviceCreateFlags flags
Jesse Halldba27f72015-11-30 14:25:46 -08001791 u32 queueCreateInfoCount
1792 const VkDeviceQueueCreateInfo* pQueueCreateInfos
Jesse Hall3dd678a2016-01-08 21:52:01 -08001793 u32 enabledLayerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001794 const char* const* ppEnabledLayerNames /// Ordered list of layer names to be enabled
Jesse Hall3dd678a2016-01-08 21:52:01 -08001795 u32 enabledExtensionCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001796 const char* const* ppEnabledExtensionNames
1797 const VkPhysicalDeviceFeatures* pEnabledFeatures
Jesse Halld27f6aa2015-08-15 17:58:48 -07001798}
1799
1800class VkInstanceCreateInfo {
1801 VkStructureType sType /// Should be VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO
1802 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001803 VkInstanceCreateFlags flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001804 const VkApplicationInfo* pApplicationInfo
Jesse Hall3dd678a2016-01-08 21:52:01 -08001805 u32 enabledLayerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001806 const char* const* ppEnabledLayerNames /// Ordered list of layer names to be enabled
Jesse Hall3dd678a2016-01-08 21:52:01 -08001807 u32 enabledExtensionCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001808 const char* const* ppEnabledExtensionNames /// Extension names to be enabled
1809}
1810
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001811class VkQueueFamilyProperties {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001812 VkQueueFlags queueFlags /// Queue flags
1813 u32 queueCount
Jesse Hallacfa5342015-11-19 21:51:33 -08001814 u32 timestampValidBits
Jesse Hall65ab5522015-11-30 00:07:16 -08001815 VkExtent3D minImageTransferGranularity
Jesse Halld27f6aa2015-08-15 17:58:48 -07001816}
1817
1818class VkPhysicalDeviceMemoryProperties {
1819 u32 memoryTypeCount
1820 VkMemoryType[VK_MAX_MEMORY_TYPES] memoryTypes
1821 u32 memoryHeapCount
1822 VkMemoryHeap[VK_MAX_MEMORY_HEAPS] memoryHeaps
1823}
1824
Jesse Hall3fbc8562015-11-29 22:10:52 -08001825class VkMemoryAllocateInfo {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001826 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07001827 const void* pNext /// Pointer to next structure
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001828 VkDeviceSize allocationSize /// Size of memory allocation
Jesse Halld27f6aa2015-08-15 17:58:48 -07001829 u32 memoryTypeIndex /// Index of the of the memory type to allocate from
1830}
1831
1832class VkMemoryRequirements {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001833 VkDeviceSize size /// Specified in bytes
1834 VkDeviceSize alignment /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001835 u32 memoryTypeBits /// Bitfield of the allowed memory type indices into memoryTypes[] for this object
1836}
1837
1838class VkSparseImageFormatProperties {
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001839 VkImageAspectFlagBits aspectMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001840 VkExtent3D imageGranularity
1841 VkSparseImageFormatFlags flags
1842}
1843
1844class VkSparseImageMemoryRequirements {
Jesse Hallb00daad2015-11-29 19:46:20 -08001845 VkSparseImageFormatProperties formatProperties
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001846 u32 imageMipTailFirstLod
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001847 VkDeviceSize imageMipTailSize /// Specified in bytes, must be a multiple of image block size / alignment
1848 VkDeviceSize imageMipTailOffset /// Specified in bytes, must be a multiple of image block size / alignment
1849 VkDeviceSize imageMipTailStride /// Specified in bytes, must be a multiple of image block size / alignment
Jesse Halld27f6aa2015-08-15 17:58:48 -07001850}
1851
1852class VkMemoryType {
1853 VkMemoryPropertyFlags propertyFlags /// Memory properties of this memory type
1854 u32 heapIndex /// Index of the memory heap allocations of this memory type are taken from
1855}
1856
1857class VkMemoryHeap {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001858 VkDeviceSize size /// Available memory in the heap
Jesse Halld27f6aa2015-08-15 17:58:48 -07001859 VkMemoryHeapFlags flags /// Flags for the heap
1860}
1861
1862class VkMappedMemoryRange {
1863 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE
1864 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08001865 VkDeviceMemory memory /// Mapped memory object
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001866 VkDeviceSize offset /// Offset within the mapped memory the range starts from
1867 VkDeviceSize size /// Size of the range within the mapped memory
Jesse Halld27f6aa2015-08-15 17:58:48 -07001868}
1869
1870class VkFormatProperties {
1871 VkFormatFeatureFlags linearTilingFeatures /// Format features in case of linear tiling
1872 VkFormatFeatureFlags optimalTilingFeatures /// Format features in case of optimal tiling
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001873 VkFormatFeatureFlags bufferFeatures /// Format features supported by buffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07001874}
1875
1876class VkImageFormatProperties {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001877 VkExtent3D maxExtent /// max image dimensions for this resource type
1878 u32 maxMipLevels /// max number of mipmap levels for this resource type
Jesse Halla15a4bf2015-11-19 22:48:02 -08001879 u32 maxArrayLayers /// max array layers for this resource type
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001880 VkSampleCountFlags sampleCounts /// supported sample counts for this resource type
1881 VkDeviceSize maxResourceSize /// max size (in bytes) of this resource type
1882}
1883
Jesse Halla15a4bf2015-11-19 22:48:02 -08001884class VkDescriptorImageInfo {
1885 VkSampler sampler
1886 VkImageView imageView
1887 VkImageLayout imageLayout
1888}
1889
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001890class VkDescriptorBufferInfo {
1891 VkBuffer buffer /// Buffer used for this descriptor when the descriptor is UNIFORM_BUFFER[_DYNAMIC]
1892 VkDeviceSize offset /// Base offset from buffer start in bytes to update in the descriptor set.
1893 VkDeviceSize range /// Size in bytes of the buffer resource for this descriptor update.
Jesse Halld27f6aa2015-08-15 17:58:48 -07001894}
1895
Jesse Halld27f6aa2015-08-15 17:58:48 -07001896class VkWriteDescriptorSet {
1897 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET
1898 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08001899 VkDescriptorSet dstSet /// Destination descriptor set
1900 u32 dstBinding /// Binding within the destination descriptor set to write
1901 u32 dstArrayElement /// Array element within the destination binding to write
Jesse Hall03b6fe12015-11-24 12:44:21 -08001902 u32 descriptorCount /// Number of descriptors to write (determines the size of the array pointed by <pDescriptors>)
Jesse Halld27f6aa2015-08-15 17:58:48 -07001903 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 -08001904 const VkDescriptorImageInfo* pImageInfo
1905 const VkDescriptorBufferInfo* pBufferInfo
1906 const VkBufferView* pTexelBufferView
Jesse Halld27f6aa2015-08-15 17:58:48 -07001907}
1908
1909class VkCopyDescriptorSet {
1910 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET
1911 const void* pNext /// Pointer to next structure
1912 VkDescriptorSet srcSet /// Source descriptor set
1913 u32 srcBinding /// Binding within the source descriptor set to copy from
1914 u32 srcArrayElement /// Array element within the source binding to copy from
Jesse Hall3fbc8562015-11-29 22:10:52 -08001915 VkDescriptorSet dstSet /// Destination descriptor set
1916 u32 dstBinding /// Binding within the destination descriptor set to copy to
1917 u32 dstArrayElement /// Array element within the destination binding to copy to
Jesse Hall03b6fe12015-11-24 12:44:21 -08001918 u32 descriptorCount /// Number of descriptors to copy
Jesse Halld27f6aa2015-08-15 17:58:48 -07001919}
1920
1921class VkBufferCreateInfo {
1922 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO
1923 const void* pNext /// Pointer to next structure.
Jesse Halla6429252015-11-29 18:59:42 -08001924 VkBufferCreateFlags flags /// Buffer creation flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001925 VkDeviceSize size /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001926 VkBufferUsageFlags usage /// Buffer usage flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001927 VkSharingMode sharingMode
Jesse Hall03b6fe12015-11-24 12:44:21 -08001928 u32 queueFamilyIndexCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001929 const u32* pQueueFamilyIndices
1930}
1931
1932class VkBufferViewCreateInfo {
1933 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO
1934 const void* pNext /// Pointer to next structure.
Jesse Halla6429252015-11-29 18:59:42 -08001935 VkBufferViewCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001936 VkBuffer buffer
Jesse Halld27f6aa2015-08-15 17:58:48 -07001937 VkFormat format /// Optionally specifies format of elements
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001938 VkDeviceSize offset /// Specified in bytes
1939 VkDeviceSize range /// View size specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001940}
1941
1942class VkImageSubresource {
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001943 VkImageAspectFlagBits aspectMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001944 u32 mipLevel
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001945 u32 arrayLayer
Jesse Halld27f6aa2015-08-15 17:58:48 -07001946}
1947
1948class VkImageSubresourceRange {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001949 VkImageAspectFlags aspectMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001950 u32 baseMipLevel
Jesse Hall3fbc8562015-11-29 22:10:52 -08001951 u32 levelCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001952 u32 baseArrayLayer
Jesse Hall3fbc8562015-11-29 22:10:52 -08001953 u32 layerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001954}
1955
1956class VkMemoryBarrier {
1957 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MEMORY_BARRIER
1958 const void* pNext /// Pointer to next structure.
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001959 VkAccessFlags srcAccessMask
1960 VkAccessFlags dstAccessMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001961}
1962
1963class VkBufferMemoryBarrier {
1964 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER
1965 const void* pNext /// Pointer to next structure.
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001966 VkAccessFlags srcAccessMask
1967 VkAccessFlags dstAccessMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001968 u32 srcQueueFamilyIndex /// Queue family to transition ownership from
Jesse Hall3fbc8562015-11-29 22:10:52 -08001969 u32 dstQueueFamilyIndex /// Queue family to transition ownership to
Jesse Halld27f6aa2015-08-15 17:58:48 -07001970 VkBuffer buffer /// Buffer to sync
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001971 VkDeviceSize offset /// Offset within the buffer to sync
1972 VkDeviceSize size /// Amount of bytes to sync
Jesse Halld27f6aa2015-08-15 17:58:48 -07001973}
1974
1975class VkImageMemoryBarrier {
1976 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER
1977 const void* pNext /// Pointer to next structure.
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001978 VkAccessFlags srcAccessMask
1979 VkAccessFlags dstAccessMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001980 VkImageLayout oldLayout /// Current layout of the image
1981 VkImageLayout newLayout /// New layout to transition the image to
1982 u32 srcQueueFamilyIndex /// Queue family to transition ownership from
Jesse Hall3fbc8562015-11-29 22:10:52 -08001983 u32 dstQueueFamilyIndex /// Queue family to transition ownership to
Jesse Halld27f6aa2015-08-15 17:58:48 -07001984 VkImage image /// Image to sync
1985 VkImageSubresourceRange subresourceRange /// Subresource range to sync
1986}
1987
1988class VkImageCreateInfo {
1989 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO
1990 const void* pNext /// Pointer to next structure.
Jesse Halla6429252015-11-29 18:59:42 -08001991 VkImageCreateFlags flags /// Image creation flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001992 VkImageType imageType
1993 VkFormat format
1994 VkExtent3D extent
1995 u32 mipLevels
Jesse Halla15a4bf2015-11-19 22:48:02 -08001996 u32 arrayLayers
Jesse Hall091ed9e2015-11-30 00:55:29 -08001997 VkSampleCountFlagBits samples
Jesse Halld27f6aa2015-08-15 17:58:48 -07001998 VkImageTiling tiling
1999 VkImageUsageFlags usage /// Image usage flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002000 VkSharingMode sharingMode /// Cross-queue-family sharing mode
Jesse Hall03b6fe12015-11-24 12:44:21 -08002001 u32 queueFamilyIndexCount /// Number of queue families to share across
Jesse Halld27f6aa2015-08-15 17:58:48 -07002002 const u32* pQueueFamilyIndices /// Array of queue family indices to share across
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002003 VkImageLayout initialLayout /// Initial image layout for all subresources
Jesse Halld27f6aa2015-08-15 17:58:48 -07002004}
2005
2006class VkSubresourceLayout {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002007 VkDeviceSize offset /// Specified in bytes
2008 VkDeviceSize size /// Specified in bytes
2009 VkDeviceSize rowPitch /// Specified in bytes
Jesse Hall543a7ff2016-01-08 16:38:30 -08002010 VkDeviceSize arrayPitch /// Specified in bytes
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002011 VkDeviceSize depthPitch /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002012}
2013
2014class VkImageViewCreateInfo {
2015 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO
2016 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002017 VkImageViewCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002018 VkImage image
2019 VkImageViewType viewType
2020 VkFormat format
Jesse Hall65ab5522015-11-30 00:07:16 -08002021 VkComponentMapping components
Jesse Halld27f6aa2015-08-15 17:58:48 -07002022 VkImageSubresourceRange subresourceRange
Jesse Halld27f6aa2015-08-15 17:58:48 -07002023}
2024
2025class VkBufferCopy {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002026 VkDeviceSize srcOffset /// Specified in bytes
Jesse Hall3fbc8562015-11-29 22:10:52 -08002027 VkDeviceSize dstOffset /// Specified in bytes
Jesse Hallb00daad2015-11-29 19:46:20 -08002028 VkDeviceSize size /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002029}
2030
Jesse Halla6429252015-11-29 18:59:42 -08002031class VkSparseMemoryBind {
Jesse Hallb00daad2015-11-29 19:46:20 -08002032 VkDeviceSize resourceOffset /// Specified in bytes
2033 VkDeviceSize size /// Specified in bytes
Jesse Hall3fbc8562015-11-29 22:10:52 -08002034 VkDeviceMemory memory
2035 VkDeviceSize memoryOffset /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002036 VkSparseMemoryBindFlags flags
2037}
2038
Jesse Halla6429252015-11-29 18:59:42 -08002039class VkSparseImageMemoryBind {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002040 VkImageSubresource subresource
2041 VkOffset3D offset
2042 VkExtent3D extent
Jesse Hall3fbc8562015-11-29 22:10:52 -08002043 VkDeviceMemory memory
2044 VkDeviceSize memoryOffset /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002045 VkSparseMemoryBindFlags flags
2046}
2047
Jesse Halla6429252015-11-29 18:59:42 -08002048class VkSparseBufferMemoryBindInfo {
2049 VkBuffer buffer
2050 u32 bindCount
2051 const VkSparseMemoryBind* pBinds
2052}
2053
2054class VkSparseImageOpaqueMemoryBindInfo {
2055 VkImage image
2056 u32 bindCount
2057 const VkSparseMemoryBind* pBinds
2058}
2059
2060class VkSparseImageMemoryBindInfo {
2061 VkImage image
2062 u32 bindCount
2063 const VkSparseMemoryBind* pBinds
2064}
2065
2066class VkBindSparseInfo {
2067 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BIND_SPARSE_INFO
2068 const void* pNext
2069 u32 waitSemaphoreCount
2070 const VkSemaphore* pWaitSemaphores
2071 u32 numBufferBinds
2072 const VkSparseBufferMemoryBindInfo* pBufferBinds
2073 u32 numImageOpaqueBinds
2074 const VkSparseImageOpaqueMemoryBindInfo* pImageOpaqueBinds
2075 u32 numImageBinds
2076 const VkSparseImageMemoryBindInfo* pImageBinds
2077 u32 signalSemaphoreCount
2078 const VkSemaphore* pSignalSemaphores
2079}
2080
Jesse Hall65ab5522015-11-30 00:07:16 -08002081class VkImageSubresourceLayers {
2082 VkImageAspectFlags aspectMask
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002083 u32 mipLevel
Jesse Halla15a4bf2015-11-19 22:48:02 -08002084 u32 baseArrayLayer
Jesse Hall3fbc8562015-11-29 22:10:52 -08002085 u32 layerCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002086}
2087
Jesse Halld27f6aa2015-08-15 17:58:48 -07002088class VkImageCopy {
Jesse Hall65ab5522015-11-30 00:07:16 -08002089 VkImageSubresourceLayers srcSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07002090 VkOffset3D srcOffset /// Specified in pixels for both compressed and uncompressed images
Jesse Hall65ab5522015-11-30 00:07:16 -08002091 VkImageSubresourceLayers dstSubresource
Jesse Hall3fbc8562015-11-29 22:10:52 -08002092 VkOffset3D dstOffset /// Specified in pixels for both compressed and uncompressed images
Jesse Halld27f6aa2015-08-15 17:58:48 -07002093 VkExtent3D extent /// Specified in pixels for both compressed and uncompressed images
2094}
2095
2096class VkImageBlit {
Jesse Hall65ab5522015-11-30 00:07:16 -08002097 VkImageSubresourceLayers srcSubresource
Jesse Hall3dd678a2016-01-08 21:52:01 -08002098 VkOffset3D[2] srcOffsets
Jesse Hall65ab5522015-11-30 00:07:16 -08002099 VkImageSubresourceLayers dstSubresource
Jesse Hall3dd678a2016-01-08 21:52:01 -08002100 VkOffset3D[2] dstOffsets
Jesse Halld27f6aa2015-08-15 17:58:48 -07002101}
2102
2103class VkBufferImageCopy {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002104 VkDeviceSize bufferOffset /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002105 u32 bufferRowLength /// Specified in texels
2106 u32 bufferImageHeight
Jesse Hall65ab5522015-11-30 00:07:16 -08002107 VkImageSubresourceLayers imageSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07002108 VkOffset3D imageOffset /// Specified in pixels for both compressed and uncompressed images
2109 VkExtent3D imageExtent /// Specified in pixels for both compressed and uncompressed images
2110}
2111
2112class VkImageResolve {
Jesse Hall65ab5522015-11-30 00:07:16 -08002113 VkImageSubresourceLayers srcSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07002114 VkOffset3D srcOffset
Jesse Hall65ab5522015-11-30 00:07:16 -08002115 VkImageSubresourceLayers dstSubresource
Jesse Hall3fbc8562015-11-29 22:10:52 -08002116 VkOffset3D dstOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07002117 VkExtent3D extent
2118}
2119
2120class VkShaderModuleCreateInfo {
2121 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO
2122 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002123 VkShaderModuleCreateFlags flags /// Reserved
Jesse Halld27f6aa2015-08-15 17:58:48 -07002124 platform.size_t codeSize /// Specified in bytes
Jesse Halla9bb62b2015-11-21 19:31:56 -08002125 const u32* pCode /// Binary code of size codeSize
Jesse Halld27f6aa2015-08-15 17:58:48 -07002126}
2127
Jesse Halld27f6aa2015-08-15 17:58:48 -07002128class VkDescriptorSetLayoutBinding {
Jesse Hall091ed9e2015-11-30 00:55:29 -08002129 u32 binding
Jesse Halld27f6aa2015-08-15 17:58:48 -07002130 VkDescriptorType descriptorType /// Type of the descriptors in this binding
Jesse Halldba27f72015-11-30 14:25:46 -08002131 u32 descriptorCount /// Number of descriptors in this binding
Jesse Halld27f6aa2015-08-15 17:58:48 -07002132 VkShaderStageFlags stageFlags /// Shader stages this binding is visible to
2133 const VkSampler* pImmutableSamplers /// Immutable samplers (used if descriptor type is SAMPLER or COMBINED_IMAGE_SAMPLER, is either NULL or contains <count> number of elements)
2134}
2135
2136class VkDescriptorSetLayoutCreateInfo {
2137 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO
2138 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002139 VkDescriptorSetLayoutCreateFlags flags
Jesse Hall03b6fe12015-11-24 12:44:21 -08002140 u32 bindingCount /// Number of bindings in the descriptor set layout
Jesse Hall543a7ff2016-01-08 16:38:30 -08002141 const VkDescriptorSetLayoutBinding* pBindings /// Array of descriptor set layout bindings
Jesse Halld27f6aa2015-08-15 17:58:48 -07002142}
2143
Jesse Hall65ab5522015-11-30 00:07:16 -08002144class VkDescriptorPoolSize {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002145 VkDescriptorType type
Jesse Hall03b6fe12015-11-24 12:44:21 -08002146 u32 descriptorCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002147}
2148
2149class VkDescriptorPoolCreateInfo {
2150 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO
2151 const void* pNext /// Pointer to next structure
Jesse Hallfbf97b02015-11-20 14:17:03 -08002152 VkDescriptorPoolCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002153 u32 maxSets
Jesse Hall65ab5522015-11-30 00:07:16 -08002154 u32 poolSizeCount
2155 const VkDescriptorPoolSize* pPoolSizes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002156}
2157
Jesse Hall3fbc8562015-11-29 22:10:52 -08002158class VkDescriptorSetAllocateInfo {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002159 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO
Jesse Hallfbf97b02015-11-20 14:17:03 -08002160 const void* pNext /// Pointer to next structure
2161 VkDescriptorPool descriptorPool
Jesse Hall03b6fe12015-11-24 12:44:21 -08002162 u32 setCount
Jesse Hallfbf97b02015-11-20 14:17:03 -08002163 const VkDescriptorSetLayout* pSetLayouts
2164}
2165
Jesse Halld27f6aa2015-08-15 17:58:48 -07002166class VkSpecializationMapEntry {
Jesse Hall65ab5522015-11-30 00:07:16 -08002167 u32 constantID /// The SpecConstant ID specified in the BIL
Jesse Halld27f6aa2015-08-15 17:58:48 -07002168 u32 offset /// Offset of the value in the data block
Jesse Hallb00daad2015-11-29 19:46:20 -08002169 platform.size_t size /// Size in bytes of the SpecConstant
Jesse Halld27f6aa2015-08-15 17:58:48 -07002170}
2171
2172class VkSpecializationInfo {
2173 u32 mapEntryCount /// Number of entries in the map
Jesse Hallb00daad2015-11-29 19:46:20 -08002174 const VkSpecializationMapEntry* pMapEntries /// Array of map entries
Jesse Halld27f6aa2015-08-15 17:58:48 -07002175 platform.size_t dataSize /// Size in bytes of pData
2176 const void* pData /// Pointer to SpecConstant data
2177}
2178
2179class VkPipelineShaderStageCreateInfo {
2180 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO
2181 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002182 VkPipelineShaderStageCreateFlags flags
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002183 VkShaderStageFlagBits stage
2184 VkShaderModule module
2185 const char* pName
Jesse Halld27f6aa2015-08-15 17:58:48 -07002186 const VkSpecializationInfo* pSpecializationInfo
2187}
2188
2189class VkComputePipelineCreateInfo {
2190 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO
2191 const void* pNext /// Pointer to next structure
Jesse Halld27f6aa2015-08-15 17:58:48 -07002192 VkPipelineCreateFlags flags /// Pipeline creation flags
Jesse Halla6429252015-11-29 18:59:42 -08002193 VkPipelineShaderStageCreateInfo stage
Jesse Halld27f6aa2015-08-15 17:58:48 -07002194 VkPipelineLayout layout /// Interface layout of the pipeline
2195 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
2196 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
2197}
2198
2199class VkVertexInputBindingDescription {
Jesse Hallb00daad2015-11-29 19:46:20 -08002200 u32 binding /// Vertex buffer binding id
2201 u32 stride /// Distance between vertices in bytes (0 = no advancement)
Jesse Hall65ab5522015-11-30 00:07:16 -08002202 VkVertexInputRate inputRate /// Rate at which binding is incremented
Jesse Halld27f6aa2015-08-15 17:58:48 -07002203}
2204
2205class VkVertexInputAttributeDescription {
Jesse Hallb00daad2015-11-29 19:46:20 -08002206 u32 location /// location of the shader vertex attrib
2207 u32 binding /// Vertex buffer binding id
2208 VkFormat format /// format of source data
2209 u32 offset /// Offset of first element in bytes from base of vertex
Jesse Halld27f6aa2015-08-15 17:58:48 -07002210}
2211
2212class VkPipelineVertexInputStateCreateInfo {
Jesse Hall03b6fe12015-11-24 12:44:21 -08002213 VkStructureType sType /// Should be VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO
2214 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002215 VkPipelineVertexInputStateCreateFlags flags
Jesse Hall03b6fe12015-11-24 12:44:21 -08002216 u32 vertexBindingDescriptionCount /// number of bindings
Jesse Halld27f6aa2015-08-15 17:58:48 -07002217 const VkVertexInputBindingDescription* pVertexBindingDescriptions
Jesse Hall03b6fe12015-11-24 12:44:21 -08002218 u32 vertexAttributeDescriptionCount /// number of attributes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002219 const VkVertexInputAttributeDescription* pVertexAttributeDescriptions
2220}
2221
2222class VkPipelineInputAssemblyStateCreateInfo {
2223 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO
2224 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002225 VkPipelineInputAssemblyStateCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002226 VkPrimitiveTopology topology
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002227 VkBool32 primitiveRestartEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002228}
2229
2230class VkPipelineTessellationStateCreateInfo {
2231 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO
2232 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002233 VkPipelineTessellationStateCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002234 u32 patchControlPoints
2235}
2236
2237class VkPipelineViewportStateCreateInfo {
2238 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO
2239 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002240 VkPipelineViewportStateCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002241 u32 viewportCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002242 const VkViewport* pViewports
2243 u32 scissorCount
2244 const VkRect2D* pScissors
Jesse Halld27f6aa2015-08-15 17:58:48 -07002245}
2246
Jesse Hall3fbc8562015-11-29 22:10:52 -08002247class VkPipelineRasterizationStateCreateInfo {
Jesse Hall65ab5522015-11-30 00:07:16 -08002248 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002249 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08002250 VkPipelineRasterizationStateCreateFlags flags
Jesse Hallae38f732015-11-19 21:32:50 -08002251 VkBool32 depthClampEnable
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002252 VkBool32 rasterizerDiscardEnable
Jesse Hall65ab5522015-11-30 00:07:16 -08002253 VkPolygonMode polygonMode /// optional (GL45)
Jesse Hallc7467b72015-11-29 21:05:26 -08002254 VkCullModeFlags cullMode
Jesse Halld27f6aa2015-08-15 17:58:48 -07002255 VkFrontFace frontFace
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002256 VkBool32 depthBiasEnable
Jesse Halla9bb62b2015-11-21 19:31:56 -08002257 f32 depthBiasConstantFactor
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002258 f32 depthBiasClamp
Jesse Halla9bb62b2015-11-21 19:31:56 -08002259 f32 depthBiasSlopeFactor
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002260 f32 lineWidth
Jesse Halld27f6aa2015-08-15 17:58:48 -07002261}
2262
2263class VkPipelineMultisampleStateCreateInfo {
2264 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO
2265 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002266 VkPipelineMultisampleStateCreateFlags flags
Jesse Hall091ed9e2015-11-30 00:55:29 -08002267 VkSampleCountFlagBits rasterizationSamples /// Number of samples used for rasterization
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002268 VkBool32 sampleShadingEnable /// optional (GL45)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002269 f32 minSampleShading /// optional (GL45)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002270 const VkSampleMask* pSampleMask
Jesse Hallacfa5342015-11-19 21:51:33 -08002271 VkBool32 alphaToCoverageEnable
2272 VkBool32 alphaToOneEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002273}
2274
2275class VkPipelineColorBlendAttachmentState {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002276 VkBool32 blendEnable
Jesse Hall65ab5522015-11-30 00:07:16 -08002277 VkBlendFactor srcColorBlendFactor
2278 VkBlendFactor dstColorBlendFactor
2279 VkBlendOp colorBlendOp
2280 VkBlendFactor srcAlphaBlendFactor
2281 VkBlendFactor dstAlphaBlendFactor
2282 VkBlendOp alphaBlendOp
2283 VkColorComponentFlags colorWriteMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07002284}
2285
2286class VkPipelineColorBlendStateCreateInfo {
2287 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO
2288 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002289 VkPipelineColorBlendStateCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002290 VkBool32 logicOpEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002291 VkLogicOp logicOp
2292 u32 attachmentCount /// # of pAttachments
2293 const VkPipelineColorBlendAttachmentState* pAttachments
Jesse Hallb00daad2015-11-29 19:46:20 -08002294 f32[4] blendConstants
Jesse Halld27f6aa2015-08-15 17:58:48 -07002295}
2296
2297class VkStencilOpState {
Jesse Hall65ab5522015-11-30 00:07:16 -08002298 VkStencilOp failOp
2299 VkStencilOp passOp
2300 VkStencilOp depthFailOp
2301 VkCompareOp compareOp
2302 u32 compareMask
2303 u32 writeMask
2304 u32 reference
Jesse Halld27f6aa2015-08-15 17:58:48 -07002305}
2306
2307class VkPipelineDepthStencilStateCreateInfo {
2308 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO
2309 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002310 VkPipelineDepthStencilStateCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002311 VkBool32 depthTestEnable
2312 VkBool32 depthWriteEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002313 VkCompareOp depthCompareOp
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002314 VkBool32 depthBoundsTestEnable /// optional (depth_bounds_test)
2315 VkBool32 stencilTestEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002316 VkStencilOpState front
2317 VkStencilOpState back
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002318 f32 minDepthBounds
2319 f32 maxDepthBounds
2320}
2321
2322class VkPipelineDynamicStateCreateInfo {
2323 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO
2324 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002325 VkPipelineDynamicStateCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002326 u32 dynamicStateCount
2327 const VkDynamicState* pDynamicStates
Jesse Halld27f6aa2015-08-15 17:58:48 -07002328}
2329
2330class VkGraphicsPipelineCreateInfo {
Jesse Halla6429252015-11-29 18:59:42 -08002331 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO
2332 const void* pNext /// Pointer to next structure
2333 VkPipelineCreateFlags flags /// Pipeline creation flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002334 u32 stageCount
Jesse Halla6429252015-11-29 18:59:42 -08002335 const VkPipelineShaderStageCreateInfo* pStages /// One entry for each active shader stage
Jesse Halld27f6aa2015-08-15 17:58:48 -07002336 const VkPipelineVertexInputStateCreateInfo* pVertexInputState
2337 const VkPipelineInputAssemblyStateCreateInfo* pInputAssemblyState
2338 const VkPipelineTessellationStateCreateInfo* pTessellationState
2339 const VkPipelineViewportStateCreateInfo* pViewportState
Jesse Hall3fbc8562015-11-29 22:10:52 -08002340 const VkPipelineRasterizationStateCreateInfo* pRasterizationState
Jesse Halld27f6aa2015-08-15 17:58:48 -07002341 const VkPipelineMultisampleStateCreateInfo* pMultisampleState
2342 const VkPipelineDepthStencilStateCreateInfo* pDepthStencilState
2343 const VkPipelineColorBlendStateCreateInfo* pColorBlendState
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002344 const VkPipelineDynamicStateCreateInfo* pDynamicState
Jesse Halla6429252015-11-29 18:59:42 -08002345 VkPipelineLayout layout /// Interface layout of the pipeline
Jesse Halld27f6aa2015-08-15 17:58:48 -07002346 VkRenderPass renderPass
2347 u32 subpass
Jesse Halla6429252015-11-29 18:59:42 -08002348 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
2349 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 -07002350}
2351
2352class VkPipelineCacheCreateInfo {
Jesse Hallb00daad2015-11-29 19:46:20 -08002353 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO
2354 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002355 VkPipelineCacheCreateFlags flags
Jesse Hallb00daad2015-11-29 19:46:20 -08002356 platform.size_t initialDataSize /// Size of initial data to populate cache, in bytes
2357 const void* pInitialData /// Initial data to populate cache
Jesse Halld27f6aa2015-08-15 17:58:48 -07002358}
2359
2360class VkPushConstantRange {
2361 VkShaderStageFlags stageFlags /// Which stages use the range
Jesse Hall03b6fe12015-11-24 12:44:21 -08002362 u32 offset /// Start of the range, in bytes
2363 u32 size /// Length of the range, in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002364}
2365
2366class VkPipelineLayoutCreateInfo {
2367 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO
2368 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002369 VkPipelineLayoutCreateFlags flags
Jesse Hall3dd678a2016-01-08 21:52:01 -08002370 u32 descriptorSetCount /// Number of descriptor sets interfaced by the pipeline
Jesse Halld27f6aa2015-08-15 17:58:48 -07002371 const VkDescriptorSetLayout* pSetLayouts /// Array of <setCount> number of descriptor set layout objects defining the layout of the
2372 u32 pushConstantRangeCount /// Number of push-constant ranges used by the pipeline
2373 const VkPushConstantRange* pPushConstantRanges /// Array of pushConstantRangeCount number of ranges used by various shader stages
2374}
2375
2376class VkSamplerCreateInfo {
2377 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO
2378 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002379 VkSamplerCreateFlags flags
Jesse Hall23ff73f2015-11-29 14:36:39 -08002380 VkFilter magFilter /// Filter mode for magnification
2381 VkFilter minFilter /// Filter mode for minifiation
2382 VkSamplerMipmapMode mipmapMode /// Mipmap selection mode
2383 VkSamplerAddressMode addressModeU
2384 VkSamplerAddressMode addressModeV
2385 VkSamplerAddressMode addressModeW
Jesse Halld27f6aa2015-08-15 17:58:48 -07002386 f32 mipLodBias
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002387 VkBool32 anisotropyEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002388 f32 maxAnisotropy
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002389 VkBool32 compareEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002390 VkCompareOp compareOp
2391 f32 minLod
2392 f32 maxLod
2393 VkBorderColor borderColor
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002394 VkBool32 unnormalizedCoordinates
Jesse Halld27f6aa2015-08-15 17:58:48 -07002395}
2396
Jesse Hall3fbc8562015-11-29 22:10:52 -08002397class VkCommandPoolCreateInfo {
2398 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002399 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08002400 VkCommandPoolCreateFlags flags /// Command pool creation flags
Jesse Halla6429252015-11-29 18:59:42 -08002401 u32 queueFamilyIndex
Jesse Halld27f6aa2015-08-15 17:58:48 -07002402}
2403
Jesse Hall3fbc8562015-11-29 22:10:52 -08002404class VkCommandBufferAllocateInfo {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002405 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002406 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08002407 VkCommandPool commandPool
2408 VkCommandBufferLevel level
Jesse Hall3dd678a2016-01-08 21:52:01 -08002409 u32 commandBufferCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002410}
2411
Jesse Hall3dd678a2016-01-08 21:52:01 -08002412class VkCommandBufferInheritanceInfo {
2413 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002414 const void* pNext /// Pointer to next structure
Jesse Halld27f6aa2015-08-15 17:58:48 -07002415 VkRenderPass renderPass /// Render pass for secondary command buffers
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002416 u32 subpass
Jesse Halld27f6aa2015-08-15 17:58:48 -07002417 VkFramebuffer framebuffer /// Framebuffer for secondary command buffers
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002418 VkBool32 occlusionQueryEnable
2419 VkQueryControlFlags queryFlags
2420 VkQueryPipelineStatisticFlags pipelineStatistics
Jesse Halld27f6aa2015-08-15 17:58:48 -07002421}
2422
Jesse Hall3dd678a2016-01-08 21:52:01 -08002423class VkCommandBufferBeginInfo {
2424 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO
2425 const void* pNext /// Pointer to next structure
2426 VkCommandBufferUsageFlags flags /// Command buffer usage flags
2427 const VkCommandBufferInheritanceInfo* pInheritanceInfo
2428}
2429
Jesse Halld27f6aa2015-08-15 17:58:48 -07002430class VkRenderPassBeginInfo {
2431 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO
2432 const void* pNext /// Pointer to next structure
2433 VkRenderPass renderPass
2434 VkFramebuffer framebuffer
2435 VkRect2D renderArea
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002436 u32 clearValueCount
2437 const VkClearValue* pClearValues
Jesse Halld27f6aa2015-08-15 17:58:48 -07002438}
2439
2440@union
2441/// Union allowing specification of floating point, integer, or unsigned integer color data. Actual value selected is based on image/attachment being cleared.
2442class VkClearColorValue {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002443 f32[4] float32
2444 s32[4] int32
2445 u32[4] uint32
Jesse Halld27f6aa2015-08-15 17:58:48 -07002446}
2447
2448class VkClearDepthStencilValue {
2449 f32 depth
2450 u32 stencil
2451}
2452
2453@union
2454/// Union allowing specification of color, depth, and stencil color values. Actual value selected is based on attachment being cleared.
2455class VkClearValue {
2456 VkClearColorValue color
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002457 VkClearDepthStencilValue depthStencil
Jesse Halld27f6aa2015-08-15 17:58:48 -07002458}
2459
Jesse Hallae38f732015-11-19 21:32:50 -08002460class VkClearAttachment {
2461 VkImageAspectFlags aspectMask
2462 u32 colorAttachment
2463 VkClearValue clearValue
2464}
2465
Jesse Halld27f6aa2015-08-15 17:58:48 -07002466class VkAttachmentDescription {
Jesse Halla6429252015-11-29 18:59:42 -08002467 VkAttachmentDescriptionFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002468 VkFormat format
Jesse Hall091ed9e2015-11-30 00:55:29 -08002469 VkSampleCountFlagBits samples
Jesse Halld27f6aa2015-08-15 17:58:48 -07002470 VkAttachmentLoadOp loadOp /// Load op for color or depth data
2471 VkAttachmentStoreOp storeOp /// Store op for color or depth data
2472 VkAttachmentLoadOp stencilLoadOp /// Load op for stencil data
2473 VkAttachmentStoreOp stencilStoreOp /// Store op for stencil data
2474 VkImageLayout initialLayout
2475 VkImageLayout finalLayout
2476}
2477
2478class VkAttachmentReference {
2479 u32 attachment
2480 VkImageLayout layout
2481}
2482
2483class VkSubpassDescription {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002484 VkSubpassDescriptionFlags flags
Jesse Halla6429252015-11-29 18:59:42 -08002485 VkPipelineBindPoint pipelineBindPoint /// Must be VK_PIPELINE_BIND_POINT_GRAPHICS for now
Jesse Hall03b6fe12015-11-24 12:44:21 -08002486 u32 inputAttachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002487 const VkAttachmentReference* pInputAttachments
Jesse Hall03b6fe12015-11-24 12:44:21 -08002488 u32 colorAttachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002489 const VkAttachmentReference* pColorAttachments
2490 const VkAttachmentReference* pResolveAttachments
Jesse Hallc7467b72015-11-29 21:05:26 -08002491 const VkAttachmentReference* pDepthStencilAttachment
Jesse Hall03b6fe12015-11-24 12:44:21 -08002492 u32 preserveAttachmentCount
Jesse Hall3dd678a2016-01-08 21:52:01 -08002493 const u32* pPreserveAttachments
Jesse Halld27f6aa2015-08-15 17:58:48 -07002494}
2495
2496class VkSubpassDependency {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002497 u32 srcSubpass
Jesse Hall3fbc8562015-11-29 22:10:52 -08002498 u32 dstSubpass
Jesse Halld27f6aa2015-08-15 17:58:48 -07002499 VkPipelineStageFlags srcStageMask
Jesse Hall3fbc8562015-11-29 22:10:52 -08002500 VkPipelineStageFlags dstStageMask
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002501 VkAccessFlags srcAccessMask
2502 VkAccessFlags dstAccessMask
Jesse Halldc6d36c2015-11-29 19:12:15 -08002503 VkDependencyFlags dependencyFlags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002504}
2505
2506class VkRenderPassCreateInfo {
2507 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO
2508 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002509 VkRenderPassCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002510 u32 attachmentCount
2511 const VkAttachmentDescription* pAttachments
2512 u32 subpassCount
2513 const VkSubpassDescription* pSubpasses
2514 u32 dependencyCount
2515 const VkSubpassDependency* pDependencies
2516}
2517
2518class VkEventCreateInfo {
2519 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_EVENT_CREATE_INFO
2520 const void* pNext /// Pointer to next structure
2521 VkEventCreateFlags flags /// Event creation flags
2522}
2523
2524class VkFenceCreateInfo {
2525 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_FENCE_CREATE_INFO
2526 const void* pNext /// Pointer to next structure
2527 VkFenceCreateFlags flags /// Fence creation flags
2528}
2529
2530class VkPhysicalDeviceFeatures {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002531 VkBool32 robustBufferAccess /// out of bounds buffer accesses are well defined
2532 VkBool32 fullDrawIndexUint32 /// full 32-bit range of indices for indexed draw calls
2533 VkBool32 imageCubeArray /// image views which are arrays of cube maps
2534 VkBool32 independentBlend /// blending operations are controlled per-attachment
2535 VkBool32 geometryShader /// geometry stage
2536 VkBool32 tessellationShader /// tessellation control and evaluation stage
2537 VkBool32 sampleRateShading /// per-sample shading and interpolation
Jesse Hall3fbc8562015-11-29 22:10:52 -08002538 VkBool32 dualSrcBlend /// blend operations which take two sources
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002539 VkBool32 logicOp /// logic operations
2540 VkBool32 multiDrawIndirect /// multi draw indirect
Jesse Hall543a7ff2016-01-08 16:38:30 -08002541 VkBool32 drawIndirectFirstInstance
Jesse Hallae38f732015-11-19 21:32:50 -08002542 VkBool32 depthClamp /// depth clamping
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002543 VkBool32 depthBiasClamp /// depth bias clamping
2544 VkBool32 fillModeNonSolid /// point and wireframe fill modes
2545 VkBool32 depthBounds /// depth bounds test
2546 VkBool32 wideLines /// lines with width greater than 1
2547 VkBool32 largePoints /// points with size greater than 1
Jesse Hallfbf97b02015-11-20 14:17:03 -08002548 VkBool32 alphaToOne /// The fragment alpha channel can be forced to maximum representable alpha value
2549 VkBool32 multiViewport
2550 VkBool32 samplerAnisotropy
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002551 VkBool32 textureCompressionETC2 /// ETC texture compression formats
2552 VkBool32 textureCompressionASTC_LDR /// ASTC LDR texture compression formats
2553 VkBool32 textureCompressionBC /// BC1-7 texture compressed formats
Jesse Hall65ab5522015-11-30 00:07:16 -08002554 VkBool32 occlusionQueryPrecise
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002555 VkBool32 pipelineStatisticsQuery /// pipeline statistics query
Jesse Halldc6d36c2015-11-29 19:12:15 -08002556 VkBool32 vertexPipelineStoresAndAtomics
2557 VkBool32 fragmentStoresAndAtomics
2558 VkBool32 shaderTessellationAndGeometryPointSize
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002559 VkBool32 shaderImageGatherExtended /// texture gather with run-time values and independent offsets
2560 VkBool32 shaderStorageImageExtendedFormats /// the extended set of formats can be used for storage images
2561 VkBool32 shaderStorageImageMultisample /// multisample images can be used for storage images
Jesse Halld1af8122015-11-29 23:50:38 -08002562 VkBool32 shaderStorageImageReadWithoutFormat
2563 VkBool32 shaderStorageImageWriteWithoutFormat
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002564 VkBool32 shaderUniformBufferArrayDynamicIndexing /// arrays of uniform buffers can be accessed with dynamically uniform indices
2565 VkBool32 shaderSampledImageArrayDynamicIndexing /// arrays of sampled images can be accessed with dynamically uniform indices
2566 VkBool32 shaderStorageBufferArrayDynamicIndexing /// arrays of storage buffers can be accessed with dynamically uniform indices
2567 VkBool32 shaderStorageImageArrayDynamicIndexing /// arrays of storage images can be accessed with dynamically uniform indices
2568 VkBool32 shaderClipDistance /// clip distance in shaders
2569 VkBool32 shaderCullDistance /// cull distance in shaders
2570 VkBool32 shaderFloat64 /// 64-bit floats (doubles) in shaders
2571 VkBool32 shaderInt64 /// 64-bit integers in shaders
2572 VkBool32 shaderInt16 /// 16-bit integers in shaders
2573 VkBool32 shaderResourceResidency /// shader can use texture operations that return resource residency information (requires sparseNonResident support)
Jesse Hall65ab5522015-11-30 00:07:16 -08002574 VkBool32 shaderResourceMinLod /// shader can use texture operations that specify minimum resource LOD
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002575 VkBool32 sparseBinding /// Sparse resources support: Resource memory can be managed at opaque page level rather than object level
2576 VkBool32 sparseResidencyBuffer /// Sparse resources support: GPU can access partially resident buffers
2577 VkBool32 sparseResidencyImage2D /// Sparse resources support: GPU can access partially resident 2D (non-MSAA non-DepthStencil) images
2578 VkBool32 sparseResidencyImage3D /// Sparse resources support: GPU can access partially resident 3D images
2579 VkBool32 sparseResidency2Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 2 samples
2580 VkBool32 sparseResidency4Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 4 samples
2581 VkBool32 sparseResidency8Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 8 samples
2582 VkBool32 sparseResidency16Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 16 samples
2583 VkBool32 sparseResidencyAliased /// Sparse resources support: GPU can correctly access data aliased into multiple locations (opt-in)
Jesse Halld1af8122015-11-29 23:50:38 -08002584 VkBool32 variableMultisampleRate
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002585 VkBool32 inheritedQueries
Jesse Halld27f6aa2015-08-15 17:58:48 -07002586}
2587
2588class VkPhysicalDeviceLimits {
2589 /// resource maximum sizes
2590 u32 maxImageDimension1D /// max 1D image dimension
2591 u32 maxImageDimension2D /// max 2D image dimension
2592 u32 maxImageDimension3D /// max 3D image dimension
2593 u32 maxImageDimensionCube /// max cubemap image dimension
2594 u32 maxImageArrayLayers /// max layers for image arrays
Jesse Hallb00daad2015-11-29 19:46:20 -08002595 u32 maxTexelBufferElements
Jesse Hallfbf97b02015-11-20 14:17:03 -08002596 u32 maxUniformBufferRange /// max uniform buffer size (bytes)
2597 u32 maxStorageBufferRange /// max storage buffer size (bytes)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002598 u32 maxPushConstantsSize /// max size of the push constants pool (bytes)
2599 /// memory limits
2600 u32 maxMemoryAllocationCount /// max number of device memory allocations supported
Jesse Hall091ed9e2015-11-30 00:55:29 -08002601 u32 maxSamplerAllocationCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002602 VkDeviceSize bufferImageGranularity /// Granularity (in bytes) at which buffers and images can be bound to adjacent memory for simultaneous usage
2603 VkDeviceSize sparseAddressSpaceSize /// Total address space available for sparse allocations (bytes)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002604 /// descriptor set limits
2605 u32 maxBoundDescriptorSets /// max number of descriptors sets that can be bound to a pipeline
Jesse Halld27f6aa2015-08-15 17:58:48 -07002606 u32 maxPerStageDescriptorSamplers /// max num of samplers allowed per-stage in a descriptor set
2607 u32 maxPerStageDescriptorUniformBuffers /// max num of uniform buffers allowed per-stage in a descriptor set
2608 u32 maxPerStageDescriptorStorageBuffers /// max num of storage buffers allowed per-stage in a descriptor set
2609 u32 maxPerStageDescriptorSampledImages /// max num of sampled images allowed per-stage in a descriptor set
2610 u32 maxPerStageDescriptorStorageImages /// max num of storage images allowed per-stage in a descriptor set
Jesse Halle1b12782015-11-30 11:27:32 -08002611 u32 maxPerStageDescriptorInputAttachments
Jesse Halldba27f72015-11-30 14:25:46 -08002612 u32 maxPerStageResources
Jesse Halld27f6aa2015-08-15 17:58:48 -07002613 u32 maxDescriptorSetSamplers /// max num of samplers allowed in all stages in a descriptor set
2614 u32 maxDescriptorSetUniformBuffers /// max num of uniform buffers allowed in all stages in a descriptor set
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002615 u32 maxDescriptorSetUniformBuffersDynamic /// max num of dynamic uniform buffers allowed in all stages in a descriptor set
Jesse Halld27f6aa2015-08-15 17:58:48 -07002616 u32 maxDescriptorSetStorageBuffers /// max num of storage buffers allowed in all stages in a descriptor set
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002617 u32 maxDescriptorSetStorageBuffersDynamic /// max num of dynamic storage buffers allowed in all stages in a descriptor set
Jesse Halld27f6aa2015-08-15 17:58:48 -07002618 u32 maxDescriptorSetSampledImages /// max num of sampled images allowed in all stages in a descriptor set
2619 u32 maxDescriptorSetStorageImages /// max num of storage images allowed in all stages in a descriptor set
Jesse Halle1b12782015-11-30 11:27:32 -08002620 u32 maxDescriptorSetInputAttachments
Jesse Halld27f6aa2015-08-15 17:58:48 -07002621 /// vertex stage limits
2622 u32 maxVertexInputAttributes /// max num of vertex input attribute slots
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002623 u32 maxVertexInputBindings /// max num of vertex input binding slots
Jesse Halld27f6aa2015-08-15 17:58:48 -07002624 u32 maxVertexInputAttributeOffset /// max vertex input attribute offset added to vertex buffer offset
2625 u32 maxVertexInputBindingStride /// max vertex input binding stride
2626 u32 maxVertexOutputComponents /// max num of output components written by vertex shader
2627 /// tessellation control stage limits
Jesse Hall3fbc8562015-11-29 22:10:52 -08002628 u32 maxTessellationGenerationLevel /// max level supported by tess primitive generator
Jesse Hallae38f732015-11-19 21:32:50 -08002629 u32 maxTessellationPatchSize /// max patch size (vertices)
2630 u32 maxTessellationControlPerVertexInputComponents /// max num of input components per-vertex in TCS
2631 u32 maxTessellationControlPerVertexOutputComponents /// max num of output components per-vertex in TCS
2632 u32 maxTessellationControlPerPatchOutputComponents /// max num of output components per-patch in TCS
2633 u32 maxTessellationControlTotalOutputComponents /// max total num of per-vertex and per-patch output components in TCS
2634 u32 maxTessellationEvaluationInputComponents /// max num of input components per vertex in TES
2635 u32 maxTessellationEvaluationOutputComponents /// max num of output components per vertex in TES
Jesse Halld27f6aa2015-08-15 17:58:48 -07002636 /// geometry stage limits
2637 u32 maxGeometryShaderInvocations /// max invocation count supported in geometry shader
2638 u32 maxGeometryInputComponents /// max num of input components read in geometry stage
2639 u32 maxGeometryOutputComponents /// max num of output components written in geometry stage
2640 u32 maxGeometryOutputVertices /// max num of vertices that can be emitted in geometry stage
2641 u32 maxGeometryTotalOutputComponents /// max total num of components (all vertices) written in geometry stage
2642 /// fragment stage limits
2643 u32 maxFragmentInputComponents /// max num of input compontents read in fragment stage
Jesse Hallfbf97b02015-11-20 14:17:03 -08002644 u32 maxFragmentOutputAttachments /// max num of output attachments written in fragment stage
Jesse Hall3fbc8562015-11-29 22:10:52 -08002645 u32 maxFragmentDualSrcAttachments /// max num of output attachments written when using dual source blending
Jesse Halld27f6aa2015-08-15 17:58:48 -07002646 u32 maxFragmentCombinedOutputResources /// max total num of storage buffers, storage images and output buffers
2647 /// compute stage limits
2648 u32 maxComputeSharedMemorySize /// max total storage size of work group local storage (bytes)
2649 u32[3] maxComputeWorkGroupCount /// max num of compute work groups that may be dispatched by a single command (x,y,z)
2650 u32 maxComputeWorkGroupInvocations /// max total compute invocations in a single local work group
2651 u32[3] maxComputeWorkGroupSize /// max local size of a compute work group (x,y,z)
2652
2653 u32 subPixelPrecisionBits /// num bits of subpixel precision in screen x and y
2654 u32 subTexelPrecisionBits /// num bits of subtexel precision
2655 u32 mipmapPrecisionBits /// num bits of mipmap precision
2656
2657 u32 maxDrawIndexedIndexValue /// max index value for indexed draw calls (for 32-bit indices)
Jesse Halldba27f72015-11-30 14:25:46 -08002658 u32 maxDrawIndirectCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002659
2660 f32 maxSamplerLodBias /// max absolute sampler level of detail bias
2661 f32 maxSamplerAnisotropy /// max degree of sampler anisotropy
2662
2663 u32 maxViewports /// max number of active viewports
Jesse Halld27f6aa2015-08-15 17:58:48 -07002664 u32[2] maxViewportDimensions /// max viewport dimensions (x,y)
2665 f32[2] viewportBoundsRange /// viewport bounds range (min,max)
2666 u32 viewportSubPixelBits /// num bits of subpixel precision for viewport
2667
Jesse Halldc6d36c2015-11-29 19:12:15 -08002668 platform.size_t minMemoryMapAlignment /// min required alignment of pointers returned by MapMemory (bytes)
2669 VkDeviceSize minTexelBufferOffsetAlignment /// min required alignment for texel buffer offsets (bytes)
2670 VkDeviceSize minUniformBufferOffsetAlignment /// min required alignment for uniform buffer sizes and offsets (bytes)
2671 VkDeviceSize minStorageBufferOffsetAlignment /// min required alignment for storage buffer offsets (bytes)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002672
Jesse Hallfbf97b02015-11-20 14:17:03 -08002673 s32 minTexelOffset /// min texel offset for OpTextureSampleOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07002674 u32 maxTexelOffset /// max texel offset for OpTextureSampleOffset
Jesse Hallfbf97b02015-11-20 14:17:03 -08002675 s32 minTexelGatherOffset /// min texel offset for OpTextureGatherOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07002676 u32 maxTexelGatherOffset /// max texel offset for OpTextureGatherOffset
2677 f32 minInterpolationOffset /// furthest negative offset for interpolateAtOffset
2678 f32 maxInterpolationOffset /// furthest positive offset for interpolateAtOffset
2679 u32 subPixelInterpolationOffsetBits /// num of subpixel bits for interpolateAtOffset
2680
2681 u32 maxFramebufferWidth /// max width for a framebuffer
2682 u32 maxFramebufferHeight /// max height for a framebuffer
2683 u32 maxFramebufferLayers /// max layer count for a layered framebuffer
Jesse Hall091ed9e2015-11-30 00:55:29 -08002684 VkSampleCountFlags framebufferColorSampleCounts
2685 VkSampleCountFlags framebufferDepthSampleCounts
2686 VkSampleCountFlags framebufferStencilSampleCounts
2687 VkSampleCountFlags framebufferNoAttachmentSampleCounts
Jesse Halld27f6aa2015-08-15 17:58:48 -07002688 u32 maxColorAttachments /// max num of framebuffer color attachments
2689
Jesse Hall091ed9e2015-11-30 00:55:29 -08002690 VkSampleCountFlags sampledImageColorSampleCounts
2691 VkSampleCountFlags sampledImageIntegerSampleCounts
2692 VkSampleCountFlags sampledImageDepthSampleCounts
2693 VkSampleCountFlags sampledImageStencilSampleCounts
2694 VkSampleCountFlags storageImageSampleCounts
Jesse Halld27f6aa2015-08-15 17:58:48 -07002695 u32 maxSampleMaskWords /// max num of sample mask words
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002696 VkBool32 timestampComputeAndGraphics
Jesse Halld27f6aa2015-08-15 17:58:48 -07002697
Jesse Halla9bb62b2015-11-21 19:31:56 -08002698 f32 timestampPeriod
Jesse Halld27f6aa2015-08-15 17:58:48 -07002699
2700 u32 maxClipDistances /// max number of clip distances
2701 u32 maxCullDistances /// max number of cull distances
2702 u32 maxCombinedClipAndCullDistances /// max combined number of user clipping
2703
Jesse Hallfbf97b02015-11-20 14:17:03 -08002704 u32 discreteQueuePriorities
2705
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002706 f32[2] pointSizeRange /// range (min,max) of supported point sizes
2707 f32[2] lineWidthRange /// range (min,max) of supported line widths
Jesse Halld27f6aa2015-08-15 17:58:48 -07002708 f32 pointSizeGranularity /// granularity of supported point sizes
2709 f32 lineWidthGranularity /// granularity of supported line widths
Jesse Hall03b6fe12015-11-24 12:44:21 -08002710 VkBool32 strictLines
Jesse Hall091ed9e2015-11-30 00:55:29 -08002711 VkBool32 standardSampleLocations
Jesse Halla9bb62b2015-11-21 19:31:56 -08002712
Jesse Hall65ab5522015-11-30 00:07:16 -08002713 VkDeviceSize optimalBufferCopyOffsetAlignment
2714 VkDeviceSize optimalBufferCopyRowPitchAlignment
Jesse Halldba27f72015-11-30 14:25:46 -08002715 VkDeviceSize nonCoherentAtomSize
Jesse Halld27f6aa2015-08-15 17:58:48 -07002716}
2717
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002718class VkPhysicalDeviceSparseProperties {
2719 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 -08002720 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 -07002721 VkBool32 residencyStandard3DBlockShape /// Sparse resources support: GPU will access all 3D sparse resources using the standard block shapes (based on pixel format)
2722 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 -07002723 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
2724}
2725
Jesse Halld27f6aa2015-08-15 17:58:48 -07002726class VkSemaphoreCreateInfo {
2727 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO
2728 const void* pNext /// Pointer to next structure
2729 VkSemaphoreCreateFlags flags /// Semaphore creation flags
2730}
2731
2732class VkQueryPoolCreateInfo {
2733 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO
2734 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002735 VkQueryPoolCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002736 VkQueryType queryType
Jesse Hall3dd678a2016-01-08 21:52:01 -08002737 u32 queryCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002738 VkQueryPipelineStatisticFlags pipelineStatistics /// Optional
2739}
2740
2741class VkFramebufferCreateInfo {
2742 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO
2743 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002744 VkFramebufferCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002745 VkRenderPass renderPass
2746 u32 attachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002747 const VkImageView* pAttachments
Jesse Halld27f6aa2015-08-15 17:58:48 -07002748 u32 width
2749 u32 height
2750 u32 layers
2751}
2752
Jesse Hall3fbc8562015-11-29 22:10:52 -08002753class VkDrawIndirectCommand {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002754 u32 vertexCount
2755 u32 instanceCount
2756 u32 firstVertex
2757 u32 firstInstance
2758}
2759
Jesse Hall3fbc8562015-11-29 22:10:52 -08002760class VkDrawIndexedIndirectCommand {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002761 u32 indexCount
2762 u32 instanceCount
2763 u32 firstIndex
2764 s32 vertexOffset
2765 u32 firstInstance
2766}
2767
Jesse Hall3fbc8562015-11-29 22:10:52 -08002768class VkDispatchIndirectCommand {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002769 u32 x
2770 u32 y
2771 u32 z
2772}
2773
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002774@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08002775class VkSurfaceCapabilitiesKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002776 u32 minImageCount
2777 u32 maxImageCount
2778 VkExtent2D currentExtent
2779 VkExtent2D minImageExtent
2780 VkExtent2D maxImageExtent
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002781 u32 maxImageArrayLayers
Jesse Hall1356b0d2015-11-23 17:24:58 -08002782 VkSurfaceTransformFlagsKHR supportedTransforms
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002783 VkSurfaceTransformFlagBitsKHR currentTransform
Jesse Halla6429252015-11-29 18:59:42 -08002784 VkCompositeAlphaFlagsKHR supportedCompositeAlpha
Jesse Hall1356b0d2015-11-23 17:24:58 -08002785 VkImageUsageFlags supportedUsageFlags
Michael Lentine88594d72015-11-12 12:49:45 -08002786}
2787
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002788@extension("VK_KHR_surface")
Michael Lentine88594d72015-11-12 12:49:45 -08002789class VkSurfaceFormatKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002790 VkFormat format
2791 VkColorSpaceKHR colorSpace
Michael Lentine88594d72015-11-12 12:49:45 -08002792}
2793
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002794@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08002795class VkSwapchainCreateInfoKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002796 VkStructureType sType
2797 const void* pNext
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002798 VkSwapchainCreateFlagsKHR flags
Jesse Hall1356b0d2015-11-23 17:24:58 -08002799 VkSurfaceKHR surface
2800 u32 minImageCount
2801 VkFormat imageFormat
2802 VkColorSpaceKHR imageColorSpace
2803 VkExtent2D imageExtent
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002804 u32 imageArrayLayers
2805 VkImageUsageFlags imageUsage
Jesse Hall1356b0d2015-11-23 17:24:58 -08002806 VkSharingMode sharingMode
Jesse Hall03b6fe12015-11-24 12:44:21 -08002807 u32 queueFamilyIndexCount
Jesse Hall1356b0d2015-11-23 17:24:58 -08002808 const u32* pQueueFamilyIndices
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002809 VkSurfaceTransformFlagBitsKHR preTransform
2810 VkCompositeAlphaFlagBitsKHR compositeAlpha
Jesse Hall1356b0d2015-11-23 17:24:58 -08002811 VkPresentModeKHR presentMode
Jesse Hall1356b0d2015-11-23 17:24:58 -08002812 VkBool32 clipped
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002813 VkSwapchainKHR oldSwapchain
Michael Lentine88594d72015-11-12 12:49:45 -08002814}
2815
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002816@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08002817class VkPresentInfoKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002818 VkStructureType sType
2819 const void* pNext
Jesse Hallb00daad2015-11-29 19:46:20 -08002820 u32 waitSemaphoreCount
2821 const VkSemaphore* pWaitSemaphores
Jesse Hall1356b0d2015-11-23 17:24:58 -08002822 u32 swapchainCount
Jesse Hall03b6fe12015-11-24 12:44:21 -08002823 const VkSwapchainKHR* pSwapchains
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002824 const u32* pImageIndices
Jesse Halle1b12782015-11-30 11:27:32 -08002825 VkResult* pResults
Michael Lentine88594d72015-11-12 12:49:45 -08002826}
2827
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002828@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002829class VkDisplayPropertiesKHR {
2830 VkDisplayKHR display
2831 const char* displayName
2832 VkExtent2D physicalDimensions
2833 VkExtent2D physicalResolution
2834 VkSurfaceTransformFlagsKHR supportedTransforms
Jesse Hall1356b0d2015-11-23 17:24:58 -08002835 VkBool32 planeReorderPossible
Jesse Halla6429252015-11-29 18:59:42 -08002836 VkBool32 persistentContent
Michael Lentine88594d72015-11-12 12:49:45 -08002837}
2838
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002839@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08002840class VkDisplayModeParametersKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002841 VkExtent2D visibleRegion
Jesse Halla6429252015-11-29 18:59:42 -08002842 u32 refreshRate
Michael Lentine88594d72015-11-12 12:49:45 -08002843}
Jesse Halld27f6aa2015-08-15 17:58:48 -07002844
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002845@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002846class VkDisplayModePropertiesKHR {
2847 VkDisplayModeKHR displayMode
Jesse Halla6429252015-11-29 18:59:42 -08002848 VkDisplayModeParametersKHR parameters
Jesse Hall1356b0d2015-11-23 17:24:58 -08002849}
2850
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002851@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002852class VkDisplayModeCreateInfoKHR {
2853 VkStructureType sType
2854 const void* pNext
Jesse Hall9ba8bc82015-11-30 16:22:16 -08002855 VkDisplayModeCreateFlagsKHR flags
Jesse Halla6429252015-11-29 18:59:42 -08002856 VkDisplayModeParametersKHR parameters
Jesse Hall1356b0d2015-11-23 17:24:58 -08002857}
2858
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002859@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002860class VkDisplayPlanePropertiesKHR {
Jesse Halla6429252015-11-29 18:59:42 -08002861 VkDisplayKHR currentDisplay
2862 u32 currentStackIndex
2863}
2864
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002865@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08002866class VkDisplayPlaneCapabilitiesKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002867 VkDisplayPlaneAlphaFlagsKHR supportedAlpha
2868 VkOffset2D minSrcPosition
2869 VkOffset2D maxSrcPosition
2870 VkExtent2D minSrcExtent
2871 VkExtent2D maxSrcExtent
2872 VkOffset2D minDstPosition
2873 VkOffset2D maxDstPosition
2874 VkExtent2D minDstExtent
2875 VkExtent2D maxDstExtent
2876}
2877
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002878@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08002879class VkDisplaySurfaceCreateInfoKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002880 VkStructureType sType
2881 const void* pNext
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002882 VkDisplaySurfaceCreateFlagsKHR flags
Jesse Hall1356b0d2015-11-23 17:24:58 -08002883 VkDisplayModeKHR displayMode
2884 u32 planeIndex
2885 u32 planeStackIndex
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002886 VkSurfaceTransformFlagBitsKHR transform
Jesse Hall1356b0d2015-11-23 17:24:58 -08002887 f32 globalAlpha
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002888 VkDisplayPlaneAlphaFlagBitsKHR alphaMode
2889 VkExtent2D imageExtent
Jesse Hall1356b0d2015-11-23 17:24:58 -08002890}
2891
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002892@extension("VK_KHR_display_swapchain")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002893class VkDisplayPresentInfoKHR {
2894 VkStructureType sType
2895 const void* pNext
2896 VkRect2D srcRect
2897 VkRect2D dstRect
Jesse Halla6429252015-11-29 18:59:42 -08002898 VkBool32 persistent
Jesse Hall1356b0d2015-11-23 17:24:58 -08002899}
2900
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002901@extension("VK_KHR_xlib_surface")
2902class VkXlibSurfaceCreateInfoKHR {
2903 VkStructureType sType
2904 const void* pNext
2905 VkXlibSurfaceCreateFlagsKHR flags
2906 platform.Display* dpy
2907 platform.Window window
2908}
2909
2910@extension("VK_KHR_xcb_surface")
2911class VkXcbSurfaceCreateInfoKHR {
2912 VkStructureType sType
2913 const void* pNext
2914 VkXcbSurfaceCreateFlagsKHR flags
2915 platform.xcb_connection_t* connection
2916 platform.xcb_window_t window
2917}
2918
2919@extension("VK_KHR_wayland_surface")
2920class VkWaylandSurfaceCreateInfoKHR {
2921 VkStructureType sType
2922 const void* pNext
2923 VkWaylandSurfaceCreateFlagsKHR flags
2924 platform.wl_display* display
2925 platform.wl_surface* surface
2926}
2927
2928@extension("VK_KHR_mir_surface")
2929class VkMirSurfaceCreateInfoKHR {
2930 VkStructureType sType
2931 const void* pNext
2932 VkMirSurfaceCreateFlagsKHR flags
2933 platform.MirConnection* connection
2934 platform.MirSurface* mirSurface
2935}
2936
2937@extension("VK_KHR_android_surface")
2938class VkAndroidSurfaceCreateInfoKHR {
2939 VkStructureType sType
2940 const void* pNext
2941 VkAndroidSurfaceCreateFlagsKHR flags
2942 platform.ANativeWindow* window
2943}
2944
2945@extension("VK_KHR_win32_surface")
2946class VkWin32SurfaceCreateInfoKHR {
2947 VkStructureType sType
2948 const void* pNext
2949 VkWin32SurfaceCreateFlagsKHR flags
2950 platform.HINSTANCE hinstance
2951 platform.HWND hwnd
2952}
2953
Chia-I Wub262ddc2016-03-22 07:38:20 +08002954@extension("VK_ANDROID_native_buffer")
2955class VkNativeBufferANDROID {
2956 VkStructureType sType
2957 const void* pNext
2958 platform.buffer_handle_t handle
2959 int stride
2960 int format
2961 int usage
2962}
2963
Jesse Hall715b86a2016-01-16 16:34:29 -08002964@extension("VK_EXT_debug_report")
2965class VkDebugReportCallbackCreateInfoEXT {
2966 VkStructureType sType
2967 const void* pNext
2968 VkDebugReportFlagsEXT flags
2969 PFN_vkDebugReportCallbackEXT pfnCallback
2970 void* pUserData
2971}
2972
Jesse Hall26763382016-05-20 07:13:52 -07002973@extension("VK_AMD_rasterization_order")
2974class VkPipelineRasterizationStateRasterizationOrderAMD {
2975 VkStructureType sType
2976 const void* pNext
2977 VkRasterizationOrderAMD rasterizationOrder
2978}
2979
2980@extension("VK_EXT_debug_marker")
2981class VkDebugMarkerObjectNameInfoEXT {
2982 VkStructureType sType
2983 const void* pNext
2984 VkDebugReportObjectTypeEXT objectType
2985 u64 object
2986 const char* pObjectName
2987}
2988
2989@extension("VK_EXT_debug_marker")
2990class VkDebugMarkerObjectTagInfoEXT {
2991 VkStructureType sType
2992 const void* pNext
2993 VkDebugReportObjectTypeEXT objectType
2994 u64 object
2995 u64 tagName
2996 platform.size_t tagSize
2997 const void* pTag
2998}
2999
3000@extension("VK_EXT_debug_marker")
3001class VkDebugMarkerMarkerInfoEXT {
3002 VkStructureType sType
3003 const void* pNext
3004 const char* pMarkerName
3005 f32[4] color
3006}
3007
Jesse Hall3f5499b2016-07-26 15:20:40 -07003008@extension("VK_NV_dedicated_allocation")
3009class VkDedicatedAllocationImageCreateInfoNV {
3010 VkStructureType sType
3011 const void* pNext
3012 VkBool32 dedicatedAllocation
3013}
3014
3015@extension("VK_NV_dedicated_allocation")
3016class VkDedicatedAllocationBufferCreateInfoNV {
3017 VkStructureType sType
3018 const void* pNext
3019 VkBool32 dedicatedAllocation
3020}
3021
3022@extension("VK_NV_dedicated_allocation")
3023class VkDedicatedAllocationMemoryAllocateInfoNV {
3024 VkStructureType sType
3025 const void* pNext
3026 VkImage image
3027 VkBuffer buffer
3028}
3029
Jesse Halleb02c472017-02-24 15:13:45 -08003030@extension("VK_NV_external_memory_capabilities")
3031class VkExternalImageFormatPropertiesNV {
3032 VkImageFormatProperties imageFormatProperties
3033 VkExternalMemoryFeatureFlagsNV externalMemoryFeatures
3034 VkExternalMemoryHandleTypeFlagsNV exportFromImportedHandleTypes
3035 VkExternalMemoryHandleTypeFlagsNV compatibleHandleTypes
3036}
3037
3038@extension("VK_NV_external_memory")
3039class VkExternalMemoryImageCreateInfoNV {
3040 VkStructureType sType
3041 const void* pNext
3042 VkExternalMemoryHandleTypeFlagsNV handleTypes
3043}
3044
3045@extension("VK_NV_external_memory")
3046class VkExportMemoryAllocateInfoNV {
3047 VkStructureType sType
3048 const void* pNext
3049 VkExternalMemoryHandleTypeFlagsNV handleTypes
3050}
3051
3052@extension("VK_NV_external_memory_win32")
3053class VkImportMemoryWin32HandleInfoNV {
3054 VkStructureType sType
3055 const void* pNext
3056 VkExternalMemoryHandleTypeFlagsNV handleType
3057 platform.HANDLE handle
3058}
3059
3060@extension("VK_NV_external_memory_win32")
3061class VkExportMemoryWin32HandleInfoNV {
3062 VkStructureType sType
3063 const void* pNext
3064 const platform.SECURITY_ATTRIBUTES* pAttributes
3065 platform.DWORD dwAccess
3066}
3067
3068@extension("VK_NV_win32_keyed_mutex")
3069class VkWin32KeyedMutexAcquireReleaseInfoNV {
3070 VkStructureType sType
3071 const void* pNext
3072 u32 acquireCount
3073 const VkDeviceMemory* pAcquireSyncs
3074 const u64* pAcquireKeys
3075 const u32* pAcquireTimeoutMilliseconds
3076 u32 releaseCount
3077 const VkDeviceMemory* pReleaseSyncs
3078 const u64* pReleaseKeys
3079}
3080
Jesse Hall08e2f482017-03-06 15:22:17 -08003081@extension("VK_KHR_get_physical_device_properties2")
3082class VkPhysicalDeviceFeatures2KHR {
3083 VkStructureType sType
3084 void* pNext
3085 VkPhysicalDeviceFeatures features
3086}
3087
3088@extension("VK_KHR_get_physical_device_properties2")
3089class VkPhysicalDeviceProperties2KHR {
3090 VkStructureType sType
3091 void* pNext
3092 VkPhysicalDeviceProperties properties
3093}
3094
3095@extension("VK_KHR_get_physical_device_properties2")
3096class VkFormatProperties2KHR {
3097 VkStructureType sType
3098 void* pNext
3099 VkFormatProperties formatProperties
3100}
3101
3102@extension("VK_KHR_get_physical_device_properties2")
3103class VkImageFormatProperties2KHR {
3104 VkStructureType sType
3105 void* pNext
3106 VkImageFormatProperties imageFormatProperties
3107}
3108
3109@extension("VK_KHR_get_physical_device_properties2")
3110class VkPhysicalDeviceImageFormatInfo2KHR {
3111 VkStructureType sType
3112 const void* pNext
3113 VkFormat format
3114 VkImageType type
3115 VkImageTiling tiling
3116 VkImageUsageFlags usage
3117 VkImageCreateFlags flags
3118}
3119
3120@extension("VK_KHR_get_physical_device_properties2")
3121class VkQueueFamilyProperties2KHR {
3122 VkStructureType sType
3123 void* pNext
3124 VkQueueFamilyProperties queueFamilyProperties
3125}
3126
3127@extension("VK_KHR_get_physical_device_properties2")
3128class VkPhysicalDeviceMemoryProperties2KHR {
3129 VkStructureType sType
3130 void* pNext
3131 VkPhysicalDeviceMemoryProperties memoryProperties
3132}
3133
3134@extension("VK_KHR_get_physical_device_properties2")
3135class VkSparseImageFormatProperties2KHR {
3136 VkStructureType sType
3137 void* pNext
3138 VkSparseImageFormatProperties properties
3139}
3140
3141@extension("VK_KHR_get_physical_device_properties2")
3142class VkPhysicalDeviceSparseImageFormatInfo2KHR {
3143 VkStructureType sType
3144 const void* pNext
3145 VkFormat format
3146 VkImageType type
3147 VkSampleCountFlagBits samples
3148 VkImageUsageFlags usage
3149 VkImageTiling tiling
3150}
3151
Jesse Halleb02c472017-02-24 15:13:45 -08003152@extension("VK_EXT_validation_flags")
3153class VkValidationFlagsEXT {
3154 VkStructureType sType
3155 const void* pNext
3156 u32 disabledValidationCheckCount
3157 VkValidationCheckEXT* pDisabledValidationChecks
3158}
3159
Jesse Hall08e2f482017-03-06 15:22:17 -08003160@extension("VK_NN_vi_surface")
3161class VkViSurfaceCreateInfoNN {
3162 VkStructureType sType
3163 const void* pNext
3164 VkViSurfaceCreateFlagsNN flags
3165 void* window
3166}
3167
Jesse Halleb02c472017-02-24 15:13:45 -08003168@extension("VK_NVX_device_generated_commands")
3169class VkDeviceGeneratedCommandsFeaturesNVX {
3170 VkStructureType sType
3171 const void* pNext
3172 VkBool32 computeBindingPointSupport
3173}
3174
3175@extension("VK_NVX_device_generated_commands")
3176class VkDeviceGeneratedCommandsLimitsNVX {
3177 VkStructureType sType
3178 const void* pNext
3179 u32 maxIndirectCommandsLayoutTokenCount
3180 u32 maxObjectEntryCounts
3181 u32 minSequenceCountBufferOffsetAlignment
3182 u32 minSequenceIndexBufferOffsetAlignment
3183 u32 minCommandsTokenBufferOffsetAlignment
3184}
3185
3186@extension("VK_NVX_device_generated_commands")
3187class VkIndirectCommandsTokenNVX {
3188 VkIndirectCommandsTokenTypeNVX tokenType
3189 VkBuffer buffer
3190 VkDeviceSize offset
3191}
3192
3193@extension("VK_NVX_device_generated_commands")
3194class VkIndirectCommandsLayoutTokenNVX {
3195 VkIndirectCommandsTokenTypeNVX tokenType
3196 u32 bindingUnit
3197 u32 dynamicCount
3198 u32 divisor
3199}
3200
3201@extension("VK_NVX_device_generated_commands")
3202class VkIndirectCommandsLayoutCreateInfoNVX {
3203 VkStructureType sType
3204 const void* pNext
3205 VkPipelineBindPoint pipelineBindPoint
3206 VkIndirectCommandsLayoutUsageFlagsNVX flags
3207 u32 tokenCount
3208 const VkIndirectCommandsLayoutTokenNVX* pTokens
3209}
3210
3211@extension("VK_NVX_device_generated_commands")
3212class VkCmdProcessCommandsInfoNVX {
3213 VkStructureType sType
3214 const void* pNext
3215 VkObjectTableNVX objectTable
3216 VkIndirectCommandsLayoutNVX indirectCommandsLayout
3217 u32 indirectCommandsTokenCount
3218 const VkIndirectCommandsTokenNVX* pIndirectCommandsTokens
3219 u32 maxSequencesCount
3220 VkCommandBuffer targetCommandBuffer
3221 VkBuffer sequencesCountBuffer
3222 VkDeviceSize sequencesCountOffset
3223 VkBuffer sequencesIndexBuffer
3224 VkDeviceSize sequencesIndexOffset
3225}
3226
3227@extension("VK_NVX_device_generated_commands")
3228class VkCmdReserveSpaceForCommandsInfoNVX {
3229 VkStructureType sType
3230 const void* pNext
3231 VkObjectTableNVX objectTable
3232 VkIndirectCommandsLayoutNVX indirectCommandsLayout
3233 u32 maxSequencesCount
3234}
3235
3236@extension("VK_NVX_device_generated_commands")
3237class VkObjectTableCreateInfoNVX {
3238 VkStructureType sType
3239 const void* pNext
3240 u32 objectCount
3241 const VkObjectEntryTypeNVX* pObjectEntryTypes
3242 const u32* pObjectEntryCounts
3243 const VkObjectEntryUsageFlagsNVX* pObjectEntryUsageFlags
3244 u32 maxUniformBuffersPerDescriptor
3245 u32 maxStorageBuffersPerDescriptor
3246 u32 maxStorageImagesPerDescriptor
3247 u32 maxSampledImagesPerDescriptor
3248 u32 maxPipelineLayouts
3249}
3250
3251@extension("VK_NVX_device_generated_commands")
3252class VkObjectTableEntryNVX {
3253 VkObjectEntryTypeNVX type
3254 VkObjectEntryUsageFlagsNVX flags
3255}
3256
3257@extension("VK_NVX_device_generated_commands")
3258class VkObjectTablePipelineEntryNVX {
3259 VkObjectEntryTypeNVX type
3260 VkObjectEntryUsageFlagsNVX flags
3261 VkPipeline pipeline
3262}
3263
3264@extension("VK_NVX_device_generated_commands")
3265class VkObjectTableDescriptorSetEntryNVX {
3266 VkObjectEntryTypeNVX type
3267 VkObjectEntryUsageFlagsNVX flags
3268 VkPipelineLayout pipelineLayout
3269 VkDescriptorSet descriptorSet
3270}
3271
3272@extension("VK_NVX_device_generated_commands")
3273class VkObjectTableVertexBufferEntryNVX {
3274 VkObjectEntryTypeNVX type
3275 VkObjectEntryUsageFlagsNVX flags
3276 VkBuffer buffer
3277}
3278
3279@extension("VK_NVX_device_generated_commands")
3280class VkObjectTableIndexBufferEntryNVX {
3281 VkObjectEntryTypeNVX type
3282 VkObjectEntryUsageFlagsNVX flags
3283 VkBuffer buffer
Jesse Hall08e2f482017-03-06 15:22:17 -08003284 VkIndexType indexType
Jesse Halleb02c472017-02-24 15:13:45 -08003285}
3286
3287@extension("VK_NVX_device_generated_commands")
3288class VkObjectTablePushConstantEntryNVX {
3289 VkObjectEntryTypeNVX type
3290 VkObjectEntryUsageFlagsNVX flags
3291 VkPipelineLayout pipelineLayout
3292 VkShaderStageFlags stageFlags
3293}
3294
Jesse Hall08e2f482017-03-06 15:22:17 -08003295@extension("VK_EXT_display_surface_counter")
3296class VkSurfaceCapabilities2EXT {
3297 VkStructureType sType
3298 void* pNext
3299 u32 minImageCount
3300 u32 maxImageCount
3301 VkExtent2D currentExtent
3302 VkExtent2D minImageExtent
3303 VkExtent2D maxImageExtent
3304 u32 maxImageArrayLayers
3305 VkSurfaceTransformFlagsKHR supportedTransforms
3306 VkSurfaceTransformFlagBitsKHR currentTransform
3307 VkCompositeAlphaFlagsKHR supportedCompositeAlpha
3308 VkImageUsageFlags supportedUsageFlags
3309 VkSurfaceCounterFlagsEXT supportedSurfaceCounters
3310}
3311
3312@extension("VK_EXT_display_control")
3313class VkDisplayPowerInfoEXT {
3314 VkStructureType sType
3315 const void* pNext
3316 VkDisplayPowerStateEXT powerState
3317}
3318
3319@extension("VK_EXT_display_control")
3320class VkDeviceEventInfoEXT {
3321 VkStructureType sType
3322 const void* pNext
3323 VkDeviceEventTypeEXT deviceEvent
3324}
3325
3326@extension("VK_EXT_display_control")
3327class VkDisplayEventInfoEXT {
3328 VkStructureType sType
3329 const void* pNext
3330 VkDisplayEventTypeEXT displayEvent
3331}
3332
3333@extension("VK_EXT_display_control")
3334class VkSwapchainCounterCreateInfoEXT {
3335 VkStructureType sType
3336 const void* pNext
3337 VkSurfaceCounterFlagsEXT surfaceCounters
3338}
Jesse Hall1356b0d2015-11-23 17:24:58 -08003339
Jesse Halld27f6aa2015-08-15 17:58:48 -07003340////////////////
3341// Commands //
3342////////////////
3343
3344// Function pointers. TODO: add support for function pointers.
3345
3346@external type void* PFN_vkVoidFunction
3347@pfn cmd void vkVoidFunction() {
3348}
3349
Jesse Hall3fbc8562015-11-29 22:10:52 -08003350@external type void* PFN_vkAllocationFunction
3351@pfn cmd void* vkAllocationFunction(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003352 void* pUserData,
3353 platform.size_t size,
3354 platform.size_t alignment,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003355 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08003356 return ?
3357}
3358
Jesse Hall3fbc8562015-11-29 22:10:52 -08003359@external type void* PFN_vkReallocationFunction
3360@pfn cmd void* vkReallocationFunction(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003361 void* pUserData,
3362 void* pOriginal,
3363 platform.size_t size,
3364 platform.size_t alignment,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003365 VkSystemAllocationScope allocationScope) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003366 return ?
3367}
3368
3369@external type void* PFN_vkFreeFunction
3370@pfn cmd void vkFreeFunction(
3371 void* pUserData,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003372 void* pMemory) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003373}
3374
Jesse Hall3fbc8562015-11-29 22:10:52 -08003375@external type void* PFN_vkInternalAllocationNotification
3376@pfn cmd void vkInternalAllocationNotification(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003377 void* pUserData,
3378 platform.size_t size,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003379 VkInternalAllocationType allocationType,
3380 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08003381}
3382
3383@external type void* PFN_vkInternalFreeNotification
3384@pfn cmd void vkInternalFreeNotification(
3385 void* pUserData,
3386 platform.size_t size,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003387 VkInternalAllocationType allocationType,
3388 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08003389}
Jesse Halld27f6aa2015-08-15 17:58:48 -07003390
3391// Global functions
3392
3393@threadSafety("system")
3394cmd VkResult vkCreateInstance(
3395 const VkInstanceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003396 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003397 VkInstance* pInstance) {
3398 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO)
3399
3400 instance := ?
3401 pInstance[0] = instance
3402 State.Instances[instance] = new!InstanceObject()
3403
Jesse Hall3dd678a2016-01-08 21:52:01 -08003404 layers := pCreateInfo.ppEnabledLayerNames[0:pCreateInfo.enabledLayerCount]
3405 extensions := pCreateInfo.ppEnabledExtensionNames[0:pCreateInfo.enabledExtensionCount]
Jesse Halld27f6aa2015-08-15 17:58:48 -07003406
3407 return ?
3408}
3409
3410@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003411cmd void vkDestroyInstance(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003412 VkInstance instance,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003413 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003414 instanceObject := GetInstance(instance)
3415
3416 State.Instances[instance] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003417}
3418
3419@threadSafety("system")
3420cmd VkResult vkEnumeratePhysicalDevices(
3421 VkInstance instance,
3422 u32* pPhysicalDeviceCount,
3423 VkPhysicalDevice* pPhysicalDevices) {
3424 instanceObject := GetInstance(instance)
3425
3426 physicalDeviceCount := as!u32(?)
3427 pPhysicalDeviceCount[0] = physicalDeviceCount
3428 physicalDevices := pPhysicalDevices[0:physicalDeviceCount]
3429
3430 for i in (0 .. physicalDeviceCount) {
3431 physicalDevice := ?
3432 physicalDevices[i] = physicalDevice
3433 if !(physicalDevice in State.PhysicalDevices) {
3434 State.PhysicalDevices[physicalDevice] = new!PhysicalDeviceObject(instance: instance)
3435 }
3436 }
3437
3438 return ?
3439}
3440
3441cmd PFN_vkVoidFunction vkGetDeviceProcAddr(
3442 VkDevice device,
3443 const char* pName) {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003444 if device != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003445 device := GetDevice(device)
3446 }
3447
3448 return ?
3449}
3450
3451cmd PFN_vkVoidFunction vkGetInstanceProcAddr(
3452 VkInstance instance,
3453 const char* pName) {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003454 if instance != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003455 instanceObject := GetInstance(instance)
3456 }
3457
3458 return ?
3459}
3460
Jesse Hall606a54e2015-11-19 22:17:28 -08003461cmd void vkGetPhysicalDeviceProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003462 VkPhysicalDevice physicalDevice,
3463 VkPhysicalDeviceProperties* pProperties) {
3464 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3465
3466 properties := ?
3467 pProperties[0] = properties
Jesse Halld27f6aa2015-08-15 17:58:48 -07003468}
3469
Jesse Hall606a54e2015-11-19 22:17:28 -08003470cmd void vkGetPhysicalDeviceQueueFamilyProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003471 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003472 u32* pQueueFamilyPropertyCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003473 VkQueueFamilyProperties* pQueueFamilyProperties) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003474 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003475 // TODO: Figure out how to express fetch-count-or-properties
3476 // This version fails 'apic validate' with 'fence not allowed in
3477 // *semantic.Branch'. Other attempts have failed with the same or other
3478 // errors.
3479 // if pQueueFamilyProperties != null {
3480 // queuesProperties := pQueueFamilyProperties[0:pCount[0]]
3481 // for i in (0 .. pCount[0]) {
3482 // queueProperties := as!VkQueueFamilyProperties(?)
3483 // queuesProperties[i] = queueProperties
3484 // }
3485 // } else {
3486 // count := ?
3487 // pCount[0] = count
3488 // }
Jesse Halld27f6aa2015-08-15 17:58:48 -07003489}
3490
Jesse Hall606a54e2015-11-19 22:17:28 -08003491cmd void vkGetPhysicalDeviceMemoryProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003492 VkPhysicalDevice physicalDevice,
3493 VkPhysicalDeviceMemoryProperties* pMemoryProperties) {
3494 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3495
3496 memoryProperties := ?
3497 pMemoryProperties[0] = memoryProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07003498}
3499
Jesse Hall606a54e2015-11-19 22:17:28 -08003500cmd void vkGetPhysicalDeviceFeatures(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003501 VkPhysicalDevice physicalDevice,
3502 VkPhysicalDeviceFeatures* pFeatures) {
3503 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3504
3505 features := ?
3506 pFeatures[0] = features
Jesse Halld27f6aa2015-08-15 17:58:48 -07003507}
3508
Jesse Hall606a54e2015-11-19 22:17:28 -08003509cmd void vkGetPhysicalDeviceFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003510 VkPhysicalDevice physicalDevice,
3511 VkFormat format,
3512 VkFormatProperties* pFormatProperties) {
3513 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3514
3515 formatProperties := ?
3516 pFormatProperties[0] = formatProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07003517}
3518
Jesse Halla9e57032015-11-30 01:03:10 -08003519cmd VkResult vkGetPhysicalDeviceImageFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003520 VkPhysicalDevice physicalDevice,
3521 VkFormat format,
3522 VkImageType type,
3523 VkImageTiling tiling,
3524 VkImageUsageFlags usage,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003525 VkImageCreateFlags flags,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003526 VkImageFormatProperties* pImageFormatProperties) {
3527 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3528
3529 imageFormatProperties := ?
3530 pImageFormatProperties[0] = imageFormatProperties
Jesse Halla9e57032015-11-30 01:03:10 -08003531
3532 return ?
Jesse Halld27f6aa2015-08-15 17:58:48 -07003533}
3534
Jesse Halld27f6aa2015-08-15 17:58:48 -07003535
3536// Device functions
3537
3538@threadSafety("system")
3539cmd VkResult vkCreateDevice(
3540 VkPhysicalDevice physicalDevice,
3541 const VkDeviceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003542 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003543 VkDevice* pDevice) {
3544 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO)
3545 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3546
3547 device := ?
3548 pDevice[0] = device
3549 State.Devices[device] = new!DeviceObject(physicalDevice: physicalDevice)
3550
3551 return ?
3552}
3553
3554@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003555cmd void vkDestroyDevice(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003556 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003557 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003558 deviceObject := GetDevice(device)
3559
3560 State.Devices[device] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003561}
3562
3563
3564// Extension discovery functions
3565
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003566cmd VkResult vkEnumerateInstanceLayerProperties(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003567 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003568 VkLayerProperties* pProperties) {
3569 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08003570 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07003571
3572 properties := pProperties[0:count]
3573 for i in (0 .. count) {
3574 property := ?
3575 properties[i] = property
3576 }
3577
3578 return ?
3579}
3580
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003581cmd VkResult vkEnumerateInstanceExtensionProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003582 const char* pLayerName,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003583 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003584 VkExtensionProperties* pProperties) {
3585 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08003586 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07003587
3588 properties := pProperties[0:count]
3589 for i in (0 .. count) {
3590 property := ?
3591 properties[i] = property
3592 }
3593
3594 return ?
3595}
3596
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003597cmd VkResult vkEnumerateDeviceLayerProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003598 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003599 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003600 VkLayerProperties* pProperties) {
3601 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3602 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08003603 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07003604
3605 properties := pProperties[0:count]
3606 for i in (0 .. count) {
3607 property := ?
3608 properties[i] = property
3609 }
3610
3611 return ?
3612}
3613
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003614cmd VkResult vkEnumerateDeviceExtensionProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003615 VkPhysicalDevice physicalDevice,
3616 const char* pLayerName,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003617 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003618 VkExtensionProperties* pProperties) {
3619 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3620
3621 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08003622 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07003623
3624 properties := pProperties[0:count]
3625 for i in (0 .. count) {
3626 property := ?
3627 properties[i] = property
3628 }
3629
3630 return ?
3631}
3632
3633
3634// Queue functions
3635
3636@threadSafety("system")
Jesse Hall606a54e2015-11-19 22:17:28 -08003637cmd void vkGetDeviceQueue(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003638 VkDevice device,
3639 u32 queueFamilyIndex,
3640 u32 queueIndex,
3641 VkQueue* pQueue) {
3642 deviceObject := GetDevice(device)
3643
3644 queue := ?
3645 pQueue[0] = queue
3646
3647 if !(queue in State.Queues) {
3648 State.Queues[queue] = new!QueueObject(device: device)
3649 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07003650}
3651
3652@threadSafety("app")
3653cmd VkResult vkQueueSubmit(
3654 VkQueue queue,
Jesse Halla366a512015-11-19 22:30:07 -08003655 u32 submitCount,
Jesse Hallb00daad2015-11-29 19:46:20 -08003656 const VkSubmitInfo* pSubmits,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003657 VkFence fence) {
3658 queueObject := GetQueue(queue)
3659
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003660 if fence != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003661 fenceObject := GetFence(fence)
3662 assert(fenceObject.device == queueObject.device)
3663 }
3664
Jesse Hall3fbc8562015-11-29 22:10:52 -08003665 // commandBuffers := pcommandBuffers[0:commandBufferCount]
3666 // for i in (0 .. commandBufferCount) {
3667 // commandBuffer := commandBuffers[i]
3668 // commandBufferObject := GetCommandBuffer(commandBuffer)
3669 // assert(commandBufferObject.device == queueObject.device)
Jesse Halla366a512015-11-19 22:30:07 -08003670 //
Jesse Hall3fbc8562015-11-29 22:10:52 -08003671 // validate("QueueCheck", commandBufferObject.queueFlags in queueObject.flags,
3672 // "vkQueueSubmit: enqueued commandBuffer requires missing queue capabilities.")
Jesse Halla366a512015-11-19 22:30:07 -08003673 // }
Jesse Halld27f6aa2015-08-15 17:58:48 -07003674
3675 return ?
3676}
3677
3678@threadSafety("system")
3679cmd VkResult vkQueueWaitIdle(
3680 VkQueue queue) {
3681 queueObject := GetQueue(queue)
3682
3683 return ?
3684}
3685
3686@threadSafety("system")
3687cmd VkResult vkDeviceWaitIdle(
3688 VkDevice device) {
3689 deviceObject := GetDevice(device)
3690
3691 return ?
3692}
3693
3694
3695// Memory functions
3696
3697@threadSafety("system")
Jesse Hall3fbc8562015-11-29 22:10:52 -08003698cmd VkResult vkAllocateMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003699 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003700 const VkMemoryAllocateInfo* pAllocateInfo,
3701 const VkAllocationCallbacks* pAllocator,
3702 VkDeviceMemory* pMemory) {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08003703 assert(pAllocateInfo.sType == VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003704 deviceObject := GetDevice(device)
3705
Jesse Hall3fbc8562015-11-29 22:10:52 -08003706 memory := ?
3707 pMemory[0] = memory
3708 State.DeviceMemories[memory] = new!DeviceMemoryObject(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003709 device: device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003710 allocationSize: pAllocateInfo[0].allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003711
3712 return ?
3713}
3714
3715@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003716cmd void vkFreeMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003717 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003718 VkDeviceMemory memory,
3719 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003720 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003721 memoryObject := GetDeviceMemory(memory)
3722 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003723
3724 // Check that no objects are still bound before freeing.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003725 validate("MemoryCheck", len(memoryObject.boundObjects) == 0,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003726 "vkFreeMemory: objects still bound")
Jesse Hall3fbc8562015-11-29 22:10:52 -08003727 validate("MemoryCheck", len(memoryObject.boundCommandBuffers) == 0,
3728 "vkFreeMemory: commandBuffers still bound")
3729 State.DeviceMemories[memory] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003730}
3731
3732@threadSafety("app")
3733cmd VkResult vkMapMemory(
3734 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003735 VkDeviceMemory memory,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003736 VkDeviceSize offset,
3737 VkDeviceSize size,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003738 VkMemoryMapFlags flags,
3739 void** ppData) {
3740 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003741 memoryObject := GetDeviceMemory(memory)
3742 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003743
3744 assert(flags == as!VkMemoryMapFlags(0))
Jesse Hall3fbc8562015-11-29 22:10:52 -08003745 assert((offset + size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003746
3747 return ?
3748}
3749
3750@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003751cmd void vkUnmapMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003752 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003753 VkDeviceMemory memory) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003754 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003755 memoryObject := GetDeviceMemory(memory)
3756 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003757}
3758
3759cmd VkResult vkFlushMappedMemoryRanges(
3760 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003761 u32 memoryRangeCount
3762 const VkMappedMemoryRange* pMemoryRanges) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003763 deviceObject := GetDevice(device)
3764
Jesse Hall3fbc8562015-11-29 22:10:52 -08003765 memoryRanges := pMemoryRanges[0:memoryRangeCount]
3766 for i in (0 .. memoryRangeCount) {
3767 memoryRange := memoryRanges[i]
3768 memoryObject := GetDeviceMemory(memoryRange.memory)
3769 assert(memoryObject.device == device)
3770 assert((memoryRange.offset + memoryRange.size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003771 }
3772
3773 return ?
3774}
3775
3776cmd VkResult vkInvalidateMappedMemoryRanges(
3777 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003778 u32 memoryRangeCount,
3779 const VkMappedMemoryRange* pMemoryRanges) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003780 deviceObject := GetDevice(device)
3781
Jesse Hall3fbc8562015-11-29 22:10:52 -08003782 memoryRanges := pMemoryRanges[0:memoryRangeCount]
3783 for i in (0 .. memoryRangeCount) {
3784 memoryRange := memoryRanges[i]
3785 memoryObject := GetDeviceMemory(memoryRange.memory)
3786 assert(memoryObject.device == device)
3787 assert((memoryRange.offset + memoryRange.size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003788 }
3789
3790 return ?
3791}
3792
3793
3794// Memory management API functions
3795
Jesse Hall606a54e2015-11-19 22:17:28 -08003796cmd void vkGetDeviceMemoryCommitment(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003797 VkDevice device,
3798 VkDeviceMemory memory,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003799 VkDeviceSize* pCommittedMemoryInBytes) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003800 deviceObject := GetDevice(device)
3801
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003802 if memory != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003803 memoryObject := GetDeviceMemory(memory)
3804 assert(memoryObject.device == device)
3805 }
3806
3807 committedMemoryInBytes := ?
3808 pCommittedMemoryInBytes[0] = committedMemoryInBytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07003809}
3810
Jesse Hall606a54e2015-11-19 22:17:28 -08003811cmd void vkGetBufferMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003812 VkDevice device,
3813 VkBuffer buffer,
3814 VkMemoryRequirements* pMemoryRequirements) {
3815 deviceObject := GetDevice(device)
3816 bufferObject := GetBuffer(buffer)
3817 assert(bufferObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003818}
3819
3820cmd VkResult vkBindBufferMemory(
3821 VkDevice device,
3822 VkBuffer buffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003823 VkDeviceMemory memory,
3824 VkDeviceSize memoryOffset) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003825 deviceObject := GetDevice(device)
3826 bufferObject := GetBuffer(buffer)
3827 assert(bufferObject.device == device)
3828
3829 // Unbind buffer from previous memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003830 if bufferObject.memory != NULL_HANDLE {
3831 memoryObject := GetDeviceMemory(bufferObject.memory)
3832 memoryObject.boundObjects[as!u64(buffer)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003833 }
3834
3835 // Bind buffer to given memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003836 if memory != NULL_HANDLE {
3837 memoryObject := GetDeviceMemory(memory)
3838 assert(memoryObject.device == device)
3839 memoryObject.boundObjects[as!u64(buffer)] = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003840 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08003841 bufferObject.memory = memory
3842 bufferObject.memoryOffset = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003843
3844 return ?
3845}
3846
Jesse Hall606a54e2015-11-19 22:17:28 -08003847cmd void vkGetImageMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003848 VkDevice device,
3849 VkImage image,
3850 VkMemoryRequirements* pMemoryRequirements) {
3851 deviceObject := GetDevice(device)
3852 imageObject := GetImage(image)
3853 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003854}
3855
3856cmd VkResult vkBindImageMemory(
3857 VkDevice device,
3858 VkImage image,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003859 VkDeviceMemory memory,
3860 VkDeviceSize memoryOffset) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003861 deviceObject := GetDevice(device)
3862 imageObject := GetImage(image)
3863 assert(imageObject.device == device)
3864
3865 // Unbind image from previous memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003866 if imageObject.memory != NULL_HANDLE {
3867 memoryObject := GetDeviceMemory(imageObject.memory)
3868 memoryObject.boundObjects[as!u64(image)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003869 }
3870
3871 // Bind image to given memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003872 if memory != NULL_HANDLE {
3873 memoryObject := GetDeviceMemory(memory)
3874 assert(memoryObject.device == device)
3875 memoryObject.boundObjects[as!u64(image)] = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003876 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08003877 imageObject.memory = memory
3878 imageObject.memoryOffset = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003879
3880 return ?
3881}
3882
Jesse Hall606a54e2015-11-19 22:17:28 -08003883cmd void vkGetImageSparseMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003884 VkDevice device,
3885 VkImage image,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003886 u32* pSparseMemoryRequirementCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003887 VkSparseImageMemoryRequirements* pSparseMemoryRequirements) {
3888 deviceObject := GetDevice(device)
3889 imageObject := GetImage(image)
3890 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003891}
3892
Jesse Hall606a54e2015-11-19 22:17:28 -08003893cmd void vkGetPhysicalDeviceSparseImageFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003894 VkPhysicalDevice physicalDevice,
3895 VkFormat format,
3896 VkImageType type,
Jesse Hall091ed9e2015-11-30 00:55:29 -08003897 VkSampleCountFlagBits samples,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003898 VkImageUsageFlags usage,
3899 VkImageTiling tiling,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003900 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003901 VkSparseImageFormatProperties* pProperties) {
3902 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003903}
3904
Jesse Halla6429252015-11-29 18:59:42 -08003905cmd VkResult vkQueueBindSparse(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003906 VkQueue queue,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003907 u32 bindInfoCount,
Jesse Halla6429252015-11-29 18:59:42 -08003908 const VkBindSparseInfo* pBindInfo,
3909 VkFence fence) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003910 queueObject := GetQueue(queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003911
3912 return ?
3913}
3914
3915
3916// Fence functions
3917
3918@threadSafety("system")
3919cmd VkResult vkCreateFence(
3920 VkDevice device,
3921 const VkFenceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003922 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003923 VkFence* pFence) {
3924 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_FENCE_CREATE_INFO)
3925 deviceObject := GetDevice(device)
3926
3927 fence := ?
3928 pFence[0] = fence
3929 State.Fences[fence] = new!FenceObject(
Jesse Halld8bade02015-11-24 10:24:18 -08003930 device: device, signaled: (pCreateInfo.flags == as!VkFenceCreateFlags(VK_FENCE_CREATE_SIGNALED_BIT)))
Jesse Halld27f6aa2015-08-15 17:58:48 -07003931
3932 return ?
3933}
3934
3935@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003936cmd void vkDestroyFence(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003937 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003938 VkFence fence,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003939 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003940 deviceObject := GetDevice(device)
3941 fenceObject := GetFence(fence)
3942 assert(fenceObject.device == device)
3943
3944 State.Fences[fence] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003945}
3946
3947@threadSafety("system")
3948cmd VkResult vkResetFences(
3949 VkDevice device,
3950 u32 fenceCount,
3951 const VkFence* pFences) {
3952 deviceObject := GetDevice(device)
3953
3954 fences := pFences[0:fenceCount]
3955 for i in (0 .. fenceCount) {
3956 fence := fences[i]
3957 fenceObject := GetFence(fence)
3958 assert(fenceObject.device == device)
3959 fenceObject.signaled = false
3960 }
3961
3962 return ?
3963}
3964
3965@threadSafety("system")
3966cmd VkResult vkGetFenceStatus(
3967 VkDevice device,
3968 VkFence fence) {
3969 deviceObject := GetDevice(device)
3970 fenceObject := GetFence(fence)
3971 assert(fenceObject.device == device)
3972
3973 return ?
3974}
3975
3976@threadSafety("system")
3977cmd VkResult vkWaitForFences(
3978 VkDevice device,
3979 u32 fenceCount,
3980 const VkFence* pFences,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003981 VkBool32 waitAll,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003982 u64 timeout) { /// timeout in nanoseconds
3983 deviceObject := GetDevice(device)
3984
3985 fences := pFences[0:fenceCount]
3986 for i in (0 .. fenceCount) {
3987 fence := fences[i]
3988 fenceObject := GetFence(fence)
3989 assert(fenceObject.device == device)
3990 }
3991
3992 return ?
3993}
3994
3995
3996// Queue semaphore functions
3997
3998@threadSafety("system")
3999cmd VkResult vkCreateSemaphore(
4000 VkDevice device,
4001 const VkSemaphoreCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004002 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004003 VkSemaphore* pSemaphore) {
4004 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO)
4005 deviceObject := GetDevice(device)
4006
4007 semaphore := ?
4008 pSemaphore[0] = semaphore
4009 State.Semaphores[semaphore] = new!SemaphoreObject(device: device)
4010
4011 return ?
4012}
4013
4014@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004015cmd void vkDestroySemaphore(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004016 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004017 VkSemaphore semaphore,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004018 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004019 deviceObject := GetDevice(device)
4020 semaphoreObject := GetSemaphore(semaphore)
4021 assert(semaphoreObject.device == device)
4022
4023 State.Semaphores[semaphore] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004024}
4025
Jesse Halld27f6aa2015-08-15 17:58:48 -07004026
4027// Event functions
4028
4029@threadSafety("system")
4030cmd VkResult vkCreateEvent(
4031 VkDevice device,
4032 const VkEventCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004033 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004034 VkEvent* pEvent) {
4035 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_EVENT_CREATE_INFO)
4036 deviceObject := GetDevice(device)
4037
4038 event := ?
4039 pEvent[0] = event
4040 State.Events[event] = new!EventObject(device: device)
4041
4042 return ?
4043}
4044
4045@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004046cmd void vkDestroyEvent(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004047 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004048 VkEvent event,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004049 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004050 deviceObject := GetDevice(device)
4051 eventObject := GetEvent(event)
4052 assert(eventObject.device == device)
4053
4054 State.Events[event] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004055}
4056
4057@threadSafety("system")
4058cmd VkResult vkGetEventStatus(
4059 VkDevice device,
4060 VkEvent event) {
4061 deviceObject := GetDevice(device)
4062 eventObject := GetEvent(event)
4063 assert(eventObject.device == device)
4064
4065 return ?
4066}
4067
4068@threadSafety("system")
4069cmd VkResult vkSetEvent(
4070 VkDevice device,
4071 VkEvent event) {
4072 deviceObject := GetDevice(device)
4073 eventObject := GetEvent(event)
4074 assert(eventObject.device == device)
4075
4076 return ?
4077}
4078
4079@threadSafety("system")
4080cmd VkResult vkResetEvent(
4081 VkDevice device,
4082 VkEvent event) {
4083 deviceObject := GetDevice(device)
4084 eventObject := GetEvent(event)
4085 assert(eventObject.device == device)
4086
4087 return ?
4088}
4089
4090
4091// Query functions
4092
4093@threadSafety("system")
4094cmd VkResult vkCreateQueryPool(
4095 VkDevice device,
4096 const VkQueryPoolCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004097 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004098 VkQueryPool* pQueryPool) {
4099 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO)
4100 deviceObject := GetDevice(device)
4101
4102 queryPool := ?
4103 pQueryPool[0] = queryPool
4104 State.QueryPools[queryPool] = new!QueryPoolObject(device: device)
4105
4106 return ?
4107}
4108
4109@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004110cmd void vkDestroyQueryPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004111 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004112 VkQueryPool queryPool,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004113 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004114 deviceObject := GetDevice(device)
4115 queryPoolObject := GetQueryPool(queryPool)
4116 assert(queryPoolObject.device == device)
4117
4118 State.QueryPools[queryPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004119}
4120
4121@threadSafety("system")
4122cmd VkResult vkGetQueryPoolResults(
4123 VkDevice device,
4124 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004125 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004126 u32 queryCount,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004127 platform.size_t dataSize,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004128 void* pData,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004129 VkDeviceSize stride,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004130 VkQueryResultFlags flags) {
4131 deviceObject := GetDevice(device)
4132 queryPoolObject := GetQueryPool(queryPool)
4133 assert(queryPoolObject.device == device)
4134
Jesse Halld27f6aa2015-08-15 17:58:48 -07004135 data := pData[0:dataSize]
4136
4137 return ?
4138}
4139
4140// Buffer functions
4141
4142@threadSafety("system")
4143cmd VkResult vkCreateBuffer(
4144 VkDevice device,
4145 const VkBufferCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004146 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004147 VkBuffer* pBuffer) {
4148 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO)
4149 deviceObject := GetDevice(device)
4150
4151 buffer := ?
4152 pBuffer[0] = buffer
4153 State.Buffers[buffer] = new!BufferObject(device: device)
4154
4155 return ?
4156}
4157
4158@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004159cmd void vkDestroyBuffer(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004160 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004161 VkBuffer buffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004162 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004163 deviceObject := GetDevice(device)
4164 bufferObject := GetBuffer(buffer)
4165 assert(bufferObject.device == device)
4166
Jesse Hall3fbc8562015-11-29 22:10:52 -08004167 assert(bufferObject.memory == 0)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004168 State.Buffers[buffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004169}
4170
4171
4172// Buffer view functions
4173
4174@threadSafety("system")
4175cmd VkResult vkCreateBufferView(
4176 VkDevice device,
4177 const VkBufferViewCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004178 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004179 VkBufferView* pView) {
4180 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO)
4181 deviceObject := GetDevice(device)
4182
4183 bufferObject := GetBuffer(pCreateInfo.buffer)
4184 assert(bufferObject.device == device)
4185
4186 view := ?
4187 pView[0] = view
4188 State.BufferViews[view] = new!BufferViewObject(device: device, buffer: pCreateInfo.buffer)
4189
4190 return ?
4191}
4192
4193@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004194cmd void vkDestroyBufferView(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004195 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004196 VkBufferView bufferView,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004197 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004198 deviceObject := GetDevice(device)
4199 bufferViewObject := GetBufferView(bufferView)
4200 assert(bufferViewObject.device == device)
4201
4202 State.BufferViews[bufferView] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004203}
4204
4205
4206// Image functions
4207
4208@threadSafety("system")
4209cmd VkResult vkCreateImage(
4210 VkDevice device,
4211 const VkImageCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004212 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004213 VkImage* pImage) {
4214 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO)
4215 deviceObject := GetDevice(device)
4216
4217 image := ?
4218 pImage[0] = image
4219 State.Images[image] = new!ImageObject(device: device)
4220
4221 return ?
4222}
4223
4224@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004225cmd void vkDestroyImage(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004226 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004227 VkImage image,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004228 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004229 deviceObject := GetDevice(device)
4230 imageObject := GetImage(image)
4231 assert(imageObject.device == device)
4232
Jesse Hall3fbc8562015-11-29 22:10:52 -08004233 assert(imageObject.memory == 0)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004234 State.Images[image] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004235}
4236
Jesse Hall606a54e2015-11-19 22:17:28 -08004237cmd void vkGetImageSubresourceLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004238 VkDevice device,
4239 VkImage image,
4240 const VkImageSubresource* pSubresource,
4241 VkSubresourceLayout* pLayout) {
4242 deviceObject := GetDevice(device)
4243 imageObject := GetImage(image)
4244 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004245}
4246
4247
4248// Image view functions
4249
4250@threadSafety("system")
4251cmd VkResult vkCreateImageView(
4252 VkDevice device,
4253 const VkImageViewCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004254 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004255 VkImageView* pView) {
4256 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO)
4257 deviceObject := GetDevice(device)
4258
4259 imageObject := GetImage(pCreateInfo.image)
4260 assert(imageObject.device == device)
4261
4262 view := ?
4263 pView[0] = view
4264 State.ImageViews[view] = new!ImageViewObject(device: device, image: pCreateInfo.image)
4265
4266 return ?
4267}
4268
4269@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004270cmd void vkDestroyImageView(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004271 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004272 VkImageView imageView,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004273 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004274 deviceObject := GetDevice(device)
4275 imageViewObject := GetImageView(imageView)
4276 assert(imageViewObject.device == device)
4277
4278 State.ImageViews[imageView] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004279}
4280
4281
4282// Shader functions
4283
4284cmd VkResult vkCreateShaderModule(
4285 VkDevice device,
4286 const VkShaderModuleCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004287 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004288 VkShaderModule* pShaderModule) {
4289 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO)
4290 deviceObject := GetDevice(device)
4291
4292 shaderModule := ?
4293 pShaderModule[0] = shaderModule
4294 State.ShaderModules[shaderModule] = new!ShaderModuleObject(device: device)
4295
4296 return ?
4297}
4298
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004299cmd void vkDestroyShaderModule(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004300 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004301 VkShaderModule shaderModule,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004302 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004303 deviceObject := GetDevice(device)
4304 shaderModuleObject := GetShaderModule(shaderModule)
4305 assert(shaderModuleObject.device == device)
4306
4307 State.ShaderModules[shaderModule] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004308}
4309
Jesse Halld27f6aa2015-08-15 17:58:48 -07004310
4311// Pipeline functions
4312
4313cmd VkResult vkCreatePipelineCache(
4314 VkDevice device,
4315 const VkPipelineCacheCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004316 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004317 VkPipelineCache* pPipelineCache) {
4318 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO)
4319 deviceObject := GetDevice(device)
4320
4321 pipelineCache := ?
4322 pPipelineCache[0] = pipelineCache
4323 State.PipelineCaches[pipelineCache] = new!PipelineCacheObject(device: device)
4324
4325 return ?
4326}
4327
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004328cmd void vkDestroyPipelineCache(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004329 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004330 VkPipelineCache pipelineCache,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004331 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004332 deviceObject := GetDevice(device)
4333 pipelineCacheObject := GetPipelineCache(pipelineCache)
4334 assert(pipelineCacheObject.device == device)
4335
4336 State.PipelineCaches[pipelineCache] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004337}
4338
Jesse Halld27f6aa2015-08-15 17:58:48 -07004339cmd VkResult vkGetPipelineCacheData(
4340 VkDevice device,
4341 VkPipelineCache pipelineCache,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004342 platform.size_t* pDataSize,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004343 void* pData) {
4344 deviceObject := GetDevice(device)
4345 pipelineCacheObject := GetPipelineCache(pipelineCache)
4346 assert(pipelineCacheObject.device == device)
4347
4348 return ?
4349}
4350
4351cmd VkResult vkMergePipelineCaches(
4352 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004353 VkPipelineCache dstCache,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004354 u32 srcCacheCount,
4355 const VkPipelineCache* pSrcCaches) {
4356 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004357 dstCacheObject := GetPipelineCache(dstCache)
4358 assert(dstCacheObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004359
4360 srcCaches := pSrcCaches[0:srcCacheCount]
4361 for i in (0 .. srcCacheCount) {
4362 srcCache := srcCaches[i]
4363 srcCacheObject := GetPipelineCache(srcCache)
4364 assert(srcCacheObject.device == device)
4365 }
4366
4367 return ?
4368}
4369
4370cmd VkResult vkCreateGraphicsPipelines(
4371 VkDevice device,
4372 VkPipelineCache pipelineCache,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004373 u32 createInfoCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004374 const VkGraphicsPipelineCreateInfo* pCreateInfos,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004375 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004376 VkPipeline* pPipelines) {
4377 deviceObject := GetDevice(device)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004378 if pipelineCache != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004379 pipelineCacheObject := GetPipelineCache(pipelineCache)
4380 assert(pipelineCacheObject.device == device)
4381 }
4382
Jesse Hall03b6fe12015-11-24 12:44:21 -08004383 createInfos := pCreateInfos[0:createInfoCount]
4384 pipelines := pPipelines[0:createInfoCount]
4385 for i in (0 .. createInfoCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004386 pipeline := ?
4387 pipelines[i] = pipeline
4388 State.Pipelines[pipeline] = new!PipelineObject(device: device)
4389 }
4390
4391 return ?
4392}
4393
4394cmd VkResult vkCreateComputePipelines(
4395 VkDevice device,
4396 VkPipelineCache pipelineCache,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004397 u32 createInfoCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004398 const VkComputePipelineCreateInfo* pCreateInfos,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004399 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004400 VkPipeline* pPipelines) {
4401 deviceObject := GetDevice(device)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004402 if pipelineCache != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004403 pipelineCacheObject := GetPipelineCache(pipelineCache)
4404 assert(pipelineCacheObject.device == device)
4405 }
4406
Jesse Hall03b6fe12015-11-24 12:44:21 -08004407 createInfos := pCreateInfos[0:createInfoCount]
4408 pipelines := pPipelines[0:createInfoCount]
4409 for i in (0 .. createInfoCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004410 pipeline := ?
4411 pipelines[i] = pipeline
4412 State.Pipelines[pipeline] = new!PipelineObject(device: device)
4413 }
4414
4415 return ?
4416}
4417
4418@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004419cmd void vkDestroyPipeline(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004420 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004421 VkPipeline pipeline,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004422 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004423 deviceObject := GetDevice(device)
4424 pipelineObjects := GetPipeline(pipeline)
4425 assert(pipelineObjects.device == device)
4426
4427 State.Pipelines[pipeline] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004428}
4429
4430
4431// Pipeline layout functions
4432
4433@threadSafety("system")
4434cmd VkResult vkCreatePipelineLayout(
4435 VkDevice device,
4436 const VkPipelineLayoutCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004437 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004438 VkPipelineLayout* pPipelineLayout) {
4439 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO)
4440 deviceObject := GetDevice(device)
4441
4442 pipelineLayout := ?
4443 pPipelineLayout[0] = pipelineLayout
4444 State.PipelineLayouts[pipelineLayout] = new!PipelineLayoutObject(device: device)
4445
4446 return ?
4447}
4448
4449@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004450cmd void vkDestroyPipelineLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004451 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004452 VkPipelineLayout pipelineLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004453 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004454 deviceObject := GetDevice(device)
4455 pipelineLayoutObjects := GetPipelineLayout(pipelineLayout)
4456 assert(pipelineLayoutObjects.device == device)
4457
4458 State.PipelineLayouts[pipelineLayout] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004459}
4460
4461
4462// Sampler functions
4463
4464@threadSafety("system")
4465cmd VkResult vkCreateSampler(
4466 VkDevice device,
4467 const VkSamplerCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004468 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004469 VkSampler* pSampler) {
4470 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO)
4471 deviceObject := GetDevice(device)
4472
4473 sampler := ?
4474 pSampler[0] = sampler
4475 State.Samplers[sampler] = new!SamplerObject(device: device)
4476
4477 return ?
4478}
4479
4480@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004481cmd void vkDestroySampler(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004482 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004483 VkSampler sampler,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004484 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004485 deviceObject := GetDevice(device)
4486 samplerObject := GetSampler(sampler)
4487 assert(samplerObject.device == device)
4488
4489 State.Samplers[sampler] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004490}
4491
4492
4493// Descriptor set functions
4494
4495@threadSafety("system")
4496cmd VkResult vkCreateDescriptorSetLayout(
4497 VkDevice device,
4498 const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004499 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004500 VkDescriptorSetLayout* pSetLayout) {
4501 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO)
4502 deviceObject := GetDevice(device)
4503
4504 setLayout := ?
4505 pSetLayout[0] = setLayout
4506 State.DescriptorSetLayouts[setLayout] = new!DescriptorSetLayoutObject(device: device)
4507
4508 return ?
4509}
4510
4511@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004512cmd void vkDestroyDescriptorSetLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004513 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004514 VkDescriptorSetLayout descriptorSetLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004515 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004516 deviceObject := GetDevice(device)
4517 descriptorSetLayoutObject := GetDescriptorSetLayout(descriptorSetLayout)
4518 assert(descriptorSetLayoutObject.device == device)
4519
4520 State.DescriptorSetLayouts[descriptorSetLayout] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004521}
4522
4523@threadSafety("system")
4524cmd VkResult vkCreateDescriptorPool(
4525 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004526 const VkDescriptorPoolCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004527 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004528 VkDescriptorPool* pDescriptorPool) {
4529 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO)
4530 deviceObject := GetDevice(device)
4531
4532 descriptorPool := ?
4533 pDescriptorPool[0] = descriptorPool
4534 State.DescriptorPools[descriptorPool] = new!DescriptorPoolObject(device: device)
4535
4536 return ?
4537}
4538
4539@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004540cmd void vkDestroyDescriptorPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004541 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004542 VkDescriptorPool descriptorPool,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004543 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004544 deviceObject := GetDevice(device)
4545 descriptorPoolObject := GetDescriptorPool(descriptorPool)
4546 assert(descriptorPoolObject.device == device)
4547
4548 State.DescriptorPools[descriptorPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004549}
4550
4551@threadSafety("app")
4552cmd VkResult vkResetDescriptorPool(
4553 VkDevice device,
Jesse Hallfbf97b02015-11-20 14:17:03 -08004554 VkDescriptorPool descriptorPool,
4555 VkDescriptorPoolResetFlags flags) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004556 deviceObject := GetDevice(device)
4557 descriptorPoolObject := GetDescriptorPool(descriptorPool)
4558 assert(descriptorPoolObject.device == device)
4559
4560 return ?
4561}
4562
4563@threadSafety("app")
Jesse Hall3fbc8562015-11-29 22:10:52 -08004564cmd VkResult vkAllocateDescriptorSets(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004565 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004566 const VkDescriptorSetAllocateInfo* pAllocateInfo,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004567 VkDescriptorSet* pDescriptorSets) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004568 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004569 allocInfo := pAllocateInfo[0]
Jesse Hallfbf97b02015-11-20 14:17:03 -08004570 descriptorPoolObject := GetDescriptorPool(allocInfo.descriptorPool)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004571
Jesse Hall03b6fe12015-11-24 12:44:21 -08004572 setLayouts := allocInfo.pSetLayouts[0:allocInfo.setCount]
4573 for i in (0 .. allocInfo.setCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004574 setLayout := setLayouts[i]
4575 setLayoutObject := GetDescriptorSetLayout(setLayout)
4576 assert(setLayoutObject.device == device)
4577 }
4578
Jesse Hall03b6fe12015-11-24 12:44:21 -08004579 descriptorSets := pDescriptorSets[0:allocInfo.setCount]
4580 for i in (0 .. allocInfo.setCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004581 descriptorSet := ?
4582 descriptorSets[i] = descriptorSet
4583 State.DescriptorSets[descriptorSet] = new!DescriptorSetObject(device: device)
4584 }
4585
4586 return ?
4587}
4588
Jesse Hallf09c6b12015-08-15 19:54:28 -07004589cmd VkResult vkFreeDescriptorSets(
4590 VkDevice device,
4591 VkDescriptorPool descriptorPool,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004592 u32 descriptorSetCount,
Jesse Hallf09c6b12015-08-15 19:54:28 -07004593 const VkDescriptorSet* pDescriptorSets) {
4594 deviceObject := GetDevice(device)
4595 descriptorPoolObject := GetDescriptorPool(descriptorPool)
4596
Jesse Hall03b6fe12015-11-24 12:44:21 -08004597 descriptorSets := pDescriptorSets[0:descriptorSetCount]
4598 for i in (0 .. descriptorSetCount) {
Jesse Hallf09c6b12015-08-15 19:54:28 -07004599 descriptorSet := descriptorSets[i]
4600 descriptorSetObject := GetDescriptorSet(descriptorSet)
4601 assert(descriptorSetObject.device == device)
4602 State.DescriptorSets[descriptorSet] = null
4603 }
4604
4605 return ?
4606}
4607
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004608cmd void vkUpdateDescriptorSets(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004609 VkDevice device,
Jesse Hallb00daad2015-11-29 19:46:20 -08004610 u32 descriptorWriteCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004611 const VkWriteDescriptorSet* pDescriptorWrites,
Jesse Hallb00daad2015-11-29 19:46:20 -08004612 u32 descriptorCopyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004613 const VkCopyDescriptorSet* pDescriptorCopies) {
4614 deviceObject := GetDevice(device)
4615
Jesse Hallb00daad2015-11-29 19:46:20 -08004616 descriptorWrites := pDescriptorWrites[0:descriptorWriteCount]
4617 for i in (0 .. descriptorWriteCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004618 descriptorWrite := descriptorWrites[i]
Jesse Hall3fbc8562015-11-29 22:10:52 -08004619 descriptorWriteObject := GetDescriptorSet(descriptorWrite.dstSet)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004620 assert(descriptorWriteObject.device == device)
4621 }
4622
Jesse Hallb00daad2015-11-29 19:46:20 -08004623 descriptorCopies := pDescriptorCopies[0:descriptorCopyCount]
4624 for i in (0 .. descriptorCopyCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004625 descriptorCopy := descriptorCopies[i]
Jesse Hall3fbc8562015-11-29 22:10:52 -08004626 descriptorCopyObject := GetDescriptorSet(descriptorCopy.dstSet)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004627 assert(descriptorCopyObject.device == device)
4628 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07004629}
4630
4631
4632// Framebuffer functions
4633
4634@threadSafety("system")
4635cmd VkResult vkCreateFramebuffer(
4636 VkDevice device,
4637 const VkFramebufferCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004638 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004639 VkFramebuffer* pFramebuffer) {
4640 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO)
4641 deviceObject := GetDevice(device)
4642
4643 framebuffer := ?
4644 pFramebuffer[0] = framebuffer
4645 State.Framebuffers[framebuffer] = new!FramebufferObject(device: device)
4646
4647 return ?
4648}
4649
4650@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004651cmd void vkDestroyFramebuffer(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004652 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004653 VkFramebuffer framebuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004654 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004655 deviceObject := GetDevice(device)
4656 framebufferObject := GetFramebuffer(framebuffer)
4657 assert(framebufferObject.device == device)
4658
4659 State.Framebuffers[framebuffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004660}
4661
4662
4663// Renderpass functions
4664
4665@threadSafety("system")
4666cmd VkResult vkCreateRenderPass(
4667 VkDevice device,
4668 const VkRenderPassCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004669 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004670 VkRenderPass* pRenderPass) {
4671 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO)
4672 deviceObject := GetDevice(device)
4673
4674 renderpass := ?
4675 pRenderPass[0] = renderpass
4676 State.RenderPasses[renderpass] = new!RenderPassObject(device: device)
4677
4678 return ?
4679}
4680
4681@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004682cmd void vkDestroyRenderPass(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004683 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004684 VkRenderPass renderPass,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004685 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004686 deviceObject := GetDevice(device)
4687 renderPassObject := GetRenderPass(renderPass)
4688 assert(renderPassObject.device == device)
4689
4690 State.RenderPasses[renderPass] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004691}
4692
Jesse Hall606a54e2015-11-19 22:17:28 -08004693cmd void vkGetRenderAreaGranularity(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004694 VkDevice device,
4695 VkRenderPass renderPass,
4696 VkExtent2D* pGranularity) {
4697 deviceObject := GetDevice(device)
4698 renderPassObject := GetRenderPass(renderPass)
4699
4700 granularity := ?
4701 pGranularity[0] = granularity
Jesse Halld27f6aa2015-08-15 17:58:48 -07004702}
4703
4704// Command pool functions
4705
4706cmd VkResult vkCreateCommandPool(
4707 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004708 const VkCommandPoolCreateInfo* pCreateInfo,
4709 const VkAllocationCallbacks* pAllocator,
4710 VkCommandPool* pCommandPool) {
4711 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004712 deviceObject := GetDevice(device)
4713
Jesse Hall3fbc8562015-11-29 22:10:52 -08004714 commandPool := ?
4715 pCommandPool[0] = commandPool
4716 State.CommandPools[commandPool] = new!CommandPoolObject(device: device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004717
4718 return ?
4719}
4720
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004721cmd void vkDestroyCommandPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004722 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004723 VkCommandPool commandPool,
4724 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004725 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004726 commandPoolObject := GetCommandPool(commandPool)
4727 assert(commandPoolObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004728
Jesse Hall3fbc8562015-11-29 22:10:52 -08004729 State.CommandPools[commandPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004730}
4731
4732cmd VkResult vkResetCommandPool(
4733 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004734 VkCommandPool commandPool,
4735 VkCommandPoolResetFlags flags) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004736 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004737 commandPoolObject := GetCommandPool(commandPool)
4738 assert(commandPoolObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004739
4740 return ?
4741}
4742
4743// Command buffer functions
4744
Jesse Hall3fbc8562015-11-29 22:10:52 -08004745macro void bindCommandBuffer(VkCommandBuffer commandBuffer, any obj, VkDeviceMemory memory) {
4746 memoryObject := GetDeviceMemory(memory)
4747 memoryObject.boundCommandBuffers[commandBuffer] = commandBuffer
Jesse Halld27f6aa2015-08-15 17:58:48 -07004748
Jesse Hall3fbc8562015-11-29 22:10:52 -08004749 commandBufferObject := GetCommandBuffer(commandBuffer)
4750 commandBufferObject.boundObjects[as!u64(obj)] = memory
Jesse Halld27f6aa2015-08-15 17:58:48 -07004751}
4752
Jesse Hall3fbc8562015-11-29 22:10:52 -08004753macro void unbindCommandBuffer(VkCommandBuffer commandBuffer, any obj, VkDeviceMemory memory) {
4754 memoryObject := GetDeviceMemory(memory)
4755 memoryObject.boundCommandBuffers[commandBuffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004756
Jesse Hall3fbc8562015-11-29 22:10:52 -08004757 commandBufferObject := GetCommandBuffer(commandBuffer)
4758 commandBufferObject.boundObjects[as!u64(obj)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004759}
4760
4761@threadSafety("system")
Jesse Hall3fbc8562015-11-29 22:10:52 -08004762cmd VkResult vkAllocateCommandBuffers(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004763 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004764 const VkCommandBufferAllocateInfo* pAllocateInfo,
4765 VkCommandBuffer* pCommandBuffers) {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08004766 assert(pAllocateInfo[0].sType == VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004767
Jesse Hall3dd678a2016-01-08 21:52:01 -08004768 count := pAllocateInfo[0].commandBufferCount
Jesse Hall3fbc8562015-11-29 22:10:52 -08004769 commandBuffers := pCommandBuffers[0:count]
Jesse Hallfbf97b02015-11-20 14:17:03 -08004770 for i in (0 .. count) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004771 commandBuffer := ?
4772 commandBuffers[i] = commandBuffer
4773 State.CommandBuffers[commandBuffer] = new!CommandBufferObject(device: device)
Jesse Hallfbf97b02015-11-20 14:17:03 -08004774 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07004775
4776 return ?
4777}
4778
4779@threadSafety("system")
Jesse Hallfbf97b02015-11-20 14:17:03 -08004780cmd void vkFreeCommandBuffers(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004781 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004782 VkCommandPool commandPool,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004783 u32 commandBufferCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004784 const VkCommandBuffer* pCommandBuffers) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004785 deviceObject := GetDevice(device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004786
Jesse Hall3fbc8562015-11-29 22:10:52 -08004787 commandBuffers := pCommandBuffers[0:commandBufferCount]
Jesse Hall03b6fe12015-11-24 12:44:21 -08004788 for i in (0 .. commandBufferCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004789 commandBufferObject := GetCommandBuffer(commandBuffers[i])
4790 assert(commandBufferObject.device == device)
Jesse Hallfbf97b02015-11-20 14:17:03 -08004791 // TODO: iterate over boundObjects and clear memory bindings
Jesse Hall3fbc8562015-11-29 22:10:52 -08004792 State.CommandBuffers[commandBuffers[i]] = null
Jesse Hallfbf97b02015-11-20 14:17:03 -08004793 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07004794}
4795
4796@threadSafety("app")
4797cmd VkResult vkBeginCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004798 VkCommandBuffer commandBuffer,
4799 const VkCommandBufferBeginInfo* pBeginInfo) {
4800 assert(pBeginInfo.sType == VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO)
4801 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004802
4803 // TODO: iterate over boundObjects and clear memory bindings
4804
4805 return ?
4806}
4807
4808@threadSafety("app")
4809cmd VkResult vkEndCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004810 VkCommandBuffer commandBuffer) {
4811 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004812
4813 return ?
4814}
4815
4816@threadSafety("app")
4817cmd VkResult vkResetCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004818 VkCommandBuffer commandBuffer,
4819 VkCommandBufferResetFlags flags) {
4820 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004821
4822 // TODO: iterate over boundObjects and clear memory bindings
4823
4824 return ?
4825}
4826
4827
4828// Command buffer building functions
4829
4830@threadSafety("app")
4831cmd void vkCmdBindPipeline(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004832 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004833 VkPipelineBindPoint pipelineBindPoint,
4834 VkPipeline pipeline) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004835 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004836 pipelineObject := GetPipeline(pipeline)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004837 assert(commandBufferObject.device == pipelineObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004838
Jesse Halld8bade02015-11-24 10:24:18 -08004839 queue := switch (pipelineBindPoint) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004840 case VK_PIPELINE_BIND_POINT_COMPUTE: VK_QUEUE_COMPUTE_BIT
4841 case VK_PIPELINE_BIND_POINT_GRAPHICS: VK_QUEUE_GRAPHICS_BIT
4842 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08004843 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004844}
4845
4846@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004847cmd void vkCmdSetViewport(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004848 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004849 u32 firstViewport,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004850 u32 viewportCount,
4851 const VkViewport* pViewports) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004852 commandBufferObject := GetCommandBuffer(commandBuffer)
4853 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004854}
4855
4856@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004857cmd void vkCmdSetScissor(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004858 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004859 u32 firstScissor,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004860 u32 scissorCount,
4861 const VkRect2D* pScissors) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004862 commandBufferObject := GetCommandBuffer(commandBuffer)
4863 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004864}
4865
4866@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004867cmd void vkCmdSetLineWidth(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004868 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004869 f32 lineWidth) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004870 commandBufferObject := GetCommandBuffer(commandBuffer)
4871 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004872}
4873
4874@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004875cmd void vkCmdSetDepthBias(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004876 VkCommandBuffer commandBuffer,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004877 f32 depthBiasConstantFactor,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004878 f32 depthBiasClamp,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004879 f32 depthBiasSlopeFactor) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004880 commandBufferObject := GetCommandBuffer(commandBuffer)
4881 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004882}
Jesse Halld27f6aa2015-08-15 17:58:48 -07004883
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004884@threadSafety("app")
4885cmd void vkCmdSetBlendConstants(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004886 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004887 // TODO(jessehall): apic only supports 'const' on pointer types. Using
4888 // an annotation as a quick hack to pass this to the template without
4889 // having to modify the AST and semantic model.
Jesse Hallb00daad2015-11-29 19:46:20 -08004890 @readonly f32[4] blendConstants) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004891 commandBufferObject := GetCommandBuffer(commandBuffer)
4892 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004893}
4894
4895@threadSafety("app")
4896cmd void vkCmdSetDepthBounds(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004897 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004898 f32 minDepthBounds,
4899 f32 maxDepthBounds) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004900 commandBufferObject := GetCommandBuffer(commandBuffer)
4901 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004902}
4903
4904@threadSafety("app")
4905cmd void vkCmdSetStencilCompareMask(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004906 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004907 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08004908 u32 compareMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004909 commandBufferObject := GetCommandBuffer(commandBuffer)
4910 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004911}
4912
4913@threadSafety("app")
4914cmd void vkCmdSetStencilWriteMask(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004915 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004916 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08004917 u32 writeMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004918 commandBufferObject := GetCommandBuffer(commandBuffer)
4919 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004920}
4921
4922@threadSafety("app")
4923cmd void vkCmdSetStencilReference(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004924 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004925 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08004926 u32 reference) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004927 commandBufferObject := GetCommandBuffer(commandBuffer)
4928 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004929}
4930
4931@threadSafety("app")
4932cmd void vkCmdBindDescriptorSets(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004933 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004934 VkPipelineBindPoint pipelineBindPoint,
4935 VkPipelineLayout layout,
4936 u32 firstSet,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004937 u32 descriptorSetCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004938 const VkDescriptorSet* pDescriptorSets,
4939 u32 dynamicOffsetCount,
4940 const u32* pDynamicOffsets) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004941 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004942
Jesse Hall03b6fe12015-11-24 12:44:21 -08004943 descriptorSets := pDescriptorSets[0:descriptorSetCount]
4944 for i in (0 .. descriptorSetCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004945 descriptorSet := descriptorSets[i]
4946 descriptorSetObject := GetDescriptorSet(descriptorSet)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004947 assert(commandBufferObject.device == descriptorSetObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004948 }
4949
4950 dynamicOffsets := pDynamicOffsets[0:dynamicOffsetCount]
4951 for i in (0 .. dynamicOffsetCount) {
4952 dynamicOffset := dynamicOffsets[i]
4953 }
4954
Jesse Halld8bade02015-11-24 10:24:18 -08004955 queue := switch (pipelineBindPoint) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004956 case VK_PIPELINE_BIND_POINT_COMPUTE: VK_QUEUE_COMPUTE_BIT
4957 case VK_PIPELINE_BIND_POINT_GRAPHICS: VK_QUEUE_GRAPHICS_BIT
4958 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08004959 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004960}
4961
4962@threadSafety("app")
4963cmd void vkCmdBindIndexBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004964 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004965 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004966 VkDeviceSize offset,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004967 VkIndexType indexType) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004968 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004969 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004970 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004971
Jesse Hall3fbc8562015-11-29 22:10:52 -08004972 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004973
Jesse Hall3fbc8562015-11-29 22:10:52 -08004974 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004975}
4976
4977@threadSafety("app")
4978cmd void vkCmdBindVertexBuffers(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004979 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004980 u32 firstBinding,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004981 u32 bindingCount,
4982 const VkBuffer* pBuffers,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004983 const VkDeviceSize* pOffsets) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004984 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004985
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004986 // TODO: check if not [firstBinding:firstBinding+bindingCount]
Jesse Halld27f6aa2015-08-15 17:58:48 -07004987 buffers := pBuffers[0:bindingCount]
4988 offsets := pOffsets[0:bindingCount]
4989 for i in (0 .. bindingCount) {
4990 buffer := buffers[i]
4991 offset := offsets[i]
4992 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004993 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004994
Jesse Hall3fbc8562015-11-29 22:10:52 -08004995 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004996 }
4997
Jesse Hall3fbc8562015-11-29 22:10:52 -08004998 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004999}
5000
5001@threadSafety("app")
5002cmd void vkCmdDraw(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005003 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005004 u32 vertexCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005005 u32 instanceCount,
5006 u32 firstVertex,
5007 u32 firstInstance) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005008 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005009
Jesse Hall3fbc8562015-11-29 22:10:52 -08005010 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005011}
5012
5013@threadSafety("app")
5014cmd void vkCmdDrawIndexed(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005015 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005016 u32 indexCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005017 u32 instanceCount,
5018 u32 firstIndex,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005019 s32 vertexOffset,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005020 u32 firstInstance) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005021 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005022
Jesse Hall3fbc8562015-11-29 22:10:52 -08005023 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005024}
5025
5026@threadSafety("app")
5027cmd void vkCmdDrawIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005028 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005029 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005030 VkDeviceSize offset,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005031 u32 drawCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005032 u32 stride) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005033 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005034 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005035 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005036
Jesse Hall3fbc8562015-11-29 22:10:52 -08005037 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005038
Jesse Hall3fbc8562015-11-29 22:10:52 -08005039 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005040}
5041
5042@threadSafety("app")
5043cmd void vkCmdDrawIndexedIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005044 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005045 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005046 VkDeviceSize offset,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005047 u32 drawCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005048 u32 stride) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005049 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005050 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005051 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005052
Jesse Hall3fbc8562015-11-29 22:10:52 -08005053 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005054
Jesse Hall3fbc8562015-11-29 22:10:52 -08005055 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005056}
5057
5058@threadSafety("app")
5059cmd void vkCmdDispatch(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005060 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005061 u32 x,
5062 u32 y,
5063 u32 z) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005064 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005065
Jesse Hall3fbc8562015-11-29 22:10:52 -08005066 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_COMPUTE_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005067}
5068
5069@threadSafety("app")
5070cmd void vkCmdDispatchIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005071 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005072 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005073 VkDeviceSize offset) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005074 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005075 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005076 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005077
Jesse Hall3fbc8562015-11-29 22:10:52 -08005078 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005079
Jesse Hall3fbc8562015-11-29 22:10:52 -08005080 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_COMPUTE_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005081}
5082
5083@threadSafety("app")
5084cmd void vkCmdCopyBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005085 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005086 VkBuffer srcBuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005087 VkBuffer dstBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005088 u32 regionCount,
5089 const VkBufferCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005090 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005091 srcBufferObject := GetBuffer(srcBuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005092 dstBufferObject := GetBuffer(dstBuffer)
5093 assert(commandBufferObject.device == srcBufferObject.device)
5094 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005095
5096 regions := pRegions[0:regionCount]
5097 for i in (0 .. regionCount) {
5098 region := regions[i]
5099 }
5100
Jesse Hall3fbc8562015-11-29 22:10:52 -08005101 bindCommandBuffer(commandBuffer, srcBuffer, srcBufferObject.memory)
5102 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005103
Jesse Hall65ab5522015-11-30 00:07:16 -08005104 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005105}
5106
5107@threadSafety("app")
5108cmd void vkCmdCopyImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005109 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005110 VkImage srcImage,
5111 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005112 VkImage dstImage,
5113 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005114 u32 regionCount,
5115 const VkImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005116 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005117 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005118 dstImageObject := GetImage(dstImage)
5119 assert(commandBufferObject.device == srcImageObject.device)
5120 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005121
5122 regions := pRegions[0:regionCount]
5123 for i in (0 .. regionCount) {
5124 region := regions[i]
5125 }
5126
Jesse Hall3fbc8562015-11-29 22:10:52 -08005127 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
5128 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005129
Jesse Hall65ab5522015-11-30 00:07:16 -08005130 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005131}
5132
5133@threadSafety("app")
5134cmd void vkCmdBlitImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005135 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005136 VkImage srcImage,
5137 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005138 VkImage dstImage,
5139 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005140 u32 regionCount,
5141 const VkImageBlit* pRegions,
Jesse Hall23ff73f2015-11-29 14:36:39 -08005142 VkFilter filter) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005143 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005144 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005145 dstImageObject := GetImage(dstImage)
5146 assert(commandBufferObject.device == srcImageObject.device)
5147 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005148
5149 regions := pRegions[0:regionCount]
5150 for i in (0 .. regionCount) {
5151 region := regions[i]
5152 }
5153
Jesse Hall3fbc8562015-11-29 22:10:52 -08005154 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
5155 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005156
Jesse Hall3fbc8562015-11-29 22:10:52 -08005157 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005158}
5159
5160@threadSafety("app")
5161cmd void vkCmdCopyBufferToImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005162 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005163 VkBuffer srcBuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005164 VkImage dstImage,
5165 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005166 u32 regionCount,
5167 const VkBufferImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005168 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005169 srcBufferObject := GetBuffer(srcBuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005170 dstImageObject := GetImage(dstImage)
5171 assert(commandBufferObject.device == srcBufferObject.device)
5172 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005173
5174 regions := pRegions[0:regionCount]
5175 for i in (0 .. regionCount) {
5176 region := regions[i]
5177 }
5178
Jesse Hall3fbc8562015-11-29 22:10:52 -08005179 bindCommandBuffer(commandBuffer, srcBuffer, srcBufferObject.memory)
5180 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005181
Jesse Hall65ab5522015-11-30 00:07:16 -08005182 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005183}
5184
5185@threadSafety("app")
5186cmd void vkCmdCopyImageToBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005187 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005188 VkImage srcImage,
5189 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005190 VkBuffer dstBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005191 u32 regionCount,
5192 const VkBufferImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005193 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005194 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005195 dstBufferObject := GetBuffer(dstBuffer)
5196 assert(commandBufferObject.device == srcImageObject.device)
5197 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005198
5199 regions := pRegions[0:regionCount]
5200 for i in (0 .. regionCount) {
5201 region := regions[i]
5202 }
5203
Jesse Hall3fbc8562015-11-29 22:10:52 -08005204 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
5205 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005206
Jesse Hall65ab5522015-11-30 00:07:16 -08005207 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005208}
5209
5210@threadSafety("app")
5211cmd void vkCmdUpdateBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005212 VkCommandBuffer commandBuffer,
5213 VkBuffer dstBuffer,
5214 VkDeviceSize dstOffset,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005215 VkDeviceSize dataSize,
Jesse Hall3f5499b2016-07-26 15:20:40 -07005216 const void* pData) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005217 commandBufferObject := GetCommandBuffer(commandBuffer)
5218 dstBufferObject := GetBuffer(dstBuffer)
5219 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005220
5221 data := pData[0:dataSize]
5222
Jesse Hall3fbc8562015-11-29 22:10:52 -08005223 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005224
Jesse Hall65ab5522015-11-30 00:07:16 -08005225 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005226}
5227
5228@threadSafety("app")
5229cmd void vkCmdFillBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005230 VkCommandBuffer commandBuffer,
5231 VkBuffer dstBuffer,
5232 VkDeviceSize dstOffset,
Jesse Hallb00daad2015-11-29 19:46:20 -08005233 VkDeviceSize size,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005234 u32 data) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005235 commandBufferObject := GetCommandBuffer(commandBuffer)
5236 dstBufferObject := GetBuffer(dstBuffer)
5237 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005238
Jesse Hall65ab5522015-11-30 00:07:16 -08005239 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005240}
5241
5242@threadSafety("app")
5243cmd void vkCmdClearColorImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005244 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005245 VkImage image,
5246 VkImageLayout imageLayout,
5247 const VkClearColorValue* pColor,
5248 u32 rangeCount,
5249 const VkImageSubresourceRange* pRanges) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005250 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005251 imageObject := GetImage(image)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005252 assert(commandBufferObject.device == imageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005253
5254 ranges := pRanges[0:rangeCount]
5255 for i in (0 .. rangeCount) {
5256 range := ranges[i]
5257 }
5258
Jesse Hall3fbc8562015-11-29 22:10:52 -08005259 bindCommandBuffer(commandBuffer, image, imageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005260
Jesse Hall3fbc8562015-11-29 22:10:52 -08005261 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005262}
5263
5264@threadSafety("app")
5265cmd void vkCmdClearDepthStencilImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005266 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005267 VkImage image,
5268 VkImageLayout imageLayout,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005269 const VkClearDepthStencilValue* pDepthStencil,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005270 u32 rangeCount,
5271 const VkImageSubresourceRange* pRanges) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005272 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005273 imageObject := GetImage(image)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005274 assert(commandBufferObject.device == imageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005275
5276 ranges := pRanges[0:rangeCount]
5277 for i in (0 .. rangeCount) {
5278 range := ranges[i]
5279 }
5280
Jesse Hall3fbc8562015-11-29 22:10:52 -08005281 bindCommandBuffer(commandBuffer, image, imageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005282
Jesse Hall3fbc8562015-11-29 22:10:52 -08005283 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005284}
5285
5286@threadSafety("app")
Jesse Hallae38f732015-11-19 21:32:50 -08005287cmd void vkCmdClearAttachments(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005288 VkCommandBuffer commandBuffer,
Jesse Hallae38f732015-11-19 21:32:50 -08005289 u32 attachmentCount,
5290 const VkClearAttachment* pAttachments,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005291 u32 rectCount,
Jesse Halla15a4bf2015-11-19 22:48:02 -08005292 const VkClearRect* pRects) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005293 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005294
5295 rects := pRects[0:rectCount]
5296 for i in (0 .. rectCount) {
5297 rect := rects[i]
5298 }
5299
Jesse Hall3fbc8562015-11-29 22:10:52 -08005300 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005301}
5302
5303@threadSafety("app")
5304cmd void vkCmdResolveImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005305 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005306 VkImage srcImage,
5307 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005308 VkImage dstImage,
5309 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005310 u32 regionCount,
5311 const VkImageResolve* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005312 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005313 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005314 dstImageObject := GetImage(dstImage)
5315 assert(commandBufferObject.device == srcImageObject.device)
5316 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005317
5318 regions := pRegions[0:regionCount]
5319 for i in (0 .. regionCount) {
5320 region := regions[i]
5321 }
5322
Jesse Hall3fbc8562015-11-29 22:10:52 -08005323 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
5324 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005325
Jesse Hall3fbc8562015-11-29 22:10:52 -08005326 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005327}
5328
5329@threadSafety("app")
5330cmd void vkCmdSetEvent(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005331 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005332 VkEvent event,
5333 VkPipelineStageFlags stageMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005334 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005335 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005336 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005337}
5338
5339@threadSafety("app")
5340cmd void vkCmdResetEvent(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005341 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005342 VkEvent event,
5343 VkPipelineStageFlags stageMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005344 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005345 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005346 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005347}
5348
5349@threadSafety("app")
5350cmd void vkCmdWaitEvents(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005351 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005352 u32 eventCount,
5353 const VkEvent* pEvents,
5354 VkPipelineStageFlags srcStageMask,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005355 VkPipelineStageFlags dstStageMask,
5356 u32 memoryBarrierCount,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005357 const VkMemoryBarrier* pMemoryBarriers,
5358 u32 bufferMemoryBarrierCount,
5359 const VkBufferMemoryBarrier* pBufferMemoryBarriers,
5360 u32 imageMemoryBarrierCount,
5361 const VkImageMemoryBarrier* pImageMemoryBarriers) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005362 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005363
5364 events := pEvents[0:eventCount]
5365 for i in (0 .. eventCount) {
5366 event := events[i]
5367 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005368 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005369 }
5370
Jesse Hall3dd678a2016-01-08 21:52:01 -08005371 memoryBarriers := pMemoryBarriers[0:memoryBarrierCount]
Jesse Hall3fbc8562015-11-29 22:10:52 -08005372 for i in (0 .. memoryBarrierCount) {
Jesse Hall3dd678a2016-01-08 21:52:01 -08005373 memoryBarrier := memoryBarriers[i]
5374 }
5375 bufferMemoryBarriers := pBufferMemoryBarriers[0:bufferMemoryBarrierCount]
5376 for i in (0 .. bufferMemoryBarrierCount) {
5377 bufferMemoryBarrier := bufferMemoryBarriers[i]
5378 bufferObject := GetBuffer(bufferMemoryBarrier.buffer)
5379 assert(bufferObject.device == commandBufferObject.device)
5380 }
5381 imageMemoryBarriers := pImageMemoryBarriers[0:imageMemoryBarrierCount]
5382 for i in (0 .. imageMemoryBarrierCount) {
5383 imageMemoryBarrier := imageMemoryBarriers[i]
5384 imageObject := GetImage(imageMemoryBarrier.image)
5385 assert(imageObject.device == commandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005386 }
5387}
5388
5389@threadSafety("app")
5390cmd void vkCmdPipelineBarrier(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005391 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005392 VkPipelineStageFlags srcStageMask,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005393 VkPipelineStageFlags dstStageMask,
Jesse Halldc6d36c2015-11-29 19:12:15 -08005394 VkDependencyFlags dependencyFlags,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005395 u32 memoryBarrierCount,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005396 const VkMemoryBarrier* pMemoryBarriers,
5397 u32 bufferMemoryBarrierCount,
5398 const VkBufferMemoryBarrier* pBufferMemoryBarriers,
5399 u32 imageMemoryBarrierCount,
5400 const VkImageMemoryBarrier* pImageMemoryBarriers) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005401 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005402
Jesse Hall3dd678a2016-01-08 21:52:01 -08005403 memoryBarriers := pMemoryBarriers[0:memoryBarrierCount]
Jesse Hall3fbc8562015-11-29 22:10:52 -08005404 for i in (0 .. memoryBarrierCount) {
Jesse Hall3dd678a2016-01-08 21:52:01 -08005405 memoryBarrier := memoryBarriers[i]
5406 }
5407 bufferMemoryBarriers := pBufferMemoryBarriers[0:bufferMemoryBarrierCount]
5408 for i in (0 .. bufferMemoryBarrierCount) {
5409 bufferMemoryBarrier := bufferMemoryBarriers[i]
5410 bufferObject := GetBuffer(bufferMemoryBarrier.buffer)
5411 assert(bufferObject.device == commandBufferObject.device)
5412 }
5413 imageMemoryBarriers := pImageMemoryBarriers[0:imageMemoryBarrierCount]
5414 for i in (0 .. imageMemoryBarrierCount) {
5415 imageMemoryBarrier := imageMemoryBarriers[i]
5416 imageObject := GetImage(imageMemoryBarrier.image)
5417 assert(imageObject.device == commandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005418 }
5419}
5420
5421@threadSafety("app")
5422cmd void vkCmdBeginQuery(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005423 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005424 VkQueryPool queryPool,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005425 u32 query,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005426 VkQueryControlFlags flags) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005427 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005428 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005429 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005430}
5431
5432@threadSafety("app")
5433cmd void vkCmdEndQuery(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005434 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005435 VkQueryPool queryPool,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005436 u32 query) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005437 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005438 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005439 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005440}
5441
5442@threadSafety("app")
5443cmd void vkCmdResetQueryPool(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005444 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005445 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005446 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005447 u32 queryCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005448 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005449 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005450 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005451}
5452
5453@threadSafety("app")
5454cmd void vkCmdWriteTimestamp(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005455 VkCommandBuffer commandBuffer,
Jesse Hall6f39a6d2015-11-24 11:08:36 -08005456 VkPipelineStageFlagBits pipelineStage,
Jesse Halla3a7a1d2015-11-24 11:37:23 -08005457 VkQueryPool queryPool,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005458 u32 query) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005459 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halla3a7a1d2015-11-24 11:37:23 -08005460 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005461 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005462}
5463
5464@threadSafety("app")
5465cmd void vkCmdCopyQueryPoolResults(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005466 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005467 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005468 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005469 u32 queryCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005470 VkBuffer dstBuffer,
5471 VkDeviceSize dstOffset,
Jesse Halla9bb62b2015-11-21 19:31:56 -08005472 VkDeviceSize stride,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005473 VkQueryResultFlags flags) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005474 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005475 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005476 dstBufferObject := GetBuffer(dstBuffer)
5477 assert(commandBufferObject.device == queryPoolObject.device)
5478 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005479}
5480
5481cmd void vkCmdPushConstants(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005482 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005483 VkPipelineLayout layout,
5484 VkShaderStageFlags stageFlags,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005485 u32 offset,
5486 u32 size,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08005487 const void* pValues) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005488 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005489 layoutObject := GetPipelineLayout(layout)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005490 assert(commandBufferObject.device == layoutObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005491}
5492
5493@threadSafety("app")
5494cmd void vkCmdBeginRenderPass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005495 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005496 const VkRenderPassBeginInfo* pRenderPassBegin,
Jesse Hall65ab5522015-11-30 00:07:16 -08005497 VkSubpassContents contents) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005498 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005499 renderPassObject := GetRenderPass(pRenderPassBegin.renderPass)
5500 framebufferObject := GetFramebuffer(pRenderPassBegin.framebuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005501 assert(commandBufferObject.device == renderPassObject.device)
5502 assert(commandBufferObject.device == framebufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005503
Jesse Hall3fbc8562015-11-29 22:10:52 -08005504 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005505}
5506
5507cmd void vkCmdNextSubpass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005508 VkCommandBuffer commandBuffer,
Jesse Hall65ab5522015-11-30 00:07:16 -08005509 VkSubpassContents contents) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005510 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005511}
5512
5513@threadSafety("app")
5514cmd void vkCmdEndRenderPass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005515 VkCommandBuffer commandBuffer) {
5516 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005517
Jesse Hall3fbc8562015-11-29 22:10:52 -08005518 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005519}
5520
5521cmd void vkCmdExecuteCommands(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005522 VkCommandBuffer commandBuffer,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005523 u32 commandBufferCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005524 const VkCommandBuffer* pCommandBuffers) {
5525 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005526
Jesse Hall3dd678a2016-01-08 21:52:01 -08005527 commandBuffers := pCommandBuffers[0:commandBufferCount]
5528 for i in (0 .. commandBufferCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005529 secondaryCommandBuffer := commandBuffers[i]
5530 secondaryCommandBufferObject := GetCommandBuffer(secondaryCommandBuffer)
5531 assert(commandBufferObject.device == secondaryCommandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005532 }
5533}
5534
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005535@extension("VK_KHR_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005536cmd void vkDestroySurfaceKHR(
5537 VkInstance instance,
Jesse Hall0e74f002015-11-30 11:37:59 -08005538 VkSurfaceKHR surface,
5539 const VkAllocationCallbacks* pAllocator) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005540 instanceObject := GetInstance(instance)
5541 surfaceObject := GetSurface(surface)
5542 assert(surfaceObject.instance == instance)
Michael Lentine88594d72015-11-12 12:49:45 -08005543
Jesse Hall1356b0d2015-11-23 17:24:58 -08005544 State.Surfaces[surface] = null
Jesse Hall2818f932015-11-19 21:19:17 -08005545}
5546
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005547@extension("VK_KHR_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005548cmd VkResult vkGetPhysicalDeviceSurfaceSupportKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005549 VkPhysicalDevice physicalDevice,
5550 u32 queueFamilyIndex,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005551 VkSurfaceKHR surface,
Jesse Hallb00daad2015-11-29 19:46:20 -08005552 VkBool32* pSupported) {
5553 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08005554
5555 return ?
5556}
5557
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005558@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08005559cmd VkResult vkGetPhysicalDeviceSurfaceCapabilitiesKHR(
5560 VkPhysicalDevice physicalDevice,
5561 VkSurfaceKHR surface,
5562 VkSurfaceCapabilitiesKHR* pSurfaceCapabilities) {
5563 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5564
5565 surfaceCapabilities := ?
5566 pSurfaceCapabilities[0] = surfaceCapabilities
5567
5568 return ?
5569}
5570
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005571@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08005572cmd VkResult vkGetPhysicalDeviceSurfaceFormatsKHR(
5573 VkPhysicalDevice physicalDevice,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005574 VkSurfaceKHR surface,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005575 u32* pSurfaceFormatCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005576 VkSurfaceFormatKHR* pSurfaceFormats) {
Jesse Hallb00daad2015-11-29 19:46:20 -08005577 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08005578
5579 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08005580 pSurfaceFormatCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08005581 surfaceFormats := pSurfaceFormats[0:count]
5582
5583 for i in (0 .. count) {
5584 surfaceFormat := ?
5585 surfaceFormats[i] = surfaceFormat
5586 }
5587
5588 return ?
5589}
5590
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005591@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08005592cmd VkResult vkGetPhysicalDeviceSurfacePresentModesKHR(
5593 VkPhysicalDevice physicalDevice,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005594 VkSurfaceKHR surface,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005595 u32* pPresentModeCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005596 VkPresentModeKHR* pPresentModes) {
Jesse Hallb00daad2015-11-29 19:46:20 -08005597 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08005598
5599 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08005600 pPresentModeCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08005601 presentModes := pPresentModes[0:count]
5602
5603 for i in (0 .. count) {
5604 presentMode := ?
5605 presentModes[i] = presentMode
5606 }
5607
5608 return ?
5609}
5610
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005611@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005612cmd VkResult vkCreateSwapchainKHR(
5613 VkDevice device,
5614 const VkSwapchainCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005615 const VkAllocationCallbacks* pAllocator,
Michael Lentine88594d72015-11-12 12:49:45 -08005616 VkSwapchainKHR* pSwapchain) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005617 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR)
Michael Lentine88594d72015-11-12 12:49:45 -08005618 deviceObject := GetDevice(device)
5619
5620 swapchain := ?
5621 pSwapchain[0] = swapchain
5622 State.Swapchains[swapchain] = new!SwapchainObject(device: device)
5623
5624 return ?
5625}
5626
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005627@extension("VK_KHR_swapchain")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005628cmd void vkDestroySwapchainKHR(
Michael Lentine88594d72015-11-12 12:49:45 -08005629 VkDevice device,
Jesse Hall0e74f002015-11-30 11:37:59 -08005630 VkSwapchainKHR swapchain,
5631 const VkAllocationCallbacks* pAllocator) {
Michael Lentine88594d72015-11-12 12:49:45 -08005632 deviceObject := GetDevice(device)
5633 swapchainObject := GetSwapchain(swapchain)
5634 assert(swapchainObject.device == device)
5635
5636 State.Swapchains[swapchain] = null
Michael Lentine88594d72015-11-12 12:49:45 -08005637}
5638
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005639@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005640cmd VkResult vkGetSwapchainImagesKHR(
5641 VkDevice device,
5642 VkSwapchainKHR swapchain,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005643 u32* pSwapchainImageCount,
Michael Lentine88594d72015-11-12 12:49:45 -08005644 VkImage* pSwapchainImages) {
5645 deviceObject := GetDevice(device)
5646
5647 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08005648 pSwapchainImageCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08005649 swapchainImages := pSwapchainImages[0:count]
5650
5651 for i in (0 .. count) {
5652 swapchainImage := ?
5653 swapchainImages[i] = swapchainImage
Jesse Hall1356b0d2015-11-23 17:24:58 -08005654 State.Images[swapchainImage] = new!ImageObject(device: device)
Michael Lentine88594d72015-11-12 12:49:45 -08005655 }
5656
5657 return ?
5658}
5659
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005660@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005661cmd VkResult vkAcquireNextImageKHR(
5662 VkDevice device,
5663 VkSwapchainKHR swapchain,
5664 u64 timeout,
5665 VkSemaphore semaphore,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005666 VkFence fence,
Michael Lentine88594d72015-11-12 12:49:45 -08005667 u32* pImageIndex) {
5668 deviceObject := GetDevice(device)
5669 swapchainObject := GetSwapchain(swapchain)
5670
5671 imageIndex := ?
5672 pImageIndex[0] = imageIndex
5673
5674 return ?
5675}
5676
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005677@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005678cmd VkResult vkQueuePresentKHR(
5679 VkQueue queue,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08005680 const VkPresentInfoKHR* pPresentInfo) {
Michael Lentine88594d72015-11-12 12:49:45 -08005681 queueObject := GetQueue(queue)
5682
5683 presentInfo := ?
5684 pPresentInfo[0] = presentInfo
5685
5686 return ?
5687}
5688
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005689@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005690cmd VkResult vkGetPhysicalDeviceDisplayPropertiesKHR(
5691 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005692 u32* pPropertyCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005693 VkDisplayPropertiesKHR* pProperties) {
5694 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5695 return ?
5696}
5697
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005698@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005699cmd VkResult vkGetPhysicalDeviceDisplayPlanePropertiesKHR(
5700 VkPhysicalDevice physicalDevice,
5701 u32* pPropertyCount,
5702 VkDisplayPlanePropertiesKHR* pProperties) {
5703 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5704 return ?
5705}
5706
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005707@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005708cmd VkResult vkGetDisplayPlaneSupportedDisplaysKHR(
5709 VkPhysicalDevice physicalDevice,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005710 u32 planeIndex,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08005711 u32* pDisplayCount,
5712 VkDisplayKHR* pDisplays) {
Jesse Halla6429252015-11-29 18:59:42 -08005713 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5714 return ?
5715}
5716
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005717@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005718cmd VkResult vkGetDisplayModePropertiesKHR(
5719 VkPhysicalDevice physicalDevice,
5720 VkDisplayKHR display,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005721 u32* pPropertyCount,
5722 VkDisplayModePropertiesKHR* pProperties) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005723 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5724 return ?
5725}
5726
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005727@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005728cmd VkResult vkCreateDisplayModeKHR(
5729 VkPhysicalDevice physicalDevice,
5730 VkDisplayKHR display,
5731 const VkDisplayModeCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005732 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005733 VkDisplayModeKHR* pMode) {
5734 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5735 return ?
5736}
5737
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005738@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005739cmd VkResult vkGetDisplayPlaneCapabilitiesKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005740 VkPhysicalDevice physicalDevice,
Jesse Hall9ba8bc82015-11-30 16:22:16 -08005741 VkDisplayModeKHR mode,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005742 u32 planeIndex,
Jesse Halla6429252015-11-29 18:59:42 -08005743 VkDisplayPlaneCapabilitiesKHR* pCapabilities) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005744 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5745 return ?
5746}
5747
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005748@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005749cmd VkResult vkCreateDisplayPlaneSurfaceKHR(
5750 VkInstance instance,
5751 const VkDisplaySurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005752 const VkAllocationCallbacks* pAllocator,
Jesse Halla6429252015-11-29 18:59:42 -08005753 VkSurfaceKHR* pSurface) {
5754 return ?
5755}
5756
Jesse Hall9ba8bc82015-11-30 16:22:16 -08005757@extension("VK_KHR_display_swapchain")
5758cmd VkResult vkCreateSharedSwapchainsKHR(
5759 VkDevice device,
5760 u32 swapchainCount,
5761 const VkSwapchainCreateInfoKHR* pCreateInfos,
5762 const VkAllocationCallbacks* pAllocator,
5763 VkSwapchainKHR* pSwapchains) {
5764 return ?
5765}
5766
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005767@extension("VK_KHR_xlib_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005768cmd VkResult vkCreateXlibSurfaceKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005769 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005770 const VkXlibSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005771 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005772 VkSurfaceKHR* pSurface) {
5773 instanceObject := GetInstance(instance)
5774 return ?
5775}
5776
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005777@extension("VK_KHR_xlib_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005778cmd VkBool32 vkGetPhysicalDeviceXlibPresentationSupportKHR(
5779 VkPhysicalDevice physicalDevice,
5780 u32 queueFamilyIndex,
5781 platform.Display* dpy,
Jesse Hall65ab5522015-11-30 00:07:16 -08005782 platform.VisualID visualID) {
Jesse Halla6429252015-11-29 18:59:42 -08005783 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5784 return ?
5785}
5786
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005787@extension("VK_KHR_xcb_surface")
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005788cmd VkResult vkCreateXcbSurfaceKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005789 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005790 const VkXcbSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005791 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005792 VkSurfaceKHR* pSurface) {
5793 instanceObject := GetInstance(instance)
5794 return ?
5795}
5796
Jesse Hall523db342015-11-30 21:12:55 -08005797@extension("VK_KHR_xcb_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005798cmd VkBool32 vkGetPhysicalDeviceXcbPresentationSupportKHR(
5799 VkPhysicalDevice physicalDevice,
5800 u32 queueFamilyIndex,
5801 platform.xcb_connection_t* connection,
5802 platform.xcb_visualid_t visual_id) {
5803 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5804 return ?
5805}
5806
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005807@extension("VK_KHR_wayland_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005808cmd VkResult vkCreateWaylandSurfaceKHR(
5809 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005810 const VkWaylandSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005811 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005812 VkSurfaceKHR* pSurface) {
5813 instanceObject := GetInstance(instance)
5814 return ?
5815}
5816
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005817@extension("VK_KHR_wayland_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005818cmd VkBool32 vkGetPhysicalDeviceWaylandPresentationSupportKHR(
5819 VkPhysicalDevice physicalDevice,
5820 u32 queueFamilyIndex,
5821 platform.wl_display* display) {
5822 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5823 return ?
5824}
5825
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005826@extension("VK_KHR_mir_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005827cmd VkResult vkCreateMirSurfaceKHR(
5828 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005829 const VkMirSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005830 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005831 VkSurfaceKHR* pSurface) {
5832 instanceObject := GetInstance(instance)
5833 return ?
5834}
5835
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005836@extension("VK_KHR_mir_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005837cmd VkBool32 vkGetPhysicalDeviceMirPresentationSupportKHR(
5838 VkPhysicalDevice physicalDevice,
5839 u32 queueFamilyIndex,
5840 platform.MirConnection* connection) {
5841 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5842 return ?
5843}
5844
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005845@extension("VK_KHR_android_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005846cmd VkResult vkCreateAndroidSurfaceKHR(
5847 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005848 const VkAndroidSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005849 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005850 VkSurfaceKHR* pSurface) {
5851 instanceObject := GetInstance(instance)
5852 return ?
5853}
5854
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005855@extension("VK_KHR_win32_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005856cmd VkResult vkCreateWin32SurfaceKHR(
5857 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005858 const VkWin32SurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005859 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005860 VkSurfaceKHR* pSurface) {
5861 instanceObject := GetInstance(instance)
5862 return ?
5863}
5864
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005865@extension("VK_KHR_win32_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005866cmd VkResult vkGetPhysicalDeviceWin32PresentationSupportKHR(
5867 VkPhysicalDevice physicalDevice,
5868 u32 queueFamilyIndex) {
Jesse Halle2948d82016-02-25 04:19:32 -08005869 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Jesse Halla6429252015-11-29 18:59:42 -08005870 return ?
5871}
5872
Chia-I Wub262ddc2016-03-22 07:38:20 +08005873@extension("VK_ANDROID_native_buffer")
5874cmd VkResult vkGetSwapchainGrallocUsageANDROID(
5875 VkDevice device,
5876 VkFormat format,
5877 VkImageUsageFlags imageUsage,
5878 int* grallocUsage) {
5879 return ?
5880}
5881
5882@extension("VK_ANDROID_native_buffer")
5883cmd VkResult vkAcquireImageANDROID(
5884 VkDevice device,
5885 VkImage image,
5886 int nativeFenceFd,
5887 VkSemaphore semaphore,
5888 VkFence fence) {
5889 return ?
5890}
5891
5892@extension("VK_ANDROID_native_buffer")
5893cmd VkResult vkQueueSignalReleaseImageANDROID(
5894 VkQueue queue,
5895 u32 waitSemaphoreCount,
5896 const VkSemaphore* pWaitSemaphores,
5897 VkImage image,
5898 int* pNativeFenceFd) {
5899 return ?
5900}
5901
Jesse Hall715b86a2016-01-16 16:34:29 -08005902@extension("VK_EXT_debug_report")
5903@external type void* PFN_vkDebugReportCallbackEXT
5904@extension("VK_EXT_debug_report")
5905@pfn cmd VkBool32 vkDebugReportCallbackEXT(
5906 VkDebugReportFlagsEXT flags,
5907 VkDebugReportObjectTypeEXT objectType,
5908 u64 object,
5909 platform.size_t location,
5910 s32 messageCode,
5911 const char* pLayerPrefix,
5912 const char* pMessage,
5913 void* pUserData) {
5914 return ?
5915}
5916
5917@extension("VK_EXT_debug_report")
5918cmd VkResult vkCreateDebugReportCallbackEXT(
5919 VkInstance instance,
5920 const VkDebugReportCallbackCreateInfoEXT* pCreateInfo,
5921 const VkAllocationCallbacks* pAllocator,
5922 VkDebugReportCallbackEXT* pCallback) {
5923 return ?
5924}
5925
5926@extension("VK_EXT_debug_report")
5927cmd void vkDestroyDebugReportCallbackEXT(
5928 VkInstance instance,
5929 VkDebugReportCallbackEXT callback,
5930 const VkAllocationCallbacks* pAllocator) {
5931}
5932
5933@extension("VK_EXT_debug_report")
5934cmd void vkDebugReportMessageEXT(
5935 VkInstance instance,
5936 VkDebugReportFlagsEXT flags,
5937 VkDebugReportObjectTypeEXT objectType,
5938 u64 object,
5939 platform.size_t location,
5940 s32 messageCode,
5941 const char* pLayerPrefix,
5942 const char* pMessage) {
5943}
5944
Jesse Hall26763382016-05-20 07:13:52 -07005945@extension("VK_EXT_debug_marker")
5946cmd VkResult vkDebugMarkerSetObjectTagEXT(
5947 VkDevice device,
5948 VkDebugMarkerObjectTagInfoEXT* pTagInfo) {
5949 return ?
5950}
5951
5952@extension("VK_EXT_debug_marker")
5953cmd VkResult vkDebugMarkerSetObjectNameEXT(
5954 VkDevice device,
5955 VkDebugMarkerObjectNameInfoEXT* pNameInfo) {
5956 return ?
5957}
5958
5959@extension("VK_EXT_debug_marker")
5960cmd void vkCmdDebugMarkerBeginEXT(
5961 VkCommandBuffer commandBuffer,
5962 VkDebugMarkerMarkerInfoEXT* pMarkerInfo) {
5963}
5964
5965@extension("VK_EXT_debug_marker")
5966cmd void vkCmdDebugMarkerEndEXT(
5967 VkCommandBuffer commandBuffer) {
5968}
5969
5970@extension("VK_EXT_debug_marker")
5971cmd void vkCmdDebugMarkerInsertEXT(
5972 VkCommandBuffer commandBuffer,
5973 VkDebugMarkerMarkerInfoEXT* pMarkerInfo) {
5974}
5975
Jesse Halleb02c472017-02-24 15:13:45 -08005976@extension("VK_AMD_draw_indirect_count")
5977cmd void vkCmdDrawIndirectCountAMD(
5978 VkCommandBuffer commandBuffer,
5979 VkBuffer buffer,
5980 VkDeviceSize offset,
5981 VkBuffer countBuffer,
5982 VkDeviceSize countBufferOffset,
5983 u32 maxDrawCount,
5984 u32 stride) {
5985}
5986
5987@extension("VK_AMD_draw_indirect_count")
5988cmd void vkCmdDrawIndexedIndirectCountAMD(
5989 VkCommandBuffer commandBuffer,
5990 VkBuffer buffer,
5991 VkDeviceSize offset,
5992 VkBuffer countBuffer,
5993 VkDeviceSize countBufferOffset,
5994 u32 maxDrawCount,
5995 u32 stride) {
5996}
5997
5998@extension("VK_NV_external_memory_capabilities")
5999cmd VkResult vkGetPhysicalDeviceExternalImageFormatPropertiesNV(
6000 VkPhysicalDevice physicalDevice,
6001 VkFormat format,
6002 VkImageType type,
6003 VkImageTiling tiling,
6004 VkImageUsageFlags usage,
6005 VkImageCreateFlags flags,
6006 VkExternalMemoryHandleTypeFlagsNV externalHandleType,
6007 VkExternalImageFormatPropertiesNV* pExternalImageFormatProperties) {
6008 return ?
6009}
6010
6011@extension("VK_NV_external_memory_win32")
6012cmd VkResult vkGetMemoryWin32HandleNV(
6013 VkDevice device,
6014 VkDeviceMemory memory,
6015 VkExternalMemoryHandleTypeFlagsNV handleType,
6016 platform.HANDLE* pHandle) {
6017 return ?
6018}
6019
Jesse Hall08e2f482017-03-06 15:22:17 -08006020@extension("VK_KHR_get_physical_device_properties2")
6021cmd void vkGetPhysicalDeviceFeatures2KHR(
6022 VkPhysicalDevice physicalDevice,
6023 VkPhysicalDeviceFeatures2KHR* pFeatures) {
6024}
6025
6026@extension("VK_KHR_get_physical_device_properties2")
6027cmd void vkGetPhysicalDeviceProperties2KHR(
6028 VkPhysicalDevice physicalDevice,
6029 VkPhysicalDeviceProperties2KHR* pProperties) {
6030}
6031
6032@extension("VK_KHR_get_physical_device_properties2")
6033cmd void vkGetPhysicalDeviceFormatProperties2KHR(
6034 VkPhysicalDevice physicalDevice,
6035 VkFormat format,
6036 VkFormatProperties2KHR* pFormatProperties) {
6037}
6038
6039@extension("VK_KHR_get_physical_device_properties2")
6040cmd VkResult vkGetPhysicalDeviceImageFormatProperties2KHR(
6041 VkPhysicalDevice physicalDevice,
6042 const VkPhysicalDeviceImageFormatInfo2KHR* pImageFormatInfo,
6043 VkImageFormatProperties2KHR* pImageFormatProperties) {
6044 return ?
6045}
6046
6047@extension("VK_KHR_get_physical_device_properties2")
6048cmd void vkGetPhysicalDeviceQueueFamilyProperties2KHR(
6049 VkPhysicalDevice physicalDevice,
6050 u32* pQueueFamilyPropertyCount,
6051 VkQueueFamilyProperties2KHR* pQueueFamilyProperties) {
6052}
6053
6054@extension("VK_KHR_get_physical_device_properties2")
6055cmd void vkGetPhysicalDeviceMemoryProperties2KHR(
6056 VkPhysicalDevice physicalDevice,
6057 VkPhysicalDeviceMemoryProperties2KHR* pMemoryProperties) {
6058}
6059
6060@extension("VK_KHR_get_physical_device_properties2")
6061cmd void vkGetPhysicalDeviceSparseImageFormatProperties2KHR(
6062 VkPhysicalDevice physicalDevice,
6063 const VkPhysicalDeviceSparseImageFormatInfo2KHR* pFormatInfo,
6064 u32* pPropertyCount,
6065 VkSparseImageFormatProperties2KHR* pProperties) {
6066}
6067
6068@extension("VK_NN_vi_surface")
6069cmd VkResult vkCreateViSurfaceNN(
6070 VkInstance instance,
6071 const VkViSurfaceCreateInfoNN* pCreateInfo,
6072 const VkAllocationCallbacks* pAllocator,
6073 VkSurfaceKHR* pSurface) {
6074 return ?
6075}
6076
6077@extension("VK_KHR_maintenance1")
6078cmd void vkTrimCommandPoolKHR(
6079 VkDevice device,
6080 VkCommandPool commandPool,
6081 VkCommandPoolTrimFlagsKHR flags) {
6082}
6083
Jesse Halleb02c472017-02-24 15:13:45 -08006084@extension("VK_NVX_device_generated_commands")
6085cmd void vkCmdProcessCommandsNVX(
6086 VkCommandBuffer commandBuffer,
6087 const VkCmdProcessCommandsInfoNVX* pProcessCommandsInfo) {
6088}
6089
6090@extension("VK_NVX_device_generated_commands")
6091cmd void vkCmdReserveSpaceForCommandsNVX(
6092 VkCommandBuffer commandBuffer,
6093 const VkCmdReserveSpaceForCommandsInfoNVX* pReserveSpaceInfo) {
6094}
6095
6096@extension("VK_NVX_device_generated_commands")
6097cmd VkResult vkCreateIndirectCommandsLayoutNVX(
6098 VkDevice device,
6099 const VkIndirectCommandsLayoutCreateInfoNVX* pCreateInfo,
6100 const VkAllocationCallbacks* pAllocator,
6101 VkIndirectCommandsLayoutNVX* pIndirectCommandsLayout) {
6102 return ?
6103}
6104
6105@extension("VK_NVX_device_generated_commands")
6106cmd void vkDestroyIndirectCommandsLayoutNVX(
6107 VkDevice device,
6108 VkIndirectCommandsLayoutNVX indirectCommandsLayout,
6109 const VkAllocationCallbacks* pAllocator) {
6110}
6111
6112@extension("VK_NVX_device_generated_commands")
6113cmd VkResult vkCreateObjectTableNVX(
6114 VkDevice device,
6115 const VkObjectTableCreateInfoNVX* pCreateInfo,
6116 const VkAllocationCallbacks* pAllocator,
6117 VkObjectTableNVX* pObjectTable) {
6118 return ?
6119}
6120
6121@extension("VK_NVX_device_generated_commands")
6122cmd void vkDestroyObjectTableNVX(
6123 VkDevice device,
6124 VkObjectTableNVX objectTable,
6125 const VkAllocationCallbacks* pAllocator) {
6126}
6127
6128@extension("VK_NVX_device_generated_commands")
6129cmd VkResult vkRegisterObjectsNVX(
6130 VkDevice device,
6131 VkObjectTableNVX objectTable,
6132 u32 objectCount,
6133 const VkObjectTableEntryNVX* const* ppObjectTableEntries,
6134 const u32* pObjectIndices) {
6135 return ?
6136}
6137
6138@extension("VK_NVX_device_generated_commands")
6139cmd VkResult vkUnregisterObjectsNVX(
6140 VkDevice device,
6141 VkObjectTableNVX objectTable,
6142 u32 objectCount,
6143 const VkObjectEntryTypeNVX* pObjectEntryTypes,
6144 const u32* pObjectIndices) {
6145 return ?
6146}
6147
6148@extension("VK_NVX_device_generated_commands")
6149cmd void vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX(
6150 VkPhysicalDevice physicalDevice,
6151 VkDeviceGeneratedCommandsFeaturesNVX* pFeatures,
6152 VkDeviceGeneratedCommandsLimitsNVX* pLimits) {
6153}
Jesse Halld27f6aa2015-08-15 17:58:48 -07006154
Jesse Hall08e2f482017-03-06 15:22:17 -08006155@extension("VK_EXT_direct_mode_display")
6156cmd VkResult vkReleaseDisplayEXT(
6157 VkPhysicalDevice physicalDevice,
6158 VkDisplayKHR display) {
6159 return ?
6160}
6161
6162@extension("VK_EXT_acquire_xlib_display")
6163cmd VkResult vkAcquireXlibDisplayEXT(
6164 VkPhysicalDevice physicalDevice,
6165 platform.Display* dpy,
6166 VkDisplayKHR display) {
6167 return ?
6168}
6169
6170@extension("VK_EXT_acquire_xlib_display")
6171cmd VkResult vkGetRandROutputDisplayEXT(
6172 VkPhysicalDevice physicalDevice,
6173 platform.Display* dpy,
6174 platform.RROutput rrOutput,
6175 VkDisplayKHR* pDisplay) {
6176 return ?
6177}
6178
6179@extension("VK_EXT_display_surface_counter")
6180cmd VkResult vkGetPhysicalDeviceSurfaceCapabilities2EXT(
6181 VkPhysicalDevice physicalDevice,
6182 VkSurfaceKHR surface,
6183 VkSurfaceCapabilities2EXT* pSurfaceCapabilities) {
6184 return ?
6185}
6186
6187@extension("VK_EXT_display_control")
6188cmd VkResult vkDisplayPowerControlEXT(
6189 VkDevice device,
6190 VkDisplayKHR display,
6191 const VkDisplayPowerInfoEXT* pDisplayPowerInfo) {
6192 return ?
6193}
6194
6195@extension("VK_EXT_display_control")
6196cmd VkResult vkRegisterDeviceEventEXT(
6197 VkDevice device,
6198 const VkDeviceEventInfoEXT* pDeviceEventInfo,
6199 const VkAllocationCallbacks* pAllocator,
6200 VkFence* pFence) {
6201 return ?
6202}
6203
6204@extension("VK_EXT_display_control")
6205cmd VkResult vkRegisterDisplayEventEXT(
6206 VkDevice device,
6207 VkDisplayKHR display,
6208 const VkDisplayEventInfoEXT* pDisplayEventInfo,
6209 const VkAllocationCallbacks* pAllocator,
6210 VkFence* pFence) {
6211 return ?
6212}
6213
6214@extension("VK_EXT_display_control")
6215cmd VkResult vkGetSwapchainCounterEXT(
6216 VkDevice device,
6217 VkSwapchainKHR swapchain,
6218 VkSurfaceCounterFlagBitsEXT counter,
6219 u64* pCounterValue) {
6220 return ?
6221}
6222
Jesse Halld27f6aa2015-08-15 17:58:48 -07006223////////////////
6224// Validation //
6225////////////////
6226
6227extern void validate(string layerName, bool condition, string message)
6228
6229
6230/////////////////////////////
6231// Internal State Tracking //
6232/////////////////////////////
6233
6234StateObject State
6235
6236@internal class StateObject {
6237 // Dispatchable objects.
6238 map!(VkInstance, ref!InstanceObject) Instances
6239 map!(VkPhysicalDevice, ref!PhysicalDeviceObject) PhysicalDevices
6240 map!(VkDevice, ref!DeviceObject) Devices
6241 map!(VkQueue, ref!QueueObject) Queues
Jesse Hall3fbc8562015-11-29 22:10:52 -08006242 map!(VkCommandBuffer, ref!CommandBufferObject) CommandBuffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07006243
6244 // Non-dispatchable objects.
6245 map!(VkDeviceMemory, ref!DeviceMemoryObject) DeviceMemories
6246 map!(VkBuffer, ref!BufferObject) Buffers
6247 map!(VkBufferView, ref!BufferViewObject) BufferViews
6248 map!(VkImage, ref!ImageObject) Images
6249 map!(VkImageView, ref!ImageViewObject) ImageViews
Jesse Halld27f6aa2015-08-15 17:58:48 -07006250 map!(VkShaderModule, ref!ShaderModuleObject) ShaderModules
Jesse Halld27f6aa2015-08-15 17:58:48 -07006251 map!(VkPipeline, ref!PipelineObject) Pipelines
6252 map!(VkPipelineLayout, ref!PipelineLayoutObject) PipelineLayouts
6253 map!(VkSampler, ref!SamplerObject) Samplers
6254 map!(VkDescriptorSet, ref!DescriptorSetObject) DescriptorSets
6255 map!(VkDescriptorSetLayout, ref!DescriptorSetLayoutObject) DescriptorSetLayouts
6256 map!(VkDescriptorPool, ref!DescriptorPoolObject) DescriptorPools
Jesse Halld27f6aa2015-08-15 17:58:48 -07006257 map!(VkFence, ref!FenceObject) Fences
6258 map!(VkSemaphore, ref!SemaphoreObject) Semaphores
6259 map!(VkEvent, ref!EventObject) Events
6260 map!(VkQueryPool, ref!QueryPoolObject) QueryPools
6261 map!(VkFramebuffer, ref!FramebufferObject) Framebuffers
6262 map!(VkRenderPass, ref!RenderPassObject) RenderPasses
6263 map!(VkPipelineCache, ref!PipelineCacheObject) PipelineCaches
Jesse Hall3fbc8562015-11-29 22:10:52 -08006264 map!(VkCommandPool, ref!CommandPoolObject) CommandPools
Jesse Hall1356b0d2015-11-23 17:24:58 -08006265 map!(VkSurfaceKHR, ref!SurfaceObject) Surfaces
Michael Lentine88594d72015-11-12 12:49:45 -08006266 map!(VkSwapchainKHR, ref!SwapchainObject) Swapchains
Jesse Halld27f6aa2015-08-15 17:58:48 -07006267}
6268
6269@internal class InstanceObject {
6270}
6271
6272@internal class PhysicalDeviceObject {
6273 VkInstance instance
6274}
6275
6276@internal class DeviceObject {
6277 VkPhysicalDevice physicalDevice
6278}
6279
6280@internal class QueueObject {
6281 VkDevice device
6282 VkQueueFlags flags
6283}
6284
Jesse Hall3fbc8562015-11-29 22:10:52 -08006285@internal class CommandBufferObject {
Jesse Halld27f6aa2015-08-15 17:58:48 -07006286 VkDevice device
6287 map!(u64, VkDeviceMemory) boundObjects
6288 VkQueueFlags queueFlags
6289}
6290
6291@internal class DeviceMemoryObject {
Jesse Hall3fbc8562015-11-29 22:10:52 -08006292 VkDevice device
6293 VkDeviceSize allocationSize
6294 map!(u64, VkDeviceSize) boundObjects
6295 map!(VkCommandBuffer, VkCommandBuffer) boundCommandBuffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07006296}
6297
6298@internal class BufferObject {
6299 VkDevice device
Jesse Hall3fbc8562015-11-29 22:10:52 -08006300 VkDeviceMemory memory
6301 VkDeviceSize memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07006302}
6303
6304@internal class BufferViewObject {
6305 VkDevice device
6306 VkBuffer buffer
6307}
6308
6309@internal class ImageObject {
6310 VkDevice device
Jesse Hall3fbc8562015-11-29 22:10:52 -08006311 VkDeviceMemory memory
6312 VkDeviceSize memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07006313}
6314
6315@internal class ImageViewObject {
6316 VkDevice device
6317 VkImage image
6318}
6319
Jesse Halld27f6aa2015-08-15 17:58:48 -07006320@internal class ShaderObject {
6321 VkDevice device
6322}
6323
6324@internal class ShaderModuleObject {
6325 VkDevice device
6326}
6327
6328@internal class PipelineObject {
6329 VkDevice device
6330}
6331
6332@internal class PipelineLayoutObject {
6333 VkDevice device
6334}
6335
6336@internal class SamplerObject {
6337 VkDevice device
6338}
6339
6340@internal class DescriptorSetObject {
6341 VkDevice device
6342}
6343
6344@internal class DescriptorSetLayoutObject {
6345 VkDevice device
6346}
6347
6348@internal class DescriptorPoolObject {
6349 VkDevice device
6350}
6351
Jesse Halld27f6aa2015-08-15 17:58:48 -07006352@internal class FenceObject {
6353 VkDevice device
6354 bool signaled
6355}
6356
6357@internal class SemaphoreObject {
6358 VkDevice device
6359}
6360
6361@internal class EventObject {
6362 VkDevice device
6363}
6364
6365@internal class QueryPoolObject {
6366 VkDevice device
6367}
6368
6369@internal class FramebufferObject {
6370 VkDevice device
6371}
6372
6373@internal class RenderPassObject {
6374 VkDevice device
6375}
6376
6377@internal class PipelineCacheObject {
6378 VkDevice device
6379}
6380
Jesse Hall3fbc8562015-11-29 22:10:52 -08006381@internal class CommandPoolObject {
Jesse Halld27f6aa2015-08-15 17:58:48 -07006382 VkDevice device
6383}
6384
Jesse Hall1356b0d2015-11-23 17:24:58 -08006385@internal class SurfaceObject {
6386 VkInstance instance
6387}
6388
Michael Lentine88594d72015-11-12 12:49:45 -08006389@internal class SwapchainObject {
6390 VkDevice device
6391}
6392
Jesse Halld27f6aa2015-08-15 17:58:48 -07006393macro ref!InstanceObject GetInstance(VkInstance instance) {
6394 assert(instance in State.Instances)
6395 return State.Instances[instance]
6396}
6397
6398macro ref!PhysicalDeviceObject GetPhysicalDevice(VkPhysicalDevice physicalDevice) {
6399 assert(physicalDevice in State.PhysicalDevices)
6400 return State.PhysicalDevices[physicalDevice]
6401}
6402
6403macro ref!DeviceObject GetDevice(VkDevice device) {
6404 assert(device in State.Devices)
6405 return State.Devices[device]
6406}
6407
6408macro ref!QueueObject GetQueue(VkQueue queue) {
6409 assert(queue in State.Queues)
6410 return State.Queues[queue]
6411}
6412
Jesse Hall3fbc8562015-11-29 22:10:52 -08006413macro ref!CommandBufferObject GetCommandBuffer(VkCommandBuffer commandBuffer) {
6414 assert(commandBuffer in State.CommandBuffers)
6415 return State.CommandBuffers[commandBuffer]
Jesse Halld27f6aa2015-08-15 17:58:48 -07006416}
6417
Jesse Hall3fbc8562015-11-29 22:10:52 -08006418macro ref!DeviceMemoryObject GetDeviceMemory(VkDeviceMemory memory) {
6419 assert(memory in State.DeviceMemories)
6420 return State.DeviceMemories[memory]
Jesse Halld27f6aa2015-08-15 17:58:48 -07006421}
6422
6423macro ref!BufferObject GetBuffer(VkBuffer buffer) {
6424 assert(buffer in State.Buffers)
6425 return State.Buffers[buffer]
6426}
6427
6428macro ref!BufferViewObject GetBufferView(VkBufferView bufferView) {
6429 assert(bufferView in State.BufferViews)
6430 return State.BufferViews[bufferView]
6431}
6432
6433macro ref!ImageObject GetImage(VkImage image) {
6434 assert(image in State.Images)
6435 return State.Images[image]
6436}
6437
6438macro ref!ImageViewObject GetImageView(VkImageView imageView) {
6439 assert(imageView in State.ImageViews)
6440 return State.ImageViews[imageView]
6441}
6442
Jesse Halld27f6aa2015-08-15 17:58:48 -07006443macro ref!ShaderModuleObject GetShaderModule(VkShaderModule shaderModule) {
6444 assert(shaderModule in State.ShaderModules)
6445 return State.ShaderModules[shaderModule]
6446}
6447
6448macro ref!PipelineObject GetPipeline(VkPipeline pipeline) {
6449 assert(pipeline in State.Pipelines)
6450 return State.Pipelines[pipeline]
6451}
6452
6453macro ref!PipelineLayoutObject GetPipelineLayout(VkPipelineLayout pipelineLayout) {
6454 assert(pipelineLayout in State.PipelineLayouts)
6455 return State.PipelineLayouts[pipelineLayout]
6456}
6457
6458macro ref!SamplerObject GetSampler(VkSampler sampler) {
6459 assert(sampler in State.Samplers)
6460 return State.Samplers[sampler]
6461}
6462
6463macro ref!DescriptorSetObject GetDescriptorSet(VkDescriptorSet descriptorSet) {
6464 assert(descriptorSet in State.DescriptorSets)
6465 return State.DescriptorSets[descriptorSet]
6466}
6467
6468macro ref!DescriptorSetLayoutObject GetDescriptorSetLayout(VkDescriptorSetLayout descriptorSetLayout) {
6469 assert(descriptorSetLayout in State.DescriptorSetLayouts)
6470 return State.DescriptorSetLayouts[descriptorSetLayout]
6471}
6472
6473macro ref!DescriptorPoolObject GetDescriptorPool(VkDescriptorPool descriptorPool) {
6474 assert(descriptorPool in State.DescriptorPools)
6475 return State.DescriptorPools[descriptorPool]
6476}
6477
Jesse Halld27f6aa2015-08-15 17:58:48 -07006478macro ref!FenceObject GetFence(VkFence fence) {
6479 assert(fence in State.Fences)
6480 return State.Fences[fence]
6481}
6482
6483macro ref!SemaphoreObject GetSemaphore(VkSemaphore semaphore) {
6484 assert(semaphore in State.Semaphores)
6485 return State.Semaphores[semaphore]
6486}
6487
6488macro ref!EventObject GetEvent(VkEvent event) {
6489 assert(event in State.Events)
6490 return State.Events[event]
6491}
6492
6493macro ref!QueryPoolObject GetQueryPool(VkQueryPool queryPool) {
6494 assert(queryPool in State.QueryPools)
6495 return State.QueryPools[queryPool]
6496}
6497
6498macro ref!FramebufferObject GetFramebuffer(VkFramebuffer framebuffer) {
6499 assert(framebuffer in State.Framebuffers)
6500 return State.Framebuffers[framebuffer]
6501}
6502
6503macro ref!RenderPassObject GetRenderPass(VkRenderPass renderPass) {
6504 assert(renderPass in State.RenderPasses)
6505 return State.RenderPasses[renderPass]
6506}
6507
6508macro ref!PipelineCacheObject GetPipelineCache(VkPipelineCache pipelineCache) {
6509 assert(pipelineCache in State.PipelineCaches)
6510 return State.PipelineCaches[pipelineCache]
6511}
6512
Jesse Hall3fbc8562015-11-29 22:10:52 -08006513macro ref!CommandPoolObject GetCommandPool(VkCommandPool commandPool) {
6514 assert(commandPool in State.CommandPools)
6515 return State.CommandPools[commandPool]
Jesse Hallf09c6b12015-08-15 19:54:28 -07006516}
Michael Lentine88594d72015-11-12 12:49:45 -08006517
Jesse Hall1356b0d2015-11-23 17:24:58 -08006518macro ref!SurfaceObject GetSurface(VkSurfaceKHR surface) {
6519 assert(surface in State.Surfaces)
6520 return State.Surfaces[surface]
6521}
6522
Michael Lentine88594d72015-11-12 12:49:45 -08006523macro ref!SwapchainObject GetSwapchain(VkSwapchainKHR swapchain) {
6524 assert(swapchain in State.Swapchains)
6525 return State.Swapchains[swapchain]
6526}
Jesse Halld8bade02015-11-24 10:24:18 -08006527
6528macro VkQueueFlags AddQueueFlag(VkQueueFlags flags, VkQueueFlagBits bit) {
6529 return as!VkQueueFlags(as!u32(flags) | as!u32(bit))
6530}