blob: cfeeeefd7f247ae2ba937dabaf8f0947b033fc6b [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
Chris Forbes289cb792016-12-30 15:03:55 +130031define VERSION_PATCH 38
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
Chris Forbes1d4e5542017-02-15 19:38:50 +130089@extension("VK_ANDROID_native_buffer") define VK_ANDROID_NATIVE_BUFFER_SPEC_VERSION 7
Chia-I Wub262ddc2016-03-22 07:38:20 +080090@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
Chris Forbes289cb792016-12-30 15:03:55 +130093@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 Hall56d386a2016-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 Hall56d386a2016-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 Hall56d386a2016-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 Hall56d386a2016-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
Chris Forbes289cb792016-12-30 15:03:55 +1300133@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
Jesse Halleb02c472017-02-24 15:13:45 -0800136// 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
Chris Forbes289cb792016-12-30 15:03:55 +1300153@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
Jesse Halleb02c472017-02-24 15:13:45 -0800156// 57
Chris Forbes289cb792016-12-30 15:03:55 +1300157@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
Jesse Halleb02c472017-02-24 15:13:45 -0800160// 58
Chris Forbes289cb792016-12-30 15:03:55 +1300161@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
Jesse Halleb02c472017-02-24 15:13:45 -0800164// 59
Chris Forbes289cb792016-12-30 15:03:55 +1300165@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 Hall889cd9a2017-02-25 22:12:23 -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
Chris Forbes289cb792016-12-30 15:03:55 +1300173@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 Hall889cd9a2017-02-25 22:12:23 -0800176// 85
177@extension("VK_KHR_incremental_present") define VK_KHR_INCREMENTAL_PRESENT_SPEC_VERSION 1
178@extension("VK_KHR_incremental_present") define VK_KHR_INCREMENTAL_PRESENT_NAME "VK_KHR_incremental_present"
179
Jesse Halleb02c472017-02-24 15:13:45 -0800180// 87
Chris Forbes289cb792016-12-30 15:03:55 +1300181@extension("VK_NVX_device_generated_commands") define VK_NVX_DEVICE_GENERATED_COMMANDS_SPEC_VERSION 1
182@extension("VK_NVX_device_generated_commands") define VK_NVX_DEVICE_GENERATED_COMMANDS_EXTENSION_NAME "VK_NVX_device_generated_commands"
183
Jesse Hall889cd9a2017-02-25 22:12:23 -0800184// 93
185@extension("VK_GOOGLE_display_timing") define VK_GOOGLE_DISPLAY_TIMING_SPEC_VERSION 1
186@extension("VK_GOOGLE_display_timing") define VK_GOOGLE_DISPLAY_TIMING_NAME "VK_GOOGLE_display_timing"
187
188// 106
189@extension("VK_EXT_hdr_metadata") define VK_EXT_HDR_METADATA_SPEC_VERSION 1
190@extension("VK_EXT_hdr_metadata") define VK_EXT_HDR_METADATA_EXTENSION_NAME "VK_EXT_hdr_metadata"
191
192// 112
Chris Forbes1d5f68c2017-01-31 10:17:01 +1300193@extension("VK_KHR_shared_presentable_image") define VK_KHR_SHARED_PRESENTABLE_IMAGE_SPEC_VERSION 1
194@extension("VK_KHR_shared_presentable_image") define VK_KHR_SHARED_PRESENTABLE_IMAGE_EXTENSION_NAME "VK_KHR_shared_presentable_image"
Chris Forbes2e12cb82017-01-18 11:45:17 +1300195
Jesse Halld27f6aa2015-08-15 17:58:48 -0700196/////////////
197// Types //
198/////////////
199
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700200type u32 VkBool32
201type u32 VkFlags
202type u64 VkDeviceSize
203type u32 VkSampleMask
204
Jesse Halld27f6aa2015-08-15 17:58:48 -0700205/// Dispatchable handle types.
206@dispatchHandle type u64 VkInstance
207@dispatchHandle type u64 VkPhysicalDevice
208@dispatchHandle type u64 VkDevice
209@dispatchHandle type u64 VkQueue
Jesse Hall3fbc8562015-11-29 22:10:52 -0800210@dispatchHandle type u64 VkCommandBuffer
Jesse Halld27f6aa2015-08-15 17:58:48 -0700211
212/// Non dispatchable handle types.
213@nonDispatchHandle type u64 VkDeviceMemory
Jesse Hall3fbc8562015-11-29 22:10:52 -0800214@nonDispatchHandle type u64 VkCommandPool
Jesse Halld27f6aa2015-08-15 17:58:48 -0700215@nonDispatchHandle type u64 VkBuffer
216@nonDispatchHandle type u64 VkBufferView
217@nonDispatchHandle type u64 VkImage
218@nonDispatchHandle type u64 VkImageView
Jesse Halld27f6aa2015-08-15 17:58:48 -0700219@nonDispatchHandle type u64 VkShaderModule
Jesse Halld27f6aa2015-08-15 17:58:48 -0700220@nonDispatchHandle type u64 VkPipeline
221@nonDispatchHandle type u64 VkPipelineLayout
222@nonDispatchHandle type u64 VkSampler
223@nonDispatchHandle type u64 VkDescriptorSet
224@nonDispatchHandle type u64 VkDescriptorSetLayout
225@nonDispatchHandle type u64 VkDescriptorPool
Jesse Halld27f6aa2015-08-15 17:58:48 -0700226@nonDispatchHandle type u64 VkFence
227@nonDispatchHandle type u64 VkSemaphore
228@nonDispatchHandle type u64 VkEvent
229@nonDispatchHandle type u64 VkQueryPool
230@nonDispatchHandle type u64 VkFramebuffer
231@nonDispatchHandle type u64 VkRenderPass
232@nonDispatchHandle type u64 VkPipelineCache
Jesse Hall1356b0d2015-11-23 17:24:58 -0800233
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800234@extension("VK_KHR_surface") @nonDispatchHandle type u64 VkSurfaceKHR
Jesse Hall1356b0d2015-11-23 17:24:58 -0800235
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800236@extension("VK_KHR_swapchain") @nonDispatchHandle type u64 VkSwapchainKHR
Jesse Hall1356b0d2015-11-23 17:24:58 -0800237
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800238@extension("VK_KHR_display") @nonDispatchHandle type u64 VkDisplayKHR
239@extension("VK_KHR_display") @nonDispatchHandle type u64 VkDisplayModeKHR
Jesse Halld27f6aa2015-08-15 17:58:48 -0700240
Jesse Hall715b86a2016-01-16 16:34:29 -0800241@extension("VK_EXT_debug_report") @nonDispatchHandle type u64 VkDebugReportCallbackEXT
242
Chris Forbes289cb792016-12-30 15:03:55 +1300243@extension("VK_NVX_device_generated_commands") @nonDispatchHandle type u64 VkObjectTableNVX
244@extension("VK_NVX_device_generated_commands") @nonDispatchHandle type u64 VkIndirectCommandsLayoutNVX
245
Jesse Halld27f6aa2015-08-15 17:58:48 -0700246
247/////////////
248// Enums //
249/////////////
250
251enum VkImageLayout {
252 VK_IMAGE_LAYOUT_UNDEFINED = 0x00000000, /// Implicit layout an image is when its contents are undefined due to various reasons (e.g. right after creation)
253 VK_IMAGE_LAYOUT_GENERAL = 0x00000001, /// General layout when image can be used for any kind of access
254 VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL = 0x00000002, /// Optimal layout when image is only used for color attachment read/write
255 VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL = 0x00000003, /// Optimal layout when image is only used for depth/stencil attachment read/write
256 VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL = 0x00000004, /// Optimal layout when image is used for read only depth/stencil attachment and shader access
257 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 -0800258 VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL = 0x00000006, /// Optimal layout when image is used only as source of transfer operations
259 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 -0700260 VK_IMAGE_LAYOUT_PREINITIALIZED = 0x00000008, /// Initial layout used when the data is populated by the CPU
Jesse Hall1356b0d2015-11-23 17:24:58 -0800261
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800262 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800263 VK_IMAGE_LAYOUT_PRESENT_SRC_KHR = 1000001002,
Chris Forbesaf3a1112017-01-31 15:37:03 +1300264
265 //@extension("VK_KHR_shared_presentable_image")
266 VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR = 1000111000,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700267}
268
269enum VkAttachmentLoadOp {
270 VK_ATTACHMENT_LOAD_OP_LOAD = 0x00000000,
271 VK_ATTACHMENT_LOAD_OP_CLEAR = 0x00000001,
272 VK_ATTACHMENT_LOAD_OP_DONT_CARE = 0x00000002,
273}
274
275enum VkAttachmentStoreOp {
276 VK_ATTACHMENT_STORE_OP_STORE = 0x00000000,
277 VK_ATTACHMENT_STORE_OP_DONT_CARE = 0x00000001,
278}
279
280enum VkImageType {
281 VK_IMAGE_TYPE_1D = 0x00000000,
282 VK_IMAGE_TYPE_2D = 0x00000001,
283 VK_IMAGE_TYPE_3D = 0x00000002,
284}
285
286enum VkImageTiling {
Jesse Hallc7467b72015-11-29 21:05:26 -0800287 VK_IMAGE_TILING_OPTIMAL = 0x00000000,
288 VK_IMAGE_TILING_LINEAR = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700289}
290
291enum VkImageViewType {
292 VK_IMAGE_VIEW_TYPE_1D = 0x00000000,
293 VK_IMAGE_VIEW_TYPE_2D = 0x00000001,
294 VK_IMAGE_VIEW_TYPE_3D = 0x00000002,
295 VK_IMAGE_VIEW_TYPE_CUBE = 0x00000003,
296 VK_IMAGE_VIEW_TYPE_1D_ARRAY = 0x00000004,
297 VK_IMAGE_VIEW_TYPE_2D_ARRAY = 0x00000005,
298 VK_IMAGE_VIEW_TYPE_CUBE_ARRAY = 0x00000006,
299}
300
Jesse Hall3fbc8562015-11-29 22:10:52 -0800301enum VkCommandBufferLevel {
302 VK_COMMAND_BUFFER_LEVEL_PRIMARY = 0x00000000,
303 VK_COMMAND_BUFFER_LEVEL_SECONDARY = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700304}
305
Jesse Hall65ab5522015-11-30 00:07:16 -0800306enum VkComponentSwizzle {
307 VK_COMPONENT_SWIZZLE_IDENTITY = 0x00000000,
308 VK_COMPONENT_SWIZZLE_ZERO = 0x00000001,
309 VK_COMPONENT_SWIZZLE_ONE = 0x00000002,
310 VK_COMPONENT_SWIZZLE_R = 0x00000003,
311 VK_COMPONENT_SWIZZLE_G = 0x00000004,
312 VK_COMPONENT_SWIZZLE_B = 0x00000005,
313 VK_COMPONENT_SWIZZLE_A = 0x00000006,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700314}
315
316enum VkDescriptorType {
317 VK_DESCRIPTOR_TYPE_SAMPLER = 0x00000000,
318 VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER = 0x00000001,
319 VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE = 0x00000002,
320 VK_DESCRIPTOR_TYPE_STORAGE_IMAGE = 0x00000003,
321 VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER = 0x00000004,
322 VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER = 0x00000005,
323 VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER = 0x00000006,
324 VK_DESCRIPTOR_TYPE_STORAGE_BUFFER = 0x00000007,
325 VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC = 0x00000008,
326 VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC = 0x00000009,
327 VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT = 0x0000000a,
328}
329
Jesse Halld27f6aa2015-08-15 17:58:48 -0700330enum VkQueryType {
331 VK_QUERY_TYPE_OCCLUSION = 0x00000000,
332 VK_QUERY_TYPE_PIPELINE_STATISTICS = 0x00000001, /// Optional
Jesse Halla3a7a1d2015-11-24 11:37:23 -0800333 VK_QUERY_TYPE_TIMESTAMP = 0x00000002,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700334}
335
Jesse Halld27f6aa2015-08-15 17:58:48 -0700336enum VkBorderColor {
337 VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK = 0x00000000,
338 VK_BORDER_COLOR_INT_TRANSPARENT_BLACK = 0x00000001,
339 VK_BORDER_COLOR_FLOAT_OPAQUE_BLACK = 0x00000002,
340 VK_BORDER_COLOR_INT_OPAQUE_BLACK = 0x00000003,
341 VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE = 0x00000004,
342 VK_BORDER_COLOR_INT_OPAQUE_WHITE = 0x00000005,
343}
344
345enum VkPipelineBindPoint {
Jesse Hallc7467b72015-11-29 21:05:26 -0800346 VK_PIPELINE_BIND_POINT_GRAPHICS = 0x00000000,
347 VK_PIPELINE_BIND_POINT_COMPUTE = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700348}
349
350enum VkPrimitiveTopology {
351 VK_PRIMITIVE_TOPOLOGY_POINT_LIST = 0x00000000,
352 VK_PRIMITIVE_TOPOLOGY_LINE_LIST = 0x00000001,
353 VK_PRIMITIVE_TOPOLOGY_LINE_STRIP = 0x00000002,
354 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST = 0x00000003,
355 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP = 0x00000004,
356 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN = 0x00000005,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800357 VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY = 0x00000006,
358 VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY = 0x00000007,
359 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY = 0x00000008,
360 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY = 0x00000009,
Jesse Hall091ed9e2015-11-30 00:55:29 -0800361 VK_PRIMITIVE_TOPOLOGY_PATCH_LIST = 0x0000000a,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700362}
363
364enum VkSharingMode {
365 VK_SHARING_MODE_EXCLUSIVE = 0x00000000,
366 VK_SHARING_MODE_CONCURRENT = 0x00000001,
367}
368
369enum VkIndexType {
370 VK_INDEX_TYPE_UINT16 = 0x00000000,
371 VK_INDEX_TYPE_UINT32 = 0x00000001,
372}
373
Jesse Hall23ff73f2015-11-29 14:36:39 -0800374enum VkFilter {
375 VK_FILTER_NEAREST = 0x00000000,
376 VK_FILTER_LINEAR = 0x00000001,
Jesse Hall26763382016-05-20 07:13:52 -0700377
378 //@extension("VK_IMG_filter_cubic")
379 VK_FILTER_CUBIC_IMG = 1000015000,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700380}
381
Jesse Hall23ff73f2015-11-29 14:36:39 -0800382enum VkSamplerMipmapMode {
Jesse Hall23ff73f2015-11-29 14:36:39 -0800383 VK_SAMPLER_MIPMAP_MODE_NEAREST = 0x00000001, /// Choose nearest mip level
384 VK_SAMPLER_MIPMAP_MODE_LINEAR = 0x00000002, /// Linear filter between mip levels
Jesse Halld27f6aa2015-08-15 17:58:48 -0700385}
386
Jesse Hall23ff73f2015-11-29 14:36:39 -0800387enum VkSamplerAddressMode {
Jesse Hallc7467b72015-11-29 21:05:26 -0800388 VK_SAMPLER_ADDRESS_MODE_REPEAT = 0x00000000,
389 VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT = 0x00000001,
390 VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE = 0x00000002,
391 VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER = 0x00000003,
392 VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700393}
394
395enum VkCompareOp {
396 VK_COMPARE_OP_NEVER = 0x00000000,
397 VK_COMPARE_OP_LESS = 0x00000001,
398 VK_COMPARE_OP_EQUAL = 0x00000002,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800399 VK_COMPARE_OP_LESS_OR_EQUAL = 0x00000003,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700400 VK_COMPARE_OP_GREATER = 0x00000004,
401 VK_COMPARE_OP_NOT_EQUAL = 0x00000005,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800402 VK_COMPARE_OP_GREATER_OR_EQUAL = 0x00000006,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700403 VK_COMPARE_OP_ALWAYS = 0x00000007,
404}
405
Jesse Hall65ab5522015-11-30 00:07:16 -0800406enum VkPolygonMode {
407 VK_POLYGON_MODE_FILL = 0x00000000,
408 VK_POLYGON_MODE_LINE = 0x00000001,
409 VK_POLYGON_MODE_POINT = 0x00000002,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700410}
411
412enum VkFrontFace {
Jesse Hall3fbc8562015-11-29 22:10:52 -0800413 VK_FRONT_FACE_COUNTER_CLOCKWISE = 0x00000000,
414 VK_FRONT_FACE_CLOCKWISE = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700415}
416
Jesse Hall65ab5522015-11-30 00:07:16 -0800417enum VkBlendFactor {
418 VK_BLEND_FACTOR_ZERO = 0x00000000,
419 VK_BLEND_FACTOR_ONE = 0x00000001,
420 VK_BLEND_FACTOR_SRC_COLOR = 0x00000002,
421 VK_BLEND_FACTOR_ONE_MINUS_SRC_COLOR = 0x00000003,
422 VK_BLEND_FACTOR_DST_COLOR = 0x00000004,
423 VK_BLEND_FACTOR_ONE_MINUS_DST_COLOR = 0x00000005,
424 VK_BLEND_FACTOR_SRC_ALPHA = 0x00000006,
425 VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA = 0x00000007,
426 VK_BLEND_FACTOR_DST_ALPHA = 0x00000008,
427 VK_BLEND_FACTOR_ONE_MINUS_DST_ALPHA = 0x00000009,
428 VK_BLEND_FACTOR_CONSTANT_COLOR = 0x0000000a,
429 VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR = 0x0000000b,
430 VK_BLEND_FACTOR_CONSTANT_ALPHA = 0x0000000c,
431 VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA = 0x0000000d,
432 VK_BLEND_FACTOR_SRC_ALPHA_SATURATE = 0x0000000e,
433 VK_BLEND_FACTOR_SRC1_COLOR = 0x0000000f,
434 VK_BLEND_FACTOR_ONE_MINUS_SRC1_COLOR = 0x00000010,
435 VK_BLEND_FACTOR_SRC1_ALPHA = 0x00000011,
436 VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA = 0x00000012,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700437}
438
439enum VkBlendOp {
440 VK_BLEND_OP_ADD = 0x00000000,
441 VK_BLEND_OP_SUBTRACT = 0x00000001,
442 VK_BLEND_OP_REVERSE_SUBTRACT = 0x00000002,
443 VK_BLEND_OP_MIN = 0x00000003,
444 VK_BLEND_OP_MAX = 0x00000004,
445}
446
447enum VkStencilOp {
448 VK_STENCIL_OP_KEEP = 0x00000000,
449 VK_STENCIL_OP_ZERO = 0x00000001,
450 VK_STENCIL_OP_REPLACE = 0x00000002,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800451 VK_STENCIL_OP_INCREMENT_AND_CLAMP = 0x00000003,
452 VK_STENCIL_OP_DECREMENT_AND_CLAMP = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700453 VK_STENCIL_OP_INVERT = 0x00000005,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800454 VK_STENCIL_OP_INCREMENT_AND_WRAP = 0x00000006,
455 VK_STENCIL_OP_DECREMENT_AND_WRAP = 0x00000007,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700456}
457
458enum VkLogicOp {
459 VK_LOGIC_OP_CLEAR = 0x00000000,
460 VK_LOGIC_OP_AND = 0x00000001,
461 VK_LOGIC_OP_AND_REVERSE = 0x00000002,
462 VK_LOGIC_OP_COPY = 0x00000003,
463 VK_LOGIC_OP_AND_INVERTED = 0x00000004,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800464 VK_LOGIC_OP_NO_OP = 0x00000005,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700465 VK_LOGIC_OP_XOR = 0x00000006,
466 VK_LOGIC_OP_OR = 0x00000007,
467 VK_LOGIC_OP_NOR = 0x00000008,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800468 VK_LOGIC_OP_EQUIVALENT = 0x00000009,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700469 VK_LOGIC_OP_INVERT = 0x0000000a,
470 VK_LOGIC_OP_OR_REVERSE = 0x0000000b,
471 VK_LOGIC_OP_COPY_INVERTED = 0x0000000c,
472 VK_LOGIC_OP_OR_INVERTED = 0x0000000d,
473 VK_LOGIC_OP_NAND = 0x0000000e,
474 VK_LOGIC_OP_SET = 0x0000000f,
475}
476
Jesse Hall3fbc8562015-11-29 22:10:52 -0800477enum VkSystemAllocationScope {
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800478 VK_SYSTEM_ALLOCATION_SCOPE_COMMAND = 0x00000000,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800479 VK_SYSTEM_ALLOCATION_SCOPE_OBJECT = 0x00000001,
480 VK_SYSTEM_ALLOCATION_SCOPE_CACHE = 0x00000002,
481 VK_SYSTEM_ALLOCATION_SCOPE_DEVICE = 0x00000003,
482 VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE = 0x00000004,
Jesse Hall03b6fe12015-11-24 12:44:21 -0800483}
484
Jesse Hall3fbc8562015-11-29 22:10:52 -0800485enum VkInternalAllocationType {
486 VK_INTERNAL_ALLOCATION_TYPE_EXECUTABLE = 0x00000000,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700487}
488
489enum VkPhysicalDeviceType {
490 VK_PHYSICAL_DEVICE_TYPE_OTHER = 0x00000000,
491 VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU = 0x00000001,
492 VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU = 0x00000002,
493 VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU = 0x00000003,
494 VK_PHYSICAL_DEVICE_TYPE_CPU = 0x00000004,
495}
496
Jesse Hall65ab5522015-11-30 00:07:16 -0800497enum VkVertexInputRate {
498 VK_VERTEX_INPUT_RATE_VERTEX = 0x00000000,
499 VK_VERTEX_INPUT_RATE_INSTANCE = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700500}
501
502/// Vulkan format definitions
503enum VkFormat {
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800504 VK_FORMAT_UNDEFINED = 0,
505 VK_FORMAT_R4G4_UNORM_PACK8 = 1,
506 VK_FORMAT_R4G4B4A4_UNORM_PACK16 = 2,
507 VK_FORMAT_B4G4R4A4_UNORM_PACK16 = 3,
508 VK_FORMAT_R5G6B5_UNORM_PACK16 = 4,
509 VK_FORMAT_B5G6R5_UNORM_PACK16 = 5,
510 VK_FORMAT_R5G5B5A1_UNORM_PACK16 = 6,
511 VK_FORMAT_B5G5R5A1_UNORM_PACK16 = 7,
512 VK_FORMAT_A1R5G5B5_UNORM_PACK16 = 8,
513 VK_FORMAT_R8_UNORM = 9,
514 VK_FORMAT_R8_SNORM = 10,
515 VK_FORMAT_R8_USCALED = 11,
516 VK_FORMAT_R8_SSCALED = 12,
517 VK_FORMAT_R8_UINT = 13,
518 VK_FORMAT_R8_SINT = 14,
519 VK_FORMAT_R8_SRGB = 15,
520 VK_FORMAT_R8G8_UNORM = 16,
521 VK_FORMAT_R8G8_SNORM = 17,
522 VK_FORMAT_R8G8_USCALED = 18,
523 VK_FORMAT_R8G8_SSCALED = 19,
524 VK_FORMAT_R8G8_UINT = 20,
525 VK_FORMAT_R8G8_SINT = 21,
526 VK_FORMAT_R8G8_SRGB = 22,
527 VK_FORMAT_R8G8B8_UNORM = 23,
528 VK_FORMAT_R8G8B8_SNORM = 24,
529 VK_FORMAT_R8G8B8_USCALED = 25,
530 VK_FORMAT_R8G8B8_SSCALED = 26,
531 VK_FORMAT_R8G8B8_UINT = 27,
532 VK_FORMAT_R8G8B8_SINT = 28,
533 VK_FORMAT_R8G8B8_SRGB = 29,
534 VK_FORMAT_B8G8R8_UNORM = 30,
535 VK_FORMAT_B8G8R8_SNORM = 31,
536 VK_FORMAT_B8G8R8_USCALED = 32,
537 VK_FORMAT_B8G8R8_SSCALED = 33,
538 VK_FORMAT_B8G8R8_UINT = 34,
539 VK_FORMAT_B8G8R8_SINT = 35,
540 VK_FORMAT_B8G8R8_SRGB = 36,
541 VK_FORMAT_R8G8B8A8_UNORM = 37,
542 VK_FORMAT_R8G8B8A8_SNORM = 38,
543 VK_FORMAT_R8G8B8A8_USCALED = 39,
544 VK_FORMAT_R8G8B8A8_SSCALED = 40,
545 VK_FORMAT_R8G8B8A8_UINT = 41,
546 VK_FORMAT_R8G8B8A8_SINT = 42,
547 VK_FORMAT_R8G8B8A8_SRGB = 43,
548 VK_FORMAT_B8G8R8A8_UNORM = 44,
549 VK_FORMAT_B8G8R8A8_SNORM = 45,
550 VK_FORMAT_B8G8R8A8_USCALED = 46,
551 VK_FORMAT_B8G8R8A8_SSCALED = 47,
552 VK_FORMAT_B8G8R8A8_UINT = 48,
553 VK_FORMAT_B8G8R8A8_SINT = 49,
554 VK_FORMAT_B8G8R8A8_SRGB = 50,
555 VK_FORMAT_A8B8G8R8_UNORM_PACK32 = 51,
556 VK_FORMAT_A8B8G8R8_SNORM_PACK32 = 52,
557 VK_FORMAT_A8B8G8R8_USCALED_PACK32 = 53,
558 VK_FORMAT_A8B8G8R8_SSCALED_PACK32 = 54,
559 VK_FORMAT_A8B8G8R8_UINT_PACK32 = 55,
560 VK_FORMAT_A8B8G8R8_SINT_PACK32 = 56,
561 VK_FORMAT_A8B8G8R8_SRGB_PACK32 = 57,
562 VK_FORMAT_A2R10G10B10_UNORM_PACK32 = 58,
563 VK_FORMAT_A2R10G10B10_SNORM_PACK32 = 59,
564 VK_FORMAT_A2R10G10B10_USCALED_PACK32 = 60,
565 VK_FORMAT_A2R10G10B10_SSCALED_PACK32 = 61,
566 VK_FORMAT_A2R10G10B10_UINT_PACK32 = 62,
567 VK_FORMAT_A2R10G10B10_SINT_PACK32 = 63,
568 VK_FORMAT_A2B10G10R10_UNORM_PACK32 = 64,
569 VK_FORMAT_A2B10G10R10_SNORM_PACK32 = 65,
570 VK_FORMAT_A2B10G10R10_USCALED_PACK32 = 66,
571 VK_FORMAT_A2B10G10R10_SSCALED_PACK32 = 67,
572 VK_FORMAT_A2B10G10R10_UINT_PACK32 = 68,
573 VK_FORMAT_A2B10G10R10_SINT_PACK32 = 69,
574 VK_FORMAT_R16_UNORM = 70,
575 VK_FORMAT_R16_SNORM = 71,
576 VK_FORMAT_R16_USCALED = 72,
577 VK_FORMAT_R16_SSCALED = 73,
578 VK_FORMAT_R16_UINT = 74,
579 VK_FORMAT_R16_SINT = 75,
580 VK_FORMAT_R16_SFLOAT = 76,
581 VK_FORMAT_R16G16_UNORM = 77,
582 VK_FORMAT_R16G16_SNORM = 78,
583 VK_FORMAT_R16G16_USCALED = 79,
584 VK_FORMAT_R16G16_SSCALED = 80,
585 VK_FORMAT_R16G16_UINT = 81,
586 VK_FORMAT_R16G16_SINT = 82,
587 VK_FORMAT_R16G16_SFLOAT = 83,
588 VK_FORMAT_R16G16B16_UNORM = 84,
589 VK_FORMAT_R16G16B16_SNORM = 85,
590 VK_FORMAT_R16G16B16_USCALED = 86,
591 VK_FORMAT_R16G16B16_SSCALED = 87,
592 VK_FORMAT_R16G16B16_UINT = 88,
593 VK_FORMAT_R16G16B16_SINT = 89,
594 VK_FORMAT_R16G16B16_SFLOAT = 90,
595 VK_FORMAT_R16G16B16A16_UNORM = 91,
596 VK_FORMAT_R16G16B16A16_SNORM = 92,
597 VK_FORMAT_R16G16B16A16_USCALED = 93,
598 VK_FORMAT_R16G16B16A16_SSCALED = 94,
599 VK_FORMAT_R16G16B16A16_UINT = 95,
600 VK_FORMAT_R16G16B16A16_SINT = 96,
601 VK_FORMAT_R16G16B16A16_SFLOAT = 97,
602 VK_FORMAT_R32_UINT = 98,
603 VK_FORMAT_R32_SINT = 99,
604 VK_FORMAT_R32_SFLOAT = 100,
605 VK_FORMAT_R32G32_UINT = 101,
606 VK_FORMAT_R32G32_SINT = 102,
607 VK_FORMAT_R32G32_SFLOAT = 103,
608 VK_FORMAT_R32G32B32_UINT = 104,
609 VK_FORMAT_R32G32B32_SINT = 105,
610 VK_FORMAT_R32G32B32_SFLOAT = 106,
611 VK_FORMAT_R32G32B32A32_UINT = 107,
612 VK_FORMAT_R32G32B32A32_SINT = 108,
613 VK_FORMAT_R32G32B32A32_SFLOAT = 109,
614 VK_FORMAT_R64_UINT = 110,
615 VK_FORMAT_R64_SINT = 111,
616 VK_FORMAT_R64_SFLOAT = 112,
617 VK_FORMAT_R64G64_UINT = 113,
618 VK_FORMAT_R64G64_SINT = 114,
619 VK_FORMAT_R64G64_SFLOAT = 115,
620 VK_FORMAT_R64G64B64_UINT = 116,
621 VK_FORMAT_R64G64B64_SINT = 117,
622 VK_FORMAT_R64G64B64_SFLOAT = 118,
623 VK_FORMAT_R64G64B64A64_UINT = 119,
624 VK_FORMAT_R64G64B64A64_SINT = 120,
625 VK_FORMAT_R64G64B64A64_SFLOAT = 121,
626 VK_FORMAT_B10G11R11_UFLOAT_PACK32 = 122,
627 VK_FORMAT_E5B9G9R9_UFLOAT_PACK32 = 123,
628 VK_FORMAT_D16_UNORM = 124,
629 VK_FORMAT_X8_D24_UNORM_PACK32 = 125,
630 VK_FORMAT_D32_SFLOAT = 126,
631 VK_FORMAT_S8_UINT = 127,
632 VK_FORMAT_D16_UNORM_S8_UINT = 128,
633 VK_FORMAT_D24_UNORM_S8_UINT = 129,
634 VK_FORMAT_D32_SFLOAT_S8_UINT = 130,
635 VK_FORMAT_BC1_RGB_UNORM_BLOCK = 131,
636 VK_FORMAT_BC1_RGB_SRGB_BLOCK = 132,
637 VK_FORMAT_BC1_RGBA_UNORM_BLOCK = 133,
638 VK_FORMAT_BC1_RGBA_SRGB_BLOCK = 134,
639 VK_FORMAT_BC2_UNORM_BLOCK = 135,
640 VK_FORMAT_BC2_SRGB_BLOCK = 136,
641 VK_FORMAT_BC3_UNORM_BLOCK = 137,
642 VK_FORMAT_BC3_SRGB_BLOCK = 138,
643 VK_FORMAT_BC4_UNORM_BLOCK = 139,
644 VK_FORMAT_BC4_SNORM_BLOCK = 140,
645 VK_FORMAT_BC5_UNORM_BLOCK = 141,
646 VK_FORMAT_BC5_SNORM_BLOCK = 142,
647 VK_FORMAT_BC6H_UFLOAT_BLOCK = 143,
648 VK_FORMAT_BC6H_SFLOAT_BLOCK = 144,
649 VK_FORMAT_BC7_UNORM_BLOCK = 145,
650 VK_FORMAT_BC7_SRGB_BLOCK = 146,
651 VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK = 147,
652 VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK = 148,
653 VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK = 149,
654 VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK = 150,
655 VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK = 151,
656 VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK = 152,
657 VK_FORMAT_EAC_R11_UNORM_BLOCK = 153,
658 VK_FORMAT_EAC_R11_SNORM_BLOCK = 154,
659 VK_FORMAT_EAC_R11G11_UNORM_BLOCK = 155,
660 VK_FORMAT_EAC_R11G11_SNORM_BLOCK = 156,
661 VK_FORMAT_ASTC_4x4_UNORM_BLOCK = 157,
662 VK_FORMAT_ASTC_4x4_SRGB_BLOCK = 158,
663 VK_FORMAT_ASTC_5x4_UNORM_BLOCK = 159,
664 VK_FORMAT_ASTC_5x4_SRGB_BLOCK = 160,
665 VK_FORMAT_ASTC_5x5_UNORM_BLOCK = 161,
666 VK_FORMAT_ASTC_5x5_SRGB_BLOCK = 162,
667 VK_FORMAT_ASTC_6x5_UNORM_BLOCK = 163,
668 VK_FORMAT_ASTC_6x5_SRGB_BLOCK = 164,
669 VK_FORMAT_ASTC_6x6_UNORM_BLOCK = 165,
670 VK_FORMAT_ASTC_6x6_SRGB_BLOCK = 166,
671 VK_FORMAT_ASTC_8x5_UNORM_BLOCK = 167,
672 VK_FORMAT_ASTC_8x5_SRGB_BLOCK = 168,
673 VK_FORMAT_ASTC_8x6_UNORM_BLOCK = 169,
674 VK_FORMAT_ASTC_8x6_SRGB_BLOCK = 170,
675 VK_FORMAT_ASTC_8x8_UNORM_BLOCK = 171,
676 VK_FORMAT_ASTC_8x8_SRGB_BLOCK = 172,
677 VK_FORMAT_ASTC_10x5_UNORM_BLOCK = 173,
678 VK_FORMAT_ASTC_10x5_SRGB_BLOCK = 174,
679 VK_FORMAT_ASTC_10x6_UNORM_BLOCK = 175,
680 VK_FORMAT_ASTC_10x6_SRGB_BLOCK = 176,
681 VK_FORMAT_ASTC_10x8_UNORM_BLOCK = 177,
682 VK_FORMAT_ASTC_10x8_SRGB_BLOCK = 178,
683 VK_FORMAT_ASTC_10x10_UNORM_BLOCK = 179,
684 VK_FORMAT_ASTC_10x10_SRGB_BLOCK = 180,
685 VK_FORMAT_ASTC_12x10_UNORM_BLOCK = 181,
686 VK_FORMAT_ASTC_12x10_SRGB_BLOCK = 182,
687 VK_FORMAT_ASTC_12x12_UNORM_BLOCK = 183,
688 VK_FORMAT_ASTC_12x12_SRGB_BLOCK = 184,
Chris Forbes289cb792016-12-30 15:03:55 +1300689
690 //@extension("VK_IMG_format_pvrtc")
Jesse Halleb02c472017-02-24 15:13:45 -0800691 VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG = 1000054000,
692 VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG = 1000054001,
693 VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG = 1000054002,
694 VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG = 1000054003,
695 VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG = 1000054004,
696 VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG = 1000054005,
697 VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG = 1000054006,
698 VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG = 1000054007,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700699}
700
Jesse Halld27f6aa2015-08-15 17:58:48 -0700701/// Structure type enumerant
702enum VkStructureType {
703 VK_STRUCTURE_TYPE_APPLICATION_INFO = 0,
Jesse Hallc7467b72015-11-29 21:05:26 -0800704 VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO = 1,
705 VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO = 2,
706 VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO = 3,
707 VK_STRUCTURE_TYPE_SUBMIT_INFO = 4,
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800708 VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO = 5,
Jesse Hallc7467b72015-11-29 21:05:26 -0800709 VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE = 6,
710 VK_STRUCTURE_TYPE_BIND_SPARSE_INFO = 7,
711 VK_STRUCTURE_TYPE_FENCE_CREATE_INFO = 8,
712 VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO = 9,
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700713 VK_STRUCTURE_TYPE_EVENT_CREATE_INFO = 10,
Jesse Hallc7467b72015-11-29 21:05:26 -0800714 VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO = 11,
715 VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO = 12,
716 VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO = 13,
717 VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO = 14,
718 VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO = 15,
719 VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO = 16,
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800720 VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO = 17,
721 VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO = 18,
722 VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO = 19,
723 VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO = 20,
724 VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO = 21,
725 VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO = 22,
726 VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO = 23,
727 VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO = 24,
728 VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO = 25,
729 VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO = 26,
730 VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO = 27,
731 VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO = 28,
732 VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO = 29,
733 VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO = 30,
734 VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO = 31,
735 VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO = 32,
736 VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO = 33,
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800737 VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO = 34,
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800738 VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET = 35,
739 VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET = 36,
740 VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO = 37,
741 VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO = 38,
742 VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO = 39,
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800743 VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO = 40,
Jesse Hall3dd678a2016-01-08 21:52:01 -0800744 VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO = 41,
745 VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO = 42,
746 VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO = 43,
747 VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER = 44,
748 VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER = 45,
749 VK_STRUCTURE_TYPE_MEMORY_BARRIER = 46,
750 VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO = 47,
751 VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO = 48,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800752
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800753 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800754 VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR = 1000001000,
755 VK_STRUCTURE_TYPE_PRESENT_INFO_KHR = 1000001001,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800756
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800757 //@extension("VK_KHR_display")
Jesse Hallbd888842015-11-30 21:44:14 -0800758 VK_STRUCTURE_TYPE_DISPLAY_MODE_CREATE_INFO_KHR = 1000002000,
759 VK_STRUCTURE_TYPE_DISPLAY_SURFACE_CREATE_INFO_KHR = 1000002001,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800760
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800761 //@extension("VK_KHR_display_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800762 VK_STRUCTURE_TYPE_DISPLAY_DISPLAY_PRESENT_INFO_KHR = 1000003000,
Jesse Hallf9fa9a52016-01-08 16:08:51 -0800763
764 //@extension("VK_KHR_xlib_surface")
765 VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR = 1000004000,
766
767 //@extension("VK_KHR_xcb_surface")
768 VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR = 1000005000,
769
770 //@extension("VK_KHR_wayland_surface")
771 VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR = 1000006000,
772
773 //@extension("VK_KHR_mir_surface")
774 VK_STRUCTURE_TYPE_MIR_SURFACE_CREATE_INFO_KHR = 1000007000,
775
776 //@extension("VK_KHR_android_surface")
777 VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR = 1000008000,
778
779 //@extension("VK_KHR_win32_surface")
780 VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR = 1000009000,
Jesse Hall543a7ff2016-01-08 16:38:30 -0800781
Ian Elliott948233a2017-01-06 12:13:23 -0700782 //@extension("VK_KHR_incremental_present")
783 VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR = 1000084000,
784
Chia-I Wub262ddc2016-03-22 07:38:20 +0800785 //@extension("VK_ANDROID_native_buffer")
786 VK_STRUCTURE_TYPE_NATIVE_BUFFER_ANDROID = 1000010000,
Chris Forbes8e4438b2016-12-07 16:26:49 +1300787 VK_STRUCTURE_TYPE_SWAPCHAIN_IMAGE_CREATE_INFO_ANDROID = 1000010001,
Chris Forbes1d4e5542017-02-15 19:38:50 +1300788 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENTATION_PROPERTIES_ANDROID = 1000010002,
Chia-I Wub262ddc2016-03-22 07:38:20 +0800789
Ian Elliott4c8bb2a2016-12-29 11:07:26 -0700790 //@extension("VK_GOOGLE_display_timing")
Ian Elliott14866bb2017-01-20 09:15:48 -0700791 VK_STRUCTURE_TYPE_PRESENT_TIMES_INFO_GOOGLE = 1000092000,
Ian Elliott4c8bb2a2016-12-29 11:07:26 -0700792
Jesse Hall543a7ff2016-01-08 16:38:30 -0800793 //@extension("VK_EXT_debug_report")
Jesse Hall26763382016-05-20 07:13:52 -0700794 VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT = 1000011000,
795
796 //@extension("VK_AMD_rasterization_order")
797 VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD = 1000018000,
798
799 //@extension("VK_EXT_debug_marker")
800 VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_NAME_INFO_EXT = 1000022000,
Jesse Hall26763382016-05-20 07:13:52 -0700801 VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_TAG_INFO_EXT = 1000022001,
Jesse Hall26763382016-05-20 07:13:52 -0700802 VK_STRUCTURE_TYPE_DEBUG_MARKER_MARKER_INFO_EXT = 1000022002,
Jesse Hall56d386a2016-07-26 15:20:40 -0700803
804 //@extension("VK_NV_dedicated_allocation")
805 VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV = 1000026000,
Jesse Hall56d386a2016-07-26 15:20:40 -0700806 VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV = 1000026001,
Jesse Hall56d386a2016-07-26 15:20:40 -0700807 VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV = 1000026002,
Chris Forbes289cb792016-12-30 15:03:55 +1300808
809 //@extension("VK_NV_external_memory")
Jesse Halleb02c472017-02-24 15:13:45 -0800810 VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_NV = 1000056000,
811 VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_NV = 1000056001,
Chris Forbes289cb792016-12-30 15:03:55 +1300812
813 //@extension("VK_NV_external_memory_win32")
Jesse Halleb02c472017-02-24 15:13:45 -0800814 VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_NV = 1000057000,
815 VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_NV = 1000057001,
Chris Forbes289cb792016-12-30 15:03:55 +1300816
817 //@extension("VK_NV_win32_keyed_mutex")
818 VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_NV = 1000058000,
819
Chris Forbes1194ede2016-12-30 16:29:25 +1300820 //@extension("VK_KHR_get_physical_device_properties2")
Jesse Hall889cd9a2017-02-25 22:12:23 -0800821 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR = 1000059000,
822 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR = 1000059001,
823 VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2_KHR = 1000059002,
824 VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2_KHR = 1000059003,
825 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2_KHR = 1000059004,
826 VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2_KHR = 1000059005,
827 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2_KHR = 1000059006,
828 VK_STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2_KHR = 1000059007,
Chris Forbes1194ede2016-12-30 16:29:25 +1300829 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2_KHR = 1000059008,
830
Chris Forbes289cb792016-12-30 15:03:55 +1300831 //@extension("VK_EXT_validation_flags")
Jesse Halleb02c472017-02-24 15:13:45 -0800832 VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT = 1000061000,
Chris Forbes289cb792016-12-30 15:03:55 +1300833
834 //@extension("VK_KHR_incremental_present")
Jesse Hall889cd9a2017-02-25 22:12:23 -0800835 VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR = 1000084000,
Chris Forbes289cb792016-12-30 15:03:55 +1300836
837 //@extension("VK_NVX_device_generated_commands")
Jesse Halleb02c472017-02-24 15:13:45 -0800838 VK_STRUCTURE_TYPE_OBJECT_TABLE_CREATE_INFO_NVX = 1000086000,
839 VK_STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_CREATE_INFO_NVX = 1000086001,
840 VK_STRUCTURE_TYPE_CMD_PROCESS_COMMANDS_INFO_NVX = 1000086002,
841 VK_STRUCTURE_TYPE_CMD_RESERVE_SPACE_FOR_COMMANDS_INFO_NVX = 1000086003,
842 VK_STRUCTURE_TYPE_DEVICE_GENERATED_COMMANDS_LIMITS_NVX = 1000086004,
843 VK_STRUCTURE_TYPE_DEVICE_GENERATED_COMMANDS_FEATURES_NVX = 1000086005,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700844}
845
Jesse Hall65ab5522015-11-30 00:07:16 -0800846enum VkSubpassContents {
847 VK_SUBPASS_CONTENTS_INLINE = 0x00000000,
848 VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700849}
850
Jesse Hall543a7ff2016-01-08 16:38:30 -0800851enum VkPipelineCacheHeaderVersion {
852 VK_PIPELINE_CACHE_HEADER_VERSION_ONE = 1,
853}
854
Jesse Hallbd888842015-11-30 21:44:14 -0800855@lastUnused(-11)
Jesse Halld27f6aa2015-08-15 17:58:48 -0700856/// Error and return codes
857enum VkResult {
858 // Return codes for successful operation execution (positive values)
Jesse Hallbd888842015-11-30 21:44:14 -0800859 VK_SUCCESS = 0,
860 VK_NOT_READY = 1,
861 VK_TIMEOUT = 2,
862 VK_EVENT_SET = 3,
863 VK_EVENT_RESET = 4,
864 VK_INCOMPLETE = 5,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700865
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800866 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800867 VK_SUBOPTIMAL_KHR = 1000001003,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800868
Jesse Halld27f6aa2015-08-15 17:58:48 -0700869 // Error codes (negative values)
Jesse Hallbd888842015-11-30 21:44:14 -0800870 VK_ERROR_OUT_OF_HOST_MEMORY = 0xFFFFFFFF, // -1
871 VK_ERROR_OUT_OF_DEVICE_MEMORY = 0xFFFFFFFE, // -2
872 VK_ERROR_INITIALIZATION_FAILED = 0xFFFFFFFD, // -3
873 VK_ERROR_DEVICE_LOST = 0xFFFFFFFC, // -4
874 VK_ERROR_MEMORY_MAP_FAILED = 0xFFFFFFFB, // -5
875 VK_ERROR_LAYER_NOT_PRESENT = 0xFFFFFFFA, // -6
876 VK_ERROR_EXTENSION_NOT_PRESENT = 0xFFFFFFF9, // -7
877 VK_ERROR_FEATURE_NOT_PRESENT = 0xFFFFFFF8, // -8
878 VK_ERROR_INCOMPATIBLE_DRIVER = 0xFFFFFFF7, // -9
879 VK_ERROR_TOO_MANY_OBJECTS = 0xFFFFFFF6, // -10
880 VK_ERROR_FORMAT_NOT_SUPPORTED = 0xFFFFFFF5, // -11
Jesse Hall56d386a2016-07-26 15:20:40 -0700881 VK_ERROR_FRAGMENTED_POOL = 0xFFFFFFF4, // -12
Jesse Hall1356b0d2015-11-23 17:24:58 -0800882
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800883 //@extension("VK_KHR_surface")
Jesse Hallbd888842015-11-30 21:44:14 -0800884 VK_ERROR_SURFACE_LOST_KHR = 0xC4653600, // -1000000000
Jesse Halla6429252015-11-29 18:59:42 -0800885
Jesse Hall563380d2016-01-15 23:14:05 -0800886 //@extension("VK_KHR_surface")
887 VK_ERROR_NATIVE_WINDOW_IN_USE_KHR = 0xC46535FF, // -1000008001
888
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800889 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800890 VK_ERROR_OUT_OF_DATE_KHR = 0xC4653214, // -1000001004
Jesse Hall1356b0d2015-11-23 17:24:58 -0800891
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800892 //@extension("VK_KHR_display_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800893 VK_ERROR_INCOMPATIBLE_DISPLAY_KHR = 0xC4652A47, // -1000003001
Jesse Hall1356b0d2015-11-23 17:24:58 -0800894
Jesse Hall543a7ff2016-01-08 16:38:30 -0800895 //@extension("VK_EXT_debug_report")
896 VK_ERROR_VALIDATION_FAILED_EXT = 0xC4650B07, // -1000011001
Jesse Hall26763382016-05-20 07:13:52 -0700897
898 //@extension("VK_NV_glsl_shader")
899 VK_ERROR_INVALID_SHADER_NV = 0xC4650720, // -1000012000
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700900}
901
902enum VkDynamicState {
903 VK_DYNAMIC_STATE_VIEWPORT = 0x00000000,
904 VK_DYNAMIC_STATE_SCISSOR = 0x00000001,
905 VK_DYNAMIC_STATE_LINE_WIDTH = 0x00000002,
906 VK_DYNAMIC_STATE_DEPTH_BIAS = 0x00000003,
907 VK_DYNAMIC_STATE_BLEND_CONSTANTS = 0x00000004,
908 VK_DYNAMIC_STATE_DEPTH_BOUNDS = 0x00000005,
909 VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK = 0x00000006,
910 VK_DYNAMIC_STATE_STENCIL_WRITE_MASK = 0x00000007,
911 VK_DYNAMIC_STATE_STENCIL_REFERENCE = 0x00000008,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700912}
913
Jesse Hall523db342015-11-30 21:12:55 -0800914@extension("VK_KHR_surface")
Michael Lentine88594d72015-11-12 12:49:45 -0800915enum VkPresentModeKHR {
916 VK_PRESENT_MODE_IMMEDIATE_KHR = 0x00000000,
917 VK_PRESENT_MODE_MAILBOX_KHR = 0x00000001,
918 VK_PRESENT_MODE_FIFO_KHR = 0x00000002,
Jesse Hall03b6fe12015-11-24 12:44:21 -0800919 VK_PRESENT_MODE_FIFO_RELAXED_KHR = 0x00000003,
Chris Forbes1d5f68c2017-01-31 10:17:01 +1300920 //@extension("VK_KHR_shared_presentable_image")
921 VK_PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR = 1000111000,
922 //@extension("VK_KHR_shared_presentable_image")
923 VK_PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR = 1000111001,
Michael Lentine88594d72015-11-12 12:49:45 -0800924}
925
Jesse Hall523db342015-11-30 21:12:55 -0800926@extension("VK_KHR_surface")
Michael Lentine88594d72015-11-12 12:49:45 -0800927enum VkColorSpaceKHR {
928 VK_COLORSPACE_SRGB_NONLINEAR_KHR = 0x00000000,
Jesse Hall889cd9a2017-02-25 22:12:23 -0800929 VK_COLOR_SPACE_DISPLAY_P3_LINEAR_EXT = 1000104001,
Courtney Goeltzenleuchter7f558ed2017-01-23 17:15:24 -0700930 VK_COLOR_SPACE_DISPLAY_P3_NONLINEAR_EXT = 1000104002,
931 VK_COLOR_SPACE_SCRGB_LINEAR_EXT = 1000104003,
932 VK_COLOR_SPACE_SCRGB_NONLINEAR_EXT = 1000104004,
933 VK_COLOR_SPACE_DCI_P3_LINEAR_EXT = 1000104005,
934 VK_COLOR_SPACE_DCI_P3_NONLINEAR_EXT = 1000104006,
935 VK_COLOR_SPACE_BT709_LINEAR_EXT = 1000104007,
936 VK_COLOR_SPACE_BT709_NONLINEAR_EXT = 1000104008,
937 VK_COLOR_SPACE_BT2020_LINEAR_EXT = 1000104009,
938 VK_COLOR_SPACE_BT2020_NONLINEAR_EXT = 1000104010,
939 VK_COLOR_SPACE_ADOBERGB_LINEAR_EXT = 1000104011,
940 VK_COLOR_SPACE_ADOBERGB_NONLINEAR_EXT = 1000104012,
Michael Lentine88594d72015-11-12 12:49:45 -0800941}
Jesse Halld27f6aa2015-08-15 17:58:48 -0700942
Jesse Hall715b86a2016-01-16 16:34:29 -0800943@extension("VK_EXT_debug_report")
944enum VkDebugReportObjectTypeEXT {
945 VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT = 0,
946 VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT = 1,
947 VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT = 2,
948 VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT = 3,
949 VK_DEBUG_REPORT_OBJECT_TYPE_QUEUE_EXT = 4,
950 VK_DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT = 5,
951 VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT = 6,
952 VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT = 7,
953 VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT = 8,
954 VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT = 9,
955 VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT = 10,
956 VK_DEBUG_REPORT_OBJECT_TYPE_EVENT_EXT = 11,
957 VK_DEBUG_REPORT_OBJECT_TYPE_QUERY_POOL_EXT = 12,
958 VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_VIEW_EXT = 13,
959 VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_VIEW_EXT = 14,
960 VK_DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT = 15,
961 VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_CACHE_EXT = 16,
962 VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_LAYOUT_EXT = 17,
963 VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT = 18,
964 VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT = 19,
965 VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT_EXT = 20,
966 VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_EXT = 21,
967 VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT = 22,
968 VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT = 23,
969 VK_DEBUG_REPORT_OBJECT_TYPE_FRAMEBUFFER_EXT = 24,
970 VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_POOL_EXT = 25,
971 VK_DEBUG_REPORT_OBJECT_TYPE_SURFACE_KHR_EXT = 26,
972 VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT = 27,
973 VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_EXT = 28,
Chris Forbes289cb792016-12-30 15:03:55 +1300974 VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_KHR_EXT = 29,
975 VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_MODE_KHR_EXT = 30,
976 VK_DEBUG_REPORT_OBJECT_TYPE_OBJECT_TABLE_NVX_EXT = 31,
977 VK_DEBUG_REPORT_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NVX_EXT = 32,
Jesse Hall715b86a2016-01-16 16:34:29 -0800978}
979
980@extension("VK_EXT_debug_report")
981enum VkDebugReportErrorEXT {
982 VK_DEBUG_REPORT_ERROR_NONE_EXT = 0,
983 VK_DEBUG_REPORT_ERROR_CALLBACK_REF_EXT = 1,
984}
985
Jesse Hall26763382016-05-20 07:13:52 -0700986@extension("VK_AMD_rasterization_order")
987enum VkRasterizationOrderAMD {
988 VK_RASTERIZATION_ORDER_STRICT_AMD = 0,
989 VK_RASTERIZATION_ORDER_RELAXED_AMD = 1,
990}
991
Chris Forbes289cb792016-12-30 15:03:55 +1300992@extension("VK_EXT_validation_flags")
993enum VkValidationCheckEXT {
994 VK_VALIDATION_CHECK_ALL_EXT = 0,
995}
996
997@extension("VK_NVX_device_generated_commands")
998enum VkIndirectCommandsTokenTypeNVX {
Jesse Halleb02c472017-02-24 15:13:45 -0800999 VK_INDIRECT_COMMANDS_TOKEN_PIPELINE_NVX = 0,
1000 VK_INDIRECT_COMMANDS_TOKEN_DESCRIPTOR_SET_NVX = 1,
1001 VK_INDIRECT_COMMANDS_TOKEN_INDEX_BUFFER_NVX = 2,
1002 VK_INDIRECT_COMMANDS_TOKEN_VERTEX_BUFFER_NVX = 3,
1003 VK_INDIRECT_COMMANDS_TOKEN_PUSH_CONSTANT_NVX = 4,
1004 VK_INDIRECT_COMMANDS_TOKEN_DRAW_INDEXED_NVX = 5,
1005 VK_INDIRECT_COMMANDS_TOKEN_DRAW_NVX = 6,
1006 VK_INDIRECT_COMMANDS_TOKEN_DISPATCH_NVX = 7,
Chris Forbes289cb792016-12-30 15:03:55 +13001007}
1008
1009@extension("VK_NVX_device_generated_commands")
1010enum VkObjectEntryTypeNVX {
Jesse Halleb02c472017-02-24 15:13:45 -08001011 VK_OBJECT_ENTRY_DESCRIPTOR_SET_NVX = 0,
1012 VK_OBJECT_ENTRY_PIPELINE_NVX = 1,
1013 VK_OBJECT_ENTRY_INDEX_BUFFER_NVX = 2,
1014 VK_OBJECT_ENTRY_VERTEX_BUFFER_NVX = 3,
1015 VK_OBJECT_ENTRY_PUSH_CONSTANT_NVX = 4,
Chris Forbes289cb792016-12-30 15:03:55 +13001016}
Jesse Hall715b86a2016-01-16 16:34:29 -08001017
Jesse Halld27f6aa2015-08-15 17:58:48 -07001018/////////////////
1019// Bitfields //
1020/////////////////
1021
Jesse Halld27f6aa2015-08-15 17:58:48 -07001022/// Queue capabilities
Jesse Halld8bade02015-11-24 10:24:18 -08001023type VkFlags VkQueueFlags
1024bitfield VkQueueFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001025 VK_QUEUE_GRAPHICS_BIT = 0x00000001, /// Queue supports graphics operations
1026 VK_QUEUE_COMPUTE_BIT = 0x00000002, /// Queue supports compute operations
Jesse Hall65ab5522015-11-30 00:07:16 -08001027 VK_QUEUE_TRANSFER_BIT = 0x00000004, /// Queue supports transfer operations
Jesse Hallb00daad2015-11-29 19:46:20 -08001028 VK_QUEUE_SPARSE_BINDING_BIT = 0x00000008, /// Queue supports sparse resource memory management operations
Jesse Halld27f6aa2015-08-15 17:58:48 -07001029}
1030
1031/// Memory properties passed into vkAllocMemory().
Jesse Halld8bade02015-11-24 10:24:18 -08001032type VkFlags VkMemoryPropertyFlags
1033bitfield VkMemoryPropertyFlagBits {
Jesse Halld1af8122015-11-29 23:50:38 -08001034 VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT = 0x00000001,
1035 VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT = 0x00000002,
1036 VK_MEMORY_PROPERTY_HOST_COHERENT_BIT = 0x00000004,
1037 VK_MEMORY_PROPERTY_HOST_CACHED_BIT = 0x00000008,
1038 VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT = 0x00000010,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001039}
1040
1041/// Memory heap flags
Jesse Halld8bade02015-11-24 10:24:18 -08001042type VkFlags VkMemoryHeapFlags
1043bitfield VkMemoryHeapFlagBits {
Jesse Halld1af8122015-11-29 23:50:38 -08001044 VK_MEMORY_HEAP_DEVICE_LOCAL_BIT = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001045}
1046
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001047/// Access flags
1048type VkFlags VkAccessFlags
1049bitfield VkAccessFlagBits {
1050 VK_ACCESS_INDIRECT_COMMAND_READ_BIT = 0x00000001,
1051 VK_ACCESS_INDEX_READ_BIT = 0x00000002,
1052 VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT = 0x00000004,
1053 VK_ACCESS_UNIFORM_READ_BIT = 0x00000008,
1054 VK_ACCESS_INPUT_ATTACHMENT_READ_BIT = 0x00000010,
1055 VK_ACCESS_SHADER_READ_BIT = 0x00000020,
1056 VK_ACCESS_SHADER_WRITE_BIT = 0x00000040,
1057 VK_ACCESS_COLOR_ATTACHMENT_READ_BIT = 0x00000080,
1058 VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT = 0x00000100,
1059 VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT = 0x00000200,
1060 VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT = 0x00000400,
1061 VK_ACCESS_TRANSFER_READ_BIT = 0x00000800,
1062 VK_ACCESS_TRANSFER_WRITE_BIT = 0x00001000,
1063 VK_ACCESS_HOST_READ_BIT = 0x00002000,
1064 VK_ACCESS_HOST_WRITE_BIT = 0x00004000,
1065 VK_ACCESS_MEMORY_READ_BIT = 0x00008000,
1066 VK_ACCESS_MEMORY_WRITE_BIT = 0x00010000,
Chris Forbes289cb792016-12-30 15:03:55 +13001067
1068 //@extension("VK_NVX_device_generated_commands")
1069 VK_ACCESS_COMMAND_PROCESS_READ_BIT_NVX = 0x00020000,
Chris Forbes289cb792016-12-30 15:03:55 +13001070 VK_ACCESS_COMMAND_PROCESS_WRITE_BIT_NVX = 0x00040000,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001071}
1072
1073/// Buffer usage flags
Jesse Halld8bade02015-11-24 10:24:18 -08001074type VkFlags VkBufferUsageFlags
1075bitfield VkBufferUsageFlagBits {
Jesse Hall3fbc8562015-11-29 22:10:52 -08001076 VK_BUFFER_USAGE_TRANSFER_SRC_BIT = 0x00000001, /// Can be used as a source of transfer operations
1077 VK_BUFFER_USAGE_TRANSFER_DST_BIT = 0x00000002, /// Can be used as a destination of transfer operations
Jesse Halld27f6aa2015-08-15 17:58:48 -07001078 VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000004, /// Can be used as TBO
1079 VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT = 0x00000008, /// Can be used as IBO
1080 VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT = 0x00000010, /// Can be used as UBO
1081 VK_BUFFER_USAGE_STORAGE_BUFFER_BIT = 0x00000020, /// Can be used as SSBO
1082 VK_BUFFER_USAGE_INDEX_BUFFER_BIT = 0x00000040, /// Can be used as source of fixed function index fetch (index buffer)
1083 VK_BUFFER_USAGE_VERTEX_BUFFER_BIT = 0x00000080, /// Can be used as source of fixed function vertex fetch (VBO)
1084 VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT = 0x00000100, /// Can be the source of indirect parameters (e.g. indirect buffer, parameter buffer)
1085}
1086
1087/// Buffer creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001088type VkFlags VkBufferCreateFlags
1089bitfield VkBufferCreateFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001090 VK_BUFFER_CREATE_SPARSE_BINDING_BIT = 0x00000001, /// Buffer should support sparse backing
Jesse Halld27f6aa2015-08-15 17:58:48 -07001091 VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002, /// Buffer should support sparse backing with partial residency
1092 VK_BUFFER_CREATE_SPARSE_ALIASED_BIT = 0x00000004, /// Buffer should support constent data access to physical memory blocks mapped into multiple locations of sparse buffers
1093}
1094
1095/// Shader stage flags
Jesse Halld8bade02015-11-24 10:24:18 -08001096type VkFlags VkShaderStageFlags
1097bitfield VkShaderStageFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001098 VK_SHADER_STAGE_VERTEX_BIT = 0x00000001,
Jesse Hallae38f732015-11-19 21:32:50 -08001099 VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT = 0x00000002,
1100 VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001101 VK_SHADER_STAGE_GEOMETRY_BIT = 0x00000008,
1102 VK_SHADER_STAGE_FRAGMENT_BIT = 0x00000010,
1103 VK_SHADER_STAGE_COMPUTE_BIT = 0x00000020,
Jesse Hallc7467b72015-11-29 21:05:26 -08001104 VK_SHADER_STAGE_ALL_GRAPHICS = 0x0000001F,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001105
1106 VK_SHADER_STAGE_ALL = 0x7FFFFFFF,
1107}
1108
Jesse Hallfbf97b02015-11-20 14:17:03 -08001109/// Descriptor pool create flags
Jesse Halld8bade02015-11-24 10:24:18 -08001110type VkFlags VkDescriptorPoolCreateFlags
1111bitfield VkDescriptorPoolCreateFlagBits {
Jesse Hallfbf97b02015-11-20 14:17:03 -08001112 VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT = 0x00000001,
1113}
1114
1115/// Descriptor pool reset flags
Jesse Halld8bade02015-11-24 10:24:18 -08001116type VkFlags VkDescriptorPoolResetFlags
Jesse Halla6429252015-11-29 18:59:42 -08001117//bitfield VkDescriptorPoolResetFlagBits {
1118//}
Jesse Hallfbf97b02015-11-20 14:17:03 -08001119
Jesse Halld27f6aa2015-08-15 17:58:48 -07001120/// Image usage flags
Jesse Halld8bade02015-11-24 10:24:18 -08001121type VkFlags VkImageUsageFlags
1122bitfield VkImageUsageFlagBits {
Jesse Hall3fbc8562015-11-29 22:10:52 -08001123 VK_IMAGE_USAGE_TRANSFER_SRC_BIT = 0x00000001, /// Can be used as a source of transfer operations
1124 VK_IMAGE_USAGE_TRANSFER_DST_BIT = 0x00000002, /// Can be used as a destination of transfer operations
Jesse Halld27f6aa2015-08-15 17:58:48 -07001125 VK_IMAGE_USAGE_SAMPLED_BIT = 0x00000004, /// Can be sampled from (SAMPLED_IMAGE and COMBINED_IMAGE_SAMPLER descriptor types)
1126 VK_IMAGE_USAGE_STORAGE_BIT = 0x00000008, /// Can be used as storage image (STORAGE_IMAGE descriptor type)
1127 VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT = 0x00000010, /// Can be used as framebuffer color attachment
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001128 VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000020, /// Can be used as framebuffer depth/stencil attachment
Jesse Halld27f6aa2015-08-15 17:58:48 -07001129 VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT = 0x00000040, /// Image data not needed outside of rendering
1130 VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT = 0x00000080, /// Can be used as framebuffer input attachment
1131}
1132
1133/// Image creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001134type VkFlags VkImageCreateFlags
1135bitfield VkImageCreateFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001136 VK_IMAGE_CREATE_SPARSE_BINDING_BIT = 0x00000001, /// Image should support sparse backing
Jesse Halld27f6aa2015-08-15 17:58:48 -07001137 VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002, /// Image should support sparse backing with partial residency
1138 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 -07001139 VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT = 0x00000008, /// Allows image views to have different format than the base image
1140 VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT = 0x00000010, /// Allows creating image views with cube type from the created image
Jesse Halld27f6aa2015-08-15 17:58:48 -07001141}
1142
Jesse Hallb00daad2015-11-29 19:46:20 -08001143/// Image view creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001144type VkFlags VkImageViewCreateFlags
Jesse Hallb00daad2015-11-29 19:46:20 -08001145//bitfield VkImageViewCreateFlagBits {
1146//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001147
1148/// Pipeline creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001149type VkFlags VkPipelineCreateFlags
1150bitfield VkPipelineCreateFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001151 VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT = 0x00000001,
1152 VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT = 0x00000002,
1153 VK_PIPELINE_CREATE_DERIVATIVE_BIT = 0x00000004,
1154}
1155
Jesse Hall65ab5522015-11-30 00:07:16 -08001156/// Color component flags
1157type VkFlags VkColorComponentFlags
1158bitfield VkColorComponentFlagBits {
1159 VK_COLOR_COMPONENT_R_BIT = 0x00000001,
1160 VK_COLOR_COMPONENT_G_BIT = 0x00000002,
1161 VK_COLOR_COMPONENT_B_BIT = 0x00000004,
1162 VK_COLOR_COMPONENT_A_BIT = 0x00000008,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001163}
1164
1165/// Fence creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001166type VkFlags VkFenceCreateFlags
1167bitfield VkFenceCreateFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001168 VK_FENCE_CREATE_SIGNALED_BIT = 0x00000001,
1169}
1170
1171/// Semaphore creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001172type VkFlags VkSemaphoreCreateFlags
Jesse Halla6429252015-11-29 18:59:42 -08001173//bitfield VkSemaphoreCreateFlagBits {
1174//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001175
1176/// Format capability flags
Jesse Halld8bade02015-11-24 10:24:18 -08001177type VkFlags VkFormatFeatureFlags
1178bitfield VkFormatFeatureFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001179 VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT = 0x00000001, /// Format can be used for sampled images (SAMPLED_IMAGE and COMBINED_IMAGE_SAMPLER descriptor types)
1180 VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT = 0x00000002, /// Format can be used for storage images (STORAGE_IMAGE descriptor type)
1181 VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT = 0x00000004, /// Format supports atomic operations in case it's used for storage images
1182 VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000008, /// Format can be used for uniform texel buffers (TBOs)
1183 VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT = 0x00000010, /// Format can be used for storage texel buffers (IBOs)
1184 VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT = 0x00000020, /// Format supports atomic operations in case it's used for storage texel buffers
1185 VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT = 0x00000040, /// Format can be used for vertex buffers (VBOs)
1186 VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT = 0x00000080, /// Format can be used for color attachment images
1187 VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT = 0x00000100, /// Format supports blending in case it's used for color attachment images
1188 VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000200, /// Format can be used for depth/stencil attachment images
Jesse Hall3fbc8562015-11-29 22:10:52 -08001189 VK_FORMAT_FEATURE_BLIT_SRC_BIT = 0x00000400, /// Format can be used as the source image of blits with vkCommandBlitImage
1190 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 -08001191 VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT = 0x00001000,
Jesse Hall26763382016-05-20 07:13:52 -07001192
1193 //@extension("VK_IMG_filter_cubic")
1194 VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG = 0x00002000,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001195}
1196
1197/// Query control flags
Jesse Halld8bade02015-11-24 10:24:18 -08001198type VkFlags VkQueryControlFlags
1199bitfield VkQueryControlFlagBits {
Jesse Hall65ab5522015-11-30 00:07:16 -08001200 VK_QUERY_CONTROL_PRECISE_BIT = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001201}
1202
1203/// Query result flags
Jesse Halld8bade02015-11-24 10:24:18 -08001204type VkFlags VkQueryResultFlags
1205bitfield VkQueryResultFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001206 VK_QUERY_RESULT_64_BIT = 0x00000001, /// Results of the queries are written to the destination buffer as 64-bit values
1207 VK_QUERY_RESULT_WAIT_BIT = 0x00000002, /// Results of the queries are waited on before proceeding with the result copy
1208 VK_QUERY_RESULT_WITH_AVAILABILITY_BIT = 0x00000004, /// Besides the results of the query, the availability of the results is also written
1209 VK_QUERY_RESULT_PARTIAL_BIT = 0x00000008, /// Copy the partial results of the query even if the final results aren't available
1210}
1211
1212/// Shader module creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001213type VkFlags VkShaderModuleCreateFlags
Jesse Halla6429252015-11-29 18:59:42 -08001214//bitfield VkShaderModuleCreateFlagBits {
1215//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001216
Jesse Halld27f6aa2015-08-15 17:58:48 -07001217/// Event creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001218type VkFlags VkEventCreateFlags
Jesse Halla6429252015-11-29 18:59:42 -08001219//bitfield VkEventCreateFlagBits {
1220//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001221
Jesse Halla15a4bf2015-11-19 22:48:02 -08001222/// Command buffer usage flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001223type VkFlags VkCommandBufferUsageFlags
1224bitfield VkCommandBufferUsageFlagBits {
1225 VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT = 0x00000001,
1226 VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT = 0x00000002,
1227 VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001228}
1229
1230/// Pipeline statistics flags
Jesse Halld8bade02015-11-24 10:24:18 -08001231type VkFlags VkQueryPipelineStatisticFlags
1232bitfield VkQueryPipelineStatisticFlagBits {
Jesse Hallae38f732015-11-19 21:32:50 -08001233 VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_BIT = 0x00000001, /// Optional
1234 VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_PRIMITIVES_BIT = 0x00000002, /// Optional
1235 VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT = 0x00000004, /// Optional
1236 VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_INVOCATIONS_BIT = 0x00000008, /// Optional
1237 VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT = 0x00000010, /// Optional
1238 VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT = 0x00000020, /// Optional
1239 VK_QUERY_PIPELINE_STATISTIC_CLIPPING_PRIMITIVES_BIT = 0x00000040, /// Optional
1240 VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT = 0x00000080, /// Optional
1241 VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT = 0x00000100, /// Optional
1242 VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT = 0x00000200, /// Optional
1243 VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT = 0x00000400, /// Optional
Jesse Halld27f6aa2015-08-15 17:58:48 -07001244}
1245
1246/// Memory mapping flags
Jesse Halld8bade02015-11-24 10:24:18 -08001247type VkFlags VkMemoryMapFlags
Jesse Halla6429252015-11-29 18:59:42 -08001248//bitfield VkMemoryMapFlagBits {
1249//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001250
1251/// Bitfield of image aspects
Jesse Halld8bade02015-11-24 10:24:18 -08001252type VkFlags VkImageAspectFlags
1253bitfield VkImageAspectFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001254 VK_IMAGE_ASPECT_COLOR_BIT = 0x00000001,
1255 VK_IMAGE_ASPECT_DEPTH_BIT = 0x00000002,
1256 VK_IMAGE_ASPECT_STENCIL_BIT = 0x00000004,
1257 VK_IMAGE_ASPECT_METADATA_BIT = 0x00000008,
1258}
1259
1260/// Sparse memory bind flags
Jesse Halld8bade02015-11-24 10:24:18 -08001261type VkFlags VkSparseMemoryBindFlags
Jesse Hall091ed9e2015-11-30 00:55:29 -08001262bitfield VkSparseMemoryBindFlagBits {
1263 VK_SPARSE_MEMORY_BIND_METADATA_BIT = 0x00000001,
1264}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001265
1266/// Sparse image memory requirements flags
Jesse Halld8bade02015-11-24 10:24:18 -08001267type VkFlags VkSparseImageFormatFlags
1268bitfield VkSparseImageFormatFlagBits {
Jesse Hallb00daad2015-11-29 19:46:20 -08001269 VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT = 0x00000001, /// Image uses a single miptail region for all array slices
1270 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.
1271 VK_SPARSE_IMAGE_FORMAT_NONSTANDARD_BLOCK_SIZE_BIT = 0x00000004, /// Image uses a non-standard sparse block size
Jesse Halld27f6aa2015-08-15 17:58:48 -07001272}
1273
1274/// Pipeline stages
Jesse Halld8bade02015-11-24 10:24:18 -08001275type VkFlags VkPipelineStageFlags
1276bitfield VkPipelineStageFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001277 VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT = 0x00000001, /// Before subsequent commands are processed
1278 VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT = 0x00000002, /// Draw/DispatchIndirect command fetch
1279 VK_PIPELINE_STAGE_VERTEX_INPUT_BIT = 0x00000004, /// Vertex/index fetch
1280 VK_PIPELINE_STAGE_VERTEX_SHADER_BIT = 0x00000008, /// Vertex shading
Jesse Hallae38f732015-11-19 21:32:50 -08001281 VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT = 0x00000010, /// Tessellation control shading
1282 VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT = 0x00000020, /// Tessellation evaluation shading
Jesse Halld27f6aa2015-08-15 17:58:48 -07001283 VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT = 0x00000040, /// Geometry shading
1284 VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT = 0x00000080, /// Fragment shading
1285 VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT = 0x00000100, /// Early fragment (depth/stencil) tests
1286 VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT = 0x00000200, /// Late fragment (depth/stencil) tests
1287 VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT = 0x00000400, /// Color attachment writes
1288 VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT = 0x00000800, /// Compute shading
1289 VK_PIPELINE_STAGE_TRANSFER_BIT = 0x00001000, /// Transfer/copy operations
Jesse Hall543a7ff2016-01-08 16:38:30 -08001290 VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT = 0x00002000,
1291 VK_PIPELINE_STAGE_HOST_BIT = 0x00004000, /// Indicates host (CPU) is a source/sink of the dependency
Jesse Halld27f6aa2015-08-15 17:58:48 -07001292
Jesse Hall543a7ff2016-01-08 16:38:30 -08001293 VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT = 0x00008000, /// All stages of the graphics pipeline
1294 VK_PIPELINE_STAGE_ALL_COMMANDS_BIT = 0x00010000, /// All graphics, compute, copy, and transition commands
Chris Forbes289cb792016-12-30 15:03:55 +13001295
1296 //@extension("VK_NVX_device_generated_commands")
1297 VK_PIPELINE_STAGE_COMMAND_PROCESS_BIT_NVX = 0x00020000,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001298}
1299
1300/// Render pass attachment description flags
Jesse Halld8bade02015-11-24 10:24:18 -08001301type VkFlags VkAttachmentDescriptionFlags
1302bitfield VkAttachmentDescriptionFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001303 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 -07001304}
1305
1306/// Subpass description flags
Jesse Halld8bade02015-11-24 10:24:18 -08001307type VkFlags VkSubpassDescriptionFlags
1308bitfield VkSubpassDescriptionFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001309}
1310
1311/// Command pool creation flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001312type VkFlags VkCommandPoolCreateFlags
1313bitfield VkCommandPoolCreateFlagBits {
1314 VK_COMMAND_POOL_CREATE_TRANSIENT_BIT = 0x00000001, /// Command buffers have a short lifetime
1315 VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT = 0x00000002, /// Command buffers may release their memory individually
Jesse Halld27f6aa2015-08-15 17:58:48 -07001316}
1317
1318/// Command pool reset flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001319type VkFlags VkCommandPoolResetFlags
1320bitfield VkCommandPoolResetFlagBits {
1321 VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT = 0x00000001, /// Release resources owned by the pool
Jesse Halld27f6aa2015-08-15 17:58:48 -07001322}
1323
Jesse Hall3fbc8562015-11-29 22:10:52 -08001324type VkFlags VkCommandBufferResetFlags
1325bitfield VkCommandBufferResetFlagBits {
1326 VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT = 0x00000001, /// Release resources owned by the buffer
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001327}
1328
Jesse Halld8bade02015-11-24 10:24:18 -08001329type VkFlags VkSampleCountFlags
1330bitfield VkSampleCountFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001331 VK_SAMPLE_COUNT_1_BIT = 0x00000001,
1332 VK_SAMPLE_COUNT_2_BIT = 0x00000002,
1333 VK_SAMPLE_COUNT_4_BIT = 0x00000004,
1334 VK_SAMPLE_COUNT_8_BIT = 0x00000008,
1335 VK_SAMPLE_COUNT_16_BIT = 0x00000010,
1336 VK_SAMPLE_COUNT_32_BIT = 0x00000020,
1337 VK_SAMPLE_COUNT_64_BIT = 0x00000040,
1338}
1339
Jesse Halld8bade02015-11-24 10:24:18 -08001340type VkFlags VkStencilFaceFlags
1341bitfield VkStencilFaceFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001342 VK_STENCIL_FACE_FRONT_BIT = 0x00000001, /// Front face
1343 VK_STENCIL_FACE_BACK_BIT = 0x00000002, /// Back face
Jesse Hallc7467b72015-11-29 21:05:26 -08001344 VK_STENCIL_FRONT_AND_BACK = 0x00000003,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001345}
1346
Jesse Halla6429252015-11-29 18:59:42 -08001347/// Instance creation flags
1348type VkFlags VkInstanceCreateFlags
1349//bitfield VkInstanceCreateFlagBits {
1350//}
1351
1352/// Device creation flags
1353type VkFlags VkDeviceCreateFlags
1354//bitfield VkDeviceCreateFlagBits {
1355//}
1356
1357/// Device queue creation flags
1358type VkFlags VkDeviceQueueCreateFlags
1359//bitfield VkDeviceQueueCreateFlagBits {
1360//}
1361
1362/// Query pool creation flags
1363type VkFlags VkQueryPoolCreateFlags
1364//bitfield VkQueryPoolCreateFlagBits {
1365//}
1366
1367/// Buffer view creation flags
1368type VkFlags VkBufferViewCreateFlags
1369//bitfield VkBufferViewCreateFlagBits {
1370//}
1371
1372/// Pipeline cache creation flags
1373type VkFlags VkPipelineCacheCreateFlags
1374//bitfield VkPipelineCacheCreateFlagBits {
1375//}
1376
1377/// Pipeline shader stage creation flags
1378type VkFlags VkPipelineShaderStageCreateFlags
1379//bitfield VkPipelineShaderStageCreateFlagBits {
1380//}
1381
1382/// Descriptor set layout creation flags
1383type VkFlags VkDescriptorSetLayoutCreateFlags
1384//bitfield VkDescriptorSetLayoutCreateFlagBits {
1385//}
1386
1387/// Pipeline vertex input state creation flags
1388type VkFlags VkPipelineVertexInputStateCreateFlags
1389//bitfield VkPipelineVertexInputStateCreateFlagBits {
1390//}
1391
1392/// Pipeline input assembly state creation flags
1393type VkFlags VkPipelineInputAssemblyStateCreateFlags
1394//bitfield VkPipelineInputAssemblyStateCreateFlagBits {
1395//}
1396
1397/// Tessellation state creation flags
1398type VkFlags VkPipelineTessellationStateCreateFlags
1399//bitfield VkPipelineTessellationStateCreateFlagBits {
1400//}
1401
1402/// Viewport state creation flags
1403type VkFlags VkPipelineViewportStateCreateFlags
1404//bitfield VkPipelineViewportStateCreateFlagBits {
1405//}
1406
Jesse Hall3fbc8562015-11-29 22:10:52 -08001407/// Rasterization state creation flags
1408type VkFlags VkPipelineRasterizationStateCreateFlags
1409//bitfield VkPipelineRasterizationStateCreateFlagBits {
Jesse Halla6429252015-11-29 18:59:42 -08001410//}
1411
1412/// Multisample state creation flags
1413type VkFlags VkPipelineMultisampleStateCreateFlags
1414//bitfield VkPipelineMultisampleStateCreateFlagBits {
1415//}
1416
1417/// Color blend state creation flags
1418type VkFlags VkPipelineColorBlendStateCreateFlags
1419//bitfield VkPipelineColorBlendStateCreateFlagBits {
1420//}
1421
1422/// Depth/stencil state creation flags
1423type VkFlags VkPipelineDepthStencilStateCreateFlags
1424//bitfield VkPipelineDepthStencilStateCreateFlagBits {
1425//}
1426
1427/// Dynamic state creation flags
1428type VkFlags VkPipelineDynamicStateCreateFlags
1429//bitfield VkPipelineDynamicStateCreateFlagBits {
1430//}
1431
1432/// Pipeline layout creation flags
1433type VkFlags VkPipelineLayoutCreateFlags
1434//bitfield VkPipelineLayoutCreateFlagBits {
1435//}
1436
1437/// Sampler creation flags
1438type VkFlags VkSamplerCreateFlags
1439//bitfield VkSamplerCreateFlagBits {
1440//}
1441
1442/// Render pass creation flags
1443type VkFlags VkRenderPassCreateFlags
1444//bitfield VkRenderPassCreateFlagBits {
1445//}
1446
1447/// Framebuffer creation flags
1448type VkFlags VkFramebufferCreateFlags
1449//bitfield VkFramebufferCreateFlagBits {
1450//}
1451
Jesse Halldc6d36c2015-11-29 19:12:15 -08001452/// Dependency flags
1453type VkFlags VkDependencyFlags
1454bitfield VkDependencyFlagBits {
1455 VK_DEPENDENCY_BY_REGION_BIT = 0x00000001,
1456}
1457
Jesse Hallc7467b72015-11-29 21:05:26 -08001458/// Cull mode flags
1459type VkFlags VkCullModeFlags
1460bitfield VkCullModeFlagBits {
1461 VK_CULL_MODE_NONE = 0x00000000,
1462 VK_CULL_MODE_FRONT_BIT = 0x00000001,
1463 VK_CULL_MODE_BACK_BIT = 0x00000002,
1464 VK_CULL_MODE_FRONT_AND_BACK = 0x00000003,
1465}
1466
Jesse Hall523db342015-11-30 21:12:55 -08001467@extension("VK_KHR_surface")
Jesse Halld8bade02015-11-24 10:24:18 -08001468type VkFlags VkSurfaceTransformFlagsKHR
Jesse Hall523db342015-11-30 21:12:55 -08001469@extension("VK_KHR_surface")
Jesse Halld8bade02015-11-24 10:24:18 -08001470bitfield VkSurfaceTransformFlagBitsKHR {
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001471 VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR = 0x00000001,
Jesse Hall9ba8bc82015-11-30 16:22:16 -08001472 VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR = 0x00000002,
1473 VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR = 0x00000004,
1474 VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR = 0x00000008,
1475 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR = 0x00000010,
1476 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR = 0x00000020,
1477 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR = 0x00000040,
1478 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR = 0x00000080,
1479 VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR = 0x00000100,
Michael Lentine88594d72015-11-12 12:49:45 -08001480}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001481
Jesse Hall523db342015-11-30 21:12:55 -08001482@extension("VK_KHR_surface")
Jesse Halla6429252015-11-29 18:59:42 -08001483type VkFlags VkCompositeAlphaFlagsKHR
Jesse Hall523db342015-11-30 21:12:55 -08001484@extension("VK_KHR_surface")
Jesse Halla6429252015-11-29 18:59:42 -08001485bitfield VkCompositeAlphaFlagBitsKHR {
1486 VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR = 0x00000001,
1487 VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR = 0x00000002,
1488 VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR = 0x00000004,
1489 VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR = 0x00000008,
1490}
1491
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001492@extension("VK_KHR_swapchain")
1493type VkFlags VkSwapchainCreateFlagsKHR
1494//@extension("VK_KHR_swapchain")
1495//bitfield VkSwapchainCreateFlagBitsKHR {
1496//}
1497
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001498@extension("VK_KHR_display")
Jesse Halld8bade02015-11-24 10:24:18 -08001499type VkFlags VkDisplayPlaneAlphaFlagsKHR
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001500@extension("VK_KHR_display")
Jesse Halld8bade02015-11-24 10:24:18 -08001501bitfield VkDisplayPlaneAlphaFlagBitsKHR {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001502 VK_DISPLAY_PLANE_ALPHA_OPAQUE_BIT_KHR = 0x00000001,
1503 VK_DISPLAY_PLANE_ALPHA_GLOBAL_BIT_KHR = 0x00000002,
1504 VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_BIT_KHR = 0x00000004,
1505 VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_PREMULTIPLIED_BIT_KHR = 0x00000008,
Jesse Hall1356b0d2015-11-23 17:24:58 -08001506}
1507
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001508@extension("VK_KHR_display")
1509type VkFlags VkDisplaySurfaceCreateFlagsKHR
1510//@extension("VK_KHR_display")
1511//bitfield VkDisplaySurfaceCreateFlagBitsKHR {
1512//}
1513
Jesse Hall9ba8bc82015-11-30 16:22:16 -08001514@extension("VK_KHR_display")
1515type VkFlags VkDisplayModeCreateFlagsKHR
1516//@extension("VK_KHR_display")
1517//bitfield VkDisplayModeCreateFlagBitsKHR {
1518//}
1519
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001520@extension("VK_KHR_xlib_surface")
1521type VkFlags VkXlibSurfaceCreateFlagsKHR
1522//@extension("VK_KHR_xlib_surface")
1523//bitfield VkXlibSurfaceCreateFlagBitsKHR {
1524//}
1525
1526@extension("VK_KHR_xcb_surface")
1527type VkFlags VkXcbSurfaceCreateFlagsKHR
1528//@extension("VK_KHR_xcb_surface")
1529//bitfield VkXcbSurfaceCreateFlagBitsKHR {
1530//}
1531
1532@extension("VK_KHR_wayland_surface")
1533type VkFlags VkWaylandSurfaceCreateFlagsKHR
1534//@extension("VK_KHR_wayland_surface")
1535//bitfield VkWaylandSurfaceCreateFlagBitsKHR {
1536//}
1537
1538@extension("VK_KHR_mir_surface")
1539type VkFlags VkMirSurfaceCreateFlagsKHR
1540//@extension("VK_KHR_mir_surface")
1541//bitfield VkMirSurfaceCreateFlagBitsKHR {
1542//}
1543
1544@extension("VK_KHR_android_surface")
1545type VkFlags VkAndroidSurfaceCreateFlagsKHR
1546//@extension("VK_KHR_android_surface")
1547//bitfield VkAndroidSurfaceCreateFlagBitsKHR {
1548//}
1549
1550@extension("VK_KHR_win32_surface")
1551type VkFlags VkWin32SurfaceCreateFlagsKHR
1552//@extension("VK_KHR_win32_surface")
1553//bitfield VkWin32SurfaceCreateFlagBitsKHR {
1554//}
1555
Jesse Hall889cd9a2017-02-25 22:12:23 -08001556@extension("VK_ANDROID_native_buffer")
1557type VkFlags VkSwapchainImageUsageFlagsANDROID
1558@extension("VK_ANDROID_native_buffer")
1559bitfield VkSwapchainImageUsageFlagBitsANDROID {
1560 VK_SWAPCHAIN_IMAGE_USAGE_FLAGS_SHARED_BIT_ANDROID = 0x00000001,
1561}
1562
Jesse Hall715b86a2016-01-16 16:34:29 -08001563@extension("VK_EXT_debug_report")
1564type VkFlags VkDebugReportFlagsEXT
1565@extension("VK_EXT_debug_report")
1566bitfield VkDebugReportFlagBitsEXT {
Jesse Halle2948d82016-02-25 04:19:32 -08001567 VK_DEBUG_REPORT_INFORMATION_BIT_EXT = 0x00000001,
1568 VK_DEBUG_REPORT_WARNING_BIT_EXT = 0x00000002,
1569 VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT = 0x00000004,
Jesse Hall715b86a2016-01-16 16:34:29 -08001570 VK_DEBUG_REPORT_ERROR_BIT_EXT = 0x00000008,
1571 VK_DEBUG_REPORT_DEBUG_BIT_EXT = 0x00000010,
1572}
1573
Chris Forbes289cb792016-12-30 15:03:55 +13001574@extension("VK_NV_external_memory_capabilities")
1575type VkFlags VkExternalMemoryHandleTypeFlagsNV
1576@extension("VK_NV_external_memory_capabilities")
1577bitfield VkExternalMemoryHandleTypeFlagBitsNV {
Jesse Halleb02c472017-02-24 15:13:45 -08001578 VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_NV = 0x00000001,
1579 VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_NV = 0x00000002,
1580 VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_IMAGE_BIT_NV = 0x00000004,
1581 VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_IMAGE_KMT_BIT_NV = 0x00000008,
Chris Forbes289cb792016-12-30 15:03:55 +13001582}
1583
1584@extension("VK_NV_external_memory_capabilities")
1585type VkFlags VkExternalMemoryFeatureFlagsNV
1586@extension("VK_NV_external_memory_capabilities")
1587bitfield VkExternalMemoryFeatureFlagBitsNV {
Jesse Halleb02c472017-02-24 15:13:45 -08001588 VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT_NV = 0x00000001,
1589 VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT_NV = 0x00000002,
1590 VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT_NV = 0x00000004,
Chris Forbes289cb792016-12-30 15:03:55 +13001591}
1592
1593@extension("VK_NVX_device_generated_commands")
1594type VkFlags VkIndirectCommandsLayoutUsageFlagsNVX
1595@extension("VK_NVX_device_generated_commands")
1596bitfield VkIndirectCommandsLayoutUsageFlagBitsNVX {
Jesse Halleb02c472017-02-24 15:13:45 -08001597 VK_INDIRECT_COMMANDS_LAYOUT_USAGE_UNORDERED_SEQUENCES_BIT_NVX = 0x00000001,
1598 VK_INDIRECT_COMMANDS_LAYOUT_USAGE_SPARSE_SEQUENCES_BIT_NVX = 0x00000002,
1599 VK_INDIRECT_COMMANDS_LAYOUT_USAGE_EMPTY_EXECUTIONS_BIT_NVX = 0x00000004,
1600 VK_INDIRECT_COMMANDS_LAYOUT_USAGE_INDEXED_SEQUENCES_BIT_NVX = 0x00000008,
Chris Forbes289cb792016-12-30 15:03:55 +13001601}
1602
1603@extension("VK_NVX_device_generated_commands")
1604type VkFlags VkObjectEntryUsageFlagsNVX
1605@extension("VK_NVX_device_generated_commands")
1606bitfield VkObjectEntryUsageFlagBitsNVX {
Jesse Halleb02c472017-02-24 15:13:45 -08001607 VK_OBJECT_ENTRY_USAGE_GRAPHICS_BIT_NVX = 0x00000001,
1608 VK_OBJECT_ENTRY_USAGE_COMPUTE_BIT_NVX = 0x00000002,
Chris Forbes289cb792016-12-30 15:03:55 +13001609}
1610
Jesse Halld27f6aa2015-08-15 17:58:48 -07001611//////////////////
1612// Structures //
1613//////////////////
1614
1615class VkOffset2D {
1616 s32 x
1617 s32 y
1618}
1619
1620class VkOffset3D {
1621 s32 x
1622 s32 y
1623 s32 z
1624}
1625
1626class VkExtent2D {
Jesse Hall3dd678a2016-01-08 21:52:01 -08001627 u32 width
1628 u32 height
Jesse Halld27f6aa2015-08-15 17:58:48 -07001629}
1630
1631class VkExtent3D {
Jesse Hall3dd678a2016-01-08 21:52:01 -08001632 u32 width
1633 u32 height
1634 u32 depth
Jesse Halld27f6aa2015-08-15 17:58:48 -07001635}
1636
1637class VkViewport {
Jesse Hall65ab5522015-11-30 00:07:16 -08001638 f32 x
1639 f32 y
Jesse Halld27f6aa2015-08-15 17:58:48 -07001640 f32 width
1641 f32 height
1642 f32 minDepth
1643 f32 maxDepth
1644}
1645
1646class VkRect2D {
1647 VkOffset2D offset
1648 VkExtent2D extent
1649}
1650
Jesse Halla15a4bf2015-11-19 22:48:02 -08001651class VkClearRect {
1652 VkRect2D rect
1653 u32 baseArrayLayer
Jesse Hall3fbc8562015-11-29 22:10:52 -08001654 u32 layerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001655}
1656
Jesse Hall65ab5522015-11-30 00:07:16 -08001657class VkComponentMapping {
1658 VkComponentSwizzle r
1659 VkComponentSwizzle g
1660 VkComponentSwizzle b
1661 VkComponentSwizzle a
Jesse Halld27f6aa2015-08-15 17:58:48 -07001662}
1663
1664class VkPhysicalDeviceProperties {
1665 u32 apiVersion
1666 u32 driverVersion
Jesse Hall65ab5522015-11-30 00:07:16 -08001667 u32 vendorID
1668 u32 deviceID
Jesse Halld27f6aa2015-08-15 17:58:48 -07001669 VkPhysicalDeviceType deviceType
Jesse Hall65ab5522015-11-30 00:07:16 -08001670 char[VK_MAX_PHYSICAL_DEVICE_NAME_SIZE] deviceName
1671 u8[VK_UUID_SIZE] pipelineCacheUUID
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001672 VkPhysicalDeviceLimits limits
1673 VkPhysicalDeviceSparseProperties sparseProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07001674}
1675
1676class VkExtensionProperties {
Jesse Hall65ab5522015-11-30 00:07:16 -08001677 char[VK_MAX_EXTENSION_NAME_SIZE] extensionName /// extension name
Jesse Halld27f6aa2015-08-15 17:58:48 -07001678 u32 specVersion /// version of the extension specification implemented
1679}
1680
1681class VkLayerProperties {
Jesse Hall65ab5522015-11-30 00:07:16 -08001682 char[VK_MAX_EXTENSION_NAME_SIZE] layerName /// layer name
Jesse Hall3fbc8562015-11-29 22:10:52 -08001683 u32 specVersion /// version of the layer specification implemented
1684 u32 implementationVersion /// build or release version of the layer's library
Jesse Hall65ab5522015-11-30 00:07:16 -08001685 char[VK_MAX_DESCRIPTION_SIZE] description /// Free-form description of the layer
Jesse Halld27f6aa2015-08-15 17:58:48 -07001686}
1687
Jesse Halla366a512015-11-19 22:30:07 -08001688class VkSubmitInfo {
Jesse Hall03b6fe12015-11-24 12:44:21 -08001689 VkStructureType sType /// Type of structure. Should be VK_STRUCTURE_TYPE_SUBMIT_INFO
1690 const void* pNext /// Next structure in chain
1691 u32 waitSemaphoreCount
Jesse Halla366a512015-11-19 22:30:07 -08001692 const VkSemaphore* pWaitSemaphores
Jesse Hall543a7ff2016-01-08 16:38:30 -08001693 const VkPipelineStageFlags* pWaitDstStageMask
Jesse Hall03b6fe12015-11-24 12:44:21 -08001694 u32 commandBufferCount
Jesse Hall3fbc8562015-11-29 22:10:52 -08001695 const VkCommandBuffer* pCommandBuffers
Jesse Hall03b6fe12015-11-24 12:44:21 -08001696 u32 signalSemaphoreCount
Jesse Halla366a512015-11-19 22:30:07 -08001697 const VkSemaphore* pSignalSemaphores
1698}
1699
Jesse Halld27f6aa2015-08-15 17:58:48 -07001700class VkApplicationInfo {
1701 VkStructureType sType /// Type of structure. Should be VK_STRUCTURE_TYPE_APPLICATION_INFO
1702 const void* pNext /// Next structure in chain
Jesse Hall3fbc8562015-11-29 22:10:52 -08001703 const char* pApplicationName
1704 u32 applicationVersion
Jesse Halld27f6aa2015-08-15 17:58:48 -07001705 const char* pEngineName
1706 u32 engineVersion
1707 u32 apiVersion
1708}
1709
Jesse Hall3fbc8562015-11-29 22:10:52 -08001710class VkAllocationCallbacks {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001711 void* pUserData
Jesse Hall3fbc8562015-11-29 22:10:52 -08001712 PFN_vkAllocationFunction pfnAllocation
1713 PFN_vkReallocationFunction pfnReallocation
Jesse Halld27f6aa2015-08-15 17:58:48 -07001714 PFN_vkFreeFunction pfnFree
Jesse Hall3fbc8562015-11-29 22:10:52 -08001715 PFN_vkInternalAllocationNotification pfnInternalAllocation
Jesse Hall03b6fe12015-11-24 12:44:21 -08001716 PFN_vkInternalFreeNotification pfnInternalFree
Jesse Halld27f6aa2015-08-15 17:58:48 -07001717}
1718
1719class VkDeviceQueueCreateInfo {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001720 VkStructureType sStype /// Should be VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO
1721 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001722 VkDeviceQueueCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001723 u32 queueFamilyIndex
Jesse Halldba27f72015-11-30 14:25:46 -08001724 u32 queueCount
Jesse Hallfbf97b02015-11-20 14:17:03 -08001725 const f32* pQueuePriorities
Jesse Halld27f6aa2015-08-15 17:58:48 -07001726}
1727
1728class VkDeviceCreateInfo {
1729 VkStructureType sType /// Should be VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO
1730 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001731 VkDeviceCreateFlags flags
Jesse Halldba27f72015-11-30 14:25:46 -08001732 u32 queueCreateInfoCount
1733 const VkDeviceQueueCreateInfo* pQueueCreateInfos
Jesse Hall3dd678a2016-01-08 21:52:01 -08001734 u32 enabledLayerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001735 const char* const* ppEnabledLayerNames /// Ordered list of layer names to be enabled
Jesse Hall3dd678a2016-01-08 21:52:01 -08001736 u32 enabledExtensionCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001737 const char* const* ppEnabledExtensionNames
1738 const VkPhysicalDeviceFeatures* pEnabledFeatures
Jesse Halld27f6aa2015-08-15 17:58:48 -07001739}
1740
1741class VkInstanceCreateInfo {
1742 VkStructureType sType /// Should be VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO
1743 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001744 VkInstanceCreateFlags flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001745 const VkApplicationInfo* pApplicationInfo
Jesse Hall3dd678a2016-01-08 21:52:01 -08001746 u32 enabledLayerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001747 const char* const* ppEnabledLayerNames /// Ordered list of layer names to be enabled
Jesse Hall3dd678a2016-01-08 21:52:01 -08001748 u32 enabledExtensionCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001749 const char* const* ppEnabledExtensionNames /// Extension names to be enabled
1750}
1751
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001752class VkQueueFamilyProperties {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001753 VkQueueFlags queueFlags /// Queue flags
1754 u32 queueCount
Jesse Hallacfa5342015-11-19 21:51:33 -08001755 u32 timestampValidBits
Jesse Hall65ab5522015-11-30 00:07:16 -08001756 VkExtent3D minImageTransferGranularity
Jesse Halld27f6aa2015-08-15 17:58:48 -07001757}
1758
1759class VkPhysicalDeviceMemoryProperties {
1760 u32 memoryTypeCount
1761 VkMemoryType[VK_MAX_MEMORY_TYPES] memoryTypes
1762 u32 memoryHeapCount
1763 VkMemoryHeap[VK_MAX_MEMORY_HEAPS] memoryHeaps
1764}
1765
Jesse Hall3fbc8562015-11-29 22:10:52 -08001766class VkMemoryAllocateInfo {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001767 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07001768 const void* pNext /// Pointer to next structure
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001769 VkDeviceSize allocationSize /// Size of memory allocation
Jesse Halld27f6aa2015-08-15 17:58:48 -07001770 u32 memoryTypeIndex /// Index of the of the memory type to allocate from
1771}
1772
1773class VkMemoryRequirements {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001774 VkDeviceSize size /// Specified in bytes
1775 VkDeviceSize alignment /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001776 u32 memoryTypeBits /// Bitfield of the allowed memory type indices into memoryTypes[] for this object
1777}
1778
1779class VkSparseImageFormatProperties {
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001780 VkImageAspectFlagBits aspectMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001781 VkExtent3D imageGranularity
1782 VkSparseImageFormatFlags flags
1783}
1784
1785class VkSparseImageMemoryRequirements {
Jesse Hallb00daad2015-11-29 19:46:20 -08001786 VkSparseImageFormatProperties formatProperties
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001787 u32 imageMipTailFirstLod
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001788 VkDeviceSize imageMipTailSize /// Specified in bytes, must be a multiple of image block size / alignment
1789 VkDeviceSize imageMipTailOffset /// Specified in bytes, must be a multiple of image block size / alignment
1790 VkDeviceSize imageMipTailStride /// Specified in bytes, must be a multiple of image block size / alignment
Jesse Halld27f6aa2015-08-15 17:58:48 -07001791}
1792
1793class VkMemoryType {
1794 VkMemoryPropertyFlags propertyFlags /// Memory properties of this memory type
1795 u32 heapIndex /// Index of the memory heap allocations of this memory type are taken from
1796}
1797
1798class VkMemoryHeap {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001799 VkDeviceSize size /// Available memory in the heap
Jesse Halld27f6aa2015-08-15 17:58:48 -07001800 VkMemoryHeapFlags flags /// Flags for the heap
1801}
1802
1803class VkMappedMemoryRange {
1804 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE
1805 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08001806 VkDeviceMemory memory /// Mapped memory object
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001807 VkDeviceSize offset /// Offset within the mapped memory the range starts from
1808 VkDeviceSize size /// Size of the range within the mapped memory
Jesse Halld27f6aa2015-08-15 17:58:48 -07001809}
1810
1811class VkFormatProperties {
1812 VkFormatFeatureFlags linearTilingFeatures /// Format features in case of linear tiling
1813 VkFormatFeatureFlags optimalTilingFeatures /// Format features in case of optimal tiling
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001814 VkFormatFeatureFlags bufferFeatures /// Format features supported by buffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07001815}
1816
1817class VkImageFormatProperties {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001818 VkExtent3D maxExtent /// max image dimensions for this resource type
1819 u32 maxMipLevels /// max number of mipmap levels for this resource type
Jesse Halla15a4bf2015-11-19 22:48:02 -08001820 u32 maxArrayLayers /// max array layers for this resource type
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001821 VkSampleCountFlags sampleCounts /// supported sample counts for this resource type
1822 VkDeviceSize maxResourceSize /// max size (in bytes) of this resource type
1823}
1824
Jesse Halla15a4bf2015-11-19 22:48:02 -08001825class VkDescriptorImageInfo {
1826 VkSampler sampler
1827 VkImageView imageView
1828 VkImageLayout imageLayout
1829}
1830
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001831class VkDescriptorBufferInfo {
1832 VkBuffer buffer /// Buffer used for this descriptor when the descriptor is UNIFORM_BUFFER[_DYNAMIC]
1833 VkDeviceSize offset /// Base offset from buffer start in bytes to update in the descriptor set.
1834 VkDeviceSize range /// Size in bytes of the buffer resource for this descriptor update.
Jesse Halld27f6aa2015-08-15 17:58:48 -07001835}
1836
Jesse Halld27f6aa2015-08-15 17:58:48 -07001837class VkWriteDescriptorSet {
1838 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET
1839 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08001840 VkDescriptorSet dstSet /// Destination descriptor set
1841 u32 dstBinding /// Binding within the destination descriptor set to write
1842 u32 dstArrayElement /// Array element within the destination binding to write
Jesse Hall03b6fe12015-11-24 12:44:21 -08001843 u32 descriptorCount /// Number of descriptors to write (determines the size of the array pointed by <pDescriptors>)
Jesse Halld27f6aa2015-08-15 17:58:48 -07001844 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 -08001845 const VkDescriptorImageInfo* pImageInfo
1846 const VkDescriptorBufferInfo* pBufferInfo
1847 const VkBufferView* pTexelBufferView
Jesse Halld27f6aa2015-08-15 17:58:48 -07001848}
1849
1850class VkCopyDescriptorSet {
1851 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET
1852 const void* pNext /// Pointer to next structure
1853 VkDescriptorSet srcSet /// Source descriptor set
1854 u32 srcBinding /// Binding within the source descriptor set to copy from
1855 u32 srcArrayElement /// Array element within the source binding to copy from
Jesse Hall3fbc8562015-11-29 22:10:52 -08001856 VkDescriptorSet dstSet /// Destination descriptor set
1857 u32 dstBinding /// Binding within the destination descriptor set to copy to
1858 u32 dstArrayElement /// Array element within the destination binding to copy to
Jesse Hall03b6fe12015-11-24 12:44:21 -08001859 u32 descriptorCount /// Number of descriptors to copy
Jesse Halld27f6aa2015-08-15 17:58:48 -07001860}
1861
1862class VkBufferCreateInfo {
1863 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO
1864 const void* pNext /// Pointer to next structure.
Jesse Halla6429252015-11-29 18:59:42 -08001865 VkBufferCreateFlags flags /// Buffer creation flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001866 VkDeviceSize size /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001867 VkBufferUsageFlags usage /// Buffer usage flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001868 VkSharingMode sharingMode
Jesse Hall03b6fe12015-11-24 12:44:21 -08001869 u32 queueFamilyIndexCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001870 const u32* pQueueFamilyIndices
1871}
1872
1873class VkBufferViewCreateInfo {
1874 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO
1875 const void* pNext /// Pointer to next structure.
Jesse Halla6429252015-11-29 18:59:42 -08001876 VkBufferViewCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001877 VkBuffer buffer
Jesse Halld27f6aa2015-08-15 17:58:48 -07001878 VkFormat format /// Optionally specifies format of elements
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001879 VkDeviceSize offset /// Specified in bytes
1880 VkDeviceSize range /// View size specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001881}
1882
1883class VkImageSubresource {
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001884 VkImageAspectFlagBits aspectMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001885 u32 mipLevel
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001886 u32 arrayLayer
Jesse Halld27f6aa2015-08-15 17:58:48 -07001887}
1888
1889class VkImageSubresourceRange {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001890 VkImageAspectFlags aspectMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001891 u32 baseMipLevel
Jesse Hall3fbc8562015-11-29 22:10:52 -08001892 u32 levelCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001893 u32 baseArrayLayer
Jesse Hall3fbc8562015-11-29 22:10:52 -08001894 u32 layerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001895}
1896
1897class VkMemoryBarrier {
1898 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MEMORY_BARRIER
1899 const void* pNext /// Pointer to next structure.
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001900 VkAccessFlags srcAccessMask
1901 VkAccessFlags dstAccessMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001902}
1903
1904class VkBufferMemoryBarrier {
1905 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER
1906 const void* pNext /// Pointer to next structure.
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001907 VkAccessFlags srcAccessMask
1908 VkAccessFlags dstAccessMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001909 u32 srcQueueFamilyIndex /// Queue family to transition ownership from
Jesse Hall3fbc8562015-11-29 22:10:52 -08001910 u32 dstQueueFamilyIndex /// Queue family to transition ownership to
Jesse Halld27f6aa2015-08-15 17:58:48 -07001911 VkBuffer buffer /// Buffer to sync
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001912 VkDeviceSize offset /// Offset within the buffer to sync
1913 VkDeviceSize size /// Amount of bytes to sync
Jesse Halld27f6aa2015-08-15 17:58:48 -07001914}
1915
1916class VkImageMemoryBarrier {
1917 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER
1918 const void* pNext /// Pointer to next structure.
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001919 VkAccessFlags srcAccessMask
1920 VkAccessFlags dstAccessMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001921 VkImageLayout oldLayout /// Current layout of the image
1922 VkImageLayout newLayout /// New layout to transition the image to
1923 u32 srcQueueFamilyIndex /// Queue family to transition ownership from
Jesse Hall3fbc8562015-11-29 22:10:52 -08001924 u32 dstQueueFamilyIndex /// Queue family to transition ownership to
Jesse Halld27f6aa2015-08-15 17:58:48 -07001925 VkImage image /// Image to sync
1926 VkImageSubresourceRange subresourceRange /// Subresource range to sync
1927}
1928
1929class VkImageCreateInfo {
1930 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO
1931 const void* pNext /// Pointer to next structure.
Jesse Halla6429252015-11-29 18:59:42 -08001932 VkImageCreateFlags flags /// Image creation flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001933 VkImageType imageType
1934 VkFormat format
1935 VkExtent3D extent
1936 u32 mipLevels
Jesse Halla15a4bf2015-11-19 22:48:02 -08001937 u32 arrayLayers
Jesse Hall091ed9e2015-11-30 00:55:29 -08001938 VkSampleCountFlagBits samples
Jesse Halld27f6aa2015-08-15 17:58:48 -07001939 VkImageTiling tiling
1940 VkImageUsageFlags usage /// Image usage flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001941 VkSharingMode sharingMode /// Cross-queue-family sharing mode
Jesse Hall03b6fe12015-11-24 12:44:21 -08001942 u32 queueFamilyIndexCount /// Number of queue families to share across
Jesse Halld27f6aa2015-08-15 17:58:48 -07001943 const u32* pQueueFamilyIndices /// Array of queue family indices to share across
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001944 VkImageLayout initialLayout /// Initial image layout for all subresources
Jesse Halld27f6aa2015-08-15 17:58:48 -07001945}
1946
1947class VkSubresourceLayout {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001948 VkDeviceSize offset /// Specified in bytes
1949 VkDeviceSize size /// Specified in bytes
1950 VkDeviceSize rowPitch /// Specified in bytes
Jesse Hall543a7ff2016-01-08 16:38:30 -08001951 VkDeviceSize arrayPitch /// Specified in bytes
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001952 VkDeviceSize depthPitch /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001953}
1954
1955class VkImageViewCreateInfo {
1956 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO
1957 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001958 VkImageViewCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001959 VkImage image
1960 VkImageViewType viewType
1961 VkFormat format
Jesse Hall65ab5522015-11-30 00:07:16 -08001962 VkComponentMapping components
Jesse Halld27f6aa2015-08-15 17:58:48 -07001963 VkImageSubresourceRange subresourceRange
Jesse Halld27f6aa2015-08-15 17:58:48 -07001964}
1965
1966class VkBufferCopy {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001967 VkDeviceSize srcOffset /// Specified in bytes
Jesse Hall3fbc8562015-11-29 22:10:52 -08001968 VkDeviceSize dstOffset /// Specified in bytes
Jesse Hallb00daad2015-11-29 19:46:20 -08001969 VkDeviceSize size /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001970}
1971
Jesse Halla6429252015-11-29 18:59:42 -08001972class VkSparseMemoryBind {
Jesse Hallb00daad2015-11-29 19:46:20 -08001973 VkDeviceSize resourceOffset /// Specified in bytes
1974 VkDeviceSize size /// Specified in bytes
Jesse Hall3fbc8562015-11-29 22:10:52 -08001975 VkDeviceMemory memory
1976 VkDeviceSize memoryOffset /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001977 VkSparseMemoryBindFlags flags
1978}
1979
Jesse Halla6429252015-11-29 18:59:42 -08001980class VkSparseImageMemoryBind {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001981 VkImageSubresource subresource
1982 VkOffset3D offset
1983 VkExtent3D extent
Jesse Hall3fbc8562015-11-29 22:10:52 -08001984 VkDeviceMemory memory
1985 VkDeviceSize memoryOffset /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001986 VkSparseMemoryBindFlags flags
1987}
1988
Jesse Halla6429252015-11-29 18:59:42 -08001989class VkSparseBufferMemoryBindInfo {
1990 VkBuffer buffer
1991 u32 bindCount
1992 const VkSparseMemoryBind* pBinds
1993}
1994
1995class VkSparseImageOpaqueMemoryBindInfo {
1996 VkImage image
1997 u32 bindCount
1998 const VkSparseMemoryBind* pBinds
1999}
2000
2001class VkSparseImageMemoryBindInfo {
2002 VkImage image
2003 u32 bindCount
2004 const VkSparseMemoryBind* pBinds
2005}
2006
2007class VkBindSparseInfo {
2008 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BIND_SPARSE_INFO
2009 const void* pNext
2010 u32 waitSemaphoreCount
2011 const VkSemaphore* pWaitSemaphores
2012 u32 numBufferBinds
2013 const VkSparseBufferMemoryBindInfo* pBufferBinds
2014 u32 numImageOpaqueBinds
2015 const VkSparseImageOpaqueMemoryBindInfo* pImageOpaqueBinds
2016 u32 numImageBinds
2017 const VkSparseImageMemoryBindInfo* pImageBinds
2018 u32 signalSemaphoreCount
2019 const VkSemaphore* pSignalSemaphores
2020}
2021
Jesse Hall65ab5522015-11-30 00:07:16 -08002022class VkImageSubresourceLayers {
2023 VkImageAspectFlags aspectMask
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002024 u32 mipLevel
Jesse Halla15a4bf2015-11-19 22:48:02 -08002025 u32 baseArrayLayer
Jesse Hall3fbc8562015-11-29 22:10:52 -08002026 u32 layerCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002027}
2028
Jesse Halld27f6aa2015-08-15 17:58:48 -07002029class VkImageCopy {
Jesse Hall65ab5522015-11-30 00:07:16 -08002030 VkImageSubresourceLayers srcSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07002031 VkOffset3D srcOffset /// Specified in pixels for both compressed and uncompressed images
Jesse Hall65ab5522015-11-30 00:07:16 -08002032 VkImageSubresourceLayers dstSubresource
Jesse Hall3fbc8562015-11-29 22:10:52 -08002033 VkOffset3D dstOffset /// Specified in pixels for both compressed and uncompressed images
Jesse Halld27f6aa2015-08-15 17:58:48 -07002034 VkExtent3D extent /// Specified in pixels for both compressed and uncompressed images
2035}
2036
2037class VkImageBlit {
Jesse Hall65ab5522015-11-30 00:07:16 -08002038 VkImageSubresourceLayers srcSubresource
Jesse Hall3dd678a2016-01-08 21:52:01 -08002039 VkOffset3D[2] srcOffsets
Jesse Hall65ab5522015-11-30 00:07:16 -08002040 VkImageSubresourceLayers dstSubresource
Jesse Hall3dd678a2016-01-08 21:52:01 -08002041 VkOffset3D[2] dstOffsets
Jesse Halld27f6aa2015-08-15 17:58:48 -07002042}
2043
2044class VkBufferImageCopy {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002045 VkDeviceSize bufferOffset /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002046 u32 bufferRowLength /// Specified in texels
2047 u32 bufferImageHeight
Jesse Hall65ab5522015-11-30 00:07:16 -08002048 VkImageSubresourceLayers imageSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07002049 VkOffset3D imageOffset /// Specified in pixels for both compressed and uncompressed images
2050 VkExtent3D imageExtent /// Specified in pixels for both compressed and uncompressed images
2051}
2052
2053class VkImageResolve {
Jesse Hall65ab5522015-11-30 00:07:16 -08002054 VkImageSubresourceLayers srcSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07002055 VkOffset3D srcOffset
Jesse Hall65ab5522015-11-30 00:07:16 -08002056 VkImageSubresourceLayers dstSubresource
Jesse Hall3fbc8562015-11-29 22:10:52 -08002057 VkOffset3D dstOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07002058 VkExtent3D extent
2059}
2060
2061class VkShaderModuleCreateInfo {
2062 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO
2063 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002064 VkShaderModuleCreateFlags flags /// Reserved
Jesse Halld27f6aa2015-08-15 17:58:48 -07002065 platform.size_t codeSize /// Specified in bytes
Jesse Halla9bb62b2015-11-21 19:31:56 -08002066 const u32* pCode /// Binary code of size codeSize
Jesse Halld27f6aa2015-08-15 17:58:48 -07002067}
2068
Jesse Halld27f6aa2015-08-15 17:58:48 -07002069class VkDescriptorSetLayoutBinding {
Jesse Hall091ed9e2015-11-30 00:55:29 -08002070 u32 binding
Jesse Halld27f6aa2015-08-15 17:58:48 -07002071 VkDescriptorType descriptorType /// Type of the descriptors in this binding
Jesse Halldba27f72015-11-30 14:25:46 -08002072 u32 descriptorCount /// Number of descriptors in this binding
Jesse Halld27f6aa2015-08-15 17:58:48 -07002073 VkShaderStageFlags stageFlags /// Shader stages this binding is visible to
2074 const VkSampler* pImmutableSamplers /// Immutable samplers (used if descriptor type is SAMPLER or COMBINED_IMAGE_SAMPLER, is either NULL or contains <count> number of elements)
2075}
2076
2077class VkDescriptorSetLayoutCreateInfo {
2078 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO
2079 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002080 VkDescriptorSetLayoutCreateFlags flags
Jesse Hall03b6fe12015-11-24 12:44:21 -08002081 u32 bindingCount /// Number of bindings in the descriptor set layout
Jesse Hall543a7ff2016-01-08 16:38:30 -08002082 const VkDescriptorSetLayoutBinding* pBindings /// Array of descriptor set layout bindings
Jesse Halld27f6aa2015-08-15 17:58:48 -07002083}
2084
Jesse Hall65ab5522015-11-30 00:07:16 -08002085class VkDescriptorPoolSize {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002086 VkDescriptorType type
Jesse Hall03b6fe12015-11-24 12:44:21 -08002087 u32 descriptorCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002088}
2089
2090class VkDescriptorPoolCreateInfo {
2091 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO
2092 const void* pNext /// Pointer to next structure
Jesse Hallfbf97b02015-11-20 14:17:03 -08002093 VkDescriptorPoolCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002094 u32 maxSets
Jesse Hall65ab5522015-11-30 00:07:16 -08002095 u32 poolSizeCount
2096 const VkDescriptorPoolSize* pPoolSizes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002097}
2098
Jesse Hall3fbc8562015-11-29 22:10:52 -08002099class VkDescriptorSetAllocateInfo {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002100 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO
Jesse Hallfbf97b02015-11-20 14:17:03 -08002101 const void* pNext /// Pointer to next structure
2102 VkDescriptorPool descriptorPool
Jesse Hall03b6fe12015-11-24 12:44:21 -08002103 u32 setCount
Jesse Hallfbf97b02015-11-20 14:17:03 -08002104 const VkDescriptorSetLayout* pSetLayouts
2105}
2106
Jesse Halld27f6aa2015-08-15 17:58:48 -07002107class VkSpecializationMapEntry {
Jesse Hall65ab5522015-11-30 00:07:16 -08002108 u32 constantID /// The SpecConstant ID specified in the BIL
Jesse Halld27f6aa2015-08-15 17:58:48 -07002109 u32 offset /// Offset of the value in the data block
Jesse Hallb00daad2015-11-29 19:46:20 -08002110 platform.size_t size /// Size in bytes of the SpecConstant
Jesse Halld27f6aa2015-08-15 17:58:48 -07002111}
2112
2113class VkSpecializationInfo {
2114 u32 mapEntryCount /// Number of entries in the map
Jesse Hallb00daad2015-11-29 19:46:20 -08002115 const VkSpecializationMapEntry* pMapEntries /// Array of map entries
Jesse Halld27f6aa2015-08-15 17:58:48 -07002116 platform.size_t dataSize /// Size in bytes of pData
2117 const void* pData /// Pointer to SpecConstant data
2118}
2119
2120class VkPipelineShaderStageCreateInfo {
2121 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO
2122 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002123 VkPipelineShaderStageCreateFlags flags
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002124 VkShaderStageFlagBits stage
2125 VkShaderModule module
2126 const char* pName
Jesse Halld27f6aa2015-08-15 17:58:48 -07002127 const VkSpecializationInfo* pSpecializationInfo
2128}
2129
2130class VkComputePipelineCreateInfo {
2131 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO
2132 const void* pNext /// Pointer to next structure
Jesse Halld27f6aa2015-08-15 17:58:48 -07002133 VkPipelineCreateFlags flags /// Pipeline creation flags
Jesse Halla6429252015-11-29 18:59:42 -08002134 VkPipelineShaderStageCreateInfo stage
Jesse Halld27f6aa2015-08-15 17:58:48 -07002135 VkPipelineLayout layout /// Interface layout of the pipeline
2136 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
2137 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
2138}
2139
2140class VkVertexInputBindingDescription {
Jesse Hallb00daad2015-11-29 19:46:20 -08002141 u32 binding /// Vertex buffer binding id
2142 u32 stride /// Distance between vertices in bytes (0 = no advancement)
Jesse Hall65ab5522015-11-30 00:07:16 -08002143 VkVertexInputRate inputRate /// Rate at which binding is incremented
Jesse Halld27f6aa2015-08-15 17:58:48 -07002144}
2145
2146class VkVertexInputAttributeDescription {
Jesse Hallb00daad2015-11-29 19:46:20 -08002147 u32 location /// location of the shader vertex attrib
2148 u32 binding /// Vertex buffer binding id
2149 VkFormat format /// format of source data
2150 u32 offset /// Offset of first element in bytes from base of vertex
Jesse Halld27f6aa2015-08-15 17:58:48 -07002151}
2152
2153class VkPipelineVertexInputStateCreateInfo {
Jesse Hall03b6fe12015-11-24 12:44:21 -08002154 VkStructureType sType /// Should be VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO
2155 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002156 VkPipelineVertexInputStateCreateFlags flags
Jesse Hall03b6fe12015-11-24 12:44:21 -08002157 u32 vertexBindingDescriptionCount /// number of bindings
Jesse Halld27f6aa2015-08-15 17:58:48 -07002158 const VkVertexInputBindingDescription* pVertexBindingDescriptions
Jesse Hall03b6fe12015-11-24 12:44:21 -08002159 u32 vertexAttributeDescriptionCount /// number of attributes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002160 const VkVertexInputAttributeDescription* pVertexAttributeDescriptions
2161}
2162
2163class VkPipelineInputAssemblyStateCreateInfo {
2164 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO
2165 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002166 VkPipelineInputAssemblyStateCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002167 VkPrimitiveTopology topology
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002168 VkBool32 primitiveRestartEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002169}
2170
2171class VkPipelineTessellationStateCreateInfo {
2172 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO
2173 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002174 VkPipelineTessellationStateCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002175 u32 patchControlPoints
2176}
2177
2178class VkPipelineViewportStateCreateInfo {
2179 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO
2180 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002181 VkPipelineViewportStateCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002182 u32 viewportCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002183 const VkViewport* pViewports
2184 u32 scissorCount
2185 const VkRect2D* pScissors
Jesse Halld27f6aa2015-08-15 17:58:48 -07002186}
2187
Jesse Hall3fbc8562015-11-29 22:10:52 -08002188class VkPipelineRasterizationStateCreateInfo {
Jesse Hall65ab5522015-11-30 00:07:16 -08002189 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002190 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08002191 VkPipelineRasterizationStateCreateFlags flags
Jesse Hallae38f732015-11-19 21:32:50 -08002192 VkBool32 depthClampEnable
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002193 VkBool32 rasterizerDiscardEnable
Jesse Hall65ab5522015-11-30 00:07:16 -08002194 VkPolygonMode polygonMode /// optional (GL45)
Jesse Hallc7467b72015-11-29 21:05:26 -08002195 VkCullModeFlags cullMode
Jesse Halld27f6aa2015-08-15 17:58:48 -07002196 VkFrontFace frontFace
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002197 VkBool32 depthBiasEnable
Jesse Halla9bb62b2015-11-21 19:31:56 -08002198 f32 depthBiasConstantFactor
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002199 f32 depthBiasClamp
Jesse Halla9bb62b2015-11-21 19:31:56 -08002200 f32 depthBiasSlopeFactor
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002201 f32 lineWidth
Jesse Halld27f6aa2015-08-15 17:58:48 -07002202}
2203
2204class VkPipelineMultisampleStateCreateInfo {
2205 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO
2206 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002207 VkPipelineMultisampleStateCreateFlags flags
Jesse Hall091ed9e2015-11-30 00:55:29 -08002208 VkSampleCountFlagBits rasterizationSamples /// Number of samples used for rasterization
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002209 VkBool32 sampleShadingEnable /// optional (GL45)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002210 f32 minSampleShading /// optional (GL45)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002211 const VkSampleMask* pSampleMask
Jesse Hallacfa5342015-11-19 21:51:33 -08002212 VkBool32 alphaToCoverageEnable
2213 VkBool32 alphaToOneEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002214}
2215
2216class VkPipelineColorBlendAttachmentState {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002217 VkBool32 blendEnable
Jesse Hall65ab5522015-11-30 00:07:16 -08002218 VkBlendFactor srcColorBlendFactor
2219 VkBlendFactor dstColorBlendFactor
2220 VkBlendOp colorBlendOp
2221 VkBlendFactor srcAlphaBlendFactor
2222 VkBlendFactor dstAlphaBlendFactor
2223 VkBlendOp alphaBlendOp
2224 VkColorComponentFlags colorWriteMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07002225}
2226
2227class VkPipelineColorBlendStateCreateInfo {
2228 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO
2229 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002230 VkPipelineColorBlendStateCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002231 VkBool32 logicOpEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002232 VkLogicOp logicOp
2233 u32 attachmentCount /// # of pAttachments
2234 const VkPipelineColorBlendAttachmentState* pAttachments
Jesse Hallb00daad2015-11-29 19:46:20 -08002235 f32[4] blendConstants
Jesse Halld27f6aa2015-08-15 17:58:48 -07002236}
2237
2238class VkStencilOpState {
Jesse Hall65ab5522015-11-30 00:07:16 -08002239 VkStencilOp failOp
2240 VkStencilOp passOp
2241 VkStencilOp depthFailOp
2242 VkCompareOp compareOp
2243 u32 compareMask
2244 u32 writeMask
2245 u32 reference
Jesse Halld27f6aa2015-08-15 17:58:48 -07002246}
2247
2248class VkPipelineDepthStencilStateCreateInfo {
2249 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO
2250 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002251 VkPipelineDepthStencilStateCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002252 VkBool32 depthTestEnable
2253 VkBool32 depthWriteEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002254 VkCompareOp depthCompareOp
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002255 VkBool32 depthBoundsTestEnable /// optional (depth_bounds_test)
2256 VkBool32 stencilTestEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002257 VkStencilOpState front
2258 VkStencilOpState back
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002259 f32 minDepthBounds
2260 f32 maxDepthBounds
2261}
2262
2263class VkPipelineDynamicStateCreateInfo {
2264 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO
2265 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002266 VkPipelineDynamicStateCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002267 u32 dynamicStateCount
2268 const VkDynamicState* pDynamicStates
Jesse Halld27f6aa2015-08-15 17:58:48 -07002269}
2270
2271class VkGraphicsPipelineCreateInfo {
Jesse Halla6429252015-11-29 18:59:42 -08002272 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO
2273 const void* pNext /// Pointer to next structure
2274 VkPipelineCreateFlags flags /// Pipeline creation flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002275 u32 stageCount
Jesse Halla6429252015-11-29 18:59:42 -08002276 const VkPipelineShaderStageCreateInfo* pStages /// One entry for each active shader stage
Jesse Halld27f6aa2015-08-15 17:58:48 -07002277 const VkPipelineVertexInputStateCreateInfo* pVertexInputState
2278 const VkPipelineInputAssemblyStateCreateInfo* pInputAssemblyState
2279 const VkPipelineTessellationStateCreateInfo* pTessellationState
2280 const VkPipelineViewportStateCreateInfo* pViewportState
Jesse Hall3fbc8562015-11-29 22:10:52 -08002281 const VkPipelineRasterizationStateCreateInfo* pRasterizationState
Jesse Halld27f6aa2015-08-15 17:58:48 -07002282 const VkPipelineMultisampleStateCreateInfo* pMultisampleState
2283 const VkPipelineDepthStencilStateCreateInfo* pDepthStencilState
2284 const VkPipelineColorBlendStateCreateInfo* pColorBlendState
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002285 const VkPipelineDynamicStateCreateInfo* pDynamicState
Jesse Halla6429252015-11-29 18:59:42 -08002286 VkPipelineLayout layout /// Interface layout of the pipeline
Jesse Halld27f6aa2015-08-15 17:58:48 -07002287 VkRenderPass renderPass
2288 u32 subpass
Jesse Halla6429252015-11-29 18:59:42 -08002289 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
2290 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 -07002291}
2292
2293class VkPipelineCacheCreateInfo {
Jesse Hallb00daad2015-11-29 19:46:20 -08002294 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO
2295 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002296 VkPipelineCacheCreateFlags flags
Jesse Hallb00daad2015-11-29 19:46:20 -08002297 platform.size_t initialDataSize /// Size of initial data to populate cache, in bytes
2298 const void* pInitialData /// Initial data to populate cache
Jesse Halld27f6aa2015-08-15 17:58:48 -07002299}
2300
2301class VkPushConstantRange {
2302 VkShaderStageFlags stageFlags /// Which stages use the range
Jesse Hall03b6fe12015-11-24 12:44:21 -08002303 u32 offset /// Start of the range, in bytes
2304 u32 size /// Length of the range, in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002305}
2306
2307class VkPipelineLayoutCreateInfo {
2308 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO
2309 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002310 VkPipelineLayoutCreateFlags flags
Jesse Hall3dd678a2016-01-08 21:52:01 -08002311 u32 descriptorSetCount /// Number of descriptor sets interfaced by the pipeline
Jesse Halld27f6aa2015-08-15 17:58:48 -07002312 const VkDescriptorSetLayout* pSetLayouts /// Array of <setCount> number of descriptor set layout objects defining the layout of the
2313 u32 pushConstantRangeCount /// Number of push-constant ranges used by the pipeline
2314 const VkPushConstantRange* pPushConstantRanges /// Array of pushConstantRangeCount number of ranges used by various shader stages
2315}
2316
2317class VkSamplerCreateInfo {
2318 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO
2319 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002320 VkSamplerCreateFlags flags
Jesse Hall23ff73f2015-11-29 14:36:39 -08002321 VkFilter magFilter /// Filter mode for magnification
2322 VkFilter minFilter /// Filter mode for minifiation
2323 VkSamplerMipmapMode mipmapMode /// Mipmap selection mode
2324 VkSamplerAddressMode addressModeU
2325 VkSamplerAddressMode addressModeV
2326 VkSamplerAddressMode addressModeW
Jesse Halld27f6aa2015-08-15 17:58:48 -07002327 f32 mipLodBias
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002328 VkBool32 anisotropyEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002329 f32 maxAnisotropy
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002330 VkBool32 compareEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002331 VkCompareOp compareOp
2332 f32 minLod
2333 f32 maxLod
2334 VkBorderColor borderColor
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002335 VkBool32 unnormalizedCoordinates
Jesse Halld27f6aa2015-08-15 17:58:48 -07002336}
2337
Jesse Hall3fbc8562015-11-29 22:10:52 -08002338class VkCommandPoolCreateInfo {
2339 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002340 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08002341 VkCommandPoolCreateFlags flags /// Command pool creation flags
Jesse Halla6429252015-11-29 18:59:42 -08002342 u32 queueFamilyIndex
Jesse Halld27f6aa2015-08-15 17:58:48 -07002343}
2344
Jesse Hall3fbc8562015-11-29 22:10:52 -08002345class VkCommandBufferAllocateInfo {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002346 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002347 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08002348 VkCommandPool commandPool
2349 VkCommandBufferLevel level
Jesse Hall3dd678a2016-01-08 21:52:01 -08002350 u32 commandBufferCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002351}
2352
Jesse Hall3dd678a2016-01-08 21:52:01 -08002353class VkCommandBufferInheritanceInfo {
2354 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002355 const void* pNext /// Pointer to next structure
Jesse Halld27f6aa2015-08-15 17:58:48 -07002356 VkRenderPass renderPass /// Render pass for secondary command buffers
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002357 u32 subpass
Jesse Halld27f6aa2015-08-15 17:58:48 -07002358 VkFramebuffer framebuffer /// Framebuffer for secondary command buffers
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002359 VkBool32 occlusionQueryEnable
2360 VkQueryControlFlags queryFlags
2361 VkQueryPipelineStatisticFlags pipelineStatistics
Jesse Halld27f6aa2015-08-15 17:58:48 -07002362}
2363
Jesse Hall3dd678a2016-01-08 21:52:01 -08002364class VkCommandBufferBeginInfo {
2365 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO
2366 const void* pNext /// Pointer to next structure
2367 VkCommandBufferUsageFlags flags /// Command buffer usage flags
2368 const VkCommandBufferInheritanceInfo* pInheritanceInfo
2369}
2370
Jesse Halld27f6aa2015-08-15 17:58:48 -07002371class VkRenderPassBeginInfo {
2372 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO
2373 const void* pNext /// Pointer to next structure
2374 VkRenderPass renderPass
2375 VkFramebuffer framebuffer
2376 VkRect2D renderArea
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002377 u32 clearValueCount
2378 const VkClearValue* pClearValues
Jesse Halld27f6aa2015-08-15 17:58:48 -07002379}
2380
2381@union
2382/// Union allowing specification of floating point, integer, or unsigned integer color data. Actual value selected is based on image/attachment being cleared.
2383class VkClearColorValue {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002384 f32[4] float32
2385 s32[4] int32
2386 u32[4] uint32
Jesse Halld27f6aa2015-08-15 17:58:48 -07002387}
2388
2389class VkClearDepthStencilValue {
2390 f32 depth
2391 u32 stencil
2392}
2393
2394@union
2395/// Union allowing specification of color, depth, and stencil color values. Actual value selected is based on attachment being cleared.
2396class VkClearValue {
2397 VkClearColorValue color
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002398 VkClearDepthStencilValue depthStencil
Jesse Halld27f6aa2015-08-15 17:58:48 -07002399}
2400
Jesse Hallae38f732015-11-19 21:32:50 -08002401class VkClearAttachment {
2402 VkImageAspectFlags aspectMask
2403 u32 colorAttachment
2404 VkClearValue clearValue
2405}
2406
Jesse Halld27f6aa2015-08-15 17:58:48 -07002407class VkAttachmentDescription {
Jesse Halla6429252015-11-29 18:59:42 -08002408 VkAttachmentDescriptionFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002409 VkFormat format
Jesse Hall091ed9e2015-11-30 00:55:29 -08002410 VkSampleCountFlagBits samples
Jesse Halld27f6aa2015-08-15 17:58:48 -07002411 VkAttachmentLoadOp loadOp /// Load op for color or depth data
2412 VkAttachmentStoreOp storeOp /// Store op for color or depth data
2413 VkAttachmentLoadOp stencilLoadOp /// Load op for stencil data
2414 VkAttachmentStoreOp stencilStoreOp /// Store op for stencil data
2415 VkImageLayout initialLayout
2416 VkImageLayout finalLayout
2417}
2418
2419class VkAttachmentReference {
2420 u32 attachment
2421 VkImageLayout layout
2422}
2423
2424class VkSubpassDescription {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002425 VkSubpassDescriptionFlags flags
Jesse Halla6429252015-11-29 18:59:42 -08002426 VkPipelineBindPoint pipelineBindPoint /// Must be VK_PIPELINE_BIND_POINT_GRAPHICS for now
Jesse Hall03b6fe12015-11-24 12:44:21 -08002427 u32 inputAttachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002428 const VkAttachmentReference* pInputAttachments
Jesse Hall03b6fe12015-11-24 12:44:21 -08002429 u32 colorAttachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002430 const VkAttachmentReference* pColorAttachments
2431 const VkAttachmentReference* pResolveAttachments
Jesse Hallc7467b72015-11-29 21:05:26 -08002432 const VkAttachmentReference* pDepthStencilAttachment
Jesse Hall03b6fe12015-11-24 12:44:21 -08002433 u32 preserveAttachmentCount
Jesse Hall3dd678a2016-01-08 21:52:01 -08002434 const u32* pPreserveAttachments
Jesse Halld27f6aa2015-08-15 17:58:48 -07002435}
2436
2437class VkSubpassDependency {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002438 u32 srcSubpass
Jesse Hall3fbc8562015-11-29 22:10:52 -08002439 u32 dstSubpass
Jesse Halld27f6aa2015-08-15 17:58:48 -07002440 VkPipelineStageFlags srcStageMask
Jesse Hall3fbc8562015-11-29 22:10:52 -08002441 VkPipelineStageFlags dstStageMask
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002442 VkAccessFlags srcAccessMask
2443 VkAccessFlags dstAccessMask
Jesse Halldc6d36c2015-11-29 19:12:15 -08002444 VkDependencyFlags dependencyFlags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002445}
2446
2447class VkRenderPassCreateInfo {
2448 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO
2449 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002450 VkRenderPassCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002451 u32 attachmentCount
2452 const VkAttachmentDescription* pAttachments
2453 u32 subpassCount
2454 const VkSubpassDescription* pSubpasses
2455 u32 dependencyCount
2456 const VkSubpassDependency* pDependencies
2457}
2458
2459class VkEventCreateInfo {
2460 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_EVENT_CREATE_INFO
2461 const void* pNext /// Pointer to next structure
2462 VkEventCreateFlags flags /// Event creation flags
2463}
2464
2465class VkFenceCreateInfo {
2466 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_FENCE_CREATE_INFO
2467 const void* pNext /// Pointer to next structure
2468 VkFenceCreateFlags flags /// Fence creation flags
2469}
2470
2471class VkPhysicalDeviceFeatures {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002472 VkBool32 robustBufferAccess /// out of bounds buffer accesses are well defined
2473 VkBool32 fullDrawIndexUint32 /// full 32-bit range of indices for indexed draw calls
2474 VkBool32 imageCubeArray /// image views which are arrays of cube maps
2475 VkBool32 independentBlend /// blending operations are controlled per-attachment
2476 VkBool32 geometryShader /// geometry stage
2477 VkBool32 tessellationShader /// tessellation control and evaluation stage
2478 VkBool32 sampleRateShading /// per-sample shading and interpolation
Jesse Hall3fbc8562015-11-29 22:10:52 -08002479 VkBool32 dualSrcBlend /// blend operations which take two sources
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002480 VkBool32 logicOp /// logic operations
2481 VkBool32 multiDrawIndirect /// multi draw indirect
Jesse Hall543a7ff2016-01-08 16:38:30 -08002482 VkBool32 drawIndirectFirstInstance
Jesse Hallae38f732015-11-19 21:32:50 -08002483 VkBool32 depthClamp /// depth clamping
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002484 VkBool32 depthBiasClamp /// depth bias clamping
2485 VkBool32 fillModeNonSolid /// point and wireframe fill modes
2486 VkBool32 depthBounds /// depth bounds test
2487 VkBool32 wideLines /// lines with width greater than 1
2488 VkBool32 largePoints /// points with size greater than 1
Jesse Hallfbf97b02015-11-20 14:17:03 -08002489 VkBool32 alphaToOne /// The fragment alpha channel can be forced to maximum representable alpha value
2490 VkBool32 multiViewport
2491 VkBool32 samplerAnisotropy
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002492 VkBool32 textureCompressionETC2 /// ETC texture compression formats
2493 VkBool32 textureCompressionASTC_LDR /// ASTC LDR texture compression formats
2494 VkBool32 textureCompressionBC /// BC1-7 texture compressed formats
Jesse Hall65ab5522015-11-30 00:07:16 -08002495 VkBool32 occlusionQueryPrecise
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002496 VkBool32 pipelineStatisticsQuery /// pipeline statistics query
Jesse Halldc6d36c2015-11-29 19:12:15 -08002497 VkBool32 vertexPipelineStoresAndAtomics
2498 VkBool32 fragmentStoresAndAtomics
2499 VkBool32 shaderTessellationAndGeometryPointSize
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002500 VkBool32 shaderImageGatherExtended /// texture gather with run-time values and independent offsets
2501 VkBool32 shaderStorageImageExtendedFormats /// the extended set of formats can be used for storage images
2502 VkBool32 shaderStorageImageMultisample /// multisample images can be used for storage images
Jesse Halld1af8122015-11-29 23:50:38 -08002503 VkBool32 shaderStorageImageReadWithoutFormat
2504 VkBool32 shaderStorageImageWriteWithoutFormat
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002505 VkBool32 shaderUniformBufferArrayDynamicIndexing /// arrays of uniform buffers can be accessed with dynamically uniform indices
2506 VkBool32 shaderSampledImageArrayDynamicIndexing /// arrays of sampled images can be accessed with dynamically uniform indices
2507 VkBool32 shaderStorageBufferArrayDynamicIndexing /// arrays of storage buffers can be accessed with dynamically uniform indices
2508 VkBool32 shaderStorageImageArrayDynamicIndexing /// arrays of storage images can be accessed with dynamically uniform indices
2509 VkBool32 shaderClipDistance /// clip distance in shaders
2510 VkBool32 shaderCullDistance /// cull distance in shaders
2511 VkBool32 shaderFloat64 /// 64-bit floats (doubles) in shaders
2512 VkBool32 shaderInt64 /// 64-bit integers in shaders
2513 VkBool32 shaderInt16 /// 16-bit integers in shaders
2514 VkBool32 shaderResourceResidency /// shader can use texture operations that return resource residency information (requires sparseNonResident support)
Jesse Hall65ab5522015-11-30 00:07:16 -08002515 VkBool32 shaderResourceMinLod /// shader can use texture operations that specify minimum resource LOD
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002516 VkBool32 sparseBinding /// Sparse resources support: Resource memory can be managed at opaque page level rather than object level
2517 VkBool32 sparseResidencyBuffer /// Sparse resources support: GPU can access partially resident buffers
2518 VkBool32 sparseResidencyImage2D /// Sparse resources support: GPU can access partially resident 2D (non-MSAA non-DepthStencil) images
2519 VkBool32 sparseResidencyImage3D /// Sparse resources support: GPU can access partially resident 3D images
2520 VkBool32 sparseResidency2Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 2 samples
2521 VkBool32 sparseResidency4Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 4 samples
2522 VkBool32 sparseResidency8Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 8 samples
2523 VkBool32 sparseResidency16Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 16 samples
2524 VkBool32 sparseResidencyAliased /// Sparse resources support: GPU can correctly access data aliased into multiple locations (opt-in)
Jesse Halld1af8122015-11-29 23:50:38 -08002525 VkBool32 variableMultisampleRate
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002526 VkBool32 inheritedQueries
Jesse Halld27f6aa2015-08-15 17:58:48 -07002527}
2528
2529class VkPhysicalDeviceLimits {
2530 /// resource maximum sizes
2531 u32 maxImageDimension1D /// max 1D image dimension
2532 u32 maxImageDimension2D /// max 2D image dimension
2533 u32 maxImageDimension3D /// max 3D image dimension
2534 u32 maxImageDimensionCube /// max cubemap image dimension
2535 u32 maxImageArrayLayers /// max layers for image arrays
Jesse Hallb00daad2015-11-29 19:46:20 -08002536 u32 maxTexelBufferElements
Jesse Hallfbf97b02015-11-20 14:17:03 -08002537 u32 maxUniformBufferRange /// max uniform buffer size (bytes)
2538 u32 maxStorageBufferRange /// max storage buffer size (bytes)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002539 u32 maxPushConstantsSize /// max size of the push constants pool (bytes)
2540 /// memory limits
2541 u32 maxMemoryAllocationCount /// max number of device memory allocations supported
Jesse Hall091ed9e2015-11-30 00:55:29 -08002542 u32 maxSamplerAllocationCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002543 VkDeviceSize bufferImageGranularity /// Granularity (in bytes) at which buffers and images can be bound to adjacent memory for simultaneous usage
2544 VkDeviceSize sparseAddressSpaceSize /// Total address space available for sparse allocations (bytes)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002545 /// descriptor set limits
2546 u32 maxBoundDescriptorSets /// max number of descriptors sets that can be bound to a pipeline
Jesse Halld27f6aa2015-08-15 17:58:48 -07002547 u32 maxPerStageDescriptorSamplers /// max num of samplers allowed per-stage in a descriptor set
2548 u32 maxPerStageDescriptorUniformBuffers /// max num of uniform buffers allowed per-stage in a descriptor set
2549 u32 maxPerStageDescriptorStorageBuffers /// max num of storage buffers allowed per-stage in a descriptor set
2550 u32 maxPerStageDescriptorSampledImages /// max num of sampled images allowed per-stage in a descriptor set
2551 u32 maxPerStageDescriptorStorageImages /// max num of storage images allowed per-stage in a descriptor set
Jesse Halle1b12782015-11-30 11:27:32 -08002552 u32 maxPerStageDescriptorInputAttachments
Jesse Halldba27f72015-11-30 14:25:46 -08002553 u32 maxPerStageResources
Jesse Halld27f6aa2015-08-15 17:58:48 -07002554 u32 maxDescriptorSetSamplers /// max num of samplers allowed in all stages in a descriptor set
2555 u32 maxDescriptorSetUniformBuffers /// max num of uniform buffers allowed in all stages in a descriptor set
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002556 u32 maxDescriptorSetUniformBuffersDynamic /// max num of dynamic uniform buffers allowed in all stages in a descriptor set
Jesse Halld27f6aa2015-08-15 17:58:48 -07002557 u32 maxDescriptorSetStorageBuffers /// max num of storage buffers allowed in all stages in a descriptor set
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002558 u32 maxDescriptorSetStorageBuffersDynamic /// max num of dynamic storage buffers allowed in all stages in a descriptor set
Jesse Halld27f6aa2015-08-15 17:58:48 -07002559 u32 maxDescriptorSetSampledImages /// max num of sampled images allowed in all stages in a descriptor set
2560 u32 maxDescriptorSetStorageImages /// max num of storage images allowed in all stages in a descriptor set
Jesse Halle1b12782015-11-30 11:27:32 -08002561 u32 maxDescriptorSetInputAttachments
Jesse Halld27f6aa2015-08-15 17:58:48 -07002562 /// vertex stage limits
2563 u32 maxVertexInputAttributes /// max num of vertex input attribute slots
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002564 u32 maxVertexInputBindings /// max num of vertex input binding slots
Jesse Halld27f6aa2015-08-15 17:58:48 -07002565 u32 maxVertexInputAttributeOffset /// max vertex input attribute offset added to vertex buffer offset
2566 u32 maxVertexInputBindingStride /// max vertex input binding stride
2567 u32 maxVertexOutputComponents /// max num of output components written by vertex shader
2568 /// tessellation control stage limits
Jesse Hall3fbc8562015-11-29 22:10:52 -08002569 u32 maxTessellationGenerationLevel /// max level supported by tess primitive generator
Jesse Hallae38f732015-11-19 21:32:50 -08002570 u32 maxTessellationPatchSize /// max patch size (vertices)
2571 u32 maxTessellationControlPerVertexInputComponents /// max num of input components per-vertex in TCS
2572 u32 maxTessellationControlPerVertexOutputComponents /// max num of output components per-vertex in TCS
2573 u32 maxTessellationControlPerPatchOutputComponents /// max num of output components per-patch in TCS
2574 u32 maxTessellationControlTotalOutputComponents /// max total num of per-vertex and per-patch output components in TCS
2575 u32 maxTessellationEvaluationInputComponents /// max num of input components per vertex in TES
2576 u32 maxTessellationEvaluationOutputComponents /// max num of output components per vertex in TES
Jesse Halld27f6aa2015-08-15 17:58:48 -07002577 /// geometry stage limits
2578 u32 maxGeometryShaderInvocations /// max invocation count supported in geometry shader
2579 u32 maxGeometryInputComponents /// max num of input components read in geometry stage
2580 u32 maxGeometryOutputComponents /// max num of output components written in geometry stage
2581 u32 maxGeometryOutputVertices /// max num of vertices that can be emitted in geometry stage
2582 u32 maxGeometryTotalOutputComponents /// max total num of components (all vertices) written in geometry stage
2583 /// fragment stage limits
2584 u32 maxFragmentInputComponents /// max num of input compontents read in fragment stage
Jesse Hallfbf97b02015-11-20 14:17:03 -08002585 u32 maxFragmentOutputAttachments /// max num of output attachments written in fragment stage
Jesse Hall3fbc8562015-11-29 22:10:52 -08002586 u32 maxFragmentDualSrcAttachments /// max num of output attachments written when using dual source blending
Jesse Halld27f6aa2015-08-15 17:58:48 -07002587 u32 maxFragmentCombinedOutputResources /// max total num of storage buffers, storage images and output buffers
2588 /// compute stage limits
2589 u32 maxComputeSharedMemorySize /// max total storage size of work group local storage (bytes)
2590 u32[3] maxComputeWorkGroupCount /// max num of compute work groups that may be dispatched by a single command (x,y,z)
2591 u32 maxComputeWorkGroupInvocations /// max total compute invocations in a single local work group
2592 u32[3] maxComputeWorkGroupSize /// max local size of a compute work group (x,y,z)
2593
2594 u32 subPixelPrecisionBits /// num bits of subpixel precision in screen x and y
2595 u32 subTexelPrecisionBits /// num bits of subtexel precision
2596 u32 mipmapPrecisionBits /// num bits of mipmap precision
2597
2598 u32 maxDrawIndexedIndexValue /// max index value for indexed draw calls (for 32-bit indices)
Jesse Halldba27f72015-11-30 14:25:46 -08002599 u32 maxDrawIndirectCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002600
2601 f32 maxSamplerLodBias /// max absolute sampler level of detail bias
2602 f32 maxSamplerAnisotropy /// max degree of sampler anisotropy
2603
2604 u32 maxViewports /// max number of active viewports
Jesse Halld27f6aa2015-08-15 17:58:48 -07002605 u32[2] maxViewportDimensions /// max viewport dimensions (x,y)
2606 f32[2] viewportBoundsRange /// viewport bounds range (min,max)
2607 u32 viewportSubPixelBits /// num bits of subpixel precision for viewport
2608
Jesse Halldc6d36c2015-11-29 19:12:15 -08002609 platform.size_t minMemoryMapAlignment /// min required alignment of pointers returned by MapMemory (bytes)
2610 VkDeviceSize minTexelBufferOffsetAlignment /// min required alignment for texel buffer offsets (bytes)
2611 VkDeviceSize minUniformBufferOffsetAlignment /// min required alignment for uniform buffer sizes and offsets (bytes)
2612 VkDeviceSize minStorageBufferOffsetAlignment /// min required alignment for storage buffer offsets (bytes)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002613
Jesse Hallfbf97b02015-11-20 14:17:03 -08002614 s32 minTexelOffset /// min texel offset for OpTextureSampleOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07002615 u32 maxTexelOffset /// max texel offset for OpTextureSampleOffset
Jesse Hallfbf97b02015-11-20 14:17:03 -08002616 s32 minTexelGatherOffset /// min texel offset for OpTextureGatherOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07002617 u32 maxTexelGatherOffset /// max texel offset for OpTextureGatherOffset
2618 f32 minInterpolationOffset /// furthest negative offset for interpolateAtOffset
2619 f32 maxInterpolationOffset /// furthest positive offset for interpolateAtOffset
2620 u32 subPixelInterpolationOffsetBits /// num of subpixel bits for interpolateAtOffset
2621
2622 u32 maxFramebufferWidth /// max width for a framebuffer
2623 u32 maxFramebufferHeight /// max height for a framebuffer
2624 u32 maxFramebufferLayers /// max layer count for a layered framebuffer
Jesse Hall091ed9e2015-11-30 00:55:29 -08002625 VkSampleCountFlags framebufferColorSampleCounts
2626 VkSampleCountFlags framebufferDepthSampleCounts
2627 VkSampleCountFlags framebufferStencilSampleCounts
2628 VkSampleCountFlags framebufferNoAttachmentSampleCounts
Jesse Halld27f6aa2015-08-15 17:58:48 -07002629 u32 maxColorAttachments /// max num of framebuffer color attachments
2630
Jesse Hall091ed9e2015-11-30 00:55:29 -08002631 VkSampleCountFlags sampledImageColorSampleCounts
2632 VkSampleCountFlags sampledImageIntegerSampleCounts
2633 VkSampleCountFlags sampledImageDepthSampleCounts
2634 VkSampleCountFlags sampledImageStencilSampleCounts
2635 VkSampleCountFlags storageImageSampleCounts
Jesse Halld27f6aa2015-08-15 17:58:48 -07002636 u32 maxSampleMaskWords /// max num of sample mask words
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002637 VkBool32 timestampComputeAndGraphics
Jesse Halld27f6aa2015-08-15 17:58:48 -07002638
Jesse Halla9bb62b2015-11-21 19:31:56 -08002639 f32 timestampPeriod
Jesse Halld27f6aa2015-08-15 17:58:48 -07002640
2641 u32 maxClipDistances /// max number of clip distances
2642 u32 maxCullDistances /// max number of cull distances
2643 u32 maxCombinedClipAndCullDistances /// max combined number of user clipping
2644
Jesse Hallfbf97b02015-11-20 14:17:03 -08002645 u32 discreteQueuePriorities
2646
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002647 f32[2] pointSizeRange /// range (min,max) of supported point sizes
2648 f32[2] lineWidthRange /// range (min,max) of supported line widths
Jesse Halld27f6aa2015-08-15 17:58:48 -07002649 f32 pointSizeGranularity /// granularity of supported point sizes
2650 f32 lineWidthGranularity /// granularity of supported line widths
Jesse Hall03b6fe12015-11-24 12:44:21 -08002651 VkBool32 strictLines
Jesse Hall091ed9e2015-11-30 00:55:29 -08002652 VkBool32 standardSampleLocations
Jesse Halla9bb62b2015-11-21 19:31:56 -08002653
Jesse Hall65ab5522015-11-30 00:07:16 -08002654 VkDeviceSize optimalBufferCopyOffsetAlignment
2655 VkDeviceSize optimalBufferCopyRowPitchAlignment
Jesse Halldba27f72015-11-30 14:25:46 -08002656 VkDeviceSize nonCoherentAtomSize
Jesse Halld27f6aa2015-08-15 17:58:48 -07002657}
2658
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002659class VkPhysicalDeviceSparseProperties {
2660 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 -08002661 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 -07002662 VkBool32 residencyStandard3DBlockShape /// Sparse resources support: GPU will access all 3D sparse resources using the standard block shapes (based on pixel format)
2663 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 -07002664 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
2665}
2666
Jesse Halld27f6aa2015-08-15 17:58:48 -07002667class VkSemaphoreCreateInfo {
2668 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO
2669 const void* pNext /// Pointer to next structure
2670 VkSemaphoreCreateFlags flags /// Semaphore creation flags
2671}
2672
2673class VkQueryPoolCreateInfo {
2674 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO
2675 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002676 VkQueryPoolCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002677 VkQueryType queryType
Jesse Hall3dd678a2016-01-08 21:52:01 -08002678 u32 queryCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002679 VkQueryPipelineStatisticFlags pipelineStatistics /// Optional
2680}
2681
2682class VkFramebufferCreateInfo {
2683 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO
2684 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002685 VkFramebufferCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002686 VkRenderPass renderPass
2687 u32 attachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002688 const VkImageView* pAttachments
Jesse Halld27f6aa2015-08-15 17:58:48 -07002689 u32 width
2690 u32 height
2691 u32 layers
2692}
2693
Jesse Hall3fbc8562015-11-29 22:10:52 -08002694class VkDrawIndirectCommand {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002695 u32 vertexCount
2696 u32 instanceCount
2697 u32 firstVertex
2698 u32 firstInstance
2699}
2700
Jesse Hall3fbc8562015-11-29 22:10:52 -08002701class VkDrawIndexedIndirectCommand {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002702 u32 indexCount
2703 u32 instanceCount
2704 u32 firstIndex
2705 s32 vertexOffset
2706 u32 firstInstance
2707}
2708
Jesse Hall3fbc8562015-11-29 22:10:52 -08002709class VkDispatchIndirectCommand {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002710 u32 x
2711 u32 y
2712 u32 z
2713}
2714
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002715@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08002716class VkSurfaceCapabilitiesKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002717 u32 minImageCount
2718 u32 maxImageCount
2719 VkExtent2D currentExtent
2720 VkExtent2D minImageExtent
2721 VkExtent2D maxImageExtent
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002722 u32 maxImageArrayLayers
Jesse Hall1356b0d2015-11-23 17:24:58 -08002723 VkSurfaceTransformFlagsKHR supportedTransforms
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002724 VkSurfaceTransformFlagBitsKHR currentTransform
Jesse Halla6429252015-11-29 18:59:42 -08002725 VkCompositeAlphaFlagsKHR supportedCompositeAlpha
Jesse Hall1356b0d2015-11-23 17:24:58 -08002726 VkImageUsageFlags supportedUsageFlags
Michael Lentine88594d72015-11-12 12:49:45 -08002727}
2728
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002729@extension("VK_KHR_surface")
Michael Lentine88594d72015-11-12 12:49:45 -08002730class VkSurfaceFormatKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002731 VkFormat format
2732 VkColorSpaceKHR colorSpace
Michael Lentine88594d72015-11-12 12:49:45 -08002733}
2734
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002735@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08002736class VkSwapchainCreateInfoKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002737 VkStructureType sType
2738 const void* pNext
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002739 VkSwapchainCreateFlagsKHR flags
Jesse Hall1356b0d2015-11-23 17:24:58 -08002740 VkSurfaceKHR surface
2741 u32 minImageCount
2742 VkFormat imageFormat
2743 VkColorSpaceKHR imageColorSpace
2744 VkExtent2D imageExtent
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002745 u32 imageArrayLayers
2746 VkImageUsageFlags imageUsage
Jesse Hall1356b0d2015-11-23 17:24:58 -08002747 VkSharingMode sharingMode
Jesse Hall03b6fe12015-11-24 12:44:21 -08002748 u32 queueFamilyIndexCount
Jesse Hall1356b0d2015-11-23 17:24:58 -08002749 const u32* pQueueFamilyIndices
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002750 VkSurfaceTransformFlagBitsKHR preTransform
2751 VkCompositeAlphaFlagBitsKHR compositeAlpha
Jesse Hall1356b0d2015-11-23 17:24:58 -08002752 VkPresentModeKHR presentMode
Jesse Hall1356b0d2015-11-23 17:24:58 -08002753 VkBool32 clipped
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002754 VkSwapchainKHR oldSwapchain
Michael Lentine88594d72015-11-12 12:49:45 -08002755}
2756
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002757@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08002758class VkPresentInfoKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002759 VkStructureType sType
2760 const void* pNext
Jesse Hallb00daad2015-11-29 19:46:20 -08002761 u32 waitSemaphoreCount
2762 const VkSemaphore* pWaitSemaphores
Jesse Hall1356b0d2015-11-23 17:24:58 -08002763 u32 swapchainCount
Jesse Hall03b6fe12015-11-24 12:44:21 -08002764 const VkSwapchainKHR* pSwapchains
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002765 const u32* pImageIndices
Jesse Halle1b12782015-11-30 11:27:32 -08002766 VkResult* pResults
Michael Lentine88594d72015-11-12 12:49:45 -08002767}
2768
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002769@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002770class VkDisplayPropertiesKHR {
2771 VkDisplayKHR display
2772 const char* displayName
2773 VkExtent2D physicalDimensions
2774 VkExtent2D physicalResolution
2775 VkSurfaceTransformFlagsKHR supportedTransforms
Jesse Hall1356b0d2015-11-23 17:24:58 -08002776 VkBool32 planeReorderPossible
Jesse Halla6429252015-11-29 18:59:42 -08002777 VkBool32 persistentContent
Michael Lentine88594d72015-11-12 12:49:45 -08002778}
2779
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002780@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08002781class VkDisplayModeParametersKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002782 VkExtent2D visibleRegion
Jesse Halla6429252015-11-29 18:59:42 -08002783 u32 refreshRate
Michael Lentine88594d72015-11-12 12:49:45 -08002784}
Jesse Halld27f6aa2015-08-15 17:58:48 -07002785
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002786@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002787class VkDisplayModePropertiesKHR {
2788 VkDisplayModeKHR displayMode
Jesse Halla6429252015-11-29 18:59:42 -08002789 VkDisplayModeParametersKHR parameters
Jesse Hall1356b0d2015-11-23 17:24:58 -08002790}
2791
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002792@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002793class VkDisplayModeCreateInfoKHR {
2794 VkStructureType sType
2795 const void* pNext
Jesse Hall9ba8bc82015-11-30 16:22:16 -08002796 VkDisplayModeCreateFlagsKHR flags
Jesse Halla6429252015-11-29 18:59:42 -08002797 VkDisplayModeParametersKHR parameters
Jesse Hall1356b0d2015-11-23 17:24:58 -08002798}
2799
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002800@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002801class VkDisplayPlanePropertiesKHR {
Jesse Halla6429252015-11-29 18:59:42 -08002802 VkDisplayKHR currentDisplay
2803 u32 currentStackIndex
2804}
2805
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002806@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08002807class VkDisplayPlaneCapabilitiesKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002808 VkDisplayPlaneAlphaFlagsKHR supportedAlpha
2809 VkOffset2D minSrcPosition
2810 VkOffset2D maxSrcPosition
2811 VkExtent2D minSrcExtent
2812 VkExtent2D maxSrcExtent
2813 VkOffset2D minDstPosition
2814 VkOffset2D maxDstPosition
2815 VkExtent2D minDstExtent
2816 VkExtent2D maxDstExtent
2817}
2818
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002819@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08002820class VkDisplaySurfaceCreateInfoKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002821 VkStructureType sType
2822 const void* pNext
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002823 VkDisplaySurfaceCreateFlagsKHR flags
Jesse Hall1356b0d2015-11-23 17:24:58 -08002824 VkDisplayModeKHR displayMode
2825 u32 planeIndex
2826 u32 planeStackIndex
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002827 VkSurfaceTransformFlagBitsKHR transform
Jesse Hall1356b0d2015-11-23 17:24:58 -08002828 f32 globalAlpha
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002829 VkDisplayPlaneAlphaFlagBitsKHR alphaMode
2830 VkExtent2D imageExtent
Jesse Hall1356b0d2015-11-23 17:24:58 -08002831}
2832
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002833@extension("VK_KHR_display_swapchain")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002834class VkDisplayPresentInfoKHR {
2835 VkStructureType sType
2836 const void* pNext
2837 VkRect2D srcRect
2838 VkRect2D dstRect
Jesse Halla6429252015-11-29 18:59:42 -08002839 VkBool32 persistent
Jesse Hall1356b0d2015-11-23 17:24:58 -08002840}
2841
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002842@extension("VK_KHR_xlib_surface")
2843class VkXlibSurfaceCreateInfoKHR {
2844 VkStructureType sType
2845 const void* pNext
2846 VkXlibSurfaceCreateFlagsKHR flags
2847 platform.Display* dpy
2848 platform.Window window
2849}
2850
2851@extension("VK_KHR_xcb_surface")
2852class VkXcbSurfaceCreateInfoKHR {
2853 VkStructureType sType
2854 const void* pNext
2855 VkXcbSurfaceCreateFlagsKHR flags
2856 platform.xcb_connection_t* connection
2857 platform.xcb_window_t window
2858}
2859
2860@extension("VK_KHR_wayland_surface")
2861class VkWaylandSurfaceCreateInfoKHR {
2862 VkStructureType sType
2863 const void* pNext
2864 VkWaylandSurfaceCreateFlagsKHR flags
2865 platform.wl_display* display
2866 platform.wl_surface* surface
2867}
2868
2869@extension("VK_KHR_mir_surface")
2870class VkMirSurfaceCreateInfoKHR {
2871 VkStructureType sType
2872 const void* pNext
2873 VkMirSurfaceCreateFlagsKHR flags
2874 platform.MirConnection* connection
2875 platform.MirSurface* mirSurface
2876}
2877
2878@extension("VK_KHR_android_surface")
2879class VkAndroidSurfaceCreateInfoKHR {
2880 VkStructureType sType
2881 const void* pNext
2882 VkAndroidSurfaceCreateFlagsKHR flags
2883 platform.ANativeWindow* window
2884}
2885
2886@extension("VK_KHR_win32_surface")
2887class VkWin32SurfaceCreateInfoKHR {
2888 VkStructureType sType
2889 const void* pNext
2890 VkWin32SurfaceCreateFlagsKHR flags
2891 platform.HINSTANCE hinstance
2892 platform.HWND hwnd
2893}
2894
Jesse Halld1abd742017-02-09 21:45:51 -08002895@internal class Gralloc1Usage {
2896 u64 consumer
2897 u64 producer
2898}
2899
Chia-I Wub262ddc2016-03-22 07:38:20 +08002900@extension("VK_ANDROID_native_buffer")
2901class VkNativeBufferANDROID {
2902 VkStructureType sType
2903 const void* pNext
2904 platform.buffer_handle_t handle
Jesse Halld1abd742017-02-09 21:45:51 -08002905 s32 stride
2906 s32 format
2907 s32 usage
2908 Gralloc1Usage usage2
Chia-I Wub262ddc2016-03-22 07:38:20 +08002909}
2910
Chris Forbes8e4438b2016-12-07 16:26:49 +13002911@extension("VK_ANDROID_native_buffer")
2912class VkSwapchainImageCreateInfoANDROID {
2913 VkStructureType sType
2914 const void* pNext
Chris Forbes134d9582017-01-12 14:26:37 +13002915 VkSwapchainImageUsageFlagsANDROID flags
Chris Forbes48853712017-01-12 14:09:33 +13002916}
Ian Elliott4c8bb2a2016-12-29 11:07:26 -07002917
Chris Forbes1d4e5542017-02-15 19:38:50 +13002918@extension("VK_ANDROID_native_buffer")
2919class VkPhysicalDevicePresentationPropertiesANDROID {
2920 VkStructureType sType
2921 void* pNext
2922 VkBool32 sharedImage
2923}
2924
Ian Elliott4c8bb2a2016-12-29 11:07:26 -07002925@extension("VK_GOOGLE_display_timing")
2926class VkRefreshCycleDurationGOOGLE {
Chris Forbes48853712017-01-12 14:09:33 +13002927 u64 minRefreshDuration
2928 u64 maxRefreshDuration
Ian Elliott4c8bb2a2016-12-29 11:07:26 -07002929}
2930
2931@extension("VK_GOOGLE_display_timing")
2932class VkPastPresentationTimingGOOGLE {
Chris Forbes48853712017-01-12 14:09:33 +13002933 u32 presentID
2934 u64 desiredPresentTime
2935 u64 actualPresentTime
2936 u64 earliestPresentTime
2937 u64 presentMargin
Ian Elliott4c8bb2a2016-12-29 11:07:26 -07002938}
2939
2940@extension("VK_GOOGLE_display_timing")
2941class VkPresentTimeGOOGLE {
Chris Forbes48853712017-01-12 14:09:33 +13002942 u32 presentID
2943 u64 desiredPresentTime
Ian Elliott4c8bb2a2016-12-29 11:07:26 -07002944}
2945
2946@extension("VK_GOOGLE_display_timing")
2947class VkPresentTimesInfoGOOGLE {
2948 VkStructureType sType
2949 const void* pNext
Chris Forbes48853712017-01-12 14:09:33 +13002950 u32 swapchainCount
Ian Elliott4c8bb2a2016-12-29 11:07:26 -07002951 const VkPresentTimeGOOGLE* pTimes
Chris Forbes8e4438b2016-12-07 16:26:49 +13002952}
2953
Jesse Hall715b86a2016-01-16 16:34:29 -08002954@extension("VK_EXT_debug_report")
2955class VkDebugReportCallbackCreateInfoEXT {
2956 VkStructureType sType
2957 const void* pNext
2958 VkDebugReportFlagsEXT flags
2959 PFN_vkDebugReportCallbackEXT pfnCallback
2960 void* pUserData
2961}
2962
Jesse Hall26763382016-05-20 07:13:52 -07002963@extension("VK_AMD_rasterization_order")
2964class VkPipelineRasterizationStateRasterizationOrderAMD {
2965 VkStructureType sType
2966 const void* pNext
2967 VkRasterizationOrderAMD rasterizationOrder
2968}
2969
2970@extension("VK_EXT_debug_marker")
2971class VkDebugMarkerObjectNameInfoEXT {
2972 VkStructureType sType
2973 const void* pNext
2974 VkDebugReportObjectTypeEXT objectType
2975 u64 object
2976 const char* pObjectName
2977}
2978
2979@extension("VK_EXT_debug_marker")
2980class VkDebugMarkerObjectTagInfoEXT {
2981 VkStructureType sType
2982 const void* pNext
2983 VkDebugReportObjectTypeEXT objectType
2984 u64 object
2985 u64 tagName
2986 platform.size_t tagSize
2987 const void* pTag
2988}
2989
2990@extension("VK_EXT_debug_marker")
2991class VkDebugMarkerMarkerInfoEXT {
2992 VkStructureType sType
2993 const void* pNext
2994 const char* pMarkerName
2995 f32[4] color
2996}
2997
Jesse Hall56d386a2016-07-26 15:20:40 -07002998@extension("VK_NV_dedicated_allocation")
2999class VkDedicatedAllocationImageCreateInfoNV {
3000 VkStructureType sType
3001 const void* pNext
3002 VkBool32 dedicatedAllocation
3003}
3004
3005@extension("VK_NV_dedicated_allocation")
3006class VkDedicatedAllocationBufferCreateInfoNV {
3007 VkStructureType sType
3008 const void* pNext
3009 VkBool32 dedicatedAllocation
3010}
3011
3012@extension("VK_NV_dedicated_allocation")
3013class VkDedicatedAllocationMemoryAllocateInfoNV {
3014 VkStructureType sType
3015 const void* pNext
3016 VkImage image
3017 VkBuffer buffer
3018}
3019
Jesse Halleb02c472017-02-24 15:13:45 -08003020@extension("VK_NV_external_memory_capabilities")
3021class VkExternalImageFormatPropertiesNV {
3022 VkImageFormatProperties imageFormatProperties
3023 VkExternalMemoryFeatureFlagsNV externalMemoryFeatures
3024 VkExternalMemoryHandleTypeFlagsNV exportFromImportedHandleTypes
3025 VkExternalMemoryHandleTypeFlagsNV compatibleHandleTypes
3026}
3027
3028@extension("VK_NV_external_memory")
3029class VkExternalMemoryImageCreateInfoNV {
3030 VkStructureType sType
3031 const void* pNext
3032 VkExternalMemoryHandleTypeFlagsNV handleTypes
3033}
3034
3035@extension("VK_NV_external_memory")
3036class VkExportMemoryAllocateInfoNV {
3037 VkStructureType sType
3038 const void* pNext
3039 VkExternalMemoryHandleTypeFlagsNV handleTypes
3040}
3041
3042@extension("VK_NV_external_memory_win32")
3043class VkImportMemoryWin32HandleInfoNV {
3044 VkStructureType sType
3045 const void* pNext
3046 VkExternalMemoryHandleTypeFlagsNV handleType
3047 platform.HANDLE handle
3048}
3049
3050@extension("VK_NV_external_memory_win32")
3051class VkExportMemoryWin32HandleInfoNV {
3052 VkStructureType sType
3053 const void* pNext
3054 const platform.SECURITY_ATTRIBUTES* pAttributes
3055 platform.DWORD dwAccess
3056}
3057
3058@extension("VK_NV_win32_keyed_mutex")
3059class VkWin32KeyedMutexAcquireReleaseInfoNV {
3060 VkStructureType sType
3061 const void* pNext
3062 u32 acquireCount
3063 const VkDeviceMemory* pAcquireSyncs
3064 const u64* pAcquireKeys
3065 const u32* pAcquireTimeoutMilliseconds
3066 u32 releaseCount
3067 const VkDeviceMemory* pReleaseSyncs
3068 const u64* pReleaseKeys
3069}
3070
Chris Forbes1194ede2016-12-30 16:29:25 +13003071@extension("VK_KHR_get_physical_device_properties2")
3072class VkPhysicalDeviceFeatures2KHR {
3073 VkStructureType sType
3074 void* pNext
3075 VkPhysicalDeviceFeatures features
3076}
3077
3078@extension("VK_KHR_get_physical_device_properties2")
3079class VkPhysicalDeviceProperties2KHR {
3080 VkStructureType sType
3081 void* pNext
3082 VkPhysicalDeviceProperties properties
3083}
3084
3085@extension("VK_KHR_get_physical_device_properties2")
3086class VkFormatProperties2KHR {
3087 VkStructureType sType
3088 void* pNext
3089 VkFormatProperties formatProperties
3090}
3091
3092@extension("VK_KHR_get_physical_device_properties2")
3093class VkImageFormatProperties2KHR {
3094 VkStructureType sType
3095 void* pNext
3096 VkImageFormatProperties imageFormatProperties
3097}
3098
3099@extension("VK_KHR_get_physical_device_properties2")
3100class VkPhysicalDeviceImageFormatInfo2KHR {
3101 VkStructureType sType
3102 const void* pNext
3103 VkFormat format
3104 VkImageType type
3105 VkImageTiling tiling
3106 VkImageUsageFlags usage
3107 VkImageCreateFlags flags
3108}
3109
3110@extension("VK_KHR_get_physical_device_properties2")
3111class VkQueueFamilyProperties2KHR {
3112 VkStructureType sType
3113 void* pNext
3114 VkQueueFamilyProperties queueFamilyProperties
3115}
3116
3117@extension("VK_KHR_get_physical_device_properties2")
3118class VkPhysicalDeviceMemoryProperties2KHR {
3119 VkStructureType sType
3120 void* pNext
3121 VkPhysicalDeviceMemoryProperties memoryProperties
3122}
3123
3124@extension("VK_KHR_get_physical_device_properties2")
3125class VkSparseImageFormatProperties2KHR {
3126 VkStructureType sType
3127 void* pNext
3128 VkSparseImageFormatProperties properties
3129}
3130
3131@extension("VK_KHR_get_physical_device_properties2")
3132class VkPhysicalDeviceSparseImageFormatInfo2KHR {
3133 VkStructureType sType
3134 const void* pNext
3135 VkFormat format
3136 VkImageType type
3137 VkSampleCountFlagBits samples
3138 VkImageUsageFlags usage
3139 VkImageTiling tiling
3140}
3141
Chris Forbes289cb792016-12-30 15:03:55 +13003142@extension("VK_EXT_validation_flags")
3143class VkValidationFlagsEXT {
3144 VkStructureType sType
3145 const void* pNext
3146 u32 disabledValidationCheckCount
3147 VkValidationCheckEXT* pDisabledValidationChecks
3148}
3149
3150@extension("VK_NVX_device_generated_commands")
3151class VkDeviceGeneratedCommandsFeaturesNVX {
3152 VkStructureType sType
3153 const void* pNext
3154 VkBool32 computeBindingPointSupport
3155}
3156
3157@extension("VK_NVX_device_generated_commands")
3158class VkDeviceGeneratedCommandsLimitsNVX {
3159 VkStructureType sType
3160 const void* pNext
3161 u32 maxIndirectCommandsLayoutTokenCount
3162 u32 maxObjectEntryCounts
3163 u32 minSequenceCountBufferOffsetAlignment
3164 u32 minSequenceIndexBufferOffsetAlignment
3165 u32 minCommandsTokenBufferOffsetAlignment
3166}
3167
3168@extension("VK_NVX_device_generated_commands")
3169class VkIndirectCommandsTokenNVX {
3170 VkIndirectCommandsTokenTypeNVX tokenType
3171 VkBuffer buffer
3172 VkDeviceSize offset
3173}
3174
3175@extension("VK_NVX_device_generated_commands")
3176class VkIndirectCommandsLayoutTokenNVX {
3177 VkIndirectCommandsTokenTypeNVX tokenType
3178 u32 bindingUnit
3179 u32 dynamicCount
3180 u32 divisor
3181}
3182
3183@extension("VK_NVX_device_generated_commands")
3184class VkIndirectCommandsLayoutCreateInfoNVX {
3185 VkStructureType sType
3186 const void* pNext
3187 VkPipelineBindPoint pipelineBindPoint
3188 VkIndirectCommandsLayoutUsageFlagsNVX flags
3189 u32 tokenCount
3190 const VkIndirectCommandsLayoutTokenNVX* pTokens
3191}
3192
3193@extension("VK_NVX_device_generated_commands")
3194class VkCmdProcessCommandsInfoNVX {
3195 VkStructureType sType
3196 const void* pNext
3197 VkObjectTableNVX objectTable
3198 VkIndirectCommandsLayoutNVX indirectCommandsLayout
3199 u32 indirectCommandsTokenCount
3200 const VkIndirectCommandsTokenNVX* pIndirectCommandsTokens
3201 u32 maxSequencesCount
3202 VkCommandBuffer targetCommandBuffer
3203 VkBuffer sequencesCountBuffer
3204 VkDeviceSize sequencesCountOffset
3205 VkBuffer sequencesIndexBuffer
3206 VkDeviceSize sequencesIndexOffset
3207}
3208
3209@extension("VK_NVX_device_generated_commands")
3210class VkCmdReserveSpaceForCommandsInfoNVX {
3211 VkStructureType sType
3212 const void* pNext
3213 VkObjectTableNVX objectTable
3214 VkIndirectCommandsLayoutNVX indirectCommandsLayout
3215 u32 maxSequencesCount
3216}
3217
3218@extension("VK_NVX_device_generated_commands")
3219class VkObjectTableCreateInfoNVX {
3220 VkStructureType sType
3221 const void* pNext
3222 u32 objectCount
3223 const VkObjectEntryTypeNVX* pObjectEntryTypes
3224 const u32* pObjectEntryCounts
3225 const VkObjectEntryUsageFlagsNVX* pObjectEntryUsageFlags
3226 u32 maxUniformBuffersPerDescriptor
3227 u32 maxStorageBuffersPerDescriptor
3228 u32 maxStorageImagesPerDescriptor
3229 u32 maxSampledImagesPerDescriptor
3230 u32 maxPipelineLayouts
3231}
3232
3233@extension("VK_NVX_device_generated_commands")
3234class VkObjectTableEntryNVX {
3235 VkObjectEntryTypeNVX type
3236 VkObjectEntryUsageFlagsNVX flags
3237}
3238
3239@extension("VK_NVX_device_generated_commands")
3240class VkObjectTablePipelineEntryNVX {
3241 VkObjectEntryTypeNVX type
3242 VkObjectEntryUsageFlagsNVX flags
3243 VkPipeline pipeline
3244}
3245
3246@extension("VK_NVX_device_generated_commands")
3247class VkObjectTableDescriptorSetEntryNVX {
3248 VkObjectEntryTypeNVX type
3249 VkObjectEntryUsageFlagsNVX flags
3250 VkPipelineLayout pipelineLayout
3251 VkDescriptorSet descriptorSet
3252}
3253
3254@extension("VK_NVX_device_generated_commands")
3255class VkObjectTableVertexBufferEntryNVX {
3256 VkObjectEntryTypeNVX type
3257 VkObjectEntryUsageFlagsNVX flags
3258 VkBuffer buffer
3259}
3260
3261@extension("VK_NVX_device_generated_commands")
3262class VkObjectTableIndexBufferEntryNVX {
3263 VkObjectEntryTypeNVX type
3264 VkObjectEntryUsageFlagsNVX flags
3265 VkBuffer buffer
3266}
3267
3268@extension("VK_NVX_device_generated_commands")
3269class VkObjectTablePushConstantEntryNVX {
3270 VkObjectEntryTypeNVX type
3271 VkObjectEntryUsageFlagsNVX flags
3272 VkPipelineLayout pipelineLayout
3273 VkShaderStageFlags stageFlags
3274}
3275
Jesse Hall889cd9a2017-02-25 22:12:23 -08003276@extension("VK_KHR_incremental_present")
3277class VkRectLayerKHR {
3278 VkOffset2D offset
3279 VkExtent2D extent
3280 u32 layer
3281}
3282
3283@extension("VK_KHR_incremental_present")
3284class VkPresentRegionKHR {
3285 u32 rectangleCount
3286 const VkRectLayerKHR* pRectangles
3287}
3288
3289@extension("VK_KHR_incremental_present")
3290class VkPresentRegionsKHR {
3291 VkStructureType sType
3292 const void* pNext
3293 u32 swapchainCount
3294 const VkPresentRegionKHR* pRegions
3295}
3296
Courtney Goeltzenleuchterd634c482017-01-05 15:55:31 -07003297@extension("VK_EXT_hdr_metadata")
3298class VkXYColorEXT {
3299 f32 x
3300 f32 y
3301}
3302
3303@extension("VK_EXT_hdr_metadata")
3304class VkHdrMetadataEXT {
3305 VkXYColorEXT displayPrimaryRed
3306 VkXYColorEXT displayPrimaryGreen
3307 VkXYColorEXT displayPrimaryBlue
3308 VkXYColorEXT whitePoint
3309 f32 maxLuminance
3310 f32 minLuminance
3311 f32 maxContentLightLevel
3312 f32 maxFrameAverageLightLevel
3313}
3314
Jesse Halld27f6aa2015-08-15 17:58:48 -07003315////////////////
3316// Commands //
3317////////////////
3318
3319// Function pointers. TODO: add support for function pointers.
3320
3321@external type void* PFN_vkVoidFunction
3322@pfn cmd void vkVoidFunction() {
3323}
3324
Jesse Hall3fbc8562015-11-29 22:10:52 -08003325@external type void* PFN_vkAllocationFunction
3326@pfn cmd void* vkAllocationFunction(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003327 void* pUserData,
3328 platform.size_t size,
3329 platform.size_t alignment,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003330 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08003331 return ?
3332}
3333
Jesse Hall3fbc8562015-11-29 22:10:52 -08003334@external type void* PFN_vkReallocationFunction
3335@pfn cmd void* vkReallocationFunction(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003336 void* pUserData,
3337 void* pOriginal,
3338 platform.size_t size,
3339 platform.size_t alignment,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003340 VkSystemAllocationScope allocationScope) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003341 return ?
3342}
3343
3344@external type void* PFN_vkFreeFunction
3345@pfn cmd void vkFreeFunction(
3346 void* pUserData,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003347 void* pMemory) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003348}
3349
Jesse Hall3fbc8562015-11-29 22:10:52 -08003350@external type void* PFN_vkInternalAllocationNotification
3351@pfn cmd void vkInternalAllocationNotification(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003352 void* pUserData,
3353 platform.size_t size,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003354 VkInternalAllocationType allocationType,
3355 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08003356}
3357
3358@external type void* PFN_vkInternalFreeNotification
3359@pfn cmd void vkInternalFreeNotification(
3360 void* pUserData,
3361 platform.size_t size,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003362 VkInternalAllocationType allocationType,
3363 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08003364}
Jesse Halld27f6aa2015-08-15 17:58:48 -07003365
3366// Global functions
3367
3368@threadSafety("system")
3369cmd VkResult vkCreateInstance(
3370 const VkInstanceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003371 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003372 VkInstance* pInstance) {
3373 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO)
3374
3375 instance := ?
3376 pInstance[0] = instance
3377 State.Instances[instance] = new!InstanceObject()
3378
Jesse Hall3dd678a2016-01-08 21:52:01 -08003379 layers := pCreateInfo.ppEnabledLayerNames[0:pCreateInfo.enabledLayerCount]
3380 extensions := pCreateInfo.ppEnabledExtensionNames[0:pCreateInfo.enabledExtensionCount]
Jesse Halld27f6aa2015-08-15 17:58:48 -07003381
3382 return ?
3383}
3384
3385@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003386cmd void vkDestroyInstance(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003387 VkInstance instance,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003388 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003389 instanceObject := GetInstance(instance)
3390
3391 State.Instances[instance] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003392}
3393
3394@threadSafety("system")
3395cmd VkResult vkEnumeratePhysicalDevices(
3396 VkInstance instance,
3397 u32* pPhysicalDeviceCount,
3398 VkPhysicalDevice* pPhysicalDevices) {
3399 instanceObject := GetInstance(instance)
3400
3401 physicalDeviceCount := as!u32(?)
3402 pPhysicalDeviceCount[0] = physicalDeviceCount
3403 physicalDevices := pPhysicalDevices[0:physicalDeviceCount]
3404
3405 for i in (0 .. physicalDeviceCount) {
3406 physicalDevice := ?
3407 physicalDevices[i] = physicalDevice
3408 if !(physicalDevice in State.PhysicalDevices) {
3409 State.PhysicalDevices[physicalDevice] = new!PhysicalDeviceObject(instance: instance)
3410 }
3411 }
3412
3413 return ?
3414}
3415
3416cmd PFN_vkVoidFunction vkGetDeviceProcAddr(
3417 VkDevice device,
3418 const char* pName) {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003419 if device != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003420 device := GetDevice(device)
3421 }
3422
3423 return ?
3424}
3425
3426cmd PFN_vkVoidFunction vkGetInstanceProcAddr(
3427 VkInstance instance,
3428 const char* pName) {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003429 if instance != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003430 instanceObject := GetInstance(instance)
3431 }
3432
3433 return ?
3434}
3435
Jesse Hall606a54e2015-11-19 22:17:28 -08003436cmd void vkGetPhysicalDeviceProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003437 VkPhysicalDevice physicalDevice,
3438 VkPhysicalDeviceProperties* pProperties) {
3439 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3440
3441 properties := ?
3442 pProperties[0] = properties
Jesse Halld27f6aa2015-08-15 17:58:48 -07003443}
3444
Jesse Hall606a54e2015-11-19 22:17:28 -08003445cmd void vkGetPhysicalDeviceQueueFamilyProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003446 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003447 u32* pQueueFamilyPropertyCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003448 VkQueueFamilyProperties* pQueueFamilyProperties) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003449 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003450 // TODO: Figure out how to express fetch-count-or-properties
3451 // This version fails 'apic validate' with 'fence not allowed in
3452 // *semantic.Branch'. Other attempts have failed with the same or other
3453 // errors.
3454 // if pQueueFamilyProperties != null {
3455 // queuesProperties := pQueueFamilyProperties[0:pCount[0]]
3456 // for i in (0 .. pCount[0]) {
3457 // queueProperties := as!VkQueueFamilyProperties(?)
3458 // queuesProperties[i] = queueProperties
3459 // }
3460 // } else {
3461 // count := ?
3462 // pCount[0] = count
3463 // }
Jesse Halld27f6aa2015-08-15 17:58:48 -07003464}
3465
Jesse Hall606a54e2015-11-19 22:17:28 -08003466cmd void vkGetPhysicalDeviceMemoryProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003467 VkPhysicalDevice physicalDevice,
3468 VkPhysicalDeviceMemoryProperties* pMemoryProperties) {
3469 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3470
3471 memoryProperties := ?
3472 pMemoryProperties[0] = memoryProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07003473}
3474
Jesse Hall606a54e2015-11-19 22:17:28 -08003475cmd void vkGetPhysicalDeviceFeatures(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003476 VkPhysicalDevice physicalDevice,
3477 VkPhysicalDeviceFeatures* pFeatures) {
3478 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3479
3480 features := ?
3481 pFeatures[0] = features
Jesse Halld27f6aa2015-08-15 17:58:48 -07003482}
3483
Jesse Hall606a54e2015-11-19 22:17:28 -08003484cmd void vkGetPhysicalDeviceFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003485 VkPhysicalDevice physicalDevice,
3486 VkFormat format,
3487 VkFormatProperties* pFormatProperties) {
3488 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3489
3490 formatProperties := ?
3491 pFormatProperties[0] = formatProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07003492}
3493
Jesse Halla9e57032015-11-30 01:03:10 -08003494cmd VkResult vkGetPhysicalDeviceImageFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003495 VkPhysicalDevice physicalDevice,
3496 VkFormat format,
3497 VkImageType type,
3498 VkImageTiling tiling,
3499 VkImageUsageFlags usage,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003500 VkImageCreateFlags flags,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003501 VkImageFormatProperties* pImageFormatProperties) {
3502 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3503
3504 imageFormatProperties := ?
3505 pImageFormatProperties[0] = imageFormatProperties
Jesse Halla9e57032015-11-30 01:03:10 -08003506
3507 return ?
Jesse Halld27f6aa2015-08-15 17:58:48 -07003508}
3509
Jesse Halld27f6aa2015-08-15 17:58:48 -07003510
3511// Device functions
3512
3513@threadSafety("system")
3514cmd VkResult vkCreateDevice(
3515 VkPhysicalDevice physicalDevice,
3516 const VkDeviceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003517 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003518 VkDevice* pDevice) {
3519 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO)
3520 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3521
3522 device := ?
3523 pDevice[0] = device
3524 State.Devices[device] = new!DeviceObject(physicalDevice: physicalDevice)
3525
3526 return ?
3527}
3528
3529@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003530cmd void vkDestroyDevice(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003531 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003532 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003533 deviceObject := GetDevice(device)
3534
3535 State.Devices[device] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003536}
3537
3538
3539// Extension discovery functions
3540
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003541cmd VkResult vkEnumerateInstanceLayerProperties(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003542 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003543 VkLayerProperties* pProperties) {
3544 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08003545 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07003546
3547 properties := pProperties[0:count]
3548 for i in (0 .. count) {
3549 property := ?
3550 properties[i] = property
3551 }
3552
3553 return ?
3554}
3555
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003556cmd VkResult vkEnumerateInstanceExtensionProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003557 const char* pLayerName,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003558 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003559 VkExtensionProperties* pProperties) {
3560 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08003561 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07003562
3563 properties := pProperties[0:count]
3564 for i in (0 .. count) {
3565 property := ?
3566 properties[i] = property
3567 }
3568
3569 return ?
3570}
3571
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003572cmd VkResult vkEnumerateDeviceLayerProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003573 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003574 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003575 VkLayerProperties* pProperties) {
3576 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3577 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08003578 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07003579
3580 properties := pProperties[0:count]
3581 for i in (0 .. count) {
3582 property := ?
3583 properties[i] = property
3584 }
3585
3586 return ?
3587}
3588
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003589cmd VkResult vkEnumerateDeviceExtensionProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003590 VkPhysicalDevice physicalDevice,
3591 const char* pLayerName,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003592 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003593 VkExtensionProperties* pProperties) {
3594 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3595
3596 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08003597 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07003598
3599 properties := pProperties[0:count]
3600 for i in (0 .. count) {
3601 property := ?
3602 properties[i] = property
3603 }
3604
3605 return ?
3606}
3607
3608
3609// Queue functions
3610
3611@threadSafety("system")
Jesse Hall606a54e2015-11-19 22:17:28 -08003612cmd void vkGetDeviceQueue(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003613 VkDevice device,
3614 u32 queueFamilyIndex,
3615 u32 queueIndex,
3616 VkQueue* pQueue) {
3617 deviceObject := GetDevice(device)
3618
3619 queue := ?
3620 pQueue[0] = queue
3621
3622 if !(queue in State.Queues) {
3623 State.Queues[queue] = new!QueueObject(device: device)
3624 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07003625}
3626
3627@threadSafety("app")
3628cmd VkResult vkQueueSubmit(
3629 VkQueue queue,
Jesse Halla366a512015-11-19 22:30:07 -08003630 u32 submitCount,
Jesse Hallb00daad2015-11-29 19:46:20 -08003631 const VkSubmitInfo* pSubmits,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003632 VkFence fence) {
3633 queueObject := GetQueue(queue)
3634
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003635 if fence != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003636 fenceObject := GetFence(fence)
3637 assert(fenceObject.device == queueObject.device)
3638 }
3639
Jesse Hall3fbc8562015-11-29 22:10:52 -08003640 // commandBuffers := pcommandBuffers[0:commandBufferCount]
3641 // for i in (0 .. commandBufferCount) {
3642 // commandBuffer := commandBuffers[i]
3643 // commandBufferObject := GetCommandBuffer(commandBuffer)
3644 // assert(commandBufferObject.device == queueObject.device)
Jesse Halla366a512015-11-19 22:30:07 -08003645 //
Jesse Hall3fbc8562015-11-29 22:10:52 -08003646 // validate("QueueCheck", commandBufferObject.queueFlags in queueObject.flags,
3647 // "vkQueueSubmit: enqueued commandBuffer requires missing queue capabilities.")
Jesse Halla366a512015-11-19 22:30:07 -08003648 // }
Jesse Halld27f6aa2015-08-15 17:58:48 -07003649
3650 return ?
3651}
3652
3653@threadSafety("system")
3654cmd VkResult vkQueueWaitIdle(
3655 VkQueue queue) {
3656 queueObject := GetQueue(queue)
3657
3658 return ?
3659}
3660
3661@threadSafety("system")
3662cmd VkResult vkDeviceWaitIdle(
3663 VkDevice device) {
3664 deviceObject := GetDevice(device)
3665
3666 return ?
3667}
3668
3669
3670// Memory functions
3671
3672@threadSafety("system")
Jesse Hall3fbc8562015-11-29 22:10:52 -08003673cmd VkResult vkAllocateMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003674 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003675 const VkMemoryAllocateInfo* pAllocateInfo,
3676 const VkAllocationCallbacks* pAllocator,
3677 VkDeviceMemory* pMemory) {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08003678 assert(pAllocateInfo.sType == VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003679 deviceObject := GetDevice(device)
3680
Jesse Hall3fbc8562015-11-29 22:10:52 -08003681 memory := ?
3682 pMemory[0] = memory
3683 State.DeviceMemories[memory] = new!DeviceMemoryObject(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003684 device: device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003685 allocationSize: pAllocateInfo[0].allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003686
3687 return ?
3688}
3689
3690@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003691cmd void vkFreeMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003692 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003693 VkDeviceMemory memory,
3694 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003695 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003696 memoryObject := GetDeviceMemory(memory)
3697 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003698
3699 // Check that no objects are still bound before freeing.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003700 validate("MemoryCheck", len(memoryObject.boundObjects) == 0,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003701 "vkFreeMemory: objects still bound")
Jesse Hall3fbc8562015-11-29 22:10:52 -08003702 validate("MemoryCheck", len(memoryObject.boundCommandBuffers) == 0,
3703 "vkFreeMemory: commandBuffers still bound")
3704 State.DeviceMemories[memory] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003705}
3706
3707@threadSafety("app")
3708cmd VkResult vkMapMemory(
3709 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003710 VkDeviceMemory memory,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003711 VkDeviceSize offset,
3712 VkDeviceSize size,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003713 VkMemoryMapFlags flags,
3714 void** ppData) {
3715 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003716 memoryObject := GetDeviceMemory(memory)
3717 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003718
3719 assert(flags == as!VkMemoryMapFlags(0))
Jesse Hall3fbc8562015-11-29 22:10:52 -08003720 assert((offset + size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003721
3722 return ?
3723}
3724
3725@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003726cmd void vkUnmapMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003727 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003728 VkDeviceMemory memory) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003729 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003730 memoryObject := GetDeviceMemory(memory)
3731 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003732}
3733
3734cmd VkResult vkFlushMappedMemoryRanges(
3735 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003736 u32 memoryRangeCount
3737 const VkMappedMemoryRange* pMemoryRanges) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003738 deviceObject := GetDevice(device)
3739
Jesse Hall3fbc8562015-11-29 22:10:52 -08003740 memoryRanges := pMemoryRanges[0:memoryRangeCount]
3741 for i in (0 .. memoryRangeCount) {
3742 memoryRange := memoryRanges[i]
3743 memoryObject := GetDeviceMemory(memoryRange.memory)
3744 assert(memoryObject.device == device)
3745 assert((memoryRange.offset + memoryRange.size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003746 }
3747
3748 return ?
3749}
3750
3751cmd VkResult vkInvalidateMappedMemoryRanges(
3752 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003753 u32 memoryRangeCount,
3754 const VkMappedMemoryRange* pMemoryRanges) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003755 deviceObject := GetDevice(device)
3756
Jesse Hall3fbc8562015-11-29 22:10:52 -08003757 memoryRanges := pMemoryRanges[0:memoryRangeCount]
3758 for i in (0 .. memoryRangeCount) {
3759 memoryRange := memoryRanges[i]
3760 memoryObject := GetDeviceMemory(memoryRange.memory)
3761 assert(memoryObject.device == device)
3762 assert((memoryRange.offset + memoryRange.size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003763 }
3764
3765 return ?
3766}
3767
3768
3769// Memory management API functions
3770
Jesse Hall606a54e2015-11-19 22:17:28 -08003771cmd void vkGetDeviceMemoryCommitment(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003772 VkDevice device,
3773 VkDeviceMemory memory,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003774 VkDeviceSize* pCommittedMemoryInBytes) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003775 deviceObject := GetDevice(device)
3776
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003777 if memory != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003778 memoryObject := GetDeviceMemory(memory)
3779 assert(memoryObject.device == device)
3780 }
3781
3782 committedMemoryInBytes := ?
3783 pCommittedMemoryInBytes[0] = committedMemoryInBytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07003784}
3785
Jesse Hall606a54e2015-11-19 22:17:28 -08003786cmd void vkGetBufferMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003787 VkDevice device,
3788 VkBuffer buffer,
3789 VkMemoryRequirements* pMemoryRequirements) {
3790 deviceObject := GetDevice(device)
3791 bufferObject := GetBuffer(buffer)
3792 assert(bufferObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003793}
3794
3795cmd VkResult vkBindBufferMemory(
3796 VkDevice device,
3797 VkBuffer buffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003798 VkDeviceMemory memory,
3799 VkDeviceSize memoryOffset) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003800 deviceObject := GetDevice(device)
3801 bufferObject := GetBuffer(buffer)
3802 assert(bufferObject.device == device)
3803
3804 // Unbind buffer from previous memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003805 if bufferObject.memory != NULL_HANDLE {
3806 memoryObject := GetDeviceMemory(bufferObject.memory)
3807 memoryObject.boundObjects[as!u64(buffer)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003808 }
3809
3810 // Bind buffer to given memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003811 if memory != NULL_HANDLE {
3812 memoryObject := GetDeviceMemory(memory)
3813 assert(memoryObject.device == device)
3814 memoryObject.boundObjects[as!u64(buffer)] = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003815 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08003816 bufferObject.memory = memory
3817 bufferObject.memoryOffset = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003818
3819 return ?
3820}
3821
Jesse Hall606a54e2015-11-19 22:17:28 -08003822cmd void vkGetImageMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003823 VkDevice device,
3824 VkImage image,
3825 VkMemoryRequirements* pMemoryRequirements) {
3826 deviceObject := GetDevice(device)
3827 imageObject := GetImage(image)
3828 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003829}
3830
3831cmd VkResult vkBindImageMemory(
3832 VkDevice device,
3833 VkImage image,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003834 VkDeviceMemory memory,
3835 VkDeviceSize memoryOffset) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003836 deviceObject := GetDevice(device)
3837 imageObject := GetImage(image)
3838 assert(imageObject.device == device)
3839
3840 // Unbind image from previous memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003841 if imageObject.memory != NULL_HANDLE {
3842 memoryObject := GetDeviceMemory(imageObject.memory)
3843 memoryObject.boundObjects[as!u64(image)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003844 }
3845
3846 // Bind image to given memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003847 if memory != NULL_HANDLE {
3848 memoryObject := GetDeviceMemory(memory)
3849 assert(memoryObject.device == device)
3850 memoryObject.boundObjects[as!u64(image)] = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003851 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08003852 imageObject.memory = memory
3853 imageObject.memoryOffset = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003854
3855 return ?
3856}
3857
Jesse Hall606a54e2015-11-19 22:17:28 -08003858cmd void vkGetImageSparseMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003859 VkDevice device,
3860 VkImage image,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003861 u32* pSparseMemoryRequirementCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003862 VkSparseImageMemoryRequirements* pSparseMemoryRequirements) {
3863 deviceObject := GetDevice(device)
3864 imageObject := GetImage(image)
3865 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003866}
3867
Jesse Hall606a54e2015-11-19 22:17:28 -08003868cmd void vkGetPhysicalDeviceSparseImageFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003869 VkPhysicalDevice physicalDevice,
3870 VkFormat format,
3871 VkImageType type,
Jesse Hall091ed9e2015-11-30 00:55:29 -08003872 VkSampleCountFlagBits samples,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003873 VkImageUsageFlags usage,
3874 VkImageTiling tiling,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003875 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003876 VkSparseImageFormatProperties* pProperties) {
3877 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003878}
3879
Jesse Halla6429252015-11-29 18:59:42 -08003880cmd VkResult vkQueueBindSparse(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003881 VkQueue queue,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003882 u32 bindInfoCount,
Jesse Halla6429252015-11-29 18:59:42 -08003883 const VkBindSparseInfo* pBindInfo,
3884 VkFence fence) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003885 queueObject := GetQueue(queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003886
3887 return ?
3888}
3889
3890
3891// Fence functions
3892
3893@threadSafety("system")
3894cmd VkResult vkCreateFence(
3895 VkDevice device,
3896 const VkFenceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003897 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003898 VkFence* pFence) {
3899 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_FENCE_CREATE_INFO)
3900 deviceObject := GetDevice(device)
3901
3902 fence := ?
3903 pFence[0] = fence
3904 State.Fences[fence] = new!FenceObject(
Jesse Halld8bade02015-11-24 10:24:18 -08003905 device: device, signaled: (pCreateInfo.flags == as!VkFenceCreateFlags(VK_FENCE_CREATE_SIGNALED_BIT)))
Jesse Halld27f6aa2015-08-15 17:58:48 -07003906
3907 return ?
3908}
3909
3910@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003911cmd void vkDestroyFence(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003912 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003913 VkFence fence,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003914 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003915 deviceObject := GetDevice(device)
3916 fenceObject := GetFence(fence)
3917 assert(fenceObject.device == device)
3918
3919 State.Fences[fence] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003920}
3921
3922@threadSafety("system")
3923cmd VkResult vkResetFences(
3924 VkDevice device,
3925 u32 fenceCount,
3926 const VkFence* pFences) {
3927 deviceObject := GetDevice(device)
3928
3929 fences := pFences[0:fenceCount]
3930 for i in (0 .. fenceCount) {
3931 fence := fences[i]
3932 fenceObject := GetFence(fence)
3933 assert(fenceObject.device == device)
3934 fenceObject.signaled = false
3935 }
3936
3937 return ?
3938}
3939
3940@threadSafety("system")
3941cmd VkResult vkGetFenceStatus(
3942 VkDevice device,
3943 VkFence fence) {
3944 deviceObject := GetDevice(device)
3945 fenceObject := GetFence(fence)
3946 assert(fenceObject.device == device)
3947
3948 return ?
3949}
3950
3951@threadSafety("system")
3952cmd VkResult vkWaitForFences(
3953 VkDevice device,
3954 u32 fenceCount,
3955 const VkFence* pFences,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003956 VkBool32 waitAll,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003957 u64 timeout) { /// timeout in nanoseconds
3958 deviceObject := GetDevice(device)
3959
3960 fences := pFences[0:fenceCount]
3961 for i in (0 .. fenceCount) {
3962 fence := fences[i]
3963 fenceObject := GetFence(fence)
3964 assert(fenceObject.device == device)
3965 }
3966
3967 return ?
3968}
3969
3970
3971// Queue semaphore functions
3972
3973@threadSafety("system")
3974cmd VkResult vkCreateSemaphore(
3975 VkDevice device,
3976 const VkSemaphoreCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003977 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003978 VkSemaphore* pSemaphore) {
3979 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO)
3980 deviceObject := GetDevice(device)
3981
3982 semaphore := ?
3983 pSemaphore[0] = semaphore
3984 State.Semaphores[semaphore] = new!SemaphoreObject(device: device)
3985
3986 return ?
3987}
3988
3989@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003990cmd void vkDestroySemaphore(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003991 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003992 VkSemaphore semaphore,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003993 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003994 deviceObject := GetDevice(device)
3995 semaphoreObject := GetSemaphore(semaphore)
3996 assert(semaphoreObject.device == device)
3997
3998 State.Semaphores[semaphore] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003999}
4000
Jesse Halld27f6aa2015-08-15 17:58:48 -07004001
4002// Event functions
4003
4004@threadSafety("system")
4005cmd VkResult vkCreateEvent(
4006 VkDevice device,
4007 const VkEventCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004008 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004009 VkEvent* pEvent) {
4010 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_EVENT_CREATE_INFO)
4011 deviceObject := GetDevice(device)
4012
4013 event := ?
4014 pEvent[0] = event
4015 State.Events[event] = new!EventObject(device: device)
4016
4017 return ?
4018}
4019
4020@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004021cmd void vkDestroyEvent(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004022 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004023 VkEvent event,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004024 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004025 deviceObject := GetDevice(device)
4026 eventObject := GetEvent(event)
4027 assert(eventObject.device == device)
4028
4029 State.Events[event] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004030}
4031
4032@threadSafety("system")
4033cmd VkResult vkGetEventStatus(
4034 VkDevice device,
4035 VkEvent event) {
4036 deviceObject := GetDevice(device)
4037 eventObject := GetEvent(event)
4038 assert(eventObject.device == device)
4039
4040 return ?
4041}
4042
4043@threadSafety("system")
4044cmd VkResult vkSetEvent(
4045 VkDevice device,
4046 VkEvent event) {
4047 deviceObject := GetDevice(device)
4048 eventObject := GetEvent(event)
4049 assert(eventObject.device == device)
4050
4051 return ?
4052}
4053
4054@threadSafety("system")
4055cmd VkResult vkResetEvent(
4056 VkDevice device,
4057 VkEvent event) {
4058 deviceObject := GetDevice(device)
4059 eventObject := GetEvent(event)
4060 assert(eventObject.device == device)
4061
4062 return ?
4063}
4064
4065
4066// Query functions
4067
4068@threadSafety("system")
4069cmd VkResult vkCreateQueryPool(
4070 VkDevice device,
4071 const VkQueryPoolCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004072 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004073 VkQueryPool* pQueryPool) {
4074 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO)
4075 deviceObject := GetDevice(device)
4076
4077 queryPool := ?
4078 pQueryPool[0] = queryPool
4079 State.QueryPools[queryPool] = new!QueryPoolObject(device: device)
4080
4081 return ?
4082}
4083
4084@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004085cmd void vkDestroyQueryPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004086 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004087 VkQueryPool queryPool,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004088 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004089 deviceObject := GetDevice(device)
4090 queryPoolObject := GetQueryPool(queryPool)
4091 assert(queryPoolObject.device == device)
4092
4093 State.QueryPools[queryPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004094}
4095
4096@threadSafety("system")
4097cmd VkResult vkGetQueryPoolResults(
4098 VkDevice device,
4099 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004100 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004101 u32 queryCount,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004102 platform.size_t dataSize,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004103 void* pData,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004104 VkDeviceSize stride,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004105 VkQueryResultFlags flags) {
4106 deviceObject := GetDevice(device)
4107 queryPoolObject := GetQueryPool(queryPool)
4108 assert(queryPoolObject.device == device)
4109
Jesse Halld27f6aa2015-08-15 17:58:48 -07004110 data := pData[0:dataSize]
4111
4112 return ?
4113}
4114
4115// Buffer functions
4116
4117@threadSafety("system")
4118cmd VkResult vkCreateBuffer(
4119 VkDevice device,
4120 const VkBufferCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004121 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004122 VkBuffer* pBuffer) {
4123 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO)
4124 deviceObject := GetDevice(device)
4125
4126 buffer := ?
4127 pBuffer[0] = buffer
4128 State.Buffers[buffer] = new!BufferObject(device: device)
4129
4130 return ?
4131}
4132
4133@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004134cmd void vkDestroyBuffer(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004135 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004136 VkBuffer buffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004137 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004138 deviceObject := GetDevice(device)
4139 bufferObject := GetBuffer(buffer)
4140 assert(bufferObject.device == device)
4141
Jesse Hall3fbc8562015-11-29 22:10:52 -08004142 assert(bufferObject.memory == 0)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004143 State.Buffers[buffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004144}
4145
4146
4147// Buffer view functions
4148
4149@threadSafety("system")
4150cmd VkResult vkCreateBufferView(
4151 VkDevice device,
4152 const VkBufferViewCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004153 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004154 VkBufferView* pView) {
4155 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO)
4156 deviceObject := GetDevice(device)
4157
4158 bufferObject := GetBuffer(pCreateInfo.buffer)
4159 assert(bufferObject.device == device)
4160
4161 view := ?
4162 pView[0] = view
4163 State.BufferViews[view] = new!BufferViewObject(device: device, buffer: pCreateInfo.buffer)
4164
4165 return ?
4166}
4167
4168@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004169cmd void vkDestroyBufferView(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004170 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004171 VkBufferView bufferView,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004172 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004173 deviceObject := GetDevice(device)
4174 bufferViewObject := GetBufferView(bufferView)
4175 assert(bufferViewObject.device == device)
4176
4177 State.BufferViews[bufferView] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004178}
4179
4180
4181// Image functions
4182
4183@threadSafety("system")
4184cmd VkResult vkCreateImage(
4185 VkDevice device,
4186 const VkImageCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004187 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004188 VkImage* pImage) {
4189 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO)
4190 deviceObject := GetDevice(device)
4191
4192 image := ?
4193 pImage[0] = image
4194 State.Images[image] = new!ImageObject(device: device)
4195
4196 return ?
4197}
4198
4199@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004200cmd void vkDestroyImage(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004201 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004202 VkImage image,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004203 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004204 deviceObject := GetDevice(device)
4205 imageObject := GetImage(image)
4206 assert(imageObject.device == device)
4207
Jesse Hall3fbc8562015-11-29 22:10:52 -08004208 assert(imageObject.memory == 0)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004209 State.Images[image] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004210}
4211
Jesse Hall606a54e2015-11-19 22:17:28 -08004212cmd void vkGetImageSubresourceLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004213 VkDevice device,
4214 VkImage image,
4215 const VkImageSubresource* pSubresource,
4216 VkSubresourceLayout* pLayout) {
4217 deviceObject := GetDevice(device)
4218 imageObject := GetImage(image)
4219 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004220}
4221
4222
4223// Image view functions
4224
4225@threadSafety("system")
4226cmd VkResult vkCreateImageView(
4227 VkDevice device,
4228 const VkImageViewCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004229 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004230 VkImageView* pView) {
4231 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO)
4232 deviceObject := GetDevice(device)
4233
4234 imageObject := GetImage(pCreateInfo.image)
4235 assert(imageObject.device == device)
4236
4237 view := ?
4238 pView[0] = view
4239 State.ImageViews[view] = new!ImageViewObject(device: device, image: pCreateInfo.image)
4240
4241 return ?
4242}
4243
4244@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004245cmd void vkDestroyImageView(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004246 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004247 VkImageView imageView,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004248 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004249 deviceObject := GetDevice(device)
4250 imageViewObject := GetImageView(imageView)
4251 assert(imageViewObject.device == device)
4252
4253 State.ImageViews[imageView] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004254}
4255
4256
4257// Shader functions
4258
4259cmd VkResult vkCreateShaderModule(
4260 VkDevice device,
4261 const VkShaderModuleCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004262 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004263 VkShaderModule* pShaderModule) {
4264 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO)
4265 deviceObject := GetDevice(device)
4266
4267 shaderModule := ?
4268 pShaderModule[0] = shaderModule
4269 State.ShaderModules[shaderModule] = new!ShaderModuleObject(device: device)
4270
4271 return ?
4272}
4273
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004274cmd void vkDestroyShaderModule(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004275 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004276 VkShaderModule shaderModule,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004277 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004278 deviceObject := GetDevice(device)
4279 shaderModuleObject := GetShaderModule(shaderModule)
4280 assert(shaderModuleObject.device == device)
4281
4282 State.ShaderModules[shaderModule] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004283}
4284
Jesse Halld27f6aa2015-08-15 17:58:48 -07004285
4286// Pipeline functions
4287
4288cmd VkResult vkCreatePipelineCache(
4289 VkDevice device,
4290 const VkPipelineCacheCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004291 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004292 VkPipelineCache* pPipelineCache) {
4293 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO)
4294 deviceObject := GetDevice(device)
4295
4296 pipelineCache := ?
4297 pPipelineCache[0] = pipelineCache
4298 State.PipelineCaches[pipelineCache] = new!PipelineCacheObject(device: device)
4299
4300 return ?
4301}
4302
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004303cmd void vkDestroyPipelineCache(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004304 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004305 VkPipelineCache pipelineCache,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004306 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004307 deviceObject := GetDevice(device)
4308 pipelineCacheObject := GetPipelineCache(pipelineCache)
4309 assert(pipelineCacheObject.device == device)
4310
4311 State.PipelineCaches[pipelineCache] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004312}
4313
Jesse Halld27f6aa2015-08-15 17:58:48 -07004314cmd VkResult vkGetPipelineCacheData(
4315 VkDevice device,
4316 VkPipelineCache pipelineCache,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004317 platform.size_t* pDataSize,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004318 void* pData) {
4319 deviceObject := GetDevice(device)
4320 pipelineCacheObject := GetPipelineCache(pipelineCache)
4321 assert(pipelineCacheObject.device == device)
4322
4323 return ?
4324}
4325
4326cmd VkResult vkMergePipelineCaches(
4327 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004328 VkPipelineCache dstCache,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004329 u32 srcCacheCount,
4330 const VkPipelineCache* pSrcCaches) {
4331 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004332 dstCacheObject := GetPipelineCache(dstCache)
4333 assert(dstCacheObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004334
4335 srcCaches := pSrcCaches[0:srcCacheCount]
4336 for i in (0 .. srcCacheCount) {
4337 srcCache := srcCaches[i]
4338 srcCacheObject := GetPipelineCache(srcCache)
4339 assert(srcCacheObject.device == device)
4340 }
4341
4342 return ?
4343}
4344
4345cmd VkResult vkCreateGraphicsPipelines(
4346 VkDevice device,
4347 VkPipelineCache pipelineCache,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004348 u32 createInfoCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004349 const VkGraphicsPipelineCreateInfo* pCreateInfos,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004350 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004351 VkPipeline* pPipelines) {
4352 deviceObject := GetDevice(device)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004353 if pipelineCache != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004354 pipelineCacheObject := GetPipelineCache(pipelineCache)
4355 assert(pipelineCacheObject.device == device)
4356 }
4357
Jesse Hall03b6fe12015-11-24 12:44:21 -08004358 createInfos := pCreateInfos[0:createInfoCount]
4359 pipelines := pPipelines[0:createInfoCount]
4360 for i in (0 .. createInfoCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004361 pipeline := ?
4362 pipelines[i] = pipeline
4363 State.Pipelines[pipeline] = new!PipelineObject(device: device)
4364 }
4365
4366 return ?
4367}
4368
4369cmd VkResult vkCreateComputePipelines(
4370 VkDevice device,
4371 VkPipelineCache pipelineCache,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004372 u32 createInfoCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004373 const VkComputePipelineCreateInfo* pCreateInfos,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004374 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004375 VkPipeline* pPipelines) {
4376 deviceObject := GetDevice(device)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004377 if pipelineCache != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004378 pipelineCacheObject := GetPipelineCache(pipelineCache)
4379 assert(pipelineCacheObject.device == device)
4380 }
4381
Jesse Hall03b6fe12015-11-24 12:44:21 -08004382 createInfos := pCreateInfos[0:createInfoCount]
4383 pipelines := pPipelines[0:createInfoCount]
4384 for i in (0 .. createInfoCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004385 pipeline := ?
4386 pipelines[i] = pipeline
4387 State.Pipelines[pipeline] = new!PipelineObject(device: device)
4388 }
4389
4390 return ?
4391}
4392
4393@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004394cmd void vkDestroyPipeline(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004395 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004396 VkPipeline pipeline,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004397 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004398 deviceObject := GetDevice(device)
4399 pipelineObjects := GetPipeline(pipeline)
4400 assert(pipelineObjects.device == device)
4401
4402 State.Pipelines[pipeline] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004403}
4404
4405
4406// Pipeline layout functions
4407
4408@threadSafety("system")
4409cmd VkResult vkCreatePipelineLayout(
4410 VkDevice device,
4411 const VkPipelineLayoutCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004412 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004413 VkPipelineLayout* pPipelineLayout) {
4414 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO)
4415 deviceObject := GetDevice(device)
4416
4417 pipelineLayout := ?
4418 pPipelineLayout[0] = pipelineLayout
4419 State.PipelineLayouts[pipelineLayout] = new!PipelineLayoutObject(device: device)
4420
4421 return ?
4422}
4423
4424@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004425cmd void vkDestroyPipelineLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004426 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004427 VkPipelineLayout pipelineLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004428 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004429 deviceObject := GetDevice(device)
4430 pipelineLayoutObjects := GetPipelineLayout(pipelineLayout)
4431 assert(pipelineLayoutObjects.device == device)
4432
4433 State.PipelineLayouts[pipelineLayout] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004434}
4435
4436
4437// Sampler functions
4438
4439@threadSafety("system")
4440cmd VkResult vkCreateSampler(
4441 VkDevice device,
4442 const VkSamplerCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004443 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004444 VkSampler* pSampler) {
4445 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO)
4446 deviceObject := GetDevice(device)
4447
4448 sampler := ?
4449 pSampler[0] = sampler
4450 State.Samplers[sampler] = new!SamplerObject(device: device)
4451
4452 return ?
4453}
4454
4455@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004456cmd void vkDestroySampler(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004457 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004458 VkSampler sampler,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004459 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004460 deviceObject := GetDevice(device)
4461 samplerObject := GetSampler(sampler)
4462 assert(samplerObject.device == device)
4463
4464 State.Samplers[sampler] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004465}
4466
4467
4468// Descriptor set functions
4469
4470@threadSafety("system")
4471cmd VkResult vkCreateDescriptorSetLayout(
4472 VkDevice device,
4473 const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004474 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004475 VkDescriptorSetLayout* pSetLayout) {
4476 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO)
4477 deviceObject := GetDevice(device)
4478
4479 setLayout := ?
4480 pSetLayout[0] = setLayout
4481 State.DescriptorSetLayouts[setLayout] = new!DescriptorSetLayoutObject(device: device)
4482
4483 return ?
4484}
4485
4486@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004487cmd void vkDestroyDescriptorSetLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004488 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004489 VkDescriptorSetLayout descriptorSetLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004490 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004491 deviceObject := GetDevice(device)
4492 descriptorSetLayoutObject := GetDescriptorSetLayout(descriptorSetLayout)
4493 assert(descriptorSetLayoutObject.device == device)
4494
4495 State.DescriptorSetLayouts[descriptorSetLayout] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004496}
4497
4498@threadSafety("system")
4499cmd VkResult vkCreateDescriptorPool(
4500 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004501 const VkDescriptorPoolCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004502 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004503 VkDescriptorPool* pDescriptorPool) {
4504 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO)
4505 deviceObject := GetDevice(device)
4506
4507 descriptorPool := ?
4508 pDescriptorPool[0] = descriptorPool
4509 State.DescriptorPools[descriptorPool] = new!DescriptorPoolObject(device: device)
4510
4511 return ?
4512}
4513
4514@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004515cmd void vkDestroyDescriptorPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004516 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004517 VkDescriptorPool descriptorPool,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004518 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004519 deviceObject := GetDevice(device)
4520 descriptorPoolObject := GetDescriptorPool(descriptorPool)
4521 assert(descriptorPoolObject.device == device)
4522
4523 State.DescriptorPools[descriptorPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004524}
4525
4526@threadSafety("app")
4527cmd VkResult vkResetDescriptorPool(
4528 VkDevice device,
Jesse Hallfbf97b02015-11-20 14:17:03 -08004529 VkDescriptorPool descriptorPool,
4530 VkDescriptorPoolResetFlags flags) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004531 deviceObject := GetDevice(device)
4532 descriptorPoolObject := GetDescriptorPool(descriptorPool)
4533 assert(descriptorPoolObject.device == device)
4534
4535 return ?
4536}
4537
4538@threadSafety("app")
Jesse Hall3fbc8562015-11-29 22:10:52 -08004539cmd VkResult vkAllocateDescriptorSets(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004540 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004541 const VkDescriptorSetAllocateInfo* pAllocateInfo,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004542 VkDescriptorSet* pDescriptorSets) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004543 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004544 allocInfo := pAllocateInfo[0]
Jesse Hallfbf97b02015-11-20 14:17:03 -08004545 descriptorPoolObject := GetDescriptorPool(allocInfo.descriptorPool)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004546
Jesse Hall03b6fe12015-11-24 12:44:21 -08004547 setLayouts := allocInfo.pSetLayouts[0:allocInfo.setCount]
4548 for i in (0 .. allocInfo.setCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004549 setLayout := setLayouts[i]
4550 setLayoutObject := GetDescriptorSetLayout(setLayout)
4551 assert(setLayoutObject.device == device)
4552 }
4553
Jesse Hall03b6fe12015-11-24 12:44:21 -08004554 descriptorSets := pDescriptorSets[0:allocInfo.setCount]
4555 for i in (0 .. allocInfo.setCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004556 descriptorSet := ?
4557 descriptorSets[i] = descriptorSet
4558 State.DescriptorSets[descriptorSet] = new!DescriptorSetObject(device: device)
4559 }
4560
4561 return ?
4562}
4563
Jesse Hallf09c6b12015-08-15 19:54:28 -07004564cmd VkResult vkFreeDescriptorSets(
4565 VkDevice device,
4566 VkDescriptorPool descriptorPool,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004567 u32 descriptorSetCount,
Jesse Hallf09c6b12015-08-15 19:54:28 -07004568 const VkDescriptorSet* pDescriptorSets) {
4569 deviceObject := GetDevice(device)
4570 descriptorPoolObject := GetDescriptorPool(descriptorPool)
4571
Jesse Hall03b6fe12015-11-24 12:44:21 -08004572 descriptorSets := pDescriptorSets[0:descriptorSetCount]
4573 for i in (0 .. descriptorSetCount) {
Jesse Hallf09c6b12015-08-15 19:54:28 -07004574 descriptorSet := descriptorSets[i]
4575 descriptorSetObject := GetDescriptorSet(descriptorSet)
4576 assert(descriptorSetObject.device == device)
4577 State.DescriptorSets[descriptorSet] = null
4578 }
4579
4580 return ?
4581}
4582
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004583cmd void vkUpdateDescriptorSets(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004584 VkDevice device,
Jesse Hallb00daad2015-11-29 19:46:20 -08004585 u32 descriptorWriteCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004586 const VkWriteDescriptorSet* pDescriptorWrites,
Jesse Hallb00daad2015-11-29 19:46:20 -08004587 u32 descriptorCopyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004588 const VkCopyDescriptorSet* pDescriptorCopies) {
4589 deviceObject := GetDevice(device)
4590
Jesse Hallb00daad2015-11-29 19:46:20 -08004591 descriptorWrites := pDescriptorWrites[0:descriptorWriteCount]
4592 for i in (0 .. descriptorWriteCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004593 descriptorWrite := descriptorWrites[i]
Jesse Hall3fbc8562015-11-29 22:10:52 -08004594 descriptorWriteObject := GetDescriptorSet(descriptorWrite.dstSet)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004595 assert(descriptorWriteObject.device == device)
4596 }
4597
Jesse Hallb00daad2015-11-29 19:46:20 -08004598 descriptorCopies := pDescriptorCopies[0:descriptorCopyCount]
4599 for i in (0 .. descriptorCopyCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004600 descriptorCopy := descriptorCopies[i]
Jesse Hall3fbc8562015-11-29 22:10:52 -08004601 descriptorCopyObject := GetDescriptorSet(descriptorCopy.dstSet)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004602 assert(descriptorCopyObject.device == device)
4603 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07004604}
4605
4606
4607// Framebuffer functions
4608
4609@threadSafety("system")
4610cmd VkResult vkCreateFramebuffer(
4611 VkDevice device,
4612 const VkFramebufferCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004613 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004614 VkFramebuffer* pFramebuffer) {
4615 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO)
4616 deviceObject := GetDevice(device)
4617
4618 framebuffer := ?
4619 pFramebuffer[0] = framebuffer
4620 State.Framebuffers[framebuffer] = new!FramebufferObject(device: device)
4621
4622 return ?
4623}
4624
4625@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004626cmd void vkDestroyFramebuffer(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004627 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004628 VkFramebuffer framebuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004629 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004630 deviceObject := GetDevice(device)
4631 framebufferObject := GetFramebuffer(framebuffer)
4632 assert(framebufferObject.device == device)
4633
4634 State.Framebuffers[framebuffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004635}
4636
4637
4638// Renderpass functions
4639
4640@threadSafety("system")
4641cmd VkResult vkCreateRenderPass(
4642 VkDevice device,
4643 const VkRenderPassCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004644 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004645 VkRenderPass* pRenderPass) {
4646 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO)
4647 deviceObject := GetDevice(device)
4648
4649 renderpass := ?
4650 pRenderPass[0] = renderpass
4651 State.RenderPasses[renderpass] = new!RenderPassObject(device: device)
4652
4653 return ?
4654}
4655
4656@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004657cmd void vkDestroyRenderPass(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004658 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004659 VkRenderPass renderPass,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004660 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004661 deviceObject := GetDevice(device)
4662 renderPassObject := GetRenderPass(renderPass)
4663 assert(renderPassObject.device == device)
4664
4665 State.RenderPasses[renderPass] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004666}
4667
Jesse Hall606a54e2015-11-19 22:17:28 -08004668cmd void vkGetRenderAreaGranularity(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004669 VkDevice device,
4670 VkRenderPass renderPass,
4671 VkExtent2D* pGranularity) {
4672 deviceObject := GetDevice(device)
4673 renderPassObject := GetRenderPass(renderPass)
4674
4675 granularity := ?
4676 pGranularity[0] = granularity
Jesse Halld27f6aa2015-08-15 17:58:48 -07004677}
4678
4679// Command pool functions
4680
4681cmd VkResult vkCreateCommandPool(
4682 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004683 const VkCommandPoolCreateInfo* pCreateInfo,
4684 const VkAllocationCallbacks* pAllocator,
4685 VkCommandPool* pCommandPool) {
4686 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004687 deviceObject := GetDevice(device)
4688
Jesse Hall3fbc8562015-11-29 22:10:52 -08004689 commandPool := ?
4690 pCommandPool[0] = commandPool
4691 State.CommandPools[commandPool] = new!CommandPoolObject(device: device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004692
4693 return ?
4694}
4695
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004696cmd void vkDestroyCommandPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004697 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004698 VkCommandPool commandPool,
4699 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004700 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004701 commandPoolObject := GetCommandPool(commandPool)
4702 assert(commandPoolObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004703
Jesse Hall3fbc8562015-11-29 22:10:52 -08004704 State.CommandPools[commandPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004705}
4706
4707cmd VkResult vkResetCommandPool(
4708 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004709 VkCommandPool commandPool,
4710 VkCommandPoolResetFlags flags) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004711 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004712 commandPoolObject := GetCommandPool(commandPool)
4713 assert(commandPoolObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004714
4715 return ?
4716}
4717
4718// Command buffer functions
4719
Jesse Hall3fbc8562015-11-29 22:10:52 -08004720macro void bindCommandBuffer(VkCommandBuffer commandBuffer, any obj, VkDeviceMemory memory) {
4721 memoryObject := GetDeviceMemory(memory)
4722 memoryObject.boundCommandBuffers[commandBuffer] = commandBuffer
Jesse Halld27f6aa2015-08-15 17:58:48 -07004723
Jesse Hall3fbc8562015-11-29 22:10:52 -08004724 commandBufferObject := GetCommandBuffer(commandBuffer)
4725 commandBufferObject.boundObjects[as!u64(obj)] = memory
Jesse Halld27f6aa2015-08-15 17:58:48 -07004726}
4727
Jesse Hall3fbc8562015-11-29 22:10:52 -08004728macro void unbindCommandBuffer(VkCommandBuffer commandBuffer, any obj, VkDeviceMemory memory) {
4729 memoryObject := GetDeviceMemory(memory)
4730 memoryObject.boundCommandBuffers[commandBuffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004731
Jesse Hall3fbc8562015-11-29 22:10:52 -08004732 commandBufferObject := GetCommandBuffer(commandBuffer)
4733 commandBufferObject.boundObjects[as!u64(obj)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004734}
4735
4736@threadSafety("system")
Jesse Hall3fbc8562015-11-29 22:10:52 -08004737cmd VkResult vkAllocateCommandBuffers(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004738 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004739 const VkCommandBufferAllocateInfo* pAllocateInfo,
4740 VkCommandBuffer* pCommandBuffers) {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08004741 assert(pAllocateInfo[0].sType == VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004742
Jesse Hall3dd678a2016-01-08 21:52:01 -08004743 count := pAllocateInfo[0].commandBufferCount
Jesse Hall3fbc8562015-11-29 22:10:52 -08004744 commandBuffers := pCommandBuffers[0:count]
Jesse Hallfbf97b02015-11-20 14:17:03 -08004745 for i in (0 .. count) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004746 commandBuffer := ?
4747 commandBuffers[i] = commandBuffer
4748 State.CommandBuffers[commandBuffer] = new!CommandBufferObject(device: device)
Jesse Hallfbf97b02015-11-20 14:17:03 -08004749 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07004750
4751 return ?
4752}
4753
4754@threadSafety("system")
Jesse Hallfbf97b02015-11-20 14:17:03 -08004755cmd void vkFreeCommandBuffers(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004756 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004757 VkCommandPool commandPool,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004758 u32 commandBufferCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004759 const VkCommandBuffer* pCommandBuffers) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004760 deviceObject := GetDevice(device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004761
Jesse Hall3fbc8562015-11-29 22:10:52 -08004762 commandBuffers := pCommandBuffers[0:commandBufferCount]
Jesse Hall03b6fe12015-11-24 12:44:21 -08004763 for i in (0 .. commandBufferCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004764 commandBufferObject := GetCommandBuffer(commandBuffers[i])
4765 assert(commandBufferObject.device == device)
Jesse Hallfbf97b02015-11-20 14:17:03 -08004766 // TODO: iterate over boundObjects and clear memory bindings
Jesse Hall3fbc8562015-11-29 22:10:52 -08004767 State.CommandBuffers[commandBuffers[i]] = null
Jesse Hallfbf97b02015-11-20 14:17:03 -08004768 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07004769}
4770
4771@threadSafety("app")
4772cmd VkResult vkBeginCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004773 VkCommandBuffer commandBuffer,
4774 const VkCommandBufferBeginInfo* pBeginInfo) {
4775 assert(pBeginInfo.sType == VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO)
4776 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004777
4778 // TODO: iterate over boundObjects and clear memory bindings
4779
4780 return ?
4781}
4782
4783@threadSafety("app")
4784cmd VkResult vkEndCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004785 VkCommandBuffer commandBuffer) {
4786 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004787
4788 return ?
4789}
4790
4791@threadSafety("app")
4792cmd VkResult vkResetCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004793 VkCommandBuffer commandBuffer,
4794 VkCommandBufferResetFlags flags) {
4795 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004796
4797 // TODO: iterate over boundObjects and clear memory bindings
4798
4799 return ?
4800}
4801
4802
4803// Command buffer building functions
4804
4805@threadSafety("app")
4806cmd void vkCmdBindPipeline(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004807 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004808 VkPipelineBindPoint pipelineBindPoint,
4809 VkPipeline pipeline) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004810 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004811 pipelineObject := GetPipeline(pipeline)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004812 assert(commandBufferObject.device == pipelineObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004813
Jesse Halld8bade02015-11-24 10:24:18 -08004814 queue := switch (pipelineBindPoint) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004815 case VK_PIPELINE_BIND_POINT_COMPUTE: VK_QUEUE_COMPUTE_BIT
4816 case VK_PIPELINE_BIND_POINT_GRAPHICS: VK_QUEUE_GRAPHICS_BIT
4817 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08004818 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004819}
4820
4821@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004822cmd void vkCmdSetViewport(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004823 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004824 u32 firstViewport,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004825 u32 viewportCount,
4826 const VkViewport* pViewports) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004827 commandBufferObject := GetCommandBuffer(commandBuffer)
4828 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004829}
4830
4831@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004832cmd void vkCmdSetScissor(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004833 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004834 u32 firstScissor,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004835 u32 scissorCount,
4836 const VkRect2D* pScissors) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004837 commandBufferObject := GetCommandBuffer(commandBuffer)
4838 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004839}
4840
4841@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004842cmd void vkCmdSetLineWidth(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004843 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004844 f32 lineWidth) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004845 commandBufferObject := GetCommandBuffer(commandBuffer)
4846 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004847}
4848
4849@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004850cmd void vkCmdSetDepthBias(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004851 VkCommandBuffer commandBuffer,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004852 f32 depthBiasConstantFactor,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004853 f32 depthBiasClamp,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004854 f32 depthBiasSlopeFactor) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004855 commandBufferObject := GetCommandBuffer(commandBuffer)
4856 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004857}
Jesse Halld27f6aa2015-08-15 17:58:48 -07004858
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004859@threadSafety("app")
4860cmd void vkCmdSetBlendConstants(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004861 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004862 // TODO(jessehall): apic only supports 'const' on pointer types. Using
4863 // an annotation as a quick hack to pass this to the template without
4864 // having to modify the AST and semantic model.
Jesse Hallb00daad2015-11-29 19:46:20 -08004865 @readonly f32[4] blendConstants) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004866 commandBufferObject := GetCommandBuffer(commandBuffer)
4867 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004868}
4869
4870@threadSafety("app")
4871cmd void vkCmdSetDepthBounds(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004872 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004873 f32 minDepthBounds,
4874 f32 maxDepthBounds) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004875 commandBufferObject := GetCommandBuffer(commandBuffer)
4876 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004877}
4878
4879@threadSafety("app")
4880cmd void vkCmdSetStencilCompareMask(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004881 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004882 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08004883 u32 compareMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004884 commandBufferObject := GetCommandBuffer(commandBuffer)
4885 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004886}
4887
4888@threadSafety("app")
4889cmd void vkCmdSetStencilWriteMask(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004890 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004891 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08004892 u32 writeMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004893 commandBufferObject := GetCommandBuffer(commandBuffer)
4894 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004895}
4896
4897@threadSafety("app")
4898cmd void vkCmdSetStencilReference(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004899 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004900 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08004901 u32 reference) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004902 commandBufferObject := GetCommandBuffer(commandBuffer)
4903 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004904}
4905
4906@threadSafety("app")
4907cmd void vkCmdBindDescriptorSets(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004908 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004909 VkPipelineBindPoint pipelineBindPoint,
4910 VkPipelineLayout layout,
4911 u32 firstSet,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004912 u32 descriptorSetCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004913 const VkDescriptorSet* pDescriptorSets,
4914 u32 dynamicOffsetCount,
4915 const u32* pDynamicOffsets) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004916 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004917
Jesse Hall03b6fe12015-11-24 12:44:21 -08004918 descriptorSets := pDescriptorSets[0:descriptorSetCount]
4919 for i in (0 .. descriptorSetCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004920 descriptorSet := descriptorSets[i]
4921 descriptorSetObject := GetDescriptorSet(descriptorSet)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004922 assert(commandBufferObject.device == descriptorSetObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004923 }
4924
4925 dynamicOffsets := pDynamicOffsets[0:dynamicOffsetCount]
4926 for i in (0 .. dynamicOffsetCount) {
4927 dynamicOffset := dynamicOffsets[i]
4928 }
4929
Jesse Halld8bade02015-11-24 10:24:18 -08004930 queue := switch (pipelineBindPoint) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004931 case VK_PIPELINE_BIND_POINT_COMPUTE: VK_QUEUE_COMPUTE_BIT
4932 case VK_PIPELINE_BIND_POINT_GRAPHICS: VK_QUEUE_GRAPHICS_BIT
4933 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08004934 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004935}
4936
4937@threadSafety("app")
4938cmd void vkCmdBindIndexBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004939 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004940 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004941 VkDeviceSize offset,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004942 VkIndexType indexType) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004943 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004944 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004945 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004946
Jesse Hall3fbc8562015-11-29 22:10:52 -08004947 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004948
Jesse Hall3fbc8562015-11-29 22:10:52 -08004949 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004950}
4951
4952@threadSafety("app")
4953cmd void vkCmdBindVertexBuffers(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004954 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004955 u32 firstBinding,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004956 u32 bindingCount,
4957 const VkBuffer* pBuffers,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004958 const VkDeviceSize* pOffsets) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004959 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004960
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004961 // TODO: check if not [firstBinding:firstBinding+bindingCount]
Jesse Halld27f6aa2015-08-15 17:58:48 -07004962 buffers := pBuffers[0:bindingCount]
4963 offsets := pOffsets[0:bindingCount]
4964 for i in (0 .. bindingCount) {
4965 buffer := buffers[i]
4966 offset := offsets[i]
4967 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004968 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004969
Jesse Hall3fbc8562015-11-29 22:10:52 -08004970 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004971 }
4972
Jesse Hall3fbc8562015-11-29 22:10:52 -08004973 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004974}
4975
4976@threadSafety("app")
4977cmd void vkCmdDraw(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004978 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004979 u32 vertexCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004980 u32 instanceCount,
4981 u32 firstVertex,
4982 u32 firstInstance) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004983 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004984
Jesse Hall3fbc8562015-11-29 22:10:52 -08004985 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004986}
4987
4988@threadSafety("app")
4989cmd void vkCmdDrawIndexed(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004990 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004991 u32 indexCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004992 u32 instanceCount,
4993 u32 firstIndex,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004994 s32 vertexOffset,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004995 u32 firstInstance) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004996 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004997
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 vkCmdDrawIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005003 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005004 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005005 VkDeviceSize offset,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005006 u32 drawCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005007 u32 stride) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005008 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005009 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005010 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005011
Jesse Hall3fbc8562015-11-29 22:10:52 -08005012 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005013
Jesse Hall3fbc8562015-11-29 22:10:52 -08005014 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005015}
5016
5017@threadSafety("app")
5018cmd void vkCmdDrawIndexedIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005019 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005020 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005021 VkDeviceSize offset,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005022 u32 drawCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005023 u32 stride) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005024 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005025 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005026 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005027
Jesse Hall3fbc8562015-11-29 22:10:52 -08005028 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005029
Jesse Hall3fbc8562015-11-29 22:10:52 -08005030 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005031}
5032
5033@threadSafety("app")
5034cmd void vkCmdDispatch(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005035 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005036 u32 x,
5037 u32 y,
5038 u32 z) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005039 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005040
Jesse Hall3fbc8562015-11-29 22:10:52 -08005041 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_COMPUTE_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005042}
5043
5044@threadSafety("app")
5045cmd void vkCmdDispatchIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005046 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005047 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005048 VkDeviceSize offset) {
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_COMPUTE_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005056}
5057
5058@threadSafety("app")
5059cmd void vkCmdCopyBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005060 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005061 VkBuffer srcBuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005062 VkBuffer dstBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005063 u32 regionCount,
5064 const VkBufferCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005065 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005066 srcBufferObject := GetBuffer(srcBuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005067 dstBufferObject := GetBuffer(dstBuffer)
5068 assert(commandBufferObject.device == srcBufferObject.device)
5069 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005070
5071 regions := pRegions[0:regionCount]
5072 for i in (0 .. regionCount) {
5073 region := regions[i]
5074 }
5075
Jesse Hall3fbc8562015-11-29 22:10:52 -08005076 bindCommandBuffer(commandBuffer, srcBuffer, srcBufferObject.memory)
5077 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005078
Jesse Hall65ab5522015-11-30 00:07:16 -08005079 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005080}
5081
5082@threadSafety("app")
5083cmd void vkCmdCopyImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005084 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005085 VkImage srcImage,
5086 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005087 VkImage dstImage,
5088 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005089 u32 regionCount,
5090 const VkImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005091 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005092 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005093 dstImageObject := GetImage(dstImage)
5094 assert(commandBufferObject.device == srcImageObject.device)
5095 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005096
5097 regions := pRegions[0:regionCount]
5098 for i in (0 .. regionCount) {
5099 region := regions[i]
5100 }
5101
Jesse Hall3fbc8562015-11-29 22:10:52 -08005102 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
5103 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005104
Jesse Hall65ab5522015-11-30 00:07:16 -08005105 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005106}
5107
5108@threadSafety("app")
5109cmd void vkCmdBlitImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005110 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005111 VkImage srcImage,
5112 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005113 VkImage dstImage,
5114 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005115 u32 regionCount,
5116 const VkImageBlit* pRegions,
Jesse Hall23ff73f2015-11-29 14:36:39 -08005117 VkFilter filter) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005118 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005119 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005120 dstImageObject := GetImage(dstImage)
5121 assert(commandBufferObject.device == srcImageObject.device)
5122 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005123
5124 regions := pRegions[0:regionCount]
5125 for i in (0 .. regionCount) {
5126 region := regions[i]
5127 }
5128
Jesse Hall3fbc8562015-11-29 22:10:52 -08005129 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
5130 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005131
Jesse Hall3fbc8562015-11-29 22:10:52 -08005132 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005133}
5134
5135@threadSafety("app")
5136cmd void vkCmdCopyBufferToImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005137 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005138 VkBuffer srcBuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005139 VkImage dstImage,
5140 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005141 u32 regionCount,
5142 const VkBufferImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005143 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005144 srcBufferObject := GetBuffer(srcBuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005145 dstImageObject := GetImage(dstImage)
5146 assert(commandBufferObject.device == srcBufferObject.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, srcBuffer, srcBufferObject.memory)
5155 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005156
Jesse Hall65ab5522015-11-30 00:07:16 -08005157 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005158}
5159
5160@threadSafety("app")
5161cmd void vkCmdCopyImageToBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005162 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005163 VkImage srcImage,
5164 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005165 VkBuffer dstBuffer,
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 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005170 dstBufferObject := GetBuffer(dstBuffer)
5171 assert(commandBufferObject.device == srcImageObject.device)
5172 assert(commandBufferObject.device == dstBufferObject.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, srcImage, srcImageObject.memory)
5180 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.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 vkCmdUpdateBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005187 VkCommandBuffer commandBuffer,
5188 VkBuffer dstBuffer,
5189 VkDeviceSize dstOffset,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005190 VkDeviceSize dataSize,
Jesse Hall56d386a2016-07-26 15:20:40 -07005191 const void* pData) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005192 commandBufferObject := GetCommandBuffer(commandBuffer)
5193 dstBufferObject := GetBuffer(dstBuffer)
5194 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005195
5196 data := pData[0:dataSize]
5197
Jesse Hall3fbc8562015-11-29 22:10:52 -08005198 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005199
Jesse Hall65ab5522015-11-30 00:07:16 -08005200 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005201}
5202
5203@threadSafety("app")
5204cmd void vkCmdFillBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005205 VkCommandBuffer commandBuffer,
5206 VkBuffer dstBuffer,
5207 VkDeviceSize dstOffset,
Jesse Hallb00daad2015-11-29 19:46:20 -08005208 VkDeviceSize size,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005209 u32 data) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005210 commandBufferObject := GetCommandBuffer(commandBuffer)
5211 dstBufferObject := GetBuffer(dstBuffer)
5212 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005213
Jesse Hall65ab5522015-11-30 00:07:16 -08005214 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005215}
5216
5217@threadSafety("app")
5218cmd void vkCmdClearColorImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005219 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005220 VkImage image,
5221 VkImageLayout imageLayout,
5222 const VkClearColorValue* pColor,
5223 u32 rangeCount,
5224 const VkImageSubresourceRange* pRanges) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005225 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005226 imageObject := GetImage(image)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005227 assert(commandBufferObject.device == imageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005228
5229 ranges := pRanges[0:rangeCount]
5230 for i in (0 .. rangeCount) {
5231 range := ranges[i]
5232 }
5233
Jesse Hall3fbc8562015-11-29 22:10:52 -08005234 bindCommandBuffer(commandBuffer, image, imageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005235
Jesse Hall3fbc8562015-11-29 22:10:52 -08005236 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005237}
5238
5239@threadSafety("app")
5240cmd void vkCmdClearDepthStencilImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005241 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005242 VkImage image,
5243 VkImageLayout imageLayout,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005244 const VkClearDepthStencilValue* pDepthStencil,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005245 u32 rangeCount,
5246 const VkImageSubresourceRange* pRanges) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005247 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005248 imageObject := GetImage(image)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005249 assert(commandBufferObject.device == imageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005250
5251 ranges := pRanges[0:rangeCount]
5252 for i in (0 .. rangeCount) {
5253 range := ranges[i]
5254 }
5255
Jesse Hall3fbc8562015-11-29 22:10:52 -08005256 bindCommandBuffer(commandBuffer, image, imageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005257
Jesse Hall3fbc8562015-11-29 22:10:52 -08005258 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005259}
5260
5261@threadSafety("app")
Jesse Hallae38f732015-11-19 21:32:50 -08005262cmd void vkCmdClearAttachments(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005263 VkCommandBuffer commandBuffer,
Jesse Hallae38f732015-11-19 21:32:50 -08005264 u32 attachmentCount,
5265 const VkClearAttachment* pAttachments,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005266 u32 rectCount,
Jesse Halla15a4bf2015-11-19 22:48:02 -08005267 const VkClearRect* pRects) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005268 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005269
5270 rects := pRects[0:rectCount]
5271 for i in (0 .. rectCount) {
5272 rect := rects[i]
5273 }
5274
Jesse Hall3fbc8562015-11-29 22:10:52 -08005275 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005276}
5277
5278@threadSafety("app")
5279cmd void vkCmdResolveImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005280 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005281 VkImage srcImage,
5282 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005283 VkImage dstImage,
5284 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005285 u32 regionCount,
5286 const VkImageResolve* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005287 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005288 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005289 dstImageObject := GetImage(dstImage)
5290 assert(commandBufferObject.device == srcImageObject.device)
5291 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005292
5293 regions := pRegions[0:regionCount]
5294 for i in (0 .. regionCount) {
5295 region := regions[i]
5296 }
5297
Jesse Hall3fbc8562015-11-29 22:10:52 -08005298 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
5299 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005300
Jesse Hall3fbc8562015-11-29 22:10:52 -08005301 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005302}
5303
5304@threadSafety("app")
5305cmd void vkCmdSetEvent(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005306 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005307 VkEvent event,
5308 VkPipelineStageFlags stageMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005309 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005310 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005311 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005312}
5313
5314@threadSafety("app")
5315cmd void vkCmdResetEvent(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005316 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005317 VkEvent event,
5318 VkPipelineStageFlags stageMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005319 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005320 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005321 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005322}
5323
5324@threadSafety("app")
5325cmd void vkCmdWaitEvents(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005326 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005327 u32 eventCount,
5328 const VkEvent* pEvents,
5329 VkPipelineStageFlags srcStageMask,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005330 VkPipelineStageFlags dstStageMask,
5331 u32 memoryBarrierCount,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005332 const VkMemoryBarrier* pMemoryBarriers,
5333 u32 bufferMemoryBarrierCount,
5334 const VkBufferMemoryBarrier* pBufferMemoryBarriers,
5335 u32 imageMemoryBarrierCount,
5336 const VkImageMemoryBarrier* pImageMemoryBarriers) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005337 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005338
5339 events := pEvents[0:eventCount]
5340 for i in (0 .. eventCount) {
5341 event := events[i]
5342 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005343 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005344 }
5345
Jesse Hall3dd678a2016-01-08 21:52:01 -08005346 memoryBarriers := pMemoryBarriers[0:memoryBarrierCount]
Jesse Hall3fbc8562015-11-29 22:10:52 -08005347 for i in (0 .. memoryBarrierCount) {
Jesse Hall3dd678a2016-01-08 21:52:01 -08005348 memoryBarrier := memoryBarriers[i]
5349 }
5350 bufferMemoryBarriers := pBufferMemoryBarriers[0:bufferMemoryBarrierCount]
5351 for i in (0 .. bufferMemoryBarrierCount) {
5352 bufferMemoryBarrier := bufferMemoryBarriers[i]
5353 bufferObject := GetBuffer(bufferMemoryBarrier.buffer)
5354 assert(bufferObject.device == commandBufferObject.device)
5355 }
5356 imageMemoryBarriers := pImageMemoryBarriers[0:imageMemoryBarrierCount]
5357 for i in (0 .. imageMemoryBarrierCount) {
5358 imageMemoryBarrier := imageMemoryBarriers[i]
5359 imageObject := GetImage(imageMemoryBarrier.image)
5360 assert(imageObject.device == commandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005361 }
5362}
5363
5364@threadSafety("app")
5365cmd void vkCmdPipelineBarrier(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005366 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005367 VkPipelineStageFlags srcStageMask,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005368 VkPipelineStageFlags dstStageMask,
Jesse Halldc6d36c2015-11-29 19:12:15 -08005369 VkDependencyFlags dependencyFlags,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005370 u32 memoryBarrierCount,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005371 const VkMemoryBarrier* pMemoryBarriers,
5372 u32 bufferMemoryBarrierCount,
5373 const VkBufferMemoryBarrier* pBufferMemoryBarriers,
5374 u32 imageMemoryBarrierCount,
5375 const VkImageMemoryBarrier* pImageMemoryBarriers) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005376 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005377
Jesse Hall3dd678a2016-01-08 21:52:01 -08005378 memoryBarriers := pMemoryBarriers[0:memoryBarrierCount]
Jesse Hall3fbc8562015-11-29 22:10:52 -08005379 for i in (0 .. memoryBarrierCount) {
Jesse Hall3dd678a2016-01-08 21:52:01 -08005380 memoryBarrier := memoryBarriers[i]
5381 }
5382 bufferMemoryBarriers := pBufferMemoryBarriers[0:bufferMemoryBarrierCount]
5383 for i in (0 .. bufferMemoryBarrierCount) {
5384 bufferMemoryBarrier := bufferMemoryBarriers[i]
5385 bufferObject := GetBuffer(bufferMemoryBarrier.buffer)
5386 assert(bufferObject.device == commandBufferObject.device)
5387 }
5388 imageMemoryBarriers := pImageMemoryBarriers[0:imageMemoryBarrierCount]
5389 for i in (0 .. imageMemoryBarrierCount) {
5390 imageMemoryBarrier := imageMemoryBarriers[i]
5391 imageObject := GetImage(imageMemoryBarrier.image)
5392 assert(imageObject.device == commandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005393 }
5394}
5395
5396@threadSafety("app")
5397cmd void vkCmdBeginQuery(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005398 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005399 VkQueryPool queryPool,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005400 u32 query,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005401 VkQueryControlFlags flags) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005402 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005403 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005404 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005405}
5406
5407@threadSafety("app")
5408cmd void vkCmdEndQuery(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005409 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005410 VkQueryPool queryPool,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005411 u32 query) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005412 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005413 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005414 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005415}
5416
5417@threadSafety("app")
5418cmd void vkCmdResetQueryPool(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005419 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005420 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005421 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005422 u32 queryCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005423 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005424 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005425 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005426}
5427
5428@threadSafety("app")
5429cmd void vkCmdWriteTimestamp(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005430 VkCommandBuffer commandBuffer,
Jesse Hall6f39a6d2015-11-24 11:08:36 -08005431 VkPipelineStageFlagBits pipelineStage,
Jesse Halla3a7a1d2015-11-24 11:37:23 -08005432 VkQueryPool queryPool,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005433 u32 query) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005434 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halla3a7a1d2015-11-24 11:37:23 -08005435 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005436 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005437}
5438
5439@threadSafety("app")
5440cmd void vkCmdCopyQueryPoolResults(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005441 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005442 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005443 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005444 u32 queryCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005445 VkBuffer dstBuffer,
5446 VkDeviceSize dstOffset,
Jesse Halla9bb62b2015-11-21 19:31:56 -08005447 VkDeviceSize stride,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005448 VkQueryResultFlags flags) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005449 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005450 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005451 dstBufferObject := GetBuffer(dstBuffer)
5452 assert(commandBufferObject.device == queryPoolObject.device)
5453 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005454}
5455
5456cmd void vkCmdPushConstants(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005457 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005458 VkPipelineLayout layout,
5459 VkShaderStageFlags stageFlags,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005460 u32 offset,
5461 u32 size,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08005462 const void* pValues) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005463 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005464 layoutObject := GetPipelineLayout(layout)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005465 assert(commandBufferObject.device == layoutObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005466}
5467
5468@threadSafety("app")
5469cmd void vkCmdBeginRenderPass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005470 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005471 const VkRenderPassBeginInfo* pRenderPassBegin,
Jesse Hall65ab5522015-11-30 00:07:16 -08005472 VkSubpassContents contents) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005473 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005474 renderPassObject := GetRenderPass(pRenderPassBegin.renderPass)
5475 framebufferObject := GetFramebuffer(pRenderPassBegin.framebuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005476 assert(commandBufferObject.device == renderPassObject.device)
5477 assert(commandBufferObject.device == framebufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005478
Jesse Hall3fbc8562015-11-29 22:10:52 -08005479 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005480}
5481
5482cmd void vkCmdNextSubpass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005483 VkCommandBuffer commandBuffer,
Jesse Hall65ab5522015-11-30 00:07:16 -08005484 VkSubpassContents contents) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005485 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005486}
5487
5488@threadSafety("app")
5489cmd void vkCmdEndRenderPass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005490 VkCommandBuffer commandBuffer) {
5491 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005492
Jesse Hall3fbc8562015-11-29 22:10:52 -08005493 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005494}
5495
5496cmd void vkCmdExecuteCommands(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005497 VkCommandBuffer commandBuffer,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005498 u32 commandBufferCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005499 const VkCommandBuffer* pCommandBuffers) {
5500 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005501
Jesse Hall3dd678a2016-01-08 21:52:01 -08005502 commandBuffers := pCommandBuffers[0:commandBufferCount]
5503 for i in (0 .. commandBufferCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005504 secondaryCommandBuffer := commandBuffers[i]
5505 secondaryCommandBufferObject := GetCommandBuffer(secondaryCommandBuffer)
5506 assert(commandBufferObject.device == secondaryCommandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005507 }
5508}
5509
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005510@extension("VK_KHR_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005511cmd void vkDestroySurfaceKHR(
5512 VkInstance instance,
Jesse Hall0e74f002015-11-30 11:37:59 -08005513 VkSurfaceKHR surface,
5514 const VkAllocationCallbacks* pAllocator) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005515 instanceObject := GetInstance(instance)
5516 surfaceObject := GetSurface(surface)
5517 assert(surfaceObject.instance == instance)
Michael Lentine88594d72015-11-12 12:49:45 -08005518
Jesse Hall1356b0d2015-11-23 17:24:58 -08005519 State.Surfaces[surface] = null
Jesse Hall2818f932015-11-19 21:19:17 -08005520}
5521
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005522@extension("VK_KHR_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005523cmd VkResult vkGetPhysicalDeviceSurfaceSupportKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005524 VkPhysicalDevice physicalDevice,
5525 u32 queueFamilyIndex,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005526 VkSurfaceKHR surface,
Jesse Hallb00daad2015-11-29 19:46:20 -08005527 VkBool32* pSupported) {
5528 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08005529
5530 return ?
5531}
5532
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005533@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08005534cmd VkResult vkGetPhysicalDeviceSurfaceCapabilitiesKHR(
5535 VkPhysicalDevice physicalDevice,
5536 VkSurfaceKHR surface,
5537 VkSurfaceCapabilitiesKHR* pSurfaceCapabilities) {
5538 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5539
5540 surfaceCapabilities := ?
5541 pSurfaceCapabilities[0] = surfaceCapabilities
5542
5543 return ?
5544}
5545
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005546@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08005547cmd VkResult vkGetPhysicalDeviceSurfaceFormatsKHR(
5548 VkPhysicalDevice physicalDevice,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005549 VkSurfaceKHR surface,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005550 u32* pSurfaceFormatCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005551 VkSurfaceFormatKHR* pSurfaceFormats) {
Jesse Hallb00daad2015-11-29 19:46:20 -08005552 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08005553
5554 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08005555 pSurfaceFormatCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08005556 surfaceFormats := pSurfaceFormats[0:count]
5557
5558 for i in (0 .. count) {
5559 surfaceFormat := ?
5560 surfaceFormats[i] = surfaceFormat
5561 }
5562
5563 return ?
5564}
5565
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005566@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08005567cmd VkResult vkGetPhysicalDeviceSurfacePresentModesKHR(
5568 VkPhysicalDevice physicalDevice,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005569 VkSurfaceKHR surface,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005570 u32* pPresentModeCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005571 VkPresentModeKHR* pPresentModes) {
Jesse Hallb00daad2015-11-29 19:46:20 -08005572 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08005573
5574 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08005575 pPresentModeCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08005576 presentModes := pPresentModes[0:count]
5577
5578 for i in (0 .. count) {
5579 presentMode := ?
5580 presentModes[i] = presentMode
5581 }
5582
5583 return ?
5584}
5585
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005586@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005587cmd VkResult vkCreateSwapchainKHR(
5588 VkDevice device,
5589 const VkSwapchainCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005590 const VkAllocationCallbacks* pAllocator,
Michael Lentine88594d72015-11-12 12:49:45 -08005591 VkSwapchainKHR* pSwapchain) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005592 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR)
Michael Lentine88594d72015-11-12 12:49:45 -08005593 deviceObject := GetDevice(device)
5594
5595 swapchain := ?
5596 pSwapchain[0] = swapchain
5597 State.Swapchains[swapchain] = new!SwapchainObject(device: device)
5598
5599 return ?
5600}
5601
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005602@extension("VK_KHR_swapchain")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005603cmd void vkDestroySwapchainKHR(
Michael Lentine88594d72015-11-12 12:49:45 -08005604 VkDevice device,
Jesse Hall0e74f002015-11-30 11:37:59 -08005605 VkSwapchainKHR swapchain,
5606 const VkAllocationCallbacks* pAllocator) {
Michael Lentine88594d72015-11-12 12:49:45 -08005607 deviceObject := GetDevice(device)
5608 swapchainObject := GetSwapchain(swapchain)
5609 assert(swapchainObject.device == device)
5610
5611 State.Swapchains[swapchain] = null
Michael Lentine88594d72015-11-12 12:49:45 -08005612}
5613
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005614@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005615cmd VkResult vkGetSwapchainImagesKHR(
5616 VkDevice device,
5617 VkSwapchainKHR swapchain,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005618 u32* pSwapchainImageCount,
Michael Lentine88594d72015-11-12 12:49:45 -08005619 VkImage* pSwapchainImages) {
5620 deviceObject := GetDevice(device)
5621
5622 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08005623 pSwapchainImageCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08005624 swapchainImages := pSwapchainImages[0:count]
5625
5626 for i in (0 .. count) {
5627 swapchainImage := ?
5628 swapchainImages[i] = swapchainImage
Jesse Hall1356b0d2015-11-23 17:24:58 -08005629 State.Images[swapchainImage] = new!ImageObject(device: device)
Michael Lentine88594d72015-11-12 12:49:45 -08005630 }
5631
5632 return ?
5633}
5634
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005635@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005636cmd VkResult vkAcquireNextImageKHR(
5637 VkDevice device,
5638 VkSwapchainKHR swapchain,
5639 u64 timeout,
5640 VkSemaphore semaphore,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005641 VkFence fence,
Michael Lentine88594d72015-11-12 12:49:45 -08005642 u32* pImageIndex) {
5643 deviceObject := GetDevice(device)
5644 swapchainObject := GetSwapchain(swapchain)
5645
5646 imageIndex := ?
5647 pImageIndex[0] = imageIndex
5648
5649 return ?
5650}
5651
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005652@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005653cmd VkResult vkQueuePresentKHR(
5654 VkQueue queue,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08005655 const VkPresentInfoKHR* pPresentInfo) {
Michael Lentine88594d72015-11-12 12:49:45 -08005656 queueObject := GetQueue(queue)
5657
5658 presentInfo := ?
5659 pPresentInfo[0] = presentInfo
5660
5661 return ?
5662}
5663
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005664@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005665cmd VkResult vkGetPhysicalDeviceDisplayPropertiesKHR(
5666 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005667 u32* pPropertyCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005668 VkDisplayPropertiesKHR* pProperties) {
5669 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5670 return ?
5671}
5672
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005673@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005674cmd VkResult vkGetPhysicalDeviceDisplayPlanePropertiesKHR(
5675 VkPhysicalDevice physicalDevice,
5676 u32* pPropertyCount,
5677 VkDisplayPlanePropertiesKHR* pProperties) {
5678 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5679 return ?
5680}
5681
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005682@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005683cmd VkResult vkGetDisplayPlaneSupportedDisplaysKHR(
5684 VkPhysicalDevice physicalDevice,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005685 u32 planeIndex,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08005686 u32* pDisplayCount,
5687 VkDisplayKHR* pDisplays) {
Jesse Halla6429252015-11-29 18:59:42 -08005688 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5689 return ?
5690}
5691
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005692@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005693cmd VkResult vkGetDisplayModePropertiesKHR(
5694 VkPhysicalDevice physicalDevice,
5695 VkDisplayKHR display,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005696 u32* pPropertyCount,
5697 VkDisplayModePropertiesKHR* pProperties) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005698 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5699 return ?
5700}
5701
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005702@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005703cmd VkResult vkCreateDisplayModeKHR(
5704 VkPhysicalDevice physicalDevice,
5705 VkDisplayKHR display,
5706 const VkDisplayModeCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005707 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005708 VkDisplayModeKHR* pMode) {
5709 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5710 return ?
5711}
5712
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005713@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005714cmd VkResult vkGetDisplayPlaneCapabilitiesKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005715 VkPhysicalDevice physicalDevice,
Jesse Hall9ba8bc82015-11-30 16:22:16 -08005716 VkDisplayModeKHR mode,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005717 u32 planeIndex,
Jesse Halla6429252015-11-29 18:59:42 -08005718 VkDisplayPlaneCapabilitiesKHR* pCapabilities) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005719 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5720 return ?
5721}
5722
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005723@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005724cmd VkResult vkCreateDisplayPlaneSurfaceKHR(
5725 VkInstance instance,
5726 const VkDisplaySurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005727 const VkAllocationCallbacks* pAllocator,
Jesse Halla6429252015-11-29 18:59:42 -08005728 VkSurfaceKHR* pSurface) {
5729 return ?
5730}
5731
Jesse Hall9ba8bc82015-11-30 16:22:16 -08005732@extension("VK_KHR_display_swapchain")
5733cmd VkResult vkCreateSharedSwapchainsKHR(
5734 VkDevice device,
5735 u32 swapchainCount,
5736 const VkSwapchainCreateInfoKHR* pCreateInfos,
5737 const VkAllocationCallbacks* pAllocator,
5738 VkSwapchainKHR* pSwapchains) {
5739 return ?
5740}
5741
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005742@extension("VK_KHR_xlib_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005743cmd VkResult vkCreateXlibSurfaceKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005744 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005745 const VkXlibSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005746 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005747 VkSurfaceKHR* pSurface) {
5748 instanceObject := GetInstance(instance)
5749 return ?
5750}
5751
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005752@extension("VK_KHR_xlib_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005753cmd VkBool32 vkGetPhysicalDeviceXlibPresentationSupportKHR(
5754 VkPhysicalDevice physicalDevice,
5755 u32 queueFamilyIndex,
5756 platform.Display* dpy,
Jesse Hall65ab5522015-11-30 00:07:16 -08005757 platform.VisualID visualID) {
Jesse Halla6429252015-11-29 18:59:42 -08005758 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5759 return ?
5760}
5761
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005762@extension("VK_KHR_xcb_surface")
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005763cmd VkResult vkCreateXcbSurfaceKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005764 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005765 const VkXcbSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005766 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005767 VkSurfaceKHR* pSurface) {
5768 instanceObject := GetInstance(instance)
5769 return ?
5770}
5771
Jesse Hall523db342015-11-30 21:12:55 -08005772@extension("VK_KHR_xcb_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005773cmd VkBool32 vkGetPhysicalDeviceXcbPresentationSupportKHR(
5774 VkPhysicalDevice physicalDevice,
5775 u32 queueFamilyIndex,
5776 platform.xcb_connection_t* connection,
5777 platform.xcb_visualid_t visual_id) {
5778 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5779 return ?
5780}
5781
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005782@extension("VK_KHR_wayland_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005783cmd VkResult vkCreateWaylandSurfaceKHR(
5784 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005785 const VkWaylandSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005786 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005787 VkSurfaceKHR* pSurface) {
5788 instanceObject := GetInstance(instance)
5789 return ?
5790}
5791
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005792@extension("VK_KHR_wayland_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005793cmd VkBool32 vkGetPhysicalDeviceWaylandPresentationSupportKHR(
5794 VkPhysicalDevice physicalDevice,
5795 u32 queueFamilyIndex,
5796 platform.wl_display* display) {
5797 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5798 return ?
5799}
5800
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005801@extension("VK_KHR_mir_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005802cmd VkResult vkCreateMirSurfaceKHR(
5803 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005804 const VkMirSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005805 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005806 VkSurfaceKHR* pSurface) {
5807 instanceObject := GetInstance(instance)
5808 return ?
5809}
5810
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005811@extension("VK_KHR_mir_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005812cmd VkBool32 vkGetPhysicalDeviceMirPresentationSupportKHR(
5813 VkPhysicalDevice physicalDevice,
5814 u32 queueFamilyIndex,
5815 platform.MirConnection* connection) {
5816 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5817 return ?
5818}
5819
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005820@extension("VK_KHR_android_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005821cmd VkResult vkCreateAndroidSurfaceKHR(
5822 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005823 const VkAndroidSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005824 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005825 VkSurfaceKHR* pSurface) {
5826 instanceObject := GetInstance(instance)
5827 return ?
5828}
5829
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005830@extension("VK_KHR_win32_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005831cmd VkResult vkCreateWin32SurfaceKHR(
5832 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005833 const VkWin32SurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005834 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005835 VkSurfaceKHR* pSurface) {
5836 instanceObject := GetInstance(instance)
5837 return ?
5838}
5839
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005840@extension("VK_KHR_win32_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005841cmd VkResult vkGetPhysicalDeviceWin32PresentationSupportKHR(
5842 VkPhysicalDevice physicalDevice,
5843 u32 queueFamilyIndex) {
Jesse Halle2948d82016-02-25 04:19:32 -08005844 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Jesse Halla6429252015-11-29 18:59:42 -08005845 return ?
5846}
5847
Chia-I Wub262ddc2016-03-22 07:38:20 +08005848@extension("VK_ANDROID_native_buffer")
Jesse Halld1abd742017-02-09 21:45:51 -08005849@optional
Chia-I Wub262ddc2016-03-22 07:38:20 +08005850cmd VkResult vkGetSwapchainGrallocUsageANDROID(
5851 VkDevice device,
5852 VkFormat format,
5853 VkImageUsageFlags imageUsage,
Jesse Halld1abd742017-02-09 21:45:51 -08005854 s32* grallocUsage) {
Chia-I Wub262ddc2016-03-22 07:38:20 +08005855 return ?
5856}
5857
5858@extension("VK_ANDROID_native_buffer")
Jesse Halld1abd742017-02-09 21:45:51 -08005859@optional
Chris Forbes8e4438b2016-12-07 16:26:49 +13005860cmd VkResult vkGetSwapchainGrallocUsage2ANDROID(
5861 VkDevice device,
5862 VkFormat format,
5863 VkImageUsageFlags imageUsage,
5864 VkSwapchainImageUsageFlagsANDROID swapchainImageUsage,
Jesse Halld1abd742017-02-09 21:45:51 -08005865 u64* grallocConsumerUsage,
5866 u64* grallocProducerUsage) {
Chris Forbes8e4438b2016-12-07 16:26:49 +13005867 return ?
5868}
5869
5870@extension("VK_ANDROID_native_buffer")
Chia-I Wub262ddc2016-03-22 07:38:20 +08005871cmd VkResult vkAcquireImageANDROID(
5872 VkDevice device,
5873 VkImage image,
5874 int nativeFenceFd,
5875 VkSemaphore semaphore,
5876 VkFence fence) {
5877 return ?
5878}
5879
5880@extension("VK_ANDROID_native_buffer")
5881cmd VkResult vkQueueSignalReleaseImageANDROID(
5882 VkQueue queue,
5883 u32 waitSemaphoreCount,
5884 const VkSemaphore* pWaitSemaphores,
5885 VkImage image,
5886 int* pNativeFenceFd) {
5887 return ?
5888}
5889
Ian Elliott4c8bb2a2016-12-29 11:07:26 -07005890@extension("VK_GOOGLE_display_timing")
5891cmd VkResult vkGetRefreshCycleDurationGOOGLE(
5892 VkDevice device,
5893 VkSwapchainKHR swapchain,
5894 VkRefreshCycleDurationGOOGLE* pDisplayTimingProperties) {
5895 deviceObject := GetDevice(device)
5896 swapchainObject := GetSwapchain(swapchain)
5897
5898 displayTimingProperties := ?
5899 pDisplayTimingProperties[0] = displayTimingProperties
5900
5901 return ?
5902}
5903
5904@extension("VK_GOOGLE_display_timing")
5905cmd VkResult vkGetPastPresentationTimingGOOGLE(
5906 VkDevice device,
5907 VkSwapchainKHR swapchain,
5908 u32* pPresentationTimingCount,
5909 VkPastPresentationTimingGOOGLE* pPresentationTimings) {
Ian Elliott4c8bb2a2016-12-29 11:07:26 -07005910 return ?
5911}
5912
Jesse Hall715b86a2016-01-16 16:34:29 -08005913@extension("VK_EXT_debug_report")
5914@external type void* PFN_vkDebugReportCallbackEXT
5915@extension("VK_EXT_debug_report")
5916@pfn cmd VkBool32 vkDebugReportCallbackEXT(
5917 VkDebugReportFlagsEXT flags,
5918 VkDebugReportObjectTypeEXT objectType,
5919 u64 object,
5920 platform.size_t location,
5921 s32 messageCode,
5922 const char* pLayerPrefix,
5923 const char* pMessage,
5924 void* pUserData) {
5925 return ?
5926}
5927
5928@extension("VK_EXT_debug_report")
5929cmd VkResult vkCreateDebugReportCallbackEXT(
5930 VkInstance instance,
5931 const VkDebugReportCallbackCreateInfoEXT* pCreateInfo,
5932 const VkAllocationCallbacks* pAllocator,
5933 VkDebugReportCallbackEXT* pCallback) {
5934 return ?
5935}
5936
5937@extension("VK_EXT_debug_report")
5938cmd void vkDestroyDebugReportCallbackEXT(
5939 VkInstance instance,
5940 VkDebugReportCallbackEXT callback,
5941 const VkAllocationCallbacks* pAllocator) {
5942}
5943
5944@extension("VK_EXT_debug_report")
5945cmd void vkDebugReportMessageEXT(
5946 VkInstance instance,
5947 VkDebugReportFlagsEXT flags,
5948 VkDebugReportObjectTypeEXT objectType,
5949 u64 object,
5950 platform.size_t location,
5951 s32 messageCode,
5952 const char* pLayerPrefix,
5953 const char* pMessage) {
5954}
5955
Jesse Hall26763382016-05-20 07:13:52 -07005956@extension("VK_EXT_debug_marker")
5957cmd VkResult vkDebugMarkerSetObjectTagEXT(
5958 VkDevice device,
5959 VkDebugMarkerObjectTagInfoEXT* pTagInfo) {
5960 return ?
5961}
5962
5963@extension("VK_EXT_debug_marker")
5964cmd VkResult vkDebugMarkerSetObjectNameEXT(
5965 VkDevice device,
5966 VkDebugMarkerObjectNameInfoEXT* pNameInfo) {
5967 return ?
5968}
5969
5970@extension("VK_EXT_debug_marker")
5971cmd void vkCmdDebugMarkerBeginEXT(
5972 VkCommandBuffer commandBuffer,
5973 VkDebugMarkerMarkerInfoEXT* pMarkerInfo) {
5974}
5975
5976@extension("VK_EXT_debug_marker")
5977cmd void vkCmdDebugMarkerEndEXT(
5978 VkCommandBuffer commandBuffer) {
5979}
5980
5981@extension("VK_EXT_debug_marker")
5982cmd void vkCmdDebugMarkerInsertEXT(
5983 VkCommandBuffer commandBuffer,
5984 VkDebugMarkerMarkerInfoEXT* pMarkerInfo) {
5985}
5986
Jesse Halleb02c472017-02-24 15:13:45 -08005987@extension("VK_AMD_draw_indirect_count")
5988cmd void vkCmdDrawIndirectCountAMD(
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_AMD_draw_indirect_count")
5999cmd void vkCmdDrawIndexedIndirectCountAMD(
6000 VkCommandBuffer commandBuffer,
6001 VkBuffer buffer,
6002 VkDeviceSize offset,
6003 VkBuffer countBuffer,
6004 VkDeviceSize countBufferOffset,
6005 u32 maxDrawCount,
6006 u32 stride) {
6007}
6008
6009@extension("VK_NV_external_memory_capabilities")
6010cmd VkResult vkGetPhysicalDeviceExternalImageFormatPropertiesNV(
6011 VkPhysicalDevice physicalDevice,
6012 VkFormat format,
6013 VkImageType type,
6014 VkImageTiling tiling,
6015 VkImageUsageFlags usage,
6016 VkImageCreateFlags flags,
6017 VkExternalMemoryHandleTypeFlagsNV externalHandleType,
6018 VkExternalImageFormatPropertiesNV* pExternalImageFormatProperties) {
6019 return ?
6020}
6021
6022@extension("VK_NV_external_memory_win32")
6023cmd VkResult vkGetMemoryWin32HandleNV(
6024 VkDevice device,
6025 VkDeviceMemory memory,
6026 VkExternalMemoryHandleTypeFlagsNV handleType,
6027 platform.HANDLE* pHandle) {
6028 return ?
6029}
6030
Chris Forbes1194ede2016-12-30 16:29:25 +13006031@extension("VK_KHR_get_physical_device_properties2")
6032cmd void vkGetPhysicalDeviceFeatures2KHR(
6033 VkPhysicalDevice physicalDevice,
6034 VkPhysicalDeviceFeatures2KHR* pFeatures) {
6035}
6036
6037@extension("VK_KHR_get_physical_device_properties2")
6038cmd void vkGetPhysicalDeviceProperties2KHR(
6039 VkPhysicalDevice physicalDevice,
6040 VkPhysicalDeviceProperties2KHR* pProperties) {
6041}
6042
6043@extension("VK_KHR_get_physical_device_properties2")
6044cmd void vkGetPhysicalDeviceFormatProperties2KHR(
6045 VkPhysicalDevice physicalDevice,
6046 VkFormat format,
6047 VkFormatProperties2KHR* pFormatProperties) {
6048}
6049
6050@extension("VK_KHR_get_physical_device_properties2")
6051cmd VkResult vkGetPhysicalDeviceImageFormatProperties2KHR(
6052 VkPhysicalDevice physicalDevice,
6053 const VkPhysicalDeviceImageFormatInfo2KHR* pImageFormatInfo,
6054 VkImageFormatProperties2KHR* pImageFormatProperties) {
6055 return ?
6056}
6057
6058@extension("VK_KHR_get_physical_device_properties2")
6059cmd void vkGetPhysicalDeviceQueueFamilyProperties2KHR(
6060 VkPhysicalDevice physicalDevice,
6061 u32* pQueueFamilyPropertyCount,
6062 VkQueueFamilyProperties2KHR* pQueueFamilyProperties) {
6063}
6064
6065@extension("VK_KHR_get_physical_device_properties2")
6066cmd void vkGetPhysicalDeviceMemoryProperties2KHR(
6067 VkPhysicalDevice physicalDevice,
6068 VkPhysicalDeviceMemoryProperties2KHR* pMemoryProperties) {
6069}
6070
6071@extension("VK_KHR_get_physical_device_properties2")
6072cmd void vkGetPhysicalDeviceSparseImageFormatProperties2KHR(
6073 VkPhysicalDevice physicalDevice,
6074 const VkPhysicalDeviceSparseImageFormatInfo2KHR* pFormatInfo,
6075 u32* pPropertyCount,
6076 VkSparseImageFormatProperties2KHR* pProperties) {
6077}
6078
Jesse Halleb02c472017-02-24 15:13:45 -08006079@extension("VK_NVX_device_generated_commands")
6080cmd void vkCmdProcessCommandsNVX(
Chris Forbes289cb792016-12-30 15:03:55 +13006081 VkCommandBuffer commandBuffer,
6082 const VkCmdProcessCommandsInfoNVX* pProcessCommandsInfo) {
6083}
6084
Jesse Halleb02c472017-02-24 15:13:45 -08006085@extension("VK_NVX_device_generated_commands")
6086cmd void vkCmdReserveSpaceForCommandsNVX(
Chris Forbes289cb792016-12-30 15:03:55 +13006087 VkCommandBuffer commandBuffer,
6088 const VkCmdReserveSpaceForCommandsInfoNVX* pReserveSpaceInfo) {
6089}
6090
Jesse Halleb02c472017-02-24 15:13:45 -08006091@extension("VK_NVX_device_generated_commands")
6092cmd VkResult vkCreateIndirectCommandsLayoutNVX(
Chris Forbes289cb792016-12-30 15:03:55 +13006093 VkDevice device,
6094 const VkIndirectCommandsLayoutCreateInfoNVX* pCreateInfo,
6095 const VkAllocationCallbacks* pAllocator,
6096 VkIndirectCommandsLayoutNVX* pIndirectCommandsLayout) {
6097 return ?
6098}
6099
Jesse Halleb02c472017-02-24 15:13:45 -08006100@extension("VK_NVX_device_generated_commands")
6101cmd void vkDestroyIndirectCommandsLayoutNVX(
Chris Forbes289cb792016-12-30 15:03:55 +13006102 VkDevice device,
6103 VkIndirectCommandsLayoutNVX indirectCommandsLayout,
6104 const VkAllocationCallbacks* pAllocator) {
6105}
6106
Jesse Halleb02c472017-02-24 15:13:45 -08006107@extension("VK_NVX_device_generated_commands")
6108cmd VkResult vkCreateObjectTableNVX(
Chris Forbes289cb792016-12-30 15:03:55 +13006109 VkDevice device,
6110 const VkObjectTableCreateInfoNVX* pCreateInfo,
6111 const VkAllocationCallbacks* pAllocator,
6112 VkObjectTableNVX* pObjectTable) {
6113 return ?
6114}
6115
Jesse Halleb02c472017-02-24 15:13:45 -08006116@extension("VK_NVX_device_generated_commands")
6117cmd void vkDestroyObjectTableNVX(
Chris Forbes289cb792016-12-30 15:03:55 +13006118 VkDevice device,
6119 VkObjectTableNVX objectTable,
6120 const VkAllocationCallbacks* pAllocator) {
6121}
6122
Jesse Halleb02c472017-02-24 15:13:45 -08006123@extension("VK_NVX_device_generated_commands")
6124cmd VkResult vkRegisterObjectsNVX(
Chris Forbes289cb792016-12-30 15:03:55 +13006125 VkDevice device,
6126 VkObjectTableNVX objectTable,
6127 u32 objectCount,
6128 const VkObjectTableEntryNVX* const* ppObjectTableEntries,
6129 const u32* pObjectIndices) {
6130 return ?
6131}
6132
Jesse Halleb02c472017-02-24 15:13:45 -08006133@extension("VK_NVX_device_generated_commands")
6134cmd VkResult vkUnregisterObjectsNVX(
Chris Forbes289cb792016-12-30 15:03:55 +13006135 VkDevice device,
6136 VkObjectTableNVX objectTable,
6137 u32 objectCount,
6138 const VkObjectEntryTypeNVX* pObjectEntryTypes,
6139 const u32* pObjectIndices) {
6140 return ?
6141}
6142
Jesse Halleb02c472017-02-24 15:13:45 -08006143@extension("VK_NVX_device_generated_commands")
6144cmd void vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX(
Chris Forbes289cb792016-12-30 15:03:55 +13006145 VkPhysicalDevice physicalDevice,
6146 VkDeviceGeneratedCommandsFeaturesNVX* pFeatures,
6147 VkDeviceGeneratedCommandsLimitsNVX* pLimits) {
6148}
6149
Jesse Hall889cd9a2017-02-25 22:12:23 -08006150@extension("VK_EXT_hdr_metadata")
6151cmd void vkSetHdrMetadataEXT(
6152 VkDevice device,
6153 u32 swapchainCount,
6154 const VkSwapchainKHR* pSwapchains,
6155 const VkHdrMetadataEXT* pMetadata) {
6156}
6157
Chris Forbes1d5f68c2017-01-31 10:17:01 +13006158@extension("VK_KHR_shared_presentable_image")
Chris Forbes2e12cb82017-01-18 11:45:17 +13006159cmd VkResult vkGetSwapchainStatusKHR(
6160 VkDevice device,
6161 VkSwapchainKHR swapchain) {
6162 return ?
6163}
6164
Jesse Halld27f6aa2015-08-15 17:58:48 -07006165////////////////
6166// Validation //
6167////////////////
6168
6169extern void validate(string layerName, bool condition, string message)
6170
6171
6172/////////////////////////////
6173// Internal State Tracking //
6174/////////////////////////////
6175
6176StateObject State
6177
6178@internal class StateObject {
6179 // Dispatchable objects.
6180 map!(VkInstance, ref!InstanceObject) Instances
6181 map!(VkPhysicalDevice, ref!PhysicalDeviceObject) PhysicalDevices
6182 map!(VkDevice, ref!DeviceObject) Devices
6183 map!(VkQueue, ref!QueueObject) Queues
Jesse Hall3fbc8562015-11-29 22:10:52 -08006184 map!(VkCommandBuffer, ref!CommandBufferObject) CommandBuffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07006185
6186 // Non-dispatchable objects.
6187 map!(VkDeviceMemory, ref!DeviceMemoryObject) DeviceMemories
6188 map!(VkBuffer, ref!BufferObject) Buffers
6189 map!(VkBufferView, ref!BufferViewObject) BufferViews
6190 map!(VkImage, ref!ImageObject) Images
6191 map!(VkImageView, ref!ImageViewObject) ImageViews
Jesse Halld27f6aa2015-08-15 17:58:48 -07006192 map!(VkShaderModule, ref!ShaderModuleObject) ShaderModules
Jesse Halld27f6aa2015-08-15 17:58:48 -07006193 map!(VkPipeline, ref!PipelineObject) Pipelines
6194 map!(VkPipelineLayout, ref!PipelineLayoutObject) PipelineLayouts
6195 map!(VkSampler, ref!SamplerObject) Samplers
6196 map!(VkDescriptorSet, ref!DescriptorSetObject) DescriptorSets
6197 map!(VkDescriptorSetLayout, ref!DescriptorSetLayoutObject) DescriptorSetLayouts
6198 map!(VkDescriptorPool, ref!DescriptorPoolObject) DescriptorPools
Jesse Halld27f6aa2015-08-15 17:58:48 -07006199 map!(VkFence, ref!FenceObject) Fences
6200 map!(VkSemaphore, ref!SemaphoreObject) Semaphores
6201 map!(VkEvent, ref!EventObject) Events
6202 map!(VkQueryPool, ref!QueryPoolObject) QueryPools
6203 map!(VkFramebuffer, ref!FramebufferObject) Framebuffers
6204 map!(VkRenderPass, ref!RenderPassObject) RenderPasses
6205 map!(VkPipelineCache, ref!PipelineCacheObject) PipelineCaches
Jesse Hall3fbc8562015-11-29 22:10:52 -08006206 map!(VkCommandPool, ref!CommandPoolObject) CommandPools
Jesse Hall1356b0d2015-11-23 17:24:58 -08006207 map!(VkSurfaceKHR, ref!SurfaceObject) Surfaces
Michael Lentine88594d72015-11-12 12:49:45 -08006208 map!(VkSwapchainKHR, ref!SwapchainObject) Swapchains
Jesse Halld27f6aa2015-08-15 17:58:48 -07006209}
6210
6211@internal class InstanceObject {
6212}
6213
6214@internal class PhysicalDeviceObject {
6215 VkInstance instance
6216}
6217
6218@internal class DeviceObject {
6219 VkPhysicalDevice physicalDevice
6220}
6221
6222@internal class QueueObject {
6223 VkDevice device
6224 VkQueueFlags flags
6225}
6226
Jesse Hall3fbc8562015-11-29 22:10:52 -08006227@internal class CommandBufferObject {
Jesse Halld27f6aa2015-08-15 17:58:48 -07006228 VkDevice device
6229 map!(u64, VkDeviceMemory) boundObjects
6230 VkQueueFlags queueFlags
6231}
6232
6233@internal class DeviceMemoryObject {
Jesse Hall3fbc8562015-11-29 22:10:52 -08006234 VkDevice device
6235 VkDeviceSize allocationSize
6236 map!(u64, VkDeviceSize) boundObjects
6237 map!(VkCommandBuffer, VkCommandBuffer) boundCommandBuffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07006238}
6239
6240@internal class BufferObject {
6241 VkDevice device
Jesse Hall3fbc8562015-11-29 22:10:52 -08006242 VkDeviceMemory memory
6243 VkDeviceSize memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07006244}
6245
6246@internal class BufferViewObject {
6247 VkDevice device
6248 VkBuffer buffer
6249}
6250
6251@internal class ImageObject {
6252 VkDevice device
Jesse Hall3fbc8562015-11-29 22:10:52 -08006253 VkDeviceMemory memory
6254 VkDeviceSize memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07006255}
6256
6257@internal class ImageViewObject {
6258 VkDevice device
6259 VkImage image
6260}
6261
Jesse Halld27f6aa2015-08-15 17:58:48 -07006262@internal class ShaderObject {
6263 VkDevice device
6264}
6265
6266@internal class ShaderModuleObject {
6267 VkDevice device
6268}
6269
6270@internal class PipelineObject {
6271 VkDevice device
6272}
6273
6274@internal class PipelineLayoutObject {
6275 VkDevice device
6276}
6277
6278@internal class SamplerObject {
6279 VkDevice device
6280}
6281
6282@internal class DescriptorSetObject {
6283 VkDevice device
6284}
6285
6286@internal class DescriptorSetLayoutObject {
6287 VkDevice device
6288}
6289
6290@internal class DescriptorPoolObject {
6291 VkDevice device
6292}
6293
Jesse Halld27f6aa2015-08-15 17:58:48 -07006294@internal class FenceObject {
6295 VkDevice device
6296 bool signaled
6297}
6298
6299@internal class SemaphoreObject {
6300 VkDevice device
6301}
6302
6303@internal class EventObject {
6304 VkDevice device
6305}
6306
6307@internal class QueryPoolObject {
6308 VkDevice device
6309}
6310
6311@internal class FramebufferObject {
6312 VkDevice device
6313}
6314
6315@internal class RenderPassObject {
6316 VkDevice device
6317}
6318
6319@internal class PipelineCacheObject {
6320 VkDevice device
6321}
6322
Jesse Hall3fbc8562015-11-29 22:10:52 -08006323@internal class CommandPoolObject {
Jesse Halld27f6aa2015-08-15 17:58:48 -07006324 VkDevice device
6325}
6326
Jesse Hall1356b0d2015-11-23 17:24:58 -08006327@internal class SurfaceObject {
6328 VkInstance instance
6329}
6330
Michael Lentine88594d72015-11-12 12:49:45 -08006331@internal class SwapchainObject {
6332 VkDevice device
6333}
6334
Jesse Halld27f6aa2015-08-15 17:58:48 -07006335macro ref!InstanceObject GetInstance(VkInstance instance) {
6336 assert(instance in State.Instances)
6337 return State.Instances[instance]
6338}
6339
6340macro ref!PhysicalDeviceObject GetPhysicalDevice(VkPhysicalDevice physicalDevice) {
6341 assert(physicalDevice in State.PhysicalDevices)
6342 return State.PhysicalDevices[physicalDevice]
6343}
6344
6345macro ref!DeviceObject GetDevice(VkDevice device) {
6346 assert(device in State.Devices)
6347 return State.Devices[device]
6348}
6349
6350macro ref!QueueObject GetQueue(VkQueue queue) {
6351 assert(queue in State.Queues)
6352 return State.Queues[queue]
6353}
6354
Jesse Hall3fbc8562015-11-29 22:10:52 -08006355macro ref!CommandBufferObject GetCommandBuffer(VkCommandBuffer commandBuffer) {
6356 assert(commandBuffer in State.CommandBuffers)
6357 return State.CommandBuffers[commandBuffer]
Jesse Halld27f6aa2015-08-15 17:58:48 -07006358}
6359
Jesse Hall3fbc8562015-11-29 22:10:52 -08006360macro ref!DeviceMemoryObject GetDeviceMemory(VkDeviceMemory memory) {
6361 assert(memory in State.DeviceMemories)
6362 return State.DeviceMemories[memory]
Jesse Halld27f6aa2015-08-15 17:58:48 -07006363}
6364
6365macro ref!BufferObject GetBuffer(VkBuffer buffer) {
6366 assert(buffer in State.Buffers)
6367 return State.Buffers[buffer]
6368}
6369
6370macro ref!BufferViewObject GetBufferView(VkBufferView bufferView) {
6371 assert(bufferView in State.BufferViews)
6372 return State.BufferViews[bufferView]
6373}
6374
6375macro ref!ImageObject GetImage(VkImage image) {
6376 assert(image in State.Images)
6377 return State.Images[image]
6378}
6379
6380macro ref!ImageViewObject GetImageView(VkImageView imageView) {
6381 assert(imageView in State.ImageViews)
6382 return State.ImageViews[imageView]
6383}
6384
Jesse Halld27f6aa2015-08-15 17:58:48 -07006385macro ref!ShaderModuleObject GetShaderModule(VkShaderModule shaderModule) {
6386 assert(shaderModule in State.ShaderModules)
6387 return State.ShaderModules[shaderModule]
6388}
6389
6390macro ref!PipelineObject GetPipeline(VkPipeline pipeline) {
6391 assert(pipeline in State.Pipelines)
6392 return State.Pipelines[pipeline]
6393}
6394
6395macro ref!PipelineLayoutObject GetPipelineLayout(VkPipelineLayout pipelineLayout) {
6396 assert(pipelineLayout in State.PipelineLayouts)
6397 return State.PipelineLayouts[pipelineLayout]
6398}
6399
6400macro ref!SamplerObject GetSampler(VkSampler sampler) {
6401 assert(sampler in State.Samplers)
6402 return State.Samplers[sampler]
6403}
6404
6405macro ref!DescriptorSetObject GetDescriptorSet(VkDescriptorSet descriptorSet) {
6406 assert(descriptorSet in State.DescriptorSets)
6407 return State.DescriptorSets[descriptorSet]
6408}
6409
6410macro ref!DescriptorSetLayoutObject GetDescriptorSetLayout(VkDescriptorSetLayout descriptorSetLayout) {
6411 assert(descriptorSetLayout in State.DescriptorSetLayouts)
6412 return State.DescriptorSetLayouts[descriptorSetLayout]
6413}
6414
6415macro ref!DescriptorPoolObject GetDescriptorPool(VkDescriptorPool descriptorPool) {
6416 assert(descriptorPool in State.DescriptorPools)
6417 return State.DescriptorPools[descriptorPool]
6418}
6419
Jesse Halld27f6aa2015-08-15 17:58:48 -07006420macro ref!FenceObject GetFence(VkFence fence) {
6421 assert(fence in State.Fences)
6422 return State.Fences[fence]
6423}
6424
6425macro ref!SemaphoreObject GetSemaphore(VkSemaphore semaphore) {
6426 assert(semaphore in State.Semaphores)
6427 return State.Semaphores[semaphore]
6428}
6429
6430macro ref!EventObject GetEvent(VkEvent event) {
6431 assert(event in State.Events)
6432 return State.Events[event]
6433}
6434
6435macro ref!QueryPoolObject GetQueryPool(VkQueryPool queryPool) {
6436 assert(queryPool in State.QueryPools)
6437 return State.QueryPools[queryPool]
6438}
6439
6440macro ref!FramebufferObject GetFramebuffer(VkFramebuffer framebuffer) {
6441 assert(framebuffer in State.Framebuffers)
6442 return State.Framebuffers[framebuffer]
6443}
6444
6445macro ref!RenderPassObject GetRenderPass(VkRenderPass renderPass) {
6446 assert(renderPass in State.RenderPasses)
6447 return State.RenderPasses[renderPass]
6448}
6449
6450macro ref!PipelineCacheObject GetPipelineCache(VkPipelineCache pipelineCache) {
6451 assert(pipelineCache in State.PipelineCaches)
6452 return State.PipelineCaches[pipelineCache]
6453}
6454
Jesse Hall3fbc8562015-11-29 22:10:52 -08006455macro ref!CommandPoolObject GetCommandPool(VkCommandPool commandPool) {
6456 assert(commandPool in State.CommandPools)
6457 return State.CommandPools[commandPool]
Jesse Hallf09c6b12015-08-15 19:54:28 -07006458}
Michael Lentine88594d72015-11-12 12:49:45 -08006459
Jesse Hall1356b0d2015-11-23 17:24:58 -08006460macro ref!SurfaceObject GetSurface(VkSurfaceKHR surface) {
6461 assert(surface in State.Surfaces)
6462 return State.Surfaces[surface]
6463}
6464
Michael Lentine88594d72015-11-12 12:49:45 -08006465macro ref!SwapchainObject GetSwapchain(VkSwapchainKHR swapchain) {
6466 assert(swapchain in State.Swapchains)
6467 return State.Swapchains[swapchain]
6468}
Jesse Halld8bade02015-11-24 10:24:18 -08006469
6470macro VkQueueFlags AddQueueFlag(VkQueueFlags flags, VkQueueFlagBits bit) {
6471 return as!VkQueueFlags(as!u32(flags) | as!u32(bit))
6472}