blob: b1551e10e6a492d4bda116794f4c704882cb4375 [file] [log] [blame]
Jesse Halld27f6aa2015-08-15 17:58:48 -07001// Copyright (c) 2015 The Khronos Group Inc.
2//
3// Permission is hereby granted, free of charge, to any person obtaining a
4// copy of this software and/or associated documentation files (the
5// "Materials"), to deal in the Materials without restriction, including
6// without limitation the rights to use, copy, modify, merge, publish,
7// distribute, sublicense, and/or sell copies of the Materials, and to
8// permit persons to whom the Materials are furnished to do so, subject to
9// the following conditions:
10//
11// The above copyright notice and this permission notice shall be included
12// in all copies or substantial portions of the Materials.
13//
14// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20// MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
21
22import platform "platform.api"
23
24///////////////
25// Constants //
26///////////////
27
28// API version (major.minor.patch)
Jesse Hall3dd678a2016-01-08 21:52:01 -080029define VERSION_MAJOR 1
30define VERSION_MINOR 0
Jesse Hall99431972017-03-06 16:02:58 -080031define VERSION_PATCH 41
Jesse Halld27f6aa2015-08-15 17:58:48 -070032
33// API limits
Jesse Hall65ab5522015-11-30 00:07:16 -080034define VK_MAX_PHYSICAL_DEVICE_NAME_SIZE 256
35define VK_UUID_SIZE 16
36define VK_MAX_EXTENSION_NAME_SIZE 256
37define VK_MAX_DESCRIPTION_SIZE 256
38define VK_MAX_MEMORY_TYPES 32
39define VK_MAX_MEMORY_HEAPS 16 /// The maximum number of unique memory heaps, each of which supporting 1 or more memory types.
Jesse Halld27f6aa2015-08-15 17:58:48 -070040
41// API keywords
42define VK_TRUE 1
43define VK_FALSE 0
Jesse Hall5ae3abb2015-10-08 14:00:22 -070044
45// API keyword, but needs special handling by some templates
46define NULL_HANDLE 0
Jesse Halld27f6aa2015-08-15 17:58:48 -070047
Jesse Halleb02c472017-02-24 15:13:45 -080048// 1
Jesse Hall33faaad2016-01-24 21:00:49 -080049@extension("VK_KHR_surface") define VK_KHR_SURFACE_SPEC_VERSION 25
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080050@extension("VK_KHR_surface") define VK_KHR_SURFACE_EXTENSION_NAME "VK_KHR_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080051
Jesse Halleb02c472017-02-24 15:13:45 -080052// 2
Jesse Hall26763382016-05-20 07:13:52 -070053@extension("VK_KHR_swapchain") define VK_KHR_SWAPCHAIN_SPEC_VERSION 68
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080054@extension("VK_KHR_swapchain") define VK_KHR_SWAPCHAIN_EXTENSION_NAME "VK_KHR_swapchain"
Jesse Hall1356b0d2015-11-23 17:24:58 -080055
Jesse Halleb02c472017-02-24 15:13:45 -080056// 3
Jesse Hall543a7ff2016-01-08 16:38:30 -080057@extension("VK_KHR_display") define VK_KHR_DISPLAY_SPEC_VERSION 21
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080058@extension("VK_KHR_display") define VK_KHR_DISPLAY_EXTENSION_NAME "VK_KHR_display"
Jesse Hall1356b0d2015-11-23 17:24:58 -080059
Jesse Halleb02c472017-02-24 15:13:45 -080060// 4
Jesse Hall543a7ff2016-01-08 16:38:30 -080061@extension("VK_KHR_display_swapchain") define VK_KHR_DISPLAY_SWAPCHAIN_SPEC_VERSION 9
Jesse Hall0e74f002015-11-30 11:37:59 -080062@extension("VK_KHR_display_swapchain") define VK_KHR_DISPLAY_SWAPCHAIN_EXTENSION_NAME "VK_KHR_display_swapchain"
Jesse Hall1356b0d2015-11-23 17:24:58 -080063
Jesse Halleb02c472017-02-24 15:13:45 -080064// 5
Jesse Hall543a7ff2016-01-08 16:38:30 -080065@extension("VK_KHR_xlib_surface") define VK_KHR_XLIB_SURFACE_SPEC_VERSION 6
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080066@extension("VK_KHR_xlib_surface") define VK_KHR_XLIB_SURFACE_NAME "VK_KHR_xlib_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080067
Jesse Halleb02c472017-02-24 15:13:45 -080068// 6
Jesse Hall543a7ff2016-01-08 16:38:30 -080069@extension("VK_KHR_xcb_surface") define VK_KHR_XCB_SURFACE_SPEC_VERSION 6
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080070@extension("VK_KHR_xcb_surface") define VK_KHR_XCB_SURFACE_NAME "VK_KHR_xcb_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080071
Jesse Halleb02c472017-02-24 15:13:45 -080072// 7
Jesse Hall543a7ff2016-01-08 16:38:30 -080073@extension("VK_KHR_wayland_surface") define VK_KHR_WAYLAND_SURFACE_SPEC_VERSION 5
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080074@extension("VK_KHR_wayland_surface") define VK_KHR_WAYLAND_SURFACE_NAME "VK_KHR_wayland_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080075
Jesse Halleb02c472017-02-24 15:13:45 -080076// 8
Jesse Hall543a7ff2016-01-08 16:38:30 -080077@extension("VK_KHR_mir_surface") define VK_KHR_MIR_SURFACE_SPEC_VERSION 4
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080078@extension("VK_KHR_mir_surface") define VK_KHR_MIR_SURFACE_NAME "VK_KHR_mir_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080079
Jesse Halleb02c472017-02-24 15:13:45 -080080// 9
Jesse Hall33faaad2016-01-24 21:00:49 -080081@extension("VK_KHR_android_surface") define VK_KHR_ANDROID_SURFACE_SPEC_VERSION 6
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080082@extension("VK_KHR_android_surface") define VK_KHR_ANDROID_SURFACE_NAME "VK_KHR_android_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080083
Jesse Halleb02c472017-02-24 15:13:45 -080084// 10
Jesse Hall543a7ff2016-01-08 16:38:30 -080085@extension("VK_KHR_win32_surface") define VK_KHR_WIN32_SURFACE_SPEC_VERSION 5
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080086@extension("VK_KHR_win32_surface") define VK_KHR_WIN32_SURFACE_NAME "VK_KHR_win32_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080087
Jesse Halleb02c472017-02-24 15:13:45 -080088// 11
Chia-I Wub262ddc2016-03-22 07:38:20 +080089@extension("VK_ANDROID_native_buffer") define VK_ANDROID_NATIVE_BUFFER_SPEC_VERSION 5
90@extension("VK_ANDROID_native_buffer") define VK_ANDROID_NATIVE_BUFFER_NAME "VK_ANDROID_native_buffer"
91
Jesse Halleb02c472017-02-24 15:13:45 -080092// 12
Jesse Hall99431972017-03-06 16:02:58 -080093@extension("VK_EXT_debug_report") define VK_EXT_DEBUG_REPORT_SPEC_VERSION 5
Jesse Hall715b86a2016-01-16 16:34:29 -080094@extension("VK_EXT_debug_report") define VK_EXT_DEBUG_REPORT_NAME "VK_EXT_debug_report"
95
Jesse Halleb02c472017-02-24 15:13:45 -080096// 13
Jesse Hall26763382016-05-20 07:13:52 -070097@extension("VK_NV_glsl_shader") define VK_NV_GLSL_SHADER_SPEC_VERSION 1
98@extension("VK_NV_glsl_shader") define VK_NV_GLSL_SHADER_NAME "VK_NV_glsl_shader"
99
Jesse Halleb02c472017-02-24 15:13:45 -0800100// 15
Jesse Hall26763382016-05-20 07:13:52 -0700101@extension("VK_KHR_sampler_mirror_clamp_to_edge") define VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_SPEC_VERSION 1
102@extension("VK_KHR_sampler_mirror_clamp_to_edge") define VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_NAME "VK_KHR_sampler_mirror_clamp_to_edge"
103
Jesse Halleb02c472017-02-24 15:13:45 -0800104// 16
Jesse Hall26763382016-05-20 07:13:52 -0700105@extension("VK_IMG_filter_cubic") define VK_IMG_FILTER_CUBIC_SPEC_VERSION 1
106@extension("VK_IMG_filter_cubic") define VK_IMG_FILTER_CUBIC_NAME "VK_IMG_filter_cubic"
107
Jesse Halleb02c472017-02-24 15:13:45 -0800108// 19
Jesse Hall26763382016-05-20 07:13:52 -0700109@extension("VK_AMD_rasterization_order") define VK_AMD_RASTERIZATION_ORDER_SPEC_VERSION 1
110@extension("VK_AMD_rasterization_order") define VK_AMD_RASTERIZATION_ORDER_NAME "VK_AMD_rasterization_order"
111
Jesse Halleb02c472017-02-24 15:13:45 -0800112// 21
Jesse Hall3f5499b2016-07-26 15:20:40 -0700113@extension("VK_AMD_shader_trinary_minmax") define VK_AMD_SHADER_TRINARY_MINMAX_SPEC_VERSION 1
114@extension("VK_AMD_shader_trinary_minmax") define VK_AMD_SHADER_TRINARY_MINMAX_EXTENSION_NAME "VK_AMD_shader_trinary_minmax"
115
Jesse Halleb02c472017-02-24 15:13:45 -0800116// 22
Jesse Hall3f5499b2016-07-26 15:20:40 -0700117@extension("VK_AMD_shader_explicit_vertex_parameter") define VK_AMD_SHADER_EXPLICIT_VERTEX_PARAMETER_SPEC_VERSION 1
118@extension("VK_AMD_shader_explicit_vertex_parameter") define VK_AMD_SHADER_EXPLICIT_VERTEX_PARAMETER_EXTENSION_NAME "VK_AMD_shader_explicit_vertex_parameter"
119
Jesse Halleb02c472017-02-24 15:13:45 -0800120// 23
Jesse Hall99431972017-03-06 16:02:58 -0800121@extension("VK_EXT_debug_marker") define VK_EXT_DEBUG_MARKER_SPEC_VERSION 4
Jesse Hall26763382016-05-20 07:13:52 -0700122@extension("VK_EXT_debug_marker") define VK_EXT_DEBUG_MARKER_NAME "VK_EXT_debug_marker"
123
Jesse Halleb02c472017-02-24 15:13:45 -0800124// 26
Jesse Hall3f5499b2016-07-26 15:20:40 -0700125@extension("VK_AMD_gcn_shader") define VK_AMD_GCN_SHADER_SPEC_VERSION 1
126@extension("VK_AMD_gcn_shader") define VK_AMD_GCN_SHADER_EXTENSION_NAME "VK_AMD_gcn_shader"
127
Jesse Halleb02c472017-02-24 15:13:45 -0800128// 27
Jesse Hall3f5499b2016-07-26 15:20:40 -0700129@extension("VK_NV_dedicated_allocation") define VK_NV_DEDICATED_ALLOCATION_SPEC_VERSION 1
130@extension("VK_NV_dedicated_allocation") define VK_NV_DEDICATED_ALLOCATION_EXTENSION_NAME "VK_NV_dedicated_allocation"
131
Jesse Halleb02c472017-02-24 15:13:45 -0800132// 28
133@extension("VK_IMG_format_pvrtc") define VK_IMG_FORMAT_PVRTC_SPEC_VERSION 1
134@extension("VK_IMG_format_pvrtc") define VK_IMG_FORMAT_PVRTC_EXTENSION_NAME "VK_IMG_format_pvrtc"
135
136// 34
137@extension("VK_AMD_draw_indirect_count") define VK_AMD_DRAW_INDIRECT_COUNT_SPEC_VERSION 1
138@extension("VK_AMD_draw_indirect_count") define VK_AMD_DRAW_INDIRECT_COUNT_EXTENSION_NAME "VK_AMD_draw_indirect_count"
139
140// 36
141@extension("VK_AMD_negative_viewport_height") define VK_AMD_NEGATIVE_VIEWPORT_HEIGHT_SPEC_VERSION 1
142@extension("VK_AMD_negative_viewport_height") define VK_AMD_NEGATIVE_VIEWPORT_HEIGHT_EXTENSION_NAME "VK_AMD_negative_viewport_height"
143
144// 37
145@extension("VK_AMD_gpu_shader_half_float") define VK_AMD_GPU_SHADER_HALF_FLOAT_SPEC_VERSION 1
146@extension("VK_AMD_gpu_shader_half_float") define VK_AMD_GPU_SHADER_HALF_FLOAT_EXTENSION_NAME "VK_AMD_gpu_shader_half_float"
147
148// 38
149@extension("VK_AMD_shader_ballot") define VK_AMD_SHADER_BALLOT_SPEC_VERSION 1
150@extension("VK_AMD_shader_ballot") define VK_AMD_SHADER_BALLOT_EXTENSION_NAME "VK_AMD_shader_ballot"
151
152// 56
153@extension("VK_NV_external_memory_capabilities") define VK_NV_EXTERNAL_MEMORY_CAPABILITIES_SPEC_VERSION 1
154@extension("VK_NV_external_memory_capabilities") define VK_NV_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME "VK_NV_external_memory_capabilities"
155
156// 57
157@extension("VK_NV_external_memory") define VK_NV_EXTERNAL_MEMORY_SPEC_VERSION 1
158@extension("VK_NV_external_memory") define VK_NV_EXTERNAL_MEMORY_EXTENSION_NAME "VK_NV_external_memory"
159
160// 58
161@extension("VK_NV_external_memory_win32") define VK_NV_EXTERNAL_MEMORY_WIN32_SPEC_VERSION 1
162@extension("VK_NV_external_memory_win32") define VK_NV_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME "VK_NV_external_memory_win32"
163
164// 59
165@extension("VK_NV_win32_keyed_mutex") define VK_NV_WIN32_KEYED_MUTEX_SPEC_VERSION 1
166@extension("VK_NV_win32_keyed_mutex") define VK_NV_WIN32_KEYED_MUTEX_EXTENSION_NAME "VK_NV_win32_keyed_mutex"
167
Jesse Hall08e2f482017-03-06 15:22:17 -0800168// 60
169@extension("VK_KHR_get_physical_device_properties2") define VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_SPEC_VERSION 1
170@extension("VK_KHR_get_physical_device_properties2") define VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME "VK_KHR_get_physical_device_properties2"
171
Jesse Halleb02c472017-02-24 15:13:45 -0800172// 62
173@extension("VK_EXT_validation_flags") define VK_EXT_VALIDATION_FLAGS_SPEC_VERSION 1
174@extension("VK_EXT_validation_flags") define VK_EXT_VALIDATION_FLAGS_EXTENSION_NAME "VK_EXT_validation_flags"
175
Jesse Hall08e2f482017-03-06 15:22:17 -0800176// 63
177@extension("VK_NN_vi_surface") define VK_NN_VI_SURFACE_SPEC_VERSION 1
178@extension("VK_NN_vi_surface") define VK_NN_VI_SURFACE_EXTENSION_NAME "VK_NN_vi_surface"
179
180// 64
181@extension("VK_KHR_shader_draw_parameters") define VK_KHR_SHADER_DRAW_PARAMETERS_SPEC_VERSION 1
182@extension("VK_KHR_shader_draw_parameters") define VK_KHR_SHADER_DRAW_PARAMETERS_EXTENSION_NAME "VK_KHR_shader_draw_parameters"
183
184// 65
185@extension("VK_EXT_shader_subgroup_ballot") define VK_EXT_SHADER_SUBGROUP_BALLOT_SPEC_VERSION 1
186@extension("VK_EXT_shader_subgroup_ballot") define VK_EXT_SHADER_SUBGROUP_BALLOT_EXTENSION_NAME "VK_EXT_shader_subgroup_ballot"
187
188// 66
189@extension("VK_EXT_shader_subgroup_vote") define VK_EXT_SHADER_SUBGROUP_VOTE_SPEC_VERSION 1
190@extension("VK_EXT_shader_subgroup_vote") define VK_EXT_SHADER_SUBGROUP_VOTE_EXTENSION_NAME "VK_EXT_shader_subgroup_vote"
191
192// 70
193@extension("VK_KHR_maintenance1") define VK_KHR_MAINTENANCE1_SPEC_VERSION 1
194@extension("VK_KHR_maintenance1") define VK_KHR_MAINTENANCE1_EXTENSION_NAME "VK_KHR_maintenance1"
195
Jesse Halleb02c472017-02-24 15:13:45 -0800196// 87
197@extension("VK_NVX_device_generated_commands") define VK_NVX_DEVICE_GENERATED_COMMANDS_SPEC_VERSION 1
198@extension("VK_NVX_device_generated_commands") define VK_NVX_DEVICE_GENERATED_COMMANDS_EXTENSION_NAME "VK_NVX_device_generated_commands"
199
Jesse Hall08e2f482017-03-06 15:22:17 -0800200// 89
201@extension("VK_EXT_direct_mode_display") define VK_EXT_DIRECT_MODE_DISPLAY_SPEC_VERSION 1
202@extension("VK_EXT_direct_mode_display") define VK_EXT_DIRECT_MODE_DISPLAY_EXTENSION_NAME "VK_EXT_direct_mode_display"
203
204// 90
205@extension("VK_EXT_acquire_xlib_display") define VK_EXT_ACQUIRE_XLIB_DISPLAY_SPEC_VERSION 1
206@extension("VK_EXT_acquire_xlib_display") define VK_EXT_ACQUIRE_XLIB_DISPLAY_EXTENSION_NAME "VK_EXT_acquire_xlib_display"
207
208// 91
209@extension("VK_EXT_display_surface_counter") define VK_EXT_DISPLAY_SURFACE_COUNTER_SPEC_VERSION 1
210@extension("VK_EXT_display_surface_counter") define VK_EXT_DISPLAY_SURFACE_COUNTER_EXTENSION_NAME "VK_EXT_display_surface_counter"
211
212// 92
213@extension("VK_EXT_display_control") define VK_EXT_DISPLAY_CONTROL_SPEC_VERSION 1
214@extension("VK_EXT_display_control") define VK_EXT_DISPLAY_CONTROL_COUNTER_EXTENSION_NAME "VK_EXT_display_control"
215
Jesse Halld27f6aa2015-08-15 17:58:48 -0700216/////////////
217// Types //
218/////////////
219
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700220type u32 VkBool32
221type u32 VkFlags
222type u64 VkDeviceSize
223type u32 VkSampleMask
224
Jesse Halld27f6aa2015-08-15 17:58:48 -0700225/// Dispatchable handle types.
226@dispatchHandle type u64 VkInstance
227@dispatchHandle type u64 VkPhysicalDevice
228@dispatchHandle type u64 VkDevice
229@dispatchHandle type u64 VkQueue
Jesse Hall3fbc8562015-11-29 22:10:52 -0800230@dispatchHandle type u64 VkCommandBuffer
Jesse Halld27f6aa2015-08-15 17:58:48 -0700231
232/// Non dispatchable handle types.
233@nonDispatchHandle type u64 VkDeviceMemory
Jesse Hall3fbc8562015-11-29 22:10:52 -0800234@nonDispatchHandle type u64 VkCommandPool
Jesse Halld27f6aa2015-08-15 17:58:48 -0700235@nonDispatchHandle type u64 VkBuffer
236@nonDispatchHandle type u64 VkBufferView
237@nonDispatchHandle type u64 VkImage
238@nonDispatchHandle type u64 VkImageView
Jesse Halld27f6aa2015-08-15 17:58:48 -0700239@nonDispatchHandle type u64 VkShaderModule
Jesse Halld27f6aa2015-08-15 17:58:48 -0700240@nonDispatchHandle type u64 VkPipeline
241@nonDispatchHandle type u64 VkPipelineLayout
242@nonDispatchHandle type u64 VkSampler
243@nonDispatchHandle type u64 VkDescriptorSet
244@nonDispatchHandle type u64 VkDescriptorSetLayout
245@nonDispatchHandle type u64 VkDescriptorPool
Jesse Halld27f6aa2015-08-15 17:58:48 -0700246@nonDispatchHandle type u64 VkFence
247@nonDispatchHandle type u64 VkSemaphore
248@nonDispatchHandle type u64 VkEvent
249@nonDispatchHandle type u64 VkQueryPool
250@nonDispatchHandle type u64 VkFramebuffer
251@nonDispatchHandle type u64 VkRenderPass
252@nonDispatchHandle type u64 VkPipelineCache
Jesse Hall1356b0d2015-11-23 17:24:58 -0800253
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800254@extension("VK_KHR_surface") @nonDispatchHandle type u64 VkSurfaceKHR
Jesse Hall1356b0d2015-11-23 17:24:58 -0800255
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800256@extension("VK_KHR_swapchain") @nonDispatchHandle type u64 VkSwapchainKHR
Jesse Hall1356b0d2015-11-23 17:24:58 -0800257
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800258@extension("VK_KHR_display") @nonDispatchHandle type u64 VkDisplayKHR
259@extension("VK_KHR_display") @nonDispatchHandle type u64 VkDisplayModeKHR
Jesse Halld27f6aa2015-08-15 17:58:48 -0700260
Jesse Hall715b86a2016-01-16 16:34:29 -0800261@extension("VK_EXT_debug_report") @nonDispatchHandle type u64 VkDebugReportCallbackEXT
262
Jesse Halleb02c472017-02-24 15:13:45 -0800263@extension("VK_NVX_device_generated_commands") @nonDispatchHandle type u64 VkObjectTableNVX
264@extension("VK_NVX_device_generated_commands") @nonDispatchHandle type u64 VkIndirectCommandsLayoutNVX
265
Jesse Halld27f6aa2015-08-15 17:58:48 -0700266
267/////////////
268// Enums //
269/////////////
270
271enum VkImageLayout {
272 VK_IMAGE_LAYOUT_UNDEFINED = 0x00000000, /// Implicit layout an image is when its contents are undefined due to various reasons (e.g. right after creation)
273 VK_IMAGE_LAYOUT_GENERAL = 0x00000001, /// General layout when image can be used for any kind of access
274 VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL = 0x00000002, /// Optimal layout when image is only used for color attachment read/write
275 VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL = 0x00000003, /// Optimal layout when image is only used for depth/stencil attachment read/write
276 VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL = 0x00000004, /// Optimal layout when image is used for read only depth/stencil attachment and shader access
277 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 -0800278 VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL = 0x00000006, /// Optimal layout when image is used only as source of transfer operations
279 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 -0700280 VK_IMAGE_LAYOUT_PREINITIALIZED = 0x00000008, /// Initial layout used when the data is populated by the CPU
Jesse Hall1356b0d2015-11-23 17:24:58 -0800281
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800282 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800283 VK_IMAGE_LAYOUT_PRESENT_SRC_KHR = 1000001002,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700284}
285
286enum VkAttachmentLoadOp {
287 VK_ATTACHMENT_LOAD_OP_LOAD = 0x00000000,
288 VK_ATTACHMENT_LOAD_OP_CLEAR = 0x00000001,
289 VK_ATTACHMENT_LOAD_OP_DONT_CARE = 0x00000002,
290}
291
292enum VkAttachmentStoreOp {
293 VK_ATTACHMENT_STORE_OP_STORE = 0x00000000,
294 VK_ATTACHMENT_STORE_OP_DONT_CARE = 0x00000001,
295}
296
297enum VkImageType {
298 VK_IMAGE_TYPE_1D = 0x00000000,
299 VK_IMAGE_TYPE_2D = 0x00000001,
300 VK_IMAGE_TYPE_3D = 0x00000002,
301}
302
303enum VkImageTiling {
Jesse Hallc7467b72015-11-29 21:05:26 -0800304 VK_IMAGE_TILING_OPTIMAL = 0x00000000,
305 VK_IMAGE_TILING_LINEAR = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700306}
307
308enum VkImageViewType {
309 VK_IMAGE_VIEW_TYPE_1D = 0x00000000,
310 VK_IMAGE_VIEW_TYPE_2D = 0x00000001,
311 VK_IMAGE_VIEW_TYPE_3D = 0x00000002,
312 VK_IMAGE_VIEW_TYPE_CUBE = 0x00000003,
313 VK_IMAGE_VIEW_TYPE_1D_ARRAY = 0x00000004,
314 VK_IMAGE_VIEW_TYPE_2D_ARRAY = 0x00000005,
315 VK_IMAGE_VIEW_TYPE_CUBE_ARRAY = 0x00000006,
316}
317
Jesse Hall3fbc8562015-11-29 22:10:52 -0800318enum VkCommandBufferLevel {
319 VK_COMMAND_BUFFER_LEVEL_PRIMARY = 0x00000000,
320 VK_COMMAND_BUFFER_LEVEL_SECONDARY = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700321}
322
Jesse Hall65ab5522015-11-30 00:07:16 -0800323enum VkComponentSwizzle {
324 VK_COMPONENT_SWIZZLE_IDENTITY = 0x00000000,
325 VK_COMPONENT_SWIZZLE_ZERO = 0x00000001,
326 VK_COMPONENT_SWIZZLE_ONE = 0x00000002,
327 VK_COMPONENT_SWIZZLE_R = 0x00000003,
328 VK_COMPONENT_SWIZZLE_G = 0x00000004,
329 VK_COMPONENT_SWIZZLE_B = 0x00000005,
330 VK_COMPONENT_SWIZZLE_A = 0x00000006,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700331}
332
333enum VkDescriptorType {
334 VK_DESCRIPTOR_TYPE_SAMPLER = 0x00000000,
335 VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER = 0x00000001,
336 VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE = 0x00000002,
337 VK_DESCRIPTOR_TYPE_STORAGE_IMAGE = 0x00000003,
338 VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER = 0x00000004,
339 VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER = 0x00000005,
340 VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER = 0x00000006,
341 VK_DESCRIPTOR_TYPE_STORAGE_BUFFER = 0x00000007,
342 VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC = 0x00000008,
343 VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC = 0x00000009,
344 VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT = 0x0000000a,
345}
346
Jesse Halld27f6aa2015-08-15 17:58:48 -0700347enum VkQueryType {
348 VK_QUERY_TYPE_OCCLUSION = 0x00000000,
349 VK_QUERY_TYPE_PIPELINE_STATISTICS = 0x00000001, /// Optional
Jesse Halla3a7a1d2015-11-24 11:37:23 -0800350 VK_QUERY_TYPE_TIMESTAMP = 0x00000002,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700351}
352
Jesse Halld27f6aa2015-08-15 17:58:48 -0700353enum VkBorderColor {
354 VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK = 0x00000000,
355 VK_BORDER_COLOR_INT_TRANSPARENT_BLACK = 0x00000001,
356 VK_BORDER_COLOR_FLOAT_OPAQUE_BLACK = 0x00000002,
357 VK_BORDER_COLOR_INT_OPAQUE_BLACK = 0x00000003,
358 VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE = 0x00000004,
359 VK_BORDER_COLOR_INT_OPAQUE_WHITE = 0x00000005,
360}
361
362enum VkPipelineBindPoint {
Jesse Hallc7467b72015-11-29 21:05:26 -0800363 VK_PIPELINE_BIND_POINT_GRAPHICS = 0x00000000,
364 VK_PIPELINE_BIND_POINT_COMPUTE = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700365}
366
367enum VkPrimitiveTopology {
368 VK_PRIMITIVE_TOPOLOGY_POINT_LIST = 0x00000000,
369 VK_PRIMITIVE_TOPOLOGY_LINE_LIST = 0x00000001,
370 VK_PRIMITIVE_TOPOLOGY_LINE_STRIP = 0x00000002,
371 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST = 0x00000003,
372 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP = 0x00000004,
373 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN = 0x00000005,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800374 VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY = 0x00000006,
375 VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY = 0x00000007,
376 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY = 0x00000008,
377 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY = 0x00000009,
Jesse Hall091ed9e2015-11-30 00:55:29 -0800378 VK_PRIMITIVE_TOPOLOGY_PATCH_LIST = 0x0000000a,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700379}
380
381enum VkSharingMode {
382 VK_SHARING_MODE_EXCLUSIVE = 0x00000000,
383 VK_SHARING_MODE_CONCURRENT = 0x00000001,
384}
385
386enum VkIndexType {
387 VK_INDEX_TYPE_UINT16 = 0x00000000,
388 VK_INDEX_TYPE_UINT32 = 0x00000001,
389}
390
Jesse Hall23ff73f2015-11-29 14:36:39 -0800391enum VkFilter {
392 VK_FILTER_NEAREST = 0x00000000,
393 VK_FILTER_LINEAR = 0x00000001,
Jesse Hall26763382016-05-20 07:13:52 -0700394
395 //@extension("VK_IMG_filter_cubic")
396 VK_FILTER_CUBIC_IMG = 1000015000,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700397}
398
Jesse Hall23ff73f2015-11-29 14:36:39 -0800399enum VkSamplerMipmapMode {
Jesse Hall23ff73f2015-11-29 14:36:39 -0800400 VK_SAMPLER_MIPMAP_MODE_NEAREST = 0x00000001, /// Choose nearest mip level
401 VK_SAMPLER_MIPMAP_MODE_LINEAR = 0x00000002, /// Linear filter between mip levels
Jesse Halld27f6aa2015-08-15 17:58:48 -0700402}
403
Jesse Hall23ff73f2015-11-29 14:36:39 -0800404enum VkSamplerAddressMode {
Jesse Hallc7467b72015-11-29 21:05:26 -0800405 VK_SAMPLER_ADDRESS_MODE_REPEAT = 0x00000000,
406 VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT = 0x00000001,
407 VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE = 0x00000002,
408 VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER = 0x00000003,
409 VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700410}
411
412enum VkCompareOp {
413 VK_COMPARE_OP_NEVER = 0x00000000,
414 VK_COMPARE_OP_LESS = 0x00000001,
415 VK_COMPARE_OP_EQUAL = 0x00000002,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800416 VK_COMPARE_OP_LESS_OR_EQUAL = 0x00000003,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700417 VK_COMPARE_OP_GREATER = 0x00000004,
418 VK_COMPARE_OP_NOT_EQUAL = 0x00000005,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800419 VK_COMPARE_OP_GREATER_OR_EQUAL = 0x00000006,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700420 VK_COMPARE_OP_ALWAYS = 0x00000007,
421}
422
Jesse Hall65ab5522015-11-30 00:07:16 -0800423enum VkPolygonMode {
424 VK_POLYGON_MODE_FILL = 0x00000000,
425 VK_POLYGON_MODE_LINE = 0x00000001,
426 VK_POLYGON_MODE_POINT = 0x00000002,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700427}
428
429enum VkFrontFace {
Jesse Hall3fbc8562015-11-29 22:10:52 -0800430 VK_FRONT_FACE_COUNTER_CLOCKWISE = 0x00000000,
431 VK_FRONT_FACE_CLOCKWISE = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700432}
433
Jesse Hall65ab5522015-11-30 00:07:16 -0800434enum VkBlendFactor {
435 VK_BLEND_FACTOR_ZERO = 0x00000000,
436 VK_BLEND_FACTOR_ONE = 0x00000001,
437 VK_BLEND_FACTOR_SRC_COLOR = 0x00000002,
438 VK_BLEND_FACTOR_ONE_MINUS_SRC_COLOR = 0x00000003,
439 VK_BLEND_FACTOR_DST_COLOR = 0x00000004,
440 VK_BLEND_FACTOR_ONE_MINUS_DST_COLOR = 0x00000005,
441 VK_BLEND_FACTOR_SRC_ALPHA = 0x00000006,
442 VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA = 0x00000007,
443 VK_BLEND_FACTOR_DST_ALPHA = 0x00000008,
444 VK_BLEND_FACTOR_ONE_MINUS_DST_ALPHA = 0x00000009,
445 VK_BLEND_FACTOR_CONSTANT_COLOR = 0x0000000a,
446 VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR = 0x0000000b,
447 VK_BLEND_FACTOR_CONSTANT_ALPHA = 0x0000000c,
448 VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA = 0x0000000d,
449 VK_BLEND_FACTOR_SRC_ALPHA_SATURATE = 0x0000000e,
450 VK_BLEND_FACTOR_SRC1_COLOR = 0x0000000f,
451 VK_BLEND_FACTOR_ONE_MINUS_SRC1_COLOR = 0x00000010,
452 VK_BLEND_FACTOR_SRC1_ALPHA = 0x00000011,
453 VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA = 0x00000012,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700454}
455
456enum VkBlendOp {
457 VK_BLEND_OP_ADD = 0x00000000,
458 VK_BLEND_OP_SUBTRACT = 0x00000001,
459 VK_BLEND_OP_REVERSE_SUBTRACT = 0x00000002,
460 VK_BLEND_OP_MIN = 0x00000003,
461 VK_BLEND_OP_MAX = 0x00000004,
462}
463
464enum VkStencilOp {
465 VK_STENCIL_OP_KEEP = 0x00000000,
466 VK_STENCIL_OP_ZERO = 0x00000001,
467 VK_STENCIL_OP_REPLACE = 0x00000002,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800468 VK_STENCIL_OP_INCREMENT_AND_CLAMP = 0x00000003,
469 VK_STENCIL_OP_DECREMENT_AND_CLAMP = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700470 VK_STENCIL_OP_INVERT = 0x00000005,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800471 VK_STENCIL_OP_INCREMENT_AND_WRAP = 0x00000006,
472 VK_STENCIL_OP_DECREMENT_AND_WRAP = 0x00000007,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700473}
474
475enum VkLogicOp {
476 VK_LOGIC_OP_CLEAR = 0x00000000,
477 VK_LOGIC_OP_AND = 0x00000001,
478 VK_LOGIC_OP_AND_REVERSE = 0x00000002,
479 VK_LOGIC_OP_COPY = 0x00000003,
480 VK_LOGIC_OP_AND_INVERTED = 0x00000004,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800481 VK_LOGIC_OP_NO_OP = 0x00000005,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700482 VK_LOGIC_OP_XOR = 0x00000006,
483 VK_LOGIC_OP_OR = 0x00000007,
484 VK_LOGIC_OP_NOR = 0x00000008,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800485 VK_LOGIC_OP_EQUIVALENT = 0x00000009,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700486 VK_LOGIC_OP_INVERT = 0x0000000a,
487 VK_LOGIC_OP_OR_REVERSE = 0x0000000b,
488 VK_LOGIC_OP_COPY_INVERTED = 0x0000000c,
489 VK_LOGIC_OP_OR_INVERTED = 0x0000000d,
490 VK_LOGIC_OP_NAND = 0x0000000e,
491 VK_LOGIC_OP_SET = 0x0000000f,
492}
493
Jesse Hall3fbc8562015-11-29 22:10:52 -0800494enum VkSystemAllocationScope {
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800495 VK_SYSTEM_ALLOCATION_SCOPE_COMMAND = 0x00000000,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800496 VK_SYSTEM_ALLOCATION_SCOPE_OBJECT = 0x00000001,
497 VK_SYSTEM_ALLOCATION_SCOPE_CACHE = 0x00000002,
498 VK_SYSTEM_ALLOCATION_SCOPE_DEVICE = 0x00000003,
499 VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE = 0x00000004,
Jesse Hall03b6fe12015-11-24 12:44:21 -0800500}
501
Jesse Hall3fbc8562015-11-29 22:10:52 -0800502enum VkInternalAllocationType {
503 VK_INTERNAL_ALLOCATION_TYPE_EXECUTABLE = 0x00000000,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700504}
505
506enum VkPhysicalDeviceType {
507 VK_PHYSICAL_DEVICE_TYPE_OTHER = 0x00000000,
508 VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU = 0x00000001,
509 VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU = 0x00000002,
510 VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU = 0x00000003,
511 VK_PHYSICAL_DEVICE_TYPE_CPU = 0x00000004,
512}
513
Jesse Hall65ab5522015-11-30 00:07:16 -0800514enum VkVertexInputRate {
515 VK_VERTEX_INPUT_RATE_VERTEX = 0x00000000,
516 VK_VERTEX_INPUT_RATE_INSTANCE = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700517}
518
519/// Vulkan format definitions
520enum VkFormat {
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800521 VK_FORMAT_UNDEFINED = 0,
522 VK_FORMAT_R4G4_UNORM_PACK8 = 1,
523 VK_FORMAT_R4G4B4A4_UNORM_PACK16 = 2,
524 VK_FORMAT_B4G4R4A4_UNORM_PACK16 = 3,
525 VK_FORMAT_R5G6B5_UNORM_PACK16 = 4,
526 VK_FORMAT_B5G6R5_UNORM_PACK16 = 5,
527 VK_FORMAT_R5G5B5A1_UNORM_PACK16 = 6,
528 VK_FORMAT_B5G5R5A1_UNORM_PACK16 = 7,
529 VK_FORMAT_A1R5G5B5_UNORM_PACK16 = 8,
530 VK_FORMAT_R8_UNORM = 9,
531 VK_FORMAT_R8_SNORM = 10,
532 VK_FORMAT_R8_USCALED = 11,
533 VK_FORMAT_R8_SSCALED = 12,
534 VK_FORMAT_R8_UINT = 13,
535 VK_FORMAT_R8_SINT = 14,
536 VK_FORMAT_R8_SRGB = 15,
537 VK_FORMAT_R8G8_UNORM = 16,
538 VK_FORMAT_R8G8_SNORM = 17,
539 VK_FORMAT_R8G8_USCALED = 18,
540 VK_FORMAT_R8G8_SSCALED = 19,
541 VK_FORMAT_R8G8_UINT = 20,
542 VK_FORMAT_R8G8_SINT = 21,
543 VK_FORMAT_R8G8_SRGB = 22,
544 VK_FORMAT_R8G8B8_UNORM = 23,
545 VK_FORMAT_R8G8B8_SNORM = 24,
546 VK_FORMAT_R8G8B8_USCALED = 25,
547 VK_FORMAT_R8G8B8_SSCALED = 26,
548 VK_FORMAT_R8G8B8_UINT = 27,
549 VK_FORMAT_R8G8B8_SINT = 28,
550 VK_FORMAT_R8G8B8_SRGB = 29,
551 VK_FORMAT_B8G8R8_UNORM = 30,
552 VK_FORMAT_B8G8R8_SNORM = 31,
553 VK_FORMAT_B8G8R8_USCALED = 32,
554 VK_FORMAT_B8G8R8_SSCALED = 33,
555 VK_FORMAT_B8G8R8_UINT = 34,
556 VK_FORMAT_B8G8R8_SINT = 35,
557 VK_FORMAT_B8G8R8_SRGB = 36,
558 VK_FORMAT_R8G8B8A8_UNORM = 37,
559 VK_FORMAT_R8G8B8A8_SNORM = 38,
560 VK_FORMAT_R8G8B8A8_USCALED = 39,
561 VK_FORMAT_R8G8B8A8_SSCALED = 40,
562 VK_FORMAT_R8G8B8A8_UINT = 41,
563 VK_FORMAT_R8G8B8A8_SINT = 42,
564 VK_FORMAT_R8G8B8A8_SRGB = 43,
565 VK_FORMAT_B8G8R8A8_UNORM = 44,
566 VK_FORMAT_B8G8R8A8_SNORM = 45,
567 VK_FORMAT_B8G8R8A8_USCALED = 46,
568 VK_FORMAT_B8G8R8A8_SSCALED = 47,
569 VK_FORMAT_B8G8R8A8_UINT = 48,
570 VK_FORMAT_B8G8R8A8_SINT = 49,
571 VK_FORMAT_B8G8R8A8_SRGB = 50,
572 VK_FORMAT_A8B8G8R8_UNORM_PACK32 = 51,
573 VK_FORMAT_A8B8G8R8_SNORM_PACK32 = 52,
574 VK_FORMAT_A8B8G8R8_USCALED_PACK32 = 53,
575 VK_FORMAT_A8B8G8R8_SSCALED_PACK32 = 54,
576 VK_FORMAT_A8B8G8R8_UINT_PACK32 = 55,
577 VK_FORMAT_A8B8G8R8_SINT_PACK32 = 56,
578 VK_FORMAT_A8B8G8R8_SRGB_PACK32 = 57,
579 VK_FORMAT_A2R10G10B10_UNORM_PACK32 = 58,
580 VK_FORMAT_A2R10G10B10_SNORM_PACK32 = 59,
581 VK_FORMAT_A2R10G10B10_USCALED_PACK32 = 60,
582 VK_FORMAT_A2R10G10B10_SSCALED_PACK32 = 61,
583 VK_FORMAT_A2R10G10B10_UINT_PACK32 = 62,
584 VK_FORMAT_A2R10G10B10_SINT_PACK32 = 63,
585 VK_FORMAT_A2B10G10R10_UNORM_PACK32 = 64,
586 VK_FORMAT_A2B10G10R10_SNORM_PACK32 = 65,
587 VK_FORMAT_A2B10G10R10_USCALED_PACK32 = 66,
588 VK_FORMAT_A2B10G10R10_SSCALED_PACK32 = 67,
589 VK_FORMAT_A2B10G10R10_UINT_PACK32 = 68,
590 VK_FORMAT_A2B10G10R10_SINT_PACK32 = 69,
591 VK_FORMAT_R16_UNORM = 70,
592 VK_FORMAT_R16_SNORM = 71,
593 VK_FORMAT_R16_USCALED = 72,
594 VK_FORMAT_R16_SSCALED = 73,
595 VK_FORMAT_R16_UINT = 74,
596 VK_FORMAT_R16_SINT = 75,
597 VK_FORMAT_R16_SFLOAT = 76,
598 VK_FORMAT_R16G16_UNORM = 77,
599 VK_FORMAT_R16G16_SNORM = 78,
600 VK_FORMAT_R16G16_USCALED = 79,
601 VK_FORMAT_R16G16_SSCALED = 80,
602 VK_FORMAT_R16G16_UINT = 81,
603 VK_FORMAT_R16G16_SINT = 82,
604 VK_FORMAT_R16G16_SFLOAT = 83,
605 VK_FORMAT_R16G16B16_UNORM = 84,
606 VK_FORMAT_R16G16B16_SNORM = 85,
607 VK_FORMAT_R16G16B16_USCALED = 86,
608 VK_FORMAT_R16G16B16_SSCALED = 87,
609 VK_FORMAT_R16G16B16_UINT = 88,
610 VK_FORMAT_R16G16B16_SINT = 89,
611 VK_FORMAT_R16G16B16_SFLOAT = 90,
612 VK_FORMAT_R16G16B16A16_UNORM = 91,
613 VK_FORMAT_R16G16B16A16_SNORM = 92,
614 VK_FORMAT_R16G16B16A16_USCALED = 93,
615 VK_FORMAT_R16G16B16A16_SSCALED = 94,
616 VK_FORMAT_R16G16B16A16_UINT = 95,
617 VK_FORMAT_R16G16B16A16_SINT = 96,
618 VK_FORMAT_R16G16B16A16_SFLOAT = 97,
619 VK_FORMAT_R32_UINT = 98,
620 VK_FORMAT_R32_SINT = 99,
621 VK_FORMAT_R32_SFLOAT = 100,
622 VK_FORMAT_R32G32_UINT = 101,
623 VK_FORMAT_R32G32_SINT = 102,
624 VK_FORMAT_R32G32_SFLOAT = 103,
625 VK_FORMAT_R32G32B32_UINT = 104,
626 VK_FORMAT_R32G32B32_SINT = 105,
627 VK_FORMAT_R32G32B32_SFLOAT = 106,
628 VK_FORMAT_R32G32B32A32_UINT = 107,
629 VK_FORMAT_R32G32B32A32_SINT = 108,
630 VK_FORMAT_R32G32B32A32_SFLOAT = 109,
631 VK_FORMAT_R64_UINT = 110,
632 VK_FORMAT_R64_SINT = 111,
633 VK_FORMAT_R64_SFLOAT = 112,
634 VK_FORMAT_R64G64_UINT = 113,
635 VK_FORMAT_R64G64_SINT = 114,
636 VK_FORMAT_R64G64_SFLOAT = 115,
637 VK_FORMAT_R64G64B64_UINT = 116,
638 VK_FORMAT_R64G64B64_SINT = 117,
639 VK_FORMAT_R64G64B64_SFLOAT = 118,
640 VK_FORMAT_R64G64B64A64_UINT = 119,
641 VK_FORMAT_R64G64B64A64_SINT = 120,
642 VK_FORMAT_R64G64B64A64_SFLOAT = 121,
643 VK_FORMAT_B10G11R11_UFLOAT_PACK32 = 122,
644 VK_FORMAT_E5B9G9R9_UFLOAT_PACK32 = 123,
645 VK_FORMAT_D16_UNORM = 124,
646 VK_FORMAT_X8_D24_UNORM_PACK32 = 125,
647 VK_FORMAT_D32_SFLOAT = 126,
648 VK_FORMAT_S8_UINT = 127,
649 VK_FORMAT_D16_UNORM_S8_UINT = 128,
650 VK_FORMAT_D24_UNORM_S8_UINT = 129,
651 VK_FORMAT_D32_SFLOAT_S8_UINT = 130,
652 VK_FORMAT_BC1_RGB_UNORM_BLOCK = 131,
653 VK_FORMAT_BC1_RGB_SRGB_BLOCK = 132,
654 VK_FORMAT_BC1_RGBA_UNORM_BLOCK = 133,
655 VK_FORMAT_BC1_RGBA_SRGB_BLOCK = 134,
656 VK_FORMAT_BC2_UNORM_BLOCK = 135,
657 VK_FORMAT_BC2_SRGB_BLOCK = 136,
658 VK_FORMAT_BC3_UNORM_BLOCK = 137,
659 VK_FORMAT_BC3_SRGB_BLOCK = 138,
660 VK_FORMAT_BC4_UNORM_BLOCK = 139,
661 VK_FORMAT_BC4_SNORM_BLOCK = 140,
662 VK_FORMAT_BC5_UNORM_BLOCK = 141,
663 VK_FORMAT_BC5_SNORM_BLOCK = 142,
664 VK_FORMAT_BC6H_UFLOAT_BLOCK = 143,
665 VK_FORMAT_BC6H_SFLOAT_BLOCK = 144,
666 VK_FORMAT_BC7_UNORM_BLOCK = 145,
667 VK_FORMAT_BC7_SRGB_BLOCK = 146,
668 VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK = 147,
669 VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK = 148,
670 VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK = 149,
671 VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK = 150,
672 VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK = 151,
673 VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK = 152,
674 VK_FORMAT_EAC_R11_UNORM_BLOCK = 153,
675 VK_FORMAT_EAC_R11_SNORM_BLOCK = 154,
676 VK_FORMAT_EAC_R11G11_UNORM_BLOCK = 155,
677 VK_FORMAT_EAC_R11G11_SNORM_BLOCK = 156,
678 VK_FORMAT_ASTC_4x4_UNORM_BLOCK = 157,
679 VK_FORMAT_ASTC_4x4_SRGB_BLOCK = 158,
680 VK_FORMAT_ASTC_5x4_UNORM_BLOCK = 159,
681 VK_FORMAT_ASTC_5x4_SRGB_BLOCK = 160,
682 VK_FORMAT_ASTC_5x5_UNORM_BLOCK = 161,
683 VK_FORMAT_ASTC_5x5_SRGB_BLOCK = 162,
684 VK_FORMAT_ASTC_6x5_UNORM_BLOCK = 163,
685 VK_FORMAT_ASTC_6x5_SRGB_BLOCK = 164,
686 VK_FORMAT_ASTC_6x6_UNORM_BLOCK = 165,
687 VK_FORMAT_ASTC_6x6_SRGB_BLOCK = 166,
688 VK_FORMAT_ASTC_8x5_UNORM_BLOCK = 167,
689 VK_FORMAT_ASTC_8x5_SRGB_BLOCK = 168,
690 VK_FORMAT_ASTC_8x6_UNORM_BLOCK = 169,
691 VK_FORMAT_ASTC_8x6_SRGB_BLOCK = 170,
692 VK_FORMAT_ASTC_8x8_UNORM_BLOCK = 171,
693 VK_FORMAT_ASTC_8x8_SRGB_BLOCK = 172,
694 VK_FORMAT_ASTC_10x5_UNORM_BLOCK = 173,
695 VK_FORMAT_ASTC_10x5_SRGB_BLOCK = 174,
696 VK_FORMAT_ASTC_10x6_UNORM_BLOCK = 175,
697 VK_FORMAT_ASTC_10x6_SRGB_BLOCK = 176,
698 VK_FORMAT_ASTC_10x8_UNORM_BLOCK = 177,
699 VK_FORMAT_ASTC_10x8_SRGB_BLOCK = 178,
700 VK_FORMAT_ASTC_10x10_UNORM_BLOCK = 179,
701 VK_FORMAT_ASTC_10x10_SRGB_BLOCK = 180,
702 VK_FORMAT_ASTC_12x10_UNORM_BLOCK = 181,
703 VK_FORMAT_ASTC_12x10_SRGB_BLOCK = 182,
704 VK_FORMAT_ASTC_12x12_UNORM_BLOCK = 183,
705 VK_FORMAT_ASTC_12x12_SRGB_BLOCK = 184,
Jesse Halleb02c472017-02-24 15:13:45 -0800706
707 //@extension("VK_IMG_format_pvrtc")
708 VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG = 1000054000,
709 VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG = 1000054001,
710 VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG = 1000054002,
711 VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG = 1000054003,
712 VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG = 1000054004,
713 VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG = 1000054005,
714 VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG = 1000054006,
715 VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG = 1000054007,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700716}
717
Jesse Halld27f6aa2015-08-15 17:58:48 -0700718/// Structure type enumerant
719enum VkStructureType {
720 VK_STRUCTURE_TYPE_APPLICATION_INFO = 0,
Jesse Hallc7467b72015-11-29 21:05:26 -0800721 VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO = 1,
722 VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO = 2,
723 VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO = 3,
724 VK_STRUCTURE_TYPE_SUBMIT_INFO = 4,
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800725 VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO = 5,
Jesse Hallc7467b72015-11-29 21:05:26 -0800726 VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE = 6,
727 VK_STRUCTURE_TYPE_BIND_SPARSE_INFO = 7,
728 VK_STRUCTURE_TYPE_FENCE_CREATE_INFO = 8,
729 VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO = 9,
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700730 VK_STRUCTURE_TYPE_EVENT_CREATE_INFO = 10,
Jesse Hallc7467b72015-11-29 21:05:26 -0800731 VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO = 11,
732 VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO = 12,
733 VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO = 13,
734 VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO = 14,
735 VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO = 15,
736 VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO = 16,
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800737 VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO = 17,
738 VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO = 18,
739 VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO = 19,
740 VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO = 20,
741 VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO = 21,
742 VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO = 22,
743 VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO = 23,
744 VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO = 24,
745 VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO = 25,
746 VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO = 26,
747 VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO = 27,
748 VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO = 28,
749 VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO = 29,
750 VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO = 30,
751 VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO = 31,
752 VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO = 32,
753 VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO = 33,
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800754 VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO = 34,
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800755 VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET = 35,
756 VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET = 36,
757 VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO = 37,
758 VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO = 38,
759 VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO = 39,
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800760 VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO = 40,
Jesse Hall3dd678a2016-01-08 21:52:01 -0800761 VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO = 41,
762 VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO = 42,
763 VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO = 43,
764 VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER = 44,
765 VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER = 45,
766 VK_STRUCTURE_TYPE_MEMORY_BARRIER = 46,
767 VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO = 47,
768 VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO = 48,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800769
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800770 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800771 VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR = 1000001000,
772 VK_STRUCTURE_TYPE_PRESENT_INFO_KHR = 1000001001,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800773
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800774 //@extension("VK_KHR_display")
Jesse Hallbd888842015-11-30 21:44:14 -0800775 VK_STRUCTURE_TYPE_DISPLAY_MODE_CREATE_INFO_KHR = 1000002000,
776 VK_STRUCTURE_TYPE_DISPLAY_SURFACE_CREATE_INFO_KHR = 1000002001,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800777
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800778 //@extension("VK_KHR_display_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800779 VK_STRUCTURE_TYPE_DISPLAY_DISPLAY_PRESENT_INFO_KHR = 1000003000,
Jesse Hallf9fa9a52016-01-08 16:08:51 -0800780
781 //@extension("VK_KHR_xlib_surface")
782 VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR = 1000004000,
783
784 //@extension("VK_KHR_xcb_surface")
785 VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR = 1000005000,
786
787 //@extension("VK_KHR_wayland_surface")
788 VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR = 1000006000,
789
790 //@extension("VK_KHR_mir_surface")
791 VK_STRUCTURE_TYPE_MIR_SURFACE_CREATE_INFO_KHR = 1000007000,
792
793 //@extension("VK_KHR_android_surface")
794 VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR = 1000008000,
795
796 //@extension("VK_KHR_win32_surface")
797 VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR = 1000009000,
Jesse Hall543a7ff2016-01-08 16:38:30 -0800798
Chia-I Wub262ddc2016-03-22 07:38:20 +0800799 //@extension("VK_ANDROID_native_buffer")
800 VK_STRUCTURE_TYPE_NATIVE_BUFFER_ANDROID = 1000010000,
801
Jesse Hall543a7ff2016-01-08 16:38:30 -0800802 //@extension("VK_EXT_debug_report")
Jesse Hall26763382016-05-20 07:13:52 -0700803 VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT = 1000011000,
804
805 //@extension("VK_AMD_rasterization_order")
806 VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD = 1000018000,
807
808 //@extension("VK_EXT_debug_marker")
809 VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_NAME_INFO_EXT = 1000022000,
Jesse Hall26763382016-05-20 07:13:52 -0700810 VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_TAG_INFO_EXT = 1000022001,
Jesse Hall26763382016-05-20 07:13:52 -0700811 VK_STRUCTURE_TYPE_DEBUG_MARKER_MARKER_INFO_EXT = 1000022002,
Jesse Hall3f5499b2016-07-26 15:20:40 -0700812
813 //@extension("VK_NV_dedicated_allocation")
814 VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV = 1000026000,
Jesse Hall3f5499b2016-07-26 15:20:40 -0700815 VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV = 1000026001,
Jesse Hall3f5499b2016-07-26 15:20:40 -0700816 VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV = 1000026002,
Jesse Halleb02c472017-02-24 15:13:45 -0800817
818 //@extension("VK_NV_external_memory")
819 VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_NV = 1000056000,
820 VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_NV = 1000056001,
821
822 //@extension("VK_NV_external_memory_win32")
823 VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_NV = 1000057000,
824 VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_NV = 1000057001,
825
826 //@extension("VK_NV_win32_keyed_mutex")
827 VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_NV = 1000058000,
828
Jesse Hall08e2f482017-03-06 15:22:17 -0800829 //@extension("VK_KHR_get_physical_device_properties2")
830 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR = 1000059000,
831 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR = 1000059001,
832 VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2_KHR = 1000059002,
833 VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2_KHR = 1000059003,
834 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2_KHR = 1000059004,
835 VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2_KHR = 1000059005,
836 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2_KHR = 1000059006,
837 VK_STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2_KHR = 1000059007,
838 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2_KHR = 1000059008,
839
Jesse Halleb02c472017-02-24 15:13:45 -0800840 //@extension("VK_EXT_validation_flags")
841 VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT = 1000061000,
842
Jesse Hall08e2f482017-03-06 15:22:17 -0800843 //@extension("VK_NN_vi_surface")
844 VK_STRUCTURE_TYPE_VI_SURFACE_CREATE_INFO_NN = 1000062000,
845
Jesse Halleb02c472017-02-24 15:13:45 -0800846 //@extension("VK_NVX_device_generated_commands")
847 VK_STRUCTURE_TYPE_OBJECT_TABLE_CREATE_INFO_NVX = 1000086000,
848 VK_STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_CREATE_INFO_NVX = 1000086001,
849 VK_STRUCTURE_TYPE_CMD_PROCESS_COMMANDS_INFO_NVX = 1000086002,
850 VK_STRUCTURE_TYPE_CMD_RESERVE_SPACE_FOR_COMMANDS_INFO_NVX = 1000086003,
851 VK_STRUCTURE_TYPE_DEVICE_GENERATED_COMMANDS_LIMITS_NVX = 1000086004,
852 VK_STRUCTURE_TYPE_DEVICE_GENERATED_COMMANDS_FEATURES_NVX = 1000086005,
Jesse Hall08e2f482017-03-06 15:22:17 -0800853
854 //@extension("VK_EXT_display_surface_counter")
855 VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES2_EXT = 1000090000,
856
857 //@extension("VK_EXT_display_control")
858 VK_STRUCTURE_TYPE_DISPLAY_POWER_INFO_EXT = 1000091000,
859 VK_STRUCTURE_TYPE_DEVICE_EVENT_INFO_EXT = 1000091001,
860 VK_STRUCTURE_TYPE_DISPLAY_EVENT_INFO_EXT = 1000091002,
861 VK_STRUCTURE_TYPE_SWAPCHAIN_COUNTER_CREATE_INFO_EXT = 1000091003,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700862}
863
Jesse Hall65ab5522015-11-30 00:07:16 -0800864enum VkSubpassContents {
865 VK_SUBPASS_CONTENTS_INLINE = 0x00000000,
866 VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700867}
868
Jesse Hall543a7ff2016-01-08 16:38:30 -0800869enum VkPipelineCacheHeaderVersion {
870 VK_PIPELINE_CACHE_HEADER_VERSION_ONE = 1,
871}
872
Jesse Hallbd888842015-11-30 21:44:14 -0800873@lastUnused(-11)
Jesse Halld27f6aa2015-08-15 17:58:48 -0700874/// Error and return codes
875enum VkResult {
876 // Return codes for successful operation execution (positive values)
Jesse Hallbd888842015-11-30 21:44:14 -0800877 VK_SUCCESS = 0,
878 VK_NOT_READY = 1,
879 VK_TIMEOUT = 2,
880 VK_EVENT_SET = 3,
881 VK_EVENT_RESET = 4,
882 VK_INCOMPLETE = 5,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700883
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800884 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800885 VK_SUBOPTIMAL_KHR = 1000001003,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800886
Jesse Halld27f6aa2015-08-15 17:58:48 -0700887 // Error codes (negative values)
Jesse Hallbd888842015-11-30 21:44:14 -0800888 VK_ERROR_OUT_OF_HOST_MEMORY = 0xFFFFFFFF, // -1
889 VK_ERROR_OUT_OF_DEVICE_MEMORY = 0xFFFFFFFE, // -2
890 VK_ERROR_INITIALIZATION_FAILED = 0xFFFFFFFD, // -3
891 VK_ERROR_DEVICE_LOST = 0xFFFFFFFC, // -4
892 VK_ERROR_MEMORY_MAP_FAILED = 0xFFFFFFFB, // -5
893 VK_ERROR_LAYER_NOT_PRESENT = 0xFFFFFFFA, // -6
894 VK_ERROR_EXTENSION_NOT_PRESENT = 0xFFFFFFF9, // -7
895 VK_ERROR_FEATURE_NOT_PRESENT = 0xFFFFFFF8, // -8
896 VK_ERROR_INCOMPATIBLE_DRIVER = 0xFFFFFFF7, // -9
897 VK_ERROR_TOO_MANY_OBJECTS = 0xFFFFFFF6, // -10
898 VK_ERROR_FORMAT_NOT_SUPPORTED = 0xFFFFFFF5, // -11
Jesse Hall3f5499b2016-07-26 15:20:40 -0700899 VK_ERROR_FRAGMENTED_POOL = 0xFFFFFFF4, // -12
Jesse Hall1356b0d2015-11-23 17:24:58 -0800900
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800901 //@extension("VK_KHR_surface")
Jesse Hallbd888842015-11-30 21:44:14 -0800902 VK_ERROR_SURFACE_LOST_KHR = 0xC4653600, // -1000000000
Jesse Halla6429252015-11-29 18:59:42 -0800903
Jesse Hall563380d2016-01-15 23:14:05 -0800904 //@extension("VK_KHR_surface")
905 VK_ERROR_NATIVE_WINDOW_IN_USE_KHR = 0xC46535FF, // -1000008001
906
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800907 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800908 VK_ERROR_OUT_OF_DATE_KHR = 0xC4653214, // -1000001004
Jesse Hall1356b0d2015-11-23 17:24:58 -0800909
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800910 //@extension("VK_KHR_display_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800911 VK_ERROR_INCOMPATIBLE_DISPLAY_KHR = 0xC4652A47, // -1000003001
Jesse Hall1356b0d2015-11-23 17:24:58 -0800912
Jesse Hall543a7ff2016-01-08 16:38:30 -0800913 //@extension("VK_EXT_debug_report")
914 VK_ERROR_VALIDATION_FAILED_EXT = 0xC4650B07, // -1000011001
Jesse Hall26763382016-05-20 07:13:52 -0700915
916 //@extension("VK_NV_glsl_shader")
917 VK_ERROR_INVALID_SHADER_NV = 0xC4650720, // -1000012000
Jesse Hall08e2f482017-03-06 15:22:17 -0800918
919 //@extension("VK_KHR_maintenance1")
920 VK_ERROR_OUT_OF_POOL_MEMORY_KHR = 0xC4642878, // -1000069000
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700921}
922
923enum VkDynamicState {
924 VK_DYNAMIC_STATE_VIEWPORT = 0x00000000,
925 VK_DYNAMIC_STATE_SCISSOR = 0x00000001,
926 VK_DYNAMIC_STATE_LINE_WIDTH = 0x00000002,
927 VK_DYNAMIC_STATE_DEPTH_BIAS = 0x00000003,
928 VK_DYNAMIC_STATE_BLEND_CONSTANTS = 0x00000004,
929 VK_DYNAMIC_STATE_DEPTH_BOUNDS = 0x00000005,
930 VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK = 0x00000006,
931 VK_DYNAMIC_STATE_STENCIL_WRITE_MASK = 0x00000007,
932 VK_DYNAMIC_STATE_STENCIL_REFERENCE = 0x00000008,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700933}
934
Jesse Hall523db342015-11-30 21:12:55 -0800935@extension("VK_KHR_surface")
Michael Lentine88594d72015-11-12 12:49:45 -0800936enum VkPresentModeKHR {
937 VK_PRESENT_MODE_IMMEDIATE_KHR = 0x00000000,
938 VK_PRESENT_MODE_MAILBOX_KHR = 0x00000001,
939 VK_PRESENT_MODE_FIFO_KHR = 0x00000002,
Jesse Hall03b6fe12015-11-24 12:44:21 -0800940 VK_PRESENT_MODE_FIFO_RELAXED_KHR = 0x00000003,
Michael Lentine88594d72015-11-12 12:49:45 -0800941}
942
Jesse Hall523db342015-11-30 21:12:55 -0800943@extension("VK_KHR_surface")
Michael Lentine88594d72015-11-12 12:49:45 -0800944enum VkColorSpaceKHR {
945 VK_COLORSPACE_SRGB_NONLINEAR_KHR = 0x00000000,
946}
Jesse Halld27f6aa2015-08-15 17:58:48 -0700947
Jesse Hall715b86a2016-01-16 16:34:29 -0800948@extension("VK_EXT_debug_report")
949enum VkDebugReportObjectTypeEXT {
950 VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT = 0,
951 VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT = 1,
952 VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT = 2,
953 VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT = 3,
954 VK_DEBUG_REPORT_OBJECT_TYPE_QUEUE_EXT = 4,
955 VK_DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT = 5,
956 VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT = 6,
957 VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT = 7,
958 VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT = 8,
959 VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT = 9,
960 VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT = 10,
961 VK_DEBUG_REPORT_OBJECT_TYPE_EVENT_EXT = 11,
962 VK_DEBUG_REPORT_OBJECT_TYPE_QUERY_POOL_EXT = 12,
963 VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_VIEW_EXT = 13,
964 VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_VIEW_EXT = 14,
965 VK_DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT = 15,
966 VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_CACHE_EXT = 16,
967 VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_LAYOUT_EXT = 17,
968 VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT = 18,
969 VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT = 19,
970 VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT_EXT = 20,
971 VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_EXT = 21,
972 VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT = 22,
973 VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT = 23,
974 VK_DEBUG_REPORT_OBJECT_TYPE_FRAMEBUFFER_EXT = 24,
975 VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_POOL_EXT = 25,
976 VK_DEBUG_REPORT_OBJECT_TYPE_SURFACE_KHR_EXT = 26,
977 VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT = 27,
978 VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_EXT = 28,
Jesse Halleb02c472017-02-24 15:13:45 -0800979 VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_KHR_EXT = 29,
980 VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_MODE_KHR_EXT = 30,
981 VK_DEBUG_REPORT_OBJECT_TYPE_OBJECT_TABLE_NVX_EXT = 31,
982 VK_DEBUG_REPORT_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NVX_EXT = 32,
Jesse Hall715b86a2016-01-16 16:34:29 -0800983}
984
985@extension("VK_EXT_debug_report")
986enum VkDebugReportErrorEXT {
987 VK_DEBUG_REPORT_ERROR_NONE_EXT = 0,
988 VK_DEBUG_REPORT_ERROR_CALLBACK_REF_EXT = 1,
989}
990
Jesse Hall26763382016-05-20 07:13:52 -0700991@extension("VK_AMD_rasterization_order")
992enum VkRasterizationOrderAMD {
993 VK_RASTERIZATION_ORDER_STRICT_AMD = 0,
994 VK_RASTERIZATION_ORDER_RELAXED_AMD = 1,
995}
996
Jesse Halleb02c472017-02-24 15:13:45 -0800997@extension("VK_EXT_validation_flags")
998enum VkValidationCheckEXT {
999 VK_VALIDATION_CHECK_ALL_EXT = 0,
1000}
1001
1002@extension("VK_NVX_device_generated_commands")
1003enum VkIndirectCommandsTokenTypeNVX {
1004 VK_INDIRECT_COMMANDS_TOKEN_PIPELINE_NVX = 0,
1005 VK_INDIRECT_COMMANDS_TOKEN_DESCRIPTOR_SET_NVX = 1,
1006 VK_INDIRECT_COMMANDS_TOKEN_INDEX_BUFFER_NVX = 2,
1007 VK_INDIRECT_COMMANDS_TOKEN_VERTEX_BUFFER_NVX = 3,
1008 VK_INDIRECT_COMMANDS_TOKEN_PUSH_CONSTANT_NVX = 4,
1009 VK_INDIRECT_COMMANDS_TOKEN_DRAW_INDEXED_NVX = 5,
1010 VK_INDIRECT_COMMANDS_TOKEN_DRAW_NVX = 6,
1011 VK_INDIRECT_COMMANDS_TOKEN_DISPATCH_NVX = 7,
1012}
1013
1014@extension("VK_NVX_device_generated_commands")
1015enum VkObjectEntryTypeNVX {
1016 VK_OBJECT_ENTRY_DESCRIPTOR_SET_NVX = 0,
1017 VK_OBJECT_ENTRY_PIPELINE_NVX = 1,
1018 VK_OBJECT_ENTRY_INDEX_BUFFER_NVX = 2,
1019 VK_OBJECT_ENTRY_VERTEX_BUFFER_NVX = 3,
1020 VK_OBJECT_ENTRY_PUSH_CONSTANT_NVX = 4,
1021}
Jesse Hall715b86a2016-01-16 16:34:29 -08001022
Jesse Hall08e2f482017-03-06 15:22:17 -08001023@extension("VK_EXT_display_control")
1024enum VkDisplayPowerStateEXT {
1025 VK_DISPLAY_POWER_STATE_OFF_EXT = 0,
1026 VK_DISPLAY_POWER_STATE_SUSPEND_EXT = 1,
1027 VK_DISPLAY_POWER_STATE_ON_EXT = 2,
1028}
1029
1030@extension("VK_EXT_display_control")
1031enum VkDeviceEventTypeEXT {
1032 VK_DEVICE_EVENT_TYPE_DISPLAY_HOTPLUG_EXT = 0,
1033}
1034
1035@extension("VK_EXT_display_control")
1036enum VkDisplayEventTypeEXT {
1037 VK_DISPLAY_EVENT_TYPE_FIRST_PIXEL_OUT_EXT = 0,
1038}
1039
Jesse Halld27f6aa2015-08-15 17:58:48 -07001040/////////////////
1041// Bitfields //
1042/////////////////
1043
Jesse Halld27f6aa2015-08-15 17:58:48 -07001044/// Queue capabilities
Jesse Halld8bade02015-11-24 10:24:18 -08001045type VkFlags VkQueueFlags
1046bitfield VkQueueFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001047 VK_QUEUE_GRAPHICS_BIT = 0x00000001, /// Queue supports graphics operations
1048 VK_QUEUE_COMPUTE_BIT = 0x00000002, /// Queue supports compute operations
Jesse Hall65ab5522015-11-30 00:07:16 -08001049 VK_QUEUE_TRANSFER_BIT = 0x00000004, /// Queue supports transfer operations
Jesse Hallb00daad2015-11-29 19:46:20 -08001050 VK_QUEUE_SPARSE_BINDING_BIT = 0x00000008, /// Queue supports sparse resource memory management operations
Jesse Halld27f6aa2015-08-15 17:58:48 -07001051}
1052
1053/// Memory properties passed into vkAllocMemory().
Jesse Halld8bade02015-11-24 10:24:18 -08001054type VkFlags VkMemoryPropertyFlags
1055bitfield VkMemoryPropertyFlagBits {
Jesse Halld1af8122015-11-29 23:50:38 -08001056 VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT = 0x00000001,
1057 VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT = 0x00000002,
1058 VK_MEMORY_PROPERTY_HOST_COHERENT_BIT = 0x00000004,
1059 VK_MEMORY_PROPERTY_HOST_CACHED_BIT = 0x00000008,
1060 VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT = 0x00000010,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001061}
1062
1063/// Memory heap flags
Jesse Halld8bade02015-11-24 10:24:18 -08001064type VkFlags VkMemoryHeapFlags
1065bitfield VkMemoryHeapFlagBits {
Jesse Halld1af8122015-11-29 23:50:38 -08001066 VK_MEMORY_HEAP_DEVICE_LOCAL_BIT = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001067}
1068
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001069/// Access flags
1070type VkFlags VkAccessFlags
1071bitfield VkAccessFlagBits {
1072 VK_ACCESS_INDIRECT_COMMAND_READ_BIT = 0x00000001,
1073 VK_ACCESS_INDEX_READ_BIT = 0x00000002,
1074 VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT = 0x00000004,
1075 VK_ACCESS_UNIFORM_READ_BIT = 0x00000008,
1076 VK_ACCESS_INPUT_ATTACHMENT_READ_BIT = 0x00000010,
1077 VK_ACCESS_SHADER_READ_BIT = 0x00000020,
1078 VK_ACCESS_SHADER_WRITE_BIT = 0x00000040,
1079 VK_ACCESS_COLOR_ATTACHMENT_READ_BIT = 0x00000080,
1080 VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT = 0x00000100,
1081 VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT = 0x00000200,
1082 VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT = 0x00000400,
1083 VK_ACCESS_TRANSFER_READ_BIT = 0x00000800,
1084 VK_ACCESS_TRANSFER_WRITE_BIT = 0x00001000,
1085 VK_ACCESS_HOST_READ_BIT = 0x00002000,
1086 VK_ACCESS_HOST_WRITE_BIT = 0x00004000,
1087 VK_ACCESS_MEMORY_READ_BIT = 0x00008000,
1088 VK_ACCESS_MEMORY_WRITE_BIT = 0x00010000,
Jesse Halleb02c472017-02-24 15:13:45 -08001089
1090 //@extension("VK_NVX_device_generated_commands")
1091 VK_ACCESS_COMMAND_PROCESS_READ_BIT_NVX = 0x00020000,
1092 VK_ACCESS_COMMAND_PROCESS_WRITE_BIT_NVX = 0x00040000,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001093}
1094
1095/// Buffer usage flags
Jesse Halld8bade02015-11-24 10:24:18 -08001096type VkFlags VkBufferUsageFlags
1097bitfield VkBufferUsageFlagBits {
Jesse Hall3fbc8562015-11-29 22:10:52 -08001098 VK_BUFFER_USAGE_TRANSFER_SRC_BIT = 0x00000001, /// Can be used as a source of transfer operations
1099 VK_BUFFER_USAGE_TRANSFER_DST_BIT = 0x00000002, /// Can be used as a destination of transfer operations
Jesse Halld27f6aa2015-08-15 17:58:48 -07001100 VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000004, /// Can be used as TBO
1101 VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT = 0x00000008, /// Can be used as IBO
1102 VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT = 0x00000010, /// Can be used as UBO
1103 VK_BUFFER_USAGE_STORAGE_BUFFER_BIT = 0x00000020, /// Can be used as SSBO
1104 VK_BUFFER_USAGE_INDEX_BUFFER_BIT = 0x00000040, /// Can be used as source of fixed function index fetch (index buffer)
1105 VK_BUFFER_USAGE_VERTEX_BUFFER_BIT = 0x00000080, /// Can be used as source of fixed function vertex fetch (VBO)
1106 VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT = 0x00000100, /// Can be the source of indirect parameters (e.g. indirect buffer, parameter buffer)
1107}
1108
1109/// Buffer creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001110type VkFlags VkBufferCreateFlags
1111bitfield VkBufferCreateFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001112 VK_BUFFER_CREATE_SPARSE_BINDING_BIT = 0x00000001, /// Buffer should support sparse backing
Jesse Halld27f6aa2015-08-15 17:58:48 -07001113 VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002, /// Buffer should support sparse backing with partial residency
1114 VK_BUFFER_CREATE_SPARSE_ALIASED_BIT = 0x00000004, /// Buffer should support constent data access to physical memory blocks mapped into multiple locations of sparse buffers
1115}
1116
1117/// Shader stage flags
Jesse Halld8bade02015-11-24 10:24:18 -08001118type VkFlags VkShaderStageFlags
1119bitfield VkShaderStageFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001120 VK_SHADER_STAGE_VERTEX_BIT = 0x00000001,
Jesse Hallae38f732015-11-19 21:32:50 -08001121 VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT = 0x00000002,
1122 VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001123 VK_SHADER_STAGE_GEOMETRY_BIT = 0x00000008,
1124 VK_SHADER_STAGE_FRAGMENT_BIT = 0x00000010,
1125 VK_SHADER_STAGE_COMPUTE_BIT = 0x00000020,
Jesse Hallc7467b72015-11-29 21:05:26 -08001126 VK_SHADER_STAGE_ALL_GRAPHICS = 0x0000001F,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001127
1128 VK_SHADER_STAGE_ALL = 0x7FFFFFFF,
1129}
1130
Jesse Hallfbf97b02015-11-20 14:17:03 -08001131/// Descriptor pool create flags
Jesse Halld8bade02015-11-24 10:24:18 -08001132type VkFlags VkDescriptorPoolCreateFlags
1133bitfield VkDescriptorPoolCreateFlagBits {
Jesse Hallfbf97b02015-11-20 14:17:03 -08001134 VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT = 0x00000001,
1135}
1136
1137/// Descriptor pool reset flags
Jesse Halld8bade02015-11-24 10:24:18 -08001138type VkFlags VkDescriptorPoolResetFlags
Jesse Halla6429252015-11-29 18:59:42 -08001139//bitfield VkDescriptorPoolResetFlagBits {
1140//}
Jesse Hallfbf97b02015-11-20 14:17:03 -08001141
Jesse Halld27f6aa2015-08-15 17:58:48 -07001142/// Image usage flags
Jesse Halld8bade02015-11-24 10:24:18 -08001143type VkFlags VkImageUsageFlags
1144bitfield VkImageUsageFlagBits {
Jesse Hall3fbc8562015-11-29 22:10:52 -08001145 VK_IMAGE_USAGE_TRANSFER_SRC_BIT = 0x00000001, /// Can be used as a source of transfer operations
1146 VK_IMAGE_USAGE_TRANSFER_DST_BIT = 0x00000002, /// Can be used as a destination of transfer operations
Jesse Halld27f6aa2015-08-15 17:58:48 -07001147 VK_IMAGE_USAGE_SAMPLED_BIT = 0x00000004, /// Can be sampled from (SAMPLED_IMAGE and COMBINED_IMAGE_SAMPLER descriptor types)
1148 VK_IMAGE_USAGE_STORAGE_BIT = 0x00000008, /// Can be used as storage image (STORAGE_IMAGE descriptor type)
1149 VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT = 0x00000010, /// Can be used as framebuffer color attachment
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001150 VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000020, /// Can be used as framebuffer depth/stencil attachment
Jesse Halld27f6aa2015-08-15 17:58:48 -07001151 VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT = 0x00000040, /// Image data not needed outside of rendering
1152 VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT = 0x00000080, /// Can be used as framebuffer input attachment
1153}
1154
1155/// Image creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001156type VkFlags VkImageCreateFlags
1157bitfield VkImageCreateFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001158 VK_IMAGE_CREATE_SPARSE_BINDING_BIT = 0x00000001, /// Image should support sparse backing
Jesse Halld27f6aa2015-08-15 17:58:48 -07001159 VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002, /// Image should support sparse backing with partial residency
1160 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 -07001161 VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT = 0x00000008, /// Allows image views to have different format than the base image
1162 VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT = 0x00000010, /// Allows creating image views with cube type from the created image
Jesse Hall08e2f482017-03-06 15:22:17 -08001163
1164 //@extension("VK_KHR_maintenance1")
1165 VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT_KHR = 0x00000020,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001166}
1167
Jesse Hallb00daad2015-11-29 19:46:20 -08001168/// Image view creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001169type VkFlags VkImageViewCreateFlags
Jesse Hallb00daad2015-11-29 19:46:20 -08001170//bitfield VkImageViewCreateFlagBits {
1171//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001172
1173/// Pipeline creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001174type VkFlags VkPipelineCreateFlags
1175bitfield VkPipelineCreateFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001176 VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT = 0x00000001,
1177 VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT = 0x00000002,
1178 VK_PIPELINE_CREATE_DERIVATIVE_BIT = 0x00000004,
1179}
1180
Jesse Hall65ab5522015-11-30 00:07:16 -08001181/// Color component flags
1182type VkFlags VkColorComponentFlags
1183bitfield VkColorComponentFlagBits {
1184 VK_COLOR_COMPONENT_R_BIT = 0x00000001,
1185 VK_COLOR_COMPONENT_G_BIT = 0x00000002,
1186 VK_COLOR_COMPONENT_B_BIT = 0x00000004,
1187 VK_COLOR_COMPONENT_A_BIT = 0x00000008,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001188}
1189
1190/// Fence creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001191type VkFlags VkFenceCreateFlags
1192bitfield VkFenceCreateFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001193 VK_FENCE_CREATE_SIGNALED_BIT = 0x00000001,
1194}
1195
1196/// Semaphore creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001197type VkFlags VkSemaphoreCreateFlags
Jesse Halla6429252015-11-29 18:59:42 -08001198//bitfield VkSemaphoreCreateFlagBits {
1199//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001200
1201/// Format capability flags
Jesse Halld8bade02015-11-24 10:24:18 -08001202type VkFlags VkFormatFeatureFlags
1203bitfield VkFormatFeatureFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001204 VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT = 0x00000001, /// Format can be used for sampled images (SAMPLED_IMAGE and COMBINED_IMAGE_SAMPLER descriptor types)
1205 VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT = 0x00000002, /// Format can be used for storage images (STORAGE_IMAGE descriptor type)
1206 VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT = 0x00000004, /// Format supports atomic operations in case it's used for storage images
1207 VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000008, /// Format can be used for uniform texel buffers (TBOs)
1208 VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT = 0x00000010, /// Format can be used for storage texel buffers (IBOs)
1209 VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT = 0x00000020, /// Format supports atomic operations in case it's used for storage texel buffers
1210 VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT = 0x00000040, /// Format can be used for vertex buffers (VBOs)
1211 VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT = 0x00000080, /// Format can be used for color attachment images
1212 VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT = 0x00000100, /// Format supports blending in case it's used for color attachment images
1213 VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000200, /// Format can be used for depth/stencil attachment images
Jesse Hall3fbc8562015-11-29 22:10:52 -08001214 VK_FORMAT_FEATURE_BLIT_SRC_BIT = 0x00000400, /// Format can be used as the source image of blits with vkCommandBlitImage
1215 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 -08001216 VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT = 0x00001000,
Jesse Hall26763382016-05-20 07:13:52 -07001217
1218 //@extension("VK_IMG_filter_cubic")
1219 VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG = 0x00002000,
Jesse Hall08e2f482017-03-06 15:22:17 -08001220
1221 //@extension("VK_KHR_maintenance1")
1222 VK_FORMAT_FEATURE_TRANSFER_SRC_BIT_KHR = 0x00004000,
1223 VK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR = 0x00008000,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001224}
1225
1226/// Query control flags
Jesse Halld8bade02015-11-24 10:24:18 -08001227type VkFlags VkQueryControlFlags
1228bitfield VkQueryControlFlagBits {
Jesse Hall65ab5522015-11-30 00:07:16 -08001229 VK_QUERY_CONTROL_PRECISE_BIT = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001230}
1231
1232/// Query result flags
Jesse Halld8bade02015-11-24 10:24:18 -08001233type VkFlags VkQueryResultFlags
1234bitfield VkQueryResultFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001235 VK_QUERY_RESULT_64_BIT = 0x00000001, /// Results of the queries are written to the destination buffer as 64-bit values
1236 VK_QUERY_RESULT_WAIT_BIT = 0x00000002, /// Results of the queries are waited on before proceeding with the result copy
1237 VK_QUERY_RESULT_WITH_AVAILABILITY_BIT = 0x00000004, /// Besides the results of the query, the availability of the results is also written
1238 VK_QUERY_RESULT_PARTIAL_BIT = 0x00000008, /// Copy the partial results of the query even if the final results aren't available
1239}
1240
1241/// Shader module creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001242type VkFlags VkShaderModuleCreateFlags
Jesse Halla6429252015-11-29 18:59:42 -08001243//bitfield VkShaderModuleCreateFlagBits {
1244//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001245
Jesse Halld27f6aa2015-08-15 17:58:48 -07001246/// Event creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001247type VkFlags VkEventCreateFlags
Jesse Halla6429252015-11-29 18:59:42 -08001248//bitfield VkEventCreateFlagBits {
1249//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001250
Jesse Halla15a4bf2015-11-19 22:48:02 -08001251/// Command buffer usage flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001252type VkFlags VkCommandBufferUsageFlags
1253bitfield VkCommandBufferUsageFlagBits {
1254 VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT = 0x00000001,
1255 VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT = 0x00000002,
1256 VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001257}
1258
1259/// Pipeline statistics flags
Jesse Halld8bade02015-11-24 10:24:18 -08001260type VkFlags VkQueryPipelineStatisticFlags
1261bitfield VkQueryPipelineStatisticFlagBits {
Jesse Hallae38f732015-11-19 21:32:50 -08001262 VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_BIT = 0x00000001, /// Optional
1263 VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_PRIMITIVES_BIT = 0x00000002, /// Optional
1264 VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT = 0x00000004, /// Optional
1265 VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_INVOCATIONS_BIT = 0x00000008, /// Optional
1266 VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT = 0x00000010, /// Optional
1267 VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT = 0x00000020, /// Optional
1268 VK_QUERY_PIPELINE_STATISTIC_CLIPPING_PRIMITIVES_BIT = 0x00000040, /// Optional
1269 VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT = 0x00000080, /// Optional
1270 VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT = 0x00000100, /// Optional
1271 VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT = 0x00000200, /// Optional
1272 VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT = 0x00000400, /// Optional
Jesse Halld27f6aa2015-08-15 17:58:48 -07001273}
1274
1275/// Memory mapping flags
Jesse Halld8bade02015-11-24 10:24:18 -08001276type VkFlags VkMemoryMapFlags
Jesse Halla6429252015-11-29 18:59:42 -08001277//bitfield VkMemoryMapFlagBits {
1278//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001279
1280/// Bitfield of image aspects
Jesse Halld8bade02015-11-24 10:24:18 -08001281type VkFlags VkImageAspectFlags
1282bitfield VkImageAspectFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001283 VK_IMAGE_ASPECT_COLOR_BIT = 0x00000001,
1284 VK_IMAGE_ASPECT_DEPTH_BIT = 0x00000002,
1285 VK_IMAGE_ASPECT_STENCIL_BIT = 0x00000004,
1286 VK_IMAGE_ASPECT_METADATA_BIT = 0x00000008,
1287}
1288
1289/// Sparse memory bind flags
Jesse Halld8bade02015-11-24 10:24:18 -08001290type VkFlags VkSparseMemoryBindFlags
Jesse Hall091ed9e2015-11-30 00:55:29 -08001291bitfield VkSparseMemoryBindFlagBits {
1292 VK_SPARSE_MEMORY_BIND_METADATA_BIT = 0x00000001,
1293}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001294
1295/// Sparse image memory requirements flags
Jesse Halld8bade02015-11-24 10:24:18 -08001296type VkFlags VkSparseImageFormatFlags
1297bitfield VkSparseImageFormatFlagBits {
Jesse Hallb00daad2015-11-29 19:46:20 -08001298 VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT = 0x00000001, /// Image uses a single miptail region for all array slices
1299 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.
1300 VK_SPARSE_IMAGE_FORMAT_NONSTANDARD_BLOCK_SIZE_BIT = 0x00000004, /// Image uses a non-standard sparse block size
Jesse Halld27f6aa2015-08-15 17:58:48 -07001301}
1302
1303/// Pipeline stages
Jesse Halld8bade02015-11-24 10:24:18 -08001304type VkFlags VkPipelineStageFlags
1305bitfield VkPipelineStageFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001306 VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT = 0x00000001, /// Before subsequent commands are processed
1307 VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT = 0x00000002, /// Draw/DispatchIndirect command fetch
1308 VK_PIPELINE_STAGE_VERTEX_INPUT_BIT = 0x00000004, /// Vertex/index fetch
1309 VK_PIPELINE_STAGE_VERTEX_SHADER_BIT = 0x00000008, /// Vertex shading
Jesse Hallae38f732015-11-19 21:32:50 -08001310 VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT = 0x00000010, /// Tessellation control shading
1311 VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT = 0x00000020, /// Tessellation evaluation shading
Jesse Halld27f6aa2015-08-15 17:58:48 -07001312 VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT = 0x00000040, /// Geometry shading
1313 VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT = 0x00000080, /// Fragment shading
1314 VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT = 0x00000100, /// Early fragment (depth/stencil) tests
1315 VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT = 0x00000200, /// Late fragment (depth/stencil) tests
1316 VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT = 0x00000400, /// Color attachment writes
1317 VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT = 0x00000800, /// Compute shading
1318 VK_PIPELINE_STAGE_TRANSFER_BIT = 0x00001000, /// Transfer/copy operations
Jesse Hall543a7ff2016-01-08 16:38:30 -08001319 VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT = 0x00002000,
1320 VK_PIPELINE_STAGE_HOST_BIT = 0x00004000, /// Indicates host (CPU) is a source/sink of the dependency
Jesse Halld27f6aa2015-08-15 17:58:48 -07001321
Jesse Hall543a7ff2016-01-08 16:38:30 -08001322 VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT = 0x00008000, /// All stages of the graphics pipeline
1323 VK_PIPELINE_STAGE_ALL_COMMANDS_BIT = 0x00010000, /// All graphics, compute, copy, and transition commands
Jesse Halleb02c472017-02-24 15:13:45 -08001324
1325 //@extension("VK_NVX_device_generated_commands")
1326 VK_PIPELINE_STAGE_COMMAND_PROCESS_BIT_NVX = 0x00020000,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001327}
1328
1329/// Render pass attachment description flags
Jesse Halld8bade02015-11-24 10:24:18 -08001330type VkFlags VkAttachmentDescriptionFlags
1331bitfield VkAttachmentDescriptionFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001332 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 -07001333}
1334
1335/// Subpass description flags
Jesse Halld8bade02015-11-24 10:24:18 -08001336type VkFlags VkSubpassDescriptionFlags
1337bitfield VkSubpassDescriptionFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001338}
1339
1340/// Command pool creation flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001341type VkFlags VkCommandPoolCreateFlags
1342bitfield VkCommandPoolCreateFlagBits {
1343 VK_COMMAND_POOL_CREATE_TRANSIENT_BIT = 0x00000001, /// Command buffers have a short lifetime
1344 VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT = 0x00000002, /// Command buffers may release their memory individually
Jesse Halld27f6aa2015-08-15 17:58:48 -07001345}
1346
1347/// Command pool reset flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001348type VkFlags VkCommandPoolResetFlags
1349bitfield VkCommandPoolResetFlagBits {
1350 VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT = 0x00000001, /// Release resources owned by the pool
Jesse Halld27f6aa2015-08-15 17:58:48 -07001351}
1352
Jesse Hall3fbc8562015-11-29 22:10:52 -08001353type VkFlags VkCommandBufferResetFlags
1354bitfield VkCommandBufferResetFlagBits {
1355 VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT = 0x00000001, /// Release resources owned by the buffer
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001356}
1357
Jesse Halld8bade02015-11-24 10:24:18 -08001358type VkFlags VkSampleCountFlags
1359bitfield VkSampleCountFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001360 VK_SAMPLE_COUNT_1_BIT = 0x00000001,
1361 VK_SAMPLE_COUNT_2_BIT = 0x00000002,
1362 VK_SAMPLE_COUNT_4_BIT = 0x00000004,
1363 VK_SAMPLE_COUNT_8_BIT = 0x00000008,
1364 VK_SAMPLE_COUNT_16_BIT = 0x00000010,
1365 VK_SAMPLE_COUNT_32_BIT = 0x00000020,
1366 VK_SAMPLE_COUNT_64_BIT = 0x00000040,
1367}
1368
Jesse Halld8bade02015-11-24 10:24:18 -08001369type VkFlags VkStencilFaceFlags
1370bitfield VkStencilFaceFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001371 VK_STENCIL_FACE_FRONT_BIT = 0x00000001, /// Front face
1372 VK_STENCIL_FACE_BACK_BIT = 0x00000002, /// Back face
Jesse Hallc7467b72015-11-29 21:05:26 -08001373 VK_STENCIL_FRONT_AND_BACK = 0x00000003,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001374}
1375
Jesse Halla6429252015-11-29 18:59:42 -08001376/// Instance creation flags
1377type VkFlags VkInstanceCreateFlags
1378//bitfield VkInstanceCreateFlagBits {
1379//}
1380
1381/// Device creation flags
1382type VkFlags VkDeviceCreateFlags
1383//bitfield VkDeviceCreateFlagBits {
1384//}
1385
1386/// Device queue creation flags
1387type VkFlags VkDeviceQueueCreateFlags
1388//bitfield VkDeviceQueueCreateFlagBits {
1389//}
1390
1391/// Query pool creation flags
1392type VkFlags VkQueryPoolCreateFlags
1393//bitfield VkQueryPoolCreateFlagBits {
1394//}
1395
1396/// Buffer view creation flags
1397type VkFlags VkBufferViewCreateFlags
1398//bitfield VkBufferViewCreateFlagBits {
1399//}
1400
1401/// Pipeline cache creation flags
1402type VkFlags VkPipelineCacheCreateFlags
1403//bitfield VkPipelineCacheCreateFlagBits {
1404//}
1405
1406/// Pipeline shader stage creation flags
1407type VkFlags VkPipelineShaderStageCreateFlags
1408//bitfield VkPipelineShaderStageCreateFlagBits {
1409//}
1410
1411/// Descriptor set layout creation flags
1412type VkFlags VkDescriptorSetLayoutCreateFlags
1413//bitfield VkDescriptorSetLayoutCreateFlagBits {
1414//}
1415
1416/// Pipeline vertex input state creation flags
1417type VkFlags VkPipelineVertexInputStateCreateFlags
1418//bitfield VkPipelineVertexInputStateCreateFlagBits {
1419//}
1420
1421/// Pipeline input assembly state creation flags
1422type VkFlags VkPipelineInputAssemblyStateCreateFlags
1423//bitfield VkPipelineInputAssemblyStateCreateFlagBits {
1424//}
1425
1426/// Tessellation state creation flags
1427type VkFlags VkPipelineTessellationStateCreateFlags
1428//bitfield VkPipelineTessellationStateCreateFlagBits {
1429//}
1430
1431/// Viewport state creation flags
1432type VkFlags VkPipelineViewportStateCreateFlags
1433//bitfield VkPipelineViewportStateCreateFlagBits {
1434//}
1435
Jesse Hall3fbc8562015-11-29 22:10:52 -08001436/// Rasterization state creation flags
1437type VkFlags VkPipelineRasterizationStateCreateFlags
1438//bitfield VkPipelineRasterizationStateCreateFlagBits {
Jesse Halla6429252015-11-29 18:59:42 -08001439//}
1440
1441/// Multisample state creation flags
1442type VkFlags VkPipelineMultisampleStateCreateFlags
1443//bitfield VkPipelineMultisampleStateCreateFlagBits {
1444//}
1445
1446/// Color blend state creation flags
1447type VkFlags VkPipelineColorBlendStateCreateFlags
1448//bitfield VkPipelineColorBlendStateCreateFlagBits {
1449//}
1450
1451/// Depth/stencil state creation flags
1452type VkFlags VkPipelineDepthStencilStateCreateFlags
1453//bitfield VkPipelineDepthStencilStateCreateFlagBits {
1454//}
1455
1456/// Dynamic state creation flags
1457type VkFlags VkPipelineDynamicStateCreateFlags
1458//bitfield VkPipelineDynamicStateCreateFlagBits {
1459//}
1460
1461/// Pipeline layout creation flags
1462type VkFlags VkPipelineLayoutCreateFlags
1463//bitfield VkPipelineLayoutCreateFlagBits {
1464//}
1465
1466/// Sampler creation flags
1467type VkFlags VkSamplerCreateFlags
1468//bitfield VkSamplerCreateFlagBits {
1469//}
1470
1471/// Render pass creation flags
1472type VkFlags VkRenderPassCreateFlags
1473//bitfield VkRenderPassCreateFlagBits {
1474//}
1475
1476/// Framebuffer creation flags
1477type VkFlags VkFramebufferCreateFlags
1478//bitfield VkFramebufferCreateFlagBits {
1479//}
1480
Jesse Halldc6d36c2015-11-29 19:12:15 -08001481/// Dependency flags
1482type VkFlags VkDependencyFlags
1483bitfield VkDependencyFlagBits {
1484 VK_DEPENDENCY_BY_REGION_BIT = 0x00000001,
1485}
1486
Jesse Hallc7467b72015-11-29 21:05:26 -08001487/// Cull mode flags
1488type VkFlags VkCullModeFlags
1489bitfield VkCullModeFlagBits {
1490 VK_CULL_MODE_NONE = 0x00000000,
1491 VK_CULL_MODE_FRONT_BIT = 0x00000001,
1492 VK_CULL_MODE_BACK_BIT = 0x00000002,
1493 VK_CULL_MODE_FRONT_AND_BACK = 0x00000003,
1494}
1495
Jesse Hall523db342015-11-30 21:12:55 -08001496@extension("VK_KHR_surface")
Jesse Halld8bade02015-11-24 10:24:18 -08001497type VkFlags VkSurfaceTransformFlagsKHR
Jesse Hall523db342015-11-30 21:12:55 -08001498@extension("VK_KHR_surface")
Jesse Halld8bade02015-11-24 10:24:18 -08001499bitfield VkSurfaceTransformFlagBitsKHR {
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001500 VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR = 0x00000001,
Jesse Hall9ba8bc82015-11-30 16:22:16 -08001501 VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR = 0x00000002,
1502 VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR = 0x00000004,
1503 VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR = 0x00000008,
1504 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR = 0x00000010,
1505 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR = 0x00000020,
1506 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR = 0x00000040,
1507 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR = 0x00000080,
1508 VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR = 0x00000100,
Michael Lentine88594d72015-11-12 12:49:45 -08001509}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001510
Jesse Hall523db342015-11-30 21:12:55 -08001511@extension("VK_KHR_surface")
Jesse Halla6429252015-11-29 18:59:42 -08001512type VkFlags VkCompositeAlphaFlagsKHR
Jesse Hall523db342015-11-30 21:12:55 -08001513@extension("VK_KHR_surface")
Jesse Halla6429252015-11-29 18:59:42 -08001514bitfield VkCompositeAlphaFlagBitsKHR {
1515 VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR = 0x00000001,
1516 VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR = 0x00000002,
1517 VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR = 0x00000004,
1518 VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR = 0x00000008,
1519}
1520
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001521@extension("VK_KHR_swapchain")
1522type VkFlags VkSwapchainCreateFlagsKHR
1523//@extension("VK_KHR_swapchain")
1524//bitfield VkSwapchainCreateFlagBitsKHR {
1525//}
1526
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001527@extension("VK_KHR_display")
Jesse Halld8bade02015-11-24 10:24:18 -08001528type VkFlags VkDisplayPlaneAlphaFlagsKHR
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001529@extension("VK_KHR_display")
Jesse Halld8bade02015-11-24 10:24:18 -08001530bitfield VkDisplayPlaneAlphaFlagBitsKHR {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001531 VK_DISPLAY_PLANE_ALPHA_OPAQUE_BIT_KHR = 0x00000001,
1532 VK_DISPLAY_PLANE_ALPHA_GLOBAL_BIT_KHR = 0x00000002,
1533 VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_BIT_KHR = 0x00000004,
1534 VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_PREMULTIPLIED_BIT_KHR = 0x00000008,
Jesse Hall1356b0d2015-11-23 17:24:58 -08001535}
1536
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001537@extension("VK_KHR_display")
1538type VkFlags VkDisplaySurfaceCreateFlagsKHR
1539//@extension("VK_KHR_display")
1540//bitfield VkDisplaySurfaceCreateFlagBitsKHR {
1541//}
1542
Jesse Hall9ba8bc82015-11-30 16:22:16 -08001543@extension("VK_KHR_display")
1544type VkFlags VkDisplayModeCreateFlagsKHR
1545//@extension("VK_KHR_display")
1546//bitfield VkDisplayModeCreateFlagBitsKHR {
1547//}
1548
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001549@extension("VK_KHR_xlib_surface")
1550type VkFlags VkXlibSurfaceCreateFlagsKHR
1551//@extension("VK_KHR_xlib_surface")
1552//bitfield VkXlibSurfaceCreateFlagBitsKHR {
1553//}
1554
1555@extension("VK_KHR_xcb_surface")
1556type VkFlags VkXcbSurfaceCreateFlagsKHR
1557//@extension("VK_KHR_xcb_surface")
1558//bitfield VkXcbSurfaceCreateFlagBitsKHR {
1559//}
1560
1561@extension("VK_KHR_wayland_surface")
1562type VkFlags VkWaylandSurfaceCreateFlagsKHR
1563//@extension("VK_KHR_wayland_surface")
1564//bitfield VkWaylandSurfaceCreateFlagBitsKHR {
1565//}
1566
1567@extension("VK_KHR_mir_surface")
1568type VkFlags VkMirSurfaceCreateFlagsKHR
1569//@extension("VK_KHR_mir_surface")
1570//bitfield VkMirSurfaceCreateFlagBitsKHR {
1571//}
1572
1573@extension("VK_KHR_android_surface")
1574type VkFlags VkAndroidSurfaceCreateFlagsKHR
1575//@extension("VK_KHR_android_surface")
1576//bitfield VkAndroidSurfaceCreateFlagBitsKHR {
1577//}
1578
1579@extension("VK_KHR_win32_surface")
1580type VkFlags VkWin32SurfaceCreateFlagsKHR
1581//@extension("VK_KHR_win32_surface")
1582//bitfield VkWin32SurfaceCreateFlagBitsKHR {
1583//}
1584
Jesse Hall715b86a2016-01-16 16:34:29 -08001585@extension("VK_EXT_debug_report")
1586type VkFlags VkDebugReportFlagsEXT
1587@extension("VK_EXT_debug_report")
1588bitfield VkDebugReportFlagBitsEXT {
Jesse Halle2948d82016-02-25 04:19:32 -08001589 VK_DEBUG_REPORT_INFORMATION_BIT_EXT = 0x00000001,
1590 VK_DEBUG_REPORT_WARNING_BIT_EXT = 0x00000002,
1591 VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT = 0x00000004,
Jesse Hall715b86a2016-01-16 16:34:29 -08001592 VK_DEBUG_REPORT_ERROR_BIT_EXT = 0x00000008,
1593 VK_DEBUG_REPORT_DEBUG_BIT_EXT = 0x00000010,
1594}
1595
Jesse Halleb02c472017-02-24 15:13:45 -08001596@extension("VK_NV_external_memory_capabilities")
1597type VkFlags VkExternalMemoryHandleTypeFlagsNV
1598@extension("VK_NV_external_memory_capabilities")
1599bitfield VkExternalMemoryHandleTypeFlagBitsNV {
1600 VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_NV = 0x00000001,
1601 VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_NV = 0x00000002,
1602 VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_IMAGE_BIT_NV = 0x00000004,
1603 VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_IMAGE_KMT_BIT_NV = 0x00000008,
1604}
1605
1606@extension("VK_NV_external_memory_capabilities")
1607type VkFlags VkExternalMemoryFeatureFlagsNV
1608@extension("VK_NV_external_memory_capabilities")
1609bitfield VkExternalMemoryFeatureFlagBitsNV {
1610 VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT_NV = 0x00000001,
1611 VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT_NV = 0x00000002,
1612 VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT_NV = 0x00000004,
1613}
1614
Jesse Hall08e2f482017-03-06 15:22:17 -08001615@extension("VK_NN_vi_surface")
1616type VkFlags VkViSurfaceCreateFlagsNN
1617//@extension("VK_NN_vi_surface")
1618//bitfield VkViSurfaceCreateFlagBitsNN {
1619//}
1620
1621@extension("VK_KHR_maintenance1")
1622type VkFlags VkCommandPoolTrimFlagsKHR
1623//@extension("VK_KHR_maintenance1")
1624//bitfield VkCommandPoolTrimFlagBitsKHR {
1625//}
1626
Jesse Halleb02c472017-02-24 15:13:45 -08001627@extension("VK_NVX_device_generated_commands")
1628type VkFlags VkIndirectCommandsLayoutUsageFlagsNVX
1629@extension("VK_NVX_device_generated_commands")
1630bitfield VkIndirectCommandsLayoutUsageFlagBitsNVX {
1631 VK_INDIRECT_COMMANDS_LAYOUT_USAGE_UNORDERED_SEQUENCES_BIT_NVX = 0x00000001,
1632 VK_INDIRECT_COMMANDS_LAYOUT_USAGE_SPARSE_SEQUENCES_BIT_NVX = 0x00000002,
1633 VK_INDIRECT_COMMANDS_LAYOUT_USAGE_EMPTY_EXECUTIONS_BIT_NVX = 0x00000004,
1634 VK_INDIRECT_COMMANDS_LAYOUT_USAGE_INDEXED_SEQUENCES_BIT_NVX = 0x00000008,
1635}
1636
1637@extension("VK_NVX_device_generated_commands")
1638type VkFlags VkObjectEntryUsageFlagsNVX
1639@extension("VK_NVX_device_generated_commands")
1640bitfield VkObjectEntryUsageFlagBitsNVX {
1641 VK_OBJECT_ENTRY_USAGE_GRAPHICS_BIT_NVX = 0x00000001,
1642 VK_OBJECT_ENTRY_USAGE_COMPUTE_BIT_NVX = 0x00000002,
1643}
1644
Jesse Hall08e2f482017-03-06 15:22:17 -08001645@extension("VK_EXT_display_surface_counter")
1646type VkFlags VkSurfaceCounterFlagsEXT
1647@extension("VK_EXT_display_surface_counter")
1648bitfield VkSurfaceCounterFlagBitsEXT {
1649 VK_SURFACE_COUNTER_VBLANK_EXT = 0x00000001,
1650}
Jesse Hall1356b0d2015-11-23 17:24:58 -08001651
Jesse Halld27f6aa2015-08-15 17:58:48 -07001652//////////////////
1653// Structures //
1654//////////////////
1655
1656class VkOffset2D {
1657 s32 x
1658 s32 y
1659}
1660
1661class VkOffset3D {
1662 s32 x
1663 s32 y
1664 s32 z
1665}
1666
1667class VkExtent2D {
Jesse Hall3dd678a2016-01-08 21:52:01 -08001668 u32 width
1669 u32 height
Jesse Halld27f6aa2015-08-15 17:58:48 -07001670}
1671
1672class VkExtent3D {
Jesse Hall3dd678a2016-01-08 21:52:01 -08001673 u32 width
1674 u32 height
1675 u32 depth
Jesse Halld27f6aa2015-08-15 17:58:48 -07001676}
1677
1678class VkViewport {
Jesse Hall65ab5522015-11-30 00:07:16 -08001679 f32 x
1680 f32 y
Jesse Halld27f6aa2015-08-15 17:58:48 -07001681 f32 width
1682 f32 height
1683 f32 minDepth
1684 f32 maxDepth
1685}
1686
1687class VkRect2D {
1688 VkOffset2D offset
1689 VkExtent2D extent
1690}
1691
Jesse Halla15a4bf2015-11-19 22:48:02 -08001692class VkClearRect {
1693 VkRect2D rect
1694 u32 baseArrayLayer
Jesse Hall3fbc8562015-11-29 22:10:52 -08001695 u32 layerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001696}
1697
Jesse Hall65ab5522015-11-30 00:07:16 -08001698class VkComponentMapping {
1699 VkComponentSwizzle r
1700 VkComponentSwizzle g
1701 VkComponentSwizzle b
1702 VkComponentSwizzle a
Jesse Halld27f6aa2015-08-15 17:58:48 -07001703}
1704
1705class VkPhysicalDeviceProperties {
1706 u32 apiVersion
1707 u32 driverVersion
Jesse Hall65ab5522015-11-30 00:07:16 -08001708 u32 vendorID
1709 u32 deviceID
Jesse Halld27f6aa2015-08-15 17:58:48 -07001710 VkPhysicalDeviceType deviceType
Jesse Hall65ab5522015-11-30 00:07:16 -08001711 char[VK_MAX_PHYSICAL_DEVICE_NAME_SIZE] deviceName
1712 u8[VK_UUID_SIZE] pipelineCacheUUID
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001713 VkPhysicalDeviceLimits limits
1714 VkPhysicalDeviceSparseProperties sparseProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07001715}
1716
1717class VkExtensionProperties {
Jesse Hall65ab5522015-11-30 00:07:16 -08001718 char[VK_MAX_EXTENSION_NAME_SIZE] extensionName /// extension name
Jesse Halld27f6aa2015-08-15 17:58:48 -07001719 u32 specVersion /// version of the extension specification implemented
1720}
1721
1722class VkLayerProperties {
Jesse Hall65ab5522015-11-30 00:07:16 -08001723 char[VK_MAX_EXTENSION_NAME_SIZE] layerName /// layer name
Jesse Hall3fbc8562015-11-29 22:10:52 -08001724 u32 specVersion /// version of the layer specification implemented
1725 u32 implementationVersion /// build or release version of the layer's library
Jesse Hall65ab5522015-11-30 00:07:16 -08001726 char[VK_MAX_DESCRIPTION_SIZE] description /// Free-form description of the layer
Jesse Halld27f6aa2015-08-15 17:58:48 -07001727}
1728
Jesse Halla366a512015-11-19 22:30:07 -08001729class VkSubmitInfo {
Jesse Hall03b6fe12015-11-24 12:44:21 -08001730 VkStructureType sType /// Type of structure. Should be VK_STRUCTURE_TYPE_SUBMIT_INFO
1731 const void* pNext /// Next structure in chain
1732 u32 waitSemaphoreCount
Jesse Halla366a512015-11-19 22:30:07 -08001733 const VkSemaphore* pWaitSemaphores
Jesse Hall543a7ff2016-01-08 16:38:30 -08001734 const VkPipelineStageFlags* pWaitDstStageMask
Jesse Hall03b6fe12015-11-24 12:44:21 -08001735 u32 commandBufferCount
Jesse Hall3fbc8562015-11-29 22:10:52 -08001736 const VkCommandBuffer* pCommandBuffers
Jesse Hall03b6fe12015-11-24 12:44:21 -08001737 u32 signalSemaphoreCount
Jesse Halla366a512015-11-19 22:30:07 -08001738 const VkSemaphore* pSignalSemaphores
1739}
1740
Jesse Halld27f6aa2015-08-15 17:58:48 -07001741class VkApplicationInfo {
1742 VkStructureType sType /// Type of structure. Should be VK_STRUCTURE_TYPE_APPLICATION_INFO
1743 const void* pNext /// Next structure in chain
Jesse Hall3fbc8562015-11-29 22:10:52 -08001744 const char* pApplicationName
1745 u32 applicationVersion
Jesse Halld27f6aa2015-08-15 17:58:48 -07001746 const char* pEngineName
1747 u32 engineVersion
1748 u32 apiVersion
1749}
1750
Jesse Hall3fbc8562015-11-29 22:10:52 -08001751class VkAllocationCallbacks {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001752 void* pUserData
Jesse Hall3fbc8562015-11-29 22:10:52 -08001753 PFN_vkAllocationFunction pfnAllocation
1754 PFN_vkReallocationFunction pfnReallocation
Jesse Halld27f6aa2015-08-15 17:58:48 -07001755 PFN_vkFreeFunction pfnFree
Jesse Hall3fbc8562015-11-29 22:10:52 -08001756 PFN_vkInternalAllocationNotification pfnInternalAllocation
Jesse Hall03b6fe12015-11-24 12:44:21 -08001757 PFN_vkInternalFreeNotification pfnInternalFree
Jesse Halld27f6aa2015-08-15 17:58:48 -07001758}
1759
1760class VkDeviceQueueCreateInfo {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001761 VkStructureType sStype /// Should be VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO
1762 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001763 VkDeviceQueueCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001764 u32 queueFamilyIndex
Jesse Halldba27f72015-11-30 14:25:46 -08001765 u32 queueCount
Jesse Hallfbf97b02015-11-20 14:17:03 -08001766 const f32* pQueuePriorities
Jesse Halld27f6aa2015-08-15 17:58:48 -07001767}
1768
1769class VkDeviceCreateInfo {
1770 VkStructureType sType /// Should be VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO
1771 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001772 VkDeviceCreateFlags flags
Jesse Halldba27f72015-11-30 14:25:46 -08001773 u32 queueCreateInfoCount
1774 const VkDeviceQueueCreateInfo* pQueueCreateInfos
Jesse Hall3dd678a2016-01-08 21:52:01 -08001775 u32 enabledLayerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001776 const char* const* ppEnabledLayerNames /// Ordered list of layer names to be enabled
Jesse Hall3dd678a2016-01-08 21:52:01 -08001777 u32 enabledExtensionCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001778 const char* const* ppEnabledExtensionNames
1779 const VkPhysicalDeviceFeatures* pEnabledFeatures
Jesse Halld27f6aa2015-08-15 17:58:48 -07001780}
1781
1782class VkInstanceCreateInfo {
1783 VkStructureType sType /// Should be VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO
1784 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001785 VkInstanceCreateFlags flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001786 const VkApplicationInfo* pApplicationInfo
Jesse Hall3dd678a2016-01-08 21:52:01 -08001787 u32 enabledLayerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001788 const char* const* ppEnabledLayerNames /// Ordered list of layer names to be enabled
Jesse Hall3dd678a2016-01-08 21:52:01 -08001789 u32 enabledExtensionCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001790 const char* const* ppEnabledExtensionNames /// Extension names to be enabled
1791}
1792
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001793class VkQueueFamilyProperties {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001794 VkQueueFlags queueFlags /// Queue flags
1795 u32 queueCount
Jesse Hallacfa5342015-11-19 21:51:33 -08001796 u32 timestampValidBits
Jesse Hall65ab5522015-11-30 00:07:16 -08001797 VkExtent3D minImageTransferGranularity
Jesse Halld27f6aa2015-08-15 17:58:48 -07001798}
1799
1800class VkPhysicalDeviceMemoryProperties {
1801 u32 memoryTypeCount
1802 VkMemoryType[VK_MAX_MEMORY_TYPES] memoryTypes
1803 u32 memoryHeapCount
1804 VkMemoryHeap[VK_MAX_MEMORY_HEAPS] memoryHeaps
1805}
1806
Jesse Hall3fbc8562015-11-29 22:10:52 -08001807class VkMemoryAllocateInfo {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001808 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07001809 const void* pNext /// Pointer to next structure
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001810 VkDeviceSize allocationSize /// Size of memory allocation
Jesse Halld27f6aa2015-08-15 17:58:48 -07001811 u32 memoryTypeIndex /// Index of the of the memory type to allocate from
1812}
1813
1814class VkMemoryRequirements {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001815 VkDeviceSize size /// Specified in bytes
1816 VkDeviceSize alignment /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001817 u32 memoryTypeBits /// Bitfield of the allowed memory type indices into memoryTypes[] for this object
1818}
1819
1820class VkSparseImageFormatProperties {
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001821 VkImageAspectFlagBits aspectMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001822 VkExtent3D imageGranularity
1823 VkSparseImageFormatFlags flags
1824}
1825
1826class VkSparseImageMemoryRequirements {
Jesse Hallb00daad2015-11-29 19:46:20 -08001827 VkSparseImageFormatProperties formatProperties
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001828 u32 imageMipTailFirstLod
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001829 VkDeviceSize imageMipTailSize /// Specified in bytes, must be a multiple of image block size / alignment
1830 VkDeviceSize imageMipTailOffset /// Specified in bytes, must be a multiple of image block size / alignment
1831 VkDeviceSize imageMipTailStride /// Specified in bytes, must be a multiple of image block size / alignment
Jesse Halld27f6aa2015-08-15 17:58:48 -07001832}
1833
1834class VkMemoryType {
1835 VkMemoryPropertyFlags propertyFlags /// Memory properties of this memory type
1836 u32 heapIndex /// Index of the memory heap allocations of this memory type are taken from
1837}
1838
1839class VkMemoryHeap {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001840 VkDeviceSize size /// Available memory in the heap
Jesse Halld27f6aa2015-08-15 17:58:48 -07001841 VkMemoryHeapFlags flags /// Flags for the heap
1842}
1843
1844class VkMappedMemoryRange {
1845 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE
1846 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08001847 VkDeviceMemory memory /// Mapped memory object
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001848 VkDeviceSize offset /// Offset within the mapped memory the range starts from
1849 VkDeviceSize size /// Size of the range within the mapped memory
Jesse Halld27f6aa2015-08-15 17:58:48 -07001850}
1851
1852class VkFormatProperties {
1853 VkFormatFeatureFlags linearTilingFeatures /// Format features in case of linear tiling
1854 VkFormatFeatureFlags optimalTilingFeatures /// Format features in case of optimal tiling
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001855 VkFormatFeatureFlags bufferFeatures /// Format features supported by buffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07001856}
1857
1858class VkImageFormatProperties {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001859 VkExtent3D maxExtent /// max image dimensions for this resource type
1860 u32 maxMipLevels /// max number of mipmap levels for this resource type
Jesse Halla15a4bf2015-11-19 22:48:02 -08001861 u32 maxArrayLayers /// max array layers for this resource type
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001862 VkSampleCountFlags sampleCounts /// supported sample counts for this resource type
1863 VkDeviceSize maxResourceSize /// max size (in bytes) of this resource type
1864}
1865
Jesse Halla15a4bf2015-11-19 22:48:02 -08001866class VkDescriptorImageInfo {
1867 VkSampler sampler
1868 VkImageView imageView
1869 VkImageLayout imageLayout
1870}
1871
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001872class VkDescriptorBufferInfo {
1873 VkBuffer buffer /// Buffer used for this descriptor when the descriptor is UNIFORM_BUFFER[_DYNAMIC]
1874 VkDeviceSize offset /// Base offset from buffer start in bytes to update in the descriptor set.
1875 VkDeviceSize range /// Size in bytes of the buffer resource for this descriptor update.
Jesse Halld27f6aa2015-08-15 17:58:48 -07001876}
1877
Jesse Halld27f6aa2015-08-15 17:58:48 -07001878class VkWriteDescriptorSet {
1879 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET
1880 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08001881 VkDescriptorSet dstSet /// Destination descriptor set
1882 u32 dstBinding /// Binding within the destination descriptor set to write
1883 u32 dstArrayElement /// Array element within the destination binding to write
Jesse Hall03b6fe12015-11-24 12:44:21 -08001884 u32 descriptorCount /// Number of descriptors to write (determines the size of the array pointed by <pDescriptors>)
Jesse Halld27f6aa2015-08-15 17:58:48 -07001885 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 -08001886 const VkDescriptorImageInfo* pImageInfo
1887 const VkDescriptorBufferInfo* pBufferInfo
1888 const VkBufferView* pTexelBufferView
Jesse Halld27f6aa2015-08-15 17:58:48 -07001889}
1890
1891class VkCopyDescriptorSet {
1892 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET
1893 const void* pNext /// Pointer to next structure
1894 VkDescriptorSet srcSet /// Source descriptor set
1895 u32 srcBinding /// Binding within the source descriptor set to copy from
1896 u32 srcArrayElement /// Array element within the source binding to copy from
Jesse Hall3fbc8562015-11-29 22:10:52 -08001897 VkDescriptorSet dstSet /// Destination descriptor set
1898 u32 dstBinding /// Binding within the destination descriptor set to copy to
1899 u32 dstArrayElement /// Array element within the destination binding to copy to
Jesse Hall03b6fe12015-11-24 12:44:21 -08001900 u32 descriptorCount /// Number of descriptors to copy
Jesse Halld27f6aa2015-08-15 17:58:48 -07001901}
1902
1903class VkBufferCreateInfo {
1904 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO
1905 const void* pNext /// Pointer to next structure.
Jesse Halla6429252015-11-29 18:59:42 -08001906 VkBufferCreateFlags flags /// Buffer creation flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001907 VkDeviceSize size /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001908 VkBufferUsageFlags usage /// Buffer usage flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001909 VkSharingMode sharingMode
Jesse Hall03b6fe12015-11-24 12:44:21 -08001910 u32 queueFamilyIndexCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001911 const u32* pQueueFamilyIndices
1912}
1913
1914class VkBufferViewCreateInfo {
1915 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO
1916 const void* pNext /// Pointer to next structure.
Jesse Halla6429252015-11-29 18:59:42 -08001917 VkBufferViewCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001918 VkBuffer buffer
Jesse Halld27f6aa2015-08-15 17:58:48 -07001919 VkFormat format /// Optionally specifies format of elements
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001920 VkDeviceSize offset /// Specified in bytes
1921 VkDeviceSize range /// View size specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001922}
1923
1924class VkImageSubresource {
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001925 VkImageAspectFlagBits aspectMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001926 u32 mipLevel
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001927 u32 arrayLayer
Jesse Halld27f6aa2015-08-15 17:58:48 -07001928}
1929
1930class VkImageSubresourceRange {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001931 VkImageAspectFlags aspectMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001932 u32 baseMipLevel
Jesse Hall3fbc8562015-11-29 22:10:52 -08001933 u32 levelCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001934 u32 baseArrayLayer
Jesse Hall3fbc8562015-11-29 22:10:52 -08001935 u32 layerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001936}
1937
1938class VkMemoryBarrier {
1939 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MEMORY_BARRIER
1940 const void* pNext /// Pointer to next structure.
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001941 VkAccessFlags srcAccessMask
1942 VkAccessFlags dstAccessMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001943}
1944
1945class VkBufferMemoryBarrier {
1946 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER
1947 const void* pNext /// Pointer to next structure.
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001948 VkAccessFlags srcAccessMask
1949 VkAccessFlags dstAccessMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001950 u32 srcQueueFamilyIndex /// Queue family to transition ownership from
Jesse Hall3fbc8562015-11-29 22:10:52 -08001951 u32 dstQueueFamilyIndex /// Queue family to transition ownership to
Jesse Halld27f6aa2015-08-15 17:58:48 -07001952 VkBuffer buffer /// Buffer to sync
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001953 VkDeviceSize offset /// Offset within the buffer to sync
1954 VkDeviceSize size /// Amount of bytes to sync
Jesse Halld27f6aa2015-08-15 17:58:48 -07001955}
1956
1957class VkImageMemoryBarrier {
1958 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER
1959 const void* pNext /// Pointer to next structure.
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001960 VkAccessFlags srcAccessMask
1961 VkAccessFlags dstAccessMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001962 VkImageLayout oldLayout /// Current layout of the image
1963 VkImageLayout newLayout /// New layout to transition the image to
1964 u32 srcQueueFamilyIndex /// Queue family to transition ownership from
Jesse Hall3fbc8562015-11-29 22:10:52 -08001965 u32 dstQueueFamilyIndex /// Queue family to transition ownership to
Jesse Halld27f6aa2015-08-15 17:58:48 -07001966 VkImage image /// Image to sync
1967 VkImageSubresourceRange subresourceRange /// Subresource range to sync
1968}
1969
1970class VkImageCreateInfo {
1971 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO
1972 const void* pNext /// Pointer to next structure.
Jesse Halla6429252015-11-29 18:59:42 -08001973 VkImageCreateFlags flags /// Image creation flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001974 VkImageType imageType
1975 VkFormat format
1976 VkExtent3D extent
1977 u32 mipLevels
Jesse Halla15a4bf2015-11-19 22:48:02 -08001978 u32 arrayLayers
Jesse Hall091ed9e2015-11-30 00:55:29 -08001979 VkSampleCountFlagBits samples
Jesse Halld27f6aa2015-08-15 17:58:48 -07001980 VkImageTiling tiling
1981 VkImageUsageFlags usage /// Image usage flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001982 VkSharingMode sharingMode /// Cross-queue-family sharing mode
Jesse Hall03b6fe12015-11-24 12:44:21 -08001983 u32 queueFamilyIndexCount /// Number of queue families to share across
Jesse Halld27f6aa2015-08-15 17:58:48 -07001984 const u32* pQueueFamilyIndices /// Array of queue family indices to share across
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001985 VkImageLayout initialLayout /// Initial image layout for all subresources
Jesse Halld27f6aa2015-08-15 17:58:48 -07001986}
1987
1988class VkSubresourceLayout {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001989 VkDeviceSize offset /// Specified in bytes
1990 VkDeviceSize size /// Specified in bytes
1991 VkDeviceSize rowPitch /// Specified in bytes
Jesse Hall543a7ff2016-01-08 16:38:30 -08001992 VkDeviceSize arrayPitch /// Specified in bytes
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001993 VkDeviceSize depthPitch /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001994}
1995
1996class VkImageViewCreateInfo {
1997 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO
1998 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001999 VkImageViewCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002000 VkImage image
2001 VkImageViewType viewType
2002 VkFormat format
Jesse Hall65ab5522015-11-30 00:07:16 -08002003 VkComponentMapping components
Jesse Halld27f6aa2015-08-15 17:58:48 -07002004 VkImageSubresourceRange subresourceRange
Jesse Halld27f6aa2015-08-15 17:58:48 -07002005}
2006
2007class VkBufferCopy {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002008 VkDeviceSize srcOffset /// Specified in bytes
Jesse Hall3fbc8562015-11-29 22:10:52 -08002009 VkDeviceSize dstOffset /// Specified in bytes
Jesse Hallb00daad2015-11-29 19:46:20 -08002010 VkDeviceSize size /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002011}
2012
Jesse Halla6429252015-11-29 18:59:42 -08002013class VkSparseMemoryBind {
Jesse Hallb00daad2015-11-29 19:46:20 -08002014 VkDeviceSize resourceOffset /// Specified in bytes
2015 VkDeviceSize size /// Specified in bytes
Jesse Hall3fbc8562015-11-29 22:10:52 -08002016 VkDeviceMemory memory
2017 VkDeviceSize memoryOffset /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002018 VkSparseMemoryBindFlags flags
2019}
2020
Jesse Halla6429252015-11-29 18:59:42 -08002021class VkSparseImageMemoryBind {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002022 VkImageSubresource subresource
2023 VkOffset3D offset
2024 VkExtent3D extent
Jesse Hall3fbc8562015-11-29 22:10:52 -08002025 VkDeviceMemory memory
2026 VkDeviceSize memoryOffset /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002027 VkSparseMemoryBindFlags flags
2028}
2029
Jesse Halla6429252015-11-29 18:59:42 -08002030class VkSparseBufferMemoryBindInfo {
2031 VkBuffer buffer
2032 u32 bindCount
2033 const VkSparseMemoryBind* pBinds
2034}
2035
2036class VkSparseImageOpaqueMemoryBindInfo {
2037 VkImage image
2038 u32 bindCount
2039 const VkSparseMemoryBind* pBinds
2040}
2041
2042class VkSparseImageMemoryBindInfo {
2043 VkImage image
2044 u32 bindCount
2045 const VkSparseMemoryBind* pBinds
2046}
2047
2048class VkBindSparseInfo {
2049 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BIND_SPARSE_INFO
2050 const void* pNext
2051 u32 waitSemaphoreCount
2052 const VkSemaphore* pWaitSemaphores
2053 u32 numBufferBinds
2054 const VkSparseBufferMemoryBindInfo* pBufferBinds
2055 u32 numImageOpaqueBinds
2056 const VkSparseImageOpaqueMemoryBindInfo* pImageOpaqueBinds
2057 u32 numImageBinds
2058 const VkSparseImageMemoryBindInfo* pImageBinds
2059 u32 signalSemaphoreCount
2060 const VkSemaphore* pSignalSemaphores
2061}
2062
Jesse Hall65ab5522015-11-30 00:07:16 -08002063class VkImageSubresourceLayers {
2064 VkImageAspectFlags aspectMask
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002065 u32 mipLevel
Jesse Halla15a4bf2015-11-19 22:48:02 -08002066 u32 baseArrayLayer
Jesse Hall3fbc8562015-11-29 22:10:52 -08002067 u32 layerCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002068}
2069
Jesse Halld27f6aa2015-08-15 17:58:48 -07002070class VkImageCopy {
Jesse Hall65ab5522015-11-30 00:07:16 -08002071 VkImageSubresourceLayers srcSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07002072 VkOffset3D srcOffset /// Specified in pixels for both compressed and uncompressed images
Jesse Hall65ab5522015-11-30 00:07:16 -08002073 VkImageSubresourceLayers dstSubresource
Jesse Hall3fbc8562015-11-29 22:10:52 -08002074 VkOffset3D dstOffset /// Specified in pixels for both compressed and uncompressed images
Jesse Halld27f6aa2015-08-15 17:58:48 -07002075 VkExtent3D extent /// Specified in pixels for both compressed and uncompressed images
2076}
2077
2078class VkImageBlit {
Jesse Hall65ab5522015-11-30 00:07:16 -08002079 VkImageSubresourceLayers srcSubresource
Jesse Hall3dd678a2016-01-08 21:52:01 -08002080 VkOffset3D[2] srcOffsets
Jesse Hall65ab5522015-11-30 00:07:16 -08002081 VkImageSubresourceLayers dstSubresource
Jesse Hall3dd678a2016-01-08 21:52:01 -08002082 VkOffset3D[2] dstOffsets
Jesse Halld27f6aa2015-08-15 17:58:48 -07002083}
2084
2085class VkBufferImageCopy {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002086 VkDeviceSize bufferOffset /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002087 u32 bufferRowLength /// Specified in texels
2088 u32 bufferImageHeight
Jesse Hall65ab5522015-11-30 00:07:16 -08002089 VkImageSubresourceLayers imageSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07002090 VkOffset3D imageOffset /// Specified in pixels for both compressed and uncompressed images
2091 VkExtent3D imageExtent /// Specified in pixels for both compressed and uncompressed images
2092}
2093
2094class VkImageResolve {
Jesse Hall65ab5522015-11-30 00:07:16 -08002095 VkImageSubresourceLayers srcSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07002096 VkOffset3D srcOffset
Jesse Hall65ab5522015-11-30 00:07:16 -08002097 VkImageSubresourceLayers dstSubresource
Jesse Hall3fbc8562015-11-29 22:10:52 -08002098 VkOffset3D dstOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07002099 VkExtent3D extent
2100}
2101
2102class VkShaderModuleCreateInfo {
2103 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO
2104 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002105 VkShaderModuleCreateFlags flags /// Reserved
Jesse Halld27f6aa2015-08-15 17:58:48 -07002106 platform.size_t codeSize /// Specified in bytes
Jesse Halla9bb62b2015-11-21 19:31:56 -08002107 const u32* pCode /// Binary code of size codeSize
Jesse Halld27f6aa2015-08-15 17:58:48 -07002108}
2109
Jesse Halld27f6aa2015-08-15 17:58:48 -07002110class VkDescriptorSetLayoutBinding {
Jesse Hall091ed9e2015-11-30 00:55:29 -08002111 u32 binding
Jesse Halld27f6aa2015-08-15 17:58:48 -07002112 VkDescriptorType descriptorType /// Type of the descriptors in this binding
Jesse Halldba27f72015-11-30 14:25:46 -08002113 u32 descriptorCount /// Number of descriptors in this binding
Jesse Halld27f6aa2015-08-15 17:58:48 -07002114 VkShaderStageFlags stageFlags /// Shader stages this binding is visible to
2115 const VkSampler* pImmutableSamplers /// Immutable samplers (used if descriptor type is SAMPLER or COMBINED_IMAGE_SAMPLER, is either NULL or contains <count> number of elements)
2116}
2117
2118class VkDescriptorSetLayoutCreateInfo {
2119 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO
2120 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002121 VkDescriptorSetLayoutCreateFlags flags
Jesse Hall03b6fe12015-11-24 12:44:21 -08002122 u32 bindingCount /// Number of bindings in the descriptor set layout
Jesse Hall543a7ff2016-01-08 16:38:30 -08002123 const VkDescriptorSetLayoutBinding* pBindings /// Array of descriptor set layout bindings
Jesse Halld27f6aa2015-08-15 17:58:48 -07002124}
2125
Jesse Hall65ab5522015-11-30 00:07:16 -08002126class VkDescriptorPoolSize {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002127 VkDescriptorType type
Jesse Hall03b6fe12015-11-24 12:44:21 -08002128 u32 descriptorCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002129}
2130
2131class VkDescriptorPoolCreateInfo {
2132 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO
2133 const void* pNext /// Pointer to next structure
Jesse Hallfbf97b02015-11-20 14:17:03 -08002134 VkDescriptorPoolCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002135 u32 maxSets
Jesse Hall65ab5522015-11-30 00:07:16 -08002136 u32 poolSizeCount
2137 const VkDescriptorPoolSize* pPoolSizes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002138}
2139
Jesse Hall3fbc8562015-11-29 22:10:52 -08002140class VkDescriptorSetAllocateInfo {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002141 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO
Jesse Hallfbf97b02015-11-20 14:17:03 -08002142 const void* pNext /// Pointer to next structure
2143 VkDescriptorPool descriptorPool
Jesse Hall03b6fe12015-11-24 12:44:21 -08002144 u32 setCount
Jesse Hallfbf97b02015-11-20 14:17:03 -08002145 const VkDescriptorSetLayout* pSetLayouts
2146}
2147
Jesse Halld27f6aa2015-08-15 17:58:48 -07002148class VkSpecializationMapEntry {
Jesse Hall65ab5522015-11-30 00:07:16 -08002149 u32 constantID /// The SpecConstant ID specified in the BIL
Jesse Halld27f6aa2015-08-15 17:58:48 -07002150 u32 offset /// Offset of the value in the data block
Jesse Hallb00daad2015-11-29 19:46:20 -08002151 platform.size_t size /// Size in bytes of the SpecConstant
Jesse Halld27f6aa2015-08-15 17:58:48 -07002152}
2153
2154class VkSpecializationInfo {
2155 u32 mapEntryCount /// Number of entries in the map
Jesse Hallb00daad2015-11-29 19:46:20 -08002156 const VkSpecializationMapEntry* pMapEntries /// Array of map entries
Jesse Halld27f6aa2015-08-15 17:58:48 -07002157 platform.size_t dataSize /// Size in bytes of pData
2158 const void* pData /// Pointer to SpecConstant data
2159}
2160
2161class VkPipelineShaderStageCreateInfo {
2162 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO
2163 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002164 VkPipelineShaderStageCreateFlags flags
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002165 VkShaderStageFlagBits stage
2166 VkShaderModule module
2167 const char* pName
Jesse Halld27f6aa2015-08-15 17:58:48 -07002168 const VkSpecializationInfo* pSpecializationInfo
2169}
2170
2171class VkComputePipelineCreateInfo {
2172 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO
2173 const void* pNext /// Pointer to next structure
Jesse Halld27f6aa2015-08-15 17:58:48 -07002174 VkPipelineCreateFlags flags /// Pipeline creation flags
Jesse Halla6429252015-11-29 18:59:42 -08002175 VkPipelineShaderStageCreateInfo stage
Jesse Halld27f6aa2015-08-15 17:58:48 -07002176 VkPipelineLayout layout /// Interface layout of the pipeline
2177 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
2178 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
2179}
2180
2181class VkVertexInputBindingDescription {
Jesse Hallb00daad2015-11-29 19:46:20 -08002182 u32 binding /// Vertex buffer binding id
2183 u32 stride /// Distance between vertices in bytes (0 = no advancement)
Jesse Hall65ab5522015-11-30 00:07:16 -08002184 VkVertexInputRate inputRate /// Rate at which binding is incremented
Jesse Halld27f6aa2015-08-15 17:58:48 -07002185}
2186
2187class VkVertexInputAttributeDescription {
Jesse Hallb00daad2015-11-29 19:46:20 -08002188 u32 location /// location of the shader vertex attrib
2189 u32 binding /// Vertex buffer binding id
2190 VkFormat format /// format of source data
2191 u32 offset /// Offset of first element in bytes from base of vertex
Jesse Halld27f6aa2015-08-15 17:58:48 -07002192}
2193
2194class VkPipelineVertexInputStateCreateInfo {
Jesse Hall03b6fe12015-11-24 12:44:21 -08002195 VkStructureType sType /// Should be VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO
2196 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002197 VkPipelineVertexInputStateCreateFlags flags
Jesse Hall03b6fe12015-11-24 12:44:21 -08002198 u32 vertexBindingDescriptionCount /// number of bindings
Jesse Halld27f6aa2015-08-15 17:58:48 -07002199 const VkVertexInputBindingDescription* pVertexBindingDescriptions
Jesse Hall03b6fe12015-11-24 12:44:21 -08002200 u32 vertexAttributeDescriptionCount /// number of attributes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002201 const VkVertexInputAttributeDescription* pVertexAttributeDescriptions
2202}
2203
2204class VkPipelineInputAssemblyStateCreateInfo {
2205 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO
2206 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002207 VkPipelineInputAssemblyStateCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002208 VkPrimitiveTopology topology
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002209 VkBool32 primitiveRestartEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002210}
2211
2212class VkPipelineTessellationStateCreateInfo {
2213 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO
2214 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002215 VkPipelineTessellationStateCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002216 u32 patchControlPoints
2217}
2218
2219class VkPipelineViewportStateCreateInfo {
2220 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO
2221 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002222 VkPipelineViewportStateCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002223 u32 viewportCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002224 const VkViewport* pViewports
2225 u32 scissorCount
2226 const VkRect2D* pScissors
Jesse Halld27f6aa2015-08-15 17:58:48 -07002227}
2228
Jesse Hall3fbc8562015-11-29 22:10:52 -08002229class VkPipelineRasterizationStateCreateInfo {
Jesse Hall65ab5522015-11-30 00:07:16 -08002230 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002231 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08002232 VkPipelineRasterizationStateCreateFlags flags
Jesse Hallae38f732015-11-19 21:32:50 -08002233 VkBool32 depthClampEnable
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002234 VkBool32 rasterizerDiscardEnable
Jesse Hall65ab5522015-11-30 00:07:16 -08002235 VkPolygonMode polygonMode /// optional (GL45)
Jesse Hallc7467b72015-11-29 21:05:26 -08002236 VkCullModeFlags cullMode
Jesse Halld27f6aa2015-08-15 17:58:48 -07002237 VkFrontFace frontFace
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002238 VkBool32 depthBiasEnable
Jesse Halla9bb62b2015-11-21 19:31:56 -08002239 f32 depthBiasConstantFactor
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002240 f32 depthBiasClamp
Jesse Halla9bb62b2015-11-21 19:31:56 -08002241 f32 depthBiasSlopeFactor
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002242 f32 lineWidth
Jesse Halld27f6aa2015-08-15 17:58:48 -07002243}
2244
2245class VkPipelineMultisampleStateCreateInfo {
2246 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO
2247 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002248 VkPipelineMultisampleStateCreateFlags flags
Jesse Hall091ed9e2015-11-30 00:55:29 -08002249 VkSampleCountFlagBits rasterizationSamples /// Number of samples used for rasterization
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002250 VkBool32 sampleShadingEnable /// optional (GL45)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002251 f32 minSampleShading /// optional (GL45)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002252 const VkSampleMask* pSampleMask
Jesse Hallacfa5342015-11-19 21:51:33 -08002253 VkBool32 alphaToCoverageEnable
2254 VkBool32 alphaToOneEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002255}
2256
2257class VkPipelineColorBlendAttachmentState {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002258 VkBool32 blendEnable
Jesse Hall65ab5522015-11-30 00:07:16 -08002259 VkBlendFactor srcColorBlendFactor
2260 VkBlendFactor dstColorBlendFactor
2261 VkBlendOp colorBlendOp
2262 VkBlendFactor srcAlphaBlendFactor
2263 VkBlendFactor dstAlphaBlendFactor
2264 VkBlendOp alphaBlendOp
2265 VkColorComponentFlags colorWriteMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07002266}
2267
2268class VkPipelineColorBlendStateCreateInfo {
2269 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO
2270 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002271 VkPipelineColorBlendStateCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002272 VkBool32 logicOpEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002273 VkLogicOp logicOp
2274 u32 attachmentCount /// # of pAttachments
2275 const VkPipelineColorBlendAttachmentState* pAttachments
Jesse Hallb00daad2015-11-29 19:46:20 -08002276 f32[4] blendConstants
Jesse Halld27f6aa2015-08-15 17:58:48 -07002277}
2278
2279class VkStencilOpState {
Jesse Hall65ab5522015-11-30 00:07:16 -08002280 VkStencilOp failOp
2281 VkStencilOp passOp
2282 VkStencilOp depthFailOp
2283 VkCompareOp compareOp
2284 u32 compareMask
2285 u32 writeMask
2286 u32 reference
Jesse Halld27f6aa2015-08-15 17:58:48 -07002287}
2288
2289class VkPipelineDepthStencilStateCreateInfo {
2290 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO
2291 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002292 VkPipelineDepthStencilStateCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002293 VkBool32 depthTestEnable
2294 VkBool32 depthWriteEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002295 VkCompareOp depthCompareOp
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002296 VkBool32 depthBoundsTestEnable /// optional (depth_bounds_test)
2297 VkBool32 stencilTestEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002298 VkStencilOpState front
2299 VkStencilOpState back
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002300 f32 minDepthBounds
2301 f32 maxDepthBounds
2302}
2303
2304class VkPipelineDynamicStateCreateInfo {
2305 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO
2306 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002307 VkPipelineDynamicStateCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002308 u32 dynamicStateCount
2309 const VkDynamicState* pDynamicStates
Jesse Halld27f6aa2015-08-15 17:58:48 -07002310}
2311
2312class VkGraphicsPipelineCreateInfo {
Jesse Halla6429252015-11-29 18:59:42 -08002313 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO
2314 const void* pNext /// Pointer to next structure
2315 VkPipelineCreateFlags flags /// Pipeline creation flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002316 u32 stageCount
Jesse Halla6429252015-11-29 18:59:42 -08002317 const VkPipelineShaderStageCreateInfo* pStages /// One entry for each active shader stage
Jesse Halld27f6aa2015-08-15 17:58:48 -07002318 const VkPipelineVertexInputStateCreateInfo* pVertexInputState
2319 const VkPipelineInputAssemblyStateCreateInfo* pInputAssemblyState
2320 const VkPipelineTessellationStateCreateInfo* pTessellationState
2321 const VkPipelineViewportStateCreateInfo* pViewportState
Jesse Hall3fbc8562015-11-29 22:10:52 -08002322 const VkPipelineRasterizationStateCreateInfo* pRasterizationState
Jesse Halld27f6aa2015-08-15 17:58:48 -07002323 const VkPipelineMultisampleStateCreateInfo* pMultisampleState
2324 const VkPipelineDepthStencilStateCreateInfo* pDepthStencilState
2325 const VkPipelineColorBlendStateCreateInfo* pColorBlendState
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002326 const VkPipelineDynamicStateCreateInfo* pDynamicState
Jesse Halla6429252015-11-29 18:59:42 -08002327 VkPipelineLayout layout /// Interface layout of the pipeline
Jesse Halld27f6aa2015-08-15 17:58:48 -07002328 VkRenderPass renderPass
2329 u32 subpass
Jesse Halla6429252015-11-29 18:59:42 -08002330 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
2331 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 -07002332}
2333
2334class VkPipelineCacheCreateInfo {
Jesse Hallb00daad2015-11-29 19:46:20 -08002335 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO
2336 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002337 VkPipelineCacheCreateFlags flags
Jesse Hallb00daad2015-11-29 19:46:20 -08002338 platform.size_t initialDataSize /// Size of initial data to populate cache, in bytes
2339 const void* pInitialData /// Initial data to populate cache
Jesse Halld27f6aa2015-08-15 17:58:48 -07002340}
2341
2342class VkPushConstantRange {
2343 VkShaderStageFlags stageFlags /// Which stages use the range
Jesse Hall03b6fe12015-11-24 12:44:21 -08002344 u32 offset /// Start of the range, in bytes
2345 u32 size /// Length of the range, in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002346}
2347
2348class VkPipelineLayoutCreateInfo {
2349 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO
2350 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002351 VkPipelineLayoutCreateFlags flags
Jesse Hall3dd678a2016-01-08 21:52:01 -08002352 u32 descriptorSetCount /// Number of descriptor sets interfaced by the pipeline
Jesse Halld27f6aa2015-08-15 17:58:48 -07002353 const VkDescriptorSetLayout* pSetLayouts /// Array of <setCount> number of descriptor set layout objects defining the layout of the
2354 u32 pushConstantRangeCount /// Number of push-constant ranges used by the pipeline
2355 const VkPushConstantRange* pPushConstantRanges /// Array of pushConstantRangeCount number of ranges used by various shader stages
2356}
2357
2358class VkSamplerCreateInfo {
2359 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO
2360 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002361 VkSamplerCreateFlags flags
Jesse Hall23ff73f2015-11-29 14:36:39 -08002362 VkFilter magFilter /// Filter mode for magnification
2363 VkFilter minFilter /// Filter mode for minifiation
2364 VkSamplerMipmapMode mipmapMode /// Mipmap selection mode
2365 VkSamplerAddressMode addressModeU
2366 VkSamplerAddressMode addressModeV
2367 VkSamplerAddressMode addressModeW
Jesse Halld27f6aa2015-08-15 17:58:48 -07002368 f32 mipLodBias
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002369 VkBool32 anisotropyEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002370 f32 maxAnisotropy
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002371 VkBool32 compareEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002372 VkCompareOp compareOp
2373 f32 minLod
2374 f32 maxLod
2375 VkBorderColor borderColor
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002376 VkBool32 unnormalizedCoordinates
Jesse Halld27f6aa2015-08-15 17:58:48 -07002377}
2378
Jesse Hall3fbc8562015-11-29 22:10:52 -08002379class VkCommandPoolCreateInfo {
2380 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002381 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08002382 VkCommandPoolCreateFlags flags /// Command pool creation flags
Jesse Halla6429252015-11-29 18:59:42 -08002383 u32 queueFamilyIndex
Jesse Halld27f6aa2015-08-15 17:58:48 -07002384}
2385
Jesse Hall3fbc8562015-11-29 22:10:52 -08002386class VkCommandBufferAllocateInfo {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002387 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002388 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08002389 VkCommandPool commandPool
2390 VkCommandBufferLevel level
Jesse Hall3dd678a2016-01-08 21:52:01 -08002391 u32 commandBufferCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002392}
2393
Jesse Hall3dd678a2016-01-08 21:52:01 -08002394class VkCommandBufferInheritanceInfo {
2395 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002396 const void* pNext /// Pointer to next structure
Jesse Halld27f6aa2015-08-15 17:58:48 -07002397 VkRenderPass renderPass /// Render pass for secondary command buffers
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002398 u32 subpass
Jesse Halld27f6aa2015-08-15 17:58:48 -07002399 VkFramebuffer framebuffer /// Framebuffer for secondary command buffers
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002400 VkBool32 occlusionQueryEnable
2401 VkQueryControlFlags queryFlags
2402 VkQueryPipelineStatisticFlags pipelineStatistics
Jesse Halld27f6aa2015-08-15 17:58:48 -07002403}
2404
Jesse Hall3dd678a2016-01-08 21:52:01 -08002405class VkCommandBufferBeginInfo {
2406 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO
2407 const void* pNext /// Pointer to next structure
2408 VkCommandBufferUsageFlags flags /// Command buffer usage flags
2409 const VkCommandBufferInheritanceInfo* pInheritanceInfo
2410}
2411
Jesse Halld27f6aa2015-08-15 17:58:48 -07002412class VkRenderPassBeginInfo {
2413 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO
2414 const void* pNext /// Pointer to next structure
2415 VkRenderPass renderPass
2416 VkFramebuffer framebuffer
2417 VkRect2D renderArea
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002418 u32 clearValueCount
2419 const VkClearValue* pClearValues
Jesse Halld27f6aa2015-08-15 17:58:48 -07002420}
2421
2422@union
2423/// Union allowing specification of floating point, integer, or unsigned integer color data. Actual value selected is based on image/attachment being cleared.
2424class VkClearColorValue {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002425 f32[4] float32
2426 s32[4] int32
2427 u32[4] uint32
Jesse Halld27f6aa2015-08-15 17:58:48 -07002428}
2429
2430class VkClearDepthStencilValue {
2431 f32 depth
2432 u32 stencil
2433}
2434
2435@union
2436/// Union allowing specification of color, depth, and stencil color values. Actual value selected is based on attachment being cleared.
2437class VkClearValue {
2438 VkClearColorValue color
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002439 VkClearDepthStencilValue depthStencil
Jesse Halld27f6aa2015-08-15 17:58:48 -07002440}
2441
Jesse Hallae38f732015-11-19 21:32:50 -08002442class VkClearAttachment {
2443 VkImageAspectFlags aspectMask
2444 u32 colorAttachment
2445 VkClearValue clearValue
2446}
2447
Jesse Halld27f6aa2015-08-15 17:58:48 -07002448class VkAttachmentDescription {
Jesse Halla6429252015-11-29 18:59:42 -08002449 VkAttachmentDescriptionFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002450 VkFormat format
Jesse Hall091ed9e2015-11-30 00:55:29 -08002451 VkSampleCountFlagBits samples
Jesse Halld27f6aa2015-08-15 17:58:48 -07002452 VkAttachmentLoadOp loadOp /// Load op for color or depth data
2453 VkAttachmentStoreOp storeOp /// Store op for color or depth data
2454 VkAttachmentLoadOp stencilLoadOp /// Load op for stencil data
2455 VkAttachmentStoreOp stencilStoreOp /// Store op for stencil data
2456 VkImageLayout initialLayout
2457 VkImageLayout finalLayout
2458}
2459
2460class VkAttachmentReference {
2461 u32 attachment
2462 VkImageLayout layout
2463}
2464
2465class VkSubpassDescription {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002466 VkSubpassDescriptionFlags flags
Jesse Halla6429252015-11-29 18:59:42 -08002467 VkPipelineBindPoint pipelineBindPoint /// Must be VK_PIPELINE_BIND_POINT_GRAPHICS for now
Jesse Hall03b6fe12015-11-24 12:44:21 -08002468 u32 inputAttachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002469 const VkAttachmentReference* pInputAttachments
Jesse Hall03b6fe12015-11-24 12:44:21 -08002470 u32 colorAttachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002471 const VkAttachmentReference* pColorAttachments
2472 const VkAttachmentReference* pResolveAttachments
Jesse Hallc7467b72015-11-29 21:05:26 -08002473 const VkAttachmentReference* pDepthStencilAttachment
Jesse Hall03b6fe12015-11-24 12:44:21 -08002474 u32 preserveAttachmentCount
Jesse Hall3dd678a2016-01-08 21:52:01 -08002475 const u32* pPreserveAttachments
Jesse Halld27f6aa2015-08-15 17:58:48 -07002476}
2477
2478class VkSubpassDependency {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002479 u32 srcSubpass
Jesse Hall3fbc8562015-11-29 22:10:52 -08002480 u32 dstSubpass
Jesse Halld27f6aa2015-08-15 17:58:48 -07002481 VkPipelineStageFlags srcStageMask
Jesse Hall3fbc8562015-11-29 22:10:52 -08002482 VkPipelineStageFlags dstStageMask
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002483 VkAccessFlags srcAccessMask
2484 VkAccessFlags dstAccessMask
Jesse Halldc6d36c2015-11-29 19:12:15 -08002485 VkDependencyFlags dependencyFlags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002486}
2487
2488class VkRenderPassCreateInfo {
2489 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO
2490 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002491 VkRenderPassCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002492 u32 attachmentCount
2493 const VkAttachmentDescription* pAttachments
2494 u32 subpassCount
2495 const VkSubpassDescription* pSubpasses
2496 u32 dependencyCount
2497 const VkSubpassDependency* pDependencies
2498}
2499
2500class VkEventCreateInfo {
2501 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_EVENT_CREATE_INFO
2502 const void* pNext /// Pointer to next structure
2503 VkEventCreateFlags flags /// Event creation flags
2504}
2505
2506class VkFenceCreateInfo {
2507 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_FENCE_CREATE_INFO
2508 const void* pNext /// Pointer to next structure
2509 VkFenceCreateFlags flags /// Fence creation flags
2510}
2511
2512class VkPhysicalDeviceFeatures {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002513 VkBool32 robustBufferAccess /// out of bounds buffer accesses are well defined
2514 VkBool32 fullDrawIndexUint32 /// full 32-bit range of indices for indexed draw calls
2515 VkBool32 imageCubeArray /// image views which are arrays of cube maps
2516 VkBool32 independentBlend /// blending operations are controlled per-attachment
2517 VkBool32 geometryShader /// geometry stage
2518 VkBool32 tessellationShader /// tessellation control and evaluation stage
2519 VkBool32 sampleRateShading /// per-sample shading and interpolation
Jesse Hall3fbc8562015-11-29 22:10:52 -08002520 VkBool32 dualSrcBlend /// blend operations which take two sources
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002521 VkBool32 logicOp /// logic operations
2522 VkBool32 multiDrawIndirect /// multi draw indirect
Jesse Hall543a7ff2016-01-08 16:38:30 -08002523 VkBool32 drawIndirectFirstInstance
Jesse Hallae38f732015-11-19 21:32:50 -08002524 VkBool32 depthClamp /// depth clamping
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002525 VkBool32 depthBiasClamp /// depth bias clamping
2526 VkBool32 fillModeNonSolid /// point and wireframe fill modes
2527 VkBool32 depthBounds /// depth bounds test
2528 VkBool32 wideLines /// lines with width greater than 1
2529 VkBool32 largePoints /// points with size greater than 1
Jesse Hallfbf97b02015-11-20 14:17:03 -08002530 VkBool32 alphaToOne /// The fragment alpha channel can be forced to maximum representable alpha value
2531 VkBool32 multiViewport
2532 VkBool32 samplerAnisotropy
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002533 VkBool32 textureCompressionETC2 /// ETC texture compression formats
2534 VkBool32 textureCompressionASTC_LDR /// ASTC LDR texture compression formats
2535 VkBool32 textureCompressionBC /// BC1-7 texture compressed formats
Jesse Hall65ab5522015-11-30 00:07:16 -08002536 VkBool32 occlusionQueryPrecise
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002537 VkBool32 pipelineStatisticsQuery /// pipeline statistics query
Jesse Halldc6d36c2015-11-29 19:12:15 -08002538 VkBool32 vertexPipelineStoresAndAtomics
2539 VkBool32 fragmentStoresAndAtomics
2540 VkBool32 shaderTessellationAndGeometryPointSize
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002541 VkBool32 shaderImageGatherExtended /// texture gather with run-time values and independent offsets
2542 VkBool32 shaderStorageImageExtendedFormats /// the extended set of formats can be used for storage images
2543 VkBool32 shaderStorageImageMultisample /// multisample images can be used for storage images
Jesse Halld1af8122015-11-29 23:50:38 -08002544 VkBool32 shaderStorageImageReadWithoutFormat
2545 VkBool32 shaderStorageImageWriteWithoutFormat
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002546 VkBool32 shaderUniformBufferArrayDynamicIndexing /// arrays of uniform buffers can be accessed with dynamically uniform indices
2547 VkBool32 shaderSampledImageArrayDynamicIndexing /// arrays of sampled images can be accessed with dynamically uniform indices
2548 VkBool32 shaderStorageBufferArrayDynamicIndexing /// arrays of storage buffers can be accessed with dynamically uniform indices
2549 VkBool32 shaderStorageImageArrayDynamicIndexing /// arrays of storage images can be accessed with dynamically uniform indices
2550 VkBool32 shaderClipDistance /// clip distance in shaders
2551 VkBool32 shaderCullDistance /// cull distance in shaders
2552 VkBool32 shaderFloat64 /// 64-bit floats (doubles) in shaders
2553 VkBool32 shaderInt64 /// 64-bit integers in shaders
2554 VkBool32 shaderInt16 /// 16-bit integers in shaders
2555 VkBool32 shaderResourceResidency /// shader can use texture operations that return resource residency information (requires sparseNonResident support)
Jesse Hall65ab5522015-11-30 00:07:16 -08002556 VkBool32 shaderResourceMinLod /// shader can use texture operations that specify minimum resource LOD
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002557 VkBool32 sparseBinding /// Sparse resources support: Resource memory can be managed at opaque page level rather than object level
2558 VkBool32 sparseResidencyBuffer /// Sparse resources support: GPU can access partially resident buffers
2559 VkBool32 sparseResidencyImage2D /// Sparse resources support: GPU can access partially resident 2D (non-MSAA non-DepthStencil) images
2560 VkBool32 sparseResidencyImage3D /// Sparse resources support: GPU can access partially resident 3D images
2561 VkBool32 sparseResidency2Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 2 samples
2562 VkBool32 sparseResidency4Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 4 samples
2563 VkBool32 sparseResidency8Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 8 samples
2564 VkBool32 sparseResidency16Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 16 samples
2565 VkBool32 sparseResidencyAliased /// Sparse resources support: GPU can correctly access data aliased into multiple locations (opt-in)
Jesse Halld1af8122015-11-29 23:50:38 -08002566 VkBool32 variableMultisampleRate
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002567 VkBool32 inheritedQueries
Jesse Halld27f6aa2015-08-15 17:58:48 -07002568}
2569
2570class VkPhysicalDeviceLimits {
2571 /// resource maximum sizes
2572 u32 maxImageDimension1D /// max 1D image dimension
2573 u32 maxImageDimension2D /// max 2D image dimension
2574 u32 maxImageDimension3D /// max 3D image dimension
2575 u32 maxImageDimensionCube /// max cubemap image dimension
2576 u32 maxImageArrayLayers /// max layers for image arrays
Jesse Hallb00daad2015-11-29 19:46:20 -08002577 u32 maxTexelBufferElements
Jesse Hallfbf97b02015-11-20 14:17:03 -08002578 u32 maxUniformBufferRange /// max uniform buffer size (bytes)
2579 u32 maxStorageBufferRange /// max storage buffer size (bytes)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002580 u32 maxPushConstantsSize /// max size of the push constants pool (bytes)
2581 /// memory limits
2582 u32 maxMemoryAllocationCount /// max number of device memory allocations supported
Jesse Hall091ed9e2015-11-30 00:55:29 -08002583 u32 maxSamplerAllocationCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002584 VkDeviceSize bufferImageGranularity /// Granularity (in bytes) at which buffers and images can be bound to adjacent memory for simultaneous usage
2585 VkDeviceSize sparseAddressSpaceSize /// Total address space available for sparse allocations (bytes)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002586 /// descriptor set limits
2587 u32 maxBoundDescriptorSets /// max number of descriptors sets that can be bound to a pipeline
Jesse Halld27f6aa2015-08-15 17:58:48 -07002588 u32 maxPerStageDescriptorSamplers /// max num of samplers allowed per-stage in a descriptor set
2589 u32 maxPerStageDescriptorUniformBuffers /// max num of uniform buffers allowed per-stage in a descriptor set
2590 u32 maxPerStageDescriptorStorageBuffers /// max num of storage buffers allowed per-stage in a descriptor set
2591 u32 maxPerStageDescriptorSampledImages /// max num of sampled images allowed per-stage in a descriptor set
2592 u32 maxPerStageDescriptorStorageImages /// max num of storage images allowed per-stage in a descriptor set
Jesse Halle1b12782015-11-30 11:27:32 -08002593 u32 maxPerStageDescriptorInputAttachments
Jesse Halldba27f72015-11-30 14:25:46 -08002594 u32 maxPerStageResources
Jesse Halld27f6aa2015-08-15 17:58:48 -07002595 u32 maxDescriptorSetSamplers /// max num of samplers allowed in all stages in a descriptor set
2596 u32 maxDescriptorSetUniformBuffers /// max num of uniform buffers allowed in all stages in a descriptor set
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002597 u32 maxDescriptorSetUniformBuffersDynamic /// max num of dynamic uniform buffers allowed in all stages in a descriptor set
Jesse Halld27f6aa2015-08-15 17:58:48 -07002598 u32 maxDescriptorSetStorageBuffers /// max num of storage buffers allowed in all stages in a descriptor set
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002599 u32 maxDescriptorSetStorageBuffersDynamic /// max num of dynamic storage buffers allowed in all stages in a descriptor set
Jesse Halld27f6aa2015-08-15 17:58:48 -07002600 u32 maxDescriptorSetSampledImages /// max num of sampled images allowed in all stages in a descriptor set
2601 u32 maxDescriptorSetStorageImages /// max num of storage images allowed in all stages in a descriptor set
Jesse Halle1b12782015-11-30 11:27:32 -08002602 u32 maxDescriptorSetInputAttachments
Jesse Halld27f6aa2015-08-15 17:58:48 -07002603 /// vertex stage limits
2604 u32 maxVertexInputAttributes /// max num of vertex input attribute slots
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002605 u32 maxVertexInputBindings /// max num of vertex input binding slots
Jesse Halld27f6aa2015-08-15 17:58:48 -07002606 u32 maxVertexInputAttributeOffset /// max vertex input attribute offset added to vertex buffer offset
2607 u32 maxVertexInputBindingStride /// max vertex input binding stride
2608 u32 maxVertexOutputComponents /// max num of output components written by vertex shader
2609 /// tessellation control stage limits
Jesse Hall3fbc8562015-11-29 22:10:52 -08002610 u32 maxTessellationGenerationLevel /// max level supported by tess primitive generator
Jesse Hallae38f732015-11-19 21:32:50 -08002611 u32 maxTessellationPatchSize /// max patch size (vertices)
2612 u32 maxTessellationControlPerVertexInputComponents /// max num of input components per-vertex in TCS
2613 u32 maxTessellationControlPerVertexOutputComponents /// max num of output components per-vertex in TCS
2614 u32 maxTessellationControlPerPatchOutputComponents /// max num of output components per-patch in TCS
2615 u32 maxTessellationControlTotalOutputComponents /// max total num of per-vertex and per-patch output components in TCS
2616 u32 maxTessellationEvaluationInputComponents /// max num of input components per vertex in TES
2617 u32 maxTessellationEvaluationOutputComponents /// max num of output components per vertex in TES
Jesse Halld27f6aa2015-08-15 17:58:48 -07002618 /// geometry stage limits
2619 u32 maxGeometryShaderInvocations /// max invocation count supported in geometry shader
2620 u32 maxGeometryInputComponents /// max num of input components read in geometry stage
2621 u32 maxGeometryOutputComponents /// max num of output components written in geometry stage
2622 u32 maxGeometryOutputVertices /// max num of vertices that can be emitted in geometry stage
2623 u32 maxGeometryTotalOutputComponents /// max total num of components (all vertices) written in geometry stage
2624 /// fragment stage limits
2625 u32 maxFragmentInputComponents /// max num of input compontents read in fragment stage
Jesse Hallfbf97b02015-11-20 14:17:03 -08002626 u32 maxFragmentOutputAttachments /// max num of output attachments written in fragment stage
Jesse Hall3fbc8562015-11-29 22:10:52 -08002627 u32 maxFragmentDualSrcAttachments /// max num of output attachments written when using dual source blending
Jesse Halld27f6aa2015-08-15 17:58:48 -07002628 u32 maxFragmentCombinedOutputResources /// max total num of storage buffers, storage images and output buffers
2629 /// compute stage limits
2630 u32 maxComputeSharedMemorySize /// max total storage size of work group local storage (bytes)
2631 u32[3] maxComputeWorkGroupCount /// max num of compute work groups that may be dispatched by a single command (x,y,z)
2632 u32 maxComputeWorkGroupInvocations /// max total compute invocations in a single local work group
2633 u32[3] maxComputeWorkGroupSize /// max local size of a compute work group (x,y,z)
2634
2635 u32 subPixelPrecisionBits /// num bits of subpixel precision in screen x and y
2636 u32 subTexelPrecisionBits /// num bits of subtexel precision
2637 u32 mipmapPrecisionBits /// num bits of mipmap precision
2638
2639 u32 maxDrawIndexedIndexValue /// max index value for indexed draw calls (for 32-bit indices)
Jesse Halldba27f72015-11-30 14:25:46 -08002640 u32 maxDrawIndirectCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002641
2642 f32 maxSamplerLodBias /// max absolute sampler level of detail bias
2643 f32 maxSamplerAnisotropy /// max degree of sampler anisotropy
2644
2645 u32 maxViewports /// max number of active viewports
Jesse Halld27f6aa2015-08-15 17:58:48 -07002646 u32[2] maxViewportDimensions /// max viewport dimensions (x,y)
2647 f32[2] viewportBoundsRange /// viewport bounds range (min,max)
2648 u32 viewportSubPixelBits /// num bits of subpixel precision for viewport
2649
Jesse Halldc6d36c2015-11-29 19:12:15 -08002650 platform.size_t minMemoryMapAlignment /// min required alignment of pointers returned by MapMemory (bytes)
2651 VkDeviceSize minTexelBufferOffsetAlignment /// min required alignment for texel buffer offsets (bytes)
2652 VkDeviceSize minUniformBufferOffsetAlignment /// min required alignment for uniform buffer sizes and offsets (bytes)
2653 VkDeviceSize minStorageBufferOffsetAlignment /// min required alignment for storage buffer offsets (bytes)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002654
Jesse Hallfbf97b02015-11-20 14:17:03 -08002655 s32 minTexelOffset /// min texel offset for OpTextureSampleOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07002656 u32 maxTexelOffset /// max texel offset for OpTextureSampleOffset
Jesse Hallfbf97b02015-11-20 14:17:03 -08002657 s32 minTexelGatherOffset /// min texel offset for OpTextureGatherOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07002658 u32 maxTexelGatherOffset /// max texel offset for OpTextureGatherOffset
2659 f32 minInterpolationOffset /// furthest negative offset for interpolateAtOffset
2660 f32 maxInterpolationOffset /// furthest positive offset for interpolateAtOffset
2661 u32 subPixelInterpolationOffsetBits /// num of subpixel bits for interpolateAtOffset
2662
2663 u32 maxFramebufferWidth /// max width for a framebuffer
2664 u32 maxFramebufferHeight /// max height for a framebuffer
2665 u32 maxFramebufferLayers /// max layer count for a layered framebuffer
Jesse Hall091ed9e2015-11-30 00:55:29 -08002666 VkSampleCountFlags framebufferColorSampleCounts
2667 VkSampleCountFlags framebufferDepthSampleCounts
2668 VkSampleCountFlags framebufferStencilSampleCounts
2669 VkSampleCountFlags framebufferNoAttachmentSampleCounts
Jesse Halld27f6aa2015-08-15 17:58:48 -07002670 u32 maxColorAttachments /// max num of framebuffer color attachments
2671
Jesse Hall091ed9e2015-11-30 00:55:29 -08002672 VkSampleCountFlags sampledImageColorSampleCounts
2673 VkSampleCountFlags sampledImageIntegerSampleCounts
2674 VkSampleCountFlags sampledImageDepthSampleCounts
2675 VkSampleCountFlags sampledImageStencilSampleCounts
2676 VkSampleCountFlags storageImageSampleCounts
Jesse Halld27f6aa2015-08-15 17:58:48 -07002677 u32 maxSampleMaskWords /// max num of sample mask words
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002678 VkBool32 timestampComputeAndGraphics
Jesse Halld27f6aa2015-08-15 17:58:48 -07002679
Jesse Halla9bb62b2015-11-21 19:31:56 -08002680 f32 timestampPeriod
Jesse Halld27f6aa2015-08-15 17:58:48 -07002681
2682 u32 maxClipDistances /// max number of clip distances
2683 u32 maxCullDistances /// max number of cull distances
2684 u32 maxCombinedClipAndCullDistances /// max combined number of user clipping
2685
Jesse Hallfbf97b02015-11-20 14:17:03 -08002686 u32 discreteQueuePriorities
2687
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002688 f32[2] pointSizeRange /// range (min,max) of supported point sizes
2689 f32[2] lineWidthRange /// range (min,max) of supported line widths
Jesse Halld27f6aa2015-08-15 17:58:48 -07002690 f32 pointSizeGranularity /// granularity of supported point sizes
2691 f32 lineWidthGranularity /// granularity of supported line widths
Jesse Hall03b6fe12015-11-24 12:44:21 -08002692 VkBool32 strictLines
Jesse Hall091ed9e2015-11-30 00:55:29 -08002693 VkBool32 standardSampleLocations
Jesse Halla9bb62b2015-11-21 19:31:56 -08002694
Jesse Hall65ab5522015-11-30 00:07:16 -08002695 VkDeviceSize optimalBufferCopyOffsetAlignment
2696 VkDeviceSize optimalBufferCopyRowPitchAlignment
Jesse Halldba27f72015-11-30 14:25:46 -08002697 VkDeviceSize nonCoherentAtomSize
Jesse Halld27f6aa2015-08-15 17:58:48 -07002698}
2699
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002700class VkPhysicalDeviceSparseProperties {
2701 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 -08002702 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 -07002703 VkBool32 residencyStandard3DBlockShape /// Sparse resources support: GPU will access all 3D sparse resources using the standard block shapes (based on pixel format)
2704 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 -07002705 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
2706}
2707
Jesse Halld27f6aa2015-08-15 17:58:48 -07002708class VkSemaphoreCreateInfo {
2709 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO
2710 const void* pNext /// Pointer to next structure
2711 VkSemaphoreCreateFlags flags /// Semaphore creation flags
2712}
2713
2714class VkQueryPoolCreateInfo {
2715 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO
2716 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002717 VkQueryPoolCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002718 VkQueryType queryType
Jesse Hall3dd678a2016-01-08 21:52:01 -08002719 u32 queryCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002720 VkQueryPipelineStatisticFlags pipelineStatistics /// Optional
2721}
2722
2723class VkFramebufferCreateInfo {
2724 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO
2725 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002726 VkFramebufferCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002727 VkRenderPass renderPass
2728 u32 attachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002729 const VkImageView* pAttachments
Jesse Halld27f6aa2015-08-15 17:58:48 -07002730 u32 width
2731 u32 height
2732 u32 layers
2733}
2734
Jesse Hall3fbc8562015-11-29 22:10:52 -08002735class VkDrawIndirectCommand {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002736 u32 vertexCount
2737 u32 instanceCount
2738 u32 firstVertex
2739 u32 firstInstance
2740}
2741
Jesse Hall3fbc8562015-11-29 22:10:52 -08002742class VkDrawIndexedIndirectCommand {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002743 u32 indexCount
2744 u32 instanceCount
2745 u32 firstIndex
2746 s32 vertexOffset
2747 u32 firstInstance
2748}
2749
Jesse Hall3fbc8562015-11-29 22:10:52 -08002750class VkDispatchIndirectCommand {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002751 u32 x
2752 u32 y
2753 u32 z
2754}
2755
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002756@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08002757class VkSurfaceCapabilitiesKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002758 u32 minImageCount
2759 u32 maxImageCount
2760 VkExtent2D currentExtent
2761 VkExtent2D minImageExtent
2762 VkExtent2D maxImageExtent
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002763 u32 maxImageArrayLayers
Jesse Hall1356b0d2015-11-23 17:24:58 -08002764 VkSurfaceTransformFlagsKHR supportedTransforms
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002765 VkSurfaceTransformFlagBitsKHR currentTransform
Jesse Halla6429252015-11-29 18:59:42 -08002766 VkCompositeAlphaFlagsKHR supportedCompositeAlpha
Jesse Hall1356b0d2015-11-23 17:24:58 -08002767 VkImageUsageFlags supportedUsageFlags
Michael Lentine88594d72015-11-12 12:49:45 -08002768}
2769
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002770@extension("VK_KHR_surface")
Michael Lentine88594d72015-11-12 12:49:45 -08002771class VkSurfaceFormatKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002772 VkFormat format
2773 VkColorSpaceKHR colorSpace
Michael Lentine88594d72015-11-12 12:49:45 -08002774}
2775
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002776@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08002777class VkSwapchainCreateInfoKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002778 VkStructureType sType
2779 const void* pNext
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002780 VkSwapchainCreateFlagsKHR flags
Jesse Hall1356b0d2015-11-23 17:24:58 -08002781 VkSurfaceKHR surface
2782 u32 minImageCount
2783 VkFormat imageFormat
2784 VkColorSpaceKHR imageColorSpace
2785 VkExtent2D imageExtent
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002786 u32 imageArrayLayers
2787 VkImageUsageFlags imageUsage
Jesse Hall1356b0d2015-11-23 17:24:58 -08002788 VkSharingMode sharingMode
Jesse Hall03b6fe12015-11-24 12:44:21 -08002789 u32 queueFamilyIndexCount
Jesse Hall1356b0d2015-11-23 17:24:58 -08002790 const u32* pQueueFamilyIndices
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002791 VkSurfaceTransformFlagBitsKHR preTransform
2792 VkCompositeAlphaFlagBitsKHR compositeAlpha
Jesse Hall1356b0d2015-11-23 17:24:58 -08002793 VkPresentModeKHR presentMode
Jesse Hall1356b0d2015-11-23 17:24:58 -08002794 VkBool32 clipped
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002795 VkSwapchainKHR oldSwapchain
Michael Lentine88594d72015-11-12 12:49:45 -08002796}
2797
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002798@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08002799class VkPresentInfoKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002800 VkStructureType sType
2801 const void* pNext
Jesse Hallb00daad2015-11-29 19:46:20 -08002802 u32 waitSemaphoreCount
2803 const VkSemaphore* pWaitSemaphores
Jesse Hall1356b0d2015-11-23 17:24:58 -08002804 u32 swapchainCount
Jesse Hall03b6fe12015-11-24 12:44:21 -08002805 const VkSwapchainKHR* pSwapchains
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002806 const u32* pImageIndices
Jesse Halle1b12782015-11-30 11:27:32 -08002807 VkResult* pResults
Michael Lentine88594d72015-11-12 12:49:45 -08002808}
2809
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002810@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002811class VkDisplayPropertiesKHR {
2812 VkDisplayKHR display
2813 const char* displayName
2814 VkExtent2D physicalDimensions
2815 VkExtent2D physicalResolution
2816 VkSurfaceTransformFlagsKHR supportedTransforms
Jesse Hall1356b0d2015-11-23 17:24:58 -08002817 VkBool32 planeReorderPossible
Jesse Halla6429252015-11-29 18:59:42 -08002818 VkBool32 persistentContent
Michael Lentine88594d72015-11-12 12:49:45 -08002819}
2820
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002821@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08002822class VkDisplayModeParametersKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002823 VkExtent2D visibleRegion
Jesse Halla6429252015-11-29 18:59:42 -08002824 u32 refreshRate
Michael Lentine88594d72015-11-12 12:49:45 -08002825}
Jesse Halld27f6aa2015-08-15 17:58:48 -07002826
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002827@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002828class VkDisplayModePropertiesKHR {
2829 VkDisplayModeKHR displayMode
Jesse Halla6429252015-11-29 18:59:42 -08002830 VkDisplayModeParametersKHR parameters
Jesse Hall1356b0d2015-11-23 17:24:58 -08002831}
2832
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002833@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002834class VkDisplayModeCreateInfoKHR {
2835 VkStructureType sType
2836 const void* pNext
Jesse Hall9ba8bc82015-11-30 16:22:16 -08002837 VkDisplayModeCreateFlagsKHR flags
Jesse Halla6429252015-11-29 18:59:42 -08002838 VkDisplayModeParametersKHR parameters
Jesse Hall1356b0d2015-11-23 17:24:58 -08002839}
2840
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002841@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002842class VkDisplayPlanePropertiesKHR {
Jesse Halla6429252015-11-29 18:59:42 -08002843 VkDisplayKHR currentDisplay
2844 u32 currentStackIndex
2845}
2846
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002847@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08002848class VkDisplayPlaneCapabilitiesKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002849 VkDisplayPlaneAlphaFlagsKHR supportedAlpha
2850 VkOffset2D minSrcPosition
2851 VkOffset2D maxSrcPosition
2852 VkExtent2D minSrcExtent
2853 VkExtent2D maxSrcExtent
2854 VkOffset2D minDstPosition
2855 VkOffset2D maxDstPosition
2856 VkExtent2D minDstExtent
2857 VkExtent2D maxDstExtent
2858}
2859
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002860@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08002861class VkDisplaySurfaceCreateInfoKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002862 VkStructureType sType
2863 const void* pNext
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002864 VkDisplaySurfaceCreateFlagsKHR flags
Jesse Hall1356b0d2015-11-23 17:24:58 -08002865 VkDisplayModeKHR displayMode
2866 u32 planeIndex
2867 u32 planeStackIndex
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002868 VkSurfaceTransformFlagBitsKHR transform
Jesse Hall1356b0d2015-11-23 17:24:58 -08002869 f32 globalAlpha
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002870 VkDisplayPlaneAlphaFlagBitsKHR alphaMode
2871 VkExtent2D imageExtent
Jesse Hall1356b0d2015-11-23 17:24:58 -08002872}
2873
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002874@extension("VK_KHR_display_swapchain")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002875class VkDisplayPresentInfoKHR {
2876 VkStructureType sType
2877 const void* pNext
2878 VkRect2D srcRect
2879 VkRect2D dstRect
Jesse Halla6429252015-11-29 18:59:42 -08002880 VkBool32 persistent
Jesse Hall1356b0d2015-11-23 17:24:58 -08002881}
2882
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002883@extension("VK_KHR_xlib_surface")
2884class VkXlibSurfaceCreateInfoKHR {
2885 VkStructureType sType
2886 const void* pNext
2887 VkXlibSurfaceCreateFlagsKHR flags
2888 platform.Display* dpy
2889 platform.Window window
2890}
2891
2892@extension("VK_KHR_xcb_surface")
2893class VkXcbSurfaceCreateInfoKHR {
2894 VkStructureType sType
2895 const void* pNext
2896 VkXcbSurfaceCreateFlagsKHR flags
2897 platform.xcb_connection_t* connection
2898 platform.xcb_window_t window
2899}
2900
2901@extension("VK_KHR_wayland_surface")
2902class VkWaylandSurfaceCreateInfoKHR {
2903 VkStructureType sType
2904 const void* pNext
2905 VkWaylandSurfaceCreateFlagsKHR flags
2906 platform.wl_display* display
2907 platform.wl_surface* surface
2908}
2909
2910@extension("VK_KHR_mir_surface")
2911class VkMirSurfaceCreateInfoKHR {
2912 VkStructureType sType
2913 const void* pNext
2914 VkMirSurfaceCreateFlagsKHR flags
2915 platform.MirConnection* connection
2916 platform.MirSurface* mirSurface
2917}
2918
2919@extension("VK_KHR_android_surface")
2920class VkAndroidSurfaceCreateInfoKHR {
2921 VkStructureType sType
2922 const void* pNext
2923 VkAndroidSurfaceCreateFlagsKHR flags
2924 platform.ANativeWindow* window
2925}
2926
2927@extension("VK_KHR_win32_surface")
2928class VkWin32SurfaceCreateInfoKHR {
2929 VkStructureType sType
2930 const void* pNext
2931 VkWin32SurfaceCreateFlagsKHR flags
2932 platform.HINSTANCE hinstance
2933 platform.HWND hwnd
2934}
2935
Chia-I Wub262ddc2016-03-22 07:38:20 +08002936@extension("VK_ANDROID_native_buffer")
2937class VkNativeBufferANDROID {
2938 VkStructureType sType
2939 const void* pNext
2940 platform.buffer_handle_t handle
2941 int stride
2942 int format
2943 int usage
2944}
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 Hall3f5499b2016-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
Jesse Hall08e2f482017-03-06 15:22:17 -08003063@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
Jesse Halleb02c472017-02-24 15:13:45 -08003134@extension("VK_EXT_validation_flags")
3135class VkValidationFlagsEXT {
3136 VkStructureType sType
3137 const void* pNext
3138 u32 disabledValidationCheckCount
3139 VkValidationCheckEXT* pDisabledValidationChecks
3140}
3141
Jesse Hall08e2f482017-03-06 15:22:17 -08003142@extension("VK_NN_vi_surface")
3143class VkViSurfaceCreateInfoNN {
3144 VkStructureType sType
3145 const void* pNext
3146 VkViSurfaceCreateFlagsNN flags
3147 void* window
3148}
3149
Jesse Halleb02c472017-02-24 15:13:45 -08003150@extension("VK_NVX_device_generated_commands")
3151class VkDeviceGeneratedCommandsFeaturesNVX {
3152 VkStructureType sType
3153 const void* pNext
3154 VkBool32 computeBindingPointSupport
3155}
3156
3157@extension("VK_NVX_device_generated_commands")
3158class VkDeviceGeneratedCommandsLimitsNVX {
3159 VkStructureType sType
3160 const void* pNext
3161 u32 maxIndirectCommandsLayoutTokenCount
3162 u32 maxObjectEntryCounts
3163 u32 minSequenceCountBufferOffsetAlignment
3164 u32 minSequenceIndexBufferOffsetAlignment
3165 u32 minCommandsTokenBufferOffsetAlignment
3166}
3167
3168@extension("VK_NVX_device_generated_commands")
3169class VkIndirectCommandsTokenNVX {
3170 VkIndirectCommandsTokenTypeNVX tokenType
3171 VkBuffer buffer
3172 VkDeviceSize offset
3173}
3174
3175@extension("VK_NVX_device_generated_commands")
3176class VkIndirectCommandsLayoutTokenNVX {
3177 VkIndirectCommandsTokenTypeNVX tokenType
3178 u32 bindingUnit
3179 u32 dynamicCount
3180 u32 divisor
3181}
3182
3183@extension("VK_NVX_device_generated_commands")
3184class VkIndirectCommandsLayoutCreateInfoNVX {
3185 VkStructureType sType
3186 const void* pNext
3187 VkPipelineBindPoint pipelineBindPoint
3188 VkIndirectCommandsLayoutUsageFlagsNVX flags
3189 u32 tokenCount
3190 const VkIndirectCommandsLayoutTokenNVX* pTokens
3191}
3192
3193@extension("VK_NVX_device_generated_commands")
3194class VkCmdProcessCommandsInfoNVX {
3195 VkStructureType sType
3196 const void* pNext
3197 VkObjectTableNVX objectTable
3198 VkIndirectCommandsLayoutNVX indirectCommandsLayout
3199 u32 indirectCommandsTokenCount
3200 const VkIndirectCommandsTokenNVX* pIndirectCommandsTokens
3201 u32 maxSequencesCount
3202 VkCommandBuffer targetCommandBuffer
3203 VkBuffer sequencesCountBuffer
3204 VkDeviceSize sequencesCountOffset
3205 VkBuffer sequencesIndexBuffer
3206 VkDeviceSize sequencesIndexOffset
3207}
3208
3209@extension("VK_NVX_device_generated_commands")
3210class VkCmdReserveSpaceForCommandsInfoNVX {
3211 VkStructureType sType
3212 const void* pNext
3213 VkObjectTableNVX objectTable
3214 VkIndirectCommandsLayoutNVX indirectCommandsLayout
3215 u32 maxSequencesCount
3216}
3217
3218@extension("VK_NVX_device_generated_commands")
3219class VkObjectTableCreateInfoNVX {
3220 VkStructureType sType
3221 const void* pNext
3222 u32 objectCount
3223 const VkObjectEntryTypeNVX* pObjectEntryTypes
3224 const u32* pObjectEntryCounts
3225 const VkObjectEntryUsageFlagsNVX* pObjectEntryUsageFlags
3226 u32 maxUniformBuffersPerDescriptor
3227 u32 maxStorageBuffersPerDescriptor
3228 u32 maxStorageImagesPerDescriptor
3229 u32 maxSampledImagesPerDescriptor
3230 u32 maxPipelineLayouts
3231}
3232
3233@extension("VK_NVX_device_generated_commands")
3234class VkObjectTableEntryNVX {
3235 VkObjectEntryTypeNVX type
3236 VkObjectEntryUsageFlagsNVX flags
3237}
3238
3239@extension("VK_NVX_device_generated_commands")
3240class VkObjectTablePipelineEntryNVX {
3241 VkObjectEntryTypeNVX type
3242 VkObjectEntryUsageFlagsNVX flags
3243 VkPipeline pipeline
3244}
3245
3246@extension("VK_NVX_device_generated_commands")
3247class VkObjectTableDescriptorSetEntryNVX {
3248 VkObjectEntryTypeNVX type
3249 VkObjectEntryUsageFlagsNVX flags
3250 VkPipelineLayout pipelineLayout
3251 VkDescriptorSet descriptorSet
3252}
3253
3254@extension("VK_NVX_device_generated_commands")
3255class VkObjectTableVertexBufferEntryNVX {
3256 VkObjectEntryTypeNVX type
3257 VkObjectEntryUsageFlagsNVX flags
3258 VkBuffer buffer
3259}
3260
3261@extension("VK_NVX_device_generated_commands")
3262class VkObjectTableIndexBufferEntryNVX {
3263 VkObjectEntryTypeNVX type
3264 VkObjectEntryUsageFlagsNVX flags
3265 VkBuffer buffer
Jesse Hall08e2f482017-03-06 15:22:17 -08003266 VkIndexType indexType
Jesse Halleb02c472017-02-24 15:13:45 -08003267}
3268
3269@extension("VK_NVX_device_generated_commands")
3270class VkObjectTablePushConstantEntryNVX {
3271 VkObjectEntryTypeNVX type
3272 VkObjectEntryUsageFlagsNVX flags
3273 VkPipelineLayout pipelineLayout
3274 VkShaderStageFlags stageFlags
3275}
3276
Jesse Hall08e2f482017-03-06 15:22:17 -08003277@extension("VK_EXT_display_surface_counter")
3278class VkSurfaceCapabilities2EXT {
3279 VkStructureType sType
3280 void* pNext
3281 u32 minImageCount
3282 u32 maxImageCount
3283 VkExtent2D currentExtent
3284 VkExtent2D minImageExtent
3285 VkExtent2D maxImageExtent
3286 u32 maxImageArrayLayers
3287 VkSurfaceTransformFlagsKHR supportedTransforms
3288 VkSurfaceTransformFlagBitsKHR currentTransform
3289 VkCompositeAlphaFlagsKHR supportedCompositeAlpha
3290 VkImageUsageFlags supportedUsageFlags
3291 VkSurfaceCounterFlagsEXT supportedSurfaceCounters
3292}
3293
3294@extension("VK_EXT_display_control")
3295class VkDisplayPowerInfoEXT {
3296 VkStructureType sType
3297 const void* pNext
3298 VkDisplayPowerStateEXT powerState
3299}
3300
3301@extension("VK_EXT_display_control")
3302class VkDeviceEventInfoEXT {
3303 VkStructureType sType
3304 const void* pNext
3305 VkDeviceEventTypeEXT deviceEvent
3306}
3307
3308@extension("VK_EXT_display_control")
3309class VkDisplayEventInfoEXT {
3310 VkStructureType sType
3311 const void* pNext
3312 VkDisplayEventTypeEXT displayEvent
3313}
3314
3315@extension("VK_EXT_display_control")
3316class VkSwapchainCounterCreateInfoEXT {
3317 VkStructureType sType
3318 const void* pNext
3319 VkSurfaceCounterFlagsEXT surfaceCounters
3320}
Jesse Hall1356b0d2015-11-23 17:24:58 -08003321
Jesse Halld27f6aa2015-08-15 17:58:48 -07003322////////////////
3323// Commands //
3324////////////////
3325
3326// Function pointers. TODO: add support for function pointers.
3327
3328@external type void* PFN_vkVoidFunction
3329@pfn cmd void vkVoidFunction() {
3330}
3331
Jesse Hall3fbc8562015-11-29 22:10:52 -08003332@external type void* PFN_vkAllocationFunction
3333@pfn cmd void* vkAllocationFunction(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003334 void* pUserData,
3335 platform.size_t size,
3336 platform.size_t alignment,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003337 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08003338 return ?
3339}
3340
Jesse Hall3fbc8562015-11-29 22:10:52 -08003341@external type void* PFN_vkReallocationFunction
3342@pfn cmd void* vkReallocationFunction(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003343 void* pUserData,
3344 void* pOriginal,
3345 platform.size_t size,
3346 platform.size_t alignment,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003347 VkSystemAllocationScope allocationScope) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003348 return ?
3349}
3350
3351@external type void* PFN_vkFreeFunction
3352@pfn cmd void vkFreeFunction(
3353 void* pUserData,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003354 void* pMemory) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003355}
3356
Jesse Hall3fbc8562015-11-29 22:10:52 -08003357@external type void* PFN_vkInternalAllocationNotification
3358@pfn cmd void vkInternalAllocationNotification(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003359 void* pUserData,
3360 platform.size_t size,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003361 VkInternalAllocationType allocationType,
3362 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08003363}
3364
3365@external type void* PFN_vkInternalFreeNotification
3366@pfn cmd void vkInternalFreeNotification(
3367 void* pUserData,
3368 platform.size_t size,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003369 VkInternalAllocationType allocationType,
3370 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08003371}
Jesse Halld27f6aa2015-08-15 17:58:48 -07003372
3373// Global functions
3374
3375@threadSafety("system")
3376cmd VkResult vkCreateInstance(
3377 const VkInstanceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003378 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003379 VkInstance* pInstance) {
3380 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO)
3381
3382 instance := ?
3383 pInstance[0] = instance
3384 State.Instances[instance] = new!InstanceObject()
3385
Jesse Hall3dd678a2016-01-08 21:52:01 -08003386 layers := pCreateInfo.ppEnabledLayerNames[0:pCreateInfo.enabledLayerCount]
3387 extensions := pCreateInfo.ppEnabledExtensionNames[0:pCreateInfo.enabledExtensionCount]
Jesse Halld27f6aa2015-08-15 17:58:48 -07003388
3389 return ?
3390}
3391
3392@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003393cmd void vkDestroyInstance(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003394 VkInstance instance,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003395 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003396 instanceObject := GetInstance(instance)
3397
3398 State.Instances[instance] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003399}
3400
3401@threadSafety("system")
3402cmd VkResult vkEnumeratePhysicalDevices(
3403 VkInstance instance,
3404 u32* pPhysicalDeviceCount,
3405 VkPhysicalDevice* pPhysicalDevices) {
3406 instanceObject := GetInstance(instance)
3407
3408 physicalDeviceCount := as!u32(?)
3409 pPhysicalDeviceCount[0] = physicalDeviceCount
3410 physicalDevices := pPhysicalDevices[0:physicalDeviceCount]
3411
3412 for i in (0 .. physicalDeviceCount) {
3413 physicalDevice := ?
3414 physicalDevices[i] = physicalDevice
3415 if !(physicalDevice in State.PhysicalDevices) {
3416 State.PhysicalDevices[physicalDevice] = new!PhysicalDeviceObject(instance: instance)
3417 }
3418 }
3419
3420 return ?
3421}
3422
3423cmd PFN_vkVoidFunction vkGetDeviceProcAddr(
3424 VkDevice device,
3425 const char* pName) {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003426 if device != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003427 device := GetDevice(device)
3428 }
3429
3430 return ?
3431}
3432
3433cmd PFN_vkVoidFunction vkGetInstanceProcAddr(
3434 VkInstance instance,
3435 const char* pName) {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003436 if instance != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003437 instanceObject := GetInstance(instance)
3438 }
3439
3440 return ?
3441}
3442
Jesse Hall606a54e2015-11-19 22:17:28 -08003443cmd void vkGetPhysicalDeviceProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003444 VkPhysicalDevice physicalDevice,
3445 VkPhysicalDeviceProperties* pProperties) {
3446 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3447
3448 properties := ?
3449 pProperties[0] = properties
Jesse Halld27f6aa2015-08-15 17:58:48 -07003450}
3451
Jesse Hall606a54e2015-11-19 22:17:28 -08003452cmd void vkGetPhysicalDeviceQueueFamilyProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003453 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003454 u32* pQueueFamilyPropertyCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003455 VkQueueFamilyProperties* pQueueFamilyProperties) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003456 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003457 // TODO: Figure out how to express fetch-count-or-properties
3458 // This version fails 'apic validate' with 'fence not allowed in
3459 // *semantic.Branch'. Other attempts have failed with the same or other
3460 // errors.
3461 // if pQueueFamilyProperties != null {
3462 // queuesProperties := pQueueFamilyProperties[0:pCount[0]]
3463 // for i in (0 .. pCount[0]) {
3464 // queueProperties := as!VkQueueFamilyProperties(?)
3465 // queuesProperties[i] = queueProperties
3466 // }
3467 // } else {
3468 // count := ?
3469 // pCount[0] = count
3470 // }
Jesse Halld27f6aa2015-08-15 17:58:48 -07003471}
3472
Jesse Hall606a54e2015-11-19 22:17:28 -08003473cmd void vkGetPhysicalDeviceMemoryProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003474 VkPhysicalDevice physicalDevice,
3475 VkPhysicalDeviceMemoryProperties* pMemoryProperties) {
3476 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3477
3478 memoryProperties := ?
3479 pMemoryProperties[0] = memoryProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07003480}
3481
Jesse Hall606a54e2015-11-19 22:17:28 -08003482cmd void vkGetPhysicalDeviceFeatures(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003483 VkPhysicalDevice physicalDevice,
3484 VkPhysicalDeviceFeatures* pFeatures) {
3485 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3486
3487 features := ?
3488 pFeatures[0] = features
Jesse Halld27f6aa2015-08-15 17:58:48 -07003489}
3490
Jesse Hall606a54e2015-11-19 22:17:28 -08003491cmd void vkGetPhysicalDeviceFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003492 VkPhysicalDevice physicalDevice,
3493 VkFormat format,
3494 VkFormatProperties* pFormatProperties) {
3495 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3496
3497 formatProperties := ?
3498 pFormatProperties[0] = formatProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07003499}
3500
Jesse Halla9e57032015-11-30 01:03:10 -08003501cmd VkResult vkGetPhysicalDeviceImageFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003502 VkPhysicalDevice physicalDevice,
3503 VkFormat format,
3504 VkImageType type,
3505 VkImageTiling tiling,
3506 VkImageUsageFlags usage,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003507 VkImageCreateFlags flags,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003508 VkImageFormatProperties* pImageFormatProperties) {
3509 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3510
3511 imageFormatProperties := ?
3512 pImageFormatProperties[0] = imageFormatProperties
Jesse Halla9e57032015-11-30 01:03:10 -08003513
3514 return ?
Jesse Halld27f6aa2015-08-15 17:58:48 -07003515}
3516
Jesse Halld27f6aa2015-08-15 17:58:48 -07003517
3518// Device functions
3519
3520@threadSafety("system")
3521cmd VkResult vkCreateDevice(
3522 VkPhysicalDevice physicalDevice,
3523 const VkDeviceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003524 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003525 VkDevice* pDevice) {
3526 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO)
3527 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3528
3529 device := ?
3530 pDevice[0] = device
3531 State.Devices[device] = new!DeviceObject(physicalDevice: physicalDevice)
3532
3533 return ?
3534}
3535
3536@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003537cmd void vkDestroyDevice(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003538 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003539 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003540 deviceObject := GetDevice(device)
3541
3542 State.Devices[device] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003543}
3544
3545
3546// Extension discovery functions
3547
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003548cmd VkResult vkEnumerateInstanceLayerProperties(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003549 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003550 VkLayerProperties* pProperties) {
3551 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08003552 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07003553
3554 properties := pProperties[0:count]
3555 for i in (0 .. count) {
3556 property := ?
3557 properties[i] = property
3558 }
3559
3560 return ?
3561}
3562
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003563cmd VkResult vkEnumerateInstanceExtensionProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003564 const char* pLayerName,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003565 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003566 VkExtensionProperties* pProperties) {
3567 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08003568 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07003569
3570 properties := pProperties[0:count]
3571 for i in (0 .. count) {
3572 property := ?
3573 properties[i] = property
3574 }
3575
3576 return ?
3577}
3578
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003579cmd VkResult vkEnumerateDeviceLayerProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003580 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003581 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003582 VkLayerProperties* pProperties) {
3583 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3584 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08003585 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07003586
3587 properties := pProperties[0:count]
3588 for i in (0 .. count) {
3589 property := ?
3590 properties[i] = property
3591 }
3592
3593 return ?
3594}
3595
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003596cmd VkResult vkEnumerateDeviceExtensionProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003597 VkPhysicalDevice physicalDevice,
3598 const char* pLayerName,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003599 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003600 VkExtensionProperties* pProperties) {
3601 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3602
3603 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08003604 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07003605
3606 properties := pProperties[0:count]
3607 for i in (0 .. count) {
3608 property := ?
3609 properties[i] = property
3610 }
3611
3612 return ?
3613}
3614
3615
3616// Queue functions
3617
3618@threadSafety("system")
Jesse Hall606a54e2015-11-19 22:17:28 -08003619cmd void vkGetDeviceQueue(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003620 VkDevice device,
3621 u32 queueFamilyIndex,
3622 u32 queueIndex,
3623 VkQueue* pQueue) {
3624 deviceObject := GetDevice(device)
3625
3626 queue := ?
3627 pQueue[0] = queue
3628
3629 if !(queue in State.Queues) {
3630 State.Queues[queue] = new!QueueObject(device: device)
3631 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07003632}
3633
3634@threadSafety("app")
3635cmd VkResult vkQueueSubmit(
3636 VkQueue queue,
Jesse Halla366a512015-11-19 22:30:07 -08003637 u32 submitCount,
Jesse Hallb00daad2015-11-29 19:46:20 -08003638 const VkSubmitInfo* pSubmits,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003639 VkFence fence) {
3640 queueObject := GetQueue(queue)
3641
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003642 if fence != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003643 fenceObject := GetFence(fence)
3644 assert(fenceObject.device == queueObject.device)
3645 }
3646
Jesse Hall3fbc8562015-11-29 22:10:52 -08003647 // commandBuffers := pcommandBuffers[0:commandBufferCount]
3648 // for i in (0 .. commandBufferCount) {
3649 // commandBuffer := commandBuffers[i]
3650 // commandBufferObject := GetCommandBuffer(commandBuffer)
3651 // assert(commandBufferObject.device == queueObject.device)
Jesse Halla366a512015-11-19 22:30:07 -08003652 //
Jesse Hall3fbc8562015-11-29 22:10:52 -08003653 // validate("QueueCheck", commandBufferObject.queueFlags in queueObject.flags,
3654 // "vkQueueSubmit: enqueued commandBuffer requires missing queue capabilities.")
Jesse Halla366a512015-11-19 22:30:07 -08003655 // }
Jesse Halld27f6aa2015-08-15 17:58:48 -07003656
3657 return ?
3658}
3659
3660@threadSafety("system")
3661cmd VkResult vkQueueWaitIdle(
3662 VkQueue queue) {
3663 queueObject := GetQueue(queue)
3664
3665 return ?
3666}
3667
3668@threadSafety("system")
3669cmd VkResult vkDeviceWaitIdle(
3670 VkDevice device) {
3671 deviceObject := GetDevice(device)
3672
3673 return ?
3674}
3675
3676
3677// Memory functions
3678
3679@threadSafety("system")
Jesse Hall3fbc8562015-11-29 22:10:52 -08003680cmd VkResult vkAllocateMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003681 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003682 const VkMemoryAllocateInfo* pAllocateInfo,
3683 const VkAllocationCallbacks* pAllocator,
3684 VkDeviceMemory* pMemory) {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08003685 assert(pAllocateInfo.sType == VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003686 deviceObject := GetDevice(device)
3687
Jesse Hall3fbc8562015-11-29 22:10:52 -08003688 memory := ?
3689 pMemory[0] = memory
3690 State.DeviceMemories[memory] = new!DeviceMemoryObject(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003691 device: device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003692 allocationSize: pAllocateInfo[0].allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003693
3694 return ?
3695}
3696
3697@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003698cmd void vkFreeMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003699 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003700 VkDeviceMemory memory,
3701 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003702 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003703 memoryObject := GetDeviceMemory(memory)
3704 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003705
3706 // Check that no objects are still bound before freeing.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003707 validate("MemoryCheck", len(memoryObject.boundObjects) == 0,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003708 "vkFreeMemory: objects still bound")
Jesse Hall3fbc8562015-11-29 22:10:52 -08003709 validate("MemoryCheck", len(memoryObject.boundCommandBuffers) == 0,
3710 "vkFreeMemory: commandBuffers still bound")
3711 State.DeviceMemories[memory] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003712}
3713
3714@threadSafety("app")
3715cmd VkResult vkMapMemory(
3716 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003717 VkDeviceMemory memory,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003718 VkDeviceSize offset,
3719 VkDeviceSize size,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003720 VkMemoryMapFlags flags,
3721 void** ppData) {
3722 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003723 memoryObject := GetDeviceMemory(memory)
3724 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003725
3726 assert(flags == as!VkMemoryMapFlags(0))
Jesse Hall3fbc8562015-11-29 22:10:52 -08003727 assert((offset + size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003728
3729 return ?
3730}
3731
3732@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003733cmd void vkUnmapMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003734 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003735 VkDeviceMemory memory) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003736 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003737 memoryObject := GetDeviceMemory(memory)
3738 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003739}
3740
3741cmd VkResult vkFlushMappedMemoryRanges(
3742 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003743 u32 memoryRangeCount
3744 const VkMappedMemoryRange* pMemoryRanges) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003745 deviceObject := GetDevice(device)
3746
Jesse Hall3fbc8562015-11-29 22:10:52 -08003747 memoryRanges := pMemoryRanges[0:memoryRangeCount]
3748 for i in (0 .. memoryRangeCount) {
3749 memoryRange := memoryRanges[i]
3750 memoryObject := GetDeviceMemory(memoryRange.memory)
3751 assert(memoryObject.device == device)
3752 assert((memoryRange.offset + memoryRange.size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003753 }
3754
3755 return ?
3756}
3757
3758cmd VkResult vkInvalidateMappedMemoryRanges(
3759 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003760 u32 memoryRangeCount,
3761 const VkMappedMemoryRange* pMemoryRanges) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003762 deviceObject := GetDevice(device)
3763
Jesse Hall3fbc8562015-11-29 22:10:52 -08003764 memoryRanges := pMemoryRanges[0:memoryRangeCount]
3765 for i in (0 .. memoryRangeCount) {
3766 memoryRange := memoryRanges[i]
3767 memoryObject := GetDeviceMemory(memoryRange.memory)
3768 assert(memoryObject.device == device)
3769 assert((memoryRange.offset + memoryRange.size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003770 }
3771
3772 return ?
3773}
3774
3775
3776// Memory management API functions
3777
Jesse Hall606a54e2015-11-19 22:17:28 -08003778cmd void vkGetDeviceMemoryCommitment(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003779 VkDevice device,
3780 VkDeviceMemory memory,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003781 VkDeviceSize* pCommittedMemoryInBytes) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003782 deviceObject := GetDevice(device)
3783
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003784 if memory != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003785 memoryObject := GetDeviceMemory(memory)
3786 assert(memoryObject.device == device)
3787 }
3788
3789 committedMemoryInBytes := ?
3790 pCommittedMemoryInBytes[0] = committedMemoryInBytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07003791}
3792
Jesse Hall606a54e2015-11-19 22:17:28 -08003793cmd void vkGetBufferMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003794 VkDevice device,
3795 VkBuffer buffer,
3796 VkMemoryRequirements* pMemoryRequirements) {
3797 deviceObject := GetDevice(device)
3798 bufferObject := GetBuffer(buffer)
3799 assert(bufferObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003800}
3801
3802cmd VkResult vkBindBufferMemory(
3803 VkDevice device,
3804 VkBuffer buffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003805 VkDeviceMemory memory,
3806 VkDeviceSize memoryOffset) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003807 deviceObject := GetDevice(device)
3808 bufferObject := GetBuffer(buffer)
3809 assert(bufferObject.device == device)
3810
3811 // Unbind buffer from previous memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003812 if bufferObject.memory != NULL_HANDLE {
3813 memoryObject := GetDeviceMemory(bufferObject.memory)
3814 memoryObject.boundObjects[as!u64(buffer)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003815 }
3816
3817 // Bind buffer to given memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003818 if memory != NULL_HANDLE {
3819 memoryObject := GetDeviceMemory(memory)
3820 assert(memoryObject.device == device)
3821 memoryObject.boundObjects[as!u64(buffer)] = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003822 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08003823 bufferObject.memory = memory
3824 bufferObject.memoryOffset = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003825
3826 return ?
3827}
3828
Jesse Hall606a54e2015-11-19 22:17:28 -08003829cmd void vkGetImageMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003830 VkDevice device,
3831 VkImage image,
3832 VkMemoryRequirements* pMemoryRequirements) {
3833 deviceObject := GetDevice(device)
3834 imageObject := GetImage(image)
3835 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003836}
3837
3838cmd VkResult vkBindImageMemory(
3839 VkDevice device,
3840 VkImage image,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003841 VkDeviceMemory memory,
3842 VkDeviceSize memoryOffset) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003843 deviceObject := GetDevice(device)
3844 imageObject := GetImage(image)
3845 assert(imageObject.device == device)
3846
3847 // Unbind image from previous memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003848 if imageObject.memory != NULL_HANDLE {
3849 memoryObject := GetDeviceMemory(imageObject.memory)
3850 memoryObject.boundObjects[as!u64(image)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003851 }
3852
3853 // Bind image to given memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003854 if memory != NULL_HANDLE {
3855 memoryObject := GetDeviceMemory(memory)
3856 assert(memoryObject.device == device)
3857 memoryObject.boundObjects[as!u64(image)] = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003858 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08003859 imageObject.memory = memory
3860 imageObject.memoryOffset = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003861
3862 return ?
3863}
3864
Jesse Hall606a54e2015-11-19 22:17:28 -08003865cmd void vkGetImageSparseMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003866 VkDevice device,
3867 VkImage image,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003868 u32* pSparseMemoryRequirementCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003869 VkSparseImageMemoryRequirements* pSparseMemoryRequirements) {
3870 deviceObject := GetDevice(device)
3871 imageObject := GetImage(image)
3872 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003873}
3874
Jesse Hall606a54e2015-11-19 22:17:28 -08003875cmd void vkGetPhysicalDeviceSparseImageFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003876 VkPhysicalDevice physicalDevice,
3877 VkFormat format,
3878 VkImageType type,
Jesse Hall091ed9e2015-11-30 00:55:29 -08003879 VkSampleCountFlagBits samples,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003880 VkImageUsageFlags usage,
3881 VkImageTiling tiling,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003882 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003883 VkSparseImageFormatProperties* pProperties) {
3884 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003885}
3886
Jesse Halla6429252015-11-29 18:59:42 -08003887cmd VkResult vkQueueBindSparse(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003888 VkQueue queue,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003889 u32 bindInfoCount,
Jesse Halla6429252015-11-29 18:59:42 -08003890 const VkBindSparseInfo* pBindInfo,
3891 VkFence fence) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003892 queueObject := GetQueue(queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003893
3894 return ?
3895}
3896
3897
3898// Fence functions
3899
3900@threadSafety("system")
3901cmd VkResult vkCreateFence(
3902 VkDevice device,
3903 const VkFenceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003904 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003905 VkFence* pFence) {
3906 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_FENCE_CREATE_INFO)
3907 deviceObject := GetDevice(device)
3908
3909 fence := ?
3910 pFence[0] = fence
3911 State.Fences[fence] = new!FenceObject(
Jesse Halld8bade02015-11-24 10:24:18 -08003912 device: device, signaled: (pCreateInfo.flags == as!VkFenceCreateFlags(VK_FENCE_CREATE_SIGNALED_BIT)))
Jesse Halld27f6aa2015-08-15 17:58:48 -07003913
3914 return ?
3915}
3916
3917@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003918cmd void vkDestroyFence(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003919 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003920 VkFence fence,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003921 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003922 deviceObject := GetDevice(device)
3923 fenceObject := GetFence(fence)
3924 assert(fenceObject.device == device)
3925
3926 State.Fences[fence] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003927}
3928
3929@threadSafety("system")
3930cmd VkResult vkResetFences(
3931 VkDevice device,
3932 u32 fenceCount,
3933 const VkFence* pFences) {
3934 deviceObject := GetDevice(device)
3935
3936 fences := pFences[0:fenceCount]
3937 for i in (0 .. fenceCount) {
3938 fence := fences[i]
3939 fenceObject := GetFence(fence)
3940 assert(fenceObject.device == device)
3941 fenceObject.signaled = false
3942 }
3943
3944 return ?
3945}
3946
3947@threadSafety("system")
3948cmd VkResult vkGetFenceStatus(
3949 VkDevice device,
3950 VkFence fence) {
3951 deviceObject := GetDevice(device)
3952 fenceObject := GetFence(fence)
3953 assert(fenceObject.device == device)
3954
3955 return ?
3956}
3957
3958@threadSafety("system")
3959cmd VkResult vkWaitForFences(
3960 VkDevice device,
3961 u32 fenceCount,
3962 const VkFence* pFences,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003963 VkBool32 waitAll,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003964 u64 timeout) { /// timeout in nanoseconds
3965 deviceObject := GetDevice(device)
3966
3967 fences := pFences[0:fenceCount]
3968 for i in (0 .. fenceCount) {
3969 fence := fences[i]
3970 fenceObject := GetFence(fence)
3971 assert(fenceObject.device == device)
3972 }
3973
3974 return ?
3975}
3976
3977
3978// Queue semaphore functions
3979
3980@threadSafety("system")
3981cmd VkResult vkCreateSemaphore(
3982 VkDevice device,
3983 const VkSemaphoreCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003984 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003985 VkSemaphore* pSemaphore) {
3986 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO)
3987 deviceObject := GetDevice(device)
3988
3989 semaphore := ?
3990 pSemaphore[0] = semaphore
3991 State.Semaphores[semaphore] = new!SemaphoreObject(device: device)
3992
3993 return ?
3994}
3995
3996@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003997cmd void vkDestroySemaphore(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003998 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003999 VkSemaphore semaphore,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004000 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004001 deviceObject := GetDevice(device)
4002 semaphoreObject := GetSemaphore(semaphore)
4003 assert(semaphoreObject.device == device)
4004
4005 State.Semaphores[semaphore] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004006}
4007
Jesse Halld27f6aa2015-08-15 17:58:48 -07004008
4009// Event functions
4010
4011@threadSafety("system")
4012cmd VkResult vkCreateEvent(
4013 VkDevice device,
4014 const VkEventCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004015 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004016 VkEvent* pEvent) {
4017 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_EVENT_CREATE_INFO)
4018 deviceObject := GetDevice(device)
4019
4020 event := ?
4021 pEvent[0] = event
4022 State.Events[event] = new!EventObject(device: device)
4023
4024 return ?
4025}
4026
4027@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004028cmd void vkDestroyEvent(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004029 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004030 VkEvent event,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004031 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004032 deviceObject := GetDevice(device)
4033 eventObject := GetEvent(event)
4034 assert(eventObject.device == device)
4035
4036 State.Events[event] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004037}
4038
4039@threadSafety("system")
4040cmd VkResult vkGetEventStatus(
4041 VkDevice device,
4042 VkEvent event) {
4043 deviceObject := GetDevice(device)
4044 eventObject := GetEvent(event)
4045 assert(eventObject.device == device)
4046
4047 return ?
4048}
4049
4050@threadSafety("system")
4051cmd VkResult vkSetEvent(
4052 VkDevice device,
4053 VkEvent event) {
4054 deviceObject := GetDevice(device)
4055 eventObject := GetEvent(event)
4056 assert(eventObject.device == device)
4057
4058 return ?
4059}
4060
4061@threadSafety("system")
4062cmd VkResult vkResetEvent(
4063 VkDevice device,
4064 VkEvent event) {
4065 deviceObject := GetDevice(device)
4066 eventObject := GetEvent(event)
4067 assert(eventObject.device == device)
4068
4069 return ?
4070}
4071
4072
4073// Query functions
4074
4075@threadSafety("system")
4076cmd VkResult vkCreateQueryPool(
4077 VkDevice device,
4078 const VkQueryPoolCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004079 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004080 VkQueryPool* pQueryPool) {
4081 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO)
4082 deviceObject := GetDevice(device)
4083
4084 queryPool := ?
4085 pQueryPool[0] = queryPool
4086 State.QueryPools[queryPool] = new!QueryPoolObject(device: device)
4087
4088 return ?
4089}
4090
4091@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004092cmd void vkDestroyQueryPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004093 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004094 VkQueryPool queryPool,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004095 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004096 deviceObject := GetDevice(device)
4097 queryPoolObject := GetQueryPool(queryPool)
4098 assert(queryPoolObject.device == device)
4099
4100 State.QueryPools[queryPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004101}
4102
4103@threadSafety("system")
4104cmd VkResult vkGetQueryPoolResults(
4105 VkDevice device,
4106 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004107 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004108 u32 queryCount,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004109 platform.size_t dataSize,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004110 void* pData,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004111 VkDeviceSize stride,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004112 VkQueryResultFlags flags) {
4113 deviceObject := GetDevice(device)
4114 queryPoolObject := GetQueryPool(queryPool)
4115 assert(queryPoolObject.device == device)
4116
Jesse Halld27f6aa2015-08-15 17:58:48 -07004117 data := pData[0:dataSize]
4118
4119 return ?
4120}
4121
4122// Buffer functions
4123
4124@threadSafety("system")
4125cmd VkResult vkCreateBuffer(
4126 VkDevice device,
4127 const VkBufferCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004128 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004129 VkBuffer* pBuffer) {
4130 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO)
4131 deviceObject := GetDevice(device)
4132
4133 buffer := ?
4134 pBuffer[0] = buffer
4135 State.Buffers[buffer] = new!BufferObject(device: device)
4136
4137 return ?
4138}
4139
4140@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004141cmd void vkDestroyBuffer(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004142 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004143 VkBuffer buffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004144 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004145 deviceObject := GetDevice(device)
4146 bufferObject := GetBuffer(buffer)
4147 assert(bufferObject.device == device)
4148
Jesse Hall3fbc8562015-11-29 22:10:52 -08004149 assert(bufferObject.memory == 0)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004150 State.Buffers[buffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004151}
4152
4153
4154// Buffer view functions
4155
4156@threadSafety("system")
4157cmd VkResult vkCreateBufferView(
4158 VkDevice device,
4159 const VkBufferViewCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004160 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004161 VkBufferView* pView) {
4162 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO)
4163 deviceObject := GetDevice(device)
4164
4165 bufferObject := GetBuffer(pCreateInfo.buffer)
4166 assert(bufferObject.device == device)
4167
4168 view := ?
4169 pView[0] = view
4170 State.BufferViews[view] = new!BufferViewObject(device: device, buffer: pCreateInfo.buffer)
4171
4172 return ?
4173}
4174
4175@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004176cmd void vkDestroyBufferView(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004177 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004178 VkBufferView bufferView,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004179 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004180 deviceObject := GetDevice(device)
4181 bufferViewObject := GetBufferView(bufferView)
4182 assert(bufferViewObject.device == device)
4183
4184 State.BufferViews[bufferView] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004185}
4186
4187
4188// Image functions
4189
4190@threadSafety("system")
4191cmd VkResult vkCreateImage(
4192 VkDevice device,
4193 const VkImageCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004194 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004195 VkImage* pImage) {
4196 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO)
4197 deviceObject := GetDevice(device)
4198
4199 image := ?
4200 pImage[0] = image
4201 State.Images[image] = new!ImageObject(device: device)
4202
4203 return ?
4204}
4205
4206@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004207cmd void vkDestroyImage(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004208 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004209 VkImage image,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004210 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004211 deviceObject := GetDevice(device)
4212 imageObject := GetImage(image)
4213 assert(imageObject.device == device)
4214
Jesse Hall3fbc8562015-11-29 22:10:52 -08004215 assert(imageObject.memory == 0)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004216 State.Images[image] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004217}
4218
Jesse Hall606a54e2015-11-19 22:17:28 -08004219cmd void vkGetImageSubresourceLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004220 VkDevice device,
4221 VkImage image,
4222 const VkImageSubresource* pSubresource,
4223 VkSubresourceLayout* pLayout) {
4224 deviceObject := GetDevice(device)
4225 imageObject := GetImage(image)
4226 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004227}
4228
4229
4230// Image view functions
4231
4232@threadSafety("system")
4233cmd VkResult vkCreateImageView(
4234 VkDevice device,
4235 const VkImageViewCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004236 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004237 VkImageView* pView) {
4238 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO)
4239 deviceObject := GetDevice(device)
4240
4241 imageObject := GetImage(pCreateInfo.image)
4242 assert(imageObject.device == device)
4243
4244 view := ?
4245 pView[0] = view
4246 State.ImageViews[view] = new!ImageViewObject(device: device, image: pCreateInfo.image)
4247
4248 return ?
4249}
4250
4251@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004252cmd void vkDestroyImageView(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004253 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004254 VkImageView imageView,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004255 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004256 deviceObject := GetDevice(device)
4257 imageViewObject := GetImageView(imageView)
4258 assert(imageViewObject.device == device)
4259
4260 State.ImageViews[imageView] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004261}
4262
4263
4264// Shader functions
4265
4266cmd VkResult vkCreateShaderModule(
4267 VkDevice device,
4268 const VkShaderModuleCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004269 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004270 VkShaderModule* pShaderModule) {
4271 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO)
4272 deviceObject := GetDevice(device)
4273
4274 shaderModule := ?
4275 pShaderModule[0] = shaderModule
4276 State.ShaderModules[shaderModule] = new!ShaderModuleObject(device: device)
4277
4278 return ?
4279}
4280
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004281cmd void vkDestroyShaderModule(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004282 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004283 VkShaderModule shaderModule,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004284 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004285 deviceObject := GetDevice(device)
4286 shaderModuleObject := GetShaderModule(shaderModule)
4287 assert(shaderModuleObject.device == device)
4288
4289 State.ShaderModules[shaderModule] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004290}
4291
Jesse Halld27f6aa2015-08-15 17:58:48 -07004292
4293// Pipeline functions
4294
4295cmd VkResult vkCreatePipelineCache(
4296 VkDevice device,
4297 const VkPipelineCacheCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004298 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004299 VkPipelineCache* pPipelineCache) {
4300 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO)
4301 deviceObject := GetDevice(device)
4302
4303 pipelineCache := ?
4304 pPipelineCache[0] = pipelineCache
4305 State.PipelineCaches[pipelineCache] = new!PipelineCacheObject(device: device)
4306
4307 return ?
4308}
4309
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004310cmd void vkDestroyPipelineCache(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004311 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004312 VkPipelineCache pipelineCache,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004313 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004314 deviceObject := GetDevice(device)
4315 pipelineCacheObject := GetPipelineCache(pipelineCache)
4316 assert(pipelineCacheObject.device == device)
4317
4318 State.PipelineCaches[pipelineCache] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004319}
4320
Jesse Halld27f6aa2015-08-15 17:58:48 -07004321cmd VkResult vkGetPipelineCacheData(
4322 VkDevice device,
4323 VkPipelineCache pipelineCache,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004324 platform.size_t* pDataSize,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004325 void* pData) {
4326 deviceObject := GetDevice(device)
4327 pipelineCacheObject := GetPipelineCache(pipelineCache)
4328 assert(pipelineCacheObject.device == device)
4329
4330 return ?
4331}
4332
4333cmd VkResult vkMergePipelineCaches(
4334 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004335 VkPipelineCache dstCache,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004336 u32 srcCacheCount,
4337 const VkPipelineCache* pSrcCaches) {
4338 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004339 dstCacheObject := GetPipelineCache(dstCache)
4340 assert(dstCacheObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004341
4342 srcCaches := pSrcCaches[0:srcCacheCount]
4343 for i in (0 .. srcCacheCount) {
4344 srcCache := srcCaches[i]
4345 srcCacheObject := GetPipelineCache(srcCache)
4346 assert(srcCacheObject.device == device)
4347 }
4348
4349 return ?
4350}
4351
4352cmd VkResult vkCreateGraphicsPipelines(
4353 VkDevice device,
4354 VkPipelineCache pipelineCache,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004355 u32 createInfoCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004356 const VkGraphicsPipelineCreateInfo* pCreateInfos,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004357 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004358 VkPipeline* pPipelines) {
4359 deviceObject := GetDevice(device)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004360 if pipelineCache != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004361 pipelineCacheObject := GetPipelineCache(pipelineCache)
4362 assert(pipelineCacheObject.device == device)
4363 }
4364
Jesse Hall03b6fe12015-11-24 12:44:21 -08004365 createInfos := pCreateInfos[0:createInfoCount]
4366 pipelines := pPipelines[0:createInfoCount]
4367 for i in (0 .. createInfoCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004368 pipeline := ?
4369 pipelines[i] = pipeline
4370 State.Pipelines[pipeline] = new!PipelineObject(device: device)
4371 }
4372
4373 return ?
4374}
4375
4376cmd VkResult vkCreateComputePipelines(
4377 VkDevice device,
4378 VkPipelineCache pipelineCache,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004379 u32 createInfoCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004380 const VkComputePipelineCreateInfo* pCreateInfos,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004381 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004382 VkPipeline* pPipelines) {
4383 deviceObject := GetDevice(device)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004384 if pipelineCache != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004385 pipelineCacheObject := GetPipelineCache(pipelineCache)
4386 assert(pipelineCacheObject.device == device)
4387 }
4388
Jesse Hall03b6fe12015-11-24 12:44:21 -08004389 createInfos := pCreateInfos[0:createInfoCount]
4390 pipelines := pPipelines[0:createInfoCount]
4391 for i in (0 .. createInfoCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004392 pipeline := ?
4393 pipelines[i] = pipeline
4394 State.Pipelines[pipeline] = new!PipelineObject(device: device)
4395 }
4396
4397 return ?
4398}
4399
4400@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004401cmd void vkDestroyPipeline(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004402 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004403 VkPipeline pipeline,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004404 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004405 deviceObject := GetDevice(device)
4406 pipelineObjects := GetPipeline(pipeline)
4407 assert(pipelineObjects.device == device)
4408
4409 State.Pipelines[pipeline] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004410}
4411
4412
4413// Pipeline layout functions
4414
4415@threadSafety("system")
4416cmd VkResult vkCreatePipelineLayout(
4417 VkDevice device,
4418 const VkPipelineLayoutCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004419 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004420 VkPipelineLayout* pPipelineLayout) {
4421 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO)
4422 deviceObject := GetDevice(device)
4423
4424 pipelineLayout := ?
4425 pPipelineLayout[0] = pipelineLayout
4426 State.PipelineLayouts[pipelineLayout] = new!PipelineLayoutObject(device: device)
4427
4428 return ?
4429}
4430
4431@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004432cmd void vkDestroyPipelineLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004433 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004434 VkPipelineLayout pipelineLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004435 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004436 deviceObject := GetDevice(device)
4437 pipelineLayoutObjects := GetPipelineLayout(pipelineLayout)
4438 assert(pipelineLayoutObjects.device == device)
4439
4440 State.PipelineLayouts[pipelineLayout] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004441}
4442
4443
4444// Sampler functions
4445
4446@threadSafety("system")
4447cmd VkResult vkCreateSampler(
4448 VkDevice device,
4449 const VkSamplerCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004450 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004451 VkSampler* pSampler) {
4452 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO)
4453 deviceObject := GetDevice(device)
4454
4455 sampler := ?
4456 pSampler[0] = sampler
4457 State.Samplers[sampler] = new!SamplerObject(device: device)
4458
4459 return ?
4460}
4461
4462@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004463cmd void vkDestroySampler(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004464 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004465 VkSampler sampler,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004466 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004467 deviceObject := GetDevice(device)
4468 samplerObject := GetSampler(sampler)
4469 assert(samplerObject.device == device)
4470
4471 State.Samplers[sampler] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004472}
4473
4474
4475// Descriptor set functions
4476
4477@threadSafety("system")
4478cmd VkResult vkCreateDescriptorSetLayout(
4479 VkDevice device,
4480 const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004481 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004482 VkDescriptorSetLayout* pSetLayout) {
4483 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO)
4484 deviceObject := GetDevice(device)
4485
4486 setLayout := ?
4487 pSetLayout[0] = setLayout
4488 State.DescriptorSetLayouts[setLayout] = new!DescriptorSetLayoutObject(device: device)
4489
4490 return ?
4491}
4492
4493@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004494cmd void vkDestroyDescriptorSetLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004495 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004496 VkDescriptorSetLayout descriptorSetLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004497 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004498 deviceObject := GetDevice(device)
4499 descriptorSetLayoutObject := GetDescriptorSetLayout(descriptorSetLayout)
4500 assert(descriptorSetLayoutObject.device == device)
4501
4502 State.DescriptorSetLayouts[descriptorSetLayout] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004503}
4504
4505@threadSafety("system")
4506cmd VkResult vkCreateDescriptorPool(
4507 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004508 const VkDescriptorPoolCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004509 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004510 VkDescriptorPool* pDescriptorPool) {
4511 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO)
4512 deviceObject := GetDevice(device)
4513
4514 descriptorPool := ?
4515 pDescriptorPool[0] = descriptorPool
4516 State.DescriptorPools[descriptorPool] = new!DescriptorPoolObject(device: device)
4517
4518 return ?
4519}
4520
4521@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004522cmd void vkDestroyDescriptorPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004523 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004524 VkDescriptorPool descriptorPool,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004525 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004526 deviceObject := GetDevice(device)
4527 descriptorPoolObject := GetDescriptorPool(descriptorPool)
4528 assert(descriptorPoolObject.device == device)
4529
4530 State.DescriptorPools[descriptorPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004531}
4532
4533@threadSafety("app")
4534cmd VkResult vkResetDescriptorPool(
4535 VkDevice device,
Jesse Hallfbf97b02015-11-20 14:17:03 -08004536 VkDescriptorPool descriptorPool,
4537 VkDescriptorPoolResetFlags flags) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004538 deviceObject := GetDevice(device)
4539 descriptorPoolObject := GetDescriptorPool(descriptorPool)
4540 assert(descriptorPoolObject.device == device)
4541
4542 return ?
4543}
4544
4545@threadSafety("app")
Jesse Hall3fbc8562015-11-29 22:10:52 -08004546cmd VkResult vkAllocateDescriptorSets(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004547 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004548 const VkDescriptorSetAllocateInfo* pAllocateInfo,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004549 VkDescriptorSet* pDescriptorSets) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004550 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004551 allocInfo := pAllocateInfo[0]
Jesse Hallfbf97b02015-11-20 14:17:03 -08004552 descriptorPoolObject := GetDescriptorPool(allocInfo.descriptorPool)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004553
Jesse Hall03b6fe12015-11-24 12:44:21 -08004554 setLayouts := allocInfo.pSetLayouts[0:allocInfo.setCount]
4555 for i in (0 .. allocInfo.setCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004556 setLayout := setLayouts[i]
4557 setLayoutObject := GetDescriptorSetLayout(setLayout)
4558 assert(setLayoutObject.device == device)
4559 }
4560
Jesse Hall03b6fe12015-11-24 12:44:21 -08004561 descriptorSets := pDescriptorSets[0:allocInfo.setCount]
4562 for i in (0 .. allocInfo.setCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004563 descriptorSet := ?
4564 descriptorSets[i] = descriptorSet
4565 State.DescriptorSets[descriptorSet] = new!DescriptorSetObject(device: device)
4566 }
4567
4568 return ?
4569}
4570
Jesse Hallf09c6b12015-08-15 19:54:28 -07004571cmd VkResult vkFreeDescriptorSets(
4572 VkDevice device,
4573 VkDescriptorPool descriptorPool,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004574 u32 descriptorSetCount,
Jesse Hallf09c6b12015-08-15 19:54:28 -07004575 const VkDescriptorSet* pDescriptorSets) {
4576 deviceObject := GetDevice(device)
4577 descriptorPoolObject := GetDescriptorPool(descriptorPool)
4578
Jesse Hall03b6fe12015-11-24 12:44:21 -08004579 descriptorSets := pDescriptorSets[0:descriptorSetCount]
4580 for i in (0 .. descriptorSetCount) {
Jesse Hallf09c6b12015-08-15 19:54:28 -07004581 descriptorSet := descriptorSets[i]
4582 descriptorSetObject := GetDescriptorSet(descriptorSet)
4583 assert(descriptorSetObject.device == device)
4584 State.DescriptorSets[descriptorSet] = null
4585 }
4586
4587 return ?
4588}
4589
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004590cmd void vkUpdateDescriptorSets(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004591 VkDevice device,
Jesse Hallb00daad2015-11-29 19:46:20 -08004592 u32 descriptorWriteCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004593 const VkWriteDescriptorSet* pDescriptorWrites,
Jesse Hallb00daad2015-11-29 19:46:20 -08004594 u32 descriptorCopyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004595 const VkCopyDescriptorSet* pDescriptorCopies) {
4596 deviceObject := GetDevice(device)
4597
Jesse Hallb00daad2015-11-29 19:46:20 -08004598 descriptorWrites := pDescriptorWrites[0:descriptorWriteCount]
4599 for i in (0 .. descriptorWriteCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004600 descriptorWrite := descriptorWrites[i]
Jesse Hall3fbc8562015-11-29 22:10:52 -08004601 descriptorWriteObject := GetDescriptorSet(descriptorWrite.dstSet)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004602 assert(descriptorWriteObject.device == device)
4603 }
4604
Jesse Hallb00daad2015-11-29 19:46:20 -08004605 descriptorCopies := pDescriptorCopies[0:descriptorCopyCount]
4606 for i in (0 .. descriptorCopyCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004607 descriptorCopy := descriptorCopies[i]
Jesse Hall3fbc8562015-11-29 22:10:52 -08004608 descriptorCopyObject := GetDescriptorSet(descriptorCopy.dstSet)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004609 assert(descriptorCopyObject.device == device)
4610 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07004611}
4612
4613
4614// Framebuffer functions
4615
4616@threadSafety("system")
4617cmd VkResult vkCreateFramebuffer(
4618 VkDevice device,
4619 const VkFramebufferCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004620 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004621 VkFramebuffer* pFramebuffer) {
4622 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO)
4623 deviceObject := GetDevice(device)
4624
4625 framebuffer := ?
4626 pFramebuffer[0] = framebuffer
4627 State.Framebuffers[framebuffer] = new!FramebufferObject(device: device)
4628
4629 return ?
4630}
4631
4632@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004633cmd void vkDestroyFramebuffer(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004634 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004635 VkFramebuffer framebuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004636 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004637 deviceObject := GetDevice(device)
4638 framebufferObject := GetFramebuffer(framebuffer)
4639 assert(framebufferObject.device == device)
4640
4641 State.Framebuffers[framebuffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004642}
4643
4644
4645// Renderpass functions
4646
4647@threadSafety("system")
4648cmd VkResult vkCreateRenderPass(
4649 VkDevice device,
4650 const VkRenderPassCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004651 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004652 VkRenderPass* pRenderPass) {
4653 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO)
4654 deviceObject := GetDevice(device)
4655
4656 renderpass := ?
4657 pRenderPass[0] = renderpass
4658 State.RenderPasses[renderpass] = new!RenderPassObject(device: device)
4659
4660 return ?
4661}
4662
4663@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004664cmd void vkDestroyRenderPass(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004665 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004666 VkRenderPass renderPass,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004667 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004668 deviceObject := GetDevice(device)
4669 renderPassObject := GetRenderPass(renderPass)
4670 assert(renderPassObject.device == device)
4671
4672 State.RenderPasses[renderPass] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004673}
4674
Jesse Hall606a54e2015-11-19 22:17:28 -08004675cmd void vkGetRenderAreaGranularity(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004676 VkDevice device,
4677 VkRenderPass renderPass,
4678 VkExtent2D* pGranularity) {
4679 deviceObject := GetDevice(device)
4680 renderPassObject := GetRenderPass(renderPass)
4681
4682 granularity := ?
4683 pGranularity[0] = granularity
Jesse Halld27f6aa2015-08-15 17:58:48 -07004684}
4685
4686// Command pool functions
4687
4688cmd VkResult vkCreateCommandPool(
4689 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004690 const VkCommandPoolCreateInfo* pCreateInfo,
4691 const VkAllocationCallbacks* pAllocator,
4692 VkCommandPool* pCommandPool) {
4693 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004694 deviceObject := GetDevice(device)
4695
Jesse Hall3fbc8562015-11-29 22:10:52 -08004696 commandPool := ?
4697 pCommandPool[0] = commandPool
4698 State.CommandPools[commandPool] = new!CommandPoolObject(device: device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004699
4700 return ?
4701}
4702
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004703cmd void vkDestroyCommandPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004704 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004705 VkCommandPool commandPool,
4706 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004707 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004708 commandPoolObject := GetCommandPool(commandPool)
4709 assert(commandPoolObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004710
Jesse Hall3fbc8562015-11-29 22:10:52 -08004711 State.CommandPools[commandPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004712}
4713
4714cmd VkResult vkResetCommandPool(
4715 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004716 VkCommandPool commandPool,
4717 VkCommandPoolResetFlags flags) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004718 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004719 commandPoolObject := GetCommandPool(commandPool)
4720 assert(commandPoolObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004721
4722 return ?
4723}
4724
4725// Command buffer functions
4726
Jesse Hall3fbc8562015-11-29 22:10:52 -08004727macro void bindCommandBuffer(VkCommandBuffer commandBuffer, any obj, VkDeviceMemory memory) {
4728 memoryObject := GetDeviceMemory(memory)
4729 memoryObject.boundCommandBuffers[commandBuffer] = commandBuffer
Jesse Halld27f6aa2015-08-15 17:58:48 -07004730
Jesse Hall3fbc8562015-11-29 22:10:52 -08004731 commandBufferObject := GetCommandBuffer(commandBuffer)
4732 commandBufferObject.boundObjects[as!u64(obj)] = memory
Jesse Halld27f6aa2015-08-15 17:58:48 -07004733}
4734
Jesse Hall3fbc8562015-11-29 22:10:52 -08004735macro void unbindCommandBuffer(VkCommandBuffer commandBuffer, any obj, VkDeviceMemory memory) {
4736 memoryObject := GetDeviceMemory(memory)
4737 memoryObject.boundCommandBuffers[commandBuffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004738
Jesse Hall3fbc8562015-11-29 22:10:52 -08004739 commandBufferObject := GetCommandBuffer(commandBuffer)
4740 commandBufferObject.boundObjects[as!u64(obj)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004741}
4742
4743@threadSafety("system")
Jesse Hall3fbc8562015-11-29 22:10:52 -08004744cmd VkResult vkAllocateCommandBuffers(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004745 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004746 const VkCommandBufferAllocateInfo* pAllocateInfo,
4747 VkCommandBuffer* pCommandBuffers) {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08004748 assert(pAllocateInfo[0].sType == VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004749
Jesse Hall3dd678a2016-01-08 21:52:01 -08004750 count := pAllocateInfo[0].commandBufferCount
Jesse Hall3fbc8562015-11-29 22:10:52 -08004751 commandBuffers := pCommandBuffers[0:count]
Jesse Hallfbf97b02015-11-20 14:17:03 -08004752 for i in (0 .. count) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004753 commandBuffer := ?
4754 commandBuffers[i] = commandBuffer
4755 State.CommandBuffers[commandBuffer] = new!CommandBufferObject(device: device)
Jesse Hallfbf97b02015-11-20 14:17:03 -08004756 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07004757
4758 return ?
4759}
4760
4761@threadSafety("system")
Jesse Hallfbf97b02015-11-20 14:17:03 -08004762cmd void vkFreeCommandBuffers(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004763 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004764 VkCommandPool commandPool,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004765 u32 commandBufferCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004766 const VkCommandBuffer* pCommandBuffers) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004767 deviceObject := GetDevice(device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004768
Jesse Hall3fbc8562015-11-29 22:10:52 -08004769 commandBuffers := pCommandBuffers[0:commandBufferCount]
Jesse Hall03b6fe12015-11-24 12:44:21 -08004770 for i in (0 .. commandBufferCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004771 commandBufferObject := GetCommandBuffer(commandBuffers[i])
4772 assert(commandBufferObject.device == device)
Jesse Hallfbf97b02015-11-20 14:17:03 -08004773 // TODO: iterate over boundObjects and clear memory bindings
Jesse Hall3fbc8562015-11-29 22:10:52 -08004774 State.CommandBuffers[commandBuffers[i]] = null
Jesse Hallfbf97b02015-11-20 14:17:03 -08004775 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07004776}
4777
4778@threadSafety("app")
4779cmd VkResult vkBeginCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004780 VkCommandBuffer commandBuffer,
4781 const VkCommandBufferBeginInfo* pBeginInfo) {
4782 assert(pBeginInfo.sType == VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO)
4783 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004784
4785 // TODO: iterate over boundObjects and clear memory bindings
4786
4787 return ?
4788}
4789
4790@threadSafety("app")
4791cmd VkResult vkEndCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004792 VkCommandBuffer commandBuffer) {
4793 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004794
4795 return ?
4796}
4797
4798@threadSafety("app")
4799cmd VkResult vkResetCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004800 VkCommandBuffer commandBuffer,
4801 VkCommandBufferResetFlags flags) {
4802 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004803
4804 // TODO: iterate over boundObjects and clear memory bindings
4805
4806 return ?
4807}
4808
4809
4810// Command buffer building functions
4811
4812@threadSafety("app")
4813cmd void vkCmdBindPipeline(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004814 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004815 VkPipelineBindPoint pipelineBindPoint,
4816 VkPipeline pipeline) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004817 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004818 pipelineObject := GetPipeline(pipeline)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004819 assert(commandBufferObject.device == pipelineObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004820
Jesse Halld8bade02015-11-24 10:24:18 -08004821 queue := switch (pipelineBindPoint) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004822 case VK_PIPELINE_BIND_POINT_COMPUTE: VK_QUEUE_COMPUTE_BIT
4823 case VK_PIPELINE_BIND_POINT_GRAPHICS: VK_QUEUE_GRAPHICS_BIT
4824 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08004825 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004826}
4827
4828@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004829cmd void vkCmdSetViewport(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004830 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004831 u32 firstViewport,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004832 u32 viewportCount,
4833 const VkViewport* pViewports) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004834 commandBufferObject := GetCommandBuffer(commandBuffer)
4835 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004836}
4837
4838@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004839cmd void vkCmdSetScissor(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004840 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004841 u32 firstScissor,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004842 u32 scissorCount,
4843 const VkRect2D* pScissors) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004844 commandBufferObject := GetCommandBuffer(commandBuffer)
4845 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004846}
4847
4848@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004849cmd void vkCmdSetLineWidth(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004850 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004851 f32 lineWidth) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004852 commandBufferObject := GetCommandBuffer(commandBuffer)
4853 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004854}
4855
4856@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004857cmd void vkCmdSetDepthBias(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004858 VkCommandBuffer commandBuffer,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004859 f32 depthBiasConstantFactor,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004860 f32 depthBiasClamp,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004861 f32 depthBiasSlopeFactor) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004862 commandBufferObject := GetCommandBuffer(commandBuffer)
4863 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004864}
Jesse Halld27f6aa2015-08-15 17:58:48 -07004865
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004866@threadSafety("app")
4867cmd void vkCmdSetBlendConstants(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004868 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004869 // TODO(jessehall): apic only supports 'const' on pointer types. Using
4870 // an annotation as a quick hack to pass this to the template without
4871 // having to modify the AST and semantic model.
Jesse Hallb00daad2015-11-29 19:46:20 -08004872 @readonly f32[4] blendConstants) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004873 commandBufferObject := GetCommandBuffer(commandBuffer)
4874 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004875}
4876
4877@threadSafety("app")
4878cmd void vkCmdSetDepthBounds(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004879 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004880 f32 minDepthBounds,
4881 f32 maxDepthBounds) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004882 commandBufferObject := GetCommandBuffer(commandBuffer)
4883 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004884}
4885
4886@threadSafety("app")
4887cmd void vkCmdSetStencilCompareMask(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004888 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004889 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08004890 u32 compareMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004891 commandBufferObject := GetCommandBuffer(commandBuffer)
4892 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004893}
4894
4895@threadSafety("app")
4896cmd void vkCmdSetStencilWriteMask(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004897 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004898 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08004899 u32 writeMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004900 commandBufferObject := GetCommandBuffer(commandBuffer)
4901 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004902}
4903
4904@threadSafety("app")
4905cmd void vkCmdSetStencilReference(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004906 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004907 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08004908 u32 reference) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004909 commandBufferObject := GetCommandBuffer(commandBuffer)
4910 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004911}
4912
4913@threadSafety("app")
4914cmd void vkCmdBindDescriptorSets(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004915 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004916 VkPipelineBindPoint pipelineBindPoint,
4917 VkPipelineLayout layout,
4918 u32 firstSet,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004919 u32 descriptorSetCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004920 const VkDescriptorSet* pDescriptorSets,
4921 u32 dynamicOffsetCount,
4922 const u32* pDynamicOffsets) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004923 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004924
Jesse Hall03b6fe12015-11-24 12:44:21 -08004925 descriptorSets := pDescriptorSets[0:descriptorSetCount]
4926 for i in (0 .. descriptorSetCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004927 descriptorSet := descriptorSets[i]
4928 descriptorSetObject := GetDescriptorSet(descriptorSet)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004929 assert(commandBufferObject.device == descriptorSetObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004930 }
4931
4932 dynamicOffsets := pDynamicOffsets[0:dynamicOffsetCount]
4933 for i in (0 .. dynamicOffsetCount) {
4934 dynamicOffset := dynamicOffsets[i]
4935 }
4936
Jesse Halld8bade02015-11-24 10:24:18 -08004937 queue := switch (pipelineBindPoint) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004938 case VK_PIPELINE_BIND_POINT_COMPUTE: VK_QUEUE_COMPUTE_BIT
4939 case VK_PIPELINE_BIND_POINT_GRAPHICS: VK_QUEUE_GRAPHICS_BIT
4940 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08004941 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004942}
4943
4944@threadSafety("app")
4945cmd void vkCmdBindIndexBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004946 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004947 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004948 VkDeviceSize offset,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004949 VkIndexType indexType) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004950 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004951 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004952 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004953
Jesse Hall3fbc8562015-11-29 22:10:52 -08004954 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004955
Jesse Hall3fbc8562015-11-29 22:10:52 -08004956 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004957}
4958
4959@threadSafety("app")
4960cmd void vkCmdBindVertexBuffers(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004961 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004962 u32 firstBinding,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004963 u32 bindingCount,
4964 const VkBuffer* pBuffers,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004965 const VkDeviceSize* pOffsets) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004966 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004967
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004968 // TODO: check if not [firstBinding:firstBinding+bindingCount]
Jesse Halld27f6aa2015-08-15 17:58:48 -07004969 buffers := pBuffers[0:bindingCount]
4970 offsets := pOffsets[0:bindingCount]
4971 for i in (0 .. bindingCount) {
4972 buffer := buffers[i]
4973 offset := offsets[i]
4974 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004975 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004976
Jesse Hall3fbc8562015-11-29 22:10:52 -08004977 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004978 }
4979
Jesse Hall3fbc8562015-11-29 22:10:52 -08004980 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004981}
4982
4983@threadSafety("app")
4984cmd void vkCmdDraw(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004985 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004986 u32 vertexCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004987 u32 instanceCount,
4988 u32 firstVertex,
4989 u32 firstInstance) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004990 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004991
Jesse Hall3fbc8562015-11-29 22:10:52 -08004992 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004993}
4994
4995@threadSafety("app")
4996cmd void vkCmdDrawIndexed(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004997 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004998 u32 indexCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004999 u32 instanceCount,
5000 u32 firstIndex,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005001 s32 vertexOffset,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005002 u32 firstInstance) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005003 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005004
Jesse Hall3fbc8562015-11-29 22:10:52 -08005005 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005006}
5007
5008@threadSafety("app")
5009cmd void vkCmdDrawIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005010 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005011 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005012 VkDeviceSize offset,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005013 u32 drawCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005014 u32 stride) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005015 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005016 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005017 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005018
Jesse Hall3fbc8562015-11-29 22:10:52 -08005019 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005020
Jesse Hall3fbc8562015-11-29 22:10:52 -08005021 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005022}
5023
5024@threadSafety("app")
5025cmd void vkCmdDrawIndexedIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005026 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005027 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005028 VkDeviceSize offset,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005029 u32 drawCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005030 u32 stride) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005031 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005032 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005033 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005034
Jesse Hall3fbc8562015-11-29 22:10:52 -08005035 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005036
Jesse Hall3fbc8562015-11-29 22:10:52 -08005037 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005038}
5039
5040@threadSafety("app")
5041cmd void vkCmdDispatch(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005042 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005043 u32 x,
5044 u32 y,
5045 u32 z) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005046 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005047
Jesse Hall3fbc8562015-11-29 22:10:52 -08005048 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_COMPUTE_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005049}
5050
5051@threadSafety("app")
5052cmd void vkCmdDispatchIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005053 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005054 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005055 VkDeviceSize offset) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005056 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005057 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005058 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005059
Jesse Hall3fbc8562015-11-29 22:10:52 -08005060 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005061
Jesse Hall3fbc8562015-11-29 22:10:52 -08005062 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_COMPUTE_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005063}
5064
5065@threadSafety("app")
5066cmd void vkCmdCopyBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005067 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005068 VkBuffer srcBuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005069 VkBuffer dstBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005070 u32 regionCount,
5071 const VkBufferCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005072 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005073 srcBufferObject := GetBuffer(srcBuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005074 dstBufferObject := GetBuffer(dstBuffer)
5075 assert(commandBufferObject.device == srcBufferObject.device)
5076 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005077
5078 regions := pRegions[0:regionCount]
5079 for i in (0 .. regionCount) {
5080 region := regions[i]
5081 }
5082
Jesse Hall3fbc8562015-11-29 22:10:52 -08005083 bindCommandBuffer(commandBuffer, srcBuffer, srcBufferObject.memory)
5084 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005085
Jesse Hall65ab5522015-11-30 00:07:16 -08005086 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005087}
5088
5089@threadSafety("app")
5090cmd void vkCmdCopyImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005091 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005092 VkImage srcImage,
5093 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005094 VkImage dstImage,
5095 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005096 u32 regionCount,
5097 const VkImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005098 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005099 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005100 dstImageObject := GetImage(dstImage)
5101 assert(commandBufferObject.device == srcImageObject.device)
5102 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005103
5104 regions := pRegions[0:regionCount]
5105 for i in (0 .. regionCount) {
5106 region := regions[i]
5107 }
5108
Jesse Hall3fbc8562015-11-29 22:10:52 -08005109 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
5110 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005111
Jesse Hall65ab5522015-11-30 00:07:16 -08005112 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005113}
5114
5115@threadSafety("app")
5116cmd void vkCmdBlitImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005117 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005118 VkImage srcImage,
5119 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005120 VkImage dstImage,
5121 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005122 u32 regionCount,
5123 const VkImageBlit* pRegions,
Jesse Hall23ff73f2015-11-29 14:36:39 -08005124 VkFilter filter) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005125 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005126 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005127 dstImageObject := GetImage(dstImage)
5128 assert(commandBufferObject.device == srcImageObject.device)
5129 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005130
5131 regions := pRegions[0:regionCount]
5132 for i in (0 .. regionCount) {
5133 region := regions[i]
5134 }
5135
Jesse Hall3fbc8562015-11-29 22:10:52 -08005136 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
5137 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005138
Jesse Hall3fbc8562015-11-29 22:10:52 -08005139 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005140}
5141
5142@threadSafety("app")
5143cmd void vkCmdCopyBufferToImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005144 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005145 VkBuffer srcBuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005146 VkImage dstImage,
5147 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005148 u32 regionCount,
5149 const VkBufferImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005150 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005151 srcBufferObject := GetBuffer(srcBuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005152 dstImageObject := GetImage(dstImage)
5153 assert(commandBufferObject.device == srcBufferObject.device)
5154 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005155
5156 regions := pRegions[0:regionCount]
5157 for i in (0 .. regionCount) {
5158 region := regions[i]
5159 }
5160
Jesse Hall3fbc8562015-11-29 22:10:52 -08005161 bindCommandBuffer(commandBuffer, srcBuffer, srcBufferObject.memory)
5162 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005163
Jesse Hall65ab5522015-11-30 00:07:16 -08005164 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005165}
5166
5167@threadSafety("app")
5168cmd void vkCmdCopyImageToBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005169 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005170 VkImage srcImage,
5171 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005172 VkBuffer dstBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005173 u32 regionCount,
5174 const VkBufferImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005175 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005176 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005177 dstBufferObject := GetBuffer(dstBuffer)
5178 assert(commandBufferObject.device == srcImageObject.device)
5179 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005180
5181 regions := pRegions[0:regionCount]
5182 for i in (0 .. regionCount) {
5183 region := regions[i]
5184 }
5185
Jesse Hall3fbc8562015-11-29 22:10:52 -08005186 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
5187 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005188
Jesse Hall65ab5522015-11-30 00:07:16 -08005189 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005190}
5191
5192@threadSafety("app")
5193cmd void vkCmdUpdateBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005194 VkCommandBuffer commandBuffer,
5195 VkBuffer dstBuffer,
5196 VkDeviceSize dstOffset,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005197 VkDeviceSize dataSize,
Jesse Hall3f5499b2016-07-26 15:20:40 -07005198 const void* pData) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005199 commandBufferObject := GetCommandBuffer(commandBuffer)
5200 dstBufferObject := GetBuffer(dstBuffer)
5201 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005202
5203 data := pData[0:dataSize]
5204
Jesse Hall3fbc8562015-11-29 22:10:52 -08005205 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005206
Jesse Hall65ab5522015-11-30 00:07:16 -08005207 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005208}
5209
5210@threadSafety("app")
5211cmd void vkCmdFillBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005212 VkCommandBuffer commandBuffer,
5213 VkBuffer dstBuffer,
5214 VkDeviceSize dstOffset,
Jesse Hallb00daad2015-11-29 19:46:20 -08005215 VkDeviceSize size,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005216 u32 data) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005217 commandBufferObject := GetCommandBuffer(commandBuffer)
5218 dstBufferObject := GetBuffer(dstBuffer)
5219 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005220
Jesse Hall65ab5522015-11-30 00:07:16 -08005221 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005222}
5223
5224@threadSafety("app")
5225cmd void vkCmdClearColorImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005226 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005227 VkImage image,
5228 VkImageLayout imageLayout,
5229 const VkClearColorValue* pColor,
5230 u32 rangeCount,
5231 const VkImageSubresourceRange* pRanges) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005232 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005233 imageObject := GetImage(image)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005234 assert(commandBufferObject.device == imageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005235
5236 ranges := pRanges[0:rangeCount]
5237 for i in (0 .. rangeCount) {
5238 range := ranges[i]
5239 }
5240
Jesse Hall3fbc8562015-11-29 22:10:52 -08005241 bindCommandBuffer(commandBuffer, image, imageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005242
Jesse Hall3fbc8562015-11-29 22:10:52 -08005243 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005244}
5245
5246@threadSafety("app")
5247cmd void vkCmdClearDepthStencilImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005248 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005249 VkImage image,
5250 VkImageLayout imageLayout,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005251 const VkClearDepthStencilValue* pDepthStencil,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005252 u32 rangeCount,
5253 const VkImageSubresourceRange* pRanges) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005254 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005255 imageObject := GetImage(image)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005256 assert(commandBufferObject.device == imageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005257
5258 ranges := pRanges[0:rangeCount]
5259 for i in (0 .. rangeCount) {
5260 range := ranges[i]
5261 }
5262
Jesse Hall3fbc8562015-11-29 22:10:52 -08005263 bindCommandBuffer(commandBuffer, image, imageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005264
Jesse Hall3fbc8562015-11-29 22:10:52 -08005265 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005266}
5267
5268@threadSafety("app")
Jesse Hallae38f732015-11-19 21:32:50 -08005269cmd void vkCmdClearAttachments(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005270 VkCommandBuffer commandBuffer,
Jesse Hallae38f732015-11-19 21:32:50 -08005271 u32 attachmentCount,
5272 const VkClearAttachment* pAttachments,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005273 u32 rectCount,
Jesse Halla15a4bf2015-11-19 22:48:02 -08005274 const VkClearRect* pRects) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005275 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005276
5277 rects := pRects[0:rectCount]
5278 for i in (0 .. rectCount) {
5279 rect := rects[i]
5280 }
5281
Jesse Hall3fbc8562015-11-29 22:10:52 -08005282 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005283}
5284
5285@threadSafety("app")
5286cmd void vkCmdResolveImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005287 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005288 VkImage srcImage,
5289 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005290 VkImage dstImage,
5291 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005292 u32 regionCount,
5293 const VkImageResolve* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005294 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005295 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005296 dstImageObject := GetImage(dstImage)
5297 assert(commandBufferObject.device == srcImageObject.device)
5298 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005299
5300 regions := pRegions[0:regionCount]
5301 for i in (0 .. regionCount) {
5302 region := regions[i]
5303 }
5304
Jesse Hall3fbc8562015-11-29 22:10:52 -08005305 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
5306 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005307
Jesse Hall3fbc8562015-11-29 22:10:52 -08005308 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005309}
5310
5311@threadSafety("app")
5312cmd void vkCmdSetEvent(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005313 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005314 VkEvent event,
5315 VkPipelineStageFlags stageMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005316 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005317 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005318 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005319}
5320
5321@threadSafety("app")
5322cmd void vkCmdResetEvent(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005323 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005324 VkEvent event,
5325 VkPipelineStageFlags stageMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005326 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005327 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005328 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005329}
5330
5331@threadSafety("app")
5332cmd void vkCmdWaitEvents(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005333 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005334 u32 eventCount,
5335 const VkEvent* pEvents,
5336 VkPipelineStageFlags srcStageMask,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005337 VkPipelineStageFlags dstStageMask,
5338 u32 memoryBarrierCount,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005339 const VkMemoryBarrier* pMemoryBarriers,
5340 u32 bufferMemoryBarrierCount,
5341 const VkBufferMemoryBarrier* pBufferMemoryBarriers,
5342 u32 imageMemoryBarrierCount,
5343 const VkImageMemoryBarrier* pImageMemoryBarriers) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005344 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005345
5346 events := pEvents[0:eventCount]
5347 for i in (0 .. eventCount) {
5348 event := events[i]
5349 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005350 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005351 }
5352
Jesse Hall3dd678a2016-01-08 21:52:01 -08005353 memoryBarriers := pMemoryBarriers[0:memoryBarrierCount]
Jesse Hall3fbc8562015-11-29 22:10:52 -08005354 for i in (0 .. memoryBarrierCount) {
Jesse Hall3dd678a2016-01-08 21:52:01 -08005355 memoryBarrier := memoryBarriers[i]
5356 }
5357 bufferMemoryBarriers := pBufferMemoryBarriers[0:bufferMemoryBarrierCount]
5358 for i in (0 .. bufferMemoryBarrierCount) {
5359 bufferMemoryBarrier := bufferMemoryBarriers[i]
5360 bufferObject := GetBuffer(bufferMemoryBarrier.buffer)
5361 assert(bufferObject.device == commandBufferObject.device)
5362 }
5363 imageMemoryBarriers := pImageMemoryBarriers[0:imageMemoryBarrierCount]
5364 for i in (0 .. imageMemoryBarrierCount) {
5365 imageMemoryBarrier := imageMemoryBarriers[i]
5366 imageObject := GetImage(imageMemoryBarrier.image)
5367 assert(imageObject.device == commandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005368 }
5369}
5370
5371@threadSafety("app")
5372cmd void vkCmdPipelineBarrier(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005373 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005374 VkPipelineStageFlags srcStageMask,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005375 VkPipelineStageFlags dstStageMask,
Jesse Halldc6d36c2015-11-29 19:12:15 -08005376 VkDependencyFlags dependencyFlags,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005377 u32 memoryBarrierCount,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005378 const VkMemoryBarrier* pMemoryBarriers,
5379 u32 bufferMemoryBarrierCount,
5380 const VkBufferMemoryBarrier* pBufferMemoryBarriers,
5381 u32 imageMemoryBarrierCount,
5382 const VkImageMemoryBarrier* pImageMemoryBarriers) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005383 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005384
Jesse Hall3dd678a2016-01-08 21:52:01 -08005385 memoryBarriers := pMemoryBarriers[0:memoryBarrierCount]
Jesse Hall3fbc8562015-11-29 22:10:52 -08005386 for i in (0 .. memoryBarrierCount) {
Jesse Hall3dd678a2016-01-08 21:52:01 -08005387 memoryBarrier := memoryBarriers[i]
5388 }
5389 bufferMemoryBarriers := pBufferMemoryBarriers[0:bufferMemoryBarrierCount]
5390 for i in (0 .. bufferMemoryBarrierCount) {
5391 bufferMemoryBarrier := bufferMemoryBarriers[i]
5392 bufferObject := GetBuffer(bufferMemoryBarrier.buffer)
5393 assert(bufferObject.device == commandBufferObject.device)
5394 }
5395 imageMemoryBarriers := pImageMemoryBarriers[0:imageMemoryBarrierCount]
5396 for i in (0 .. imageMemoryBarrierCount) {
5397 imageMemoryBarrier := imageMemoryBarriers[i]
5398 imageObject := GetImage(imageMemoryBarrier.image)
5399 assert(imageObject.device == commandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005400 }
5401}
5402
5403@threadSafety("app")
5404cmd void vkCmdBeginQuery(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005405 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005406 VkQueryPool queryPool,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005407 u32 query,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005408 VkQueryControlFlags flags) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005409 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005410 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005411 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005412}
5413
5414@threadSafety("app")
5415cmd void vkCmdEndQuery(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005416 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005417 VkQueryPool queryPool,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005418 u32 query) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005419 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005420 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005421 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005422}
5423
5424@threadSafety("app")
5425cmd void vkCmdResetQueryPool(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005426 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005427 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005428 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005429 u32 queryCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005430 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005431 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005432 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005433}
5434
5435@threadSafety("app")
5436cmd void vkCmdWriteTimestamp(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005437 VkCommandBuffer commandBuffer,
Jesse Hall6f39a6d2015-11-24 11:08:36 -08005438 VkPipelineStageFlagBits pipelineStage,
Jesse Halla3a7a1d2015-11-24 11:37:23 -08005439 VkQueryPool queryPool,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005440 u32 query) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005441 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halla3a7a1d2015-11-24 11:37:23 -08005442 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005443 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005444}
5445
5446@threadSafety("app")
5447cmd void vkCmdCopyQueryPoolResults(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005448 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005449 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005450 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005451 u32 queryCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005452 VkBuffer dstBuffer,
5453 VkDeviceSize dstOffset,
Jesse Halla9bb62b2015-11-21 19:31:56 -08005454 VkDeviceSize stride,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005455 VkQueryResultFlags flags) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005456 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005457 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005458 dstBufferObject := GetBuffer(dstBuffer)
5459 assert(commandBufferObject.device == queryPoolObject.device)
5460 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005461}
5462
5463cmd void vkCmdPushConstants(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005464 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005465 VkPipelineLayout layout,
5466 VkShaderStageFlags stageFlags,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005467 u32 offset,
5468 u32 size,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08005469 const void* pValues) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005470 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005471 layoutObject := GetPipelineLayout(layout)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005472 assert(commandBufferObject.device == layoutObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005473}
5474
5475@threadSafety("app")
5476cmd void vkCmdBeginRenderPass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005477 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005478 const VkRenderPassBeginInfo* pRenderPassBegin,
Jesse Hall65ab5522015-11-30 00:07:16 -08005479 VkSubpassContents contents) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005480 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005481 renderPassObject := GetRenderPass(pRenderPassBegin.renderPass)
5482 framebufferObject := GetFramebuffer(pRenderPassBegin.framebuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005483 assert(commandBufferObject.device == renderPassObject.device)
5484 assert(commandBufferObject.device == framebufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005485
Jesse Hall3fbc8562015-11-29 22:10:52 -08005486 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005487}
5488
5489cmd void vkCmdNextSubpass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005490 VkCommandBuffer commandBuffer,
Jesse Hall65ab5522015-11-30 00:07:16 -08005491 VkSubpassContents contents) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005492 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005493}
5494
5495@threadSafety("app")
5496cmd void vkCmdEndRenderPass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005497 VkCommandBuffer commandBuffer) {
5498 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005499
Jesse Hall3fbc8562015-11-29 22:10:52 -08005500 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005501}
5502
5503cmd void vkCmdExecuteCommands(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005504 VkCommandBuffer commandBuffer,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005505 u32 commandBufferCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005506 const VkCommandBuffer* pCommandBuffers) {
5507 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005508
Jesse Hall3dd678a2016-01-08 21:52:01 -08005509 commandBuffers := pCommandBuffers[0:commandBufferCount]
5510 for i in (0 .. commandBufferCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005511 secondaryCommandBuffer := commandBuffers[i]
5512 secondaryCommandBufferObject := GetCommandBuffer(secondaryCommandBuffer)
5513 assert(commandBufferObject.device == secondaryCommandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005514 }
5515}
5516
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005517@extension("VK_KHR_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005518cmd void vkDestroySurfaceKHR(
5519 VkInstance instance,
Jesse Hall0e74f002015-11-30 11:37:59 -08005520 VkSurfaceKHR surface,
5521 const VkAllocationCallbacks* pAllocator) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005522 instanceObject := GetInstance(instance)
5523 surfaceObject := GetSurface(surface)
5524 assert(surfaceObject.instance == instance)
Michael Lentine88594d72015-11-12 12:49:45 -08005525
Jesse Hall1356b0d2015-11-23 17:24:58 -08005526 State.Surfaces[surface] = null
Jesse Hall2818f932015-11-19 21:19:17 -08005527}
5528
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005529@extension("VK_KHR_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005530cmd VkResult vkGetPhysicalDeviceSurfaceSupportKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005531 VkPhysicalDevice physicalDevice,
5532 u32 queueFamilyIndex,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005533 VkSurfaceKHR surface,
Jesse Hallb00daad2015-11-29 19:46:20 -08005534 VkBool32* pSupported) {
5535 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08005536
5537 return ?
5538}
5539
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005540@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08005541cmd VkResult vkGetPhysicalDeviceSurfaceCapabilitiesKHR(
5542 VkPhysicalDevice physicalDevice,
5543 VkSurfaceKHR surface,
5544 VkSurfaceCapabilitiesKHR* pSurfaceCapabilities) {
5545 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5546
5547 surfaceCapabilities := ?
5548 pSurfaceCapabilities[0] = surfaceCapabilities
5549
5550 return ?
5551}
5552
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005553@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08005554cmd VkResult vkGetPhysicalDeviceSurfaceFormatsKHR(
5555 VkPhysicalDevice physicalDevice,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005556 VkSurfaceKHR surface,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005557 u32* pSurfaceFormatCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005558 VkSurfaceFormatKHR* pSurfaceFormats) {
Jesse Hallb00daad2015-11-29 19:46:20 -08005559 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08005560
5561 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08005562 pSurfaceFormatCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08005563 surfaceFormats := pSurfaceFormats[0:count]
5564
5565 for i in (0 .. count) {
5566 surfaceFormat := ?
5567 surfaceFormats[i] = surfaceFormat
5568 }
5569
5570 return ?
5571}
5572
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005573@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08005574cmd VkResult vkGetPhysicalDeviceSurfacePresentModesKHR(
5575 VkPhysicalDevice physicalDevice,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005576 VkSurfaceKHR surface,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005577 u32* pPresentModeCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005578 VkPresentModeKHR* pPresentModes) {
Jesse Hallb00daad2015-11-29 19:46:20 -08005579 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08005580
5581 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08005582 pPresentModeCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08005583 presentModes := pPresentModes[0:count]
5584
5585 for i in (0 .. count) {
5586 presentMode := ?
5587 presentModes[i] = presentMode
5588 }
5589
5590 return ?
5591}
5592
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005593@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005594cmd VkResult vkCreateSwapchainKHR(
5595 VkDevice device,
5596 const VkSwapchainCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005597 const VkAllocationCallbacks* pAllocator,
Michael Lentine88594d72015-11-12 12:49:45 -08005598 VkSwapchainKHR* pSwapchain) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005599 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR)
Michael Lentine88594d72015-11-12 12:49:45 -08005600 deviceObject := GetDevice(device)
5601
5602 swapchain := ?
5603 pSwapchain[0] = swapchain
5604 State.Swapchains[swapchain] = new!SwapchainObject(device: device)
5605
5606 return ?
5607}
5608
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005609@extension("VK_KHR_swapchain")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005610cmd void vkDestroySwapchainKHR(
Michael Lentine88594d72015-11-12 12:49:45 -08005611 VkDevice device,
Jesse Hall0e74f002015-11-30 11:37:59 -08005612 VkSwapchainKHR swapchain,
5613 const VkAllocationCallbacks* pAllocator) {
Michael Lentine88594d72015-11-12 12:49:45 -08005614 deviceObject := GetDevice(device)
5615 swapchainObject := GetSwapchain(swapchain)
5616 assert(swapchainObject.device == device)
5617
5618 State.Swapchains[swapchain] = null
Michael Lentine88594d72015-11-12 12:49:45 -08005619}
5620
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005621@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005622cmd VkResult vkGetSwapchainImagesKHR(
5623 VkDevice device,
5624 VkSwapchainKHR swapchain,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005625 u32* pSwapchainImageCount,
Michael Lentine88594d72015-11-12 12:49:45 -08005626 VkImage* pSwapchainImages) {
5627 deviceObject := GetDevice(device)
5628
5629 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08005630 pSwapchainImageCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08005631 swapchainImages := pSwapchainImages[0:count]
5632
5633 for i in (0 .. count) {
5634 swapchainImage := ?
5635 swapchainImages[i] = swapchainImage
Jesse Hall1356b0d2015-11-23 17:24:58 -08005636 State.Images[swapchainImage] = new!ImageObject(device: device)
Michael Lentine88594d72015-11-12 12:49:45 -08005637 }
5638
5639 return ?
5640}
5641
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005642@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005643cmd VkResult vkAcquireNextImageKHR(
5644 VkDevice device,
5645 VkSwapchainKHR swapchain,
5646 u64 timeout,
5647 VkSemaphore semaphore,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005648 VkFence fence,
Michael Lentine88594d72015-11-12 12:49:45 -08005649 u32* pImageIndex) {
5650 deviceObject := GetDevice(device)
5651 swapchainObject := GetSwapchain(swapchain)
5652
5653 imageIndex := ?
5654 pImageIndex[0] = imageIndex
5655
5656 return ?
5657}
5658
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005659@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005660cmd VkResult vkQueuePresentKHR(
5661 VkQueue queue,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08005662 const VkPresentInfoKHR* pPresentInfo) {
Michael Lentine88594d72015-11-12 12:49:45 -08005663 queueObject := GetQueue(queue)
5664
5665 presentInfo := ?
5666 pPresentInfo[0] = presentInfo
5667
5668 return ?
5669}
5670
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005671@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005672cmd VkResult vkGetPhysicalDeviceDisplayPropertiesKHR(
5673 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005674 u32* pPropertyCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005675 VkDisplayPropertiesKHR* pProperties) {
5676 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5677 return ?
5678}
5679
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005680@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005681cmd VkResult vkGetPhysicalDeviceDisplayPlanePropertiesKHR(
5682 VkPhysicalDevice physicalDevice,
5683 u32* pPropertyCount,
5684 VkDisplayPlanePropertiesKHR* pProperties) {
5685 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5686 return ?
5687}
5688
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005689@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005690cmd VkResult vkGetDisplayPlaneSupportedDisplaysKHR(
5691 VkPhysicalDevice physicalDevice,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005692 u32 planeIndex,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08005693 u32* pDisplayCount,
5694 VkDisplayKHR* pDisplays) {
Jesse Halla6429252015-11-29 18:59:42 -08005695 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5696 return ?
5697}
5698
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005699@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005700cmd VkResult vkGetDisplayModePropertiesKHR(
5701 VkPhysicalDevice physicalDevice,
5702 VkDisplayKHR display,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005703 u32* pPropertyCount,
5704 VkDisplayModePropertiesKHR* pProperties) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005705 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5706 return ?
5707}
5708
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005709@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005710cmd VkResult vkCreateDisplayModeKHR(
5711 VkPhysicalDevice physicalDevice,
5712 VkDisplayKHR display,
5713 const VkDisplayModeCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005714 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005715 VkDisplayModeKHR* pMode) {
5716 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5717 return ?
5718}
5719
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005720@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005721cmd VkResult vkGetDisplayPlaneCapabilitiesKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005722 VkPhysicalDevice physicalDevice,
Jesse Hall9ba8bc82015-11-30 16:22:16 -08005723 VkDisplayModeKHR mode,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005724 u32 planeIndex,
Jesse Halla6429252015-11-29 18:59:42 -08005725 VkDisplayPlaneCapabilitiesKHR* pCapabilities) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005726 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5727 return ?
5728}
5729
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005730@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005731cmd VkResult vkCreateDisplayPlaneSurfaceKHR(
5732 VkInstance instance,
5733 const VkDisplaySurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005734 const VkAllocationCallbacks* pAllocator,
Jesse Halla6429252015-11-29 18:59:42 -08005735 VkSurfaceKHR* pSurface) {
5736 return ?
5737}
5738
Jesse Hall9ba8bc82015-11-30 16:22:16 -08005739@extension("VK_KHR_display_swapchain")
5740cmd VkResult vkCreateSharedSwapchainsKHR(
5741 VkDevice device,
5742 u32 swapchainCount,
5743 const VkSwapchainCreateInfoKHR* pCreateInfos,
5744 const VkAllocationCallbacks* pAllocator,
5745 VkSwapchainKHR* pSwapchains) {
5746 return ?
5747}
5748
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005749@extension("VK_KHR_xlib_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005750cmd VkResult vkCreateXlibSurfaceKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005751 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005752 const VkXlibSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005753 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005754 VkSurfaceKHR* pSurface) {
5755 instanceObject := GetInstance(instance)
5756 return ?
5757}
5758
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005759@extension("VK_KHR_xlib_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005760cmd VkBool32 vkGetPhysicalDeviceXlibPresentationSupportKHR(
5761 VkPhysicalDevice physicalDevice,
5762 u32 queueFamilyIndex,
5763 platform.Display* dpy,
Jesse Hall65ab5522015-11-30 00:07:16 -08005764 platform.VisualID visualID) {
Jesse Halla6429252015-11-29 18:59:42 -08005765 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5766 return ?
5767}
5768
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005769@extension("VK_KHR_xcb_surface")
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005770cmd VkResult vkCreateXcbSurfaceKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005771 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005772 const VkXcbSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005773 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005774 VkSurfaceKHR* pSurface) {
5775 instanceObject := GetInstance(instance)
5776 return ?
5777}
5778
Jesse Hall523db342015-11-30 21:12:55 -08005779@extension("VK_KHR_xcb_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005780cmd VkBool32 vkGetPhysicalDeviceXcbPresentationSupportKHR(
5781 VkPhysicalDevice physicalDevice,
5782 u32 queueFamilyIndex,
5783 platform.xcb_connection_t* connection,
5784 platform.xcb_visualid_t visual_id) {
5785 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5786 return ?
5787}
5788
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005789@extension("VK_KHR_wayland_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005790cmd VkResult vkCreateWaylandSurfaceKHR(
5791 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005792 const VkWaylandSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005793 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005794 VkSurfaceKHR* pSurface) {
5795 instanceObject := GetInstance(instance)
5796 return ?
5797}
5798
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005799@extension("VK_KHR_wayland_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005800cmd VkBool32 vkGetPhysicalDeviceWaylandPresentationSupportKHR(
5801 VkPhysicalDevice physicalDevice,
5802 u32 queueFamilyIndex,
5803 platform.wl_display* display) {
5804 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5805 return ?
5806}
5807
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005808@extension("VK_KHR_mir_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005809cmd VkResult vkCreateMirSurfaceKHR(
5810 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005811 const VkMirSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005812 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005813 VkSurfaceKHR* pSurface) {
5814 instanceObject := GetInstance(instance)
5815 return ?
5816}
5817
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005818@extension("VK_KHR_mir_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005819cmd VkBool32 vkGetPhysicalDeviceMirPresentationSupportKHR(
5820 VkPhysicalDevice physicalDevice,
5821 u32 queueFamilyIndex,
5822 platform.MirConnection* connection) {
5823 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5824 return ?
5825}
5826
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005827@extension("VK_KHR_android_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005828cmd VkResult vkCreateAndroidSurfaceKHR(
5829 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005830 const VkAndroidSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005831 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005832 VkSurfaceKHR* pSurface) {
5833 instanceObject := GetInstance(instance)
5834 return ?
5835}
5836
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005837@extension("VK_KHR_win32_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005838cmd VkResult vkCreateWin32SurfaceKHR(
5839 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005840 const VkWin32SurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005841 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005842 VkSurfaceKHR* pSurface) {
5843 instanceObject := GetInstance(instance)
5844 return ?
5845}
5846
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005847@extension("VK_KHR_win32_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005848cmd VkResult vkGetPhysicalDeviceWin32PresentationSupportKHR(
5849 VkPhysicalDevice physicalDevice,
5850 u32 queueFamilyIndex) {
Jesse Halle2948d82016-02-25 04:19:32 -08005851 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Jesse Halla6429252015-11-29 18:59:42 -08005852 return ?
5853}
5854
Chia-I Wub262ddc2016-03-22 07:38:20 +08005855@extension("VK_ANDROID_native_buffer")
5856cmd VkResult vkGetSwapchainGrallocUsageANDROID(
5857 VkDevice device,
5858 VkFormat format,
5859 VkImageUsageFlags imageUsage,
5860 int* grallocUsage) {
5861 return ?
5862}
5863
5864@extension("VK_ANDROID_native_buffer")
5865cmd VkResult vkAcquireImageANDROID(
5866 VkDevice device,
5867 VkImage image,
5868 int nativeFenceFd,
5869 VkSemaphore semaphore,
5870 VkFence fence) {
5871 return ?
5872}
5873
5874@extension("VK_ANDROID_native_buffer")
5875cmd VkResult vkQueueSignalReleaseImageANDROID(
5876 VkQueue queue,
5877 u32 waitSemaphoreCount,
5878 const VkSemaphore* pWaitSemaphores,
5879 VkImage image,
5880 int* pNativeFenceFd) {
5881 return ?
5882}
5883
Jesse Hall715b86a2016-01-16 16:34:29 -08005884@extension("VK_EXT_debug_report")
5885@external type void* PFN_vkDebugReportCallbackEXT
5886@extension("VK_EXT_debug_report")
5887@pfn cmd VkBool32 vkDebugReportCallbackEXT(
5888 VkDebugReportFlagsEXT flags,
5889 VkDebugReportObjectTypeEXT objectType,
5890 u64 object,
5891 platform.size_t location,
5892 s32 messageCode,
5893 const char* pLayerPrefix,
5894 const char* pMessage,
5895 void* pUserData) {
5896 return ?
5897}
5898
5899@extension("VK_EXT_debug_report")
5900cmd VkResult vkCreateDebugReportCallbackEXT(
5901 VkInstance instance,
5902 const VkDebugReportCallbackCreateInfoEXT* pCreateInfo,
5903 const VkAllocationCallbacks* pAllocator,
5904 VkDebugReportCallbackEXT* pCallback) {
5905 return ?
5906}
5907
5908@extension("VK_EXT_debug_report")
5909cmd void vkDestroyDebugReportCallbackEXT(
5910 VkInstance instance,
5911 VkDebugReportCallbackEXT callback,
5912 const VkAllocationCallbacks* pAllocator) {
5913}
5914
5915@extension("VK_EXT_debug_report")
5916cmd void vkDebugReportMessageEXT(
5917 VkInstance instance,
5918 VkDebugReportFlagsEXT flags,
5919 VkDebugReportObjectTypeEXT objectType,
5920 u64 object,
5921 platform.size_t location,
5922 s32 messageCode,
5923 const char* pLayerPrefix,
5924 const char* pMessage) {
5925}
5926
Jesse Hall26763382016-05-20 07:13:52 -07005927@extension("VK_EXT_debug_marker")
5928cmd VkResult vkDebugMarkerSetObjectTagEXT(
5929 VkDevice device,
5930 VkDebugMarkerObjectTagInfoEXT* pTagInfo) {
5931 return ?
5932}
5933
5934@extension("VK_EXT_debug_marker")
5935cmd VkResult vkDebugMarkerSetObjectNameEXT(
5936 VkDevice device,
5937 VkDebugMarkerObjectNameInfoEXT* pNameInfo) {
5938 return ?
5939}
5940
5941@extension("VK_EXT_debug_marker")
5942cmd void vkCmdDebugMarkerBeginEXT(
5943 VkCommandBuffer commandBuffer,
5944 VkDebugMarkerMarkerInfoEXT* pMarkerInfo) {
5945}
5946
5947@extension("VK_EXT_debug_marker")
5948cmd void vkCmdDebugMarkerEndEXT(
5949 VkCommandBuffer commandBuffer) {
5950}
5951
5952@extension("VK_EXT_debug_marker")
5953cmd void vkCmdDebugMarkerInsertEXT(
5954 VkCommandBuffer commandBuffer,
5955 VkDebugMarkerMarkerInfoEXT* pMarkerInfo) {
5956}
5957
Jesse Halleb02c472017-02-24 15:13:45 -08005958@extension("VK_AMD_draw_indirect_count")
5959cmd void vkCmdDrawIndirectCountAMD(
5960 VkCommandBuffer commandBuffer,
5961 VkBuffer buffer,
5962 VkDeviceSize offset,
5963 VkBuffer countBuffer,
5964 VkDeviceSize countBufferOffset,
5965 u32 maxDrawCount,
5966 u32 stride) {
5967}
5968
5969@extension("VK_AMD_draw_indirect_count")
5970cmd void vkCmdDrawIndexedIndirectCountAMD(
5971 VkCommandBuffer commandBuffer,
5972 VkBuffer buffer,
5973 VkDeviceSize offset,
5974 VkBuffer countBuffer,
5975 VkDeviceSize countBufferOffset,
5976 u32 maxDrawCount,
5977 u32 stride) {
5978}
5979
5980@extension("VK_NV_external_memory_capabilities")
5981cmd VkResult vkGetPhysicalDeviceExternalImageFormatPropertiesNV(
5982 VkPhysicalDevice physicalDevice,
5983 VkFormat format,
5984 VkImageType type,
5985 VkImageTiling tiling,
5986 VkImageUsageFlags usage,
5987 VkImageCreateFlags flags,
5988 VkExternalMemoryHandleTypeFlagsNV externalHandleType,
5989 VkExternalImageFormatPropertiesNV* pExternalImageFormatProperties) {
5990 return ?
5991}
5992
5993@extension("VK_NV_external_memory_win32")
5994cmd VkResult vkGetMemoryWin32HandleNV(
5995 VkDevice device,
5996 VkDeviceMemory memory,
5997 VkExternalMemoryHandleTypeFlagsNV handleType,
5998 platform.HANDLE* pHandle) {
5999 return ?
6000}
6001
Jesse Hall08e2f482017-03-06 15:22:17 -08006002@extension("VK_KHR_get_physical_device_properties2")
6003cmd void vkGetPhysicalDeviceFeatures2KHR(
6004 VkPhysicalDevice physicalDevice,
6005 VkPhysicalDeviceFeatures2KHR* pFeatures) {
6006}
6007
6008@extension("VK_KHR_get_physical_device_properties2")
6009cmd void vkGetPhysicalDeviceProperties2KHR(
6010 VkPhysicalDevice physicalDevice,
6011 VkPhysicalDeviceProperties2KHR* pProperties) {
6012}
6013
6014@extension("VK_KHR_get_physical_device_properties2")
6015cmd void vkGetPhysicalDeviceFormatProperties2KHR(
6016 VkPhysicalDevice physicalDevice,
6017 VkFormat format,
6018 VkFormatProperties2KHR* pFormatProperties) {
6019}
6020
6021@extension("VK_KHR_get_physical_device_properties2")
6022cmd VkResult vkGetPhysicalDeviceImageFormatProperties2KHR(
6023 VkPhysicalDevice physicalDevice,
6024 const VkPhysicalDeviceImageFormatInfo2KHR* pImageFormatInfo,
6025 VkImageFormatProperties2KHR* pImageFormatProperties) {
6026 return ?
6027}
6028
6029@extension("VK_KHR_get_physical_device_properties2")
6030cmd void vkGetPhysicalDeviceQueueFamilyProperties2KHR(
6031 VkPhysicalDevice physicalDevice,
6032 u32* pQueueFamilyPropertyCount,
6033 VkQueueFamilyProperties2KHR* pQueueFamilyProperties) {
6034}
6035
6036@extension("VK_KHR_get_physical_device_properties2")
6037cmd void vkGetPhysicalDeviceMemoryProperties2KHR(
6038 VkPhysicalDevice physicalDevice,
6039 VkPhysicalDeviceMemoryProperties2KHR* pMemoryProperties) {
6040}
6041
6042@extension("VK_KHR_get_physical_device_properties2")
6043cmd void vkGetPhysicalDeviceSparseImageFormatProperties2KHR(
6044 VkPhysicalDevice physicalDevice,
6045 const VkPhysicalDeviceSparseImageFormatInfo2KHR* pFormatInfo,
6046 u32* pPropertyCount,
6047 VkSparseImageFormatProperties2KHR* pProperties) {
6048}
6049
6050@extension("VK_NN_vi_surface")
6051cmd VkResult vkCreateViSurfaceNN(
6052 VkInstance instance,
6053 const VkViSurfaceCreateInfoNN* pCreateInfo,
6054 const VkAllocationCallbacks* pAllocator,
6055 VkSurfaceKHR* pSurface) {
6056 return ?
6057}
6058
6059@extension("VK_KHR_maintenance1")
6060cmd void vkTrimCommandPoolKHR(
6061 VkDevice device,
6062 VkCommandPool commandPool,
6063 VkCommandPoolTrimFlagsKHR flags) {
6064}
6065
Jesse Halleb02c472017-02-24 15:13:45 -08006066@extension("VK_NVX_device_generated_commands")
6067cmd void vkCmdProcessCommandsNVX(
6068 VkCommandBuffer commandBuffer,
6069 const VkCmdProcessCommandsInfoNVX* pProcessCommandsInfo) {
6070}
6071
6072@extension("VK_NVX_device_generated_commands")
6073cmd void vkCmdReserveSpaceForCommandsNVX(
6074 VkCommandBuffer commandBuffer,
6075 const VkCmdReserveSpaceForCommandsInfoNVX* pReserveSpaceInfo) {
6076}
6077
6078@extension("VK_NVX_device_generated_commands")
6079cmd VkResult vkCreateIndirectCommandsLayoutNVX(
6080 VkDevice device,
6081 const VkIndirectCommandsLayoutCreateInfoNVX* pCreateInfo,
6082 const VkAllocationCallbacks* pAllocator,
6083 VkIndirectCommandsLayoutNVX* pIndirectCommandsLayout) {
6084 return ?
6085}
6086
6087@extension("VK_NVX_device_generated_commands")
6088cmd void vkDestroyIndirectCommandsLayoutNVX(
6089 VkDevice device,
6090 VkIndirectCommandsLayoutNVX indirectCommandsLayout,
6091 const VkAllocationCallbacks* pAllocator) {
6092}
6093
6094@extension("VK_NVX_device_generated_commands")
6095cmd VkResult vkCreateObjectTableNVX(
6096 VkDevice device,
6097 const VkObjectTableCreateInfoNVX* pCreateInfo,
6098 const VkAllocationCallbacks* pAllocator,
6099 VkObjectTableNVX* pObjectTable) {
6100 return ?
6101}
6102
6103@extension("VK_NVX_device_generated_commands")
6104cmd void vkDestroyObjectTableNVX(
6105 VkDevice device,
6106 VkObjectTableNVX objectTable,
6107 const VkAllocationCallbacks* pAllocator) {
6108}
6109
6110@extension("VK_NVX_device_generated_commands")
6111cmd VkResult vkRegisterObjectsNVX(
6112 VkDevice device,
6113 VkObjectTableNVX objectTable,
6114 u32 objectCount,
6115 const VkObjectTableEntryNVX* const* ppObjectTableEntries,
6116 const u32* pObjectIndices) {
6117 return ?
6118}
6119
6120@extension("VK_NVX_device_generated_commands")
6121cmd VkResult vkUnregisterObjectsNVX(
6122 VkDevice device,
6123 VkObjectTableNVX objectTable,
6124 u32 objectCount,
6125 const VkObjectEntryTypeNVX* pObjectEntryTypes,
6126 const u32* pObjectIndices) {
6127 return ?
6128}
6129
6130@extension("VK_NVX_device_generated_commands")
6131cmd void vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX(
6132 VkPhysicalDevice physicalDevice,
6133 VkDeviceGeneratedCommandsFeaturesNVX* pFeatures,
6134 VkDeviceGeneratedCommandsLimitsNVX* pLimits) {
6135}
Jesse Halld27f6aa2015-08-15 17:58:48 -07006136
Jesse Hall08e2f482017-03-06 15:22:17 -08006137@extension("VK_EXT_direct_mode_display")
6138cmd VkResult vkReleaseDisplayEXT(
6139 VkPhysicalDevice physicalDevice,
6140 VkDisplayKHR display) {
6141 return ?
6142}
6143
6144@extension("VK_EXT_acquire_xlib_display")
6145cmd VkResult vkAcquireXlibDisplayEXT(
6146 VkPhysicalDevice physicalDevice,
6147 platform.Display* dpy,
6148 VkDisplayKHR display) {
6149 return ?
6150}
6151
6152@extension("VK_EXT_acquire_xlib_display")
6153cmd VkResult vkGetRandROutputDisplayEXT(
6154 VkPhysicalDevice physicalDevice,
6155 platform.Display* dpy,
6156 platform.RROutput rrOutput,
6157 VkDisplayKHR* pDisplay) {
6158 return ?
6159}
6160
6161@extension("VK_EXT_display_surface_counter")
6162cmd VkResult vkGetPhysicalDeviceSurfaceCapabilities2EXT(
6163 VkPhysicalDevice physicalDevice,
6164 VkSurfaceKHR surface,
6165 VkSurfaceCapabilities2EXT* pSurfaceCapabilities) {
6166 return ?
6167}
6168
6169@extension("VK_EXT_display_control")
6170cmd VkResult vkDisplayPowerControlEXT(
6171 VkDevice device,
6172 VkDisplayKHR display,
6173 const VkDisplayPowerInfoEXT* pDisplayPowerInfo) {
6174 return ?
6175}
6176
6177@extension("VK_EXT_display_control")
6178cmd VkResult vkRegisterDeviceEventEXT(
6179 VkDevice device,
6180 const VkDeviceEventInfoEXT* pDeviceEventInfo,
6181 const VkAllocationCallbacks* pAllocator,
6182 VkFence* pFence) {
6183 return ?
6184}
6185
6186@extension("VK_EXT_display_control")
6187cmd VkResult vkRegisterDisplayEventEXT(
6188 VkDevice device,
6189 VkDisplayKHR display,
6190 const VkDisplayEventInfoEXT* pDisplayEventInfo,
6191 const VkAllocationCallbacks* pAllocator,
6192 VkFence* pFence) {
6193 return ?
6194}
6195
6196@extension("VK_EXT_display_control")
6197cmd VkResult vkGetSwapchainCounterEXT(
6198 VkDevice device,
6199 VkSwapchainKHR swapchain,
6200 VkSurfaceCounterFlagBitsEXT counter,
6201 u64* pCounterValue) {
6202 return ?
6203}
6204
Jesse Halld27f6aa2015-08-15 17:58:48 -07006205////////////////
6206// Validation //
6207////////////////
6208
6209extern void validate(string layerName, bool condition, string message)
6210
6211
6212/////////////////////////////
6213// Internal State Tracking //
6214/////////////////////////////
6215
6216StateObject State
6217
6218@internal class StateObject {
6219 // Dispatchable objects.
6220 map!(VkInstance, ref!InstanceObject) Instances
6221 map!(VkPhysicalDevice, ref!PhysicalDeviceObject) PhysicalDevices
6222 map!(VkDevice, ref!DeviceObject) Devices
6223 map!(VkQueue, ref!QueueObject) Queues
Jesse Hall3fbc8562015-11-29 22:10:52 -08006224 map!(VkCommandBuffer, ref!CommandBufferObject) CommandBuffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07006225
6226 // Non-dispatchable objects.
6227 map!(VkDeviceMemory, ref!DeviceMemoryObject) DeviceMemories
6228 map!(VkBuffer, ref!BufferObject) Buffers
6229 map!(VkBufferView, ref!BufferViewObject) BufferViews
6230 map!(VkImage, ref!ImageObject) Images
6231 map!(VkImageView, ref!ImageViewObject) ImageViews
Jesse Halld27f6aa2015-08-15 17:58:48 -07006232 map!(VkShaderModule, ref!ShaderModuleObject) ShaderModules
Jesse Halld27f6aa2015-08-15 17:58:48 -07006233 map!(VkPipeline, ref!PipelineObject) Pipelines
6234 map!(VkPipelineLayout, ref!PipelineLayoutObject) PipelineLayouts
6235 map!(VkSampler, ref!SamplerObject) Samplers
6236 map!(VkDescriptorSet, ref!DescriptorSetObject) DescriptorSets
6237 map!(VkDescriptorSetLayout, ref!DescriptorSetLayoutObject) DescriptorSetLayouts
6238 map!(VkDescriptorPool, ref!DescriptorPoolObject) DescriptorPools
Jesse Halld27f6aa2015-08-15 17:58:48 -07006239 map!(VkFence, ref!FenceObject) Fences
6240 map!(VkSemaphore, ref!SemaphoreObject) Semaphores
6241 map!(VkEvent, ref!EventObject) Events
6242 map!(VkQueryPool, ref!QueryPoolObject) QueryPools
6243 map!(VkFramebuffer, ref!FramebufferObject) Framebuffers
6244 map!(VkRenderPass, ref!RenderPassObject) RenderPasses
6245 map!(VkPipelineCache, ref!PipelineCacheObject) PipelineCaches
Jesse Hall3fbc8562015-11-29 22:10:52 -08006246 map!(VkCommandPool, ref!CommandPoolObject) CommandPools
Jesse Hall1356b0d2015-11-23 17:24:58 -08006247 map!(VkSurfaceKHR, ref!SurfaceObject) Surfaces
Michael Lentine88594d72015-11-12 12:49:45 -08006248 map!(VkSwapchainKHR, ref!SwapchainObject) Swapchains
Jesse Halld27f6aa2015-08-15 17:58:48 -07006249}
6250
6251@internal class InstanceObject {
6252}
6253
6254@internal class PhysicalDeviceObject {
6255 VkInstance instance
6256}
6257
6258@internal class DeviceObject {
6259 VkPhysicalDevice physicalDevice
6260}
6261
6262@internal class QueueObject {
6263 VkDevice device
6264 VkQueueFlags flags
6265}
6266
Jesse Hall3fbc8562015-11-29 22:10:52 -08006267@internal class CommandBufferObject {
Jesse Halld27f6aa2015-08-15 17:58:48 -07006268 VkDevice device
6269 map!(u64, VkDeviceMemory) boundObjects
6270 VkQueueFlags queueFlags
6271}
6272
6273@internal class DeviceMemoryObject {
Jesse Hall3fbc8562015-11-29 22:10:52 -08006274 VkDevice device
6275 VkDeviceSize allocationSize
6276 map!(u64, VkDeviceSize) boundObjects
6277 map!(VkCommandBuffer, VkCommandBuffer) boundCommandBuffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07006278}
6279
6280@internal class BufferObject {
6281 VkDevice device
Jesse Hall3fbc8562015-11-29 22:10:52 -08006282 VkDeviceMemory memory
6283 VkDeviceSize memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07006284}
6285
6286@internal class BufferViewObject {
6287 VkDevice device
6288 VkBuffer buffer
6289}
6290
6291@internal class ImageObject {
6292 VkDevice device
Jesse Hall3fbc8562015-11-29 22:10:52 -08006293 VkDeviceMemory memory
6294 VkDeviceSize memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07006295}
6296
6297@internal class ImageViewObject {
6298 VkDevice device
6299 VkImage image
6300}
6301
Jesse Halld27f6aa2015-08-15 17:58:48 -07006302@internal class ShaderObject {
6303 VkDevice device
6304}
6305
6306@internal class ShaderModuleObject {
6307 VkDevice device
6308}
6309
6310@internal class PipelineObject {
6311 VkDevice device
6312}
6313
6314@internal class PipelineLayoutObject {
6315 VkDevice device
6316}
6317
6318@internal class SamplerObject {
6319 VkDevice device
6320}
6321
6322@internal class DescriptorSetObject {
6323 VkDevice device
6324}
6325
6326@internal class DescriptorSetLayoutObject {
6327 VkDevice device
6328}
6329
6330@internal class DescriptorPoolObject {
6331 VkDevice device
6332}
6333
Jesse Halld27f6aa2015-08-15 17:58:48 -07006334@internal class FenceObject {
6335 VkDevice device
6336 bool signaled
6337}
6338
6339@internal class SemaphoreObject {
6340 VkDevice device
6341}
6342
6343@internal class EventObject {
6344 VkDevice device
6345}
6346
6347@internal class QueryPoolObject {
6348 VkDevice device
6349}
6350
6351@internal class FramebufferObject {
6352 VkDevice device
6353}
6354
6355@internal class RenderPassObject {
6356 VkDevice device
6357}
6358
6359@internal class PipelineCacheObject {
6360 VkDevice device
6361}
6362
Jesse Hall3fbc8562015-11-29 22:10:52 -08006363@internal class CommandPoolObject {
Jesse Halld27f6aa2015-08-15 17:58:48 -07006364 VkDevice device
6365}
6366
Jesse Hall1356b0d2015-11-23 17:24:58 -08006367@internal class SurfaceObject {
6368 VkInstance instance
6369}
6370
Michael Lentine88594d72015-11-12 12:49:45 -08006371@internal class SwapchainObject {
6372 VkDevice device
6373}
6374
Jesse Halld27f6aa2015-08-15 17:58:48 -07006375macro ref!InstanceObject GetInstance(VkInstance instance) {
6376 assert(instance in State.Instances)
6377 return State.Instances[instance]
6378}
6379
6380macro ref!PhysicalDeviceObject GetPhysicalDevice(VkPhysicalDevice physicalDevice) {
6381 assert(physicalDevice in State.PhysicalDevices)
6382 return State.PhysicalDevices[physicalDevice]
6383}
6384
6385macro ref!DeviceObject GetDevice(VkDevice device) {
6386 assert(device in State.Devices)
6387 return State.Devices[device]
6388}
6389
6390macro ref!QueueObject GetQueue(VkQueue queue) {
6391 assert(queue in State.Queues)
6392 return State.Queues[queue]
6393}
6394
Jesse Hall3fbc8562015-11-29 22:10:52 -08006395macro ref!CommandBufferObject GetCommandBuffer(VkCommandBuffer commandBuffer) {
6396 assert(commandBuffer in State.CommandBuffers)
6397 return State.CommandBuffers[commandBuffer]
Jesse Halld27f6aa2015-08-15 17:58:48 -07006398}
6399
Jesse Hall3fbc8562015-11-29 22:10:52 -08006400macro ref!DeviceMemoryObject GetDeviceMemory(VkDeviceMemory memory) {
6401 assert(memory in State.DeviceMemories)
6402 return State.DeviceMemories[memory]
Jesse Halld27f6aa2015-08-15 17:58:48 -07006403}
6404
6405macro ref!BufferObject GetBuffer(VkBuffer buffer) {
6406 assert(buffer in State.Buffers)
6407 return State.Buffers[buffer]
6408}
6409
6410macro ref!BufferViewObject GetBufferView(VkBufferView bufferView) {
6411 assert(bufferView in State.BufferViews)
6412 return State.BufferViews[bufferView]
6413}
6414
6415macro ref!ImageObject GetImage(VkImage image) {
6416 assert(image in State.Images)
6417 return State.Images[image]
6418}
6419
6420macro ref!ImageViewObject GetImageView(VkImageView imageView) {
6421 assert(imageView in State.ImageViews)
6422 return State.ImageViews[imageView]
6423}
6424
Jesse Halld27f6aa2015-08-15 17:58:48 -07006425macro ref!ShaderModuleObject GetShaderModule(VkShaderModule shaderModule) {
6426 assert(shaderModule in State.ShaderModules)
6427 return State.ShaderModules[shaderModule]
6428}
6429
6430macro ref!PipelineObject GetPipeline(VkPipeline pipeline) {
6431 assert(pipeline in State.Pipelines)
6432 return State.Pipelines[pipeline]
6433}
6434
6435macro ref!PipelineLayoutObject GetPipelineLayout(VkPipelineLayout pipelineLayout) {
6436 assert(pipelineLayout in State.PipelineLayouts)
6437 return State.PipelineLayouts[pipelineLayout]
6438}
6439
6440macro ref!SamplerObject GetSampler(VkSampler sampler) {
6441 assert(sampler in State.Samplers)
6442 return State.Samplers[sampler]
6443}
6444
6445macro ref!DescriptorSetObject GetDescriptorSet(VkDescriptorSet descriptorSet) {
6446 assert(descriptorSet in State.DescriptorSets)
6447 return State.DescriptorSets[descriptorSet]
6448}
6449
6450macro ref!DescriptorSetLayoutObject GetDescriptorSetLayout(VkDescriptorSetLayout descriptorSetLayout) {
6451 assert(descriptorSetLayout in State.DescriptorSetLayouts)
6452 return State.DescriptorSetLayouts[descriptorSetLayout]
6453}
6454
6455macro ref!DescriptorPoolObject GetDescriptorPool(VkDescriptorPool descriptorPool) {
6456 assert(descriptorPool in State.DescriptorPools)
6457 return State.DescriptorPools[descriptorPool]
6458}
6459
Jesse Halld27f6aa2015-08-15 17:58:48 -07006460macro ref!FenceObject GetFence(VkFence fence) {
6461 assert(fence in State.Fences)
6462 return State.Fences[fence]
6463}
6464
6465macro ref!SemaphoreObject GetSemaphore(VkSemaphore semaphore) {
6466 assert(semaphore in State.Semaphores)
6467 return State.Semaphores[semaphore]
6468}
6469
6470macro ref!EventObject GetEvent(VkEvent event) {
6471 assert(event in State.Events)
6472 return State.Events[event]
6473}
6474
6475macro ref!QueryPoolObject GetQueryPool(VkQueryPool queryPool) {
6476 assert(queryPool in State.QueryPools)
6477 return State.QueryPools[queryPool]
6478}
6479
6480macro ref!FramebufferObject GetFramebuffer(VkFramebuffer framebuffer) {
6481 assert(framebuffer in State.Framebuffers)
6482 return State.Framebuffers[framebuffer]
6483}
6484
6485macro ref!RenderPassObject GetRenderPass(VkRenderPass renderPass) {
6486 assert(renderPass in State.RenderPasses)
6487 return State.RenderPasses[renderPass]
6488}
6489
6490macro ref!PipelineCacheObject GetPipelineCache(VkPipelineCache pipelineCache) {
6491 assert(pipelineCache in State.PipelineCaches)
6492 return State.PipelineCaches[pipelineCache]
6493}
6494
Jesse Hall3fbc8562015-11-29 22:10:52 -08006495macro ref!CommandPoolObject GetCommandPool(VkCommandPool commandPool) {
6496 assert(commandPool in State.CommandPools)
6497 return State.CommandPools[commandPool]
Jesse Hallf09c6b12015-08-15 19:54:28 -07006498}
Michael Lentine88594d72015-11-12 12:49:45 -08006499
Jesse Hall1356b0d2015-11-23 17:24:58 -08006500macro ref!SurfaceObject GetSurface(VkSurfaceKHR surface) {
6501 assert(surface in State.Surfaces)
6502 return State.Surfaces[surface]
6503}
6504
Michael Lentine88594d72015-11-12 12:49:45 -08006505macro ref!SwapchainObject GetSwapchain(VkSwapchainKHR swapchain) {
6506 assert(swapchain in State.Swapchains)
6507 return State.Swapchains[swapchain]
6508}
Jesse Halld8bade02015-11-24 10:24:18 -08006509
6510macro VkQueueFlags AddQueueFlag(VkQueueFlags flags, VkQueueFlagBits bit) {
6511 return as!VkQueueFlags(as!u32(flags) | as!u32(bit))
6512}