blob: a89fed93cd1391002c62be88edb6e39d44225738 [file] [log] [blame]
Jesse Halld27f6aa2015-08-15 17:58:48 -07001// Copyright (c) 2015 The Khronos Group Inc.
2//
3// Permission is hereby granted, free of charge, to any person obtaining a
4// copy of this software and/or associated documentation files (the
5// "Materials"), to deal in the Materials without restriction, including
6// without limitation the rights to use, copy, modify, merge, publish,
7// distribute, sublicense, and/or sell copies of the Materials, and to
8// permit persons to whom the Materials are furnished to do so, subject to
9// the following conditions:
10//
11// The above copyright notice and this permission notice shall be included
12// in all copies or substantial portions of the Materials.
13//
14// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20// MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
21
22import platform "platform.api"
23
24///////////////
25// Constants //
26///////////////
27
28// API version (major.minor.patch)
Jesse Hall3dd678a2016-01-08 21:52:01 -080029define VERSION_MAJOR 1
30define VERSION_MINOR 0
Chris Forbes289cb792016-12-30 15:03:55 +130031define VERSION_PATCH 38
Jesse Halld27f6aa2015-08-15 17:58:48 -070032
33// API limits
Jesse Hall65ab5522015-11-30 00:07:16 -080034define VK_MAX_PHYSICAL_DEVICE_NAME_SIZE 256
35define VK_UUID_SIZE 16
36define VK_MAX_EXTENSION_NAME_SIZE 256
37define VK_MAX_DESCRIPTION_SIZE 256
38define VK_MAX_MEMORY_TYPES 32
39define VK_MAX_MEMORY_HEAPS 16 /// The maximum number of unique memory heaps, each of which supporting 1 or more memory types.
Jesse Halld27f6aa2015-08-15 17:58:48 -070040
41// API keywords
42define VK_TRUE 1
43define VK_FALSE 0
Jesse Hall5ae3abb2015-10-08 14:00:22 -070044
45// API keyword, but needs special handling by some templates
46define NULL_HANDLE 0
Jesse Halld27f6aa2015-08-15 17:58:48 -070047
Jesse Hall33faaad2016-01-24 21:00:49 -080048@extension("VK_KHR_surface") define VK_KHR_SURFACE_SPEC_VERSION 25
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080049@extension("VK_KHR_surface") define VK_KHR_SURFACE_EXTENSION_NAME "VK_KHR_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080050
Jesse Hall26763382016-05-20 07:13:52 -070051@extension("VK_KHR_swapchain") define VK_KHR_SWAPCHAIN_SPEC_VERSION 68
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080052@extension("VK_KHR_swapchain") define VK_KHR_SWAPCHAIN_EXTENSION_NAME "VK_KHR_swapchain"
Jesse Hall1356b0d2015-11-23 17:24:58 -080053
Jesse Hall543a7ff2016-01-08 16:38:30 -080054@extension("VK_KHR_display") define VK_KHR_DISPLAY_SPEC_VERSION 21
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080055@extension("VK_KHR_display") define VK_KHR_DISPLAY_EXTENSION_NAME "VK_KHR_display"
Jesse Hall1356b0d2015-11-23 17:24:58 -080056
Jesse Hall543a7ff2016-01-08 16:38:30 -080057@extension("VK_KHR_display_swapchain") define VK_KHR_DISPLAY_SWAPCHAIN_SPEC_VERSION 9
Jesse Hall0e74f002015-11-30 11:37:59 -080058@extension("VK_KHR_display_swapchain") define VK_KHR_DISPLAY_SWAPCHAIN_EXTENSION_NAME "VK_KHR_display_swapchain"
Jesse Hall1356b0d2015-11-23 17:24:58 -080059
Jesse Hall543a7ff2016-01-08 16:38:30 -080060@extension("VK_KHR_xlib_surface") define VK_KHR_XLIB_SURFACE_SPEC_VERSION 6
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080061@extension("VK_KHR_xlib_surface") define VK_KHR_XLIB_SURFACE_NAME "VK_KHR_xlib_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080062
Jesse Hall543a7ff2016-01-08 16:38:30 -080063@extension("VK_KHR_xcb_surface") define VK_KHR_XCB_SURFACE_SPEC_VERSION 6
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080064@extension("VK_KHR_xcb_surface") define VK_KHR_XCB_SURFACE_NAME "VK_KHR_xcb_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080065
Jesse Hall543a7ff2016-01-08 16:38:30 -080066@extension("VK_KHR_wayland_surface") define VK_KHR_WAYLAND_SURFACE_SPEC_VERSION 5
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080067@extension("VK_KHR_wayland_surface") define VK_KHR_WAYLAND_SURFACE_NAME "VK_KHR_wayland_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080068
Jesse Hall543a7ff2016-01-08 16:38:30 -080069@extension("VK_KHR_mir_surface") define VK_KHR_MIR_SURFACE_SPEC_VERSION 4
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080070@extension("VK_KHR_mir_surface") define VK_KHR_MIR_SURFACE_NAME "VK_KHR_mir_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080071
Jesse Hall33faaad2016-01-24 21:00:49 -080072@extension("VK_KHR_android_surface") define VK_KHR_ANDROID_SURFACE_SPEC_VERSION 6
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080073@extension("VK_KHR_android_surface") define VK_KHR_ANDROID_SURFACE_NAME "VK_KHR_android_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080074
Jesse Hall543a7ff2016-01-08 16:38:30 -080075@extension("VK_KHR_win32_surface") define VK_KHR_WIN32_SURFACE_SPEC_VERSION 5
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080076@extension("VK_KHR_win32_surface") define VK_KHR_WIN32_SURFACE_NAME "VK_KHR_win32_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080077
Ian Elliott948233a2017-01-06 12:13:23 -070078@extension("VK_KHR_incremental_present") define VK_KHR_INCREMENTAL_PRESENT_SPEC_VERSION 1
79@extension("VK_KHR_incremental_present") define VK_KHR_INCREMENTAL_PRESENT_NAME "VK_KHR_incremental_present"
80
Chris Forbes8e4438b2016-12-07 16:26:49 +130081@extension("VK_ANDROID_native_buffer") define VK_ANDROID_NATIVE_BUFFER_SPEC_VERSION 6
Chia-I Wub262ddc2016-03-22 07:38:20 +080082@extension("VK_ANDROID_native_buffer") define VK_ANDROID_NATIVE_BUFFER_NAME "VK_ANDROID_native_buffer"
83
Ian Elliott4c8bb2a2016-12-29 11:07:26 -070084@extension("VK_GOOGLE_display_timing") define VK_GOOGLE_DISPLAY_TIMING_SPEC_VERSION 1
85@extension("VK_GOOGLE_display_timing") define VK_GOOGLE_DISPLAY_TIMING_NAME "VK_GOOGLE_display_timing"
86
Chris Forbes289cb792016-12-30 15:03:55 +130087@extension("VK_EXT_debug_report") define VK_EXT_DEBUG_REPORT_SPEC_VERSION 4
Jesse Hall715b86a2016-01-16 16:34:29 -080088@extension("VK_EXT_debug_report") define VK_EXT_DEBUG_REPORT_NAME "VK_EXT_debug_report"
89
Jesse Hall26763382016-05-20 07:13:52 -070090@extension("VK_NV_glsl_shader") define VK_NV_GLSL_SHADER_SPEC_VERSION 1
91@extension("VK_NV_glsl_shader") define VK_NV_GLSL_SHADER_NAME "VK_NV_glsl_shader"
92
93@extension("VK_KHR_sampler_mirror_clamp_to_edge") define VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_SPEC_VERSION 1
94@extension("VK_KHR_sampler_mirror_clamp_to_edge") define VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_NAME "VK_KHR_sampler_mirror_clamp_to_edge"
95
96@extension("VK_IMG_filter_cubic") define VK_IMG_FILTER_CUBIC_SPEC_VERSION 1
97@extension("VK_IMG_filter_cubic") define VK_IMG_FILTER_CUBIC_NAME "VK_IMG_filter_cubic"
98
99@extension("VK_AMD_rasterization_order") define VK_AMD_RASTERIZATION_ORDER_SPEC_VERSION 1
100@extension("VK_AMD_rasterization_order") define VK_AMD_RASTERIZATION_ORDER_NAME "VK_AMD_rasterization_order"
101
Jesse Hall56d386a2016-07-26 15:20:40 -0700102@extension("VK_AMD_shader_trinary_minmax") define VK_AMD_SHADER_TRINARY_MINMAX_SPEC_VERSION 1
103@extension("VK_AMD_shader_trinary_minmax") define VK_AMD_SHADER_TRINARY_MINMAX_EXTENSION_NAME "VK_AMD_shader_trinary_minmax"
104
105@extension("VK_AMD_shader_explicit_vertex_parameter") define VK_AMD_SHADER_EXPLICIT_VERTEX_PARAMETER_SPEC_VERSION 1
106@extension("VK_AMD_shader_explicit_vertex_parameter") define VK_AMD_SHADER_EXPLICIT_VERTEX_PARAMETER_EXTENSION_NAME "VK_AMD_shader_explicit_vertex_parameter"
107
Jesse Hall26763382016-05-20 07:13:52 -0700108@extension("VK_EXT_debug_marker") define VK_EXT_DEBUG_MARKER_SPEC_VERSION 3
109@extension("VK_EXT_debug_marker") define VK_EXT_DEBUG_MARKER_NAME "VK_EXT_debug_marker"
110
Jesse Hall56d386a2016-07-26 15:20:40 -0700111@extension("VK_AMD_gcn_shader") define VK_AMD_GCN_SHADER_SPEC_VERSION 1
112@extension("VK_AMD_gcn_shader") define VK_AMD_GCN_SHADER_EXTENSION_NAME "VK_AMD_gcn_shader"
113
114@extension("VK_NV_dedicated_allocation") define VK_NV_DEDICATED_ALLOCATION_SPEC_VERSION 1
115@extension("VK_NV_dedicated_allocation") define VK_NV_DEDICATED_ALLOCATION_EXTENSION_NAME "VK_NV_dedicated_allocation"
116
Chris Forbes1194ede2016-12-30 16:29:25 +1300117@extension("VK_KHR_get_physical_device_properties2") define VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_SPEC_VERSION 1
118@extension("VK_KHR_get_physical_device_properties2") define VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME "VK_KHR_get_physical_device_properties2"
119
Chris Forbes289cb792016-12-30 15:03:55 +1300120@extension("VK_AMD_draw_indirect_count") define VK_AMD_DRAW_INDIRECT_COUNT_SPEC_VERSION 1
121@extension("VK_AMD_draw_indirect_count") define VK_AMD_DRAW_INDIRECT_COUNT_EXTENSION_NAME "VK_AMD_draw_indirect_count"
122
123@extension("VK_AMD_negative_viewport_height") define VK_AMD_NEGATIVE_VIEWPORT_HEIGHT_SPEC_VERSION 1
124@extension("VK_AMD_negative_viewport_height") define VK_AMD_NEGATIVE_VIEWPORT_HEIGHT_EXTENSION_NAME "VK_AMD_negative_viewport_height"
125
126@extension("VK_AMD_gpu_shader_half_float") define VK_AMD_GPU_SHADER_HALF_FLOAT_SPEC_VERSION 1
127@extension("VK_AMD_gpu_shader_half_float") define VK_AMD_GPU_SHADER_HALF_FLOAT_EXTENSION_NAME "VK_AMD_gpu_shader_half_float"
128
129@extension("VK_AMD_shader_ballot") define VK_AMD_SHADER_BALLOT_SPEC_VERSION 1
130@extension("VK_AMD_shader_ballot") define VK_AMD_SHADER_BALLOT_EXTENSION_NAME "VK_AMD_shader_ballot"
131
132@extension("VK_IMG_format_pvrtc") define VK_IMG_FORMAT_PVRTC_SPEC_VERSION 1
133@extension("VK_IMG_format_pvrtc") define VK_IMG_FORMAT_PVRTC_EXTENSION_NAME "VK_IMG_format_pvrtc"
134
135@extension("VK_NV_external_memory_capabilities") define VK_NV_EXTERNAL_MEMORY_CAPABILITIES_SPEC_VERSION 1
136@extension("VK_NV_external_memory_capabilities") define VK_NV_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME "VK_NV_external_memory_capabilities"
137
138@extension("VK_NV_external_memory") define VK_NV_EXTERNAL_MEMORY_SPEC_VERSION 1
139@extension("VK_NV_external_memory") define VK_NV_EXTERNAL_MEMORY_EXTENSION_NAME "VK_NV_external_memory"
140
141@extension("VK_NV_external_memory_win32") define VK_NV_EXTERNAL_MEMORY_WIN32_SPEC_VERSION 1
142@extension("VK_NV_external_memory_win32") define VK_NV_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME "VK_NV_external_memory_win32"
143
144@extension("VK_NV_win32_keyed_mutex") define VK_NV_WIN32_KEYED_MUTEX_SPEC_VERSION 1
145@extension("VK_NV_win32_keyed_mutex") define VK_NV_WIN32_KEYED_MUTEX_EXTENSION_NAME "VK_NV_win32_keyed_mutex"
146
147@extension("VK_EXT_validation_flags") define VK_EXT_VALIDATION_FLAGS_SPEC_VERSION 1
148@extension("VK_EXT_validation_flags") define VK_EXT_VALIDATION_FLAGS_EXTENSION_NAME "VK_EXT_validation_flags"
149
150@extension("VK_NVX_device_generated_commands") define VK_NVX_DEVICE_GENERATED_COMMANDS_SPEC_VERSION 1
151@extension("VK_NVX_device_generated_commands") define VK_NVX_DEVICE_GENERATED_COMMANDS_EXTENSION_NAME "VK_NVX_device_generated_commands"
152
Chris Forbes1d5f68c2017-01-31 10:17:01 +1300153@extension("VK_KHR_shared_presentable_image") define VK_KHR_SHARED_PRESENTABLE_IMAGE_SPEC_VERSION 1
154@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 +1300155
Chris Forbes289cb792016-12-30 15:03:55 +1300156
Jesse Halld27f6aa2015-08-15 17:58:48 -0700157
158/////////////
159// Types //
160/////////////
161
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700162type u32 VkBool32
163type u32 VkFlags
164type u64 VkDeviceSize
165type u32 VkSampleMask
166
Jesse Halld27f6aa2015-08-15 17:58:48 -0700167/// Dispatchable handle types.
168@dispatchHandle type u64 VkInstance
169@dispatchHandle type u64 VkPhysicalDevice
170@dispatchHandle type u64 VkDevice
171@dispatchHandle type u64 VkQueue
Jesse Hall3fbc8562015-11-29 22:10:52 -0800172@dispatchHandle type u64 VkCommandBuffer
Jesse Halld27f6aa2015-08-15 17:58:48 -0700173
174/// Non dispatchable handle types.
175@nonDispatchHandle type u64 VkDeviceMemory
Jesse Hall3fbc8562015-11-29 22:10:52 -0800176@nonDispatchHandle type u64 VkCommandPool
Jesse Halld27f6aa2015-08-15 17:58:48 -0700177@nonDispatchHandle type u64 VkBuffer
178@nonDispatchHandle type u64 VkBufferView
179@nonDispatchHandle type u64 VkImage
180@nonDispatchHandle type u64 VkImageView
Jesse Halld27f6aa2015-08-15 17:58:48 -0700181@nonDispatchHandle type u64 VkShaderModule
Jesse Halld27f6aa2015-08-15 17:58:48 -0700182@nonDispatchHandle type u64 VkPipeline
183@nonDispatchHandle type u64 VkPipelineLayout
184@nonDispatchHandle type u64 VkSampler
185@nonDispatchHandle type u64 VkDescriptorSet
186@nonDispatchHandle type u64 VkDescriptorSetLayout
187@nonDispatchHandle type u64 VkDescriptorPool
Jesse Halld27f6aa2015-08-15 17:58:48 -0700188@nonDispatchHandle type u64 VkFence
189@nonDispatchHandle type u64 VkSemaphore
190@nonDispatchHandle type u64 VkEvent
191@nonDispatchHandle type u64 VkQueryPool
192@nonDispatchHandle type u64 VkFramebuffer
193@nonDispatchHandle type u64 VkRenderPass
194@nonDispatchHandle type u64 VkPipelineCache
Jesse Hall1356b0d2015-11-23 17:24:58 -0800195
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800196@extension("VK_KHR_surface") @nonDispatchHandle type u64 VkSurfaceKHR
Jesse Hall1356b0d2015-11-23 17:24:58 -0800197
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800198@extension("VK_KHR_swapchain") @nonDispatchHandle type u64 VkSwapchainKHR
Jesse Hall1356b0d2015-11-23 17:24:58 -0800199
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800200@extension("VK_KHR_display") @nonDispatchHandle type u64 VkDisplayKHR
201@extension("VK_KHR_display") @nonDispatchHandle type u64 VkDisplayModeKHR
Jesse Halld27f6aa2015-08-15 17:58:48 -0700202
Jesse Hall715b86a2016-01-16 16:34:29 -0800203@extension("VK_EXT_debug_report") @nonDispatchHandle type u64 VkDebugReportCallbackEXT
204
Chris Forbes289cb792016-12-30 15:03:55 +1300205@extension("VK_NVX_device_generated_commands") @nonDispatchHandle type u64 VkObjectTableNVX
206@extension("VK_NVX_device_generated_commands") @nonDispatchHandle type u64 VkIndirectCommandsLayoutNVX
207
Jesse Halld27f6aa2015-08-15 17:58:48 -0700208
209/////////////
210// Enums //
211/////////////
212
213enum VkImageLayout {
214 VK_IMAGE_LAYOUT_UNDEFINED = 0x00000000, /// Implicit layout an image is when its contents are undefined due to various reasons (e.g. right after creation)
215 VK_IMAGE_LAYOUT_GENERAL = 0x00000001, /// General layout when image can be used for any kind of access
216 VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL = 0x00000002, /// Optimal layout when image is only used for color attachment read/write
217 VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL = 0x00000003, /// Optimal layout when image is only used for depth/stencil attachment read/write
218 VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL = 0x00000004, /// Optimal layout when image is used for read only depth/stencil attachment and shader access
219 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 -0800220 VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL = 0x00000006, /// Optimal layout when image is used only as source of transfer operations
221 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 -0700222 VK_IMAGE_LAYOUT_PREINITIALIZED = 0x00000008, /// Initial layout used when the data is populated by the CPU
Jesse Hall1356b0d2015-11-23 17:24:58 -0800223
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800224 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800225 VK_IMAGE_LAYOUT_PRESENT_SRC_KHR = 1000001002,
Chris Forbesaf3a1112017-01-31 15:37:03 +1300226
227 //@extension("VK_KHR_shared_presentable_image")
228 VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR = 1000111000,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700229}
230
231enum VkAttachmentLoadOp {
232 VK_ATTACHMENT_LOAD_OP_LOAD = 0x00000000,
233 VK_ATTACHMENT_LOAD_OP_CLEAR = 0x00000001,
234 VK_ATTACHMENT_LOAD_OP_DONT_CARE = 0x00000002,
235}
236
237enum VkAttachmentStoreOp {
238 VK_ATTACHMENT_STORE_OP_STORE = 0x00000000,
239 VK_ATTACHMENT_STORE_OP_DONT_CARE = 0x00000001,
240}
241
242enum VkImageType {
243 VK_IMAGE_TYPE_1D = 0x00000000,
244 VK_IMAGE_TYPE_2D = 0x00000001,
245 VK_IMAGE_TYPE_3D = 0x00000002,
246}
247
248enum VkImageTiling {
Jesse Hallc7467b72015-11-29 21:05:26 -0800249 VK_IMAGE_TILING_OPTIMAL = 0x00000000,
250 VK_IMAGE_TILING_LINEAR = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700251}
252
253enum VkImageViewType {
254 VK_IMAGE_VIEW_TYPE_1D = 0x00000000,
255 VK_IMAGE_VIEW_TYPE_2D = 0x00000001,
256 VK_IMAGE_VIEW_TYPE_3D = 0x00000002,
257 VK_IMAGE_VIEW_TYPE_CUBE = 0x00000003,
258 VK_IMAGE_VIEW_TYPE_1D_ARRAY = 0x00000004,
259 VK_IMAGE_VIEW_TYPE_2D_ARRAY = 0x00000005,
260 VK_IMAGE_VIEW_TYPE_CUBE_ARRAY = 0x00000006,
261}
262
Jesse Hall3fbc8562015-11-29 22:10:52 -0800263enum VkCommandBufferLevel {
264 VK_COMMAND_BUFFER_LEVEL_PRIMARY = 0x00000000,
265 VK_COMMAND_BUFFER_LEVEL_SECONDARY = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700266}
267
Jesse Hall65ab5522015-11-30 00:07:16 -0800268enum VkComponentSwizzle {
269 VK_COMPONENT_SWIZZLE_IDENTITY = 0x00000000,
270 VK_COMPONENT_SWIZZLE_ZERO = 0x00000001,
271 VK_COMPONENT_SWIZZLE_ONE = 0x00000002,
272 VK_COMPONENT_SWIZZLE_R = 0x00000003,
273 VK_COMPONENT_SWIZZLE_G = 0x00000004,
274 VK_COMPONENT_SWIZZLE_B = 0x00000005,
275 VK_COMPONENT_SWIZZLE_A = 0x00000006,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700276}
277
278enum VkDescriptorType {
279 VK_DESCRIPTOR_TYPE_SAMPLER = 0x00000000,
280 VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER = 0x00000001,
281 VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE = 0x00000002,
282 VK_DESCRIPTOR_TYPE_STORAGE_IMAGE = 0x00000003,
283 VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER = 0x00000004,
284 VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER = 0x00000005,
285 VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER = 0x00000006,
286 VK_DESCRIPTOR_TYPE_STORAGE_BUFFER = 0x00000007,
287 VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC = 0x00000008,
288 VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC = 0x00000009,
289 VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT = 0x0000000a,
290}
291
Jesse Halld27f6aa2015-08-15 17:58:48 -0700292enum VkQueryType {
293 VK_QUERY_TYPE_OCCLUSION = 0x00000000,
294 VK_QUERY_TYPE_PIPELINE_STATISTICS = 0x00000001, /// Optional
Jesse Halla3a7a1d2015-11-24 11:37:23 -0800295 VK_QUERY_TYPE_TIMESTAMP = 0x00000002,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700296}
297
Jesse Halld27f6aa2015-08-15 17:58:48 -0700298enum VkBorderColor {
299 VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK = 0x00000000,
300 VK_BORDER_COLOR_INT_TRANSPARENT_BLACK = 0x00000001,
301 VK_BORDER_COLOR_FLOAT_OPAQUE_BLACK = 0x00000002,
302 VK_BORDER_COLOR_INT_OPAQUE_BLACK = 0x00000003,
303 VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE = 0x00000004,
304 VK_BORDER_COLOR_INT_OPAQUE_WHITE = 0x00000005,
305}
306
307enum VkPipelineBindPoint {
Jesse Hallc7467b72015-11-29 21:05:26 -0800308 VK_PIPELINE_BIND_POINT_GRAPHICS = 0x00000000,
309 VK_PIPELINE_BIND_POINT_COMPUTE = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700310}
311
312enum VkPrimitiveTopology {
313 VK_PRIMITIVE_TOPOLOGY_POINT_LIST = 0x00000000,
314 VK_PRIMITIVE_TOPOLOGY_LINE_LIST = 0x00000001,
315 VK_PRIMITIVE_TOPOLOGY_LINE_STRIP = 0x00000002,
316 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST = 0x00000003,
317 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP = 0x00000004,
318 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN = 0x00000005,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800319 VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY = 0x00000006,
320 VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY = 0x00000007,
321 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY = 0x00000008,
322 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY = 0x00000009,
Jesse Hall091ed9e2015-11-30 00:55:29 -0800323 VK_PRIMITIVE_TOPOLOGY_PATCH_LIST = 0x0000000a,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700324}
325
326enum VkSharingMode {
327 VK_SHARING_MODE_EXCLUSIVE = 0x00000000,
328 VK_SHARING_MODE_CONCURRENT = 0x00000001,
329}
330
331enum VkIndexType {
332 VK_INDEX_TYPE_UINT16 = 0x00000000,
333 VK_INDEX_TYPE_UINT32 = 0x00000001,
334}
335
Jesse Hall23ff73f2015-11-29 14:36:39 -0800336enum VkFilter {
337 VK_FILTER_NEAREST = 0x00000000,
338 VK_FILTER_LINEAR = 0x00000001,
Jesse Hall26763382016-05-20 07:13:52 -0700339
340 //@extension("VK_IMG_filter_cubic")
341 VK_FILTER_CUBIC_IMG = 1000015000,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700342}
343
Jesse Hall23ff73f2015-11-29 14:36:39 -0800344enum VkSamplerMipmapMode {
Jesse Hall23ff73f2015-11-29 14:36:39 -0800345 VK_SAMPLER_MIPMAP_MODE_NEAREST = 0x00000001, /// Choose nearest mip level
346 VK_SAMPLER_MIPMAP_MODE_LINEAR = 0x00000002, /// Linear filter between mip levels
Jesse Halld27f6aa2015-08-15 17:58:48 -0700347}
348
Jesse Hall23ff73f2015-11-29 14:36:39 -0800349enum VkSamplerAddressMode {
Jesse Hallc7467b72015-11-29 21:05:26 -0800350 VK_SAMPLER_ADDRESS_MODE_REPEAT = 0x00000000,
351 VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT = 0x00000001,
352 VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE = 0x00000002,
353 VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER = 0x00000003,
354 VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700355}
356
357enum VkCompareOp {
358 VK_COMPARE_OP_NEVER = 0x00000000,
359 VK_COMPARE_OP_LESS = 0x00000001,
360 VK_COMPARE_OP_EQUAL = 0x00000002,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800361 VK_COMPARE_OP_LESS_OR_EQUAL = 0x00000003,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700362 VK_COMPARE_OP_GREATER = 0x00000004,
363 VK_COMPARE_OP_NOT_EQUAL = 0x00000005,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800364 VK_COMPARE_OP_GREATER_OR_EQUAL = 0x00000006,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700365 VK_COMPARE_OP_ALWAYS = 0x00000007,
366}
367
Jesse Hall65ab5522015-11-30 00:07:16 -0800368enum VkPolygonMode {
369 VK_POLYGON_MODE_FILL = 0x00000000,
370 VK_POLYGON_MODE_LINE = 0x00000001,
371 VK_POLYGON_MODE_POINT = 0x00000002,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700372}
373
374enum VkFrontFace {
Jesse Hall3fbc8562015-11-29 22:10:52 -0800375 VK_FRONT_FACE_COUNTER_CLOCKWISE = 0x00000000,
376 VK_FRONT_FACE_CLOCKWISE = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700377}
378
Jesse Hall65ab5522015-11-30 00:07:16 -0800379enum VkBlendFactor {
380 VK_BLEND_FACTOR_ZERO = 0x00000000,
381 VK_BLEND_FACTOR_ONE = 0x00000001,
382 VK_BLEND_FACTOR_SRC_COLOR = 0x00000002,
383 VK_BLEND_FACTOR_ONE_MINUS_SRC_COLOR = 0x00000003,
384 VK_BLEND_FACTOR_DST_COLOR = 0x00000004,
385 VK_BLEND_FACTOR_ONE_MINUS_DST_COLOR = 0x00000005,
386 VK_BLEND_FACTOR_SRC_ALPHA = 0x00000006,
387 VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA = 0x00000007,
388 VK_BLEND_FACTOR_DST_ALPHA = 0x00000008,
389 VK_BLEND_FACTOR_ONE_MINUS_DST_ALPHA = 0x00000009,
390 VK_BLEND_FACTOR_CONSTANT_COLOR = 0x0000000a,
391 VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR = 0x0000000b,
392 VK_BLEND_FACTOR_CONSTANT_ALPHA = 0x0000000c,
393 VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA = 0x0000000d,
394 VK_BLEND_FACTOR_SRC_ALPHA_SATURATE = 0x0000000e,
395 VK_BLEND_FACTOR_SRC1_COLOR = 0x0000000f,
396 VK_BLEND_FACTOR_ONE_MINUS_SRC1_COLOR = 0x00000010,
397 VK_BLEND_FACTOR_SRC1_ALPHA = 0x00000011,
398 VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA = 0x00000012,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700399}
400
401enum VkBlendOp {
402 VK_BLEND_OP_ADD = 0x00000000,
403 VK_BLEND_OP_SUBTRACT = 0x00000001,
404 VK_BLEND_OP_REVERSE_SUBTRACT = 0x00000002,
405 VK_BLEND_OP_MIN = 0x00000003,
406 VK_BLEND_OP_MAX = 0x00000004,
407}
408
409enum VkStencilOp {
410 VK_STENCIL_OP_KEEP = 0x00000000,
411 VK_STENCIL_OP_ZERO = 0x00000001,
412 VK_STENCIL_OP_REPLACE = 0x00000002,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800413 VK_STENCIL_OP_INCREMENT_AND_CLAMP = 0x00000003,
414 VK_STENCIL_OP_DECREMENT_AND_CLAMP = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700415 VK_STENCIL_OP_INVERT = 0x00000005,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800416 VK_STENCIL_OP_INCREMENT_AND_WRAP = 0x00000006,
417 VK_STENCIL_OP_DECREMENT_AND_WRAP = 0x00000007,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700418}
419
420enum VkLogicOp {
421 VK_LOGIC_OP_CLEAR = 0x00000000,
422 VK_LOGIC_OP_AND = 0x00000001,
423 VK_LOGIC_OP_AND_REVERSE = 0x00000002,
424 VK_LOGIC_OP_COPY = 0x00000003,
425 VK_LOGIC_OP_AND_INVERTED = 0x00000004,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800426 VK_LOGIC_OP_NO_OP = 0x00000005,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700427 VK_LOGIC_OP_XOR = 0x00000006,
428 VK_LOGIC_OP_OR = 0x00000007,
429 VK_LOGIC_OP_NOR = 0x00000008,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800430 VK_LOGIC_OP_EQUIVALENT = 0x00000009,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700431 VK_LOGIC_OP_INVERT = 0x0000000a,
432 VK_LOGIC_OP_OR_REVERSE = 0x0000000b,
433 VK_LOGIC_OP_COPY_INVERTED = 0x0000000c,
434 VK_LOGIC_OP_OR_INVERTED = 0x0000000d,
435 VK_LOGIC_OP_NAND = 0x0000000e,
436 VK_LOGIC_OP_SET = 0x0000000f,
437}
438
Jesse Hall3fbc8562015-11-29 22:10:52 -0800439enum VkSystemAllocationScope {
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800440 VK_SYSTEM_ALLOCATION_SCOPE_COMMAND = 0x00000000,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800441 VK_SYSTEM_ALLOCATION_SCOPE_OBJECT = 0x00000001,
442 VK_SYSTEM_ALLOCATION_SCOPE_CACHE = 0x00000002,
443 VK_SYSTEM_ALLOCATION_SCOPE_DEVICE = 0x00000003,
444 VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE = 0x00000004,
Jesse Hall03b6fe12015-11-24 12:44:21 -0800445}
446
Jesse Hall3fbc8562015-11-29 22:10:52 -0800447enum VkInternalAllocationType {
448 VK_INTERNAL_ALLOCATION_TYPE_EXECUTABLE = 0x00000000,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700449}
450
451enum VkPhysicalDeviceType {
452 VK_PHYSICAL_DEVICE_TYPE_OTHER = 0x00000000,
453 VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU = 0x00000001,
454 VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU = 0x00000002,
455 VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU = 0x00000003,
456 VK_PHYSICAL_DEVICE_TYPE_CPU = 0x00000004,
457}
458
Jesse Hall65ab5522015-11-30 00:07:16 -0800459enum VkVertexInputRate {
460 VK_VERTEX_INPUT_RATE_VERTEX = 0x00000000,
461 VK_VERTEX_INPUT_RATE_INSTANCE = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700462}
463
464/// Vulkan format definitions
465enum VkFormat {
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800466 VK_FORMAT_UNDEFINED = 0,
467 VK_FORMAT_R4G4_UNORM_PACK8 = 1,
468 VK_FORMAT_R4G4B4A4_UNORM_PACK16 = 2,
469 VK_FORMAT_B4G4R4A4_UNORM_PACK16 = 3,
470 VK_FORMAT_R5G6B5_UNORM_PACK16 = 4,
471 VK_FORMAT_B5G6R5_UNORM_PACK16 = 5,
472 VK_FORMAT_R5G5B5A1_UNORM_PACK16 = 6,
473 VK_FORMAT_B5G5R5A1_UNORM_PACK16 = 7,
474 VK_FORMAT_A1R5G5B5_UNORM_PACK16 = 8,
475 VK_FORMAT_R8_UNORM = 9,
476 VK_FORMAT_R8_SNORM = 10,
477 VK_FORMAT_R8_USCALED = 11,
478 VK_FORMAT_R8_SSCALED = 12,
479 VK_FORMAT_R8_UINT = 13,
480 VK_FORMAT_R8_SINT = 14,
481 VK_FORMAT_R8_SRGB = 15,
482 VK_FORMAT_R8G8_UNORM = 16,
483 VK_FORMAT_R8G8_SNORM = 17,
484 VK_FORMAT_R8G8_USCALED = 18,
485 VK_FORMAT_R8G8_SSCALED = 19,
486 VK_FORMAT_R8G8_UINT = 20,
487 VK_FORMAT_R8G8_SINT = 21,
488 VK_FORMAT_R8G8_SRGB = 22,
489 VK_FORMAT_R8G8B8_UNORM = 23,
490 VK_FORMAT_R8G8B8_SNORM = 24,
491 VK_FORMAT_R8G8B8_USCALED = 25,
492 VK_FORMAT_R8G8B8_SSCALED = 26,
493 VK_FORMAT_R8G8B8_UINT = 27,
494 VK_FORMAT_R8G8B8_SINT = 28,
495 VK_FORMAT_R8G8B8_SRGB = 29,
496 VK_FORMAT_B8G8R8_UNORM = 30,
497 VK_FORMAT_B8G8R8_SNORM = 31,
498 VK_FORMAT_B8G8R8_USCALED = 32,
499 VK_FORMAT_B8G8R8_SSCALED = 33,
500 VK_FORMAT_B8G8R8_UINT = 34,
501 VK_FORMAT_B8G8R8_SINT = 35,
502 VK_FORMAT_B8G8R8_SRGB = 36,
503 VK_FORMAT_R8G8B8A8_UNORM = 37,
504 VK_FORMAT_R8G8B8A8_SNORM = 38,
505 VK_FORMAT_R8G8B8A8_USCALED = 39,
506 VK_FORMAT_R8G8B8A8_SSCALED = 40,
507 VK_FORMAT_R8G8B8A8_UINT = 41,
508 VK_FORMAT_R8G8B8A8_SINT = 42,
509 VK_FORMAT_R8G8B8A8_SRGB = 43,
510 VK_FORMAT_B8G8R8A8_UNORM = 44,
511 VK_FORMAT_B8G8R8A8_SNORM = 45,
512 VK_FORMAT_B8G8R8A8_USCALED = 46,
513 VK_FORMAT_B8G8R8A8_SSCALED = 47,
514 VK_FORMAT_B8G8R8A8_UINT = 48,
515 VK_FORMAT_B8G8R8A8_SINT = 49,
516 VK_FORMAT_B8G8R8A8_SRGB = 50,
517 VK_FORMAT_A8B8G8R8_UNORM_PACK32 = 51,
518 VK_FORMAT_A8B8G8R8_SNORM_PACK32 = 52,
519 VK_FORMAT_A8B8G8R8_USCALED_PACK32 = 53,
520 VK_FORMAT_A8B8G8R8_SSCALED_PACK32 = 54,
521 VK_FORMAT_A8B8G8R8_UINT_PACK32 = 55,
522 VK_FORMAT_A8B8G8R8_SINT_PACK32 = 56,
523 VK_FORMAT_A8B8G8R8_SRGB_PACK32 = 57,
524 VK_FORMAT_A2R10G10B10_UNORM_PACK32 = 58,
525 VK_FORMAT_A2R10G10B10_SNORM_PACK32 = 59,
526 VK_FORMAT_A2R10G10B10_USCALED_PACK32 = 60,
527 VK_FORMAT_A2R10G10B10_SSCALED_PACK32 = 61,
528 VK_FORMAT_A2R10G10B10_UINT_PACK32 = 62,
529 VK_FORMAT_A2R10G10B10_SINT_PACK32 = 63,
530 VK_FORMAT_A2B10G10R10_UNORM_PACK32 = 64,
531 VK_FORMAT_A2B10G10R10_SNORM_PACK32 = 65,
532 VK_FORMAT_A2B10G10R10_USCALED_PACK32 = 66,
533 VK_FORMAT_A2B10G10R10_SSCALED_PACK32 = 67,
534 VK_FORMAT_A2B10G10R10_UINT_PACK32 = 68,
535 VK_FORMAT_A2B10G10R10_SINT_PACK32 = 69,
536 VK_FORMAT_R16_UNORM = 70,
537 VK_FORMAT_R16_SNORM = 71,
538 VK_FORMAT_R16_USCALED = 72,
539 VK_FORMAT_R16_SSCALED = 73,
540 VK_FORMAT_R16_UINT = 74,
541 VK_FORMAT_R16_SINT = 75,
542 VK_FORMAT_R16_SFLOAT = 76,
543 VK_FORMAT_R16G16_UNORM = 77,
544 VK_FORMAT_R16G16_SNORM = 78,
545 VK_FORMAT_R16G16_USCALED = 79,
546 VK_FORMAT_R16G16_SSCALED = 80,
547 VK_FORMAT_R16G16_UINT = 81,
548 VK_FORMAT_R16G16_SINT = 82,
549 VK_FORMAT_R16G16_SFLOAT = 83,
550 VK_FORMAT_R16G16B16_UNORM = 84,
551 VK_FORMAT_R16G16B16_SNORM = 85,
552 VK_FORMAT_R16G16B16_USCALED = 86,
553 VK_FORMAT_R16G16B16_SSCALED = 87,
554 VK_FORMAT_R16G16B16_UINT = 88,
555 VK_FORMAT_R16G16B16_SINT = 89,
556 VK_FORMAT_R16G16B16_SFLOAT = 90,
557 VK_FORMAT_R16G16B16A16_UNORM = 91,
558 VK_FORMAT_R16G16B16A16_SNORM = 92,
559 VK_FORMAT_R16G16B16A16_USCALED = 93,
560 VK_FORMAT_R16G16B16A16_SSCALED = 94,
561 VK_FORMAT_R16G16B16A16_UINT = 95,
562 VK_FORMAT_R16G16B16A16_SINT = 96,
563 VK_FORMAT_R16G16B16A16_SFLOAT = 97,
564 VK_FORMAT_R32_UINT = 98,
565 VK_FORMAT_R32_SINT = 99,
566 VK_FORMAT_R32_SFLOAT = 100,
567 VK_FORMAT_R32G32_UINT = 101,
568 VK_FORMAT_R32G32_SINT = 102,
569 VK_FORMAT_R32G32_SFLOAT = 103,
570 VK_FORMAT_R32G32B32_UINT = 104,
571 VK_FORMAT_R32G32B32_SINT = 105,
572 VK_FORMAT_R32G32B32_SFLOAT = 106,
573 VK_FORMAT_R32G32B32A32_UINT = 107,
574 VK_FORMAT_R32G32B32A32_SINT = 108,
575 VK_FORMAT_R32G32B32A32_SFLOAT = 109,
576 VK_FORMAT_R64_UINT = 110,
577 VK_FORMAT_R64_SINT = 111,
578 VK_FORMAT_R64_SFLOAT = 112,
579 VK_FORMAT_R64G64_UINT = 113,
580 VK_FORMAT_R64G64_SINT = 114,
581 VK_FORMAT_R64G64_SFLOAT = 115,
582 VK_FORMAT_R64G64B64_UINT = 116,
583 VK_FORMAT_R64G64B64_SINT = 117,
584 VK_FORMAT_R64G64B64_SFLOAT = 118,
585 VK_FORMAT_R64G64B64A64_UINT = 119,
586 VK_FORMAT_R64G64B64A64_SINT = 120,
587 VK_FORMAT_R64G64B64A64_SFLOAT = 121,
588 VK_FORMAT_B10G11R11_UFLOAT_PACK32 = 122,
589 VK_FORMAT_E5B9G9R9_UFLOAT_PACK32 = 123,
590 VK_FORMAT_D16_UNORM = 124,
591 VK_FORMAT_X8_D24_UNORM_PACK32 = 125,
592 VK_FORMAT_D32_SFLOAT = 126,
593 VK_FORMAT_S8_UINT = 127,
594 VK_FORMAT_D16_UNORM_S8_UINT = 128,
595 VK_FORMAT_D24_UNORM_S8_UINT = 129,
596 VK_FORMAT_D32_SFLOAT_S8_UINT = 130,
597 VK_FORMAT_BC1_RGB_UNORM_BLOCK = 131,
598 VK_FORMAT_BC1_RGB_SRGB_BLOCK = 132,
599 VK_FORMAT_BC1_RGBA_UNORM_BLOCK = 133,
600 VK_FORMAT_BC1_RGBA_SRGB_BLOCK = 134,
601 VK_FORMAT_BC2_UNORM_BLOCK = 135,
602 VK_FORMAT_BC2_SRGB_BLOCK = 136,
603 VK_FORMAT_BC3_UNORM_BLOCK = 137,
604 VK_FORMAT_BC3_SRGB_BLOCK = 138,
605 VK_FORMAT_BC4_UNORM_BLOCK = 139,
606 VK_FORMAT_BC4_SNORM_BLOCK = 140,
607 VK_FORMAT_BC5_UNORM_BLOCK = 141,
608 VK_FORMAT_BC5_SNORM_BLOCK = 142,
609 VK_FORMAT_BC6H_UFLOAT_BLOCK = 143,
610 VK_FORMAT_BC6H_SFLOAT_BLOCK = 144,
611 VK_FORMAT_BC7_UNORM_BLOCK = 145,
612 VK_FORMAT_BC7_SRGB_BLOCK = 146,
613 VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK = 147,
614 VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK = 148,
615 VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK = 149,
616 VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK = 150,
617 VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK = 151,
618 VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK = 152,
619 VK_FORMAT_EAC_R11_UNORM_BLOCK = 153,
620 VK_FORMAT_EAC_R11_SNORM_BLOCK = 154,
621 VK_FORMAT_EAC_R11G11_UNORM_BLOCK = 155,
622 VK_FORMAT_EAC_R11G11_SNORM_BLOCK = 156,
623 VK_FORMAT_ASTC_4x4_UNORM_BLOCK = 157,
624 VK_FORMAT_ASTC_4x4_SRGB_BLOCK = 158,
625 VK_FORMAT_ASTC_5x4_UNORM_BLOCK = 159,
626 VK_FORMAT_ASTC_5x4_SRGB_BLOCK = 160,
627 VK_FORMAT_ASTC_5x5_UNORM_BLOCK = 161,
628 VK_FORMAT_ASTC_5x5_SRGB_BLOCK = 162,
629 VK_FORMAT_ASTC_6x5_UNORM_BLOCK = 163,
630 VK_FORMAT_ASTC_6x5_SRGB_BLOCK = 164,
631 VK_FORMAT_ASTC_6x6_UNORM_BLOCK = 165,
632 VK_FORMAT_ASTC_6x6_SRGB_BLOCK = 166,
633 VK_FORMAT_ASTC_8x5_UNORM_BLOCK = 167,
634 VK_FORMAT_ASTC_8x5_SRGB_BLOCK = 168,
635 VK_FORMAT_ASTC_8x6_UNORM_BLOCK = 169,
636 VK_FORMAT_ASTC_8x6_SRGB_BLOCK = 170,
637 VK_FORMAT_ASTC_8x8_UNORM_BLOCK = 171,
638 VK_FORMAT_ASTC_8x8_SRGB_BLOCK = 172,
639 VK_FORMAT_ASTC_10x5_UNORM_BLOCK = 173,
640 VK_FORMAT_ASTC_10x5_SRGB_BLOCK = 174,
641 VK_FORMAT_ASTC_10x6_UNORM_BLOCK = 175,
642 VK_FORMAT_ASTC_10x6_SRGB_BLOCK = 176,
643 VK_FORMAT_ASTC_10x8_UNORM_BLOCK = 177,
644 VK_FORMAT_ASTC_10x8_SRGB_BLOCK = 178,
645 VK_FORMAT_ASTC_10x10_UNORM_BLOCK = 179,
646 VK_FORMAT_ASTC_10x10_SRGB_BLOCK = 180,
647 VK_FORMAT_ASTC_12x10_UNORM_BLOCK = 181,
648 VK_FORMAT_ASTC_12x10_SRGB_BLOCK = 182,
649 VK_FORMAT_ASTC_12x12_UNORM_BLOCK = 183,
650 VK_FORMAT_ASTC_12x12_SRGB_BLOCK = 184,
Chris Forbes289cb792016-12-30 15:03:55 +1300651
652 //@extension("VK_IMG_format_pvrtc")
653 VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG = 1000054000,
654
655 //@extension("VK_IMG_format_pvrtc")
656 VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG = 1000054001,
657
658 //@extension("VK_IMG_format_pvrtc")
659 VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG = 1000054002,
660
661 //@extension("VK_IMG_format_pvrtc")
662 VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG = 1000054003,
663
664 //@extension("VK_IMG_format_pvrtc")
665 VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG = 1000054004,
666
667 //@extension("VK_IMG_format_pvrtc")
668 VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG = 1000054005,
669
670 //@extension("VK_IMG_format_pvrtc")
671 VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG = 1000054006,
672
673 //@extension("VK_IMG_format_pvrtc")
674 VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG = 1000054007,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700675}
676
Jesse Halld27f6aa2015-08-15 17:58:48 -0700677/// Structure type enumerant
678enum VkStructureType {
679 VK_STRUCTURE_TYPE_APPLICATION_INFO = 0,
Jesse Hallc7467b72015-11-29 21:05:26 -0800680 VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO = 1,
681 VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO = 2,
682 VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO = 3,
683 VK_STRUCTURE_TYPE_SUBMIT_INFO = 4,
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800684 VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO = 5,
Jesse Hallc7467b72015-11-29 21:05:26 -0800685 VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE = 6,
686 VK_STRUCTURE_TYPE_BIND_SPARSE_INFO = 7,
687 VK_STRUCTURE_TYPE_FENCE_CREATE_INFO = 8,
688 VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO = 9,
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700689 VK_STRUCTURE_TYPE_EVENT_CREATE_INFO = 10,
Jesse Hallc7467b72015-11-29 21:05:26 -0800690 VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO = 11,
691 VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO = 12,
692 VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO = 13,
693 VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO = 14,
694 VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO = 15,
695 VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO = 16,
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800696 VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO = 17,
697 VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO = 18,
698 VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO = 19,
699 VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO = 20,
700 VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO = 21,
701 VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO = 22,
702 VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO = 23,
703 VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO = 24,
704 VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO = 25,
705 VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO = 26,
706 VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO = 27,
707 VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO = 28,
708 VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO = 29,
709 VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO = 30,
710 VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO = 31,
711 VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO = 32,
712 VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO = 33,
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800713 VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO = 34,
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800714 VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET = 35,
715 VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET = 36,
716 VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO = 37,
717 VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO = 38,
718 VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO = 39,
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800719 VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO = 40,
Jesse Hall3dd678a2016-01-08 21:52:01 -0800720 VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO = 41,
721 VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO = 42,
722 VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO = 43,
723 VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER = 44,
724 VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER = 45,
725 VK_STRUCTURE_TYPE_MEMORY_BARRIER = 46,
726 VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO = 47,
727 VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO = 48,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800728
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800729 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800730 VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR = 1000001000,
731 VK_STRUCTURE_TYPE_PRESENT_INFO_KHR = 1000001001,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800732
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800733 //@extension("VK_KHR_display")
Jesse Hallbd888842015-11-30 21:44:14 -0800734 VK_STRUCTURE_TYPE_DISPLAY_MODE_CREATE_INFO_KHR = 1000002000,
735 VK_STRUCTURE_TYPE_DISPLAY_SURFACE_CREATE_INFO_KHR = 1000002001,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800736
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800737 //@extension("VK_KHR_display_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800738 VK_STRUCTURE_TYPE_DISPLAY_DISPLAY_PRESENT_INFO_KHR = 1000003000,
Jesse Hallf9fa9a52016-01-08 16:08:51 -0800739
740 //@extension("VK_KHR_xlib_surface")
741 VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR = 1000004000,
742
743 //@extension("VK_KHR_xcb_surface")
744 VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR = 1000005000,
745
746 //@extension("VK_KHR_wayland_surface")
747 VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR = 1000006000,
748
749 //@extension("VK_KHR_mir_surface")
750 VK_STRUCTURE_TYPE_MIR_SURFACE_CREATE_INFO_KHR = 1000007000,
751
752 //@extension("VK_KHR_android_surface")
753 VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR = 1000008000,
754
755 //@extension("VK_KHR_win32_surface")
756 VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR = 1000009000,
Jesse Hall543a7ff2016-01-08 16:38:30 -0800757
Ian Elliott948233a2017-01-06 12:13:23 -0700758 //@extension("VK_KHR_incremental_present")
759 VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR = 1000084000,
760
Chia-I Wub262ddc2016-03-22 07:38:20 +0800761 //@extension("VK_ANDROID_native_buffer")
762 VK_STRUCTURE_TYPE_NATIVE_BUFFER_ANDROID = 1000010000,
Chris Forbes8e4438b2016-12-07 16:26:49 +1300763 VK_STRUCTURE_TYPE_SWAPCHAIN_IMAGE_CREATE_INFO_ANDROID = 1000010001,
Chia-I Wub262ddc2016-03-22 07:38:20 +0800764
Ian Elliott4c8bb2a2016-12-29 11:07:26 -0700765 //@extension("VK_GOOGLE_display_timing")
Ian Elliott14866bb2017-01-20 09:15:48 -0700766 VK_STRUCTURE_TYPE_PRESENT_TIMES_INFO_GOOGLE = 1000092000,
Ian Elliott4c8bb2a2016-12-29 11:07:26 -0700767
Jesse Hall543a7ff2016-01-08 16:38:30 -0800768 //@extension("VK_EXT_debug_report")
Jesse Hall26763382016-05-20 07:13:52 -0700769 VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT = 1000011000,
770
771 //@extension("VK_AMD_rasterization_order")
772 VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD = 1000018000,
773
774 //@extension("VK_EXT_debug_marker")
775 VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_NAME_INFO_EXT = 1000022000,
776
777 //@extension("VK_EXT_debug_marker")
778 VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_TAG_INFO_EXT = 1000022001,
779
780 //@extension("VK_EXT_debug_marker")
781 VK_STRUCTURE_TYPE_DEBUG_MARKER_MARKER_INFO_EXT = 1000022002,
Jesse Hall56d386a2016-07-26 15:20:40 -0700782
783 //@extension("VK_NV_dedicated_allocation")
784 VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV = 1000026000,
785
786 //@extension("VK_NV_dedicated_allocation")
787 VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV = 1000026001,
788
789 //@extension("VK_NV_dedicated_allocation")
790 VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV = 1000026002,
Chris Forbes289cb792016-12-30 15:03:55 +1300791
792 //@extension("VK_NV_external_memory")
793 VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_NV = 1000056000,
794
795 //@extension("VK_NV_external_memory")
796 VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_NV = 1000056001,
797
798 //@extension("VK_NV_external_memory_win32")
799 VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_NV = 1000057000,
800
801 //@extension("VK_NV_external_memory_win32")
802 VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_NV = 1000057001,
803
804 //@extension("VK_NV_win32_keyed_mutex")
805 VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_NV = 1000058000,
806
Chris Forbes1194ede2016-12-30 16:29:25 +1300807 //@extension("VK_KHR_get_physical_device_properties2")
808 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR = 1000059000,
809
810 //@extension("VK_KHR_get_physical_device_properties2")
811 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR = 1000059001,
812
813 //@extension("VK_KHR_get_physical_device_properties2")
814 VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2_KHR = 1000059002,
815
816 //@extension("VK_KHR_get_physical_device_properties2")
817 VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2_KHR = 1000059003,
818
819 //@extension("VK_KHR_get_physical_device_properties2")
820 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2_KHR = 1000059004,
821
822 //@extension("VK_KHR_get_physical_device_properties2")
823 VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2_KHR = 1000059005,
824
825 //@extension("VK_KHR_get_physical_device_properties2")
826 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2_KHR = 1000059006,
827
828 //@extension("VK_KHR_get_physical_device_properties2")
829 VK_STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2_KHR = 1000059007,
830
831 //@extension("VK_KHR_get_physical_device_properties2")
832 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2_KHR = 1000059008,
833
Chris Forbes289cb792016-12-30 15:03:55 +1300834 //@extension("VK_EXT_validation_flags")
835 VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT = 1000061000,
836
837 //@extension("VK_KHR_incremental_present")
838 VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR = 1000084000,
839
840 //@extension("VK_NVX_device_generated_commands")
841 VK_STRUCTURE_TYPE_OBJECT_TABLE_CREATE_INFO_NVX = 1000086000,
842
843 //@extension("VK_NVX_device_generated_commands")
844 VK_STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_CREATE_INFO_NVX = 1000086001,
845
846 //@extension("VK_NVX_device_generated_commands")
847 VK_STRUCTURE_TYPE_CMD_PROCESS_COMMANDS_INFO_NVX = 1000086002,
848
849 //@extension("VK_NVX_device_generated_commands")
850 VK_STRUCTURE_TYPE_CMD_RESERVE_SPACE_FOR_COMMANDS_INFO_NVX = 1000086003,
851
852 //@extension("VK_NVX_device_generated_commands")
853 VK_STRUCTURE_TYPE_DEVICE_GENERATED_COMMANDS_LIMITS_NVX = 1000086004,
854
855 //@extension("VK_NVX_device_generated_commands")
856 VK_STRUCTURE_TYPE_DEVICE_GENERATED_COMMANDS_FEATURES_NVX = 1000086005,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700857}
858
Jesse Hall65ab5522015-11-30 00:07:16 -0800859enum VkSubpassContents {
860 VK_SUBPASS_CONTENTS_INLINE = 0x00000000,
861 VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700862}
863
Jesse Hall543a7ff2016-01-08 16:38:30 -0800864enum VkPipelineCacheHeaderVersion {
865 VK_PIPELINE_CACHE_HEADER_VERSION_ONE = 1,
866}
867
Jesse Hallbd888842015-11-30 21:44:14 -0800868@lastUnused(-11)
Jesse Halld27f6aa2015-08-15 17:58:48 -0700869/// Error and return codes
870enum VkResult {
871 // Return codes for successful operation execution (positive values)
Jesse Hallbd888842015-11-30 21:44:14 -0800872 VK_SUCCESS = 0,
873 VK_NOT_READY = 1,
874 VK_TIMEOUT = 2,
875 VK_EVENT_SET = 3,
876 VK_EVENT_RESET = 4,
877 VK_INCOMPLETE = 5,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700878
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800879 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800880 VK_SUBOPTIMAL_KHR = 1000001003,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800881
Jesse Halld27f6aa2015-08-15 17:58:48 -0700882 // Error codes (negative values)
Jesse Hallbd888842015-11-30 21:44:14 -0800883 VK_ERROR_OUT_OF_HOST_MEMORY = 0xFFFFFFFF, // -1
884 VK_ERROR_OUT_OF_DEVICE_MEMORY = 0xFFFFFFFE, // -2
885 VK_ERROR_INITIALIZATION_FAILED = 0xFFFFFFFD, // -3
886 VK_ERROR_DEVICE_LOST = 0xFFFFFFFC, // -4
887 VK_ERROR_MEMORY_MAP_FAILED = 0xFFFFFFFB, // -5
888 VK_ERROR_LAYER_NOT_PRESENT = 0xFFFFFFFA, // -6
889 VK_ERROR_EXTENSION_NOT_PRESENT = 0xFFFFFFF9, // -7
890 VK_ERROR_FEATURE_NOT_PRESENT = 0xFFFFFFF8, // -8
891 VK_ERROR_INCOMPATIBLE_DRIVER = 0xFFFFFFF7, // -9
892 VK_ERROR_TOO_MANY_OBJECTS = 0xFFFFFFF6, // -10
893 VK_ERROR_FORMAT_NOT_SUPPORTED = 0xFFFFFFF5, // -11
Jesse Hall56d386a2016-07-26 15:20:40 -0700894 VK_ERROR_FRAGMENTED_POOL = 0xFFFFFFF4, // -12
Jesse Hall1356b0d2015-11-23 17:24:58 -0800895
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800896 //@extension("VK_KHR_surface")
Jesse Hallbd888842015-11-30 21:44:14 -0800897 VK_ERROR_SURFACE_LOST_KHR = 0xC4653600, // -1000000000
Jesse Halla6429252015-11-29 18:59:42 -0800898
Jesse Hall563380d2016-01-15 23:14:05 -0800899 //@extension("VK_KHR_surface")
900 VK_ERROR_NATIVE_WINDOW_IN_USE_KHR = 0xC46535FF, // -1000008001
901
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800902 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800903 VK_ERROR_OUT_OF_DATE_KHR = 0xC4653214, // -1000001004
Jesse Hall1356b0d2015-11-23 17:24:58 -0800904
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800905 //@extension("VK_KHR_display_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800906 VK_ERROR_INCOMPATIBLE_DISPLAY_KHR = 0xC4652A47, // -1000003001
Jesse Hall1356b0d2015-11-23 17:24:58 -0800907
Jesse Hall543a7ff2016-01-08 16:38:30 -0800908 //@extension("VK_EXT_debug_report")
909 VK_ERROR_VALIDATION_FAILED_EXT = 0xC4650B07, // -1000011001
Jesse Hall26763382016-05-20 07:13:52 -0700910
911 //@extension("VK_NV_glsl_shader")
912 VK_ERROR_INVALID_SHADER_NV = 0xC4650720, // -1000012000
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700913}
914
915enum VkDynamicState {
916 VK_DYNAMIC_STATE_VIEWPORT = 0x00000000,
917 VK_DYNAMIC_STATE_SCISSOR = 0x00000001,
918 VK_DYNAMIC_STATE_LINE_WIDTH = 0x00000002,
919 VK_DYNAMIC_STATE_DEPTH_BIAS = 0x00000003,
920 VK_DYNAMIC_STATE_BLEND_CONSTANTS = 0x00000004,
921 VK_DYNAMIC_STATE_DEPTH_BOUNDS = 0x00000005,
922 VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK = 0x00000006,
923 VK_DYNAMIC_STATE_STENCIL_WRITE_MASK = 0x00000007,
924 VK_DYNAMIC_STATE_STENCIL_REFERENCE = 0x00000008,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700925}
926
Jesse Hall523db342015-11-30 21:12:55 -0800927@extension("VK_KHR_surface")
Michael Lentine88594d72015-11-12 12:49:45 -0800928enum VkPresentModeKHR {
929 VK_PRESENT_MODE_IMMEDIATE_KHR = 0x00000000,
930 VK_PRESENT_MODE_MAILBOX_KHR = 0x00000001,
931 VK_PRESENT_MODE_FIFO_KHR = 0x00000002,
Jesse Hall03b6fe12015-11-24 12:44:21 -0800932 VK_PRESENT_MODE_FIFO_RELAXED_KHR = 0x00000003,
Chris Forbes1d5f68c2017-01-31 10:17:01 +1300933 //@extension("VK_KHR_shared_presentable_image")
934 VK_PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR = 1000111000,
935 //@extension("VK_KHR_shared_presentable_image")
936 VK_PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR = 1000111001,
Michael Lentine88594d72015-11-12 12:49:45 -0800937}
938
Jesse Hall523db342015-11-30 21:12:55 -0800939@extension("VK_KHR_surface")
Michael Lentine88594d72015-11-12 12:49:45 -0800940enum VkColorSpaceKHR {
941 VK_COLORSPACE_SRGB_NONLINEAR_KHR = 0x00000000,
Courtney Goeltzenleuchter7f558ed2017-01-23 17:15:24 -0700942 VK_COLOR_SPACE_DISPLAY_P3_LINEAR_EXT = 1000104001,
943 VK_COLOR_SPACE_DISPLAY_P3_NONLINEAR_EXT = 1000104002,
944 VK_COLOR_SPACE_SCRGB_LINEAR_EXT = 1000104003,
945 VK_COLOR_SPACE_SCRGB_NONLINEAR_EXT = 1000104004,
946 VK_COLOR_SPACE_DCI_P3_LINEAR_EXT = 1000104005,
947 VK_COLOR_SPACE_DCI_P3_NONLINEAR_EXT = 1000104006,
948 VK_COLOR_SPACE_BT709_LINEAR_EXT = 1000104007,
949 VK_COLOR_SPACE_BT709_NONLINEAR_EXT = 1000104008,
950 VK_COLOR_SPACE_BT2020_LINEAR_EXT = 1000104009,
951 VK_COLOR_SPACE_BT2020_NONLINEAR_EXT = 1000104010,
952 VK_COLOR_SPACE_ADOBERGB_LINEAR_EXT = 1000104011,
953 VK_COLOR_SPACE_ADOBERGB_NONLINEAR_EXT = 1000104012,
Michael Lentine88594d72015-11-12 12:49:45 -0800954}
Jesse Halld27f6aa2015-08-15 17:58:48 -0700955
Jesse Hall715b86a2016-01-16 16:34:29 -0800956@extension("VK_EXT_debug_report")
957enum VkDebugReportObjectTypeEXT {
958 VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT = 0,
959 VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT = 1,
960 VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT = 2,
961 VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT = 3,
962 VK_DEBUG_REPORT_OBJECT_TYPE_QUEUE_EXT = 4,
963 VK_DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT = 5,
964 VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT = 6,
965 VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT = 7,
966 VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT = 8,
967 VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT = 9,
968 VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT = 10,
969 VK_DEBUG_REPORT_OBJECT_TYPE_EVENT_EXT = 11,
970 VK_DEBUG_REPORT_OBJECT_TYPE_QUERY_POOL_EXT = 12,
971 VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_VIEW_EXT = 13,
972 VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_VIEW_EXT = 14,
973 VK_DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT = 15,
974 VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_CACHE_EXT = 16,
975 VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_LAYOUT_EXT = 17,
976 VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT = 18,
977 VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT = 19,
978 VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT_EXT = 20,
979 VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_EXT = 21,
980 VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT = 22,
981 VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT = 23,
982 VK_DEBUG_REPORT_OBJECT_TYPE_FRAMEBUFFER_EXT = 24,
983 VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_POOL_EXT = 25,
984 VK_DEBUG_REPORT_OBJECT_TYPE_SURFACE_KHR_EXT = 26,
985 VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT = 27,
986 VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_EXT = 28,
Chris Forbes289cb792016-12-30 15:03:55 +1300987 VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_KHR_EXT = 29,
988 VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_MODE_KHR_EXT = 30,
989 VK_DEBUG_REPORT_OBJECT_TYPE_OBJECT_TABLE_NVX_EXT = 31,
990 VK_DEBUG_REPORT_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NVX_EXT = 32,
Jesse Hall715b86a2016-01-16 16:34:29 -0800991}
992
993@extension("VK_EXT_debug_report")
994enum VkDebugReportErrorEXT {
995 VK_DEBUG_REPORT_ERROR_NONE_EXT = 0,
996 VK_DEBUG_REPORT_ERROR_CALLBACK_REF_EXT = 1,
997}
998
Jesse Hall26763382016-05-20 07:13:52 -0700999@extension("VK_AMD_rasterization_order")
1000enum VkRasterizationOrderAMD {
1001 VK_RASTERIZATION_ORDER_STRICT_AMD = 0,
1002 VK_RASTERIZATION_ORDER_RELAXED_AMD = 1,
1003}
1004
Chris Forbes289cb792016-12-30 15:03:55 +13001005@extension("VK_EXT_validation_flags")
1006enum VkValidationCheckEXT {
1007 VK_VALIDATION_CHECK_ALL_EXT = 0,
1008}
1009
1010@extension("VK_NVX_device_generated_commands")
1011enum VkIndirectCommandsTokenTypeNVX {
1012 VK_INDIRECT_COMMANDS_TOKEN_PIPELINE_NVX = 0,
1013 VK_INDIRECT_COMMANDS_TOKEN_DESCRIPTOR_SET_NVX = 1,
1014 VK_INDIRECT_COMMANDS_TOKEN_INDEX_BUFFER_NVX = 2,
1015 VK_INDIRECT_COMMANDS_TOKEN_VERTEX_BUFFER_NVX = 3,
1016 VK_INDIRECT_COMMANDS_TOKEN_PUSH_CONSTANT_NVX = 4,
1017 VK_INDIRECT_COMMANDS_TOKEN_DRAW_INDEXED_NVX = 5,
1018 VK_INDIRECT_COMMANDS_TOKEN_DRAW_NVX = 6,
1019 VK_INDIRECT_COMMANDS_TOKEN_DISPATCH_NVX = 7,
1020}
1021
1022@extension("VK_NVX_device_generated_commands")
1023enum VkObjectEntryTypeNVX {
1024 VK_OBJECT_ENTRY_DESCRIPTOR_SET_NVX = 0,
1025 VK_OBJECT_ENTRY_PIPELINE_NVX = 1,
1026 VK_OBJECT_ENTRY_INDEX_BUFFER_NVX = 2,
1027 VK_OBJECT_ENTRY_VERTEX_BUFFER_NVX = 3,
1028 VK_OBJECT_ENTRY_PUSH_CONSTANT_NVX = 4,
1029}
Jesse Hall715b86a2016-01-16 16:34:29 -08001030
Jesse Halld27f6aa2015-08-15 17:58:48 -07001031/////////////////
1032// Bitfields //
1033/////////////////
1034
Jesse Halld27f6aa2015-08-15 17:58:48 -07001035/// Queue capabilities
Jesse Halld8bade02015-11-24 10:24:18 -08001036type VkFlags VkQueueFlags
1037bitfield VkQueueFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001038 VK_QUEUE_GRAPHICS_BIT = 0x00000001, /// Queue supports graphics operations
1039 VK_QUEUE_COMPUTE_BIT = 0x00000002, /// Queue supports compute operations
Jesse Hall65ab5522015-11-30 00:07:16 -08001040 VK_QUEUE_TRANSFER_BIT = 0x00000004, /// Queue supports transfer operations
Jesse Hallb00daad2015-11-29 19:46:20 -08001041 VK_QUEUE_SPARSE_BINDING_BIT = 0x00000008, /// Queue supports sparse resource memory management operations
Jesse Halld27f6aa2015-08-15 17:58:48 -07001042}
1043
1044/// Memory properties passed into vkAllocMemory().
Jesse Halld8bade02015-11-24 10:24:18 -08001045type VkFlags VkMemoryPropertyFlags
1046bitfield VkMemoryPropertyFlagBits {
Jesse Halld1af8122015-11-29 23:50:38 -08001047 VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT = 0x00000001,
1048 VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT = 0x00000002,
1049 VK_MEMORY_PROPERTY_HOST_COHERENT_BIT = 0x00000004,
1050 VK_MEMORY_PROPERTY_HOST_CACHED_BIT = 0x00000008,
1051 VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT = 0x00000010,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001052}
1053
1054/// Memory heap flags
Jesse Halld8bade02015-11-24 10:24:18 -08001055type VkFlags VkMemoryHeapFlags
1056bitfield VkMemoryHeapFlagBits {
Jesse Halld1af8122015-11-29 23:50:38 -08001057 VK_MEMORY_HEAP_DEVICE_LOCAL_BIT = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001058}
1059
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001060/// Access flags
1061type VkFlags VkAccessFlags
1062bitfield VkAccessFlagBits {
1063 VK_ACCESS_INDIRECT_COMMAND_READ_BIT = 0x00000001,
1064 VK_ACCESS_INDEX_READ_BIT = 0x00000002,
1065 VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT = 0x00000004,
1066 VK_ACCESS_UNIFORM_READ_BIT = 0x00000008,
1067 VK_ACCESS_INPUT_ATTACHMENT_READ_BIT = 0x00000010,
1068 VK_ACCESS_SHADER_READ_BIT = 0x00000020,
1069 VK_ACCESS_SHADER_WRITE_BIT = 0x00000040,
1070 VK_ACCESS_COLOR_ATTACHMENT_READ_BIT = 0x00000080,
1071 VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT = 0x00000100,
1072 VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT = 0x00000200,
1073 VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT = 0x00000400,
1074 VK_ACCESS_TRANSFER_READ_BIT = 0x00000800,
1075 VK_ACCESS_TRANSFER_WRITE_BIT = 0x00001000,
1076 VK_ACCESS_HOST_READ_BIT = 0x00002000,
1077 VK_ACCESS_HOST_WRITE_BIT = 0x00004000,
1078 VK_ACCESS_MEMORY_READ_BIT = 0x00008000,
1079 VK_ACCESS_MEMORY_WRITE_BIT = 0x00010000,
Chris Forbes289cb792016-12-30 15:03:55 +13001080
1081 //@extension("VK_NVX_device_generated_commands")
1082 VK_ACCESS_COMMAND_PROCESS_READ_BIT_NVX = 0x00020000,
1083
1084 //@extension("VK_NVX_device_generated_commands")
1085 VK_ACCESS_COMMAND_PROCESS_WRITE_BIT_NVX = 0x00040000,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001086}
1087
1088/// Buffer usage flags
Jesse Halld8bade02015-11-24 10:24:18 -08001089type VkFlags VkBufferUsageFlags
1090bitfield VkBufferUsageFlagBits {
Jesse Hall3fbc8562015-11-29 22:10:52 -08001091 VK_BUFFER_USAGE_TRANSFER_SRC_BIT = 0x00000001, /// Can be used as a source of transfer operations
1092 VK_BUFFER_USAGE_TRANSFER_DST_BIT = 0x00000002, /// Can be used as a destination of transfer operations
Jesse Halld27f6aa2015-08-15 17:58:48 -07001093 VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000004, /// Can be used as TBO
1094 VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT = 0x00000008, /// Can be used as IBO
1095 VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT = 0x00000010, /// Can be used as UBO
1096 VK_BUFFER_USAGE_STORAGE_BUFFER_BIT = 0x00000020, /// Can be used as SSBO
1097 VK_BUFFER_USAGE_INDEX_BUFFER_BIT = 0x00000040, /// Can be used as source of fixed function index fetch (index buffer)
1098 VK_BUFFER_USAGE_VERTEX_BUFFER_BIT = 0x00000080, /// Can be used as source of fixed function vertex fetch (VBO)
1099 VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT = 0x00000100, /// Can be the source of indirect parameters (e.g. indirect buffer, parameter buffer)
1100}
1101
1102/// Buffer creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001103type VkFlags VkBufferCreateFlags
1104bitfield VkBufferCreateFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001105 VK_BUFFER_CREATE_SPARSE_BINDING_BIT = 0x00000001, /// Buffer should support sparse backing
Jesse Halld27f6aa2015-08-15 17:58:48 -07001106 VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002, /// Buffer should support sparse backing with partial residency
1107 VK_BUFFER_CREATE_SPARSE_ALIASED_BIT = 0x00000004, /// Buffer should support constent data access to physical memory blocks mapped into multiple locations of sparse buffers
1108}
1109
1110/// Shader stage flags
Jesse Halld8bade02015-11-24 10:24:18 -08001111type VkFlags VkShaderStageFlags
1112bitfield VkShaderStageFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001113 VK_SHADER_STAGE_VERTEX_BIT = 0x00000001,
Jesse Hallae38f732015-11-19 21:32:50 -08001114 VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT = 0x00000002,
1115 VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001116 VK_SHADER_STAGE_GEOMETRY_BIT = 0x00000008,
1117 VK_SHADER_STAGE_FRAGMENT_BIT = 0x00000010,
1118 VK_SHADER_STAGE_COMPUTE_BIT = 0x00000020,
Jesse Hallc7467b72015-11-29 21:05:26 -08001119 VK_SHADER_STAGE_ALL_GRAPHICS = 0x0000001F,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001120
1121 VK_SHADER_STAGE_ALL = 0x7FFFFFFF,
1122}
1123
Jesse Hallfbf97b02015-11-20 14:17:03 -08001124/// Descriptor pool create flags
Jesse Halld8bade02015-11-24 10:24:18 -08001125type VkFlags VkDescriptorPoolCreateFlags
1126bitfield VkDescriptorPoolCreateFlagBits {
Jesse Hallfbf97b02015-11-20 14:17:03 -08001127 VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT = 0x00000001,
1128}
1129
1130/// Descriptor pool reset flags
Jesse Halld8bade02015-11-24 10:24:18 -08001131type VkFlags VkDescriptorPoolResetFlags
Jesse Halla6429252015-11-29 18:59:42 -08001132//bitfield VkDescriptorPoolResetFlagBits {
1133//}
Jesse Hallfbf97b02015-11-20 14:17:03 -08001134
Jesse Halld27f6aa2015-08-15 17:58:48 -07001135/// Image usage flags
Jesse Halld8bade02015-11-24 10:24:18 -08001136type VkFlags VkImageUsageFlags
1137bitfield VkImageUsageFlagBits {
Jesse Hall3fbc8562015-11-29 22:10:52 -08001138 VK_IMAGE_USAGE_TRANSFER_SRC_BIT = 0x00000001, /// Can be used as a source of transfer operations
1139 VK_IMAGE_USAGE_TRANSFER_DST_BIT = 0x00000002, /// Can be used as a destination of transfer operations
Jesse Halld27f6aa2015-08-15 17:58:48 -07001140 VK_IMAGE_USAGE_SAMPLED_BIT = 0x00000004, /// Can be sampled from (SAMPLED_IMAGE and COMBINED_IMAGE_SAMPLER descriptor types)
1141 VK_IMAGE_USAGE_STORAGE_BIT = 0x00000008, /// Can be used as storage image (STORAGE_IMAGE descriptor type)
1142 VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT = 0x00000010, /// Can be used as framebuffer color attachment
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001143 VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000020, /// Can be used as framebuffer depth/stencil attachment
Jesse Halld27f6aa2015-08-15 17:58:48 -07001144 VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT = 0x00000040, /// Image data not needed outside of rendering
1145 VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT = 0x00000080, /// Can be used as framebuffer input attachment
1146}
1147
1148/// Image creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001149type VkFlags VkImageCreateFlags
1150bitfield VkImageCreateFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001151 VK_IMAGE_CREATE_SPARSE_BINDING_BIT = 0x00000001, /// Image should support sparse backing
Jesse Halld27f6aa2015-08-15 17:58:48 -07001152 VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002, /// Image should support sparse backing with partial residency
1153 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 -07001154 VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT = 0x00000008, /// Allows image views to have different format than the base image
1155 VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT = 0x00000010, /// Allows creating image views with cube type from the created image
Jesse Halld27f6aa2015-08-15 17:58:48 -07001156}
1157
Jesse Hallb00daad2015-11-29 19:46:20 -08001158/// Image view creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001159type VkFlags VkImageViewCreateFlags
Jesse Hallb00daad2015-11-29 19:46:20 -08001160//bitfield VkImageViewCreateFlagBits {
1161//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001162
1163/// Pipeline creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001164type VkFlags VkPipelineCreateFlags
1165bitfield VkPipelineCreateFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001166 VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT = 0x00000001,
1167 VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT = 0x00000002,
1168 VK_PIPELINE_CREATE_DERIVATIVE_BIT = 0x00000004,
1169}
1170
Jesse Hall65ab5522015-11-30 00:07:16 -08001171/// Color component flags
1172type VkFlags VkColorComponentFlags
1173bitfield VkColorComponentFlagBits {
1174 VK_COLOR_COMPONENT_R_BIT = 0x00000001,
1175 VK_COLOR_COMPONENT_G_BIT = 0x00000002,
1176 VK_COLOR_COMPONENT_B_BIT = 0x00000004,
1177 VK_COLOR_COMPONENT_A_BIT = 0x00000008,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001178}
1179
1180/// Fence creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001181type VkFlags VkFenceCreateFlags
1182bitfield VkFenceCreateFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001183 VK_FENCE_CREATE_SIGNALED_BIT = 0x00000001,
1184}
1185
1186/// Semaphore creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001187type VkFlags VkSemaphoreCreateFlags
Jesse Halla6429252015-11-29 18:59:42 -08001188//bitfield VkSemaphoreCreateFlagBits {
1189//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001190
1191/// Format capability flags
Jesse Halld8bade02015-11-24 10:24:18 -08001192type VkFlags VkFormatFeatureFlags
1193bitfield VkFormatFeatureFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001194 VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT = 0x00000001, /// Format can be used for sampled images (SAMPLED_IMAGE and COMBINED_IMAGE_SAMPLER descriptor types)
1195 VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT = 0x00000002, /// Format can be used for storage images (STORAGE_IMAGE descriptor type)
1196 VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT = 0x00000004, /// Format supports atomic operations in case it's used for storage images
1197 VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000008, /// Format can be used for uniform texel buffers (TBOs)
1198 VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT = 0x00000010, /// Format can be used for storage texel buffers (IBOs)
1199 VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT = 0x00000020, /// Format supports atomic operations in case it's used for storage texel buffers
1200 VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT = 0x00000040, /// Format can be used for vertex buffers (VBOs)
1201 VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT = 0x00000080, /// Format can be used for color attachment images
1202 VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT = 0x00000100, /// Format supports blending in case it's used for color attachment images
1203 VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000200, /// Format can be used for depth/stencil attachment images
Jesse Hall3fbc8562015-11-29 22:10:52 -08001204 VK_FORMAT_FEATURE_BLIT_SRC_BIT = 0x00000400, /// Format can be used as the source image of blits with vkCommandBlitImage
1205 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 -08001206 VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT = 0x00001000,
Jesse Hall26763382016-05-20 07:13:52 -07001207
1208 //@extension("VK_IMG_filter_cubic")
1209 VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG = 0x00002000,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001210}
1211
1212/// Query control flags
Jesse Halld8bade02015-11-24 10:24:18 -08001213type VkFlags VkQueryControlFlags
1214bitfield VkQueryControlFlagBits {
Jesse Hall65ab5522015-11-30 00:07:16 -08001215 VK_QUERY_CONTROL_PRECISE_BIT = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001216}
1217
1218/// Query result flags
Jesse Halld8bade02015-11-24 10:24:18 -08001219type VkFlags VkQueryResultFlags
1220bitfield VkQueryResultFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001221 VK_QUERY_RESULT_64_BIT = 0x00000001, /// Results of the queries are written to the destination buffer as 64-bit values
1222 VK_QUERY_RESULT_WAIT_BIT = 0x00000002, /// Results of the queries are waited on before proceeding with the result copy
1223 VK_QUERY_RESULT_WITH_AVAILABILITY_BIT = 0x00000004, /// Besides the results of the query, the availability of the results is also written
1224 VK_QUERY_RESULT_PARTIAL_BIT = 0x00000008, /// Copy the partial results of the query even if the final results aren't available
1225}
1226
1227/// Shader module creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001228type VkFlags VkShaderModuleCreateFlags
Jesse Halla6429252015-11-29 18:59:42 -08001229//bitfield VkShaderModuleCreateFlagBits {
1230//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001231
Jesse Halld27f6aa2015-08-15 17:58:48 -07001232/// Event creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001233type VkFlags VkEventCreateFlags
Jesse Halla6429252015-11-29 18:59:42 -08001234//bitfield VkEventCreateFlagBits {
1235//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001236
Jesse Halla15a4bf2015-11-19 22:48:02 -08001237/// Command buffer usage flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001238type VkFlags VkCommandBufferUsageFlags
1239bitfield VkCommandBufferUsageFlagBits {
1240 VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT = 0x00000001,
1241 VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT = 0x00000002,
1242 VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001243}
1244
1245/// Pipeline statistics flags
Jesse Halld8bade02015-11-24 10:24:18 -08001246type VkFlags VkQueryPipelineStatisticFlags
1247bitfield VkQueryPipelineStatisticFlagBits {
Jesse Hallae38f732015-11-19 21:32:50 -08001248 VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_BIT = 0x00000001, /// Optional
1249 VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_PRIMITIVES_BIT = 0x00000002, /// Optional
1250 VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT = 0x00000004, /// Optional
1251 VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_INVOCATIONS_BIT = 0x00000008, /// Optional
1252 VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT = 0x00000010, /// Optional
1253 VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT = 0x00000020, /// Optional
1254 VK_QUERY_PIPELINE_STATISTIC_CLIPPING_PRIMITIVES_BIT = 0x00000040, /// Optional
1255 VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT = 0x00000080, /// Optional
1256 VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT = 0x00000100, /// Optional
1257 VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT = 0x00000200, /// Optional
1258 VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT = 0x00000400, /// Optional
Jesse Halld27f6aa2015-08-15 17:58:48 -07001259}
1260
1261/// Memory mapping flags
Jesse Halld8bade02015-11-24 10:24:18 -08001262type VkFlags VkMemoryMapFlags
Jesse Halla6429252015-11-29 18:59:42 -08001263//bitfield VkMemoryMapFlagBits {
1264//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001265
1266/// Bitfield of image aspects
Jesse Halld8bade02015-11-24 10:24:18 -08001267type VkFlags VkImageAspectFlags
1268bitfield VkImageAspectFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001269 VK_IMAGE_ASPECT_COLOR_BIT = 0x00000001,
1270 VK_IMAGE_ASPECT_DEPTH_BIT = 0x00000002,
1271 VK_IMAGE_ASPECT_STENCIL_BIT = 0x00000004,
1272 VK_IMAGE_ASPECT_METADATA_BIT = 0x00000008,
1273}
1274
1275/// Sparse memory bind flags
Jesse Halld8bade02015-11-24 10:24:18 -08001276type VkFlags VkSparseMemoryBindFlags
Jesse Hall091ed9e2015-11-30 00:55:29 -08001277bitfield VkSparseMemoryBindFlagBits {
1278 VK_SPARSE_MEMORY_BIND_METADATA_BIT = 0x00000001,
1279}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001280
1281/// Sparse image memory requirements flags
Jesse Halld8bade02015-11-24 10:24:18 -08001282type VkFlags VkSparseImageFormatFlags
1283bitfield VkSparseImageFormatFlagBits {
Jesse Hallb00daad2015-11-29 19:46:20 -08001284 VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT = 0x00000001, /// Image uses a single miptail region for all array slices
1285 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.
1286 VK_SPARSE_IMAGE_FORMAT_NONSTANDARD_BLOCK_SIZE_BIT = 0x00000004, /// Image uses a non-standard sparse block size
Jesse Halld27f6aa2015-08-15 17:58:48 -07001287}
1288
1289/// Pipeline stages
Jesse Halld8bade02015-11-24 10:24:18 -08001290type VkFlags VkPipelineStageFlags
1291bitfield VkPipelineStageFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001292 VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT = 0x00000001, /// Before subsequent commands are processed
1293 VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT = 0x00000002, /// Draw/DispatchIndirect command fetch
1294 VK_PIPELINE_STAGE_VERTEX_INPUT_BIT = 0x00000004, /// Vertex/index fetch
1295 VK_PIPELINE_STAGE_VERTEX_SHADER_BIT = 0x00000008, /// Vertex shading
Jesse Hallae38f732015-11-19 21:32:50 -08001296 VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT = 0x00000010, /// Tessellation control shading
1297 VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT = 0x00000020, /// Tessellation evaluation shading
Jesse Halld27f6aa2015-08-15 17:58:48 -07001298 VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT = 0x00000040, /// Geometry shading
1299 VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT = 0x00000080, /// Fragment shading
1300 VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT = 0x00000100, /// Early fragment (depth/stencil) tests
1301 VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT = 0x00000200, /// Late fragment (depth/stencil) tests
1302 VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT = 0x00000400, /// Color attachment writes
1303 VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT = 0x00000800, /// Compute shading
1304 VK_PIPELINE_STAGE_TRANSFER_BIT = 0x00001000, /// Transfer/copy operations
Jesse Hall543a7ff2016-01-08 16:38:30 -08001305 VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT = 0x00002000,
1306 VK_PIPELINE_STAGE_HOST_BIT = 0x00004000, /// Indicates host (CPU) is a source/sink of the dependency
Jesse Halld27f6aa2015-08-15 17:58:48 -07001307
Jesse Hall543a7ff2016-01-08 16:38:30 -08001308 VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT = 0x00008000, /// All stages of the graphics pipeline
1309 VK_PIPELINE_STAGE_ALL_COMMANDS_BIT = 0x00010000, /// All graphics, compute, copy, and transition commands
Chris Forbes289cb792016-12-30 15:03:55 +13001310
1311 //@extension("VK_NVX_device_generated_commands")
1312 VK_PIPELINE_STAGE_COMMAND_PROCESS_BIT_NVX = 0x00020000,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001313}
1314
1315/// Render pass attachment description flags
Jesse Halld8bade02015-11-24 10:24:18 -08001316type VkFlags VkAttachmentDescriptionFlags
1317bitfield VkAttachmentDescriptionFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001318 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 -07001319}
1320
1321/// Subpass description flags
Jesse Halld8bade02015-11-24 10:24:18 -08001322type VkFlags VkSubpassDescriptionFlags
1323bitfield VkSubpassDescriptionFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001324}
1325
1326/// Command pool creation flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001327type VkFlags VkCommandPoolCreateFlags
1328bitfield VkCommandPoolCreateFlagBits {
1329 VK_COMMAND_POOL_CREATE_TRANSIENT_BIT = 0x00000001, /// Command buffers have a short lifetime
1330 VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT = 0x00000002, /// Command buffers may release their memory individually
Jesse Halld27f6aa2015-08-15 17:58:48 -07001331}
1332
1333/// Command pool reset flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001334type VkFlags VkCommandPoolResetFlags
1335bitfield VkCommandPoolResetFlagBits {
1336 VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT = 0x00000001, /// Release resources owned by the pool
Jesse Halld27f6aa2015-08-15 17:58:48 -07001337}
1338
Jesse Hall3fbc8562015-11-29 22:10:52 -08001339type VkFlags VkCommandBufferResetFlags
1340bitfield VkCommandBufferResetFlagBits {
1341 VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT = 0x00000001, /// Release resources owned by the buffer
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001342}
1343
Jesse Halld8bade02015-11-24 10:24:18 -08001344type VkFlags VkSampleCountFlags
1345bitfield VkSampleCountFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001346 VK_SAMPLE_COUNT_1_BIT = 0x00000001,
1347 VK_SAMPLE_COUNT_2_BIT = 0x00000002,
1348 VK_SAMPLE_COUNT_4_BIT = 0x00000004,
1349 VK_SAMPLE_COUNT_8_BIT = 0x00000008,
1350 VK_SAMPLE_COUNT_16_BIT = 0x00000010,
1351 VK_SAMPLE_COUNT_32_BIT = 0x00000020,
1352 VK_SAMPLE_COUNT_64_BIT = 0x00000040,
1353}
1354
Jesse Halld8bade02015-11-24 10:24:18 -08001355type VkFlags VkStencilFaceFlags
1356bitfield VkStencilFaceFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001357 VK_STENCIL_FACE_FRONT_BIT = 0x00000001, /// Front face
1358 VK_STENCIL_FACE_BACK_BIT = 0x00000002, /// Back face
Jesse Hallc7467b72015-11-29 21:05:26 -08001359 VK_STENCIL_FRONT_AND_BACK = 0x00000003,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001360}
1361
Jesse Halla6429252015-11-29 18:59:42 -08001362/// Instance creation flags
1363type VkFlags VkInstanceCreateFlags
1364//bitfield VkInstanceCreateFlagBits {
1365//}
1366
1367/// Device creation flags
1368type VkFlags VkDeviceCreateFlags
1369//bitfield VkDeviceCreateFlagBits {
1370//}
1371
1372/// Device queue creation flags
1373type VkFlags VkDeviceQueueCreateFlags
1374//bitfield VkDeviceQueueCreateFlagBits {
1375//}
1376
1377/// Query pool creation flags
1378type VkFlags VkQueryPoolCreateFlags
1379//bitfield VkQueryPoolCreateFlagBits {
1380//}
1381
1382/// Buffer view creation flags
1383type VkFlags VkBufferViewCreateFlags
1384//bitfield VkBufferViewCreateFlagBits {
1385//}
1386
1387/// Pipeline cache creation flags
1388type VkFlags VkPipelineCacheCreateFlags
1389//bitfield VkPipelineCacheCreateFlagBits {
1390//}
1391
1392/// Pipeline shader stage creation flags
1393type VkFlags VkPipelineShaderStageCreateFlags
1394//bitfield VkPipelineShaderStageCreateFlagBits {
1395//}
1396
1397/// Descriptor set layout creation flags
1398type VkFlags VkDescriptorSetLayoutCreateFlags
1399//bitfield VkDescriptorSetLayoutCreateFlagBits {
1400//}
1401
1402/// Pipeline vertex input state creation flags
1403type VkFlags VkPipelineVertexInputStateCreateFlags
1404//bitfield VkPipelineVertexInputStateCreateFlagBits {
1405//}
1406
1407/// Pipeline input assembly state creation flags
1408type VkFlags VkPipelineInputAssemblyStateCreateFlags
1409//bitfield VkPipelineInputAssemblyStateCreateFlagBits {
1410//}
1411
1412/// Tessellation state creation flags
1413type VkFlags VkPipelineTessellationStateCreateFlags
1414//bitfield VkPipelineTessellationStateCreateFlagBits {
1415//}
1416
1417/// Viewport state creation flags
1418type VkFlags VkPipelineViewportStateCreateFlags
1419//bitfield VkPipelineViewportStateCreateFlagBits {
1420//}
1421
Jesse Hall3fbc8562015-11-29 22:10:52 -08001422/// Rasterization state creation flags
1423type VkFlags VkPipelineRasterizationStateCreateFlags
1424//bitfield VkPipelineRasterizationStateCreateFlagBits {
Jesse Halla6429252015-11-29 18:59:42 -08001425//}
1426
1427/// Multisample state creation flags
1428type VkFlags VkPipelineMultisampleStateCreateFlags
1429//bitfield VkPipelineMultisampleStateCreateFlagBits {
1430//}
1431
1432/// Color blend state creation flags
1433type VkFlags VkPipelineColorBlendStateCreateFlags
1434//bitfield VkPipelineColorBlendStateCreateFlagBits {
1435//}
1436
1437/// Depth/stencil state creation flags
1438type VkFlags VkPipelineDepthStencilStateCreateFlags
1439//bitfield VkPipelineDepthStencilStateCreateFlagBits {
1440//}
1441
1442/// Dynamic state creation flags
1443type VkFlags VkPipelineDynamicStateCreateFlags
1444//bitfield VkPipelineDynamicStateCreateFlagBits {
1445//}
1446
1447/// Pipeline layout creation flags
1448type VkFlags VkPipelineLayoutCreateFlags
1449//bitfield VkPipelineLayoutCreateFlagBits {
1450//}
1451
1452/// Sampler creation flags
1453type VkFlags VkSamplerCreateFlags
1454//bitfield VkSamplerCreateFlagBits {
1455//}
1456
1457/// Render pass creation flags
1458type VkFlags VkRenderPassCreateFlags
1459//bitfield VkRenderPassCreateFlagBits {
1460//}
1461
1462/// Framebuffer creation flags
1463type VkFlags VkFramebufferCreateFlags
1464//bitfield VkFramebufferCreateFlagBits {
1465//}
1466
Jesse Halldc6d36c2015-11-29 19:12:15 -08001467/// Dependency flags
1468type VkFlags VkDependencyFlags
1469bitfield VkDependencyFlagBits {
1470 VK_DEPENDENCY_BY_REGION_BIT = 0x00000001,
1471}
1472
Jesse Hallc7467b72015-11-29 21:05:26 -08001473/// Cull mode flags
1474type VkFlags VkCullModeFlags
1475bitfield VkCullModeFlagBits {
1476 VK_CULL_MODE_NONE = 0x00000000,
1477 VK_CULL_MODE_FRONT_BIT = 0x00000001,
1478 VK_CULL_MODE_BACK_BIT = 0x00000002,
1479 VK_CULL_MODE_FRONT_AND_BACK = 0x00000003,
1480}
1481
Jesse Hall523db342015-11-30 21:12:55 -08001482@extension("VK_KHR_surface")
Jesse Halld8bade02015-11-24 10:24:18 -08001483type VkFlags VkSurfaceTransformFlagsKHR
Jesse Hall523db342015-11-30 21:12:55 -08001484@extension("VK_KHR_surface")
Jesse Halld8bade02015-11-24 10:24:18 -08001485bitfield VkSurfaceTransformFlagBitsKHR {
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001486 VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR = 0x00000001,
Jesse Hall9ba8bc82015-11-30 16:22:16 -08001487 VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR = 0x00000002,
1488 VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR = 0x00000004,
1489 VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR = 0x00000008,
1490 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR = 0x00000010,
1491 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR = 0x00000020,
1492 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR = 0x00000040,
1493 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR = 0x00000080,
1494 VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR = 0x00000100,
Michael Lentine88594d72015-11-12 12:49:45 -08001495}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001496
Jesse Hall523db342015-11-30 21:12:55 -08001497@extension("VK_KHR_surface")
Jesse Halla6429252015-11-29 18:59:42 -08001498type VkFlags VkCompositeAlphaFlagsKHR
Jesse Hall523db342015-11-30 21:12:55 -08001499@extension("VK_KHR_surface")
Jesse Halla6429252015-11-29 18:59:42 -08001500bitfield VkCompositeAlphaFlagBitsKHR {
1501 VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR = 0x00000001,
1502 VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR = 0x00000002,
1503 VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR = 0x00000004,
1504 VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR = 0x00000008,
1505}
1506
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001507@extension("VK_KHR_swapchain")
1508type VkFlags VkSwapchainCreateFlagsKHR
1509//@extension("VK_KHR_swapchain")
1510//bitfield VkSwapchainCreateFlagBitsKHR {
1511//}
1512
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001513@extension("VK_KHR_display")
Jesse Halld8bade02015-11-24 10:24:18 -08001514type VkFlags VkDisplayPlaneAlphaFlagsKHR
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001515@extension("VK_KHR_display")
Jesse Halld8bade02015-11-24 10:24:18 -08001516bitfield VkDisplayPlaneAlphaFlagBitsKHR {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001517 VK_DISPLAY_PLANE_ALPHA_OPAQUE_BIT_KHR = 0x00000001,
1518 VK_DISPLAY_PLANE_ALPHA_GLOBAL_BIT_KHR = 0x00000002,
1519 VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_BIT_KHR = 0x00000004,
1520 VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_PREMULTIPLIED_BIT_KHR = 0x00000008,
Jesse Hall1356b0d2015-11-23 17:24:58 -08001521}
1522
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001523@extension("VK_KHR_display")
1524type VkFlags VkDisplaySurfaceCreateFlagsKHR
1525//@extension("VK_KHR_display")
1526//bitfield VkDisplaySurfaceCreateFlagBitsKHR {
1527//}
1528
Jesse Hall9ba8bc82015-11-30 16:22:16 -08001529@extension("VK_KHR_display")
1530type VkFlags VkDisplayModeCreateFlagsKHR
1531//@extension("VK_KHR_display")
1532//bitfield VkDisplayModeCreateFlagBitsKHR {
1533//}
1534
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001535@extension("VK_KHR_xlib_surface")
1536type VkFlags VkXlibSurfaceCreateFlagsKHR
1537//@extension("VK_KHR_xlib_surface")
1538//bitfield VkXlibSurfaceCreateFlagBitsKHR {
1539//}
1540
1541@extension("VK_KHR_xcb_surface")
1542type VkFlags VkXcbSurfaceCreateFlagsKHR
1543//@extension("VK_KHR_xcb_surface")
1544//bitfield VkXcbSurfaceCreateFlagBitsKHR {
1545//}
1546
1547@extension("VK_KHR_wayland_surface")
1548type VkFlags VkWaylandSurfaceCreateFlagsKHR
1549//@extension("VK_KHR_wayland_surface")
1550//bitfield VkWaylandSurfaceCreateFlagBitsKHR {
1551//}
1552
1553@extension("VK_KHR_mir_surface")
1554type VkFlags VkMirSurfaceCreateFlagsKHR
1555//@extension("VK_KHR_mir_surface")
1556//bitfield VkMirSurfaceCreateFlagBitsKHR {
1557//}
1558
1559@extension("VK_KHR_android_surface")
1560type VkFlags VkAndroidSurfaceCreateFlagsKHR
1561//@extension("VK_KHR_android_surface")
1562//bitfield VkAndroidSurfaceCreateFlagBitsKHR {
1563//}
1564
1565@extension("VK_KHR_win32_surface")
1566type VkFlags VkWin32SurfaceCreateFlagsKHR
1567//@extension("VK_KHR_win32_surface")
1568//bitfield VkWin32SurfaceCreateFlagBitsKHR {
1569//}
1570
Jesse Hall715b86a2016-01-16 16:34:29 -08001571@extension("VK_EXT_debug_report")
1572type VkFlags VkDebugReportFlagsEXT
1573@extension("VK_EXT_debug_report")
1574bitfield VkDebugReportFlagBitsEXT {
Jesse Halle2948d82016-02-25 04:19:32 -08001575 VK_DEBUG_REPORT_INFORMATION_BIT_EXT = 0x00000001,
1576 VK_DEBUG_REPORT_WARNING_BIT_EXT = 0x00000002,
1577 VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT = 0x00000004,
Jesse Hall715b86a2016-01-16 16:34:29 -08001578 VK_DEBUG_REPORT_ERROR_BIT_EXT = 0x00000008,
1579 VK_DEBUG_REPORT_DEBUG_BIT_EXT = 0x00000010,
1580}
1581
Chris Forbes8e4438b2016-12-07 16:26:49 +13001582@extension("VK_ANDROID_native_buffer")
1583type VkFlags VkSwapchainImageUsageFlagsANDROID
1584@extension("VK_ANDROID_native_buffer")
1585bitfield VkSwapchainImageUsageFlagBitsANDROID {
Chris Forbes4da65b92017-01-31 11:48:50 +13001586 VK_SWAPCHAIN_IMAGE_USAGE_FLAGS_SHARED_BIT_ANDROID = 0x00000001,
Chris Forbes8e4438b2016-12-07 16:26:49 +13001587}
1588
Chris Forbes289cb792016-12-30 15:03:55 +13001589@extension("VK_NV_external_memory_capabilities")
1590type VkFlags VkExternalMemoryHandleTypeFlagsNV
1591@extension("VK_NV_external_memory_capabilities")
1592bitfield VkExternalMemoryHandleTypeFlagBitsNV {
1593 VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_NV = 0x00000001,
1594 VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_NV = 0x00000002,
1595 VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_IMAGE_BIT_NV = 0x00000004,
1596 VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_IMAGE_KMT_BIT_NV = 0x00000008,
1597}
1598
1599@extension("VK_NV_external_memory_capabilities")
1600type VkFlags VkExternalMemoryFeatureFlagsNV
1601@extension("VK_NV_external_memory_capabilities")
1602bitfield VkExternalMemoryFeatureFlagBitsNV {
1603 VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT_NV = 0x00000001,
1604 VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT_NV = 0x00000002,
1605 VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT_NV = 0x00000004,
1606}
1607
1608@extension("VK_NVX_device_generated_commands")
1609type VkFlags VkIndirectCommandsLayoutUsageFlagsNVX
1610@extension("VK_NVX_device_generated_commands")
1611bitfield VkIndirectCommandsLayoutUsageFlagBitsNVX {
1612 VK_INDIRECT_COMMANDS_LAYOUT_USAGE_UNORDERED_SEQUENCES_BIT_NVX = 0x00000001,
1613 VK_INDIRECT_COMMANDS_LAYOUT_USAGE_SPARSE_SEQUENCES_BIT_NVX = 0x00000002,
1614 VK_INDIRECT_COMMANDS_LAYOUT_USAGE_EMPTY_EXECUTIONS_BIT_NVX = 0x00000004,
1615 VK_INDIRECT_COMMANDS_LAYOUT_USAGE_INDEXED_SEQUENCES_BIT_NVX = 0x00000008,
1616}
1617
1618@extension("VK_NVX_device_generated_commands")
1619type VkFlags VkObjectEntryUsageFlagsNVX
1620@extension("VK_NVX_device_generated_commands")
1621bitfield VkObjectEntryUsageFlagBitsNVX {
1622 VK_OBJECT_ENTRY_USAGE_GRAPHICS_BIT_NVX = 0x00000001,
1623 VK_OBJECT_ENTRY_USAGE_COMPUTE_BIT_NVX = 0x00000002,
1624}
1625
Jesse Hall1356b0d2015-11-23 17:24:58 -08001626
Jesse Halld27f6aa2015-08-15 17:58:48 -07001627//////////////////
1628// Structures //
1629//////////////////
1630
1631class VkOffset2D {
1632 s32 x
1633 s32 y
1634}
1635
1636class VkOffset3D {
1637 s32 x
1638 s32 y
1639 s32 z
1640}
1641
1642class VkExtent2D {
Jesse Hall3dd678a2016-01-08 21:52:01 -08001643 u32 width
1644 u32 height
Jesse Halld27f6aa2015-08-15 17:58:48 -07001645}
1646
1647class VkExtent3D {
Jesse Hall3dd678a2016-01-08 21:52:01 -08001648 u32 width
1649 u32 height
1650 u32 depth
Jesse Halld27f6aa2015-08-15 17:58:48 -07001651}
1652
1653class VkViewport {
Jesse Hall65ab5522015-11-30 00:07:16 -08001654 f32 x
1655 f32 y
Jesse Halld27f6aa2015-08-15 17:58:48 -07001656 f32 width
1657 f32 height
1658 f32 minDepth
1659 f32 maxDepth
1660}
1661
1662class VkRect2D {
1663 VkOffset2D offset
1664 VkExtent2D extent
1665}
1666
Jesse Halla15a4bf2015-11-19 22:48:02 -08001667class VkClearRect {
1668 VkRect2D rect
1669 u32 baseArrayLayer
Jesse Hall3fbc8562015-11-29 22:10:52 -08001670 u32 layerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001671}
1672
Jesse Hall65ab5522015-11-30 00:07:16 -08001673class VkComponentMapping {
1674 VkComponentSwizzle r
1675 VkComponentSwizzle g
1676 VkComponentSwizzle b
1677 VkComponentSwizzle a
Jesse Halld27f6aa2015-08-15 17:58:48 -07001678}
1679
1680class VkPhysicalDeviceProperties {
1681 u32 apiVersion
1682 u32 driverVersion
Jesse Hall65ab5522015-11-30 00:07:16 -08001683 u32 vendorID
1684 u32 deviceID
Jesse Halld27f6aa2015-08-15 17:58:48 -07001685 VkPhysicalDeviceType deviceType
Jesse Hall65ab5522015-11-30 00:07:16 -08001686 char[VK_MAX_PHYSICAL_DEVICE_NAME_SIZE] deviceName
1687 u8[VK_UUID_SIZE] pipelineCacheUUID
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001688 VkPhysicalDeviceLimits limits
1689 VkPhysicalDeviceSparseProperties sparseProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07001690}
1691
1692class VkExtensionProperties {
Jesse Hall65ab5522015-11-30 00:07:16 -08001693 char[VK_MAX_EXTENSION_NAME_SIZE] extensionName /// extension name
Jesse Halld27f6aa2015-08-15 17:58:48 -07001694 u32 specVersion /// version of the extension specification implemented
1695}
1696
1697class VkLayerProperties {
Jesse Hall65ab5522015-11-30 00:07:16 -08001698 char[VK_MAX_EXTENSION_NAME_SIZE] layerName /// layer name
Jesse Hall3fbc8562015-11-29 22:10:52 -08001699 u32 specVersion /// version of the layer specification implemented
1700 u32 implementationVersion /// build or release version of the layer's library
Jesse Hall65ab5522015-11-30 00:07:16 -08001701 char[VK_MAX_DESCRIPTION_SIZE] description /// Free-form description of the layer
Jesse Halld27f6aa2015-08-15 17:58:48 -07001702}
1703
Jesse Halla366a512015-11-19 22:30:07 -08001704class VkSubmitInfo {
Jesse Hall03b6fe12015-11-24 12:44:21 -08001705 VkStructureType sType /// Type of structure. Should be VK_STRUCTURE_TYPE_SUBMIT_INFO
1706 const void* pNext /// Next structure in chain
1707 u32 waitSemaphoreCount
Jesse Halla366a512015-11-19 22:30:07 -08001708 const VkSemaphore* pWaitSemaphores
Jesse Hall543a7ff2016-01-08 16:38:30 -08001709 const VkPipelineStageFlags* pWaitDstStageMask
Jesse Hall03b6fe12015-11-24 12:44:21 -08001710 u32 commandBufferCount
Jesse Hall3fbc8562015-11-29 22:10:52 -08001711 const VkCommandBuffer* pCommandBuffers
Jesse Hall03b6fe12015-11-24 12:44:21 -08001712 u32 signalSemaphoreCount
Jesse Halla366a512015-11-19 22:30:07 -08001713 const VkSemaphore* pSignalSemaphores
1714}
1715
Jesse Halld27f6aa2015-08-15 17:58:48 -07001716class VkApplicationInfo {
1717 VkStructureType sType /// Type of structure. Should be VK_STRUCTURE_TYPE_APPLICATION_INFO
1718 const void* pNext /// Next structure in chain
Jesse Hall3fbc8562015-11-29 22:10:52 -08001719 const char* pApplicationName
1720 u32 applicationVersion
Jesse Halld27f6aa2015-08-15 17:58:48 -07001721 const char* pEngineName
1722 u32 engineVersion
1723 u32 apiVersion
1724}
1725
Jesse Hall3fbc8562015-11-29 22:10:52 -08001726class VkAllocationCallbacks {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001727 void* pUserData
Jesse Hall3fbc8562015-11-29 22:10:52 -08001728 PFN_vkAllocationFunction pfnAllocation
1729 PFN_vkReallocationFunction pfnReallocation
Jesse Halld27f6aa2015-08-15 17:58:48 -07001730 PFN_vkFreeFunction pfnFree
Jesse Hall3fbc8562015-11-29 22:10:52 -08001731 PFN_vkInternalAllocationNotification pfnInternalAllocation
Jesse Hall03b6fe12015-11-24 12:44:21 -08001732 PFN_vkInternalFreeNotification pfnInternalFree
Jesse Halld27f6aa2015-08-15 17:58:48 -07001733}
1734
1735class VkDeviceQueueCreateInfo {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001736 VkStructureType sStype /// Should be VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO
1737 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001738 VkDeviceQueueCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001739 u32 queueFamilyIndex
Jesse Halldba27f72015-11-30 14:25:46 -08001740 u32 queueCount
Jesse Hallfbf97b02015-11-20 14:17:03 -08001741 const f32* pQueuePriorities
Jesse Halld27f6aa2015-08-15 17:58:48 -07001742}
1743
1744class VkDeviceCreateInfo {
1745 VkStructureType sType /// Should be VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO
1746 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001747 VkDeviceCreateFlags flags
Jesse Halldba27f72015-11-30 14:25:46 -08001748 u32 queueCreateInfoCount
1749 const VkDeviceQueueCreateInfo* pQueueCreateInfos
Jesse Hall3dd678a2016-01-08 21:52:01 -08001750 u32 enabledLayerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001751 const char* const* ppEnabledLayerNames /// Ordered list of layer names to be enabled
Jesse Hall3dd678a2016-01-08 21:52:01 -08001752 u32 enabledExtensionCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001753 const char* const* ppEnabledExtensionNames
1754 const VkPhysicalDeviceFeatures* pEnabledFeatures
Jesse Halld27f6aa2015-08-15 17:58:48 -07001755}
1756
1757class VkInstanceCreateInfo {
1758 VkStructureType sType /// Should be VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO
1759 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001760 VkInstanceCreateFlags flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001761 const VkApplicationInfo* pApplicationInfo
Jesse Hall3dd678a2016-01-08 21:52:01 -08001762 u32 enabledLayerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001763 const char* const* ppEnabledLayerNames /// Ordered list of layer names to be enabled
Jesse Hall3dd678a2016-01-08 21:52:01 -08001764 u32 enabledExtensionCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001765 const char* const* ppEnabledExtensionNames /// Extension names to be enabled
1766}
1767
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001768class VkQueueFamilyProperties {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001769 VkQueueFlags queueFlags /// Queue flags
1770 u32 queueCount
Jesse Hallacfa5342015-11-19 21:51:33 -08001771 u32 timestampValidBits
Jesse Hall65ab5522015-11-30 00:07:16 -08001772 VkExtent3D minImageTransferGranularity
Jesse Halld27f6aa2015-08-15 17:58:48 -07001773}
1774
1775class VkPhysicalDeviceMemoryProperties {
1776 u32 memoryTypeCount
1777 VkMemoryType[VK_MAX_MEMORY_TYPES] memoryTypes
1778 u32 memoryHeapCount
1779 VkMemoryHeap[VK_MAX_MEMORY_HEAPS] memoryHeaps
1780}
1781
Jesse Hall3fbc8562015-11-29 22:10:52 -08001782class VkMemoryAllocateInfo {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001783 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07001784 const void* pNext /// Pointer to next structure
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001785 VkDeviceSize allocationSize /// Size of memory allocation
Jesse Halld27f6aa2015-08-15 17:58:48 -07001786 u32 memoryTypeIndex /// Index of the of the memory type to allocate from
1787}
1788
1789class VkMemoryRequirements {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001790 VkDeviceSize size /// Specified in bytes
1791 VkDeviceSize alignment /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001792 u32 memoryTypeBits /// Bitfield of the allowed memory type indices into memoryTypes[] for this object
1793}
1794
1795class VkSparseImageFormatProperties {
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001796 VkImageAspectFlagBits aspectMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001797 VkExtent3D imageGranularity
1798 VkSparseImageFormatFlags flags
1799}
1800
1801class VkSparseImageMemoryRequirements {
Jesse Hallb00daad2015-11-29 19:46:20 -08001802 VkSparseImageFormatProperties formatProperties
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001803 u32 imageMipTailFirstLod
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001804 VkDeviceSize imageMipTailSize /// Specified in bytes, must be a multiple of image block size / alignment
1805 VkDeviceSize imageMipTailOffset /// Specified in bytes, must be a multiple of image block size / alignment
1806 VkDeviceSize imageMipTailStride /// Specified in bytes, must be a multiple of image block size / alignment
Jesse Halld27f6aa2015-08-15 17:58:48 -07001807}
1808
1809class VkMemoryType {
1810 VkMemoryPropertyFlags propertyFlags /// Memory properties of this memory type
1811 u32 heapIndex /// Index of the memory heap allocations of this memory type are taken from
1812}
1813
1814class VkMemoryHeap {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001815 VkDeviceSize size /// Available memory in the heap
Jesse Halld27f6aa2015-08-15 17:58:48 -07001816 VkMemoryHeapFlags flags /// Flags for the heap
1817}
1818
1819class VkMappedMemoryRange {
1820 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE
1821 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08001822 VkDeviceMemory memory /// Mapped memory object
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001823 VkDeviceSize offset /// Offset within the mapped memory the range starts from
1824 VkDeviceSize size /// Size of the range within the mapped memory
Jesse Halld27f6aa2015-08-15 17:58:48 -07001825}
1826
1827class VkFormatProperties {
1828 VkFormatFeatureFlags linearTilingFeatures /// Format features in case of linear tiling
1829 VkFormatFeatureFlags optimalTilingFeatures /// Format features in case of optimal tiling
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001830 VkFormatFeatureFlags bufferFeatures /// Format features supported by buffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07001831}
1832
1833class VkImageFormatProperties {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001834 VkExtent3D maxExtent /// max image dimensions for this resource type
1835 u32 maxMipLevels /// max number of mipmap levels for this resource type
Jesse Halla15a4bf2015-11-19 22:48:02 -08001836 u32 maxArrayLayers /// max array layers for this resource type
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001837 VkSampleCountFlags sampleCounts /// supported sample counts for this resource type
1838 VkDeviceSize maxResourceSize /// max size (in bytes) of this resource type
1839}
1840
Jesse Halla15a4bf2015-11-19 22:48:02 -08001841class VkDescriptorImageInfo {
1842 VkSampler sampler
1843 VkImageView imageView
1844 VkImageLayout imageLayout
1845}
1846
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001847class VkDescriptorBufferInfo {
1848 VkBuffer buffer /// Buffer used for this descriptor when the descriptor is UNIFORM_BUFFER[_DYNAMIC]
1849 VkDeviceSize offset /// Base offset from buffer start in bytes to update in the descriptor set.
1850 VkDeviceSize range /// Size in bytes of the buffer resource for this descriptor update.
Jesse Halld27f6aa2015-08-15 17:58:48 -07001851}
1852
Jesse Halld27f6aa2015-08-15 17:58:48 -07001853class VkWriteDescriptorSet {
1854 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET
1855 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08001856 VkDescriptorSet dstSet /// Destination descriptor set
1857 u32 dstBinding /// Binding within the destination descriptor set to write
1858 u32 dstArrayElement /// Array element within the destination binding to write
Jesse Hall03b6fe12015-11-24 12:44:21 -08001859 u32 descriptorCount /// Number of descriptors to write (determines the size of the array pointed by <pDescriptors>)
Jesse Halld27f6aa2015-08-15 17:58:48 -07001860 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 -08001861 const VkDescriptorImageInfo* pImageInfo
1862 const VkDescriptorBufferInfo* pBufferInfo
1863 const VkBufferView* pTexelBufferView
Jesse Halld27f6aa2015-08-15 17:58:48 -07001864}
1865
1866class VkCopyDescriptorSet {
1867 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET
1868 const void* pNext /// Pointer to next structure
1869 VkDescriptorSet srcSet /// Source descriptor set
1870 u32 srcBinding /// Binding within the source descriptor set to copy from
1871 u32 srcArrayElement /// Array element within the source binding to copy from
Jesse Hall3fbc8562015-11-29 22:10:52 -08001872 VkDescriptorSet dstSet /// Destination descriptor set
1873 u32 dstBinding /// Binding within the destination descriptor set to copy to
1874 u32 dstArrayElement /// Array element within the destination binding to copy to
Jesse Hall03b6fe12015-11-24 12:44:21 -08001875 u32 descriptorCount /// Number of descriptors to copy
Jesse Halld27f6aa2015-08-15 17:58:48 -07001876}
1877
1878class VkBufferCreateInfo {
1879 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO
1880 const void* pNext /// Pointer to next structure.
Jesse Halla6429252015-11-29 18:59:42 -08001881 VkBufferCreateFlags flags /// Buffer creation flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001882 VkDeviceSize size /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001883 VkBufferUsageFlags usage /// Buffer usage flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001884 VkSharingMode sharingMode
Jesse Hall03b6fe12015-11-24 12:44:21 -08001885 u32 queueFamilyIndexCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001886 const u32* pQueueFamilyIndices
1887}
1888
1889class VkBufferViewCreateInfo {
1890 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO
1891 const void* pNext /// Pointer to next structure.
Jesse Halla6429252015-11-29 18:59:42 -08001892 VkBufferViewCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001893 VkBuffer buffer
Jesse Halld27f6aa2015-08-15 17:58:48 -07001894 VkFormat format /// Optionally specifies format of elements
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001895 VkDeviceSize offset /// Specified in bytes
1896 VkDeviceSize range /// View size specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001897}
1898
1899class VkImageSubresource {
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001900 VkImageAspectFlagBits aspectMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001901 u32 mipLevel
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001902 u32 arrayLayer
Jesse Halld27f6aa2015-08-15 17:58:48 -07001903}
1904
1905class VkImageSubresourceRange {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001906 VkImageAspectFlags aspectMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001907 u32 baseMipLevel
Jesse Hall3fbc8562015-11-29 22:10:52 -08001908 u32 levelCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001909 u32 baseArrayLayer
Jesse Hall3fbc8562015-11-29 22:10:52 -08001910 u32 layerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001911}
1912
1913class VkMemoryBarrier {
1914 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MEMORY_BARRIER
1915 const void* pNext /// Pointer to next structure.
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001916 VkAccessFlags srcAccessMask
1917 VkAccessFlags dstAccessMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001918}
1919
1920class VkBufferMemoryBarrier {
1921 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER
1922 const void* pNext /// Pointer to next structure.
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001923 VkAccessFlags srcAccessMask
1924 VkAccessFlags dstAccessMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001925 u32 srcQueueFamilyIndex /// Queue family to transition ownership from
Jesse Hall3fbc8562015-11-29 22:10:52 -08001926 u32 dstQueueFamilyIndex /// Queue family to transition ownership to
Jesse Halld27f6aa2015-08-15 17:58:48 -07001927 VkBuffer buffer /// Buffer to sync
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001928 VkDeviceSize offset /// Offset within the buffer to sync
1929 VkDeviceSize size /// Amount of bytes to sync
Jesse Halld27f6aa2015-08-15 17:58:48 -07001930}
1931
1932class VkImageMemoryBarrier {
1933 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER
1934 const void* pNext /// Pointer to next structure.
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001935 VkAccessFlags srcAccessMask
1936 VkAccessFlags dstAccessMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001937 VkImageLayout oldLayout /// Current layout of the image
1938 VkImageLayout newLayout /// New layout to transition the image to
1939 u32 srcQueueFamilyIndex /// Queue family to transition ownership from
Jesse Hall3fbc8562015-11-29 22:10:52 -08001940 u32 dstQueueFamilyIndex /// Queue family to transition ownership to
Jesse Halld27f6aa2015-08-15 17:58:48 -07001941 VkImage image /// Image to sync
1942 VkImageSubresourceRange subresourceRange /// Subresource range to sync
1943}
1944
1945class VkImageCreateInfo {
1946 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO
1947 const void* pNext /// Pointer to next structure.
Jesse Halla6429252015-11-29 18:59:42 -08001948 VkImageCreateFlags flags /// Image creation flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001949 VkImageType imageType
1950 VkFormat format
1951 VkExtent3D extent
1952 u32 mipLevels
Jesse Halla15a4bf2015-11-19 22:48:02 -08001953 u32 arrayLayers
Jesse Hall091ed9e2015-11-30 00:55:29 -08001954 VkSampleCountFlagBits samples
Jesse Halld27f6aa2015-08-15 17:58:48 -07001955 VkImageTiling tiling
1956 VkImageUsageFlags usage /// Image usage flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001957 VkSharingMode sharingMode /// Cross-queue-family sharing mode
Jesse Hall03b6fe12015-11-24 12:44:21 -08001958 u32 queueFamilyIndexCount /// Number of queue families to share across
Jesse Halld27f6aa2015-08-15 17:58:48 -07001959 const u32* pQueueFamilyIndices /// Array of queue family indices to share across
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001960 VkImageLayout initialLayout /// Initial image layout for all subresources
Jesse Halld27f6aa2015-08-15 17:58:48 -07001961}
1962
1963class VkSubresourceLayout {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001964 VkDeviceSize offset /// Specified in bytes
1965 VkDeviceSize size /// Specified in bytes
1966 VkDeviceSize rowPitch /// Specified in bytes
Jesse Hall543a7ff2016-01-08 16:38:30 -08001967 VkDeviceSize arrayPitch /// Specified in bytes
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001968 VkDeviceSize depthPitch /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001969}
1970
1971class VkImageViewCreateInfo {
1972 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO
1973 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001974 VkImageViewCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001975 VkImage image
1976 VkImageViewType viewType
1977 VkFormat format
Jesse Hall65ab5522015-11-30 00:07:16 -08001978 VkComponentMapping components
Jesse Halld27f6aa2015-08-15 17:58:48 -07001979 VkImageSubresourceRange subresourceRange
Jesse Halld27f6aa2015-08-15 17:58:48 -07001980}
1981
1982class VkBufferCopy {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001983 VkDeviceSize srcOffset /// Specified in bytes
Jesse Hall3fbc8562015-11-29 22:10:52 -08001984 VkDeviceSize dstOffset /// Specified in bytes
Jesse Hallb00daad2015-11-29 19:46:20 -08001985 VkDeviceSize size /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001986}
1987
Jesse Halla6429252015-11-29 18:59:42 -08001988class VkSparseMemoryBind {
Jesse Hallb00daad2015-11-29 19:46:20 -08001989 VkDeviceSize resourceOffset /// Specified in bytes
1990 VkDeviceSize size /// Specified in bytes
Jesse Hall3fbc8562015-11-29 22:10:52 -08001991 VkDeviceMemory memory
1992 VkDeviceSize memoryOffset /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001993 VkSparseMemoryBindFlags flags
1994}
1995
Jesse Halla6429252015-11-29 18:59:42 -08001996class VkSparseImageMemoryBind {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001997 VkImageSubresource subresource
1998 VkOffset3D offset
1999 VkExtent3D extent
Jesse Hall3fbc8562015-11-29 22:10:52 -08002000 VkDeviceMemory memory
2001 VkDeviceSize memoryOffset /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002002 VkSparseMemoryBindFlags flags
2003}
2004
Jesse Halla6429252015-11-29 18:59:42 -08002005class VkSparseBufferMemoryBindInfo {
2006 VkBuffer buffer
2007 u32 bindCount
2008 const VkSparseMemoryBind* pBinds
2009}
2010
2011class VkSparseImageOpaqueMemoryBindInfo {
2012 VkImage image
2013 u32 bindCount
2014 const VkSparseMemoryBind* pBinds
2015}
2016
2017class VkSparseImageMemoryBindInfo {
2018 VkImage image
2019 u32 bindCount
2020 const VkSparseMemoryBind* pBinds
2021}
2022
2023class VkBindSparseInfo {
2024 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BIND_SPARSE_INFO
2025 const void* pNext
2026 u32 waitSemaphoreCount
2027 const VkSemaphore* pWaitSemaphores
2028 u32 numBufferBinds
2029 const VkSparseBufferMemoryBindInfo* pBufferBinds
2030 u32 numImageOpaqueBinds
2031 const VkSparseImageOpaqueMemoryBindInfo* pImageOpaqueBinds
2032 u32 numImageBinds
2033 const VkSparseImageMemoryBindInfo* pImageBinds
2034 u32 signalSemaphoreCount
2035 const VkSemaphore* pSignalSemaphores
2036}
2037
Jesse Hall65ab5522015-11-30 00:07:16 -08002038class VkImageSubresourceLayers {
2039 VkImageAspectFlags aspectMask
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002040 u32 mipLevel
Jesse Halla15a4bf2015-11-19 22:48:02 -08002041 u32 baseArrayLayer
Jesse Hall3fbc8562015-11-29 22:10:52 -08002042 u32 layerCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002043}
2044
Jesse Halld27f6aa2015-08-15 17:58:48 -07002045class VkImageCopy {
Jesse Hall65ab5522015-11-30 00:07:16 -08002046 VkImageSubresourceLayers srcSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07002047 VkOffset3D srcOffset /// Specified in pixels for both compressed and uncompressed images
Jesse Hall65ab5522015-11-30 00:07:16 -08002048 VkImageSubresourceLayers dstSubresource
Jesse Hall3fbc8562015-11-29 22:10:52 -08002049 VkOffset3D dstOffset /// Specified in pixels for both compressed and uncompressed images
Jesse Halld27f6aa2015-08-15 17:58:48 -07002050 VkExtent3D extent /// Specified in pixels for both compressed and uncompressed images
2051}
2052
2053class VkImageBlit {
Jesse Hall65ab5522015-11-30 00:07:16 -08002054 VkImageSubresourceLayers srcSubresource
Jesse Hall3dd678a2016-01-08 21:52:01 -08002055 VkOffset3D[2] srcOffsets
Jesse Hall65ab5522015-11-30 00:07:16 -08002056 VkImageSubresourceLayers dstSubresource
Jesse Hall3dd678a2016-01-08 21:52:01 -08002057 VkOffset3D[2] dstOffsets
Jesse Halld27f6aa2015-08-15 17:58:48 -07002058}
2059
2060class VkBufferImageCopy {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002061 VkDeviceSize bufferOffset /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002062 u32 bufferRowLength /// Specified in texels
2063 u32 bufferImageHeight
Jesse Hall65ab5522015-11-30 00:07:16 -08002064 VkImageSubresourceLayers imageSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07002065 VkOffset3D imageOffset /// Specified in pixels for both compressed and uncompressed images
2066 VkExtent3D imageExtent /// Specified in pixels for both compressed and uncompressed images
2067}
2068
2069class VkImageResolve {
Jesse Hall65ab5522015-11-30 00:07:16 -08002070 VkImageSubresourceLayers srcSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07002071 VkOffset3D srcOffset
Jesse Hall65ab5522015-11-30 00:07:16 -08002072 VkImageSubresourceLayers dstSubresource
Jesse Hall3fbc8562015-11-29 22:10:52 -08002073 VkOffset3D dstOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07002074 VkExtent3D extent
2075}
2076
2077class VkShaderModuleCreateInfo {
2078 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO
2079 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002080 VkShaderModuleCreateFlags flags /// Reserved
Jesse Halld27f6aa2015-08-15 17:58:48 -07002081 platform.size_t codeSize /// Specified in bytes
Jesse Halla9bb62b2015-11-21 19:31:56 -08002082 const u32* pCode /// Binary code of size codeSize
Jesse Halld27f6aa2015-08-15 17:58:48 -07002083}
2084
Jesse Halld27f6aa2015-08-15 17:58:48 -07002085class VkDescriptorSetLayoutBinding {
Jesse Hall091ed9e2015-11-30 00:55:29 -08002086 u32 binding
Jesse Halld27f6aa2015-08-15 17:58:48 -07002087 VkDescriptorType descriptorType /// Type of the descriptors in this binding
Jesse Halldba27f72015-11-30 14:25:46 -08002088 u32 descriptorCount /// Number of descriptors in this binding
Jesse Halld27f6aa2015-08-15 17:58:48 -07002089 VkShaderStageFlags stageFlags /// Shader stages this binding is visible to
2090 const VkSampler* pImmutableSamplers /// Immutable samplers (used if descriptor type is SAMPLER or COMBINED_IMAGE_SAMPLER, is either NULL or contains <count> number of elements)
2091}
2092
2093class VkDescriptorSetLayoutCreateInfo {
2094 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO
2095 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002096 VkDescriptorSetLayoutCreateFlags flags
Jesse Hall03b6fe12015-11-24 12:44:21 -08002097 u32 bindingCount /// Number of bindings in the descriptor set layout
Jesse Hall543a7ff2016-01-08 16:38:30 -08002098 const VkDescriptorSetLayoutBinding* pBindings /// Array of descriptor set layout bindings
Jesse Halld27f6aa2015-08-15 17:58:48 -07002099}
2100
Jesse Hall65ab5522015-11-30 00:07:16 -08002101class VkDescriptorPoolSize {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002102 VkDescriptorType type
Jesse Hall03b6fe12015-11-24 12:44:21 -08002103 u32 descriptorCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002104}
2105
2106class VkDescriptorPoolCreateInfo {
2107 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO
2108 const void* pNext /// Pointer to next structure
Jesse Hallfbf97b02015-11-20 14:17:03 -08002109 VkDescriptorPoolCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002110 u32 maxSets
Jesse Hall65ab5522015-11-30 00:07:16 -08002111 u32 poolSizeCount
2112 const VkDescriptorPoolSize* pPoolSizes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002113}
2114
Jesse Hall3fbc8562015-11-29 22:10:52 -08002115class VkDescriptorSetAllocateInfo {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002116 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO
Jesse Hallfbf97b02015-11-20 14:17:03 -08002117 const void* pNext /// Pointer to next structure
2118 VkDescriptorPool descriptorPool
Jesse Hall03b6fe12015-11-24 12:44:21 -08002119 u32 setCount
Jesse Hallfbf97b02015-11-20 14:17:03 -08002120 const VkDescriptorSetLayout* pSetLayouts
2121}
2122
Jesse Halld27f6aa2015-08-15 17:58:48 -07002123class VkSpecializationMapEntry {
Jesse Hall65ab5522015-11-30 00:07:16 -08002124 u32 constantID /// The SpecConstant ID specified in the BIL
Jesse Halld27f6aa2015-08-15 17:58:48 -07002125 u32 offset /// Offset of the value in the data block
Jesse Hallb00daad2015-11-29 19:46:20 -08002126 platform.size_t size /// Size in bytes of the SpecConstant
Jesse Halld27f6aa2015-08-15 17:58:48 -07002127}
2128
2129class VkSpecializationInfo {
2130 u32 mapEntryCount /// Number of entries in the map
Jesse Hallb00daad2015-11-29 19:46:20 -08002131 const VkSpecializationMapEntry* pMapEntries /// Array of map entries
Jesse Halld27f6aa2015-08-15 17:58:48 -07002132 platform.size_t dataSize /// Size in bytes of pData
2133 const void* pData /// Pointer to SpecConstant data
2134}
2135
2136class VkPipelineShaderStageCreateInfo {
2137 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO
2138 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002139 VkPipelineShaderStageCreateFlags flags
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002140 VkShaderStageFlagBits stage
2141 VkShaderModule module
2142 const char* pName
Jesse Halld27f6aa2015-08-15 17:58:48 -07002143 const VkSpecializationInfo* pSpecializationInfo
2144}
2145
2146class VkComputePipelineCreateInfo {
2147 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO
2148 const void* pNext /// Pointer to next structure
Jesse Halld27f6aa2015-08-15 17:58:48 -07002149 VkPipelineCreateFlags flags /// Pipeline creation flags
Jesse Halla6429252015-11-29 18:59:42 -08002150 VkPipelineShaderStageCreateInfo stage
Jesse Halld27f6aa2015-08-15 17:58:48 -07002151 VkPipelineLayout layout /// Interface layout of the pipeline
2152 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
2153 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
2154}
2155
2156class VkVertexInputBindingDescription {
Jesse Hallb00daad2015-11-29 19:46:20 -08002157 u32 binding /// Vertex buffer binding id
2158 u32 stride /// Distance between vertices in bytes (0 = no advancement)
Jesse Hall65ab5522015-11-30 00:07:16 -08002159 VkVertexInputRate inputRate /// Rate at which binding is incremented
Jesse Halld27f6aa2015-08-15 17:58:48 -07002160}
2161
2162class VkVertexInputAttributeDescription {
Jesse Hallb00daad2015-11-29 19:46:20 -08002163 u32 location /// location of the shader vertex attrib
2164 u32 binding /// Vertex buffer binding id
2165 VkFormat format /// format of source data
2166 u32 offset /// Offset of first element in bytes from base of vertex
Jesse Halld27f6aa2015-08-15 17:58:48 -07002167}
2168
2169class VkPipelineVertexInputStateCreateInfo {
Jesse Hall03b6fe12015-11-24 12:44:21 -08002170 VkStructureType sType /// Should be VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO
2171 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002172 VkPipelineVertexInputStateCreateFlags flags
Jesse Hall03b6fe12015-11-24 12:44:21 -08002173 u32 vertexBindingDescriptionCount /// number of bindings
Jesse Halld27f6aa2015-08-15 17:58:48 -07002174 const VkVertexInputBindingDescription* pVertexBindingDescriptions
Jesse Hall03b6fe12015-11-24 12:44:21 -08002175 u32 vertexAttributeDescriptionCount /// number of attributes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002176 const VkVertexInputAttributeDescription* pVertexAttributeDescriptions
2177}
2178
2179class VkPipelineInputAssemblyStateCreateInfo {
2180 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO
2181 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002182 VkPipelineInputAssemblyStateCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002183 VkPrimitiveTopology topology
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002184 VkBool32 primitiveRestartEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002185}
2186
2187class VkPipelineTessellationStateCreateInfo {
2188 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO
2189 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002190 VkPipelineTessellationStateCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002191 u32 patchControlPoints
2192}
2193
2194class VkPipelineViewportStateCreateInfo {
2195 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO
2196 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002197 VkPipelineViewportStateCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002198 u32 viewportCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002199 const VkViewport* pViewports
2200 u32 scissorCount
2201 const VkRect2D* pScissors
Jesse Halld27f6aa2015-08-15 17:58:48 -07002202}
2203
Jesse Hall3fbc8562015-11-29 22:10:52 -08002204class VkPipelineRasterizationStateCreateInfo {
Jesse Hall65ab5522015-11-30 00:07:16 -08002205 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002206 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08002207 VkPipelineRasterizationStateCreateFlags flags
Jesse Hallae38f732015-11-19 21:32:50 -08002208 VkBool32 depthClampEnable
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002209 VkBool32 rasterizerDiscardEnable
Jesse Hall65ab5522015-11-30 00:07:16 -08002210 VkPolygonMode polygonMode /// optional (GL45)
Jesse Hallc7467b72015-11-29 21:05:26 -08002211 VkCullModeFlags cullMode
Jesse Halld27f6aa2015-08-15 17:58:48 -07002212 VkFrontFace frontFace
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002213 VkBool32 depthBiasEnable
Jesse Halla9bb62b2015-11-21 19:31:56 -08002214 f32 depthBiasConstantFactor
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002215 f32 depthBiasClamp
Jesse Halla9bb62b2015-11-21 19:31:56 -08002216 f32 depthBiasSlopeFactor
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002217 f32 lineWidth
Jesse Halld27f6aa2015-08-15 17:58:48 -07002218}
2219
2220class VkPipelineMultisampleStateCreateInfo {
2221 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO
2222 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002223 VkPipelineMultisampleStateCreateFlags flags
Jesse Hall091ed9e2015-11-30 00:55:29 -08002224 VkSampleCountFlagBits rasterizationSamples /// Number of samples used for rasterization
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002225 VkBool32 sampleShadingEnable /// optional (GL45)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002226 f32 minSampleShading /// optional (GL45)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002227 const VkSampleMask* pSampleMask
Jesse Hallacfa5342015-11-19 21:51:33 -08002228 VkBool32 alphaToCoverageEnable
2229 VkBool32 alphaToOneEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002230}
2231
2232class VkPipelineColorBlendAttachmentState {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002233 VkBool32 blendEnable
Jesse Hall65ab5522015-11-30 00:07:16 -08002234 VkBlendFactor srcColorBlendFactor
2235 VkBlendFactor dstColorBlendFactor
2236 VkBlendOp colorBlendOp
2237 VkBlendFactor srcAlphaBlendFactor
2238 VkBlendFactor dstAlphaBlendFactor
2239 VkBlendOp alphaBlendOp
2240 VkColorComponentFlags colorWriteMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07002241}
2242
2243class VkPipelineColorBlendStateCreateInfo {
2244 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO
2245 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002246 VkPipelineColorBlendStateCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002247 VkBool32 logicOpEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002248 VkLogicOp logicOp
2249 u32 attachmentCount /// # of pAttachments
2250 const VkPipelineColorBlendAttachmentState* pAttachments
Jesse Hallb00daad2015-11-29 19:46:20 -08002251 f32[4] blendConstants
Jesse Halld27f6aa2015-08-15 17:58:48 -07002252}
2253
2254class VkStencilOpState {
Jesse Hall65ab5522015-11-30 00:07:16 -08002255 VkStencilOp failOp
2256 VkStencilOp passOp
2257 VkStencilOp depthFailOp
2258 VkCompareOp compareOp
2259 u32 compareMask
2260 u32 writeMask
2261 u32 reference
Jesse Halld27f6aa2015-08-15 17:58:48 -07002262}
2263
2264class VkPipelineDepthStencilStateCreateInfo {
2265 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO
2266 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002267 VkPipelineDepthStencilStateCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002268 VkBool32 depthTestEnable
2269 VkBool32 depthWriteEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002270 VkCompareOp depthCompareOp
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002271 VkBool32 depthBoundsTestEnable /// optional (depth_bounds_test)
2272 VkBool32 stencilTestEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002273 VkStencilOpState front
2274 VkStencilOpState back
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002275 f32 minDepthBounds
2276 f32 maxDepthBounds
2277}
2278
2279class VkPipelineDynamicStateCreateInfo {
2280 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO
2281 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002282 VkPipelineDynamicStateCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002283 u32 dynamicStateCount
2284 const VkDynamicState* pDynamicStates
Jesse Halld27f6aa2015-08-15 17:58:48 -07002285}
2286
2287class VkGraphicsPipelineCreateInfo {
Jesse Halla6429252015-11-29 18:59:42 -08002288 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO
2289 const void* pNext /// Pointer to next structure
2290 VkPipelineCreateFlags flags /// Pipeline creation flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002291 u32 stageCount
Jesse Halla6429252015-11-29 18:59:42 -08002292 const VkPipelineShaderStageCreateInfo* pStages /// One entry for each active shader stage
Jesse Halld27f6aa2015-08-15 17:58:48 -07002293 const VkPipelineVertexInputStateCreateInfo* pVertexInputState
2294 const VkPipelineInputAssemblyStateCreateInfo* pInputAssemblyState
2295 const VkPipelineTessellationStateCreateInfo* pTessellationState
2296 const VkPipelineViewportStateCreateInfo* pViewportState
Jesse Hall3fbc8562015-11-29 22:10:52 -08002297 const VkPipelineRasterizationStateCreateInfo* pRasterizationState
Jesse Halld27f6aa2015-08-15 17:58:48 -07002298 const VkPipelineMultisampleStateCreateInfo* pMultisampleState
2299 const VkPipelineDepthStencilStateCreateInfo* pDepthStencilState
2300 const VkPipelineColorBlendStateCreateInfo* pColorBlendState
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002301 const VkPipelineDynamicStateCreateInfo* pDynamicState
Jesse Halla6429252015-11-29 18:59:42 -08002302 VkPipelineLayout layout /// Interface layout of the pipeline
Jesse Halld27f6aa2015-08-15 17:58:48 -07002303 VkRenderPass renderPass
2304 u32 subpass
Jesse Halla6429252015-11-29 18:59:42 -08002305 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
2306 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 -07002307}
2308
2309class VkPipelineCacheCreateInfo {
Jesse Hallb00daad2015-11-29 19:46:20 -08002310 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO
2311 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002312 VkPipelineCacheCreateFlags flags
Jesse Hallb00daad2015-11-29 19:46:20 -08002313 platform.size_t initialDataSize /// Size of initial data to populate cache, in bytes
2314 const void* pInitialData /// Initial data to populate cache
Jesse Halld27f6aa2015-08-15 17:58:48 -07002315}
2316
2317class VkPushConstantRange {
2318 VkShaderStageFlags stageFlags /// Which stages use the range
Jesse Hall03b6fe12015-11-24 12:44:21 -08002319 u32 offset /// Start of the range, in bytes
2320 u32 size /// Length of the range, in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002321}
2322
2323class VkPipelineLayoutCreateInfo {
2324 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO
2325 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002326 VkPipelineLayoutCreateFlags flags
Jesse Hall3dd678a2016-01-08 21:52:01 -08002327 u32 descriptorSetCount /// Number of descriptor sets interfaced by the pipeline
Jesse Halld27f6aa2015-08-15 17:58:48 -07002328 const VkDescriptorSetLayout* pSetLayouts /// Array of <setCount> number of descriptor set layout objects defining the layout of the
2329 u32 pushConstantRangeCount /// Number of push-constant ranges used by the pipeline
2330 const VkPushConstantRange* pPushConstantRanges /// Array of pushConstantRangeCount number of ranges used by various shader stages
2331}
2332
2333class VkSamplerCreateInfo {
2334 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO
2335 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002336 VkSamplerCreateFlags flags
Jesse Hall23ff73f2015-11-29 14:36:39 -08002337 VkFilter magFilter /// Filter mode for magnification
2338 VkFilter minFilter /// Filter mode for minifiation
2339 VkSamplerMipmapMode mipmapMode /// Mipmap selection mode
2340 VkSamplerAddressMode addressModeU
2341 VkSamplerAddressMode addressModeV
2342 VkSamplerAddressMode addressModeW
Jesse Halld27f6aa2015-08-15 17:58:48 -07002343 f32 mipLodBias
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002344 VkBool32 anisotropyEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002345 f32 maxAnisotropy
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002346 VkBool32 compareEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002347 VkCompareOp compareOp
2348 f32 minLod
2349 f32 maxLod
2350 VkBorderColor borderColor
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002351 VkBool32 unnormalizedCoordinates
Jesse Halld27f6aa2015-08-15 17:58:48 -07002352}
2353
Jesse Hall3fbc8562015-11-29 22:10:52 -08002354class VkCommandPoolCreateInfo {
2355 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002356 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08002357 VkCommandPoolCreateFlags flags /// Command pool creation flags
Jesse Halla6429252015-11-29 18:59:42 -08002358 u32 queueFamilyIndex
Jesse Halld27f6aa2015-08-15 17:58:48 -07002359}
2360
Jesse Hall3fbc8562015-11-29 22:10:52 -08002361class VkCommandBufferAllocateInfo {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002362 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002363 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08002364 VkCommandPool commandPool
2365 VkCommandBufferLevel level
Jesse Hall3dd678a2016-01-08 21:52:01 -08002366 u32 commandBufferCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002367}
2368
Jesse Hall3dd678a2016-01-08 21:52:01 -08002369class VkCommandBufferInheritanceInfo {
2370 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002371 const void* pNext /// Pointer to next structure
Jesse Halld27f6aa2015-08-15 17:58:48 -07002372 VkRenderPass renderPass /// Render pass for secondary command buffers
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002373 u32 subpass
Jesse Halld27f6aa2015-08-15 17:58:48 -07002374 VkFramebuffer framebuffer /// Framebuffer for secondary command buffers
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002375 VkBool32 occlusionQueryEnable
2376 VkQueryControlFlags queryFlags
2377 VkQueryPipelineStatisticFlags pipelineStatistics
Jesse Halld27f6aa2015-08-15 17:58:48 -07002378}
2379
Jesse Hall3dd678a2016-01-08 21:52:01 -08002380class VkCommandBufferBeginInfo {
2381 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO
2382 const void* pNext /// Pointer to next structure
2383 VkCommandBufferUsageFlags flags /// Command buffer usage flags
2384 const VkCommandBufferInheritanceInfo* pInheritanceInfo
2385}
2386
Jesse Halld27f6aa2015-08-15 17:58:48 -07002387class VkRenderPassBeginInfo {
2388 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO
2389 const void* pNext /// Pointer to next structure
2390 VkRenderPass renderPass
2391 VkFramebuffer framebuffer
2392 VkRect2D renderArea
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002393 u32 clearValueCount
2394 const VkClearValue* pClearValues
Jesse Halld27f6aa2015-08-15 17:58:48 -07002395}
2396
2397@union
2398/// Union allowing specification of floating point, integer, or unsigned integer color data. Actual value selected is based on image/attachment being cleared.
2399class VkClearColorValue {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002400 f32[4] float32
2401 s32[4] int32
2402 u32[4] uint32
Jesse Halld27f6aa2015-08-15 17:58:48 -07002403}
2404
2405class VkClearDepthStencilValue {
2406 f32 depth
2407 u32 stencil
2408}
2409
2410@union
2411/// Union allowing specification of color, depth, and stencil color values. Actual value selected is based on attachment being cleared.
2412class VkClearValue {
2413 VkClearColorValue color
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002414 VkClearDepthStencilValue depthStencil
Jesse Halld27f6aa2015-08-15 17:58:48 -07002415}
2416
Jesse Hallae38f732015-11-19 21:32:50 -08002417class VkClearAttachment {
2418 VkImageAspectFlags aspectMask
2419 u32 colorAttachment
2420 VkClearValue clearValue
2421}
2422
Jesse Halld27f6aa2015-08-15 17:58:48 -07002423class VkAttachmentDescription {
Jesse Halla6429252015-11-29 18:59:42 -08002424 VkAttachmentDescriptionFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002425 VkFormat format
Jesse Hall091ed9e2015-11-30 00:55:29 -08002426 VkSampleCountFlagBits samples
Jesse Halld27f6aa2015-08-15 17:58:48 -07002427 VkAttachmentLoadOp loadOp /// Load op for color or depth data
2428 VkAttachmentStoreOp storeOp /// Store op for color or depth data
2429 VkAttachmentLoadOp stencilLoadOp /// Load op for stencil data
2430 VkAttachmentStoreOp stencilStoreOp /// Store op for stencil data
2431 VkImageLayout initialLayout
2432 VkImageLayout finalLayout
2433}
2434
2435class VkAttachmentReference {
2436 u32 attachment
2437 VkImageLayout layout
2438}
2439
2440class VkSubpassDescription {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002441 VkSubpassDescriptionFlags flags
Jesse Halla6429252015-11-29 18:59:42 -08002442 VkPipelineBindPoint pipelineBindPoint /// Must be VK_PIPELINE_BIND_POINT_GRAPHICS for now
Jesse Hall03b6fe12015-11-24 12:44:21 -08002443 u32 inputAttachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002444 const VkAttachmentReference* pInputAttachments
Jesse Hall03b6fe12015-11-24 12:44:21 -08002445 u32 colorAttachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002446 const VkAttachmentReference* pColorAttachments
2447 const VkAttachmentReference* pResolveAttachments
Jesse Hallc7467b72015-11-29 21:05:26 -08002448 const VkAttachmentReference* pDepthStencilAttachment
Jesse Hall03b6fe12015-11-24 12:44:21 -08002449 u32 preserveAttachmentCount
Jesse Hall3dd678a2016-01-08 21:52:01 -08002450 const u32* pPreserveAttachments
Jesse Halld27f6aa2015-08-15 17:58:48 -07002451}
2452
2453class VkSubpassDependency {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002454 u32 srcSubpass
Jesse Hall3fbc8562015-11-29 22:10:52 -08002455 u32 dstSubpass
Jesse Halld27f6aa2015-08-15 17:58:48 -07002456 VkPipelineStageFlags srcStageMask
Jesse Hall3fbc8562015-11-29 22:10:52 -08002457 VkPipelineStageFlags dstStageMask
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002458 VkAccessFlags srcAccessMask
2459 VkAccessFlags dstAccessMask
Jesse Halldc6d36c2015-11-29 19:12:15 -08002460 VkDependencyFlags dependencyFlags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002461}
2462
2463class VkRenderPassCreateInfo {
2464 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO
2465 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002466 VkRenderPassCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002467 u32 attachmentCount
2468 const VkAttachmentDescription* pAttachments
2469 u32 subpassCount
2470 const VkSubpassDescription* pSubpasses
2471 u32 dependencyCount
2472 const VkSubpassDependency* pDependencies
2473}
2474
2475class VkEventCreateInfo {
2476 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_EVENT_CREATE_INFO
2477 const void* pNext /// Pointer to next structure
2478 VkEventCreateFlags flags /// Event creation flags
2479}
2480
2481class VkFenceCreateInfo {
2482 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_FENCE_CREATE_INFO
2483 const void* pNext /// Pointer to next structure
2484 VkFenceCreateFlags flags /// Fence creation flags
2485}
2486
2487class VkPhysicalDeviceFeatures {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002488 VkBool32 robustBufferAccess /// out of bounds buffer accesses are well defined
2489 VkBool32 fullDrawIndexUint32 /// full 32-bit range of indices for indexed draw calls
2490 VkBool32 imageCubeArray /// image views which are arrays of cube maps
2491 VkBool32 independentBlend /// blending operations are controlled per-attachment
2492 VkBool32 geometryShader /// geometry stage
2493 VkBool32 tessellationShader /// tessellation control and evaluation stage
2494 VkBool32 sampleRateShading /// per-sample shading and interpolation
Jesse Hall3fbc8562015-11-29 22:10:52 -08002495 VkBool32 dualSrcBlend /// blend operations which take two sources
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002496 VkBool32 logicOp /// logic operations
2497 VkBool32 multiDrawIndirect /// multi draw indirect
Jesse Hall543a7ff2016-01-08 16:38:30 -08002498 VkBool32 drawIndirectFirstInstance
Jesse Hallae38f732015-11-19 21:32:50 -08002499 VkBool32 depthClamp /// depth clamping
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002500 VkBool32 depthBiasClamp /// depth bias clamping
2501 VkBool32 fillModeNonSolid /// point and wireframe fill modes
2502 VkBool32 depthBounds /// depth bounds test
2503 VkBool32 wideLines /// lines with width greater than 1
2504 VkBool32 largePoints /// points with size greater than 1
Jesse Hallfbf97b02015-11-20 14:17:03 -08002505 VkBool32 alphaToOne /// The fragment alpha channel can be forced to maximum representable alpha value
2506 VkBool32 multiViewport
2507 VkBool32 samplerAnisotropy
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002508 VkBool32 textureCompressionETC2 /// ETC texture compression formats
2509 VkBool32 textureCompressionASTC_LDR /// ASTC LDR texture compression formats
2510 VkBool32 textureCompressionBC /// BC1-7 texture compressed formats
Jesse Hall65ab5522015-11-30 00:07:16 -08002511 VkBool32 occlusionQueryPrecise
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002512 VkBool32 pipelineStatisticsQuery /// pipeline statistics query
Jesse Halldc6d36c2015-11-29 19:12:15 -08002513 VkBool32 vertexPipelineStoresAndAtomics
2514 VkBool32 fragmentStoresAndAtomics
2515 VkBool32 shaderTessellationAndGeometryPointSize
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002516 VkBool32 shaderImageGatherExtended /// texture gather with run-time values and independent offsets
2517 VkBool32 shaderStorageImageExtendedFormats /// the extended set of formats can be used for storage images
2518 VkBool32 shaderStorageImageMultisample /// multisample images can be used for storage images
Jesse Halld1af8122015-11-29 23:50:38 -08002519 VkBool32 shaderStorageImageReadWithoutFormat
2520 VkBool32 shaderStorageImageWriteWithoutFormat
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002521 VkBool32 shaderUniformBufferArrayDynamicIndexing /// arrays of uniform buffers can be accessed with dynamically uniform indices
2522 VkBool32 shaderSampledImageArrayDynamicIndexing /// arrays of sampled images can be accessed with dynamically uniform indices
2523 VkBool32 shaderStorageBufferArrayDynamicIndexing /// arrays of storage buffers can be accessed with dynamically uniform indices
2524 VkBool32 shaderStorageImageArrayDynamicIndexing /// arrays of storage images can be accessed with dynamically uniform indices
2525 VkBool32 shaderClipDistance /// clip distance in shaders
2526 VkBool32 shaderCullDistance /// cull distance in shaders
2527 VkBool32 shaderFloat64 /// 64-bit floats (doubles) in shaders
2528 VkBool32 shaderInt64 /// 64-bit integers in shaders
2529 VkBool32 shaderInt16 /// 16-bit integers in shaders
2530 VkBool32 shaderResourceResidency /// shader can use texture operations that return resource residency information (requires sparseNonResident support)
Jesse Hall65ab5522015-11-30 00:07:16 -08002531 VkBool32 shaderResourceMinLod /// shader can use texture operations that specify minimum resource LOD
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002532 VkBool32 sparseBinding /// Sparse resources support: Resource memory can be managed at opaque page level rather than object level
2533 VkBool32 sparseResidencyBuffer /// Sparse resources support: GPU can access partially resident buffers
2534 VkBool32 sparseResidencyImage2D /// Sparse resources support: GPU can access partially resident 2D (non-MSAA non-DepthStencil) images
2535 VkBool32 sparseResidencyImage3D /// Sparse resources support: GPU can access partially resident 3D images
2536 VkBool32 sparseResidency2Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 2 samples
2537 VkBool32 sparseResidency4Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 4 samples
2538 VkBool32 sparseResidency8Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 8 samples
2539 VkBool32 sparseResidency16Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 16 samples
2540 VkBool32 sparseResidencyAliased /// Sparse resources support: GPU can correctly access data aliased into multiple locations (opt-in)
Jesse Halld1af8122015-11-29 23:50:38 -08002541 VkBool32 variableMultisampleRate
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002542 VkBool32 inheritedQueries
Jesse Halld27f6aa2015-08-15 17:58:48 -07002543}
2544
2545class VkPhysicalDeviceLimits {
2546 /// resource maximum sizes
2547 u32 maxImageDimension1D /// max 1D image dimension
2548 u32 maxImageDimension2D /// max 2D image dimension
2549 u32 maxImageDimension3D /// max 3D image dimension
2550 u32 maxImageDimensionCube /// max cubemap image dimension
2551 u32 maxImageArrayLayers /// max layers for image arrays
Jesse Hallb00daad2015-11-29 19:46:20 -08002552 u32 maxTexelBufferElements
Jesse Hallfbf97b02015-11-20 14:17:03 -08002553 u32 maxUniformBufferRange /// max uniform buffer size (bytes)
2554 u32 maxStorageBufferRange /// max storage buffer size (bytes)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002555 u32 maxPushConstantsSize /// max size of the push constants pool (bytes)
2556 /// memory limits
2557 u32 maxMemoryAllocationCount /// max number of device memory allocations supported
Jesse Hall091ed9e2015-11-30 00:55:29 -08002558 u32 maxSamplerAllocationCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002559 VkDeviceSize bufferImageGranularity /// Granularity (in bytes) at which buffers and images can be bound to adjacent memory for simultaneous usage
2560 VkDeviceSize sparseAddressSpaceSize /// Total address space available for sparse allocations (bytes)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002561 /// descriptor set limits
2562 u32 maxBoundDescriptorSets /// max number of descriptors sets that can be bound to a pipeline
Jesse Halld27f6aa2015-08-15 17:58:48 -07002563 u32 maxPerStageDescriptorSamplers /// max num of samplers allowed per-stage in a descriptor set
2564 u32 maxPerStageDescriptorUniformBuffers /// max num of uniform buffers allowed per-stage in a descriptor set
2565 u32 maxPerStageDescriptorStorageBuffers /// max num of storage buffers allowed per-stage in a descriptor set
2566 u32 maxPerStageDescriptorSampledImages /// max num of sampled images allowed per-stage in a descriptor set
2567 u32 maxPerStageDescriptorStorageImages /// max num of storage images allowed per-stage in a descriptor set
Jesse Halle1b12782015-11-30 11:27:32 -08002568 u32 maxPerStageDescriptorInputAttachments
Jesse Halldba27f72015-11-30 14:25:46 -08002569 u32 maxPerStageResources
Jesse Halld27f6aa2015-08-15 17:58:48 -07002570 u32 maxDescriptorSetSamplers /// max num of samplers allowed in all stages in a descriptor set
2571 u32 maxDescriptorSetUniformBuffers /// max num of uniform buffers allowed in all stages in a descriptor set
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002572 u32 maxDescriptorSetUniformBuffersDynamic /// max num of dynamic uniform buffers allowed in all stages in a descriptor set
Jesse Halld27f6aa2015-08-15 17:58:48 -07002573 u32 maxDescriptorSetStorageBuffers /// max num of storage buffers allowed in all stages in a descriptor set
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002574 u32 maxDescriptorSetStorageBuffersDynamic /// max num of dynamic storage buffers allowed in all stages in a descriptor set
Jesse Halld27f6aa2015-08-15 17:58:48 -07002575 u32 maxDescriptorSetSampledImages /// max num of sampled images allowed in all stages in a descriptor set
2576 u32 maxDescriptorSetStorageImages /// max num of storage images allowed in all stages in a descriptor set
Jesse Halle1b12782015-11-30 11:27:32 -08002577 u32 maxDescriptorSetInputAttachments
Jesse Halld27f6aa2015-08-15 17:58:48 -07002578 /// vertex stage limits
2579 u32 maxVertexInputAttributes /// max num of vertex input attribute slots
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002580 u32 maxVertexInputBindings /// max num of vertex input binding slots
Jesse Halld27f6aa2015-08-15 17:58:48 -07002581 u32 maxVertexInputAttributeOffset /// max vertex input attribute offset added to vertex buffer offset
2582 u32 maxVertexInputBindingStride /// max vertex input binding stride
2583 u32 maxVertexOutputComponents /// max num of output components written by vertex shader
2584 /// tessellation control stage limits
Jesse Hall3fbc8562015-11-29 22:10:52 -08002585 u32 maxTessellationGenerationLevel /// max level supported by tess primitive generator
Jesse Hallae38f732015-11-19 21:32:50 -08002586 u32 maxTessellationPatchSize /// max patch size (vertices)
2587 u32 maxTessellationControlPerVertexInputComponents /// max num of input components per-vertex in TCS
2588 u32 maxTessellationControlPerVertexOutputComponents /// max num of output components per-vertex in TCS
2589 u32 maxTessellationControlPerPatchOutputComponents /// max num of output components per-patch in TCS
2590 u32 maxTessellationControlTotalOutputComponents /// max total num of per-vertex and per-patch output components in TCS
2591 u32 maxTessellationEvaluationInputComponents /// max num of input components per vertex in TES
2592 u32 maxTessellationEvaluationOutputComponents /// max num of output components per vertex in TES
Jesse Halld27f6aa2015-08-15 17:58:48 -07002593 /// geometry stage limits
2594 u32 maxGeometryShaderInvocations /// max invocation count supported in geometry shader
2595 u32 maxGeometryInputComponents /// max num of input components read in geometry stage
2596 u32 maxGeometryOutputComponents /// max num of output components written in geometry stage
2597 u32 maxGeometryOutputVertices /// max num of vertices that can be emitted in geometry stage
2598 u32 maxGeometryTotalOutputComponents /// max total num of components (all vertices) written in geometry stage
2599 /// fragment stage limits
2600 u32 maxFragmentInputComponents /// max num of input compontents read in fragment stage
Jesse Hallfbf97b02015-11-20 14:17:03 -08002601 u32 maxFragmentOutputAttachments /// max num of output attachments written in fragment stage
Jesse Hall3fbc8562015-11-29 22:10:52 -08002602 u32 maxFragmentDualSrcAttachments /// max num of output attachments written when using dual source blending
Jesse Halld27f6aa2015-08-15 17:58:48 -07002603 u32 maxFragmentCombinedOutputResources /// max total num of storage buffers, storage images and output buffers
2604 /// compute stage limits
2605 u32 maxComputeSharedMemorySize /// max total storage size of work group local storage (bytes)
2606 u32[3] maxComputeWorkGroupCount /// max num of compute work groups that may be dispatched by a single command (x,y,z)
2607 u32 maxComputeWorkGroupInvocations /// max total compute invocations in a single local work group
2608 u32[3] maxComputeWorkGroupSize /// max local size of a compute work group (x,y,z)
2609
2610 u32 subPixelPrecisionBits /// num bits of subpixel precision in screen x and y
2611 u32 subTexelPrecisionBits /// num bits of subtexel precision
2612 u32 mipmapPrecisionBits /// num bits of mipmap precision
2613
2614 u32 maxDrawIndexedIndexValue /// max index value for indexed draw calls (for 32-bit indices)
Jesse Halldba27f72015-11-30 14:25:46 -08002615 u32 maxDrawIndirectCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002616
2617 f32 maxSamplerLodBias /// max absolute sampler level of detail bias
2618 f32 maxSamplerAnisotropy /// max degree of sampler anisotropy
2619
2620 u32 maxViewports /// max number of active viewports
Jesse Halld27f6aa2015-08-15 17:58:48 -07002621 u32[2] maxViewportDimensions /// max viewport dimensions (x,y)
2622 f32[2] viewportBoundsRange /// viewport bounds range (min,max)
2623 u32 viewportSubPixelBits /// num bits of subpixel precision for viewport
2624
Jesse Halldc6d36c2015-11-29 19:12:15 -08002625 platform.size_t minMemoryMapAlignment /// min required alignment of pointers returned by MapMemory (bytes)
2626 VkDeviceSize minTexelBufferOffsetAlignment /// min required alignment for texel buffer offsets (bytes)
2627 VkDeviceSize minUniformBufferOffsetAlignment /// min required alignment for uniform buffer sizes and offsets (bytes)
2628 VkDeviceSize minStorageBufferOffsetAlignment /// min required alignment for storage buffer offsets (bytes)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002629
Jesse Hallfbf97b02015-11-20 14:17:03 -08002630 s32 minTexelOffset /// min texel offset for OpTextureSampleOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07002631 u32 maxTexelOffset /// max texel offset for OpTextureSampleOffset
Jesse Hallfbf97b02015-11-20 14:17:03 -08002632 s32 minTexelGatherOffset /// min texel offset for OpTextureGatherOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07002633 u32 maxTexelGatherOffset /// max texel offset for OpTextureGatherOffset
2634 f32 minInterpolationOffset /// furthest negative offset for interpolateAtOffset
2635 f32 maxInterpolationOffset /// furthest positive offset for interpolateAtOffset
2636 u32 subPixelInterpolationOffsetBits /// num of subpixel bits for interpolateAtOffset
2637
2638 u32 maxFramebufferWidth /// max width for a framebuffer
2639 u32 maxFramebufferHeight /// max height for a framebuffer
2640 u32 maxFramebufferLayers /// max layer count for a layered framebuffer
Jesse Hall091ed9e2015-11-30 00:55:29 -08002641 VkSampleCountFlags framebufferColorSampleCounts
2642 VkSampleCountFlags framebufferDepthSampleCounts
2643 VkSampleCountFlags framebufferStencilSampleCounts
2644 VkSampleCountFlags framebufferNoAttachmentSampleCounts
Jesse Halld27f6aa2015-08-15 17:58:48 -07002645 u32 maxColorAttachments /// max num of framebuffer color attachments
2646
Jesse Hall091ed9e2015-11-30 00:55:29 -08002647 VkSampleCountFlags sampledImageColorSampleCounts
2648 VkSampleCountFlags sampledImageIntegerSampleCounts
2649 VkSampleCountFlags sampledImageDepthSampleCounts
2650 VkSampleCountFlags sampledImageStencilSampleCounts
2651 VkSampleCountFlags storageImageSampleCounts
Jesse Halld27f6aa2015-08-15 17:58:48 -07002652 u32 maxSampleMaskWords /// max num of sample mask words
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002653 VkBool32 timestampComputeAndGraphics
Jesse Halld27f6aa2015-08-15 17:58:48 -07002654
Jesse Halla9bb62b2015-11-21 19:31:56 -08002655 f32 timestampPeriod
Jesse Halld27f6aa2015-08-15 17:58:48 -07002656
2657 u32 maxClipDistances /// max number of clip distances
2658 u32 maxCullDistances /// max number of cull distances
2659 u32 maxCombinedClipAndCullDistances /// max combined number of user clipping
2660
Jesse Hallfbf97b02015-11-20 14:17:03 -08002661 u32 discreteQueuePriorities
2662
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002663 f32[2] pointSizeRange /// range (min,max) of supported point sizes
2664 f32[2] lineWidthRange /// range (min,max) of supported line widths
Jesse Halld27f6aa2015-08-15 17:58:48 -07002665 f32 pointSizeGranularity /// granularity of supported point sizes
2666 f32 lineWidthGranularity /// granularity of supported line widths
Jesse Hall03b6fe12015-11-24 12:44:21 -08002667 VkBool32 strictLines
Jesse Hall091ed9e2015-11-30 00:55:29 -08002668 VkBool32 standardSampleLocations
Jesse Halla9bb62b2015-11-21 19:31:56 -08002669
Jesse Hall65ab5522015-11-30 00:07:16 -08002670 VkDeviceSize optimalBufferCopyOffsetAlignment
2671 VkDeviceSize optimalBufferCopyRowPitchAlignment
Jesse Halldba27f72015-11-30 14:25:46 -08002672 VkDeviceSize nonCoherentAtomSize
Jesse Halld27f6aa2015-08-15 17:58:48 -07002673}
2674
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002675class VkPhysicalDeviceSparseProperties {
2676 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 -08002677 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 -07002678 VkBool32 residencyStandard3DBlockShape /// Sparse resources support: GPU will access all 3D sparse resources using the standard block shapes (based on pixel format)
2679 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 -07002680 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
2681}
2682
Jesse Halld27f6aa2015-08-15 17:58:48 -07002683class VkSemaphoreCreateInfo {
2684 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO
2685 const void* pNext /// Pointer to next structure
2686 VkSemaphoreCreateFlags flags /// Semaphore creation flags
2687}
2688
2689class VkQueryPoolCreateInfo {
2690 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO
2691 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002692 VkQueryPoolCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002693 VkQueryType queryType
Jesse Hall3dd678a2016-01-08 21:52:01 -08002694 u32 queryCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002695 VkQueryPipelineStatisticFlags pipelineStatistics /// Optional
2696}
2697
2698class VkFramebufferCreateInfo {
2699 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO
2700 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002701 VkFramebufferCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002702 VkRenderPass renderPass
2703 u32 attachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002704 const VkImageView* pAttachments
Jesse Halld27f6aa2015-08-15 17:58:48 -07002705 u32 width
2706 u32 height
2707 u32 layers
2708}
2709
Jesse Hall3fbc8562015-11-29 22:10:52 -08002710class VkDrawIndirectCommand {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002711 u32 vertexCount
2712 u32 instanceCount
2713 u32 firstVertex
2714 u32 firstInstance
2715}
2716
Jesse Hall3fbc8562015-11-29 22:10:52 -08002717class VkDrawIndexedIndirectCommand {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002718 u32 indexCount
2719 u32 instanceCount
2720 u32 firstIndex
2721 s32 vertexOffset
2722 u32 firstInstance
2723}
2724
Jesse Hall3fbc8562015-11-29 22:10:52 -08002725class VkDispatchIndirectCommand {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002726 u32 x
2727 u32 y
2728 u32 z
2729}
2730
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002731@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08002732class VkSurfaceCapabilitiesKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002733 u32 minImageCount
2734 u32 maxImageCount
2735 VkExtent2D currentExtent
2736 VkExtent2D minImageExtent
2737 VkExtent2D maxImageExtent
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002738 u32 maxImageArrayLayers
Jesse Hall1356b0d2015-11-23 17:24:58 -08002739 VkSurfaceTransformFlagsKHR supportedTransforms
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002740 VkSurfaceTransformFlagBitsKHR currentTransform
Jesse Halla6429252015-11-29 18:59:42 -08002741 VkCompositeAlphaFlagsKHR supportedCompositeAlpha
Jesse Hall1356b0d2015-11-23 17:24:58 -08002742 VkImageUsageFlags supportedUsageFlags
Michael Lentine88594d72015-11-12 12:49:45 -08002743}
2744
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002745@extension("VK_KHR_surface")
Michael Lentine88594d72015-11-12 12:49:45 -08002746class VkSurfaceFormatKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002747 VkFormat format
2748 VkColorSpaceKHR colorSpace
Michael Lentine88594d72015-11-12 12:49:45 -08002749}
2750
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002751@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08002752class VkSwapchainCreateInfoKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002753 VkStructureType sType
2754 const void* pNext
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002755 VkSwapchainCreateFlagsKHR flags
Jesse Hall1356b0d2015-11-23 17:24:58 -08002756 VkSurfaceKHR surface
2757 u32 minImageCount
2758 VkFormat imageFormat
2759 VkColorSpaceKHR imageColorSpace
2760 VkExtent2D imageExtent
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002761 u32 imageArrayLayers
2762 VkImageUsageFlags imageUsage
Jesse Hall1356b0d2015-11-23 17:24:58 -08002763 VkSharingMode sharingMode
Jesse Hall03b6fe12015-11-24 12:44:21 -08002764 u32 queueFamilyIndexCount
Jesse Hall1356b0d2015-11-23 17:24:58 -08002765 const u32* pQueueFamilyIndices
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002766 VkSurfaceTransformFlagBitsKHR preTransform
2767 VkCompositeAlphaFlagBitsKHR compositeAlpha
Jesse Hall1356b0d2015-11-23 17:24:58 -08002768 VkPresentModeKHR presentMode
Jesse Hall1356b0d2015-11-23 17:24:58 -08002769 VkBool32 clipped
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002770 VkSwapchainKHR oldSwapchain
Michael Lentine88594d72015-11-12 12:49:45 -08002771}
2772
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002773@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08002774class VkPresentInfoKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002775 VkStructureType sType
2776 const void* pNext
Jesse Hallb00daad2015-11-29 19:46:20 -08002777 u32 waitSemaphoreCount
2778 const VkSemaphore* pWaitSemaphores
Jesse Hall1356b0d2015-11-23 17:24:58 -08002779 u32 swapchainCount
Jesse Hall03b6fe12015-11-24 12:44:21 -08002780 const VkSwapchainKHR* pSwapchains
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002781 const u32* pImageIndices
Jesse Halle1b12782015-11-30 11:27:32 -08002782 VkResult* pResults
Michael Lentine88594d72015-11-12 12:49:45 -08002783}
2784
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002785@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002786class VkDisplayPropertiesKHR {
2787 VkDisplayKHR display
2788 const char* displayName
2789 VkExtent2D physicalDimensions
2790 VkExtent2D physicalResolution
2791 VkSurfaceTransformFlagsKHR supportedTransforms
Jesse Hall1356b0d2015-11-23 17:24:58 -08002792 VkBool32 planeReorderPossible
Jesse Halla6429252015-11-29 18:59:42 -08002793 VkBool32 persistentContent
Michael Lentine88594d72015-11-12 12:49:45 -08002794}
2795
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002796@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08002797class VkDisplayModeParametersKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002798 VkExtent2D visibleRegion
Jesse Halla6429252015-11-29 18:59:42 -08002799 u32 refreshRate
Michael Lentine88594d72015-11-12 12:49:45 -08002800}
Jesse Halld27f6aa2015-08-15 17:58:48 -07002801
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002802@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002803class VkDisplayModePropertiesKHR {
2804 VkDisplayModeKHR displayMode
Jesse Halla6429252015-11-29 18:59:42 -08002805 VkDisplayModeParametersKHR parameters
Jesse Hall1356b0d2015-11-23 17:24:58 -08002806}
2807
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002808@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002809class VkDisplayModeCreateInfoKHR {
2810 VkStructureType sType
2811 const void* pNext
Jesse Hall9ba8bc82015-11-30 16:22:16 -08002812 VkDisplayModeCreateFlagsKHR flags
Jesse Halla6429252015-11-29 18:59:42 -08002813 VkDisplayModeParametersKHR parameters
Jesse Hall1356b0d2015-11-23 17:24:58 -08002814}
2815
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002816@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002817class VkDisplayPlanePropertiesKHR {
Jesse Halla6429252015-11-29 18:59:42 -08002818 VkDisplayKHR currentDisplay
2819 u32 currentStackIndex
2820}
2821
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002822@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08002823class VkDisplayPlaneCapabilitiesKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002824 VkDisplayPlaneAlphaFlagsKHR supportedAlpha
2825 VkOffset2D minSrcPosition
2826 VkOffset2D maxSrcPosition
2827 VkExtent2D minSrcExtent
2828 VkExtent2D maxSrcExtent
2829 VkOffset2D minDstPosition
2830 VkOffset2D maxDstPosition
2831 VkExtent2D minDstExtent
2832 VkExtent2D maxDstExtent
2833}
2834
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002835@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08002836class VkDisplaySurfaceCreateInfoKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002837 VkStructureType sType
2838 const void* pNext
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002839 VkDisplaySurfaceCreateFlagsKHR flags
Jesse Hall1356b0d2015-11-23 17:24:58 -08002840 VkDisplayModeKHR displayMode
2841 u32 planeIndex
2842 u32 planeStackIndex
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002843 VkSurfaceTransformFlagBitsKHR transform
Jesse Hall1356b0d2015-11-23 17:24:58 -08002844 f32 globalAlpha
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002845 VkDisplayPlaneAlphaFlagBitsKHR alphaMode
2846 VkExtent2D imageExtent
Jesse Hall1356b0d2015-11-23 17:24:58 -08002847}
2848
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002849@extension("VK_KHR_display_swapchain")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002850class VkDisplayPresentInfoKHR {
2851 VkStructureType sType
2852 const void* pNext
2853 VkRect2D srcRect
2854 VkRect2D dstRect
Jesse Halla6429252015-11-29 18:59:42 -08002855 VkBool32 persistent
Jesse Hall1356b0d2015-11-23 17:24:58 -08002856}
2857
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002858@extension("VK_KHR_xlib_surface")
2859class VkXlibSurfaceCreateInfoKHR {
2860 VkStructureType sType
2861 const void* pNext
2862 VkXlibSurfaceCreateFlagsKHR flags
2863 platform.Display* dpy
2864 platform.Window window
2865}
2866
2867@extension("VK_KHR_xcb_surface")
2868class VkXcbSurfaceCreateInfoKHR {
2869 VkStructureType sType
2870 const void* pNext
2871 VkXcbSurfaceCreateFlagsKHR flags
2872 platform.xcb_connection_t* connection
2873 platform.xcb_window_t window
2874}
2875
2876@extension("VK_KHR_wayland_surface")
2877class VkWaylandSurfaceCreateInfoKHR {
2878 VkStructureType sType
2879 const void* pNext
2880 VkWaylandSurfaceCreateFlagsKHR flags
2881 platform.wl_display* display
2882 platform.wl_surface* surface
2883}
2884
2885@extension("VK_KHR_mir_surface")
2886class VkMirSurfaceCreateInfoKHR {
2887 VkStructureType sType
2888 const void* pNext
2889 VkMirSurfaceCreateFlagsKHR flags
2890 platform.MirConnection* connection
2891 platform.MirSurface* mirSurface
2892}
2893
2894@extension("VK_KHR_android_surface")
2895class VkAndroidSurfaceCreateInfoKHR {
2896 VkStructureType sType
2897 const void* pNext
2898 VkAndroidSurfaceCreateFlagsKHR flags
2899 platform.ANativeWindow* window
2900}
2901
2902@extension("VK_KHR_win32_surface")
2903class VkWin32SurfaceCreateInfoKHR {
2904 VkStructureType sType
2905 const void* pNext
2906 VkWin32SurfaceCreateFlagsKHR flags
2907 platform.HINSTANCE hinstance
2908 platform.HWND hwnd
2909}
2910
Jesse Halld1abd742017-02-09 21:45:51 -08002911@internal class Gralloc1Usage {
2912 u64 consumer
2913 u64 producer
2914}
2915
Chia-I Wub262ddc2016-03-22 07:38:20 +08002916@extension("VK_ANDROID_native_buffer")
2917class VkNativeBufferANDROID {
2918 VkStructureType sType
2919 const void* pNext
2920 platform.buffer_handle_t handle
Jesse Halld1abd742017-02-09 21:45:51 -08002921 s32 stride
2922 s32 format
2923 s32 usage
2924 Gralloc1Usage usage2
Chia-I Wub262ddc2016-03-22 07:38:20 +08002925}
2926
Chris Forbes8e4438b2016-12-07 16:26:49 +13002927@extension("VK_ANDROID_native_buffer")
2928class VkSwapchainImageCreateInfoANDROID {
2929 VkStructureType sType
2930 const void* pNext
Chris Forbes134d9582017-01-12 14:26:37 +13002931 VkSwapchainImageUsageFlagsANDROID flags
Chris Forbes48853712017-01-12 14:09:33 +13002932}
Ian Elliott4c8bb2a2016-12-29 11:07:26 -07002933
2934@extension("VK_GOOGLE_display_timing")
2935class VkRefreshCycleDurationGOOGLE {
Chris Forbes48853712017-01-12 14:09:33 +13002936 u64 minRefreshDuration
2937 u64 maxRefreshDuration
Ian Elliott4c8bb2a2016-12-29 11:07:26 -07002938}
2939
2940@extension("VK_GOOGLE_display_timing")
2941class VkPastPresentationTimingGOOGLE {
Chris Forbes48853712017-01-12 14:09:33 +13002942 u32 presentID
2943 u64 desiredPresentTime
2944 u64 actualPresentTime
2945 u64 earliestPresentTime
2946 u64 presentMargin
Ian Elliott4c8bb2a2016-12-29 11:07:26 -07002947}
2948
2949@extension("VK_GOOGLE_display_timing")
2950class VkPresentTimeGOOGLE {
Chris Forbes48853712017-01-12 14:09:33 +13002951 u32 presentID
2952 u64 desiredPresentTime
Ian Elliott4c8bb2a2016-12-29 11:07:26 -07002953}
2954
2955@extension("VK_GOOGLE_display_timing")
2956class VkPresentTimesInfoGOOGLE {
2957 VkStructureType sType
2958 const void* pNext
Chris Forbes48853712017-01-12 14:09:33 +13002959 u32 swapchainCount
Ian Elliott4c8bb2a2016-12-29 11:07:26 -07002960 const VkPresentTimeGOOGLE* pTimes
Chris Forbes8e4438b2016-12-07 16:26:49 +13002961}
2962
Jesse Hall715b86a2016-01-16 16:34:29 -08002963@extension("VK_EXT_debug_report")
2964class VkDebugReportCallbackCreateInfoEXT {
2965 VkStructureType sType
2966 const void* pNext
2967 VkDebugReportFlagsEXT flags
2968 PFN_vkDebugReportCallbackEXT pfnCallback
2969 void* pUserData
2970}
2971
Jesse Hall26763382016-05-20 07:13:52 -07002972@extension("VK_AMD_rasterization_order")
2973class VkPipelineRasterizationStateRasterizationOrderAMD {
2974 VkStructureType sType
2975 const void* pNext
2976 VkRasterizationOrderAMD rasterizationOrder
2977}
2978
2979@extension("VK_EXT_debug_marker")
2980class VkDebugMarkerObjectNameInfoEXT {
2981 VkStructureType sType
2982 const void* pNext
2983 VkDebugReportObjectTypeEXT objectType
2984 u64 object
2985 const char* pObjectName
2986}
2987
2988@extension("VK_EXT_debug_marker")
2989class VkDebugMarkerObjectTagInfoEXT {
2990 VkStructureType sType
2991 const void* pNext
2992 VkDebugReportObjectTypeEXT objectType
2993 u64 object
2994 u64 tagName
2995 platform.size_t tagSize
2996 const void* pTag
2997}
2998
2999@extension("VK_EXT_debug_marker")
3000class VkDebugMarkerMarkerInfoEXT {
3001 VkStructureType sType
3002 const void* pNext
3003 const char* pMarkerName
3004 f32[4] color
3005}
3006
Jesse Hall56d386a2016-07-26 15:20:40 -07003007@extension("VK_NV_dedicated_allocation")
3008class VkDedicatedAllocationImageCreateInfoNV {
3009 VkStructureType sType
3010 const void* pNext
3011 VkBool32 dedicatedAllocation
3012}
3013
3014@extension("VK_NV_dedicated_allocation")
3015class VkDedicatedAllocationBufferCreateInfoNV {
3016 VkStructureType sType
3017 const void* pNext
3018 VkBool32 dedicatedAllocation
3019}
3020
3021@extension("VK_NV_dedicated_allocation")
3022class VkDedicatedAllocationMemoryAllocateInfoNV {
3023 VkStructureType sType
3024 const void* pNext
3025 VkImage image
3026 VkBuffer buffer
3027}
3028
Chris Forbes1194ede2016-12-30 16:29:25 +13003029@extension("VK_KHR_get_physical_device_properties2")
3030class VkPhysicalDeviceFeatures2KHR {
3031 VkStructureType sType
3032 void* pNext
3033 VkPhysicalDeviceFeatures features
3034}
3035
3036@extension("VK_KHR_get_physical_device_properties2")
3037class VkPhysicalDeviceProperties2KHR {
3038 VkStructureType sType
3039 void* pNext
3040 VkPhysicalDeviceProperties properties
3041}
3042
3043@extension("VK_KHR_get_physical_device_properties2")
3044class VkFormatProperties2KHR {
3045 VkStructureType sType
3046 void* pNext
3047 VkFormatProperties formatProperties
3048}
3049
3050@extension("VK_KHR_get_physical_device_properties2")
3051class VkImageFormatProperties2KHR {
3052 VkStructureType sType
3053 void* pNext
3054 VkImageFormatProperties imageFormatProperties
3055}
3056
3057@extension("VK_KHR_get_physical_device_properties2")
3058class VkPhysicalDeviceImageFormatInfo2KHR {
3059 VkStructureType sType
3060 const void* pNext
3061 VkFormat format
3062 VkImageType type
3063 VkImageTiling tiling
3064 VkImageUsageFlags usage
3065 VkImageCreateFlags flags
3066}
3067
3068@extension("VK_KHR_get_physical_device_properties2")
3069class VkQueueFamilyProperties2KHR {
3070 VkStructureType sType
3071 void* pNext
3072 VkQueueFamilyProperties queueFamilyProperties
3073}
3074
3075@extension("VK_KHR_get_physical_device_properties2")
3076class VkPhysicalDeviceMemoryProperties2KHR {
3077 VkStructureType sType
3078 void* pNext
3079 VkPhysicalDeviceMemoryProperties memoryProperties
3080}
3081
3082@extension("VK_KHR_get_physical_device_properties2")
3083class VkSparseImageFormatProperties2KHR {
3084 VkStructureType sType
3085 void* pNext
3086 VkSparseImageFormatProperties properties
3087}
3088
3089@extension("VK_KHR_get_physical_device_properties2")
3090class VkPhysicalDeviceSparseImageFormatInfo2KHR {
3091 VkStructureType sType
3092 const void* pNext
3093 VkFormat format
3094 VkImageType type
3095 VkSampleCountFlagBits samples
3096 VkImageUsageFlags usage
3097 VkImageTiling tiling
3098}
3099
Chris Forbes289cb792016-12-30 15:03:55 +13003100@extension("VK_KHR_incremental_present")
3101class VkRectLayerKHR {
3102 VkOffset2D offset
3103 VkExtent2D extent
3104 u32 layer
3105}
3106
3107@extension("VK_KHR_incremental_present")
3108class VkPresentRegionKHR {
3109 u32 rectangleCount
3110 const VkRectLayerKHR* pRectangles
3111}
3112
3113@extension("VK_KHR_incremental_present")
3114class VkPresentRegionsKHR {
3115 VkStructureType sType
3116 const void* pNext
3117 u32 swapchainCount
3118 const VkPresentRegionKHR* pRegions
3119}
3120
3121@extension("VK_NV_external_memory_capabilities")
3122class VkExternalImageFormatPropertiesNV {
3123 VkImageFormatProperties imageFormatProperties
3124 VkExternalMemoryFeatureFlagsNV externalMemoryFeatures
3125 VkExternalMemoryHandleTypeFlagsNV exportFromImportedHandleTypes
3126 VkExternalMemoryHandleTypeFlagsNV compatibleHandleTypes
3127}
3128
3129@extension("VK_NV_external_memory")
3130class VkExternalMemoryImageCreateInfoNV {
3131 VkStructureType sType
3132 const void* pNext
3133 VkExternalMemoryHandleTypeFlagsNV handleTypes
3134}
3135
3136@extension("VK_NV_external_memory")
3137class VkExportMemoryAllocateInfoNV {
3138 VkStructureType sType
3139 const void* pNext
3140 VkExternalMemoryHandleTypeFlagsNV handleTypes
3141}
3142
3143@extension("VK_NV_external_memory_win32")
3144class VkImportMemoryWin32HandleInfoNV {
3145 VkStructureType sType
3146 const void* pNext
3147 VkExternalMemoryHandleTypeFlagsNV handleType
3148 platform.HANDLE handle
3149}
3150
3151@extension("VK_NV_external_memory_win32")
3152class VkExportMemoryWin32HandleInfoNV {
3153 VkStructureType sType
3154 const void* pNext
3155 const platform.SECURITY_ATTRIBUTES* pAttributes
3156 u32 dwAccess
3157}
3158
3159@extension("VK_NV_win32_keyed_mutex")
3160class VkWin32KeyedMutexAcquireReleaseInfoNV {
3161 VkStructureType sType
3162 const void* pNext
3163 u32 acquireCount
3164 const VkDeviceMemory* pAcquireSyncs
3165 const u64* pAcquireKeys
3166 const u32* pAcquireTimeoutMilliseconds
3167 u32 releaseCount
3168 const VkDeviceMemory* pReleaseSyncs
3169 const u64* pReleaseKeys
3170}
3171
3172@extension("VK_EXT_validation_flags")
3173class VkValidationFlagsEXT {
3174 VkStructureType sType
3175 const void* pNext
3176 u32 disabledValidationCheckCount
3177 VkValidationCheckEXT* pDisabledValidationChecks
3178}
3179
3180@extension("VK_NVX_device_generated_commands")
3181class VkDeviceGeneratedCommandsFeaturesNVX {
3182 VkStructureType sType
3183 const void* pNext
3184 VkBool32 computeBindingPointSupport
3185}
3186
3187@extension("VK_NVX_device_generated_commands")
3188class VkDeviceGeneratedCommandsLimitsNVX {
3189 VkStructureType sType
3190 const void* pNext
3191 u32 maxIndirectCommandsLayoutTokenCount
3192 u32 maxObjectEntryCounts
3193 u32 minSequenceCountBufferOffsetAlignment
3194 u32 minSequenceIndexBufferOffsetAlignment
3195 u32 minCommandsTokenBufferOffsetAlignment
3196}
3197
3198@extension("VK_NVX_device_generated_commands")
3199class VkIndirectCommandsTokenNVX {
3200 VkIndirectCommandsTokenTypeNVX tokenType
3201 VkBuffer buffer
3202 VkDeviceSize offset
3203}
3204
3205@extension("VK_NVX_device_generated_commands")
3206class VkIndirectCommandsLayoutTokenNVX {
3207 VkIndirectCommandsTokenTypeNVX tokenType
3208 u32 bindingUnit
3209 u32 dynamicCount
3210 u32 divisor
3211}
3212
3213@extension("VK_NVX_device_generated_commands")
3214class VkIndirectCommandsLayoutCreateInfoNVX {
3215 VkStructureType sType
3216 const void* pNext
3217 VkPipelineBindPoint pipelineBindPoint
3218 VkIndirectCommandsLayoutUsageFlagsNVX flags
3219 u32 tokenCount
3220 const VkIndirectCommandsLayoutTokenNVX* pTokens
3221}
3222
3223@extension("VK_NVX_device_generated_commands")
3224class VkCmdProcessCommandsInfoNVX {
3225 VkStructureType sType
3226 const void* pNext
3227 VkObjectTableNVX objectTable
3228 VkIndirectCommandsLayoutNVX indirectCommandsLayout
3229 u32 indirectCommandsTokenCount
3230 const VkIndirectCommandsTokenNVX* pIndirectCommandsTokens
3231 u32 maxSequencesCount
3232 VkCommandBuffer targetCommandBuffer
3233 VkBuffer sequencesCountBuffer
3234 VkDeviceSize sequencesCountOffset
3235 VkBuffer sequencesIndexBuffer
3236 VkDeviceSize sequencesIndexOffset
3237}
3238
3239@extension("VK_NVX_device_generated_commands")
3240class VkCmdReserveSpaceForCommandsInfoNVX {
3241 VkStructureType sType
3242 const void* pNext
3243 VkObjectTableNVX objectTable
3244 VkIndirectCommandsLayoutNVX indirectCommandsLayout
3245 u32 maxSequencesCount
3246}
3247
3248@extension("VK_NVX_device_generated_commands")
3249class VkObjectTableCreateInfoNVX {
3250 VkStructureType sType
3251 const void* pNext
3252 u32 objectCount
3253 const VkObjectEntryTypeNVX* pObjectEntryTypes
3254 const u32* pObjectEntryCounts
3255 const VkObjectEntryUsageFlagsNVX* pObjectEntryUsageFlags
3256 u32 maxUniformBuffersPerDescriptor
3257 u32 maxStorageBuffersPerDescriptor
3258 u32 maxStorageImagesPerDescriptor
3259 u32 maxSampledImagesPerDescriptor
3260 u32 maxPipelineLayouts
3261}
3262
3263@extension("VK_NVX_device_generated_commands")
3264class VkObjectTableEntryNVX {
3265 VkObjectEntryTypeNVX type
3266 VkObjectEntryUsageFlagsNVX flags
3267}
3268
3269@extension("VK_NVX_device_generated_commands")
3270class VkObjectTablePipelineEntryNVX {
3271 VkObjectEntryTypeNVX type
3272 VkObjectEntryUsageFlagsNVX flags
3273 VkPipeline pipeline
3274}
3275
3276@extension("VK_NVX_device_generated_commands")
3277class VkObjectTableDescriptorSetEntryNVX {
3278 VkObjectEntryTypeNVX type
3279 VkObjectEntryUsageFlagsNVX flags
3280 VkPipelineLayout pipelineLayout
3281 VkDescriptorSet descriptorSet
3282}
3283
3284@extension("VK_NVX_device_generated_commands")
3285class VkObjectTableVertexBufferEntryNVX {
3286 VkObjectEntryTypeNVX type
3287 VkObjectEntryUsageFlagsNVX flags
3288 VkBuffer buffer
3289}
3290
3291@extension("VK_NVX_device_generated_commands")
3292class VkObjectTableIndexBufferEntryNVX {
3293 VkObjectEntryTypeNVX type
3294 VkObjectEntryUsageFlagsNVX flags
3295 VkBuffer buffer
3296}
3297
3298@extension("VK_NVX_device_generated_commands")
3299class VkObjectTablePushConstantEntryNVX {
3300 VkObjectEntryTypeNVX type
3301 VkObjectEntryUsageFlagsNVX flags
3302 VkPipelineLayout pipelineLayout
3303 VkShaderStageFlags stageFlags
3304}
3305
3306
Jesse Hall1356b0d2015-11-23 17:24:58 -08003307
Jesse Halld27f6aa2015-08-15 17:58:48 -07003308////////////////
3309// Commands //
3310////////////////
3311
3312// Function pointers. TODO: add support for function pointers.
3313
3314@external type void* PFN_vkVoidFunction
3315@pfn cmd void vkVoidFunction() {
3316}
3317
Jesse Hall3fbc8562015-11-29 22:10:52 -08003318@external type void* PFN_vkAllocationFunction
3319@pfn cmd void* vkAllocationFunction(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003320 void* pUserData,
3321 platform.size_t size,
3322 platform.size_t alignment,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003323 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08003324 return ?
3325}
3326
Jesse Hall3fbc8562015-11-29 22:10:52 -08003327@external type void* PFN_vkReallocationFunction
3328@pfn cmd void* vkReallocationFunction(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003329 void* pUserData,
3330 void* pOriginal,
3331 platform.size_t size,
3332 platform.size_t alignment,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003333 VkSystemAllocationScope allocationScope) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003334 return ?
3335}
3336
3337@external type void* PFN_vkFreeFunction
3338@pfn cmd void vkFreeFunction(
3339 void* pUserData,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003340 void* pMemory) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003341}
3342
Jesse Hall3fbc8562015-11-29 22:10:52 -08003343@external type void* PFN_vkInternalAllocationNotification
3344@pfn cmd void vkInternalAllocationNotification(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003345 void* pUserData,
3346 platform.size_t size,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003347 VkInternalAllocationType allocationType,
3348 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08003349}
3350
3351@external type void* PFN_vkInternalFreeNotification
3352@pfn cmd void vkInternalFreeNotification(
3353 void* pUserData,
3354 platform.size_t size,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003355 VkInternalAllocationType allocationType,
3356 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08003357}
Jesse Halld27f6aa2015-08-15 17:58:48 -07003358
3359// Global functions
3360
3361@threadSafety("system")
3362cmd VkResult vkCreateInstance(
3363 const VkInstanceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003364 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003365 VkInstance* pInstance) {
3366 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO)
3367
3368 instance := ?
3369 pInstance[0] = instance
3370 State.Instances[instance] = new!InstanceObject()
3371
Jesse Hall3dd678a2016-01-08 21:52:01 -08003372 layers := pCreateInfo.ppEnabledLayerNames[0:pCreateInfo.enabledLayerCount]
3373 extensions := pCreateInfo.ppEnabledExtensionNames[0:pCreateInfo.enabledExtensionCount]
Jesse Halld27f6aa2015-08-15 17:58:48 -07003374
3375 return ?
3376}
3377
3378@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003379cmd void vkDestroyInstance(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003380 VkInstance instance,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003381 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003382 instanceObject := GetInstance(instance)
3383
3384 State.Instances[instance] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003385}
3386
3387@threadSafety("system")
3388cmd VkResult vkEnumeratePhysicalDevices(
3389 VkInstance instance,
3390 u32* pPhysicalDeviceCount,
3391 VkPhysicalDevice* pPhysicalDevices) {
3392 instanceObject := GetInstance(instance)
3393
3394 physicalDeviceCount := as!u32(?)
3395 pPhysicalDeviceCount[0] = physicalDeviceCount
3396 physicalDevices := pPhysicalDevices[0:physicalDeviceCount]
3397
3398 for i in (0 .. physicalDeviceCount) {
3399 physicalDevice := ?
3400 physicalDevices[i] = physicalDevice
3401 if !(physicalDevice in State.PhysicalDevices) {
3402 State.PhysicalDevices[physicalDevice] = new!PhysicalDeviceObject(instance: instance)
3403 }
3404 }
3405
3406 return ?
3407}
3408
3409cmd PFN_vkVoidFunction vkGetDeviceProcAddr(
3410 VkDevice device,
3411 const char* pName) {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003412 if device != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003413 device := GetDevice(device)
3414 }
3415
3416 return ?
3417}
3418
3419cmd PFN_vkVoidFunction vkGetInstanceProcAddr(
3420 VkInstance instance,
3421 const char* pName) {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003422 if instance != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003423 instanceObject := GetInstance(instance)
3424 }
3425
3426 return ?
3427}
3428
Jesse Hall606a54e2015-11-19 22:17:28 -08003429cmd void vkGetPhysicalDeviceProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003430 VkPhysicalDevice physicalDevice,
3431 VkPhysicalDeviceProperties* pProperties) {
3432 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3433
3434 properties := ?
3435 pProperties[0] = properties
Jesse Halld27f6aa2015-08-15 17:58:48 -07003436}
3437
Jesse Hall606a54e2015-11-19 22:17:28 -08003438cmd void vkGetPhysicalDeviceQueueFamilyProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003439 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003440 u32* pQueueFamilyPropertyCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003441 VkQueueFamilyProperties* pQueueFamilyProperties) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003442 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003443 // TODO: Figure out how to express fetch-count-or-properties
3444 // This version fails 'apic validate' with 'fence not allowed in
3445 // *semantic.Branch'. Other attempts have failed with the same or other
3446 // errors.
3447 // if pQueueFamilyProperties != null {
3448 // queuesProperties := pQueueFamilyProperties[0:pCount[0]]
3449 // for i in (0 .. pCount[0]) {
3450 // queueProperties := as!VkQueueFamilyProperties(?)
3451 // queuesProperties[i] = queueProperties
3452 // }
3453 // } else {
3454 // count := ?
3455 // pCount[0] = count
3456 // }
Jesse Halld27f6aa2015-08-15 17:58:48 -07003457}
3458
Jesse Hall606a54e2015-11-19 22:17:28 -08003459cmd void vkGetPhysicalDeviceMemoryProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003460 VkPhysicalDevice physicalDevice,
3461 VkPhysicalDeviceMemoryProperties* pMemoryProperties) {
3462 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3463
3464 memoryProperties := ?
3465 pMemoryProperties[0] = memoryProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07003466}
3467
Jesse Hall606a54e2015-11-19 22:17:28 -08003468cmd void vkGetPhysicalDeviceFeatures(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003469 VkPhysicalDevice physicalDevice,
3470 VkPhysicalDeviceFeatures* pFeatures) {
3471 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3472
3473 features := ?
3474 pFeatures[0] = features
Jesse Halld27f6aa2015-08-15 17:58:48 -07003475}
3476
Jesse Hall606a54e2015-11-19 22:17:28 -08003477cmd void vkGetPhysicalDeviceFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003478 VkPhysicalDevice physicalDevice,
3479 VkFormat format,
3480 VkFormatProperties* pFormatProperties) {
3481 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3482
3483 formatProperties := ?
3484 pFormatProperties[0] = formatProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07003485}
3486
Jesse Halla9e57032015-11-30 01:03:10 -08003487cmd VkResult vkGetPhysicalDeviceImageFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003488 VkPhysicalDevice physicalDevice,
3489 VkFormat format,
3490 VkImageType type,
3491 VkImageTiling tiling,
3492 VkImageUsageFlags usage,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003493 VkImageCreateFlags flags,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003494 VkImageFormatProperties* pImageFormatProperties) {
3495 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3496
3497 imageFormatProperties := ?
3498 pImageFormatProperties[0] = imageFormatProperties
Jesse Halla9e57032015-11-30 01:03:10 -08003499
3500 return ?
Jesse Halld27f6aa2015-08-15 17:58:48 -07003501}
3502
Jesse Halld27f6aa2015-08-15 17:58:48 -07003503
3504// Device functions
3505
3506@threadSafety("system")
3507cmd VkResult vkCreateDevice(
3508 VkPhysicalDevice physicalDevice,
3509 const VkDeviceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003510 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003511 VkDevice* pDevice) {
3512 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO)
3513 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3514
3515 device := ?
3516 pDevice[0] = device
3517 State.Devices[device] = new!DeviceObject(physicalDevice: physicalDevice)
3518
3519 return ?
3520}
3521
3522@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003523cmd void vkDestroyDevice(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003524 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003525 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003526 deviceObject := GetDevice(device)
3527
3528 State.Devices[device] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003529}
3530
3531
3532// Extension discovery functions
3533
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003534cmd VkResult vkEnumerateInstanceLayerProperties(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003535 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003536 VkLayerProperties* pProperties) {
3537 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08003538 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07003539
3540 properties := pProperties[0:count]
3541 for i in (0 .. count) {
3542 property := ?
3543 properties[i] = property
3544 }
3545
3546 return ?
3547}
3548
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003549cmd VkResult vkEnumerateInstanceExtensionProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003550 const char* pLayerName,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003551 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003552 VkExtensionProperties* pProperties) {
3553 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08003554 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07003555
3556 properties := pProperties[0:count]
3557 for i in (0 .. count) {
3558 property := ?
3559 properties[i] = property
3560 }
3561
3562 return ?
3563}
3564
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003565cmd VkResult vkEnumerateDeviceLayerProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003566 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003567 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003568 VkLayerProperties* pProperties) {
3569 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3570 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08003571 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07003572
3573 properties := pProperties[0:count]
3574 for i in (0 .. count) {
3575 property := ?
3576 properties[i] = property
3577 }
3578
3579 return ?
3580}
3581
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003582cmd VkResult vkEnumerateDeviceExtensionProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003583 VkPhysicalDevice physicalDevice,
3584 const char* pLayerName,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003585 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003586 VkExtensionProperties* pProperties) {
3587 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3588
3589 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08003590 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07003591
3592 properties := pProperties[0:count]
3593 for i in (0 .. count) {
3594 property := ?
3595 properties[i] = property
3596 }
3597
3598 return ?
3599}
3600
3601
3602// Queue functions
3603
3604@threadSafety("system")
Jesse Hall606a54e2015-11-19 22:17:28 -08003605cmd void vkGetDeviceQueue(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003606 VkDevice device,
3607 u32 queueFamilyIndex,
3608 u32 queueIndex,
3609 VkQueue* pQueue) {
3610 deviceObject := GetDevice(device)
3611
3612 queue := ?
3613 pQueue[0] = queue
3614
3615 if !(queue in State.Queues) {
3616 State.Queues[queue] = new!QueueObject(device: device)
3617 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07003618}
3619
3620@threadSafety("app")
3621cmd VkResult vkQueueSubmit(
3622 VkQueue queue,
Jesse Halla366a512015-11-19 22:30:07 -08003623 u32 submitCount,
Jesse Hallb00daad2015-11-29 19:46:20 -08003624 const VkSubmitInfo* pSubmits,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003625 VkFence fence) {
3626 queueObject := GetQueue(queue)
3627
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003628 if fence != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003629 fenceObject := GetFence(fence)
3630 assert(fenceObject.device == queueObject.device)
3631 }
3632
Jesse Hall3fbc8562015-11-29 22:10:52 -08003633 // commandBuffers := pcommandBuffers[0:commandBufferCount]
3634 // for i in (0 .. commandBufferCount) {
3635 // commandBuffer := commandBuffers[i]
3636 // commandBufferObject := GetCommandBuffer(commandBuffer)
3637 // assert(commandBufferObject.device == queueObject.device)
Jesse Halla366a512015-11-19 22:30:07 -08003638 //
Jesse Hall3fbc8562015-11-29 22:10:52 -08003639 // validate("QueueCheck", commandBufferObject.queueFlags in queueObject.flags,
3640 // "vkQueueSubmit: enqueued commandBuffer requires missing queue capabilities.")
Jesse Halla366a512015-11-19 22:30:07 -08003641 // }
Jesse Halld27f6aa2015-08-15 17:58:48 -07003642
3643 return ?
3644}
3645
3646@threadSafety("system")
3647cmd VkResult vkQueueWaitIdle(
3648 VkQueue queue) {
3649 queueObject := GetQueue(queue)
3650
3651 return ?
3652}
3653
3654@threadSafety("system")
3655cmd VkResult vkDeviceWaitIdle(
3656 VkDevice device) {
3657 deviceObject := GetDevice(device)
3658
3659 return ?
3660}
3661
3662
3663// Memory functions
3664
3665@threadSafety("system")
Jesse Hall3fbc8562015-11-29 22:10:52 -08003666cmd VkResult vkAllocateMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003667 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003668 const VkMemoryAllocateInfo* pAllocateInfo,
3669 const VkAllocationCallbacks* pAllocator,
3670 VkDeviceMemory* pMemory) {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08003671 assert(pAllocateInfo.sType == VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003672 deviceObject := GetDevice(device)
3673
Jesse Hall3fbc8562015-11-29 22:10:52 -08003674 memory := ?
3675 pMemory[0] = memory
3676 State.DeviceMemories[memory] = new!DeviceMemoryObject(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003677 device: device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003678 allocationSize: pAllocateInfo[0].allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003679
3680 return ?
3681}
3682
3683@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003684cmd void vkFreeMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003685 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003686 VkDeviceMemory memory,
3687 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003688 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003689 memoryObject := GetDeviceMemory(memory)
3690 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003691
3692 // Check that no objects are still bound before freeing.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003693 validate("MemoryCheck", len(memoryObject.boundObjects) == 0,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003694 "vkFreeMemory: objects still bound")
Jesse Hall3fbc8562015-11-29 22:10:52 -08003695 validate("MemoryCheck", len(memoryObject.boundCommandBuffers) == 0,
3696 "vkFreeMemory: commandBuffers still bound")
3697 State.DeviceMemories[memory] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003698}
3699
3700@threadSafety("app")
3701cmd VkResult vkMapMemory(
3702 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003703 VkDeviceMemory memory,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003704 VkDeviceSize offset,
3705 VkDeviceSize size,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003706 VkMemoryMapFlags flags,
3707 void** ppData) {
3708 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003709 memoryObject := GetDeviceMemory(memory)
3710 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003711
3712 assert(flags == as!VkMemoryMapFlags(0))
Jesse Hall3fbc8562015-11-29 22:10:52 -08003713 assert((offset + size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003714
3715 return ?
3716}
3717
3718@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003719cmd void vkUnmapMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003720 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003721 VkDeviceMemory memory) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003722 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003723 memoryObject := GetDeviceMemory(memory)
3724 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003725}
3726
3727cmd VkResult vkFlushMappedMemoryRanges(
3728 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003729 u32 memoryRangeCount
3730 const VkMappedMemoryRange* pMemoryRanges) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003731 deviceObject := GetDevice(device)
3732
Jesse Hall3fbc8562015-11-29 22:10:52 -08003733 memoryRanges := pMemoryRanges[0:memoryRangeCount]
3734 for i in (0 .. memoryRangeCount) {
3735 memoryRange := memoryRanges[i]
3736 memoryObject := GetDeviceMemory(memoryRange.memory)
3737 assert(memoryObject.device == device)
3738 assert((memoryRange.offset + memoryRange.size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003739 }
3740
3741 return ?
3742}
3743
3744cmd VkResult vkInvalidateMappedMemoryRanges(
3745 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003746 u32 memoryRangeCount,
3747 const VkMappedMemoryRange* pMemoryRanges) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003748 deviceObject := GetDevice(device)
3749
Jesse Hall3fbc8562015-11-29 22:10:52 -08003750 memoryRanges := pMemoryRanges[0:memoryRangeCount]
3751 for i in (0 .. memoryRangeCount) {
3752 memoryRange := memoryRanges[i]
3753 memoryObject := GetDeviceMemory(memoryRange.memory)
3754 assert(memoryObject.device == device)
3755 assert((memoryRange.offset + memoryRange.size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003756 }
3757
3758 return ?
3759}
3760
3761
3762// Memory management API functions
3763
Jesse Hall606a54e2015-11-19 22:17:28 -08003764cmd void vkGetDeviceMemoryCommitment(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003765 VkDevice device,
3766 VkDeviceMemory memory,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003767 VkDeviceSize* pCommittedMemoryInBytes) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003768 deviceObject := GetDevice(device)
3769
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003770 if memory != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003771 memoryObject := GetDeviceMemory(memory)
3772 assert(memoryObject.device == device)
3773 }
3774
3775 committedMemoryInBytes := ?
3776 pCommittedMemoryInBytes[0] = committedMemoryInBytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07003777}
3778
Jesse Hall606a54e2015-11-19 22:17:28 -08003779cmd void vkGetBufferMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003780 VkDevice device,
3781 VkBuffer buffer,
3782 VkMemoryRequirements* pMemoryRequirements) {
3783 deviceObject := GetDevice(device)
3784 bufferObject := GetBuffer(buffer)
3785 assert(bufferObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003786}
3787
3788cmd VkResult vkBindBufferMemory(
3789 VkDevice device,
3790 VkBuffer buffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003791 VkDeviceMemory memory,
3792 VkDeviceSize memoryOffset) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003793 deviceObject := GetDevice(device)
3794 bufferObject := GetBuffer(buffer)
3795 assert(bufferObject.device == device)
3796
3797 // Unbind buffer from previous memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003798 if bufferObject.memory != NULL_HANDLE {
3799 memoryObject := GetDeviceMemory(bufferObject.memory)
3800 memoryObject.boundObjects[as!u64(buffer)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003801 }
3802
3803 // Bind buffer to given memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003804 if memory != NULL_HANDLE {
3805 memoryObject := GetDeviceMemory(memory)
3806 assert(memoryObject.device == device)
3807 memoryObject.boundObjects[as!u64(buffer)] = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003808 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08003809 bufferObject.memory = memory
3810 bufferObject.memoryOffset = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003811
3812 return ?
3813}
3814
Jesse Hall606a54e2015-11-19 22:17:28 -08003815cmd void vkGetImageMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003816 VkDevice device,
3817 VkImage image,
3818 VkMemoryRequirements* pMemoryRequirements) {
3819 deviceObject := GetDevice(device)
3820 imageObject := GetImage(image)
3821 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003822}
3823
3824cmd VkResult vkBindImageMemory(
3825 VkDevice device,
3826 VkImage image,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003827 VkDeviceMemory memory,
3828 VkDeviceSize memoryOffset) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003829 deviceObject := GetDevice(device)
3830 imageObject := GetImage(image)
3831 assert(imageObject.device == device)
3832
3833 // Unbind image from previous memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003834 if imageObject.memory != NULL_HANDLE {
3835 memoryObject := GetDeviceMemory(imageObject.memory)
3836 memoryObject.boundObjects[as!u64(image)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003837 }
3838
3839 // Bind image to given memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003840 if memory != NULL_HANDLE {
3841 memoryObject := GetDeviceMemory(memory)
3842 assert(memoryObject.device == device)
3843 memoryObject.boundObjects[as!u64(image)] = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003844 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08003845 imageObject.memory = memory
3846 imageObject.memoryOffset = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003847
3848 return ?
3849}
3850
Jesse Hall606a54e2015-11-19 22:17:28 -08003851cmd void vkGetImageSparseMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003852 VkDevice device,
3853 VkImage image,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003854 u32* pSparseMemoryRequirementCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003855 VkSparseImageMemoryRequirements* pSparseMemoryRequirements) {
3856 deviceObject := GetDevice(device)
3857 imageObject := GetImage(image)
3858 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003859}
3860
Jesse Hall606a54e2015-11-19 22:17:28 -08003861cmd void vkGetPhysicalDeviceSparseImageFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003862 VkPhysicalDevice physicalDevice,
3863 VkFormat format,
3864 VkImageType type,
Jesse Hall091ed9e2015-11-30 00:55:29 -08003865 VkSampleCountFlagBits samples,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003866 VkImageUsageFlags usage,
3867 VkImageTiling tiling,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003868 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003869 VkSparseImageFormatProperties* pProperties) {
3870 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003871}
3872
Jesse Halla6429252015-11-29 18:59:42 -08003873cmd VkResult vkQueueBindSparse(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003874 VkQueue queue,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003875 u32 bindInfoCount,
Jesse Halla6429252015-11-29 18:59:42 -08003876 const VkBindSparseInfo* pBindInfo,
3877 VkFence fence) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003878 queueObject := GetQueue(queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003879
3880 return ?
3881}
3882
3883
3884// Fence functions
3885
3886@threadSafety("system")
3887cmd VkResult vkCreateFence(
3888 VkDevice device,
3889 const VkFenceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003890 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003891 VkFence* pFence) {
3892 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_FENCE_CREATE_INFO)
3893 deviceObject := GetDevice(device)
3894
3895 fence := ?
3896 pFence[0] = fence
3897 State.Fences[fence] = new!FenceObject(
Jesse Halld8bade02015-11-24 10:24:18 -08003898 device: device, signaled: (pCreateInfo.flags == as!VkFenceCreateFlags(VK_FENCE_CREATE_SIGNALED_BIT)))
Jesse Halld27f6aa2015-08-15 17:58:48 -07003899
3900 return ?
3901}
3902
3903@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003904cmd void vkDestroyFence(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003905 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003906 VkFence fence,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003907 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003908 deviceObject := GetDevice(device)
3909 fenceObject := GetFence(fence)
3910 assert(fenceObject.device == device)
3911
3912 State.Fences[fence] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003913}
3914
3915@threadSafety("system")
3916cmd VkResult vkResetFences(
3917 VkDevice device,
3918 u32 fenceCount,
3919 const VkFence* pFences) {
3920 deviceObject := GetDevice(device)
3921
3922 fences := pFences[0:fenceCount]
3923 for i in (0 .. fenceCount) {
3924 fence := fences[i]
3925 fenceObject := GetFence(fence)
3926 assert(fenceObject.device == device)
3927 fenceObject.signaled = false
3928 }
3929
3930 return ?
3931}
3932
3933@threadSafety("system")
3934cmd VkResult vkGetFenceStatus(
3935 VkDevice device,
3936 VkFence fence) {
3937 deviceObject := GetDevice(device)
3938 fenceObject := GetFence(fence)
3939 assert(fenceObject.device == device)
3940
3941 return ?
3942}
3943
3944@threadSafety("system")
3945cmd VkResult vkWaitForFences(
3946 VkDevice device,
3947 u32 fenceCount,
3948 const VkFence* pFences,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003949 VkBool32 waitAll,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003950 u64 timeout) { /// timeout in nanoseconds
3951 deviceObject := GetDevice(device)
3952
3953 fences := pFences[0:fenceCount]
3954 for i in (0 .. fenceCount) {
3955 fence := fences[i]
3956 fenceObject := GetFence(fence)
3957 assert(fenceObject.device == device)
3958 }
3959
3960 return ?
3961}
3962
3963
3964// Queue semaphore functions
3965
3966@threadSafety("system")
3967cmd VkResult vkCreateSemaphore(
3968 VkDevice device,
3969 const VkSemaphoreCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003970 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003971 VkSemaphore* pSemaphore) {
3972 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO)
3973 deviceObject := GetDevice(device)
3974
3975 semaphore := ?
3976 pSemaphore[0] = semaphore
3977 State.Semaphores[semaphore] = new!SemaphoreObject(device: device)
3978
3979 return ?
3980}
3981
3982@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003983cmd void vkDestroySemaphore(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003984 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003985 VkSemaphore semaphore,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003986 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003987 deviceObject := GetDevice(device)
3988 semaphoreObject := GetSemaphore(semaphore)
3989 assert(semaphoreObject.device == device)
3990
3991 State.Semaphores[semaphore] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003992}
3993
Jesse Halld27f6aa2015-08-15 17:58:48 -07003994
3995// Event functions
3996
3997@threadSafety("system")
3998cmd VkResult vkCreateEvent(
3999 VkDevice device,
4000 const VkEventCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004001 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004002 VkEvent* pEvent) {
4003 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_EVENT_CREATE_INFO)
4004 deviceObject := GetDevice(device)
4005
4006 event := ?
4007 pEvent[0] = event
4008 State.Events[event] = new!EventObject(device: device)
4009
4010 return ?
4011}
4012
4013@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004014cmd void vkDestroyEvent(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004015 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004016 VkEvent event,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004017 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004018 deviceObject := GetDevice(device)
4019 eventObject := GetEvent(event)
4020 assert(eventObject.device == device)
4021
4022 State.Events[event] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004023}
4024
4025@threadSafety("system")
4026cmd VkResult vkGetEventStatus(
4027 VkDevice device,
4028 VkEvent event) {
4029 deviceObject := GetDevice(device)
4030 eventObject := GetEvent(event)
4031 assert(eventObject.device == device)
4032
4033 return ?
4034}
4035
4036@threadSafety("system")
4037cmd VkResult vkSetEvent(
4038 VkDevice device,
4039 VkEvent event) {
4040 deviceObject := GetDevice(device)
4041 eventObject := GetEvent(event)
4042 assert(eventObject.device == device)
4043
4044 return ?
4045}
4046
4047@threadSafety("system")
4048cmd VkResult vkResetEvent(
4049 VkDevice device,
4050 VkEvent event) {
4051 deviceObject := GetDevice(device)
4052 eventObject := GetEvent(event)
4053 assert(eventObject.device == device)
4054
4055 return ?
4056}
4057
4058
4059// Query functions
4060
4061@threadSafety("system")
4062cmd VkResult vkCreateQueryPool(
4063 VkDevice device,
4064 const VkQueryPoolCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004065 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004066 VkQueryPool* pQueryPool) {
4067 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO)
4068 deviceObject := GetDevice(device)
4069
4070 queryPool := ?
4071 pQueryPool[0] = queryPool
4072 State.QueryPools[queryPool] = new!QueryPoolObject(device: device)
4073
4074 return ?
4075}
4076
4077@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004078cmd void vkDestroyQueryPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004079 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004080 VkQueryPool queryPool,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004081 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004082 deviceObject := GetDevice(device)
4083 queryPoolObject := GetQueryPool(queryPool)
4084 assert(queryPoolObject.device == device)
4085
4086 State.QueryPools[queryPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004087}
4088
4089@threadSafety("system")
4090cmd VkResult vkGetQueryPoolResults(
4091 VkDevice device,
4092 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004093 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004094 u32 queryCount,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004095 platform.size_t dataSize,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004096 void* pData,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004097 VkDeviceSize stride,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004098 VkQueryResultFlags flags) {
4099 deviceObject := GetDevice(device)
4100 queryPoolObject := GetQueryPool(queryPool)
4101 assert(queryPoolObject.device == device)
4102
Jesse Halld27f6aa2015-08-15 17:58:48 -07004103 data := pData[0:dataSize]
4104
4105 return ?
4106}
4107
4108// Buffer functions
4109
4110@threadSafety("system")
4111cmd VkResult vkCreateBuffer(
4112 VkDevice device,
4113 const VkBufferCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004114 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004115 VkBuffer* pBuffer) {
4116 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO)
4117 deviceObject := GetDevice(device)
4118
4119 buffer := ?
4120 pBuffer[0] = buffer
4121 State.Buffers[buffer] = new!BufferObject(device: device)
4122
4123 return ?
4124}
4125
4126@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004127cmd void vkDestroyBuffer(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004128 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004129 VkBuffer buffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004130 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004131 deviceObject := GetDevice(device)
4132 bufferObject := GetBuffer(buffer)
4133 assert(bufferObject.device == device)
4134
Jesse Hall3fbc8562015-11-29 22:10:52 -08004135 assert(bufferObject.memory == 0)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004136 State.Buffers[buffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004137}
4138
4139
4140// Buffer view functions
4141
4142@threadSafety("system")
4143cmd VkResult vkCreateBufferView(
4144 VkDevice device,
4145 const VkBufferViewCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004146 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004147 VkBufferView* pView) {
4148 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO)
4149 deviceObject := GetDevice(device)
4150
4151 bufferObject := GetBuffer(pCreateInfo.buffer)
4152 assert(bufferObject.device == device)
4153
4154 view := ?
4155 pView[0] = view
4156 State.BufferViews[view] = new!BufferViewObject(device: device, buffer: pCreateInfo.buffer)
4157
4158 return ?
4159}
4160
4161@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004162cmd void vkDestroyBufferView(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004163 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004164 VkBufferView bufferView,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004165 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004166 deviceObject := GetDevice(device)
4167 bufferViewObject := GetBufferView(bufferView)
4168 assert(bufferViewObject.device == device)
4169
4170 State.BufferViews[bufferView] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004171}
4172
4173
4174// Image functions
4175
4176@threadSafety("system")
4177cmd VkResult vkCreateImage(
4178 VkDevice device,
4179 const VkImageCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004180 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004181 VkImage* pImage) {
4182 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO)
4183 deviceObject := GetDevice(device)
4184
4185 image := ?
4186 pImage[0] = image
4187 State.Images[image] = new!ImageObject(device: device)
4188
4189 return ?
4190}
4191
4192@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004193cmd void vkDestroyImage(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004194 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004195 VkImage image,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004196 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004197 deviceObject := GetDevice(device)
4198 imageObject := GetImage(image)
4199 assert(imageObject.device == device)
4200
Jesse Hall3fbc8562015-11-29 22:10:52 -08004201 assert(imageObject.memory == 0)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004202 State.Images[image] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004203}
4204
Jesse Hall606a54e2015-11-19 22:17:28 -08004205cmd void vkGetImageSubresourceLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004206 VkDevice device,
4207 VkImage image,
4208 const VkImageSubresource* pSubresource,
4209 VkSubresourceLayout* pLayout) {
4210 deviceObject := GetDevice(device)
4211 imageObject := GetImage(image)
4212 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004213}
4214
4215
4216// Image view functions
4217
4218@threadSafety("system")
4219cmd VkResult vkCreateImageView(
4220 VkDevice device,
4221 const VkImageViewCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004222 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004223 VkImageView* pView) {
4224 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO)
4225 deviceObject := GetDevice(device)
4226
4227 imageObject := GetImage(pCreateInfo.image)
4228 assert(imageObject.device == device)
4229
4230 view := ?
4231 pView[0] = view
4232 State.ImageViews[view] = new!ImageViewObject(device: device, image: pCreateInfo.image)
4233
4234 return ?
4235}
4236
4237@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004238cmd void vkDestroyImageView(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004239 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004240 VkImageView imageView,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004241 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004242 deviceObject := GetDevice(device)
4243 imageViewObject := GetImageView(imageView)
4244 assert(imageViewObject.device == device)
4245
4246 State.ImageViews[imageView] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004247}
4248
4249
4250// Shader functions
4251
4252cmd VkResult vkCreateShaderModule(
4253 VkDevice device,
4254 const VkShaderModuleCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004255 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004256 VkShaderModule* pShaderModule) {
4257 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO)
4258 deviceObject := GetDevice(device)
4259
4260 shaderModule := ?
4261 pShaderModule[0] = shaderModule
4262 State.ShaderModules[shaderModule] = new!ShaderModuleObject(device: device)
4263
4264 return ?
4265}
4266
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004267cmd void vkDestroyShaderModule(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004268 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004269 VkShaderModule shaderModule,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004270 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004271 deviceObject := GetDevice(device)
4272 shaderModuleObject := GetShaderModule(shaderModule)
4273 assert(shaderModuleObject.device == device)
4274
4275 State.ShaderModules[shaderModule] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004276}
4277
Jesse Halld27f6aa2015-08-15 17:58:48 -07004278
4279// Pipeline functions
4280
4281cmd VkResult vkCreatePipelineCache(
4282 VkDevice device,
4283 const VkPipelineCacheCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004284 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004285 VkPipelineCache* pPipelineCache) {
4286 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO)
4287 deviceObject := GetDevice(device)
4288
4289 pipelineCache := ?
4290 pPipelineCache[0] = pipelineCache
4291 State.PipelineCaches[pipelineCache] = new!PipelineCacheObject(device: device)
4292
4293 return ?
4294}
4295
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004296cmd void vkDestroyPipelineCache(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004297 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004298 VkPipelineCache pipelineCache,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004299 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004300 deviceObject := GetDevice(device)
4301 pipelineCacheObject := GetPipelineCache(pipelineCache)
4302 assert(pipelineCacheObject.device == device)
4303
4304 State.PipelineCaches[pipelineCache] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004305}
4306
Jesse Halld27f6aa2015-08-15 17:58:48 -07004307cmd VkResult vkGetPipelineCacheData(
4308 VkDevice device,
4309 VkPipelineCache pipelineCache,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004310 platform.size_t* pDataSize,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004311 void* pData) {
4312 deviceObject := GetDevice(device)
4313 pipelineCacheObject := GetPipelineCache(pipelineCache)
4314 assert(pipelineCacheObject.device == device)
4315
4316 return ?
4317}
4318
4319cmd VkResult vkMergePipelineCaches(
4320 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004321 VkPipelineCache dstCache,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004322 u32 srcCacheCount,
4323 const VkPipelineCache* pSrcCaches) {
4324 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004325 dstCacheObject := GetPipelineCache(dstCache)
4326 assert(dstCacheObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004327
4328 srcCaches := pSrcCaches[0:srcCacheCount]
4329 for i in (0 .. srcCacheCount) {
4330 srcCache := srcCaches[i]
4331 srcCacheObject := GetPipelineCache(srcCache)
4332 assert(srcCacheObject.device == device)
4333 }
4334
4335 return ?
4336}
4337
4338cmd VkResult vkCreateGraphicsPipelines(
4339 VkDevice device,
4340 VkPipelineCache pipelineCache,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004341 u32 createInfoCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004342 const VkGraphicsPipelineCreateInfo* pCreateInfos,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004343 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004344 VkPipeline* pPipelines) {
4345 deviceObject := GetDevice(device)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004346 if pipelineCache != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004347 pipelineCacheObject := GetPipelineCache(pipelineCache)
4348 assert(pipelineCacheObject.device == device)
4349 }
4350
Jesse Hall03b6fe12015-11-24 12:44:21 -08004351 createInfos := pCreateInfos[0:createInfoCount]
4352 pipelines := pPipelines[0:createInfoCount]
4353 for i in (0 .. createInfoCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004354 pipeline := ?
4355 pipelines[i] = pipeline
4356 State.Pipelines[pipeline] = new!PipelineObject(device: device)
4357 }
4358
4359 return ?
4360}
4361
4362cmd VkResult vkCreateComputePipelines(
4363 VkDevice device,
4364 VkPipelineCache pipelineCache,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004365 u32 createInfoCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004366 const VkComputePipelineCreateInfo* pCreateInfos,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004367 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004368 VkPipeline* pPipelines) {
4369 deviceObject := GetDevice(device)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004370 if pipelineCache != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004371 pipelineCacheObject := GetPipelineCache(pipelineCache)
4372 assert(pipelineCacheObject.device == device)
4373 }
4374
Jesse Hall03b6fe12015-11-24 12:44:21 -08004375 createInfos := pCreateInfos[0:createInfoCount]
4376 pipelines := pPipelines[0:createInfoCount]
4377 for i in (0 .. createInfoCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004378 pipeline := ?
4379 pipelines[i] = pipeline
4380 State.Pipelines[pipeline] = new!PipelineObject(device: device)
4381 }
4382
4383 return ?
4384}
4385
4386@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004387cmd void vkDestroyPipeline(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004388 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004389 VkPipeline pipeline,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004390 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004391 deviceObject := GetDevice(device)
4392 pipelineObjects := GetPipeline(pipeline)
4393 assert(pipelineObjects.device == device)
4394
4395 State.Pipelines[pipeline] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004396}
4397
4398
4399// Pipeline layout functions
4400
4401@threadSafety("system")
4402cmd VkResult vkCreatePipelineLayout(
4403 VkDevice device,
4404 const VkPipelineLayoutCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004405 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004406 VkPipelineLayout* pPipelineLayout) {
4407 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO)
4408 deviceObject := GetDevice(device)
4409
4410 pipelineLayout := ?
4411 pPipelineLayout[0] = pipelineLayout
4412 State.PipelineLayouts[pipelineLayout] = new!PipelineLayoutObject(device: device)
4413
4414 return ?
4415}
4416
4417@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004418cmd void vkDestroyPipelineLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004419 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004420 VkPipelineLayout pipelineLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004421 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004422 deviceObject := GetDevice(device)
4423 pipelineLayoutObjects := GetPipelineLayout(pipelineLayout)
4424 assert(pipelineLayoutObjects.device == device)
4425
4426 State.PipelineLayouts[pipelineLayout] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004427}
4428
4429
4430// Sampler functions
4431
4432@threadSafety("system")
4433cmd VkResult vkCreateSampler(
4434 VkDevice device,
4435 const VkSamplerCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004436 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004437 VkSampler* pSampler) {
4438 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO)
4439 deviceObject := GetDevice(device)
4440
4441 sampler := ?
4442 pSampler[0] = sampler
4443 State.Samplers[sampler] = new!SamplerObject(device: device)
4444
4445 return ?
4446}
4447
4448@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004449cmd void vkDestroySampler(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004450 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004451 VkSampler sampler,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004452 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004453 deviceObject := GetDevice(device)
4454 samplerObject := GetSampler(sampler)
4455 assert(samplerObject.device == device)
4456
4457 State.Samplers[sampler] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004458}
4459
4460
4461// Descriptor set functions
4462
4463@threadSafety("system")
4464cmd VkResult vkCreateDescriptorSetLayout(
4465 VkDevice device,
4466 const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004467 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004468 VkDescriptorSetLayout* pSetLayout) {
4469 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO)
4470 deviceObject := GetDevice(device)
4471
4472 setLayout := ?
4473 pSetLayout[0] = setLayout
4474 State.DescriptorSetLayouts[setLayout] = new!DescriptorSetLayoutObject(device: device)
4475
4476 return ?
4477}
4478
4479@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004480cmd void vkDestroyDescriptorSetLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004481 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004482 VkDescriptorSetLayout descriptorSetLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004483 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004484 deviceObject := GetDevice(device)
4485 descriptorSetLayoutObject := GetDescriptorSetLayout(descriptorSetLayout)
4486 assert(descriptorSetLayoutObject.device == device)
4487
4488 State.DescriptorSetLayouts[descriptorSetLayout] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004489}
4490
4491@threadSafety("system")
4492cmd VkResult vkCreateDescriptorPool(
4493 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004494 const VkDescriptorPoolCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004495 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004496 VkDescriptorPool* pDescriptorPool) {
4497 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO)
4498 deviceObject := GetDevice(device)
4499
4500 descriptorPool := ?
4501 pDescriptorPool[0] = descriptorPool
4502 State.DescriptorPools[descriptorPool] = new!DescriptorPoolObject(device: device)
4503
4504 return ?
4505}
4506
4507@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004508cmd void vkDestroyDescriptorPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004509 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004510 VkDescriptorPool descriptorPool,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004511 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004512 deviceObject := GetDevice(device)
4513 descriptorPoolObject := GetDescriptorPool(descriptorPool)
4514 assert(descriptorPoolObject.device == device)
4515
4516 State.DescriptorPools[descriptorPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004517}
4518
4519@threadSafety("app")
4520cmd VkResult vkResetDescriptorPool(
4521 VkDevice device,
Jesse Hallfbf97b02015-11-20 14:17:03 -08004522 VkDescriptorPool descriptorPool,
4523 VkDescriptorPoolResetFlags flags) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004524 deviceObject := GetDevice(device)
4525 descriptorPoolObject := GetDescriptorPool(descriptorPool)
4526 assert(descriptorPoolObject.device == device)
4527
4528 return ?
4529}
4530
4531@threadSafety("app")
Jesse Hall3fbc8562015-11-29 22:10:52 -08004532cmd VkResult vkAllocateDescriptorSets(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004533 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004534 const VkDescriptorSetAllocateInfo* pAllocateInfo,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004535 VkDescriptorSet* pDescriptorSets) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004536 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004537 allocInfo := pAllocateInfo[0]
Jesse Hallfbf97b02015-11-20 14:17:03 -08004538 descriptorPoolObject := GetDescriptorPool(allocInfo.descriptorPool)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004539
Jesse Hall03b6fe12015-11-24 12:44:21 -08004540 setLayouts := allocInfo.pSetLayouts[0:allocInfo.setCount]
4541 for i in (0 .. allocInfo.setCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004542 setLayout := setLayouts[i]
4543 setLayoutObject := GetDescriptorSetLayout(setLayout)
4544 assert(setLayoutObject.device == device)
4545 }
4546
Jesse Hall03b6fe12015-11-24 12:44:21 -08004547 descriptorSets := pDescriptorSets[0:allocInfo.setCount]
4548 for i in (0 .. allocInfo.setCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004549 descriptorSet := ?
4550 descriptorSets[i] = descriptorSet
4551 State.DescriptorSets[descriptorSet] = new!DescriptorSetObject(device: device)
4552 }
4553
4554 return ?
4555}
4556
Jesse Hallf09c6b12015-08-15 19:54:28 -07004557cmd VkResult vkFreeDescriptorSets(
4558 VkDevice device,
4559 VkDescriptorPool descriptorPool,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004560 u32 descriptorSetCount,
Jesse Hallf09c6b12015-08-15 19:54:28 -07004561 const VkDescriptorSet* pDescriptorSets) {
4562 deviceObject := GetDevice(device)
4563 descriptorPoolObject := GetDescriptorPool(descriptorPool)
4564
Jesse Hall03b6fe12015-11-24 12:44:21 -08004565 descriptorSets := pDescriptorSets[0:descriptorSetCount]
4566 for i in (0 .. descriptorSetCount) {
Jesse Hallf09c6b12015-08-15 19:54:28 -07004567 descriptorSet := descriptorSets[i]
4568 descriptorSetObject := GetDescriptorSet(descriptorSet)
4569 assert(descriptorSetObject.device == device)
4570 State.DescriptorSets[descriptorSet] = null
4571 }
4572
4573 return ?
4574}
4575
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004576cmd void vkUpdateDescriptorSets(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004577 VkDevice device,
Jesse Hallb00daad2015-11-29 19:46:20 -08004578 u32 descriptorWriteCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004579 const VkWriteDescriptorSet* pDescriptorWrites,
Jesse Hallb00daad2015-11-29 19:46:20 -08004580 u32 descriptorCopyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004581 const VkCopyDescriptorSet* pDescriptorCopies) {
4582 deviceObject := GetDevice(device)
4583
Jesse Hallb00daad2015-11-29 19:46:20 -08004584 descriptorWrites := pDescriptorWrites[0:descriptorWriteCount]
4585 for i in (0 .. descriptorWriteCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004586 descriptorWrite := descriptorWrites[i]
Jesse Hall3fbc8562015-11-29 22:10:52 -08004587 descriptorWriteObject := GetDescriptorSet(descriptorWrite.dstSet)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004588 assert(descriptorWriteObject.device == device)
4589 }
4590
Jesse Hallb00daad2015-11-29 19:46:20 -08004591 descriptorCopies := pDescriptorCopies[0:descriptorCopyCount]
4592 for i in (0 .. descriptorCopyCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004593 descriptorCopy := descriptorCopies[i]
Jesse Hall3fbc8562015-11-29 22:10:52 -08004594 descriptorCopyObject := GetDescriptorSet(descriptorCopy.dstSet)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004595 assert(descriptorCopyObject.device == device)
4596 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07004597}
4598
4599
4600// Framebuffer functions
4601
4602@threadSafety("system")
4603cmd VkResult vkCreateFramebuffer(
4604 VkDevice device,
4605 const VkFramebufferCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004606 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004607 VkFramebuffer* pFramebuffer) {
4608 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO)
4609 deviceObject := GetDevice(device)
4610
4611 framebuffer := ?
4612 pFramebuffer[0] = framebuffer
4613 State.Framebuffers[framebuffer] = new!FramebufferObject(device: device)
4614
4615 return ?
4616}
4617
4618@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004619cmd void vkDestroyFramebuffer(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004620 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004621 VkFramebuffer framebuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004622 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004623 deviceObject := GetDevice(device)
4624 framebufferObject := GetFramebuffer(framebuffer)
4625 assert(framebufferObject.device == device)
4626
4627 State.Framebuffers[framebuffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004628}
4629
4630
4631// Renderpass functions
4632
4633@threadSafety("system")
4634cmd VkResult vkCreateRenderPass(
4635 VkDevice device,
4636 const VkRenderPassCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004637 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004638 VkRenderPass* pRenderPass) {
4639 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO)
4640 deviceObject := GetDevice(device)
4641
4642 renderpass := ?
4643 pRenderPass[0] = renderpass
4644 State.RenderPasses[renderpass] = new!RenderPassObject(device: device)
4645
4646 return ?
4647}
4648
4649@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004650cmd void vkDestroyRenderPass(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004651 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004652 VkRenderPass renderPass,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004653 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004654 deviceObject := GetDevice(device)
4655 renderPassObject := GetRenderPass(renderPass)
4656 assert(renderPassObject.device == device)
4657
4658 State.RenderPasses[renderPass] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004659}
4660
Jesse Hall606a54e2015-11-19 22:17:28 -08004661cmd void vkGetRenderAreaGranularity(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004662 VkDevice device,
4663 VkRenderPass renderPass,
4664 VkExtent2D* pGranularity) {
4665 deviceObject := GetDevice(device)
4666 renderPassObject := GetRenderPass(renderPass)
4667
4668 granularity := ?
4669 pGranularity[0] = granularity
Jesse Halld27f6aa2015-08-15 17:58:48 -07004670}
4671
4672// Command pool functions
4673
4674cmd VkResult vkCreateCommandPool(
4675 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004676 const VkCommandPoolCreateInfo* pCreateInfo,
4677 const VkAllocationCallbacks* pAllocator,
4678 VkCommandPool* pCommandPool) {
4679 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004680 deviceObject := GetDevice(device)
4681
Jesse Hall3fbc8562015-11-29 22:10:52 -08004682 commandPool := ?
4683 pCommandPool[0] = commandPool
4684 State.CommandPools[commandPool] = new!CommandPoolObject(device: device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004685
4686 return ?
4687}
4688
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004689cmd void vkDestroyCommandPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004690 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004691 VkCommandPool commandPool,
4692 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004693 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004694 commandPoolObject := GetCommandPool(commandPool)
4695 assert(commandPoolObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004696
Jesse Hall3fbc8562015-11-29 22:10:52 -08004697 State.CommandPools[commandPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004698}
4699
4700cmd VkResult vkResetCommandPool(
4701 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004702 VkCommandPool commandPool,
4703 VkCommandPoolResetFlags flags) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004704 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004705 commandPoolObject := GetCommandPool(commandPool)
4706 assert(commandPoolObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004707
4708 return ?
4709}
4710
4711// Command buffer functions
4712
Jesse Hall3fbc8562015-11-29 22:10:52 -08004713macro void bindCommandBuffer(VkCommandBuffer commandBuffer, any obj, VkDeviceMemory memory) {
4714 memoryObject := GetDeviceMemory(memory)
4715 memoryObject.boundCommandBuffers[commandBuffer] = commandBuffer
Jesse Halld27f6aa2015-08-15 17:58:48 -07004716
Jesse Hall3fbc8562015-11-29 22:10:52 -08004717 commandBufferObject := GetCommandBuffer(commandBuffer)
4718 commandBufferObject.boundObjects[as!u64(obj)] = memory
Jesse Halld27f6aa2015-08-15 17:58:48 -07004719}
4720
Jesse Hall3fbc8562015-11-29 22:10:52 -08004721macro void unbindCommandBuffer(VkCommandBuffer commandBuffer, any obj, VkDeviceMemory memory) {
4722 memoryObject := GetDeviceMemory(memory)
4723 memoryObject.boundCommandBuffers[commandBuffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004724
Jesse Hall3fbc8562015-11-29 22:10:52 -08004725 commandBufferObject := GetCommandBuffer(commandBuffer)
4726 commandBufferObject.boundObjects[as!u64(obj)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004727}
4728
4729@threadSafety("system")
Jesse Hall3fbc8562015-11-29 22:10:52 -08004730cmd VkResult vkAllocateCommandBuffers(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004731 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004732 const VkCommandBufferAllocateInfo* pAllocateInfo,
4733 VkCommandBuffer* pCommandBuffers) {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08004734 assert(pAllocateInfo[0].sType == VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004735
Jesse Hall3dd678a2016-01-08 21:52:01 -08004736 count := pAllocateInfo[0].commandBufferCount
Jesse Hall3fbc8562015-11-29 22:10:52 -08004737 commandBuffers := pCommandBuffers[0:count]
Jesse Hallfbf97b02015-11-20 14:17:03 -08004738 for i in (0 .. count) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004739 commandBuffer := ?
4740 commandBuffers[i] = commandBuffer
4741 State.CommandBuffers[commandBuffer] = new!CommandBufferObject(device: device)
Jesse Hallfbf97b02015-11-20 14:17:03 -08004742 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07004743
4744 return ?
4745}
4746
4747@threadSafety("system")
Jesse Hallfbf97b02015-11-20 14:17:03 -08004748cmd void vkFreeCommandBuffers(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004749 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004750 VkCommandPool commandPool,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004751 u32 commandBufferCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004752 const VkCommandBuffer* pCommandBuffers) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004753 deviceObject := GetDevice(device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004754
Jesse Hall3fbc8562015-11-29 22:10:52 -08004755 commandBuffers := pCommandBuffers[0:commandBufferCount]
Jesse Hall03b6fe12015-11-24 12:44:21 -08004756 for i in (0 .. commandBufferCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004757 commandBufferObject := GetCommandBuffer(commandBuffers[i])
4758 assert(commandBufferObject.device == device)
Jesse Hallfbf97b02015-11-20 14:17:03 -08004759 // TODO: iterate over boundObjects and clear memory bindings
Jesse Hall3fbc8562015-11-29 22:10:52 -08004760 State.CommandBuffers[commandBuffers[i]] = null
Jesse Hallfbf97b02015-11-20 14:17:03 -08004761 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07004762}
4763
4764@threadSafety("app")
4765cmd VkResult vkBeginCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004766 VkCommandBuffer commandBuffer,
4767 const VkCommandBufferBeginInfo* pBeginInfo) {
4768 assert(pBeginInfo.sType == VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO)
4769 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004770
4771 // TODO: iterate over boundObjects and clear memory bindings
4772
4773 return ?
4774}
4775
4776@threadSafety("app")
4777cmd VkResult vkEndCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004778 VkCommandBuffer commandBuffer) {
4779 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004780
4781 return ?
4782}
4783
4784@threadSafety("app")
4785cmd VkResult vkResetCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004786 VkCommandBuffer commandBuffer,
4787 VkCommandBufferResetFlags flags) {
4788 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004789
4790 // TODO: iterate over boundObjects and clear memory bindings
4791
4792 return ?
4793}
4794
4795
4796// Command buffer building functions
4797
4798@threadSafety("app")
4799cmd void vkCmdBindPipeline(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004800 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004801 VkPipelineBindPoint pipelineBindPoint,
4802 VkPipeline pipeline) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004803 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004804 pipelineObject := GetPipeline(pipeline)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004805 assert(commandBufferObject.device == pipelineObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004806
Jesse Halld8bade02015-11-24 10:24:18 -08004807 queue := switch (pipelineBindPoint) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004808 case VK_PIPELINE_BIND_POINT_COMPUTE: VK_QUEUE_COMPUTE_BIT
4809 case VK_PIPELINE_BIND_POINT_GRAPHICS: VK_QUEUE_GRAPHICS_BIT
4810 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08004811 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004812}
4813
4814@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004815cmd void vkCmdSetViewport(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004816 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004817 u32 firstViewport,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004818 u32 viewportCount,
4819 const VkViewport* pViewports) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004820 commandBufferObject := GetCommandBuffer(commandBuffer)
4821 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004822}
4823
4824@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004825cmd void vkCmdSetScissor(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004826 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004827 u32 firstScissor,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004828 u32 scissorCount,
4829 const VkRect2D* pScissors) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004830 commandBufferObject := GetCommandBuffer(commandBuffer)
4831 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004832}
4833
4834@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004835cmd void vkCmdSetLineWidth(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004836 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004837 f32 lineWidth) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004838 commandBufferObject := GetCommandBuffer(commandBuffer)
4839 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004840}
4841
4842@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004843cmd void vkCmdSetDepthBias(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004844 VkCommandBuffer commandBuffer,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004845 f32 depthBiasConstantFactor,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004846 f32 depthBiasClamp,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004847 f32 depthBiasSlopeFactor) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004848 commandBufferObject := GetCommandBuffer(commandBuffer)
4849 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004850}
Jesse Halld27f6aa2015-08-15 17:58:48 -07004851
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004852@threadSafety("app")
4853cmd void vkCmdSetBlendConstants(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004854 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004855 // TODO(jessehall): apic only supports 'const' on pointer types. Using
4856 // an annotation as a quick hack to pass this to the template without
4857 // having to modify the AST and semantic model.
Jesse Hallb00daad2015-11-29 19:46:20 -08004858 @readonly f32[4] blendConstants) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004859 commandBufferObject := GetCommandBuffer(commandBuffer)
4860 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004861}
4862
4863@threadSafety("app")
4864cmd void vkCmdSetDepthBounds(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004865 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004866 f32 minDepthBounds,
4867 f32 maxDepthBounds) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004868 commandBufferObject := GetCommandBuffer(commandBuffer)
4869 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004870}
4871
4872@threadSafety("app")
4873cmd void vkCmdSetStencilCompareMask(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004874 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004875 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08004876 u32 compareMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004877 commandBufferObject := GetCommandBuffer(commandBuffer)
4878 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004879}
4880
4881@threadSafety("app")
4882cmd void vkCmdSetStencilWriteMask(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004883 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004884 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08004885 u32 writeMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004886 commandBufferObject := GetCommandBuffer(commandBuffer)
4887 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004888}
4889
4890@threadSafety("app")
4891cmd void vkCmdSetStencilReference(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004892 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004893 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08004894 u32 reference) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004895 commandBufferObject := GetCommandBuffer(commandBuffer)
4896 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004897}
4898
4899@threadSafety("app")
4900cmd void vkCmdBindDescriptorSets(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004901 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004902 VkPipelineBindPoint pipelineBindPoint,
4903 VkPipelineLayout layout,
4904 u32 firstSet,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004905 u32 descriptorSetCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004906 const VkDescriptorSet* pDescriptorSets,
4907 u32 dynamicOffsetCount,
4908 const u32* pDynamicOffsets) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004909 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004910
Jesse Hall03b6fe12015-11-24 12:44:21 -08004911 descriptorSets := pDescriptorSets[0:descriptorSetCount]
4912 for i in (0 .. descriptorSetCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004913 descriptorSet := descriptorSets[i]
4914 descriptorSetObject := GetDescriptorSet(descriptorSet)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004915 assert(commandBufferObject.device == descriptorSetObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004916 }
4917
4918 dynamicOffsets := pDynamicOffsets[0:dynamicOffsetCount]
4919 for i in (0 .. dynamicOffsetCount) {
4920 dynamicOffset := dynamicOffsets[i]
4921 }
4922
Jesse Halld8bade02015-11-24 10:24:18 -08004923 queue := switch (pipelineBindPoint) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004924 case VK_PIPELINE_BIND_POINT_COMPUTE: VK_QUEUE_COMPUTE_BIT
4925 case VK_PIPELINE_BIND_POINT_GRAPHICS: VK_QUEUE_GRAPHICS_BIT
4926 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08004927 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004928}
4929
4930@threadSafety("app")
4931cmd void vkCmdBindIndexBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004932 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004933 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004934 VkDeviceSize offset,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004935 VkIndexType indexType) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004936 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004937 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004938 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004939
Jesse Hall3fbc8562015-11-29 22:10:52 -08004940 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004941
Jesse Hall3fbc8562015-11-29 22:10:52 -08004942 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004943}
4944
4945@threadSafety("app")
4946cmd void vkCmdBindVertexBuffers(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004947 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004948 u32 firstBinding,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004949 u32 bindingCount,
4950 const VkBuffer* pBuffers,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004951 const VkDeviceSize* pOffsets) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004952 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004953
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004954 // TODO: check if not [firstBinding:firstBinding+bindingCount]
Jesse Halld27f6aa2015-08-15 17:58:48 -07004955 buffers := pBuffers[0:bindingCount]
4956 offsets := pOffsets[0:bindingCount]
4957 for i in (0 .. bindingCount) {
4958 buffer := buffers[i]
4959 offset := offsets[i]
4960 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004961 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004962
Jesse Hall3fbc8562015-11-29 22:10:52 -08004963 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004964 }
4965
Jesse Hall3fbc8562015-11-29 22:10:52 -08004966 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004967}
4968
4969@threadSafety("app")
4970cmd void vkCmdDraw(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004971 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004972 u32 vertexCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004973 u32 instanceCount,
4974 u32 firstVertex,
4975 u32 firstInstance) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004976 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004977
Jesse Hall3fbc8562015-11-29 22:10:52 -08004978 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004979}
4980
4981@threadSafety("app")
4982cmd void vkCmdDrawIndexed(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004983 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004984 u32 indexCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004985 u32 instanceCount,
4986 u32 firstIndex,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004987 s32 vertexOffset,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004988 u32 firstInstance) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004989 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004990
Jesse Hall3fbc8562015-11-29 22:10:52 -08004991 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004992}
4993
4994@threadSafety("app")
4995cmd void vkCmdDrawIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004996 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004997 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004998 VkDeviceSize offset,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004999 u32 drawCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005000 u32 stride) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005001 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005002 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005003 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005004
Jesse Hall3fbc8562015-11-29 22:10:52 -08005005 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005006
Jesse Hall3fbc8562015-11-29 22:10:52 -08005007 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005008}
5009
5010@threadSafety("app")
5011cmd void vkCmdDrawIndexedIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005012 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005013 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005014 VkDeviceSize offset,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005015 u32 drawCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005016 u32 stride) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005017 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005018 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005019 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005020
Jesse Hall3fbc8562015-11-29 22:10:52 -08005021 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005022
Jesse Hall3fbc8562015-11-29 22:10:52 -08005023 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005024}
5025
5026@threadSafety("app")
5027cmd void vkCmdDispatch(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005028 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005029 u32 x,
5030 u32 y,
5031 u32 z) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005032 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005033
Jesse Hall3fbc8562015-11-29 22:10:52 -08005034 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_COMPUTE_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005035}
5036
5037@threadSafety("app")
5038cmd void vkCmdDispatchIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005039 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005040 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005041 VkDeviceSize offset) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005042 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005043 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005044 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005045
Jesse Hall3fbc8562015-11-29 22:10:52 -08005046 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005047
Jesse Hall3fbc8562015-11-29 22:10:52 -08005048 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_COMPUTE_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005049}
5050
5051@threadSafety("app")
5052cmd void vkCmdCopyBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005053 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005054 VkBuffer srcBuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005055 VkBuffer dstBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005056 u32 regionCount,
5057 const VkBufferCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005058 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005059 srcBufferObject := GetBuffer(srcBuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005060 dstBufferObject := GetBuffer(dstBuffer)
5061 assert(commandBufferObject.device == srcBufferObject.device)
5062 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005063
5064 regions := pRegions[0:regionCount]
5065 for i in (0 .. regionCount) {
5066 region := regions[i]
5067 }
5068
Jesse Hall3fbc8562015-11-29 22:10:52 -08005069 bindCommandBuffer(commandBuffer, srcBuffer, srcBufferObject.memory)
5070 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005071
Jesse Hall65ab5522015-11-30 00:07:16 -08005072 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005073}
5074
5075@threadSafety("app")
5076cmd void vkCmdCopyImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005077 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005078 VkImage srcImage,
5079 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005080 VkImage dstImage,
5081 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005082 u32 regionCount,
5083 const VkImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005084 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005085 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005086 dstImageObject := GetImage(dstImage)
5087 assert(commandBufferObject.device == srcImageObject.device)
5088 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005089
5090 regions := pRegions[0:regionCount]
5091 for i in (0 .. regionCount) {
5092 region := regions[i]
5093 }
5094
Jesse Hall3fbc8562015-11-29 22:10:52 -08005095 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
5096 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005097
Jesse Hall65ab5522015-11-30 00:07:16 -08005098 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005099}
5100
5101@threadSafety("app")
5102cmd void vkCmdBlitImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005103 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005104 VkImage srcImage,
5105 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005106 VkImage dstImage,
5107 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005108 u32 regionCount,
5109 const VkImageBlit* pRegions,
Jesse Hall23ff73f2015-11-29 14:36:39 -08005110 VkFilter filter) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005111 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005112 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005113 dstImageObject := GetImage(dstImage)
5114 assert(commandBufferObject.device == srcImageObject.device)
5115 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005116
5117 regions := pRegions[0:regionCount]
5118 for i in (0 .. regionCount) {
5119 region := regions[i]
5120 }
5121
Jesse Hall3fbc8562015-11-29 22:10:52 -08005122 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
5123 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005124
Jesse Hall3fbc8562015-11-29 22:10:52 -08005125 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005126}
5127
5128@threadSafety("app")
5129cmd void vkCmdCopyBufferToImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005130 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005131 VkBuffer srcBuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005132 VkImage dstImage,
5133 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005134 u32 regionCount,
5135 const VkBufferImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005136 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005137 srcBufferObject := GetBuffer(srcBuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005138 dstImageObject := GetImage(dstImage)
5139 assert(commandBufferObject.device == srcBufferObject.device)
5140 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005141
5142 regions := pRegions[0:regionCount]
5143 for i in (0 .. regionCount) {
5144 region := regions[i]
5145 }
5146
Jesse Hall3fbc8562015-11-29 22:10:52 -08005147 bindCommandBuffer(commandBuffer, srcBuffer, srcBufferObject.memory)
5148 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005149
Jesse Hall65ab5522015-11-30 00:07:16 -08005150 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005151}
5152
5153@threadSafety("app")
5154cmd void vkCmdCopyImageToBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005155 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005156 VkImage srcImage,
5157 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005158 VkBuffer dstBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005159 u32 regionCount,
5160 const VkBufferImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005161 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005162 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005163 dstBufferObject := GetBuffer(dstBuffer)
5164 assert(commandBufferObject.device == srcImageObject.device)
5165 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005166
5167 regions := pRegions[0:regionCount]
5168 for i in (0 .. regionCount) {
5169 region := regions[i]
5170 }
5171
Jesse Hall3fbc8562015-11-29 22:10:52 -08005172 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
5173 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005174
Jesse Hall65ab5522015-11-30 00:07:16 -08005175 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005176}
5177
5178@threadSafety("app")
5179cmd void vkCmdUpdateBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005180 VkCommandBuffer commandBuffer,
5181 VkBuffer dstBuffer,
5182 VkDeviceSize dstOffset,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005183 VkDeviceSize dataSize,
Jesse Hall56d386a2016-07-26 15:20:40 -07005184 const void* pData) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005185 commandBufferObject := GetCommandBuffer(commandBuffer)
5186 dstBufferObject := GetBuffer(dstBuffer)
5187 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005188
5189 data := pData[0:dataSize]
5190
Jesse Hall3fbc8562015-11-29 22:10:52 -08005191 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005192
Jesse Hall65ab5522015-11-30 00:07:16 -08005193 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005194}
5195
5196@threadSafety("app")
5197cmd void vkCmdFillBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005198 VkCommandBuffer commandBuffer,
5199 VkBuffer dstBuffer,
5200 VkDeviceSize dstOffset,
Jesse Hallb00daad2015-11-29 19:46:20 -08005201 VkDeviceSize size,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005202 u32 data) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005203 commandBufferObject := GetCommandBuffer(commandBuffer)
5204 dstBufferObject := GetBuffer(dstBuffer)
5205 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005206
Jesse Hall65ab5522015-11-30 00:07:16 -08005207 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005208}
5209
5210@threadSafety("app")
5211cmd void vkCmdClearColorImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005212 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005213 VkImage image,
5214 VkImageLayout imageLayout,
5215 const VkClearColorValue* pColor,
5216 u32 rangeCount,
5217 const VkImageSubresourceRange* pRanges) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005218 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005219 imageObject := GetImage(image)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005220 assert(commandBufferObject.device == imageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005221
5222 ranges := pRanges[0:rangeCount]
5223 for i in (0 .. rangeCount) {
5224 range := ranges[i]
5225 }
5226
Jesse Hall3fbc8562015-11-29 22:10:52 -08005227 bindCommandBuffer(commandBuffer, image, imageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005228
Jesse Hall3fbc8562015-11-29 22:10:52 -08005229 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005230}
5231
5232@threadSafety("app")
5233cmd void vkCmdClearDepthStencilImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005234 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005235 VkImage image,
5236 VkImageLayout imageLayout,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005237 const VkClearDepthStencilValue* pDepthStencil,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005238 u32 rangeCount,
5239 const VkImageSubresourceRange* pRanges) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005240 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005241 imageObject := GetImage(image)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005242 assert(commandBufferObject.device == imageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005243
5244 ranges := pRanges[0:rangeCount]
5245 for i in (0 .. rangeCount) {
5246 range := ranges[i]
5247 }
5248
Jesse Hall3fbc8562015-11-29 22:10:52 -08005249 bindCommandBuffer(commandBuffer, image, imageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005250
Jesse Hall3fbc8562015-11-29 22:10:52 -08005251 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005252}
5253
5254@threadSafety("app")
Jesse Hallae38f732015-11-19 21:32:50 -08005255cmd void vkCmdClearAttachments(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005256 VkCommandBuffer commandBuffer,
Jesse Hallae38f732015-11-19 21:32:50 -08005257 u32 attachmentCount,
5258 const VkClearAttachment* pAttachments,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005259 u32 rectCount,
Jesse Halla15a4bf2015-11-19 22:48:02 -08005260 const VkClearRect* pRects) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005261 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005262
5263 rects := pRects[0:rectCount]
5264 for i in (0 .. rectCount) {
5265 rect := rects[i]
5266 }
5267
Jesse Hall3fbc8562015-11-29 22:10:52 -08005268 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005269}
5270
5271@threadSafety("app")
5272cmd void vkCmdResolveImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005273 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005274 VkImage srcImage,
5275 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005276 VkImage dstImage,
5277 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005278 u32 regionCount,
5279 const VkImageResolve* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005280 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005281 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005282 dstImageObject := GetImage(dstImage)
5283 assert(commandBufferObject.device == srcImageObject.device)
5284 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005285
5286 regions := pRegions[0:regionCount]
5287 for i in (0 .. regionCount) {
5288 region := regions[i]
5289 }
5290
Jesse Hall3fbc8562015-11-29 22:10:52 -08005291 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
5292 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005293
Jesse Hall3fbc8562015-11-29 22:10:52 -08005294 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005295}
5296
5297@threadSafety("app")
5298cmd void vkCmdSetEvent(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005299 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005300 VkEvent event,
5301 VkPipelineStageFlags stageMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005302 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005303 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005304 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005305}
5306
5307@threadSafety("app")
5308cmd void vkCmdResetEvent(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005309 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005310 VkEvent event,
5311 VkPipelineStageFlags stageMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005312 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005313 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005314 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005315}
5316
5317@threadSafety("app")
5318cmd void vkCmdWaitEvents(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005319 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005320 u32 eventCount,
5321 const VkEvent* pEvents,
5322 VkPipelineStageFlags srcStageMask,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005323 VkPipelineStageFlags dstStageMask,
5324 u32 memoryBarrierCount,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005325 const VkMemoryBarrier* pMemoryBarriers,
5326 u32 bufferMemoryBarrierCount,
5327 const VkBufferMemoryBarrier* pBufferMemoryBarriers,
5328 u32 imageMemoryBarrierCount,
5329 const VkImageMemoryBarrier* pImageMemoryBarriers) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005330 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005331
5332 events := pEvents[0:eventCount]
5333 for i in (0 .. eventCount) {
5334 event := events[i]
5335 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005336 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005337 }
5338
Jesse Hall3dd678a2016-01-08 21:52:01 -08005339 memoryBarriers := pMemoryBarriers[0:memoryBarrierCount]
Jesse Hall3fbc8562015-11-29 22:10:52 -08005340 for i in (0 .. memoryBarrierCount) {
Jesse Hall3dd678a2016-01-08 21:52:01 -08005341 memoryBarrier := memoryBarriers[i]
5342 }
5343 bufferMemoryBarriers := pBufferMemoryBarriers[0:bufferMemoryBarrierCount]
5344 for i in (0 .. bufferMemoryBarrierCount) {
5345 bufferMemoryBarrier := bufferMemoryBarriers[i]
5346 bufferObject := GetBuffer(bufferMemoryBarrier.buffer)
5347 assert(bufferObject.device == commandBufferObject.device)
5348 }
5349 imageMemoryBarriers := pImageMemoryBarriers[0:imageMemoryBarrierCount]
5350 for i in (0 .. imageMemoryBarrierCount) {
5351 imageMemoryBarrier := imageMemoryBarriers[i]
5352 imageObject := GetImage(imageMemoryBarrier.image)
5353 assert(imageObject.device == commandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005354 }
5355}
5356
5357@threadSafety("app")
5358cmd void vkCmdPipelineBarrier(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005359 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005360 VkPipelineStageFlags srcStageMask,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005361 VkPipelineStageFlags dstStageMask,
Jesse Halldc6d36c2015-11-29 19:12:15 -08005362 VkDependencyFlags dependencyFlags,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005363 u32 memoryBarrierCount,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005364 const VkMemoryBarrier* pMemoryBarriers,
5365 u32 bufferMemoryBarrierCount,
5366 const VkBufferMemoryBarrier* pBufferMemoryBarriers,
5367 u32 imageMemoryBarrierCount,
5368 const VkImageMemoryBarrier* pImageMemoryBarriers) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005369 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005370
Jesse Hall3dd678a2016-01-08 21:52:01 -08005371 memoryBarriers := pMemoryBarriers[0:memoryBarrierCount]
Jesse Hall3fbc8562015-11-29 22:10:52 -08005372 for i in (0 .. memoryBarrierCount) {
Jesse Hall3dd678a2016-01-08 21:52:01 -08005373 memoryBarrier := memoryBarriers[i]
5374 }
5375 bufferMemoryBarriers := pBufferMemoryBarriers[0:bufferMemoryBarrierCount]
5376 for i in (0 .. bufferMemoryBarrierCount) {
5377 bufferMemoryBarrier := bufferMemoryBarriers[i]
5378 bufferObject := GetBuffer(bufferMemoryBarrier.buffer)
5379 assert(bufferObject.device == commandBufferObject.device)
5380 }
5381 imageMemoryBarriers := pImageMemoryBarriers[0:imageMemoryBarrierCount]
5382 for i in (0 .. imageMemoryBarrierCount) {
5383 imageMemoryBarrier := imageMemoryBarriers[i]
5384 imageObject := GetImage(imageMemoryBarrier.image)
5385 assert(imageObject.device == commandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005386 }
5387}
5388
5389@threadSafety("app")
5390cmd void vkCmdBeginQuery(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005391 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005392 VkQueryPool queryPool,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005393 u32 query,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005394 VkQueryControlFlags flags) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005395 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005396 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005397 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005398}
5399
5400@threadSafety("app")
5401cmd void vkCmdEndQuery(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005402 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005403 VkQueryPool queryPool,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005404 u32 query) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005405 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005406 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005407 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005408}
5409
5410@threadSafety("app")
5411cmd void vkCmdResetQueryPool(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005412 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005413 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005414 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005415 u32 queryCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005416 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005417 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005418 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005419}
5420
5421@threadSafety("app")
5422cmd void vkCmdWriteTimestamp(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005423 VkCommandBuffer commandBuffer,
Jesse Hall6f39a6d2015-11-24 11:08:36 -08005424 VkPipelineStageFlagBits pipelineStage,
Jesse Halla3a7a1d2015-11-24 11:37:23 -08005425 VkQueryPool queryPool,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005426 u32 query) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005427 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halla3a7a1d2015-11-24 11:37:23 -08005428 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005429 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005430}
5431
5432@threadSafety("app")
5433cmd void vkCmdCopyQueryPoolResults(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005434 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005435 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005436 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005437 u32 queryCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005438 VkBuffer dstBuffer,
5439 VkDeviceSize dstOffset,
Jesse Halla9bb62b2015-11-21 19:31:56 -08005440 VkDeviceSize stride,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005441 VkQueryResultFlags flags) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005442 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005443 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005444 dstBufferObject := GetBuffer(dstBuffer)
5445 assert(commandBufferObject.device == queryPoolObject.device)
5446 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005447}
5448
5449cmd void vkCmdPushConstants(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005450 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005451 VkPipelineLayout layout,
5452 VkShaderStageFlags stageFlags,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005453 u32 offset,
5454 u32 size,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08005455 const void* pValues) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005456 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005457 layoutObject := GetPipelineLayout(layout)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005458 assert(commandBufferObject.device == layoutObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005459}
5460
5461@threadSafety("app")
5462cmd void vkCmdBeginRenderPass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005463 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005464 const VkRenderPassBeginInfo* pRenderPassBegin,
Jesse Hall65ab5522015-11-30 00:07:16 -08005465 VkSubpassContents contents) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005466 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005467 renderPassObject := GetRenderPass(pRenderPassBegin.renderPass)
5468 framebufferObject := GetFramebuffer(pRenderPassBegin.framebuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005469 assert(commandBufferObject.device == renderPassObject.device)
5470 assert(commandBufferObject.device == framebufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005471
Jesse Hall3fbc8562015-11-29 22:10:52 -08005472 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005473}
5474
5475cmd void vkCmdNextSubpass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005476 VkCommandBuffer commandBuffer,
Jesse Hall65ab5522015-11-30 00:07:16 -08005477 VkSubpassContents contents) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005478 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005479}
5480
5481@threadSafety("app")
5482cmd void vkCmdEndRenderPass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005483 VkCommandBuffer commandBuffer) {
5484 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005485
Jesse Hall3fbc8562015-11-29 22:10:52 -08005486 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005487}
5488
5489cmd void vkCmdExecuteCommands(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005490 VkCommandBuffer commandBuffer,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005491 u32 commandBufferCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005492 const VkCommandBuffer* pCommandBuffers) {
5493 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005494
Jesse Hall3dd678a2016-01-08 21:52:01 -08005495 commandBuffers := pCommandBuffers[0:commandBufferCount]
5496 for i in (0 .. commandBufferCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005497 secondaryCommandBuffer := commandBuffers[i]
5498 secondaryCommandBufferObject := GetCommandBuffer(secondaryCommandBuffer)
5499 assert(commandBufferObject.device == secondaryCommandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005500 }
5501}
5502
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005503@extension("VK_KHR_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005504cmd void vkDestroySurfaceKHR(
5505 VkInstance instance,
Jesse Hall0e74f002015-11-30 11:37:59 -08005506 VkSurfaceKHR surface,
5507 const VkAllocationCallbacks* pAllocator) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005508 instanceObject := GetInstance(instance)
5509 surfaceObject := GetSurface(surface)
5510 assert(surfaceObject.instance == instance)
Michael Lentine88594d72015-11-12 12:49:45 -08005511
Jesse Hall1356b0d2015-11-23 17:24:58 -08005512 State.Surfaces[surface] = null
Jesse Hall2818f932015-11-19 21:19:17 -08005513}
5514
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005515@extension("VK_KHR_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005516cmd VkResult vkGetPhysicalDeviceSurfaceSupportKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005517 VkPhysicalDevice physicalDevice,
5518 u32 queueFamilyIndex,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005519 VkSurfaceKHR surface,
Jesse Hallb00daad2015-11-29 19:46:20 -08005520 VkBool32* pSupported) {
5521 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08005522
5523 return ?
5524}
5525
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005526@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08005527cmd VkResult vkGetPhysicalDeviceSurfaceCapabilitiesKHR(
5528 VkPhysicalDevice physicalDevice,
5529 VkSurfaceKHR surface,
5530 VkSurfaceCapabilitiesKHR* pSurfaceCapabilities) {
5531 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5532
5533 surfaceCapabilities := ?
5534 pSurfaceCapabilities[0] = surfaceCapabilities
5535
5536 return ?
5537}
5538
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005539@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08005540cmd VkResult vkGetPhysicalDeviceSurfaceFormatsKHR(
5541 VkPhysicalDevice physicalDevice,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005542 VkSurfaceKHR surface,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005543 u32* pSurfaceFormatCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005544 VkSurfaceFormatKHR* pSurfaceFormats) {
Jesse Hallb00daad2015-11-29 19:46:20 -08005545 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08005546
5547 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08005548 pSurfaceFormatCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08005549 surfaceFormats := pSurfaceFormats[0:count]
5550
5551 for i in (0 .. count) {
5552 surfaceFormat := ?
5553 surfaceFormats[i] = surfaceFormat
5554 }
5555
5556 return ?
5557}
5558
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005559@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08005560cmd VkResult vkGetPhysicalDeviceSurfacePresentModesKHR(
5561 VkPhysicalDevice physicalDevice,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005562 VkSurfaceKHR surface,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005563 u32* pPresentModeCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005564 VkPresentModeKHR* pPresentModes) {
Jesse Hallb00daad2015-11-29 19:46:20 -08005565 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08005566
5567 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08005568 pPresentModeCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08005569 presentModes := pPresentModes[0:count]
5570
5571 for i in (0 .. count) {
5572 presentMode := ?
5573 presentModes[i] = presentMode
5574 }
5575
5576 return ?
5577}
5578
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005579@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005580cmd VkResult vkCreateSwapchainKHR(
5581 VkDevice device,
5582 const VkSwapchainCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005583 const VkAllocationCallbacks* pAllocator,
Michael Lentine88594d72015-11-12 12:49:45 -08005584 VkSwapchainKHR* pSwapchain) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005585 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR)
Michael Lentine88594d72015-11-12 12:49:45 -08005586 deviceObject := GetDevice(device)
5587
5588 swapchain := ?
5589 pSwapchain[0] = swapchain
5590 State.Swapchains[swapchain] = new!SwapchainObject(device: device)
5591
5592 return ?
5593}
5594
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005595@extension("VK_KHR_swapchain")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005596cmd void vkDestroySwapchainKHR(
Michael Lentine88594d72015-11-12 12:49:45 -08005597 VkDevice device,
Jesse Hall0e74f002015-11-30 11:37:59 -08005598 VkSwapchainKHR swapchain,
5599 const VkAllocationCallbacks* pAllocator) {
Michael Lentine88594d72015-11-12 12:49:45 -08005600 deviceObject := GetDevice(device)
5601 swapchainObject := GetSwapchain(swapchain)
5602 assert(swapchainObject.device == device)
5603
5604 State.Swapchains[swapchain] = null
Michael Lentine88594d72015-11-12 12:49:45 -08005605}
5606
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005607@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005608cmd VkResult vkGetSwapchainImagesKHR(
5609 VkDevice device,
5610 VkSwapchainKHR swapchain,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005611 u32* pSwapchainImageCount,
Michael Lentine88594d72015-11-12 12:49:45 -08005612 VkImage* pSwapchainImages) {
5613 deviceObject := GetDevice(device)
5614
5615 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08005616 pSwapchainImageCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08005617 swapchainImages := pSwapchainImages[0:count]
5618
5619 for i in (0 .. count) {
5620 swapchainImage := ?
5621 swapchainImages[i] = swapchainImage
Jesse Hall1356b0d2015-11-23 17:24:58 -08005622 State.Images[swapchainImage] = new!ImageObject(device: device)
Michael Lentine88594d72015-11-12 12:49:45 -08005623 }
5624
5625 return ?
5626}
5627
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005628@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005629cmd VkResult vkAcquireNextImageKHR(
5630 VkDevice device,
5631 VkSwapchainKHR swapchain,
5632 u64 timeout,
5633 VkSemaphore semaphore,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005634 VkFence fence,
Michael Lentine88594d72015-11-12 12:49:45 -08005635 u32* pImageIndex) {
5636 deviceObject := GetDevice(device)
5637 swapchainObject := GetSwapchain(swapchain)
5638
5639 imageIndex := ?
5640 pImageIndex[0] = imageIndex
5641
5642 return ?
5643}
5644
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005645@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005646cmd VkResult vkQueuePresentKHR(
5647 VkQueue queue,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08005648 const VkPresentInfoKHR* pPresentInfo) {
Michael Lentine88594d72015-11-12 12:49:45 -08005649 queueObject := GetQueue(queue)
5650
5651 presentInfo := ?
5652 pPresentInfo[0] = presentInfo
5653
5654 return ?
5655}
5656
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005657@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005658cmd VkResult vkGetPhysicalDeviceDisplayPropertiesKHR(
5659 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005660 u32* pPropertyCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005661 VkDisplayPropertiesKHR* pProperties) {
5662 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5663 return ?
5664}
5665
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005666@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005667cmd VkResult vkGetPhysicalDeviceDisplayPlanePropertiesKHR(
5668 VkPhysicalDevice physicalDevice,
5669 u32* pPropertyCount,
5670 VkDisplayPlanePropertiesKHR* pProperties) {
5671 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5672 return ?
5673}
5674
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005675@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005676cmd VkResult vkGetDisplayPlaneSupportedDisplaysKHR(
5677 VkPhysicalDevice physicalDevice,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005678 u32 planeIndex,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08005679 u32* pDisplayCount,
5680 VkDisplayKHR* pDisplays) {
Jesse Halla6429252015-11-29 18:59:42 -08005681 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5682 return ?
5683}
5684
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005685@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005686cmd VkResult vkGetDisplayModePropertiesKHR(
5687 VkPhysicalDevice physicalDevice,
5688 VkDisplayKHR display,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005689 u32* pPropertyCount,
5690 VkDisplayModePropertiesKHR* pProperties) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005691 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5692 return ?
5693}
5694
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005695@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005696cmd VkResult vkCreateDisplayModeKHR(
5697 VkPhysicalDevice physicalDevice,
5698 VkDisplayKHR display,
5699 const VkDisplayModeCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005700 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005701 VkDisplayModeKHR* pMode) {
5702 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5703 return ?
5704}
5705
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005706@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005707cmd VkResult vkGetDisplayPlaneCapabilitiesKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005708 VkPhysicalDevice physicalDevice,
Jesse Hall9ba8bc82015-11-30 16:22:16 -08005709 VkDisplayModeKHR mode,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005710 u32 planeIndex,
Jesse Halla6429252015-11-29 18:59:42 -08005711 VkDisplayPlaneCapabilitiesKHR* pCapabilities) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005712 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5713 return ?
5714}
5715
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005716@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005717cmd VkResult vkCreateDisplayPlaneSurfaceKHR(
5718 VkInstance instance,
5719 const VkDisplaySurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005720 const VkAllocationCallbacks* pAllocator,
Jesse Halla6429252015-11-29 18:59:42 -08005721 VkSurfaceKHR* pSurface) {
5722 return ?
5723}
5724
Jesse Hall9ba8bc82015-11-30 16:22:16 -08005725@extension("VK_KHR_display_swapchain")
5726cmd VkResult vkCreateSharedSwapchainsKHR(
5727 VkDevice device,
5728 u32 swapchainCount,
5729 const VkSwapchainCreateInfoKHR* pCreateInfos,
5730 const VkAllocationCallbacks* pAllocator,
5731 VkSwapchainKHR* pSwapchains) {
5732 return ?
5733}
5734
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005735@extension("VK_KHR_xlib_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005736cmd VkResult vkCreateXlibSurfaceKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005737 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005738 const VkXlibSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005739 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005740 VkSurfaceKHR* pSurface) {
5741 instanceObject := GetInstance(instance)
5742 return ?
5743}
5744
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005745@extension("VK_KHR_xlib_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005746cmd VkBool32 vkGetPhysicalDeviceXlibPresentationSupportKHR(
5747 VkPhysicalDevice physicalDevice,
5748 u32 queueFamilyIndex,
5749 platform.Display* dpy,
Jesse Hall65ab5522015-11-30 00:07:16 -08005750 platform.VisualID visualID) {
Jesse Halla6429252015-11-29 18:59:42 -08005751 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5752 return ?
5753}
5754
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005755@extension("VK_KHR_xcb_surface")
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005756cmd VkResult vkCreateXcbSurfaceKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005757 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005758 const VkXcbSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005759 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005760 VkSurfaceKHR* pSurface) {
5761 instanceObject := GetInstance(instance)
5762 return ?
5763}
5764
Jesse Hall523db342015-11-30 21:12:55 -08005765@extension("VK_KHR_xcb_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005766cmd VkBool32 vkGetPhysicalDeviceXcbPresentationSupportKHR(
5767 VkPhysicalDevice physicalDevice,
5768 u32 queueFamilyIndex,
5769 platform.xcb_connection_t* connection,
5770 platform.xcb_visualid_t visual_id) {
5771 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5772 return ?
5773}
5774
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005775@extension("VK_KHR_wayland_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005776cmd VkResult vkCreateWaylandSurfaceKHR(
5777 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005778 const VkWaylandSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005779 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005780 VkSurfaceKHR* pSurface) {
5781 instanceObject := GetInstance(instance)
5782 return ?
5783}
5784
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005785@extension("VK_KHR_wayland_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005786cmd VkBool32 vkGetPhysicalDeviceWaylandPresentationSupportKHR(
5787 VkPhysicalDevice physicalDevice,
5788 u32 queueFamilyIndex,
5789 platform.wl_display* display) {
5790 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5791 return ?
5792}
5793
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005794@extension("VK_KHR_mir_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005795cmd VkResult vkCreateMirSurfaceKHR(
5796 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005797 const VkMirSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005798 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005799 VkSurfaceKHR* pSurface) {
5800 instanceObject := GetInstance(instance)
5801 return ?
5802}
5803
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005804@extension("VK_KHR_mir_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005805cmd VkBool32 vkGetPhysicalDeviceMirPresentationSupportKHR(
5806 VkPhysicalDevice physicalDevice,
5807 u32 queueFamilyIndex,
5808 platform.MirConnection* connection) {
5809 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5810 return ?
5811}
5812
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005813@extension("VK_KHR_android_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005814cmd VkResult vkCreateAndroidSurfaceKHR(
5815 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005816 const VkAndroidSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005817 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005818 VkSurfaceKHR* pSurface) {
5819 instanceObject := GetInstance(instance)
5820 return ?
5821}
5822
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005823@extension("VK_KHR_win32_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005824cmd VkResult vkCreateWin32SurfaceKHR(
5825 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005826 const VkWin32SurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005827 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005828 VkSurfaceKHR* pSurface) {
5829 instanceObject := GetInstance(instance)
5830 return ?
5831}
5832
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005833@extension("VK_KHR_win32_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005834cmd VkResult vkGetPhysicalDeviceWin32PresentationSupportKHR(
5835 VkPhysicalDevice physicalDevice,
5836 u32 queueFamilyIndex) {
Jesse Halle2948d82016-02-25 04:19:32 -08005837 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Jesse Halla6429252015-11-29 18:59:42 -08005838 return ?
5839}
5840
Chia-I Wub262ddc2016-03-22 07:38:20 +08005841@extension("VK_ANDROID_native_buffer")
Jesse Halld1abd742017-02-09 21:45:51 -08005842@optional
Chia-I Wub262ddc2016-03-22 07:38:20 +08005843cmd VkResult vkGetSwapchainGrallocUsageANDROID(
5844 VkDevice device,
5845 VkFormat format,
5846 VkImageUsageFlags imageUsage,
Jesse Halld1abd742017-02-09 21:45:51 -08005847 s32* grallocUsage) {
Chia-I Wub262ddc2016-03-22 07:38:20 +08005848 return ?
5849}
5850
5851@extension("VK_ANDROID_native_buffer")
Jesse Halld1abd742017-02-09 21:45:51 -08005852@optional
Chris Forbes8e4438b2016-12-07 16:26:49 +13005853cmd VkResult vkGetSwapchainGrallocUsage2ANDROID(
5854 VkDevice device,
5855 VkFormat format,
5856 VkImageUsageFlags imageUsage,
5857 VkSwapchainImageUsageFlagsANDROID swapchainImageUsage,
Jesse Halld1abd742017-02-09 21:45:51 -08005858 u64* grallocConsumerUsage,
5859 u64* grallocProducerUsage) {
Chris Forbes8e4438b2016-12-07 16:26:49 +13005860 return ?
5861}
5862
5863@extension("VK_ANDROID_native_buffer")
Chia-I Wub262ddc2016-03-22 07:38:20 +08005864cmd VkResult vkAcquireImageANDROID(
5865 VkDevice device,
5866 VkImage image,
5867 int nativeFenceFd,
5868 VkSemaphore semaphore,
5869 VkFence fence) {
5870 return ?
5871}
5872
5873@extension("VK_ANDROID_native_buffer")
5874cmd VkResult vkQueueSignalReleaseImageANDROID(
5875 VkQueue queue,
5876 u32 waitSemaphoreCount,
5877 const VkSemaphore* pWaitSemaphores,
5878 VkImage image,
5879 int* pNativeFenceFd) {
5880 return ?
5881}
5882
Ian Elliott4c8bb2a2016-12-29 11:07:26 -07005883@extension("VK_GOOGLE_display_timing")
5884cmd VkResult vkGetRefreshCycleDurationGOOGLE(
5885 VkDevice device,
5886 VkSwapchainKHR swapchain,
5887 VkRefreshCycleDurationGOOGLE* pDisplayTimingProperties) {
5888 deviceObject := GetDevice(device)
5889 swapchainObject := GetSwapchain(swapchain)
5890
5891 displayTimingProperties := ?
5892 pDisplayTimingProperties[0] = displayTimingProperties
5893
5894 return ?
5895}
5896
5897@extension("VK_GOOGLE_display_timing")
5898cmd VkResult vkGetPastPresentationTimingGOOGLE(
5899 VkDevice device,
5900 VkSwapchainKHR swapchain,
5901 u32* pPresentationTimingCount,
5902 VkPastPresentationTimingGOOGLE* pPresentationTimings) {
Ian Elliott4c8bb2a2016-12-29 11:07:26 -07005903 return ?
5904}
5905
Jesse Hall715b86a2016-01-16 16:34:29 -08005906@extension("VK_EXT_debug_report")
5907@external type void* PFN_vkDebugReportCallbackEXT
5908@extension("VK_EXT_debug_report")
5909@pfn cmd VkBool32 vkDebugReportCallbackEXT(
5910 VkDebugReportFlagsEXT flags,
5911 VkDebugReportObjectTypeEXT objectType,
5912 u64 object,
5913 platform.size_t location,
5914 s32 messageCode,
5915 const char* pLayerPrefix,
5916 const char* pMessage,
5917 void* pUserData) {
5918 return ?
5919}
5920
5921@extension("VK_EXT_debug_report")
5922cmd VkResult vkCreateDebugReportCallbackEXT(
5923 VkInstance instance,
5924 const VkDebugReportCallbackCreateInfoEXT* pCreateInfo,
5925 const VkAllocationCallbacks* pAllocator,
5926 VkDebugReportCallbackEXT* pCallback) {
5927 return ?
5928}
5929
5930@extension("VK_EXT_debug_report")
5931cmd void vkDestroyDebugReportCallbackEXT(
5932 VkInstance instance,
5933 VkDebugReportCallbackEXT callback,
5934 const VkAllocationCallbacks* pAllocator) {
5935}
5936
5937@extension("VK_EXT_debug_report")
5938cmd void vkDebugReportMessageEXT(
5939 VkInstance instance,
5940 VkDebugReportFlagsEXT flags,
5941 VkDebugReportObjectTypeEXT objectType,
5942 u64 object,
5943 platform.size_t location,
5944 s32 messageCode,
5945 const char* pLayerPrefix,
5946 const char* pMessage) {
5947}
5948
Jesse Hall26763382016-05-20 07:13:52 -07005949@extension("VK_EXT_debug_marker")
5950cmd VkResult vkDebugMarkerSetObjectTagEXT(
5951 VkDevice device,
5952 VkDebugMarkerObjectTagInfoEXT* pTagInfo) {
5953 return ?
5954}
5955
5956@extension("VK_EXT_debug_marker")
5957cmd VkResult vkDebugMarkerSetObjectNameEXT(
5958 VkDevice device,
5959 VkDebugMarkerObjectNameInfoEXT* pNameInfo) {
5960 return ?
5961}
5962
5963@extension("VK_EXT_debug_marker")
5964cmd void vkCmdDebugMarkerBeginEXT(
5965 VkCommandBuffer commandBuffer,
5966 VkDebugMarkerMarkerInfoEXT* pMarkerInfo) {
5967}
5968
5969@extension("VK_EXT_debug_marker")
5970cmd void vkCmdDebugMarkerEndEXT(
5971 VkCommandBuffer commandBuffer) {
5972}
5973
5974@extension("VK_EXT_debug_marker")
5975cmd void vkCmdDebugMarkerInsertEXT(
5976 VkCommandBuffer commandBuffer,
5977 VkDebugMarkerMarkerInfoEXT* pMarkerInfo) {
5978}
5979
Chris Forbes1194ede2016-12-30 16:29:25 +13005980@extension("VK_KHR_get_physical_device_properties2")
5981cmd void vkGetPhysicalDeviceFeatures2KHR(
5982 VkPhysicalDevice physicalDevice,
5983 VkPhysicalDeviceFeatures2KHR* pFeatures) {
5984}
5985
5986@extension("VK_KHR_get_physical_device_properties2")
5987cmd void vkGetPhysicalDeviceProperties2KHR(
5988 VkPhysicalDevice physicalDevice,
5989 VkPhysicalDeviceProperties2KHR* pProperties) {
5990}
5991
5992@extension("VK_KHR_get_physical_device_properties2")
5993cmd void vkGetPhysicalDeviceFormatProperties2KHR(
5994 VkPhysicalDevice physicalDevice,
5995 VkFormat format,
5996 VkFormatProperties2KHR* pFormatProperties) {
5997}
5998
5999@extension("VK_KHR_get_physical_device_properties2")
6000cmd VkResult vkGetPhysicalDeviceImageFormatProperties2KHR(
6001 VkPhysicalDevice physicalDevice,
6002 const VkPhysicalDeviceImageFormatInfo2KHR* pImageFormatInfo,
6003 VkImageFormatProperties2KHR* pImageFormatProperties) {
6004 return ?
6005}
6006
6007@extension("VK_KHR_get_physical_device_properties2")
6008cmd void vkGetPhysicalDeviceQueueFamilyProperties2KHR(
6009 VkPhysicalDevice physicalDevice,
6010 u32* pQueueFamilyPropertyCount,
6011 VkQueueFamilyProperties2KHR* pQueueFamilyProperties) {
6012}
6013
6014@extension("VK_KHR_get_physical_device_properties2")
6015cmd void vkGetPhysicalDeviceMemoryProperties2KHR(
6016 VkPhysicalDevice physicalDevice,
6017 VkPhysicalDeviceMemoryProperties2KHR* pMemoryProperties) {
6018}
6019
6020@extension("VK_KHR_get_physical_device_properties2")
6021cmd void vkGetPhysicalDeviceSparseImageFormatProperties2KHR(
6022 VkPhysicalDevice physicalDevice,
6023 const VkPhysicalDeviceSparseImageFormatInfo2KHR* pFormatInfo,
6024 u32* pPropertyCount,
6025 VkSparseImageFormatProperties2KHR* pProperties) {
6026}
6027
Chris Forbes289cb792016-12-30 15:03:55 +13006028@extension("VK_AMD_draw_indirect_count")
6029cmd void vkCmdDrawIndirectCountAMD(
6030 VkCommandBuffer commandBuffer,
6031 VkBuffer buffer,
6032 VkDeviceSize offset,
6033 VkBuffer countBuffer,
6034 VkDeviceSize countBufferOffset,
6035 u32 maxDrawCount,
6036 u32 stride) {
6037}
6038
6039@extension("VK_AMD_draw_indirect_count")
6040cmd void vkCmdDrawIndexedIndirectCountAMD(
6041 VkCommandBuffer commandBuffer,
6042 VkBuffer buffer,
6043 VkDeviceSize offset,
6044 VkBuffer countBuffer,
6045 VkDeviceSize countBufferOffset,
6046 u32 maxDrawCount,
6047 u32 stride) {
6048}
6049
6050@extension("VK_NV_external_memory_capabilities")
6051cmd VkResult vkGetPhysicalDeviceExternalImageFormatPropertiesNV(
6052 VkPhysicalDevice physicalDevice,
6053 VkFormat format,
6054 VkImageType type,
6055 VkImageTiling tiling,
6056 VkImageUsageFlags usage,
6057 VkImageCreateFlags flags,
6058 VkExternalMemoryHandleTypeFlagsNV externalHandleType,
6059 VkExternalImageFormatPropertiesNV* pExternalImageFormatProperties) {
6060 return ?
6061}
6062
6063@extension("VK_NV_external_memory_win32")
6064cmd VkResult vkGetMemoryWin32HandleNV(
6065 VkDevice device,
6066 VkDeviceMemory memory,
6067 VkExternalMemoryHandleTypeFlagsNV handleType,
6068 platform.HANDLE* pHandle) {
6069 return ?
6070}
6071
6072@extension("VK_NV_external_memory_win32")
6073cmd void vkCmdProcessCommandsNVX(
6074 VkCommandBuffer commandBuffer,
6075 const VkCmdProcessCommandsInfoNVX* pProcessCommandsInfo) {
6076}
6077
6078@extension("VK_NV_external_memory_win32")
6079cmd void vkCmdReserveSpaceForCommandsNVX(
6080 VkCommandBuffer commandBuffer,
6081 const VkCmdReserveSpaceForCommandsInfoNVX* pReserveSpaceInfo) {
6082}
6083
6084@extension("VK_NV_external_memory_win32")
6085cmd VkResult vkCreateIndirectCommandsLayoutNVX(
6086 VkDevice device,
6087 const VkIndirectCommandsLayoutCreateInfoNVX* pCreateInfo,
6088 const VkAllocationCallbacks* pAllocator,
6089 VkIndirectCommandsLayoutNVX* pIndirectCommandsLayout) {
6090 return ?
6091}
6092
6093@extension("VK_NV_external_memory_win32")
6094cmd void vkDestroyIndirectCommandsLayoutNVX(
6095 VkDevice device,
6096 VkIndirectCommandsLayoutNVX indirectCommandsLayout,
6097 const VkAllocationCallbacks* pAllocator) {
6098}
6099
6100@extension("VK_NV_external_memory_win32")
6101cmd VkResult vkCreateObjectTableNVX(
6102 VkDevice device,
6103 const VkObjectTableCreateInfoNVX* pCreateInfo,
6104 const VkAllocationCallbacks* pAllocator,
6105 VkObjectTableNVX* pObjectTable) {
6106 return ?
6107}
6108
6109@extension("VK_NV_external_memory_win32")
6110cmd void vkDestroyObjectTableNVX(
6111 VkDevice device,
6112 VkObjectTableNVX objectTable,
6113 const VkAllocationCallbacks* pAllocator) {
6114}
6115
6116@extension("VK_NV_external_memory_win32")
6117cmd VkResult vkRegisterObjectsNVX(
6118 VkDevice device,
6119 VkObjectTableNVX objectTable,
6120 u32 objectCount,
6121 const VkObjectTableEntryNVX* const* ppObjectTableEntries,
6122 const u32* pObjectIndices) {
6123 return ?
6124}
6125
6126@extension("VK_NV_external_memory_win32")
6127cmd VkResult vkUnregisterObjectsNVX(
6128 VkDevice device,
6129 VkObjectTableNVX objectTable,
6130 u32 objectCount,
6131 const VkObjectEntryTypeNVX* pObjectEntryTypes,
6132 const u32* pObjectIndices) {
6133 return ?
6134}
6135
6136@extension("VK_NV_external_memory_win32")
6137cmd void vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX(
6138 VkPhysicalDevice physicalDevice,
6139 VkDeviceGeneratedCommandsFeaturesNVX* pFeatures,
6140 VkDeviceGeneratedCommandsLimitsNVX* pLimits) {
6141}
6142
Chris Forbes1d5f68c2017-01-31 10:17:01 +13006143@extension("VK_KHR_shared_presentable_image")
Chris Forbes2e12cb82017-01-18 11:45:17 +13006144cmd VkResult vkGetSwapchainStatusKHR(
6145 VkDevice device,
6146 VkSwapchainKHR swapchain) {
6147 return ?
6148}
6149
Jesse Halld27f6aa2015-08-15 17:58:48 -07006150
6151////////////////
6152// Validation //
6153////////////////
6154
6155extern void validate(string layerName, bool condition, string message)
6156
6157
6158/////////////////////////////
6159// Internal State Tracking //
6160/////////////////////////////
6161
6162StateObject State
6163
6164@internal class StateObject {
6165 // Dispatchable objects.
6166 map!(VkInstance, ref!InstanceObject) Instances
6167 map!(VkPhysicalDevice, ref!PhysicalDeviceObject) PhysicalDevices
6168 map!(VkDevice, ref!DeviceObject) Devices
6169 map!(VkQueue, ref!QueueObject) Queues
Jesse Hall3fbc8562015-11-29 22:10:52 -08006170 map!(VkCommandBuffer, ref!CommandBufferObject) CommandBuffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07006171
6172 // Non-dispatchable objects.
6173 map!(VkDeviceMemory, ref!DeviceMemoryObject) DeviceMemories
6174 map!(VkBuffer, ref!BufferObject) Buffers
6175 map!(VkBufferView, ref!BufferViewObject) BufferViews
6176 map!(VkImage, ref!ImageObject) Images
6177 map!(VkImageView, ref!ImageViewObject) ImageViews
Jesse Halld27f6aa2015-08-15 17:58:48 -07006178 map!(VkShaderModule, ref!ShaderModuleObject) ShaderModules
Jesse Halld27f6aa2015-08-15 17:58:48 -07006179 map!(VkPipeline, ref!PipelineObject) Pipelines
6180 map!(VkPipelineLayout, ref!PipelineLayoutObject) PipelineLayouts
6181 map!(VkSampler, ref!SamplerObject) Samplers
6182 map!(VkDescriptorSet, ref!DescriptorSetObject) DescriptorSets
6183 map!(VkDescriptorSetLayout, ref!DescriptorSetLayoutObject) DescriptorSetLayouts
6184 map!(VkDescriptorPool, ref!DescriptorPoolObject) DescriptorPools
Jesse Halld27f6aa2015-08-15 17:58:48 -07006185 map!(VkFence, ref!FenceObject) Fences
6186 map!(VkSemaphore, ref!SemaphoreObject) Semaphores
6187 map!(VkEvent, ref!EventObject) Events
6188 map!(VkQueryPool, ref!QueryPoolObject) QueryPools
6189 map!(VkFramebuffer, ref!FramebufferObject) Framebuffers
6190 map!(VkRenderPass, ref!RenderPassObject) RenderPasses
6191 map!(VkPipelineCache, ref!PipelineCacheObject) PipelineCaches
Jesse Hall3fbc8562015-11-29 22:10:52 -08006192 map!(VkCommandPool, ref!CommandPoolObject) CommandPools
Jesse Hall1356b0d2015-11-23 17:24:58 -08006193 map!(VkSurfaceKHR, ref!SurfaceObject) Surfaces
Michael Lentine88594d72015-11-12 12:49:45 -08006194 map!(VkSwapchainKHR, ref!SwapchainObject) Swapchains
Jesse Halld27f6aa2015-08-15 17:58:48 -07006195}
6196
6197@internal class InstanceObject {
6198}
6199
6200@internal class PhysicalDeviceObject {
6201 VkInstance instance
6202}
6203
6204@internal class DeviceObject {
6205 VkPhysicalDevice physicalDevice
6206}
6207
6208@internal class QueueObject {
6209 VkDevice device
6210 VkQueueFlags flags
6211}
6212
Jesse Hall3fbc8562015-11-29 22:10:52 -08006213@internal class CommandBufferObject {
Jesse Halld27f6aa2015-08-15 17:58:48 -07006214 VkDevice device
6215 map!(u64, VkDeviceMemory) boundObjects
6216 VkQueueFlags queueFlags
6217}
6218
6219@internal class DeviceMemoryObject {
Jesse Hall3fbc8562015-11-29 22:10:52 -08006220 VkDevice device
6221 VkDeviceSize allocationSize
6222 map!(u64, VkDeviceSize) boundObjects
6223 map!(VkCommandBuffer, VkCommandBuffer) boundCommandBuffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07006224}
6225
6226@internal class BufferObject {
6227 VkDevice device
Jesse Hall3fbc8562015-11-29 22:10:52 -08006228 VkDeviceMemory memory
6229 VkDeviceSize memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07006230}
6231
6232@internal class BufferViewObject {
6233 VkDevice device
6234 VkBuffer buffer
6235}
6236
6237@internal class ImageObject {
6238 VkDevice device
Jesse Hall3fbc8562015-11-29 22:10:52 -08006239 VkDeviceMemory memory
6240 VkDeviceSize memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07006241}
6242
6243@internal class ImageViewObject {
6244 VkDevice device
6245 VkImage image
6246}
6247
Jesse Halld27f6aa2015-08-15 17:58:48 -07006248@internal class ShaderObject {
6249 VkDevice device
6250}
6251
6252@internal class ShaderModuleObject {
6253 VkDevice device
6254}
6255
6256@internal class PipelineObject {
6257 VkDevice device
6258}
6259
6260@internal class PipelineLayoutObject {
6261 VkDevice device
6262}
6263
6264@internal class SamplerObject {
6265 VkDevice device
6266}
6267
6268@internal class DescriptorSetObject {
6269 VkDevice device
6270}
6271
6272@internal class DescriptorSetLayoutObject {
6273 VkDevice device
6274}
6275
6276@internal class DescriptorPoolObject {
6277 VkDevice device
6278}
6279
Jesse Halld27f6aa2015-08-15 17:58:48 -07006280@internal class FenceObject {
6281 VkDevice device
6282 bool signaled
6283}
6284
6285@internal class SemaphoreObject {
6286 VkDevice device
6287}
6288
6289@internal class EventObject {
6290 VkDevice device
6291}
6292
6293@internal class QueryPoolObject {
6294 VkDevice device
6295}
6296
6297@internal class FramebufferObject {
6298 VkDevice device
6299}
6300
6301@internal class RenderPassObject {
6302 VkDevice device
6303}
6304
6305@internal class PipelineCacheObject {
6306 VkDevice device
6307}
6308
Jesse Hall3fbc8562015-11-29 22:10:52 -08006309@internal class CommandPoolObject {
Jesse Halld27f6aa2015-08-15 17:58:48 -07006310 VkDevice device
6311}
6312
Jesse Hall1356b0d2015-11-23 17:24:58 -08006313@internal class SurfaceObject {
6314 VkInstance instance
6315}
6316
Michael Lentine88594d72015-11-12 12:49:45 -08006317@internal class SwapchainObject {
6318 VkDevice device
6319}
6320
Jesse Halld27f6aa2015-08-15 17:58:48 -07006321macro ref!InstanceObject GetInstance(VkInstance instance) {
6322 assert(instance in State.Instances)
6323 return State.Instances[instance]
6324}
6325
6326macro ref!PhysicalDeviceObject GetPhysicalDevice(VkPhysicalDevice physicalDevice) {
6327 assert(physicalDevice in State.PhysicalDevices)
6328 return State.PhysicalDevices[physicalDevice]
6329}
6330
6331macro ref!DeviceObject GetDevice(VkDevice device) {
6332 assert(device in State.Devices)
6333 return State.Devices[device]
6334}
6335
6336macro ref!QueueObject GetQueue(VkQueue queue) {
6337 assert(queue in State.Queues)
6338 return State.Queues[queue]
6339}
6340
Jesse Hall3fbc8562015-11-29 22:10:52 -08006341macro ref!CommandBufferObject GetCommandBuffer(VkCommandBuffer commandBuffer) {
6342 assert(commandBuffer in State.CommandBuffers)
6343 return State.CommandBuffers[commandBuffer]
Jesse Halld27f6aa2015-08-15 17:58:48 -07006344}
6345
Jesse Hall3fbc8562015-11-29 22:10:52 -08006346macro ref!DeviceMemoryObject GetDeviceMemory(VkDeviceMemory memory) {
6347 assert(memory in State.DeviceMemories)
6348 return State.DeviceMemories[memory]
Jesse Halld27f6aa2015-08-15 17:58:48 -07006349}
6350
6351macro ref!BufferObject GetBuffer(VkBuffer buffer) {
6352 assert(buffer in State.Buffers)
6353 return State.Buffers[buffer]
6354}
6355
6356macro ref!BufferViewObject GetBufferView(VkBufferView bufferView) {
6357 assert(bufferView in State.BufferViews)
6358 return State.BufferViews[bufferView]
6359}
6360
6361macro ref!ImageObject GetImage(VkImage image) {
6362 assert(image in State.Images)
6363 return State.Images[image]
6364}
6365
6366macro ref!ImageViewObject GetImageView(VkImageView imageView) {
6367 assert(imageView in State.ImageViews)
6368 return State.ImageViews[imageView]
6369}
6370
Jesse Halld27f6aa2015-08-15 17:58:48 -07006371macro ref!ShaderModuleObject GetShaderModule(VkShaderModule shaderModule) {
6372 assert(shaderModule in State.ShaderModules)
6373 return State.ShaderModules[shaderModule]
6374}
6375
6376macro ref!PipelineObject GetPipeline(VkPipeline pipeline) {
6377 assert(pipeline in State.Pipelines)
6378 return State.Pipelines[pipeline]
6379}
6380
6381macro ref!PipelineLayoutObject GetPipelineLayout(VkPipelineLayout pipelineLayout) {
6382 assert(pipelineLayout in State.PipelineLayouts)
6383 return State.PipelineLayouts[pipelineLayout]
6384}
6385
6386macro ref!SamplerObject GetSampler(VkSampler sampler) {
6387 assert(sampler in State.Samplers)
6388 return State.Samplers[sampler]
6389}
6390
6391macro ref!DescriptorSetObject GetDescriptorSet(VkDescriptorSet descriptorSet) {
6392 assert(descriptorSet in State.DescriptorSets)
6393 return State.DescriptorSets[descriptorSet]
6394}
6395
6396macro ref!DescriptorSetLayoutObject GetDescriptorSetLayout(VkDescriptorSetLayout descriptorSetLayout) {
6397 assert(descriptorSetLayout in State.DescriptorSetLayouts)
6398 return State.DescriptorSetLayouts[descriptorSetLayout]
6399}
6400
6401macro ref!DescriptorPoolObject GetDescriptorPool(VkDescriptorPool descriptorPool) {
6402 assert(descriptorPool in State.DescriptorPools)
6403 return State.DescriptorPools[descriptorPool]
6404}
6405
Jesse Halld27f6aa2015-08-15 17:58:48 -07006406macro ref!FenceObject GetFence(VkFence fence) {
6407 assert(fence in State.Fences)
6408 return State.Fences[fence]
6409}
6410
6411macro ref!SemaphoreObject GetSemaphore(VkSemaphore semaphore) {
6412 assert(semaphore in State.Semaphores)
6413 return State.Semaphores[semaphore]
6414}
6415
6416macro ref!EventObject GetEvent(VkEvent event) {
6417 assert(event in State.Events)
6418 return State.Events[event]
6419}
6420
6421macro ref!QueryPoolObject GetQueryPool(VkQueryPool queryPool) {
6422 assert(queryPool in State.QueryPools)
6423 return State.QueryPools[queryPool]
6424}
6425
6426macro ref!FramebufferObject GetFramebuffer(VkFramebuffer framebuffer) {
6427 assert(framebuffer in State.Framebuffers)
6428 return State.Framebuffers[framebuffer]
6429}
6430
6431macro ref!RenderPassObject GetRenderPass(VkRenderPass renderPass) {
6432 assert(renderPass in State.RenderPasses)
6433 return State.RenderPasses[renderPass]
6434}
6435
6436macro ref!PipelineCacheObject GetPipelineCache(VkPipelineCache pipelineCache) {
6437 assert(pipelineCache in State.PipelineCaches)
6438 return State.PipelineCaches[pipelineCache]
6439}
6440
Jesse Hall3fbc8562015-11-29 22:10:52 -08006441macro ref!CommandPoolObject GetCommandPool(VkCommandPool commandPool) {
6442 assert(commandPool in State.CommandPools)
6443 return State.CommandPools[commandPool]
Jesse Hallf09c6b12015-08-15 19:54:28 -07006444}
Michael Lentine88594d72015-11-12 12:49:45 -08006445
Jesse Hall1356b0d2015-11-23 17:24:58 -08006446macro ref!SurfaceObject GetSurface(VkSurfaceKHR surface) {
6447 assert(surface in State.Surfaces)
6448 return State.Surfaces[surface]
6449}
6450
Michael Lentine88594d72015-11-12 12:49:45 -08006451macro ref!SwapchainObject GetSwapchain(VkSwapchainKHR swapchain) {
6452 assert(swapchain in State.Swapchains)
6453 return State.Swapchains[swapchain]
6454}
Jesse Halld8bade02015-11-24 10:24:18 -08006455
6456macro VkQueueFlags AddQueueFlag(VkQueueFlags flags, VkQueueFlagBits bit) {
6457 return as!VkQueueFlags(as!u32(flags) | as!u32(bit))
6458}