blob: 5a67d36430a18b6e3d8ac81450eee3f7e5967e30 [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
Chia-I Wub262ddc2016-03-22 07:38:20 +08002911@extension("VK_ANDROID_native_buffer")
2912class VkNativeBufferANDROID {
2913 VkStructureType sType
2914 const void* pNext
2915 platform.buffer_handle_t handle
2916 int stride
2917 int format
2918 int usage
2919}
2920
Chris Forbes8e4438b2016-12-07 16:26:49 +13002921@extension("VK_ANDROID_native_buffer")
2922class VkSwapchainImageCreateInfoANDROID {
2923 VkStructureType sType
2924 const void* pNext
Chris Forbes134d9582017-01-12 14:26:37 +13002925 VkSwapchainImageUsageFlagsANDROID flags
Chris Forbes48853712017-01-12 14:09:33 +13002926}
Ian Elliott4c8bb2a2016-12-29 11:07:26 -07002927
2928@extension("VK_GOOGLE_display_timing")
2929class VkRefreshCycleDurationGOOGLE {
Chris Forbes48853712017-01-12 14:09:33 +13002930 u64 minRefreshDuration
2931 u64 maxRefreshDuration
Ian Elliott4c8bb2a2016-12-29 11:07:26 -07002932}
2933
2934@extension("VK_GOOGLE_display_timing")
2935class VkPastPresentationTimingGOOGLE {
Chris Forbes48853712017-01-12 14:09:33 +13002936 u32 presentID
2937 u64 desiredPresentTime
2938 u64 actualPresentTime
2939 u64 earliestPresentTime
2940 u64 presentMargin
Ian Elliott4c8bb2a2016-12-29 11:07:26 -07002941}
2942
2943@extension("VK_GOOGLE_display_timing")
2944class VkPresentTimeGOOGLE {
Chris Forbes48853712017-01-12 14:09:33 +13002945 u32 presentID
2946 u64 desiredPresentTime
Ian Elliott4c8bb2a2016-12-29 11:07:26 -07002947}
2948
2949@extension("VK_GOOGLE_display_timing")
2950class VkPresentTimesInfoGOOGLE {
2951 VkStructureType sType
2952 const void* pNext
Chris Forbes48853712017-01-12 14:09:33 +13002953 u32 swapchainCount
Ian Elliott4c8bb2a2016-12-29 11:07:26 -07002954 const VkPresentTimeGOOGLE* pTimes
Chris Forbes8e4438b2016-12-07 16:26:49 +13002955}
2956
Jesse Hall715b86a2016-01-16 16:34:29 -08002957@extension("VK_EXT_debug_report")
2958class VkDebugReportCallbackCreateInfoEXT {
2959 VkStructureType sType
2960 const void* pNext
2961 VkDebugReportFlagsEXT flags
2962 PFN_vkDebugReportCallbackEXT pfnCallback
2963 void* pUserData
2964}
2965
Jesse Hall26763382016-05-20 07:13:52 -07002966@extension("VK_AMD_rasterization_order")
2967class VkPipelineRasterizationStateRasterizationOrderAMD {
2968 VkStructureType sType
2969 const void* pNext
2970 VkRasterizationOrderAMD rasterizationOrder
2971}
2972
2973@extension("VK_EXT_debug_marker")
2974class VkDebugMarkerObjectNameInfoEXT {
2975 VkStructureType sType
2976 const void* pNext
2977 VkDebugReportObjectTypeEXT objectType
2978 u64 object
2979 const char* pObjectName
2980}
2981
2982@extension("VK_EXT_debug_marker")
2983class VkDebugMarkerObjectTagInfoEXT {
2984 VkStructureType sType
2985 const void* pNext
2986 VkDebugReportObjectTypeEXT objectType
2987 u64 object
2988 u64 tagName
2989 platform.size_t tagSize
2990 const void* pTag
2991}
2992
2993@extension("VK_EXT_debug_marker")
2994class VkDebugMarkerMarkerInfoEXT {
2995 VkStructureType sType
2996 const void* pNext
2997 const char* pMarkerName
2998 f32[4] color
2999}
3000
Jesse Hall56d386a2016-07-26 15:20:40 -07003001@extension("VK_NV_dedicated_allocation")
3002class VkDedicatedAllocationImageCreateInfoNV {
3003 VkStructureType sType
3004 const void* pNext
3005 VkBool32 dedicatedAllocation
3006}
3007
3008@extension("VK_NV_dedicated_allocation")
3009class VkDedicatedAllocationBufferCreateInfoNV {
3010 VkStructureType sType
3011 const void* pNext
3012 VkBool32 dedicatedAllocation
3013}
3014
3015@extension("VK_NV_dedicated_allocation")
3016class VkDedicatedAllocationMemoryAllocateInfoNV {
3017 VkStructureType sType
3018 const void* pNext
3019 VkImage image
3020 VkBuffer buffer
3021}
3022
Chris Forbes1194ede2016-12-30 16:29:25 +13003023@extension("VK_KHR_get_physical_device_properties2")
3024class VkPhysicalDeviceFeatures2KHR {
3025 VkStructureType sType
3026 void* pNext
3027 VkPhysicalDeviceFeatures features
3028}
3029
3030@extension("VK_KHR_get_physical_device_properties2")
3031class VkPhysicalDeviceProperties2KHR {
3032 VkStructureType sType
3033 void* pNext
3034 VkPhysicalDeviceProperties properties
3035}
3036
3037@extension("VK_KHR_get_physical_device_properties2")
3038class VkFormatProperties2KHR {
3039 VkStructureType sType
3040 void* pNext
3041 VkFormatProperties formatProperties
3042}
3043
3044@extension("VK_KHR_get_physical_device_properties2")
3045class VkImageFormatProperties2KHR {
3046 VkStructureType sType
3047 void* pNext
3048 VkImageFormatProperties imageFormatProperties
3049}
3050
3051@extension("VK_KHR_get_physical_device_properties2")
3052class VkPhysicalDeviceImageFormatInfo2KHR {
3053 VkStructureType sType
3054 const void* pNext
3055 VkFormat format
3056 VkImageType type
3057 VkImageTiling tiling
3058 VkImageUsageFlags usage
3059 VkImageCreateFlags flags
3060}
3061
3062@extension("VK_KHR_get_physical_device_properties2")
3063class VkQueueFamilyProperties2KHR {
3064 VkStructureType sType
3065 void* pNext
3066 VkQueueFamilyProperties queueFamilyProperties
3067}
3068
3069@extension("VK_KHR_get_physical_device_properties2")
3070class VkPhysicalDeviceMemoryProperties2KHR {
3071 VkStructureType sType
3072 void* pNext
3073 VkPhysicalDeviceMemoryProperties memoryProperties
3074}
3075
3076@extension("VK_KHR_get_physical_device_properties2")
3077class VkSparseImageFormatProperties2KHR {
3078 VkStructureType sType
3079 void* pNext
3080 VkSparseImageFormatProperties properties
3081}
3082
3083@extension("VK_KHR_get_physical_device_properties2")
3084class VkPhysicalDeviceSparseImageFormatInfo2KHR {
3085 VkStructureType sType
3086 const void* pNext
3087 VkFormat format
3088 VkImageType type
3089 VkSampleCountFlagBits samples
3090 VkImageUsageFlags usage
3091 VkImageTiling tiling
3092}
3093
Chris Forbes289cb792016-12-30 15:03:55 +13003094@extension("VK_KHR_incremental_present")
3095class VkRectLayerKHR {
3096 VkOffset2D offset
3097 VkExtent2D extent
3098 u32 layer
3099}
3100
3101@extension("VK_KHR_incremental_present")
3102class VkPresentRegionKHR {
3103 u32 rectangleCount
3104 const VkRectLayerKHR* pRectangles
3105}
3106
3107@extension("VK_KHR_incremental_present")
3108class VkPresentRegionsKHR {
3109 VkStructureType sType
3110 const void* pNext
3111 u32 swapchainCount
3112 const VkPresentRegionKHR* pRegions
3113}
3114
3115@extension("VK_NV_external_memory_capabilities")
3116class VkExternalImageFormatPropertiesNV {
3117 VkImageFormatProperties imageFormatProperties
3118 VkExternalMemoryFeatureFlagsNV externalMemoryFeatures
3119 VkExternalMemoryHandleTypeFlagsNV exportFromImportedHandleTypes
3120 VkExternalMemoryHandleTypeFlagsNV compatibleHandleTypes
3121}
3122
3123@extension("VK_NV_external_memory")
3124class VkExternalMemoryImageCreateInfoNV {
3125 VkStructureType sType
3126 const void* pNext
3127 VkExternalMemoryHandleTypeFlagsNV handleTypes
3128}
3129
3130@extension("VK_NV_external_memory")
3131class VkExportMemoryAllocateInfoNV {
3132 VkStructureType sType
3133 const void* pNext
3134 VkExternalMemoryHandleTypeFlagsNV handleTypes
3135}
3136
3137@extension("VK_NV_external_memory_win32")
3138class VkImportMemoryWin32HandleInfoNV {
3139 VkStructureType sType
3140 const void* pNext
3141 VkExternalMemoryHandleTypeFlagsNV handleType
3142 platform.HANDLE handle
3143}
3144
3145@extension("VK_NV_external_memory_win32")
3146class VkExportMemoryWin32HandleInfoNV {
3147 VkStructureType sType
3148 const void* pNext
3149 const platform.SECURITY_ATTRIBUTES* pAttributes
3150 u32 dwAccess
3151}
3152
3153@extension("VK_NV_win32_keyed_mutex")
3154class VkWin32KeyedMutexAcquireReleaseInfoNV {
3155 VkStructureType sType
3156 const void* pNext
3157 u32 acquireCount
3158 const VkDeviceMemory* pAcquireSyncs
3159 const u64* pAcquireKeys
3160 const u32* pAcquireTimeoutMilliseconds
3161 u32 releaseCount
3162 const VkDeviceMemory* pReleaseSyncs
3163 const u64* pReleaseKeys
3164}
3165
3166@extension("VK_EXT_validation_flags")
3167class VkValidationFlagsEXT {
3168 VkStructureType sType
3169 const void* pNext
3170 u32 disabledValidationCheckCount
3171 VkValidationCheckEXT* pDisabledValidationChecks
3172}
3173
3174@extension("VK_NVX_device_generated_commands")
3175class VkDeviceGeneratedCommandsFeaturesNVX {
3176 VkStructureType sType
3177 const void* pNext
3178 VkBool32 computeBindingPointSupport
3179}
3180
3181@extension("VK_NVX_device_generated_commands")
3182class VkDeviceGeneratedCommandsLimitsNVX {
3183 VkStructureType sType
3184 const void* pNext
3185 u32 maxIndirectCommandsLayoutTokenCount
3186 u32 maxObjectEntryCounts
3187 u32 minSequenceCountBufferOffsetAlignment
3188 u32 minSequenceIndexBufferOffsetAlignment
3189 u32 minCommandsTokenBufferOffsetAlignment
3190}
3191
3192@extension("VK_NVX_device_generated_commands")
3193class VkIndirectCommandsTokenNVX {
3194 VkIndirectCommandsTokenTypeNVX tokenType
3195 VkBuffer buffer
3196 VkDeviceSize offset
3197}
3198
3199@extension("VK_NVX_device_generated_commands")
3200class VkIndirectCommandsLayoutTokenNVX {
3201 VkIndirectCommandsTokenTypeNVX tokenType
3202 u32 bindingUnit
3203 u32 dynamicCount
3204 u32 divisor
3205}
3206
3207@extension("VK_NVX_device_generated_commands")
3208class VkIndirectCommandsLayoutCreateInfoNVX {
3209 VkStructureType sType
3210 const void* pNext
3211 VkPipelineBindPoint pipelineBindPoint
3212 VkIndirectCommandsLayoutUsageFlagsNVX flags
3213 u32 tokenCount
3214 const VkIndirectCommandsLayoutTokenNVX* pTokens
3215}
3216
3217@extension("VK_NVX_device_generated_commands")
3218class VkCmdProcessCommandsInfoNVX {
3219 VkStructureType sType
3220 const void* pNext
3221 VkObjectTableNVX objectTable
3222 VkIndirectCommandsLayoutNVX indirectCommandsLayout
3223 u32 indirectCommandsTokenCount
3224 const VkIndirectCommandsTokenNVX* pIndirectCommandsTokens
3225 u32 maxSequencesCount
3226 VkCommandBuffer targetCommandBuffer
3227 VkBuffer sequencesCountBuffer
3228 VkDeviceSize sequencesCountOffset
3229 VkBuffer sequencesIndexBuffer
3230 VkDeviceSize sequencesIndexOffset
3231}
3232
3233@extension("VK_NVX_device_generated_commands")
3234class VkCmdReserveSpaceForCommandsInfoNVX {
3235 VkStructureType sType
3236 const void* pNext
3237 VkObjectTableNVX objectTable
3238 VkIndirectCommandsLayoutNVX indirectCommandsLayout
3239 u32 maxSequencesCount
3240}
3241
3242@extension("VK_NVX_device_generated_commands")
3243class VkObjectTableCreateInfoNVX {
3244 VkStructureType sType
3245 const void* pNext
3246 u32 objectCount
3247 const VkObjectEntryTypeNVX* pObjectEntryTypes
3248 const u32* pObjectEntryCounts
3249 const VkObjectEntryUsageFlagsNVX* pObjectEntryUsageFlags
3250 u32 maxUniformBuffersPerDescriptor
3251 u32 maxStorageBuffersPerDescriptor
3252 u32 maxStorageImagesPerDescriptor
3253 u32 maxSampledImagesPerDescriptor
3254 u32 maxPipelineLayouts
3255}
3256
3257@extension("VK_NVX_device_generated_commands")
3258class VkObjectTableEntryNVX {
3259 VkObjectEntryTypeNVX type
3260 VkObjectEntryUsageFlagsNVX flags
3261}
3262
3263@extension("VK_NVX_device_generated_commands")
3264class VkObjectTablePipelineEntryNVX {
3265 VkObjectEntryTypeNVX type
3266 VkObjectEntryUsageFlagsNVX flags
3267 VkPipeline pipeline
3268}
3269
3270@extension("VK_NVX_device_generated_commands")
3271class VkObjectTableDescriptorSetEntryNVX {
3272 VkObjectEntryTypeNVX type
3273 VkObjectEntryUsageFlagsNVX flags
3274 VkPipelineLayout pipelineLayout
3275 VkDescriptorSet descriptorSet
3276}
3277
3278@extension("VK_NVX_device_generated_commands")
3279class VkObjectTableVertexBufferEntryNVX {
3280 VkObjectEntryTypeNVX type
3281 VkObjectEntryUsageFlagsNVX flags
3282 VkBuffer buffer
3283}
3284
3285@extension("VK_NVX_device_generated_commands")
3286class VkObjectTableIndexBufferEntryNVX {
3287 VkObjectEntryTypeNVX type
3288 VkObjectEntryUsageFlagsNVX flags
3289 VkBuffer buffer
3290}
3291
3292@extension("VK_NVX_device_generated_commands")
3293class VkObjectTablePushConstantEntryNVX {
3294 VkObjectEntryTypeNVX type
3295 VkObjectEntryUsageFlagsNVX flags
3296 VkPipelineLayout pipelineLayout
3297 VkShaderStageFlags stageFlags
3298}
3299
3300
Jesse Hall1356b0d2015-11-23 17:24:58 -08003301
Jesse Halld27f6aa2015-08-15 17:58:48 -07003302////////////////
3303// Commands //
3304////////////////
3305
3306// Function pointers. TODO: add support for function pointers.
3307
3308@external type void* PFN_vkVoidFunction
3309@pfn cmd void vkVoidFunction() {
3310}
3311
Jesse Hall3fbc8562015-11-29 22:10:52 -08003312@external type void* PFN_vkAllocationFunction
3313@pfn cmd void* vkAllocationFunction(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003314 void* pUserData,
3315 platform.size_t size,
3316 platform.size_t alignment,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003317 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08003318 return ?
3319}
3320
Jesse Hall3fbc8562015-11-29 22:10:52 -08003321@external type void* PFN_vkReallocationFunction
3322@pfn cmd void* vkReallocationFunction(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003323 void* pUserData,
3324 void* pOriginal,
3325 platform.size_t size,
3326 platform.size_t alignment,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003327 VkSystemAllocationScope allocationScope) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003328 return ?
3329}
3330
3331@external type void* PFN_vkFreeFunction
3332@pfn cmd void vkFreeFunction(
3333 void* pUserData,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003334 void* pMemory) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003335}
3336
Jesse Hall3fbc8562015-11-29 22:10:52 -08003337@external type void* PFN_vkInternalAllocationNotification
3338@pfn cmd void vkInternalAllocationNotification(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003339 void* pUserData,
3340 platform.size_t size,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003341 VkInternalAllocationType allocationType,
3342 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08003343}
3344
3345@external type void* PFN_vkInternalFreeNotification
3346@pfn cmd void vkInternalFreeNotification(
3347 void* pUserData,
3348 platform.size_t size,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003349 VkInternalAllocationType allocationType,
3350 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08003351}
Jesse Halld27f6aa2015-08-15 17:58:48 -07003352
3353// Global functions
3354
3355@threadSafety("system")
3356cmd VkResult vkCreateInstance(
3357 const VkInstanceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003358 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003359 VkInstance* pInstance) {
3360 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO)
3361
3362 instance := ?
3363 pInstance[0] = instance
3364 State.Instances[instance] = new!InstanceObject()
3365
Jesse Hall3dd678a2016-01-08 21:52:01 -08003366 layers := pCreateInfo.ppEnabledLayerNames[0:pCreateInfo.enabledLayerCount]
3367 extensions := pCreateInfo.ppEnabledExtensionNames[0:pCreateInfo.enabledExtensionCount]
Jesse Halld27f6aa2015-08-15 17:58:48 -07003368
3369 return ?
3370}
3371
3372@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003373cmd void vkDestroyInstance(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003374 VkInstance instance,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003375 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003376 instanceObject := GetInstance(instance)
3377
3378 State.Instances[instance] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003379}
3380
3381@threadSafety("system")
3382cmd VkResult vkEnumeratePhysicalDevices(
3383 VkInstance instance,
3384 u32* pPhysicalDeviceCount,
3385 VkPhysicalDevice* pPhysicalDevices) {
3386 instanceObject := GetInstance(instance)
3387
3388 physicalDeviceCount := as!u32(?)
3389 pPhysicalDeviceCount[0] = physicalDeviceCount
3390 physicalDevices := pPhysicalDevices[0:physicalDeviceCount]
3391
3392 for i in (0 .. physicalDeviceCount) {
3393 physicalDevice := ?
3394 physicalDevices[i] = physicalDevice
3395 if !(physicalDevice in State.PhysicalDevices) {
3396 State.PhysicalDevices[physicalDevice] = new!PhysicalDeviceObject(instance: instance)
3397 }
3398 }
3399
3400 return ?
3401}
3402
3403cmd PFN_vkVoidFunction vkGetDeviceProcAddr(
3404 VkDevice device,
3405 const char* pName) {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003406 if device != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003407 device := GetDevice(device)
3408 }
3409
3410 return ?
3411}
3412
3413cmd PFN_vkVoidFunction vkGetInstanceProcAddr(
3414 VkInstance instance,
3415 const char* pName) {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003416 if instance != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003417 instanceObject := GetInstance(instance)
3418 }
3419
3420 return ?
3421}
3422
Jesse Hall606a54e2015-11-19 22:17:28 -08003423cmd void vkGetPhysicalDeviceProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003424 VkPhysicalDevice physicalDevice,
3425 VkPhysicalDeviceProperties* pProperties) {
3426 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3427
3428 properties := ?
3429 pProperties[0] = properties
Jesse Halld27f6aa2015-08-15 17:58:48 -07003430}
3431
Jesse Hall606a54e2015-11-19 22:17:28 -08003432cmd void vkGetPhysicalDeviceQueueFamilyProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003433 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003434 u32* pQueueFamilyPropertyCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003435 VkQueueFamilyProperties* pQueueFamilyProperties) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003436 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003437 // TODO: Figure out how to express fetch-count-or-properties
3438 // This version fails 'apic validate' with 'fence not allowed in
3439 // *semantic.Branch'. Other attempts have failed with the same or other
3440 // errors.
3441 // if pQueueFamilyProperties != null {
3442 // queuesProperties := pQueueFamilyProperties[0:pCount[0]]
3443 // for i in (0 .. pCount[0]) {
3444 // queueProperties := as!VkQueueFamilyProperties(?)
3445 // queuesProperties[i] = queueProperties
3446 // }
3447 // } else {
3448 // count := ?
3449 // pCount[0] = count
3450 // }
Jesse Halld27f6aa2015-08-15 17:58:48 -07003451}
3452
Jesse Hall606a54e2015-11-19 22:17:28 -08003453cmd void vkGetPhysicalDeviceMemoryProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003454 VkPhysicalDevice physicalDevice,
3455 VkPhysicalDeviceMemoryProperties* pMemoryProperties) {
3456 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3457
3458 memoryProperties := ?
3459 pMemoryProperties[0] = memoryProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07003460}
3461
Jesse Hall606a54e2015-11-19 22:17:28 -08003462cmd void vkGetPhysicalDeviceFeatures(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003463 VkPhysicalDevice physicalDevice,
3464 VkPhysicalDeviceFeatures* pFeatures) {
3465 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3466
3467 features := ?
3468 pFeatures[0] = features
Jesse Halld27f6aa2015-08-15 17:58:48 -07003469}
3470
Jesse Hall606a54e2015-11-19 22:17:28 -08003471cmd void vkGetPhysicalDeviceFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003472 VkPhysicalDevice physicalDevice,
3473 VkFormat format,
3474 VkFormatProperties* pFormatProperties) {
3475 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3476
3477 formatProperties := ?
3478 pFormatProperties[0] = formatProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07003479}
3480
Jesse Halla9e57032015-11-30 01:03:10 -08003481cmd VkResult vkGetPhysicalDeviceImageFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003482 VkPhysicalDevice physicalDevice,
3483 VkFormat format,
3484 VkImageType type,
3485 VkImageTiling tiling,
3486 VkImageUsageFlags usage,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003487 VkImageCreateFlags flags,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003488 VkImageFormatProperties* pImageFormatProperties) {
3489 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3490
3491 imageFormatProperties := ?
3492 pImageFormatProperties[0] = imageFormatProperties
Jesse Halla9e57032015-11-30 01:03:10 -08003493
3494 return ?
Jesse Halld27f6aa2015-08-15 17:58:48 -07003495}
3496
Jesse Halld27f6aa2015-08-15 17:58:48 -07003497
3498// Device functions
3499
3500@threadSafety("system")
3501cmd VkResult vkCreateDevice(
3502 VkPhysicalDevice physicalDevice,
3503 const VkDeviceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003504 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003505 VkDevice* pDevice) {
3506 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO)
3507 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3508
3509 device := ?
3510 pDevice[0] = device
3511 State.Devices[device] = new!DeviceObject(physicalDevice: physicalDevice)
3512
3513 return ?
3514}
3515
3516@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003517cmd void vkDestroyDevice(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003518 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003519 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003520 deviceObject := GetDevice(device)
3521
3522 State.Devices[device] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003523}
3524
3525
3526// Extension discovery functions
3527
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003528cmd VkResult vkEnumerateInstanceLayerProperties(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003529 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003530 VkLayerProperties* pProperties) {
3531 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08003532 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07003533
3534 properties := pProperties[0:count]
3535 for i in (0 .. count) {
3536 property := ?
3537 properties[i] = property
3538 }
3539
3540 return ?
3541}
3542
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003543cmd VkResult vkEnumerateInstanceExtensionProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003544 const char* pLayerName,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003545 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003546 VkExtensionProperties* pProperties) {
3547 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08003548 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07003549
3550 properties := pProperties[0:count]
3551 for i in (0 .. count) {
3552 property := ?
3553 properties[i] = property
3554 }
3555
3556 return ?
3557}
3558
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003559cmd VkResult vkEnumerateDeviceLayerProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003560 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003561 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003562 VkLayerProperties* pProperties) {
3563 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3564 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08003565 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07003566
3567 properties := pProperties[0:count]
3568 for i in (0 .. count) {
3569 property := ?
3570 properties[i] = property
3571 }
3572
3573 return ?
3574}
3575
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003576cmd VkResult vkEnumerateDeviceExtensionProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003577 VkPhysicalDevice physicalDevice,
3578 const char* pLayerName,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003579 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003580 VkExtensionProperties* pProperties) {
3581 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3582
3583 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08003584 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07003585
3586 properties := pProperties[0:count]
3587 for i in (0 .. count) {
3588 property := ?
3589 properties[i] = property
3590 }
3591
3592 return ?
3593}
3594
3595
3596// Queue functions
3597
3598@threadSafety("system")
Jesse Hall606a54e2015-11-19 22:17:28 -08003599cmd void vkGetDeviceQueue(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003600 VkDevice device,
3601 u32 queueFamilyIndex,
3602 u32 queueIndex,
3603 VkQueue* pQueue) {
3604 deviceObject := GetDevice(device)
3605
3606 queue := ?
3607 pQueue[0] = queue
3608
3609 if !(queue in State.Queues) {
3610 State.Queues[queue] = new!QueueObject(device: device)
3611 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07003612}
3613
3614@threadSafety("app")
3615cmd VkResult vkQueueSubmit(
3616 VkQueue queue,
Jesse Halla366a512015-11-19 22:30:07 -08003617 u32 submitCount,
Jesse Hallb00daad2015-11-29 19:46:20 -08003618 const VkSubmitInfo* pSubmits,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003619 VkFence fence) {
3620 queueObject := GetQueue(queue)
3621
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003622 if fence != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003623 fenceObject := GetFence(fence)
3624 assert(fenceObject.device == queueObject.device)
3625 }
3626
Jesse Hall3fbc8562015-11-29 22:10:52 -08003627 // commandBuffers := pcommandBuffers[0:commandBufferCount]
3628 // for i in (0 .. commandBufferCount) {
3629 // commandBuffer := commandBuffers[i]
3630 // commandBufferObject := GetCommandBuffer(commandBuffer)
3631 // assert(commandBufferObject.device == queueObject.device)
Jesse Halla366a512015-11-19 22:30:07 -08003632 //
Jesse Hall3fbc8562015-11-29 22:10:52 -08003633 // validate("QueueCheck", commandBufferObject.queueFlags in queueObject.flags,
3634 // "vkQueueSubmit: enqueued commandBuffer requires missing queue capabilities.")
Jesse Halla366a512015-11-19 22:30:07 -08003635 // }
Jesse Halld27f6aa2015-08-15 17:58:48 -07003636
3637 return ?
3638}
3639
3640@threadSafety("system")
3641cmd VkResult vkQueueWaitIdle(
3642 VkQueue queue) {
3643 queueObject := GetQueue(queue)
3644
3645 return ?
3646}
3647
3648@threadSafety("system")
3649cmd VkResult vkDeviceWaitIdle(
3650 VkDevice device) {
3651 deviceObject := GetDevice(device)
3652
3653 return ?
3654}
3655
3656
3657// Memory functions
3658
3659@threadSafety("system")
Jesse Hall3fbc8562015-11-29 22:10:52 -08003660cmd VkResult vkAllocateMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003661 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003662 const VkMemoryAllocateInfo* pAllocateInfo,
3663 const VkAllocationCallbacks* pAllocator,
3664 VkDeviceMemory* pMemory) {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08003665 assert(pAllocateInfo.sType == VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003666 deviceObject := GetDevice(device)
3667
Jesse Hall3fbc8562015-11-29 22:10:52 -08003668 memory := ?
3669 pMemory[0] = memory
3670 State.DeviceMemories[memory] = new!DeviceMemoryObject(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003671 device: device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003672 allocationSize: pAllocateInfo[0].allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003673
3674 return ?
3675}
3676
3677@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003678cmd void vkFreeMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003679 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003680 VkDeviceMemory memory,
3681 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003682 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003683 memoryObject := GetDeviceMemory(memory)
3684 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003685
3686 // Check that no objects are still bound before freeing.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003687 validate("MemoryCheck", len(memoryObject.boundObjects) == 0,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003688 "vkFreeMemory: objects still bound")
Jesse Hall3fbc8562015-11-29 22:10:52 -08003689 validate("MemoryCheck", len(memoryObject.boundCommandBuffers) == 0,
3690 "vkFreeMemory: commandBuffers still bound")
3691 State.DeviceMemories[memory] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003692}
3693
3694@threadSafety("app")
3695cmd VkResult vkMapMemory(
3696 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003697 VkDeviceMemory memory,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003698 VkDeviceSize offset,
3699 VkDeviceSize size,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003700 VkMemoryMapFlags flags,
3701 void** ppData) {
3702 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003703 memoryObject := GetDeviceMemory(memory)
3704 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003705
3706 assert(flags == as!VkMemoryMapFlags(0))
Jesse Hall3fbc8562015-11-29 22:10:52 -08003707 assert((offset + size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003708
3709 return ?
3710}
3711
3712@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003713cmd void vkUnmapMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003714 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003715 VkDeviceMemory memory) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003716 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003717 memoryObject := GetDeviceMemory(memory)
3718 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003719}
3720
3721cmd VkResult vkFlushMappedMemoryRanges(
3722 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003723 u32 memoryRangeCount
3724 const VkMappedMemoryRange* pMemoryRanges) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003725 deviceObject := GetDevice(device)
3726
Jesse Hall3fbc8562015-11-29 22:10:52 -08003727 memoryRanges := pMemoryRanges[0:memoryRangeCount]
3728 for i in (0 .. memoryRangeCount) {
3729 memoryRange := memoryRanges[i]
3730 memoryObject := GetDeviceMemory(memoryRange.memory)
3731 assert(memoryObject.device == device)
3732 assert((memoryRange.offset + memoryRange.size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003733 }
3734
3735 return ?
3736}
3737
3738cmd VkResult vkInvalidateMappedMemoryRanges(
3739 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003740 u32 memoryRangeCount,
3741 const VkMappedMemoryRange* pMemoryRanges) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003742 deviceObject := GetDevice(device)
3743
Jesse Hall3fbc8562015-11-29 22:10:52 -08003744 memoryRanges := pMemoryRanges[0:memoryRangeCount]
3745 for i in (0 .. memoryRangeCount) {
3746 memoryRange := memoryRanges[i]
3747 memoryObject := GetDeviceMemory(memoryRange.memory)
3748 assert(memoryObject.device == device)
3749 assert((memoryRange.offset + memoryRange.size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003750 }
3751
3752 return ?
3753}
3754
3755
3756// Memory management API functions
3757
Jesse Hall606a54e2015-11-19 22:17:28 -08003758cmd void vkGetDeviceMemoryCommitment(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003759 VkDevice device,
3760 VkDeviceMemory memory,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003761 VkDeviceSize* pCommittedMemoryInBytes) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003762 deviceObject := GetDevice(device)
3763
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003764 if memory != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003765 memoryObject := GetDeviceMemory(memory)
3766 assert(memoryObject.device == device)
3767 }
3768
3769 committedMemoryInBytes := ?
3770 pCommittedMemoryInBytes[0] = committedMemoryInBytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07003771}
3772
Jesse Hall606a54e2015-11-19 22:17:28 -08003773cmd void vkGetBufferMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003774 VkDevice device,
3775 VkBuffer buffer,
3776 VkMemoryRequirements* pMemoryRequirements) {
3777 deviceObject := GetDevice(device)
3778 bufferObject := GetBuffer(buffer)
3779 assert(bufferObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003780}
3781
3782cmd VkResult vkBindBufferMemory(
3783 VkDevice device,
3784 VkBuffer buffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003785 VkDeviceMemory memory,
3786 VkDeviceSize memoryOffset) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003787 deviceObject := GetDevice(device)
3788 bufferObject := GetBuffer(buffer)
3789 assert(bufferObject.device == device)
3790
3791 // Unbind buffer from previous memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003792 if bufferObject.memory != NULL_HANDLE {
3793 memoryObject := GetDeviceMemory(bufferObject.memory)
3794 memoryObject.boundObjects[as!u64(buffer)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003795 }
3796
3797 // Bind buffer to given memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003798 if memory != NULL_HANDLE {
3799 memoryObject := GetDeviceMemory(memory)
3800 assert(memoryObject.device == device)
3801 memoryObject.boundObjects[as!u64(buffer)] = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003802 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08003803 bufferObject.memory = memory
3804 bufferObject.memoryOffset = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003805
3806 return ?
3807}
3808
Jesse Hall606a54e2015-11-19 22:17:28 -08003809cmd void vkGetImageMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003810 VkDevice device,
3811 VkImage image,
3812 VkMemoryRequirements* pMemoryRequirements) {
3813 deviceObject := GetDevice(device)
3814 imageObject := GetImage(image)
3815 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003816}
3817
3818cmd VkResult vkBindImageMemory(
3819 VkDevice device,
3820 VkImage image,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003821 VkDeviceMemory memory,
3822 VkDeviceSize memoryOffset) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003823 deviceObject := GetDevice(device)
3824 imageObject := GetImage(image)
3825 assert(imageObject.device == device)
3826
3827 // Unbind image from previous memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003828 if imageObject.memory != NULL_HANDLE {
3829 memoryObject := GetDeviceMemory(imageObject.memory)
3830 memoryObject.boundObjects[as!u64(image)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003831 }
3832
3833 // Bind image to given memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003834 if memory != NULL_HANDLE {
3835 memoryObject := GetDeviceMemory(memory)
3836 assert(memoryObject.device == device)
3837 memoryObject.boundObjects[as!u64(image)] = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003838 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08003839 imageObject.memory = memory
3840 imageObject.memoryOffset = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003841
3842 return ?
3843}
3844
Jesse Hall606a54e2015-11-19 22:17:28 -08003845cmd void vkGetImageSparseMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003846 VkDevice device,
3847 VkImage image,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003848 u32* pSparseMemoryRequirementCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003849 VkSparseImageMemoryRequirements* pSparseMemoryRequirements) {
3850 deviceObject := GetDevice(device)
3851 imageObject := GetImage(image)
3852 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003853}
3854
Jesse Hall606a54e2015-11-19 22:17:28 -08003855cmd void vkGetPhysicalDeviceSparseImageFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003856 VkPhysicalDevice physicalDevice,
3857 VkFormat format,
3858 VkImageType type,
Jesse Hall091ed9e2015-11-30 00:55:29 -08003859 VkSampleCountFlagBits samples,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003860 VkImageUsageFlags usage,
3861 VkImageTiling tiling,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003862 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003863 VkSparseImageFormatProperties* pProperties) {
3864 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003865}
3866
Jesse Halla6429252015-11-29 18:59:42 -08003867cmd VkResult vkQueueBindSparse(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003868 VkQueue queue,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003869 u32 bindInfoCount,
Jesse Halla6429252015-11-29 18:59:42 -08003870 const VkBindSparseInfo* pBindInfo,
3871 VkFence fence) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003872 queueObject := GetQueue(queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003873
3874 return ?
3875}
3876
3877
3878// Fence functions
3879
3880@threadSafety("system")
3881cmd VkResult vkCreateFence(
3882 VkDevice device,
3883 const VkFenceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003884 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003885 VkFence* pFence) {
3886 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_FENCE_CREATE_INFO)
3887 deviceObject := GetDevice(device)
3888
3889 fence := ?
3890 pFence[0] = fence
3891 State.Fences[fence] = new!FenceObject(
Jesse Halld8bade02015-11-24 10:24:18 -08003892 device: device, signaled: (pCreateInfo.flags == as!VkFenceCreateFlags(VK_FENCE_CREATE_SIGNALED_BIT)))
Jesse Halld27f6aa2015-08-15 17:58:48 -07003893
3894 return ?
3895}
3896
3897@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003898cmd void vkDestroyFence(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003899 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003900 VkFence fence,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003901 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003902 deviceObject := GetDevice(device)
3903 fenceObject := GetFence(fence)
3904 assert(fenceObject.device == device)
3905
3906 State.Fences[fence] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003907}
3908
3909@threadSafety("system")
3910cmd VkResult vkResetFences(
3911 VkDevice device,
3912 u32 fenceCount,
3913 const VkFence* pFences) {
3914 deviceObject := GetDevice(device)
3915
3916 fences := pFences[0:fenceCount]
3917 for i in (0 .. fenceCount) {
3918 fence := fences[i]
3919 fenceObject := GetFence(fence)
3920 assert(fenceObject.device == device)
3921 fenceObject.signaled = false
3922 }
3923
3924 return ?
3925}
3926
3927@threadSafety("system")
3928cmd VkResult vkGetFenceStatus(
3929 VkDevice device,
3930 VkFence fence) {
3931 deviceObject := GetDevice(device)
3932 fenceObject := GetFence(fence)
3933 assert(fenceObject.device == device)
3934
3935 return ?
3936}
3937
3938@threadSafety("system")
3939cmd VkResult vkWaitForFences(
3940 VkDevice device,
3941 u32 fenceCount,
3942 const VkFence* pFences,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003943 VkBool32 waitAll,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003944 u64 timeout) { /// timeout in nanoseconds
3945 deviceObject := GetDevice(device)
3946
3947 fences := pFences[0:fenceCount]
3948 for i in (0 .. fenceCount) {
3949 fence := fences[i]
3950 fenceObject := GetFence(fence)
3951 assert(fenceObject.device == device)
3952 }
3953
3954 return ?
3955}
3956
3957
3958// Queue semaphore functions
3959
3960@threadSafety("system")
3961cmd VkResult vkCreateSemaphore(
3962 VkDevice device,
3963 const VkSemaphoreCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003964 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003965 VkSemaphore* pSemaphore) {
3966 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO)
3967 deviceObject := GetDevice(device)
3968
3969 semaphore := ?
3970 pSemaphore[0] = semaphore
3971 State.Semaphores[semaphore] = new!SemaphoreObject(device: device)
3972
3973 return ?
3974}
3975
3976@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003977cmd void vkDestroySemaphore(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003978 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003979 VkSemaphore semaphore,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003980 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003981 deviceObject := GetDevice(device)
3982 semaphoreObject := GetSemaphore(semaphore)
3983 assert(semaphoreObject.device == device)
3984
3985 State.Semaphores[semaphore] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003986}
3987
Jesse Halld27f6aa2015-08-15 17:58:48 -07003988
3989// Event functions
3990
3991@threadSafety("system")
3992cmd VkResult vkCreateEvent(
3993 VkDevice device,
3994 const VkEventCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003995 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003996 VkEvent* pEvent) {
3997 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_EVENT_CREATE_INFO)
3998 deviceObject := GetDevice(device)
3999
4000 event := ?
4001 pEvent[0] = event
4002 State.Events[event] = new!EventObject(device: device)
4003
4004 return ?
4005}
4006
4007@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004008cmd void vkDestroyEvent(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004009 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004010 VkEvent event,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004011 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004012 deviceObject := GetDevice(device)
4013 eventObject := GetEvent(event)
4014 assert(eventObject.device == device)
4015
4016 State.Events[event] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004017}
4018
4019@threadSafety("system")
4020cmd VkResult vkGetEventStatus(
4021 VkDevice device,
4022 VkEvent event) {
4023 deviceObject := GetDevice(device)
4024 eventObject := GetEvent(event)
4025 assert(eventObject.device == device)
4026
4027 return ?
4028}
4029
4030@threadSafety("system")
4031cmd VkResult vkSetEvent(
4032 VkDevice device,
4033 VkEvent event) {
4034 deviceObject := GetDevice(device)
4035 eventObject := GetEvent(event)
4036 assert(eventObject.device == device)
4037
4038 return ?
4039}
4040
4041@threadSafety("system")
4042cmd VkResult vkResetEvent(
4043 VkDevice device,
4044 VkEvent event) {
4045 deviceObject := GetDevice(device)
4046 eventObject := GetEvent(event)
4047 assert(eventObject.device == device)
4048
4049 return ?
4050}
4051
4052
4053// Query functions
4054
4055@threadSafety("system")
4056cmd VkResult vkCreateQueryPool(
4057 VkDevice device,
4058 const VkQueryPoolCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004059 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004060 VkQueryPool* pQueryPool) {
4061 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO)
4062 deviceObject := GetDevice(device)
4063
4064 queryPool := ?
4065 pQueryPool[0] = queryPool
4066 State.QueryPools[queryPool] = new!QueryPoolObject(device: device)
4067
4068 return ?
4069}
4070
4071@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004072cmd void vkDestroyQueryPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004073 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004074 VkQueryPool queryPool,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004075 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004076 deviceObject := GetDevice(device)
4077 queryPoolObject := GetQueryPool(queryPool)
4078 assert(queryPoolObject.device == device)
4079
4080 State.QueryPools[queryPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004081}
4082
4083@threadSafety("system")
4084cmd VkResult vkGetQueryPoolResults(
4085 VkDevice device,
4086 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004087 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004088 u32 queryCount,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004089 platform.size_t dataSize,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004090 void* pData,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004091 VkDeviceSize stride,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004092 VkQueryResultFlags flags) {
4093 deviceObject := GetDevice(device)
4094 queryPoolObject := GetQueryPool(queryPool)
4095 assert(queryPoolObject.device == device)
4096
Jesse Halld27f6aa2015-08-15 17:58:48 -07004097 data := pData[0:dataSize]
4098
4099 return ?
4100}
4101
4102// Buffer functions
4103
4104@threadSafety("system")
4105cmd VkResult vkCreateBuffer(
4106 VkDevice device,
4107 const VkBufferCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004108 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004109 VkBuffer* pBuffer) {
4110 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO)
4111 deviceObject := GetDevice(device)
4112
4113 buffer := ?
4114 pBuffer[0] = buffer
4115 State.Buffers[buffer] = new!BufferObject(device: device)
4116
4117 return ?
4118}
4119
4120@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004121cmd void vkDestroyBuffer(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004122 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004123 VkBuffer buffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004124 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004125 deviceObject := GetDevice(device)
4126 bufferObject := GetBuffer(buffer)
4127 assert(bufferObject.device == device)
4128
Jesse Hall3fbc8562015-11-29 22:10:52 -08004129 assert(bufferObject.memory == 0)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004130 State.Buffers[buffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004131}
4132
4133
4134// Buffer view functions
4135
4136@threadSafety("system")
4137cmd VkResult vkCreateBufferView(
4138 VkDevice device,
4139 const VkBufferViewCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004140 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004141 VkBufferView* pView) {
4142 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO)
4143 deviceObject := GetDevice(device)
4144
4145 bufferObject := GetBuffer(pCreateInfo.buffer)
4146 assert(bufferObject.device == device)
4147
4148 view := ?
4149 pView[0] = view
4150 State.BufferViews[view] = new!BufferViewObject(device: device, buffer: pCreateInfo.buffer)
4151
4152 return ?
4153}
4154
4155@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004156cmd void vkDestroyBufferView(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004157 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004158 VkBufferView bufferView,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004159 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004160 deviceObject := GetDevice(device)
4161 bufferViewObject := GetBufferView(bufferView)
4162 assert(bufferViewObject.device == device)
4163
4164 State.BufferViews[bufferView] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004165}
4166
4167
4168// Image functions
4169
4170@threadSafety("system")
4171cmd VkResult vkCreateImage(
4172 VkDevice device,
4173 const VkImageCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004174 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004175 VkImage* pImage) {
4176 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO)
4177 deviceObject := GetDevice(device)
4178
4179 image := ?
4180 pImage[0] = image
4181 State.Images[image] = new!ImageObject(device: device)
4182
4183 return ?
4184}
4185
4186@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004187cmd void vkDestroyImage(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004188 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004189 VkImage image,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004190 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004191 deviceObject := GetDevice(device)
4192 imageObject := GetImage(image)
4193 assert(imageObject.device == device)
4194
Jesse Hall3fbc8562015-11-29 22:10:52 -08004195 assert(imageObject.memory == 0)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004196 State.Images[image] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004197}
4198
Jesse Hall606a54e2015-11-19 22:17:28 -08004199cmd void vkGetImageSubresourceLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004200 VkDevice device,
4201 VkImage image,
4202 const VkImageSubresource* pSubresource,
4203 VkSubresourceLayout* pLayout) {
4204 deviceObject := GetDevice(device)
4205 imageObject := GetImage(image)
4206 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004207}
4208
4209
4210// Image view functions
4211
4212@threadSafety("system")
4213cmd VkResult vkCreateImageView(
4214 VkDevice device,
4215 const VkImageViewCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004216 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004217 VkImageView* pView) {
4218 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO)
4219 deviceObject := GetDevice(device)
4220
4221 imageObject := GetImage(pCreateInfo.image)
4222 assert(imageObject.device == device)
4223
4224 view := ?
4225 pView[0] = view
4226 State.ImageViews[view] = new!ImageViewObject(device: device, image: pCreateInfo.image)
4227
4228 return ?
4229}
4230
4231@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004232cmd void vkDestroyImageView(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004233 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004234 VkImageView imageView,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004235 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004236 deviceObject := GetDevice(device)
4237 imageViewObject := GetImageView(imageView)
4238 assert(imageViewObject.device == device)
4239
4240 State.ImageViews[imageView] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004241}
4242
4243
4244// Shader functions
4245
4246cmd VkResult vkCreateShaderModule(
4247 VkDevice device,
4248 const VkShaderModuleCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004249 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004250 VkShaderModule* pShaderModule) {
4251 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO)
4252 deviceObject := GetDevice(device)
4253
4254 shaderModule := ?
4255 pShaderModule[0] = shaderModule
4256 State.ShaderModules[shaderModule] = new!ShaderModuleObject(device: device)
4257
4258 return ?
4259}
4260
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004261cmd void vkDestroyShaderModule(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004262 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004263 VkShaderModule shaderModule,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004264 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004265 deviceObject := GetDevice(device)
4266 shaderModuleObject := GetShaderModule(shaderModule)
4267 assert(shaderModuleObject.device == device)
4268
4269 State.ShaderModules[shaderModule] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004270}
4271
Jesse Halld27f6aa2015-08-15 17:58:48 -07004272
4273// Pipeline functions
4274
4275cmd VkResult vkCreatePipelineCache(
4276 VkDevice device,
4277 const VkPipelineCacheCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004278 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004279 VkPipelineCache* pPipelineCache) {
4280 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO)
4281 deviceObject := GetDevice(device)
4282
4283 pipelineCache := ?
4284 pPipelineCache[0] = pipelineCache
4285 State.PipelineCaches[pipelineCache] = new!PipelineCacheObject(device: device)
4286
4287 return ?
4288}
4289
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004290cmd void vkDestroyPipelineCache(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004291 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004292 VkPipelineCache pipelineCache,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004293 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004294 deviceObject := GetDevice(device)
4295 pipelineCacheObject := GetPipelineCache(pipelineCache)
4296 assert(pipelineCacheObject.device == device)
4297
4298 State.PipelineCaches[pipelineCache] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004299}
4300
Jesse Halld27f6aa2015-08-15 17:58:48 -07004301cmd VkResult vkGetPipelineCacheData(
4302 VkDevice device,
4303 VkPipelineCache pipelineCache,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004304 platform.size_t* pDataSize,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004305 void* pData) {
4306 deviceObject := GetDevice(device)
4307 pipelineCacheObject := GetPipelineCache(pipelineCache)
4308 assert(pipelineCacheObject.device == device)
4309
4310 return ?
4311}
4312
4313cmd VkResult vkMergePipelineCaches(
4314 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004315 VkPipelineCache dstCache,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004316 u32 srcCacheCount,
4317 const VkPipelineCache* pSrcCaches) {
4318 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004319 dstCacheObject := GetPipelineCache(dstCache)
4320 assert(dstCacheObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004321
4322 srcCaches := pSrcCaches[0:srcCacheCount]
4323 for i in (0 .. srcCacheCount) {
4324 srcCache := srcCaches[i]
4325 srcCacheObject := GetPipelineCache(srcCache)
4326 assert(srcCacheObject.device == device)
4327 }
4328
4329 return ?
4330}
4331
4332cmd VkResult vkCreateGraphicsPipelines(
4333 VkDevice device,
4334 VkPipelineCache pipelineCache,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004335 u32 createInfoCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004336 const VkGraphicsPipelineCreateInfo* pCreateInfos,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004337 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004338 VkPipeline* pPipelines) {
4339 deviceObject := GetDevice(device)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004340 if pipelineCache != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004341 pipelineCacheObject := GetPipelineCache(pipelineCache)
4342 assert(pipelineCacheObject.device == device)
4343 }
4344
Jesse Hall03b6fe12015-11-24 12:44:21 -08004345 createInfos := pCreateInfos[0:createInfoCount]
4346 pipelines := pPipelines[0:createInfoCount]
4347 for i in (0 .. createInfoCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004348 pipeline := ?
4349 pipelines[i] = pipeline
4350 State.Pipelines[pipeline] = new!PipelineObject(device: device)
4351 }
4352
4353 return ?
4354}
4355
4356cmd VkResult vkCreateComputePipelines(
4357 VkDevice device,
4358 VkPipelineCache pipelineCache,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004359 u32 createInfoCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004360 const VkComputePipelineCreateInfo* pCreateInfos,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004361 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004362 VkPipeline* pPipelines) {
4363 deviceObject := GetDevice(device)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004364 if pipelineCache != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004365 pipelineCacheObject := GetPipelineCache(pipelineCache)
4366 assert(pipelineCacheObject.device == device)
4367 }
4368
Jesse Hall03b6fe12015-11-24 12:44:21 -08004369 createInfos := pCreateInfos[0:createInfoCount]
4370 pipelines := pPipelines[0:createInfoCount]
4371 for i in (0 .. createInfoCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004372 pipeline := ?
4373 pipelines[i] = pipeline
4374 State.Pipelines[pipeline] = new!PipelineObject(device: device)
4375 }
4376
4377 return ?
4378}
4379
4380@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004381cmd void vkDestroyPipeline(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004382 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004383 VkPipeline pipeline,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004384 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004385 deviceObject := GetDevice(device)
4386 pipelineObjects := GetPipeline(pipeline)
4387 assert(pipelineObjects.device == device)
4388
4389 State.Pipelines[pipeline] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004390}
4391
4392
4393// Pipeline layout functions
4394
4395@threadSafety("system")
4396cmd VkResult vkCreatePipelineLayout(
4397 VkDevice device,
4398 const VkPipelineLayoutCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004399 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004400 VkPipelineLayout* pPipelineLayout) {
4401 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO)
4402 deviceObject := GetDevice(device)
4403
4404 pipelineLayout := ?
4405 pPipelineLayout[0] = pipelineLayout
4406 State.PipelineLayouts[pipelineLayout] = new!PipelineLayoutObject(device: device)
4407
4408 return ?
4409}
4410
4411@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004412cmd void vkDestroyPipelineLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004413 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004414 VkPipelineLayout pipelineLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004415 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004416 deviceObject := GetDevice(device)
4417 pipelineLayoutObjects := GetPipelineLayout(pipelineLayout)
4418 assert(pipelineLayoutObjects.device == device)
4419
4420 State.PipelineLayouts[pipelineLayout] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004421}
4422
4423
4424// Sampler functions
4425
4426@threadSafety("system")
4427cmd VkResult vkCreateSampler(
4428 VkDevice device,
4429 const VkSamplerCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004430 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004431 VkSampler* pSampler) {
4432 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO)
4433 deviceObject := GetDevice(device)
4434
4435 sampler := ?
4436 pSampler[0] = sampler
4437 State.Samplers[sampler] = new!SamplerObject(device: device)
4438
4439 return ?
4440}
4441
4442@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004443cmd void vkDestroySampler(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004444 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004445 VkSampler sampler,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004446 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004447 deviceObject := GetDevice(device)
4448 samplerObject := GetSampler(sampler)
4449 assert(samplerObject.device == device)
4450
4451 State.Samplers[sampler] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004452}
4453
4454
4455// Descriptor set functions
4456
4457@threadSafety("system")
4458cmd VkResult vkCreateDescriptorSetLayout(
4459 VkDevice device,
4460 const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004461 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004462 VkDescriptorSetLayout* pSetLayout) {
4463 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO)
4464 deviceObject := GetDevice(device)
4465
4466 setLayout := ?
4467 pSetLayout[0] = setLayout
4468 State.DescriptorSetLayouts[setLayout] = new!DescriptorSetLayoutObject(device: device)
4469
4470 return ?
4471}
4472
4473@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004474cmd void vkDestroyDescriptorSetLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004475 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004476 VkDescriptorSetLayout descriptorSetLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004477 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004478 deviceObject := GetDevice(device)
4479 descriptorSetLayoutObject := GetDescriptorSetLayout(descriptorSetLayout)
4480 assert(descriptorSetLayoutObject.device == device)
4481
4482 State.DescriptorSetLayouts[descriptorSetLayout] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004483}
4484
4485@threadSafety("system")
4486cmd VkResult vkCreateDescriptorPool(
4487 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004488 const VkDescriptorPoolCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004489 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004490 VkDescriptorPool* pDescriptorPool) {
4491 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO)
4492 deviceObject := GetDevice(device)
4493
4494 descriptorPool := ?
4495 pDescriptorPool[0] = descriptorPool
4496 State.DescriptorPools[descriptorPool] = new!DescriptorPoolObject(device: device)
4497
4498 return ?
4499}
4500
4501@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004502cmd void vkDestroyDescriptorPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004503 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004504 VkDescriptorPool descriptorPool,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004505 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004506 deviceObject := GetDevice(device)
4507 descriptorPoolObject := GetDescriptorPool(descriptorPool)
4508 assert(descriptorPoolObject.device == device)
4509
4510 State.DescriptorPools[descriptorPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004511}
4512
4513@threadSafety("app")
4514cmd VkResult vkResetDescriptorPool(
4515 VkDevice device,
Jesse Hallfbf97b02015-11-20 14:17:03 -08004516 VkDescriptorPool descriptorPool,
4517 VkDescriptorPoolResetFlags flags) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004518 deviceObject := GetDevice(device)
4519 descriptorPoolObject := GetDescriptorPool(descriptorPool)
4520 assert(descriptorPoolObject.device == device)
4521
4522 return ?
4523}
4524
4525@threadSafety("app")
Jesse Hall3fbc8562015-11-29 22:10:52 -08004526cmd VkResult vkAllocateDescriptorSets(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004527 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004528 const VkDescriptorSetAllocateInfo* pAllocateInfo,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004529 VkDescriptorSet* pDescriptorSets) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004530 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004531 allocInfo := pAllocateInfo[0]
Jesse Hallfbf97b02015-11-20 14:17:03 -08004532 descriptorPoolObject := GetDescriptorPool(allocInfo.descriptorPool)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004533
Jesse Hall03b6fe12015-11-24 12:44:21 -08004534 setLayouts := allocInfo.pSetLayouts[0:allocInfo.setCount]
4535 for i in (0 .. allocInfo.setCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004536 setLayout := setLayouts[i]
4537 setLayoutObject := GetDescriptorSetLayout(setLayout)
4538 assert(setLayoutObject.device == device)
4539 }
4540
Jesse Hall03b6fe12015-11-24 12:44:21 -08004541 descriptorSets := pDescriptorSets[0:allocInfo.setCount]
4542 for i in (0 .. allocInfo.setCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004543 descriptorSet := ?
4544 descriptorSets[i] = descriptorSet
4545 State.DescriptorSets[descriptorSet] = new!DescriptorSetObject(device: device)
4546 }
4547
4548 return ?
4549}
4550
Jesse Hallf09c6b12015-08-15 19:54:28 -07004551cmd VkResult vkFreeDescriptorSets(
4552 VkDevice device,
4553 VkDescriptorPool descriptorPool,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004554 u32 descriptorSetCount,
Jesse Hallf09c6b12015-08-15 19:54:28 -07004555 const VkDescriptorSet* pDescriptorSets) {
4556 deviceObject := GetDevice(device)
4557 descriptorPoolObject := GetDescriptorPool(descriptorPool)
4558
Jesse Hall03b6fe12015-11-24 12:44:21 -08004559 descriptorSets := pDescriptorSets[0:descriptorSetCount]
4560 for i in (0 .. descriptorSetCount) {
Jesse Hallf09c6b12015-08-15 19:54:28 -07004561 descriptorSet := descriptorSets[i]
4562 descriptorSetObject := GetDescriptorSet(descriptorSet)
4563 assert(descriptorSetObject.device == device)
4564 State.DescriptorSets[descriptorSet] = null
4565 }
4566
4567 return ?
4568}
4569
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004570cmd void vkUpdateDescriptorSets(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004571 VkDevice device,
Jesse Hallb00daad2015-11-29 19:46:20 -08004572 u32 descriptorWriteCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004573 const VkWriteDescriptorSet* pDescriptorWrites,
Jesse Hallb00daad2015-11-29 19:46:20 -08004574 u32 descriptorCopyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004575 const VkCopyDescriptorSet* pDescriptorCopies) {
4576 deviceObject := GetDevice(device)
4577
Jesse Hallb00daad2015-11-29 19:46:20 -08004578 descriptorWrites := pDescriptorWrites[0:descriptorWriteCount]
4579 for i in (0 .. descriptorWriteCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004580 descriptorWrite := descriptorWrites[i]
Jesse Hall3fbc8562015-11-29 22:10:52 -08004581 descriptorWriteObject := GetDescriptorSet(descriptorWrite.dstSet)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004582 assert(descriptorWriteObject.device == device)
4583 }
4584
Jesse Hallb00daad2015-11-29 19:46:20 -08004585 descriptorCopies := pDescriptorCopies[0:descriptorCopyCount]
4586 for i in (0 .. descriptorCopyCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004587 descriptorCopy := descriptorCopies[i]
Jesse Hall3fbc8562015-11-29 22:10:52 -08004588 descriptorCopyObject := GetDescriptorSet(descriptorCopy.dstSet)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004589 assert(descriptorCopyObject.device == device)
4590 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07004591}
4592
4593
4594// Framebuffer functions
4595
4596@threadSafety("system")
4597cmd VkResult vkCreateFramebuffer(
4598 VkDevice device,
4599 const VkFramebufferCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004600 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004601 VkFramebuffer* pFramebuffer) {
4602 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO)
4603 deviceObject := GetDevice(device)
4604
4605 framebuffer := ?
4606 pFramebuffer[0] = framebuffer
4607 State.Framebuffers[framebuffer] = new!FramebufferObject(device: device)
4608
4609 return ?
4610}
4611
4612@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004613cmd void vkDestroyFramebuffer(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004614 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004615 VkFramebuffer framebuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004616 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004617 deviceObject := GetDevice(device)
4618 framebufferObject := GetFramebuffer(framebuffer)
4619 assert(framebufferObject.device == device)
4620
4621 State.Framebuffers[framebuffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004622}
4623
4624
4625// Renderpass functions
4626
4627@threadSafety("system")
4628cmd VkResult vkCreateRenderPass(
4629 VkDevice device,
4630 const VkRenderPassCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004631 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004632 VkRenderPass* pRenderPass) {
4633 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO)
4634 deviceObject := GetDevice(device)
4635
4636 renderpass := ?
4637 pRenderPass[0] = renderpass
4638 State.RenderPasses[renderpass] = new!RenderPassObject(device: device)
4639
4640 return ?
4641}
4642
4643@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004644cmd void vkDestroyRenderPass(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004645 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004646 VkRenderPass renderPass,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004647 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004648 deviceObject := GetDevice(device)
4649 renderPassObject := GetRenderPass(renderPass)
4650 assert(renderPassObject.device == device)
4651
4652 State.RenderPasses[renderPass] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004653}
4654
Jesse Hall606a54e2015-11-19 22:17:28 -08004655cmd void vkGetRenderAreaGranularity(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004656 VkDevice device,
4657 VkRenderPass renderPass,
4658 VkExtent2D* pGranularity) {
4659 deviceObject := GetDevice(device)
4660 renderPassObject := GetRenderPass(renderPass)
4661
4662 granularity := ?
4663 pGranularity[0] = granularity
Jesse Halld27f6aa2015-08-15 17:58:48 -07004664}
4665
4666// Command pool functions
4667
4668cmd VkResult vkCreateCommandPool(
4669 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004670 const VkCommandPoolCreateInfo* pCreateInfo,
4671 const VkAllocationCallbacks* pAllocator,
4672 VkCommandPool* pCommandPool) {
4673 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004674 deviceObject := GetDevice(device)
4675
Jesse Hall3fbc8562015-11-29 22:10:52 -08004676 commandPool := ?
4677 pCommandPool[0] = commandPool
4678 State.CommandPools[commandPool] = new!CommandPoolObject(device: device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004679
4680 return ?
4681}
4682
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004683cmd void vkDestroyCommandPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004684 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004685 VkCommandPool commandPool,
4686 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004687 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004688 commandPoolObject := GetCommandPool(commandPool)
4689 assert(commandPoolObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004690
Jesse Hall3fbc8562015-11-29 22:10:52 -08004691 State.CommandPools[commandPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004692}
4693
4694cmd VkResult vkResetCommandPool(
4695 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004696 VkCommandPool commandPool,
4697 VkCommandPoolResetFlags flags) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004698 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004699 commandPoolObject := GetCommandPool(commandPool)
4700 assert(commandPoolObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004701
4702 return ?
4703}
4704
4705// Command buffer functions
4706
Jesse Hall3fbc8562015-11-29 22:10:52 -08004707macro void bindCommandBuffer(VkCommandBuffer commandBuffer, any obj, VkDeviceMemory memory) {
4708 memoryObject := GetDeviceMemory(memory)
4709 memoryObject.boundCommandBuffers[commandBuffer] = commandBuffer
Jesse Halld27f6aa2015-08-15 17:58:48 -07004710
Jesse Hall3fbc8562015-11-29 22:10:52 -08004711 commandBufferObject := GetCommandBuffer(commandBuffer)
4712 commandBufferObject.boundObjects[as!u64(obj)] = memory
Jesse Halld27f6aa2015-08-15 17:58:48 -07004713}
4714
Jesse Hall3fbc8562015-11-29 22:10:52 -08004715macro void unbindCommandBuffer(VkCommandBuffer commandBuffer, any obj, VkDeviceMemory memory) {
4716 memoryObject := GetDeviceMemory(memory)
4717 memoryObject.boundCommandBuffers[commandBuffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004718
Jesse Hall3fbc8562015-11-29 22:10:52 -08004719 commandBufferObject := GetCommandBuffer(commandBuffer)
4720 commandBufferObject.boundObjects[as!u64(obj)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004721}
4722
4723@threadSafety("system")
Jesse Hall3fbc8562015-11-29 22:10:52 -08004724cmd VkResult vkAllocateCommandBuffers(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004725 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004726 const VkCommandBufferAllocateInfo* pAllocateInfo,
4727 VkCommandBuffer* pCommandBuffers) {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08004728 assert(pAllocateInfo[0].sType == VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004729
Jesse Hall3dd678a2016-01-08 21:52:01 -08004730 count := pAllocateInfo[0].commandBufferCount
Jesse Hall3fbc8562015-11-29 22:10:52 -08004731 commandBuffers := pCommandBuffers[0:count]
Jesse Hallfbf97b02015-11-20 14:17:03 -08004732 for i in (0 .. count) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004733 commandBuffer := ?
4734 commandBuffers[i] = commandBuffer
4735 State.CommandBuffers[commandBuffer] = new!CommandBufferObject(device: device)
Jesse Hallfbf97b02015-11-20 14:17:03 -08004736 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07004737
4738 return ?
4739}
4740
4741@threadSafety("system")
Jesse Hallfbf97b02015-11-20 14:17:03 -08004742cmd void vkFreeCommandBuffers(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004743 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004744 VkCommandPool commandPool,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004745 u32 commandBufferCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004746 const VkCommandBuffer* pCommandBuffers) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004747 deviceObject := GetDevice(device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004748
Jesse Hall3fbc8562015-11-29 22:10:52 -08004749 commandBuffers := pCommandBuffers[0:commandBufferCount]
Jesse Hall03b6fe12015-11-24 12:44:21 -08004750 for i in (0 .. commandBufferCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004751 commandBufferObject := GetCommandBuffer(commandBuffers[i])
4752 assert(commandBufferObject.device == device)
Jesse Hallfbf97b02015-11-20 14:17:03 -08004753 // TODO: iterate over boundObjects and clear memory bindings
Jesse Hall3fbc8562015-11-29 22:10:52 -08004754 State.CommandBuffers[commandBuffers[i]] = null
Jesse Hallfbf97b02015-11-20 14:17:03 -08004755 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07004756}
4757
4758@threadSafety("app")
4759cmd VkResult vkBeginCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004760 VkCommandBuffer commandBuffer,
4761 const VkCommandBufferBeginInfo* pBeginInfo) {
4762 assert(pBeginInfo.sType == VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO)
4763 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004764
4765 // TODO: iterate over boundObjects and clear memory bindings
4766
4767 return ?
4768}
4769
4770@threadSafety("app")
4771cmd VkResult vkEndCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004772 VkCommandBuffer commandBuffer) {
4773 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004774
4775 return ?
4776}
4777
4778@threadSafety("app")
4779cmd VkResult vkResetCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004780 VkCommandBuffer commandBuffer,
4781 VkCommandBufferResetFlags flags) {
4782 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004783
4784 // TODO: iterate over boundObjects and clear memory bindings
4785
4786 return ?
4787}
4788
4789
4790// Command buffer building functions
4791
4792@threadSafety("app")
4793cmd void vkCmdBindPipeline(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004794 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004795 VkPipelineBindPoint pipelineBindPoint,
4796 VkPipeline pipeline) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004797 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004798 pipelineObject := GetPipeline(pipeline)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004799 assert(commandBufferObject.device == pipelineObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004800
Jesse Halld8bade02015-11-24 10:24:18 -08004801 queue := switch (pipelineBindPoint) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004802 case VK_PIPELINE_BIND_POINT_COMPUTE: VK_QUEUE_COMPUTE_BIT
4803 case VK_PIPELINE_BIND_POINT_GRAPHICS: VK_QUEUE_GRAPHICS_BIT
4804 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08004805 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004806}
4807
4808@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004809cmd void vkCmdSetViewport(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004810 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004811 u32 firstViewport,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004812 u32 viewportCount,
4813 const VkViewport* pViewports) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004814 commandBufferObject := GetCommandBuffer(commandBuffer)
4815 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004816}
4817
4818@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004819cmd void vkCmdSetScissor(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004820 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004821 u32 firstScissor,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004822 u32 scissorCount,
4823 const VkRect2D* pScissors) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004824 commandBufferObject := GetCommandBuffer(commandBuffer)
4825 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004826}
4827
4828@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004829cmd void vkCmdSetLineWidth(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004830 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004831 f32 lineWidth) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004832 commandBufferObject := GetCommandBuffer(commandBuffer)
4833 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004834}
4835
4836@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004837cmd void vkCmdSetDepthBias(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004838 VkCommandBuffer commandBuffer,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004839 f32 depthBiasConstantFactor,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004840 f32 depthBiasClamp,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004841 f32 depthBiasSlopeFactor) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004842 commandBufferObject := GetCommandBuffer(commandBuffer)
4843 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004844}
Jesse Halld27f6aa2015-08-15 17:58:48 -07004845
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004846@threadSafety("app")
4847cmd void vkCmdSetBlendConstants(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004848 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004849 // TODO(jessehall): apic only supports 'const' on pointer types. Using
4850 // an annotation as a quick hack to pass this to the template without
4851 // having to modify the AST and semantic model.
Jesse Hallb00daad2015-11-29 19:46:20 -08004852 @readonly f32[4] blendConstants) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004853 commandBufferObject := GetCommandBuffer(commandBuffer)
4854 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004855}
4856
4857@threadSafety("app")
4858cmd void vkCmdSetDepthBounds(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004859 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004860 f32 minDepthBounds,
4861 f32 maxDepthBounds) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004862 commandBufferObject := GetCommandBuffer(commandBuffer)
4863 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004864}
4865
4866@threadSafety("app")
4867cmd void vkCmdSetStencilCompareMask(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004868 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004869 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08004870 u32 compareMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004871 commandBufferObject := GetCommandBuffer(commandBuffer)
4872 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004873}
4874
4875@threadSafety("app")
4876cmd void vkCmdSetStencilWriteMask(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004877 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004878 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08004879 u32 writeMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004880 commandBufferObject := GetCommandBuffer(commandBuffer)
4881 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004882}
4883
4884@threadSafety("app")
4885cmd void vkCmdSetStencilReference(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004886 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004887 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08004888 u32 reference) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004889 commandBufferObject := GetCommandBuffer(commandBuffer)
4890 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004891}
4892
4893@threadSafety("app")
4894cmd void vkCmdBindDescriptorSets(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004895 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004896 VkPipelineBindPoint pipelineBindPoint,
4897 VkPipelineLayout layout,
4898 u32 firstSet,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004899 u32 descriptorSetCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004900 const VkDescriptorSet* pDescriptorSets,
4901 u32 dynamicOffsetCount,
4902 const u32* pDynamicOffsets) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004903 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004904
Jesse Hall03b6fe12015-11-24 12:44:21 -08004905 descriptorSets := pDescriptorSets[0:descriptorSetCount]
4906 for i in (0 .. descriptorSetCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004907 descriptorSet := descriptorSets[i]
4908 descriptorSetObject := GetDescriptorSet(descriptorSet)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004909 assert(commandBufferObject.device == descriptorSetObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004910 }
4911
4912 dynamicOffsets := pDynamicOffsets[0:dynamicOffsetCount]
4913 for i in (0 .. dynamicOffsetCount) {
4914 dynamicOffset := dynamicOffsets[i]
4915 }
4916
Jesse Halld8bade02015-11-24 10:24:18 -08004917 queue := switch (pipelineBindPoint) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004918 case VK_PIPELINE_BIND_POINT_COMPUTE: VK_QUEUE_COMPUTE_BIT
4919 case VK_PIPELINE_BIND_POINT_GRAPHICS: VK_QUEUE_GRAPHICS_BIT
4920 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08004921 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004922}
4923
4924@threadSafety("app")
4925cmd void vkCmdBindIndexBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004926 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004927 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004928 VkDeviceSize offset,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004929 VkIndexType indexType) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004930 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004931 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004932 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004933
Jesse Hall3fbc8562015-11-29 22:10:52 -08004934 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004935
Jesse Hall3fbc8562015-11-29 22:10:52 -08004936 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004937}
4938
4939@threadSafety("app")
4940cmd void vkCmdBindVertexBuffers(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004941 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004942 u32 firstBinding,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004943 u32 bindingCount,
4944 const VkBuffer* pBuffers,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004945 const VkDeviceSize* pOffsets) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004946 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004947
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004948 // TODO: check if not [firstBinding:firstBinding+bindingCount]
Jesse Halld27f6aa2015-08-15 17:58:48 -07004949 buffers := pBuffers[0:bindingCount]
4950 offsets := pOffsets[0:bindingCount]
4951 for i in (0 .. bindingCount) {
4952 buffer := buffers[i]
4953 offset := offsets[i]
4954 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004955 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004956
Jesse Hall3fbc8562015-11-29 22:10:52 -08004957 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004958 }
4959
Jesse Hall3fbc8562015-11-29 22:10:52 -08004960 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004961}
4962
4963@threadSafety("app")
4964cmd void vkCmdDraw(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004965 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004966 u32 vertexCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004967 u32 instanceCount,
4968 u32 firstVertex,
4969 u32 firstInstance) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004970 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004971
Jesse Hall3fbc8562015-11-29 22:10:52 -08004972 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004973}
4974
4975@threadSafety("app")
4976cmd void vkCmdDrawIndexed(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004977 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004978 u32 indexCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004979 u32 instanceCount,
4980 u32 firstIndex,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004981 s32 vertexOffset,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004982 u32 firstInstance) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004983 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004984
Jesse Hall3fbc8562015-11-29 22:10:52 -08004985 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004986}
4987
4988@threadSafety("app")
4989cmd void vkCmdDrawIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004990 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004991 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004992 VkDeviceSize offset,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004993 u32 drawCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004994 u32 stride) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004995 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004996 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004997 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004998
Jesse Hall3fbc8562015-11-29 22:10:52 -08004999 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005000
Jesse Hall3fbc8562015-11-29 22:10:52 -08005001 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005002}
5003
5004@threadSafety("app")
5005cmd void vkCmdDrawIndexedIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005006 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005007 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005008 VkDeviceSize offset,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005009 u32 drawCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005010 u32 stride) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005011 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005012 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005013 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005014
Jesse Hall3fbc8562015-11-29 22:10:52 -08005015 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005016
Jesse Hall3fbc8562015-11-29 22:10:52 -08005017 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005018}
5019
5020@threadSafety("app")
5021cmd void vkCmdDispatch(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005022 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005023 u32 x,
5024 u32 y,
5025 u32 z) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005026 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005027
Jesse Hall3fbc8562015-11-29 22:10:52 -08005028 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_COMPUTE_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005029}
5030
5031@threadSafety("app")
5032cmd void vkCmdDispatchIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005033 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005034 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005035 VkDeviceSize offset) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005036 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005037 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005038 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005039
Jesse Hall3fbc8562015-11-29 22:10:52 -08005040 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005041
Jesse Hall3fbc8562015-11-29 22:10:52 -08005042 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_COMPUTE_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005043}
5044
5045@threadSafety("app")
5046cmd void vkCmdCopyBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005047 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005048 VkBuffer srcBuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005049 VkBuffer dstBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005050 u32 regionCount,
5051 const VkBufferCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005052 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005053 srcBufferObject := GetBuffer(srcBuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005054 dstBufferObject := GetBuffer(dstBuffer)
5055 assert(commandBufferObject.device == srcBufferObject.device)
5056 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005057
5058 regions := pRegions[0:regionCount]
5059 for i in (0 .. regionCount) {
5060 region := regions[i]
5061 }
5062
Jesse Hall3fbc8562015-11-29 22:10:52 -08005063 bindCommandBuffer(commandBuffer, srcBuffer, srcBufferObject.memory)
5064 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005065
Jesse Hall65ab5522015-11-30 00:07:16 -08005066 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005067}
5068
5069@threadSafety("app")
5070cmd void vkCmdCopyImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005071 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005072 VkImage srcImage,
5073 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005074 VkImage dstImage,
5075 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005076 u32 regionCount,
5077 const VkImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005078 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005079 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005080 dstImageObject := GetImage(dstImage)
5081 assert(commandBufferObject.device == srcImageObject.device)
5082 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005083
5084 regions := pRegions[0:regionCount]
5085 for i in (0 .. regionCount) {
5086 region := regions[i]
5087 }
5088
Jesse Hall3fbc8562015-11-29 22:10:52 -08005089 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
5090 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005091
Jesse Hall65ab5522015-11-30 00:07:16 -08005092 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005093}
5094
5095@threadSafety("app")
5096cmd void vkCmdBlitImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005097 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005098 VkImage srcImage,
5099 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005100 VkImage dstImage,
5101 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005102 u32 regionCount,
5103 const VkImageBlit* pRegions,
Jesse Hall23ff73f2015-11-29 14:36:39 -08005104 VkFilter filter) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005105 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005106 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005107 dstImageObject := GetImage(dstImage)
5108 assert(commandBufferObject.device == srcImageObject.device)
5109 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005110
5111 regions := pRegions[0:regionCount]
5112 for i in (0 .. regionCount) {
5113 region := regions[i]
5114 }
5115
Jesse Hall3fbc8562015-11-29 22:10:52 -08005116 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
5117 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005118
Jesse Hall3fbc8562015-11-29 22:10:52 -08005119 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005120}
5121
5122@threadSafety("app")
5123cmd void vkCmdCopyBufferToImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005124 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005125 VkBuffer srcBuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005126 VkImage dstImage,
5127 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005128 u32 regionCount,
5129 const VkBufferImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005130 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005131 srcBufferObject := GetBuffer(srcBuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005132 dstImageObject := GetImage(dstImage)
5133 assert(commandBufferObject.device == srcBufferObject.device)
5134 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005135
5136 regions := pRegions[0:regionCount]
5137 for i in (0 .. regionCount) {
5138 region := regions[i]
5139 }
5140
Jesse Hall3fbc8562015-11-29 22:10:52 -08005141 bindCommandBuffer(commandBuffer, srcBuffer, srcBufferObject.memory)
5142 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005143
Jesse Hall65ab5522015-11-30 00:07:16 -08005144 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005145}
5146
5147@threadSafety("app")
5148cmd void vkCmdCopyImageToBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005149 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005150 VkImage srcImage,
5151 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005152 VkBuffer dstBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005153 u32 regionCount,
5154 const VkBufferImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005155 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005156 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005157 dstBufferObject := GetBuffer(dstBuffer)
5158 assert(commandBufferObject.device == srcImageObject.device)
5159 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005160
5161 regions := pRegions[0:regionCount]
5162 for i in (0 .. regionCount) {
5163 region := regions[i]
5164 }
5165
Jesse Hall3fbc8562015-11-29 22:10:52 -08005166 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
5167 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005168
Jesse Hall65ab5522015-11-30 00:07:16 -08005169 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005170}
5171
5172@threadSafety("app")
5173cmd void vkCmdUpdateBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005174 VkCommandBuffer commandBuffer,
5175 VkBuffer dstBuffer,
5176 VkDeviceSize dstOffset,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005177 VkDeviceSize dataSize,
Jesse Hall56d386a2016-07-26 15:20:40 -07005178 const void* pData) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005179 commandBufferObject := GetCommandBuffer(commandBuffer)
5180 dstBufferObject := GetBuffer(dstBuffer)
5181 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005182
5183 data := pData[0:dataSize]
5184
Jesse Hall3fbc8562015-11-29 22:10:52 -08005185 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005186
Jesse Hall65ab5522015-11-30 00:07:16 -08005187 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005188}
5189
5190@threadSafety("app")
5191cmd void vkCmdFillBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005192 VkCommandBuffer commandBuffer,
5193 VkBuffer dstBuffer,
5194 VkDeviceSize dstOffset,
Jesse Hallb00daad2015-11-29 19:46:20 -08005195 VkDeviceSize size,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005196 u32 data) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005197 commandBufferObject := GetCommandBuffer(commandBuffer)
5198 dstBufferObject := GetBuffer(dstBuffer)
5199 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005200
Jesse Hall65ab5522015-11-30 00:07:16 -08005201 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005202}
5203
5204@threadSafety("app")
5205cmd void vkCmdClearColorImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005206 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005207 VkImage image,
5208 VkImageLayout imageLayout,
5209 const VkClearColorValue* pColor,
5210 u32 rangeCount,
5211 const VkImageSubresourceRange* pRanges) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005212 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005213 imageObject := GetImage(image)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005214 assert(commandBufferObject.device == imageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005215
5216 ranges := pRanges[0:rangeCount]
5217 for i in (0 .. rangeCount) {
5218 range := ranges[i]
5219 }
5220
Jesse Hall3fbc8562015-11-29 22:10:52 -08005221 bindCommandBuffer(commandBuffer, image, imageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005222
Jesse Hall3fbc8562015-11-29 22:10:52 -08005223 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005224}
5225
5226@threadSafety("app")
5227cmd void vkCmdClearDepthStencilImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005228 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005229 VkImage image,
5230 VkImageLayout imageLayout,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005231 const VkClearDepthStencilValue* pDepthStencil,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005232 u32 rangeCount,
5233 const VkImageSubresourceRange* pRanges) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005234 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005235 imageObject := GetImage(image)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005236 assert(commandBufferObject.device == imageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005237
5238 ranges := pRanges[0:rangeCount]
5239 for i in (0 .. rangeCount) {
5240 range := ranges[i]
5241 }
5242
Jesse Hall3fbc8562015-11-29 22:10:52 -08005243 bindCommandBuffer(commandBuffer, image, imageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005244
Jesse Hall3fbc8562015-11-29 22:10:52 -08005245 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005246}
5247
5248@threadSafety("app")
Jesse Hallae38f732015-11-19 21:32:50 -08005249cmd void vkCmdClearAttachments(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005250 VkCommandBuffer commandBuffer,
Jesse Hallae38f732015-11-19 21:32:50 -08005251 u32 attachmentCount,
5252 const VkClearAttachment* pAttachments,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005253 u32 rectCount,
Jesse Halla15a4bf2015-11-19 22:48:02 -08005254 const VkClearRect* pRects) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005255 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005256
5257 rects := pRects[0:rectCount]
5258 for i in (0 .. rectCount) {
5259 rect := rects[i]
5260 }
5261
Jesse Hall3fbc8562015-11-29 22:10:52 -08005262 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005263}
5264
5265@threadSafety("app")
5266cmd void vkCmdResolveImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005267 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005268 VkImage srcImage,
5269 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005270 VkImage dstImage,
5271 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005272 u32 regionCount,
5273 const VkImageResolve* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005274 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005275 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005276 dstImageObject := GetImage(dstImage)
5277 assert(commandBufferObject.device == srcImageObject.device)
5278 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005279
5280 regions := pRegions[0:regionCount]
5281 for i in (0 .. regionCount) {
5282 region := regions[i]
5283 }
5284
Jesse Hall3fbc8562015-11-29 22:10:52 -08005285 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
5286 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005287
Jesse Hall3fbc8562015-11-29 22:10:52 -08005288 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005289}
5290
5291@threadSafety("app")
5292cmd void vkCmdSetEvent(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005293 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005294 VkEvent event,
5295 VkPipelineStageFlags stageMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005296 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005297 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005298 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005299}
5300
5301@threadSafety("app")
5302cmd void vkCmdResetEvent(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005303 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005304 VkEvent event,
5305 VkPipelineStageFlags stageMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005306 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005307 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005308 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005309}
5310
5311@threadSafety("app")
5312cmd void vkCmdWaitEvents(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005313 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005314 u32 eventCount,
5315 const VkEvent* pEvents,
5316 VkPipelineStageFlags srcStageMask,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005317 VkPipelineStageFlags dstStageMask,
5318 u32 memoryBarrierCount,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005319 const VkMemoryBarrier* pMemoryBarriers,
5320 u32 bufferMemoryBarrierCount,
5321 const VkBufferMemoryBarrier* pBufferMemoryBarriers,
5322 u32 imageMemoryBarrierCount,
5323 const VkImageMemoryBarrier* pImageMemoryBarriers) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005324 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005325
5326 events := pEvents[0:eventCount]
5327 for i in (0 .. eventCount) {
5328 event := events[i]
5329 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005330 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005331 }
5332
Jesse Hall3dd678a2016-01-08 21:52:01 -08005333 memoryBarriers := pMemoryBarriers[0:memoryBarrierCount]
Jesse Hall3fbc8562015-11-29 22:10:52 -08005334 for i in (0 .. memoryBarrierCount) {
Jesse Hall3dd678a2016-01-08 21:52:01 -08005335 memoryBarrier := memoryBarriers[i]
5336 }
5337 bufferMemoryBarriers := pBufferMemoryBarriers[0:bufferMemoryBarrierCount]
5338 for i in (0 .. bufferMemoryBarrierCount) {
5339 bufferMemoryBarrier := bufferMemoryBarriers[i]
5340 bufferObject := GetBuffer(bufferMemoryBarrier.buffer)
5341 assert(bufferObject.device == commandBufferObject.device)
5342 }
5343 imageMemoryBarriers := pImageMemoryBarriers[0:imageMemoryBarrierCount]
5344 for i in (0 .. imageMemoryBarrierCount) {
5345 imageMemoryBarrier := imageMemoryBarriers[i]
5346 imageObject := GetImage(imageMemoryBarrier.image)
5347 assert(imageObject.device == commandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005348 }
5349}
5350
5351@threadSafety("app")
5352cmd void vkCmdPipelineBarrier(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005353 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005354 VkPipelineStageFlags srcStageMask,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005355 VkPipelineStageFlags dstStageMask,
Jesse Halldc6d36c2015-11-29 19:12:15 -08005356 VkDependencyFlags dependencyFlags,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005357 u32 memoryBarrierCount,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005358 const VkMemoryBarrier* pMemoryBarriers,
5359 u32 bufferMemoryBarrierCount,
5360 const VkBufferMemoryBarrier* pBufferMemoryBarriers,
5361 u32 imageMemoryBarrierCount,
5362 const VkImageMemoryBarrier* pImageMemoryBarriers) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005363 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005364
Jesse Hall3dd678a2016-01-08 21:52:01 -08005365 memoryBarriers := pMemoryBarriers[0:memoryBarrierCount]
Jesse Hall3fbc8562015-11-29 22:10:52 -08005366 for i in (0 .. memoryBarrierCount) {
Jesse Hall3dd678a2016-01-08 21:52:01 -08005367 memoryBarrier := memoryBarriers[i]
5368 }
5369 bufferMemoryBarriers := pBufferMemoryBarriers[0:bufferMemoryBarrierCount]
5370 for i in (0 .. bufferMemoryBarrierCount) {
5371 bufferMemoryBarrier := bufferMemoryBarriers[i]
5372 bufferObject := GetBuffer(bufferMemoryBarrier.buffer)
5373 assert(bufferObject.device == commandBufferObject.device)
5374 }
5375 imageMemoryBarriers := pImageMemoryBarriers[0:imageMemoryBarrierCount]
5376 for i in (0 .. imageMemoryBarrierCount) {
5377 imageMemoryBarrier := imageMemoryBarriers[i]
5378 imageObject := GetImage(imageMemoryBarrier.image)
5379 assert(imageObject.device == commandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005380 }
5381}
5382
5383@threadSafety("app")
5384cmd void vkCmdBeginQuery(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005385 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005386 VkQueryPool queryPool,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005387 u32 query,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005388 VkQueryControlFlags flags) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005389 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005390 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005391 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005392}
5393
5394@threadSafety("app")
5395cmd void vkCmdEndQuery(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005396 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005397 VkQueryPool queryPool,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005398 u32 query) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005399 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005400 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005401 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005402}
5403
5404@threadSafety("app")
5405cmd void vkCmdResetQueryPool(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005406 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005407 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005408 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005409 u32 queryCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005410 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005411 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005412 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005413}
5414
5415@threadSafety("app")
5416cmd void vkCmdWriteTimestamp(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005417 VkCommandBuffer commandBuffer,
Jesse Hall6f39a6d2015-11-24 11:08:36 -08005418 VkPipelineStageFlagBits pipelineStage,
Jesse Halla3a7a1d2015-11-24 11:37:23 -08005419 VkQueryPool queryPool,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005420 u32 query) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005421 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halla3a7a1d2015-11-24 11:37:23 -08005422 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005423 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005424}
5425
5426@threadSafety("app")
5427cmd void vkCmdCopyQueryPoolResults(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005428 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005429 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005430 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005431 u32 queryCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005432 VkBuffer dstBuffer,
5433 VkDeviceSize dstOffset,
Jesse Halla9bb62b2015-11-21 19:31:56 -08005434 VkDeviceSize stride,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005435 VkQueryResultFlags flags) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005436 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005437 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005438 dstBufferObject := GetBuffer(dstBuffer)
5439 assert(commandBufferObject.device == queryPoolObject.device)
5440 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005441}
5442
5443cmd void vkCmdPushConstants(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005444 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005445 VkPipelineLayout layout,
5446 VkShaderStageFlags stageFlags,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005447 u32 offset,
5448 u32 size,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08005449 const void* pValues) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005450 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005451 layoutObject := GetPipelineLayout(layout)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005452 assert(commandBufferObject.device == layoutObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005453}
5454
5455@threadSafety("app")
5456cmd void vkCmdBeginRenderPass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005457 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005458 const VkRenderPassBeginInfo* pRenderPassBegin,
Jesse Hall65ab5522015-11-30 00:07:16 -08005459 VkSubpassContents contents) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005460 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005461 renderPassObject := GetRenderPass(pRenderPassBegin.renderPass)
5462 framebufferObject := GetFramebuffer(pRenderPassBegin.framebuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005463 assert(commandBufferObject.device == renderPassObject.device)
5464 assert(commandBufferObject.device == framebufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005465
Jesse Hall3fbc8562015-11-29 22:10:52 -08005466 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005467}
5468
5469cmd void vkCmdNextSubpass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005470 VkCommandBuffer commandBuffer,
Jesse Hall65ab5522015-11-30 00:07:16 -08005471 VkSubpassContents contents) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005472 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005473}
5474
5475@threadSafety("app")
5476cmd void vkCmdEndRenderPass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005477 VkCommandBuffer commandBuffer) {
5478 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005479
Jesse Hall3fbc8562015-11-29 22:10:52 -08005480 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005481}
5482
5483cmd void vkCmdExecuteCommands(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005484 VkCommandBuffer commandBuffer,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005485 u32 commandBufferCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005486 const VkCommandBuffer* pCommandBuffers) {
5487 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005488
Jesse Hall3dd678a2016-01-08 21:52:01 -08005489 commandBuffers := pCommandBuffers[0:commandBufferCount]
5490 for i in (0 .. commandBufferCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005491 secondaryCommandBuffer := commandBuffers[i]
5492 secondaryCommandBufferObject := GetCommandBuffer(secondaryCommandBuffer)
5493 assert(commandBufferObject.device == secondaryCommandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005494 }
5495}
5496
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005497@extension("VK_KHR_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005498cmd void vkDestroySurfaceKHR(
5499 VkInstance instance,
Jesse Hall0e74f002015-11-30 11:37:59 -08005500 VkSurfaceKHR surface,
5501 const VkAllocationCallbacks* pAllocator) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005502 instanceObject := GetInstance(instance)
5503 surfaceObject := GetSurface(surface)
5504 assert(surfaceObject.instance == instance)
Michael Lentine88594d72015-11-12 12:49:45 -08005505
Jesse Hall1356b0d2015-11-23 17:24:58 -08005506 State.Surfaces[surface] = null
Jesse Hall2818f932015-11-19 21:19:17 -08005507}
5508
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005509@extension("VK_KHR_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005510cmd VkResult vkGetPhysicalDeviceSurfaceSupportKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005511 VkPhysicalDevice physicalDevice,
5512 u32 queueFamilyIndex,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005513 VkSurfaceKHR surface,
Jesse Hallb00daad2015-11-29 19:46:20 -08005514 VkBool32* pSupported) {
5515 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08005516
5517 return ?
5518}
5519
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005520@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08005521cmd VkResult vkGetPhysicalDeviceSurfaceCapabilitiesKHR(
5522 VkPhysicalDevice physicalDevice,
5523 VkSurfaceKHR surface,
5524 VkSurfaceCapabilitiesKHR* pSurfaceCapabilities) {
5525 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5526
5527 surfaceCapabilities := ?
5528 pSurfaceCapabilities[0] = surfaceCapabilities
5529
5530 return ?
5531}
5532
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005533@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08005534cmd VkResult vkGetPhysicalDeviceSurfaceFormatsKHR(
5535 VkPhysicalDevice physicalDevice,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005536 VkSurfaceKHR surface,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005537 u32* pSurfaceFormatCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005538 VkSurfaceFormatKHR* pSurfaceFormats) {
Jesse Hallb00daad2015-11-29 19:46:20 -08005539 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08005540
5541 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08005542 pSurfaceFormatCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08005543 surfaceFormats := pSurfaceFormats[0:count]
5544
5545 for i in (0 .. count) {
5546 surfaceFormat := ?
5547 surfaceFormats[i] = surfaceFormat
5548 }
5549
5550 return ?
5551}
5552
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005553@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08005554cmd VkResult vkGetPhysicalDeviceSurfacePresentModesKHR(
5555 VkPhysicalDevice physicalDevice,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005556 VkSurfaceKHR surface,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005557 u32* pPresentModeCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005558 VkPresentModeKHR* pPresentModes) {
Jesse Hallb00daad2015-11-29 19:46:20 -08005559 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08005560
5561 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08005562 pPresentModeCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08005563 presentModes := pPresentModes[0:count]
5564
5565 for i in (0 .. count) {
5566 presentMode := ?
5567 presentModes[i] = presentMode
5568 }
5569
5570 return ?
5571}
5572
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005573@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005574cmd VkResult vkCreateSwapchainKHR(
5575 VkDevice device,
5576 const VkSwapchainCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005577 const VkAllocationCallbacks* pAllocator,
Michael Lentine88594d72015-11-12 12:49:45 -08005578 VkSwapchainKHR* pSwapchain) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005579 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR)
Michael Lentine88594d72015-11-12 12:49:45 -08005580 deviceObject := GetDevice(device)
5581
5582 swapchain := ?
5583 pSwapchain[0] = swapchain
5584 State.Swapchains[swapchain] = new!SwapchainObject(device: device)
5585
5586 return ?
5587}
5588
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005589@extension("VK_KHR_swapchain")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005590cmd void vkDestroySwapchainKHR(
Michael Lentine88594d72015-11-12 12:49:45 -08005591 VkDevice device,
Jesse Hall0e74f002015-11-30 11:37:59 -08005592 VkSwapchainKHR swapchain,
5593 const VkAllocationCallbacks* pAllocator) {
Michael Lentine88594d72015-11-12 12:49:45 -08005594 deviceObject := GetDevice(device)
5595 swapchainObject := GetSwapchain(swapchain)
5596 assert(swapchainObject.device == device)
5597
5598 State.Swapchains[swapchain] = null
Michael Lentine88594d72015-11-12 12:49:45 -08005599}
5600
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005601@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005602cmd VkResult vkGetSwapchainImagesKHR(
5603 VkDevice device,
5604 VkSwapchainKHR swapchain,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005605 u32* pSwapchainImageCount,
Michael Lentine88594d72015-11-12 12:49:45 -08005606 VkImage* pSwapchainImages) {
5607 deviceObject := GetDevice(device)
5608
5609 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08005610 pSwapchainImageCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08005611 swapchainImages := pSwapchainImages[0:count]
5612
5613 for i in (0 .. count) {
5614 swapchainImage := ?
5615 swapchainImages[i] = swapchainImage
Jesse Hall1356b0d2015-11-23 17:24:58 -08005616 State.Images[swapchainImage] = new!ImageObject(device: device)
Michael Lentine88594d72015-11-12 12:49:45 -08005617 }
5618
5619 return ?
5620}
5621
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005622@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005623cmd VkResult vkAcquireNextImageKHR(
5624 VkDevice device,
5625 VkSwapchainKHR swapchain,
5626 u64 timeout,
5627 VkSemaphore semaphore,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005628 VkFence fence,
Michael Lentine88594d72015-11-12 12:49:45 -08005629 u32* pImageIndex) {
5630 deviceObject := GetDevice(device)
5631 swapchainObject := GetSwapchain(swapchain)
5632
5633 imageIndex := ?
5634 pImageIndex[0] = imageIndex
5635
5636 return ?
5637}
5638
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005639@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005640cmd VkResult vkQueuePresentKHR(
5641 VkQueue queue,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08005642 const VkPresentInfoKHR* pPresentInfo) {
Michael Lentine88594d72015-11-12 12:49:45 -08005643 queueObject := GetQueue(queue)
5644
5645 presentInfo := ?
5646 pPresentInfo[0] = presentInfo
5647
5648 return ?
5649}
5650
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005651@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005652cmd VkResult vkGetPhysicalDeviceDisplayPropertiesKHR(
5653 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005654 u32* pPropertyCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005655 VkDisplayPropertiesKHR* pProperties) {
5656 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5657 return ?
5658}
5659
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005660@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005661cmd VkResult vkGetPhysicalDeviceDisplayPlanePropertiesKHR(
5662 VkPhysicalDevice physicalDevice,
5663 u32* pPropertyCount,
5664 VkDisplayPlanePropertiesKHR* pProperties) {
5665 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5666 return ?
5667}
5668
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005669@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005670cmd VkResult vkGetDisplayPlaneSupportedDisplaysKHR(
5671 VkPhysicalDevice physicalDevice,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005672 u32 planeIndex,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08005673 u32* pDisplayCount,
5674 VkDisplayKHR* pDisplays) {
Jesse Halla6429252015-11-29 18:59:42 -08005675 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5676 return ?
5677}
5678
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005679@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005680cmd VkResult vkGetDisplayModePropertiesKHR(
5681 VkPhysicalDevice physicalDevice,
5682 VkDisplayKHR display,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005683 u32* pPropertyCount,
5684 VkDisplayModePropertiesKHR* pProperties) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005685 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5686 return ?
5687}
5688
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005689@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005690cmd VkResult vkCreateDisplayModeKHR(
5691 VkPhysicalDevice physicalDevice,
5692 VkDisplayKHR display,
5693 const VkDisplayModeCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005694 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005695 VkDisplayModeKHR* pMode) {
5696 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5697 return ?
5698}
5699
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005700@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005701cmd VkResult vkGetDisplayPlaneCapabilitiesKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005702 VkPhysicalDevice physicalDevice,
Jesse Hall9ba8bc82015-11-30 16:22:16 -08005703 VkDisplayModeKHR mode,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005704 u32 planeIndex,
Jesse Halla6429252015-11-29 18:59:42 -08005705 VkDisplayPlaneCapabilitiesKHR* pCapabilities) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005706 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5707 return ?
5708}
5709
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005710@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005711cmd VkResult vkCreateDisplayPlaneSurfaceKHR(
5712 VkInstance instance,
5713 const VkDisplaySurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005714 const VkAllocationCallbacks* pAllocator,
Jesse Halla6429252015-11-29 18:59:42 -08005715 VkSurfaceKHR* pSurface) {
5716 return ?
5717}
5718
Jesse Hall9ba8bc82015-11-30 16:22:16 -08005719@extension("VK_KHR_display_swapchain")
5720cmd VkResult vkCreateSharedSwapchainsKHR(
5721 VkDevice device,
5722 u32 swapchainCount,
5723 const VkSwapchainCreateInfoKHR* pCreateInfos,
5724 const VkAllocationCallbacks* pAllocator,
5725 VkSwapchainKHR* pSwapchains) {
5726 return ?
5727}
5728
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005729@extension("VK_KHR_xlib_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005730cmd VkResult vkCreateXlibSurfaceKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005731 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005732 const VkXlibSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005733 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005734 VkSurfaceKHR* pSurface) {
5735 instanceObject := GetInstance(instance)
5736 return ?
5737}
5738
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005739@extension("VK_KHR_xlib_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005740cmd VkBool32 vkGetPhysicalDeviceXlibPresentationSupportKHR(
5741 VkPhysicalDevice physicalDevice,
5742 u32 queueFamilyIndex,
5743 platform.Display* dpy,
Jesse Hall65ab5522015-11-30 00:07:16 -08005744 platform.VisualID visualID) {
Jesse Halla6429252015-11-29 18:59:42 -08005745 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5746 return ?
5747}
5748
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005749@extension("VK_KHR_xcb_surface")
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005750cmd VkResult vkCreateXcbSurfaceKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005751 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005752 const VkXcbSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005753 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005754 VkSurfaceKHR* pSurface) {
5755 instanceObject := GetInstance(instance)
5756 return ?
5757}
5758
Jesse Hall523db342015-11-30 21:12:55 -08005759@extension("VK_KHR_xcb_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005760cmd VkBool32 vkGetPhysicalDeviceXcbPresentationSupportKHR(
5761 VkPhysicalDevice physicalDevice,
5762 u32 queueFamilyIndex,
5763 platform.xcb_connection_t* connection,
5764 platform.xcb_visualid_t visual_id) {
5765 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5766 return ?
5767}
5768
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005769@extension("VK_KHR_wayland_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005770cmd VkResult vkCreateWaylandSurfaceKHR(
5771 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005772 const VkWaylandSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005773 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005774 VkSurfaceKHR* pSurface) {
5775 instanceObject := GetInstance(instance)
5776 return ?
5777}
5778
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005779@extension("VK_KHR_wayland_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005780cmd VkBool32 vkGetPhysicalDeviceWaylandPresentationSupportKHR(
5781 VkPhysicalDevice physicalDevice,
5782 u32 queueFamilyIndex,
5783 platform.wl_display* display) {
5784 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5785 return ?
5786}
5787
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005788@extension("VK_KHR_mir_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005789cmd VkResult vkCreateMirSurfaceKHR(
5790 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005791 const VkMirSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005792 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005793 VkSurfaceKHR* pSurface) {
5794 instanceObject := GetInstance(instance)
5795 return ?
5796}
5797
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005798@extension("VK_KHR_mir_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005799cmd VkBool32 vkGetPhysicalDeviceMirPresentationSupportKHR(
5800 VkPhysicalDevice physicalDevice,
5801 u32 queueFamilyIndex,
5802 platform.MirConnection* connection) {
5803 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5804 return ?
5805}
5806
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005807@extension("VK_KHR_android_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005808cmd VkResult vkCreateAndroidSurfaceKHR(
5809 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005810 const VkAndroidSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005811 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005812 VkSurfaceKHR* pSurface) {
5813 instanceObject := GetInstance(instance)
5814 return ?
5815}
5816
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005817@extension("VK_KHR_win32_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005818cmd VkResult vkCreateWin32SurfaceKHR(
5819 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005820 const VkWin32SurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005821 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005822 VkSurfaceKHR* pSurface) {
5823 instanceObject := GetInstance(instance)
5824 return ?
5825}
5826
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005827@extension("VK_KHR_win32_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005828cmd VkResult vkGetPhysicalDeviceWin32PresentationSupportKHR(
5829 VkPhysicalDevice physicalDevice,
5830 u32 queueFamilyIndex) {
Jesse Halle2948d82016-02-25 04:19:32 -08005831 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Jesse Halla6429252015-11-29 18:59:42 -08005832 return ?
5833}
5834
Chia-I Wub262ddc2016-03-22 07:38:20 +08005835@extension("VK_ANDROID_native_buffer")
5836cmd VkResult vkGetSwapchainGrallocUsageANDROID(
5837 VkDevice device,
5838 VkFormat format,
5839 VkImageUsageFlags imageUsage,
5840 int* grallocUsage) {
5841 return ?
5842}
5843
5844@extension("VK_ANDROID_native_buffer")
Chris Forbes8e4438b2016-12-07 16:26:49 +13005845cmd VkResult vkGetSwapchainGrallocUsage2ANDROID(
5846 VkDevice device,
5847 VkFormat format,
5848 VkImageUsageFlags imageUsage,
5849 VkSwapchainImageUsageFlagsANDROID swapchainImageUsage,
5850 int* grallocUsage) {
5851 return ?
5852}
5853
5854@extension("VK_ANDROID_native_buffer")
Chia-I Wub262ddc2016-03-22 07:38:20 +08005855cmd VkResult vkAcquireImageANDROID(
5856 VkDevice device,
5857 VkImage image,
5858 int nativeFenceFd,
5859 VkSemaphore semaphore,
5860 VkFence fence) {
5861 return ?
5862}
5863
5864@extension("VK_ANDROID_native_buffer")
5865cmd VkResult vkQueueSignalReleaseImageANDROID(
5866 VkQueue queue,
5867 u32 waitSemaphoreCount,
5868 const VkSemaphore* pWaitSemaphores,
5869 VkImage image,
5870 int* pNativeFenceFd) {
5871 return ?
5872}
5873
Ian Elliott4c8bb2a2016-12-29 11:07:26 -07005874@extension("VK_GOOGLE_display_timing")
5875cmd VkResult vkGetRefreshCycleDurationGOOGLE(
5876 VkDevice device,
5877 VkSwapchainKHR swapchain,
5878 VkRefreshCycleDurationGOOGLE* pDisplayTimingProperties) {
5879 deviceObject := GetDevice(device)
5880 swapchainObject := GetSwapchain(swapchain)
5881
5882 displayTimingProperties := ?
5883 pDisplayTimingProperties[0] = displayTimingProperties
5884
5885 return ?
5886}
5887
5888@extension("VK_GOOGLE_display_timing")
5889cmd VkResult vkGetPastPresentationTimingGOOGLE(
5890 VkDevice device,
5891 VkSwapchainKHR swapchain,
5892 u32* pPresentationTimingCount,
5893 VkPastPresentationTimingGOOGLE* pPresentationTimings) {
Ian Elliott4c8bb2a2016-12-29 11:07:26 -07005894 return ?
5895}
5896
Jesse Hall715b86a2016-01-16 16:34:29 -08005897@extension("VK_EXT_debug_report")
5898@external type void* PFN_vkDebugReportCallbackEXT
5899@extension("VK_EXT_debug_report")
5900@pfn cmd VkBool32 vkDebugReportCallbackEXT(
5901 VkDebugReportFlagsEXT flags,
5902 VkDebugReportObjectTypeEXT objectType,
5903 u64 object,
5904 platform.size_t location,
5905 s32 messageCode,
5906 const char* pLayerPrefix,
5907 const char* pMessage,
5908 void* pUserData) {
5909 return ?
5910}
5911
5912@extension("VK_EXT_debug_report")
5913cmd VkResult vkCreateDebugReportCallbackEXT(
5914 VkInstance instance,
5915 const VkDebugReportCallbackCreateInfoEXT* pCreateInfo,
5916 const VkAllocationCallbacks* pAllocator,
5917 VkDebugReportCallbackEXT* pCallback) {
5918 return ?
5919}
5920
5921@extension("VK_EXT_debug_report")
5922cmd void vkDestroyDebugReportCallbackEXT(
5923 VkInstance instance,
5924 VkDebugReportCallbackEXT callback,
5925 const VkAllocationCallbacks* pAllocator) {
5926}
5927
5928@extension("VK_EXT_debug_report")
5929cmd void vkDebugReportMessageEXT(
5930 VkInstance instance,
5931 VkDebugReportFlagsEXT flags,
5932 VkDebugReportObjectTypeEXT objectType,
5933 u64 object,
5934 platform.size_t location,
5935 s32 messageCode,
5936 const char* pLayerPrefix,
5937 const char* pMessage) {
5938}
5939
Jesse Hall26763382016-05-20 07:13:52 -07005940@extension("VK_EXT_debug_marker")
5941cmd VkResult vkDebugMarkerSetObjectTagEXT(
5942 VkDevice device,
5943 VkDebugMarkerObjectTagInfoEXT* pTagInfo) {
5944 return ?
5945}
5946
5947@extension("VK_EXT_debug_marker")
5948cmd VkResult vkDebugMarkerSetObjectNameEXT(
5949 VkDevice device,
5950 VkDebugMarkerObjectNameInfoEXT* pNameInfo) {
5951 return ?
5952}
5953
5954@extension("VK_EXT_debug_marker")
5955cmd void vkCmdDebugMarkerBeginEXT(
5956 VkCommandBuffer commandBuffer,
5957 VkDebugMarkerMarkerInfoEXT* pMarkerInfo) {
5958}
5959
5960@extension("VK_EXT_debug_marker")
5961cmd void vkCmdDebugMarkerEndEXT(
5962 VkCommandBuffer commandBuffer) {
5963}
5964
5965@extension("VK_EXT_debug_marker")
5966cmd void vkCmdDebugMarkerInsertEXT(
5967 VkCommandBuffer commandBuffer,
5968 VkDebugMarkerMarkerInfoEXT* pMarkerInfo) {
5969}
5970
Chris Forbes1194ede2016-12-30 16:29:25 +13005971@extension("VK_KHR_get_physical_device_properties2")
5972cmd void vkGetPhysicalDeviceFeatures2KHR(
5973 VkPhysicalDevice physicalDevice,
5974 VkPhysicalDeviceFeatures2KHR* pFeatures) {
5975}
5976
5977@extension("VK_KHR_get_physical_device_properties2")
5978cmd void vkGetPhysicalDeviceProperties2KHR(
5979 VkPhysicalDevice physicalDevice,
5980 VkPhysicalDeviceProperties2KHR* pProperties) {
5981}
5982
5983@extension("VK_KHR_get_physical_device_properties2")
5984cmd void vkGetPhysicalDeviceFormatProperties2KHR(
5985 VkPhysicalDevice physicalDevice,
5986 VkFormat format,
5987 VkFormatProperties2KHR* pFormatProperties) {
5988}
5989
5990@extension("VK_KHR_get_physical_device_properties2")
5991cmd VkResult vkGetPhysicalDeviceImageFormatProperties2KHR(
5992 VkPhysicalDevice physicalDevice,
5993 const VkPhysicalDeviceImageFormatInfo2KHR* pImageFormatInfo,
5994 VkImageFormatProperties2KHR* pImageFormatProperties) {
5995 return ?
5996}
5997
5998@extension("VK_KHR_get_physical_device_properties2")
5999cmd void vkGetPhysicalDeviceQueueFamilyProperties2KHR(
6000 VkPhysicalDevice physicalDevice,
6001 u32* pQueueFamilyPropertyCount,
6002 VkQueueFamilyProperties2KHR* pQueueFamilyProperties) {
6003}
6004
6005@extension("VK_KHR_get_physical_device_properties2")
6006cmd void vkGetPhysicalDeviceMemoryProperties2KHR(
6007 VkPhysicalDevice physicalDevice,
6008 VkPhysicalDeviceMemoryProperties2KHR* pMemoryProperties) {
6009}
6010
6011@extension("VK_KHR_get_physical_device_properties2")
6012cmd void vkGetPhysicalDeviceSparseImageFormatProperties2KHR(
6013 VkPhysicalDevice physicalDevice,
6014 const VkPhysicalDeviceSparseImageFormatInfo2KHR* pFormatInfo,
6015 u32* pPropertyCount,
6016 VkSparseImageFormatProperties2KHR* pProperties) {
6017}
6018
Chris Forbes289cb792016-12-30 15:03:55 +13006019@extension("VK_AMD_draw_indirect_count")
6020cmd void vkCmdDrawIndirectCountAMD(
6021 VkCommandBuffer commandBuffer,
6022 VkBuffer buffer,
6023 VkDeviceSize offset,
6024 VkBuffer countBuffer,
6025 VkDeviceSize countBufferOffset,
6026 u32 maxDrawCount,
6027 u32 stride) {
6028}
6029
6030@extension("VK_AMD_draw_indirect_count")
6031cmd void vkCmdDrawIndexedIndirectCountAMD(
6032 VkCommandBuffer commandBuffer,
6033 VkBuffer buffer,
6034 VkDeviceSize offset,
6035 VkBuffer countBuffer,
6036 VkDeviceSize countBufferOffset,
6037 u32 maxDrawCount,
6038 u32 stride) {
6039}
6040
6041@extension("VK_NV_external_memory_capabilities")
6042cmd VkResult vkGetPhysicalDeviceExternalImageFormatPropertiesNV(
6043 VkPhysicalDevice physicalDevice,
6044 VkFormat format,
6045 VkImageType type,
6046 VkImageTiling tiling,
6047 VkImageUsageFlags usage,
6048 VkImageCreateFlags flags,
6049 VkExternalMemoryHandleTypeFlagsNV externalHandleType,
6050 VkExternalImageFormatPropertiesNV* pExternalImageFormatProperties) {
6051 return ?
6052}
6053
6054@extension("VK_NV_external_memory_win32")
6055cmd VkResult vkGetMemoryWin32HandleNV(
6056 VkDevice device,
6057 VkDeviceMemory memory,
6058 VkExternalMemoryHandleTypeFlagsNV handleType,
6059 platform.HANDLE* pHandle) {
6060 return ?
6061}
6062
6063@extension("VK_NV_external_memory_win32")
6064cmd void vkCmdProcessCommandsNVX(
6065 VkCommandBuffer commandBuffer,
6066 const VkCmdProcessCommandsInfoNVX* pProcessCommandsInfo) {
6067}
6068
6069@extension("VK_NV_external_memory_win32")
6070cmd void vkCmdReserveSpaceForCommandsNVX(
6071 VkCommandBuffer commandBuffer,
6072 const VkCmdReserveSpaceForCommandsInfoNVX* pReserveSpaceInfo) {
6073}
6074
6075@extension("VK_NV_external_memory_win32")
6076cmd VkResult vkCreateIndirectCommandsLayoutNVX(
6077 VkDevice device,
6078 const VkIndirectCommandsLayoutCreateInfoNVX* pCreateInfo,
6079 const VkAllocationCallbacks* pAllocator,
6080 VkIndirectCommandsLayoutNVX* pIndirectCommandsLayout) {
6081 return ?
6082}
6083
6084@extension("VK_NV_external_memory_win32")
6085cmd void vkDestroyIndirectCommandsLayoutNVX(
6086 VkDevice device,
6087 VkIndirectCommandsLayoutNVX indirectCommandsLayout,
6088 const VkAllocationCallbacks* pAllocator) {
6089}
6090
6091@extension("VK_NV_external_memory_win32")
6092cmd VkResult vkCreateObjectTableNVX(
6093 VkDevice device,
6094 const VkObjectTableCreateInfoNVX* pCreateInfo,
6095 const VkAllocationCallbacks* pAllocator,
6096 VkObjectTableNVX* pObjectTable) {
6097 return ?
6098}
6099
6100@extension("VK_NV_external_memory_win32")
6101cmd void vkDestroyObjectTableNVX(
6102 VkDevice device,
6103 VkObjectTableNVX objectTable,
6104 const VkAllocationCallbacks* pAllocator) {
6105}
6106
6107@extension("VK_NV_external_memory_win32")
6108cmd VkResult vkRegisterObjectsNVX(
6109 VkDevice device,
6110 VkObjectTableNVX objectTable,
6111 u32 objectCount,
6112 const VkObjectTableEntryNVX* const* ppObjectTableEntries,
6113 const u32* pObjectIndices) {
6114 return ?
6115}
6116
6117@extension("VK_NV_external_memory_win32")
6118cmd VkResult vkUnregisterObjectsNVX(
6119 VkDevice device,
6120 VkObjectTableNVX objectTable,
6121 u32 objectCount,
6122 const VkObjectEntryTypeNVX* pObjectEntryTypes,
6123 const u32* pObjectIndices) {
6124 return ?
6125}
6126
6127@extension("VK_NV_external_memory_win32")
6128cmd void vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX(
6129 VkPhysicalDevice physicalDevice,
6130 VkDeviceGeneratedCommandsFeaturesNVX* pFeatures,
6131 VkDeviceGeneratedCommandsLimitsNVX* pLimits) {
6132}
6133
Chris Forbes1d5f68c2017-01-31 10:17:01 +13006134@extension("VK_KHR_shared_presentable_image")
Chris Forbes2e12cb82017-01-18 11:45:17 +13006135cmd VkResult vkGetSwapchainStatusKHR(
6136 VkDevice device,
6137 VkSwapchainKHR swapchain) {
6138 return ?
6139}
6140
Jesse Halld27f6aa2015-08-15 17:58:48 -07006141
6142////////////////
6143// Validation //
6144////////////////
6145
6146extern void validate(string layerName, bool condition, string message)
6147
6148
6149/////////////////////////////
6150// Internal State Tracking //
6151/////////////////////////////
6152
6153StateObject State
6154
6155@internal class StateObject {
6156 // Dispatchable objects.
6157 map!(VkInstance, ref!InstanceObject) Instances
6158 map!(VkPhysicalDevice, ref!PhysicalDeviceObject) PhysicalDevices
6159 map!(VkDevice, ref!DeviceObject) Devices
6160 map!(VkQueue, ref!QueueObject) Queues
Jesse Hall3fbc8562015-11-29 22:10:52 -08006161 map!(VkCommandBuffer, ref!CommandBufferObject) CommandBuffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07006162
6163 // Non-dispatchable objects.
6164 map!(VkDeviceMemory, ref!DeviceMemoryObject) DeviceMemories
6165 map!(VkBuffer, ref!BufferObject) Buffers
6166 map!(VkBufferView, ref!BufferViewObject) BufferViews
6167 map!(VkImage, ref!ImageObject) Images
6168 map!(VkImageView, ref!ImageViewObject) ImageViews
Jesse Halld27f6aa2015-08-15 17:58:48 -07006169 map!(VkShaderModule, ref!ShaderModuleObject) ShaderModules
Jesse Halld27f6aa2015-08-15 17:58:48 -07006170 map!(VkPipeline, ref!PipelineObject) Pipelines
6171 map!(VkPipelineLayout, ref!PipelineLayoutObject) PipelineLayouts
6172 map!(VkSampler, ref!SamplerObject) Samplers
6173 map!(VkDescriptorSet, ref!DescriptorSetObject) DescriptorSets
6174 map!(VkDescriptorSetLayout, ref!DescriptorSetLayoutObject) DescriptorSetLayouts
6175 map!(VkDescriptorPool, ref!DescriptorPoolObject) DescriptorPools
Jesse Halld27f6aa2015-08-15 17:58:48 -07006176 map!(VkFence, ref!FenceObject) Fences
6177 map!(VkSemaphore, ref!SemaphoreObject) Semaphores
6178 map!(VkEvent, ref!EventObject) Events
6179 map!(VkQueryPool, ref!QueryPoolObject) QueryPools
6180 map!(VkFramebuffer, ref!FramebufferObject) Framebuffers
6181 map!(VkRenderPass, ref!RenderPassObject) RenderPasses
6182 map!(VkPipelineCache, ref!PipelineCacheObject) PipelineCaches
Jesse Hall3fbc8562015-11-29 22:10:52 -08006183 map!(VkCommandPool, ref!CommandPoolObject) CommandPools
Jesse Hall1356b0d2015-11-23 17:24:58 -08006184 map!(VkSurfaceKHR, ref!SurfaceObject) Surfaces
Michael Lentine88594d72015-11-12 12:49:45 -08006185 map!(VkSwapchainKHR, ref!SwapchainObject) Swapchains
Jesse Halld27f6aa2015-08-15 17:58:48 -07006186}
6187
6188@internal class InstanceObject {
6189}
6190
6191@internal class PhysicalDeviceObject {
6192 VkInstance instance
6193}
6194
6195@internal class DeviceObject {
6196 VkPhysicalDevice physicalDevice
6197}
6198
6199@internal class QueueObject {
6200 VkDevice device
6201 VkQueueFlags flags
6202}
6203
Jesse Hall3fbc8562015-11-29 22:10:52 -08006204@internal class CommandBufferObject {
Jesse Halld27f6aa2015-08-15 17:58:48 -07006205 VkDevice device
6206 map!(u64, VkDeviceMemory) boundObjects
6207 VkQueueFlags queueFlags
6208}
6209
6210@internal class DeviceMemoryObject {
Jesse Hall3fbc8562015-11-29 22:10:52 -08006211 VkDevice device
6212 VkDeviceSize allocationSize
6213 map!(u64, VkDeviceSize) boundObjects
6214 map!(VkCommandBuffer, VkCommandBuffer) boundCommandBuffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07006215}
6216
6217@internal class BufferObject {
6218 VkDevice device
Jesse Hall3fbc8562015-11-29 22:10:52 -08006219 VkDeviceMemory memory
6220 VkDeviceSize memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07006221}
6222
6223@internal class BufferViewObject {
6224 VkDevice device
6225 VkBuffer buffer
6226}
6227
6228@internal class ImageObject {
6229 VkDevice device
Jesse Hall3fbc8562015-11-29 22:10:52 -08006230 VkDeviceMemory memory
6231 VkDeviceSize memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07006232}
6233
6234@internal class ImageViewObject {
6235 VkDevice device
6236 VkImage image
6237}
6238
Jesse Halld27f6aa2015-08-15 17:58:48 -07006239@internal class ShaderObject {
6240 VkDevice device
6241}
6242
6243@internal class ShaderModuleObject {
6244 VkDevice device
6245}
6246
6247@internal class PipelineObject {
6248 VkDevice device
6249}
6250
6251@internal class PipelineLayoutObject {
6252 VkDevice device
6253}
6254
6255@internal class SamplerObject {
6256 VkDevice device
6257}
6258
6259@internal class DescriptorSetObject {
6260 VkDevice device
6261}
6262
6263@internal class DescriptorSetLayoutObject {
6264 VkDevice device
6265}
6266
6267@internal class DescriptorPoolObject {
6268 VkDevice device
6269}
6270
Jesse Halld27f6aa2015-08-15 17:58:48 -07006271@internal class FenceObject {
6272 VkDevice device
6273 bool signaled
6274}
6275
6276@internal class SemaphoreObject {
6277 VkDevice device
6278}
6279
6280@internal class EventObject {
6281 VkDevice device
6282}
6283
6284@internal class QueryPoolObject {
6285 VkDevice device
6286}
6287
6288@internal class FramebufferObject {
6289 VkDevice device
6290}
6291
6292@internal class RenderPassObject {
6293 VkDevice device
6294}
6295
6296@internal class PipelineCacheObject {
6297 VkDevice device
6298}
6299
Jesse Hall3fbc8562015-11-29 22:10:52 -08006300@internal class CommandPoolObject {
Jesse Halld27f6aa2015-08-15 17:58:48 -07006301 VkDevice device
6302}
6303
Jesse Hall1356b0d2015-11-23 17:24:58 -08006304@internal class SurfaceObject {
6305 VkInstance instance
6306}
6307
Michael Lentine88594d72015-11-12 12:49:45 -08006308@internal class SwapchainObject {
6309 VkDevice device
6310}
6311
Jesse Halld27f6aa2015-08-15 17:58:48 -07006312macro ref!InstanceObject GetInstance(VkInstance instance) {
6313 assert(instance in State.Instances)
6314 return State.Instances[instance]
6315}
6316
6317macro ref!PhysicalDeviceObject GetPhysicalDevice(VkPhysicalDevice physicalDevice) {
6318 assert(physicalDevice in State.PhysicalDevices)
6319 return State.PhysicalDevices[physicalDevice]
6320}
6321
6322macro ref!DeviceObject GetDevice(VkDevice device) {
6323 assert(device in State.Devices)
6324 return State.Devices[device]
6325}
6326
6327macro ref!QueueObject GetQueue(VkQueue queue) {
6328 assert(queue in State.Queues)
6329 return State.Queues[queue]
6330}
6331
Jesse Hall3fbc8562015-11-29 22:10:52 -08006332macro ref!CommandBufferObject GetCommandBuffer(VkCommandBuffer commandBuffer) {
6333 assert(commandBuffer in State.CommandBuffers)
6334 return State.CommandBuffers[commandBuffer]
Jesse Halld27f6aa2015-08-15 17:58:48 -07006335}
6336
Jesse Hall3fbc8562015-11-29 22:10:52 -08006337macro ref!DeviceMemoryObject GetDeviceMemory(VkDeviceMemory memory) {
6338 assert(memory in State.DeviceMemories)
6339 return State.DeviceMemories[memory]
Jesse Halld27f6aa2015-08-15 17:58:48 -07006340}
6341
6342macro ref!BufferObject GetBuffer(VkBuffer buffer) {
6343 assert(buffer in State.Buffers)
6344 return State.Buffers[buffer]
6345}
6346
6347macro ref!BufferViewObject GetBufferView(VkBufferView bufferView) {
6348 assert(bufferView in State.BufferViews)
6349 return State.BufferViews[bufferView]
6350}
6351
6352macro ref!ImageObject GetImage(VkImage image) {
6353 assert(image in State.Images)
6354 return State.Images[image]
6355}
6356
6357macro ref!ImageViewObject GetImageView(VkImageView imageView) {
6358 assert(imageView in State.ImageViews)
6359 return State.ImageViews[imageView]
6360}
6361
Jesse Halld27f6aa2015-08-15 17:58:48 -07006362macro ref!ShaderModuleObject GetShaderModule(VkShaderModule shaderModule) {
6363 assert(shaderModule in State.ShaderModules)
6364 return State.ShaderModules[shaderModule]
6365}
6366
6367macro ref!PipelineObject GetPipeline(VkPipeline pipeline) {
6368 assert(pipeline in State.Pipelines)
6369 return State.Pipelines[pipeline]
6370}
6371
6372macro ref!PipelineLayoutObject GetPipelineLayout(VkPipelineLayout pipelineLayout) {
6373 assert(pipelineLayout in State.PipelineLayouts)
6374 return State.PipelineLayouts[pipelineLayout]
6375}
6376
6377macro ref!SamplerObject GetSampler(VkSampler sampler) {
6378 assert(sampler in State.Samplers)
6379 return State.Samplers[sampler]
6380}
6381
6382macro ref!DescriptorSetObject GetDescriptorSet(VkDescriptorSet descriptorSet) {
6383 assert(descriptorSet in State.DescriptorSets)
6384 return State.DescriptorSets[descriptorSet]
6385}
6386
6387macro ref!DescriptorSetLayoutObject GetDescriptorSetLayout(VkDescriptorSetLayout descriptorSetLayout) {
6388 assert(descriptorSetLayout in State.DescriptorSetLayouts)
6389 return State.DescriptorSetLayouts[descriptorSetLayout]
6390}
6391
6392macro ref!DescriptorPoolObject GetDescriptorPool(VkDescriptorPool descriptorPool) {
6393 assert(descriptorPool in State.DescriptorPools)
6394 return State.DescriptorPools[descriptorPool]
6395}
6396
Jesse Halld27f6aa2015-08-15 17:58:48 -07006397macro ref!FenceObject GetFence(VkFence fence) {
6398 assert(fence in State.Fences)
6399 return State.Fences[fence]
6400}
6401
6402macro ref!SemaphoreObject GetSemaphore(VkSemaphore semaphore) {
6403 assert(semaphore in State.Semaphores)
6404 return State.Semaphores[semaphore]
6405}
6406
6407macro ref!EventObject GetEvent(VkEvent event) {
6408 assert(event in State.Events)
6409 return State.Events[event]
6410}
6411
6412macro ref!QueryPoolObject GetQueryPool(VkQueryPool queryPool) {
6413 assert(queryPool in State.QueryPools)
6414 return State.QueryPools[queryPool]
6415}
6416
6417macro ref!FramebufferObject GetFramebuffer(VkFramebuffer framebuffer) {
6418 assert(framebuffer in State.Framebuffers)
6419 return State.Framebuffers[framebuffer]
6420}
6421
6422macro ref!RenderPassObject GetRenderPass(VkRenderPass renderPass) {
6423 assert(renderPass in State.RenderPasses)
6424 return State.RenderPasses[renderPass]
6425}
6426
6427macro ref!PipelineCacheObject GetPipelineCache(VkPipelineCache pipelineCache) {
6428 assert(pipelineCache in State.PipelineCaches)
6429 return State.PipelineCaches[pipelineCache]
6430}
6431
Jesse Hall3fbc8562015-11-29 22:10:52 -08006432macro ref!CommandPoolObject GetCommandPool(VkCommandPool commandPool) {
6433 assert(commandPool in State.CommandPools)
6434 return State.CommandPools[commandPool]
Jesse Hallf09c6b12015-08-15 19:54:28 -07006435}
Michael Lentine88594d72015-11-12 12:49:45 -08006436
Jesse Hall1356b0d2015-11-23 17:24:58 -08006437macro ref!SurfaceObject GetSurface(VkSurfaceKHR surface) {
6438 assert(surface in State.Surfaces)
6439 return State.Surfaces[surface]
6440}
6441
Michael Lentine88594d72015-11-12 12:49:45 -08006442macro ref!SwapchainObject GetSwapchain(VkSwapchainKHR swapchain) {
6443 assert(swapchain in State.Swapchains)
6444 return State.Swapchains[swapchain]
6445}
Jesse Halld8bade02015-11-24 10:24:18 -08006446
6447macro VkQueueFlags AddQueueFlag(VkQueueFlags flags, VkQueueFlagBits bit) {
6448 return as!VkQueueFlags(as!u32(flags) | as!u32(bit))
6449}