blob: 634afc1bb90d57b417ae791e8e0243b07550f5fe [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 Hall77ad05b2017-03-10 22:02:20 -080031define VERSION_PATCH 39
Jesse Halld27f6aa2015-08-15 17:58:48 -070032
33// API limits
Jesse Hall65ab5522015-11-30 00:07:16 -080034define VK_MAX_PHYSICAL_DEVICE_NAME_SIZE 256
35define VK_UUID_SIZE 16
36define VK_MAX_EXTENSION_NAME_SIZE 256
37define VK_MAX_DESCRIPTION_SIZE 256
38define VK_MAX_MEMORY_TYPES 32
39define VK_MAX_MEMORY_HEAPS 16 /// The maximum number of unique memory heaps, each of which supporting 1 or more memory types.
Jesse Halld27f6aa2015-08-15 17:58:48 -070040
41// API keywords
42define VK_TRUE 1
43define VK_FALSE 0
Jesse Hall5ae3abb2015-10-08 14:00:22 -070044
45// API keyword, but needs special handling by some templates
46define NULL_HANDLE 0
Jesse Halld27f6aa2015-08-15 17:58:48 -070047
Jesse Halleb02c472017-02-24 15:13:45 -080048// 1
Jesse Hall33faaad2016-01-24 21:00:49 -080049@extension("VK_KHR_surface") define VK_KHR_SURFACE_SPEC_VERSION 25
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080050@extension("VK_KHR_surface") define VK_KHR_SURFACE_EXTENSION_NAME "VK_KHR_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080051
Jesse Halleb02c472017-02-24 15:13:45 -080052// 2
Jesse Hall26763382016-05-20 07:13:52 -070053@extension("VK_KHR_swapchain") define VK_KHR_SWAPCHAIN_SPEC_VERSION 68
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080054@extension("VK_KHR_swapchain") define VK_KHR_SWAPCHAIN_EXTENSION_NAME "VK_KHR_swapchain"
Jesse Hall1356b0d2015-11-23 17:24:58 -080055
Jesse Halleb02c472017-02-24 15:13:45 -080056// 3
Jesse Hall543a7ff2016-01-08 16:38:30 -080057@extension("VK_KHR_display") define VK_KHR_DISPLAY_SPEC_VERSION 21
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080058@extension("VK_KHR_display") define VK_KHR_DISPLAY_EXTENSION_NAME "VK_KHR_display"
Jesse Hall1356b0d2015-11-23 17:24:58 -080059
Jesse Halleb02c472017-02-24 15:13:45 -080060// 4
Jesse Hall543a7ff2016-01-08 16:38:30 -080061@extension("VK_KHR_display_swapchain") define VK_KHR_DISPLAY_SWAPCHAIN_SPEC_VERSION 9
Jesse Hall0e74f002015-11-30 11:37:59 -080062@extension("VK_KHR_display_swapchain") define VK_KHR_DISPLAY_SWAPCHAIN_EXTENSION_NAME "VK_KHR_display_swapchain"
Jesse Hall1356b0d2015-11-23 17:24:58 -080063
Jesse Halleb02c472017-02-24 15:13:45 -080064// 5
Jesse Hall543a7ff2016-01-08 16:38:30 -080065@extension("VK_KHR_xlib_surface") define VK_KHR_XLIB_SURFACE_SPEC_VERSION 6
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080066@extension("VK_KHR_xlib_surface") define VK_KHR_XLIB_SURFACE_NAME "VK_KHR_xlib_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080067
Jesse Halleb02c472017-02-24 15:13:45 -080068// 6
Jesse Hall543a7ff2016-01-08 16:38:30 -080069@extension("VK_KHR_xcb_surface") define VK_KHR_XCB_SURFACE_SPEC_VERSION 6
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080070@extension("VK_KHR_xcb_surface") define VK_KHR_XCB_SURFACE_NAME "VK_KHR_xcb_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080071
Jesse Halleb02c472017-02-24 15:13:45 -080072// 7
Jesse Hall543a7ff2016-01-08 16:38:30 -080073@extension("VK_KHR_wayland_surface") define VK_KHR_WAYLAND_SURFACE_SPEC_VERSION 5
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080074@extension("VK_KHR_wayland_surface") define VK_KHR_WAYLAND_SURFACE_NAME "VK_KHR_wayland_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080075
Jesse Halleb02c472017-02-24 15:13:45 -080076// 8
Jesse Hall543a7ff2016-01-08 16:38:30 -080077@extension("VK_KHR_mir_surface") define VK_KHR_MIR_SURFACE_SPEC_VERSION 4
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080078@extension("VK_KHR_mir_surface") define VK_KHR_MIR_SURFACE_NAME "VK_KHR_mir_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080079
Jesse Halleb02c472017-02-24 15:13:45 -080080// 9
Jesse Hall33faaad2016-01-24 21:00:49 -080081@extension("VK_KHR_android_surface") define VK_KHR_ANDROID_SURFACE_SPEC_VERSION 6
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080082@extension("VK_KHR_android_surface") define VK_KHR_ANDROID_SURFACE_NAME "VK_KHR_android_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080083
Jesse Halleb02c472017-02-24 15:13:45 -080084// 10
Jesse Hall543a7ff2016-01-08 16:38:30 -080085@extension("VK_KHR_win32_surface") define VK_KHR_WIN32_SURFACE_SPEC_VERSION 5
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080086@extension("VK_KHR_win32_surface") define VK_KHR_WIN32_SURFACE_NAME "VK_KHR_win32_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080087
Jesse Halleb02c472017-02-24 15:13:45 -080088// 11
Chris Forbes1d4e5542017-02-15 19:38:50 +130089@extension("VK_ANDROID_native_buffer") define VK_ANDROID_NATIVE_BUFFER_SPEC_VERSION 7
Chia-I Wub262ddc2016-03-22 07:38:20 +080090@extension("VK_ANDROID_native_buffer") define VK_ANDROID_NATIVE_BUFFER_NAME "VK_ANDROID_native_buffer"
91
Jesse Halleb02c472017-02-24 15:13:45 -080092// 12
Chris Forbes289cb792016-12-30 15:03:55 +130093@extension("VK_EXT_debug_report") define VK_EXT_DEBUG_REPORT_SPEC_VERSION 4
Jesse Hall715b86a2016-01-16 16:34:29 -080094@extension("VK_EXT_debug_report") define VK_EXT_DEBUG_REPORT_NAME "VK_EXT_debug_report"
95
Jesse Halleb02c472017-02-24 15:13:45 -080096// 13
Jesse Hall26763382016-05-20 07:13:52 -070097@extension("VK_NV_glsl_shader") define VK_NV_GLSL_SHADER_SPEC_VERSION 1
98@extension("VK_NV_glsl_shader") define VK_NV_GLSL_SHADER_NAME "VK_NV_glsl_shader"
99
Jesse Halleb02c472017-02-24 15:13:45 -0800100// 15
Jesse Hall26763382016-05-20 07:13:52 -0700101@extension("VK_KHR_sampler_mirror_clamp_to_edge") define VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_SPEC_VERSION 1
102@extension("VK_KHR_sampler_mirror_clamp_to_edge") define VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_NAME "VK_KHR_sampler_mirror_clamp_to_edge"
103
Jesse Halleb02c472017-02-24 15:13:45 -0800104// 16
Jesse Hall26763382016-05-20 07:13:52 -0700105@extension("VK_IMG_filter_cubic") define VK_IMG_FILTER_CUBIC_SPEC_VERSION 1
106@extension("VK_IMG_filter_cubic") define VK_IMG_FILTER_CUBIC_NAME "VK_IMG_filter_cubic"
107
Jesse Halleb02c472017-02-24 15:13:45 -0800108// 19
Jesse Hall26763382016-05-20 07:13:52 -0700109@extension("VK_AMD_rasterization_order") define VK_AMD_RASTERIZATION_ORDER_SPEC_VERSION 1
110@extension("VK_AMD_rasterization_order") define VK_AMD_RASTERIZATION_ORDER_NAME "VK_AMD_rasterization_order"
111
Jesse Halleb02c472017-02-24 15:13:45 -0800112// 21
Jesse Hall56d386a2016-07-26 15:20:40 -0700113@extension("VK_AMD_shader_trinary_minmax") define VK_AMD_SHADER_TRINARY_MINMAX_SPEC_VERSION 1
114@extension("VK_AMD_shader_trinary_minmax") define VK_AMD_SHADER_TRINARY_MINMAX_EXTENSION_NAME "VK_AMD_shader_trinary_minmax"
115
Jesse Halleb02c472017-02-24 15:13:45 -0800116// 22
Jesse Hall56d386a2016-07-26 15:20:40 -0700117@extension("VK_AMD_shader_explicit_vertex_parameter") define VK_AMD_SHADER_EXPLICIT_VERTEX_PARAMETER_SPEC_VERSION 1
118@extension("VK_AMD_shader_explicit_vertex_parameter") define VK_AMD_SHADER_EXPLICIT_VERTEX_PARAMETER_EXTENSION_NAME "VK_AMD_shader_explicit_vertex_parameter"
119
Jesse Halleb02c472017-02-24 15:13:45 -0800120// 23
Jesse Hall26763382016-05-20 07:13:52 -0700121@extension("VK_EXT_debug_marker") define VK_EXT_DEBUG_MARKER_SPEC_VERSION 3
122@extension("VK_EXT_debug_marker") define VK_EXT_DEBUG_MARKER_NAME "VK_EXT_debug_marker"
123
Jesse Halleb02c472017-02-24 15:13:45 -0800124// 26
Jesse Hall56d386a2016-07-26 15:20:40 -0700125@extension("VK_AMD_gcn_shader") define VK_AMD_GCN_SHADER_SPEC_VERSION 1
126@extension("VK_AMD_gcn_shader") define VK_AMD_GCN_SHADER_EXTENSION_NAME "VK_AMD_gcn_shader"
127
Jesse Halleb02c472017-02-24 15:13:45 -0800128// 27
Jesse Hall56d386a2016-07-26 15:20:40 -0700129@extension("VK_NV_dedicated_allocation") define VK_NV_DEDICATED_ALLOCATION_SPEC_VERSION 1
130@extension("VK_NV_dedicated_allocation") define VK_NV_DEDICATED_ALLOCATION_EXTENSION_NAME "VK_NV_dedicated_allocation"
131
Jesse Halleb02c472017-02-24 15:13:45 -0800132// 28
Chris Forbes289cb792016-12-30 15:03:55 +1300133@extension("VK_IMG_format_pvrtc") define VK_IMG_FORMAT_PVRTC_SPEC_VERSION 1
134@extension("VK_IMG_format_pvrtc") define VK_IMG_FORMAT_PVRTC_EXTENSION_NAME "VK_IMG_format_pvrtc"
135
Jesse Halleb02c472017-02-24 15:13:45 -0800136// 34
137@extension("VK_AMD_draw_indirect_count") define VK_AMD_DRAW_INDIRECT_COUNT_SPEC_VERSION 1
138@extension("VK_AMD_draw_indirect_count") define VK_AMD_DRAW_INDIRECT_COUNT_EXTENSION_NAME "VK_AMD_draw_indirect_count"
139
140// 36
141@extension("VK_AMD_negative_viewport_height") define VK_AMD_NEGATIVE_VIEWPORT_HEIGHT_SPEC_VERSION 1
142@extension("VK_AMD_negative_viewport_height") define VK_AMD_NEGATIVE_VIEWPORT_HEIGHT_EXTENSION_NAME "VK_AMD_negative_viewport_height"
143
144// 37
145@extension("VK_AMD_gpu_shader_half_float") define VK_AMD_GPU_SHADER_HALF_FLOAT_SPEC_VERSION 1
146@extension("VK_AMD_gpu_shader_half_float") define VK_AMD_GPU_SHADER_HALF_FLOAT_EXTENSION_NAME "VK_AMD_gpu_shader_half_float"
147
148// 38
149@extension("VK_AMD_shader_ballot") define VK_AMD_SHADER_BALLOT_SPEC_VERSION 1
150@extension("VK_AMD_shader_ballot") define VK_AMD_SHADER_BALLOT_EXTENSION_NAME "VK_AMD_shader_ballot"
151
152// 56
Chris Forbes289cb792016-12-30 15:03:55 +1300153@extension("VK_NV_external_memory_capabilities") define VK_NV_EXTERNAL_MEMORY_CAPABILITIES_SPEC_VERSION 1
154@extension("VK_NV_external_memory_capabilities") define VK_NV_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME "VK_NV_external_memory_capabilities"
155
Jesse Halleb02c472017-02-24 15:13:45 -0800156// 57
Chris Forbes289cb792016-12-30 15:03:55 +1300157@extension("VK_NV_external_memory") define VK_NV_EXTERNAL_MEMORY_SPEC_VERSION 1
158@extension("VK_NV_external_memory") define VK_NV_EXTERNAL_MEMORY_EXTENSION_NAME "VK_NV_external_memory"
159
Jesse Halleb02c472017-02-24 15:13:45 -0800160// 58
Chris Forbes289cb792016-12-30 15:03:55 +1300161@extension("VK_NV_external_memory_win32") define VK_NV_EXTERNAL_MEMORY_WIN32_SPEC_VERSION 1
162@extension("VK_NV_external_memory_win32") define VK_NV_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME "VK_NV_external_memory_win32"
163
Jesse Halleb02c472017-02-24 15:13:45 -0800164// 59
Chris Forbes289cb792016-12-30 15:03:55 +1300165@extension("VK_NV_win32_keyed_mutex") define VK_NV_WIN32_KEYED_MUTEX_SPEC_VERSION 1
166@extension("VK_NV_win32_keyed_mutex") define VK_NV_WIN32_KEYED_MUTEX_EXTENSION_NAME "VK_NV_win32_keyed_mutex"
167
Jesse Hall889cd9a2017-02-25 22:12:23 -0800168// 60
169@extension("VK_KHR_get_physical_device_properties2") define VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_SPEC_VERSION 1
170@extension("VK_KHR_get_physical_device_properties2") define VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME "VK_KHR_get_physical_device_properties2"
171
Jesse Halleb02c472017-02-24 15:13:45 -0800172// 62
Chris Forbes289cb792016-12-30 15:03:55 +1300173@extension("VK_EXT_validation_flags") define VK_EXT_VALIDATION_FLAGS_SPEC_VERSION 1
174@extension("VK_EXT_validation_flags") define VK_EXT_VALIDATION_FLAGS_EXTENSION_NAME "VK_EXT_validation_flags"
175
Jesse Hall77ad05b2017-03-10 22:02:20 -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 Hall889cd9a2017-02-25 22:12:23 -0800196// 85
197@extension("VK_KHR_incremental_present") define VK_KHR_INCREMENTAL_PRESENT_SPEC_VERSION 1
198@extension("VK_KHR_incremental_present") define VK_KHR_INCREMENTAL_PRESENT_NAME "VK_KHR_incremental_present"
199
Jesse Halleb02c472017-02-24 15:13:45 -0800200// 87
Chris Forbes289cb792016-12-30 15:03:55 +1300201@extension("VK_NVX_device_generated_commands") define VK_NVX_DEVICE_GENERATED_COMMANDS_SPEC_VERSION 1
202@extension("VK_NVX_device_generated_commands") define VK_NVX_DEVICE_GENERATED_COMMANDS_EXTENSION_NAME "VK_NVX_device_generated_commands"
203
Jesse Hall77ad05b2017-03-10 22:02:20 -0800204// 89
205@extension("VK_EXT_direct_mode_display") define VK_EXT_DIRECT_MODE_DISPLAY_SPEC_VERSION 1
206@extension("VK_EXT_direct_mode_display") define VK_EXT_DIRECT_MODE_DISPLAY_EXTENSION_NAME "VK_EXT_direct_mode_display"
207
208// 90
209@extension("VK_EXT_acquire_xlib_display") define VK_EXT_ACQUIRE_XLIB_DISPLAY_SPEC_VERSION 1
210@extension("VK_EXT_acquire_xlib_display") define VK_EXT_ACQUIRE_XLIB_DISPLAY_EXTENSION_NAME "VK_EXT_acquire_xlib_display"
211
212// 91
213@extension("VK_EXT_display_surface_counter") define VK_EXT_DISPLAY_SURFACE_COUNTER_SPEC_VERSION 1
214@extension("VK_EXT_display_surface_counter") define VK_EXT_DISPLAY_SURFACE_COUNTER_EXTENSION_NAME "VK_EXT_display_surface_counter"
215
216// 92
217@extension("VK_EXT_display_control") define VK_EXT_DISPLAY_CONTROL_SPEC_VERSION 1
218@extension("VK_EXT_display_control") define VK_EXT_DISPLAY_CONTROL_COUNTER_EXTENSION_NAME "VK_EXT_display_control"
219
Jesse Hall889cd9a2017-02-25 22:12:23 -0800220// 93
221@extension("VK_GOOGLE_display_timing") define VK_GOOGLE_DISPLAY_TIMING_SPEC_VERSION 1
222@extension("VK_GOOGLE_display_timing") define VK_GOOGLE_DISPLAY_TIMING_NAME "VK_GOOGLE_display_timing"
223
Jesse Hall77ad05b2017-03-10 22:02:20 -0800224// 105
225@extension("VK_EXT_swapchain_colorspace") define VK_EXT_SWAPCHAIN_COLORSPACE_SPEC_VERSION 1
226@extension("VK_EXT_swapchain_colorspace") define VK_EXT_SWAPCHAIN_COLORSPACE_COUNTER_EXTENSION_NAME "VK_EXT_swapchain_colorspace"
227
Jesse Hall889cd9a2017-02-25 22:12:23 -0800228// 106
229@extension("VK_EXT_hdr_metadata") define VK_EXT_HDR_METADATA_SPEC_VERSION 1
230@extension("VK_EXT_hdr_metadata") define VK_EXT_HDR_METADATA_EXTENSION_NAME "VK_EXT_hdr_metadata"
231
232// 112
Chris Forbes1d5f68c2017-01-31 10:17:01 +1300233@extension("VK_KHR_shared_presentable_image") define VK_KHR_SHARED_PRESENTABLE_IMAGE_SPEC_VERSION 1
234@extension("VK_KHR_shared_presentable_image") define VK_KHR_SHARED_PRESENTABLE_IMAGE_EXTENSION_NAME "VK_KHR_shared_presentable_image"
Chris Forbes2e12cb82017-01-18 11:45:17 +1300235
Jesse Halld27f6aa2015-08-15 17:58:48 -0700236/////////////
237// Types //
238/////////////
239
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700240type u32 VkBool32
241type u32 VkFlags
242type u64 VkDeviceSize
243type u32 VkSampleMask
244
Jesse Halld27f6aa2015-08-15 17:58:48 -0700245/// Dispatchable handle types.
246@dispatchHandle type u64 VkInstance
247@dispatchHandle type u64 VkPhysicalDevice
248@dispatchHandle type u64 VkDevice
249@dispatchHandle type u64 VkQueue
Jesse Hall3fbc8562015-11-29 22:10:52 -0800250@dispatchHandle type u64 VkCommandBuffer
Jesse Halld27f6aa2015-08-15 17:58:48 -0700251
252/// Non dispatchable handle types.
253@nonDispatchHandle type u64 VkDeviceMemory
Jesse Hall3fbc8562015-11-29 22:10:52 -0800254@nonDispatchHandle type u64 VkCommandPool
Jesse Halld27f6aa2015-08-15 17:58:48 -0700255@nonDispatchHandle type u64 VkBuffer
256@nonDispatchHandle type u64 VkBufferView
257@nonDispatchHandle type u64 VkImage
258@nonDispatchHandle type u64 VkImageView
Jesse Halld27f6aa2015-08-15 17:58:48 -0700259@nonDispatchHandle type u64 VkShaderModule
Jesse Halld27f6aa2015-08-15 17:58:48 -0700260@nonDispatchHandle type u64 VkPipeline
261@nonDispatchHandle type u64 VkPipelineLayout
262@nonDispatchHandle type u64 VkSampler
263@nonDispatchHandle type u64 VkDescriptorSet
264@nonDispatchHandle type u64 VkDescriptorSetLayout
265@nonDispatchHandle type u64 VkDescriptorPool
Jesse Halld27f6aa2015-08-15 17:58:48 -0700266@nonDispatchHandle type u64 VkFence
267@nonDispatchHandle type u64 VkSemaphore
268@nonDispatchHandle type u64 VkEvent
269@nonDispatchHandle type u64 VkQueryPool
270@nonDispatchHandle type u64 VkFramebuffer
271@nonDispatchHandle type u64 VkRenderPass
272@nonDispatchHandle type u64 VkPipelineCache
Jesse Hall1356b0d2015-11-23 17:24:58 -0800273
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800274@extension("VK_KHR_surface") @nonDispatchHandle type u64 VkSurfaceKHR
Jesse Hall1356b0d2015-11-23 17:24:58 -0800275
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800276@extension("VK_KHR_swapchain") @nonDispatchHandle type u64 VkSwapchainKHR
Jesse Hall1356b0d2015-11-23 17:24:58 -0800277
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800278@extension("VK_KHR_display") @nonDispatchHandle type u64 VkDisplayKHR
279@extension("VK_KHR_display") @nonDispatchHandle type u64 VkDisplayModeKHR
Jesse Halld27f6aa2015-08-15 17:58:48 -0700280
Jesse Hall715b86a2016-01-16 16:34:29 -0800281@extension("VK_EXT_debug_report") @nonDispatchHandle type u64 VkDebugReportCallbackEXT
282
Chris Forbes289cb792016-12-30 15:03:55 +1300283@extension("VK_NVX_device_generated_commands") @nonDispatchHandle type u64 VkObjectTableNVX
284@extension("VK_NVX_device_generated_commands") @nonDispatchHandle type u64 VkIndirectCommandsLayoutNVX
285
Jesse Halld27f6aa2015-08-15 17:58:48 -0700286
287/////////////
288// Enums //
289/////////////
290
291enum VkImageLayout {
292 VK_IMAGE_LAYOUT_UNDEFINED = 0x00000000, /// Implicit layout an image is when its contents are undefined due to various reasons (e.g. right after creation)
293 VK_IMAGE_LAYOUT_GENERAL = 0x00000001, /// General layout when image can be used for any kind of access
294 VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL = 0x00000002, /// Optimal layout when image is only used for color attachment read/write
295 VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL = 0x00000003, /// Optimal layout when image is only used for depth/stencil attachment read/write
296 VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL = 0x00000004, /// Optimal layout when image is used for read only depth/stencil attachment and shader access
297 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 -0800298 VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL = 0x00000006, /// Optimal layout when image is used only as source of transfer operations
299 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 -0700300 VK_IMAGE_LAYOUT_PREINITIALIZED = 0x00000008, /// Initial layout used when the data is populated by the CPU
Jesse Hall1356b0d2015-11-23 17:24:58 -0800301
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800302 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800303 VK_IMAGE_LAYOUT_PRESENT_SRC_KHR = 1000001002,
Chris Forbesaf3a1112017-01-31 15:37:03 +1300304
305 //@extension("VK_KHR_shared_presentable_image")
306 VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR = 1000111000,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700307}
308
309enum VkAttachmentLoadOp {
310 VK_ATTACHMENT_LOAD_OP_LOAD = 0x00000000,
311 VK_ATTACHMENT_LOAD_OP_CLEAR = 0x00000001,
312 VK_ATTACHMENT_LOAD_OP_DONT_CARE = 0x00000002,
313}
314
315enum VkAttachmentStoreOp {
316 VK_ATTACHMENT_STORE_OP_STORE = 0x00000000,
317 VK_ATTACHMENT_STORE_OP_DONT_CARE = 0x00000001,
318}
319
320enum VkImageType {
321 VK_IMAGE_TYPE_1D = 0x00000000,
322 VK_IMAGE_TYPE_2D = 0x00000001,
323 VK_IMAGE_TYPE_3D = 0x00000002,
324}
325
326enum VkImageTiling {
Jesse Hallc7467b72015-11-29 21:05:26 -0800327 VK_IMAGE_TILING_OPTIMAL = 0x00000000,
328 VK_IMAGE_TILING_LINEAR = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700329}
330
331enum VkImageViewType {
332 VK_IMAGE_VIEW_TYPE_1D = 0x00000000,
333 VK_IMAGE_VIEW_TYPE_2D = 0x00000001,
334 VK_IMAGE_VIEW_TYPE_3D = 0x00000002,
335 VK_IMAGE_VIEW_TYPE_CUBE = 0x00000003,
336 VK_IMAGE_VIEW_TYPE_1D_ARRAY = 0x00000004,
337 VK_IMAGE_VIEW_TYPE_2D_ARRAY = 0x00000005,
338 VK_IMAGE_VIEW_TYPE_CUBE_ARRAY = 0x00000006,
339}
340
Jesse Hall3fbc8562015-11-29 22:10:52 -0800341enum VkCommandBufferLevel {
342 VK_COMMAND_BUFFER_LEVEL_PRIMARY = 0x00000000,
343 VK_COMMAND_BUFFER_LEVEL_SECONDARY = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700344}
345
Jesse Hall65ab5522015-11-30 00:07:16 -0800346enum VkComponentSwizzle {
347 VK_COMPONENT_SWIZZLE_IDENTITY = 0x00000000,
348 VK_COMPONENT_SWIZZLE_ZERO = 0x00000001,
349 VK_COMPONENT_SWIZZLE_ONE = 0x00000002,
350 VK_COMPONENT_SWIZZLE_R = 0x00000003,
351 VK_COMPONENT_SWIZZLE_G = 0x00000004,
352 VK_COMPONENT_SWIZZLE_B = 0x00000005,
353 VK_COMPONENT_SWIZZLE_A = 0x00000006,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700354}
355
356enum VkDescriptorType {
357 VK_DESCRIPTOR_TYPE_SAMPLER = 0x00000000,
358 VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER = 0x00000001,
359 VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE = 0x00000002,
360 VK_DESCRIPTOR_TYPE_STORAGE_IMAGE = 0x00000003,
361 VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER = 0x00000004,
362 VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER = 0x00000005,
363 VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER = 0x00000006,
364 VK_DESCRIPTOR_TYPE_STORAGE_BUFFER = 0x00000007,
365 VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC = 0x00000008,
366 VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC = 0x00000009,
367 VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT = 0x0000000a,
368}
369
Jesse Halld27f6aa2015-08-15 17:58:48 -0700370enum VkQueryType {
371 VK_QUERY_TYPE_OCCLUSION = 0x00000000,
372 VK_QUERY_TYPE_PIPELINE_STATISTICS = 0x00000001, /// Optional
Jesse Halla3a7a1d2015-11-24 11:37:23 -0800373 VK_QUERY_TYPE_TIMESTAMP = 0x00000002,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700374}
375
Jesse Halld27f6aa2015-08-15 17:58:48 -0700376enum VkBorderColor {
377 VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK = 0x00000000,
378 VK_BORDER_COLOR_INT_TRANSPARENT_BLACK = 0x00000001,
379 VK_BORDER_COLOR_FLOAT_OPAQUE_BLACK = 0x00000002,
380 VK_BORDER_COLOR_INT_OPAQUE_BLACK = 0x00000003,
381 VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE = 0x00000004,
382 VK_BORDER_COLOR_INT_OPAQUE_WHITE = 0x00000005,
383}
384
385enum VkPipelineBindPoint {
Jesse Hallc7467b72015-11-29 21:05:26 -0800386 VK_PIPELINE_BIND_POINT_GRAPHICS = 0x00000000,
387 VK_PIPELINE_BIND_POINT_COMPUTE = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700388}
389
390enum VkPrimitiveTopology {
391 VK_PRIMITIVE_TOPOLOGY_POINT_LIST = 0x00000000,
392 VK_PRIMITIVE_TOPOLOGY_LINE_LIST = 0x00000001,
393 VK_PRIMITIVE_TOPOLOGY_LINE_STRIP = 0x00000002,
394 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST = 0x00000003,
395 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP = 0x00000004,
396 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN = 0x00000005,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800397 VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY = 0x00000006,
398 VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY = 0x00000007,
399 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY = 0x00000008,
400 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY = 0x00000009,
Jesse Hall091ed9e2015-11-30 00:55:29 -0800401 VK_PRIMITIVE_TOPOLOGY_PATCH_LIST = 0x0000000a,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700402}
403
404enum VkSharingMode {
405 VK_SHARING_MODE_EXCLUSIVE = 0x00000000,
406 VK_SHARING_MODE_CONCURRENT = 0x00000001,
407}
408
409enum VkIndexType {
410 VK_INDEX_TYPE_UINT16 = 0x00000000,
411 VK_INDEX_TYPE_UINT32 = 0x00000001,
412}
413
Jesse Hall23ff73f2015-11-29 14:36:39 -0800414enum VkFilter {
415 VK_FILTER_NEAREST = 0x00000000,
416 VK_FILTER_LINEAR = 0x00000001,
Jesse Hall26763382016-05-20 07:13:52 -0700417
418 //@extension("VK_IMG_filter_cubic")
419 VK_FILTER_CUBIC_IMG = 1000015000,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700420}
421
Jesse Hall23ff73f2015-11-29 14:36:39 -0800422enum VkSamplerMipmapMode {
Jesse Hall23ff73f2015-11-29 14:36:39 -0800423 VK_SAMPLER_MIPMAP_MODE_NEAREST = 0x00000001, /// Choose nearest mip level
424 VK_SAMPLER_MIPMAP_MODE_LINEAR = 0x00000002, /// Linear filter between mip levels
Jesse Halld27f6aa2015-08-15 17:58:48 -0700425}
426
Jesse Hall23ff73f2015-11-29 14:36:39 -0800427enum VkSamplerAddressMode {
Jesse Hallc7467b72015-11-29 21:05:26 -0800428 VK_SAMPLER_ADDRESS_MODE_REPEAT = 0x00000000,
429 VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT = 0x00000001,
430 VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE = 0x00000002,
431 VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER = 0x00000003,
432 VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700433}
434
435enum VkCompareOp {
436 VK_COMPARE_OP_NEVER = 0x00000000,
437 VK_COMPARE_OP_LESS = 0x00000001,
438 VK_COMPARE_OP_EQUAL = 0x00000002,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800439 VK_COMPARE_OP_LESS_OR_EQUAL = 0x00000003,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700440 VK_COMPARE_OP_GREATER = 0x00000004,
441 VK_COMPARE_OP_NOT_EQUAL = 0x00000005,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800442 VK_COMPARE_OP_GREATER_OR_EQUAL = 0x00000006,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700443 VK_COMPARE_OP_ALWAYS = 0x00000007,
444}
445
Jesse Hall65ab5522015-11-30 00:07:16 -0800446enum VkPolygonMode {
447 VK_POLYGON_MODE_FILL = 0x00000000,
448 VK_POLYGON_MODE_LINE = 0x00000001,
449 VK_POLYGON_MODE_POINT = 0x00000002,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700450}
451
452enum VkFrontFace {
Jesse Hall3fbc8562015-11-29 22:10:52 -0800453 VK_FRONT_FACE_COUNTER_CLOCKWISE = 0x00000000,
454 VK_FRONT_FACE_CLOCKWISE = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700455}
456
Jesse Hall65ab5522015-11-30 00:07:16 -0800457enum VkBlendFactor {
458 VK_BLEND_FACTOR_ZERO = 0x00000000,
459 VK_BLEND_FACTOR_ONE = 0x00000001,
460 VK_BLEND_FACTOR_SRC_COLOR = 0x00000002,
461 VK_BLEND_FACTOR_ONE_MINUS_SRC_COLOR = 0x00000003,
462 VK_BLEND_FACTOR_DST_COLOR = 0x00000004,
463 VK_BLEND_FACTOR_ONE_MINUS_DST_COLOR = 0x00000005,
464 VK_BLEND_FACTOR_SRC_ALPHA = 0x00000006,
465 VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA = 0x00000007,
466 VK_BLEND_FACTOR_DST_ALPHA = 0x00000008,
467 VK_BLEND_FACTOR_ONE_MINUS_DST_ALPHA = 0x00000009,
468 VK_BLEND_FACTOR_CONSTANT_COLOR = 0x0000000a,
469 VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR = 0x0000000b,
470 VK_BLEND_FACTOR_CONSTANT_ALPHA = 0x0000000c,
471 VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA = 0x0000000d,
472 VK_BLEND_FACTOR_SRC_ALPHA_SATURATE = 0x0000000e,
473 VK_BLEND_FACTOR_SRC1_COLOR = 0x0000000f,
474 VK_BLEND_FACTOR_ONE_MINUS_SRC1_COLOR = 0x00000010,
475 VK_BLEND_FACTOR_SRC1_ALPHA = 0x00000011,
476 VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA = 0x00000012,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700477}
478
479enum VkBlendOp {
480 VK_BLEND_OP_ADD = 0x00000000,
481 VK_BLEND_OP_SUBTRACT = 0x00000001,
482 VK_BLEND_OP_REVERSE_SUBTRACT = 0x00000002,
483 VK_BLEND_OP_MIN = 0x00000003,
484 VK_BLEND_OP_MAX = 0x00000004,
485}
486
487enum VkStencilOp {
488 VK_STENCIL_OP_KEEP = 0x00000000,
489 VK_STENCIL_OP_ZERO = 0x00000001,
490 VK_STENCIL_OP_REPLACE = 0x00000002,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800491 VK_STENCIL_OP_INCREMENT_AND_CLAMP = 0x00000003,
492 VK_STENCIL_OP_DECREMENT_AND_CLAMP = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700493 VK_STENCIL_OP_INVERT = 0x00000005,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800494 VK_STENCIL_OP_INCREMENT_AND_WRAP = 0x00000006,
495 VK_STENCIL_OP_DECREMENT_AND_WRAP = 0x00000007,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700496}
497
498enum VkLogicOp {
499 VK_LOGIC_OP_CLEAR = 0x00000000,
500 VK_LOGIC_OP_AND = 0x00000001,
501 VK_LOGIC_OP_AND_REVERSE = 0x00000002,
502 VK_LOGIC_OP_COPY = 0x00000003,
503 VK_LOGIC_OP_AND_INVERTED = 0x00000004,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800504 VK_LOGIC_OP_NO_OP = 0x00000005,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700505 VK_LOGIC_OP_XOR = 0x00000006,
506 VK_LOGIC_OP_OR = 0x00000007,
507 VK_LOGIC_OP_NOR = 0x00000008,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800508 VK_LOGIC_OP_EQUIVALENT = 0x00000009,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700509 VK_LOGIC_OP_INVERT = 0x0000000a,
510 VK_LOGIC_OP_OR_REVERSE = 0x0000000b,
511 VK_LOGIC_OP_COPY_INVERTED = 0x0000000c,
512 VK_LOGIC_OP_OR_INVERTED = 0x0000000d,
513 VK_LOGIC_OP_NAND = 0x0000000e,
514 VK_LOGIC_OP_SET = 0x0000000f,
515}
516
Jesse Hall3fbc8562015-11-29 22:10:52 -0800517enum VkSystemAllocationScope {
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800518 VK_SYSTEM_ALLOCATION_SCOPE_COMMAND = 0x00000000,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800519 VK_SYSTEM_ALLOCATION_SCOPE_OBJECT = 0x00000001,
520 VK_SYSTEM_ALLOCATION_SCOPE_CACHE = 0x00000002,
521 VK_SYSTEM_ALLOCATION_SCOPE_DEVICE = 0x00000003,
522 VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE = 0x00000004,
Jesse Hall03b6fe12015-11-24 12:44:21 -0800523}
524
Jesse Hall3fbc8562015-11-29 22:10:52 -0800525enum VkInternalAllocationType {
526 VK_INTERNAL_ALLOCATION_TYPE_EXECUTABLE = 0x00000000,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700527}
528
529enum VkPhysicalDeviceType {
530 VK_PHYSICAL_DEVICE_TYPE_OTHER = 0x00000000,
531 VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU = 0x00000001,
532 VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU = 0x00000002,
533 VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU = 0x00000003,
534 VK_PHYSICAL_DEVICE_TYPE_CPU = 0x00000004,
535}
536
Jesse Hall65ab5522015-11-30 00:07:16 -0800537enum VkVertexInputRate {
538 VK_VERTEX_INPUT_RATE_VERTEX = 0x00000000,
539 VK_VERTEX_INPUT_RATE_INSTANCE = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700540}
541
542/// Vulkan format definitions
543enum VkFormat {
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800544 VK_FORMAT_UNDEFINED = 0,
545 VK_FORMAT_R4G4_UNORM_PACK8 = 1,
546 VK_FORMAT_R4G4B4A4_UNORM_PACK16 = 2,
547 VK_FORMAT_B4G4R4A4_UNORM_PACK16 = 3,
548 VK_FORMAT_R5G6B5_UNORM_PACK16 = 4,
549 VK_FORMAT_B5G6R5_UNORM_PACK16 = 5,
550 VK_FORMAT_R5G5B5A1_UNORM_PACK16 = 6,
551 VK_FORMAT_B5G5R5A1_UNORM_PACK16 = 7,
552 VK_FORMAT_A1R5G5B5_UNORM_PACK16 = 8,
553 VK_FORMAT_R8_UNORM = 9,
554 VK_FORMAT_R8_SNORM = 10,
555 VK_FORMAT_R8_USCALED = 11,
556 VK_FORMAT_R8_SSCALED = 12,
557 VK_FORMAT_R8_UINT = 13,
558 VK_FORMAT_R8_SINT = 14,
559 VK_FORMAT_R8_SRGB = 15,
560 VK_FORMAT_R8G8_UNORM = 16,
561 VK_FORMAT_R8G8_SNORM = 17,
562 VK_FORMAT_R8G8_USCALED = 18,
563 VK_FORMAT_R8G8_SSCALED = 19,
564 VK_FORMAT_R8G8_UINT = 20,
565 VK_FORMAT_R8G8_SINT = 21,
566 VK_FORMAT_R8G8_SRGB = 22,
567 VK_FORMAT_R8G8B8_UNORM = 23,
568 VK_FORMAT_R8G8B8_SNORM = 24,
569 VK_FORMAT_R8G8B8_USCALED = 25,
570 VK_FORMAT_R8G8B8_SSCALED = 26,
571 VK_FORMAT_R8G8B8_UINT = 27,
572 VK_FORMAT_R8G8B8_SINT = 28,
573 VK_FORMAT_R8G8B8_SRGB = 29,
574 VK_FORMAT_B8G8R8_UNORM = 30,
575 VK_FORMAT_B8G8R8_SNORM = 31,
576 VK_FORMAT_B8G8R8_USCALED = 32,
577 VK_FORMAT_B8G8R8_SSCALED = 33,
578 VK_FORMAT_B8G8R8_UINT = 34,
579 VK_FORMAT_B8G8R8_SINT = 35,
580 VK_FORMAT_B8G8R8_SRGB = 36,
581 VK_FORMAT_R8G8B8A8_UNORM = 37,
582 VK_FORMAT_R8G8B8A8_SNORM = 38,
583 VK_FORMAT_R8G8B8A8_USCALED = 39,
584 VK_FORMAT_R8G8B8A8_SSCALED = 40,
585 VK_FORMAT_R8G8B8A8_UINT = 41,
586 VK_FORMAT_R8G8B8A8_SINT = 42,
587 VK_FORMAT_R8G8B8A8_SRGB = 43,
588 VK_FORMAT_B8G8R8A8_UNORM = 44,
589 VK_FORMAT_B8G8R8A8_SNORM = 45,
590 VK_FORMAT_B8G8R8A8_USCALED = 46,
591 VK_FORMAT_B8G8R8A8_SSCALED = 47,
592 VK_FORMAT_B8G8R8A8_UINT = 48,
593 VK_FORMAT_B8G8R8A8_SINT = 49,
594 VK_FORMAT_B8G8R8A8_SRGB = 50,
595 VK_FORMAT_A8B8G8R8_UNORM_PACK32 = 51,
596 VK_FORMAT_A8B8G8R8_SNORM_PACK32 = 52,
597 VK_FORMAT_A8B8G8R8_USCALED_PACK32 = 53,
598 VK_FORMAT_A8B8G8R8_SSCALED_PACK32 = 54,
599 VK_FORMAT_A8B8G8R8_UINT_PACK32 = 55,
600 VK_FORMAT_A8B8G8R8_SINT_PACK32 = 56,
601 VK_FORMAT_A8B8G8R8_SRGB_PACK32 = 57,
602 VK_FORMAT_A2R10G10B10_UNORM_PACK32 = 58,
603 VK_FORMAT_A2R10G10B10_SNORM_PACK32 = 59,
604 VK_FORMAT_A2R10G10B10_USCALED_PACK32 = 60,
605 VK_FORMAT_A2R10G10B10_SSCALED_PACK32 = 61,
606 VK_FORMAT_A2R10G10B10_UINT_PACK32 = 62,
607 VK_FORMAT_A2R10G10B10_SINT_PACK32 = 63,
608 VK_FORMAT_A2B10G10R10_UNORM_PACK32 = 64,
609 VK_FORMAT_A2B10G10R10_SNORM_PACK32 = 65,
610 VK_FORMAT_A2B10G10R10_USCALED_PACK32 = 66,
611 VK_FORMAT_A2B10G10R10_SSCALED_PACK32 = 67,
612 VK_FORMAT_A2B10G10R10_UINT_PACK32 = 68,
613 VK_FORMAT_A2B10G10R10_SINT_PACK32 = 69,
614 VK_FORMAT_R16_UNORM = 70,
615 VK_FORMAT_R16_SNORM = 71,
616 VK_FORMAT_R16_USCALED = 72,
617 VK_FORMAT_R16_SSCALED = 73,
618 VK_FORMAT_R16_UINT = 74,
619 VK_FORMAT_R16_SINT = 75,
620 VK_FORMAT_R16_SFLOAT = 76,
621 VK_FORMAT_R16G16_UNORM = 77,
622 VK_FORMAT_R16G16_SNORM = 78,
623 VK_FORMAT_R16G16_USCALED = 79,
624 VK_FORMAT_R16G16_SSCALED = 80,
625 VK_FORMAT_R16G16_UINT = 81,
626 VK_FORMAT_R16G16_SINT = 82,
627 VK_FORMAT_R16G16_SFLOAT = 83,
628 VK_FORMAT_R16G16B16_UNORM = 84,
629 VK_FORMAT_R16G16B16_SNORM = 85,
630 VK_FORMAT_R16G16B16_USCALED = 86,
631 VK_FORMAT_R16G16B16_SSCALED = 87,
632 VK_FORMAT_R16G16B16_UINT = 88,
633 VK_FORMAT_R16G16B16_SINT = 89,
634 VK_FORMAT_R16G16B16_SFLOAT = 90,
635 VK_FORMAT_R16G16B16A16_UNORM = 91,
636 VK_FORMAT_R16G16B16A16_SNORM = 92,
637 VK_FORMAT_R16G16B16A16_USCALED = 93,
638 VK_FORMAT_R16G16B16A16_SSCALED = 94,
639 VK_FORMAT_R16G16B16A16_UINT = 95,
640 VK_FORMAT_R16G16B16A16_SINT = 96,
641 VK_FORMAT_R16G16B16A16_SFLOAT = 97,
642 VK_FORMAT_R32_UINT = 98,
643 VK_FORMAT_R32_SINT = 99,
644 VK_FORMAT_R32_SFLOAT = 100,
645 VK_FORMAT_R32G32_UINT = 101,
646 VK_FORMAT_R32G32_SINT = 102,
647 VK_FORMAT_R32G32_SFLOAT = 103,
648 VK_FORMAT_R32G32B32_UINT = 104,
649 VK_FORMAT_R32G32B32_SINT = 105,
650 VK_FORMAT_R32G32B32_SFLOAT = 106,
651 VK_FORMAT_R32G32B32A32_UINT = 107,
652 VK_FORMAT_R32G32B32A32_SINT = 108,
653 VK_FORMAT_R32G32B32A32_SFLOAT = 109,
654 VK_FORMAT_R64_UINT = 110,
655 VK_FORMAT_R64_SINT = 111,
656 VK_FORMAT_R64_SFLOAT = 112,
657 VK_FORMAT_R64G64_UINT = 113,
658 VK_FORMAT_R64G64_SINT = 114,
659 VK_FORMAT_R64G64_SFLOAT = 115,
660 VK_FORMAT_R64G64B64_UINT = 116,
661 VK_FORMAT_R64G64B64_SINT = 117,
662 VK_FORMAT_R64G64B64_SFLOAT = 118,
663 VK_FORMAT_R64G64B64A64_UINT = 119,
664 VK_FORMAT_R64G64B64A64_SINT = 120,
665 VK_FORMAT_R64G64B64A64_SFLOAT = 121,
666 VK_FORMAT_B10G11R11_UFLOAT_PACK32 = 122,
667 VK_FORMAT_E5B9G9R9_UFLOAT_PACK32 = 123,
668 VK_FORMAT_D16_UNORM = 124,
669 VK_FORMAT_X8_D24_UNORM_PACK32 = 125,
670 VK_FORMAT_D32_SFLOAT = 126,
671 VK_FORMAT_S8_UINT = 127,
672 VK_FORMAT_D16_UNORM_S8_UINT = 128,
673 VK_FORMAT_D24_UNORM_S8_UINT = 129,
674 VK_FORMAT_D32_SFLOAT_S8_UINT = 130,
675 VK_FORMAT_BC1_RGB_UNORM_BLOCK = 131,
676 VK_FORMAT_BC1_RGB_SRGB_BLOCK = 132,
677 VK_FORMAT_BC1_RGBA_UNORM_BLOCK = 133,
678 VK_FORMAT_BC1_RGBA_SRGB_BLOCK = 134,
679 VK_FORMAT_BC2_UNORM_BLOCK = 135,
680 VK_FORMAT_BC2_SRGB_BLOCK = 136,
681 VK_FORMAT_BC3_UNORM_BLOCK = 137,
682 VK_FORMAT_BC3_SRGB_BLOCK = 138,
683 VK_FORMAT_BC4_UNORM_BLOCK = 139,
684 VK_FORMAT_BC4_SNORM_BLOCK = 140,
685 VK_FORMAT_BC5_UNORM_BLOCK = 141,
686 VK_FORMAT_BC5_SNORM_BLOCK = 142,
687 VK_FORMAT_BC6H_UFLOAT_BLOCK = 143,
688 VK_FORMAT_BC6H_SFLOAT_BLOCK = 144,
689 VK_FORMAT_BC7_UNORM_BLOCK = 145,
690 VK_FORMAT_BC7_SRGB_BLOCK = 146,
691 VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK = 147,
692 VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK = 148,
693 VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK = 149,
694 VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK = 150,
695 VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK = 151,
696 VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK = 152,
697 VK_FORMAT_EAC_R11_UNORM_BLOCK = 153,
698 VK_FORMAT_EAC_R11_SNORM_BLOCK = 154,
699 VK_FORMAT_EAC_R11G11_UNORM_BLOCK = 155,
700 VK_FORMAT_EAC_R11G11_SNORM_BLOCK = 156,
701 VK_FORMAT_ASTC_4x4_UNORM_BLOCK = 157,
702 VK_FORMAT_ASTC_4x4_SRGB_BLOCK = 158,
703 VK_FORMAT_ASTC_5x4_UNORM_BLOCK = 159,
704 VK_FORMAT_ASTC_5x4_SRGB_BLOCK = 160,
705 VK_FORMAT_ASTC_5x5_UNORM_BLOCK = 161,
706 VK_FORMAT_ASTC_5x5_SRGB_BLOCK = 162,
707 VK_FORMAT_ASTC_6x5_UNORM_BLOCK = 163,
708 VK_FORMAT_ASTC_6x5_SRGB_BLOCK = 164,
709 VK_FORMAT_ASTC_6x6_UNORM_BLOCK = 165,
710 VK_FORMAT_ASTC_6x6_SRGB_BLOCK = 166,
711 VK_FORMAT_ASTC_8x5_UNORM_BLOCK = 167,
712 VK_FORMAT_ASTC_8x5_SRGB_BLOCK = 168,
713 VK_FORMAT_ASTC_8x6_UNORM_BLOCK = 169,
714 VK_FORMAT_ASTC_8x6_SRGB_BLOCK = 170,
715 VK_FORMAT_ASTC_8x8_UNORM_BLOCK = 171,
716 VK_FORMAT_ASTC_8x8_SRGB_BLOCK = 172,
717 VK_FORMAT_ASTC_10x5_UNORM_BLOCK = 173,
718 VK_FORMAT_ASTC_10x5_SRGB_BLOCK = 174,
719 VK_FORMAT_ASTC_10x6_UNORM_BLOCK = 175,
720 VK_FORMAT_ASTC_10x6_SRGB_BLOCK = 176,
721 VK_FORMAT_ASTC_10x8_UNORM_BLOCK = 177,
722 VK_FORMAT_ASTC_10x8_SRGB_BLOCK = 178,
723 VK_FORMAT_ASTC_10x10_UNORM_BLOCK = 179,
724 VK_FORMAT_ASTC_10x10_SRGB_BLOCK = 180,
725 VK_FORMAT_ASTC_12x10_UNORM_BLOCK = 181,
726 VK_FORMAT_ASTC_12x10_SRGB_BLOCK = 182,
727 VK_FORMAT_ASTC_12x12_UNORM_BLOCK = 183,
728 VK_FORMAT_ASTC_12x12_SRGB_BLOCK = 184,
Chris Forbes289cb792016-12-30 15:03:55 +1300729
730 //@extension("VK_IMG_format_pvrtc")
Jesse Halleb02c472017-02-24 15:13:45 -0800731 VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG = 1000054000,
732 VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG = 1000054001,
733 VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG = 1000054002,
734 VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG = 1000054003,
735 VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG = 1000054004,
736 VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG = 1000054005,
737 VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG = 1000054006,
738 VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG = 1000054007,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700739}
740
Jesse Halld27f6aa2015-08-15 17:58:48 -0700741/// Structure type enumerant
742enum VkStructureType {
743 VK_STRUCTURE_TYPE_APPLICATION_INFO = 0,
Jesse Hallc7467b72015-11-29 21:05:26 -0800744 VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO = 1,
745 VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO = 2,
746 VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO = 3,
747 VK_STRUCTURE_TYPE_SUBMIT_INFO = 4,
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800748 VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO = 5,
Jesse Hallc7467b72015-11-29 21:05:26 -0800749 VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE = 6,
750 VK_STRUCTURE_TYPE_BIND_SPARSE_INFO = 7,
751 VK_STRUCTURE_TYPE_FENCE_CREATE_INFO = 8,
752 VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO = 9,
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700753 VK_STRUCTURE_TYPE_EVENT_CREATE_INFO = 10,
Jesse Hallc7467b72015-11-29 21:05:26 -0800754 VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO = 11,
755 VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO = 12,
756 VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO = 13,
757 VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO = 14,
758 VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO = 15,
759 VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO = 16,
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800760 VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO = 17,
761 VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO = 18,
762 VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO = 19,
763 VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO = 20,
764 VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO = 21,
765 VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO = 22,
766 VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO = 23,
767 VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO = 24,
768 VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO = 25,
769 VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO = 26,
770 VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO = 27,
771 VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO = 28,
772 VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO = 29,
773 VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO = 30,
774 VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO = 31,
775 VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO = 32,
776 VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO = 33,
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800777 VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO = 34,
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800778 VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET = 35,
779 VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET = 36,
780 VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO = 37,
781 VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO = 38,
782 VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO = 39,
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800783 VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO = 40,
Jesse Hall3dd678a2016-01-08 21:52:01 -0800784 VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO = 41,
785 VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO = 42,
786 VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO = 43,
787 VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER = 44,
788 VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER = 45,
789 VK_STRUCTURE_TYPE_MEMORY_BARRIER = 46,
790 VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO = 47,
791 VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO = 48,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800792
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800793 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800794 VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR = 1000001000,
795 VK_STRUCTURE_TYPE_PRESENT_INFO_KHR = 1000001001,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800796
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800797 //@extension("VK_KHR_display")
Jesse Hallbd888842015-11-30 21:44:14 -0800798 VK_STRUCTURE_TYPE_DISPLAY_MODE_CREATE_INFO_KHR = 1000002000,
799 VK_STRUCTURE_TYPE_DISPLAY_SURFACE_CREATE_INFO_KHR = 1000002001,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800800
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800801 //@extension("VK_KHR_display_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800802 VK_STRUCTURE_TYPE_DISPLAY_DISPLAY_PRESENT_INFO_KHR = 1000003000,
Jesse Hallf9fa9a52016-01-08 16:08:51 -0800803
804 //@extension("VK_KHR_xlib_surface")
805 VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR = 1000004000,
806
807 //@extension("VK_KHR_xcb_surface")
808 VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR = 1000005000,
809
810 //@extension("VK_KHR_wayland_surface")
811 VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR = 1000006000,
812
813 //@extension("VK_KHR_mir_surface")
814 VK_STRUCTURE_TYPE_MIR_SURFACE_CREATE_INFO_KHR = 1000007000,
815
816 //@extension("VK_KHR_android_surface")
817 VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR = 1000008000,
818
819 //@extension("VK_KHR_win32_surface")
820 VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR = 1000009000,
Jesse Hall543a7ff2016-01-08 16:38:30 -0800821
Ian Elliott948233a2017-01-06 12:13:23 -0700822 //@extension("VK_KHR_incremental_present")
823 VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR = 1000084000,
824
Chia-I Wub262ddc2016-03-22 07:38:20 +0800825 //@extension("VK_ANDROID_native_buffer")
826 VK_STRUCTURE_TYPE_NATIVE_BUFFER_ANDROID = 1000010000,
Chris Forbes8e4438b2016-12-07 16:26:49 +1300827 VK_STRUCTURE_TYPE_SWAPCHAIN_IMAGE_CREATE_INFO_ANDROID = 1000010001,
Chris Forbes1d4e5542017-02-15 19:38:50 +1300828 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENTATION_PROPERTIES_ANDROID = 1000010002,
Chia-I Wub262ddc2016-03-22 07:38:20 +0800829
Ian Elliott4c8bb2a2016-12-29 11:07:26 -0700830 //@extension("VK_GOOGLE_display_timing")
Ian Elliott14866bb2017-01-20 09:15:48 -0700831 VK_STRUCTURE_TYPE_PRESENT_TIMES_INFO_GOOGLE = 1000092000,
Ian Elliott4c8bb2a2016-12-29 11:07:26 -0700832
Jesse Hall543a7ff2016-01-08 16:38:30 -0800833 //@extension("VK_EXT_debug_report")
Jesse Hall26763382016-05-20 07:13:52 -0700834 VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT = 1000011000,
835
836 //@extension("VK_AMD_rasterization_order")
837 VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD = 1000018000,
838
839 //@extension("VK_EXT_debug_marker")
840 VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_NAME_INFO_EXT = 1000022000,
Jesse Hall26763382016-05-20 07:13:52 -0700841 VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_TAG_INFO_EXT = 1000022001,
Jesse Hall26763382016-05-20 07:13:52 -0700842 VK_STRUCTURE_TYPE_DEBUG_MARKER_MARKER_INFO_EXT = 1000022002,
Jesse Hall56d386a2016-07-26 15:20:40 -0700843
844 //@extension("VK_NV_dedicated_allocation")
845 VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV = 1000026000,
Jesse Hall56d386a2016-07-26 15:20:40 -0700846 VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV = 1000026001,
Jesse Hall56d386a2016-07-26 15:20:40 -0700847 VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV = 1000026002,
Chris Forbes289cb792016-12-30 15:03:55 +1300848
849 //@extension("VK_NV_external_memory")
Jesse Halleb02c472017-02-24 15:13:45 -0800850 VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_NV = 1000056000,
851 VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_NV = 1000056001,
Chris Forbes289cb792016-12-30 15:03:55 +1300852
853 //@extension("VK_NV_external_memory_win32")
Jesse Halleb02c472017-02-24 15:13:45 -0800854 VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_NV = 1000057000,
855 VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_NV = 1000057001,
Chris Forbes289cb792016-12-30 15:03:55 +1300856
857 //@extension("VK_NV_win32_keyed_mutex")
858 VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_NV = 1000058000,
859
Chris Forbes1194ede2016-12-30 16:29:25 +1300860 //@extension("VK_KHR_get_physical_device_properties2")
Jesse Hall889cd9a2017-02-25 22:12:23 -0800861 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR = 1000059000,
862 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR = 1000059001,
863 VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2_KHR = 1000059002,
864 VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2_KHR = 1000059003,
865 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2_KHR = 1000059004,
866 VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2_KHR = 1000059005,
867 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2_KHR = 1000059006,
868 VK_STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2_KHR = 1000059007,
Chris Forbes1194ede2016-12-30 16:29:25 +1300869 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2_KHR = 1000059008,
870
Chris Forbes289cb792016-12-30 15:03:55 +1300871 //@extension("VK_EXT_validation_flags")
Jesse Halleb02c472017-02-24 15:13:45 -0800872 VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT = 1000061000,
Chris Forbes289cb792016-12-30 15:03:55 +1300873
Jesse Hall77ad05b2017-03-10 22:02:20 -0800874 //@extension("VK_NN_vi_surface")
875 VK_STRUCTURE_TYPE_VI_SURFACE_CREATE_INFO_NN = 1000062000,
876
Chris Forbes289cb792016-12-30 15:03:55 +1300877 //@extension("VK_KHR_incremental_present")
Jesse Hall889cd9a2017-02-25 22:12:23 -0800878 VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR = 1000084000,
Chris Forbes289cb792016-12-30 15:03:55 +1300879
880 //@extension("VK_NVX_device_generated_commands")
Jesse Halleb02c472017-02-24 15:13:45 -0800881 VK_STRUCTURE_TYPE_OBJECT_TABLE_CREATE_INFO_NVX = 1000086000,
882 VK_STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_CREATE_INFO_NVX = 1000086001,
883 VK_STRUCTURE_TYPE_CMD_PROCESS_COMMANDS_INFO_NVX = 1000086002,
884 VK_STRUCTURE_TYPE_CMD_RESERVE_SPACE_FOR_COMMANDS_INFO_NVX = 1000086003,
885 VK_STRUCTURE_TYPE_DEVICE_GENERATED_COMMANDS_LIMITS_NVX = 1000086004,
886 VK_STRUCTURE_TYPE_DEVICE_GENERATED_COMMANDS_FEATURES_NVX = 1000086005,
Jesse Hall77ad05b2017-03-10 22:02:20 -0800887
888 //@extension("VK_EXT_display_surface_counter")
889 VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES2_EXT = 1000090000,
890
891 //@extension("VK_EXT_display_control")
892 VK_STRUCTURE_TYPE_DISPLAY_POWER_INFO_EXT = 1000091000,
893 VK_STRUCTURE_TYPE_DEVICE_EVENT_INFO_EXT = 1000091001,
894 VK_STRUCTURE_TYPE_DISPLAY_EVENT_INFO_EXT = 1000091002,
895 VK_STRUCTURE_TYPE_SWAPCHAIN_COUNTER_CREATE_INFO_EXT = 1000091003,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700896}
897
Jesse Hall65ab5522015-11-30 00:07:16 -0800898enum VkSubpassContents {
899 VK_SUBPASS_CONTENTS_INLINE = 0x00000000,
900 VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700901}
902
Jesse Hall543a7ff2016-01-08 16:38:30 -0800903enum VkPipelineCacheHeaderVersion {
904 VK_PIPELINE_CACHE_HEADER_VERSION_ONE = 1,
905}
906
Jesse Hallbd888842015-11-30 21:44:14 -0800907@lastUnused(-11)
Jesse Halld27f6aa2015-08-15 17:58:48 -0700908/// Error and return codes
909enum VkResult {
910 // Return codes for successful operation execution (positive values)
Jesse Hallbd888842015-11-30 21:44:14 -0800911 VK_SUCCESS = 0,
912 VK_NOT_READY = 1,
913 VK_TIMEOUT = 2,
914 VK_EVENT_SET = 3,
915 VK_EVENT_RESET = 4,
916 VK_INCOMPLETE = 5,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700917
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800918 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800919 VK_SUBOPTIMAL_KHR = 1000001003,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800920
Jesse Halld27f6aa2015-08-15 17:58:48 -0700921 // Error codes (negative values)
Jesse Hallbd888842015-11-30 21:44:14 -0800922 VK_ERROR_OUT_OF_HOST_MEMORY = 0xFFFFFFFF, // -1
923 VK_ERROR_OUT_OF_DEVICE_MEMORY = 0xFFFFFFFE, // -2
924 VK_ERROR_INITIALIZATION_FAILED = 0xFFFFFFFD, // -3
925 VK_ERROR_DEVICE_LOST = 0xFFFFFFFC, // -4
926 VK_ERROR_MEMORY_MAP_FAILED = 0xFFFFFFFB, // -5
927 VK_ERROR_LAYER_NOT_PRESENT = 0xFFFFFFFA, // -6
928 VK_ERROR_EXTENSION_NOT_PRESENT = 0xFFFFFFF9, // -7
929 VK_ERROR_FEATURE_NOT_PRESENT = 0xFFFFFFF8, // -8
930 VK_ERROR_INCOMPATIBLE_DRIVER = 0xFFFFFFF7, // -9
931 VK_ERROR_TOO_MANY_OBJECTS = 0xFFFFFFF6, // -10
932 VK_ERROR_FORMAT_NOT_SUPPORTED = 0xFFFFFFF5, // -11
Jesse Hall56d386a2016-07-26 15:20:40 -0700933 VK_ERROR_FRAGMENTED_POOL = 0xFFFFFFF4, // -12
Jesse Hall1356b0d2015-11-23 17:24:58 -0800934
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800935 //@extension("VK_KHR_surface")
Jesse Hallbd888842015-11-30 21:44:14 -0800936 VK_ERROR_SURFACE_LOST_KHR = 0xC4653600, // -1000000000
Jesse Halla6429252015-11-29 18:59:42 -0800937
Jesse Hall563380d2016-01-15 23:14:05 -0800938 //@extension("VK_KHR_surface")
939 VK_ERROR_NATIVE_WINDOW_IN_USE_KHR = 0xC46535FF, // -1000008001
940
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800941 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800942 VK_ERROR_OUT_OF_DATE_KHR = 0xC4653214, // -1000001004
Jesse Hall1356b0d2015-11-23 17:24:58 -0800943
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800944 //@extension("VK_KHR_display_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800945 VK_ERROR_INCOMPATIBLE_DISPLAY_KHR = 0xC4652A47, // -1000003001
Jesse Hall1356b0d2015-11-23 17:24:58 -0800946
Jesse Hall543a7ff2016-01-08 16:38:30 -0800947 //@extension("VK_EXT_debug_report")
948 VK_ERROR_VALIDATION_FAILED_EXT = 0xC4650B07, // -1000011001
Jesse Hall26763382016-05-20 07:13:52 -0700949
950 //@extension("VK_NV_glsl_shader")
951 VK_ERROR_INVALID_SHADER_NV = 0xC4650720, // -1000012000
Jesse Hall77ad05b2017-03-10 22:02:20 -0800952
953 //@extension("VK_KHR_maintenance1")
954 VK_ERROR_OUT_OF_POOL_MEMORY_KHR = 0xC4642878, // -1000069000
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700955}
956
957enum VkDynamicState {
958 VK_DYNAMIC_STATE_VIEWPORT = 0x00000000,
959 VK_DYNAMIC_STATE_SCISSOR = 0x00000001,
960 VK_DYNAMIC_STATE_LINE_WIDTH = 0x00000002,
961 VK_DYNAMIC_STATE_DEPTH_BIAS = 0x00000003,
962 VK_DYNAMIC_STATE_BLEND_CONSTANTS = 0x00000004,
963 VK_DYNAMIC_STATE_DEPTH_BOUNDS = 0x00000005,
964 VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK = 0x00000006,
965 VK_DYNAMIC_STATE_STENCIL_WRITE_MASK = 0x00000007,
966 VK_DYNAMIC_STATE_STENCIL_REFERENCE = 0x00000008,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700967}
968
Jesse Hall523db342015-11-30 21:12:55 -0800969@extension("VK_KHR_surface")
Michael Lentine88594d72015-11-12 12:49:45 -0800970enum VkPresentModeKHR {
971 VK_PRESENT_MODE_IMMEDIATE_KHR = 0x00000000,
972 VK_PRESENT_MODE_MAILBOX_KHR = 0x00000001,
973 VK_PRESENT_MODE_FIFO_KHR = 0x00000002,
Jesse Hall03b6fe12015-11-24 12:44:21 -0800974 VK_PRESENT_MODE_FIFO_RELAXED_KHR = 0x00000003,
Jesse Hall77ad05b2017-03-10 22:02:20 -0800975
Chris Forbes1d5f68c2017-01-31 10:17:01 +1300976 //@extension("VK_KHR_shared_presentable_image")
Jesse Hall77ad05b2017-03-10 22:02:20 -0800977 VK_PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR = 1000111000,
978 VK_PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR = 1000111001,
Michael Lentine88594d72015-11-12 12:49:45 -0800979}
980
Jesse Hall523db342015-11-30 21:12:55 -0800981@extension("VK_KHR_surface")
Michael Lentine88594d72015-11-12 12:49:45 -0800982enum VkColorSpaceKHR {
983 VK_COLORSPACE_SRGB_NONLINEAR_KHR = 0x00000000,
Jesse Hall77ad05b2017-03-10 22:02:20 -0800984
985 //@extension("VK_EXT_swapchain_colorspace")
Jesse Hall889cd9a2017-02-25 22:12:23 -0800986 VK_COLOR_SPACE_DISPLAY_P3_LINEAR_EXT = 1000104001,
Courtney Goeltzenleuchter7f558ed2017-01-23 17:15:24 -0700987 VK_COLOR_SPACE_DISPLAY_P3_NONLINEAR_EXT = 1000104002,
988 VK_COLOR_SPACE_SCRGB_LINEAR_EXT = 1000104003,
989 VK_COLOR_SPACE_SCRGB_NONLINEAR_EXT = 1000104004,
990 VK_COLOR_SPACE_DCI_P3_LINEAR_EXT = 1000104005,
991 VK_COLOR_SPACE_DCI_P3_NONLINEAR_EXT = 1000104006,
992 VK_COLOR_SPACE_BT709_LINEAR_EXT = 1000104007,
993 VK_COLOR_SPACE_BT709_NONLINEAR_EXT = 1000104008,
994 VK_COLOR_SPACE_BT2020_LINEAR_EXT = 1000104009,
995 VK_COLOR_SPACE_BT2020_NONLINEAR_EXT = 1000104010,
996 VK_COLOR_SPACE_ADOBERGB_LINEAR_EXT = 1000104011,
997 VK_COLOR_SPACE_ADOBERGB_NONLINEAR_EXT = 1000104012,
Michael Lentine88594d72015-11-12 12:49:45 -0800998}
Jesse Halld27f6aa2015-08-15 17:58:48 -0700999
Jesse Hall715b86a2016-01-16 16:34:29 -08001000@extension("VK_EXT_debug_report")
1001enum VkDebugReportObjectTypeEXT {
1002 VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT = 0,
1003 VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT = 1,
1004 VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT = 2,
1005 VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT = 3,
1006 VK_DEBUG_REPORT_OBJECT_TYPE_QUEUE_EXT = 4,
1007 VK_DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT = 5,
1008 VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT = 6,
1009 VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT = 7,
1010 VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT = 8,
1011 VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT = 9,
1012 VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT = 10,
1013 VK_DEBUG_REPORT_OBJECT_TYPE_EVENT_EXT = 11,
1014 VK_DEBUG_REPORT_OBJECT_TYPE_QUERY_POOL_EXT = 12,
1015 VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_VIEW_EXT = 13,
1016 VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_VIEW_EXT = 14,
1017 VK_DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT = 15,
1018 VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_CACHE_EXT = 16,
1019 VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_LAYOUT_EXT = 17,
1020 VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT = 18,
1021 VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT = 19,
1022 VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT_EXT = 20,
1023 VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_EXT = 21,
1024 VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT = 22,
1025 VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT = 23,
1026 VK_DEBUG_REPORT_OBJECT_TYPE_FRAMEBUFFER_EXT = 24,
1027 VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_POOL_EXT = 25,
1028 VK_DEBUG_REPORT_OBJECT_TYPE_SURFACE_KHR_EXT = 26,
1029 VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT = 27,
1030 VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_EXT = 28,
Chris Forbes289cb792016-12-30 15:03:55 +13001031 VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_KHR_EXT = 29,
1032 VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_MODE_KHR_EXT = 30,
1033 VK_DEBUG_REPORT_OBJECT_TYPE_OBJECT_TABLE_NVX_EXT = 31,
1034 VK_DEBUG_REPORT_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NVX_EXT = 32,
Jesse Hall715b86a2016-01-16 16:34:29 -08001035}
1036
1037@extension("VK_EXT_debug_report")
1038enum VkDebugReportErrorEXT {
1039 VK_DEBUG_REPORT_ERROR_NONE_EXT = 0,
1040 VK_DEBUG_REPORT_ERROR_CALLBACK_REF_EXT = 1,
1041}
1042
Jesse Hall26763382016-05-20 07:13:52 -07001043@extension("VK_AMD_rasterization_order")
1044enum VkRasterizationOrderAMD {
1045 VK_RASTERIZATION_ORDER_STRICT_AMD = 0,
1046 VK_RASTERIZATION_ORDER_RELAXED_AMD = 1,
1047}
1048
Chris Forbes289cb792016-12-30 15:03:55 +13001049@extension("VK_EXT_validation_flags")
1050enum VkValidationCheckEXT {
1051 VK_VALIDATION_CHECK_ALL_EXT = 0,
1052}
1053
1054@extension("VK_NVX_device_generated_commands")
1055enum VkIndirectCommandsTokenTypeNVX {
Jesse Halleb02c472017-02-24 15:13:45 -08001056 VK_INDIRECT_COMMANDS_TOKEN_PIPELINE_NVX = 0,
1057 VK_INDIRECT_COMMANDS_TOKEN_DESCRIPTOR_SET_NVX = 1,
1058 VK_INDIRECT_COMMANDS_TOKEN_INDEX_BUFFER_NVX = 2,
1059 VK_INDIRECT_COMMANDS_TOKEN_VERTEX_BUFFER_NVX = 3,
1060 VK_INDIRECT_COMMANDS_TOKEN_PUSH_CONSTANT_NVX = 4,
1061 VK_INDIRECT_COMMANDS_TOKEN_DRAW_INDEXED_NVX = 5,
1062 VK_INDIRECT_COMMANDS_TOKEN_DRAW_NVX = 6,
1063 VK_INDIRECT_COMMANDS_TOKEN_DISPATCH_NVX = 7,
Chris Forbes289cb792016-12-30 15:03:55 +13001064}
1065
1066@extension("VK_NVX_device_generated_commands")
1067enum VkObjectEntryTypeNVX {
Jesse Halleb02c472017-02-24 15:13:45 -08001068 VK_OBJECT_ENTRY_DESCRIPTOR_SET_NVX = 0,
1069 VK_OBJECT_ENTRY_PIPELINE_NVX = 1,
1070 VK_OBJECT_ENTRY_INDEX_BUFFER_NVX = 2,
1071 VK_OBJECT_ENTRY_VERTEX_BUFFER_NVX = 3,
1072 VK_OBJECT_ENTRY_PUSH_CONSTANT_NVX = 4,
Chris Forbes289cb792016-12-30 15:03:55 +13001073}
Jesse Hall715b86a2016-01-16 16:34:29 -08001074
Jesse Hall77ad05b2017-03-10 22:02:20 -08001075@extension("VK_EXT_display_control")
1076enum VkDisplayPowerStateEXT {
1077 VK_DISPLAY_POWER_STATE_OFF_EXT = 0,
1078 VK_DISPLAY_POWER_STATE_SUSPEND_EXT = 1,
1079 VK_DISPLAY_POWER_STATE_ON_EXT = 2,
1080}
1081
1082@extension("VK_EXT_display_control")
1083enum VkDeviceEventTypeEXT {
1084 VK_DEVICE_EVENT_TYPE_DISPLAY_HOTPLUG_EXT = 0,
1085}
1086
1087@extension("VK_EXT_display_control")
1088enum VkDisplayEventTypeEXT {
1089 VK_DISPLAY_EVENT_TYPE_FIRST_PIXEL_OUT_EXT = 0,
1090}
1091
Jesse Halld27f6aa2015-08-15 17:58:48 -07001092/////////////////
1093// Bitfields //
1094/////////////////
1095
Jesse Halld27f6aa2015-08-15 17:58:48 -07001096/// Queue capabilities
Jesse Halld8bade02015-11-24 10:24:18 -08001097type VkFlags VkQueueFlags
1098bitfield VkQueueFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001099 VK_QUEUE_GRAPHICS_BIT = 0x00000001, /// Queue supports graphics operations
1100 VK_QUEUE_COMPUTE_BIT = 0x00000002, /// Queue supports compute operations
Jesse Hall65ab5522015-11-30 00:07:16 -08001101 VK_QUEUE_TRANSFER_BIT = 0x00000004, /// Queue supports transfer operations
Jesse Hallb00daad2015-11-29 19:46:20 -08001102 VK_QUEUE_SPARSE_BINDING_BIT = 0x00000008, /// Queue supports sparse resource memory management operations
Jesse Halld27f6aa2015-08-15 17:58:48 -07001103}
1104
1105/// Memory properties passed into vkAllocMemory().
Jesse Halld8bade02015-11-24 10:24:18 -08001106type VkFlags VkMemoryPropertyFlags
1107bitfield VkMemoryPropertyFlagBits {
Jesse Halld1af8122015-11-29 23:50:38 -08001108 VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT = 0x00000001,
1109 VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT = 0x00000002,
1110 VK_MEMORY_PROPERTY_HOST_COHERENT_BIT = 0x00000004,
1111 VK_MEMORY_PROPERTY_HOST_CACHED_BIT = 0x00000008,
1112 VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT = 0x00000010,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001113}
1114
1115/// Memory heap flags
Jesse Halld8bade02015-11-24 10:24:18 -08001116type VkFlags VkMemoryHeapFlags
1117bitfield VkMemoryHeapFlagBits {
Jesse Halld1af8122015-11-29 23:50:38 -08001118 VK_MEMORY_HEAP_DEVICE_LOCAL_BIT = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001119}
1120
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001121/// Access flags
1122type VkFlags VkAccessFlags
1123bitfield VkAccessFlagBits {
1124 VK_ACCESS_INDIRECT_COMMAND_READ_BIT = 0x00000001,
1125 VK_ACCESS_INDEX_READ_BIT = 0x00000002,
1126 VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT = 0x00000004,
1127 VK_ACCESS_UNIFORM_READ_BIT = 0x00000008,
1128 VK_ACCESS_INPUT_ATTACHMENT_READ_BIT = 0x00000010,
1129 VK_ACCESS_SHADER_READ_BIT = 0x00000020,
1130 VK_ACCESS_SHADER_WRITE_BIT = 0x00000040,
1131 VK_ACCESS_COLOR_ATTACHMENT_READ_BIT = 0x00000080,
1132 VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT = 0x00000100,
1133 VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT = 0x00000200,
1134 VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT = 0x00000400,
1135 VK_ACCESS_TRANSFER_READ_BIT = 0x00000800,
1136 VK_ACCESS_TRANSFER_WRITE_BIT = 0x00001000,
1137 VK_ACCESS_HOST_READ_BIT = 0x00002000,
1138 VK_ACCESS_HOST_WRITE_BIT = 0x00004000,
1139 VK_ACCESS_MEMORY_READ_BIT = 0x00008000,
1140 VK_ACCESS_MEMORY_WRITE_BIT = 0x00010000,
Chris Forbes289cb792016-12-30 15:03:55 +13001141
1142 //@extension("VK_NVX_device_generated_commands")
1143 VK_ACCESS_COMMAND_PROCESS_READ_BIT_NVX = 0x00020000,
Chris Forbes289cb792016-12-30 15:03:55 +13001144 VK_ACCESS_COMMAND_PROCESS_WRITE_BIT_NVX = 0x00040000,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001145}
1146
1147/// Buffer usage flags
Jesse Halld8bade02015-11-24 10:24:18 -08001148type VkFlags VkBufferUsageFlags
1149bitfield VkBufferUsageFlagBits {
Jesse Hall3fbc8562015-11-29 22:10:52 -08001150 VK_BUFFER_USAGE_TRANSFER_SRC_BIT = 0x00000001, /// Can be used as a source of transfer operations
1151 VK_BUFFER_USAGE_TRANSFER_DST_BIT = 0x00000002, /// Can be used as a destination of transfer operations
Jesse Halld27f6aa2015-08-15 17:58:48 -07001152 VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000004, /// Can be used as TBO
1153 VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT = 0x00000008, /// Can be used as IBO
1154 VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT = 0x00000010, /// Can be used as UBO
1155 VK_BUFFER_USAGE_STORAGE_BUFFER_BIT = 0x00000020, /// Can be used as SSBO
1156 VK_BUFFER_USAGE_INDEX_BUFFER_BIT = 0x00000040, /// Can be used as source of fixed function index fetch (index buffer)
1157 VK_BUFFER_USAGE_VERTEX_BUFFER_BIT = 0x00000080, /// Can be used as source of fixed function vertex fetch (VBO)
1158 VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT = 0x00000100, /// Can be the source of indirect parameters (e.g. indirect buffer, parameter buffer)
1159}
1160
1161/// Buffer creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001162type VkFlags VkBufferCreateFlags
1163bitfield VkBufferCreateFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001164 VK_BUFFER_CREATE_SPARSE_BINDING_BIT = 0x00000001, /// Buffer should support sparse backing
Jesse Halld27f6aa2015-08-15 17:58:48 -07001165 VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002, /// Buffer should support sparse backing with partial residency
1166 VK_BUFFER_CREATE_SPARSE_ALIASED_BIT = 0x00000004, /// Buffer should support constent data access to physical memory blocks mapped into multiple locations of sparse buffers
1167}
1168
1169/// Shader stage flags
Jesse Halld8bade02015-11-24 10:24:18 -08001170type VkFlags VkShaderStageFlags
1171bitfield VkShaderStageFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001172 VK_SHADER_STAGE_VERTEX_BIT = 0x00000001,
Jesse Hallae38f732015-11-19 21:32:50 -08001173 VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT = 0x00000002,
1174 VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001175 VK_SHADER_STAGE_GEOMETRY_BIT = 0x00000008,
1176 VK_SHADER_STAGE_FRAGMENT_BIT = 0x00000010,
1177 VK_SHADER_STAGE_COMPUTE_BIT = 0x00000020,
Jesse Hallc7467b72015-11-29 21:05:26 -08001178 VK_SHADER_STAGE_ALL_GRAPHICS = 0x0000001F,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001179
1180 VK_SHADER_STAGE_ALL = 0x7FFFFFFF,
1181}
1182
Jesse Hallfbf97b02015-11-20 14:17:03 -08001183/// Descriptor pool create flags
Jesse Halld8bade02015-11-24 10:24:18 -08001184type VkFlags VkDescriptorPoolCreateFlags
1185bitfield VkDescriptorPoolCreateFlagBits {
Jesse Hallfbf97b02015-11-20 14:17:03 -08001186 VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT = 0x00000001,
1187}
1188
1189/// Descriptor pool reset flags
Jesse Halld8bade02015-11-24 10:24:18 -08001190type VkFlags VkDescriptorPoolResetFlags
Jesse Halla6429252015-11-29 18:59:42 -08001191//bitfield VkDescriptorPoolResetFlagBits {
1192//}
Jesse Hallfbf97b02015-11-20 14:17:03 -08001193
Jesse Halld27f6aa2015-08-15 17:58:48 -07001194/// Image usage flags
Jesse Halld8bade02015-11-24 10:24:18 -08001195type VkFlags VkImageUsageFlags
1196bitfield VkImageUsageFlagBits {
Jesse Hall3fbc8562015-11-29 22:10:52 -08001197 VK_IMAGE_USAGE_TRANSFER_SRC_BIT = 0x00000001, /// Can be used as a source of transfer operations
1198 VK_IMAGE_USAGE_TRANSFER_DST_BIT = 0x00000002, /// Can be used as a destination of transfer operations
Jesse Halld27f6aa2015-08-15 17:58:48 -07001199 VK_IMAGE_USAGE_SAMPLED_BIT = 0x00000004, /// Can be sampled from (SAMPLED_IMAGE and COMBINED_IMAGE_SAMPLER descriptor types)
1200 VK_IMAGE_USAGE_STORAGE_BIT = 0x00000008, /// Can be used as storage image (STORAGE_IMAGE descriptor type)
1201 VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT = 0x00000010, /// Can be used as framebuffer color attachment
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001202 VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000020, /// Can be used as framebuffer depth/stencil attachment
Jesse Halld27f6aa2015-08-15 17:58:48 -07001203 VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT = 0x00000040, /// Image data not needed outside of rendering
1204 VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT = 0x00000080, /// Can be used as framebuffer input attachment
1205}
1206
1207/// Image creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001208type VkFlags VkImageCreateFlags
1209bitfield VkImageCreateFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001210 VK_IMAGE_CREATE_SPARSE_BINDING_BIT = 0x00000001, /// Image should support sparse backing
Jesse Halld27f6aa2015-08-15 17:58:48 -07001211 VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002, /// Image should support sparse backing with partial residency
1212 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 -07001213 VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT = 0x00000008, /// Allows image views to have different format than the base image
1214 VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT = 0x00000010, /// Allows creating image views with cube type from the created image
Jesse Hall77ad05b2017-03-10 22:02:20 -08001215
1216 //@extension("VK_KHR_maintenance1")
1217 VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT_KHR = 0x00000020,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001218}
1219
Jesse Hallb00daad2015-11-29 19:46:20 -08001220/// Image view creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001221type VkFlags VkImageViewCreateFlags
Jesse Hallb00daad2015-11-29 19:46:20 -08001222//bitfield VkImageViewCreateFlagBits {
1223//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001224
1225/// Pipeline creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001226type VkFlags VkPipelineCreateFlags
1227bitfield VkPipelineCreateFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001228 VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT = 0x00000001,
1229 VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT = 0x00000002,
1230 VK_PIPELINE_CREATE_DERIVATIVE_BIT = 0x00000004,
1231}
1232
Jesse Hall65ab5522015-11-30 00:07:16 -08001233/// Color component flags
1234type VkFlags VkColorComponentFlags
1235bitfield VkColorComponentFlagBits {
1236 VK_COLOR_COMPONENT_R_BIT = 0x00000001,
1237 VK_COLOR_COMPONENT_G_BIT = 0x00000002,
1238 VK_COLOR_COMPONENT_B_BIT = 0x00000004,
1239 VK_COLOR_COMPONENT_A_BIT = 0x00000008,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001240}
1241
1242/// Fence creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001243type VkFlags VkFenceCreateFlags
1244bitfield VkFenceCreateFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001245 VK_FENCE_CREATE_SIGNALED_BIT = 0x00000001,
1246}
1247
1248/// Semaphore creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001249type VkFlags VkSemaphoreCreateFlags
Jesse Halla6429252015-11-29 18:59:42 -08001250//bitfield VkSemaphoreCreateFlagBits {
1251//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001252
1253/// Format capability flags
Jesse Halld8bade02015-11-24 10:24:18 -08001254type VkFlags VkFormatFeatureFlags
1255bitfield VkFormatFeatureFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001256 VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT = 0x00000001, /// Format can be used for sampled images (SAMPLED_IMAGE and COMBINED_IMAGE_SAMPLER descriptor types)
1257 VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT = 0x00000002, /// Format can be used for storage images (STORAGE_IMAGE descriptor type)
1258 VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT = 0x00000004, /// Format supports atomic operations in case it's used for storage images
1259 VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000008, /// Format can be used for uniform texel buffers (TBOs)
1260 VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT = 0x00000010, /// Format can be used for storage texel buffers (IBOs)
1261 VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT = 0x00000020, /// Format supports atomic operations in case it's used for storage texel buffers
1262 VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT = 0x00000040, /// Format can be used for vertex buffers (VBOs)
1263 VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT = 0x00000080, /// Format can be used for color attachment images
1264 VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT = 0x00000100, /// Format supports blending in case it's used for color attachment images
1265 VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000200, /// Format can be used for depth/stencil attachment images
Jesse Hall3fbc8562015-11-29 22:10:52 -08001266 VK_FORMAT_FEATURE_BLIT_SRC_BIT = 0x00000400, /// Format can be used as the source image of blits with vkCommandBlitImage
1267 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 -08001268 VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT = 0x00001000,
Jesse Hall26763382016-05-20 07:13:52 -07001269
1270 //@extension("VK_IMG_filter_cubic")
1271 VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG = 0x00002000,
Jesse Hall77ad05b2017-03-10 22:02:20 -08001272
1273 //@extension("VK_KHR_maintenance1")
1274 VK_FORMAT_FEATURE_TRANSFER_SRC_BIT_KHR = 0x00004000,
1275 VK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR = 0x00008000,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001276}
1277
1278/// Query control flags
Jesse Halld8bade02015-11-24 10:24:18 -08001279type VkFlags VkQueryControlFlags
1280bitfield VkQueryControlFlagBits {
Jesse Hall65ab5522015-11-30 00:07:16 -08001281 VK_QUERY_CONTROL_PRECISE_BIT = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001282}
1283
1284/// Query result flags
Jesse Halld8bade02015-11-24 10:24:18 -08001285type VkFlags VkQueryResultFlags
1286bitfield VkQueryResultFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001287 VK_QUERY_RESULT_64_BIT = 0x00000001, /// Results of the queries are written to the destination buffer as 64-bit values
1288 VK_QUERY_RESULT_WAIT_BIT = 0x00000002, /// Results of the queries are waited on before proceeding with the result copy
1289 VK_QUERY_RESULT_WITH_AVAILABILITY_BIT = 0x00000004, /// Besides the results of the query, the availability of the results is also written
1290 VK_QUERY_RESULT_PARTIAL_BIT = 0x00000008, /// Copy the partial results of the query even if the final results aren't available
1291}
1292
1293/// Shader module creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001294type VkFlags VkShaderModuleCreateFlags
Jesse Halla6429252015-11-29 18:59:42 -08001295//bitfield VkShaderModuleCreateFlagBits {
1296//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001297
Jesse Halld27f6aa2015-08-15 17:58:48 -07001298/// Event creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001299type VkFlags VkEventCreateFlags
Jesse Halla6429252015-11-29 18:59:42 -08001300//bitfield VkEventCreateFlagBits {
1301//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001302
Jesse Halla15a4bf2015-11-19 22:48:02 -08001303/// Command buffer usage flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001304type VkFlags VkCommandBufferUsageFlags
1305bitfield VkCommandBufferUsageFlagBits {
1306 VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT = 0x00000001,
1307 VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT = 0x00000002,
1308 VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001309}
1310
1311/// Pipeline statistics flags
Jesse Halld8bade02015-11-24 10:24:18 -08001312type VkFlags VkQueryPipelineStatisticFlags
1313bitfield VkQueryPipelineStatisticFlagBits {
Jesse Hallae38f732015-11-19 21:32:50 -08001314 VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_BIT = 0x00000001, /// Optional
1315 VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_PRIMITIVES_BIT = 0x00000002, /// Optional
1316 VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT = 0x00000004, /// Optional
1317 VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_INVOCATIONS_BIT = 0x00000008, /// Optional
1318 VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT = 0x00000010, /// Optional
1319 VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT = 0x00000020, /// Optional
1320 VK_QUERY_PIPELINE_STATISTIC_CLIPPING_PRIMITIVES_BIT = 0x00000040, /// Optional
1321 VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT = 0x00000080, /// Optional
1322 VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT = 0x00000100, /// Optional
1323 VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT = 0x00000200, /// Optional
1324 VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT = 0x00000400, /// Optional
Jesse Halld27f6aa2015-08-15 17:58:48 -07001325}
1326
1327/// Memory mapping flags
Jesse Halld8bade02015-11-24 10:24:18 -08001328type VkFlags VkMemoryMapFlags
Jesse Halla6429252015-11-29 18:59:42 -08001329//bitfield VkMemoryMapFlagBits {
1330//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001331
1332/// Bitfield of image aspects
Jesse Halld8bade02015-11-24 10:24:18 -08001333type VkFlags VkImageAspectFlags
1334bitfield VkImageAspectFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001335 VK_IMAGE_ASPECT_COLOR_BIT = 0x00000001,
1336 VK_IMAGE_ASPECT_DEPTH_BIT = 0x00000002,
1337 VK_IMAGE_ASPECT_STENCIL_BIT = 0x00000004,
1338 VK_IMAGE_ASPECT_METADATA_BIT = 0x00000008,
1339}
1340
1341/// Sparse memory bind flags
Jesse Halld8bade02015-11-24 10:24:18 -08001342type VkFlags VkSparseMemoryBindFlags
Jesse Hall091ed9e2015-11-30 00:55:29 -08001343bitfield VkSparseMemoryBindFlagBits {
1344 VK_SPARSE_MEMORY_BIND_METADATA_BIT = 0x00000001,
1345}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001346
1347/// Sparse image memory requirements flags
Jesse Halld8bade02015-11-24 10:24:18 -08001348type VkFlags VkSparseImageFormatFlags
1349bitfield VkSparseImageFormatFlagBits {
Jesse Hallb00daad2015-11-29 19:46:20 -08001350 VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT = 0x00000001, /// Image uses a single miptail region for all array slices
1351 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.
1352 VK_SPARSE_IMAGE_FORMAT_NONSTANDARD_BLOCK_SIZE_BIT = 0x00000004, /// Image uses a non-standard sparse block size
Jesse Halld27f6aa2015-08-15 17:58:48 -07001353}
1354
1355/// Pipeline stages
Jesse Halld8bade02015-11-24 10:24:18 -08001356type VkFlags VkPipelineStageFlags
1357bitfield VkPipelineStageFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001358 VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT = 0x00000001, /// Before subsequent commands are processed
1359 VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT = 0x00000002, /// Draw/DispatchIndirect command fetch
1360 VK_PIPELINE_STAGE_VERTEX_INPUT_BIT = 0x00000004, /// Vertex/index fetch
1361 VK_PIPELINE_STAGE_VERTEX_SHADER_BIT = 0x00000008, /// Vertex shading
Jesse Hallae38f732015-11-19 21:32:50 -08001362 VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT = 0x00000010, /// Tessellation control shading
1363 VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT = 0x00000020, /// Tessellation evaluation shading
Jesse Halld27f6aa2015-08-15 17:58:48 -07001364 VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT = 0x00000040, /// Geometry shading
1365 VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT = 0x00000080, /// Fragment shading
1366 VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT = 0x00000100, /// Early fragment (depth/stencil) tests
1367 VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT = 0x00000200, /// Late fragment (depth/stencil) tests
1368 VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT = 0x00000400, /// Color attachment writes
1369 VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT = 0x00000800, /// Compute shading
1370 VK_PIPELINE_STAGE_TRANSFER_BIT = 0x00001000, /// Transfer/copy operations
Jesse Hall543a7ff2016-01-08 16:38:30 -08001371 VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT = 0x00002000,
1372 VK_PIPELINE_STAGE_HOST_BIT = 0x00004000, /// Indicates host (CPU) is a source/sink of the dependency
Jesse Halld27f6aa2015-08-15 17:58:48 -07001373
Jesse Hall543a7ff2016-01-08 16:38:30 -08001374 VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT = 0x00008000, /// All stages of the graphics pipeline
1375 VK_PIPELINE_STAGE_ALL_COMMANDS_BIT = 0x00010000, /// All graphics, compute, copy, and transition commands
Chris Forbes289cb792016-12-30 15:03:55 +13001376
1377 //@extension("VK_NVX_device_generated_commands")
1378 VK_PIPELINE_STAGE_COMMAND_PROCESS_BIT_NVX = 0x00020000,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001379}
1380
1381/// Render pass attachment description flags
Jesse Halld8bade02015-11-24 10:24:18 -08001382type VkFlags VkAttachmentDescriptionFlags
1383bitfield VkAttachmentDescriptionFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001384 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 -07001385}
1386
1387/// Subpass description flags
Jesse Halld8bade02015-11-24 10:24:18 -08001388type VkFlags VkSubpassDescriptionFlags
1389bitfield VkSubpassDescriptionFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001390}
1391
1392/// Command pool creation flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001393type VkFlags VkCommandPoolCreateFlags
1394bitfield VkCommandPoolCreateFlagBits {
1395 VK_COMMAND_POOL_CREATE_TRANSIENT_BIT = 0x00000001, /// Command buffers have a short lifetime
1396 VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT = 0x00000002, /// Command buffers may release their memory individually
Jesse Halld27f6aa2015-08-15 17:58:48 -07001397}
1398
1399/// Command pool reset flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001400type VkFlags VkCommandPoolResetFlags
1401bitfield VkCommandPoolResetFlagBits {
1402 VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT = 0x00000001, /// Release resources owned by the pool
Jesse Halld27f6aa2015-08-15 17:58:48 -07001403}
1404
Jesse Hall3fbc8562015-11-29 22:10:52 -08001405type VkFlags VkCommandBufferResetFlags
1406bitfield VkCommandBufferResetFlagBits {
1407 VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT = 0x00000001, /// Release resources owned by the buffer
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001408}
1409
Jesse Halld8bade02015-11-24 10:24:18 -08001410type VkFlags VkSampleCountFlags
1411bitfield VkSampleCountFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001412 VK_SAMPLE_COUNT_1_BIT = 0x00000001,
1413 VK_SAMPLE_COUNT_2_BIT = 0x00000002,
1414 VK_SAMPLE_COUNT_4_BIT = 0x00000004,
1415 VK_SAMPLE_COUNT_8_BIT = 0x00000008,
1416 VK_SAMPLE_COUNT_16_BIT = 0x00000010,
1417 VK_SAMPLE_COUNT_32_BIT = 0x00000020,
1418 VK_SAMPLE_COUNT_64_BIT = 0x00000040,
1419}
1420
Jesse Halld8bade02015-11-24 10:24:18 -08001421type VkFlags VkStencilFaceFlags
1422bitfield VkStencilFaceFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001423 VK_STENCIL_FACE_FRONT_BIT = 0x00000001, /// Front face
1424 VK_STENCIL_FACE_BACK_BIT = 0x00000002, /// Back face
Jesse Hallc7467b72015-11-29 21:05:26 -08001425 VK_STENCIL_FRONT_AND_BACK = 0x00000003,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001426}
1427
Jesse Halla6429252015-11-29 18:59:42 -08001428/// Instance creation flags
1429type VkFlags VkInstanceCreateFlags
1430//bitfield VkInstanceCreateFlagBits {
1431//}
1432
1433/// Device creation flags
1434type VkFlags VkDeviceCreateFlags
1435//bitfield VkDeviceCreateFlagBits {
1436//}
1437
1438/// Device queue creation flags
1439type VkFlags VkDeviceQueueCreateFlags
1440//bitfield VkDeviceQueueCreateFlagBits {
1441//}
1442
1443/// Query pool creation flags
1444type VkFlags VkQueryPoolCreateFlags
1445//bitfield VkQueryPoolCreateFlagBits {
1446//}
1447
1448/// Buffer view creation flags
1449type VkFlags VkBufferViewCreateFlags
1450//bitfield VkBufferViewCreateFlagBits {
1451//}
1452
1453/// Pipeline cache creation flags
1454type VkFlags VkPipelineCacheCreateFlags
1455//bitfield VkPipelineCacheCreateFlagBits {
1456//}
1457
1458/// Pipeline shader stage creation flags
1459type VkFlags VkPipelineShaderStageCreateFlags
1460//bitfield VkPipelineShaderStageCreateFlagBits {
1461//}
1462
1463/// Descriptor set layout creation flags
1464type VkFlags VkDescriptorSetLayoutCreateFlags
1465//bitfield VkDescriptorSetLayoutCreateFlagBits {
1466//}
1467
1468/// Pipeline vertex input state creation flags
1469type VkFlags VkPipelineVertexInputStateCreateFlags
1470//bitfield VkPipelineVertexInputStateCreateFlagBits {
1471//}
1472
1473/// Pipeline input assembly state creation flags
1474type VkFlags VkPipelineInputAssemblyStateCreateFlags
1475//bitfield VkPipelineInputAssemblyStateCreateFlagBits {
1476//}
1477
1478/// Tessellation state creation flags
1479type VkFlags VkPipelineTessellationStateCreateFlags
1480//bitfield VkPipelineTessellationStateCreateFlagBits {
1481//}
1482
1483/// Viewport state creation flags
1484type VkFlags VkPipelineViewportStateCreateFlags
1485//bitfield VkPipelineViewportStateCreateFlagBits {
1486//}
1487
Jesse Hall3fbc8562015-11-29 22:10:52 -08001488/// Rasterization state creation flags
1489type VkFlags VkPipelineRasterizationStateCreateFlags
1490//bitfield VkPipelineRasterizationStateCreateFlagBits {
Jesse Halla6429252015-11-29 18:59:42 -08001491//}
1492
1493/// Multisample state creation flags
1494type VkFlags VkPipelineMultisampleStateCreateFlags
1495//bitfield VkPipelineMultisampleStateCreateFlagBits {
1496//}
1497
1498/// Color blend state creation flags
1499type VkFlags VkPipelineColorBlendStateCreateFlags
1500//bitfield VkPipelineColorBlendStateCreateFlagBits {
1501//}
1502
1503/// Depth/stencil state creation flags
1504type VkFlags VkPipelineDepthStencilStateCreateFlags
1505//bitfield VkPipelineDepthStencilStateCreateFlagBits {
1506//}
1507
1508/// Dynamic state creation flags
1509type VkFlags VkPipelineDynamicStateCreateFlags
1510//bitfield VkPipelineDynamicStateCreateFlagBits {
1511//}
1512
1513/// Pipeline layout creation flags
1514type VkFlags VkPipelineLayoutCreateFlags
1515//bitfield VkPipelineLayoutCreateFlagBits {
1516//}
1517
1518/// Sampler creation flags
1519type VkFlags VkSamplerCreateFlags
1520//bitfield VkSamplerCreateFlagBits {
1521//}
1522
1523/// Render pass creation flags
1524type VkFlags VkRenderPassCreateFlags
1525//bitfield VkRenderPassCreateFlagBits {
1526//}
1527
1528/// Framebuffer creation flags
1529type VkFlags VkFramebufferCreateFlags
1530//bitfield VkFramebufferCreateFlagBits {
1531//}
1532
Jesse Halldc6d36c2015-11-29 19:12:15 -08001533/// Dependency flags
1534type VkFlags VkDependencyFlags
1535bitfield VkDependencyFlagBits {
1536 VK_DEPENDENCY_BY_REGION_BIT = 0x00000001,
1537}
1538
Jesse Hallc7467b72015-11-29 21:05:26 -08001539/// Cull mode flags
1540type VkFlags VkCullModeFlags
1541bitfield VkCullModeFlagBits {
1542 VK_CULL_MODE_NONE = 0x00000000,
1543 VK_CULL_MODE_FRONT_BIT = 0x00000001,
1544 VK_CULL_MODE_BACK_BIT = 0x00000002,
1545 VK_CULL_MODE_FRONT_AND_BACK = 0x00000003,
1546}
1547
Jesse Hall523db342015-11-30 21:12:55 -08001548@extension("VK_KHR_surface")
Jesse Halld8bade02015-11-24 10:24:18 -08001549type VkFlags VkSurfaceTransformFlagsKHR
Jesse Hall523db342015-11-30 21:12:55 -08001550@extension("VK_KHR_surface")
Jesse Halld8bade02015-11-24 10:24:18 -08001551bitfield VkSurfaceTransformFlagBitsKHR {
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001552 VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR = 0x00000001,
Jesse Hall9ba8bc82015-11-30 16:22:16 -08001553 VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR = 0x00000002,
1554 VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR = 0x00000004,
1555 VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR = 0x00000008,
1556 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR = 0x00000010,
1557 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR = 0x00000020,
1558 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR = 0x00000040,
1559 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR = 0x00000080,
1560 VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR = 0x00000100,
Michael Lentine88594d72015-11-12 12:49:45 -08001561}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001562
Jesse Hall523db342015-11-30 21:12:55 -08001563@extension("VK_KHR_surface")
Jesse Halla6429252015-11-29 18:59:42 -08001564type VkFlags VkCompositeAlphaFlagsKHR
Jesse Hall523db342015-11-30 21:12:55 -08001565@extension("VK_KHR_surface")
Jesse Halla6429252015-11-29 18:59:42 -08001566bitfield VkCompositeAlphaFlagBitsKHR {
1567 VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR = 0x00000001,
1568 VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR = 0x00000002,
1569 VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR = 0x00000004,
1570 VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR = 0x00000008,
1571}
1572
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001573@extension("VK_KHR_swapchain")
1574type VkFlags VkSwapchainCreateFlagsKHR
1575//@extension("VK_KHR_swapchain")
1576//bitfield VkSwapchainCreateFlagBitsKHR {
1577//}
1578
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001579@extension("VK_KHR_display")
Jesse Halld8bade02015-11-24 10:24:18 -08001580type VkFlags VkDisplayPlaneAlphaFlagsKHR
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001581@extension("VK_KHR_display")
Jesse Halld8bade02015-11-24 10:24:18 -08001582bitfield VkDisplayPlaneAlphaFlagBitsKHR {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001583 VK_DISPLAY_PLANE_ALPHA_OPAQUE_BIT_KHR = 0x00000001,
1584 VK_DISPLAY_PLANE_ALPHA_GLOBAL_BIT_KHR = 0x00000002,
1585 VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_BIT_KHR = 0x00000004,
1586 VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_PREMULTIPLIED_BIT_KHR = 0x00000008,
Jesse Hall1356b0d2015-11-23 17:24:58 -08001587}
1588
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001589@extension("VK_KHR_display")
1590type VkFlags VkDisplaySurfaceCreateFlagsKHR
1591//@extension("VK_KHR_display")
1592//bitfield VkDisplaySurfaceCreateFlagBitsKHR {
1593//}
1594
Jesse Hall9ba8bc82015-11-30 16:22:16 -08001595@extension("VK_KHR_display")
1596type VkFlags VkDisplayModeCreateFlagsKHR
1597//@extension("VK_KHR_display")
1598//bitfield VkDisplayModeCreateFlagBitsKHR {
1599//}
1600
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001601@extension("VK_KHR_xlib_surface")
1602type VkFlags VkXlibSurfaceCreateFlagsKHR
1603//@extension("VK_KHR_xlib_surface")
1604//bitfield VkXlibSurfaceCreateFlagBitsKHR {
1605//}
1606
1607@extension("VK_KHR_xcb_surface")
1608type VkFlags VkXcbSurfaceCreateFlagsKHR
1609//@extension("VK_KHR_xcb_surface")
1610//bitfield VkXcbSurfaceCreateFlagBitsKHR {
1611//}
1612
1613@extension("VK_KHR_wayland_surface")
1614type VkFlags VkWaylandSurfaceCreateFlagsKHR
1615//@extension("VK_KHR_wayland_surface")
1616//bitfield VkWaylandSurfaceCreateFlagBitsKHR {
1617//}
1618
1619@extension("VK_KHR_mir_surface")
1620type VkFlags VkMirSurfaceCreateFlagsKHR
1621//@extension("VK_KHR_mir_surface")
1622//bitfield VkMirSurfaceCreateFlagBitsKHR {
1623//}
1624
1625@extension("VK_KHR_android_surface")
1626type VkFlags VkAndroidSurfaceCreateFlagsKHR
1627//@extension("VK_KHR_android_surface")
1628//bitfield VkAndroidSurfaceCreateFlagBitsKHR {
1629//}
1630
1631@extension("VK_KHR_win32_surface")
1632type VkFlags VkWin32SurfaceCreateFlagsKHR
1633//@extension("VK_KHR_win32_surface")
1634//bitfield VkWin32SurfaceCreateFlagBitsKHR {
1635//}
1636
Jesse Hall889cd9a2017-02-25 22:12:23 -08001637@extension("VK_ANDROID_native_buffer")
1638type VkFlags VkSwapchainImageUsageFlagsANDROID
1639@extension("VK_ANDROID_native_buffer")
1640bitfield VkSwapchainImageUsageFlagBitsANDROID {
1641 VK_SWAPCHAIN_IMAGE_USAGE_FLAGS_SHARED_BIT_ANDROID = 0x00000001,
1642}
1643
Jesse Hall715b86a2016-01-16 16:34:29 -08001644@extension("VK_EXT_debug_report")
1645type VkFlags VkDebugReportFlagsEXT
1646@extension("VK_EXT_debug_report")
1647bitfield VkDebugReportFlagBitsEXT {
Jesse Halle2948d82016-02-25 04:19:32 -08001648 VK_DEBUG_REPORT_INFORMATION_BIT_EXT = 0x00000001,
1649 VK_DEBUG_REPORT_WARNING_BIT_EXT = 0x00000002,
1650 VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT = 0x00000004,
Jesse Hall715b86a2016-01-16 16:34:29 -08001651 VK_DEBUG_REPORT_ERROR_BIT_EXT = 0x00000008,
1652 VK_DEBUG_REPORT_DEBUG_BIT_EXT = 0x00000010,
1653}
1654
Chris Forbes289cb792016-12-30 15:03:55 +13001655@extension("VK_NV_external_memory_capabilities")
1656type VkFlags VkExternalMemoryHandleTypeFlagsNV
1657@extension("VK_NV_external_memory_capabilities")
1658bitfield VkExternalMemoryHandleTypeFlagBitsNV {
Jesse Halleb02c472017-02-24 15:13:45 -08001659 VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_NV = 0x00000001,
1660 VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_NV = 0x00000002,
1661 VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_IMAGE_BIT_NV = 0x00000004,
1662 VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_IMAGE_KMT_BIT_NV = 0x00000008,
Chris Forbes289cb792016-12-30 15:03:55 +13001663}
1664
1665@extension("VK_NV_external_memory_capabilities")
1666type VkFlags VkExternalMemoryFeatureFlagsNV
1667@extension("VK_NV_external_memory_capabilities")
1668bitfield VkExternalMemoryFeatureFlagBitsNV {
Jesse Halleb02c472017-02-24 15:13:45 -08001669 VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT_NV = 0x00000001,
1670 VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT_NV = 0x00000002,
1671 VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT_NV = 0x00000004,
Chris Forbes289cb792016-12-30 15:03:55 +13001672}
1673
Jesse Hall77ad05b2017-03-10 22:02:20 -08001674@extension("VK_NN_vi_surface")
1675type VkFlags VkViSurfaceCreateFlagsNN
1676//@extension("VK_NN_vi_surface")
1677//bitfield VkViSurfaceCreateFlagBitsNN {
1678//}
1679
1680@extension("VK_KHR_maintenance1")
1681type VkFlags VkCommandPoolTrimFlagsKHR
1682//@extension("VK_KHR_maintenance1")
1683//bitfield VkCommandPoolTrimFlagBitsKHR {
1684//}
1685
Chris Forbes289cb792016-12-30 15:03:55 +13001686@extension("VK_NVX_device_generated_commands")
1687type VkFlags VkIndirectCommandsLayoutUsageFlagsNVX
1688@extension("VK_NVX_device_generated_commands")
1689bitfield VkIndirectCommandsLayoutUsageFlagBitsNVX {
Jesse Halleb02c472017-02-24 15:13:45 -08001690 VK_INDIRECT_COMMANDS_LAYOUT_USAGE_UNORDERED_SEQUENCES_BIT_NVX = 0x00000001,
1691 VK_INDIRECT_COMMANDS_LAYOUT_USAGE_SPARSE_SEQUENCES_BIT_NVX = 0x00000002,
1692 VK_INDIRECT_COMMANDS_LAYOUT_USAGE_EMPTY_EXECUTIONS_BIT_NVX = 0x00000004,
1693 VK_INDIRECT_COMMANDS_LAYOUT_USAGE_INDEXED_SEQUENCES_BIT_NVX = 0x00000008,
Chris Forbes289cb792016-12-30 15:03:55 +13001694}
1695
1696@extension("VK_NVX_device_generated_commands")
1697type VkFlags VkObjectEntryUsageFlagsNVX
1698@extension("VK_NVX_device_generated_commands")
1699bitfield VkObjectEntryUsageFlagBitsNVX {
Jesse Halleb02c472017-02-24 15:13:45 -08001700 VK_OBJECT_ENTRY_USAGE_GRAPHICS_BIT_NVX = 0x00000001,
1701 VK_OBJECT_ENTRY_USAGE_COMPUTE_BIT_NVX = 0x00000002,
Chris Forbes289cb792016-12-30 15:03:55 +13001702}
1703
Jesse Hall77ad05b2017-03-10 22:02:20 -08001704@extension("VK_EXT_display_surface_counter")
1705type VkFlags VkSurfaceCounterFlagsEXT
1706@extension("VK_EXT_display_surface_counter")
1707bitfield VkSurfaceCounterFlagBitsEXT {
1708 VK_SURFACE_COUNTER_VBLANK_EXT = 0x00000001,
1709}
1710
Jesse Halld27f6aa2015-08-15 17:58:48 -07001711//////////////////
1712// Structures //
1713//////////////////
1714
1715class VkOffset2D {
1716 s32 x
1717 s32 y
1718}
1719
1720class VkOffset3D {
1721 s32 x
1722 s32 y
1723 s32 z
1724}
1725
1726class VkExtent2D {
Jesse Hall3dd678a2016-01-08 21:52:01 -08001727 u32 width
1728 u32 height
Jesse Halld27f6aa2015-08-15 17:58:48 -07001729}
1730
1731class VkExtent3D {
Jesse Hall3dd678a2016-01-08 21:52:01 -08001732 u32 width
1733 u32 height
1734 u32 depth
Jesse Halld27f6aa2015-08-15 17:58:48 -07001735}
1736
1737class VkViewport {
Jesse Hall65ab5522015-11-30 00:07:16 -08001738 f32 x
1739 f32 y
Jesse Halld27f6aa2015-08-15 17:58:48 -07001740 f32 width
1741 f32 height
1742 f32 minDepth
1743 f32 maxDepth
1744}
1745
1746class VkRect2D {
1747 VkOffset2D offset
1748 VkExtent2D extent
1749}
1750
Jesse Halla15a4bf2015-11-19 22:48:02 -08001751class VkClearRect {
1752 VkRect2D rect
1753 u32 baseArrayLayer
Jesse Hall3fbc8562015-11-29 22:10:52 -08001754 u32 layerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001755}
1756
Jesse Hall65ab5522015-11-30 00:07:16 -08001757class VkComponentMapping {
1758 VkComponentSwizzle r
1759 VkComponentSwizzle g
1760 VkComponentSwizzle b
1761 VkComponentSwizzle a
Jesse Halld27f6aa2015-08-15 17:58:48 -07001762}
1763
1764class VkPhysicalDeviceProperties {
1765 u32 apiVersion
1766 u32 driverVersion
Jesse Hall65ab5522015-11-30 00:07:16 -08001767 u32 vendorID
1768 u32 deviceID
Jesse Halld27f6aa2015-08-15 17:58:48 -07001769 VkPhysicalDeviceType deviceType
Jesse Hall65ab5522015-11-30 00:07:16 -08001770 char[VK_MAX_PHYSICAL_DEVICE_NAME_SIZE] deviceName
1771 u8[VK_UUID_SIZE] pipelineCacheUUID
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001772 VkPhysicalDeviceLimits limits
1773 VkPhysicalDeviceSparseProperties sparseProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07001774}
1775
1776class VkExtensionProperties {
Jesse Hall65ab5522015-11-30 00:07:16 -08001777 char[VK_MAX_EXTENSION_NAME_SIZE] extensionName /// extension name
Jesse Halld27f6aa2015-08-15 17:58:48 -07001778 u32 specVersion /// version of the extension specification implemented
1779}
1780
1781class VkLayerProperties {
Jesse Hall65ab5522015-11-30 00:07:16 -08001782 char[VK_MAX_EXTENSION_NAME_SIZE] layerName /// layer name
Jesse Hall3fbc8562015-11-29 22:10:52 -08001783 u32 specVersion /// version of the layer specification implemented
1784 u32 implementationVersion /// build or release version of the layer's library
Jesse Hall65ab5522015-11-30 00:07:16 -08001785 char[VK_MAX_DESCRIPTION_SIZE] description /// Free-form description of the layer
Jesse Halld27f6aa2015-08-15 17:58:48 -07001786}
1787
Jesse Halla366a512015-11-19 22:30:07 -08001788class VkSubmitInfo {
Jesse Hall03b6fe12015-11-24 12:44:21 -08001789 VkStructureType sType /// Type of structure. Should be VK_STRUCTURE_TYPE_SUBMIT_INFO
1790 const void* pNext /// Next structure in chain
1791 u32 waitSemaphoreCount
Jesse Halla366a512015-11-19 22:30:07 -08001792 const VkSemaphore* pWaitSemaphores
Jesse Hall543a7ff2016-01-08 16:38:30 -08001793 const VkPipelineStageFlags* pWaitDstStageMask
Jesse Hall03b6fe12015-11-24 12:44:21 -08001794 u32 commandBufferCount
Jesse Hall3fbc8562015-11-29 22:10:52 -08001795 const VkCommandBuffer* pCommandBuffers
Jesse Hall03b6fe12015-11-24 12:44:21 -08001796 u32 signalSemaphoreCount
Jesse Halla366a512015-11-19 22:30:07 -08001797 const VkSemaphore* pSignalSemaphores
1798}
1799
Jesse Halld27f6aa2015-08-15 17:58:48 -07001800class VkApplicationInfo {
1801 VkStructureType sType /// Type of structure. Should be VK_STRUCTURE_TYPE_APPLICATION_INFO
1802 const void* pNext /// Next structure in chain
Jesse Hall3fbc8562015-11-29 22:10:52 -08001803 const char* pApplicationName
1804 u32 applicationVersion
Jesse Halld27f6aa2015-08-15 17:58:48 -07001805 const char* pEngineName
1806 u32 engineVersion
1807 u32 apiVersion
1808}
1809
Jesse Hall3fbc8562015-11-29 22:10:52 -08001810class VkAllocationCallbacks {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001811 void* pUserData
Jesse Hall3fbc8562015-11-29 22:10:52 -08001812 PFN_vkAllocationFunction pfnAllocation
1813 PFN_vkReallocationFunction pfnReallocation
Jesse Halld27f6aa2015-08-15 17:58:48 -07001814 PFN_vkFreeFunction pfnFree
Jesse Hall3fbc8562015-11-29 22:10:52 -08001815 PFN_vkInternalAllocationNotification pfnInternalAllocation
Jesse Hall03b6fe12015-11-24 12:44:21 -08001816 PFN_vkInternalFreeNotification pfnInternalFree
Jesse Halld27f6aa2015-08-15 17:58:48 -07001817}
1818
1819class VkDeviceQueueCreateInfo {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001820 VkStructureType sStype /// Should be VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO
1821 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001822 VkDeviceQueueCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001823 u32 queueFamilyIndex
Jesse Halldba27f72015-11-30 14:25:46 -08001824 u32 queueCount
Jesse Hallfbf97b02015-11-20 14:17:03 -08001825 const f32* pQueuePriorities
Jesse Halld27f6aa2015-08-15 17:58:48 -07001826}
1827
1828class VkDeviceCreateInfo {
1829 VkStructureType sType /// Should be VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO
1830 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001831 VkDeviceCreateFlags flags
Jesse Halldba27f72015-11-30 14:25:46 -08001832 u32 queueCreateInfoCount
1833 const VkDeviceQueueCreateInfo* pQueueCreateInfos
Jesse Hall3dd678a2016-01-08 21:52:01 -08001834 u32 enabledLayerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001835 const char* const* ppEnabledLayerNames /// Ordered list of layer names to be enabled
Jesse Hall3dd678a2016-01-08 21:52:01 -08001836 u32 enabledExtensionCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001837 const char* const* ppEnabledExtensionNames
1838 const VkPhysicalDeviceFeatures* pEnabledFeatures
Jesse Halld27f6aa2015-08-15 17:58:48 -07001839}
1840
1841class VkInstanceCreateInfo {
1842 VkStructureType sType /// Should be VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO
1843 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001844 VkInstanceCreateFlags flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001845 const VkApplicationInfo* pApplicationInfo
Jesse Hall3dd678a2016-01-08 21:52:01 -08001846 u32 enabledLayerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001847 const char* const* ppEnabledLayerNames /// Ordered list of layer names to be enabled
Jesse Hall3dd678a2016-01-08 21:52:01 -08001848 u32 enabledExtensionCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001849 const char* const* ppEnabledExtensionNames /// Extension names to be enabled
1850}
1851
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001852class VkQueueFamilyProperties {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001853 VkQueueFlags queueFlags /// Queue flags
1854 u32 queueCount
Jesse Hallacfa5342015-11-19 21:51:33 -08001855 u32 timestampValidBits
Jesse Hall65ab5522015-11-30 00:07:16 -08001856 VkExtent3D minImageTransferGranularity
Jesse Halld27f6aa2015-08-15 17:58:48 -07001857}
1858
1859class VkPhysicalDeviceMemoryProperties {
1860 u32 memoryTypeCount
1861 VkMemoryType[VK_MAX_MEMORY_TYPES] memoryTypes
1862 u32 memoryHeapCount
1863 VkMemoryHeap[VK_MAX_MEMORY_HEAPS] memoryHeaps
1864}
1865
Jesse Hall3fbc8562015-11-29 22:10:52 -08001866class VkMemoryAllocateInfo {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001867 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07001868 const void* pNext /// Pointer to next structure
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001869 VkDeviceSize allocationSize /// Size of memory allocation
Jesse Halld27f6aa2015-08-15 17:58:48 -07001870 u32 memoryTypeIndex /// Index of the of the memory type to allocate from
1871}
1872
1873class VkMemoryRequirements {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001874 VkDeviceSize size /// Specified in bytes
1875 VkDeviceSize alignment /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001876 u32 memoryTypeBits /// Bitfield of the allowed memory type indices into memoryTypes[] for this object
1877}
1878
1879class VkSparseImageFormatProperties {
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001880 VkImageAspectFlagBits aspectMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001881 VkExtent3D imageGranularity
1882 VkSparseImageFormatFlags flags
1883}
1884
1885class VkSparseImageMemoryRequirements {
Jesse Hallb00daad2015-11-29 19:46:20 -08001886 VkSparseImageFormatProperties formatProperties
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001887 u32 imageMipTailFirstLod
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001888 VkDeviceSize imageMipTailSize /// Specified in bytes, must be a multiple of image block size / alignment
1889 VkDeviceSize imageMipTailOffset /// Specified in bytes, must be a multiple of image block size / alignment
1890 VkDeviceSize imageMipTailStride /// Specified in bytes, must be a multiple of image block size / alignment
Jesse Halld27f6aa2015-08-15 17:58:48 -07001891}
1892
1893class VkMemoryType {
1894 VkMemoryPropertyFlags propertyFlags /// Memory properties of this memory type
1895 u32 heapIndex /// Index of the memory heap allocations of this memory type are taken from
1896}
1897
1898class VkMemoryHeap {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001899 VkDeviceSize size /// Available memory in the heap
Jesse Halld27f6aa2015-08-15 17:58:48 -07001900 VkMemoryHeapFlags flags /// Flags for the heap
1901}
1902
1903class VkMappedMemoryRange {
1904 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE
1905 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08001906 VkDeviceMemory memory /// Mapped memory object
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001907 VkDeviceSize offset /// Offset within the mapped memory the range starts from
1908 VkDeviceSize size /// Size of the range within the mapped memory
Jesse Halld27f6aa2015-08-15 17:58:48 -07001909}
1910
1911class VkFormatProperties {
1912 VkFormatFeatureFlags linearTilingFeatures /// Format features in case of linear tiling
1913 VkFormatFeatureFlags optimalTilingFeatures /// Format features in case of optimal tiling
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001914 VkFormatFeatureFlags bufferFeatures /// Format features supported by buffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07001915}
1916
1917class VkImageFormatProperties {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001918 VkExtent3D maxExtent /// max image dimensions for this resource type
1919 u32 maxMipLevels /// max number of mipmap levels for this resource type
Jesse Halla15a4bf2015-11-19 22:48:02 -08001920 u32 maxArrayLayers /// max array layers for this resource type
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001921 VkSampleCountFlags sampleCounts /// supported sample counts for this resource type
1922 VkDeviceSize maxResourceSize /// max size (in bytes) of this resource type
1923}
1924
Jesse Halla15a4bf2015-11-19 22:48:02 -08001925class VkDescriptorImageInfo {
1926 VkSampler sampler
1927 VkImageView imageView
1928 VkImageLayout imageLayout
1929}
1930
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001931class VkDescriptorBufferInfo {
1932 VkBuffer buffer /// Buffer used for this descriptor when the descriptor is UNIFORM_BUFFER[_DYNAMIC]
1933 VkDeviceSize offset /// Base offset from buffer start in bytes to update in the descriptor set.
1934 VkDeviceSize range /// Size in bytes of the buffer resource for this descriptor update.
Jesse Halld27f6aa2015-08-15 17:58:48 -07001935}
1936
Jesse Halld27f6aa2015-08-15 17:58:48 -07001937class VkWriteDescriptorSet {
1938 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET
1939 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08001940 VkDescriptorSet dstSet /// Destination descriptor set
1941 u32 dstBinding /// Binding within the destination descriptor set to write
1942 u32 dstArrayElement /// Array element within the destination binding to write
Jesse Hall03b6fe12015-11-24 12:44:21 -08001943 u32 descriptorCount /// Number of descriptors to write (determines the size of the array pointed by <pDescriptors>)
Jesse Halld27f6aa2015-08-15 17:58:48 -07001944 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 -08001945 const VkDescriptorImageInfo* pImageInfo
1946 const VkDescriptorBufferInfo* pBufferInfo
1947 const VkBufferView* pTexelBufferView
Jesse Halld27f6aa2015-08-15 17:58:48 -07001948}
1949
1950class VkCopyDescriptorSet {
1951 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET
1952 const void* pNext /// Pointer to next structure
1953 VkDescriptorSet srcSet /// Source descriptor set
1954 u32 srcBinding /// Binding within the source descriptor set to copy from
1955 u32 srcArrayElement /// Array element within the source binding to copy from
Jesse Hall3fbc8562015-11-29 22:10:52 -08001956 VkDescriptorSet dstSet /// Destination descriptor set
1957 u32 dstBinding /// Binding within the destination descriptor set to copy to
1958 u32 dstArrayElement /// Array element within the destination binding to copy to
Jesse Hall03b6fe12015-11-24 12:44:21 -08001959 u32 descriptorCount /// Number of descriptors to copy
Jesse Halld27f6aa2015-08-15 17:58:48 -07001960}
1961
1962class VkBufferCreateInfo {
1963 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO
1964 const void* pNext /// Pointer to next structure.
Jesse Halla6429252015-11-29 18:59:42 -08001965 VkBufferCreateFlags flags /// Buffer creation flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001966 VkDeviceSize size /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001967 VkBufferUsageFlags usage /// Buffer usage flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001968 VkSharingMode sharingMode
Jesse Hall03b6fe12015-11-24 12:44:21 -08001969 u32 queueFamilyIndexCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001970 const u32* pQueueFamilyIndices
1971}
1972
1973class VkBufferViewCreateInfo {
1974 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO
1975 const void* pNext /// Pointer to next structure.
Jesse Halla6429252015-11-29 18:59:42 -08001976 VkBufferViewCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001977 VkBuffer buffer
Jesse Halld27f6aa2015-08-15 17:58:48 -07001978 VkFormat format /// Optionally specifies format of elements
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001979 VkDeviceSize offset /// Specified in bytes
1980 VkDeviceSize range /// View size specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001981}
1982
1983class VkImageSubresource {
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001984 VkImageAspectFlagBits aspectMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001985 u32 mipLevel
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001986 u32 arrayLayer
Jesse Halld27f6aa2015-08-15 17:58:48 -07001987}
1988
1989class VkImageSubresourceRange {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001990 VkImageAspectFlags aspectMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001991 u32 baseMipLevel
Jesse Hall3fbc8562015-11-29 22:10:52 -08001992 u32 levelCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001993 u32 baseArrayLayer
Jesse Hall3fbc8562015-11-29 22:10:52 -08001994 u32 layerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001995}
1996
1997class VkMemoryBarrier {
1998 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MEMORY_BARRIER
1999 const void* pNext /// Pointer to next structure.
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002000 VkAccessFlags srcAccessMask
2001 VkAccessFlags dstAccessMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07002002}
2003
2004class VkBufferMemoryBarrier {
2005 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER
2006 const void* pNext /// Pointer to next structure.
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002007 VkAccessFlags srcAccessMask
2008 VkAccessFlags dstAccessMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07002009 u32 srcQueueFamilyIndex /// Queue family to transition ownership from
Jesse Hall3fbc8562015-11-29 22:10:52 -08002010 u32 dstQueueFamilyIndex /// Queue family to transition ownership to
Jesse Halld27f6aa2015-08-15 17:58:48 -07002011 VkBuffer buffer /// Buffer to sync
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002012 VkDeviceSize offset /// Offset within the buffer to sync
2013 VkDeviceSize size /// Amount of bytes to sync
Jesse Halld27f6aa2015-08-15 17:58:48 -07002014}
2015
2016class VkImageMemoryBarrier {
2017 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER
2018 const void* pNext /// Pointer to next structure.
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002019 VkAccessFlags srcAccessMask
2020 VkAccessFlags dstAccessMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07002021 VkImageLayout oldLayout /// Current layout of the image
2022 VkImageLayout newLayout /// New layout to transition the image to
2023 u32 srcQueueFamilyIndex /// Queue family to transition ownership from
Jesse Hall3fbc8562015-11-29 22:10:52 -08002024 u32 dstQueueFamilyIndex /// Queue family to transition ownership to
Jesse Halld27f6aa2015-08-15 17:58:48 -07002025 VkImage image /// Image to sync
2026 VkImageSubresourceRange subresourceRange /// Subresource range to sync
2027}
2028
2029class VkImageCreateInfo {
2030 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO
2031 const void* pNext /// Pointer to next structure.
Jesse Halla6429252015-11-29 18:59:42 -08002032 VkImageCreateFlags flags /// Image creation flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002033 VkImageType imageType
2034 VkFormat format
2035 VkExtent3D extent
2036 u32 mipLevels
Jesse Halla15a4bf2015-11-19 22:48:02 -08002037 u32 arrayLayers
Jesse Hall091ed9e2015-11-30 00:55:29 -08002038 VkSampleCountFlagBits samples
Jesse Halld27f6aa2015-08-15 17:58:48 -07002039 VkImageTiling tiling
2040 VkImageUsageFlags usage /// Image usage flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002041 VkSharingMode sharingMode /// Cross-queue-family sharing mode
Jesse Hall03b6fe12015-11-24 12:44:21 -08002042 u32 queueFamilyIndexCount /// Number of queue families to share across
Jesse Halld27f6aa2015-08-15 17:58:48 -07002043 const u32* pQueueFamilyIndices /// Array of queue family indices to share across
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002044 VkImageLayout initialLayout /// Initial image layout for all subresources
Jesse Halld27f6aa2015-08-15 17:58:48 -07002045}
2046
2047class VkSubresourceLayout {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002048 VkDeviceSize offset /// Specified in bytes
2049 VkDeviceSize size /// Specified in bytes
2050 VkDeviceSize rowPitch /// Specified in bytes
Jesse Hall543a7ff2016-01-08 16:38:30 -08002051 VkDeviceSize arrayPitch /// Specified in bytes
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002052 VkDeviceSize depthPitch /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002053}
2054
2055class VkImageViewCreateInfo {
2056 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO
2057 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002058 VkImageViewCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002059 VkImage image
2060 VkImageViewType viewType
2061 VkFormat format
Jesse Hall65ab5522015-11-30 00:07:16 -08002062 VkComponentMapping components
Jesse Halld27f6aa2015-08-15 17:58:48 -07002063 VkImageSubresourceRange subresourceRange
Jesse Halld27f6aa2015-08-15 17:58:48 -07002064}
2065
2066class VkBufferCopy {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002067 VkDeviceSize srcOffset /// Specified in bytes
Jesse Hall3fbc8562015-11-29 22:10:52 -08002068 VkDeviceSize dstOffset /// Specified in bytes
Jesse Hallb00daad2015-11-29 19:46:20 -08002069 VkDeviceSize size /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002070}
2071
Jesse Halla6429252015-11-29 18:59:42 -08002072class VkSparseMemoryBind {
Jesse Hallb00daad2015-11-29 19:46:20 -08002073 VkDeviceSize resourceOffset /// Specified in bytes
2074 VkDeviceSize size /// Specified in bytes
Jesse Hall3fbc8562015-11-29 22:10:52 -08002075 VkDeviceMemory memory
2076 VkDeviceSize memoryOffset /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002077 VkSparseMemoryBindFlags flags
2078}
2079
Jesse Halla6429252015-11-29 18:59:42 -08002080class VkSparseImageMemoryBind {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002081 VkImageSubresource subresource
2082 VkOffset3D offset
2083 VkExtent3D extent
Jesse Hall3fbc8562015-11-29 22:10:52 -08002084 VkDeviceMemory memory
2085 VkDeviceSize memoryOffset /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002086 VkSparseMemoryBindFlags flags
2087}
2088
Jesse Halla6429252015-11-29 18:59:42 -08002089class VkSparseBufferMemoryBindInfo {
2090 VkBuffer buffer
2091 u32 bindCount
2092 const VkSparseMemoryBind* pBinds
2093}
2094
2095class VkSparseImageOpaqueMemoryBindInfo {
2096 VkImage image
2097 u32 bindCount
2098 const VkSparseMemoryBind* pBinds
2099}
2100
2101class VkSparseImageMemoryBindInfo {
2102 VkImage image
2103 u32 bindCount
2104 const VkSparseMemoryBind* pBinds
2105}
2106
2107class VkBindSparseInfo {
2108 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BIND_SPARSE_INFO
2109 const void* pNext
2110 u32 waitSemaphoreCount
2111 const VkSemaphore* pWaitSemaphores
2112 u32 numBufferBinds
2113 const VkSparseBufferMemoryBindInfo* pBufferBinds
2114 u32 numImageOpaqueBinds
2115 const VkSparseImageOpaqueMemoryBindInfo* pImageOpaqueBinds
2116 u32 numImageBinds
2117 const VkSparseImageMemoryBindInfo* pImageBinds
2118 u32 signalSemaphoreCount
2119 const VkSemaphore* pSignalSemaphores
2120}
2121
Jesse Hall65ab5522015-11-30 00:07:16 -08002122class VkImageSubresourceLayers {
2123 VkImageAspectFlags aspectMask
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002124 u32 mipLevel
Jesse Halla15a4bf2015-11-19 22:48:02 -08002125 u32 baseArrayLayer
Jesse Hall3fbc8562015-11-29 22:10:52 -08002126 u32 layerCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002127}
2128
Jesse Halld27f6aa2015-08-15 17:58:48 -07002129class VkImageCopy {
Jesse Hall65ab5522015-11-30 00:07:16 -08002130 VkImageSubresourceLayers srcSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07002131 VkOffset3D srcOffset /// Specified in pixels for both compressed and uncompressed images
Jesse Hall65ab5522015-11-30 00:07:16 -08002132 VkImageSubresourceLayers dstSubresource
Jesse Hall3fbc8562015-11-29 22:10:52 -08002133 VkOffset3D dstOffset /// Specified in pixels for both compressed and uncompressed images
Jesse Halld27f6aa2015-08-15 17:58:48 -07002134 VkExtent3D extent /// Specified in pixels for both compressed and uncompressed images
2135}
2136
2137class VkImageBlit {
Jesse Hall65ab5522015-11-30 00:07:16 -08002138 VkImageSubresourceLayers srcSubresource
Jesse Hall3dd678a2016-01-08 21:52:01 -08002139 VkOffset3D[2] srcOffsets
Jesse Hall65ab5522015-11-30 00:07:16 -08002140 VkImageSubresourceLayers dstSubresource
Jesse Hall3dd678a2016-01-08 21:52:01 -08002141 VkOffset3D[2] dstOffsets
Jesse Halld27f6aa2015-08-15 17:58:48 -07002142}
2143
2144class VkBufferImageCopy {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002145 VkDeviceSize bufferOffset /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002146 u32 bufferRowLength /// Specified in texels
2147 u32 bufferImageHeight
Jesse Hall65ab5522015-11-30 00:07:16 -08002148 VkImageSubresourceLayers imageSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07002149 VkOffset3D imageOffset /// Specified in pixels for both compressed and uncompressed images
2150 VkExtent3D imageExtent /// Specified in pixels for both compressed and uncompressed images
2151}
2152
2153class VkImageResolve {
Jesse Hall65ab5522015-11-30 00:07:16 -08002154 VkImageSubresourceLayers srcSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07002155 VkOffset3D srcOffset
Jesse Hall65ab5522015-11-30 00:07:16 -08002156 VkImageSubresourceLayers dstSubresource
Jesse Hall3fbc8562015-11-29 22:10:52 -08002157 VkOffset3D dstOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07002158 VkExtent3D extent
2159}
2160
2161class VkShaderModuleCreateInfo {
2162 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO
2163 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002164 VkShaderModuleCreateFlags flags /// Reserved
Jesse Halld27f6aa2015-08-15 17:58:48 -07002165 platform.size_t codeSize /// Specified in bytes
Jesse Halla9bb62b2015-11-21 19:31:56 -08002166 const u32* pCode /// Binary code of size codeSize
Jesse Halld27f6aa2015-08-15 17:58:48 -07002167}
2168
Jesse Halld27f6aa2015-08-15 17:58:48 -07002169class VkDescriptorSetLayoutBinding {
Jesse Hall091ed9e2015-11-30 00:55:29 -08002170 u32 binding
Jesse Halld27f6aa2015-08-15 17:58:48 -07002171 VkDescriptorType descriptorType /// Type of the descriptors in this binding
Jesse Halldba27f72015-11-30 14:25:46 -08002172 u32 descriptorCount /// Number of descriptors in this binding
Jesse Halld27f6aa2015-08-15 17:58:48 -07002173 VkShaderStageFlags stageFlags /// Shader stages this binding is visible to
2174 const VkSampler* pImmutableSamplers /// Immutable samplers (used if descriptor type is SAMPLER or COMBINED_IMAGE_SAMPLER, is either NULL or contains <count> number of elements)
2175}
2176
2177class VkDescriptorSetLayoutCreateInfo {
2178 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO
2179 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002180 VkDescriptorSetLayoutCreateFlags flags
Jesse Hall03b6fe12015-11-24 12:44:21 -08002181 u32 bindingCount /// Number of bindings in the descriptor set layout
Jesse Hall543a7ff2016-01-08 16:38:30 -08002182 const VkDescriptorSetLayoutBinding* pBindings /// Array of descriptor set layout bindings
Jesse Halld27f6aa2015-08-15 17:58:48 -07002183}
2184
Jesse Hall65ab5522015-11-30 00:07:16 -08002185class VkDescriptorPoolSize {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002186 VkDescriptorType type
Jesse Hall03b6fe12015-11-24 12:44:21 -08002187 u32 descriptorCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002188}
2189
2190class VkDescriptorPoolCreateInfo {
2191 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO
2192 const void* pNext /// Pointer to next structure
Jesse Hallfbf97b02015-11-20 14:17:03 -08002193 VkDescriptorPoolCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002194 u32 maxSets
Jesse Hall65ab5522015-11-30 00:07:16 -08002195 u32 poolSizeCount
2196 const VkDescriptorPoolSize* pPoolSizes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002197}
2198
Jesse Hall3fbc8562015-11-29 22:10:52 -08002199class VkDescriptorSetAllocateInfo {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002200 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO
Jesse Hallfbf97b02015-11-20 14:17:03 -08002201 const void* pNext /// Pointer to next structure
2202 VkDescriptorPool descriptorPool
Jesse Hall03b6fe12015-11-24 12:44:21 -08002203 u32 setCount
Jesse Hallfbf97b02015-11-20 14:17:03 -08002204 const VkDescriptorSetLayout* pSetLayouts
2205}
2206
Jesse Halld27f6aa2015-08-15 17:58:48 -07002207class VkSpecializationMapEntry {
Jesse Hall65ab5522015-11-30 00:07:16 -08002208 u32 constantID /// The SpecConstant ID specified in the BIL
Jesse Halld27f6aa2015-08-15 17:58:48 -07002209 u32 offset /// Offset of the value in the data block
Jesse Hallb00daad2015-11-29 19:46:20 -08002210 platform.size_t size /// Size in bytes of the SpecConstant
Jesse Halld27f6aa2015-08-15 17:58:48 -07002211}
2212
2213class VkSpecializationInfo {
2214 u32 mapEntryCount /// Number of entries in the map
Jesse Hallb00daad2015-11-29 19:46:20 -08002215 const VkSpecializationMapEntry* pMapEntries /// Array of map entries
Jesse Halld27f6aa2015-08-15 17:58:48 -07002216 platform.size_t dataSize /// Size in bytes of pData
2217 const void* pData /// Pointer to SpecConstant data
2218}
2219
2220class VkPipelineShaderStageCreateInfo {
2221 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO
2222 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002223 VkPipelineShaderStageCreateFlags flags
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002224 VkShaderStageFlagBits stage
2225 VkShaderModule module
2226 const char* pName
Jesse Halld27f6aa2015-08-15 17:58:48 -07002227 const VkSpecializationInfo* pSpecializationInfo
2228}
2229
2230class VkComputePipelineCreateInfo {
2231 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO
2232 const void* pNext /// Pointer to next structure
Jesse Halld27f6aa2015-08-15 17:58:48 -07002233 VkPipelineCreateFlags flags /// Pipeline creation flags
Jesse Halla6429252015-11-29 18:59:42 -08002234 VkPipelineShaderStageCreateInfo stage
Jesse Halld27f6aa2015-08-15 17:58:48 -07002235 VkPipelineLayout layout /// Interface layout of the pipeline
2236 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
2237 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
2238}
2239
2240class VkVertexInputBindingDescription {
Jesse Hallb00daad2015-11-29 19:46:20 -08002241 u32 binding /// Vertex buffer binding id
2242 u32 stride /// Distance between vertices in bytes (0 = no advancement)
Jesse Hall65ab5522015-11-30 00:07:16 -08002243 VkVertexInputRate inputRate /// Rate at which binding is incremented
Jesse Halld27f6aa2015-08-15 17:58:48 -07002244}
2245
2246class VkVertexInputAttributeDescription {
Jesse Hallb00daad2015-11-29 19:46:20 -08002247 u32 location /// location of the shader vertex attrib
2248 u32 binding /// Vertex buffer binding id
2249 VkFormat format /// format of source data
2250 u32 offset /// Offset of first element in bytes from base of vertex
Jesse Halld27f6aa2015-08-15 17:58:48 -07002251}
2252
2253class VkPipelineVertexInputStateCreateInfo {
Jesse Hall03b6fe12015-11-24 12:44:21 -08002254 VkStructureType sType /// Should be VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO
2255 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002256 VkPipelineVertexInputStateCreateFlags flags
Jesse Hall03b6fe12015-11-24 12:44:21 -08002257 u32 vertexBindingDescriptionCount /// number of bindings
Jesse Halld27f6aa2015-08-15 17:58:48 -07002258 const VkVertexInputBindingDescription* pVertexBindingDescriptions
Jesse Hall03b6fe12015-11-24 12:44:21 -08002259 u32 vertexAttributeDescriptionCount /// number of attributes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002260 const VkVertexInputAttributeDescription* pVertexAttributeDescriptions
2261}
2262
2263class VkPipelineInputAssemblyStateCreateInfo {
2264 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO
2265 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002266 VkPipelineInputAssemblyStateCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002267 VkPrimitiveTopology topology
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002268 VkBool32 primitiveRestartEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002269}
2270
2271class VkPipelineTessellationStateCreateInfo {
2272 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO
2273 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002274 VkPipelineTessellationStateCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002275 u32 patchControlPoints
2276}
2277
2278class VkPipelineViewportStateCreateInfo {
2279 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO
2280 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002281 VkPipelineViewportStateCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002282 u32 viewportCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002283 const VkViewport* pViewports
2284 u32 scissorCount
2285 const VkRect2D* pScissors
Jesse Halld27f6aa2015-08-15 17:58:48 -07002286}
2287
Jesse Hall3fbc8562015-11-29 22:10:52 -08002288class VkPipelineRasterizationStateCreateInfo {
Jesse Hall65ab5522015-11-30 00:07:16 -08002289 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002290 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08002291 VkPipelineRasterizationStateCreateFlags flags
Jesse Hallae38f732015-11-19 21:32:50 -08002292 VkBool32 depthClampEnable
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002293 VkBool32 rasterizerDiscardEnable
Jesse Hall65ab5522015-11-30 00:07:16 -08002294 VkPolygonMode polygonMode /// optional (GL45)
Jesse Hallc7467b72015-11-29 21:05:26 -08002295 VkCullModeFlags cullMode
Jesse Halld27f6aa2015-08-15 17:58:48 -07002296 VkFrontFace frontFace
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002297 VkBool32 depthBiasEnable
Jesse Halla9bb62b2015-11-21 19:31:56 -08002298 f32 depthBiasConstantFactor
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002299 f32 depthBiasClamp
Jesse Halla9bb62b2015-11-21 19:31:56 -08002300 f32 depthBiasSlopeFactor
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002301 f32 lineWidth
Jesse Halld27f6aa2015-08-15 17:58:48 -07002302}
2303
2304class VkPipelineMultisampleStateCreateInfo {
2305 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO
2306 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002307 VkPipelineMultisampleStateCreateFlags flags
Jesse Hall091ed9e2015-11-30 00:55:29 -08002308 VkSampleCountFlagBits rasterizationSamples /// Number of samples used for rasterization
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002309 VkBool32 sampleShadingEnable /// optional (GL45)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002310 f32 minSampleShading /// optional (GL45)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002311 const VkSampleMask* pSampleMask
Jesse Hallacfa5342015-11-19 21:51:33 -08002312 VkBool32 alphaToCoverageEnable
2313 VkBool32 alphaToOneEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002314}
2315
2316class VkPipelineColorBlendAttachmentState {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002317 VkBool32 blendEnable
Jesse Hall65ab5522015-11-30 00:07:16 -08002318 VkBlendFactor srcColorBlendFactor
2319 VkBlendFactor dstColorBlendFactor
2320 VkBlendOp colorBlendOp
2321 VkBlendFactor srcAlphaBlendFactor
2322 VkBlendFactor dstAlphaBlendFactor
2323 VkBlendOp alphaBlendOp
2324 VkColorComponentFlags colorWriteMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07002325}
2326
2327class VkPipelineColorBlendStateCreateInfo {
2328 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO
2329 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002330 VkPipelineColorBlendStateCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002331 VkBool32 logicOpEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002332 VkLogicOp logicOp
2333 u32 attachmentCount /// # of pAttachments
2334 const VkPipelineColorBlendAttachmentState* pAttachments
Jesse Hallb00daad2015-11-29 19:46:20 -08002335 f32[4] blendConstants
Jesse Halld27f6aa2015-08-15 17:58:48 -07002336}
2337
2338class VkStencilOpState {
Jesse Hall65ab5522015-11-30 00:07:16 -08002339 VkStencilOp failOp
2340 VkStencilOp passOp
2341 VkStencilOp depthFailOp
2342 VkCompareOp compareOp
2343 u32 compareMask
2344 u32 writeMask
2345 u32 reference
Jesse Halld27f6aa2015-08-15 17:58:48 -07002346}
2347
2348class VkPipelineDepthStencilStateCreateInfo {
2349 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO
2350 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002351 VkPipelineDepthStencilStateCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002352 VkBool32 depthTestEnable
2353 VkBool32 depthWriteEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002354 VkCompareOp depthCompareOp
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002355 VkBool32 depthBoundsTestEnable /// optional (depth_bounds_test)
2356 VkBool32 stencilTestEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002357 VkStencilOpState front
2358 VkStencilOpState back
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002359 f32 minDepthBounds
2360 f32 maxDepthBounds
2361}
2362
2363class VkPipelineDynamicStateCreateInfo {
2364 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO
2365 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002366 VkPipelineDynamicStateCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002367 u32 dynamicStateCount
2368 const VkDynamicState* pDynamicStates
Jesse Halld27f6aa2015-08-15 17:58:48 -07002369}
2370
2371class VkGraphicsPipelineCreateInfo {
Jesse Halla6429252015-11-29 18:59:42 -08002372 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO
2373 const void* pNext /// Pointer to next structure
2374 VkPipelineCreateFlags flags /// Pipeline creation flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002375 u32 stageCount
Jesse Halla6429252015-11-29 18:59:42 -08002376 const VkPipelineShaderStageCreateInfo* pStages /// One entry for each active shader stage
Jesse Halld27f6aa2015-08-15 17:58:48 -07002377 const VkPipelineVertexInputStateCreateInfo* pVertexInputState
2378 const VkPipelineInputAssemblyStateCreateInfo* pInputAssemblyState
2379 const VkPipelineTessellationStateCreateInfo* pTessellationState
2380 const VkPipelineViewportStateCreateInfo* pViewportState
Jesse Hall3fbc8562015-11-29 22:10:52 -08002381 const VkPipelineRasterizationStateCreateInfo* pRasterizationState
Jesse Halld27f6aa2015-08-15 17:58:48 -07002382 const VkPipelineMultisampleStateCreateInfo* pMultisampleState
2383 const VkPipelineDepthStencilStateCreateInfo* pDepthStencilState
2384 const VkPipelineColorBlendStateCreateInfo* pColorBlendState
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002385 const VkPipelineDynamicStateCreateInfo* pDynamicState
Jesse Halla6429252015-11-29 18:59:42 -08002386 VkPipelineLayout layout /// Interface layout of the pipeline
Jesse Halld27f6aa2015-08-15 17:58:48 -07002387 VkRenderPass renderPass
2388 u32 subpass
Jesse Halla6429252015-11-29 18:59:42 -08002389 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
2390 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 -07002391}
2392
2393class VkPipelineCacheCreateInfo {
Jesse Hallb00daad2015-11-29 19:46:20 -08002394 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO
2395 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002396 VkPipelineCacheCreateFlags flags
Jesse Hallb00daad2015-11-29 19:46:20 -08002397 platform.size_t initialDataSize /// Size of initial data to populate cache, in bytes
2398 const void* pInitialData /// Initial data to populate cache
Jesse Halld27f6aa2015-08-15 17:58:48 -07002399}
2400
2401class VkPushConstantRange {
2402 VkShaderStageFlags stageFlags /// Which stages use the range
Jesse Hall03b6fe12015-11-24 12:44:21 -08002403 u32 offset /// Start of the range, in bytes
2404 u32 size /// Length of the range, in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002405}
2406
2407class VkPipelineLayoutCreateInfo {
2408 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO
2409 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002410 VkPipelineLayoutCreateFlags flags
Jesse Hall3dd678a2016-01-08 21:52:01 -08002411 u32 descriptorSetCount /// Number of descriptor sets interfaced by the pipeline
Jesse Halld27f6aa2015-08-15 17:58:48 -07002412 const VkDescriptorSetLayout* pSetLayouts /// Array of <setCount> number of descriptor set layout objects defining the layout of the
2413 u32 pushConstantRangeCount /// Number of push-constant ranges used by the pipeline
2414 const VkPushConstantRange* pPushConstantRanges /// Array of pushConstantRangeCount number of ranges used by various shader stages
2415}
2416
2417class VkSamplerCreateInfo {
2418 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO
2419 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002420 VkSamplerCreateFlags flags
Jesse Hall23ff73f2015-11-29 14:36:39 -08002421 VkFilter magFilter /// Filter mode for magnification
2422 VkFilter minFilter /// Filter mode for minifiation
2423 VkSamplerMipmapMode mipmapMode /// Mipmap selection mode
2424 VkSamplerAddressMode addressModeU
2425 VkSamplerAddressMode addressModeV
2426 VkSamplerAddressMode addressModeW
Jesse Halld27f6aa2015-08-15 17:58:48 -07002427 f32 mipLodBias
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002428 VkBool32 anisotropyEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002429 f32 maxAnisotropy
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002430 VkBool32 compareEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002431 VkCompareOp compareOp
2432 f32 minLod
2433 f32 maxLod
2434 VkBorderColor borderColor
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002435 VkBool32 unnormalizedCoordinates
Jesse Halld27f6aa2015-08-15 17:58:48 -07002436}
2437
Jesse Hall3fbc8562015-11-29 22:10:52 -08002438class VkCommandPoolCreateInfo {
2439 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002440 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08002441 VkCommandPoolCreateFlags flags /// Command pool creation flags
Jesse Halla6429252015-11-29 18:59:42 -08002442 u32 queueFamilyIndex
Jesse Halld27f6aa2015-08-15 17:58:48 -07002443}
2444
Jesse Hall3fbc8562015-11-29 22:10:52 -08002445class VkCommandBufferAllocateInfo {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002446 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002447 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08002448 VkCommandPool commandPool
2449 VkCommandBufferLevel level
Jesse Hall3dd678a2016-01-08 21:52:01 -08002450 u32 commandBufferCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002451}
2452
Jesse Hall3dd678a2016-01-08 21:52:01 -08002453class VkCommandBufferInheritanceInfo {
2454 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002455 const void* pNext /// Pointer to next structure
Jesse Halld27f6aa2015-08-15 17:58:48 -07002456 VkRenderPass renderPass /// Render pass for secondary command buffers
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002457 u32 subpass
Jesse Halld27f6aa2015-08-15 17:58:48 -07002458 VkFramebuffer framebuffer /// Framebuffer for secondary command buffers
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002459 VkBool32 occlusionQueryEnable
2460 VkQueryControlFlags queryFlags
2461 VkQueryPipelineStatisticFlags pipelineStatistics
Jesse Halld27f6aa2015-08-15 17:58:48 -07002462}
2463
Jesse Hall3dd678a2016-01-08 21:52:01 -08002464class VkCommandBufferBeginInfo {
2465 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO
2466 const void* pNext /// Pointer to next structure
2467 VkCommandBufferUsageFlags flags /// Command buffer usage flags
2468 const VkCommandBufferInheritanceInfo* pInheritanceInfo
2469}
2470
Jesse Halld27f6aa2015-08-15 17:58:48 -07002471class VkRenderPassBeginInfo {
2472 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO
2473 const void* pNext /// Pointer to next structure
2474 VkRenderPass renderPass
2475 VkFramebuffer framebuffer
2476 VkRect2D renderArea
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002477 u32 clearValueCount
2478 const VkClearValue* pClearValues
Jesse Halld27f6aa2015-08-15 17:58:48 -07002479}
2480
2481@union
2482/// Union allowing specification of floating point, integer, or unsigned integer color data. Actual value selected is based on image/attachment being cleared.
2483class VkClearColorValue {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002484 f32[4] float32
2485 s32[4] int32
2486 u32[4] uint32
Jesse Halld27f6aa2015-08-15 17:58:48 -07002487}
2488
2489class VkClearDepthStencilValue {
2490 f32 depth
2491 u32 stencil
2492}
2493
2494@union
2495/// Union allowing specification of color, depth, and stencil color values. Actual value selected is based on attachment being cleared.
2496class VkClearValue {
2497 VkClearColorValue color
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002498 VkClearDepthStencilValue depthStencil
Jesse Halld27f6aa2015-08-15 17:58:48 -07002499}
2500
Jesse Hallae38f732015-11-19 21:32:50 -08002501class VkClearAttachment {
2502 VkImageAspectFlags aspectMask
2503 u32 colorAttachment
2504 VkClearValue clearValue
2505}
2506
Jesse Halld27f6aa2015-08-15 17:58:48 -07002507class VkAttachmentDescription {
Jesse Halla6429252015-11-29 18:59:42 -08002508 VkAttachmentDescriptionFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002509 VkFormat format
Jesse Hall091ed9e2015-11-30 00:55:29 -08002510 VkSampleCountFlagBits samples
Jesse Halld27f6aa2015-08-15 17:58:48 -07002511 VkAttachmentLoadOp loadOp /// Load op for color or depth data
2512 VkAttachmentStoreOp storeOp /// Store op for color or depth data
2513 VkAttachmentLoadOp stencilLoadOp /// Load op for stencil data
2514 VkAttachmentStoreOp stencilStoreOp /// Store op for stencil data
2515 VkImageLayout initialLayout
2516 VkImageLayout finalLayout
2517}
2518
2519class VkAttachmentReference {
2520 u32 attachment
2521 VkImageLayout layout
2522}
2523
2524class VkSubpassDescription {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002525 VkSubpassDescriptionFlags flags
Jesse Halla6429252015-11-29 18:59:42 -08002526 VkPipelineBindPoint pipelineBindPoint /// Must be VK_PIPELINE_BIND_POINT_GRAPHICS for now
Jesse Hall03b6fe12015-11-24 12:44:21 -08002527 u32 inputAttachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002528 const VkAttachmentReference* pInputAttachments
Jesse Hall03b6fe12015-11-24 12:44:21 -08002529 u32 colorAttachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002530 const VkAttachmentReference* pColorAttachments
2531 const VkAttachmentReference* pResolveAttachments
Jesse Hallc7467b72015-11-29 21:05:26 -08002532 const VkAttachmentReference* pDepthStencilAttachment
Jesse Hall03b6fe12015-11-24 12:44:21 -08002533 u32 preserveAttachmentCount
Jesse Hall3dd678a2016-01-08 21:52:01 -08002534 const u32* pPreserveAttachments
Jesse Halld27f6aa2015-08-15 17:58:48 -07002535}
2536
2537class VkSubpassDependency {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002538 u32 srcSubpass
Jesse Hall3fbc8562015-11-29 22:10:52 -08002539 u32 dstSubpass
Jesse Halld27f6aa2015-08-15 17:58:48 -07002540 VkPipelineStageFlags srcStageMask
Jesse Hall3fbc8562015-11-29 22:10:52 -08002541 VkPipelineStageFlags dstStageMask
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002542 VkAccessFlags srcAccessMask
2543 VkAccessFlags dstAccessMask
Jesse Halldc6d36c2015-11-29 19:12:15 -08002544 VkDependencyFlags dependencyFlags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002545}
2546
2547class VkRenderPassCreateInfo {
2548 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO
2549 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002550 VkRenderPassCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002551 u32 attachmentCount
2552 const VkAttachmentDescription* pAttachments
2553 u32 subpassCount
2554 const VkSubpassDescription* pSubpasses
2555 u32 dependencyCount
2556 const VkSubpassDependency* pDependencies
2557}
2558
2559class VkEventCreateInfo {
2560 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_EVENT_CREATE_INFO
2561 const void* pNext /// Pointer to next structure
2562 VkEventCreateFlags flags /// Event creation flags
2563}
2564
2565class VkFenceCreateInfo {
2566 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_FENCE_CREATE_INFO
2567 const void* pNext /// Pointer to next structure
2568 VkFenceCreateFlags flags /// Fence creation flags
2569}
2570
2571class VkPhysicalDeviceFeatures {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002572 VkBool32 robustBufferAccess /// out of bounds buffer accesses are well defined
2573 VkBool32 fullDrawIndexUint32 /// full 32-bit range of indices for indexed draw calls
2574 VkBool32 imageCubeArray /// image views which are arrays of cube maps
2575 VkBool32 independentBlend /// blending operations are controlled per-attachment
2576 VkBool32 geometryShader /// geometry stage
2577 VkBool32 tessellationShader /// tessellation control and evaluation stage
2578 VkBool32 sampleRateShading /// per-sample shading and interpolation
Jesse Hall3fbc8562015-11-29 22:10:52 -08002579 VkBool32 dualSrcBlend /// blend operations which take two sources
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002580 VkBool32 logicOp /// logic operations
2581 VkBool32 multiDrawIndirect /// multi draw indirect
Jesse Hall543a7ff2016-01-08 16:38:30 -08002582 VkBool32 drawIndirectFirstInstance
Jesse Hallae38f732015-11-19 21:32:50 -08002583 VkBool32 depthClamp /// depth clamping
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002584 VkBool32 depthBiasClamp /// depth bias clamping
2585 VkBool32 fillModeNonSolid /// point and wireframe fill modes
2586 VkBool32 depthBounds /// depth bounds test
2587 VkBool32 wideLines /// lines with width greater than 1
2588 VkBool32 largePoints /// points with size greater than 1
Jesse Hallfbf97b02015-11-20 14:17:03 -08002589 VkBool32 alphaToOne /// The fragment alpha channel can be forced to maximum representable alpha value
2590 VkBool32 multiViewport
2591 VkBool32 samplerAnisotropy
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002592 VkBool32 textureCompressionETC2 /// ETC texture compression formats
2593 VkBool32 textureCompressionASTC_LDR /// ASTC LDR texture compression formats
2594 VkBool32 textureCompressionBC /// BC1-7 texture compressed formats
Jesse Hall65ab5522015-11-30 00:07:16 -08002595 VkBool32 occlusionQueryPrecise
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002596 VkBool32 pipelineStatisticsQuery /// pipeline statistics query
Jesse Halldc6d36c2015-11-29 19:12:15 -08002597 VkBool32 vertexPipelineStoresAndAtomics
2598 VkBool32 fragmentStoresAndAtomics
2599 VkBool32 shaderTessellationAndGeometryPointSize
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002600 VkBool32 shaderImageGatherExtended /// texture gather with run-time values and independent offsets
2601 VkBool32 shaderStorageImageExtendedFormats /// the extended set of formats can be used for storage images
2602 VkBool32 shaderStorageImageMultisample /// multisample images can be used for storage images
Jesse Halld1af8122015-11-29 23:50:38 -08002603 VkBool32 shaderStorageImageReadWithoutFormat
2604 VkBool32 shaderStorageImageWriteWithoutFormat
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002605 VkBool32 shaderUniformBufferArrayDynamicIndexing /// arrays of uniform buffers can be accessed with dynamically uniform indices
2606 VkBool32 shaderSampledImageArrayDynamicIndexing /// arrays of sampled images can be accessed with dynamically uniform indices
2607 VkBool32 shaderStorageBufferArrayDynamicIndexing /// arrays of storage buffers can be accessed with dynamically uniform indices
2608 VkBool32 shaderStorageImageArrayDynamicIndexing /// arrays of storage images can be accessed with dynamically uniform indices
2609 VkBool32 shaderClipDistance /// clip distance in shaders
2610 VkBool32 shaderCullDistance /// cull distance in shaders
2611 VkBool32 shaderFloat64 /// 64-bit floats (doubles) in shaders
2612 VkBool32 shaderInt64 /// 64-bit integers in shaders
2613 VkBool32 shaderInt16 /// 16-bit integers in shaders
2614 VkBool32 shaderResourceResidency /// shader can use texture operations that return resource residency information (requires sparseNonResident support)
Jesse Hall65ab5522015-11-30 00:07:16 -08002615 VkBool32 shaderResourceMinLod /// shader can use texture operations that specify minimum resource LOD
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002616 VkBool32 sparseBinding /// Sparse resources support: Resource memory can be managed at opaque page level rather than object level
2617 VkBool32 sparseResidencyBuffer /// Sparse resources support: GPU can access partially resident buffers
2618 VkBool32 sparseResidencyImage2D /// Sparse resources support: GPU can access partially resident 2D (non-MSAA non-DepthStencil) images
2619 VkBool32 sparseResidencyImage3D /// Sparse resources support: GPU can access partially resident 3D images
2620 VkBool32 sparseResidency2Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 2 samples
2621 VkBool32 sparseResidency4Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 4 samples
2622 VkBool32 sparseResidency8Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 8 samples
2623 VkBool32 sparseResidency16Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 16 samples
2624 VkBool32 sparseResidencyAliased /// Sparse resources support: GPU can correctly access data aliased into multiple locations (opt-in)
Jesse Halld1af8122015-11-29 23:50:38 -08002625 VkBool32 variableMultisampleRate
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002626 VkBool32 inheritedQueries
Jesse Halld27f6aa2015-08-15 17:58:48 -07002627}
2628
2629class VkPhysicalDeviceLimits {
2630 /// resource maximum sizes
2631 u32 maxImageDimension1D /// max 1D image dimension
2632 u32 maxImageDimension2D /// max 2D image dimension
2633 u32 maxImageDimension3D /// max 3D image dimension
2634 u32 maxImageDimensionCube /// max cubemap image dimension
2635 u32 maxImageArrayLayers /// max layers for image arrays
Jesse Hallb00daad2015-11-29 19:46:20 -08002636 u32 maxTexelBufferElements
Jesse Hallfbf97b02015-11-20 14:17:03 -08002637 u32 maxUniformBufferRange /// max uniform buffer size (bytes)
2638 u32 maxStorageBufferRange /// max storage buffer size (bytes)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002639 u32 maxPushConstantsSize /// max size of the push constants pool (bytes)
2640 /// memory limits
2641 u32 maxMemoryAllocationCount /// max number of device memory allocations supported
Jesse Hall091ed9e2015-11-30 00:55:29 -08002642 u32 maxSamplerAllocationCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002643 VkDeviceSize bufferImageGranularity /// Granularity (in bytes) at which buffers and images can be bound to adjacent memory for simultaneous usage
2644 VkDeviceSize sparseAddressSpaceSize /// Total address space available for sparse allocations (bytes)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002645 /// descriptor set limits
2646 u32 maxBoundDescriptorSets /// max number of descriptors sets that can be bound to a pipeline
Jesse Halld27f6aa2015-08-15 17:58:48 -07002647 u32 maxPerStageDescriptorSamplers /// max num of samplers allowed per-stage in a descriptor set
2648 u32 maxPerStageDescriptorUniformBuffers /// max num of uniform buffers allowed per-stage in a descriptor set
2649 u32 maxPerStageDescriptorStorageBuffers /// max num of storage buffers allowed per-stage in a descriptor set
2650 u32 maxPerStageDescriptorSampledImages /// max num of sampled images allowed per-stage in a descriptor set
2651 u32 maxPerStageDescriptorStorageImages /// max num of storage images allowed per-stage in a descriptor set
Jesse Halle1b12782015-11-30 11:27:32 -08002652 u32 maxPerStageDescriptorInputAttachments
Jesse Halldba27f72015-11-30 14:25:46 -08002653 u32 maxPerStageResources
Jesse Halld27f6aa2015-08-15 17:58:48 -07002654 u32 maxDescriptorSetSamplers /// max num of samplers allowed in all stages in a descriptor set
2655 u32 maxDescriptorSetUniformBuffers /// max num of uniform buffers allowed in all stages in a descriptor set
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002656 u32 maxDescriptorSetUniformBuffersDynamic /// max num of dynamic uniform buffers allowed in all stages in a descriptor set
Jesse Halld27f6aa2015-08-15 17:58:48 -07002657 u32 maxDescriptorSetStorageBuffers /// max num of storage buffers allowed in all stages in a descriptor set
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002658 u32 maxDescriptorSetStorageBuffersDynamic /// max num of dynamic storage buffers allowed in all stages in a descriptor set
Jesse Halld27f6aa2015-08-15 17:58:48 -07002659 u32 maxDescriptorSetSampledImages /// max num of sampled images allowed in all stages in a descriptor set
2660 u32 maxDescriptorSetStorageImages /// max num of storage images allowed in all stages in a descriptor set
Jesse Halle1b12782015-11-30 11:27:32 -08002661 u32 maxDescriptorSetInputAttachments
Jesse Halld27f6aa2015-08-15 17:58:48 -07002662 /// vertex stage limits
2663 u32 maxVertexInputAttributes /// max num of vertex input attribute slots
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002664 u32 maxVertexInputBindings /// max num of vertex input binding slots
Jesse Halld27f6aa2015-08-15 17:58:48 -07002665 u32 maxVertexInputAttributeOffset /// max vertex input attribute offset added to vertex buffer offset
2666 u32 maxVertexInputBindingStride /// max vertex input binding stride
2667 u32 maxVertexOutputComponents /// max num of output components written by vertex shader
2668 /// tessellation control stage limits
Jesse Hall3fbc8562015-11-29 22:10:52 -08002669 u32 maxTessellationGenerationLevel /// max level supported by tess primitive generator
Jesse Hallae38f732015-11-19 21:32:50 -08002670 u32 maxTessellationPatchSize /// max patch size (vertices)
2671 u32 maxTessellationControlPerVertexInputComponents /// max num of input components per-vertex in TCS
2672 u32 maxTessellationControlPerVertexOutputComponents /// max num of output components per-vertex in TCS
2673 u32 maxTessellationControlPerPatchOutputComponents /// max num of output components per-patch in TCS
2674 u32 maxTessellationControlTotalOutputComponents /// max total num of per-vertex and per-patch output components in TCS
2675 u32 maxTessellationEvaluationInputComponents /// max num of input components per vertex in TES
2676 u32 maxTessellationEvaluationOutputComponents /// max num of output components per vertex in TES
Jesse Halld27f6aa2015-08-15 17:58:48 -07002677 /// geometry stage limits
2678 u32 maxGeometryShaderInvocations /// max invocation count supported in geometry shader
2679 u32 maxGeometryInputComponents /// max num of input components read in geometry stage
2680 u32 maxGeometryOutputComponents /// max num of output components written in geometry stage
2681 u32 maxGeometryOutputVertices /// max num of vertices that can be emitted in geometry stage
2682 u32 maxGeometryTotalOutputComponents /// max total num of components (all vertices) written in geometry stage
2683 /// fragment stage limits
2684 u32 maxFragmentInputComponents /// max num of input compontents read in fragment stage
Jesse Hallfbf97b02015-11-20 14:17:03 -08002685 u32 maxFragmentOutputAttachments /// max num of output attachments written in fragment stage
Jesse Hall3fbc8562015-11-29 22:10:52 -08002686 u32 maxFragmentDualSrcAttachments /// max num of output attachments written when using dual source blending
Jesse Halld27f6aa2015-08-15 17:58:48 -07002687 u32 maxFragmentCombinedOutputResources /// max total num of storage buffers, storage images and output buffers
2688 /// compute stage limits
2689 u32 maxComputeSharedMemorySize /// max total storage size of work group local storage (bytes)
2690 u32[3] maxComputeWorkGroupCount /// max num of compute work groups that may be dispatched by a single command (x,y,z)
2691 u32 maxComputeWorkGroupInvocations /// max total compute invocations in a single local work group
2692 u32[3] maxComputeWorkGroupSize /// max local size of a compute work group (x,y,z)
2693
2694 u32 subPixelPrecisionBits /// num bits of subpixel precision in screen x and y
2695 u32 subTexelPrecisionBits /// num bits of subtexel precision
2696 u32 mipmapPrecisionBits /// num bits of mipmap precision
2697
2698 u32 maxDrawIndexedIndexValue /// max index value for indexed draw calls (for 32-bit indices)
Jesse Halldba27f72015-11-30 14:25:46 -08002699 u32 maxDrawIndirectCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002700
2701 f32 maxSamplerLodBias /// max absolute sampler level of detail bias
2702 f32 maxSamplerAnisotropy /// max degree of sampler anisotropy
2703
2704 u32 maxViewports /// max number of active viewports
Jesse Halld27f6aa2015-08-15 17:58:48 -07002705 u32[2] maxViewportDimensions /// max viewport dimensions (x,y)
2706 f32[2] viewportBoundsRange /// viewport bounds range (min,max)
2707 u32 viewportSubPixelBits /// num bits of subpixel precision for viewport
2708
Jesse Halldc6d36c2015-11-29 19:12:15 -08002709 platform.size_t minMemoryMapAlignment /// min required alignment of pointers returned by MapMemory (bytes)
2710 VkDeviceSize minTexelBufferOffsetAlignment /// min required alignment for texel buffer offsets (bytes)
2711 VkDeviceSize minUniformBufferOffsetAlignment /// min required alignment for uniform buffer sizes and offsets (bytes)
2712 VkDeviceSize minStorageBufferOffsetAlignment /// min required alignment for storage buffer offsets (bytes)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002713
Jesse Hallfbf97b02015-11-20 14:17:03 -08002714 s32 minTexelOffset /// min texel offset for OpTextureSampleOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07002715 u32 maxTexelOffset /// max texel offset for OpTextureSampleOffset
Jesse Hallfbf97b02015-11-20 14:17:03 -08002716 s32 minTexelGatherOffset /// min texel offset for OpTextureGatherOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07002717 u32 maxTexelGatherOffset /// max texel offset for OpTextureGatherOffset
2718 f32 minInterpolationOffset /// furthest negative offset for interpolateAtOffset
2719 f32 maxInterpolationOffset /// furthest positive offset for interpolateAtOffset
2720 u32 subPixelInterpolationOffsetBits /// num of subpixel bits for interpolateAtOffset
2721
2722 u32 maxFramebufferWidth /// max width for a framebuffer
2723 u32 maxFramebufferHeight /// max height for a framebuffer
2724 u32 maxFramebufferLayers /// max layer count for a layered framebuffer
Jesse Hall091ed9e2015-11-30 00:55:29 -08002725 VkSampleCountFlags framebufferColorSampleCounts
2726 VkSampleCountFlags framebufferDepthSampleCounts
2727 VkSampleCountFlags framebufferStencilSampleCounts
2728 VkSampleCountFlags framebufferNoAttachmentSampleCounts
Jesse Halld27f6aa2015-08-15 17:58:48 -07002729 u32 maxColorAttachments /// max num of framebuffer color attachments
2730
Jesse Hall091ed9e2015-11-30 00:55:29 -08002731 VkSampleCountFlags sampledImageColorSampleCounts
2732 VkSampleCountFlags sampledImageIntegerSampleCounts
2733 VkSampleCountFlags sampledImageDepthSampleCounts
2734 VkSampleCountFlags sampledImageStencilSampleCounts
2735 VkSampleCountFlags storageImageSampleCounts
Jesse Halld27f6aa2015-08-15 17:58:48 -07002736 u32 maxSampleMaskWords /// max num of sample mask words
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002737 VkBool32 timestampComputeAndGraphics
Jesse Halld27f6aa2015-08-15 17:58:48 -07002738
Jesse Halla9bb62b2015-11-21 19:31:56 -08002739 f32 timestampPeriod
Jesse Halld27f6aa2015-08-15 17:58:48 -07002740
2741 u32 maxClipDistances /// max number of clip distances
2742 u32 maxCullDistances /// max number of cull distances
2743 u32 maxCombinedClipAndCullDistances /// max combined number of user clipping
2744
Jesse Hallfbf97b02015-11-20 14:17:03 -08002745 u32 discreteQueuePriorities
2746
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002747 f32[2] pointSizeRange /// range (min,max) of supported point sizes
2748 f32[2] lineWidthRange /// range (min,max) of supported line widths
Jesse Halld27f6aa2015-08-15 17:58:48 -07002749 f32 pointSizeGranularity /// granularity of supported point sizes
2750 f32 lineWidthGranularity /// granularity of supported line widths
Jesse Hall03b6fe12015-11-24 12:44:21 -08002751 VkBool32 strictLines
Jesse Hall091ed9e2015-11-30 00:55:29 -08002752 VkBool32 standardSampleLocations
Jesse Halla9bb62b2015-11-21 19:31:56 -08002753
Jesse Hall65ab5522015-11-30 00:07:16 -08002754 VkDeviceSize optimalBufferCopyOffsetAlignment
2755 VkDeviceSize optimalBufferCopyRowPitchAlignment
Jesse Halldba27f72015-11-30 14:25:46 -08002756 VkDeviceSize nonCoherentAtomSize
Jesse Halld27f6aa2015-08-15 17:58:48 -07002757}
2758
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002759class VkPhysicalDeviceSparseProperties {
2760 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 -08002761 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 -07002762 VkBool32 residencyStandard3DBlockShape /// Sparse resources support: GPU will access all 3D sparse resources using the standard block shapes (based on pixel format)
2763 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 -07002764 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
2765}
2766
Jesse Halld27f6aa2015-08-15 17:58:48 -07002767class VkSemaphoreCreateInfo {
2768 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO
2769 const void* pNext /// Pointer to next structure
2770 VkSemaphoreCreateFlags flags /// Semaphore creation flags
2771}
2772
2773class VkQueryPoolCreateInfo {
2774 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO
2775 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002776 VkQueryPoolCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002777 VkQueryType queryType
Jesse Hall3dd678a2016-01-08 21:52:01 -08002778 u32 queryCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002779 VkQueryPipelineStatisticFlags pipelineStatistics /// Optional
2780}
2781
2782class VkFramebufferCreateInfo {
2783 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO
2784 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002785 VkFramebufferCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002786 VkRenderPass renderPass
2787 u32 attachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002788 const VkImageView* pAttachments
Jesse Halld27f6aa2015-08-15 17:58:48 -07002789 u32 width
2790 u32 height
2791 u32 layers
2792}
2793
Jesse Hall3fbc8562015-11-29 22:10:52 -08002794class VkDrawIndirectCommand {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002795 u32 vertexCount
2796 u32 instanceCount
2797 u32 firstVertex
2798 u32 firstInstance
2799}
2800
Jesse Hall3fbc8562015-11-29 22:10:52 -08002801class VkDrawIndexedIndirectCommand {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002802 u32 indexCount
2803 u32 instanceCount
2804 u32 firstIndex
2805 s32 vertexOffset
2806 u32 firstInstance
2807}
2808
Jesse Hall3fbc8562015-11-29 22:10:52 -08002809class VkDispatchIndirectCommand {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002810 u32 x
2811 u32 y
2812 u32 z
2813}
2814
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002815@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08002816class VkSurfaceCapabilitiesKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002817 u32 minImageCount
2818 u32 maxImageCount
2819 VkExtent2D currentExtent
2820 VkExtent2D minImageExtent
2821 VkExtent2D maxImageExtent
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002822 u32 maxImageArrayLayers
Jesse Hall1356b0d2015-11-23 17:24:58 -08002823 VkSurfaceTransformFlagsKHR supportedTransforms
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002824 VkSurfaceTransformFlagBitsKHR currentTransform
Jesse Halla6429252015-11-29 18:59:42 -08002825 VkCompositeAlphaFlagsKHR supportedCompositeAlpha
Jesse Hall1356b0d2015-11-23 17:24:58 -08002826 VkImageUsageFlags supportedUsageFlags
Michael Lentine88594d72015-11-12 12:49:45 -08002827}
2828
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002829@extension("VK_KHR_surface")
Michael Lentine88594d72015-11-12 12:49:45 -08002830class VkSurfaceFormatKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002831 VkFormat format
2832 VkColorSpaceKHR colorSpace
Michael Lentine88594d72015-11-12 12:49:45 -08002833}
2834
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002835@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08002836class VkSwapchainCreateInfoKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002837 VkStructureType sType
2838 const void* pNext
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002839 VkSwapchainCreateFlagsKHR flags
Jesse Hall1356b0d2015-11-23 17:24:58 -08002840 VkSurfaceKHR surface
2841 u32 minImageCount
2842 VkFormat imageFormat
2843 VkColorSpaceKHR imageColorSpace
2844 VkExtent2D imageExtent
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002845 u32 imageArrayLayers
2846 VkImageUsageFlags imageUsage
Jesse Hall1356b0d2015-11-23 17:24:58 -08002847 VkSharingMode sharingMode
Jesse Hall03b6fe12015-11-24 12:44:21 -08002848 u32 queueFamilyIndexCount
Jesse Hall1356b0d2015-11-23 17:24:58 -08002849 const u32* pQueueFamilyIndices
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002850 VkSurfaceTransformFlagBitsKHR preTransform
2851 VkCompositeAlphaFlagBitsKHR compositeAlpha
Jesse Hall1356b0d2015-11-23 17:24:58 -08002852 VkPresentModeKHR presentMode
Jesse Hall1356b0d2015-11-23 17:24:58 -08002853 VkBool32 clipped
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002854 VkSwapchainKHR oldSwapchain
Michael Lentine88594d72015-11-12 12:49:45 -08002855}
2856
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002857@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08002858class VkPresentInfoKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002859 VkStructureType sType
2860 const void* pNext
Jesse Hallb00daad2015-11-29 19:46:20 -08002861 u32 waitSemaphoreCount
2862 const VkSemaphore* pWaitSemaphores
Jesse Hall1356b0d2015-11-23 17:24:58 -08002863 u32 swapchainCount
Jesse Hall03b6fe12015-11-24 12:44:21 -08002864 const VkSwapchainKHR* pSwapchains
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002865 const u32* pImageIndices
Jesse Halle1b12782015-11-30 11:27:32 -08002866 VkResult* pResults
Michael Lentine88594d72015-11-12 12:49:45 -08002867}
2868
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002869@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002870class VkDisplayPropertiesKHR {
2871 VkDisplayKHR display
2872 const char* displayName
2873 VkExtent2D physicalDimensions
2874 VkExtent2D physicalResolution
2875 VkSurfaceTransformFlagsKHR supportedTransforms
Jesse Hall1356b0d2015-11-23 17:24:58 -08002876 VkBool32 planeReorderPossible
Jesse Halla6429252015-11-29 18:59:42 -08002877 VkBool32 persistentContent
Michael Lentine88594d72015-11-12 12:49:45 -08002878}
2879
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002880@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08002881class VkDisplayModeParametersKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002882 VkExtent2D visibleRegion
Jesse Halla6429252015-11-29 18:59:42 -08002883 u32 refreshRate
Michael Lentine88594d72015-11-12 12:49:45 -08002884}
Jesse Halld27f6aa2015-08-15 17:58:48 -07002885
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002886@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002887class VkDisplayModePropertiesKHR {
2888 VkDisplayModeKHR displayMode
Jesse Halla6429252015-11-29 18:59:42 -08002889 VkDisplayModeParametersKHR parameters
Jesse Hall1356b0d2015-11-23 17:24:58 -08002890}
2891
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002892@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002893class VkDisplayModeCreateInfoKHR {
2894 VkStructureType sType
2895 const void* pNext
Jesse Hall9ba8bc82015-11-30 16:22:16 -08002896 VkDisplayModeCreateFlagsKHR flags
Jesse Halla6429252015-11-29 18:59:42 -08002897 VkDisplayModeParametersKHR parameters
Jesse Hall1356b0d2015-11-23 17:24:58 -08002898}
2899
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002900@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002901class VkDisplayPlanePropertiesKHR {
Jesse Halla6429252015-11-29 18:59:42 -08002902 VkDisplayKHR currentDisplay
2903 u32 currentStackIndex
2904}
2905
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002906@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08002907class VkDisplayPlaneCapabilitiesKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002908 VkDisplayPlaneAlphaFlagsKHR supportedAlpha
2909 VkOffset2D minSrcPosition
2910 VkOffset2D maxSrcPosition
2911 VkExtent2D minSrcExtent
2912 VkExtent2D maxSrcExtent
2913 VkOffset2D minDstPosition
2914 VkOffset2D maxDstPosition
2915 VkExtent2D minDstExtent
2916 VkExtent2D maxDstExtent
2917}
2918
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002919@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08002920class VkDisplaySurfaceCreateInfoKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002921 VkStructureType sType
2922 const void* pNext
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002923 VkDisplaySurfaceCreateFlagsKHR flags
Jesse Hall1356b0d2015-11-23 17:24:58 -08002924 VkDisplayModeKHR displayMode
2925 u32 planeIndex
2926 u32 planeStackIndex
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002927 VkSurfaceTransformFlagBitsKHR transform
Jesse Hall1356b0d2015-11-23 17:24:58 -08002928 f32 globalAlpha
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002929 VkDisplayPlaneAlphaFlagBitsKHR alphaMode
2930 VkExtent2D imageExtent
Jesse Hall1356b0d2015-11-23 17:24:58 -08002931}
2932
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002933@extension("VK_KHR_display_swapchain")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002934class VkDisplayPresentInfoKHR {
2935 VkStructureType sType
2936 const void* pNext
2937 VkRect2D srcRect
2938 VkRect2D dstRect
Jesse Halla6429252015-11-29 18:59:42 -08002939 VkBool32 persistent
Jesse Hall1356b0d2015-11-23 17:24:58 -08002940}
2941
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002942@extension("VK_KHR_xlib_surface")
2943class VkXlibSurfaceCreateInfoKHR {
2944 VkStructureType sType
2945 const void* pNext
2946 VkXlibSurfaceCreateFlagsKHR flags
2947 platform.Display* dpy
2948 platform.Window window
2949}
2950
2951@extension("VK_KHR_xcb_surface")
2952class VkXcbSurfaceCreateInfoKHR {
2953 VkStructureType sType
2954 const void* pNext
2955 VkXcbSurfaceCreateFlagsKHR flags
2956 platform.xcb_connection_t* connection
2957 platform.xcb_window_t window
2958}
2959
2960@extension("VK_KHR_wayland_surface")
2961class VkWaylandSurfaceCreateInfoKHR {
2962 VkStructureType sType
2963 const void* pNext
2964 VkWaylandSurfaceCreateFlagsKHR flags
2965 platform.wl_display* display
2966 platform.wl_surface* surface
2967}
2968
2969@extension("VK_KHR_mir_surface")
2970class VkMirSurfaceCreateInfoKHR {
2971 VkStructureType sType
2972 const void* pNext
2973 VkMirSurfaceCreateFlagsKHR flags
2974 platform.MirConnection* connection
2975 platform.MirSurface* mirSurface
2976}
2977
2978@extension("VK_KHR_android_surface")
2979class VkAndroidSurfaceCreateInfoKHR {
2980 VkStructureType sType
2981 const void* pNext
2982 VkAndroidSurfaceCreateFlagsKHR flags
2983 platform.ANativeWindow* window
2984}
2985
2986@extension("VK_KHR_win32_surface")
2987class VkWin32SurfaceCreateInfoKHR {
2988 VkStructureType sType
2989 const void* pNext
2990 VkWin32SurfaceCreateFlagsKHR flags
2991 platform.HINSTANCE hinstance
2992 platform.HWND hwnd
2993}
2994
Jesse Halld1abd742017-02-09 21:45:51 -08002995@internal class Gralloc1Usage {
2996 u64 consumer
2997 u64 producer
2998}
2999
Chia-I Wub262ddc2016-03-22 07:38:20 +08003000@extension("VK_ANDROID_native_buffer")
3001class VkNativeBufferANDROID {
3002 VkStructureType sType
3003 const void* pNext
3004 platform.buffer_handle_t handle
Jesse Halld1abd742017-02-09 21:45:51 -08003005 s32 stride
3006 s32 format
3007 s32 usage
3008 Gralloc1Usage usage2
Chia-I Wub262ddc2016-03-22 07:38:20 +08003009}
3010
Chris Forbes8e4438b2016-12-07 16:26:49 +13003011@extension("VK_ANDROID_native_buffer")
3012class VkSwapchainImageCreateInfoANDROID {
3013 VkStructureType sType
3014 const void* pNext
Chris Forbes134d9582017-01-12 14:26:37 +13003015 VkSwapchainImageUsageFlagsANDROID flags
Chris Forbes48853712017-01-12 14:09:33 +13003016}
Ian Elliott4c8bb2a2016-12-29 11:07:26 -07003017
Chris Forbes1d4e5542017-02-15 19:38:50 +13003018@extension("VK_ANDROID_native_buffer")
3019class VkPhysicalDevicePresentationPropertiesANDROID {
3020 VkStructureType sType
3021 void* pNext
3022 VkBool32 sharedImage
3023}
3024
Ian Elliott4c8bb2a2016-12-29 11:07:26 -07003025@extension("VK_GOOGLE_display_timing")
3026class VkRefreshCycleDurationGOOGLE {
Chris Forbes48853712017-01-12 14:09:33 +13003027 u64 minRefreshDuration
3028 u64 maxRefreshDuration
Ian Elliott4c8bb2a2016-12-29 11:07:26 -07003029}
3030
3031@extension("VK_GOOGLE_display_timing")
3032class VkPastPresentationTimingGOOGLE {
Chris Forbes48853712017-01-12 14:09:33 +13003033 u32 presentID
3034 u64 desiredPresentTime
3035 u64 actualPresentTime
3036 u64 earliestPresentTime
3037 u64 presentMargin
Ian Elliott4c8bb2a2016-12-29 11:07:26 -07003038}
3039
3040@extension("VK_GOOGLE_display_timing")
3041class VkPresentTimeGOOGLE {
Chris Forbes48853712017-01-12 14:09:33 +13003042 u32 presentID
3043 u64 desiredPresentTime
Ian Elliott4c8bb2a2016-12-29 11:07:26 -07003044}
3045
3046@extension("VK_GOOGLE_display_timing")
3047class VkPresentTimesInfoGOOGLE {
3048 VkStructureType sType
3049 const void* pNext
Chris Forbes48853712017-01-12 14:09:33 +13003050 u32 swapchainCount
Ian Elliott4c8bb2a2016-12-29 11:07:26 -07003051 const VkPresentTimeGOOGLE* pTimes
Chris Forbes8e4438b2016-12-07 16:26:49 +13003052}
3053
Jesse Hall715b86a2016-01-16 16:34:29 -08003054@extension("VK_EXT_debug_report")
3055class VkDebugReportCallbackCreateInfoEXT {
3056 VkStructureType sType
3057 const void* pNext
3058 VkDebugReportFlagsEXT flags
3059 PFN_vkDebugReportCallbackEXT pfnCallback
3060 void* pUserData
3061}
3062
Jesse Hall26763382016-05-20 07:13:52 -07003063@extension("VK_AMD_rasterization_order")
3064class VkPipelineRasterizationStateRasterizationOrderAMD {
3065 VkStructureType sType
3066 const void* pNext
3067 VkRasterizationOrderAMD rasterizationOrder
3068}
3069
3070@extension("VK_EXT_debug_marker")
3071class VkDebugMarkerObjectNameInfoEXT {
3072 VkStructureType sType
3073 const void* pNext
3074 VkDebugReportObjectTypeEXT objectType
3075 u64 object
3076 const char* pObjectName
3077}
3078
3079@extension("VK_EXT_debug_marker")
3080class VkDebugMarkerObjectTagInfoEXT {
3081 VkStructureType sType
3082 const void* pNext
3083 VkDebugReportObjectTypeEXT objectType
3084 u64 object
3085 u64 tagName
3086 platform.size_t tagSize
3087 const void* pTag
3088}
3089
3090@extension("VK_EXT_debug_marker")
3091class VkDebugMarkerMarkerInfoEXT {
3092 VkStructureType sType
3093 const void* pNext
3094 const char* pMarkerName
3095 f32[4] color
3096}
3097
Jesse Hall56d386a2016-07-26 15:20:40 -07003098@extension("VK_NV_dedicated_allocation")
3099class VkDedicatedAllocationImageCreateInfoNV {
3100 VkStructureType sType
3101 const void* pNext
3102 VkBool32 dedicatedAllocation
3103}
3104
3105@extension("VK_NV_dedicated_allocation")
3106class VkDedicatedAllocationBufferCreateInfoNV {
3107 VkStructureType sType
3108 const void* pNext
3109 VkBool32 dedicatedAllocation
3110}
3111
3112@extension("VK_NV_dedicated_allocation")
3113class VkDedicatedAllocationMemoryAllocateInfoNV {
3114 VkStructureType sType
3115 const void* pNext
3116 VkImage image
3117 VkBuffer buffer
3118}
3119
Jesse Halleb02c472017-02-24 15:13:45 -08003120@extension("VK_NV_external_memory_capabilities")
3121class VkExternalImageFormatPropertiesNV {
3122 VkImageFormatProperties imageFormatProperties
3123 VkExternalMemoryFeatureFlagsNV externalMemoryFeatures
3124 VkExternalMemoryHandleTypeFlagsNV exportFromImportedHandleTypes
3125 VkExternalMemoryHandleTypeFlagsNV compatibleHandleTypes
3126}
3127
3128@extension("VK_NV_external_memory")
3129class VkExternalMemoryImageCreateInfoNV {
3130 VkStructureType sType
3131 const void* pNext
3132 VkExternalMemoryHandleTypeFlagsNV handleTypes
3133}
3134
3135@extension("VK_NV_external_memory")
3136class VkExportMemoryAllocateInfoNV {
3137 VkStructureType sType
3138 const void* pNext
3139 VkExternalMemoryHandleTypeFlagsNV handleTypes
3140}
3141
3142@extension("VK_NV_external_memory_win32")
3143class VkImportMemoryWin32HandleInfoNV {
3144 VkStructureType sType
3145 const void* pNext
3146 VkExternalMemoryHandleTypeFlagsNV handleType
3147 platform.HANDLE handle
3148}
3149
3150@extension("VK_NV_external_memory_win32")
3151class VkExportMemoryWin32HandleInfoNV {
3152 VkStructureType sType
3153 const void* pNext
3154 const platform.SECURITY_ATTRIBUTES* pAttributes
3155 platform.DWORD dwAccess
3156}
3157
3158@extension("VK_NV_win32_keyed_mutex")
3159class VkWin32KeyedMutexAcquireReleaseInfoNV {
3160 VkStructureType sType
3161 const void* pNext
3162 u32 acquireCount
3163 const VkDeviceMemory* pAcquireSyncs
3164 const u64* pAcquireKeys
3165 const u32* pAcquireTimeoutMilliseconds
3166 u32 releaseCount
3167 const VkDeviceMemory* pReleaseSyncs
3168 const u64* pReleaseKeys
3169}
3170
Chris Forbes1194ede2016-12-30 16:29:25 +13003171@extension("VK_KHR_get_physical_device_properties2")
3172class VkPhysicalDeviceFeatures2KHR {
3173 VkStructureType sType
3174 void* pNext
3175 VkPhysicalDeviceFeatures features
3176}
3177
3178@extension("VK_KHR_get_physical_device_properties2")
3179class VkPhysicalDeviceProperties2KHR {
3180 VkStructureType sType
3181 void* pNext
3182 VkPhysicalDeviceProperties properties
3183}
3184
3185@extension("VK_KHR_get_physical_device_properties2")
3186class VkFormatProperties2KHR {
3187 VkStructureType sType
3188 void* pNext
3189 VkFormatProperties formatProperties
3190}
3191
3192@extension("VK_KHR_get_physical_device_properties2")
3193class VkImageFormatProperties2KHR {
3194 VkStructureType sType
3195 void* pNext
3196 VkImageFormatProperties imageFormatProperties
3197}
3198
3199@extension("VK_KHR_get_physical_device_properties2")
3200class VkPhysicalDeviceImageFormatInfo2KHR {
3201 VkStructureType sType
3202 const void* pNext
3203 VkFormat format
3204 VkImageType type
3205 VkImageTiling tiling
3206 VkImageUsageFlags usage
3207 VkImageCreateFlags flags
3208}
3209
3210@extension("VK_KHR_get_physical_device_properties2")
3211class VkQueueFamilyProperties2KHR {
3212 VkStructureType sType
3213 void* pNext
3214 VkQueueFamilyProperties queueFamilyProperties
3215}
3216
3217@extension("VK_KHR_get_physical_device_properties2")
3218class VkPhysicalDeviceMemoryProperties2KHR {
3219 VkStructureType sType
3220 void* pNext
3221 VkPhysicalDeviceMemoryProperties memoryProperties
3222}
3223
3224@extension("VK_KHR_get_physical_device_properties2")
3225class VkSparseImageFormatProperties2KHR {
3226 VkStructureType sType
3227 void* pNext
3228 VkSparseImageFormatProperties properties
3229}
3230
3231@extension("VK_KHR_get_physical_device_properties2")
3232class VkPhysicalDeviceSparseImageFormatInfo2KHR {
3233 VkStructureType sType
3234 const void* pNext
3235 VkFormat format
3236 VkImageType type
3237 VkSampleCountFlagBits samples
3238 VkImageUsageFlags usage
3239 VkImageTiling tiling
3240}
3241
Chris Forbes289cb792016-12-30 15:03:55 +13003242@extension("VK_EXT_validation_flags")
3243class VkValidationFlagsEXT {
3244 VkStructureType sType
3245 const void* pNext
3246 u32 disabledValidationCheckCount
3247 VkValidationCheckEXT* pDisabledValidationChecks
3248}
3249
Jesse Hall77ad05b2017-03-10 22:02:20 -08003250@extension("VK_NN_vi_surface")
3251class VkViSurfaceCreateInfoNN {
3252 VkStructureType sType
3253 const void* pNext
3254 VkViSurfaceCreateFlagsNN flags
3255 void* window
3256}
3257
Chris Forbes289cb792016-12-30 15:03:55 +13003258@extension("VK_NVX_device_generated_commands")
3259class VkDeviceGeneratedCommandsFeaturesNVX {
3260 VkStructureType sType
3261 const void* pNext
3262 VkBool32 computeBindingPointSupport
3263}
3264
3265@extension("VK_NVX_device_generated_commands")
3266class VkDeviceGeneratedCommandsLimitsNVX {
3267 VkStructureType sType
3268 const void* pNext
3269 u32 maxIndirectCommandsLayoutTokenCount
3270 u32 maxObjectEntryCounts
3271 u32 minSequenceCountBufferOffsetAlignment
3272 u32 minSequenceIndexBufferOffsetAlignment
3273 u32 minCommandsTokenBufferOffsetAlignment
3274}
3275
3276@extension("VK_NVX_device_generated_commands")
3277class VkIndirectCommandsTokenNVX {
3278 VkIndirectCommandsTokenTypeNVX tokenType
3279 VkBuffer buffer
3280 VkDeviceSize offset
3281}
3282
3283@extension("VK_NVX_device_generated_commands")
3284class VkIndirectCommandsLayoutTokenNVX {
3285 VkIndirectCommandsTokenTypeNVX tokenType
3286 u32 bindingUnit
3287 u32 dynamicCount
3288 u32 divisor
3289}
3290
3291@extension("VK_NVX_device_generated_commands")
3292class VkIndirectCommandsLayoutCreateInfoNVX {
3293 VkStructureType sType
3294 const void* pNext
3295 VkPipelineBindPoint pipelineBindPoint
3296 VkIndirectCommandsLayoutUsageFlagsNVX flags
3297 u32 tokenCount
3298 const VkIndirectCommandsLayoutTokenNVX* pTokens
3299}
3300
3301@extension("VK_NVX_device_generated_commands")
3302class VkCmdProcessCommandsInfoNVX {
3303 VkStructureType sType
3304 const void* pNext
3305 VkObjectTableNVX objectTable
3306 VkIndirectCommandsLayoutNVX indirectCommandsLayout
3307 u32 indirectCommandsTokenCount
3308 const VkIndirectCommandsTokenNVX* pIndirectCommandsTokens
3309 u32 maxSequencesCount
3310 VkCommandBuffer targetCommandBuffer
3311 VkBuffer sequencesCountBuffer
3312 VkDeviceSize sequencesCountOffset
3313 VkBuffer sequencesIndexBuffer
3314 VkDeviceSize sequencesIndexOffset
3315}
3316
3317@extension("VK_NVX_device_generated_commands")
3318class VkCmdReserveSpaceForCommandsInfoNVX {
3319 VkStructureType sType
3320 const void* pNext
3321 VkObjectTableNVX objectTable
3322 VkIndirectCommandsLayoutNVX indirectCommandsLayout
3323 u32 maxSequencesCount
3324}
3325
3326@extension("VK_NVX_device_generated_commands")
3327class VkObjectTableCreateInfoNVX {
3328 VkStructureType sType
3329 const void* pNext
3330 u32 objectCount
3331 const VkObjectEntryTypeNVX* pObjectEntryTypes
3332 const u32* pObjectEntryCounts
3333 const VkObjectEntryUsageFlagsNVX* pObjectEntryUsageFlags
3334 u32 maxUniformBuffersPerDescriptor
3335 u32 maxStorageBuffersPerDescriptor
3336 u32 maxStorageImagesPerDescriptor
3337 u32 maxSampledImagesPerDescriptor
3338 u32 maxPipelineLayouts
3339}
3340
3341@extension("VK_NVX_device_generated_commands")
3342class VkObjectTableEntryNVX {
3343 VkObjectEntryTypeNVX type
3344 VkObjectEntryUsageFlagsNVX flags
3345}
3346
3347@extension("VK_NVX_device_generated_commands")
3348class VkObjectTablePipelineEntryNVX {
3349 VkObjectEntryTypeNVX type
3350 VkObjectEntryUsageFlagsNVX flags
3351 VkPipeline pipeline
3352}
3353
3354@extension("VK_NVX_device_generated_commands")
3355class VkObjectTableDescriptorSetEntryNVX {
3356 VkObjectEntryTypeNVX type
3357 VkObjectEntryUsageFlagsNVX flags
3358 VkPipelineLayout pipelineLayout
3359 VkDescriptorSet descriptorSet
3360}
3361
3362@extension("VK_NVX_device_generated_commands")
3363class VkObjectTableVertexBufferEntryNVX {
3364 VkObjectEntryTypeNVX type
3365 VkObjectEntryUsageFlagsNVX flags
3366 VkBuffer buffer
3367}
3368
3369@extension("VK_NVX_device_generated_commands")
3370class VkObjectTableIndexBufferEntryNVX {
3371 VkObjectEntryTypeNVX type
3372 VkObjectEntryUsageFlagsNVX flags
3373 VkBuffer buffer
Jesse Hall77ad05b2017-03-10 22:02:20 -08003374 VkIndexType indexType
Chris Forbes289cb792016-12-30 15:03:55 +13003375}
3376
3377@extension("VK_NVX_device_generated_commands")
3378class VkObjectTablePushConstantEntryNVX {
3379 VkObjectEntryTypeNVX type
3380 VkObjectEntryUsageFlagsNVX flags
3381 VkPipelineLayout pipelineLayout
3382 VkShaderStageFlags stageFlags
3383}
3384
Jesse Hall889cd9a2017-02-25 22:12:23 -08003385@extension("VK_KHR_incremental_present")
3386class VkRectLayerKHR {
3387 VkOffset2D offset
3388 VkExtent2D extent
3389 u32 layer
3390}
3391
3392@extension("VK_KHR_incremental_present")
3393class VkPresentRegionKHR {
3394 u32 rectangleCount
3395 const VkRectLayerKHR* pRectangles
3396}
3397
3398@extension("VK_KHR_incremental_present")
3399class VkPresentRegionsKHR {
3400 VkStructureType sType
3401 const void* pNext
3402 u32 swapchainCount
3403 const VkPresentRegionKHR* pRegions
3404}
3405
Jesse Hall77ad05b2017-03-10 22:02:20 -08003406@extension("VK_EXT_display_surface_counter")
3407class VkSurfaceCapabilities2EXT {
3408 VkStructureType sType
3409 void* pNext
3410 u32 minImageCount
3411 u32 maxImageCount
3412 VkExtent2D currentExtent
3413 VkExtent2D minImageExtent
3414 VkExtent2D maxImageExtent
3415 u32 maxImageArrayLayers
3416 VkSurfaceTransformFlagsKHR supportedTransforms
3417 VkSurfaceTransformFlagBitsKHR currentTransform
3418 VkCompositeAlphaFlagsKHR supportedCompositeAlpha
3419 VkImageUsageFlags supportedUsageFlags
3420 VkSurfaceCounterFlagsEXT supportedSurfaceCounters
3421}
3422
3423@extension("VK_EXT_display_control")
3424class VkDisplayPowerInfoEXT {
3425 VkStructureType sType
3426 const void* pNext
3427 VkDisplayPowerStateEXT powerState
3428}
3429
3430@extension("VK_EXT_display_control")
3431class VkDeviceEventInfoEXT {
3432 VkStructureType sType
3433 const void* pNext
3434 VkDeviceEventTypeEXT deviceEvent
3435}
3436
3437@extension("VK_EXT_display_control")
3438class VkDisplayEventInfoEXT {
3439 VkStructureType sType
3440 const void* pNext
3441 VkDisplayEventTypeEXT displayEvent
3442}
3443
3444@extension("VK_EXT_display_control")
3445class VkSwapchainCounterCreateInfoEXT {
3446 VkStructureType sType
3447 const void* pNext
3448 VkSurfaceCounterFlagsEXT surfaceCounters
3449}
3450
Courtney Goeltzenleuchterd634c482017-01-05 15:55:31 -07003451@extension("VK_EXT_hdr_metadata")
3452class VkXYColorEXT {
3453 f32 x
3454 f32 y
3455}
3456
3457@extension("VK_EXT_hdr_metadata")
3458class VkHdrMetadataEXT {
3459 VkXYColorEXT displayPrimaryRed
3460 VkXYColorEXT displayPrimaryGreen
3461 VkXYColorEXT displayPrimaryBlue
3462 VkXYColorEXT whitePoint
3463 f32 maxLuminance
3464 f32 minLuminance
3465 f32 maxContentLightLevel
3466 f32 maxFrameAverageLightLevel
3467}
3468
Jesse Halld27f6aa2015-08-15 17:58:48 -07003469////////////////
3470// Commands //
3471////////////////
3472
3473// Function pointers. TODO: add support for function pointers.
3474
3475@external type void* PFN_vkVoidFunction
3476@pfn cmd void vkVoidFunction() {
3477}
3478
Jesse Hall3fbc8562015-11-29 22:10:52 -08003479@external type void* PFN_vkAllocationFunction
3480@pfn cmd void* vkAllocationFunction(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003481 void* pUserData,
3482 platform.size_t size,
3483 platform.size_t alignment,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003484 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08003485 return ?
3486}
3487
Jesse Hall3fbc8562015-11-29 22:10:52 -08003488@external type void* PFN_vkReallocationFunction
3489@pfn cmd void* vkReallocationFunction(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003490 void* pUserData,
3491 void* pOriginal,
3492 platform.size_t size,
3493 platform.size_t alignment,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003494 VkSystemAllocationScope allocationScope) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003495 return ?
3496}
3497
3498@external type void* PFN_vkFreeFunction
3499@pfn cmd void vkFreeFunction(
3500 void* pUserData,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003501 void* pMemory) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003502}
3503
Jesse Hall3fbc8562015-11-29 22:10:52 -08003504@external type void* PFN_vkInternalAllocationNotification
3505@pfn cmd void vkInternalAllocationNotification(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003506 void* pUserData,
3507 platform.size_t size,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003508 VkInternalAllocationType allocationType,
3509 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08003510}
3511
3512@external type void* PFN_vkInternalFreeNotification
3513@pfn cmd void vkInternalFreeNotification(
3514 void* pUserData,
3515 platform.size_t size,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003516 VkInternalAllocationType allocationType,
3517 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08003518}
Jesse Halld27f6aa2015-08-15 17:58:48 -07003519
3520// Global functions
3521
3522@threadSafety("system")
3523cmd VkResult vkCreateInstance(
3524 const VkInstanceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003525 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003526 VkInstance* pInstance) {
3527 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO)
3528
3529 instance := ?
3530 pInstance[0] = instance
3531 State.Instances[instance] = new!InstanceObject()
3532
Jesse Hall3dd678a2016-01-08 21:52:01 -08003533 layers := pCreateInfo.ppEnabledLayerNames[0:pCreateInfo.enabledLayerCount]
3534 extensions := pCreateInfo.ppEnabledExtensionNames[0:pCreateInfo.enabledExtensionCount]
Jesse Halld27f6aa2015-08-15 17:58:48 -07003535
3536 return ?
3537}
3538
3539@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003540cmd void vkDestroyInstance(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003541 VkInstance instance,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003542 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003543 instanceObject := GetInstance(instance)
3544
3545 State.Instances[instance] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003546}
3547
3548@threadSafety("system")
3549cmd VkResult vkEnumeratePhysicalDevices(
3550 VkInstance instance,
3551 u32* pPhysicalDeviceCount,
3552 VkPhysicalDevice* pPhysicalDevices) {
3553 instanceObject := GetInstance(instance)
3554
3555 physicalDeviceCount := as!u32(?)
3556 pPhysicalDeviceCount[0] = physicalDeviceCount
3557 physicalDevices := pPhysicalDevices[0:physicalDeviceCount]
3558
3559 for i in (0 .. physicalDeviceCount) {
3560 physicalDevice := ?
3561 physicalDevices[i] = physicalDevice
3562 if !(physicalDevice in State.PhysicalDevices) {
3563 State.PhysicalDevices[physicalDevice] = new!PhysicalDeviceObject(instance: instance)
3564 }
3565 }
3566
3567 return ?
3568}
3569
3570cmd PFN_vkVoidFunction vkGetDeviceProcAddr(
3571 VkDevice device,
3572 const char* pName) {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003573 if device != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003574 device := GetDevice(device)
3575 }
3576
3577 return ?
3578}
3579
3580cmd PFN_vkVoidFunction vkGetInstanceProcAddr(
3581 VkInstance instance,
3582 const char* pName) {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003583 if instance != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003584 instanceObject := GetInstance(instance)
3585 }
3586
3587 return ?
3588}
3589
Jesse Hall606a54e2015-11-19 22:17:28 -08003590cmd void vkGetPhysicalDeviceProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003591 VkPhysicalDevice physicalDevice,
3592 VkPhysicalDeviceProperties* pProperties) {
3593 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3594
3595 properties := ?
3596 pProperties[0] = properties
Jesse Halld27f6aa2015-08-15 17:58:48 -07003597}
3598
Jesse Hall606a54e2015-11-19 22:17:28 -08003599cmd void vkGetPhysicalDeviceQueueFamilyProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003600 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003601 u32* pQueueFamilyPropertyCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003602 VkQueueFamilyProperties* pQueueFamilyProperties) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003603 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003604 // TODO: Figure out how to express fetch-count-or-properties
3605 // This version fails 'apic validate' with 'fence not allowed in
3606 // *semantic.Branch'. Other attempts have failed with the same or other
3607 // errors.
3608 // if pQueueFamilyProperties != null {
3609 // queuesProperties := pQueueFamilyProperties[0:pCount[0]]
3610 // for i in (0 .. pCount[0]) {
3611 // queueProperties := as!VkQueueFamilyProperties(?)
3612 // queuesProperties[i] = queueProperties
3613 // }
3614 // } else {
3615 // count := ?
3616 // pCount[0] = count
3617 // }
Jesse Halld27f6aa2015-08-15 17:58:48 -07003618}
3619
Jesse Hall606a54e2015-11-19 22:17:28 -08003620cmd void vkGetPhysicalDeviceMemoryProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003621 VkPhysicalDevice physicalDevice,
3622 VkPhysicalDeviceMemoryProperties* pMemoryProperties) {
3623 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3624
3625 memoryProperties := ?
3626 pMemoryProperties[0] = memoryProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07003627}
3628
Jesse Hall606a54e2015-11-19 22:17:28 -08003629cmd void vkGetPhysicalDeviceFeatures(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003630 VkPhysicalDevice physicalDevice,
3631 VkPhysicalDeviceFeatures* pFeatures) {
3632 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3633
3634 features := ?
3635 pFeatures[0] = features
Jesse Halld27f6aa2015-08-15 17:58:48 -07003636}
3637
Jesse Hall606a54e2015-11-19 22:17:28 -08003638cmd void vkGetPhysicalDeviceFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003639 VkPhysicalDevice physicalDevice,
3640 VkFormat format,
3641 VkFormatProperties* pFormatProperties) {
3642 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3643
3644 formatProperties := ?
3645 pFormatProperties[0] = formatProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07003646}
3647
Jesse Halla9e57032015-11-30 01:03:10 -08003648cmd VkResult vkGetPhysicalDeviceImageFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003649 VkPhysicalDevice physicalDevice,
3650 VkFormat format,
3651 VkImageType type,
3652 VkImageTiling tiling,
3653 VkImageUsageFlags usage,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003654 VkImageCreateFlags flags,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003655 VkImageFormatProperties* pImageFormatProperties) {
3656 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3657
3658 imageFormatProperties := ?
3659 pImageFormatProperties[0] = imageFormatProperties
Jesse Halla9e57032015-11-30 01:03:10 -08003660
3661 return ?
Jesse Halld27f6aa2015-08-15 17:58:48 -07003662}
3663
Jesse Halld27f6aa2015-08-15 17:58:48 -07003664
3665// Device functions
3666
3667@threadSafety("system")
3668cmd VkResult vkCreateDevice(
3669 VkPhysicalDevice physicalDevice,
3670 const VkDeviceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003671 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003672 VkDevice* pDevice) {
3673 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO)
3674 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3675
3676 device := ?
3677 pDevice[0] = device
3678 State.Devices[device] = new!DeviceObject(physicalDevice: physicalDevice)
3679
3680 return ?
3681}
3682
3683@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003684cmd void vkDestroyDevice(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003685 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003686 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003687 deviceObject := GetDevice(device)
3688
3689 State.Devices[device] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003690}
3691
3692
3693// Extension discovery functions
3694
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003695cmd VkResult vkEnumerateInstanceLayerProperties(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003696 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003697 VkLayerProperties* pProperties) {
3698 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08003699 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07003700
3701 properties := pProperties[0:count]
3702 for i in (0 .. count) {
3703 property := ?
3704 properties[i] = property
3705 }
3706
3707 return ?
3708}
3709
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003710cmd VkResult vkEnumerateInstanceExtensionProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003711 const char* pLayerName,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003712 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003713 VkExtensionProperties* pProperties) {
3714 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08003715 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07003716
3717 properties := pProperties[0:count]
3718 for i in (0 .. count) {
3719 property := ?
3720 properties[i] = property
3721 }
3722
3723 return ?
3724}
3725
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003726cmd VkResult vkEnumerateDeviceLayerProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003727 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003728 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003729 VkLayerProperties* pProperties) {
3730 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3731 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08003732 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07003733
3734 properties := pProperties[0:count]
3735 for i in (0 .. count) {
3736 property := ?
3737 properties[i] = property
3738 }
3739
3740 return ?
3741}
3742
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003743cmd VkResult vkEnumerateDeviceExtensionProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003744 VkPhysicalDevice physicalDevice,
3745 const char* pLayerName,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003746 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003747 VkExtensionProperties* pProperties) {
3748 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3749
3750 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08003751 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07003752
3753 properties := pProperties[0:count]
3754 for i in (0 .. count) {
3755 property := ?
3756 properties[i] = property
3757 }
3758
3759 return ?
3760}
3761
3762
3763// Queue functions
3764
3765@threadSafety("system")
Jesse Hall606a54e2015-11-19 22:17:28 -08003766cmd void vkGetDeviceQueue(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003767 VkDevice device,
3768 u32 queueFamilyIndex,
3769 u32 queueIndex,
3770 VkQueue* pQueue) {
3771 deviceObject := GetDevice(device)
3772
3773 queue := ?
3774 pQueue[0] = queue
3775
3776 if !(queue in State.Queues) {
3777 State.Queues[queue] = new!QueueObject(device: device)
3778 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07003779}
3780
3781@threadSafety("app")
3782cmd VkResult vkQueueSubmit(
3783 VkQueue queue,
Jesse Halla366a512015-11-19 22:30:07 -08003784 u32 submitCount,
Jesse Hallb00daad2015-11-29 19:46:20 -08003785 const VkSubmitInfo* pSubmits,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003786 VkFence fence) {
3787 queueObject := GetQueue(queue)
3788
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003789 if fence != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003790 fenceObject := GetFence(fence)
3791 assert(fenceObject.device == queueObject.device)
3792 }
3793
Jesse Hall3fbc8562015-11-29 22:10:52 -08003794 // commandBuffers := pcommandBuffers[0:commandBufferCount]
3795 // for i in (0 .. commandBufferCount) {
3796 // commandBuffer := commandBuffers[i]
3797 // commandBufferObject := GetCommandBuffer(commandBuffer)
3798 // assert(commandBufferObject.device == queueObject.device)
Jesse Halla366a512015-11-19 22:30:07 -08003799 //
Jesse Hall3fbc8562015-11-29 22:10:52 -08003800 // validate("QueueCheck", commandBufferObject.queueFlags in queueObject.flags,
3801 // "vkQueueSubmit: enqueued commandBuffer requires missing queue capabilities.")
Jesse Halla366a512015-11-19 22:30:07 -08003802 // }
Jesse Halld27f6aa2015-08-15 17:58:48 -07003803
3804 return ?
3805}
3806
3807@threadSafety("system")
3808cmd VkResult vkQueueWaitIdle(
3809 VkQueue queue) {
3810 queueObject := GetQueue(queue)
3811
3812 return ?
3813}
3814
3815@threadSafety("system")
3816cmd VkResult vkDeviceWaitIdle(
3817 VkDevice device) {
3818 deviceObject := GetDevice(device)
3819
3820 return ?
3821}
3822
3823
3824// Memory functions
3825
3826@threadSafety("system")
Jesse Hall3fbc8562015-11-29 22:10:52 -08003827cmd VkResult vkAllocateMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003828 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003829 const VkMemoryAllocateInfo* pAllocateInfo,
3830 const VkAllocationCallbacks* pAllocator,
3831 VkDeviceMemory* pMemory) {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08003832 assert(pAllocateInfo.sType == VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003833 deviceObject := GetDevice(device)
3834
Jesse Hall3fbc8562015-11-29 22:10:52 -08003835 memory := ?
3836 pMemory[0] = memory
3837 State.DeviceMemories[memory] = new!DeviceMemoryObject(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003838 device: device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003839 allocationSize: pAllocateInfo[0].allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003840
3841 return ?
3842}
3843
3844@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003845cmd void vkFreeMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003846 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003847 VkDeviceMemory memory,
3848 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003849 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003850 memoryObject := GetDeviceMemory(memory)
3851 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003852
3853 // Check that no objects are still bound before freeing.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003854 validate("MemoryCheck", len(memoryObject.boundObjects) == 0,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003855 "vkFreeMemory: objects still bound")
Jesse Hall3fbc8562015-11-29 22:10:52 -08003856 validate("MemoryCheck", len(memoryObject.boundCommandBuffers) == 0,
3857 "vkFreeMemory: commandBuffers still bound")
3858 State.DeviceMemories[memory] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003859}
3860
3861@threadSafety("app")
3862cmd VkResult vkMapMemory(
3863 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003864 VkDeviceMemory memory,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003865 VkDeviceSize offset,
3866 VkDeviceSize size,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003867 VkMemoryMapFlags flags,
3868 void** ppData) {
3869 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003870 memoryObject := GetDeviceMemory(memory)
3871 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003872
3873 assert(flags == as!VkMemoryMapFlags(0))
Jesse Hall3fbc8562015-11-29 22:10:52 -08003874 assert((offset + size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003875
3876 return ?
3877}
3878
3879@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003880cmd void vkUnmapMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003881 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003882 VkDeviceMemory memory) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003883 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003884 memoryObject := GetDeviceMemory(memory)
3885 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003886}
3887
3888cmd VkResult vkFlushMappedMemoryRanges(
3889 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003890 u32 memoryRangeCount
3891 const VkMappedMemoryRange* pMemoryRanges) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003892 deviceObject := GetDevice(device)
3893
Jesse Hall3fbc8562015-11-29 22:10:52 -08003894 memoryRanges := pMemoryRanges[0:memoryRangeCount]
3895 for i in (0 .. memoryRangeCount) {
3896 memoryRange := memoryRanges[i]
3897 memoryObject := GetDeviceMemory(memoryRange.memory)
3898 assert(memoryObject.device == device)
3899 assert((memoryRange.offset + memoryRange.size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003900 }
3901
3902 return ?
3903}
3904
3905cmd VkResult vkInvalidateMappedMemoryRanges(
3906 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003907 u32 memoryRangeCount,
3908 const VkMappedMemoryRange* pMemoryRanges) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003909 deviceObject := GetDevice(device)
3910
Jesse Hall3fbc8562015-11-29 22:10:52 -08003911 memoryRanges := pMemoryRanges[0:memoryRangeCount]
3912 for i in (0 .. memoryRangeCount) {
3913 memoryRange := memoryRanges[i]
3914 memoryObject := GetDeviceMemory(memoryRange.memory)
3915 assert(memoryObject.device == device)
3916 assert((memoryRange.offset + memoryRange.size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003917 }
3918
3919 return ?
3920}
3921
3922
3923// Memory management API functions
3924
Jesse Hall606a54e2015-11-19 22:17:28 -08003925cmd void vkGetDeviceMemoryCommitment(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003926 VkDevice device,
3927 VkDeviceMemory memory,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003928 VkDeviceSize* pCommittedMemoryInBytes) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003929 deviceObject := GetDevice(device)
3930
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003931 if memory != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003932 memoryObject := GetDeviceMemory(memory)
3933 assert(memoryObject.device == device)
3934 }
3935
3936 committedMemoryInBytes := ?
3937 pCommittedMemoryInBytes[0] = committedMemoryInBytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07003938}
3939
Jesse Hall606a54e2015-11-19 22:17:28 -08003940cmd void vkGetBufferMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003941 VkDevice device,
3942 VkBuffer buffer,
3943 VkMemoryRequirements* pMemoryRequirements) {
3944 deviceObject := GetDevice(device)
3945 bufferObject := GetBuffer(buffer)
3946 assert(bufferObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003947}
3948
3949cmd VkResult vkBindBufferMemory(
3950 VkDevice device,
3951 VkBuffer buffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003952 VkDeviceMemory memory,
3953 VkDeviceSize memoryOffset) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003954 deviceObject := GetDevice(device)
3955 bufferObject := GetBuffer(buffer)
3956 assert(bufferObject.device == device)
3957
3958 // Unbind buffer from previous memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003959 if bufferObject.memory != NULL_HANDLE {
3960 memoryObject := GetDeviceMemory(bufferObject.memory)
3961 memoryObject.boundObjects[as!u64(buffer)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003962 }
3963
3964 // Bind buffer to given memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003965 if memory != NULL_HANDLE {
3966 memoryObject := GetDeviceMemory(memory)
3967 assert(memoryObject.device == device)
3968 memoryObject.boundObjects[as!u64(buffer)] = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003969 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08003970 bufferObject.memory = memory
3971 bufferObject.memoryOffset = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003972
3973 return ?
3974}
3975
Jesse Hall606a54e2015-11-19 22:17:28 -08003976cmd void vkGetImageMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003977 VkDevice device,
3978 VkImage image,
3979 VkMemoryRequirements* pMemoryRequirements) {
3980 deviceObject := GetDevice(device)
3981 imageObject := GetImage(image)
3982 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003983}
3984
3985cmd VkResult vkBindImageMemory(
3986 VkDevice device,
3987 VkImage image,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003988 VkDeviceMemory memory,
3989 VkDeviceSize memoryOffset) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003990 deviceObject := GetDevice(device)
3991 imageObject := GetImage(image)
3992 assert(imageObject.device == device)
3993
3994 // Unbind image from previous memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003995 if imageObject.memory != NULL_HANDLE {
3996 memoryObject := GetDeviceMemory(imageObject.memory)
3997 memoryObject.boundObjects[as!u64(image)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003998 }
3999
4000 // Bind image to given memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08004001 if memory != NULL_HANDLE {
4002 memoryObject := GetDeviceMemory(memory)
4003 assert(memoryObject.device == device)
4004 memoryObject.boundObjects[as!u64(image)] = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07004005 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08004006 imageObject.memory = memory
4007 imageObject.memoryOffset = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07004008
4009 return ?
4010}
4011
Jesse Hall606a54e2015-11-19 22:17:28 -08004012cmd void vkGetImageSparseMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004013 VkDevice device,
4014 VkImage image,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004015 u32* pSparseMemoryRequirementCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004016 VkSparseImageMemoryRequirements* pSparseMemoryRequirements) {
4017 deviceObject := GetDevice(device)
4018 imageObject := GetImage(image)
4019 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004020}
4021
Jesse Hall606a54e2015-11-19 22:17:28 -08004022cmd void vkGetPhysicalDeviceSparseImageFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004023 VkPhysicalDevice physicalDevice,
4024 VkFormat format,
4025 VkImageType type,
Jesse Hall091ed9e2015-11-30 00:55:29 -08004026 VkSampleCountFlagBits samples,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004027 VkImageUsageFlags usage,
4028 VkImageTiling tiling,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004029 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004030 VkSparseImageFormatProperties* pProperties) {
4031 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004032}
4033
Jesse Halla6429252015-11-29 18:59:42 -08004034cmd VkResult vkQueueBindSparse(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004035 VkQueue queue,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004036 u32 bindInfoCount,
Jesse Halla6429252015-11-29 18:59:42 -08004037 const VkBindSparseInfo* pBindInfo,
4038 VkFence fence) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004039 queueObject := GetQueue(queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004040
4041 return ?
4042}
4043
4044
4045// Fence functions
4046
4047@threadSafety("system")
4048cmd VkResult vkCreateFence(
4049 VkDevice device,
4050 const VkFenceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004051 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004052 VkFence* pFence) {
4053 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_FENCE_CREATE_INFO)
4054 deviceObject := GetDevice(device)
4055
4056 fence := ?
4057 pFence[0] = fence
4058 State.Fences[fence] = new!FenceObject(
Jesse Halld8bade02015-11-24 10:24:18 -08004059 device: device, signaled: (pCreateInfo.flags == as!VkFenceCreateFlags(VK_FENCE_CREATE_SIGNALED_BIT)))
Jesse Halld27f6aa2015-08-15 17:58:48 -07004060
4061 return ?
4062}
4063
4064@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004065cmd void vkDestroyFence(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004066 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004067 VkFence fence,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004068 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004069 deviceObject := GetDevice(device)
4070 fenceObject := GetFence(fence)
4071 assert(fenceObject.device == device)
4072
4073 State.Fences[fence] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004074}
4075
4076@threadSafety("system")
4077cmd VkResult vkResetFences(
4078 VkDevice device,
4079 u32 fenceCount,
4080 const VkFence* pFences) {
4081 deviceObject := GetDevice(device)
4082
4083 fences := pFences[0:fenceCount]
4084 for i in (0 .. fenceCount) {
4085 fence := fences[i]
4086 fenceObject := GetFence(fence)
4087 assert(fenceObject.device == device)
4088 fenceObject.signaled = false
4089 }
4090
4091 return ?
4092}
4093
4094@threadSafety("system")
4095cmd VkResult vkGetFenceStatus(
4096 VkDevice device,
4097 VkFence fence) {
4098 deviceObject := GetDevice(device)
4099 fenceObject := GetFence(fence)
4100 assert(fenceObject.device == device)
4101
4102 return ?
4103}
4104
4105@threadSafety("system")
4106cmd VkResult vkWaitForFences(
4107 VkDevice device,
4108 u32 fenceCount,
4109 const VkFence* pFences,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004110 VkBool32 waitAll,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004111 u64 timeout) { /// timeout in nanoseconds
4112 deviceObject := GetDevice(device)
4113
4114 fences := pFences[0:fenceCount]
4115 for i in (0 .. fenceCount) {
4116 fence := fences[i]
4117 fenceObject := GetFence(fence)
4118 assert(fenceObject.device == device)
4119 }
4120
4121 return ?
4122}
4123
4124
4125// Queue semaphore functions
4126
4127@threadSafety("system")
4128cmd VkResult vkCreateSemaphore(
4129 VkDevice device,
4130 const VkSemaphoreCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004131 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004132 VkSemaphore* pSemaphore) {
4133 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO)
4134 deviceObject := GetDevice(device)
4135
4136 semaphore := ?
4137 pSemaphore[0] = semaphore
4138 State.Semaphores[semaphore] = new!SemaphoreObject(device: device)
4139
4140 return ?
4141}
4142
4143@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004144cmd void vkDestroySemaphore(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004145 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004146 VkSemaphore semaphore,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004147 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004148 deviceObject := GetDevice(device)
4149 semaphoreObject := GetSemaphore(semaphore)
4150 assert(semaphoreObject.device == device)
4151
4152 State.Semaphores[semaphore] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004153}
4154
Jesse Halld27f6aa2015-08-15 17:58:48 -07004155
4156// Event functions
4157
4158@threadSafety("system")
4159cmd VkResult vkCreateEvent(
4160 VkDevice device,
4161 const VkEventCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004162 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004163 VkEvent* pEvent) {
4164 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_EVENT_CREATE_INFO)
4165 deviceObject := GetDevice(device)
4166
4167 event := ?
4168 pEvent[0] = event
4169 State.Events[event] = new!EventObject(device: device)
4170
4171 return ?
4172}
4173
4174@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004175cmd void vkDestroyEvent(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004176 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004177 VkEvent event,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004178 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004179 deviceObject := GetDevice(device)
4180 eventObject := GetEvent(event)
4181 assert(eventObject.device == device)
4182
4183 State.Events[event] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004184}
4185
4186@threadSafety("system")
4187cmd VkResult vkGetEventStatus(
4188 VkDevice device,
4189 VkEvent event) {
4190 deviceObject := GetDevice(device)
4191 eventObject := GetEvent(event)
4192 assert(eventObject.device == device)
4193
4194 return ?
4195}
4196
4197@threadSafety("system")
4198cmd VkResult vkSetEvent(
4199 VkDevice device,
4200 VkEvent event) {
4201 deviceObject := GetDevice(device)
4202 eventObject := GetEvent(event)
4203 assert(eventObject.device == device)
4204
4205 return ?
4206}
4207
4208@threadSafety("system")
4209cmd VkResult vkResetEvent(
4210 VkDevice device,
4211 VkEvent event) {
4212 deviceObject := GetDevice(device)
4213 eventObject := GetEvent(event)
4214 assert(eventObject.device == device)
4215
4216 return ?
4217}
4218
4219
4220// Query functions
4221
4222@threadSafety("system")
4223cmd VkResult vkCreateQueryPool(
4224 VkDevice device,
4225 const VkQueryPoolCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004226 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004227 VkQueryPool* pQueryPool) {
4228 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO)
4229 deviceObject := GetDevice(device)
4230
4231 queryPool := ?
4232 pQueryPool[0] = queryPool
4233 State.QueryPools[queryPool] = new!QueryPoolObject(device: device)
4234
4235 return ?
4236}
4237
4238@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004239cmd void vkDestroyQueryPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004240 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004241 VkQueryPool queryPool,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004242 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004243 deviceObject := GetDevice(device)
4244 queryPoolObject := GetQueryPool(queryPool)
4245 assert(queryPoolObject.device == device)
4246
4247 State.QueryPools[queryPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004248}
4249
4250@threadSafety("system")
4251cmd VkResult vkGetQueryPoolResults(
4252 VkDevice device,
4253 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004254 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004255 u32 queryCount,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004256 platform.size_t dataSize,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004257 void* pData,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004258 VkDeviceSize stride,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004259 VkQueryResultFlags flags) {
4260 deviceObject := GetDevice(device)
4261 queryPoolObject := GetQueryPool(queryPool)
4262 assert(queryPoolObject.device == device)
4263
Jesse Halld27f6aa2015-08-15 17:58:48 -07004264 data := pData[0:dataSize]
4265
4266 return ?
4267}
4268
4269// Buffer functions
4270
4271@threadSafety("system")
4272cmd VkResult vkCreateBuffer(
4273 VkDevice device,
4274 const VkBufferCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004275 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004276 VkBuffer* pBuffer) {
4277 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO)
4278 deviceObject := GetDevice(device)
4279
4280 buffer := ?
4281 pBuffer[0] = buffer
4282 State.Buffers[buffer] = new!BufferObject(device: device)
4283
4284 return ?
4285}
4286
4287@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004288cmd void vkDestroyBuffer(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004289 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004290 VkBuffer buffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004291 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004292 deviceObject := GetDevice(device)
4293 bufferObject := GetBuffer(buffer)
4294 assert(bufferObject.device == device)
4295
Jesse Hall3fbc8562015-11-29 22:10:52 -08004296 assert(bufferObject.memory == 0)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004297 State.Buffers[buffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004298}
4299
4300
4301// Buffer view functions
4302
4303@threadSafety("system")
4304cmd VkResult vkCreateBufferView(
4305 VkDevice device,
4306 const VkBufferViewCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004307 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004308 VkBufferView* pView) {
4309 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO)
4310 deviceObject := GetDevice(device)
4311
4312 bufferObject := GetBuffer(pCreateInfo.buffer)
4313 assert(bufferObject.device == device)
4314
4315 view := ?
4316 pView[0] = view
4317 State.BufferViews[view] = new!BufferViewObject(device: device, buffer: pCreateInfo.buffer)
4318
4319 return ?
4320}
4321
4322@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004323cmd void vkDestroyBufferView(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004324 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004325 VkBufferView bufferView,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004326 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004327 deviceObject := GetDevice(device)
4328 bufferViewObject := GetBufferView(bufferView)
4329 assert(bufferViewObject.device == device)
4330
4331 State.BufferViews[bufferView] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004332}
4333
4334
4335// Image functions
4336
4337@threadSafety("system")
4338cmd VkResult vkCreateImage(
4339 VkDevice device,
4340 const VkImageCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004341 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004342 VkImage* pImage) {
4343 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO)
4344 deviceObject := GetDevice(device)
4345
4346 image := ?
4347 pImage[0] = image
4348 State.Images[image] = new!ImageObject(device: device)
4349
4350 return ?
4351}
4352
4353@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004354cmd void vkDestroyImage(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004355 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004356 VkImage image,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004357 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004358 deviceObject := GetDevice(device)
4359 imageObject := GetImage(image)
4360 assert(imageObject.device == device)
4361
Jesse Hall3fbc8562015-11-29 22:10:52 -08004362 assert(imageObject.memory == 0)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004363 State.Images[image] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004364}
4365
Jesse Hall606a54e2015-11-19 22:17:28 -08004366cmd void vkGetImageSubresourceLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004367 VkDevice device,
4368 VkImage image,
4369 const VkImageSubresource* pSubresource,
4370 VkSubresourceLayout* pLayout) {
4371 deviceObject := GetDevice(device)
4372 imageObject := GetImage(image)
4373 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004374}
4375
4376
4377// Image view functions
4378
4379@threadSafety("system")
4380cmd VkResult vkCreateImageView(
4381 VkDevice device,
4382 const VkImageViewCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004383 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004384 VkImageView* pView) {
4385 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO)
4386 deviceObject := GetDevice(device)
4387
4388 imageObject := GetImage(pCreateInfo.image)
4389 assert(imageObject.device == device)
4390
4391 view := ?
4392 pView[0] = view
4393 State.ImageViews[view] = new!ImageViewObject(device: device, image: pCreateInfo.image)
4394
4395 return ?
4396}
4397
4398@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004399cmd void vkDestroyImageView(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004400 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004401 VkImageView imageView,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004402 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004403 deviceObject := GetDevice(device)
4404 imageViewObject := GetImageView(imageView)
4405 assert(imageViewObject.device == device)
4406
4407 State.ImageViews[imageView] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004408}
4409
4410
4411// Shader functions
4412
4413cmd VkResult vkCreateShaderModule(
4414 VkDevice device,
4415 const VkShaderModuleCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004416 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004417 VkShaderModule* pShaderModule) {
4418 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO)
4419 deviceObject := GetDevice(device)
4420
4421 shaderModule := ?
4422 pShaderModule[0] = shaderModule
4423 State.ShaderModules[shaderModule] = new!ShaderModuleObject(device: device)
4424
4425 return ?
4426}
4427
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004428cmd void vkDestroyShaderModule(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004429 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004430 VkShaderModule shaderModule,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004431 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004432 deviceObject := GetDevice(device)
4433 shaderModuleObject := GetShaderModule(shaderModule)
4434 assert(shaderModuleObject.device == device)
4435
4436 State.ShaderModules[shaderModule] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004437}
4438
Jesse Halld27f6aa2015-08-15 17:58:48 -07004439
4440// Pipeline functions
4441
4442cmd VkResult vkCreatePipelineCache(
4443 VkDevice device,
4444 const VkPipelineCacheCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004445 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004446 VkPipelineCache* pPipelineCache) {
4447 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO)
4448 deviceObject := GetDevice(device)
4449
4450 pipelineCache := ?
4451 pPipelineCache[0] = pipelineCache
4452 State.PipelineCaches[pipelineCache] = new!PipelineCacheObject(device: device)
4453
4454 return ?
4455}
4456
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004457cmd void vkDestroyPipelineCache(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004458 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004459 VkPipelineCache pipelineCache,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004460 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004461 deviceObject := GetDevice(device)
4462 pipelineCacheObject := GetPipelineCache(pipelineCache)
4463 assert(pipelineCacheObject.device == device)
4464
4465 State.PipelineCaches[pipelineCache] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004466}
4467
Jesse Halld27f6aa2015-08-15 17:58:48 -07004468cmd VkResult vkGetPipelineCacheData(
4469 VkDevice device,
4470 VkPipelineCache pipelineCache,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004471 platform.size_t* pDataSize,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004472 void* pData) {
4473 deviceObject := GetDevice(device)
4474 pipelineCacheObject := GetPipelineCache(pipelineCache)
4475 assert(pipelineCacheObject.device == device)
4476
4477 return ?
4478}
4479
4480cmd VkResult vkMergePipelineCaches(
4481 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004482 VkPipelineCache dstCache,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004483 u32 srcCacheCount,
4484 const VkPipelineCache* pSrcCaches) {
4485 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004486 dstCacheObject := GetPipelineCache(dstCache)
4487 assert(dstCacheObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004488
4489 srcCaches := pSrcCaches[0:srcCacheCount]
4490 for i in (0 .. srcCacheCount) {
4491 srcCache := srcCaches[i]
4492 srcCacheObject := GetPipelineCache(srcCache)
4493 assert(srcCacheObject.device == device)
4494 }
4495
4496 return ?
4497}
4498
4499cmd VkResult vkCreateGraphicsPipelines(
4500 VkDevice device,
4501 VkPipelineCache pipelineCache,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004502 u32 createInfoCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004503 const VkGraphicsPipelineCreateInfo* pCreateInfos,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004504 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004505 VkPipeline* pPipelines) {
4506 deviceObject := GetDevice(device)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004507 if pipelineCache != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004508 pipelineCacheObject := GetPipelineCache(pipelineCache)
4509 assert(pipelineCacheObject.device == device)
4510 }
4511
Jesse Hall03b6fe12015-11-24 12:44:21 -08004512 createInfos := pCreateInfos[0:createInfoCount]
4513 pipelines := pPipelines[0:createInfoCount]
4514 for i in (0 .. createInfoCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004515 pipeline := ?
4516 pipelines[i] = pipeline
4517 State.Pipelines[pipeline] = new!PipelineObject(device: device)
4518 }
4519
4520 return ?
4521}
4522
4523cmd VkResult vkCreateComputePipelines(
4524 VkDevice device,
4525 VkPipelineCache pipelineCache,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004526 u32 createInfoCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004527 const VkComputePipelineCreateInfo* pCreateInfos,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004528 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004529 VkPipeline* pPipelines) {
4530 deviceObject := GetDevice(device)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004531 if pipelineCache != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004532 pipelineCacheObject := GetPipelineCache(pipelineCache)
4533 assert(pipelineCacheObject.device == device)
4534 }
4535
Jesse Hall03b6fe12015-11-24 12:44:21 -08004536 createInfos := pCreateInfos[0:createInfoCount]
4537 pipelines := pPipelines[0:createInfoCount]
4538 for i in (0 .. createInfoCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004539 pipeline := ?
4540 pipelines[i] = pipeline
4541 State.Pipelines[pipeline] = new!PipelineObject(device: device)
4542 }
4543
4544 return ?
4545}
4546
4547@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004548cmd void vkDestroyPipeline(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004549 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004550 VkPipeline pipeline,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004551 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004552 deviceObject := GetDevice(device)
4553 pipelineObjects := GetPipeline(pipeline)
4554 assert(pipelineObjects.device == device)
4555
4556 State.Pipelines[pipeline] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004557}
4558
4559
4560// Pipeline layout functions
4561
4562@threadSafety("system")
4563cmd VkResult vkCreatePipelineLayout(
4564 VkDevice device,
4565 const VkPipelineLayoutCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004566 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004567 VkPipelineLayout* pPipelineLayout) {
4568 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO)
4569 deviceObject := GetDevice(device)
4570
4571 pipelineLayout := ?
4572 pPipelineLayout[0] = pipelineLayout
4573 State.PipelineLayouts[pipelineLayout] = new!PipelineLayoutObject(device: device)
4574
4575 return ?
4576}
4577
4578@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004579cmd void vkDestroyPipelineLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004580 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004581 VkPipelineLayout pipelineLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004582 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004583 deviceObject := GetDevice(device)
4584 pipelineLayoutObjects := GetPipelineLayout(pipelineLayout)
4585 assert(pipelineLayoutObjects.device == device)
4586
4587 State.PipelineLayouts[pipelineLayout] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004588}
4589
4590
4591// Sampler functions
4592
4593@threadSafety("system")
4594cmd VkResult vkCreateSampler(
4595 VkDevice device,
4596 const VkSamplerCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004597 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004598 VkSampler* pSampler) {
4599 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO)
4600 deviceObject := GetDevice(device)
4601
4602 sampler := ?
4603 pSampler[0] = sampler
4604 State.Samplers[sampler] = new!SamplerObject(device: device)
4605
4606 return ?
4607}
4608
4609@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004610cmd void vkDestroySampler(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004611 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004612 VkSampler sampler,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004613 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004614 deviceObject := GetDevice(device)
4615 samplerObject := GetSampler(sampler)
4616 assert(samplerObject.device == device)
4617
4618 State.Samplers[sampler] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004619}
4620
4621
4622// Descriptor set functions
4623
4624@threadSafety("system")
4625cmd VkResult vkCreateDescriptorSetLayout(
4626 VkDevice device,
4627 const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004628 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004629 VkDescriptorSetLayout* pSetLayout) {
4630 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO)
4631 deviceObject := GetDevice(device)
4632
4633 setLayout := ?
4634 pSetLayout[0] = setLayout
4635 State.DescriptorSetLayouts[setLayout] = new!DescriptorSetLayoutObject(device: device)
4636
4637 return ?
4638}
4639
4640@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004641cmd void vkDestroyDescriptorSetLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004642 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004643 VkDescriptorSetLayout descriptorSetLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004644 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004645 deviceObject := GetDevice(device)
4646 descriptorSetLayoutObject := GetDescriptorSetLayout(descriptorSetLayout)
4647 assert(descriptorSetLayoutObject.device == device)
4648
4649 State.DescriptorSetLayouts[descriptorSetLayout] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004650}
4651
4652@threadSafety("system")
4653cmd VkResult vkCreateDescriptorPool(
4654 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004655 const VkDescriptorPoolCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004656 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004657 VkDescriptorPool* pDescriptorPool) {
4658 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO)
4659 deviceObject := GetDevice(device)
4660
4661 descriptorPool := ?
4662 pDescriptorPool[0] = descriptorPool
4663 State.DescriptorPools[descriptorPool] = new!DescriptorPoolObject(device: device)
4664
4665 return ?
4666}
4667
4668@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004669cmd void vkDestroyDescriptorPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004670 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004671 VkDescriptorPool descriptorPool,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004672 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004673 deviceObject := GetDevice(device)
4674 descriptorPoolObject := GetDescriptorPool(descriptorPool)
4675 assert(descriptorPoolObject.device == device)
4676
4677 State.DescriptorPools[descriptorPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004678}
4679
4680@threadSafety("app")
4681cmd VkResult vkResetDescriptorPool(
4682 VkDevice device,
Jesse Hallfbf97b02015-11-20 14:17:03 -08004683 VkDescriptorPool descriptorPool,
4684 VkDescriptorPoolResetFlags flags) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004685 deviceObject := GetDevice(device)
4686 descriptorPoolObject := GetDescriptorPool(descriptorPool)
4687 assert(descriptorPoolObject.device == device)
4688
4689 return ?
4690}
4691
4692@threadSafety("app")
Jesse Hall3fbc8562015-11-29 22:10:52 -08004693cmd VkResult vkAllocateDescriptorSets(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004694 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004695 const VkDescriptorSetAllocateInfo* pAllocateInfo,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004696 VkDescriptorSet* pDescriptorSets) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004697 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004698 allocInfo := pAllocateInfo[0]
Jesse Hallfbf97b02015-11-20 14:17:03 -08004699 descriptorPoolObject := GetDescriptorPool(allocInfo.descriptorPool)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004700
Jesse Hall03b6fe12015-11-24 12:44:21 -08004701 setLayouts := allocInfo.pSetLayouts[0:allocInfo.setCount]
4702 for i in (0 .. allocInfo.setCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004703 setLayout := setLayouts[i]
4704 setLayoutObject := GetDescriptorSetLayout(setLayout)
4705 assert(setLayoutObject.device == device)
4706 }
4707
Jesse Hall03b6fe12015-11-24 12:44:21 -08004708 descriptorSets := pDescriptorSets[0:allocInfo.setCount]
4709 for i in (0 .. allocInfo.setCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004710 descriptorSet := ?
4711 descriptorSets[i] = descriptorSet
4712 State.DescriptorSets[descriptorSet] = new!DescriptorSetObject(device: device)
4713 }
4714
4715 return ?
4716}
4717
Jesse Hallf09c6b12015-08-15 19:54:28 -07004718cmd VkResult vkFreeDescriptorSets(
4719 VkDevice device,
4720 VkDescriptorPool descriptorPool,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004721 u32 descriptorSetCount,
Jesse Hallf09c6b12015-08-15 19:54:28 -07004722 const VkDescriptorSet* pDescriptorSets) {
4723 deviceObject := GetDevice(device)
4724 descriptorPoolObject := GetDescriptorPool(descriptorPool)
4725
Jesse Hall03b6fe12015-11-24 12:44:21 -08004726 descriptorSets := pDescriptorSets[0:descriptorSetCount]
4727 for i in (0 .. descriptorSetCount) {
Jesse Hallf09c6b12015-08-15 19:54:28 -07004728 descriptorSet := descriptorSets[i]
4729 descriptorSetObject := GetDescriptorSet(descriptorSet)
4730 assert(descriptorSetObject.device == device)
4731 State.DescriptorSets[descriptorSet] = null
4732 }
4733
4734 return ?
4735}
4736
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004737cmd void vkUpdateDescriptorSets(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004738 VkDevice device,
Jesse Hallb00daad2015-11-29 19:46:20 -08004739 u32 descriptorWriteCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004740 const VkWriteDescriptorSet* pDescriptorWrites,
Jesse Hallb00daad2015-11-29 19:46:20 -08004741 u32 descriptorCopyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004742 const VkCopyDescriptorSet* pDescriptorCopies) {
4743 deviceObject := GetDevice(device)
4744
Jesse Hallb00daad2015-11-29 19:46:20 -08004745 descriptorWrites := pDescriptorWrites[0:descriptorWriteCount]
4746 for i in (0 .. descriptorWriteCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004747 descriptorWrite := descriptorWrites[i]
Jesse Hall3fbc8562015-11-29 22:10:52 -08004748 descriptorWriteObject := GetDescriptorSet(descriptorWrite.dstSet)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004749 assert(descriptorWriteObject.device == device)
4750 }
4751
Jesse Hallb00daad2015-11-29 19:46:20 -08004752 descriptorCopies := pDescriptorCopies[0:descriptorCopyCount]
4753 for i in (0 .. descriptorCopyCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004754 descriptorCopy := descriptorCopies[i]
Jesse Hall3fbc8562015-11-29 22:10:52 -08004755 descriptorCopyObject := GetDescriptorSet(descriptorCopy.dstSet)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004756 assert(descriptorCopyObject.device == device)
4757 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07004758}
4759
4760
4761// Framebuffer functions
4762
4763@threadSafety("system")
4764cmd VkResult vkCreateFramebuffer(
4765 VkDevice device,
4766 const VkFramebufferCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004767 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004768 VkFramebuffer* pFramebuffer) {
4769 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO)
4770 deviceObject := GetDevice(device)
4771
4772 framebuffer := ?
4773 pFramebuffer[0] = framebuffer
4774 State.Framebuffers[framebuffer] = new!FramebufferObject(device: device)
4775
4776 return ?
4777}
4778
4779@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004780cmd void vkDestroyFramebuffer(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004781 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004782 VkFramebuffer framebuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004783 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004784 deviceObject := GetDevice(device)
4785 framebufferObject := GetFramebuffer(framebuffer)
4786 assert(framebufferObject.device == device)
4787
4788 State.Framebuffers[framebuffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004789}
4790
4791
4792// Renderpass functions
4793
4794@threadSafety("system")
4795cmd VkResult vkCreateRenderPass(
4796 VkDevice device,
4797 const VkRenderPassCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004798 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004799 VkRenderPass* pRenderPass) {
4800 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO)
4801 deviceObject := GetDevice(device)
4802
4803 renderpass := ?
4804 pRenderPass[0] = renderpass
4805 State.RenderPasses[renderpass] = new!RenderPassObject(device: device)
4806
4807 return ?
4808}
4809
4810@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004811cmd void vkDestroyRenderPass(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004812 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004813 VkRenderPass renderPass,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004814 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004815 deviceObject := GetDevice(device)
4816 renderPassObject := GetRenderPass(renderPass)
4817 assert(renderPassObject.device == device)
4818
4819 State.RenderPasses[renderPass] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004820}
4821
Jesse Hall606a54e2015-11-19 22:17:28 -08004822cmd void vkGetRenderAreaGranularity(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004823 VkDevice device,
4824 VkRenderPass renderPass,
4825 VkExtent2D* pGranularity) {
4826 deviceObject := GetDevice(device)
4827 renderPassObject := GetRenderPass(renderPass)
4828
4829 granularity := ?
4830 pGranularity[0] = granularity
Jesse Halld27f6aa2015-08-15 17:58:48 -07004831}
4832
4833// Command pool functions
4834
4835cmd VkResult vkCreateCommandPool(
4836 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004837 const VkCommandPoolCreateInfo* pCreateInfo,
4838 const VkAllocationCallbacks* pAllocator,
4839 VkCommandPool* pCommandPool) {
4840 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004841 deviceObject := GetDevice(device)
4842
Jesse Hall3fbc8562015-11-29 22:10:52 -08004843 commandPool := ?
4844 pCommandPool[0] = commandPool
4845 State.CommandPools[commandPool] = new!CommandPoolObject(device: device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004846
4847 return ?
4848}
4849
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004850cmd void vkDestroyCommandPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004851 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004852 VkCommandPool commandPool,
4853 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004854 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004855 commandPoolObject := GetCommandPool(commandPool)
4856 assert(commandPoolObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004857
Jesse Hall3fbc8562015-11-29 22:10:52 -08004858 State.CommandPools[commandPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004859}
4860
4861cmd VkResult vkResetCommandPool(
4862 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004863 VkCommandPool commandPool,
4864 VkCommandPoolResetFlags flags) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004865 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004866 commandPoolObject := GetCommandPool(commandPool)
4867 assert(commandPoolObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004868
4869 return ?
4870}
4871
4872// Command buffer functions
4873
Jesse Hall3fbc8562015-11-29 22:10:52 -08004874macro void bindCommandBuffer(VkCommandBuffer commandBuffer, any obj, VkDeviceMemory memory) {
4875 memoryObject := GetDeviceMemory(memory)
4876 memoryObject.boundCommandBuffers[commandBuffer] = commandBuffer
Jesse Halld27f6aa2015-08-15 17:58:48 -07004877
Jesse Hall3fbc8562015-11-29 22:10:52 -08004878 commandBufferObject := GetCommandBuffer(commandBuffer)
4879 commandBufferObject.boundObjects[as!u64(obj)] = memory
Jesse Halld27f6aa2015-08-15 17:58:48 -07004880}
4881
Jesse Hall3fbc8562015-11-29 22:10:52 -08004882macro void unbindCommandBuffer(VkCommandBuffer commandBuffer, any obj, VkDeviceMemory memory) {
4883 memoryObject := GetDeviceMemory(memory)
4884 memoryObject.boundCommandBuffers[commandBuffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004885
Jesse Hall3fbc8562015-11-29 22:10:52 -08004886 commandBufferObject := GetCommandBuffer(commandBuffer)
4887 commandBufferObject.boundObjects[as!u64(obj)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004888}
4889
4890@threadSafety("system")
Jesse Hall3fbc8562015-11-29 22:10:52 -08004891cmd VkResult vkAllocateCommandBuffers(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004892 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004893 const VkCommandBufferAllocateInfo* pAllocateInfo,
4894 VkCommandBuffer* pCommandBuffers) {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08004895 assert(pAllocateInfo[0].sType == VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004896
Jesse Hall3dd678a2016-01-08 21:52:01 -08004897 count := pAllocateInfo[0].commandBufferCount
Jesse Hall3fbc8562015-11-29 22:10:52 -08004898 commandBuffers := pCommandBuffers[0:count]
Jesse Hallfbf97b02015-11-20 14:17:03 -08004899 for i in (0 .. count) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004900 commandBuffer := ?
4901 commandBuffers[i] = commandBuffer
4902 State.CommandBuffers[commandBuffer] = new!CommandBufferObject(device: device)
Jesse Hallfbf97b02015-11-20 14:17:03 -08004903 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07004904
4905 return ?
4906}
4907
4908@threadSafety("system")
Jesse Hallfbf97b02015-11-20 14:17:03 -08004909cmd void vkFreeCommandBuffers(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004910 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004911 VkCommandPool commandPool,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004912 u32 commandBufferCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004913 const VkCommandBuffer* pCommandBuffers) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004914 deviceObject := GetDevice(device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004915
Jesse Hall3fbc8562015-11-29 22:10:52 -08004916 commandBuffers := pCommandBuffers[0:commandBufferCount]
Jesse Hall03b6fe12015-11-24 12:44:21 -08004917 for i in (0 .. commandBufferCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004918 commandBufferObject := GetCommandBuffer(commandBuffers[i])
4919 assert(commandBufferObject.device == device)
Jesse Hallfbf97b02015-11-20 14:17:03 -08004920 // TODO: iterate over boundObjects and clear memory bindings
Jesse Hall3fbc8562015-11-29 22:10:52 -08004921 State.CommandBuffers[commandBuffers[i]] = null
Jesse Hallfbf97b02015-11-20 14:17:03 -08004922 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07004923}
4924
4925@threadSafety("app")
4926cmd VkResult vkBeginCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004927 VkCommandBuffer commandBuffer,
4928 const VkCommandBufferBeginInfo* pBeginInfo) {
4929 assert(pBeginInfo.sType == VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO)
4930 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004931
4932 // TODO: iterate over boundObjects and clear memory bindings
4933
4934 return ?
4935}
4936
4937@threadSafety("app")
4938cmd VkResult vkEndCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004939 VkCommandBuffer commandBuffer) {
4940 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004941
4942 return ?
4943}
4944
4945@threadSafety("app")
4946cmd VkResult vkResetCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004947 VkCommandBuffer commandBuffer,
4948 VkCommandBufferResetFlags flags) {
4949 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004950
4951 // TODO: iterate over boundObjects and clear memory bindings
4952
4953 return ?
4954}
4955
4956
4957// Command buffer building functions
4958
4959@threadSafety("app")
4960cmd void vkCmdBindPipeline(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004961 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004962 VkPipelineBindPoint pipelineBindPoint,
4963 VkPipeline pipeline) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004964 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004965 pipelineObject := GetPipeline(pipeline)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004966 assert(commandBufferObject.device == pipelineObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004967
Jesse Halld8bade02015-11-24 10:24:18 -08004968 queue := switch (pipelineBindPoint) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004969 case VK_PIPELINE_BIND_POINT_COMPUTE: VK_QUEUE_COMPUTE_BIT
4970 case VK_PIPELINE_BIND_POINT_GRAPHICS: VK_QUEUE_GRAPHICS_BIT
4971 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08004972 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004973}
4974
4975@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004976cmd void vkCmdSetViewport(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004977 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004978 u32 firstViewport,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004979 u32 viewportCount,
4980 const VkViewport* pViewports) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004981 commandBufferObject := GetCommandBuffer(commandBuffer)
4982 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004983}
4984
4985@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004986cmd void vkCmdSetScissor(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004987 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004988 u32 firstScissor,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004989 u32 scissorCount,
4990 const VkRect2D* pScissors) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004991 commandBufferObject := GetCommandBuffer(commandBuffer)
4992 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004993}
4994
4995@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004996cmd void vkCmdSetLineWidth(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004997 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004998 f32 lineWidth) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004999 commandBufferObject := GetCommandBuffer(commandBuffer)
5000 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005001}
5002
5003@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005004cmd void vkCmdSetDepthBias(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005005 VkCommandBuffer commandBuffer,
Jesse Halla9bb62b2015-11-21 19:31:56 -08005006 f32 depthBiasConstantFactor,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005007 f32 depthBiasClamp,
Jesse Halla9bb62b2015-11-21 19:31:56 -08005008 f32 depthBiasSlopeFactor) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005009 commandBufferObject := GetCommandBuffer(commandBuffer)
5010 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005011}
Jesse Halld27f6aa2015-08-15 17:58:48 -07005012
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005013@threadSafety("app")
5014cmd void vkCmdSetBlendConstants(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005015 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005016 // TODO(jessehall): apic only supports 'const' on pointer types. Using
5017 // an annotation as a quick hack to pass this to the template without
5018 // having to modify the AST and semantic model.
Jesse Hallb00daad2015-11-29 19:46:20 -08005019 @readonly f32[4] blendConstants) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005020 commandBufferObject := GetCommandBuffer(commandBuffer)
5021 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005022}
5023
5024@threadSafety("app")
5025cmd void vkCmdSetDepthBounds(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005026 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005027 f32 minDepthBounds,
5028 f32 maxDepthBounds) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005029 commandBufferObject := GetCommandBuffer(commandBuffer)
5030 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005031}
5032
5033@threadSafety("app")
5034cmd void vkCmdSetStencilCompareMask(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005035 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005036 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08005037 u32 compareMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005038 commandBufferObject := GetCommandBuffer(commandBuffer)
5039 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005040}
5041
5042@threadSafety("app")
5043cmd void vkCmdSetStencilWriteMask(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005044 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005045 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08005046 u32 writeMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005047 commandBufferObject := GetCommandBuffer(commandBuffer)
5048 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005049}
5050
5051@threadSafety("app")
5052cmd void vkCmdSetStencilReference(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005053 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005054 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08005055 u32 reference) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005056 commandBufferObject := GetCommandBuffer(commandBuffer)
5057 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005058}
5059
5060@threadSafety("app")
5061cmd void vkCmdBindDescriptorSets(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005062 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005063 VkPipelineBindPoint pipelineBindPoint,
5064 VkPipelineLayout layout,
5065 u32 firstSet,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005066 u32 descriptorSetCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005067 const VkDescriptorSet* pDescriptorSets,
5068 u32 dynamicOffsetCount,
5069 const u32* pDynamicOffsets) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005070 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005071
Jesse Hall03b6fe12015-11-24 12:44:21 -08005072 descriptorSets := pDescriptorSets[0:descriptorSetCount]
5073 for i in (0 .. descriptorSetCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07005074 descriptorSet := descriptorSets[i]
5075 descriptorSetObject := GetDescriptorSet(descriptorSet)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005076 assert(commandBufferObject.device == descriptorSetObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005077 }
5078
5079 dynamicOffsets := pDynamicOffsets[0:dynamicOffsetCount]
5080 for i in (0 .. dynamicOffsetCount) {
5081 dynamicOffset := dynamicOffsets[i]
5082 }
5083
Jesse Halld8bade02015-11-24 10:24:18 -08005084 queue := switch (pipelineBindPoint) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07005085 case VK_PIPELINE_BIND_POINT_COMPUTE: VK_QUEUE_COMPUTE_BIT
5086 case VK_PIPELINE_BIND_POINT_GRAPHICS: VK_QUEUE_GRAPHICS_BIT
5087 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08005088 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005089}
5090
5091@threadSafety("app")
5092cmd void vkCmdBindIndexBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005093 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005094 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005095 VkDeviceSize offset,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005096 VkIndexType indexType) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005097 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005098 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005099 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005100
Jesse Hall3fbc8562015-11-29 22:10:52 -08005101 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005102
Jesse Hall3fbc8562015-11-29 22:10:52 -08005103 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005104}
5105
5106@threadSafety("app")
5107cmd void vkCmdBindVertexBuffers(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005108 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005109 u32 firstBinding,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005110 u32 bindingCount,
5111 const VkBuffer* pBuffers,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005112 const VkDeviceSize* pOffsets) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005113 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005114
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005115 // TODO: check if not [firstBinding:firstBinding+bindingCount]
Jesse Halld27f6aa2015-08-15 17:58:48 -07005116 buffers := pBuffers[0:bindingCount]
5117 offsets := pOffsets[0:bindingCount]
5118 for i in (0 .. bindingCount) {
5119 buffer := buffers[i]
5120 offset := offsets[i]
5121 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005122 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005123
Jesse Hall3fbc8562015-11-29 22:10:52 -08005124 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005125 }
5126
Jesse Hall3fbc8562015-11-29 22:10:52 -08005127 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005128}
5129
5130@threadSafety("app")
5131cmd void vkCmdDraw(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005132 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005133 u32 vertexCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005134 u32 instanceCount,
5135 u32 firstVertex,
5136 u32 firstInstance) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005137 commandBufferObject := GetCommandBuffer(commandBuffer)
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 vkCmdDrawIndexed(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005144 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005145 u32 indexCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005146 u32 instanceCount,
5147 u32 firstIndex,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005148 s32 vertexOffset,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005149 u32 firstInstance) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005150 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005151
Jesse Hall3fbc8562015-11-29 22:10:52 -08005152 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005153}
5154
5155@threadSafety("app")
5156cmd void vkCmdDrawIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005157 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005158 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005159 VkDeviceSize offset,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005160 u32 drawCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005161 u32 stride) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005162 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005163 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005164 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005165
Jesse Hall3fbc8562015-11-29 22:10:52 -08005166 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005167
Jesse Hall3fbc8562015-11-29 22:10:52 -08005168 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005169}
5170
5171@threadSafety("app")
5172cmd void vkCmdDrawIndexedIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005173 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005174 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005175 VkDeviceSize offset,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005176 u32 drawCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005177 u32 stride) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005178 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005179 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005180 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005181
Jesse Hall3fbc8562015-11-29 22:10:52 -08005182 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005183
Jesse Hall3fbc8562015-11-29 22:10:52 -08005184 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005185}
5186
5187@threadSafety("app")
5188cmd void vkCmdDispatch(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005189 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005190 u32 x,
5191 u32 y,
5192 u32 z) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005193 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005194
Jesse Hall3fbc8562015-11-29 22:10:52 -08005195 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_COMPUTE_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005196}
5197
5198@threadSafety("app")
5199cmd void vkCmdDispatchIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005200 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005201 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005202 VkDeviceSize offset) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005203 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005204 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005205 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005206
Jesse Hall3fbc8562015-11-29 22:10:52 -08005207 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005208
Jesse Hall3fbc8562015-11-29 22:10:52 -08005209 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_COMPUTE_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005210}
5211
5212@threadSafety("app")
5213cmd void vkCmdCopyBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005214 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005215 VkBuffer srcBuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005216 VkBuffer dstBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005217 u32 regionCount,
5218 const VkBufferCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005219 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005220 srcBufferObject := GetBuffer(srcBuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005221 dstBufferObject := GetBuffer(dstBuffer)
5222 assert(commandBufferObject.device == srcBufferObject.device)
5223 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005224
5225 regions := pRegions[0:regionCount]
5226 for i in (0 .. regionCount) {
5227 region := regions[i]
5228 }
5229
Jesse Hall3fbc8562015-11-29 22:10:52 -08005230 bindCommandBuffer(commandBuffer, srcBuffer, srcBufferObject.memory)
5231 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005232
Jesse Hall65ab5522015-11-30 00:07:16 -08005233 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005234}
5235
5236@threadSafety("app")
5237cmd void vkCmdCopyImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005238 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005239 VkImage srcImage,
5240 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005241 VkImage dstImage,
5242 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005243 u32 regionCount,
5244 const VkImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005245 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005246 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005247 dstImageObject := GetImage(dstImage)
5248 assert(commandBufferObject.device == srcImageObject.device)
5249 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005250
5251 regions := pRegions[0:regionCount]
5252 for i in (0 .. regionCount) {
5253 region := regions[i]
5254 }
5255
Jesse Hall3fbc8562015-11-29 22:10:52 -08005256 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
5257 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005258
Jesse Hall65ab5522015-11-30 00:07:16 -08005259 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005260}
5261
5262@threadSafety("app")
5263cmd void vkCmdBlitImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005264 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005265 VkImage srcImage,
5266 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005267 VkImage dstImage,
5268 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005269 u32 regionCount,
5270 const VkImageBlit* pRegions,
Jesse Hall23ff73f2015-11-29 14:36:39 -08005271 VkFilter filter) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005272 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005273 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005274 dstImageObject := GetImage(dstImage)
5275 assert(commandBufferObject.device == srcImageObject.device)
5276 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005277
5278 regions := pRegions[0:regionCount]
5279 for i in (0 .. regionCount) {
5280 region := regions[i]
5281 }
5282
Jesse Hall3fbc8562015-11-29 22:10:52 -08005283 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
5284 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005285
Jesse Hall3fbc8562015-11-29 22:10:52 -08005286 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005287}
5288
5289@threadSafety("app")
5290cmd void vkCmdCopyBufferToImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005291 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005292 VkBuffer srcBuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005293 VkImage dstImage,
5294 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005295 u32 regionCount,
5296 const VkBufferImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005297 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005298 srcBufferObject := GetBuffer(srcBuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005299 dstImageObject := GetImage(dstImage)
5300 assert(commandBufferObject.device == srcBufferObject.device)
5301 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005302
5303 regions := pRegions[0:regionCount]
5304 for i in (0 .. regionCount) {
5305 region := regions[i]
5306 }
5307
Jesse Hall3fbc8562015-11-29 22:10:52 -08005308 bindCommandBuffer(commandBuffer, srcBuffer, srcBufferObject.memory)
5309 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005310
Jesse Hall65ab5522015-11-30 00:07:16 -08005311 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005312}
5313
5314@threadSafety("app")
5315cmd void vkCmdCopyImageToBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005316 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005317 VkImage srcImage,
5318 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005319 VkBuffer dstBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005320 u32 regionCount,
5321 const VkBufferImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005322 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005323 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005324 dstBufferObject := GetBuffer(dstBuffer)
5325 assert(commandBufferObject.device == srcImageObject.device)
5326 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005327
5328 regions := pRegions[0:regionCount]
5329 for i in (0 .. regionCount) {
5330 region := regions[i]
5331 }
5332
Jesse Hall3fbc8562015-11-29 22:10:52 -08005333 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
5334 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005335
Jesse Hall65ab5522015-11-30 00:07:16 -08005336 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005337}
5338
5339@threadSafety("app")
5340cmd void vkCmdUpdateBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005341 VkCommandBuffer commandBuffer,
5342 VkBuffer dstBuffer,
5343 VkDeviceSize dstOffset,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005344 VkDeviceSize dataSize,
Jesse Hall56d386a2016-07-26 15:20:40 -07005345 const void* pData) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005346 commandBufferObject := GetCommandBuffer(commandBuffer)
5347 dstBufferObject := GetBuffer(dstBuffer)
5348 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005349
5350 data := pData[0:dataSize]
5351
Jesse Hall3fbc8562015-11-29 22:10:52 -08005352 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005353
Jesse Hall65ab5522015-11-30 00:07:16 -08005354 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005355}
5356
5357@threadSafety("app")
5358cmd void vkCmdFillBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005359 VkCommandBuffer commandBuffer,
5360 VkBuffer dstBuffer,
5361 VkDeviceSize dstOffset,
Jesse Hallb00daad2015-11-29 19:46:20 -08005362 VkDeviceSize size,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005363 u32 data) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005364 commandBufferObject := GetCommandBuffer(commandBuffer)
5365 dstBufferObject := GetBuffer(dstBuffer)
5366 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005367
Jesse Hall65ab5522015-11-30 00:07:16 -08005368 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005369}
5370
5371@threadSafety("app")
5372cmd void vkCmdClearColorImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005373 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005374 VkImage image,
5375 VkImageLayout imageLayout,
5376 const VkClearColorValue* pColor,
5377 u32 rangeCount,
5378 const VkImageSubresourceRange* pRanges) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005379 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005380 imageObject := GetImage(image)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005381 assert(commandBufferObject.device == imageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005382
5383 ranges := pRanges[0:rangeCount]
5384 for i in (0 .. rangeCount) {
5385 range := ranges[i]
5386 }
5387
Jesse Hall3fbc8562015-11-29 22:10:52 -08005388 bindCommandBuffer(commandBuffer, image, imageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005389
Jesse Hall3fbc8562015-11-29 22:10:52 -08005390 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005391}
5392
5393@threadSafety("app")
5394cmd void vkCmdClearDepthStencilImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005395 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005396 VkImage image,
5397 VkImageLayout imageLayout,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005398 const VkClearDepthStencilValue* pDepthStencil,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005399 u32 rangeCount,
5400 const VkImageSubresourceRange* pRanges) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005401 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005402 imageObject := GetImage(image)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005403 assert(commandBufferObject.device == imageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005404
5405 ranges := pRanges[0:rangeCount]
5406 for i in (0 .. rangeCount) {
5407 range := ranges[i]
5408 }
5409
Jesse Hall3fbc8562015-11-29 22:10:52 -08005410 bindCommandBuffer(commandBuffer, image, imageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005411
Jesse Hall3fbc8562015-11-29 22:10:52 -08005412 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005413}
5414
5415@threadSafety("app")
Jesse Hallae38f732015-11-19 21:32:50 -08005416cmd void vkCmdClearAttachments(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005417 VkCommandBuffer commandBuffer,
Jesse Hallae38f732015-11-19 21:32:50 -08005418 u32 attachmentCount,
5419 const VkClearAttachment* pAttachments,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005420 u32 rectCount,
Jesse Halla15a4bf2015-11-19 22:48:02 -08005421 const VkClearRect* pRects) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005422 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005423
5424 rects := pRects[0:rectCount]
5425 for i in (0 .. rectCount) {
5426 rect := rects[i]
5427 }
5428
Jesse Hall3fbc8562015-11-29 22:10:52 -08005429 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005430}
5431
5432@threadSafety("app")
5433cmd void vkCmdResolveImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005434 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005435 VkImage srcImage,
5436 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005437 VkImage dstImage,
5438 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005439 u32 regionCount,
5440 const VkImageResolve* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005441 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005442 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005443 dstImageObject := GetImage(dstImage)
5444 assert(commandBufferObject.device == srcImageObject.device)
5445 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005446
5447 regions := pRegions[0:regionCount]
5448 for i in (0 .. regionCount) {
5449 region := regions[i]
5450 }
5451
Jesse Hall3fbc8562015-11-29 22:10:52 -08005452 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
5453 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005454
Jesse Hall3fbc8562015-11-29 22:10:52 -08005455 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005456}
5457
5458@threadSafety("app")
5459cmd void vkCmdSetEvent(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005460 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005461 VkEvent event,
5462 VkPipelineStageFlags stageMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005463 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005464 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005465 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005466}
5467
5468@threadSafety("app")
5469cmd void vkCmdResetEvent(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005470 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005471 VkEvent event,
5472 VkPipelineStageFlags stageMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005473 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005474 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005475 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005476}
5477
5478@threadSafety("app")
5479cmd void vkCmdWaitEvents(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005480 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005481 u32 eventCount,
5482 const VkEvent* pEvents,
5483 VkPipelineStageFlags srcStageMask,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005484 VkPipelineStageFlags dstStageMask,
5485 u32 memoryBarrierCount,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005486 const VkMemoryBarrier* pMemoryBarriers,
5487 u32 bufferMemoryBarrierCount,
5488 const VkBufferMemoryBarrier* pBufferMemoryBarriers,
5489 u32 imageMemoryBarrierCount,
5490 const VkImageMemoryBarrier* pImageMemoryBarriers) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005491 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005492
5493 events := pEvents[0:eventCount]
5494 for i in (0 .. eventCount) {
5495 event := events[i]
5496 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005497 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005498 }
5499
Jesse Hall3dd678a2016-01-08 21:52:01 -08005500 memoryBarriers := pMemoryBarriers[0:memoryBarrierCount]
Jesse Hall3fbc8562015-11-29 22:10:52 -08005501 for i in (0 .. memoryBarrierCount) {
Jesse Hall3dd678a2016-01-08 21:52:01 -08005502 memoryBarrier := memoryBarriers[i]
5503 }
5504 bufferMemoryBarriers := pBufferMemoryBarriers[0:bufferMemoryBarrierCount]
5505 for i in (0 .. bufferMemoryBarrierCount) {
5506 bufferMemoryBarrier := bufferMemoryBarriers[i]
5507 bufferObject := GetBuffer(bufferMemoryBarrier.buffer)
5508 assert(bufferObject.device == commandBufferObject.device)
5509 }
5510 imageMemoryBarriers := pImageMemoryBarriers[0:imageMemoryBarrierCount]
5511 for i in (0 .. imageMemoryBarrierCount) {
5512 imageMemoryBarrier := imageMemoryBarriers[i]
5513 imageObject := GetImage(imageMemoryBarrier.image)
5514 assert(imageObject.device == commandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005515 }
5516}
5517
5518@threadSafety("app")
5519cmd void vkCmdPipelineBarrier(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005520 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005521 VkPipelineStageFlags srcStageMask,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005522 VkPipelineStageFlags dstStageMask,
Jesse Halldc6d36c2015-11-29 19:12:15 -08005523 VkDependencyFlags dependencyFlags,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005524 u32 memoryBarrierCount,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005525 const VkMemoryBarrier* pMemoryBarriers,
5526 u32 bufferMemoryBarrierCount,
5527 const VkBufferMemoryBarrier* pBufferMemoryBarriers,
5528 u32 imageMemoryBarrierCount,
5529 const VkImageMemoryBarrier* pImageMemoryBarriers) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005530 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005531
Jesse Hall3dd678a2016-01-08 21:52:01 -08005532 memoryBarriers := pMemoryBarriers[0:memoryBarrierCount]
Jesse Hall3fbc8562015-11-29 22:10:52 -08005533 for i in (0 .. memoryBarrierCount) {
Jesse Hall3dd678a2016-01-08 21:52:01 -08005534 memoryBarrier := memoryBarriers[i]
5535 }
5536 bufferMemoryBarriers := pBufferMemoryBarriers[0:bufferMemoryBarrierCount]
5537 for i in (0 .. bufferMemoryBarrierCount) {
5538 bufferMemoryBarrier := bufferMemoryBarriers[i]
5539 bufferObject := GetBuffer(bufferMemoryBarrier.buffer)
5540 assert(bufferObject.device == commandBufferObject.device)
5541 }
5542 imageMemoryBarriers := pImageMemoryBarriers[0:imageMemoryBarrierCount]
5543 for i in (0 .. imageMemoryBarrierCount) {
5544 imageMemoryBarrier := imageMemoryBarriers[i]
5545 imageObject := GetImage(imageMemoryBarrier.image)
5546 assert(imageObject.device == commandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005547 }
5548}
5549
5550@threadSafety("app")
5551cmd void vkCmdBeginQuery(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005552 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005553 VkQueryPool queryPool,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005554 u32 query,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005555 VkQueryControlFlags flags) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005556 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005557 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005558 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005559}
5560
5561@threadSafety("app")
5562cmd void vkCmdEndQuery(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005563 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005564 VkQueryPool queryPool,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005565 u32 query) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005566 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005567 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005568 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005569}
5570
5571@threadSafety("app")
5572cmd void vkCmdResetQueryPool(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005573 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005574 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005575 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005576 u32 queryCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005577 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005578 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005579 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005580}
5581
5582@threadSafety("app")
5583cmd void vkCmdWriteTimestamp(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005584 VkCommandBuffer commandBuffer,
Jesse Hall6f39a6d2015-11-24 11:08:36 -08005585 VkPipelineStageFlagBits pipelineStage,
Jesse Halla3a7a1d2015-11-24 11:37:23 -08005586 VkQueryPool queryPool,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005587 u32 query) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005588 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halla3a7a1d2015-11-24 11:37:23 -08005589 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005590 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005591}
5592
5593@threadSafety("app")
5594cmd void vkCmdCopyQueryPoolResults(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005595 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005596 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005597 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005598 u32 queryCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005599 VkBuffer dstBuffer,
5600 VkDeviceSize dstOffset,
Jesse Halla9bb62b2015-11-21 19:31:56 -08005601 VkDeviceSize stride,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005602 VkQueryResultFlags flags) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005603 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005604 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005605 dstBufferObject := GetBuffer(dstBuffer)
5606 assert(commandBufferObject.device == queryPoolObject.device)
5607 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005608}
5609
5610cmd void vkCmdPushConstants(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005611 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005612 VkPipelineLayout layout,
5613 VkShaderStageFlags stageFlags,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005614 u32 offset,
5615 u32 size,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08005616 const void* pValues) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005617 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005618 layoutObject := GetPipelineLayout(layout)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005619 assert(commandBufferObject.device == layoutObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005620}
5621
5622@threadSafety("app")
5623cmd void vkCmdBeginRenderPass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005624 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005625 const VkRenderPassBeginInfo* pRenderPassBegin,
Jesse Hall65ab5522015-11-30 00:07:16 -08005626 VkSubpassContents contents) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005627 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005628 renderPassObject := GetRenderPass(pRenderPassBegin.renderPass)
5629 framebufferObject := GetFramebuffer(pRenderPassBegin.framebuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005630 assert(commandBufferObject.device == renderPassObject.device)
5631 assert(commandBufferObject.device == framebufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005632
Jesse Hall3fbc8562015-11-29 22:10:52 -08005633 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005634}
5635
5636cmd void vkCmdNextSubpass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005637 VkCommandBuffer commandBuffer,
Jesse Hall65ab5522015-11-30 00:07:16 -08005638 VkSubpassContents contents) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005639 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005640}
5641
5642@threadSafety("app")
5643cmd void vkCmdEndRenderPass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005644 VkCommandBuffer commandBuffer) {
5645 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005646
Jesse Hall3fbc8562015-11-29 22:10:52 -08005647 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005648}
5649
5650cmd void vkCmdExecuteCommands(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005651 VkCommandBuffer commandBuffer,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005652 u32 commandBufferCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005653 const VkCommandBuffer* pCommandBuffers) {
5654 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005655
Jesse Hall3dd678a2016-01-08 21:52:01 -08005656 commandBuffers := pCommandBuffers[0:commandBufferCount]
5657 for i in (0 .. commandBufferCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005658 secondaryCommandBuffer := commandBuffers[i]
5659 secondaryCommandBufferObject := GetCommandBuffer(secondaryCommandBuffer)
5660 assert(commandBufferObject.device == secondaryCommandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005661 }
5662}
5663
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005664@extension("VK_KHR_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005665cmd void vkDestroySurfaceKHR(
5666 VkInstance instance,
Jesse Hall0e74f002015-11-30 11:37:59 -08005667 VkSurfaceKHR surface,
5668 const VkAllocationCallbacks* pAllocator) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005669 instanceObject := GetInstance(instance)
5670 surfaceObject := GetSurface(surface)
5671 assert(surfaceObject.instance == instance)
Michael Lentine88594d72015-11-12 12:49:45 -08005672
Jesse Hall1356b0d2015-11-23 17:24:58 -08005673 State.Surfaces[surface] = null
Jesse Hall2818f932015-11-19 21:19:17 -08005674}
5675
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005676@extension("VK_KHR_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005677cmd VkResult vkGetPhysicalDeviceSurfaceSupportKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005678 VkPhysicalDevice physicalDevice,
5679 u32 queueFamilyIndex,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005680 VkSurfaceKHR surface,
Jesse Hallb00daad2015-11-29 19:46:20 -08005681 VkBool32* pSupported) {
5682 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08005683
5684 return ?
5685}
5686
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005687@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08005688cmd VkResult vkGetPhysicalDeviceSurfaceCapabilitiesKHR(
5689 VkPhysicalDevice physicalDevice,
5690 VkSurfaceKHR surface,
5691 VkSurfaceCapabilitiesKHR* pSurfaceCapabilities) {
5692 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5693
5694 surfaceCapabilities := ?
5695 pSurfaceCapabilities[0] = surfaceCapabilities
5696
5697 return ?
5698}
5699
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005700@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08005701cmd VkResult vkGetPhysicalDeviceSurfaceFormatsKHR(
5702 VkPhysicalDevice physicalDevice,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005703 VkSurfaceKHR surface,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005704 u32* pSurfaceFormatCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005705 VkSurfaceFormatKHR* pSurfaceFormats) {
Jesse Hallb00daad2015-11-29 19:46:20 -08005706 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08005707
5708 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08005709 pSurfaceFormatCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08005710 surfaceFormats := pSurfaceFormats[0:count]
5711
5712 for i in (0 .. count) {
5713 surfaceFormat := ?
5714 surfaceFormats[i] = surfaceFormat
5715 }
5716
5717 return ?
5718}
5719
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005720@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08005721cmd VkResult vkGetPhysicalDeviceSurfacePresentModesKHR(
5722 VkPhysicalDevice physicalDevice,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005723 VkSurfaceKHR surface,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005724 u32* pPresentModeCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005725 VkPresentModeKHR* pPresentModes) {
Jesse Hallb00daad2015-11-29 19:46:20 -08005726 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08005727
5728 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08005729 pPresentModeCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08005730 presentModes := pPresentModes[0:count]
5731
5732 for i in (0 .. count) {
5733 presentMode := ?
5734 presentModes[i] = presentMode
5735 }
5736
5737 return ?
5738}
5739
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005740@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005741cmd VkResult vkCreateSwapchainKHR(
5742 VkDevice device,
5743 const VkSwapchainCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005744 const VkAllocationCallbacks* pAllocator,
Michael Lentine88594d72015-11-12 12:49:45 -08005745 VkSwapchainKHR* pSwapchain) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005746 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR)
Michael Lentine88594d72015-11-12 12:49:45 -08005747 deviceObject := GetDevice(device)
5748
5749 swapchain := ?
5750 pSwapchain[0] = swapchain
5751 State.Swapchains[swapchain] = new!SwapchainObject(device: device)
5752
5753 return ?
5754}
5755
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005756@extension("VK_KHR_swapchain")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005757cmd void vkDestroySwapchainKHR(
Michael Lentine88594d72015-11-12 12:49:45 -08005758 VkDevice device,
Jesse Hall0e74f002015-11-30 11:37:59 -08005759 VkSwapchainKHR swapchain,
5760 const VkAllocationCallbacks* pAllocator) {
Michael Lentine88594d72015-11-12 12:49:45 -08005761 deviceObject := GetDevice(device)
5762 swapchainObject := GetSwapchain(swapchain)
5763 assert(swapchainObject.device == device)
5764
5765 State.Swapchains[swapchain] = null
Michael Lentine88594d72015-11-12 12:49:45 -08005766}
5767
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005768@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005769cmd VkResult vkGetSwapchainImagesKHR(
5770 VkDevice device,
5771 VkSwapchainKHR swapchain,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005772 u32* pSwapchainImageCount,
Michael Lentine88594d72015-11-12 12:49:45 -08005773 VkImage* pSwapchainImages) {
5774 deviceObject := GetDevice(device)
5775
5776 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08005777 pSwapchainImageCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08005778 swapchainImages := pSwapchainImages[0:count]
5779
5780 for i in (0 .. count) {
5781 swapchainImage := ?
5782 swapchainImages[i] = swapchainImage
Jesse Hall1356b0d2015-11-23 17:24:58 -08005783 State.Images[swapchainImage] = new!ImageObject(device: device)
Michael Lentine88594d72015-11-12 12:49:45 -08005784 }
5785
5786 return ?
5787}
5788
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005789@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005790cmd VkResult vkAcquireNextImageKHR(
5791 VkDevice device,
5792 VkSwapchainKHR swapchain,
5793 u64 timeout,
5794 VkSemaphore semaphore,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005795 VkFence fence,
Michael Lentine88594d72015-11-12 12:49:45 -08005796 u32* pImageIndex) {
5797 deviceObject := GetDevice(device)
5798 swapchainObject := GetSwapchain(swapchain)
5799
5800 imageIndex := ?
5801 pImageIndex[0] = imageIndex
5802
5803 return ?
5804}
5805
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005806@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005807cmd VkResult vkQueuePresentKHR(
5808 VkQueue queue,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08005809 const VkPresentInfoKHR* pPresentInfo) {
Michael Lentine88594d72015-11-12 12:49:45 -08005810 queueObject := GetQueue(queue)
5811
5812 presentInfo := ?
5813 pPresentInfo[0] = presentInfo
5814
5815 return ?
5816}
5817
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005818@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005819cmd VkResult vkGetPhysicalDeviceDisplayPropertiesKHR(
5820 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005821 u32* pPropertyCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005822 VkDisplayPropertiesKHR* pProperties) {
5823 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5824 return ?
5825}
5826
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005827@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005828cmd VkResult vkGetPhysicalDeviceDisplayPlanePropertiesKHR(
5829 VkPhysicalDevice physicalDevice,
5830 u32* pPropertyCount,
5831 VkDisplayPlanePropertiesKHR* pProperties) {
5832 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5833 return ?
5834}
5835
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005836@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005837cmd VkResult vkGetDisplayPlaneSupportedDisplaysKHR(
5838 VkPhysicalDevice physicalDevice,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005839 u32 planeIndex,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08005840 u32* pDisplayCount,
5841 VkDisplayKHR* pDisplays) {
Jesse Halla6429252015-11-29 18:59:42 -08005842 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5843 return ?
5844}
5845
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005846@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005847cmd VkResult vkGetDisplayModePropertiesKHR(
5848 VkPhysicalDevice physicalDevice,
5849 VkDisplayKHR display,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005850 u32* pPropertyCount,
5851 VkDisplayModePropertiesKHR* pProperties) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005852 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5853 return ?
5854}
5855
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005856@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005857cmd VkResult vkCreateDisplayModeKHR(
5858 VkPhysicalDevice physicalDevice,
5859 VkDisplayKHR display,
5860 const VkDisplayModeCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005861 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005862 VkDisplayModeKHR* pMode) {
5863 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5864 return ?
5865}
5866
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005867@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005868cmd VkResult vkGetDisplayPlaneCapabilitiesKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005869 VkPhysicalDevice physicalDevice,
Jesse Hall9ba8bc82015-11-30 16:22:16 -08005870 VkDisplayModeKHR mode,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005871 u32 planeIndex,
Jesse Halla6429252015-11-29 18:59:42 -08005872 VkDisplayPlaneCapabilitiesKHR* pCapabilities) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005873 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5874 return ?
5875}
5876
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005877@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005878cmd VkResult vkCreateDisplayPlaneSurfaceKHR(
5879 VkInstance instance,
5880 const VkDisplaySurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005881 const VkAllocationCallbacks* pAllocator,
Jesse Halla6429252015-11-29 18:59:42 -08005882 VkSurfaceKHR* pSurface) {
5883 return ?
5884}
5885
Jesse Hall9ba8bc82015-11-30 16:22:16 -08005886@extension("VK_KHR_display_swapchain")
5887cmd VkResult vkCreateSharedSwapchainsKHR(
5888 VkDevice device,
5889 u32 swapchainCount,
5890 const VkSwapchainCreateInfoKHR* pCreateInfos,
5891 const VkAllocationCallbacks* pAllocator,
5892 VkSwapchainKHR* pSwapchains) {
5893 return ?
5894}
5895
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005896@extension("VK_KHR_xlib_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005897cmd VkResult vkCreateXlibSurfaceKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005898 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005899 const VkXlibSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005900 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005901 VkSurfaceKHR* pSurface) {
5902 instanceObject := GetInstance(instance)
5903 return ?
5904}
5905
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005906@extension("VK_KHR_xlib_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005907cmd VkBool32 vkGetPhysicalDeviceXlibPresentationSupportKHR(
5908 VkPhysicalDevice physicalDevice,
5909 u32 queueFamilyIndex,
5910 platform.Display* dpy,
Jesse Hall65ab5522015-11-30 00:07:16 -08005911 platform.VisualID visualID) {
Jesse Halla6429252015-11-29 18:59:42 -08005912 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5913 return ?
5914}
5915
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005916@extension("VK_KHR_xcb_surface")
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005917cmd VkResult vkCreateXcbSurfaceKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005918 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005919 const VkXcbSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005920 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005921 VkSurfaceKHR* pSurface) {
5922 instanceObject := GetInstance(instance)
5923 return ?
5924}
5925
Jesse Hall523db342015-11-30 21:12:55 -08005926@extension("VK_KHR_xcb_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005927cmd VkBool32 vkGetPhysicalDeviceXcbPresentationSupportKHR(
5928 VkPhysicalDevice physicalDevice,
5929 u32 queueFamilyIndex,
5930 platform.xcb_connection_t* connection,
5931 platform.xcb_visualid_t visual_id) {
5932 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5933 return ?
5934}
5935
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005936@extension("VK_KHR_wayland_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005937cmd VkResult vkCreateWaylandSurfaceKHR(
5938 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005939 const VkWaylandSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005940 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005941 VkSurfaceKHR* pSurface) {
5942 instanceObject := GetInstance(instance)
5943 return ?
5944}
5945
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005946@extension("VK_KHR_wayland_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005947cmd VkBool32 vkGetPhysicalDeviceWaylandPresentationSupportKHR(
5948 VkPhysicalDevice physicalDevice,
5949 u32 queueFamilyIndex,
5950 platform.wl_display* display) {
5951 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5952 return ?
5953}
5954
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005955@extension("VK_KHR_mir_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005956cmd VkResult vkCreateMirSurfaceKHR(
5957 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005958 const VkMirSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005959 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005960 VkSurfaceKHR* pSurface) {
5961 instanceObject := GetInstance(instance)
5962 return ?
5963}
5964
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005965@extension("VK_KHR_mir_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005966cmd VkBool32 vkGetPhysicalDeviceMirPresentationSupportKHR(
5967 VkPhysicalDevice physicalDevice,
5968 u32 queueFamilyIndex,
5969 platform.MirConnection* connection) {
5970 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5971 return ?
5972}
5973
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005974@extension("VK_KHR_android_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005975cmd VkResult vkCreateAndroidSurfaceKHR(
5976 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005977 const VkAndroidSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005978 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005979 VkSurfaceKHR* pSurface) {
5980 instanceObject := GetInstance(instance)
5981 return ?
5982}
5983
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005984@extension("VK_KHR_win32_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005985cmd VkResult vkCreateWin32SurfaceKHR(
5986 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005987 const VkWin32SurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005988 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005989 VkSurfaceKHR* pSurface) {
5990 instanceObject := GetInstance(instance)
5991 return ?
5992}
5993
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005994@extension("VK_KHR_win32_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005995cmd VkResult vkGetPhysicalDeviceWin32PresentationSupportKHR(
5996 VkPhysicalDevice physicalDevice,
5997 u32 queueFamilyIndex) {
Jesse Halle2948d82016-02-25 04:19:32 -08005998 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Jesse Halla6429252015-11-29 18:59:42 -08005999 return ?
6000}
6001
Chia-I Wub262ddc2016-03-22 07:38:20 +08006002@extension("VK_ANDROID_native_buffer")
Jesse Halld1abd742017-02-09 21:45:51 -08006003@optional
Chia-I Wub262ddc2016-03-22 07:38:20 +08006004cmd VkResult vkGetSwapchainGrallocUsageANDROID(
6005 VkDevice device,
6006 VkFormat format,
6007 VkImageUsageFlags imageUsage,
Jesse Halld1abd742017-02-09 21:45:51 -08006008 s32* grallocUsage) {
Chia-I Wub262ddc2016-03-22 07:38:20 +08006009 return ?
6010}
6011
6012@extension("VK_ANDROID_native_buffer")
Jesse Halld1abd742017-02-09 21:45:51 -08006013@optional
Chris Forbes8e4438b2016-12-07 16:26:49 +13006014cmd VkResult vkGetSwapchainGrallocUsage2ANDROID(
6015 VkDevice device,
6016 VkFormat format,
6017 VkImageUsageFlags imageUsage,
6018 VkSwapchainImageUsageFlagsANDROID swapchainImageUsage,
Jesse Halld1abd742017-02-09 21:45:51 -08006019 u64* grallocConsumerUsage,
6020 u64* grallocProducerUsage) {
Chris Forbes8e4438b2016-12-07 16:26:49 +13006021 return ?
6022}
6023
6024@extension("VK_ANDROID_native_buffer")
Chia-I Wub262ddc2016-03-22 07:38:20 +08006025cmd VkResult vkAcquireImageANDROID(
6026 VkDevice device,
6027 VkImage image,
6028 int nativeFenceFd,
6029 VkSemaphore semaphore,
6030 VkFence fence) {
6031 return ?
6032}
6033
6034@extension("VK_ANDROID_native_buffer")
6035cmd VkResult vkQueueSignalReleaseImageANDROID(
6036 VkQueue queue,
6037 u32 waitSemaphoreCount,
6038 const VkSemaphore* pWaitSemaphores,
6039 VkImage image,
6040 int* pNativeFenceFd) {
6041 return ?
6042}
6043
Ian Elliott4c8bb2a2016-12-29 11:07:26 -07006044@extension("VK_GOOGLE_display_timing")
6045cmd VkResult vkGetRefreshCycleDurationGOOGLE(
6046 VkDevice device,
6047 VkSwapchainKHR swapchain,
6048 VkRefreshCycleDurationGOOGLE* pDisplayTimingProperties) {
6049 deviceObject := GetDevice(device)
6050 swapchainObject := GetSwapchain(swapchain)
6051
6052 displayTimingProperties := ?
6053 pDisplayTimingProperties[0] = displayTimingProperties
6054
6055 return ?
6056}
6057
6058@extension("VK_GOOGLE_display_timing")
6059cmd VkResult vkGetPastPresentationTimingGOOGLE(
6060 VkDevice device,
6061 VkSwapchainKHR swapchain,
6062 u32* pPresentationTimingCount,
6063 VkPastPresentationTimingGOOGLE* pPresentationTimings) {
Ian Elliott4c8bb2a2016-12-29 11:07:26 -07006064 return ?
6065}
6066
Jesse Hall715b86a2016-01-16 16:34:29 -08006067@extension("VK_EXT_debug_report")
6068@external type void* PFN_vkDebugReportCallbackEXT
6069@extension("VK_EXT_debug_report")
6070@pfn cmd VkBool32 vkDebugReportCallbackEXT(
6071 VkDebugReportFlagsEXT flags,
6072 VkDebugReportObjectTypeEXT objectType,
6073 u64 object,
6074 platform.size_t location,
6075 s32 messageCode,
6076 const char* pLayerPrefix,
6077 const char* pMessage,
6078 void* pUserData) {
6079 return ?
6080}
6081
6082@extension("VK_EXT_debug_report")
6083cmd VkResult vkCreateDebugReportCallbackEXT(
6084 VkInstance instance,
6085 const VkDebugReportCallbackCreateInfoEXT* pCreateInfo,
6086 const VkAllocationCallbacks* pAllocator,
6087 VkDebugReportCallbackEXT* pCallback) {
6088 return ?
6089}
6090
6091@extension("VK_EXT_debug_report")
6092cmd void vkDestroyDebugReportCallbackEXT(
6093 VkInstance instance,
6094 VkDebugReportCallbackEXT callback,
6095 const VkAllocationCallbacks* pAllocator) {
6096}
6097
6098@extension("VK_EXT_debug_report")
6099cmd void vkDebugReportMessageEXT(
6100 VkInstance instance,
6101 VkDebugReportFlagsEXT flags,
6102 VkDebugReportObjectTypeEXT objectType,
6103 u64 object,
6104 platform.size_t location,
6105 s32 messageCode,
6106 const char* pLayerPrefix,
6107 const char* pMessage) {
6108}
6109
Jesse Hall26763382016-05-20 07:13:52 -07006110@extension("VK_EXT_debug_marker")
6111cmd VkResult vkDebugMarkerSetObjectTagEXT(
6112 VkDevice device,
6113 VkDebugMarkerObjectTagInfoEXT* pTagInfo) {
6114 return ?
6115}
6116
6117@extension("VK_EXT_debug_marker")
6118cmd VkResult vkDebugMarkerSetObjectNameEXT(
6119 VkDevice device,
6120 VkDebugMarkerObjectNameInfoEXT* pNameInfo) {
6121 return ?
6122}
6123
6124@extension("VK_EXT_debug_marker")
6125cmd void vkCmdDebugMarkerBeginEXT(
6126 VkCommandBuffer commandBuffer,
6127 VkDebugMarkerMarkerInfoEXT* pMarkerInfo) {
6128}
6129
6130@extension("VK_EXT_debug_marker")
6131cmd void vkCmdDebugMarkerEndEXT(
6132 VkCommandBuffer commandBuffer) {
6133}
6134
6135@extension("VK_EXT_debug_marker")
6136cmd void vkCmdDebugMarkerInsertEXT(
6137 VkCommandBuffer commandBuffer,
6138 VkDebugMarkerMarkerInfoEXT* pMarkerInfo) {
6139}
6140
Jesse Halleb02c472017-02-24 15:13:45 -08006141@extension("VK_AMD_draw_indirect_count")
6142cmd void vkCmdDrawIndirectCountAMD(
6143 VkCommandBuffer commandBuffer,
6144 VkBuffer buffer,
6145 VkDeviceSize offset,
6146 VkBuffer countBuffer,
6147 VkDeviceSize countBufferOffset,
6148 u32 maxDrawCount,
6149 u32 stride) {
6150}
6151
6152@extension("VK_AMD_draw_indirect_count")
6153cmd void vkCmdDrawIndexedIndirectCountAMD(
6154 VkCommandBuffer commandBuffer,
6155 VkBuffer buffer,
6156 VkDeviceSize offset,
6157 VkBuffer countBuffer,
6158 VkDeviceSize countBufferOffset,
6159 u32 maxDrawCount,
6160 u32 stride) {
6161}
6162
6163@extension("VK_NV_external_memory_capabilities")
6164cmd VkResult vkGetPhysicalDeviceExternalImageFormatPropertiesNV(
6165 VkPhysicalDevice physicalDevice,
6166 VkFormat format,
6167 VkImageType type,
6168 VkImageTiling tiling,
6169 VkImageUsageFlags usage,
6170 VkImageCreateFlags flags,
6171 VkExternalMemoryHandleTypeFlagsNV externalHandleType,
6172 VkExternalImageFormatPropertiesNV* pExternalImageFormatProperties) {
6173 return ?
6174}
6175
6176@extension("VK_NV_external_memory_win32")
6177cmd VkResult vkGetMemoryWin32HandleNV(
6178 VkDevice device,
6179 VkDeviceMemory memory,
6180 VkExternalMemoryHandleTypeFlagsNV handleType,
6181 platform.HANDLE* pHandle) {
6182 return ?
6183}
6184
Chris Forbes1194ede2016-12-30 16:29:25 +13006185@extension("VK_KHR_get_physical_device_properties2")
6186cmd void vkGetPhysicalDeviceFeatures2KHR(
6187 VkPhysicalDevice physicalDevice,
6188 VkPhysicalDeviceFeatures2KHR* pFeatures) {
6189}
6190
6191@extension("VK_KHR_get_physical_device_properties2")
6192cmd void vkGetPhysicalDeviceProperties2KHR(
6193 VkPhysicalDevice physicalDevice,
6194 VkPhysicalDeviceProperties2KHR* pProperties) {
6195}
6196
6197@extension("VK_KHR_get_physical_device_properties2")
6198cmd void vkGetPhysicalDeviceFormatProperties2KHR(
6199 VkPhysicalDevice physicalDevice,
6200 VkFormat format,
6201 VkFormatProperties2KHR* pFormatProperties) {
6202}
6203
6204@extension("VK_KHR_get_physical_device_properties2")
6205cmd VkResult vkGetPhysicalDeviceImageFormatProperties2KHR(
6206 VkPhysicalDevice physicalDevice,
6207 const VkPhysicalDeviceImageFormatInfo2KHR* pImageFormatInfo,
6208 VkImageFormatProperties2KHR* pImageFormatProperties) {
6209 return ?
6210}
6211
6212@extension("VK_KHR_get_physical_device_properties2")
6213cmd void vkGetPhysicalDeviceQueueFamilyProperties2KHR(
6214 VkPhysicalDevice physicalDevice,
6215 u32* pQueueFamilyPropertyCount,
6216 VkQueueFamilyProperties2KHR* pQueueFamilyProperties) {
6217}
6218
6219@extension("VK_KHR_get_physical_device_properties2")
6220cmd void vkGetPhysicalDeviceMemoryProperties2KHR(
6221 VkPhysicalDevice physicalDevice,
6222 VkPhysicalDeviceMemoryProperties2KHR* pMemoryProperties) {
6223}
6224
6225@extension("VK_KHR_get_physical_device_properties2")
6226cmd void vkGetPhysicalDeviceSparseImageFormatProperties2KHR(
Jesse Hall77ad05b2017-03-10 22:02:20 -08006227 VkPhysicalDevice physicalDevice,
6228 const VkPhysicalDeviceSparseImageFormatInfo2KHR* pFormatInfo,
6229 u32* pPropertyCount,
6230 VkSparseImageFormatProperties2KHR* pProperties) {
6231}
6232
6233@extension("VK_NN_vi_surface")
6234cmd VkResult vkCreateViSurfaceNN(
6235 VkInstance instance,
6236 const VkViSurfaceCreateInfoNN* pCreateInfo,
6237 const VkAllocationCallbacks* pAllocator,
6238 VkSurfaceKHR* pSurface) {
6239 return ?
6240}
6241
6242@extension("VK_KHR_maintenance1")
6243cmd void vkTrimCommandPoolKHR(
6244 VkDevice device,
6245 VkCommandPool commandPool,
6246 VkCommandPoolTrimFlagsKHR flags) {
Chris Forbes1194ede2016-12-30 16:29:25 +13006247}
6248
Jesse Halleb02c472017-02-24 15:13:45 -08006249@extension("VK_NVX_device_generated_commands")
6250cmd void vkCmdProcessCommandsNVX(
Chris Forbes289cb792016-12-30 15:03:55 +13006251 VkCommandBuffer commandBuffer,
6252 const VkCmdProcessCommandsInfoNVX* pProcessCommandsInfo) {
6253}
6254
Jesse Halleb02c472017-02-24 15:13:45 -08006255@extension("VK_NVX_device_generated_commands")
6256cmd void vkCmdReserveSpaceForCommandsNVX(
Chris Forbes289cb792016-12-30 15:03:55 +13006257 VkCommandBuffer commandBuffer,
6258 const VkCmdReserveSpaceForCommandsInfoNVX* pReserveSpaceInfo) {
6259}
6260
Jesse Halleb02c472017-02-24 15:13:45 -08006261@extension("VK_NVX_device_generated_commands")
6262cmd VkResult vkCreateIndirectCommandsLayoutNVX(
Chris Forbes289cb792016-12-30 15:03:55 +13006263 VkDevice device,
6264 const VkIndirectCommandsLayoutCreateInfoNVX* pCreateInfo,
6265 const VkAllocationCallbacks* pAllocator,
6266 VkIndirectCommandsLayoutNVX* pIndirectCommandsLayout) {
6267 return ?
6268}
6269
Jesse Halleb02c472017-02-24 15:13:45 -08006270@extension("VK_NVX_device_generated_commands")
6271cmd void vkDestroyIndirectCommandsLayoutNVX(
Chris Forbes289cb792016-12-30 15:03:55 +13006272 VkDevice device,
6273 VkIndirectCommandsLayoutNVX indirectCommandsLayout,
6274 const VkAllocationCallbacks* pAllocator) {
6275}
6276
Jesse Halleb02c472017-02-24 15:13:45 -08006277@extension("VK_NVX_device_generated_commands")
6278cmd VkResult vkCreateObjectTableNVX(
Chris Forbes289cb792016-12-30 15:03:55 +13006279 VkDevice device,
6280 const VkObjectTableCreateInfoNVX* pCreateInfo,
6281 const VkAllocationCallbacks* pAllocator,
6282 VkObjectTableNVX* pObjectTable) {
6283 return ?
6284}
6285
Jesse Halleb02c472017-02-24 15:13:45 -08006286@extension("VK_NVX_device_generated_commands")
6287cmd void vkDestroyObjectTableNVX(
Chris Forbes289cb792016-12-30 15:03:55 +13006288 VkDevice device,
6289 VkObjectTableNVX objectTable,
6290 const VkAllocationCallbacks* pAllocator) {
6291}
6292
Jesse Halleb02c472017-02-24 15:13:45 -08006293@extension("VK_NVX_device_generated_commands")
6294cmd VkResult vkRegisterObjectsNVX(
Chris Forbes289cb792016-12-30 15:03:55 +13006295 VkDevice device,
6296 VkObjectTableNVX objectTable,
6297 u32 objectCount,
6298 const VkObjectTableEntryNVX* const* ppObjectTableEntries,
6299 const u32* pObjectIndices) {
6300 return ?
6301}
6302
Jesse Halleb02c472017-02-24 15:13:45 -08006303@extension("VK_NVX_device_generated_commands")
6304cmd VkResult vkUnregisterObjectsNVX(
Chris Forbes289cb792016-12-30 15:03:55 +13006305 VkDevice device,
6306 VkObjectTableNVX objectTable,
6307 u32 objectCount,
6308 const VkObjectEntryTypeNVX* pObjectEntryTypes,
6309 const u32* pObjectIndices) {
6310 return ?
6311}
6312
Jesse Halleb02c472017-02-24 15:13:45 -08006313@extension("VK_NVX_device_generated_commands")
6314cmd void vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX(
Chris Forbes289cb792016-12-30 15:03:55 +13006315 VkPhysicalDevice physicalDevice,
6316 VkDeviceGeneratedCommandsFeaturesNVX* pFeatures,
6317 VkDeviceGeneratedCommandsLimitsNVX* pLimits) {
6318}
6319
Jesse Hall77ad05b2017-03-10 22:02:20 -08006320@extension("VK_EXT_direct_mode_display")
6321cmd VkResult vkReleaseDisplayEXT(
6322 VkPhysicalDevice physicalDevice,
6323 VkDisplayKHR display) {
6324 return ?
6325}
6326
6327@extension("VK_EXT_acquire_xlib_display")
6328cmd VkResult vkAcquireXlibDisplayEXT(
6329 VkPhysicalDevice physicalDevice,
6330 platform.Display* dpy,
6331 VkDisplayKHR display) {
6332 return ?
6333}
6334
6335@extension("VK_EXT_acquire_xlib_display")
6336cmd VkResult vkGetRandROutputDisplayEXT(
6337 VkPhysicalDevice physicalDevice,
6338 platform.Display* dpy,
6339 platform.RROutput rrOutput,
6340 VkDisplayKHR* pDisplay) {
6341 return ?
6342}
6343
6344@extension("VK_EXT_display_surface_counter")
6345cmd VkResult vkGetPhysicalDeviceSurfaceCapabilities2EXT(
6346 VkPhysicalDevice physicalDevice,
6347 VkSurfaceKHR surface,
6348 VkSurfaceCapabilities2EXT* pSurfaceCapabilities) {
6349 return ?
6350}
6351
6352@extension("VK_EXT_display_control")
6353cmd VkResult vkDisplayPowerControlEXT(
6354 VkDevice device,
6355 VkDisplayKHR display,
6356 const VkDisplayPowerInfoEXT* pDisplayPowerInfo) {
6357 return ?
6358}
6359
6360@extension("VK_EXT_display_control")
6361cmd VkResult vkRegisterDeviceEventEXT(
6362 VkDevice device,
6363 const VkDeviceEventInfoEXT* pDeviceEventInfo,
6364 const VkAllocationCallbacks* pAllocator,
6365 VkFence* pFence) {
6366 return ?
6367}
6368
6369@extension("VK_EXT_display_control")
6370cmd VkResult vkRegisterDisplayEventEXT(
6371 VkDevice device,
6372 VkDisplayKHR display,
6373 const VkDisplayEventInfoEXT* pDisplayEventInfo,
6374 const VkAllocationCallbacks* pAllocator,
6375 VkFence* pFence) {
6376 return ?
6377}
6378
6379@extension("VK_EXT_display_control")
6380cmd VkResult vkGetSwapchainCounterEXT(
6381 VkDevice device,
6382 VkSwapchainKHR swapchain,
6383 VkSurfaceCounterFlagBitsEXT counter,
6384 u64* pCounterValue) {
6385 return ?
6386}
6387
Jesse Hall889cd9a2017-02-25 22:12:23 -08006388@extension("VK_EXT_hdr_metadata")
6389cmd void vkSetHdrMetadataEXT(
6390 VkDevice device,
6391 u32 swapchainCount,
6392 const VkSwapchainKHR* pSwapchains,
6393 const VkHdrMetadataEXT* pMetadata) {
6394}
6395
Chris Forbes1d5f68c2017-01-31 10:17:01 +13006396@extension("VK_KHR_shared_presentable_image")
Chris Forbes2e12cb82017-01-18 11:45:17 +13006397cmd VkResult vkGetSwapchainStatusKHR(
6398 VkDevice device,
6399 VkSwapchainKHR swapchain) {
6400 return ?
6401}
6402
Jesse Halld27f6aa2015-08-15 17:58:48 -07006403////////////////
6404// Validation //
6405////////////////
6406
6407extern void validate(string layerName, bool condition, string message)
6408
6409
6410/////////////////////////////
6411// Internal State Tracking //
6412/////////////////////////////
6413
6414StateObject State
6415
6416@internal class StateObject {
6417 // Dispatchable objects.
6418 map!(VkInstance, ref!InstanceObject) Instances
6419 map!(VkPhysicalDevice, ref!PhysicalDeviceObject) PhysicalDevices
6420 map!(VkDevice, ref!DeviceObject) Devices
6421 map!(VkQueue, ref!QueueObject) Queues
Jesse Hall3fbc8562015-11-29 22:10:52 -08006422 map!(VkCommandBuffer, ref!CommandBufferObject) CommandBuffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07006423
6424 // Non-dispatchable objects.
6425 map!(VkDeviceMemory, ref!DeviceMemoryObject) DeviceMemories
6426 map!(VkBuffer, ref!BufferObject) Buffers
6427 map!(VkBufferView, ref!BufferViewObject) BufferViews
6428 map!(VkImage, ref!ImageObject) Images
6429 map!(VkImageView, ref!ImageViewObject) ImageViews
Jesse Halld27f6aa2015-08-15 17:58:48 -07006430 map!(VkShaderModule, ref!ShaderModuleObject) ShaderModules
Jesse Halld27f6aa2015-08-15 17:58:48 -07006431 map!(VkPipeline, ref!PipelineObject) Pipelines
6432 map!(VkPipelineLayout, ref!PipelineLayoutObject) PipelineLayouts
6433 map!(VkSampler, ref!SamplerObject) Samplers
6434 map!(VkDescriptorSet, ref!DescriptorSetObject) DescriptorSets
6435 map!(VkDescriptorSetLayout, ref!DescriptorSetLayoutObject) DescriptorSetLayouts
6436 map!(VkDescriptorPool, ref!DescriptorPoolObject) DescriptorPools
Jesse Halld27f6aa2015-08-15 17:58:48 -07006437 map!(VkFence, ref!FenceObject) Fences
6438 map!(VkSemaphore, ref!SemaphoreObject) Semaphores
6439 map!(VkEvent, ref!EventObject) Events
6440 map!(VkQueryPool, ref!QueryPoolObject) QueryPools
6441 map!(VkFramebuffer, ref!FramebufferObject) Framebuffers
6442 map!(VkRenderPass, ref!RenderPassObject) RenderPasses
6443 map!(VkPipelineCache, ref!PipelineCacheObject) PipelineCaches
Jesse Hall3fbc8562015-11-29 22:10:52 -08006444 map!(VkCommandPool, ref!CommandPoolObject) CommandPools
Jesse Hall1356b0d2015-11-23 17:24:58 -08006445 map!(VkSurfaceKHR, ref!SurfaceObject) Surfaces
Michael Lentine88594d72015-11-12 12:49:45 -08006446 map!(VkSwapchainKHR, ref!SwapchainObject) Swapchains
Jesse Halld27f6aa2015-08-15 17:58:48 -07006447}
6448
6449@internal class InstanceObject {
6450}
6451
6452@internal class PhysicalDeviceObject {
6453 VkInstance instance
6454}
6455
6456@internal class DeviceObject {
6457 VkPhysicalDevice physicalDevice
6458}
6459
6460@internal class QueueObject {
6461 VkDevice device
6462 VkQueueFlags flags
6463}
6464
Jesse Hall3fbc8562015-11-29 22:10:52 -08006465@internal class CommandBufferObject {
Jesse Halld27f6aa2015-08-15 17:58:48 -07006466 VkDevice device
6467 map!(u64, VkDeviceMemory) boundObjects
6468 VkQueueFlags queueFlags
6469}
6470
6471@internal class DeviceMemoryObject {
Jesse Hall3fbc8562015-11-29 22:10:52 -08006472 VkDevice device
6473 VkDeviceSize allocationSize
6474 map!(u64, VkDeviceSize) boundObjects
6475 map!(VkCommandBuffer, VkCommandBuffer) boundCommandBuffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07006476}
6477
6478@internal class BufferObject {
6479 VkDevice device
Jesse Hall3fbc8562015-11-29 22:10:52 -08006480 VkDeviceMemory memory
6481 VkDeviceSize memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07006482}
6483
6484@internal class BufferViewObject {
6485 VkDevice device
6486 VkBuffer buffer
6487}
6488
6489@internal class ImageObject {
6490 VkDevice device
Jesse Hall3fbc8562015-11-29 22:10:52 -08006491 VkDeviceMemory memory
6492 VkDeviceSize memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07006493}
6494
6495@internal class ImageViewObject {
6496 VkDevice device
6497 VkImage image
6498}
6499
Jesse Halld27f6aa2015-08-15 17:58:48 -07006500@internal class ShaderObject {
6501 VkDevice device
6502}
6503
6504@internal class ShaderModuleObject {
6505 VkDevice device
6506}
6507
6508@internal class PipelineObject {
6509 VkDevice device
6510}
6511
6512@internal class PipelineLayoutObject {
6513 VkDevice device
6514}
6515
6516@internal class SamplerObject {
6517 VkDevice device
6518}
6519
6520@internal class DescriptorSetObject {
6521 VkDevice device
6522}
6523
6524@internal class DescriptorSetLayoutObject {
6525 VkDevice device
6526}
6527
6528@internal class DescriptorPoolObject {
6529 VkDevice device
6530}
6531
Jesse Halld27f6aa2015-08-15 17:58:48 -07006532@internal class FenceObject {
6533 VkDevice device
6534 bool signaled
6535}
6536
6537@internal class SemaphoreObject {
6538 VkDevice device
6539}
6540
6541@internal class EventObject {
6542 VkDevice device
6543}
6544
6545@internal class QueryPoolObject {
6546 VkDevice device
6547}
6548
6549@internal class FramebufferObject {
6550 VkDevice device
6551}
6552
6553@internal class RenderPassObject {
6554 VkDevice device
6555}
6556
6557@internal class PipelineCacheObject {
6558 VkDevice device
6559}
6560
Jesse Hall3fbc8562015-11-29 22:10:52 -08006561@internal class CommandPoolObject {
Jesse Halld27f6aa2015-08-15 17:58:48 -07006562 VkDevice device
6563}
6564
Jesse Hall1356b0d2015-11-23 17:24:58 -08006565@internal class SurfaceObject {
6566 VkInstance instance
6567}
6568
Michael Lentine88594d72015-11-12 12:49:45 -08006569@internal class SwapchainObject {
6570 VkDevice device
6571}
6572
Jesse Halld27f6aa2015-08-15 17:58:48 -07006573macro ref!InstanceObject GetInstance(VkInstance instance) {
6574 assert(instance in State.Instances)
6575 return State.Instances[instance]
6576}
6577
6578macro ref!PhysicalDeviceObject GetPhysicalDevice(VkPhysicalDevice physicalDevice) {
6579 assert(physicalDevice in State.PhysicalDevices)
6580 return State.PhysicalDevices[physicalDevice]
6581}
6582
6583macro ref!DeviceObject GetDevice(VkDevice device) {
6584 assert(device in State.Devices)
6585 return State.Devices[device]
6586}
6587
6588macro ref!QueueObject GetQueue(VkQueue queue) {
6589 assert(queue in State.Queues)
6590 return State.Queues[queue]
6591}
6592
Jesse Hall3fbc8562015-11-29 22:10:52 -08006593macro ref!CommandBufferObject GetCommandBuffer(VkCommandBuffer commandBuffer) {
6594 assert(commandBuffer in State.CommandBuffers)
6595 return State.CommandBuffers[commandBuffer]
Jesse Halld27f6aa2015-08-15 17:58:48 -07006596}
6597
Jesse Hall3fbc8562015-11-29 22:10:52 -08006598macro ref!DeviceMemoryObject GetDeviceMemory(VkDeviceMemory memory) {
6599 assert(memory in State.DeviceMemories)
6600 return State.DeviceMemories[memory]
Jesse Halld27f6aa2015-08-15 17:58:48 -07006601}
6602
6603macro ref!BufferObject GetBuffer(VkBuffer buffer) {
6604 assert(buffer in State.Buffers)
6605 return State.Buffers[buffer]
6606}
6607
6608macro ref!BufferViewObject GetBufferView(VkBufferView bufferView) {
6609 assert(bufferView in State.BufferViews)
6610 return State.BufferViews[bufferView]
6611}
6612
6613macro ref!ImageObject GetImage(VkImage image) {
6614 assert(image in State.Images)
6615 return State.Images[image]
6616}
6617
6618macro ref!ImageViewObject GetImageView(VkImageView imageView) {
6619 assert(imageView in State.ImageViews)
6620 return State.ImageViews[imageView]
6621}
6622
Jesse Halld27f6aa2015-08-15 17:58:48 -07006623macro ref!ShaderModuleObject GetShaderModule(VkShaderModule shaderModule) {
6624 assert(shaderModule in State.ShaderModules)
6625 return State.ShaderModules[shaderModule]
6626}
6627
6628macro ref!PipelineObject GetPipeline(VkPipeline pipeline) {
6629 assert(pipeline in State.Pipelines)
6630 return State.Pipelines[pipeline]
6631}
6632
6633macro ref!PipelineLayoutObject GetPipelineLayout(VkPipelineLayout pipelineLayout) {
6634 assert(pipelineLayout in State.PipelineLayouts)
6635 return State.PipelineLayouts[pipelineLayout]
6636}
6637
6638macro ref!SamplerObject GetSampler(VkSampler sampler) {
6639 assert(sampler in State.Samplers)
6640 return State.Samplers[sampler]
6641}
6642
6643macro ref!DescriptorSetObject GetDescriptorSet(VkDescriptorSet descriptorSet) {
6644 assert(descriptorSet in State.DescriptorSets)
6645 return State.DescriptorSets[descriptorSet]
6646}
6647
6648macro ref!DescriptorSetLayoutObject GetDescriptorSetLayout(VkDescriptorSetLayout descriptorSetLayout) {
6649 assert(descriptorSetLayout in State.DescriptorSetLayouts)
6650 return State.DescriptorSetLayouts[descriptorSetLayout]
6651}
6652
6653macro ref!DescriptorPoolObject GetDescriptorPool(VkDescriptorPool descriptorPool) {
6654 assert(descriptorPool in State.DescriptorPools)
6655 return State.DescriptorPools[descriptorPool]
6656}
6657
Jesse Halld27f6aa2015-08-15 17:58:48 -07006658macro ref!FenceObject GetFence(VkFence fence) {
6659 assert(fence in State.Fences)
6660 return State.Fences[fence]
6661}
6662
6663macro ref!SemaphoreObject GetSemaphore(VkSemaphore semaphore) {
6664 assert(semaphore in State.Semaphores)
6665 return State.Semaphores[semaphore]
6666}
6667
6668macro ref!EventObject GetEvent(VkEvent event) {
6669 assert(event in State.Events)
6670 return State.Events[event]
6671}
6672
6673macro ref!QueryPoolObject GetQueryPool(VkQueryPool queryPool) {
6674 assert(queryPool in State.QueryPools)
6675 return State.QueryPools[queryPool]
6676}
6677
6678macro ref!FramebufferObject GetFramebuffer(VkFramebuffer framebuffer) {
6679 assert(framebuffer in State.Framebuffers)
6680 return State.Framebuffers[framebuffer]
6681}
6682
6683macro ref!RenderPassObject GetRenderPass(VkRenderPass renderPass) {
6684 assert(renderPass in State.RenderPasses)
6685 return State.RenderPasses[renderPass]
6686}
6687
6688macro ref!PipelineCacheObject GetPipelineCache(VkPipelineCache pipelineCache) {
6689 assert(pipelineCache in State.PipelineCaches)
6690 return State.PipelineCaches[pipelineCache]
6691}
6692
Jesse Hall3fbc8562015-11-29 22:10:52 -08006693macro ref!CommandPoolObject GetCommandPool(VkCommandPool commandPool) {
6694 assert(commandPool in State.CommandPools)
6695 return State.CommandPools[commandPool]
Jesse Hallf09c6b12015-08-15 19:54:28 -07006696}
Michael Lentine88594d72015-11-12 12:49:45 -08006697
Jesse Hall1356b0d2015-11-23 17:24:58 -08006698macro ref!SurfaceObject GetSurface(VkSurfaceKHR surface) {
6699 assert(surface in State.Surfaces)
6700 return State.Surfaces[surface]
6701}
6702
Michael Lentine88594d72015-11-12 12:49:45 -08006703macro ref!SwapchainObject GetSwapchain(VkSwapchainKHR swapchain) {
6704 assert(swapchain in State.Swapchains)
6705 return State.Swapchains[swapchain]
6706}
Jesse Halld8bade02015-11-24 10:24:18 -08006707
6708macro VkQueueFlags AddQueueFlag(VkQueueFlags flags, VkQueueFlagBits bit) {
6709 return as!VkQueueFlags(as!u32(flags) | as!u32(bit))
6710}