blob: 222d9fd032c2bfcaea504414edffa48f1246c43b [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 Forbes8e4438b2016-12-07 16:26:49 +130089@extension("VK_ANDROID_native_buffer") define VK_ANDROID_NATIVE_BUFFER_SPEC_VERSION 6
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,
Chia-I Wub262ddc2016-03-22 07:38:20 +0800788
Ian Elliott4c8bb2a2016-12-29 11:07:26 -0700789 //@extension("VK_GOOGLE_display_timing")
Ian Elliott14866bb2017-01-20 09:15:48 -0700790 VK_STRUCTURE_TYPE_PRESENT_TIMES_INFO_GOOGLE = 1000092000,
Ian Elliott4c8bb2a2016-12-29 11:07:26 -0700791
Jesse Hall543a7ff2016-01-08 16:38:30 -0800792 //@extension("VK_EXT_debug_report")
Jesse Hall26763382016-05-20 07:13:52 -0700793 VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT = 1000011000,
794
795 //@extension("VK_AMD_rasterization_order")
796 VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD = 1000018000,
797
798 //@extension("VK_EXT_debug_marker")
799 VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_NAME_INFO_EXT = 1000022000,
Jesse Hall26763382016-05-20 07:13:52 -0700800 VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_TAG_INFO_EXT = 1000022001,
Jesse Hall26763382016-05-20 07:13:52 -0700801 VK_STRUCTURE_TYPE_DEBUG_MARKER_MARKER_INFO_EXT = 1000022002,
Jesse Hall56d386a2016-07-26 15:20:40 -0700802
803 //@extension("VK_NV_dedicated_allocation")
804 VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV = 1000026000,
Jesse Hall56d386a2016-07-26 15:20:40 -0700805 VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV = 1000026001,
Jesse Hall56d386a2016-07-26 15:20:40 -0700806 VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV = 1000026002,
Chris Forbes289cb792016-12-30 15:03:55 +1300807
808 //@extension("VK_NV_external_memory")
Jesse Halleb02c472017-02-24 15:13:45 -0800809 VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_NV = 1000056000,
810 VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_NV = 1000056001,
Chris Forbes289cb792016-12-30 15:03:55 +1300811
812 //@extension("VK_NV_external_memory_win32")
Jesse Halleb02c472017-02-24 15:13:45 -0800813 VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_NV = 1000057000,
814 VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_NV = 1000057001,
Chris Forbes289cb792016-12-30 15:03:55 +1300815
816 //@extension("VK_NV_win32_keyed_mutex")
817 VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_NV = 1000058000,
818
Chris Forbes1194ede2016-12-30 16:29:25 +1300819 //@extension("VK_KHR_get_physical_device_properties2")
Jesse Hall889cd9a2017-02-25 22:12:23 -0800820 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR = 1000059000,
821 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR = 1000059001,
822 VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2_KHR = 1000059002,
823 VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2_KHR = 1000059003,
824 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2_KHR = 1000059004,
825 VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2_KHR = 1000059005,
826 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2_KHR = 1000059006,
827 VK_STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2_KHR = 1000059007,
Chris Forbes1194ede2016-12-30 16:29:25 +1300828 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2_KHR = 1000059008,
829
Chris Forbes289cb792016-12-30 15:03:55 +1300830 //@extension("VK_EXT_validation_flags")
Jesse Halleb02c472017-02-24 15:13:45 -0800831 VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT = 1000061000,
Chris Forbes289cb792016-12-30 15:03:55 +1300832
833 //@extension("VK_KHR_incremental_present")
Jesse Hall889cd9a2017-02-25 22:12:23 -0800834 VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR = 1000084000,
Chris Forbes289cb792016-12-30 15:03:55 +1300835
836 //@extension("VK_NVX_device_generated_commands")
Jesse Halleb02c472017-02-24 15:13:45 -0800837 VK_STRUCTURE_TYPE_OBJECT_TABLE_CREATE_INFO_NVX = 1000086000,
838 VK_STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_CREATE_INFO_NVX = 1000086001,
839 VK_STRUCTURE_TYPE_CMD_PROCESS_COMMANDS_INFO_NVX = 1000086002,
840 VK_STRUCTURE_TYPE_CMD_RESERVE_SPACE_FOR_COMMANDS_INFO_NVX = 1000086003,
841 VK_STRUCTURE_TYPE_DEVICE_GENERATED_COMMANDS_LIMITS_NVX = 1000086004,
842 VK_STRUCTURE_TYPE_DEVICE_GENERATED_COMMANDS_FEATURES_NVX = 1000086005,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700843}
844
Jesse Hall65ab5522015-11-30 00:07:16 -0800845enum VkSubpassContents {
846 VK_SUBPASS_CONTENTS_INLINE = 0x00000000,
847 VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700848}
849
Jesse Hall543a7ff2016-01-08 16:38:30 -0800850enum VkPipelineCacheHeaderVersion {
851 VK_PIPELINE_CACHE_HEADER_VERSION_ONE = 1,
852}
853
Jesse Hallbd888842015-11-30 21:44:14 -0800854@lastUnused(-11)
Jesse Halld27f6aa2015-08-15 17:58:48 -0700855/// Error and return codes
856enum VkResult {
857 // Return codes for successful operation execution (positive values)
Jesse Hallbd888842015-11-30 21:44:14 -0800858 VK_SUCCESS = 0,
859 VK_NOT_READY = 1,
860 VK_TIMEOUT = 2,
861 VK_EVENT_SET = 3,
862 VK_EVENT_RESET = 4,
863 VK_INCOMPLETE = 5,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700864
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800865 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800866 VK_SUBOPTIMAL_KHR = 1000001003,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800867
Jesse Halld27f6aa2015-08-15 17:58:48 -0700868 // Error codes (negative values)
Jesse Hallbd888842015-11-30 21:44:14 -0800869 VK_ERROR_OUT_OF_HOST_MEMORY = 0xFFFFFFFF, // -1
870 VK_ERROR_OUT_OF_DEVICE_MEMORY = 0xFFFFFFFE, // -2
871 VK_ERROR_INITIALIZATION_FAILED = 0xFFFFFFFD, // -3
872 VK_ERROR_DEVICE_LOST = 0xFFFFFFFC, // -4
873 VK_ERROR_MEMORY_MAP_FAILED = 0xFFFFFFFB, // -5
874 VK_ERROR_LAYER_NOT_PRESENT = 0xFFFFFFFA, // -6
875 VK_ERROR_EXTENSION_NOT_PRESENT = 0xFFFFFFF9, // -7
876 VK_ERROR_FEATURE_NOT_PRESENT = 0xFFFFFFF8, // -8
877 VK_ERROR_INCOMPATIBLE_DRIVER = 0xFFFFFFF7, // -9
878 VK_ERROR_TOO_MANY_OBJECTS = 0xFFFFFFF6, // -10
879 VK_ERROR_FORMAT_NOT_SUPPORTED = 0xFFFFFFF5, // -11
Jesse Hall56d386a2016-07-26 15:20:40 -0700880 VK_ERROR_FRAGMENTED_POOL = 0xFFFFFFF4, // -12
Jesse Hall1356b0d2015-11-23 17:24:58 -0800881
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800882 //@extension("VK_KHR_surface")
Jesse Hallbd888842015-11-30 21:44:14 -0800883 VK_ERROR_SURFACE_LOST_KHR = 0xC4653600, // -1000000000
Jesse Halla6429252015-11-29 18:59:42 -0800884
Jesse Hall563380d2016-01-15 23:14:05 -0800885 //@extension("VK_KHR_surface")
886 VK_ERROR_NATIVE_WINDOW_IN_USE_KHR = 0xC46535FF, // -1000008001
887
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800888 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800889 VK_ERROR_OUT_OF_DATE_KHR = 0xC4653214, // -1000001004
Jesse Hall1356b0d2015-11-23 17:24:58 -0800890
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800891 //@extension("VK_KHR_display_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800892 VK_ERROR_INCOMPATIBLE_DISPLAY_KHR = 0xC4652A47, // -1000003001
Jesse Hall1356b0d2015-11-23 17:24:58 -0800893
Jesse Hall543a7ff2016-01-08 16:38:30 -0800894 //@extension("VK_EXT_debug_report")
895 VK_ERROR_VALIDATION_FAILED_EXT = 0xC4650B07, // -1000011001
Jesse Hall26763382016-05-20 07:13:52 -0700896
897 //@extension("VK_NV_glsl_shader")
898 VK_ERROR_INVALID_SHADER_NV = 0xC4650720, // -1000012000
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700899}
900
901enum VkDynamicState {
902 VK_DYNAMIC_STATE_VIEWPORT = 0x00000000,
903 VK_DYNAMIC_STATE_SCISSOR = 0x00000001,
904 VK_DYNAMIC_STATE_LINE_WIDTH = 0x00000002,
905 VK_DYNAMIC_STATE_DEPTH_BIAS = 0x00000003,
906 VK_DYNAMIC_STATE_BLEND_CONSTANTS = 0x00000004,
907 VK_DYNAMIC_STATE_DEPTH_BOUNDS = 0x00000005,
908 VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK = 0x00000006,
909 VK_DYNAMIC_STATE_STENCIL_WRITE_MASK = 0x00000007,
910 VK_DYNAMIC_STATE_STENCIL_REFERENCE = 0x00000008,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700911}
912
Jesse Hall523db342015-11-30 21:12:55 -0800913@extension("VK_KHR_surface")
Michael Lentine88594d72015-11-12 12:49:45 -0800914enum VkPresentModeKHR {
915 VK_PRESENT_MODE_IMMEDIATE_KHR = 0x00000000,
916 VK_PRESENT_MODE_MAILBOX_KHR = 0x00000001,
917 VK_PRESENT_MODE_FIFO_KHR = 0x00000002,
Jesse Hall03b6fe12015-11-24 12:44:21 -0800918 VK_PRESENT_MODE_FIFO_RELAXED_KHR = 0x00000003,
Chris Forbes1d5f68c2017-01-31 10:17:01 +1300919 //@extension("VK_KHR_shared_presentable_image")
920 VK_PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR = 1000111000,
921 //@extension("VK_KHR_shared_presentable_image")
922 VK_PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR = 1000111001,
Michael Lentine88594d72015-11-12 12:49:45 -0800923}
924
Jesse Hall523db342015-11-30 21:12:55 -0800925@extension("VK_KHR_surface")
Michael Lentine88594d72015-11-12 12:49:45 -0800926enum VkColorSpaceKHR {
927 VK_COLORSPACE_SRGB_NONLINEAR_KHR = 0x00000000,
Jesse Hall889cd9a2017-02-25 22:12:23 -0800928 VK_COLOR_SPACE_DISPLAY_P3_LINEAR_EXT = 1000104001,
Courtney Goeltzenleuchter7f558ed2017-01-23 17:15:24 -0700929 VK_COLOR_SPACE_DISPLAY_P3_NONLINEAR_EXT = 1000104002,
930 VK_COLOR_SPACE_SCRGB_LINEAR_EXT = 1000104003,
931 VK_COLOR_SPACE_SCRGB_NONLINEAR_EXT = 1000104004,
932 VK_COLOR_SPACE_DCI_P3_LINEAR_EXT = 1000104005,
933 VK_COLOR_SPACE_DCI_P3_NONLINEAR_EXT = 1000104006,
934 VK_COLOR_SPACE_BT709_LINEAR_EXT = 1000104007,
935 VK_COLOR_SPACE_BT709_NONLINEAR_EXT = 1000104008,
936 VK_COLOR_SPACE_BT2020_LINEAR_EXT = 1000104009,
937 VK_COLOR_SPACE_BT2020_NONLINEAR_EXT = 1000104010,
938 VK_COLOR_SPACE_ADOBERGB_LINEAR_EXT = 1000104011,
939 VK_COLOR_SPACE_ADOBERGB_NONLINEAR_EXT = 1000104012,
Michael Lentine88594d72015-11-12 12:49:45 -0800940}
Jesse Halld27f6aa2015-08-15 17:58:48 -0700941
Jesse Hall715b86a2016-01-16 16:34:29 -0800942@extension("VK_EXT_debug_report")
943enum VkDebugReportObjectTypeEXT {
944 VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT = 0,
945 VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT = 1,
946 VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT = 2,
947 VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT = 3,
948 VK_DEBUG_REPORT_OBJECT_TYPE_QUEUE_EXT = 4,
949 VK_DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT = 5,
950 VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT = 6,
951 VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT = 7,
952 VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT = 8,
953 VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT = 9,
954 VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT = 10,
955 VK_DEBUG_REPORT_OBJECT_TYPE_EVENT_EXT = 11,
956 VK_DEBUG_REPORT_OBJECT_TYPE_QUERY_POOL_EXT = 12,
957 VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_VIEW_EXT = 13,
958 VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_VIEW_EXT = 14,
959 VK_DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT = 15,
960 VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_CACHE_EXT = 16,
961 VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_LAYOUT_EXT = 17,
962 VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT = 18,
963 VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT = 19,
964 VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT_EXT = 20,
965 VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_EXT = 21,
966 VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT = 22,
967 VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT = 23,
968 VK_DEBUG_REPORT_OBJECT_TYPE_FRAMEBUFFER_EXT = 24,
969 VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_POOL_EXT = 25,
970 VK_DEBUG_REPORT_OBJECT_TYPE_SURFACE_KHR_EXT = 26,
971 VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT = 27,
972 VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_EXT = 28,
Chris Forbes289cb792016-12-30 15:03:55 +1300973 VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_KHR_EXT = 29,
974 VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_MODE_KHR_EXT = 30,
975 VK_DEBUG_REPORT_OBJECT_TYPE_OBJECT_TABLE_NVX_EXT = 31,
976 VK_DEBUG_REPORT_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NVX_EXT = 32,
Jesse Hall715b86a2016-01-16 16:34:29 -0800977}
978
979@extension("VK_EXT_debug_report")
980enum VkDebugReportErrorEXT {
981 VK_DEBUG_REPORT_ERROR_NONE_EXT = 0,
982 VK_DEBUG_REPORT_ERROR_CALLBACK_REF_EXT = 1,
983}
984
Jesse Hall26763382016-05-20 07:13:52 -0700985@extension("VK_AMD_rasterization_order")
986enum VkRasterizationOrderAMD {
987 VK_RASTERIZATION_ORDER_STRICT_AMD = 0,
988 VK_RASTERIZATION_ORDER_RELAXED_AMD = 1,
989}
990
Chris Forbes289cb792016-12-30 15:03:55 +1300991@extension("VK_EXT_validation_flags")
992enum VkValidationCheckEXT {
993 VK_VALIDATION_CHECK_ALL_EXT = 0,
994}
995
996@extension("VK_NVX_device_generated_commands")
997enum VkIndirectCommandsTokenTypeNVX {
Jesse Halleb02c472017-02-24 15:13:45 -0800998 VK_INDIRECT_COMMANDS_TOKEN_PIPELINE_NVX = 0,
999 VK_INDIRECT_COMMANDS_TOKEN_DESCRIPTOR_SET_NVX = 1,
1000 VK_INDIRECT_COMMANDS_TOKEN_INDEX_BUFFER_NVX = 2,
1001 VK_INDIRECT_COMMANDS_TOKEN_VERTEX_BUFFER_NVX = 3,
1002 VK_INDIRECT_COMMANDS_TOKEN_PUSH_CONSTANT_NVX = 4,
1003 VK_INDIRECT_COMMANDS_TOKEN_DRAW_INDEXED_NVX = 5,
1004 VK_INDIRECT_COMMANDS_TOKEN_DRAW_NVX = 6,
1005 VK_INDIRECT_COMMANDS_TOKEN_DISPATCH_NVX = 7,
Chris Forbes289cb792016-12-30 15:03:55 +13001006}
1007
1008@extension("VK_NVX_device_generated_commands")
1009enum VkObjectEntryTypeNVX {
Jesse Halleb02c472017-02-24 15:13:45 -08001010 VK_OBJECT_ENTRY_DESCRIPTOR_SET_NVX = 0,
1011 VK_OBJECT_ENTRY_PIPELINE_NVX = 1,
1012 VK_OBJECT_ENTRY_INDEX_BUFFER_NVX = 2,
1013 VK_OBJECT_ENTRY_VERTEX_BUFFER_NVX = 3,
1014 VK_OBJECT_ENTRY_PUSH_CONSTANT_NVX = 4,
Chris Forbes289cb792016-12-30 15:03:55 +13001015}
Jesse Hall715b86a2016-01-16 16:34:29 -08001016
Jesse Halld27f6aa2015-08-15 17:58:48 -07001017/////////////////
1018// Bitfields //
1019/////////////////
1020
Jesse Halld27f6aa2015-08-15 17:58:48 -07001021/// Queue capabilities
Jesse Halld8bade02015-11-24 10:24:18 -08001022type VkFlags VkQueueFlags
1023bitfield VkQueueFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001024 VK_QUEUE_GRAPHICS_BIT = 0x00000001, /// Queue supports graphics operations
1025 VK_QUEUE_COMPUTE_BIT = 0x00000002, /// Queue supports compute operations
Jesse Hall65ab5522015-11-30 00:07:16 -08001026 VK_QUEUE_TRANSFER_BIT = 0x00000004, /// Queue supports transfer operations
Jesse Hallb00daad2015-11-29 19:46:20 -08001027 VK_QUEUE_SPARSE_BINDING_BIT = 0x00000008, /// Queue supports sparse resource memory management operations
Jesse Halld27f6aa2015-08-15 17:58:48 -07001028}
1029
1030/// Memory properties passed into vkAllocMemory().
Jesse Halld8bade02015-11-24 10:24:18 -08001031type VkFlags VkMemoryPropertyFlags
1032bitfield VkMemoryPropertyFlagBits {
Jesse Halld1af8122015-11-29 23:50:38 -08001033 VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT = 0x00000001,
1034 VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT = 0x00000002,
1035 VK_MEMORY_PROPERTY_HOST_COHERENT_BIT = 0x00000004,
1036 VK_MEMORY_PROPERTY_HOST_CACHED_BIT = 0x00000008,
1037 VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT = 0x00000010,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001038}
1039
1040/// Memory heap flags
Jesse Halld8bade02015-11-24 10:24:18 -08001041type VkFlags VkMemoryHeapFlags
1042bitfield VkMemoryHeapFlagBits {
Jesse Halld1af8122015-11-29 23:50:38 -08001043 VK_MEMORY_HEAP_DEVICE_LOCAL_BIT = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001044}
1045
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001046/// Access flags
1047type VkFlags VkAccessFlags
1048bitfield VkAccessFlagBits {
1049 VK_ACCESS_INDIRECT_COMMAND_READ_BIT = 0x00000001,
1050 VK_ACCESS_INDEX_READ_BIT = 0x00000002,
1051 VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT = 0x00000004,
1052 VK_ACCESS_UNIFORM_READ_BIT = 0x00000008,
1053 VK_ACCESS_INPUT_ATTACHMENT_READ_BIT = 0x00000010,
1054 VK_ACCESS_SHADER_READ_BIT = 0x00000020,
1055 VK_ACCESS_SHADER_WRITE_BIT = 0x00000040,
1056 VK_ACCESS_COLOR_ATTACHMENT_READ_BIT = 0x00000080,
1057 VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT = 0x00000100,
1058 VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT = 0x00000200,
1059 VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT = 0x00000400,
1060 VK_ACCESS_TRANSFER_READ_BIT = 0x00000800,
1061 VK_ACCESS_TRANSFER_WRITE_BIT = 0x00001000,
1062 VK_ACCESS_HOST_READ_BIT = 0x00002000,
1063 VK_ACCESS_HOST_WRITE_BIT = 0x00004000,
1064 VK_ACCESS_MEMORY_READ_BIT = 0x00008000,
1065 VK_ACCESS_MEMORY_WRITE_BIT = 0x00010000,
Chris Forbes289cb792016-12-30 15:03:55 +13001066
1067 //@extension("VK_NVX_device_generated_commands")
1068 VK_ACCESS_COMMAND_PROCESS_READ_BIT_NVX = 0x00020000,
Chris Forbes289cb792016-12-30 15:03:55 +13001069 VK_ACCESS_COMMAND_PROCESS_WRITE_BIT_NVX = 0x00040000,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001070}
1071
1072/// Buffer usage flags
Jesse Halld8bade02015-11-24 10:24:18 -08001073type VkFlags VkBufferUsageFlags
1074bitfield VkBufferUsageFlagBits {
Jesse Hall3fbc8562015-11-29 22:10:52 -08001075 VK_BUFFER_USAGE_TRANSFER_SRC_BIT = 0x00000001, /// Can be used as a source of transfer operations
1076 VK_BUFFER_USAGE_TRANSFER_DST_BIT = 0x00000002, /// Can be used as a destination of transfer operations
Jesse Halld27f6aa2015-08-15 17:58:48 -07001077 VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000004, /// Can be used as TBO
1078 VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT = 0x00000008, /// Can be used as IBO
1079 VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT = 0x00000010, /// Can be used as UBO
1080 VK_BUFFER_USAGE_STORAGE_BUFFER_BIT = 0x00000020, /// Can be used as SSBO
1081 VK_BUFFER_USAGE_INDEX_BUFFER_BIT = 0x00000040, /// Can be used as source of fixed function index fetch (index buffer)
1082 VK_BUFFER_USAGE_VERTEX_BUFFER_BIT = 0x00000080, /// Can be used as source of fixed function vertex fetch (VBO)
1083 VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT = 0x00000100, /// Can be the source of indirect parameters (e.g. indirect buffer, parameter buffer)
1084}
1085
1086/// Buffer creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001087type VkFlags VkBufferCreateFlags
1088bitfield VkBufferCreateFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001089 VK_BUFFER_CREATE_SPARSE_BINDING_BIT = 0x00000001, /// Buffer should support sparse backing
Jesse Halld27f6aa2015-08-15 17:58:48 -07001090 VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002, /// Buffer should support sparse backing with partial residency
1091 VK_BUFFER_CREATE_SPARSE_ALIASED_BIT = 0x00000004, /// Buffer should support constent data access to physical memory blocks mapped into multiple locations of sparse buffers
1092}
1093
1094/// Shader stage flags
Jesse Halld8bade02015-11-24 10:24:18 -08001095type VkFlags VkShaderStageFlags
1096bitfield VkShaderStageFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001097 VK_SHADER_STAGE_VERTEX_BIT = 0x00000001,
Jesse Hallae38f732015-11-19 21:32:50 -08001098 VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT = 0x00000002,
1099 VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001100 VK_SHADER_STAGE_GEOMETRY_BIT = 0x00000008,
1101 VK_SHADER_STAGE_FRAGMENT_BIT = 0x00000010,
1102 VK_SHADER_STAGE_COMPUTE_BIT = 0x00000020,
Jesse Hallc7467b72015-11-29 21:05:26 -08001103 VK_SHADER_STAGE_ALL_GRAPHICS = 0x0000001F,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001104
1105 VK_SHADER_STAGE_ALL = 0x7FFFFFFF,
1106}
1107
Jesse Hallfbf97b02015-11-20 14:17:03 -08001108/// Descriptor pool create flags
Jesse Halld8bade02015-11-24 10:24:18 -08001109type VkFlags VkDescriptorPoolCreateFlags
1110bitfield VkDescriptorPoolCreateFlagBits {
Jesse Hallfbf97b02015-11-20 14:17:03 -08001111 VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT = 0x00000001,
1112}
1113
1114/// Descriptor pool reset flags
Jesse Halld8bade02015-11-24 10:24:18 -08001115type VkFlags VkDescriptorPoolResetFlags
Jesse Halla6429252015-11-29 18:59:42 -08001116//bitfield VkDescriptorPoolResetFlagBits {
1117//}
Jesse Hallfbf97b02015-11-20 14:17:03 -08001118
Jesse Halld27f6aa2015-08-15 17:58:48 -07001119/// Image usage flags
Jesse Halld8bade02015-11-24 10:24:18 -08001120type VkFlags VkImageUsageFlags
1121bitfield VkImageUsageFlagBits {
Jesse Hall3fbc8562015-11-29 22:10:52 -08001122 VK_IMAGE_USAGE_TRANSFER_SRC_BIT = 0x00000001, /// Can be used as a source of transfer operations
1123 VK_IMAGE_USAGE_TRANSFER_DST_BIT = 0x00000002, /// Can be used as a destination of transfer operations
Jesse Halld27f6aa2015-08-15 17:58:48 -07001124 VK_IMAGE_USAGE_SAMPLED_BIT = 0x00000004, /// Can be sampled from (SAMPLED_IMAGE and COMBINED_IMAGE_SAMPLER descriptor types)
1125 VK_IMAGE_USAGE_STORAGE_BIT = 0x00000008, /// Can be used as storage image (STORAGE_IMAGE descriptor type)
1126 VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT = 0x00000010, /// Can be used as framebuffer color attachment
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001127 VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000020, /// Can be used as framebuffer depth/stencil attachment
Jesse Halld27f6aa2015-08-15 17:58:48 -07001128 VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT = 0x00000040, /// Image data not needed outside of rendering
1129 VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT = 0x00000080, /// Can be used as framebuffer input attachment
1130}
1131
1132/// Image creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001133type VkFlags VkImageCreateFlags
1134bitfield VkImageCreateFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001135 VK_IMAGE_CREATE_SPARSE_BINDING_BIT = 0x00000001, /// Image should support sparse backing
Jesse Halld27f6aa2015-08-15 17:58:48 -07001136 VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002, /// Image should support sparse backing with partial residency
1137 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 -07001138 VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT = 0x00000008, /// Allows image views to have different format than the base image
1139 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 -07001140}
1141
Jesse Hallb00daad2015-11-29 19:46:20 -08001142/// Image view creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001143type VkFlags VkImageViewCreateFlags
Jesse Hallb00daad2015-11-29 19:46:20 -08001144//bitfield VkImageViewCreateFlagBits {
1145//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001146
1147/// Pipeline creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001148type VkFlags VkPipelineCreateFlags
1149bitfield VkPipelineCreateFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001150 VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT = 0x00000001,
1151 VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT = 0x00000002,
1152 VK_PIPELINE_CREATE_DERIVATIVE_BIT = 0x00000004,
1153}
1154
Jesse Hall65ab5522015-11-30 00:07:16 -08001155/// Color component flags
1156type VkFlags VkColorComponentFlags
1157bitfield VkColorComponentFlagBits {
1158 VK_COLOR_COMPONENT_R_BIT = 0x00000001,
1159 VK_COLOR_COMPONENT_G_BIT = 0x00000002,
1160 VK_COLOR_COMPONENT_B_BIT = 0x00000004,
1161 VK_COLOR_COMPONENT_A_BIT = 0x00000008,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001162}
1163
1164/// Fence creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001165type VkFlags VkFenceCreateFlags
1166bitfield VkFenceCreateFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001167 VK_FENCE_CREATE_SIGNALED_BIT = 0x00000001,
1168}
1169
1170/// Semaphore creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001171type VkFlags VkSemaphoreCreateFlags
Jesse Halla6429252015-11-29 18:59:42 -08001172//bitfield VkSemaphoreCreateFlagBits {
1173//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001174
1175/// Format capability flags
Jesse Halld8bade02015-11-24 10:24:18 -08001176type VkFlags VkFormatFeatureFlags
1177bitfield VkFormatFeatureFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001178 VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT = 0x00000001, /// Format can be used for sampled images (SAMPLED_IMAGE and COMBINED_IMAGE_SAMPLER descriptor types)
1179 VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT = 0x00000002, /// Format can be used for storage images (STORAGE_IMAGE descriptor type)
1180 VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT = 0x00000004, /// Format supports atomic operations in case it's used for storage images
1181 VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000008, /// Format can be used for uniform texel buffers (TBOs)
1182 VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT = 0x00000010, /// Format can be used for storage texel buffers (IBOs)
1183 VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT = 0x00000020, /// Format supports atomic operations in case it's used for storage texel buffers
1184 VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT = 0x00000040, /// Format can be used for vertex buffers (VBOs)
1185 VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT = 0x00000080, /// Format can be used for color attachment images
1186 VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT = 0x00000100, /// Format supports blending in case it's used for color attachment images
1187 VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000200, /// Format can be used for depth/stencil attachment images
Jesse Hall3fbc8562015-11-29 22:10:52 -08001188 VK_FORMAT_FEATURE_BLIT_SRC_BIT = 0x00000400, /// Format can be used as the source image of blits with vkCommandBlitImage
1189 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 -08001190 VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT = 0x00001000,
Jesse Hall26763382016-05-20 07:13:52 -07001191
1192 //@extension("VK_IMG_filter_cubic")
1193 VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG = 0x00002000,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001194}
1195
1196/// Query control flags
Jesse Halld8bade02015-11-24 10:24:18 -08001197type VkFlags VkQueryControlFlags
1198bitfield VkQueryControlFlagBits {
Jesse Hall65ab5522015-11-30 00:07:16 -08001199 VK_QUERY_CONTROL_PRECISE_BIT = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001200}
1201
1202/// Query result flags
Jesse Halld8bade02015-11-24 10:24:18 -08001203type VkFlags VkQueryResultFlags
1204bitfield VkQueryResultFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001205 VK_QUERY_RESULT_64_BIT = 0x00000001, /// Results of the queries are written to the destination buffer as 64-bit values
1206 VK_QUERY_RESULT_WAIT_BIT = 0x00000002, /// Results of the queries are waited on before proceeding with the result copy
1207 VK_QUERY_RESULT_WITH_AVAILABILITY_BIT = 0x00000004, /// Besides the results of the query, the availability of the results is also written
1208 VK_QUERY_RESULT_PARTIAL_BIT = 0x00000008, /// Copy the partial results of the query even if the final results aren't available
1209}
1210
1211/// Shader module creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001212type VkFlags VkShaderModuleCreateFlags
Jesse Halla6429252015-11-29 18:59:42 -08001213//bitfield VkShaderModuleCreateFlagBits {
1214//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001215
Jesse Halld27f6aa2015-08-15 17:58:48 -07001216/// Event creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001217type VkFlags VkEventCreateFlags
Jesse Halla6429252015-11-29 18:59:42 -08001218//bitfield VkEventCreateFlagBits {
1219//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001220
Jesse Halla15a4bf2015-11-19 22:48:02 -08001221/// Command buffer usage flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001222type VkFlags VkCommandBufferUsageFlags
1223bitfield VkCommandBufferUsageFlagBits {
1224 VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT = 0x00000001,
1225 VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT = 0x00000002,
1226 VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001227}
1228
1229/// Pipeline statistics flags
Jesse Halld8bade02015-11-24 10:24:18 -08001230type VkFlags VkQueryPipelineStatisticFlags
1231bitfield VkQueryPipelineStatisticFlagBits {
Jesse Hallae38f732015-11-19 21:32:50 -08001232 VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_BIT = 0x00000001, /// Optional
1233 VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_PRIMITIVES_BIT = 0x00000002, /// Optional
1234 VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT = 0x00000004, /// Optional
1235 VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_INVOCATIONS_BIT = 0x00000008, /// Optional
1236 VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT = 0x00000010, /// Optional
1237 VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT = 0x00000020, /// Optional
1238 VK_QUERY_PIPELINE_STATISTIC_CLIPPING_PRIMITIVES_BIT = 0x00000040, /// Optional
1239 VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT = 0x00000080, /// Optional
1240 VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT = 0x00000100, /// Optional
1241 VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT = 0x00000200, /// Optional
1242 VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT = 0x00000400, /// Optional
Jesse Halld27f6aa2015-08-15 17:58:48 -07001243}
1244
1245/// Memory mapping flags
Jesse Halld8bade02015-11-24 10:24:18 -08001246type VkFlags VkMemoryMapFlags
Jesse Halla6429252015-11-29 18:59:42 -08001247//bitfield VkMemoryMapFlagBits {
1248//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001249
1250/// Bitfield of image aspects
Jesse Halld8bade02015-11-24 10:24:18 -08001251type VkFlags VkImageAspectFlags
1252bitfield VkImageAspectFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001253 VK_IMAGE_ASPECT_COLOR_BIT = 0x00000001,
1254 VK_IMAGE_ASPECT_DEPTH_BIT = 0x00000002,
1255 VK_IMAGE_ASPECT_STENCIL_BIT = 0x00000004,
1256 VK_IMAGE_ASPECT_METADATA_BIT = 0x00000008,
1257}
1258
1259/// Sparse memory bind flags
Jesse Halld8bade02015-11-24 10:24:18 -08001260type VkFlags VkSparseMemoryBindFlags
Jesse Hall091ed9e2015-11-30 00:55:29 -08001261bitfield VkSparseMemoryBindFlagBits {
1262 VK_SPARSE_MEMORY_BIND_METADATA_BIT = 0x00000001,
1263}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001264
1265/// Sparse image memory requirements flags
Jesse Halld8bade02015-11-24 10:24:18 -08001266type VkFlags VkSparseImageFormatFlags
1267bitfield VkSparseImageFormatFlagBits {
Jesse Hallb00daad2015-11-29 19:46:20 -08001268 VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT = 0x00000001, /// Image uses a single miptail region for all array slices
1269 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.
1270 VK_SPARSE_IMAGE_FORMAT_NONSTANDARD_BLOCK_SIZE_BIT = 0x00000004, /// Image uses a non-standard sparse block size
Jesse Halld27f6aa2015-08-15 17:58:48 -07001271}
1272
1273/// Pipeline stages
Jesse Halld8bade02015-11-24 10:24:18 -08001274type VkFlags VkPipelineStageFlags
1275bitfield VkPipelineStageFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001276 VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT = 0x00000001, /// Before subsequent commands are processed
1277 VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT = 0x00000002, /// Draw/DispatchIndirect command fetch
1278 VK_PIPELINE_STAGE_VERTEX_INPUT_BIT = 0x00000004, /// Vertex/index fetch
1279 VK_PIPELINE_STAGE_VERTEX_SHADER_BIT = 0x00000008, /// Vertex shading
Jesse Hallae38f732015-11-19 21:32:50 -08001280 VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT = 0x00000010, /// Tessellation control shading
1281 VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT = 0x00000020, /// Tessellation evaluation shading
Jesse Halld27f6aa2015-08-15 17:58:48 -07001282 VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT = 0x00000040, /// Geometry shading
1283 VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT = 0x00000080, /// Fragment shading
1284 VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT = 0x00000100, /// Early fragment (depth/stencil) tests
1285 VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT = 0x00000200, /// Late fragment (depth/stencil) tests
1286 VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT = 0x00000400, /// Color attachment writes
1287 VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT = 0x00000800, /// Compute shading
1288 VK_PIPELINE_STAGE_TRANSFER_BIT = 0x00001000, /// Transfer/copy operations
Jesse Hall543a7ff2016-01-08 16:38:30 -08001289 VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT = 0x00002000,
1290 VK_PIPELINE_STAGE_HOST_BIT = 0x00004000, /// Indicates host (CPU) is a source/sink of the dependency
Jesse Halld27f6aa2015-08-15 17:58:48 -07001291
Jesse Hall543a7ff2016-01-08 16:38:30 -08001292 VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT = 0x00008000, /// All stages of the graphics pipeline
1293 VK_PIPELINE_STAGE_ALL_COMMANDS_BIT = 0x00010000, /// All graphics, compute, copy, and transition commands
Chris Forbes289cb792016-12-30 15:03:55 +13001294
1295 //@extension("VK_NVX_device_generated_commands")
1296 VK_PIPELINE_STAGE_COMMAND_PROCESS_BIT_NVX = 0x00020000,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001297}
1298
1299/// Render pass attachment description flags
Jesse Halld8bade02015-11-24 10:24:18 -08001300type VkFlags VkAttachmentDescriptionFlags
1301bitfield VkAttachmentDescriptionFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001302 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 -07001303}
1304
1305/// Subpass description flags
Jesse Halld8bade02015-11-24 10:24:18 -08001306type VkFlags VkSubpassDescriptionFlags
1307bitfield VkSubpassDescriptionFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001308}
1309
1310/// Command pool creation flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001311type VkFlags VkCommandPoolCreateFlags
1312bitfield VkCommandPoolCreateFlagBits {
1313 VK_COMMAND_POOL_CREATE_TRANSIENT_BIT = 0x00000001, /// Command buffers have a short lifetime
1314 VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT = 0x00000002, /// Command buffers may release their memory individually
Jesse Halld27f6aa2015-08-15 17:58:48 -07001315}
1316
1317/// Command pool reset flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001318type VkFlags VkCommandPoolResetFlags
1319bitfield VkCommandPoolResetFlagBits {
1320 VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT = 0x00000001, /// Release resources owned by the pool
Jesse Halld27f6aa2015-08-15 17:58:48 -07001321}
1322
Jesse Hall3fbc8562015-11-29 22:10:52 -08001323type VkFlags VkCommandBufferResetFlags
1324bitfield VkCommandBufferResetFlagBits {
1325 VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT = 0x00000001, /// Release resources owned by the buffer
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001326}
1327
Jesse Halld8bade02015-11-24 10:24:18 -08001328type VkFlags VkSampleCountFlags
1329bitfield VkSampleCountFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001330 VK_SAMPLE_COUNT_1_BIT = 0x00000001,
1331 VK_SAMPLE_COUNT_2_BIT = 0x00000002,
1332 VK_SAMPLE_COUNT_4_BIT = 0x00000004,
1333 VK_SAMPLE_COUNT_8_BIT = 0x00000008,
1334 VK_SAMPLE_COUNT_16_BIT = 0x00000010,
1335 VK_SAMPLE_COUNT_32_BIT = 0x00000020,
1336 VK_SAMPLE_COUNT_64_BIT = 0x00000040,
1337}
1338
Jesse Halld8bade02015-11-24 10:24:18 -08001339type VkFlags VkStencilFaceFlags
1340bitfield VkStencilFaceFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001341 VK_STENCIL_FACE_FRONT_BIT = 0x00000001, /// Front face
1342 VK_STENCIL_FACE_BACK_BIT = 0x00000002, /// Back face
Jesse Hallc7467b72015-11-29 21:05:26 -08001343 VK_STENCIL_FRONT_AND_BACK = 0x00000003,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001344}
1345
Jesse Halla6429252015-11-29 18:59:42 -08001346/// Instance creation flags
1347type VkFlags VkInstanceCreateFlags
1348//bitfield VkInstanceCreateFlagBits {
1349//}
1350
1351/// Device creation flags
1352type VkFlags VkDeviceCreateFlags
1353//bitfield VkDeviceCreateFlagBits {
1354//}
1355
1356/// Device queue creation flags
1357type VkFlags VkDeviceQueueCreateFlags
1358//bitfield VkDeviceQueueCreateFlagBits {
1359//}
1360
1361/// Query pool creation flags
1362type VkFlags VkQueryPoolCreateFlags
1363//bitfield VkQueryPoolCreateFlagBits {
1364//}
1365
1366/// Buffer view creation flags
1367type VkFlags VkBufferViewCreateFlags
1368//bitfield VkBufferViewCreateFlagBits {
1369//}
1370
1371/// Pipeline cache creation flags
1372type VkFlags VkPipelineCacheCreateFlags
1373//bitfield VkPipelineCacheCreateFlagBits {
1374//}
1375
1376/// Pipeline shader stage creation flags
1377type VkFlags VkPipelineShaderStageCreateFlags
1378//bitfield VkPipelineShaderStageCreateFlagBits {
1379//}
1380
1381/// Descriptor set layout creation flags
1382type VkFlags VkDescriptorSetLayoutCreateFlags
1383//bitfield VkDescriptorSetLayoutCreateFlagBits {
1384//}
1385
1386/// Pipeline vertex input state creation flags
1387type VkFlags VkPipelineVertexInputStateCreateFlags
1388//bitfield VkPipelineVertexInputStateCreateFlagBits {
1389//}
1390
1391/// Pipeline input assembly state creation flags
1392type VkFlags VkPipelineInputAssemblyStateCreateFlags
1393//bitfield VkPipelineInputAssemblyStateCreateFlagBits {
1394//}
1395
1396/// Tessellation state creation flags
1397type VkFlags VkPipelineTessellationStateCreateFlags
1398//bitfield VkPipelineTessellationStateCreateFlagBits {
1399//}
1400
1401/// Viewport state creation flags
1402type VkFlags VkPipelineViewportStateCreateFlags
1403//bitfield VkPipelineViewportStateCreateFlagBits {
1404//}
1405
Jesse Hall3fbc8562015-11-29 22:10:52 -08001406/// Rasterization state creation flags
1407type VkFlags VkPipelineRasterizationStateCreateFlags
1408//bitfield VkPipelineRasterizationStateCreateFlagBits {
Jesse Halla6429252015-11-29 18:59:42 -08001409//}
1410
1411/// Multisample state creation flags
1412type VkFlags VkPipelineMultisampleStateCreateFlags
1413//bitfield VkPipelineMultisampleStateCreateFlagBits {
1414//}
1415
1416/// Color blend state creation flags
1417type VkFlags VkPipelineColorBlendStateCreateFlags
1418//bitfield VkPipelineColorBlendStateCreateFlagBits {
1419//}
1420
1421/// Depth/stencil state creation flags
1422type VkFlags VkPipelineDepthStencilStateCreateFlags
1423//bitfield VkPipelineDepthStencilStateCreateFlagBits {
1424//}
1425
1426/// Dynamic state creation flags
1427type VkFlags VkPipelineDynamicStateCreateFlags
1428//bitfield VkPipelineDynamicStateCreateFlagBits {
1429//}
1430
1431/// Pipeline layout creation flags
1432type VkFlags VkPipelineLayoutCreateFlags
1433//bitfield VkPipelineLayoutCreateFlagBits {
1434//}
1435
1436/// Sampler creation flags
1437type VkFlags VkSamplerCreateFlags
1438//bitfield VkSamplerCreateFlagBits {
1439//}
1440
1441/// Render pass creation flags
1442type VkFlags VkRenderPassCreateFlags
1443//bitfield VkRenderPassCreateFlagBits {
1444//}
1445
1446/// Framebuffer creation flags
1447type VkFlags VkFramebufferCreateFlags
1448//bitfield VkFramebufferCreateFlagBits {
1449//}
1450
Jesse Halldc6d36c2015-11-29 19:12:15 -08001451/// Dependency flags
1452type VkFlags VkDependencyFlags
1453bitfield VkDependencyFlagBits {
1454 VK_DEPENDENCY_BY_REGION_BIT = 0x00000001,
1455}
1456
Jesse Hallc7467b72015-11-29 21:05:26 -08001457/// Cull mode flags
1458type VkFlags VkCullModeFlags
1459bitfield VkCullModeFlagBits {
1460 VK_CULL_MODE_NONE = 0x00000000,
1461 VK_CULL_MODE_FRONT_BIT = 0x00000001,
1462 VK_CULL_MODE_BACK_BIT = 0x00000002,
1463 VK_CULL_MODE_FRONT_AND_BACK = 0x00000003,
1464}
1465
Jesse Hall523db342015-11-30 21:12:55 -08001466@extension("VK_KHR_surface")
Jesse Halld8bade02015-11-24 10:24:18 -08001467type VkFlags VkSurfaceTransformFlagsKHR
Jesse Hall523db342015-11-30 21:12:55 -08001468@extension("VK_KHR_surface")
Jesse Halld8bade02015-11-24 10:24:18 -08001469bitfield VkSurfaceTransformFlagBitsKHR {
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001470 VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR = 0x00000001,
Jesse Hall9ba8bc82015-11-30 16:22:16 -08001471 VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR = 0x00000002,
1472 VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR = 0x00000004,
1473 VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR = 0x00000008,
1474 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR = 0x00000010,
1475 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR = 0x00000020,
1476 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR = 0x00000040,
1477 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR = 0x00000080,
1478 VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR = 0x00000100,
Michael Lentine88594d72015-11-12 12:49:45 -08001479}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001480
Jesse Hall523db342015-11-30 21:12:55 -08001481@extension("VK_KHR_surface")
Jesse Halla6429252015-11-29 18:59:42 -08001482type VkFlags VkCompositeAlphaFlagsKHR
Jesse Hall523db342015-11-30 21:12:55 -08001483@extension("VK_KHR_surface")
Jesse Halla6429252015-11-29 18:59:42 -08001484bitfield VkCompositeAlphaFlagBitsKHR {
1485 VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR = 0x00000001,
1486 VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR = 0x00000002,
1487 VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR = 0x00000004,
1488 VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR = 0x00000008,
1489}
1490
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001491@extension("VK_KHR_swapchain")
1492type VkFlags VkSwapchainCreateFlagsKHR
1493//@extension("VK_KHR_swapchain")
1494//bitfield VkSwapchainCreateFlagBitsKHR {
1495//}
1496
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001497@extension("VK_KHR_display")
Jesse Halld8bade02015-11-24 10:24:18 -08001498type VkFlags VkDisplayPlaneAlphaFlagsKHR
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001499@extension("VK_KHR_display")
Jesse Halld8bade02015-11-24 10:24:18 -08001500bitfield VkDisplayPlaneAlphaFlagBitsKHR {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001501 VK_DISPLAY_PLANE_ALPHA_OPAQUE_BIT_KHR = 0x00000001,
1502 VK_DISPLAY_PLANE_ALPHA_GLOBAL_BIT_KHR = 0x00000002,
1503 VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_BIT_KHR = 0x00000004,
1504 VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_PREMULTIPLIED_BIT_KHR = 0x00000008,
Jesse Hall1356b0d2015-11-23 17:24:58 -08001505}
1506
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001507@extension("VK_KHR_display")
1508type VkFlags VkDisplaySurfaceCreateFlagsKHR
1509//@extension("VK_KHR_display")
1510//bitfield VkDisplaySurfaceCreateFlagBitsKHR {
1511//}
1512
Jesse Hall9ba8bc82015-11-30 16:22:16 -08001513@extension("VK_KHR_display")
1514type VkFlags VkDisplayModeCreateFlagsKHR
1515//@extension("VK_KHR_display")
1516//bitfield VkDisplayModeCreateFlagBitsKHR {
1517//}
1518
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001519@extension("VK_KHR_xlib_surface")
1520type VkFlags VkXlibSurfaceCreateFlagsKHR
1521//@extension("VK_KHR_xlib_surface")
1522//bitfield VkXlibSurfaceCreateFlagBitsKHR {
1523//}
1524
1525@extension("VK_KHR_xcb_surface")
1526type VkFlags VkXcbSurfaceCreateFlagsKHR
1527//@extension("VK_KHR_xcb_surface")
1528//bitfield VkXcbSurfaceCreateFlagBitsKHR {
1529//}
1530
1531@extension("VK_KHR_wayland_surface")
1532type VkFlags VkWaylandSurfaceCreateFlagsKHR
1533//@extension("VK_KHR_wayland_surface")
1534//bitfield VkWaylandSurfaceCreateFlagBitsKHR {
1535//}
1536
1537@extension("VK_KHR_mir_surface")
1538type VkFlags VkMirSurfaceCreateFlagsKHR
1539//@extension("VK_KHR_mir_surface")
1540//bitfield VkMirSurfaceCreateFlagBitsKHR {
1541//}
1542
1543@extension("VK_KHR_android_surface")
1544type VkFlags VkAndroidSurfaceCreateFlagsKHR
1545//@extension("VK_KHR_android_surface")
1546//bitfield VkAndroidSurfaceCreateFlagBitsKHR {
1547//}
1548
1549@extension("VK_KHR_win32_surface")
1550type VkFlags VkWin32SurfaceCreateFlagsKHR
1551//@extension("VK_KHR_win32_surface")
1552//bitfield VkWin32SurfaceCreateFlagBitsKHR {
1553//}
1554
Jesse Hall889cd9a2017-02-25 22:12:23 -08001555@extension("VK_ANDROID_native_buffer")
1556type VkFlags VkSwapchainImageUsageFlagsANDROID
1557@extension("VK_ANDROID_native_buffer")
1558bitfield VkSwapchainImageUsageFlagBitsANDROID {
1559 VK_SWAPCHAIN_IMAGE_USAGE_FLAGS_SHARED_BIT_ANDROID = 0x00000001,
1560}
1561
Jesse Hall715b86a2016-01-16 16:34:29 -08001562@extension("VK_EXT_debug_report")
1563type VkFlags VkDebugReportFlagsEXT
1564@extension("VK_EXT_debug_report")
1565bitfield VkDebugReportFlagBitsEXT {
Jesse Halle2948d82016-02-25 04:19:32 -08001566 VK_DEBUG_REPORT_INFORMATION_BIT_EXT = 0x00000001,
1567 VK_DEBUG_REPORT_WARNING_BIT_EXT = 0x00000002,
1568 VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT = 0x00000004,
Jesse Hall715b86a2016-01-16 16:34:29 -08001569 VK_DEBUG_REPORT_ERROR_BIT_EXT = 0x00000008,
1570 VK_DEBUG_REPORT_DEBUG_BIT_EXT = 0x00000010,
1571}
1572
Chris Forbes289cb792016-12-30 15:03:55 +13001573@extension("VK_NV_external_memory_capabilities")
1574type VkFlags VkExternalMemoryHandleTypeFlagsNV
1575@extension("VK_NV_external_memory_capabilities")
1576bitfield VkExternalMemoryHandleTypeFlagBitsNV {
Jesse Halleb02c472017-02-24 15:13:45 -08001577 VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_NV = 0x00000001,
1578 VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_NV = 0x00000002,
1579 VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_IMAGE_BIT_NV = 0x00000004,
1580 VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_IMAGE_KMT_BIT_NV = 0x00000008,
Chris Forbes289cb792016-12-30 15:03:55 +13001581}
1582
1583@extension("VK_NV_external_memory_capabilities")
1584type VkFlags VkExternalMemoryFeatureFlagsNV
1585@extension("VK_NV_external_memory_capabilities")
1586bitfield VkExternalMemoryFeatureFlagBitsNV {
Jesse Halleb02c472017-02-24 15:13:45 -08001587 VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT_NV = 0x00000001,
1588 VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT_NV = 0x00000002,
1589 VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT_NV = 0x00000004,
Chris Forbes289cb792016-12-30 15:03:55 +13001590}
1591
1592@extension("VK_NVX_device_generated_commands")
1593type VkFlags VkIndirectCommandsLayoutUsageFlagsNVX
1594@extension("VK_NVX_device_generated_commands")
1595bitfield VkIndirectCommandsLayoutUsageFlagBitsNVX {
Jesse Halleb02c472017-02-24 15:13:45 -08001596 VK_INDIRECT_COMMANDS_LAYOUT_USAGE_UNORDERED_SEQUENCES_BIT_NVX = 0x00000001,
1597 VK_INDIRECT_COMMANDS_LAYOUT_USAGE_SPARSE_SEQUENCES_BIT_NVX = 0x00000002,
1598 VK_INDIRECT_COMMANDS_LAYOUT_USAGE_EMPTY_EXECUTIONS_BIT_NVX = 0x00000004,
1599 VK_INDIRECT_COMMANDS_LAYOUT_USAGE_INDEXED_SEQUENCES_BIT_NVX = 0x00000008,
Chris Forbes289cb792016-12-30 15:03:55 +13001600}
1601
1602@extension("VK_NVX_device_generated_commands")
1603type VkFlags VkObjectEntryUsageFlagsNVX
1604@extension("VK_NVX_device_generated_commands")
1605bitfield VkObjectEntryUsageFlagBitsNVX {
Jesse Halleb02c472017-02-24 15:13:45 -08001606 VK_OBJECT_ENTRY_USAGE_GRAPHICS_BIT_NVX = 0x00000001,
1607 VK_OBJECT_ENTRY_USAGE_COMPUTE_BIT_NVX = 0x00000002,
Chris Forbes289cb792016-12-30 15:03:55 +13001608}
1609
Jesse Halld27f6aa2015-08-15 17:58:48 -07001610//////////////////
1611// Structures //
1612//////////////////
1613
1614class VkOffset2D {
1615 s32 x
1616 s32 y
1617}
1618
1619class VkOffset3D {
1620 s32 x
1621 s32 y
1622 s32 z
1623}
1624
1625class VkExtent2D {
Jesse Hall3dd678a2016-01-08 21:52:01 -08001626 u32 width
1627 u32 height
Jesse Halld27f6aa2015-08-15 17:58:48 -07001628}
1629
1630class VkExtent3D {
Jesse Hall3dd678a2016-01-08 21:52:01 -08001631 u32 width
1632 u32 height
1633 u32 depth
Jesse Halld27f6aa2015-08-15 17:58:48 -07001634}
1635
1636class VkViewport {
Jesse Hall65ab5522015-11-30 00:07:16 -08001637 f32 x
1638 f32 y
Jesse Halld27f6aa2015-08-15 17:58:48 -07001639 f32 width
1640 f32 height
1641 f32 minDepth
1642 f32 maxDepth
1643}
1644
1645class VkRect2D {
1646 VkOffset2D offset
1647 VkExtent2D extent
1648}
1649
Jesse Halla15a4bf2015-11-19 22:48:02 -08001650class VkClearRect {
1651 VkRect2D rect
1652 u32 baseArrayLayer
Jesse Hall3fbc8562015-11-29 22:10:52 -08001653 u32 layerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001654}
1655
Jesse Hall65ab5522015-11-30 00:07:16 -08001656class VkComponentMapping {
1657 VkComponentSwizzle r
1658 VkComponentSwizzle g
1659 VkComponentSwizzle b
1660 VkComponentSwizzle a
Jesse Halld27f6aa2015-08-15 17:58:48 -07001661}
1662
1663class VkPhysicalDeviceProperties {
1664 u32 apiVersion
1665 u32 driverVersion
Jesse Hall65ab5522015-11-30 00:07:16 -08001666 u32 vendorID
1667 u32 deviceID
Jesse Halld27f6aa2015-08-15 17:58:48 -07001668 VkPhysicalDeviceType deviceType
Jesse Hall65ab5522015-11-30 00:07:16 -08001669 char[VK_MAX_PHYSICAL_DEVICE_NAME_SIZE] deviceName
1670 u8[VK_UUID_SIZE] pipelineCacheUUID
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001671 VkPhysicalDeviceLimits limits
1672 VkPhysicalDeviceSparseProperties sparseProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07001673}
1674
1675class VkExtensionProperties {
Jesse Hall65ab5522015-11-30 00:07:16 -08001676 char[VK_MAX_EXTENSION_NAME_SIZE] extensionName /// extension name
Jesse Halld27f6aa2015-08-15 17:58:48 -07001677 u32 specVersion /// version of the extension specification implemented
1678}
1679
1680class VkLayerProperties {
Jesse Hall65ab5522015-11-30 00:07:16 -08001681 char[VK_MAX_EXTENSION_NAME_SIZE] layerName /// layer name
Jesse Hall3fbc8562015-11-29 22:10:52 -08001682 u32 specVersion /// version of the layer specification implemented
1683 u32 implementationVersion /// build or release version of the layer's library
Jesse Hall65ab5522015-11-30 00:07:16 -08001684 char[VK_MAX_DESCRIPTION_SIZE] description /// Free-form description of the layer
Jesse Halld27f6aa2015-08-15 17:58:48 -07001685}
1686
Jesse Halla366a512015-11-19 22:30:07 -08001687class VkSubmitInfo {
Jesse Hall03b6fe12015-11-24 12:44:21 -08001688 VkStructureType sType /// Type of structure. Should be VK_STRUCTURE_TYPE_SUBMIT_INFO
1689 const void* pNext /// Next structure in chain
1690 u32 waitSemaphoreCount
Jesse Halla366a512015-11-19 22:30:07 -08001691 const VkSemaphore* pWaitSemaphores
Jesse Hall543a7ff2016-01-08 16:38:30 -08001692 const VkPipelineStageFlags* pWaitDstStageMask
Jesse Hall03b6fe12015-11-24 12:44:21 -08001693 u32 commandBufferCount
Jesse Hall3fbc8562015-11-29 22:10:52 -08001694 const VkCommandBuffer* pCommandBuffers
Jesse Hall03b6fe12015-11-24 12:44:21 -08001695 u32 signalSemaphoreCount
Jesse Halla366a512015-11-19 22:30:07 -08001696 const VkSemaphore* pSignalSemaphores
1697}
1698
Jesse Halld27f6aa2015-08-15 17:58:48 -07001699class VkApplicationInfo {
1700 VkStructureType sType /// Type of structure. Should be VK_STRUCTURE_TYPE_APPLICATION_INFO
1701 const void* pNext /// Next structure in chain
Jesse Hall3fbc8562015-11-29 22:10:52 -08001702 const char* pApplicationName
1703 u32 applicationVersion
Jesse Halld27f6aa2015-08-15 17:58:48 -07001704 const char* pEngineName
1705 u32 engineVersion
1706 u32 apiVersion
1707}
1708
Jesse Hall3fbc8562015-11-29 22:10:52 -08001709class VkAllocationCallbacks {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001710 void* pUserData
Jesse Hall3fbc8562015-11-29 22:10:52 -08001711 PFN_vkAllocationFunction pfnAllocation
1712 PFN_vkReallocationFunction pfnReallocation
Jesse Halld27f6aa2015-08-15 17:58:48 -07001713 PFN_vkFreeFunction pfnFree
Jesse Hall3fbc8562015-11-29 22:10:52 -08001714 PFN_vkInternalAllocationNotification pfnInternalAllocation
Jesse Hall03b6fe12015-11-24 12:44:21 -08001715 PFN_vkInternalFreeNotification pfnInternalFree
Jesse Halld27f6aa2015-08-15 17:58:48 -07001716}
1717
1718class VkDeviceQueueCreateInfo {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001719 VkStructureType sStype /// Should be VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO
1720 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001721 VkDeviceQueueCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001722 u32 queueFamilyIndex
Jesse Halldba27f72015-11-30 14:25:46 -08001723 u32 queueCount
Jesse Hallfbf97b02015-11-20 14:17:03 -08001724 const f32* pQueuePriorities
Jesse Halld27f6aa2015-08-15 17:58:48 -07001725}
1726
1727class VkDeviceCreateInfo {
1728 VkStructureType sType /// Should be VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO
1729 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001730 VkDeviceCreateFlags flags
Jesse Halldba27f72015-11-30 14:25:46 -08001731 u32 queueCreateInfoCount
1732 const VkDeviceQueueCreateInfo* pQueueCreateInfos
Jesse Hall3dd678a2016-01-08 21:52:01 -08001733 u32 enabledLayerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001734 const char* const* ppEnabledLayerNames /// Ordered list of layer names to be enabled
Jesse Hall3dd678a2016-01-08 21:52:01 -08001735 u32 enabledExtensionCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001736 const char* const* ppEnabledExtensionNames
1737 const VkPhysicalDeviceFeatures* pEnabledFeatures
Jesse Halld27f6aa2015-08-15 17:58:48 -07001738}
1739
1740class VkInstanceCreateInfo {
1741 VkStructureType sType /// Should be VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO
1742 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001743 VkInstanceCreateFlags flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001744 const VkApplicationInfo* pApplicationInfo
Jesse Hall3dd678a2016-01-08 21:52:01 -08001745 u32 enabledLayerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001746 const char* const* ppEnabledLayerNames /// Ordered list of layer names to be enabled
Jesse Hall3dd678a2016-01-08 21:52:01 -08001747 u32 enabledExtensionCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001748 const char* const* ppEnabledExtensionNames /// Extension names to be enabled
1749}
1750
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001751class VkQueueFamilyProperties {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001752 VkQueueFlags queueFlags /// Queue flags
1753 u32 queueCount
Jesse Hallacfa5342015-11-19 21:51:33 -08001754 u32 timestampValidBits
Jesse Hall65ab5522015-11-30 00:07:16 -08001755 VkExtent3D minImageTransferGranularity
Jesse Halld27f6aa2015-08-15 17:58:48 -07001756}
1757
1758class VkPhysicalDeviceMemoryProperties {
1759 u32 memoryTypeCount
1760 VkMemoryType[VK_MAX_MEMORY_TYPES] memoryTypes
1761 u32 memoryHeapCount
1762 VkMemoryHeap[VK_MAX_MEMORY_HEAPS] memoryHeaps
1763}
1764
Jesse Hall3fbc8562015-11-29 22:10:52 -08001765class VkMemoryAllocateInfo {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001766 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07001767 const void* pNext /// Pointer to next structure
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001768 VkDeviceSize allocationSize /// Size of memory allocation
Jesse Halld27f6aa2015-08-15 17:58:48 -07001769 u32 memoryTypeIndex /// Index of the of the memory type to allocate from
1770}
1771
1772class VkMemoryRequirements {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001773 VkDeviceSize size /// Specified in bytes
1774 VkDeviceSize alignment /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001775 u32 memoryTypeBits /// Bitfield of the allowed memory type indices into memoryTypes[] for this object
1776}
1777
1778class VkSparseImageFormatProperties {
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001779 VkImageAspectFlagBits aspectMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001780 VkExtent3D imageGranularity
1781 VkSparseImageFormatFlags flags
1782}
1783
1784class VkSparseImageMemoryRequirements {
Jesse Hallb00daad2015-11-29 19:46:20 -08001785 VkSparseImageFormatProperties formatProperties
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001786 u32 imageMipTailFirstLod
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001787 VkDeviceSize imageMipTailSize /// Specified in bytes, must be a multiple of image block size / alignment
1788 VkDeviceSize imageMipTailOffset /// Specified in bytes, must be a multiple of image block size / alignment
1789 VkDeviceSize imageMipTailStride /// Specified in bytes, must be a multiple of image block size / alignment
Jesse Halld27f6aa2015-08-15 17:58:48 -07001790}
1791
1792class VkMemoryType {
1793 VkMemoryPropertyFlags propertyFlags /// Memory properties of this memory type
1794 u32 heapIndex /// Index of the memory heap allocations of this memory type are taken from
1795}
1796
1797class VkMemoryHeap {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001798 VkDeviceSize size /// Available memory in the heap
Jesse Halld27f6aa2015-08-15 17:58:48 -07001799 VkMemoryHeapFlags flags /// Flags for the heap
1800}
1801
1802class VkMappedMemoryRange {
1803 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE
1804 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08001805 VkDeviceMemory memory /// Mapped memory object
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001806 VkDeviceSize offset /// Offset within the mapped memory the range starts from
1807 VkDeviceSize size /// Size of the range within the mapped memory
Jesse Halld27f6aa2015-08-15 17:58:48 -07001808}
1809
1810class VkFormatProperties {
1811 VkFormatFeatureFlags linearTilingFeatures /// Format features in case of linear tiling
1812 VkFormatFeatureFlags optimalTilingFeatures /// Format features in case of optimal tiling
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001813 VkFormatFeatureFlags bufferFeatures /// Format features supported by buffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07001814}
1815
1816class VkImageFormatProperties {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001817 VkExtent3D maxExtent /// max image dimensions for this resource type
1818 u32 maxMipLevels /// max number of mipmap levels for this resource type
Jesse Halla15a4bf2015-11-19 22:48:02 -08001819 u32 maxArrayLayers /// max array layers for this resource type
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001820 VkSampleCountFlags sampleCounts /// supported sample counts for this resource type
1821 VkDeviceSize maxResourceSize /// max size (in bytes) of this resource type
1822}
1823
Jesse Halla15a4bf2015-11-19 22:48:02 -08001824class VkDescriptorImageInfo {
1825 VkSampler sampler
1826 VkImageView imageView
1827 VkImageLayout imageLayout
1828}
1829
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001830class VkDescriptorBufferInfo {
1831 VkBuffer buffer /// Buffer used for this descriptor when the descriptor is UNIFORM_BUFFER[_DYNAMIC]
1832 VkDeviceSize offset /// Base offset from buffer start in bytes to update in the descriptor set.
1833 VkDeviceSize range /// Size in bytes of the buffer resource for this descriptor update.
Jesse Halld27f6aa2015-08-15 17:58:48 -07001834}
1835
Jesse Halld27f6aa2015-08-15 17:58:48 -07001836class VkWriteDescriptorSet {
1837 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET
1838 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08001839 VkDescriptorSet dstSet /// Destination descriptor set
1840 u32 dstBinding /// Binding within the destination descriptor set to write
1841 u32 dstArrayElement /// Array element within the destination binding to write
Jesse Hall03b6fe12015-11-24 12:44:21 -08001842 u32 descriptorCount /// Number of descriptors to write (determines the size of the array pointed by <pDescriptors>)
Jesse Halld27f6aa2015-08-15 17:58:48 -07001843 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 -08001844 const VkDescriptorImageInfo* pImageInfo
1845 const VkDescriptorBufferInfo* pBufferInfo
1846 const VkBufferView* pTexelBufferView
Jesse Halld27f6aa2015-08-15 17:58:48 -07001847}
1848
1849class VkCopyDescriptorSet {
1850 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET
1851 const void* pNext /// Pointer to next structure
1852 VkDescriptorSet srcSet /// Source descriptor set
1853 u32 srcBinding /// Binding within the source descriptor set to copy from
1854 u32 srcArrayElement /// Array element within the source binding to copy from
Jesse Hall3fbc8562015-11-29 22:10:52 -08001855 VkDescriptorSet dstSet /// Destination descriptor set
1856 u32 dstBinding /// Binding within the destination descriptor set to copy to
1857 u32 dstArrayElement /// Array element within the destination binding to copy to
Jesse Hall03b6fe12015-11-24 12:44:21 -08001858 u32 descriptorCount /// Number of descriptors to copy
Jesse Halld27f6aa2015-08-15 17:58:48 -07001859}
1860
1861class VkBufferCreateInfo {
1862 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO
1863 const void* pNext /// Pointer to next structure.
Jesse Halla6429252015-11-29 18:59:42 -08001864 VkBufferCreateFlags flags /// Buffer creation flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001865 VkDeviceSize size /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001866 VkBufferUsageFlags usage /// Buffer usage flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001867 VkSharingMode sharingMode
Jesse Hall03b6fe12015-11-24 12:44:21 -08001868 u32 queueFamilyIndexCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001869 const u32* pQueueFamilyIndices
1870}
1871
1872class VkBufferViewCreateInfo {
1873 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO
1874 const void* pNext /// Pointer to next structure.
Jesse Halla6429252015-11-29 18:59:42 -08001875 VkBufferViewCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001876 VkBuffer buffer
Jesse Halld27f6aa2015-08-15 17:58:48 -07001877 VkFormat format /// Optionally specifies format of elements
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001878 VkDeviceSize offset /// Specified in bytes
1879 VkDeviceSize range /// View size specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001880}
1881
1882class VkImageSubresource {
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001883 VkImageAspectFlagBits aspectMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001884 u32 mipLevel
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001885 u32 arrayLayer
Jesse Halld27f6aa2015-08-15 17:58:48 -07001886}
1887
1888class VkImageSubresourceRange {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001889 VkImageAspectFlags aspectMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001890 u32 baseMipLevel
Jesse Hall3fbc8562015-11-29 22:10:52 -08001891 u32 levelCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001892 u32 baseArrayLayer
Jesse Hall3fbc8562015-11-29 22:10:52 -08001893 u32 layerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001894}
1895
1896class VkMemoryBarrier {
1897 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MEMORY_BARRIER
1898 const void* pNext /// Pointer to next structure.
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001899 VkAccessFlags srcAccessMask
1900 VkAccessFlags dstAccessMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001901}
1902
1903class VkBufferMemoryBarrier {
1904 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER
1905 const void* pNext /// Pointer to next structure.
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001906 VkAccessFlags srcAccessMask
1907 VkAccessFlags dstAccessMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001908 u32 srcQueueFamilyIndex /// Queue family to transition ownership from
Jesse Hall3fbc8562015-11-29 22:10:52 -08001909 u32 dstQueueFamilyIndex /// Queue family to transition ownership to
Jesse Halld27f6aa2015-08-15 17:58:48 -07001910 VkBuffer buffer /// Buffer to sync
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001911 VkDeviceSize offset /// Offset within the buffer to sync
1912 VkDeviceSize size /// Amount of bytes to sync
Jesse Halld27f6aa2015-08-15 17:58:48 -07001913}
1914
1915class VkImageMemoryBarrier {
1916 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER
1917 const void* pNext /// Pointer to next structure.
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001918 VkAccessFlags srcAccessMask
1919 VkAccessFlags dstAccessMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001920 VkImageLayout oldLayout /// Current layout of the image
1921 VkImageLayout newLayout /// New layout to transition the image to
1922 u32 srcQueueFamilyIndex /// Queue family to transition ownership from
Jesse Hall3fbc8562015-11-29 22:10:52 -08001923 u32 dstQueueFamilyIndex /// Queue family to transition ownership to
Jesse Halld27f6aa2015-08-15 17:58:48 -07001924 VkImage image /// Image to sync
1925 VkImageSubresourceRange subresourceRange /// Subresource range to sync
1926}
1927
1928class VkImageCreateInfo {
1929 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO
1930 const void* pNext /// Pointer to next structure.
Jesse Halla6429252015-11-29 18:59:42 -08001931 VkImageCreateFlags flags /// Image creation flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001932 VkImageType imageType
1933 VkFormat format
1934 VkExtent3D extent
1935 u32 mipLevels
Jesse Halla15a4bf2015-11-19 22:48:02 -08001936 u32 arrayLayers
Jesse Hall091ed9e2015-11-30 00:55:29 -08001937 VkSampleCountFlagBits samples
Jesse Halld27f6aa2015-08-15 17:58:48 -07001938 VkImageTiling tiling
1939 VkImageUsageFlags usage /// Image usage flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001940 VkSharingMode sharingMode /// Cross-queue-family sharing mode
Jesse Hall03b6fe12015-11-24 12:44:21 -08001941 u32 queueFamilyIndexCount /// Number of queue families to share across
Jesse Halld27f6aa2015-08-15 17:58:48 -07001942 const u32* pQueueFamilyIndices /// Array of queue family indices to share across
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001943 VkImageLayout initialLayout /// Initial image layout for all subresources
Jesse Halld27f6aa2015-08-15 17:58:48 -07001944}
1945
1946class VkSubresourceLayout {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001947 VkDeviceSize offset /// Specified in bytes
1948 VkDeviceSize size /// Specified in bytes
1949 VkDeviceSize rowPitch /// Specified in bytes
Jesse Hall543a7ff2016-01-08 16:38:30 -08001950 VkDeviceSize arrayPitch /// Specified in bytes
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001951 VkDeviceSize depthPitch /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001952}
1953
1954class VkImageViewCreateInfo {
1955 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO
1956 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001957 VkImageViewCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001958 VkImage image
1959 VkImageViewType viewType
1960 VkFormat format
Jesse Hall65ab5522015-11-30 00:07:16 -08001961 VkComponentMapping components
Jesse Halld27f6aa2015-08-15 17:58:48 -07001962 VkImageSubresourceRange subresourceRange
Jesse Halld27f6aa2015-08-15 17:58:48 -07001963}
1964
1965class VkBufferCopy {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001966 VkDeviceSize srcOffset /// Specified in bytes
Jesse Hall3fbc8562015-11-29 22:10:52 -08001967 VkDeviceSize dstOffset /// Specified in bytes
Jesse Hallb00daad2015-11-29 19:46:20 -08001968 VkDeviceSize size /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001969}
1970
Jesse Halla6429252015-11-29 18:59:42 -08001971class VkSparseMemoryBind {
Jesse Hallb00daad2015-11-29 19:46:20 -08001972 VkDeviceSize resourceOffset /// Specified in bytes
1973 VkDeviceSize size /// Specified in bytes
Jesse Hall3fbc8562015-11-29 22:10:52 -08001974 VkDeviceMemory memory
1975 VkDeviceSize memoryOffset /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001976 VkSparseMemoryBindFlags flags
1977}
1978
Jesse Halla6429252015-11-29 18:59:42 -08001979class VkSparseImageMemoryBind {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001980 VkImageSubresource subresource
1981 VkOffset3D offset
1982 VkExtent3D extent
Jesse Hall3fbc8562015-11-29 22:10:52 -08001983 VkDeviceMemory memory
1984 VkDeviceSize memoryOffset /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001985 VkSparseMemoryBindFlags flags
1986}
1987
Jesse Halla6429252015-11-29 18:59:42 -08001988class VkSparseBufferMemoryBindInfo {
1989 VkBuffer buffer
1990 u32 bindCount
1991 const VkSparseMemoryBind* pBinds
1992}
1993
1994class VkSparseImageOpaqueMemoryBindInfo {
1995 VkImage image
1996 u32 bindCount
1997 const VkSparseMemoryBind* pBinds
1998}
1999
2000class VkSparseImageMemoryBindInfo {
2001 VkImage image
2002 u32 bindCount
2003 const VkSparseMemoryBind* pBinds
2004}
2005
2006class VkBindSparseInfo {
2007 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BIND_SPARSE_INFO
2008 const void* pNext
2009 u32 waitSemaphoreCount
2010 const VkSemaphore* pWaitSemaphores
2011 u32 numBufferBinds
2012 const VkSparseBufferMemoryBindInfo* pBufferBinds
2013 u32 numImageOpaqueBinds
2014 const VkSparseImageOpaqueMemoryBindInfo* pImageOpaqueBinds
2015 u32 numImageBinds
2016 const VkSparseImageMemoryBindInfo* pImageBinds
2017 u32 signalSemaphoreCount
2018 const VkSemaphore* pSignalSemaphores
2019}
2020
Jesse Hall65ab5522015-11-30 00:07:16 -08002021class VkImageSubresourceLayers {
2022 VkImageAspectFlags aspectMask
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002023 u32 mipLevel
Jesse Halla15a4bf2015-11-19 22:48:02 -08002024 u32 baseArrayLayer
Jesse Hall3fbc8562015-11-29 22:10:52 -08002025 u32 layerCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002026}
2027
Jesse Halld27f6aa2015-08-15 17:58:48 -07002028class VkImageCopy {
Jesse Hall65ab5522015-11-30 00:07:16 -08002029 VkImageSubresourceLayers srcSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07002030 VkOffset3D srcOffset /// Specified in pixels for both compressed and uncompressed images
Jesse Hall65ab5522015-11-30 00:07:16 -08002031 VkImageSubresourceLayers dstSubresource
Jesse Hall3fbc8562015-11-29 22:10:52 -08002032 VkOffset3D dstOffset /// Specified in pixels for both compressed and uncompressed images
Jesse Halld27f6aa2015-08-15 17:58:48 -07002033 VkExtent3D extent /// Specified in pixels for both compressed and uncompressed images
2034}
2035
2036class VkImageBlit {
Jesse Hall65ab5522015-11-30 00:07:16 -08002037 VkImageSubresourceLayers srcSubresource
Jesse Hall3dd678a2016-01-08 21:52:01 -08002038 VkOffset3D[2] srcOffsets
Jesse Hall65ab5522015-11-30 00:07:16 -08002039 VkImageSubresourceLayers dstSubresource
Jesse Hall3dd678a2016-01-08 21:52:01 -08002040 VkOffset3D[2] dstOffsets
Jesse Halld27f6aa2015-08-15 17:58:48 -07002041}
2042
2043class VkBufferImageCopy {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002044 VkDeviceSize bufferOffset /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002045 u32 bufferRowLength /// Specified in texels
2046 u32 bufferImageHeight
Jesse Hall65ab5522015-11-30 00:07:16 -08002047 VkImageSubresourceLayers imageSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07002048 VkOffset3D imageOffset /// Specified in pixels for both compressed and uncompressed images
2049 VkExtent3D imageExtent /// Specified in pixels for both compressed and uncompressed images
2050}
2051
2052class VkImageResolve {
Jesse Hall65ab5522015-11-30 00:07:16 -08002053 VkImageSubresourceLayers srcSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07002054 VkOffset3D srcOffset
Jesse Hall65ab5522015-11-30 00:07:16 -08002055 VkImageSubresourceLayers dstSubresource
Jesse Hall3fbc8562015-11-29 22:10:52 -08002056 VkOffset3D dstOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07002057 VkExtent3D extent
2058}
2059
2060class VkShaderModuleCreateInfo {
2061 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO
2062 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002063 VkShaderModuleCreateFlags flags /// Reserved
Jesse Halld27f6aa2015-08-15 17:58:48 -07002064 platform.size_t codeSize /// Specified in bytes
Jesse Halla9bb62b2015-11-21 19:31:56 -08002065 const u32* pCode /// Binary code of size codeSize
Jesse Halld27f6aa2015-08-15 17:58:48 -07002066}
2067
Jesse Halld27f6aa2015-08-15 17:58:48 -07002068class VkDescriptorSetLayoutBinding {
Jesse Hall091ed9e2015-11-30 00:55:29 -08002069 u32 binding
Jesse Halld27f6aa2015-08-15 17:58:48 -07002070 VkDescriptorType descriptorType /// Type of the descriptors in this binding
Jesse Halldba27f72015-11-30 14:25:46 -08002071 u32 descriptorCount /// Number of descriptors in this binding
Jesse Halld27f6aa2015-08-15 17:58:48 -07002072 VkShaderStageFlags stageFlags /// Shader stages this binding is visible to
2073 const VkSampler* pImmutableSamplers /// Immutable samplers (used if descriptor type is SAMPLER or COMBINED_IMAGE_SAMPLER, is either NULL or contains <count> number of elements)
2074}
2075
2076class VkDescriptorSetLayoutCreateInfo {
2077 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO
2078 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002079 VkDescriptorSetLayoutCreateFlags flags
Jesse Hall03b6fe12015-11-24 12:44:21 -08002080 u32 bindingCount /// Number of bindings in the descriptor set layout
Jesse Hall543a7ff2016-01-08 16:38:30 -08002081 const VkDescriptorSetLayoutBinding* pBindings /// Array of descriptor set layout bindings
Jesse Halld27f6aa2015-08-15 17:58:48 -07002082}
2083
Jesse Hall65ab5522015-11-30 00:07:16 -08002084class VkDescriptorPoolSize {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002085 VkDescriptorType type
Jesse Hall03b6fe12015-11-24 12:44:21 -08002086 u32 descriptorCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002087}
2088
2089class VkDescriptorPoolCreateInfo {
2090 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO
2091 const void* pNext /// Pointer to next structure
Jesse Hallfbf97b02015-11-20 14:17:03 -08002092 VkDescriptorPoolCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002093 u32 maxSets
Jesse Hall65ab5522015-11-30 00:07:16 -08002094 u32 poolSizeCount
2095 const VkDescriptorPoolSize* pPoolSizes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002096}
2097
Jesse Hall3fbc8562015-11-29 22:10:52 -08002098class VkDescriptorSetAllocateInfo {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002099 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO
Jesse Hallfbf97b02015-11-20 14:17:03 -08002100 const void* pNext /// Pointer to next structure
2101 VkDescriptorPool descriptorPool
Jesse Hall03b6fe12015-11-24 12:44:21 -08002102 u32 setCount
Jesse Hallfbf97b02015-11-20 14:17:03 -08002103 const VkDescriptorSetLayout* pSetLayouts
2104}
2105
Jesse Halld27f6aa2015-08-15 17:58:48 -07002106class VkSpecializationMapEntry {
Jesse Hall65ab5522015-11-30 00:07:16 -08002107 u32 constantID /// The SpecConstant ID specified in the BIL
Jesse Halld27f6aa2015-08-15 17:58:48 -07002108 u32 offset /// Offset of the value in the data block
Jesse Hallb00daad2015-11-29 19:46:20 -08002109 platform.size_t size /// Size in bytes of the SpecConstant
Jesse Halld27f6aa2015-08-15 17:58:48 -07002110}
2111
2112class VkSpecializationInfo {
2113 u32 mapEntryCount /// Number of entries in the map
Jesse Hallb00daad2015-11-29 19:46:20 -08002114 const VkSpecializationMapEntry* pMapEntries /// Array of map entries
Jesse Halld27f6aa2015-08-15 17:58:48 -07002115 platform.size_t dataSize /// Size in bytes of pData
2116 const void* pData /// Pointer to SpecConstant data
2117}
2118
2119class VkPipelineShaderStageCreateInfo {
2120 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO
2121 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002122 VkPipelineShaderStageCreateFlags flags
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002123 VkShaderStageFlagBits stage
2124 VkShaderModule module
2125 const char* pName
Jesse Halld27f6aa2015-08-15 17:58:48 -07002126 const VkSpecializationInfo* pSpecializationInfo
2127}
2128
2129class VkComputePipelineCreateInfo {
2130 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO
2131 const void* pNext /// Pointer to next structure
Jesse Halld27f6aa2015-08-15 17:58:48 -07002132 VkPipelineCreateFlags flags /// Pipeline creation flags
Jesse Halla6429252015-11-29 18:59:42 -08002133 VkPipelineShaderStageCreateInfo stage
Jesse Halld27f6aa2015-08-15 17:58:48 -07002134 VkPipelineLayout layout /// Interface layout of the pipeline
2135 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
2136 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
2137}
2138
2139class VkVertexInputBindingDescription {
Jesse Hallb00daad2015-11-29 19:46:20 -08002140 u32 binding /// Vertex buffer binding id
2141 u32 stride /// Distance between vertices in bytes (0 = no advancement)
Jesse Hall65ab5522015-11-30 00:07:16 -08002142 VkVertexInputRate inputRate /// Rate at which binding is incremented
Jesse Halld27f6aa2015-08-15 17:58:48 -07002143}
2144
2145class VkVertexInputAttributeDescription {
Jesse Hallb00daad2015-11-29 19:46:20 -08002146 u32 location /// location of the shader vertex attrib
2147 u32 binding /// Vertex buffer binding id
2148 VkFormat format /// format of source data
2149 u32 offset /// Offset of first element in bytes from base of vertex
Jesse Halld27f6aa2015-08-15 17:58:48 -07002150}
2151
2152class VkPipelineVertexInputStateCreateInfo {
Jesse Hall03b6fe12015-11-24 12:44:21 -08002153 VkStructureType sType /// Should be VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO
2154 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002155 VkPipelineVertexInputStateCreateFlags flags
Jesse Hall03b6fe12015-11-24 12:44:21 -08002156 u32 vertexBindingDescriptionCount /// number of bindings
Jesse Halld27f6aa2015-08-15 17:58:48 -07002157 const VkVertexInputBindingDescription* pVertexBindingDescriptions
Jesse Hall03b6fe12015-11-24 12:44:21 -08002158 u32 vertexAttributeDescriptionCount /// number of attributes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002159 const VkVertexInputAttributeDescription* pVertexAttributeDescriptions
2160}
2161
2162class VkPipelineInputAssemblyStateCreateInfo {
2163 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO
2164 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002165 VkPipelineInputAssemblyStateCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002166 VkPrimitiveTopology topology
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002167 VkBool32 primitiveRestartEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002168}
2169
2170class VkPipelineTessellationStateCreateInfo {
2171 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO
2172 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002173 VkPipelineTessellationStateCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002174 u32 patchControlPoints
2175}
2176
2177class VkPipelineViewportStateCreateInfo {
2178 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO
2179 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002180 VkPipelineViewportStateCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002181 u32 viewportCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002182 const VkViewport* pViewports
2183 u32 scissorCount
2184 const VkRect2D* pScissors
Jesse Halld27f6aa2015-08-15 17:58:48 -07002185}
2186
Jesse Hall3fbc8562015-11-29 22:10:52 -08002187class VkPipelineRasterizationStateCreateInfo {
Jesse Hall65ab5522015-11-30 00:07:16 -08002188 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002189 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08002190 VkPipelineRasterizationStateCreateFlags flags
Jesse Hallae38f732015-11-19 21:32:50 -08002191 VkBool32 depthClampEnable
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002192 VkBool32 rasterizerDiscardEnable
Jesse Hall65ab5522015-11-30 00:07:16 -08002193 VkPolygonMode polygonMode /// optional (GL45)
Jesse Hallc7467b72015-11-29 21:05:26 -08002194 VkCullModeFlags cullMode
Jesse Halld27f6aa2015-08-15 17:58:48 -07002195 VkFrontFace frontFace
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002196 VkBool32 depthBiasEnable
Jesse Halla9bb62b2015-11-21 19:31:56 -08002197 f32 depthBiasConstantFactor
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002198 f32 depthBiasClamp
Jesse Halla9bb62b2015-11-21 19:31:56 -08002199 f32 depthBiasSlopeFactor
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002200 f32 lineWidth
Jesse Halld27f6aa2015-08-15 17:58:48 -07002201}
2202
2203class VkPipelineMultisampleStateCreateInfo {
2204 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO
2205 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002206 VkPipelineMultisampleStateCreateFlags flags
Jesse Hall091ed9e2015-11-30 00:55:29 -08002207 VkSampleCountFlagBits rasterizationSamples /// Number of samples used for rasterization
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002208 VkBool32 sampleShadingEnable /// optional (GL45)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002209 f32 minSampleShading /// optional (GL45)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002210 const VkSampleMask* pSampleMask
Jesse Hallacfa5342015-11-19 21:51:33 -08002211 VkBool32 alphaToCoverageEnable
2212 VkBool32 alphaToOneEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002213}
2214
2215class VkPipelineColorBlendAttachmentState {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002216 VkBool32 blendEnable
Jesse Hall65ab5522015-11-30 00:07:16 -08002217 VkBlendFactor srcColorBlendFactor
2218 VkBlendFactor dstColorBlendFactor
2219 VkBlendOp colorBlendOp
2220 VkBlendFactor srcAlphaBlendFactor
2221 VkBlendFactor dstAlphaBlendFactor
2222 VkBlendOp alphaBlendOp
2223 VkColorComponentFlags colorWriteMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07002224}
2225
2226class VkPipelineColorBlendStateCreateInfo {
2227 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO
2228 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002229 VkPipelineColorBlendStateCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002230 VkBool32 logicOpEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002231 VkLogicOp logicOp
2232 u32 attachmentCount /// # of pAttachments
2233 const VkPipelineColorBlendAttachmentState* pAttachments
Jesse Hallb00daad2015-11-29 19:46:20 -08002234 f32[4] blendConstants
Jesse Halld27f6aa2015-08-15 17:58:48 -07002235}
2236
2237class VkStencilOpState {
Jesse Hall65ab5522015-11-30 00:07:16 -08002238 VkStencilOp failOp
2239 VkStencilOp passOp
2240 VkStencilOp depthFailOp
2241 VkCompareOp compareOp
2242 u32 compareMask
2243 u32 writeMask
2244 u32 reference
Jesse Halld27f6aa2015-08-15 17:58:48 -07002245}
2246
2247class VkPipelineDepthStencilStateCreateInfo {
2248 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO
2249 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002250 VkPipelineDepthStencilStateCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002251 VkBool32 depthTestEnable
2252 VkBool32 depthWriteEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002253 VkCompareOp depthCompareOp
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002254 VkBool32 depthBoundsTestEnable /// optional (depth_bounds_test)
2255 VkBool32 stencilTestEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002256 VkStencilOpState front
2257 VkStencilOpState back
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002258 f32 minDepthBounds
2259 f32 maxDepthBounds
2260}
2261
2262class VkPipelineDynamicStateCreateInfo {
2263 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO
2264 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002265 VkPipelineDynamicStateCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002266 u32 dynamicStateCount
2267 const VkDynamicState* pDynamicStates
Jesse Halld27f6aa2015-08-15 17:58:48 -07002268}
2269
2270class VkGraphicsPipelineCreateInfo {
Jesse Halla6429252015-11-29 18:59:42 -08002271 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO
2272 const void* pNext /// Pointer to next structure
2273 VkPipelineCreateFlags flags /// Pipeline creation flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002274 u32 stageCount
Jesse Halla6429252015-11-29 18:59:42 -08002275 const VkPipelineShaderStageCreateInfo* pStages /// One entry for each active shader stage
Jesse Halld27f6aa2015-08-15 17:58:48 -07002276 const VkPipelineVertexInputStateCreateInfo* pVertexInputState
2277 const VkPipelineInputAssemblyStateCreateInfo* pInputAssemblyState
2278 const VkPipelineTessellationStateCreateInfo* pTessellationState
2279 const VkPipelineViewportStateCreateInfo* pViewportState
Jesse Hall3fbc8562015-11-29 22:10:52 -08002280 const VkPipelineRasterizationStateCreateInfo* pRasterizationState
Jesse Halld27f6aa2015-08-15 17:58:48 -07002281 const VkPipelineMultisampleStateCreateInfo* pMultisampleState
2282 const VkPipelineDepthStencilStateCreateInfo* pDepthStencilState
2283 const VkPipelineColorBlendStateCreateInfo* pColorBlendState
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002284 const VkPipelineDynamicStateCreateInfo* pDynamicState
Jesse Halla6429252015-11-29 18:59:42 -08002285 VkPipelineLayout layout /// Interface layout of the pipeline
Jesse Halld27f6aa2015-08-15 17:58:48 -07002286 VkRenderPass renderPass
2287 u32 subpass
Jesse Halla6429252015-11-29 18:59:42 -08002288 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
2289 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 -07002290}
2291
2292class VkPipelineCacheCreateInfo {
Jesse Hallb00daad2015-11-29 19:46:20 -08002293 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO
2294 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002295 VkPipelineCacheCreateFlags flags
Jesse Hallb00daad2015-11-29 19:46:20 -08002296 platform.size_t initialDataSize /// Size of initial data to populate cache, in bytes
2297 const void* pInitialData /// Initial data to populate cache
Jesse Halld27f6aa2015-08-15 17:58:48 -07002298}
2299
2300class VkPushConstantRange {
2301 VkShaderStageFlags stageFlags /// Which stages use the range
Jesse Hall03b6fe12015-11-24 12:44:21 -08002302 u32 offset /// Start of the range, in bytes
2303 u32 size /// Length of the range, in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002304}
2305
2306class VkPipelineLayoutCreateInfo {
2307 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO
2308 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002309 VkPipelineLayoutCreateFlags flags
Jesse Hall3dd678a2016-01-08 21:52:01 -08002310 u32 descriptorSetCount /// Number of descriptor sets interfaced by the pipeline
Jesse Halld27f6aa2015-08-15 17:58:48 -07002311 const VkDescriptorSetLayout* pSetLayouts /// Array of <setCount> number of descriptor set layout objects defining the layout of the
2312 u32 pushConstantRangeCount /// Number of push-constant ranges used by the pipeline
2313 const VkPushConstantRange* pPushConstantRanges /// Array of pushConstantRangeCount number of ranges used by various shader stages
2314}
2315
2316class VkSamplerCreateInfo {
2317 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO
2318 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002319 VkSamplerCreateFlags flags
Jesse Hall23ff73f2015-11-29 14:36:39 -08002320 VkFilter magFilter /// Filter mode for magnification
2321 VkFilter minFilter /// Filter mode for minifiation
2322 VkSamplerMipmapMode mipmapMode /// Mipmap selection mode
2323 VkSamplerAddressMode addressModeU
2324 VkSamplerAddressMode addressModeV
2325 VkSamplerAddressMode addressModeW
Jesse Halld27f6aa2015-08-15 17:58:48 -07002326 f32 mipLodBias
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002327 VkBool32 anisotropyEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002328 f32 maxAnisotropy
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002329 VkBool32 compareEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002330 VkCompareOp compareOp
2331 f32 minLod
2332 f32 maxLod
2333 VkBorderColor borderColor
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002334 VkBool32 unnormalizedCoordinates
Jesse Halld27f6aa2015-08-15 17:58:48 -07002335}
2336
Jesse Hall3fbc8562015-11-29 22:10:52 -08002337class VkCommandPoolCreateInfo {
2338 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002339 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08002340 VkCommandPoolCreateFlags flags /// Command pool creation flags
Jesse Halla6429252015-11-29 18:59:42 -08002341 u32 queueFamilyIndex
Jesse Halld27f6aa2015-08-15 17:58:48 -07002342}
2343
Jesse Hall3fbc8562015-11-29 22:10:52 -08002344class VkCommandBufferAllocateInfo {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002345 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002346 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08002347 VkCommandPool commandPool
2348 VkCommandBufferLevel level
Jesse Hall3dd678a2016-01-08 21:52:01 -08002349 u32 commandBufferCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002350}
2351
Jesse Hall3dd678a2016-01-08 21:52:01 -08002352class VkCommandBufferInheritanceInfo {
2353 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002354 const void* pNext /// Pointer to next structure
Jesse Halld27f6aa2015-08-15 17:58:48 -07002355 VkRenderPass renderPass /// Render pass for secondary command buffers
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002356 u32 subpass
Jesse Halld27f6aa2015-08-15 17:58:48 -07002357 VkFramebuffer framebuffer /// Framebuffer for secondary command buffers
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002358 VkBool32 occlusionQueryEnable
2359 VkQueryControlFlags queryFlags
2360 VkQueryPipelineStatisticFlags pipelineStatistics
Jesse Halld27f6aa2015-08-15 17:58:48 -07002361}
2362
Jesse Hall3dd678a2016-01-08 21:52:01 -08002363class VkCommandBufferBeginInfo {
2364 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO
2365 const void* pNext /// Pointer to next structure
2366 VkCommandBufferUsageFlags flags /// Command buffer usage flags
2367 const VkCommandBufferInheritanceInfo* pInheritanceInfo
2368}
2369
Jesse Halld27f6aa2015-08-15 17:58:48 -07002370class VkRenderPassBeginInfo {
2371 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO
2372 const void* pNext /// Pointer to next structure
2373 VkRenderPass renderPass
2374 VkFramebuffer framebuffer
2375 VkRect2D renderArea
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002376 u32 clearValueCount
2377 const VkClearValue* pClearValues
Jesse Halld27f6aa2015-08-15 17:58:48 -07002378}
2379
2380@union
2381/// Union allowing specification of floating point, integer, or unsigned integer color data. Actual value selected is based on image/attachment being cleared.
2382class VkClearColorValue {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002383 f32[4] float32
2384 s32[4] int32
2385 u32[4] uint32
Jesse Halld27f6aa2015-08-15 17:58:48 -07002386}
2387
2388class VkClearDepthStencilValue {
2389 f32 depth
2390 u32 stencil
2391}
2392
2393@union
2394/// Union allowing specification of color, depth, and stencil color values. Actual value selected is based on attachment being cleared.
2395class VkClearValue {
2396 VkClearColorValue color
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002397 VkClearDepthStencilValue depthStencil
Jesse Halld27f6aa2015-08-15 17:58:48 -07002398}
2399
Jesse Hallae38f732015-11-19 21:32:50 -08002400class VkClearAttachment {
2401 VkImageAspectFlags aspectMask
2402 u32 colorAttachment
2403 VkClearValue clearValue
2404}
2405
Jesse Halld27f6aa2015-08-15 17:58:48 -07002406class VkAttachmentDescription {
Jesse Halla6429252015-11-29 18:59:42 -08002407 VkAttachmentDescriptionFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002408 VkFormat format
Jesse Hall091ed9e2015-11-30 00:55:29 -08002409 VkSampleCountFlagBits samples
Jesse Halld27f6aa2015-08-15 17:58:48 -07002410 VkAttachmentLoadOp loadOp /// Load op for color or depth data
2411 VkAttachmentStoreOp storeOp /// Store op for color or depth data
2412 VkAttachmentLoadOp stencilLoadOp /// Load op for stencil data
2413 VkAttachmentStoreOp stencilStoreOp /// Store op for stencil data
2414 VkImageLayout initialLayout
2415 VkImageLayout finalLayout
2416}
2417
2418class VkAttachmentReference {
2419 u32 attachment
2420 VkImageLayout layout
2421}
2422
2423class VkSubpassDescription {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002424 VkSubpassDescriptionFlags flags
Jesse Halla6429252015-11-29 18:59:42 -08002425 VkPipelineBindPoint pipelineBindPoint /// Must be VK_PIPELINE_BIND_POINT_GRAPHICS for now
Jesse Hall03b6fe12015-11-24 12:44:21 -08002426 u32 inputAttachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002427 const VkAttachmentReference* pInputAttachments
Jesse Hall03b6fe12015-11-24 12:44:21 -08002428 u32 colorAttachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002429 const VkAttachmentReference* pColorAttachments
2430 const VkAttachmentReference* pResolveAttachments
Jesse Hallc7467b72015-11-29 21:05:26 -08002431 const VkAttachmentReference* pDepthStencilAttachment
Jesse Hall03b6fe12015-11-24 12:44:21 -08002432 u32 preserveAttachmentCount
Jesse Hall3dd678a2016-01-08 21:52:01 -08002433 const u32* pPreserveAttachments
Jesse Halld27f6aa2015-08-15 17:58:48 -07002434}
2435
2436class VkSubpassDependency {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002437 u32 srcSubpass
Jesse Hall3fbc8562015-11-29 22:10:52 -08002438 u32 dstSubpass
Jesse Halld27f6aa2015-08-15 17:58:48 -07002439 VkPipelineStageFlags srcStageMask
Jesse Hall3fbc8562015-11-29 22:10:52 -08002440 VkPipelineStageFlags dstStageMask
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002441 VkAccessFlags srcAccessMask
2442 VkAccessFlags dstAccessMask
Jesse Halldc6d36c2015-11-29 19:12:15 -08002443 VkDependencyFlags dependencyFlags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002444}
2445
2446class VkRenderPassCreateInfo {
2447 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO
2448 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002449 VkRenderPassCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002450 u32 attachmentCount
2451 const VkAttachmentDescription* pAttachments
2452 u32 subpassCount
2453 const VkSubpassDescription* pSubpasses
2454 u32 dependencyCount
2455 const VkSubpassDependency* pDependencies
2456}
2457
2458class VkEventCreateInfo {
2459 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_EVENT_CREATE_INFO
2460 const void* pNext /// Pointer to next structure
2461 VkEventCreateFlags flags /// Event creation flags
2462}
2463
2464class VkFenceCreateInfo {
2465 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_FENCE_CREATE_INFO
2466 const void* pNext /// Pointer to next structure
2467 VkFenceCreateFlags flags /// Fence creation flags
2468}
2469
2470class VkPhysicalDeviceFeatures {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002471 VkBool32 robustBufferAccess /// out of bounds buffer accesses are well defined
2472 VkBool32 fullDrawIndexUint32 /// full 32-bit range of indices for indexed draw calls
2473 VkBool32 imageCubeArray /// image views which are arrays of cube maps
2474 VkBool32 independentBlend /// blending operations are controlled per-attachment
2475 VkBool32 geometryShader /// geometry stage
2476 VkBool32 tessellationShader /// tessellation control and evaluation stage
2477 VkBool32 sampleRateShading /// per-sample shading and interpolation
Jesse Hall3fbc8562015-11-29 22:10:52 -08002478 VkBool32 dualSrcBlend /// blend operations which take two sources
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002479 VkBool32 logicOp /// logic operations
2480 VkBool32 multiDrawIndirect /// multi draw indirect
Jesse Hall543a7ff2016-01-08 16:38:30 -08002481 VkBool32 drawIndirectFirstInstance
Jesse Hallae38f732015-11-19 21:32:50 -08002482 VkBool32 depthClamp /// depth clamping
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002483 VkBool32 depthBiasClamp /// depth bias clamping
2484 VkBool32 fillModeNonSolid /// point and wireframe fill modes
2485 VkBool32 depthBounds /// depth bounds test
2486 VkBool32 wideLines /// lines with width greater than 1
2487 VkBool32 largePoints /// points with size greater than 1
Jesse Hallfbf97b02015-11-20 14:17:03 -08002488 VkBool32 alphaToOne /// The fragment alpha channel can be forced to maximum representable alpha value
2489 VkBool32 multiViewport
2490 VkBool32 samplerAnisotropy
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002491 VkBool32 textureCompressionETC2 /// ETC texture compression formats
2492 VkBool32 textureCompressionASTC_LDR /// ASTC LDR texture compression formats
2493 VkBool32 textureCompressionBC /// BC1-7 texture compressed formats
Jesse Hall65ab5522015-11-30 00:07:16 -08002494 VkBool32 occlusionQueryPrecise
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002495 VkBool32 pipelineStatisticsQuery /// pipeline statistics query
Jesse Halldc6d36c2015-11-29 19:12:15 -08002496 VkBool32 vertexPipelineStoresAndAtomics
2497 VkBool32 fragmentStoresAndAtomics
2498 VkBool32 shaderTessellationAndGeometryPointSize
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002499 VkBool32 shaderImageGatherExtended /// texture gather with run-time values and independent offsets
2500 VkBool32 shaderStorageImageExtendedFormats /// the extended set of formats can be used for storage images
2501 VkBool32 shaderStorageImageMultisample /// multisample images can be used for storage images
Jesse Halld1af8122015-11-29 23:50:38 -08002502 VkBool32 shaderStorageImageReadWithoutFormat
2503 VkBool32 shaderStorageImageWriteWithoutFormat
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002504 VkBool32 shaderUniformBufferArrayDynamicIndexing /// arrays of uniform buffers can be accessed with dynamically uniform indices
2505 VkBool32 shaderSampledImageArrayDynamicIndexing /// arrays of sampled images can be accessed with dynamically uniform indices
2506 VkBool32 shaderStorageBufferArrayDynamicIndexing /// arrays of storage buffers can be accessed with dynamically uniform indices
2507 VkBool32 shaderStorageImageArrayDynamicIndexing /// arrays of storage images can be accessed with dynamically uniform indices
2508 VkBool32 shaderClipDistance /// clip distance in shaders
2509 VkBool32 shaderCullDistance /// cull distance in shaders
2510 VkBool32 shaderFloat64 /// 64-bit floats (doubles) in shaders
2511 VkBool32 shaderInt64 /// 64-bit integers in shaders
2512 VkBool32 shaderInt16 /// 16-bit integers in shaders
2513 VkBool32 shaderResourceResidency /// shader can use texture operations that return resource residency information (requires sparseNonResident support)
Jesse Hall65ab5522015-11-30 00:07:16 -08002514 VkBool32 shaderResourceMinLod /// shader can use texture operations that specify minimum resource LOD
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002515 VkBool32 sparseBinding /// Sparse resources support: Resource memory can be managed at opaque page level rather than object level
2516 VkBool32 sparseResidencyBuffer /// Sparse resources support: GPU can access partially resident buffers
2517 VkBool32 sparseResidencyImage2D /// Sparse resources support: GPU can access partially resident 2D (non-MSAA non-DepthStencil) images
2518 VkBool32 sparseResidencyImage3D /// Sparse resources support: GPU can access partially resident 3D images
2519 VkBool32 sparseResidency2Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 2 samples
2520 VkBool32 sparseResidency4Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 4 samples
2521 VkBool32 sparseResidency8Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 8 samples
2522 VkBool32 sparseResidency16Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 16 samples
2523 VkBool32 sparseResidencyAliased /// Sparse resources support: GPU can correctly access data aliased into multiple locations (opt-in)
Jesse Halld1af8122015-11-29 23:50:38 -08002524 VkBool32 variableMultisampleRate
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002525 VkBool32 inheritedQueries
Jesse Halld27f6aa2015-08-15 17:58:48 -07002526}
2527
2528class VkPhysicalDeviceLimits {
2529 /// resource maximum sizes
2530 u32 maxImageDimension1D /// max 1D image dimension
2531 u32 maxImageDimension2D /// max 2D image dimension
2532 u32 maxImageDimension3D /// max 3D image dimension
2533 u32 maxImageDimensionCube /// max cubemap image dimension
2534 u32 maxImageArrayLayers /// max layers for image arrays
Jesse Hallb00daad2015-11-29 19:46:20 -08002535 u32 maxTexelBufferElements
Jesse Hallfbf97b02015-11-20 14:17:03 -08002536 u32 maxUniformBufferRange /// max uniform buffer size (bytes)
2537 u32 maxStorageBufferRange /// max storage buffer size (bytes)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002538 u32 maxPushConstantsSize /// max size of the push constants pool (bytes)
2539 /// memory limits
2540 u32 maxMemoryAllocationCount /// max number of device memory allocations supported
Jesse Hall091ed9e2015-11-30 00:55:29 -08002541 u32 maxSamplerAllocationCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002542 VkDeviceSize bufferImageGranularity /// Granularity (in bytes) at which buffers and images can be bound to adjacent memory for simultaneous usage
2543 VkDeviceSize sparseAddressSpaceSize /// Total address space available for sparse allocations (bytes)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002544 /// descriptor set limits
2545 u32 maxBoundDescriptorSets /// max number of descriptors sets that can be bound to a pipeline
Jesse Halld27f6aa2015-08-15 17:58:48 -07002546 u32 maxPerStageDescriptorSamplers /// max num of samplers allowed per-stage in a descriptor set
2547 u32 maxPerStageDescriptorUniformBuffers /// max num of uniform buffers allowed per-stage in a descriptor set
2548 u32 maxPerStageDescriptorStorageBuffers /// max num of storage buffers allowed per-stage in a descriptor set
2549 u32 maxPerStageDescriptorSampledImages /// max num of sampled images allowed per-stage in a descriptor set
2550 u32 maxPerStageDescriptorStorageImages /// max num of storage images allowed per-stage in a descriptor set
Jesse Halle1b12782015-11-30 11:27:32 -08002551 u32 maxPerStageDescriptorInputAttachments
Jesse Halldba27f72015-11-30 14:25:46 -08002552 u32 maxPerStageResources
Jesse Halld27f6aa2015-08-15 17:58:48 -07002553 u32 maxDescriptorSetSamplers /// max num of samplers allowed in all stages in a descriptor set
2554 u32 maxDescriptorSetUniformBuffers /// max num of uniform buffers allowed in all stages in a descriptor set
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002555 u32 maxDescriptorSetUniformBuffersDynamic /// max num of dynamic uniform buffers allowed in all stages in a descriptor set
Jesse Halld27f6aa2015-08-15 17:58:48 -07002556 u32 maxDescriptorSetStorageBuffers /// max num of storage buffers allowed in all stages in a descriptor set
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002557 u32 maxDescriptorSetStorageBuffersDynamic /// max num of dynamic storage buffers allowed in all stages in a descriptor set
Jesse Halld27f6aa2015-08-15 17:58:48 -07002558 u32 maxDescriptorSetSampledImages /// max num of sampled images allowed in all stages in a descriptor set
2559 u32 maxDescriptorSetStorageImages /// max num of storage images allowed in all stages in a descriptor set
Jesse Halle1b12782015-11-30 11:27:32 -08002560 u32 maxDescriptorSetInputAttachments
Jesse Halld27f6aa2015-08-15 17:58:48 -07002561 /// vertex stage limits
2562 u32 maxVertexInputAttributes /// max num of vertex input attribute slots
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002563 u32 maxVertexInputBindings /// max num of vertex input binding slots
Jesse Halld27f6aa2015-08-15 17:58:48 -07002564 u32 maxVertexInputAttributeOffset /// max vertex input attribute offset added to vertex buffer offset
2565 u32 maxVertexInputBindingStride /// max vertex input binding stride
2566 u32 maxVertexOutputComponents /// max num of output components written by vertex shader
2567 /// tessellation control stage limits
Jesse Hall3fbc8562015-11-29 22:10:52 -08002568 u32 maxTessellationGenerationLevel /// max level supported by tess primitive generator
Jesse Hallae38f732015-11-19 21:32:50 -08002569 u32 maxTessellationPatchSize /// max patch size (vertices)
2570 u32 maxTessellationControlPerVertexInputComponents /// max num of input components per-vertex in TCS
2571 u32 maxTessellationControlPerVertexOutputComponents /// max num of output components per-vertex in TCS
2572 u32 maxTessellationControlPerPatchOutputComponents /// max num of output components per-patch in TCS
2573 u32 maxTessellationControlTotalOutputComponents /// max total num of per-vertex and per-patch output components in TCS
2574 u32 maxTessellationEvaluationInputComponents /// max num of input components per vertex in TES
2575 u32 maxTessellationEvaluationOutputComponents /// max num of output components per vertex in TES
Jesse Halld27f6aa2015-08-15 17:58:48 -07002576 /// geometry stage limits
2577 u32 maxGeometryShaderInvocations /// max invocation count supported in geometry shader
2578 u32 maxGeometryInputComponents /// max num of input components read in geometry stage
2579 u32 maxGeometryOutputComponents /// max num of output components written in geometry stage
2580 u32 maxGeometryOutputVertices /// max num of vertices that can be emitted in geometry stage
2581 u32 maxGeometryTotalOutputComponents /// max total num of components (all vertices) written in geometry stage
2582 /// fragment stage limits
2583 u32 maxFragmentInputComponents /// max num of input compontents read in fragment stage
Jesse Hallfbf97b02015-11-20 14:17:03 -08002584 u32 maxFragmentOutputAttachments /// max num of output attachments written in fragment stage
Jesse Hall3fbc8562015-11-29 22:10:52 -08002585 u32 maxFragmentDualSrcAttachments /// max num of output attachments written when using dual source blending
Jesse Halld27f6aa2015-08-15 17:58:48 -07002586 u32 maxFragmentCombinedOutputResources /// max total num of storage buffers, storage images and output buffers
2587 /// compute stage limits
2588 u32 maxComputeSharedMemorySize /// max total storage size of work group local storage (bytes)
2589 u32[3] maxComputeWorkGroupCount /// max num of compute work groups that may be dispatched by a single command (x,y,z)
2590 u32 maxComputeWorkGroupInvocations /// max total compute invocations in a single local work group
2591 u32[3] maxComputeWorkGroupSize /// max local size of a compute work group (x,y,z)
2592
2593 u32 subPixelPrecisionBits /// num bits of subpixel precision in screen x and y
2594 u32 subTexelPrecisionBits /// num bits of subtexel precision
2595 u32 mipmapPrecisionBits /// num bits of mipmap precision
2596
2597 u32 maxDrawIndexedIndexValue /// max index value for indexed draw calls (for 32-bit indices)
Jesse Halldba27f72015-11-30 14:25:46 -08002598 u32 maxDrawIndirectCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002599
2600 f32 maxSamplerLodBias /// max absolute sampler level of detail bias
2601 f32 maxSamplerAnisotropy /// max degree of sampler anisotropy
2602
2603 u32 maxViewports /// max number of active viewports
Jesse Halld27f6aa2015-08-15 17:58:48 -07002604 u32[2] maxViewportDimensions /// max viewport dimensions (x,y)
2605 f32[2] viewportBoundsRange /// viewport bounds range (min,max)
2606 u32 viewportSubPixelBits /// num bits of subpixel precision for viewport
2607
Jesse Halldc6d36c2015-11-29 19:12:15 -08002608 platform.size_t minMemoryMapAlignment /// min required alignment of pointers returned by MapMemory (bytes)
2609 VkDeviceSize minTexelBufferOffsetAlignment /// min required alignment for texel buffer offsets (bytes)
2610 VkDeviceSize minUniformBufferOffsetAlignment /// min required alignment for uniform buffer sizes and offsets (bytes)
2611 VkDeviceSize minStorageBufferOffsetAlignment /// min required alignment for storage buffer offsets (bytes)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002612
Jesse Hallfbf97b02015-11-20 14:17:03 -08002613 s32 minTexelOffset /// min texel offset for OpTextureSampleOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07002614 u32 maxTexelOffset /// max texel offset for OpTextureSampleOffset
Jesse Hallfbf97b02015-11-20 14:17:03 -08002615 s32 minTexelGatherOffset /// min texel offset for OpTextureGatherOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07002616 u32 maxTexelGatherOffset /// max texel offset for OpTextureGatherOffset
2617 f32 minInterpolationOffset /// furthest negative offset for interpolateAtOffset
2618 f32 maxInterpolationOffset /// furthest positive offset for interpolateAtOffset
2619 u32 subPixelInterpolationOffsetBits /// num of subpixel bits for interpolateAtOffset
2620
2621 u32 maxFramebufferWidth /// max width for a framebuffer
2622 u32 maxFramebufferHeight /// max height for a framebuffer
2623 u32 maxFramebufferLayers /// max layer count for a layered framebuffer
Jesse Hall091ed9e2015-11-30 00:55:29 -08002624 VkSampleCountFlags framebufferColorSampleCounts
2625 VkSampleCountFlags framebufferDepthSampleCounts
2626 VkSampleCountFlags framebufferStencilSampleCounts
2627 VkSampleCountFlags framebufferNoAttachmentSampleCounts
Jesse Halld27f6aa2015-08-15 17:58:48 -07002628 u32 maxColorAttachments /// max num of framebuffer color attachments
2629
Jesse Hall091ed9e2015-11-30 00:55:29 -08002630 VkSampleCountFlags sampledImageColorSampleCounts
2631 VkSampleCountFlags sampledImageIntegerSampleCounts
2632 VkSampleCountFlags sampledImageDepthSampleCounts
2633 VkSampleCountFlags sampledImageStencilSampleCounts
2634 VkSampleCountFlags storageImageSampleCounts
Jesse Halld27f6aa2015-08-15 17:58:48 -07002635 u32 maxSampleMaskWords /// max num of sample mask words
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002636 VkBool32 timestampComputeAndGraphics
Jesse Halld27f6aa2015-08-15 17:58:48 -07002637
Jesse Halla9bb62b2015-11-21 19:31:56 -08002638 f32 timestampPeriod
Jesse Halld27f6aa2015-08-15 17:58:48 -07002639
2640 u32 maxClipDistances /// max number of clip distances
2641 u32 maxCullDistances /// max number of cull distances
2642 u32 maxCombinedClipAndCullDistances /// max combined number of user clipping
2643
Jesse Hallfbf97b02015-11-20 14:17:03 -08002644 u32 discreteQueuePriorities
2645
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002646 f32[2] pointSizeRange /// range (min,max) of supported point sizes
2647 f32[2] lineWidthRange /// range (min,max) of supported line widths
Jesse Halld27f6aa2015-08-15 17:58:48 -07002648 f32 pointSizeGranularity /// granularity of supported point sizes
2649 f32 lineWidthGranularity /// granularity of supported line widths
Jesse Hall03b6fe12015-11-24 12:44:21 -08002650 VkBool32 strictLines
Jesse Hall091ed9e2015-11-30 00:55:29 -08002651 VkBool32 standardSampleLocations
Jesse Halla9bb62b2015-11-21 19:31:56 -08002652
Jesse Hall65ab5522015-11-30 00:07:16 -08002653 VkDeviceSize optimalBufferCopyOffsetAlignment
2654 VkDeviceSize optimalBufferCopyRowPitchAlignment
Jesse Halldba27f72015-11-30 14:25:46 -08002655 VkDeviceSize nonCoherentAtomSize
Jesse Halld27f6aa2015-08-15 17:58:48 -07002656}
2657
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002658class VkPhysicalDeviceSparseProperties {
2659 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 -08002660 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 -07002661 VkBool32 residencyStandard3DBlockShape /// Sparse resources support: GPU will access all 3D sparse resources using the standard block shapes (based on pixel format)
2662 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 -07002663 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
2664}
2665
Jesse Halld27f6aa2015-08-15 17:58:48 -07002666class VkSemaphoreCreateInfo {
2667 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO
2668 const void* pNext /// Pointer to next structure
2669 VkSemaphoreCreateFlags flags /// Semaphore creation flags
2670}
2671
2672class VkQueryPoolCreateInfo {
2673 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO
2674 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002675 VkQueryPoolCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002676 VkQueryType queryType
Jesse Hall3dd678a2016-01-08 21:52:01 -08002677 u32 queryCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002678 VkQueryPipelineStatisticFlags pipelineStatistics /// Optional
2679}
2680
2681class VkFramebufferCreateInfo {
2682 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO
2683 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002684 VkFramebufferCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002685 VkRenderPass renderPass
2686 u32 attachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002687 const VkImageView* pAttachments
Jesse Halld27f6aa2015-08-15 17:58:48 -07002688 u32 width
2689 u32 height
2690 u32 layers
2691}
2692
Jesse Hall3fbc8562015-11-29 22:10:52 -08002693class VkDrawIndirectCommand {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002694 u32 vertexCount
2695 u32 instanceCount
2696 u32 firstVertex
2697 u32 firstInstance
2698}
2699
Jesse Hall3fbc8562015-11-29 22:10:52 -08002700class VkDrawIndexedIndirectCommand {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002701 u32 indexCount
2702 u32 instanceCount
2703 u32 firstIndex
2704 s32 vertexOffset
2705 u32 firstInstance
2706}
2707
Jesse Hall3fbc8562015-11-29 22:10:52 -08002708class VkDispatchIndirectCommand {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002709 u32 x
2710 u32 y
2711 u32 z
2712}
2713
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002714@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08002715class VkSurfaceCapabilitiesKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002716 u32 minImageCount
2717 u32 maxImageCount
2718 VkExtent2D currentExtent
2719 VkExtent2D minImageExtent
2720 VkExtent2D maxImageExtent
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002721 u32 maxImageArrayLayers
Jesse Hall1356b0d2015-11-23 17:24:58 -08002722 VkSurfaceTransformFlagsKHR supportedTransforms
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002723 VkSurfaceTransformFlagBitsKHR currentTransform
Jesse Halla6429252015-11-29 18:59:42 -08002724 VkCompositeAlphaFlagsKHR supportedCompositeAlpha
Jesse Hall1356b0d2015-11-23 17:24:58 -08002725 VkImageUsageFlags supportedUsageFlags
Michael Lentine88594d72015-11-12 12:49:45 -08002726}
2727
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002728@extension("VK_KHR_surface")
Michael Lentine88594d72015-11-12 12:49:45 -08002729class VkSurfaceFormatKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002730 VkFormat format
2731 VkColorSpaceKHR colorSpace
Michael Lentine88594d72015-11-12 12:49:45 -08002732}
2733
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002734@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08002735class VkSwapchainCreateInfoKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002736 VkStructureType sType
2737 const void* pNext
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002738 VkSwapchainCreateFlagsKHR flags
Jesse Hall1356b0d2015-11-23 17:24:58 -08002739 VkSurfaceKHR surface
2740 u32 minImageCount
2741 VkFormat imageFormat
2742 VkColorSpaceKHR imageColorSpace
2743 VkExtent2D imageExtent
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002744 u32 imageArrayLayers
2745 VkImageUsageFlags imageUsage
Jesse Hall1356b0d2015-11-23 17:24:58 -08002746 VkSharingMode sharingMode
Jesse Hall03b6fe12015-11-24 12:44:21 -08002747 u32 queueFamilyIndexCount
Jesse Hall1356b0d2015-11-23 17:24:58 -08002748 const u32* pQueueFamilyIndices
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002749 VkSurfaceTransformFlagBitsKHR preTransform
2750 VkCompositeAlphaFlagBitsKHR compositeAlpha
Jesse Hall1356b0d2015-11-23 17:24:58 -08002751 VkPresentModeKHR presentMode
Jesse Hall1356b0d2015-11-23 17:24:58 -08002752 VkBool32 clipped
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002753 VkSwapchainKHR oldSwapchain
Michael Lentine88594d72015-11-12 12:49:45 -08002754}
2755
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002756@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08002757class VkPresentInfoKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002758 VkStructureType sType
2759 const void* pNext
Jesse Hallb00daad2015-11-29 19:46:20 -08002760 u32 waitSemaphoreCount
2761 const VkSemaphore* pWaitSemaphores
Jesse Hall1356b0d2015-11-23 17:24:58 -08002762 u32 swapchainCount
Jesse Hall03b6fe12015-11-24 12:44:21 -08002763 const VkSwapchainKHR* pSwapchains
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002764 const u32* pImageIndices
Jesse Halle1b12782015-11-30 11:27:32 -08002765 VkResult* pResults
Michael Lentine88594d72015-11-12 12:49:45 -08002766}
2767
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002768@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002769class VkDisplayPropertiesKHR {
2770 VkDisplayKHR display
2771 const char* displayName
2772 VkExtent2D physicalDimensions
2773 VkExtent2D physicalResolution
2774 VkSurfaceTransformFlagsKHR supportedTransforms
Jesse Hall1356b0d2015-11-23 17:24:58 -08002775 VkBool32 planeReorderPossible
Jesse Halla6429252015-11-29 18:59:42 -08002776 VkBool32 persistentContent
Michael Lentine88594d72015-11-12 12:49:45 -08002777}
2778
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002779@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08002780class VkDisplayModeParametersKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002781 VkExtent2D visibleRegion
Jesse Halla6429252015-11-29 18:59:42 -08002782 u32 refreshRate
Michael Lentine88594d72015-11-12 12:49:45 -08002783}
Jesse Halld27f6aa2015-08-15 17:58:48 -07002784
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002785@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002786class VkDisplayModePropertiesKHR {
2787 VkDisplayModeKHR displayMode
Jesse Halla6429252015-11-29 18:59:42 -08002788 VkDisplayModeParametersKHR parameters
Jesse Hall1356b0d2015-11-23 17:24:58 -08002789}
2790
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002791@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002792class VkDisplayModeCreateInfoKHR {
2793 VkStructureType sType
2794 const void* pNext
Jesse Hall9ba8bc82015-11-30 16:22:16 -08002795 VkDisplayModeCreateFlagsKHR flags
Jesse Halla6429252015-11-29 18:59:42 -08002796 VkDisplayModeParametersKHR parameters
Jesse Hall1356b0d2015-11-23 17:24:58 -08002797}
2798
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002799@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002800class VkDisplayPlanePropertiesKHR {
Jesse Halla6429252015-11-29 18:59:42 -08002801 VkDisplayKHR currentDisplay
2802 u32 currentStackIndex
2803}
2804
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002805@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08002806class VkDisplayPlaneCapabilitiesKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002807 VkDisplayPlaneAlphaFlagsKHR supportedAlpha
2808 VkOffset2D minSrcPosition
2809 VkOffset2D maxSrcPosition
2810 VkExtent2D minSrcExtent
2811 VkExtent2D maxSrcExtent
2812 VkOffset2D minDstPosition
2813 VkOffset2D maxDstPosition
2814 VkExtent2D minDstExtent
2815 VkExtent2D maxDstExtent
2816}
2817
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002818@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08002819class VkDisplaySurfaceCreateInfoKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002820 VkStructureType sType
2821 const void* pNext
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002822 VkDisplaySurfaceCreateFlagsKHR flags
Jesse Hall1356b0d2015-11-23 17:24:58 -08002823 VkDisplayModeKHR displayMode
2824 u32 planeIndex
2825 u32 planeStackIndex
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002826 VkSurfaceTransformFlagBitsKHR transform
Jesse Hall1356b0d2015-11-23 17:24:58 -08002827 f32 globalAlpha
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002828 VkDisplayPlaneAlphaFlagBitsKHR alphaMode
2829 VkExtent2D imageExtent
Jesse Hall1356b0d2015-11-23 17:24:58 -08002830}
2831
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002832@extension("VK_KHR_display_swapchain")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002833class VkDisplayPresentInfoKHR {
2834 VkStructureType sType
2835 const void* pNext
2836 VkRect2D srcRect
2837 VkRect2D dstRect
Jesse Halla6429252015-11-29 18:59:42 -08002838 VkBool32 persistent
Jesse Hall1356b0d2015-11-23 17:24:58 -08002839}
2840
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002841@extension("VK_KHR_xlib_surface")
2842class VkXlibSurfaceCreateInfoKHR {
2843 VkStructureType sType
2844 const void* pNext
2845 VkXlibSurfaceCreateFlagsKHR flags
2846 platform.Display* dpy
2847 platform.Window window
2848}
2849
2850@extension("VK_KHR_xcb_surface")
2851class VkXcbSurfaceCreateInfoKHR {
2852 VkStructureType sType
2853 const void* pNext
2854 VkXcbSurfaceCreateFlagsKHR flags
2855 platform.xcb_connection_t* connection
2856 platform.xcb_window_t window
2857}
2858
2859@extension("VK_KHR_wayland_surface")
2860class VkWaylandSurfaceCreateInfoKHR {
2861 VkStructureType sType
2862 const void* pNext
2863 VkWaylandSurfaceCreateFlagsKHR flags
2864 platform.wl_display* display
2865 platform.wl_surface* surface
2866}
2867
2868@extension("VK_KHR_mir_surface")
2869class VkMirSurfaceCreateInfoKHR {
2870 VkStructureType sType
2871 const void* pNext
2872 VkMirSurfaceCreateFlagsKHR flags
2873 platform.MirConnection* connection
2874 platform.MirSurface* mirSurface
2875}
2876
2877@extension("VK_KHR_android_surface")
2878class VkAndroidSurfaceCreateInfoKHR {
2879 VkStructureType sType
2880 const void* pNext
2881 VkAndroidSurfaceCreateFlagsKHR flags
2882 platform.ANativeWindow* window
2883}
2884
2885@extension("VK_KHR_win32_surface")
2886class VkWin32SurfaceCreateInfoKHR {
2887 VkStructureType sType
2888 const void* pNext
2889 VkWin32SurfaceCreateFlagsKHR flags
2890 platform.HINSTANCE hinstance
2891 platform.HWND hwnd
2892}
2893
Jesse Halld1abd742017-02-09 21:45:51 -08002894@internal class Gralloc1Usage {
2895 u64 consumer
2896 u64 producer
2897}
2898
Chia-I Wub262ddc2016-03-22 07:38:20 +08002899@extension("VK_ANDROID_native_buffer")
2900class VkNativeBufferANDROID {
2901 VkStructureType sType
2902 const void* pNext
2903 platform.buffer_handle_t handle
Jesse Halld1abd742017-02-09 21:45:51 -08002904 s32 stride
2905 s32 format
2906 s32 usage
2907 Gralloc1Usage usage2
Chia-I Wub262ddc2016-03-22 07:38:20 +08002908}
2909
Chris Forbes8e4438b2016-12-07 16:26:49 +13002910@extension("VK_ANDROID_native_buffer")
2911class VkSwapchainImageCreateInfoANDROID {
2912 VkStructureType sType
2913 const void* pNext
Chris Forbes134d9582017-01-12 14:26:37 +13002914 VkSwapchainImageUsageFlagsANDROID flags
Chris Forbes48853712017-01-12 14:09:33 +13002915}
Ian Elliott4c8bb2a2016-12-29 11:07:26 -07002916
2917@extension("VK_GOOGLE_display_timing")
2918class VkRefreshCycleDurationGOOGLE {
Chris Forbes48853712017-01-12 14:09:33 +13002919 u64 minRefreshDuration
2920 u64 maxRefreshDuration
Ian Elliott4c8bb2a2016-12-29 11:07:26 -07002921}
2922
2923@extension("VK_GOOGLE_display_timing")
2924class VkPastPresentationTimingGOOGLE {
Chris Forbes48853712017-01-12 14:09:33 +13002925 u32 presentID
2926 u64 desiredPresentTime
2927 u64 actualPresentTime
2928 u64 earliestPresentTime
2929 u64 presentMargin
Ian Elliott4c8bb2a2016-12-29 11:07:26 -07002930}
2931
2932@extension("VK_GOOGLE_display_timing")
2933class VkPresentTimeGOOGLE {
Chris Forbes48853712017-01-12 14:09:33 +13002934 u32 presentID
2935 u64 desiredPresentTime
Ian Elliott4c8bb2a2016-12-29 11:07:26 -07002936}
2937
2938@extension("VK_GOOGLE_display_timing")
2939class VkPresentTimesInfoGOOGLE {
2940 VkStructureType sType
2941 const void* pNext
Chris Forbes48853712017-01-12 14:09:33 +13002942 u32 swapchainCount
Ian Elliott4c8bb2a2016-12-29 11:07:26 -07002943 const VkPresentTimeGOOGLE* pTimes
Chris Forbes8e4438b2016-12-07 16:26:49 +13002944}
2945
Jesse Hall715b86a2016-01-16 16:34:29 -08002946@extension("VK_EXT_debug_report")
2947class VkDebugReportCallbackCreateInfoEXT {
2948 VkStructureType sType
2949 const void* pNext
2950 VkDebugReportFlagsEXT flags
2951 PFN_vkDebugReportCallbackEXT pfnCallback
2952 void* pUserData
2953}
2954
Jesse Hall26763382016-05-20 07:13:52 -07002955@extension("VK_AMD_rasterization_order")
2956class VkPipelineRasterizationStateRasterizationOrderAMD {
2957 VkStructureType sType
2958 const void* pNext
2959 VkRasterizationOrderAMD rasterizationOrder
2960}
2961
2962@extension("VK_EXT_debug_marker")
2963class VkDebugMarkerObjectNameInfoEXT {
2964 VkStructureType sType
2965 const void* pNext
2966 VkDebugReportObjectTypeEXT objectType
2967 u64 object
2968 const char* pObjectName
2969}
2970
2971@extension("VK_EXT_debug_marker")
2972class VkDebugMarkerObjectTagInfoEXT {
2973 VkStructureType sType
2974 const void* pNext
2975 VkDebugReportObjectTypeEXT objectType
2976 u64 object
2977 u64 tagName
2978 platform.size_t tagSize
2979 const void* pTag
2980}
2981
2982@extension("VK_EXT_debug_marker")
2983class VkDebugMarkerMarkerInfoEXT {
2984 VkStructureType sType
2985 const void* pNext
2986 const char* pMarkerName
2987 f32[4] color
2988}
2989
Jesse Hall56d386a2016-07-26 15:20:40 -07002990@extension("VK_NV_dedicated_allocation")
2991class VkDedicatedAllocationImageCreateInfoNV {
2992 VkStructureType sType
2993 const void* pNext
2994 VkBool32 dedicatedAllocation
2995}
2996
2997@extension("VK_NV_dedicated_allocation")
2998class VkDedicatedAllocationBufferCreateInfoNV {
2999 VkStructureType sType
3000 const void* pNext
3001 VkBool32 dedicatedAllocation
3002}
3003
3004@extension("VK_NV_dedicated_allocation")
3005class VkDedicatedAllocationMemoryAllocateInfoNV {
3006 VkStructureType sType
3007 const void* pNext
3008 VkImage image
3009 VkBuffer buffer
3010}
3011
Jesse Halleb02c472017-02-24 15:13:45 -08003012@extension("VK_NV_external_memory_capabilities")
3013class VkExternalImageFormatPropertiesNV {
3014 VkImageFormatProperties imageFormatProperties
3015 VkExternalMemoryFeatureFlagsNV externalMemoryFeatures
3016 VkExternalMemoryHandleTypeFlagsNV exportFromImportedHandleTypes
3017 VkExternalMemoryHandleTypeFlagsNV compatibleHandleTypes
3018}
3019
3020@extension("VK_NV_external_memory")
3021class VkExternalMemoryImageCreateInfoNV {
3022 VkStructureType sType
3023 const void* pNext
3024 VkExternalMemoryHandleTypeFlagsNV handleTypes
3025}
3026
3027@extension("VK_NV_external_memory")
3028class VkExportMemoryAllocateInfoNV {
3029 VkStructureType sType
3030 const void* pNext
3031 VkExternalMemoryHandleTypeFlagsNV handleTypes
3032}
3033
3034@extension("VK_NV_external_memory_win32")
3035class VkImportMemoryWin32HandleInfoNV {
3036 VkStructureType sType
3037 const void* pNext
3038 VkExternalMemoryHandleTypeFlagsNV handleType
3039 platform.HANDLE handle
3040}
3041
3042@extension("VK_NV_external_memory_win32")
3043class VkExportMemoryWin32HandleInfoNV {
3044 VkStructureType sType
3045 const void* pNext
3046 const platform.SECURITY_ATTRIBUTES* pAttributes
3047 platform.DWORD dwAccess
3048}
3049
3050@extension("VK_NV_win32_keyed_mutex")
3051class VkWin32KeyedMutexAcquireReleaseInfoNV {
3052 VkStructureType sType
3053 const void* pNext
3054 u32 acquireCount
3055 const VkDeviceMemory* pAcquireSyncs
3056 const u64* pAcquireKeys
3057 const u32* pAcquireTimeoutMilliseconds
3058 u32 releaseCount
3059 const VkDeviceMemory* pReleaseSyncs
3060 const u64* pReleaseKeys
3061}
3062
Chris Forbes1194ede2016-12-30 16:29:25 +13003063@extension("VK_KHR_get_physical_device_properties2")
3064class VkPhysicalDeviceFeatures2KHR {
3065 VkStructureType sType
3066 void* pNext
3067 VkPhysicalDeviceFeatures features
3068}
3069
3070@extension("VK_KHR_get_physical_device_properties2")
3071class VkPhysicalDeviceProperties2KHR {
3072 VkStructureType sType
3073 void* pNext
3074 VkPhysicalDeviceProperties properties
3075}
3076
3077@extension("VK_KHR_get_physical_device_properties2")
3078class VkFormatProperties2KHR {
3079 VkStructureType sType
3080 void* pNext
3081 VkFormatProperties formatProperties
3082}
3083
3084@extension("VK_KHR_get_physical_device_properties2")
3085class VkImageFormatProperties2KHR {
3086 VkStructureType sType
3087 void* pNext
3088 VkImageFormatProperties imageFormatProperties
3089}
3090
3091@extension("VK_KHR_get_physical_device_properties2")
3092class VkPhysicalDeviceImageFormatInfo2KHR {
3093 VkStructureType sType
3094 const void* pNext
3095 VkFormat format
3096 VkImageType type
3097 VkImageTiling tiling
3098 VkImageUsageFlags usage
3099 VkImageCreateFlags flags
3100}
3101
3102@extension("VK_KHR_get_physical_device_properties2")
3103class VkQueueFamilyProperties2KHR {
3104 VkStructureType sType
3105 void* pNext
3106 VkQueueFamilyProperties queueFamilyProperties
3107}
3108
3109@extension("VK_KHR_get_physical_device_properties2")
3110class VkPhysicalDeviceMemoryProperties2KHR {
3111 VkStructureType sType
3112 void* pNext
3113 VkPhysicalDeviceMemoryProperties memoryProperties
3114}
3115
3116@extension("VK_KHR_get_physical_device_properties2")
3117class VkSparseImageFormatProperties2KHR {
3118 VkStructureType sType
3119 void* pNext
3120 VkSparseImageFormatProperties properties
3121}
3122
3123@extension("VK_KHR_get_physical_device_properties2")
3124class VkPhysicalDeviceSparseImageFormatInfo2KHR {
3125 VkStructureType sType
3126 const void* pNext
3127 VkFormat format
3128 VkImageType type
3129 VkSampleCountFlagBits samples
3130 VkImageUsageFlags usage
3131 VkImageTiling tiling
3132}
3133
Chris Forbes289cb792016-12-30 15:03:55 +13003134@extension("VK_EXT_validation_flags")
3135class VkValidationFlagsEXT {
3136 VkStructureType sType
3137 const void* pNext
3138 u32 disabledValidationCheckCount
3139 VkValidationCheckEXT* pDisabledValidationChecks
3140}
3141
3142@extension("VK_NVX_device_generated_commands")
3143class VkDeviceGeneratedCommandsFeaturesNVX {
3144 VkStructureType sType
3145 const void* pNext
3146 VkBool32 computeBindingPointSupport
3147}
3148
3149@extension("VK_NVX_device_generated_commands")
3150class VkDeviceGeneratedCommandsLimitsNVX {
3151 VkStructureType sType
3152 const void* pNext
3153 u32 maxIndirectCommandsLayoutTokenCount
3154 u32 maxObjectEntryCounts
3155 u32 minSequenceCountBufferOffsetAlignment
3156 u32 minSequenceIndexBufferOffsetAlignment
3157 u32 minCommandsTokenBufferOffsetAlignment
3158}
3159
3160@extension("VK_NVX_device_generated_commands")
3161class VkIndirectCommandsTokenNVX {
3162 VkIndirectCommandsTokenTypeNVX tokenType
3163 VkBuffer buffer
3164 VkDeviceSize offset
3165}
3166
3167@extension("VK_NVX_device_generated_commands")
3168class VkIndirectCommandsLayoutTokenNVX {
3169 VkIndirectCommandsTokenTypeNVX tokenType
3170 u32 bindingUnit
3171 u32 dynamicCount
3172 u32 divisor
3173}
3174
3175@extension("VK_NVX_device_generated_commands")
3176class VkIndirectCommandsLayoutCreateInfoNVX {
3177 VkStructureType sType
3178 const void* pNext
3179 VkPipelineBindPoint pipelineBindPoint
3180 VkIndirectCommandsLayoutUsageFlagsNVX flags
3181 u32 tokenCount
3182 const VkIndirectCommandsLayoutTokenNVX* pTokens
3183}
3184
3185@extension("VK_NVX_device_generated_commands")
3186class VkCmdProcessCommandsInfoNVX {
3187 VkStructureType sType
3188 const void* pNext
3189 VkObjectTableNVX objectTable
3190 VkIndirectCommandsLayoutNVX indirectCommandsLayout
3191 u32 indirectCommandsTokenCount
3192 const VkIndirectCommandsTokenNVX* pIndirectCommandsTokens
3193 u32 maxSequencesCount
3194 VkCommandBuffer targetCommandBuffer
3195 VkBuffer sequencesCountBuffer
3196 VkDeviceSize sequencesCountOffset
3197 VkBuffer sequencesIndexBuffer
3198 VkDeviceSize sequencesIndexOffset
3199}
3200
3201@extension("VK_NVX_device_generated_commands")
3202class VkCmdReserveSpaceForCommandsInfoNVX {
3203 VkStructureType sType
3204 const void* pNext
3205 VkObjectTableNVX objectTable
3206 VkIndirectCommandsLayoutNVX indirectCommandsLayout
3207 u32 maxSequencesCount
3208}
3209
3210@extension("VK_NVX_device_generated_commands")
3211class VkObjectTableCreateInfoNVX {
3212 VkStructureType sType
3213 const void* pNext
3214 u32 objectCount
3215 const VkObjectEntryTypeNVX* pObjectEntryTypes
3216 const u32* pObjectEntryCounts
3217 const VkObjectEntryUsageFlagsNVX* pObjectEntryUsageFlags
3218 u32 maxUniformBuffersPerDescriptor
3219 u32 maxStorageBuffersPerDescriptor
3220 u32 maxStorageImagesPerDescriptor
3221 u32 maxSampledImagesPerDescriptor
3222 u32 maxPipelineLayouts
3223}
3224
3225@extension("VK_NVX_device_generated_commands")
3226class VkObjectTableEntryNVX {
3227 VkObjectEntryTypeNVX type
3228 VkObjectEntryUsageFlagsNVX flags
3229}
3230
3231@extension("VK_NVX_device_generated_commands")
3232class VkObjectTablePipelineEntryNVX {
3233 VkObjectEntryTypeNVX type
3234 VkObjectEntryUsageFlagsNVX flags
3235 VkPipeline pipeline
3236}
3237
3238@extension("VK_NVX_device_generated_commands")
3239class VkObjectTableDescriptorSetEntryNVX {
3240 VkObjectEntryTypeNVX type
3241 VkObjectEntryUsageFlagsNVX flags
3242 VkPipelineLayout pipelineLayout
3243 VkDescriptorSet descriptorSet
3244}
3245
3246@extension("VK_NVX_device_generated_commands")
3247class VkObjectTableVertexBufferEntryNVX {
3248 VkObjectEntryTypeNVX type
3249 VkObjectEntryUsageFlagsNVX flags
3250 VkBuffer buffer
3251}
3252
3253@extension("VK_NVX_device_generated_commands")
3254class VkObjectTableIndexBufferEntryNVX {
3255 VkObjectEntryTypeNVX type
3256 VkObjectEntryUsageFlagsNVX flags
3257 VkBuffer buffer
3258}
3259
3260@extension("VK_NVX_device_generated_commands")
3261class VkObjectTablePushConstantEntryNVX {
3262 VkObjectEntryTypeNVX type
3263 VkObjectEntryUsageFlagsNVX flags
3264 VkPipelineLayout pipelineLayout
3265 VkShaderStageFlags stageFlags
3266}
3267
Jesse Hall889cd9a2017-02-25 22:12:23 -08003268@extension("VK_KHR_incremental_present")
3269class VkRectLayerKHR {
3270 VkOffset2D offset
3271 VkExtent2D extent
3272 u32 layer
3273}
3274
3275@extension("VK_KHR_incremental_present")
3276class VkPresentRegionKHR {
3277 u32 rectangleCount
3278 const VkRectLayerKHR* pRectangles
3279}
3280
3281@extension("VK_KHR_incremental_present")
3282class VkPresentRegionsKHR {
3283 VkStructureType sType
3284 const void* pNext
3285 u32 swapchainCount
3286 const VkPresentRegionKHR* pRegions
3287}
3288
Courtney Goeltzenleuchterd634c482017-01-05 15:55:31 -07003289@extension("VK_EXT_hdr_metadata")
3290class VkXYColorEXT {
3291 f32 x
3292 f32 y
3293}
3294
3295@extension("VK_EXT_hdr_metadata")
3296class VkHdrMetadataEXT {
3297 VkXYColorEXT displayPrimaryRed
3298 VkXYColorEXT displayPrimaryGreen
3299 VkXYColorEXT displayPrimaryBlue
3300 VkXYColorEXT whitePoint
3301 f32 maxLuminance
3302 f32 minLuminance
3303 f32 maxContentLightLevel
3304 f32 maxFrameAverageLightLevel
3305}
3306
Jesse Halld27f6aa2015-08-15 17:58:48 -07003307////////////////
3308// Commands //
3309////////////////
3310
3311// Function pointers. TODO: add support for function pointers.
3312
3313@external type void* PFN_vkVoidFunction
3314@pfn cmd void vkVoidFunction() {
3315}
3316
Jesse Hall3fbc8562015-11-29 22:10:52 -08003317@external type void* PFN_vkAllocationFunction
3318@pfn cmd void* vkAllocationFunction(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003319 void* pUserData,
3320 platform.size_t size,
3321 platform.size_t alignment,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003322 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08003323 return ?
3324}
3325
Jesse Hall3fbc8562015-11-29 22:10:52 -08003326@external type void* PFN_vkReallocationFunction
3327@pfn cmd void* vkReallocationFunction(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003328 void* pUserData,
3329 void* pOriginal,
3330 platform.size_t size,
3331 platform.size_t alignment,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003332 VkSystemAllocationScope allocationScope) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003333 return ?
3334}
3335
3336@external type void* PFN_vkFreeFunction
3337@pfn cmd void vkFreeFunction(
3338 void* pUserData,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003339 void* pMemory) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003340}
3341
Jesse Hall3fbc8562015-11-29 22:10:52 -08003342@external type void* PFN_vkInternalAllocationNotification
3343@pfn cmd void vkInternalAllocationNotification(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003344 void* pUserData,
3345 platform.size_t size,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003346 VkInternalAllocationType allocationType,
3347 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08003348}
3349
3350@external type void* PFN_vkInternalFreeNotification
3351@pfn cmd void vkInternalFreeNotification(
3352 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}
Jesse Halld27f6aa2015-08-15 17:58:48 -07003357
3358// Global functions
3359
3360@threadSafety("system")
3361cmd VkResult vkCreateInstance(
3362 const VkInstanceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003363 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003364 VkInstance* pInstance) {
3365 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO)
3366
3367 instance := ?
3368 pInstance[0] = instance
3369 State.Instances[instance] = new!InstanceObject()
3370
Jesse Hall3dd678a2016-01-08 21:52:01 -08003371 layers := pCreateInfo.ppEnabledLayerNames[0:pCreateInfo.enabledLayerCount]
3372 extensions := pCreateInfo.ppEnabledExtensionNames[0:pCreateInfo.enabledExtensionCount]
Jesse Halld27f6aa2015-08-15 17:58:48 -07003373
3374 return ?
3375}
3376
3377@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003378cmd void vkDestroyInstance(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003379 VkInstance instance,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003380 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003381 instanceObject := GetInstance(instance)
3382
3383 State.Instances[instance] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003384}
3385
3386@threadSafety("system")
3387cmd VkResult vkEnumeratePhysicalDevices(
3388 VkInstance instance,
3389 u32* pPhysicalDeviceCount,
3390 VkPhysicalDevice* pPhysicalDevices) {
3391 instanceObject := GetInstance(instance)
3392
3393 physicalDeviceCount := as!u32(?)
3394 pPhysicalDeviceCount[0] = physicalDeviceCount
3395 physicalDevices := pPhysicalDevices[0:physicalDeviceCount]
3396
3397 for i in (0 .. physicalDeviceCount) {
3398 physicalDevice := ?
3399 physicalDevices[i] = physicalDevice
3400 if !(physicalDevice in State.PhysicalDevices) {
3401 State.PhysicalDevices[physicalDevice] = new!PhysicalDeviceObject(instance: instance)
3402 }
3403 }
3404
3405 return ?
3406}
3407
3408cmd PFN_vkVoidFunction vkGetDeviceProcAddr(
3409 VkDevice device,
3410 const char* pName) {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003411 if device != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003412 device := GetDevice(device)
3413 }
3414
3415 return ?
3416}
3417
3418cmd PFN_vkVoidFunction vkGetInstanceProcAddr(
3419 VkInstance instance,
3420 const char* pName) {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003421 if instance != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003422 instanceObject := GetInstance(instance)
3423 }
3424
3425 return ?
3426}
3427
Jesse Hall606a54e2015-11-19 22:17:28 -08003428cmd void vkGetPhysicalDeviceProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003429 VkPhysicalDevice physicalDevice,
3430 VkPhysicalDeviceProperties* pProperties) {
3431 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3432
3433 properties := ?
3434 pProperties[0] = properties
Jesse Halld27f6aa2015-08-15 17:58:48 -07003435}
3436
Jesse Hall606a54e2015-11-19 22:17:28 -08003437cmd void vkGetPhysicalDeviceQueueFamilyProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003438 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003439 u32* pQueueFamilyPropertyCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003440 VkQueueFamilyProperties* pQueueFamilyProperties) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003441 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003442 // TODO: Figure out how to express fetch-count-or-properties
3443 // This version fails 'apic validate' with 'fence not allowed in
3444 // *semantic.Branch'. Other attempts have failed with the same or other
3445 // errors.
3446 // if pQueueFamilyProperties != null {
3447 // queuesProperties := pQueueFamilyProperties[0:pCount[0]]
3448 // for i in (0 .. pCount[0]) {
3449 // queueProperties := as!VkQueueFamilyProperties(?)
3450 // queuesProperties[i] = queueProperties
3451 // }
3452 // } else {
3453 // count := ?
3454 // pCount[0] = count
3455 // }
Jesse Halld27f6aa2015-08-15 17:58:48 -07003456}
3457
Jesse Hall606a54e2015-11-19 22:17:28 -08003458cmd void vkGetPhysicalDeviceMemoryProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003459 VkPhysicalDevice physicalDevice,
3460 VkPhysicalDeviceMemoryProperties* pMemoryProperties) {
3461 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3462
3463 memoryProperties := ?
3464 pMemoryProperties[0] = memoryProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07003465}
3466
Jesse Hall606a54e2015-11-19 22:17:28 -08003467cmd void vkGetPhysicalDeviceFeatures(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003468 VkPhysicalDevice physicalDevice,
3469 VkPhysicalDeviceFeatures* pFeatures) {
3470 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3471
3472 features := ?
3473 pFeatures[0] = features
Jesse Halld27f6aa2015-08-15 17:58:48 -07003474}
3475
Jesse Hall606a54e2015-11-19 22:17:28 -08003476cmd void vkGetPhysicalDeviceFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003477 VkPhysicalDevice physicalDevice,
3478 VkFormat format,
3479 VkFormatProperties* pFormatProperties) {
3480 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3481
3482 formatProperties := ?
3483 pFormatProperties[0] = formatProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07003484}
3485
Jesse Halla9e57032015-11-30 01:03:10 -08003486cmd VkResult vkGetPhysicalDeviceImageFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003487 VkPhysicalDevice physicalDevice,
3488 VkFormat format,
3489 VkImageType type,
3490 VkImageTiling tiling,
3491 VkImageUsageFlags usage,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003492 VkImageCreateFlags flags,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003493 VkImageFormatProperties* pImageFormatProperties) {
3494 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3495
3496 imageFormatProperties := ?
3497 pImageFormatProperties[0] = imageFormatProperties
Jesse Halla9e57032015-11-30 01:03:10 -08003498
3499 return ?
Jesse Halld27f6aa2015-08-15 17:58:48 -07003500}
3501
Jesse Halld27f6aa2015-08-15 17:58:48 -07003502
3503// Device functions
3504
3505@threadSafety("system")
3506cmd VkResult vkCreateDevice(
3507 VkPhysicalDevice physicalDevice,
3508 const VkDeviceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003509 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003510 VkDevice* pDevice) {
3511 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO)
3512 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3513
3514 device := ?
3515 pDevice[0] = device
3516 State.Devices[device] = new!DeviceObject(physicalDevice: physicalDevice)
3517
3518 return ?
3519}
3520
3521@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003522cmd void vkDestroyDevice(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003523 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003524 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003525 deviceObject := GetDevice(device)
3526
3527 State.Devices[device] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003528}
3529
3530
3531// Extension discovery functions
3532
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003533cmd VkResult vkEnumerateInstanceLayerProperties(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003534 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003535 VkLayerProperties* pProperties) {
3536 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08003537 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07003538
3539 properties := pProperties[0:count]
3540 for i in (0 .. count) {
3541 property := ?
3542 properties[i] = property
3543 }
3544
3545 return ?
3546}
3547
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003548cmd VkResult vkEnumerateInstanceExtensionProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003549 const char* pLayerName,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003550 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003551 VkExtensionProperties* pProperties) {
3552 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08003553 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07003554
3555 properties := pProperties[0:count]
3556 for i in (0 .. count) {
3557 property := ?
3558 properties[i] = property
3559 }
3560
3561 return ?
3562}
3563
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003564cmd VkResult vkEnumerateDeviceLayerProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003565 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003566 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003567 VkLayerProperties* pProperties) {
3568 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3569 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08003570 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07003571
3572 properties := pProperties[0:count]
3573 for i in (0 .. count) {
3574 property := ?
3575 properties[i] = property
3576 }
3577
3578 return ?
3579}
3580
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003581cmd VkResult vkEnumerateDeviceExtensionProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003582 VkPhysicalDevice physicalDevice,
3583 const char* pLayerName,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003584 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003585 VkExtensionProperties* pProperties) {
3586 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3587
3588 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08003589 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07003590
3591 properties := pProperties[0:count]
3592 for i in (0 .. count) {
3593 property := ?
3594 properties[i] = property
3595 }
3596
3597 return ?
3598}
3599
3600
3601// Queue functions
3602
3603@threadSafety("system")
Jesse Hall606a54e2015-11-19 22:17:28 -08003604cmd void vkGetDeviceQueue(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003605 VkDevice device,
3606 u32 queueFamilyIndex,
3607 u32 queueIndex,
3608 VkQueue* pQueue) {
3609 deviceObject := GetDevice(device)
3610
3611 queue := ?
3612 pQueue[0] = queue
3613
3614 if !(queue in State.Queues) {
3615 State.Queues[queue] = new!QueueObject(device: device)
3616 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07003617}
3618
3619@threadSafety("app")
3620cmd VkResult vkQueueSubmit(
3621 VkQueue queue,
Jesse Halla366a512015-11-19 22:30:07 -08003622 u32 submitCount,
Jesse Hallb00daad2015-11-29 19:46:20 -08003623 const VkSubmitInfo* pSubmits,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003624 VkFence fence) {
3625 queueObject := GetQueue(queue)
3626
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003627 if fence != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003628 fenceObject := GetFence(fence)
3629 assert(fenceObject.device == queueObject.device)
3630 }
3631
Jesse Hall3fbc8562015-11-29 22:10:52 -08003632 // commandBuffers := pcommandBuffers[0:commandBufferCount]
3633 // for i in (0 .. commandBufferCount) {
3634 // commandBuffer := commandBuffers[i]
3635 // commandBufferObject := GetCommandBuffer(commandBuffer)
3636 // assert(commandBufferObject.device == queueObject.device)
Jesse Halla366a512015-11-19 22:30:07 -08003637 //
Jesse Hall3fbc8562015-11-29 22:10:52 -08003638 // validate("QueueCheck", commandBufferObject.queueFlags in queueObject.flags,
3639 // "vkQueueSubmit: enqueued commandBuffer requires missing queue capabilities.")
Jesse Halla366a512015-11-19 22:30:07 -08003640 // }
Jesse Halld27f6aa2015-08-15 17:58:48 -07003641
3642 return ?
3643}
3644
3645@threadSafety("system")
3646cmd VkResult vkQueueWaitIdle(
3647 VkQueue queue) {
3648 queueObject := GetQueue(queue)
3649
3650 return ?
3651}
3652
3653@threadSafety("system")
3654cmd VkResult vkDeviceWaitIdle(
3655 VkDevice device) {
3656 deviceObject := GetDevice(device)
3657
3658 return ?
3659}
3660
3661
3662// Memory functions
3663
3664@threadSafety("system")
Jesse Hall3fbc8562015-11-29 22:10:52 -08003665cmd VkResult vkAllocateMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003666 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003667 const VkMemoryAllocateInfo* pAllocateInfo,
3668 const VkAllocationCallbacks* pAllocator,
3669 VkDeviceMemory* pMemory) {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08003670 assert(pAllocateInfo.sType == VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003671 deviceObject := GetDevice(device)
3672
Jesse Hall3fbc8562015-11-29 22:10:52 -08003673 memory := ?
3674 pMemory[0] = memory
3675 State.DeviceMemories[memory] = new!DeviceMemoryObject(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003676 device: device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003677 allocationSize: pAllocateInfo[0].allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003678
3679 return ?
3680}
3681
3682@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003683cmd void vkFreeMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003684 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003685 VkDeviceMemory memory,
3686 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003687 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003688 memoryObject := GetDeviceMemory(memory)
3689 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003690
3691 // Check that no objects are still bound before freeing.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003692 validate("MemoryCheck", len(memoryObject.boundObjects) == 0,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003693 "vkFreeMemory: objects still bound")
Jesse Hall3fbc8562015-11-29 22:10:52 -08003694 validate("MemoryCheck", len(memoryObject.boundCommandBuffers) == 0,
3695 "vkFreeMemory: commandBuffers still bound")
3696 State.DeviceMemories[memory] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003697}
3698
3699@threadSafety("app")
3700cmd VkResult vkMapMemory(
3701 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003702 VkDeviceMemory memory,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003703 VkDeviceSize offset,
3704 VkDeviceSize size,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003705 VkMemoryMapFlags flags,
3706 void** ppData) {
3707 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003708 memoryObject := GetDeviceMemory(memory)
3709 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003710
3711 assert(flags == as!VkMemoryMapFlags(0))
Jesse Hall3fbc8562015-11-29 22:10:52 -08003712 assert((offset + size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003713
3714 return ?
3715}
3716
3717@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003718cmd void vkUnmapMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003719 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003720 VkDeviceMemory memory) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003721 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003722 memoryObject := GetDeviceMemory(memory)
3723 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003724}
3725
3726cmd VkResult vkFlushMappedMemoryRanges(
3727 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003728 u32 memoryRangeCount
3729 const VkMappedMemoryRange* pMemoryRanges) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003730 deviceObject := GetDevice(device)
3731
Jesse Hall3fbc8562015-11-29 22:10:52 -08003732 memoryRanges := pMemoryRanges[0:memoryRangeCount]
3733 for i in (0 .. memoryRangeCount) {
3734 memoryRange := memoryRanges[i]
3735 memoryObject := GetDeviceMemory(memoryRange.memory)
3736 assert(memoryObject.device == device)
3737 assert((memoryRange.offset + memoryRange.size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003738 }
3739
3740 return ?
3741}
3742
3743cmd VkResult vkInvalidateMappedMemoryRanges(
3744 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003745 u32 memoryRangeCount,
3746 const VkMappedMemoryRange* pMemoryRanges) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003747 deviceObject := GetDevice(device)
3748
Jesse Hall3fbc8562015-11-29 22:10:52 -08003749 memoryRanges := pMemoryRanges[0:memoryRangeCount]
3750 for i in (0 .. memoryRangeCount) {
3751 memoryRange := memoryRanges[i]
3752 memoryObject := GetDeviceMemory(memoryRange.memory)
3753 assert(memoryObject.device == device)
3754 assert((memoryRange.offset + memoryRange.size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003755 }
3756
3757 return ?
3758}
3759
3760
3761// Memory management API functions
3762
Jesse Hall606a54e2015-11-19 22:17:28 -08003763cmd void vkGetDeviceMemoryCommitment(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003764 VkDevice device,
3765 VkDeviceMemory memory,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003766 VkDeviceSize* pCommittedMemoryInBytes) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003767 deviceObject := GetDevice(device)
3768
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003769 if memory != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003770 memoryObject := GetDeviceMemory(memory)
3771 assert(memoryObject.device == device)
3772 }
3773
3774 committedMemoryInBytes := ?
3775 pCommittedMemoryInBytes[0] = committedMemoryInBytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07003776}
3777
Jesse Hall606a54e2015-11-19 22:17:28 -08003778cmd void vkGetBufferMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003779 VkDevice device,
3780 VkBuffer buffer,
3781 VkMemoryRequirements* pMemoryRequirements) {
3782 deviceObject := GetDevice(device)
3783 bufferObject := GetBuffer(buffer)
3784 assert(bufferObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003785}
3786
3787cmd VkResult vkBindBufferMemory(
3788 VkDevice device,
3789 VkBuffer buffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003790 VkDeviceMemory memory,
3791 VkDeviceSize memoryOffset) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003792 deviceObject := GetDevice(device)
3793 bufferObject := GetBuffer(buffer)
3794 assert(bufferObject.device == device)
3795
3796 // Unbind buffer from previous memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003797 if bufferObject.memory != NULL_HANDLE {
3798 memoryObject := GetDeviceMemory(bufferObject.memory)
3799 memoryObject.boundObjects[as!u64(buffer)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003800 }
3801
3802 // Bind buffer to given memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003803 if memory != NULL_HANDLE {
3804 memoryObject := GetDeviceMemory(memory)
3805 assert(memoryObject.device == device)
3806 memoryObject.boundObjects[as!u64(buffer)] = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003807 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08003808 bufferObject.memory = memory
3809 bufferObject.memoryOffset = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003810
3811 return ?
3812}
3813
Jesse Hall606a54e2015-11-19 22:17:28 -08003814cmd void vkGetImageMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003815 VkDevice device,
3816 VkImage image,
3817 VkMemoryRequirements* pMemoryRequirements) {
3818 deviceObject := GetDevice(device)
3819 imageObject := GetImage(image)
3820 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003821}
3822
3823cmd VkResult vkBindImageMemory(
3824 VkDevice device,
3825 VkImage image,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003826 VkDeviceMemory memory,
3827 VkDeviceSize memoryOffset) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003828 deviceObject := GetDevice(device)
3829 imageObject := GetImage(image)
3830 assert(imageObject.device == device)
3831
3832 // Unbind image from previous memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003833 if imageObject.memory != NULL_HANDLE {
3834 memoryObject := GetDeviceMemory(imageObject.memory)
3835 memoryObject.boundObjects[as!u64(image)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003836 }
3837
3838 // Bind image to given memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003839 if memory != NULL_HANDLE {
3840 memoryObject := GetDeviceMemory(memory)
3841 assert(memoryObject.device == device)
3842 memoryObject.boundObjects[as!u64(image)] = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003843 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08003844 imageObject.memory = memory
3845 imageObject.memoryOffset = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003846
3847 return ?
3848}
3849
Jesse Hall606a54e2015-11-19 22:17:28 -08003850cmd void vkGetImageSparseMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003851 VkDevice device,
3852 VkImage image,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003853 u32* pSparseMemoryRequirementCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003854 VkSparseImageMemoryRequirements* pSparseMemoryRequirements) {
3855 deviceObject := GetDevice(device)
3856 imageObject := GetImage(image)
3857 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003858}
3859
Jesse Hall606a54e2015-11-19 22:17:28 -08003860cmd void vkGetPhysicalDeviceSparseImageFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003861 VkPhysicalDevice physicalDevice,
3862 VkFormat format,
3863 VkImageType type,
Jesse Hall091ed9e2015-11-30 00:55:29 -08003864 VkSampleCountFlagBits samples,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003865 VkImageUsageFlags usage,
3866 VkImageTiling tiling,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003867 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003868 VkSparseImageFormatProperties* pProperties) {
3869 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003870}
3871
Jesse Halla6429252015-11-29 18:59:42 -08003872cmd VkResult vkQueueBindSparse(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003873 VkQueue queue,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003874 u32 bindInfoCount,
Jesse Halla6429252015-11-29 18:59:42 -08003875 const VkBindSparseInfo* pBindInfo,
3876 VkFence fence) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003877 queueObject := GetQueue(queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003878
3879 return ?
3880}
3881
3882
3883// Fence functions
3884
3885@threadSafety("system")
3886cmd VkResult vkCreateFence(
3887 VkDevice device,
3888 const VkFenceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003889 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003890 VkFence* pFence) {
3891 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_FENCE_CREATE_INFO)
3892 deviceObject := GetDevice(device)
3893
3894 fence := ?
3895 pFence[0] = fence
3896 State.Fences[fence] = new!FenceObject(
Jesse Halld8bade02015-11-24 10:24:18 -08003897 device: device, signaled: (pCreateInfo.flags == as!VkFenceCreateFlags(VK_FENCE_CREATE_SIGNALED_BIT)))
Jesse Halld27f6aa2015-08-15 17:58:48 -07003898
3899 return ?
3900}
3901
3902@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003903cmd void vkDestroyFence(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003904 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003905 VkFence fence,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003906 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003907 deviceObject := GetDevice(device)
3908 fenceObject := GetFence(fence)
3909 assert(fenceObject.device == device)
3910
3911 State.Fences[fence] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003912}
3913
3914@threadSafety("system")
3915cmd VkResult vkResetFences(
3916 VkDevice device,
3917 u32 fenceCount,
3918 const VkFence* pFences) {
3919 deviceObject := GetDevice(device)
3920
3921 fences := pFences[0:fenceCount]
3922 for i in (0 .. fenceCount) {
3923 fence := fences[i]
3924 fenceObject := GetFence(fence)
3925 assert(fenceObject.device == device)
3926 fenceObject.signaled = false
3927 }
3928
3929 return ?
3930}
3931
3932@threadSafety("system")
3933cmd VkResult vkGetFenceStatus(
3934 VkDevice device,
3935 VkFence fence) {
3936 deviceObject := GetDevice(device)
3937 fenceObject := GetFence(fence)
3938 assert(fenceObject.device == device)
3939
3940 return ?
3941}
3942
3943@threadSafety("system")
3944cmd VkResult vkWaitForFences(
3945 VkDevice device,
3946 u32 fenceCount,
3947 const VkFence* pFences,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003948 VkBool32 waitAll,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003949 u64 timeout) { /// timeout in nanoseconds
3950 deviceObject := GetDevice(device)
3951
3952 fences := pFences[0:fenceCount]
3953 for i in (0 .. fenceCount) {
3954 fence := fences[i]
3955 fenceObject := GetFence(fence)
3956 assert(fenceObject.device == device)
3957 }
3958
3959 return ?
3960}
3961
3962
3963// Queue semaphore functions
3964
3965@threadSafety("system")
3966cmd VkResult vkCreateSemaphore(
3967 VkDevice device,
3968 const VkSemaphoreCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003969 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003970 VkSemaphore* pSemaphore) {
3971 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO)
3972 deviceObject := GetDevice(device)
3973
3974 semaphore := ?
3975 pSemaphore[0] = semaphore
3976 State.Semaphores[semaphore] = new!SemaphoreObject(device: device)
3977
3978 return ?
3979}
3980
3981@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003982cmd void vkDestroySemaphore(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003983 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003984 VkSemaphore semaphore,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003985 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003986 deviceObject := GetDevice(device)
3987 semaphoreObject := GetSemaphore(semaphore)
3988 assert(semaphoreObject.device == device)
3989
3990 State.Semaphores[semaphore] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003991}
3992
Jesse Halld27f6aa2015-08-15 17:58:48 -07003993
3994// Event functions
3995
3996@threadSafety("system")
3997cmd VkResult vkCreateEvent(
3998 VkDevice device,
3999 const VkEventCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004000 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004001 VkEvent* pEvent) {
4002 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_EVENT_CREATE_INFO)
4003 deviceObject := GetDevice(device)
4004
4005 event := ?
4006 pEvent[0] = event
4007 State.Events[event] = new!EventObject(device: device)
4008
4009 return ?
4010}
4011
4012@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004013cmd void vkDestroyEvent(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004014 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004015 VkEvent event,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004016 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004017 deviceObject := GetDevice(device)
4018 eventObject := GetEvent(event)
4019 assert(eventObject.device == device)
4020
4021 State.Events[event] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004022}
4023
4024@threadSafety("system")
4025cmd VkResult vkGetEventStatus(
4026 VkDevice device,
4027 VkEvent event) {
4028 deviceObject := GetDevice(device)
4029 eventObject := GetEvent(event)
4030 assert(eventObject.device == device)
4031
4032 return ?
4033}
4034
4035@threadSafety("system")
4036cmd VkResult vkSetEvent(
4037 VkDevice device,
4038 VkEvent event) {
4039 deviceObject := GetDevice(device)
4040 eventObject := GetEvent(event)
4041 assert(eventObject.device == device)
4042
4043 return ?
4044}
4045
4046@threadSafety("system")
4047cmd VkResult vkResetEvent(
4048 VkDevice device,
4049 VkEvent event) {
4050 deviceObject := GetDevice(device)
4051 eventObject := GetEvent(event)
4052 assert(eventObject.device == device)
4053
4054 return ?
4055}
4056
4057
4058// Query functions
4059
4060@threadSafety("system")
4061cmd VkResult vkCreateQueryPool(
4062 VkDevice device,
4063 const VkQueryPoolCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004064 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004065 VkQueryPool* pQueryPool) {
4066 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO)
4067 deviceObject := GetDevice(device)
4068
4069 queryPool := ?
4070 pQueryPool[0] = queryPool
4071 State.QueryPools[queryPool] = new!QueryPoolObject(device: device)
4072
4073 return ?
4074}
4075
4076@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004077cmd void vkDestroyQueryPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004078 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004079 VkQueryPool queryPool,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004080 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004081 deviceObject := GetDevice(device)
4082 queryPoolObject := GetQueryPool(queryPool)
4083 assert(queryPoolObject.device == device)
4084
4085 State.QueryPools[queryPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004086}
4087
4088@threadSafety("system")
4089cmd VkResult vkGetQueryPoolResults(
4090 VkDevice device,
4091 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004092 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004093 u32 queryCount,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004094 platform.size_t dataSize,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004095 void* pData,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004096 VkDeviceSize stride,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004097 VkQueryResultFlags flags) {
4098 deviceObject := GetDevice(device)
4099 queryPoolObject := GetQueryPool(queryPool)
4100 assert(queryPoolObject.device == device)
4101
Jesse Halld27f6aa2015-08-15 17:58:48 -07004102 data := pData[0:dataSize]
4103
4104 return ?
4105}
4106
4107// Buffer functions
4108
4109@threadSafety("system")
4110cmd VkResult vkCreateBuffer(
4111 VkDevice device,
4112 const VkBufferCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004113 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004114 VkBuffer* pBuffer) {
4115 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO)
4116 deviceObject := GetDevice(device)
4117
4118 buffer := ?
4119 pBuffer[0] = buffer
4120 State.Buffers[buffer] = new!BufferObject(device: device)
4121
4122 return ?
4123}
4124
4125@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004126cmd void vkDestroyBuffer(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004127 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004128 VkBuffer buffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004129 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004130 deviceObject := GetDevice(device)
4131 bufferObject := GetBuffer(buffer)
4132 assert(bufferObject.device == device)
4133
Jesse Hall3fbc8562015-11-29 22:10:52 -08004134 assert(bufferObject.memory == 0)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004135 State.Buffers[buffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004136}
4137
4138
4139// Buffer view functions
4140
4141@threadSafety("system")
4142cmd VkResult vkCreateBufferView(
4143 VkDevice device,
4144 const VkBufferViewCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004145 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004146 VkBufferView* pView) {
4147 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO)
4148 deviceObject := GetDevice(device)
4149
4150 bufferObject := GetBuffer(pCreateInfo.buffer)
4151 assert(bufferObject.device == device)
4152
4153 view := ?
4154 pView[0] = view
4155 State.BufferViews[view] = new!BufferViewObject(device: device, buffer: pCreateInfo.buffer)
4156
4157 return ?
4158}
4159
4160@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004161cmd void vkDestroyBufferView(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004162 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004163 VkBufferView bufferView,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004164 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004165 deviceObject := GetDevice(device)
4166 bufferViewObject := GetBufferView(bufferView)
4167 assert(bufferViewObject.device == device)
4168
4169 State.BufferViews[bufferView] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004170}
4171
4172
4173// Image functions
4174
4175@threadSafety("system")
4176cmd VkResult vkCreateImage(
4177 VkDevice device,
4178 const VkImageCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004179 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004180 VkImage* pImage) {
4181 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO)
4182 deviceObject := GetDevice(device)
4183
4184 image := ?
4185 pImage[0] = image
4186 State.Images[image] = new!ImageObject(device: device)
4187
4188 return ?
4189}
4190
4191@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004192cmd void vkDestroyImage(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004193 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004194 VkImage image,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004195 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004196 deviceObject := GetDevice(device)
4197 imageObject := GetImage(image)
4198 assert(imageObject.device == device)
4199
Jesse Hall3fbc8562015-11-29 22:10:52 -08004200 assert(imageObject.memory == 0)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004201 State.Images[image] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004202}
4203
Jesse Hall606a54e2015-11-19 22:17:28 -08004204cmd void vkGetImageSubresourceLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004205 VkDevice device,
4206 VkImage image,
4207 const VkImageSubresource* pSubresource,
4208 VkSubresourceLayout* pLayout) {
4209 deviceObject := GetDevice(device)
4210 imageObject := GetImage(image)
4211 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004212}
4213
4214
4215// Image view functions
4216
4217@threadSafety("system")
4218cmd VkResult vkCreateImageView(
4219 VkDevice device,
4220 const VkImageViewCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004221 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004222 VkImageView* pView) {
4223 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO)
4224 deviceObject := GetDevice(device)
4225
4226 imageObject := GetImage(pCreateInfo.image)
4227 assert(imageObject.device == device)
4228
4229 view := ?
4230 pView[0] = view
4231 State.ImageViews[view] = new!ImageViewObject(device: device, image: pCreateInfo.image)
4232
4233 return ?
4234}
4235
4236@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004237cmd void vkDestroyImageView(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004238 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004239 VkImageView imageView,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004240 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004241 deviceObject := GetDevice(device)
4242 imageViewObject := GetImageView(imageView)
4243 assert(imageViewObject.device == device)
4244
4245 State.ImageViews[imageView] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004246}
4247
4248
4249// Shader functions
4250
4251cmd VkResult vkCreateShaderModule(
4252 VkDevice device,
4253 const VkShaderModuleCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004254 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004255 VkShaderModule* pShaderModule) {
4256 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO)
4257 deviceObject := GetDevice(device)
4258
4259 shaderModule := ?
4260 pShaderModule[0] = shaderModule
4261 State.ShaderModules[shaderModule] = new!ShaderModuleObject(device: device)
4262
4263 return ?
4264}
4265
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004266cmd void vkDestroyShaderModule(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004267 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004268 VkShaderModule shaderModule,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004269 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004270 deviceObject := GetDevice(device)
4271 shaderModuleObject := GetShaderModule(shaderModule)
4272 assert(shaderModuleObject.device == device)
4273
4274 State.ShaderModules[shaderModule] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004275}
4276
Jesse Halld27f6aa2015-08-15 17:58:48 -07004277
4278// Pipeline functions
4279
4280cmd VkResult vkCreatePipelineCache(
4281 VkDevice device,
4282 const VkPipelineCacheCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004283 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004284 VkPipelineCache* pPipelineCache) {
4285 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO)
4286 deviceObject := GetDevice(device)
4287
4288 pipelineCache := ?
4289 pPipelineCache[0] = pipelineCache
4290 State.PipelineCaches[pipelineCache] = new!PipelineCacheObject(device: device)
4291
4292 return ?
4293}
4294
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004295cmd void vkDestroyPipelineCache(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004296 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004297 VkPipelineCache pipelineCache,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004298 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004299 deviceObject := GetDevice(device)
4300 pipelineCacheObject := GetPipelineCache(pipelineCache)
4301 assert(pipelineCacheObject.device == device)
4302
4303 State.PipelineCaches[pipelineCache] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004304}
4305
Jesse Halld27f6aa2015-08-15 17:58:48 -07004306cmd VkResult vkGetPipelineCacheData(
4307 VkDevice device,
4308 VkPipelineCache pipelineCache,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004309 platform.size_t* pDataSize,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004310 void* pData) {
4311 deviceObject := GetDevice(device)
4312 pipelineCacheObject := GetPipelineCache(pipelineCache)
4313 assert(pipelineCacheObject.device == device)
4314
4315 return ?
4316}
4317
4318cmd VkResult vkMergePipelineCaches(
4319 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004320 VkPipelineCache dstCache,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004321 u32 srcCacheCount,
4322 const VkPipelineCache* pSrcCaches) {
4323 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004324 dstCacheObject := GetPipelineCache(dstCache)
4325 assert(dstCacheObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004326
4327 srcCaches := pSrcCaches[0:srcCacheCount]
4328 for i in (0 .. srcCacheCount) {
4329 srcCache := srcCaches[i]
4330 srcCacheObject := GetPipelineCache(srcCache)
4331 assert(srcCacheObject.device == device)
4332 }
4333
4334 return ?
4335}
4336
4337cmd VkResult vkCreateGraphicsPipelines(
4338 VkDevice device,
4339 VkPipelineCache pipelineCache,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004340 u32 createInfoCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004341 const VkGraphicsPipelineCreateInfo* pCreateInfos,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004342 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004343 VkPipeline* pPipelines) {
4344 deviceObject := GetDevice(device)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004345 if pipelineCache != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004346 pipelineCacheObject := GetPipelineCache(pipelineCache)
4347 assert(pipelineCacheObject.device == device)
4348 }
4349
Jesse Hall03b6fe12015-11-24 12:44:21 -08004350 createInfos := pCreateInfos[0:createInfoCount]
4351 pipelines := pPipelines[0:createInfoCount]
4352 for i in (0 .. createInfoCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004353 pipeline := ?
4354 pipelines[i] = pipeline
4355 State.Pipelines[pipeline] = new!PipelineObject(device: device)
4356 }
4357
4358 return ?
4359}
4360
4361cmd VkResult vkCreateComputePipelines(
4362 VkDevice device,
4363 VkPipelineCache pipelineCache,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004364 u32 createInfoCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004365 const VkComputePipelineCreateInfo* pCreateInfos,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004366 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004367 VkPipeline* pPipelines) {
4368 deviceObject := GetDevice(device)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004369 if pipelineCache != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004370 pipelineCacheObject := GetPipelineCache(pipelineCache)
4371 assert(pipelineCacheObject.device == device)
4372 }
4373
Jesse Hall03b6fe12015-11-24 12:44:21 -08004374 createInfos := pCreateInfos[0:createInfoCount]
4375 pipelines := pPipelines[0:createInfoCount]
4376 for i in (0 .. createInfoCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004377 pipeline := ?
4378 pipelines[i] = pipeline
4379 State.Pipelines[pipeline] = new!PipelineObject(device: device)
4380 }
4381
4382 return ?
4383}
4384
4385@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004386cmd void vkDestroyPipeline(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004387 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004388 VkPipeline pipeline,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004389 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004390 deviceObject := GetDevice(device)
4391 pipelineObjects := GetPipeline(pipeline)
4392 assert(pipelineObjects.device == device)
4393
4394 State.Pipelines[pipeline] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004395}
4396
4397
4398// Pipeline layout functions
4399
4400@threadSafety("system")
4401cmd VkResult vkCreatePipelineLayout(
4402 VkDevice device,
4403 const VkPipelineLayoutCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004404 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004405 VkPipelineLayout* pPipelineLayout) {
4406 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO)
4407 deviceObject := GetDevice(device)
4408
4409 pipelineLayout := ?
4410 pPipelineLayout[0] = pipelineLayout
4411 State.PipelineLayouts[pipelineLayout] = new!PipelineLayoutObject(device: device)
4412
4413 return ?
4414}
4415
4416@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004417cmd void vkDestroyPipelineLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004418 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004419 VkPipelineLayout pipelineLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004420 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004421 deviceObject := GetDevice(device)
4422 pipelineLayoutObjects := GetPipelineLayout(pipelineLayout)
4423 assert(pipelineLayoutObjects.device == device)
4424
4425 State.PipelineLayouts[pipelineLayout] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004426}
4427
4428
4429// Sampler functions
4430
4431@threadSafety("system")
4432cmd VkResult vkCreateSampler(
4433 VkDevice device,
4434 const VkSamplerCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004435 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004436 VkSampler* pSampler) {
4437 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO)
4438 deviceObject := GetDevice(device)
4439
4440 sampler := ?
4441 pSampler[0] = sampler
4442 State.Samplers[sampler] = new!SamplerObject(device: device)
4443
4444 return ?
4445}
4446
4447@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004448cmd void vkDestroySampler(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004449 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004450 VkSampler sampler,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004451 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004452 deviceObject := GetDevice(device)
4453 samplerObject := GetSampler(sampler)
4454 assert(samplerObject.device == device)
4455
4456 State.Samplers[sampler] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004457}
4458
4459
4460// Descriptor set functions
4461
4462@threadSafety("system")
4463cmd VkResult vkCreateDescriptorSetLayout(
4464 VkDevice device,
4465 const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004466 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004467 VkDescriptorSetLayout* pSetLayout) {
4468 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO)
4469 deviceObject := GetDevice(device)
4470
4471 setLayout := ?
4472 pSetLayout[0] = setLayout
4473 State.DescriptorSetLayouts[setLayout] = new!DescriptorSetLayoutObject(device: device)
4474
4475 return ?
4476}
4477
4478@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004479cmd void vkDestroyDescriptorSetLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004480 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004481 VkDescriptorSetLayout descriptorSetLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004482 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004483 deviceObject := GetDevice(device)
4484 descriptorSetLayoutObject := GetDescriptorSetLayout(descriptorSetLayout)
4485 assert(descriptorSetLayoutObject.device == device)
4486
4487 State.DescriptorSetLayouts[descriptorSetLayout] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004488}
4489
4490@threadSafety("system")
4491cmd VkResult vkCreateDescriptorPool(
4492 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004493 const VkDescriptorPoolCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004494 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004495 VkDescriptorPool* pDescriptorPool) {
4496 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO)
4497 deviceObject := GetDevice(device)
4498
4499 descriptorPool := ?
4500 pDescriptorPool[0] = descriptorPool
4501 State.DescriptorPools[descriptorPool] = new!DescriptorPoolObject(device: device)
4502
4503 return ?
4504}
4505
4506@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004507cmd void vkDestroyDescriptorPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004508 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004509 VkDescriptorPool descriptorPool,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004510 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004511 deviceObject := GetDevice(device)
4512 descriptorPoolObject := GetDescriptorPool(descriptorPool)
4513 assert(descriptorPoolObject.device == device)
4514
4515 State.DescriptorPools[descriptorPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004516}
4517
4518@threadSafety("app")
4519cmd VkResult vkResetDescriptorPool(
4520 VkDevice device,
Jesse Hallfbf97b02015-11-20 14:17:03 -08004521 VkDescriptorPool descriptorPool,
4522 VkDescriptorPoolResetFlags flags) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004523 deviceObject := GetDevice(device)
4524 descriptorPoolObject := GetDescriptorPool(descriptorPool)
4525 assert(descriptorPoolObject.device == device)
4526
4527 return ?
4528}
4529
4530@threadSafety("app")
Jesse Hall3fbc8562015-11-29 22:10:52 -08004531cmd VkResult vkAllocateDescriptorSets(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004532 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004533 const VkDescriptorSetAllocateInfo* pAllocateInfo,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004534 VkDescriptorSet* pDescriptorSets) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004535 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004536 allocInfo := pAllocateInfo[0]
Jesse Hallfbf97b02015-11-20 14:17:03 -08004537 descriptorPoolObject := GetDescriptorPool(allocInfo.descriptorPool)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004538
Jesse Hall03b6fe12015-11-24 12:44:21 -08004539 setLayouts := allocInfo.pSetLayouts[0:allocInfo.setCount]
4540 for i in (0 .. allocInfo.setCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004541 setLayout := setLayouts[i]
4542 setLayoutObject := GetDescriptorSetLayout(setLayout)
4543 assert(setLayoutObject.device == device)
4544 }
4545
Jesse Hall03b6fe12015-11-24 12:44:21 -08004546 descriptorSets := pDescriptorSets[0:allocInfo.setCount]
4547 for i in (0 .. allocInfo.setCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004548 descriptorSet := ?
4549 descriptorSets[i] = descriptorSet
4550 State.DescriptorSets[descriptorSet] = new!DescriptorSetObject(device: device)
4551 }
4552
4553 return ?
4554}
4555
Jesse Hallf09c6b12015-08-15 19:54:28 -07004556cmd VkResult vkFreeDescriptorSets(
4557 VkDevice device,
4558 VkDescriptorPool descriptorPool,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004559 u32 descriptorSetCount,
Jesse Hallf09c6b12015-08-15 19:54:28 -07004560 const VkDescriptorSet* pDescriptorSets) {
4561 deviceObject := GetDevice(device)
4562 descriptorPoolObject := GetDescriptorPool(descriptorPool)
4563
Jesse Hall03b6fe12015-11-24 12:44:21 -08004564 descriptorSets := pDescriptorSets[0:descriptorSetCount]
4565 for i in (0 .. descriptorSetCount) {
Jesse Hallf09c6b12015-08-15 19:54:28 -07004566 descriptorSet := descriptorSets[i]
4567 descriptorSetObject := GetDescriptorSet(descriptorSet)
4568 assert(descriptorSetObject.device == device)
4569 State.DescriptorSets[descriptorSet] = null
4570 }
4571
4572 return ?
4573}
4574
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004575cmd void vkUpdateDescriptorSets(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004576 VkDevice device,
Jesse Hallb00daad2015-11-29 19:46:20 -08004577 u32 descriptorWriteCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004578 const VkWriteDescriptorSet* pDescriptorWrites,
Jesse Hallb00daad2015-11-29 19:46:20 -08004579 u32 descriptorCopyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004580 const VkCopyDescriptorSet* pDescriptorCopies) {
4581 deviceObject := GetDevice(device)
4582
Jesse Hallb00daad2015-11-29 19:46:20 -08004583 descriptorWrites := pDescriptorWrites[0:descriptorWriteCount]
4584 for i in (0 .. descriptorWriteCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004585 descriptorWrite := descriptorWrites[i]
Jesse Hall3fbc8562015-11-29 22:10:52 -08004586 descriptorWriteObject := GetDescriptorSet(descriptorWrite.dstSet)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004587 assert(descriptorWriteObject.device == device)
4588 }
4589
Jesse Hallb00daad2015-11-29 19:46:20 -08004590 descriptorCopies := pDescriptorCopies[0:descriptorCopyCount]
4591 for i in (0 .. descriptorCopyCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004592 descriptorCopy := descriptorCopies[i]
Jesse Hall3fbc8562015-11-29 22:10:52 -08004593 descriptorCopyObject := GetDescriptorSet(descriptorCopy.dstSet)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004594 assert(descriptorCopyObject.device == device)
4595 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07004596}
4597
4598
4599// Framebuffer functions
4600
4601@threadSafety("system")
4602cmd VkResult vkCreateFramebuffer(
4603 VkDevice device,
4604 const VkFramebufferCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004605 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004606 VkFramebuffer* pFramebuffer) {
4607 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO)
4608 deviceObject := GetDevice(device)
4609
4610 framebuffer := ?
4611 pFramebuffer[0] = framebuffer
4612 State.Framebuffers[framebuffer] = new!FramebufferObject(device: device)
4613
4614 return ?
4615}
4616
4617@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004618cmd void vkDestroyFramebuffer(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004619 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004620 VkFramebuffer framebuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004621 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004622 deviceObject := GetDevice(device)
4623 framebufferObject := GetFramebuffer(framebuffer)
4624 assert(framebufferObject.device == device)
4625
4626 State.Framebuffers[framebuffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004627}
4628
4629
4630// Renderpass functions
4631
4632@threadSafety("system")
4633cmd VkResult vkCreateRenderPass(
4634 VkDevice device,
4635 const VkRenderPassCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004636 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004637 VkRenderPass* pRenderPass) {
4638 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO)
4639 deviceObject := GetDevice(device)
4640
4641 renderpass := ?
4642 pRenderPass[0] = renderpass
4643 State.RenderPasses[renderpass] = new!RenderPassObject(device: device)
4644
4645 return ?
4646}
4647
4648@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004649cmd void vkDestroyRenderPass(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004650 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004651 VkRenderPass renderPass,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004652 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004653 deviceObject := GetDevice(device)
4654 renderPassObject := GetRenderPass(renderPass)
4655 assert(renderPassObject.device == device)
4656
4657 State.RenderPasses[renderPass] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004658}
4659
Jesse Hall606a54e2015-11-19 22:17:28 -08004660cmd void vkGetRenderAreaGranularity(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004661 VkDevice device,
4662 VkRenderPass renderPass,
4663 VkExtent2D* pGranularity) {
4664 deviceObject := GetDevice(device)
4665 renderPassObject := GetRenderPass(renderPass)
4666
4667 granularity := ?
4668 pGranularity[0] = granularity
Jesse Halld27f6aa2015-08-15 17:58:48 -07004669}
4670
4671// Command pool functions
4672
4673cmd VkResult vkCreateCommandPool(
4674 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004675 const VkCommandPoolCreateInfo* pCreateInfo,
4676 const VkAllocationCallbacks* pAllocator,
4677 VkCommandPool* pCommandPool) {
4678 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004679 deviceObject := GetDevice(device)
4680
Jesse Hall3fbc8562015-11-29 22:10:52 -08004681 commandPool := ?
4682 pCommandPool[0] = commandPool
4683 State.CommandPools[commandPool] = new!CommandPoolObject(device: device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004684
4685 return ?
4686}
4687
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004688cmd void vkDestroyCommandPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004689 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004690 VkCommandPool commandPool,
4691 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004692 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004693 commandPoolObject := GetCommandPool(commandPool)
4694 assert(commandPoolObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004695
Jesse Hall3fbc8562015-11-29 22:10:52 -08004696 State.CommandPools[commandPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004697}
4698
4699cmd VkResult vkResetCommandPool(
4700 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004701 VkCommandPool commandPool,
4702 VkCommandPoolResetFlags flags) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004703 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004704 commandPoolObject := GetCommandPool(commandPool)
4705 assert(commandPoolObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004706
4707 return ?
4708}
4709
4710// Command buffer functions
4711
Jesse Hall3fbc8562015-11-29 22:10:52 -08004712macro void bindCommandBuffer(VkCommandBuffer commandBuffer, any obj, VkDeviceMemory memory) {
4713 memoryObject := GetDeviceMemory(memory)
4714 memoryObject.boundCommandBuffers[commandBuffer] = commandBuffer
Jesse Halld27f6aa2015-08-15 17:58:48 -07004715
Jesse Hall3fbc8562015-11-29 22:10:52 -08004716 commandBufferObject := GetCommandBuffer(commandBuffer)
4717 commandBufferObject.boundObjects[as!u64(obj)] = memory
Jesse Halld27f6aa2015-08-15 17:58:48 -07004718}
4719
Jesse Hall3fbc8562015-11-29 22:10:52 -08004720macro void unbindCommandBuffer(VkCommandBuffer commandBuffer, any obj, VkDeviceMemory memory) {
4721 memoryObject := GetDeviceMemory(memory)
4722 memoryObject.boundCommandBuffers[commandBuffer] = null
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)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004726}
4727
4728@threadSafety("system")
Jesse Hall3fbc8562015-11-29 22:10:52 -08004729cmd VkResult vkAllocateCommandBuffers(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004730 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004731 const VkCommandBufferAllocateInfo* pAllocateInfo,
4732 VkCommandBuffer* pCommandBuffers) {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08004733 assert(pAllocateInfo[0].sType == VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004734
Jesse Hall3dd678a2016-01-08 21:52:01 -08004735 count := pAllocateInfo[0].commandBufferCount
Jesse Hall3fbc8562015-11-29 22:10:52 -08004736 commandBuffers := pCommandBuffers[0:count]
Jesse Hallfbf97b02015-11-20 14:17:03 -08004737 for i in (0 .. count) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004738 commandBuffer := ?
4739 commandBuffers[i] = commandBuffer
4740 State.CommandBuffers[commandBuffer] = new!CommandBufferObject(device: device)
Jesse Hallfbf97b02015-11-20 14:17:03 -08004741 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07004742
4743 return ?
4744}
4745
4746@threadSafety("system")
Jesse Hallfbf97b02015-11-20 14:17:03 -08004747cmd void vkFreeCommandBuffers(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004748 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004749 VkCommandPool commandPool,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004750 u32 commandBufferCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004751 const VkCommandBuffer* pCommandBuffers) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004752 deviceObject := GetDevice(device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004753
Jesse Hall3fbc8562015-11-29 22:10:52 -08004754 commandBuffers := pCommandBuffers[0:commandBufferCount]
Jesse Hall03b6fe12015-11-24 12:44:21 -08004755 for i in (0 .. commandBufferCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004756 commandBufferObject := GetCommandBuffer(commandBuffers[i])
4757 assert(commandBufferObject.device == device)
Jesse Hallfbf97b02015-11-20 14:17:03 -08004758 // TODO: iterate over boundObjects and clear memory bindings
Jesse Hall3fbc8562015-11-29 22:10:52 -08004759 State.CommandBuffers[commandBuffers[i]] = null
Jesse Hallfbf97b02015-11-20 14:17:03 -08004760 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07004761}
4762
4763@threadSafety("app")
4764cmd VkResult vkBeginCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004765 VkCommandBuffer commandBuffer,
4766 const VkCommandBufferBeginInfo* pBeginInfo) {
4767 assert(pBeginInfo.sType == VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO)
4768 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004769
4770 // TODO: iterate over boundObjects and clear memory bindings
4771
4772 return ?
4773}
4774
4775@threadSafety("app")
4776cmd VkResult vkEndCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004777 VkCommandBuffer commandBuffer) {
4778 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004779
4780 return ?
4781}
4782
4783@threadSafety("app")
4784cmd VkResult vkResetCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004785 VkCommandBuffer commandBuffer,
4786 VkCommandBufferResetFlags flags) {
4787 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004788
4789 // TODO: iterate over boundObjects and clear memory bindings
4790
4791 return ?
4792}
4793
4794
4795// Command buffer building functions
4796
4797@threadSafety("app")
4798cmd void vkCmdBindPipeline(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004799 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004800 VkPipelineBindPoint pipelineBindPoint,
4801 VkPipeline pipeline) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004802 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004803 pipelineObject := GetPipeline(pipeline)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004804 assert(commandBufferObject.device == pipelineObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004805
Jesse Halld8bade02015-11-24 10:24:18 -08004806 queue := switch (pipelineBindPoint) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004807 case VK_PIPELINE_BIND_POINT_COMPUTE: VK_QUEUE_COMPUTE_BIT
4808 case VK_PIPELINE_BIND_POINT_GRAPHICS: VK_QUEUE_GRAPHICS_BIT
4809 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08004810 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004811}
4812
4813@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004814cmd void vkCmdSetViewport(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004815 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004816 u32 firstViewport,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004817 u32 viewportCount,
4818 const VkViewport* pViewports) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004819 commandBufferObject := GetCommandBuffer(commandBuffer)
4820 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004821}
4822
4823@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004824cmd void vkCmdSetScissor(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004825 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004826 u32 firstScissor,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004827 u32 scissorCount,
4828 const VkRect2D* pScissors) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004829 commandBufferObject := GetCommandBuffer(commandBuffer)
4830 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004831}
4832
4833@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004834cmd void vkCmdSetLineWidth(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004835 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004836 f32 lineWidth) {
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 vkCmdSetDepthBias(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004843 VkCommandBuffer commandBuffer,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004844 f32 depthBiasConstantFactor,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004845 f32 depthBiasClamp,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004846 f32 depthBiasSlopeFactor) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004847 commandBufferObject := GetCommandBuffer(commandBuffer)
4848 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004849}
Jesse Halld27f6aa2015-08-15 17:58:48 -07004850
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004851@threadSafety("app")
4852cmd void vkCmdSetBlendConstants(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004853 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004854 // TODO(jessehall): apic only supports 'const' on pointer types. Using
4855 // an annotation as a quick hack to pass this to the template without
4856 // having to modify the AST and semantic model.
Jesse Hallb00daad2015-11-29 19:46:20 -08004857 @readonly f32[4] blendConstants) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004858 commandBufferObject := GetCommandBuffer(commandBuffer)
4859 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004860}
4861
4862@threadSafety("app")
4863cmd void vkCmdSetDepthBounds(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004864 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004865 f32 minDepthBounds,
4866 f32 maxDepthBounds) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004867 commandBufferObject := GetCommandBuffer(commandBuffer)
4868 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004869}
4870
4871@threadSafety("app")
4872cmd void vkCmdSetStencilCompareMask(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004873 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004874 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08004875 u32 compareMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004876 commandBufferObject := GetCommandBuffer(commandBuffer)
4877 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004878}
4879
4880@threadSafety("app")
4881cmd void vkCmdSetStencilWriteMask(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004882 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004883 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08004884 u32 writeMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004885 commandBufferObject := GetCommandBuffer(commandBuffer)
4886 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004887}
4888
4889@threadSafety("app")
4890cmd void vkCmdSetStencilReference(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004891 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004892 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08004893 u32 reference) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004894 commandBufferObject := GetCommandBuffer(commandBuffer)
4895 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004896}
4897
4898@threadSafety("app")
4899cmd void vkCmdBindDescriptorSets(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004900 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004901 VkPipelineBindPoint pipelineBindPoint,
4902 VkPipelineLayout layout,
4903 u32 firstSet,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004904 u32 descriptorSetCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004905 const VkDescriptorSet* pDescriptorSets,
4906 u32 dynamicOffsetCount,
4907 const u32* pDynamicOffsets) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004908 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004909
Jesse Hall03b6fe12015-11-24 12:44:21 -08004910 descriptorSets := pDescriptorSets[0:descriptorSetCount]
4911 for i in (0 .. descriptorSetCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004912 descriptorSet := descriptorSets[i]
4913 descriptorSetObject := GetDescriptorSet(descriptorSet)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004914 assert(commandBufferObject.device == descriptorSetObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004915 }
4916
4917 dynamicOffsets := pDynamicOffsets[0:dynamicOffsetCount]
4918 for i in (0 .. dynamicOffsetCount) {
4919 dynamicOffset := dynamicOffsets[i]
4920 }
4921
Jesse Halld8bade02015-11-24 10:24:18 -08004922 queue := switch (pipelineBindPoint) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004923 case VK_PIPELINE_BIND_POINT_COMPUTE: VK_QUEUE_COMPUTE_BIT
4924 case VK_PIPELINE_BIND_POINT_GRAPHICS: VK_QUEUE_GRAPHICS_BIT
4925 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08004926 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004927}
4928
4929@threadSafety("app")
4930cmd void vkCmdBindIndexBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004931 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004932 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004933 VkDeviceSize offset,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004934 VkIndexType indexType) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004935 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004936 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004937 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004938
Jesse Hall3fbc8562015-11-29 22:10:52 -08004939 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004940
Jesse Hall3fbc8562015-11-29 22:10:52 -08004941 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004942}
4943
4944@threadSafety("app")
4945cmd void vkCmdBindVertexBuffers(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004946 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004947 u32 firstBinding,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004948 u32 bindingCount,
4949 const VkBuffer* pBuffers,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004950 const VkDeviceSize* pOffsets) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004951 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004952
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004953 // TODO: check if not [firstBinding:firstBinding+bindingCount]
Jesse Halld27f6aa2015-08-15 17:58:48 -07004954 buffers := pBuffers[0:bindingCount]
4955 offsets := pOffsets[0:bindingCount]
4956 for i in (0 .. bindingCount) {
4957 buffer := buffers[i]
4958 offset := offsets[i]
4959 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004960 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004961
Jesse Hall3fbc8562015-11-29 22:10:52 -08004962 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004963 }
4964
Jesse Hall3fbc8562015-11-29 22:10:52 -08004965 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004966}
4967
4968@threadSafety("app")
4969cmd void vkCmdDraw(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004970 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004971 u32 vertexCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004972 u32 instanceCount,
4973 u32 firstVertex,
4974 u32 firstInstance) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004975 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004976
Jesse Hall3fbc8562015-11-29 22:10:52 -08004977 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004978}
4979
4980@threadSafety("app")
4981cmd void vkCmdDrawIndexed(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004982 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004983 u32 indexCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004984 u32 instanceCount,
4985 u32 firstIndex,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004986 s32 vertexOffset,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004987 u32 firstInstance) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004988 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004989
Jesse Hall3fbc8562015-11-29 22:10:52 -08004990 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004991}
4992
4993@threadSafety("app")
4994cmd void vkCmdDrawIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004995 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004996 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004997 VkDeviceSize offset,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004998 u32 drawCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004999 u32 stride) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005000 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005001 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005002 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005003
Jesse Hall3fbc8562015-11-29 22:10:52 -08005004 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005005
Jesse Hall3fbc8562015-11-29 22:10:52 -08005006 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005007}
5008
5009@threadSafety("app")
5010cmd void vkCmdDrawIndexedIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005011 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005012 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005013 VkDeviceSize offset,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005014 u32 drawCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005015 u32 stride) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005016 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005017 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005018 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005019
Jesse Hall3fbc8562015-11-29 22:10:52 -08005020 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005021
Jesse Hall3fbc8562015-11-29 22:10:52 -08005022 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005023}
5024
5025@threadSafety("app")
5026cmd void vkCmdDispatch(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005027 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005028 u32 x,
5029 u32 y,
5030 u32 z) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005031 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005032
Jesse Hall3fbc8562015-11-29 22:10:52 -08005033 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_COMPUTE_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005034}
5035
5036@threadSafety("app")
5037cmd void vkCmdDispatchIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005038 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005039 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005040 VkDeviceSize offset) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005041 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005042 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005043 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005044
Jesse Hall3fbc8562015-11-29 22:10:52 -08005045 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005046
Jesse Hall3fbc8562015-11-29 22:10:52 -08005047 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_COMPUTE_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005048}
5049
5050@threadSafety("app")
5051cmd void vkCmdCopyBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005052 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005053 VkBuffer srcBuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005054 VkBuffer dstBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005055 u32 regionCount,
5056 const VkBufferCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005057 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005058 srcBufferObject := GetBuffer(srcBuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005059 dstBufferObject := GetBuffer(dstBuffer)
5060 assert(commandBufferObject.device == srcBufferObject.device)
5061 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005062
5063 regions := pRegions[0:regionCount]
5064 for i in (0 .. regionCount) {
5065 region := regions[i]
5066 }
5067
Jesse Hall3fbc8562015-11-29 22:10:52 -08005068 bindCommandBuffer(commandBuffer, srcBuffer, srcBufferObject.memory)
5069 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005070
Jesse Hall65ab5522015-11-30 00:07:16 -08005071 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005072}
5073
5074@threadSafety("app")
5075cmd void vkCmdCopyImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005076 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005077 VkImage srcImage,
5078 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005079 VkImage dstImage,
5080 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005081 u32 regionCount,
5082 const VkImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005083 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005084 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005085 dstImageObject := GetImage(dstImage)
5086 assert(commandBufferObject.device == srcImageObject.device)
5087 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005088
5089 regions := pRegions[0:regionCount]
5090 for i in (0 .. regionCount) {
5091 region := regions[i]
5092 }
5093
Jesse Hall3fbc8562015-11-29 22:10:52 -08005094 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
5095 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005096
Jesse Hall65ab5522015-11-30 00:07:16 -08005097 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005098}
5099
5100@threadSafety("app")
5101cmd void vkCmdBlitImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005102 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005103 VkImage srcImage,
5104 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005105 VkImage dstImage,
5106 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005107 u32 regionCount,
5108 const VkImageBlit* pRegions,
Jesse Hall23ff73f2015-11-29 14:36:39 -08005109 VkFilter filter) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005110 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005111 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005112 dstImageObject := GetImage(dstImage)
5113 assert(commandBufferObject.device == srcImageObject.device)
5114 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005115
5116 regions := pRegions[0:regionCount]
5117 for i in (0 .. regionCount) {
5118 region := regions[i]
5119 }
5120
Jesse Hall3fbc8562015-11-29 22:10:52 -08005121 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
5122 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005123
Jesse Hall3fbc8562015-11-29 22:10:52 -08005124 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005125}
5126
5127@threadSafety("app")
5128cmd void vkCmdCopyBufferToImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005129 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005130 VkBuffer srcBuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005131 VkImage dstImage,
5132 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005133 u32 regionCount,
5134 const VkBufferImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005135 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005136 srcBufferObject := GetBuffer(srcBuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005137 dstImageObject := GetImage(dstImage)
5138 assert(commandBufferObject.device == srcBufferObject.device)
5139 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005140
5141 regions := pRegions[0:regionCount]
5142 for i in (0 .. regionCount) {
5143 region := regions[i]
5144 }
5145
Jesse Hall3fbc8562015-11-29 22:10:52 -08005146 bindCommandBuffer(commandBuffer, srcBuffer, srcBufferObject.memory)
5147 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005148
Jesse Hall65ab5522015-11-30 00:07:16 -08005149 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005150}
5151
5152@threadSafety("app")
5153cmd void vkCmdCopyImageToBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005154 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005155 VkImage srcImage,
5156 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005157 VkBuffer dstBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005158 u32 regionCount,
5159 const VkBufferImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005160 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005161 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005162 dstBufferObject := GetBuffer(dstBuffer)
5163 assert(commandBufferObject.device == srcImageObject.device)
5164 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005165
5166 regions := pRegions[0:regionCount]
5167 for i in (0 .. regionCount) {
5168 region := regions[i]
5169 }
5170
Jesse Hall3fbc8562015-11-29 22:10:52 -08005171 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
5172 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005173
Jesse Hall65ab5522015-11-30 00:07:16 -08005174 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005175}
5176
5177@threadSafety("app")
5178cmd void vkCmdUpdateBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005179 VkCommandBuffer commandBuffer,
5180 VkBuffer dstBuffer,
5181 VkDeviceSize dstOffset,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005182 VkDeviceSize dataSize,
Jesse Hall56d386a2016-07-26 15:20:40 -07005183 const void* pData) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005184 commandBufferObject := GetCommandBuffer(commandBuffer)
5185 dstBufferObject := GetBuffer(dstBuffer)
5186 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005187
5188 data := pData[0:dataSize]
5189
Jesse Hall3fbc8562015-11-29 22:10:52 -08005190 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005191
Jesse Hall65ab5522015-11-30 00:07:16 -08005192 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005193}
5194
5195@threadSafety("app")
5196cmd void vkCmdFillBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005197 VkCommandBuffer commandBuffer,
5198 VkBuffer dstBuffer,
5199 VkDeviceSize dstOffset,
Jesse Hallb00daad2015-11-29 19:46:20 -08005200 VkDeviceSize size,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005201 u32 data) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005202 commandBufferObject := GetCommandBuffer(commandBuffer)
5203 dstBufferObject := GetBuffer(dstBuffer)
5204 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005205
Jesse Hall65ab5522015-11-30 00:07:16 -08005206 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005207}
5208
5209@threadSafety("app")
5210cmd void vkCmdClearColorImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005211 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005212 VkImage image,
5213 VkImageLayout imageLayout,
5214 const VkClearColorValue* pColor,
5215 u32 rangeCount,
5216 const VkImageSubresourceRange* pRanges) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005217 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005218 imageObject := GetImage(image)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005219 assert(commandBufferObject.device == imageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005220
5221 ranges := pRanges[0:rangeCount]
5222 for i in (0 .. rangeCount) {
5223 range := ranges[i]
5224 }
5225
Jesse Hall3fbc8562015-11-29 22:10:52 -08005226 bindCommandBuffer(commandBuffer, image, imageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005227
Jesse Hall3fbc8562015-11-29 22:10:52 -08005228 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005229}
5230
5231@threadSafety("app")
5232cmd void vkCmdClearDepthStencilImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005233 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005234 VkImage image,
5235 VkImageLayout imageLayout,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005236 const VkClearDepthStencilValue* pDepthStencil,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005237 u32 rangeCount,
5238 const VkImageSubresourceRange* pRanges) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005239 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005240 imageObject := GetImage(image)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005241 assert(commandBufferObject.device == imageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005242
5243 ranges := pRanges[0:rangeCount]
5244 for i in (0 .. rangeCount) {
5245 range := ranges[i]
5246 }
5247
Jesse Hall3fbc8562015-11-29 22:10:52 -08005248 bindCommandBuffer(commandBuffer, image, imageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005249
Jesse Hall3fbc8562015-11-29 22:10:52 -08005250 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005251}
5252
5253@threadSafety("app")
Jesse Hallae38f732015-11-19 21:32:50 -08005254cmd void vkCmdClearAttachments(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005255 VkCommandBuffer commandBuffer,
Jesse Hallae38f732015-11-19 21:32:50 -08005256 u32 attachmentCount,
5257 const VkClearAttachment* pAttachments,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005258 u32 rectCount,
Jesse Halla15a4bf2015-11-19 22:48:02 -08005259 const VkClearRect* pRects) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005260 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005261
5262 rects := pRects[0:rectCount]
5263 for i in (0 .. rectCount) {
5264 rect := rects[i]
5265 }
5266
Jesse Hall3fbc8562015-11-29 22:10:52 -08005267 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005268}
5269
5270@threadSafety("app")
5271cmd void vkCmdResolveImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005272 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005273 VkImage srcImage,
5274 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005275 VkImage dstImage,
5276 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005277 u32 regionCount,
5278 const VkImageResolve* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005279 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005280 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005281 dstImageObject := GetImage(dstImage)
5282 assert(commandBufferObject.device == srcImageObject.device)
5283 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005284
5285 regions := pRegions[0:regionCount]
5286 for i in (0 .. regionCount) {
5287 region := regions[i]
5288 }
5289
Jesse Hall3fbc8562015-11-29 22:10:52 -08005290 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
5291 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005292
Jesse Hall3fbc8562015-11-29 22:10:52 -08005293 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005294}
5295
5296@threadSafety("app")
5297cmd void vkCmdSetEvent(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005298 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005299 VkEvent event,
5300 VkPipelineStageFlags stageMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005301 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005302 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005303 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005304}
5305
5306@threadSafety("app")
5307cmd void vkCmdResetEvent(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005308 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005309 VkEvent event,
5310 VkPipelineStageFlags stageMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005311 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005312 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005313 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005314}
5315
5316@threadSafety("app")
5317cmd void vkCmdWaitEvents(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005318 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005319 u32 eventCount,
5320 const VkEvent* pEvents,
5321 VkPipelineStageFlags srcStageMask,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005322 VkPipelineStageFlags dstStageMask,
5323 u32 memoryBarrierCount,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005324 const VkMemoryBarrier* pMemoryBarriers,
5325 u32 bufferMemoryBarrierCount,
5326 const VkBufferMemoryBarrier* pBufferMemoryBarriers,
5327 u32 imageMemoryBarrierCount,
5328 const VkImageMemoryBarrier* pImageMemoryBarriers) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005329 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005330
5331 events := pEvents[0:eventCount]
5332 for i in (0 .. eventCount) {
5333 event := events[i]
5334 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005335 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005336 }
5337
Jesse Hall3dd678a2016-01-08 21:52:01 -08005338 memoryBarriers := pMemoryBarriers[0:memoryBarrierCount]
Jesse Hall3fbc8562015-11-29 22:10:52 -08005339 for i in (0 .. memoryBarrierCount) {
Jesse Hall3dd678a2016-01-08 21:52:01 -08005340 memoryBarrier := memoryBarriers[i]
5341 }
5342 bufferMemoryBarriers := pBufferMemoryBarriers[0:bufferMemoryBarrierCount]
5343 for i in (0 .. bufferMemoryBarrierCount) {
5344 bufferMemoryBarrier := bufferMemoryBarriers[i]
5345 bufferObject := GetBuffer(bufferMemoryBarrier.buffer)
5346 assert(bufferObject.device == commandBufferObject.device)
5347 }
5348 imageMemoryBarriers := pImageMemoryBarriers[0:imageMemoryBarrierCount]
5349 for i in (0 .. imageMemoryBarrierCount) {
5350 imageMemoryBarrier := imageMemoryBarriers[i]
5351 imageObject := GetImage(imageMemoryBarrier.image)
5352 assert(imageObject.device == commandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005353 }
5354}
5355
5356@threadSafety("app")
5357cmd void vkCmdPipelineBarrier(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005358 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005359 VkPipelineStageFlags srcStageMask,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005360 VkPipelineStageFlags dstStageMask,
Jesse Halldc6d36c2015-11-29 19:12:15 -08005361 VkDependencyFlags dependencyFlags,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005362 u32 memoryBarrierCount,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005363 const VkMemoryBarrier* pMemoryBarriers,
5364 u32 bufferMemoryBarrierCount,
5365 const VkBufferMemoryBarrier* pBufferMemoryBarriers,
5366 u32 imageMemoryBarrierCount,
5367 const VkImageMemoryBarrier* pImageMemoryBarriers) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005368 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005369
Jesse Hall3dd678a2016-01-08 21:52:01 -08005370 memoryBarriers := pMemoryBarriers[0:memoryBarrierCount]
Jesse Hall3fbc8562015-11-29 22:10:52 -08005371 for i in (0 .. memoryBarrierCount) {
Jesse Hall3dd678a2016-01-08 21:52:01 -08005372 memoryBarrier := memoryBarriers[i]
5373 }
5374 bufferMemoryBarriers := pBufferMemoryBarriers[0:bufferMemoryBarrierCount]
5375 for i in (0 .. bufferMemoryBarrierCount) {
5376 bufferMemoryBarrier := bufferMemoryBarriers[i]
5377 bufferObject := GetBuffer(bufferMemoryBarrier.buffer)
5378 assert(bufferObject.device == commandBufferObject.device)
5379 }
5380 imageMemoryBarriers := pImageMemoryBarriers[0:imageMemoryBarrierCount]
5381 for i in (0 .. imageMemoryBarrierCount) {
5382 imageMemoryBarrier := imageMemoryBarriers[i]
5383 imageObject := GetImage(imageMemoryBarrier.image)
5384 assert(imageObject.device == commandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005385 }
5386}
5387
5388@threadSafety("app")
5389cmd void vkCmdBeginQuery(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005390 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005391 VkQueryPool queryPool,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005392 u32 query,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005393 VkQueryControlFlags flags) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005394 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005395 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005396 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005397}
5398
5399@threadSafety("app")
5400cmd void vkCmdEndQuery(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005401 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005402 VkQueryPool queryPool,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005403 u32 query) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005404 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005405 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005406 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005407}
5408
5409@threadSafety("app")
5410cmd void vkCmdResetQueryPool(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005411 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005412 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005413 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005414 u32 queryCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005415 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005416 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005417 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005418}
5419
5420@threadSafety("app")
5421cmd void vkCmdWriteTimestamp(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005422 VkCommandBuffer commandBuffer,
Jesse Hall6f39a6d2015-11-24 11:08:36 -08005423 VkPipelineStageFlagBits pipelineStage,
Jesse Halla3a7a1d2015-11-24 11:37:23 -08005424 VkQueryPool queryPool,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005425 u32 query) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005426 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halla3a7a1d2015-11-24 11:37:23 -08005427 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005428 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005429}
5430
5431@threadSafety("app")
5432cmd void vkCmdCopyQueryPoolResults(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005433 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005434 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005435 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005436 u32 queryCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005437 VkBuffer dstBuffer,
5438 VkDeviceSize dstOffset,
Jesse Halla9bb62b2015-11-21 19:31:56 -08005439 VkDeviceSize stride,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005440 VkQueryResultFlags flags) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005441 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005442 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005443 dstBufferObject := GetBuffer(dstBuffer)
5444 assert(commandBufferObject.device == queryPoolObject.device)
5445 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005446}
5447
5448cmd void vkCmdPushConstants(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005449 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005450 VkPipelineLayout layout,
5451 VkShaderStageFlags stageFlags,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005452 u32 offset,
5453 u32 size,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08005454 const void* pValues) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005455 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005456 layoutObject := GetPipelineLayout(layout)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005457 assert(commandBufferObject.device == layoutObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005458}
5459
5460@threadSafety("app")
5461cmd void vkCmdBeginRenderPass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005462 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005463 const VkRenderPassBeginInfo* pRenderPassBegin,
Jesse Hall65ab5522015-11-30 00:07:16 -08005464 VkSubpassContents contents) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005465 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005466 renderPassObject := GetRenderPass(pRenderPassBegin.renderPass)
5467 framebufferObject := GetFramebuffer(pRenderPassBegin.framebuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005468 assert(commandBufferObject.device == renderPassObject.device)
5469 assert(commandBufferObject.device == framebufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005470
Jesse Hall3fbc8562015-11-29 22:10:52 -08005471 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005472}
5473
5474cmd void vkCmdNextSubpass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005475 VkCommandBuffer commandBuffer,
Jesse Hall65ab5522015-11-30 00:07:16 -08005476 VkSubpassContents contents) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005477 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005478}
5479
5480@threadSafety("app")
5481cmd void vkCmdEndRenderPass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005482 VkCommandBuffer commandBuffer) {
5483 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005484
Jesse Hall3fbc8562015-11-29 22:10:52 -08005485 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005486}
5487
5488cmd void vkCmdExecuteCommands(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005489 VkCommandBuffer commandBuffer,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005490 u32 commandBufferCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005491 const VkCommandBuffer* pCommandBuffers) {
5492 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005493
Jesse Hall3dd678a2016-01-08 21:52:01 -08005494 commandBuffers := pCommandBuffers[0:commandBufferCount]
5495 for i in (0 .. commandBufferCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005496 secondaryCommandBuffer := commandBuffers[i]
5497 secondaryCommandBufferObject := GetCommandBuffer(secondaryCommandBuffer)
5498 assert(commandBufferObject.device == secondaryCommandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005499 }
5500}
5501
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005502@extension("VK_KHR_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005503cmd void vkDestroySurfaceKHR(
5504 VkInstance instance,
Jesse Hall0e74f002015-11-30 11:37:59 -08005505 VkSurfaceKHR surface,
5506 const VkAllocationCallbacks* pAllocator) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005507 instanceObject := GetInstance(instance)
5508 surfaceObject := GetSurface(surface)
5509 assert(surfaceObject.instance == instance)
Michael Lentine88594d72015-11-12 12:49:45 -08005510
Jesse Hall1356b0d2015-11-23 17:24:58 -08005511 State.Surfaces[surface] = null
Jesse Hall2818f932015-11-19 21:19:17 -08005512}
5513
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005514@extension("VK_KHR_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005515cmd VkResult vkGetPhysicalDeviceSurfaceSupportKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005516 VkPhysicalDevice physicalDevice,
5517 u32 queueFamilyIndex,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005518 VkSurfaceKHR surface,
Jesse Hallb00daad2015-11-29 19:46:20 -08005519 VkBool32* pSupported) {
5520 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08005521
5522 return ?
5523}
5524
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005525@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08005526cmd VkResult vkGetPhysicalDeviceSurfaceCapabilitiesKHR(
5527 VkPhysicalDevice physicalDevice,
5528 VkSurfaceKHR surface,
5529 VkSurfaceCapabilitiesKHR* pSurfaceCapabilities) {
5530 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5531
5532 surfaceCapabilities := ?
5533 pSurfaceCapabilities[0] = surfaceCapabilities
5534
5535 return ?
5536}
5537
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005538@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08005539cmd VkResult vkGetPhysicalDeviceSurfaceFormatsKHR(
5540 VkPhysicalDevice physicalDevice,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005541 VkSurfaceKHR surface,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005542 u32* pSurfaceFormatCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005543 VkSurfaceFormatKHR* pSurfaceFormats) {
Jesse Hallb00daad2015-11-29 19:46:20 -08005544 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08005545
5546 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08005547 pSurfaceFormatCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08005548 surfaceFormats := pSurfaceFormats[0:count]
5549
5550 for i in (0 .. count) {
5551 surfaceFormat := ?
5552 surfaceFormats[i] = surfaceFormat
5553 }
5554
5555 return ?
5556}
5557
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005558@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08005559cmd VkResult vkGetPhysicalDeviceSurfacePresentModesKHR(
5560 VkPhysicalDevice physicalDevice,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005561 VkSurfaceKHR surface,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005562 u32* pPresentModeCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005563 VkPresentModeKHR* pPresentModes) {
Jesse Hallb00daad2015-11-29 19:46:20 -08005564 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08005565
5566 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08005567 pPresentModeCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08005568 presentModes := pPresentModes[0:count]
5569
5570 for i in (0 .. count) {
5571 presentMode := ?
5572 presentModes[i] = presentMode
5573 }
5574
5575 return ?
5576}
5577
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005578@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005579cmd VkResult vkCreateSwapchainKHR(
5580 VkDevice device,
5581 const VkSwapchainCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005582 const VkAllocationCallbacks* pAllocator,
Michael Lentine88594d72015-11-12 12:49:45 -08005583 VkSwapchainKHR* pSwapchain) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005584 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR)
Michael Lentine88594d72015-11-12 12:49:45 -08005585 deviceObject := GetDevice(device)
5586
5587 swapchain := ?
5588 pSwapchain[0] = swapchain
5589 State.Swapchains[swapchain] = new!SwapchainObject(device: device)
5590
5591 return ?
5592}
5593
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005594@extension("VK_KHR_swapchain")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005595cmd void vkDestroySwapchainKHR(
Michael Lentine88594d72015-11-12 12:49:45 -08005596 VkDevice device,
Jesse Hall0e74f002015-11-30 11:37:59 -08005597 VkSwapchainKHR swapchain,
5598 const VkAllocationCallbacks* pAllocator) {
Michael Lentine88594d72015-11-12 12:49:45 -08005599 deviceObject := GetDevice(device)
5600 swapchainObject := GetSwapchain(swapchain)
5601 assert(swapchainObject.device == device)
5602
5603 State.Swapchains[swapchain] = null
Michael Lentine88594d72015-11-12 12:49:45 -08005604}
5605
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005606@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005607cmd VkResult vkGetSwapchainImagesKHR(
5608 VkDevice device,
5609 VkSwapchainKHR swapchain,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005610 u32* pSwapchainImageCount,
Michael Lentine88594d72015-11-12 12:49:45 -08005611 VkImage* pSwapchainImages) {
5612 deviceObject := GetDevice(device)
5613
5614 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08005615 pSwapchainImageCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08005616 swapchainImages := pSwapchainImages[0:count]
5617
5618 for i in (0 .. count) {
5619 swapchainImage := ?
5620 swapchainImages[i] = swapchainImage
Jesse Hall1356b0d2015-11-23 17:24:58 -08005621 State.Images[swapchainImage] = new!ImageObject(device: device)
Michael Lentine88594d72015-11-12 12:49:45 -08005622 }
5623
5624 return ?
5625}
5626
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005627@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005628cmd VkResult vkAcquireNextImageKHR(
5629 VkDevice device,
5630 VkSwapchainKHR swapchain,
5631 u64 timeout,
5632 VkSemaphore semaphore,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005633 VkFence fence,
Michael Lentine88594d72015-11-12 12:49:45 -08005634 u32* pImageIndex) {
5635 deviceObject := GetDevice(device)
5636 swapchainObject := GetSwapchain(swapchain)
5637
5638 imageIndex := ?
5639 pImageIndex[0] = imageIndex
5640
5641 return ?
5642}
5643
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005644@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005645cmd VkResult vkQueuePresentKHR(
5646 VkQueue queue,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08005647 const VkPresentInfoKHR* pPresentInfo) {
Michael Lentine88594d72015-11-12 12:49:45 -08005648 queueObject := GetQueue(queue)
5649
5650 presentInfo := ?
5651 pPresentInfo[0] = presentInfo
5652
5653 return ?
5654}
5655
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005656@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005657cmd VkResult vkGetPhysicalDeviceDisplayPropertiesKHR(
5658 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005659 u32* pPropertyCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005660 VkDisplayPropertiesKHR* pProperties) {
5661 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5662 return ?
5663}
5664
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005665@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005666cmd VkResult vkGetPhysicalDeviceDisplayPlanePropertiesKHR(
5667 VkPhysicalDevice physicalDevice,
5668 u32* pPropertyCount,
5669 VkDisplayPlanePropertiesKHR* pProperties) {
5670 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5671 return ?
5672}
5673
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005674@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005675cmd VkResult vkGetDisplayPlaneSupportedDisplaysKHR(
5676 VkPhysicalDevice physicalDevice,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005677 u32 planeIndex,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08005678 u32* pDisplayCount,
5679 VkDisplayKHR* pDisplays) {
Jesse Halla6429252015-11-29 18:59:42 -08005680 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5681 return ?
5682}
5683
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005684@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005685cmd VkResult vkGetDisplayModePropertiesKHR(
5686 VkPhysicalDevice physicalDevice,
5687 VkDisplayKHR display,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005688 u32* pPropertyCount,
5689 VkDisplayModePropertiesKHR* pProperties) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005690 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5691 return ?
5692}
5693
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005694@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005695cmd VkResult vkCreateDisplayModeKHR(
5696 VkPhysicalDevice physicalDevice,
5697 VkDisplayKHR display,
5698 const VkDisplayModeCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005699 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005700 VkDisplayModeKHR* pMode) {
5701 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5702 return ?
5703}
5704
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005705@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005706cmd VkResult vkGetDisplayPlaneCapabilitiesKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005707 VkPhysicalDevice physicalDevice,
Jesse Hall9ba8bc82015-11-30 16:22:16 -08005708 VkDisplayModeKHR mode,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005709 u32 planeIndex,
Jesse Halla6429252015-11-29 18:59:42 -08005710 VkDisplayPlaneCapabilitiesKHR* pCapabilities) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005711 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5712 return ?
5713}
5714
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005715@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005716cmd VkResult vkCreateDisplayPlaneSurfaceKHR(
5717 VkInstance instance,
5718 const VkDisplaySurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005719 const VkAllocationCallbacks* pAllocator,
Jesse Halla6429252015-11-29 18:59:42 -08005720 VkSurfaceKHR* pSurface) {
5721 return ?
5722}
5723
Jesse Hall9ba8bc82015-11-30 16:22:16 -08005724@extension("VK_KHR_display_swapchain")
5725cmd VkResult vkCreateSharedSwapchainsKHR(
5726 VkDevice device,
5727 u32 swapchainCount,
5728 const VkSwapchainCreateInfoKHR* pCreateInfos,
5729 const VkAllocationCallbacks* pAllocator,
5730 VkSwapchainKHR* pSwapchains) {
5731 return ?
5732}
5733
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005734@extension("VK_KHR_xlib_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005735cmd VkResult vkCreateXlibSurfaceKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005736 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005737 const VkXlibSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005738 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005739 VkSurfaceKHR* pSurface) {
5740 instanceObject := GetInstance(instance)
5741 return ?
5742}
5743
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005744@extension("VK_KHR_xlib_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005745cmd VkBool32 vkGetPhysicalDeviceXlibPresentationSupportKHR(
5746 VkPhysicalDevice physicalDevice,
5747 u32 queueFamilyIndex,
5748 platform.Display* dpy,
Jesse Hall65ab5522015-11-30 00:07:16 -08005749 platform.VisualID visualID) {
Jesse Halla6429252015-11-29 18:59:42 -08005750 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5751 return ?
5752}
5753
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005754@extension("VK_KHR_xcb_surface")
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005755cmd VkResult vkCreateXcbSurfaceKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005756 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005757 const VkXcbSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005758 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005759 VkSurfaceKHR* pSurface) {
5760 instanceObject := GetInstance(instance)
5761 return ?
5762}
5763
Jesse Hall523db342015-11-30 21:12:55 -08005764@extension("VK_KHR_xcb_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005765cmd VkBool32 vkGetPhysicalDeviceXcbPresentationSupportKHR(
5766 VkPhysicalDevice physicalDevice,
5767 u32 queueFamilyIndex,
5768 platform.xcb_connection_t* connection,
5769 platform.xcb_visualid_t visual_id) {
5770 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5771 return ?
5772}
5773
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005774@extension("VK_KHR_wayland_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005775cmd VkResult vkCreateWaylandSurfaceKHR(
5776 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005777 const VkWaylandSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005778 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005779 VkSurfaceKHR* pSurface) {
5780 instanceObject := GetInstance(instance)
5781 return ?
5782}
5783
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005784@extension("VK_KHR_wayland_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005785cmd VkBool32 vkGetPhysicalDeviceWaylandPresentationSupportKHR(
5786 VkPhysicalDevice physicalDevice,
5787 u32 queueFamilyIndex,
5788 platform.wl_display* display) {
5789 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5790 return ?
5791}
5792
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005793@extension("VK_KHR_mir_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005794cmd VkResult vkCreateMirSurfaceKHR(
5795 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005796 const VkMirSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005797 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005798 VkSurfaceKHR* pSurface) {
5799 instanceObject := GetInstance(instance)
5800 return ?
5801}
5802
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005803@extension("VK_KHR_mir_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005804cmd VkBool32 vkGetPhysicalDeviceMirPresentationSupportKHR(
5805 VkPhysicalDevice physicalDevice,
5806 u32 queueFamilyIndex,
5807 platform.MirConnection* connection) {
5808 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5809 return ?
5810}
5811
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005812@extension("VK_KHR_android_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005813cmd VkResult vkCreateAndroidSurfaceKHR(
5814 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005815 const VkAndroidSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005816 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005817 VkSurfaceKHR* pSurface) {
5818 instanceObject := GetInstance(instance)
5819 return ?
5820}
5821
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005822@extension("VK_KHR_win32_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005823cmd VkResult vkCreateWin32SurfaceKHR(
5824 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005825 const VkWin32SurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005826 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005827 VkSurfaceKHR* pSurface) {
5828 instanceObject := GetInstance(instance)
5829 return ?
5830}
5831
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005832@extension("VK_KHR_win32_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005833cmd VkResult vkGetPhysicalDeviceWin32PresentationSupportKHR(
5834 VkPhysicalDevice physicalDevice,
5835 u32 queueFamilyIndex) {
Jesse Halle2948d82016-02-25 04:19:32 -08005836 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Jesse Halla6429252015-11-29 18:59:42 -08005837 return ?
5838}
5839
Chia-I Wub262ddc2016-03-22 07:38:20 +08005840@extension("VK_ANDROID_native_buffer")
Jesse Halld1abd742017-02-09 21:45:51 -08005841@optional
Chia-I Wub262ddc2016-03-22 07:38:20 +08005842cmd VkResult vkGetSwapchainGrallocUsageANDROID(
5843 VkDevice device,
5844 VkFormat format,
5845 VkImageUsageFlags imageUsage,
Jesse Halld1abd742017-02-09 21:45:51 -08005846 s32* grallocUsage) {
Chia-I Wub262ddc2016-03-22 07:38:20 +08005847 return ?
5848}
5849
5850@extension("VK_ANDROID_native_buffer")
Jesse Halld1abd742017-02-09 21:45:51 -08005851@optional
Chris Forbes8e4438b2016-12-07 16:26:49 +13005852cmd VkResult vkGetSwapchainGrallocUsage2ANDROID(
5853 VkDevice device,
5854 VkFormat format,
5855 VkImageUsageFlags imageUsage,
5856 VkSwapchainImageUsageFlagsANDROID swapchainImageUsage,
Jesse Halld1abd742017-02-09 21:45:51 -08005857 u64* grallocConsumerUsage,
5858 u64* grallocProducerUsage) {
Chris Forbes8e4438b2016-12-07 16:26:49 +13005859 return ?
5860}
5861
5862@extension("VK_ANDROID_native_buffer")
Chia-I Wub262ddc2016-03-22 07:38:20 +08005863cmd VkResult vkAcquireImageANDROID(
5864 VkDevice device,
5865 VkImage image,
5866 int nativeFenceFd,
5867 VkSemaphore semaphore,
5868 VkFence fence) {
5869 return ?
5870}
5871
5872@extension("VK_ANDROID_native_buffer")
5873cmd VkResult vkQueueSignalReleaseImageANDROID(
5874 VkQueue queue,
5875 u32 waitSemaphoreCount,
5876 const VkSemaphore* pWaitSemaphores,
5877 VkImage image,
5878 int* pNativeFenceFd) {
5879 return ?
5880}
5881
Ian Elliott4c8bb2a2016-12-29 11:07:26 -07005882@extension("VK_GOOGLE_display_timing")
5883cmd VkResult vkGetRefreshCycleDurationGOOGLE(
5884 VkDevice device,
5885 VkSwapchainKHR swapchain,
5886 VkRefreshCycleDurationGOOGLE* pDisplayTimingProperties) {
5887 deviceObject := GetDevice(device)
5888 swapchainObject := GetSwapchain(swapchain)
5889
5890 displayTimingProperties := ?
5891 pDisplayTimingProperties[0] = displayTimingProperties
5892
5893 return ?
5894}
5895
5896@extension("VK_GOOGLE_display_timing")
5897cmd VkResult vkGetPastPresentationTimingGOOGLE(
5898 VkDevice device,
5899 VkSwapchainKHR swapchain,
5900 u32* pPresentationTimingCount,
5901 VkPastPresentationTimingGOOGLE* pPresentationTimings) {
Ian Elliott4c8bb2a2016-12-29 11:07:26 -07005902 return ?
5903}
5904
Jesse Hall715b86a2016-01-16 16:34:29 -08005905@extension("VK_EXT_debug_report")
5906@external type void* PFN_vkDebugReportCallbackEXT
5907@extension("VK_EXT_debug_report")
5908@pfn cmd VkBool32 vkDebugReportCallbackEXT(
5909 VkDebugReportFlagsEXT flags,
5910 VkDebugReportObjectTypeEXT objectType,
5911 u64 object,
5912 platform.size_t location,
5913 s32 messageCode,
5914 const char* pLayerPrefix,
5915 const char* pMessage,
5916 void* pUserData) {
5917 return ?
5918}
5919
5920@extension("VK_EXT_debug_report")
5921cmd VkResult vkCreateDebugReportCallbackEXT(
5922 VkInstance instance,
5923 const VkDebugReportCallbackCreateInfoEXT* pCreateInfo,
5924 const VkAllocationCallbacks* pAllocator,
5925 VkDebugReportCallbackEXT* pCallback) {
5926 return ?
5927}
5928
5929@extension("VK_EXT_debug_report")
5930cmd void vkDestroyDebugReportCallbackEXT(
5931 VkInstance instance,
5932 VkDebugReportCallbackEXT callback,
5933 const VkAllocationCallbacks* pAllocator) {
5934}
5935
5936@extension("VK_EXT_debug_report")
5937cmd void vkDebugReportMessageEXT(
5938 VkInstance instance,
5939 VkDebugReportFlagsEXT flags,
5940 VkDebugReportObjectTypeEXT objectType,
5941 u64 object,
5942 platform.size_t location,
5943 s32 messageCode,
5944 const char* pLayerPrefix,
5945 const char* pMessage) {
5946}
5947
Jesse Hall26763382016-05-20 07:13:52 -07005948@extension("VK_EXT_debug_marker")
5949cmd VkResult vkDebugMarkerSetObjectTagEXT(
5950 VkDevice device,
5951 VkDebugMarkerObjectTagInfoEXT* pTagInfo) {
5952 return ?
5953}
5954
5955@extension("VK_EXT_debug_marker")
5956cmd VkResult vkDebugMarkerSetObjectNameEXT(
5957 VkDevice device,
5958 VkDebugMarkerObjectNameInfoEXT* pNameInfo) {
5959 return ?
5960}
5961
5962@extension("VK_EXT_debug_marker")
5963cmd void vkCmdDebugMarkerBeginEXT(
5964 VkCommandBuffer commandBuffer,
5965 VkDebugMarkerMarkerInfoEXT* pMarkerInfo) {
5966}
5967
5968@extension("VK_EXT_debug_marker")
5969cmd void vkCmdDebugMarkerEndEXT(
5970 VkCommandBuffer commandBuffer) {
5971}
5972
5973@extension("VK_EXT_debug_marker")
5974cmd void vkCmdDebugMarkerInsertEXT(
5975 VkCommandBuffer commandBuffer,
5976 VkDebugMarkerMarkerInfoEXT* pMarkerInfo) {
5977}
5978
Jesse Halleb02c472017-02-24 15:13:45 -08005979@extension("VK_AMD_draw_indirect_count")
5980cmd void vkCmdDrawIndirectCountAMD(
5981 VkCommandBuffer commandBuffer,
5982 VkBuffer buffer,
5983 VkDeviceSize offset,
5984 VkBuffer countBuffer,
5985 VkDeviceSize countBufferOffset,
5986 u32 maxDrawCount,
5987 u32 stride) {
5988}
5989
5990@extension("VK_AMD_draw_indirect_count")
5991cmd void vkCmdDrawIndexedIndirectCountAMD(
5992 VkCommandBuffer commandBuffer,
5993 VkBuffer buffer,
5994 VkDeviceSize offset,
5995 VkBuffer countBuffer,
5996 VkDeviceSize countBufferOffset,
5997 u32 maxDrawCount,
5998 u32 stride) {
5999}
6000
6001@extension("VK_NV_external_memory_capabilities")
6002cmd VkResult vkGetPhysicalDeviceExternalImageFormatPropertiesNV(
6003 VkPhysicalDevice physicalDevice,
6004 VkFormat format,
6005 VkImageType type,
6006 VkImageTiling tiling,
6007 VkImageUsageFlags usage,
6008 VkImageCreateFlags flags,
6009 VkExternalMemoryHandleTypeFlagsNV externalHandleType,
6010 VkExternalImageFormatPropertiesNV* pExternalImageFormatProperties) {
6011 return ?
6012}
6013
6014@extension("VK_NV_external_memory_win32")
6015cmd VkResult vkGetMemoryWin32HandleNV(
6016 VkDevice device,
6017 VkDeviceMemory memory,
6018 VkExternalMemoryHandleTypeFlagsNV handleType,
6019 platform.HANDLE* pHandle) {
6020 return ?
6021}
6022
Chris Forbes1194ede2016-12-30 16:29:25 +13006023@extension("VK_KHR_get_physical_device_properties2")
6024cmd void vkGetPhysicalDeviceFeatures2KHR(
6025 VkPhysicalDevice physicalDevice,
6026 VkPhysicalDeviceFeatures2KHR* pFeatures) {
6027}
6028
6029@extension("VK_KHR_get_physical_device_properties2")
6030cmd void vkGetPhysicalDeviceProperties2KHR(
6031 VkPhysicalDevice physicalDevice,
6032 VkPhysicalDeviceProperties2KHR* pProperties) {
6033}
6034
6035@extension("VK_KHR_get_physical_device_properties2")
6036cmd void vkGetPhysicalDeviceFormatProperties2KHR(
6037 VkPhysicalDevice physicalDevice,
6038 VkFormat format,
6039 VkFormatProperties2KHR* pFormatProperties) {
6040}
6041
6042@extension("VK_KHR_get_physical_device_properties2")
6043cmd VkResult vkGetPhysicalDeviceImageFormatProperties2KHR(
6044 VkPhysicalDevice physicalDevice,
6045 const VkPhysicalDeviceImageFormatInfo2KHR* pImageFormatInfo,
6046 VkImageFormatProperties2KHR* pImageFormatProperties) {
6047 return ?
6048}
6049
6050@extension("VK_KHR_get_physical_device_properties2")
6051cmd void vkGetPhysicalDeviceQueueFamilyProperties2KHR(
6052 VkPhysicalDevice physicalDevice,
6053 u32* pQueueFamilyPropertyCount,
6054 VkQueueFamilyProperties2KHR* pQueueFamilyProperties) {
6055}
6056
6057@extension("VK_KHR_get_physical_device_properties2")
6058cmd void vkGetPhysicalDeviceMemoryProperties2KHR(
6059 VkPhysicalDevice physicalDevice,
6060 VkPhysicalDeviceMemoryProperties2KHR* pMemoryProperties) {
6061}
6062
6063@extension("VK_KHR_get_physical_device_properties2")
6064cmd void vkGetPhysicalDeviceSparseImageFormatProperties2KHR(
6065 VkPhysicalDevice physicalDevice,
6066 const VkPhysicalDeviceSparseImageFormatInfo2KHR* pFormatInfo,
6067 u32* pPropertyCount,
6068 VkSparseImageFormatProperties2KHR* pProperties) {
6069}
6070
Jesse Halleb02c472017-02-24 15:13:45 -08006071@extension("VK_NVX_device_generated_commands")
6072cmd void vkCmdProcessCommandsNVX(
Chris Forbes289cb792016-12-30 15:03:55 +13006073 VkCommandBuffer commandBuffer,
6074 const VkCmdProcessCommandsInfoNVX* pProcessCommandsInfo) {
6075}
6076
Jesse Halleb02c472017-02-24 15:13:45 -08006077@extension("VK_NVX_device_generated_commands")
6078cmd void vkCmdReserveSpaceForCommandsNVX(
Chris Forbes289cb792016-12-30 15:03:55 +13006079 VkCommandBuffer commandBuffer,
6080 const VkCmdReserveSpaceForCommandsInfoNVX* pReserveSpaceInfo) {
6081}
6082
Jesse Halleb02c472017-02-24 15:13:45 -08006083@extension("VK_NVX_device_generated_commands")
6084cmd VkResult vkCreateIndirectCommandsLayoutNVX(
Chris Forbes289cb792016-12-30 15:03:55 +13006085 VkDevice device,
6086 const VkIndirectCommandsLayoutCreateInfoNVX* pCreateInfo,
6087 const VkAllocationCallbacks* pAllocator,
6088 VkIndirectCommandsLayoutNVX* pIndirectCommandsLayout) {
6089 return ?
6090}
6091
Jesse Halleb02c472017-02-24 15:13:45 -08006092@extension("VK_NVX_device_generated_commands")
6093cmd void vkDestroyIndirectCommandsLayoutNVX(
Chris Forbes289cb792016-12-30 15:03:55 +13006094 VkDevice device,
6095 VkIndirectCommandsLayoutNVX indirectCommandsLayout,
6096 const VkAllocationCallbacks* pAllocator) {
6097}
6098
Jesse Halleb02c472017-02-24 15:13:45 -08006099@extension("VK_NVX_device_generated_commands")
6100cmd VkResult vkCreateObjectTableNVX(
Chris Forbes289cb792016-12-30 15:03:55 +13006101 VkDevice device,
6102 const VkObjectTableCreateInfoNVX* pCreateInfo,
6103 const VkAllocationCallbacks* pAllocator,
6104 VkObjectTableNVX* pObjectTable) {
6105 return ?
6106}
6107
Jesse Halleb02c472017-02-24 15:13:45 -08006108@extension("VK_NVX_device_generated_commands")
6109cmd void vkDestroyObjectTableNVX(
Chris Forbes289cb792016-12-30 15:03:55 +13006110 VkDevice device,
6111 VkObjectTableNVX objectTable,
6112 const VkAllocationCallbacks* pAllocator) {
6113}
6114
Jesse Halleb02c472017-02-24 15:13:45 -08006115@extension("VK_NVX_device_generated_commands")
6116cmd VkResult vkRegisterObjectsNVX(
Chris Forbes289cb792016-12-30 15:03:55 +13006117 VkDevice device,
6118 VkObjectTableNVX objectTable,
6119 u32 objectCount,
6120 const VkObjectTableEntryNVX* const* ppObjectTableEntries,
6121 const u32* pObjectIndices) {
6122 return ?
6123}
6124
Jesse Halleb02c472017-02-24 15:13:45 -08006125@extension("VK_NVX_device_generated_commands")
6126cmd VkResult vkUnregisterObjectsNVX(
Chris Forbes289cb792016-12-30 15:03:55 +13006127 VkDevice device,
6128 VkObjectTableNVX objectTable,
6129 u32 objectCount,
6130 const VkObjectEntryTypeNVX* pObjectEntryTypes,
6131 const u32* pObjectIndices) {
6132 return ?
6133}
6134
Jesse Halleb02c472017-02-24 15:13:45 -08006135@extension("VK_NVX_device_generated_commands")
6136cmd void vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX(
Chris Forbes289cb792016-12-30 15:03:55 +13006137 VkPhysicalDevice physicalDevice,
6138 VkDeviceGeneratedCommandsFeaturesNVX* pFeatures,
6139 VkDeviceGeneratedCommandsLimitsNVX* pLimits) {
6140}
6141
Jesse Hall889cd9a2017-02-25 22:12:23 -08006142@extension("VK_EXT_hdr_metadata")
6143cmd void vkSetHdrMetadataEXT(
6144 VkDevice device,
6145 u32 swapchainCount,
6146 const VkSwapchainKHR* pSwapchains,
6147 const VkHdrMetadataEXT* pMetadata) {
6148}
6149
Chris Forbes1d5f68c2017-01-31 10:17:01 +13006150@extension("VK_KHR_shared_presentable_image")
Chris Forbes2e12cb82017-01-18 11:45:17 +13006151cmd VkResult vkGetSwapchainStatusKHR(
6152 VkDevice device,
6153 VkSwapchainKHR swapchain) {
6154 return ?
6155}
6156
Jesse Halld27f6aa2015-08-15 17:58:48 -07006157////////////////
6158// Validation //
6159////////////////
6160
6161extern void validate(string layerName, bool condition, string message)
6162
6163
6164/////////////////////////////
6165// Internal State Tracking //
6166/////////////////////////////
6167
6168StateObject State
6169
6170@internal class StateObject {
6171 // Dispatchable objects.
6172 map!(VkInstance, ref!InstanceObject) Instances
6173 map!(VkPhysicalDevice, ref!PhysicalDeviceObject) PhysicalDevices
6174 map!(VkDevice, ref!DeviceObject) Devices
6175 map!(VkQueue, ref!QueueObject) Queues
Jesse Hall3fbc8562015-11-29 22:10:52 -08006176 map!(VkCommandBuffer, ref!CommandBufferObject) CommandBuffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07006177
6178 // Non-dispatchable objects.
6179 map!(VkDeviceMemory, ref!DeviceMemoryObject) DeviceMemories
6180 map!(VkBuffer, ref!BufferObject) Buffers
6181 map!(VkBufferView, ref!BufferViewObject) BufferViews
6182 map!(VkImage, ref!ImageObject) Images
6183 map!(VkImageView, ref!ImageViewObject) ImageViews
Jesse Halld27f6aa2015-08-15 17:58:48 -07006184 map!(VkShaderModule, ref!ShaderModuleObject) ShaderModules
Jesse Halld27f6aa2015-08-15 17:58:48 -07006185 map!(VkPipeline, ref!PipelineObject) Pipelines
6186 map!(VkPipelineLayout, ref!PipelineLayoutObject) PipelineLayouts
6187 map!(VkSampler, ref!SamplerObject) Samplers
6188 map!(VkDescriptorSet, ref!DescriptorSetObject) DescriptorSets
6189 map!(VkDescriptorSetLayout, ref!DescriptorSetLayoutObject) DescriptorSetLayouts
6190 map!(VkDescriptorPool, ref!DescriptorPoolObject) DescriptorPools
Jesse Halld27f6aa2015-08-15 17:58:48 -07006191 map!(VkFence, ref!FenceObject) Fences
6192 map!(VkSemaphore, ref!SemaphoreObject) Semaphores
6193 map!(VkEvent, ref!EventObject) Events
6194 map!(VkQueryPool, ref!QueryPoolObject) QueryPools
6195 map!(VkFramebuffer, ref!FramebufferObject) Framebuffers
6196 map!(VkRenderPass, ref!RenderPassObject) RenderPasses
6197 map!(VkPipelineCache, ref!PipelineCacheObject) PipelineCaches
Jesse Hall3fbc8562015-11-29 22:10:52 -08006198 map!(VkCommandPool, ref!CommandPoolObject) CommandPools
Jesse Hall1356b0d2015-11-23 17:24:58 -08006199 map!(VkSurfaceKHR, ref!SurfaceObject) Surfaces
Michael Lentine88594d72015-11-12 12:49:45 -08006200 map!(VkSwapchainKHR, ref!SwapchainObject) Swapchains
Jesse Halld27f6aa2015-08-15 17:58:48 -07006201}
6202
6203@internal class InstanceObject {
6204}
6205
6206@internal class PhysicalDeviceObject {
6207 VkInstance instance
6208}
6209
6210@internal class DeviceObject {
6211 VkPhysicalDevice physicalDevice
6212}
6213
6214@internal class QueueObject {
6215 VkDevice device
6216 VkQueueFlags flags
6217}
6218
Jesse Hall3fbc8562015-11-29 22:10:52 -08006219@internal class CommandBufferObject {
Jesse Halld27f6aa2015-08-15 17:58:48 -07006220 VkDevice device
6221 map!(u64, VkDeviceMemory) boundObjects
6222 VkQueueFlags queueFlags
6223}
6224
6225@internal class DeviceMemoryObject {
Jesse Hall3fbc8562015-11-29 22:10:52 -08006226 VkDevice device
6227 VkDeviceSize allocationSize
6228 map!(u64, VkDeviceSize) boundObjects
6229 map!(VkCommandBuffer, VkCommandBuffer) boundCommandBuffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07006230}
6231
6232@internal class BufferObject {
6233 VkDevice device
Jesse Hall3fbc8562015-11-29 22:10:52 -08006234 VkDeviceMemory memory
6235 VkDeviceSize memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07006236}
6237
6238@internal class BufferViewObject {
6239 VkDevice device
6240 VkBuffer buffer
6241}
6242
6243@internal class ImageObject {
6244 VkDevice device
Jesse Hall3fbc8562015-11-29 22:10:52 -08006245 VkDeviceMemory memory
6246 VkDeviceSize memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07006247}
6248
6249@internal class ImageViewObject {
6250 VkDevice device
6251 VkImage image
6252}
6253
Jesse Halld27f6aa2015-08-15 17:58:48 -07006254@internal class ShaderObject {
6255 VkDevice device
6256}
6257
6258@internal class ShaderModuleObject {
6259 VkDevice device
6260}
6261
6262@internal class PipelineObject {
6263 VkDevice device
6264}
6265
6266@internal class PipelineLayoutObject {
6267 VkDevice device
6268}
6269
6270@internal class SamplerObject {
6271 VkDevice device
6272}
6273
6274@internal class DescriptorSetObject {
6275 VkDevice device
6276}
6277
6278@internal class DescriptorSetLayoutObject {
6279 VkDevice device
6280}
6281
6282@internal class DescriptorPoolObject {
6283 VkDevice device
6284}
6285
Jesse Halld27f6aa2015-08-15 17:58:48 -07006286@internal class FenceObject {
6287 VkDevice device
6288 bool signaled
6289}
6290
6291@internal class SemaphoreObject {
6292 VkDevice device
6293}
6294
6295@internal class EventObject {
6296 VkDevice device
6297}
6298
6299@internal class QueryPoolObject {
6300 VkDevice device
6301}
6302
6303@internal class FramebufferObject {
6304 VkDevice device
6305}
6306
6307@internal class RenderPassObject {
6308 VkDevice device
6309}
6310
6311@internal class PipelineCacheObject {
6312 VkDevice device
6313}
6314
Jesse Hall3fbc8562015-11-29 22:10:52 -08006315@internal class CommandPoolObject {
Jesse Halld27f6aa2015-08-15 17:58:48 -07006316 VkDevice device
6317}
6318
Jesse Hall1356b0d2015-11-23 17:24:58 -08006319@internal class SurfaceObject {
6320 VkInstance instance
6321}
6322
Michael Lentine88594d72015-11-12 12:49:45 -08006323@internal class SwapchainObject {
6324 VkDevice device
6325}
6326
Jesse Halld27f6aa2015-08-15 17:58:48 -07006327macro ref!InstanceObject GetInstance(VkInstance instance) {
6328 assert(instance in State.Instances)
6329 return State.Instances[instance]
6330}
6331
6332macro ref!PhysicalDeviceObject GetPhysicalDevice(VkPhysicalDevice physicalDevice) {
6333 assert(physicalDevice in State.PhysicalDevices)
6334 return State.PhysicalDevices[physicalDevice]
6335}
6336
6337macro ref!DeviceObject GetDevice(VkDevice device) {
6338 assert(device in State.Devices)
6339 return State.Devices[device]
6340}
6341
6342macro ref!QueueObject GetQueue(VkQueue queue) {
6343 assert(queue in State.Queues)
6344 return State.Queues[queue]
6345}
6346
Jesse Hall3fbc8562015-11-29 22:10:52 -08006347macro ref!CommandBufferObject GetCommandBuffer(VkCommandBuffer commandBuffer) {
6348 assert(commandBuffer in State.CommandBuffers)
6349 return State.CommandBuffers[commandBuffer]
Jesse Halld27f6aa2015-08-15 17:58:48 -07006350}
6351
Jesse Hall3fbc8562015-11-29 22:10:52 -08006352macro ref!DeviceMemoryObject GetDeviceMemory(VkDeviceMemory memory) {
6353 assert(memory in State.DeviceMemories)
6354 return State.DeviceMemories[memory]
Jesse Halld27f6aa2015-08-15 17:58:48 -07006355}
6356
6357macro ref!BufferObject GetBuffer(VkBuffer buffer) {
6358 assert(buffer in State.Buffers)
6359 return State.Buffers[buffer]
6360}
6361
6362macro ref!BufferViewObject GetBufferView(VkBufferView bufferView) {
6363 assert(bufferView in State.BufferViews)
6364 return State.BufferViews[bufferView]
6365}
6366
6367macro ref!ImageObject GetImage(VkImage image) {
6368 assert(image in State.Images)
6369 return State.Images[image]
6370}
6371
6372macro ref!ImageViewObject GetImageView(VkImageView imageView) {
6373 assert(imageView in State.ImageViews)
6374 return State.ImageViews[imageView]
6375}
6376
Jesse Halld27f6aa2015-08-15 17:58:48 -07006377macro ref!ShaderModuleObject GetShaderModule(VkShaderModule shaderModule) {
6378 assert(shaderModule in State.ShaderModules)
6379 return State.ShaderModules[shaderModule]
6380}
6381
6382macro ref!PipelineObject GetPipeline(VkPipeline pipeline) {
6383 assert(pipeline in State.Pipelines)
6384 return State.Pipelines[pipeline]
6385}
6386
6387macro ref!PipelineLayoutObject GetPipelineLayout(VkPipelineLayout pipelineLayout) {
6388 assert(pipelineLayout in State.PipelineLayouts)
6389 return State.PipelineLayouts[pipelineLayout]
6390}
6391
6392macro ref!SamplerObject GetSampler(VkSampler sampler) {
6393 assert(sampler in State.Samplers)
6394 return State.Samplers[sampler]
6395}
6396
6397macro ref!DescriptorSetObject GetDescriptorSet(VkDescriptorSet descriptorSet) {
6398 assert(descriptorSet in State.DescriptorSets)
6399 return State.DescriptorSets[descriptorSet]
6400}
6401
6402macro ref!DescriptorSetLayoutObject GetDescriptorSetLayout(VkDescriptorSetLayout descriptorSetLayout) {
6403 assert(descriptorSetLayout in State.DescriptorSetLayouts)
6404 return State.DescriptorSetLayouts[descriptorSetLayout]
6405}
6406
6407macro ref!DescriptorPoolObject GetDescriptorPool(VkDescriptorPool descriptorPool) {
6408 assert(descriptorPool in State.DescriptorPools)
6409 return State.DescriptorPools[descriptorPool]
6410}
6411
Jesse Halld27f6aa2015-08-15 17:58:48 -07006412macro ref!FenceObject GetFence(VkFence fence) {
6413 assert(fence in State.Fences)
6414 return State.Fences[fence]
6415}
6416
6417macro ref!SemaphoreObject GetSemaphore(VkSemaphore semaphore) {
6418 assert(semaphore in State.Semaphores)
6419 return State.Semaphores[semaphore]
6420}
6421
6422macro ref!EventObject GetEvent(VkEvent event) {
6423 assert(event in State.Events)
6424 return State.Events[event]
6425}
6426
6427macro ref!QueryPoolObject GetQueryPool(VkQueryPool queryPool) {
6428 assert(queryPool in State.QueryPools)
6429 return State.QueryPools[queryPool]
6430}
6431
6432macro ref!FramebufferObject GetFramebuffer(VkFramebuffer framebuffer) {
6433 assert(framebuffer in State.Framebuffers)
6434 return State.Framebuffers[framebuffer]
6435}
6436
6437macro ref!RenderPassObject GetRenderPass(VkRenderPass renderPass) {
6438 assert(renderPass in State.RenderPasses)
6439 return State.RenderPasses[renderPass]
6440}
6441
6442macro ref!PipelineCacheObject GetPipelineCache(VkPipelineCache pipelineCache) {
6443 assert(pipelineCache in State.PipelineCaches)
6444 return State.PipelineCaches[pipelineCache]
6445}
6446
Jesse Hall3fbc8562015-11-29 22:10:52 -08006447macro ref!CommandPoolObject GetCommandPool(VkCommandPool commandPool) {
6448 assert(commandPool in State.CommandPools)
6449 return State.CommandPools[commandPool]
Jesse Hallf09c6b12015-08-15 19:54:28 -07006450}
Michael Lentine88594d72015-11-12 12:49:45 -08006451
Jesse Hall1356b0d2015-11-23 17:24:58 -08006452macro ref!SurfaceObject GetSurface(VkSurfaceKHR surface) {
6453 assert(surface in State.Surfaces)
6454 return State.Surfaces[surface]
6455}
6456
Michael Lentine88594d72015-11-12 12:49:45 -08006457macro ref!SwapchainObject GetSwapchain(VkSwapchainKHR swapchain) {
6458 assert(swapchain in State.Swapchains)
6459 return State.Swapchains[swapchain]
6460}
Jesse Halld8bade02015-11-24 10:24:18 -08006461
6462macro VkQueueFlags AddQueueFlag(VkQueueFlags flags, VkQueueFlagBits bit) {
6463 return as!VkQueueFlags(as!u32(flags) | as!u32(bit))
6464}