blob: eed44ad67074795aa069b583b86d2de50acf8a0b [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
Courtney Goeltzenleuchterd634c482017-01-05 15:55:31 -0700156@extension("VK_EXT_HDR_METADATA_SPEC_VERSION") define VK_EXT_HDR_METADATA_SPEC_VERSION 1
157@extension("VK_EXT_HDR_METADATA_EXTENSION_NAME") define VK_EXT_HDR_METADATA_EXTENSION_NAME "VK_EXT_hdr_metadata"
Chris Forbes289cb792016-12-30 15:03:55 +1300158
Jesse Halld27f6aa2015-08-15 17:58:48 -0700159
160/////////////
161// Types //
162/////////////
163
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700164type u32 VkBool32
165type u32 VkFlags
166type u64 VkDeviceSize
167type u32 VkSampleMask
168
Jesse Halld27f6aa2015-08-15 17:58:48 -0700169/// Dispatchable handle types.
170@dispatchHandle type u64 VkInstance
171@dispatchHandle type u64 VkPhysicalDevice
172@dispatchHandle type u64 VkDevice
173@dispatchHandle type u64 VkQueue
Jesse Hall3fbc8562015-11-29 22:10:52 -0800174@dispatchHandle type u64 VkCommandBuffer
Jesse Halld27f6aa2015-08-15 17:58:48 -0700175
176/// Non dispatchable handle types.
177@nonDispatchHandle type u64 VkDeviceMemory
Jesse Hall3fbc8562015-11-29 22:10:52 -0800178@nonDispatchHandle type u64 VkCommandPool
Jesse Halld27f6aa2015-08-15 17:58:48 -0700179@nonDispatchHandle type u64 VkBuffer
180@nonDispatchHandle type u64 VkBufferView
181@nonDispatchHandle type u64 VkImage
182@nonDispatchHandle type u64 VkImageView
Jesse Halld27f6aa2015-08-15 17:58:48 -0700183@nonDispatchHandle type u64 VkShaderModule
Jesse Halld27f6aa2015-08-15 17:58:48 -0700184@nonDispatchHandle type u64 VkPipeline
185@nonDispatchHandle type u64 VkPipelineLayout
186@nonDispatchHandle type u64 VkSampler
187@nonDispatchHandle type u64 VkDescriptorSet
188@nonDispatchHandle type u64 VkDescriptorSetLayout
189@nonDispatchHandle type u64 VkDescriptorPool
Jesse Halld27f6aa2015-08-15 17:58:48 -0700190@nonDispatchHandle type u64 VkFence
191@nonDispatchHandle type u64 VkSemaphore
192@nonDispatchHandle type u64 VkEvent
193@nonDispatchHandle type u64 VkQueryPool
194@nonDispatchHandle type u64 VkFramebuffer
195@nonDispatchHandle type u64 VkRenderPass
196@nonDispatchHandle type u64 VkPipelineCache
Jesse Hall1356b0d2015-11-23 17:24:58 -0800197
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800198@extension("VK_KHR_surface") @nonDispatchHandle type u64 VkSurfaceKHR
Jesse Hall1356b0d2015-11-23 17:24:58 -0800199
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800200@extension("VK_KHR_swapchain") @nonDispatchHandle type u64 VkSwapchainKHR
Jesse Hall1356b0d2015-11-23 17:24:58 -0800201
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800202@extension("VK_KHR_display") @nonDispatchHandle type u64 VkDisplayKHR
203@extension("VK_KHR_display") @nonDispatchHandle type u64 VkDisplayModeKHR
Jesse Halld27f6aa2015-08-15 17:58:48 -0700204
Jesse Hall715b86a2016-01-16 16:34:29 -0800205@extension("VK_EXT_debug_report") @nonDispatchHandle type u64 VkDebugReportCallbackEXT
206
Chris Forbes289cb792016-12-30 15:03:55 +1300207@extension("VK_NVX_device_generated_commands") @nonDispatchHandle type u64 VkObjectTableNVX
208@extension("VK_NVX_device_generated_commands") @nonDispatchHandle type u64 VkIndirectCommandsLayoutNVX
209
Jesse Halld27f6aa2015-08-15 17:58:48 -0700210
211/////////////
212// Enums //
213/////////////
214
215enum VkImageLayout {
216 VK_IMAGE_LAYOUT_UNDEFINED = 0x00000000, /// Implicit layout an image is when its contents are undefined due to various reasons (e.g. right after creation)
217 VK_IMAGE_LAYOUT_GENERAL = 0x00000001, /// General layout when image can be used for any kind of access
218 VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL = 0x00000002, /// Optimal layout when image is only used for color attachment read/write
219 VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL = 0x00000003, /// Optimal layout when image is only used for depth/stencil attachment read/write
220 VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL = 0x00000004, /// Optimal layout when image is used for read only depth/stencil attachment and shader access
221 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 -0800222 VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL = 0x00000006, /// Optimal layout when image is used only as source of transfer operations
223 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 -0700224 VK_IMAGE_LAYOUT_PREINITIALIZED = 0x00000008, /// Initial layout used when the data is populated by the CPU
Jesse Hall1356b0d2015-11-23 17:24:58 -0800225
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800226 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800227 VK_IMAGE_LAYOUT_PRESENT_SRC_KHR = 1000001002,
Chris Forbesaf3a1112017-01-31 15:37:03 +1300228
229 //@extension("VK_KHR_shared_presentable_image")
230 VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR = 1000111000,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700231}
232
233enum VkAttachmentLoadOp {
234 VK_ATTACHMENT_LOAD_OP_LOAD = 0x00000000,
235 VK_ATTACHMENT_LOAD_OP_CLEAR = 0x00000001,
236 VK_ATTACHMENT_LOAD_OP_DONT_CARE = 0x00000002,
237}
238
239enum VkAttachmentStoreOp {
240 VK_ATTACHMENT_STORE_OP_STORE = 0x00000000,
241 VK_ATTACHMENT_STORE_OP_DONT_CARE = 0x00000001,
242}
243
244enum VkImageType {
245 VK_IMAGE_TYPE_1D = 0x00000000,
246 VK_IMAGE_TYPE_2D = 0x00000001,
247 VK_IMAGE_TYPE_3D = 0x00000002,
248}
249
250enum VkImageTiling {
Jesse Hallc7467b72015-11-29 21:05:26 -0800251 VK_IMAGE_TILING_OPTIMAL = 0x00000000,
252 VK_IMAGE_TILING_LINEAR = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700253}
254
255enum VkImageViewType {
256 VK_IMAGE_VIEW_TYPE_1D = 0x00000000,
257 VK_IMAGE_VIEW_TYPE_2D = 0x00000001,
258 VK_IMAGE_VIEW_TYPE_3D = 0x00000002,
259 VK_IMAGE_VIEW_TYPE_CUBE = 0x00000003,
260 VK_IMAGE_VIEW_TYPE_1D_ARRAY = 0x00000004,
261 VK_IMAGE_VIEW_TYPE_2D_ARRAY = 0x00000005,
262 VK_IMAGE_VIEW_TYPE_CUBE_ARRAY = 0x00000006,
263}
264
Jesse Hall3fbc8562015-11-29 22:10:52 -0800265enum VkCommandBufferLevel {
266 VK_COMMAND_BUFFER_LEVEL_PRIMARY = 0x00000000,
267 VK_COMMAND_BUFFER_LEVEL_SECONDARY = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700268}
269
Jesse Hall65ab5522015-11-30 00:07:16 -0800270enum VkComponentSwizzle {
271 VK_COMPONENT_SWIZZLE_IDENTITY = 0x00000000,
272 VK_COMPONENT_SWIZZLE_ZERO = 0x00000001,
273 VK_COMPONENT_SWIZZLE_ONE = 0x00000002,
274 VK_COMPONENT_SWIZZLE_R = 0x00000003,
275 VK_COMPONENT_SWIZZLE_G = 0x00000004,
276 VK_COMPONENT_SWIZZLE_B = 0x00000005,
277 VK_COMPONENT_SWIZZLE_A = 0x00000006,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700278}
279
280enum VkDescriptorType {
281 VK_DESCRIPTOR_TYPE_SAMPLER = 0x00000000,
282 VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER = 0x00000001,
283 VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE = 0x00000002,
284 VK_DESCRIPTOR_TYPE_STORAGE_IMAGE = 0x00000003,
285 VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER = 0x00000004,
286 VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER = 0x00000005,
287 VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER = 0x00000006,
288 VK_DESCRIPTOR_TYPE_STORAGE_BUFFER = 0x00000007,
289 VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC = 0x00000008,
290 VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC = 0x00000009,
291 VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT = 0x0000000a,
292}
293
Jesse Halld27f6aa2015-08-15 17:58:48 -0700294enum VkQueryType {
295 VK_QUERY_TYPE_OCCLUSION = 0x00000000,
296 VK_QUERY_TYPE_PIPELINE_STATISTICS = 0x00000001, /// Optional
Jesse Halla3a7a1d2015-11-24 11:37:23 -0800297 VK_QUERY_TYPE_TIMESTAMP = 0x00000002,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700298}
299
Jesse Halld27f6aa2015-08-15 17:58:48 -0700300enum VkBorderColor {
301 VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK = 0x00000000,
302 VK_BORDER_COLOR_INT_TRANSPARENT_BLACK = 0x00000001,
303 VK_BORDER_COLOR_FLOAT_OPAQUE_BLACK = 0x00000002,
304 VK_BORDER_COLOR_INT_OPAQUE_BLACK = 0x00000003,
305 VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE = 0x00000004,
306 VK_BORDER_COLOR_INT_OPAQUE_WHITE = 0x00000005,
307}
308
309enum VkPipelineBindPoint {
Jesse Hallc7467b72015-11-29 21:05:26 -0800310 VK_PIPELINE_BIND_POINT_GRAPHICS = 0x00000000,
311 VK_PIPELINE_BIND_POINT_COMPUTE = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700312}
313
314enum VkPrimitiveTopology {
315 VK_PRIMITIVE_TOPOLOGY_POINT_LIST = 0x00000000,
316 VK_PRIMITIVE_TOPOLOGY_LINE_LIST = 0x00000001,
317 VK_PRIMITIVE_TOPOLOGY_LINE_STRIP = 0x00000002,
318 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST = 0x00000003,
319 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP = 0x00000004,
320 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN = 0x00000005,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800321 VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY = 0x00000006,
322 VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY = 0x00000007,
323 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY = 0x00000008,
324 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY = 0x00000009,
Jesse Hall091ed9e2015-11-30 00:55:29 -0800325 VK_PRIMITIVE_TOPOLOGY_PATCH_LIST = 0x0000000a,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700326}
327
328enum VkSharingMode {
329 VK_SHARING_MODE_EXCLUSIVE = 0x00000000,
330 VK_SHARING_MODE_CONCURRENT = 0x00000001,
331}
332
333enum VkIndexType {
334 VK_INDEX_TYPE_UINT16 = 0x00000000,
335 VK_INDEX_TYPE_UINT32 = 0x00000001,
336}
337
Jesse Hall23ff73f2015-11-29 14:36:39 -0800338enum VkFilter {
339 VK_FILTER_NEAREST = 0x00000000,
340 VK_FILTER_LINEAR = 0x00000001,
Jesse Hall26763382016-05-20 07:13:52 -0700341
342 //@extension("VK_IMG_filter_cubic")
343 VK_FILTER_CUBIC_IMG = 1000015000,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700344}
345
Jesse Hall23ff73f2015-11-29 14:36:39 -0800346enum VkSamplerMipmapMode {
Jesse Hall23ff73f2015-11-29 14:36:39 -0800347 VK_SAMPLER_MIPMAP_MODE_NEAREST = 0x00000001, /// Choose nearest mip level
348 VK_SAMPLER_MIPMAP_MODE_LINEAR = 0x00000002, /// Linear filter between mip levels
Jesse Halld27f6aa2015-08-15 17:58:48 -0700349}
350
Jesse Hall23ff73f2015-11-29 14:36:39 -0800351enum VkSamplerAddressMode {
Jesse Hallc7467b72015-11-29 21:05:26 -0800352 VK_SAMPLER_ADDRESS_MODE_REPEAT = 0x00000000,
353 VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT = 0x00000001,
354 VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE = 0x00000002,
355 VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER = 0x00000003,
356 VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700357}
358
359enum VkCompareOp {
360 VK_COMPARE_OP_NEVER = 0x00000000,
361 VK_COMPARE_OP_LESS = 0x00000001,
362 VK_COMPARE_OP_EQUAL = 0x00000002,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800363 VK_COMPARE_OP_LESS_OR_EQUAL = 0x00000003,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700364 VK_COMPARE_OP_GREATER = 0x00000004,
365 VK_COMPARE_OP_NOT_EQUAL = 0x00000005,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800366 VK_COMPARE_OP_GREATER_OR_EQUAL = 0x00000006,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700367 VK_COMPARE_OP_ALWAYS = 0x00000007,
368}
369
Jesse Hall65ab5522015-11-30 00:07:16 -0800370enum VkPolygonMode {
371 VK_POLYGON_MODE_FILL = 0x00000000,
372 VK_POLYGON_MODE_LINE = 0x00000001,
373 VK_POLYGON_MODE_POINT = 0x00000002,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700374}
375
376enum VkFrontFace {
Jesse Hall3fbc8562015-11-29 22:10:52 -0800377 VK_FRONT_FACE_COUNTER_CLOCKWISE = 0x00000000,
378 VK_FRONT_FACE_CLOCKWISE = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700379}
380
Jesse Hall65ab5522015-11-30 00:07:16 -0800381enum VkBlendFactor {
382 VK_BLEND_FACTOR_ZERO = 0x00000000,
383 VK_BLEND_FACTOR_ONE = 0x00000001,
384 VK_BLEND_FACTOR_SRC_COLOR = 0x00000002,
385 VK_BLEND_FACTOR_ONE_MINUS_SRC_COLOR = 0x00000003,
386 VK_BLEND_FACTOR_DST_COLOR = 0x00000004,
387 VK_BLEND_FACTOR_ONE_MINUS_DST_COLOR = 0x00000005,
388 VK_BLEND_FACTOR_SRC_ALPHA = 0x00000006,
389 VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA = 0x00000007,
390 VK_BLEND_FACTOR_DST_ALPHA = 0x00000008,
391 VK_BLEND_FACTOR_ONE_MINUS_DST_ALPHA = 0x00000009,
392 VK_BLEND_FACTOR_CONSTANT_COLOR = 0x0000000a,
393 VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR = 0x0000000b,
394 VK_BLEND_FACTOR_CONSTANT_ALPHA = 0x0000000c,
395 VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA = 0x0000000d,
396 VK_BLEND_FACTOR_SRC_ALPHA_SATURATE = 0x0000000e,
397 VK_BLEND_FACTOR_SRC1_COLOR = 0x0000000f,
398 VK_BLEND_FACTOR_ONE_MINUS_SRC1_COLOR = 0x00000010,
399 VK_BLEND_FACTOR_SRC1_ALPHA = 0x00000011,
400 VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA = 0x00000012,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700401}
402
403enum VkBlendOp {
404 VK_BLEND_OP_ADD = 0x00000000,
405 VK_BLEND_OP_SUBTRACT = 0x00000001,
406 VK_BLEND_OP_REVERSE_SUBTRACT = 0x00000002,
407 VK_BLEND_OP_MIN = 0x00000003,
408 VK_BLEND_OP_MAX = 0x00000004,
409}
410
411enum VkStencilOp {
412 VK_STENCIL_OP_KEEP = 0x00000000,
413 VK_STENCIL_OP_ZERO = 0x00000001,
414 VK_STENCIL_OP_REPLACE = 0x00000002,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800415 VK_STENCIL_OP_INCREMENT_AND_CLAMP = 0x00000003,
416 VK_STENCIL_OP_DECREMENT_AND_CLAMP = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700417 VK_STENCIL_OP_INVERT = 0x00000005,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800418 VK_STENCIL_OP_INCREMENT_AND_WRAP = 0x00000006,
419 VK_STENCIL_OP_DECREMENT_AND_WRAP = 0x00000007,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700420}
421
422enum VkLogicOp {
423 VK_LOGIC_OP_CLEAR = 0x00000000,
424 VK_LOGIC_OP_AND = 0x00000001,
425 VK_LOGIC_OP_AND_REVERSE = 0x00000002,
426 VK_LOGIC_OP_COPY = 0x00000003,
427 VK_LOGIC_OP_AND_INVERTED = 0x00000004,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800428 VK_LOGIC_OP_NO_OP = 0x00000005,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700429 VK_LOGIC_OP_XOR = 0x00000006,
430 VK_LOGIC_OP_OR = 0x00000007,
431 VK_LOGIC_OP_NOR = 0x00000008,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800432 VK_LOGIC_OP_EQUIVALENT = 0x00000009,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700433 VK_LOGIC_OP_INVERT = 0x0000000a,
434 VK_LOGIC_OP_OR_REVERSE = 0x0000000b,
435 VK_LOGIC_OP_COPY_INVERTED = 0x0000000c,
436 VK_LOGIC_OP_OR_INVERTED = 0x0000000d,
437 VK_LOGIC_OP_NAND = 0x0000000e,
438 VK_LOGIC_OP_SET = 0x0000000f,
439}
440
Jesse Hall3fbc8562015-11-29 22:10:52 -0800441enum VkSystemAllocationScope {
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800442 VK_SYSTEM_ALLOCATION_SCOPE_COMMAND = 0x00000000,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800443 VK_SYSTEM_ALLOCATION_SCOPE_OBJECT = 0x00000001,
444 VK_SYSTEM_ALLOCATION_SCOPE_CACHE = 0x00000002,
445 VK_SYSTEM_ALLOCATION_SCOPE_DEVICE = 0x00000003,
446 VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE = 0x00000004,
Jesse Hall03b6fe12015-11-24 12:44:21 -0800447}
448
Jesse Hall3fbc8562015-11-29 22:10:52 -0800449enum VkInternalAllocationType {
450 VK_INTERNAL_ALLOCATION_TYPE_EXECUTABLE = 0x00000000,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700451}
452
453enum VkPhysicalDeviceType {
454 VK_PHYSICAL_DEVICE_TYPE_OTHER = 0x00000000,
455 VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU = 0x00000001,
456 VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU = 0x00000002,
457 VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU = 0x00000003,
458 VK_PHYSICAL_DEVICE_TYPE_CPU = 0x00000004,
459}
460
Jesse Hall65ab5522015-11-30 00:07:16 -0800461enum VkVertexInputRate {
462 VK_VERTEX_INPUT_RATE_VERTEX = 0x00000000,
463 VK_VERTEX_INPUT_RATE_INSTANCE = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700464}
465
466/// Vulkan format definitions
467enum VkFormat {
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800468 VK_FORMAT_UNDEFINED = 0,
469 VK_FORMAT_R4G4_UNORM_PACK8 = 1,
470 VK_FORMAT_R4G4B4A4_UNORM_PACK16 = 2,
471 VK_FORMAT_B4G4R4A4_UNORM_PACK16 = 3,
472 VK_FORMAT_R5G6B5_UNORM_PACK16 = 4,
473 VK_FORMAT_B5G6R5_UNORM_PACK16 = 5,
474 VK_FORMAT_R5G5B5A1_UNORM_PACK16 = 6,
475 VK_FORMAT_B5G5R5A1_UNORM_PACK16 = 7,
476 VK_FORMAT_A1R5G5B5_UNORM_PACK16 = 8,
477 VK_FORMAT_R8_UNORM = 9,
478 VK_FORMAT_R8_SNORM = 10,
479 VK_FORMAT_R8_USCALED = 11,
480 VK_FORMAT_R8_SSCALED = 12,
481 VK_FORMAT_R8_UINT = 13,
482 VK_FORMAT_R8_SINT = 14,
483 VK_FORMAT_R8_SRGB = 15,
484 VK_FORMAT_R8G8_UNORM = 16,
485 VK_FORMAT_R8G8_SNORM = 17,
486 VK_FORMAT_R8G8_USCALED = 18,
487 VK_FORMAT_R8G8_SSCALED = 19,
488 VK_FORMAT_R8G8_UINT = 20,
489 VK_FORMAT_R8G8_SINT = 21,
490 VK_FORMAT_R8G8_SRGB = 22,
491 VK_FORMAT_R8G8B8_UNORM = 23,
492 VK_FORMAT_R8G8B8_SNORM = 24,
493 VK_FORMAT_R8G8B8_USCALED = 25,
494 VK_FORMAT_R8G8B8_SSCALED = 26,
495 VK_FORMAT_R8G8B8_UINT = 27,
496 VK_FORMAT_R8G8B8_SINT = 28,
497 VK_FORMAT_R8G8B8_SRGB = 29,
498 VK_FORMAT_B8G8R8_UNORM = 30,
499 VK_FORMAT_B8G8R8_SNORM = 31,
500 VK_FORMAT_B8G8R8_USCALED = 32,
501 VK_FORMAT_B8G8R8_SSCALED = 33,
502 VK_FORMAT_B8G8R8_UINT = 34,
503 VK_FORMAT_B8G8R8_SINT = 35,
504 VK_FORMAT_B8G8R8_SRGB = 36,
505 VK_FORMAT_R8G8B8A8_UNORM = 37,
506 VK_FORMAT_R8G8B8A8_SNORM = 38,
507 VK_FORMAT_R8G8B8A8_USCALED = 39,
508 VK_FORMAT_R8G8B8A8_SSCALED = 40,
509 VK_FORMAT_R8G8B8A8_UINT = 41,
510 VK_FORMAT_R8G8B8A8_SINT = 42,
511 VK_FORMAT_R8G8B8A8_SRGB = 43,
512 VK_FORMAT_B8G8R8A8_UNORM = 44,
513 VK_FORMAT_B8G8R8A8_SNORM = 45,
514 VK_FORMAT_B8G8R8A8_USCALED = 46,
515 VK_FORMAT_B8G8R8A8_SSCALED = 47,
516 VK_FORMAT_B8G8R8A8_UINT = 48,
517 VK_FORMAT_B8G8R8A8_SINT = 49,
518 VK_FORMAT_B8G8R8A8_SRGB = 50,
519 VK_FORMAT_A8B8G8R8_UNORM_PACK32 = 51,
520 VK_FORMAT_A8B8G8R8_SNORM_PACK32 = 52,
521 VK_FORMAT_A8B8G8R8_USCALED_PACK32 = 53,
522 VK_FORMAT_A8B8G8R8_SSCALED_PACK32 = 54,
523 VK_FORMAT_A8B8G8R8_UINT_PACK32 = 55,
524 VK_FORMAT_A8B8G8R8_SINT_PACK32 = 56,
525 VK_FORMAT_A8B8G8R8_SRGB_PACK32 = 57,
526 VK_FORMAT_A2R10G10B10_UNORM_PACK32 = 58,
527 VK_FORMAT_A2R10G10B10_SNORM_PACK32 = 59,
528 VK_FORMAT_A2R10G10B10_USCALED_PACK32 = 60,
529 VK_FORMAT_A2R10G10B10_SSCALED_PACK32 = 61,
530 VK_FORMAT_A2R10G10B10_UINT_PACK32 = 62,
531 VK_FORMAT_A2R10G10B10_SINT_PACK32 = 63,
532 VK_FORMAT_A2B10G10R10_UNORM_PACK32 = 64,
533 VK_FORMAT_A2B10G10R10_SNORM_PACK32 = 65,
534 VK_FORMAT_A2B10G10R10_USCALED_PACK32 = 66,
535 VK_FORMAT_A2B10G10R10_SSCALED_PACK32 = 67,
536 VK_FORMAT_A2B10G10R10_UINT_PACK32 = 68,
537 VK_FORMAT_A2B10G10R10_SINT_PACK32 = 69,
538 VK_FORMAT_R16_UNORM = 70,
539 VK_FORMAT_R16_SNORM = 71,
540 VK_FORMAT_R16_USCALED = 72,
541 VK_FORMAT_R16_SSCALED = 73,
542 VK_FORMAT_R16_UINT = 74,
543 VK_FORMAT_R16_SINT = 75,
544 VK_FORMAT_R16_SFLOAT = 76,
545 VK_FORMAT_R16G16_UNORM = 77,
546 VK_FORMAT_R16G16_SNORM = 78,
547 VK_FORMAT_R16G16_USCALED = 79,
548 VK_FORMAT_R16G16_SSCALED = 80,
549 VK_FORMAT_R16G16_UINT = 81,
550 VK_FORMAT_R16G16_SINT = 82,
551 VK_FORMAT_R16G16_SFLOAT = 83,
552 VK_FORMAT_R16G16B16_UNORM = 84,
553 VK_FORMAT_R16G16B16_SNORM = 85,
554 VK_FORMAT_R16G16B16_USCALED = 86,
555 VK_FORMAT_R16G16B16_SSCALED = 87,
556 VK_FORMAT_R16G16B16_UINT = 88,
557 VK_FORMAT_R16G16B16_SINT = 89,
558 VK_FORMAT_R16G16B16_SFLOAT = 90,
559 VK_FORMAT_R16G16B16A16_UNORM = 91,
560 VK_FORMAT_R16G16B16A16_SNORM = 92,
561 VK_FORMAT_R16G16B16A16_USCALED = 93,
562 VK_FORMAT_R16G16B16A16_SSCALED = 94,
563 VK_FORMAT_R16G16B16A16_UINT = 95,
564 VK_FORMAT_R16G16B16A16_SINT = 96,
565 VK_FORMAT_R16G16B16A16_SFLOAT = 97,
566 VK_FORMAT_R32_UINT = 98,
567 VK_FORMAT_R32_SINT = 99,
568 VK_FORMAT_R32_SFLOAT = 100,
569 VK_FORMAT_R32G32_UINT = 101,
570 VK_FORMAT_R32G32_SINT = 102,
571 VK_FORMAT_R32G32_SFLOAT = 103,
572 VK_FORMAT_R32G32B32_UINT = 104,
573 VK_FORMAT_R32G32B32_SINT = 105,
574 VK_FORMAT_R32G32B32_SFLOAT = 106,
575 VK_FORMAT_R32G32B32A32_UINT = 107,
576 VK_FORMAT_R32G32B32A32_SINT = 108,
577 VK_FORMAT_R32G32B32A32_SFLOAT = 109,
578 VK_FORMAT_R64_UINT = 110,
579 VK_FORMAT_R64_SINT = 111,
580 VK_FORMAT_R64_SFLOAT = 112,
581 VK_FORMAT_R64G64_UINT = 113,
582 VK_FORMAT_R64G64_SINT = 114,
583 VK_FORMAT_R64G64_SFLOAT = 115,
584 VK_FORMAT_R64G64B64_UINT = 116,
585 VK_FORMAT_R64G64B64_SINT = 117,
586 VK_FORMAT_R64G64B64_SFLOAT = 118,
587 VK_FORMAT_R64G64B64A64_UINT = 119,
588 VK_FORMAT_R64G64B64A64_SINT = 120,
589 VK_FORMAT_R64G64B64A64_SFLOAT = 121,
590 VK_FORMAT_B10G11R11_UFLOAT_PACK32 = 122,
591 VK_FORMAT_E5B9G9R9_UFLOAT_PACK32 = 123,
592 VK_FORMAT_D16_UNORM = 124,
593 VK_FORMAT_X8_D24_UNORM_PACK32 = 125,
594 VK_FORMAT_D32_SFLOAT = 126,
595 VK_FORMAT_S8_UINT = 127,
596 VK_FORMAT_D16_UNORM_S8_UINT = 128,
597 VK_FORMAT_D24_UNORM_S8_UINT = 129,
598 VK_FORMAT_D32_SFLOAT_S8_UINT = 130,
599 VK_FORMAT_BC1_RGB_UNORM_BLOCK = 131,
600 VK_FORMAT_BC1_RGB_SRGB_BLOCK = 132,
601 VK_FORMAT_BC1_RGBA_UNORM_BLOCK = 133,
602 VK_FORMAT_BC1_RGBA_SRGB_BLOCK = 134,
603 VK_FORMAT_BC2_UNORM_BLOCK = 135,
604 VK_FORMAT_BC2_SRGB_BLOCK = 136,
605 VK_FORMAT_BC3_UNORM_BLOCK = 137,
606 VK_FORMAT_BC3_SRGB_BLOCK = 138,
607 VK_FORMAT_BC4_UNORM_BLOCK = 139,
608 VK_FORMAT_BC4_SNORM_BLOCK = 140,
609 VK_FORMAT_BC5_UNORM_BLOCK = 141,
610 VK_FORMAT_BC5_SNORM_BLOCK = 142,
611 VK_FORMAT_BC6H_UFLOAT_BLOCK = 143,
612 VK_FORMAT_BC6H_SFLOAT_BLOCK = 144,
613 VK_FORMAT_BC7_UNORM_BLOCK = 145,
614 VK_FORMAT_BC7_SRGB_BLOCK = 146,
615 VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK = 147,
616 VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK = 148,
617 VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK = 149,
618 VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK = 150,
619 VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK = 151,
620 VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK = 152,
621 VK_FORMAT_EAC_R11_UNORM_BLOCK = 153,
622 VK_FORMAT_EAC_R11_SNORM_BLOCK = 154,
623 VK_FORMAT_EAC_R11G11_UNORM_BLOCK = 155,
624 VK_FORMAT_EAC_R11G11_SNORM_BLOCK = 156,
625 VK_FORMAT_ASTC_4x4_UNORM_BLOCK = 157,
626 VK_FORMAT_ASTC_4x4_SRGB_BLOCK = 158,
627 VK_FORMAT_ASTC_5x4_UNORM_BLOCK = 159,
628 VK_FORMAT_ASTC_5x4_SRGB_BLOCK = 160,
629 VK_FORMAT_ASTC_5x5_UNORM_BLOCK = 161,
630 VK_FORMAT_ASTC_5x5_SRGB_BLOCK = 162,
631 VK_FORMAT_ASTC_6x5_UNORM_BLOCK = 163,
632 VK_FORMAT_ASTC_6x5_SRGB_BLOCK = 164,
633 VK_FORMAT_ASTC_6x6_UNORM_BLOCK = 165,
634 VK_FORMAT_ASTC_6x6_SRGB_BLOCK = 166,
635 VK_FORMAT_ASTC_8x5_UNORM_BLOCK = 167,
636 VK_FORMAT_ASTC_8x5_SRGB_BLOCK = 168,
637 VK_FORMAT_ASTC_8x6_UNORM_BLOCK = 169,
638 VK_FORMAT_ASTC_8x6_SRGB_BLOCK = 170,
639 VK_FORMAT_ASTC_8x8_UNORM_BLOCK = 171,
640 VK_FORMAT_ASTC_8x8_SRGB_BLOCK = 172,
641 VK_FORMAT_ASTC_10x5_UNORM_BLOCK = 173,
642 VK_FORMAT_ASTC_10x5_SRGB_BLOCK = 174,
643 VK_FORMAT_ASTC_10x6_UNORM_BLOCK = 175,
644 VK_FORMAT_ASTC_10x6_SRGB_BLOCK = 176,
645 VK_FORMAT_ASTC_10x8_UNORM_BLOCK = 177,
646 VK_FORMAT_ASTC_10x8_SRGB_BLOCK = 178,
647 VK_FORMAT_ASTC_10x10_UNORM_BLOCK = 179,
648 VK_FORMAT_ASTC_10x10_SRGB_BLOCK = 180,
649 VK_FORMAT_ASTC_12x10_UNORM_BLOCK = 181,
650 VK_FORMAT_ASTC_12x10_SRGB_BLOCK = 182,
651 VK_FORMAT_ASTC_12x12_UNORM_BLOCK = 183,
652 VK_FORMAT_ASTC_12x12_SRGB_BLOCK = 184,
Chris Forbes289cb792016-12-30 15:03:55 +1300653
654 //@extension("VK_IMG_format_pvrtc")
655 VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG = 1000054000,
656
657 //@extension("VK_IMG_format_pvrtc")
658 VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG = 1000054001,
659
660 //@extension("VK_IMG_format_pvrtc")
661 VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG = 1000054002,
662
663 //@extension("VK_IMG_format_pvrtc")
664 VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG = 1000054003,
665
666 //@extension("VK_IMG_format_pvrtc")
667 VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG = 1000054004,
668
669 //@extension("VK_IMG_format_pvrtc")
670 VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG = 1000054005,
671
672 //@extension("VK_IMG_format_pvrtc")
673 VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG = 1000054006,
674
675 //@extension("VK_IMG_format_pvrtc")
676 VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG = 1000054007,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700677}
678
Jesse Halld27f6aa2015-08-15 17:58:48 -0700679/// Structure type enumerant
680enum VkStructureType {
681 VK_STRUCTURE_TYPE_APPLICATION_INFO = 0,
Jesse Hallc7467b72015-11-29 21:05:26 -0800682 VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO = 1,
683 VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO = 2,
684 VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO = 3,
685 VK_STRUCTURE_TYPE_SUBMIT_INFO = 4,
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800686 VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO = 5,
Jesse Hallc7467b72015-11-29 21:05:26 -0800687 VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE = 6,
688 VK_STRUCTURE_TYPE_BIND_SPARSE_INFO = 7,
689 VK_STRUCTURE_TYPE_FENCE_CREATE_INFO = 8,
690 VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO = 9,
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700691 VK_STRUCTURE_TYPE_EVENT_CREATE_INFO = 10,
Jesse Hallc7467b72015-11-29 21:05:26 -0800692 VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO = 11,
693 VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO = 12,
694 VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO = 13,
695 VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO = 14,
696 VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO = 15,
697 VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO = 16,
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800698 VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO = 17,
699 VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO = 18,
700 VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO = 19,
701 VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO = 20,
702 VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO = 21,
703 VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO = 22,
704 VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO = 23,
705 VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO = 24,
706 VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO = 25,
707 VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO = 26,
708 VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO = 27,
709 VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO = 28,
710 VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO = 29,
711 VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO = 30,
712 VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO = 31,
713 VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO = 32,
714 VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO = 33,
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800715 VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO = 34,
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800716 VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET = 35,
717 VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET = 36,
718 VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO = 37,
719 VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO = 38,
720 VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO = 39,
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800721 VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO = 40,
Jesse Hall3dd678a2016-01-08 21:52:01 -0800722 VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO = 41,
723 VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO = 42,
724 VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO = 43,
725 VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER = 44,
726 VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER = 45,
727 VK_STRUCTURE_TYPE_MEMORY_BARRIER = 46,
728 VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO = 47,
729 VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO = 48,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800730
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800731 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800732 VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR = 1000001000,
733 VK_STRUCTURE_TYPE_PRESENT_INFO_KHR = 1000001001,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800734
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800735 //@extension("VK_KHR_display")
Jesse Hallbd888842015-11-30 21:44:14 -0800736 VK_STRUCTURE_TYPE_DISPLAY_MODE_CREATE_INFO_KHR = 1000002000,
737 VK_STRUCTURE_TYPE_DISPLAY_SURFACE_CREATE_INFO_KHR = 1000002001,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800738
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800739 //@extension("VK_KHR_display_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800740 VK_STRUCTURE_TYPE_DISPLAY_DISPLAY_PRESENT_INFO_KHR = 1000003000,
Jesse Hallf9fa9a52016-01-08 16:08:51 -0800741
742 //@extension("VK_KHR_xlib_surface")
743 VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR = 1000004000,
744
745 //@extension("VK_KHR_xcb_surface")
746 VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR = 1000005000,
747
748 //@extension("VK_KHR_wayland_surface")
749 VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR = 1000006000,
750
751 //@extension("VK_KHR_mir_surface")
752 VK_STRUCTURE_TYPE_MIR_SURFACE_CREATE_INFO_KHR = 1000007000,
753
754 //@extension("VK_KHR_android_surface")
755 VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR = 1000008000,
756
757 //@extension("VK_KHR_win32_surface")
758 VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR = 1000009000,
Jesse Hall543a7ff2016-01-08 16:38:30 -0800759
Ian Elliott948233a2017-01-06 12:13:23 -0700760 //@extension("VK_KHR_incremental_present")
761 VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR = 1000084000,
762
Chia-I Wub262ddc2016-03-22 07:38:20 +0800763 //@extension("VK_ANDROID_native_buffer")
764 VK_STRUCTURE_TYPE_NATIVE_BUFFER_ANDROID = 1000010000,
Chris Forbes8e4438b2016-12-07 16:26:49 +1300765 VK_STRUCTURE_TYPE_SWAPCHAIN_IMAGE_CREATE_INFO_ANDROID = 1000010001,
Chia-I Wub262ddc2016-03-22 07:38:20 +0800766
Ian Elliott4c8bb2a2016-12-29 11:07:26 -0700767 //@extension("VK_GOOGLE_display_timing")
Ian Elliott14866bb2017-01-20 09:15:48 -0700768 VK_STRUCTURE_TYPE_PRESENT_TIMES_INFO_GOOGLE = 1000092000,
Ian Elliott4c8bb2a2016-12-29 11:07:26 -0700769
Jesse Hall543a7ff2016-01-08 16:38:30 -0800770 //@extension("VK_EXT_debug_report")
Jesse Hall26763382016-05-20 07:13:52 -0700771 VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT = 1000011000,
772
773 //@extension("VK_AMD_rasterization_order")
774 VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD = 1000018000,
775
776 //@extension("VK_EXT_debug_marker")
777 VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_NAME_INFO_EXT = 1000022000,
778
779 //@extension("VK_EXT_debug_marker")
780 VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_TAG_INFO_EXT = 1000022001,
781
782 //@extension("VK_EXT_debug_marker")
783 VK_STRUCTURE_TYPE_DEBUG_MARKER_MARKER_INFO_EXT = 1000022002,
Jesse Hall56d386a2016-07-26 15:20:40 -0700784
785 //@extension("VK_NV_dedicated_allocation")
786 VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV = 1000026000,
787
788 //@extension("VK_NV_dedicated_allocation")
789 VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV = 1000026001,
790
791 //@extension("VK_NV_dedicated_allocation")
792 VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV = 1000026002,
Chris Forbes289cb792016-12-30 15:03:55 +1300793
794 //@extension("VK_NV_external_memory")
795 VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_NV = 1000056000,
796
797 //@extension("VK_NV_external_memory")
798 VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_NV = 1000056001,
799
800 //@extension("VK_NV_external_memory_win32")
801 VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_NV = 1000057000,
802
803 //@extension("VK_NV_external_memory_win32")
804 VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_NV = 1000057001,
805
806 //@extension("VK_NV_win32_keyed_mutex")
807 VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_NV = 1000058000,
808
Chris Forbes1194ede2016-12-30 16:29:25 +1300809 //@extension("VK_KHR_get_physical_device_properties2")
810 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR = 1000059000,
811
812 //@extension("VK_KHR_get_physical_device_properties2")
813 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR = 1000059001,
814
815 //@extension("VK_KHR_get_physical_device_properties2")
816 VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2_KHR = 1000059002,
817
818 //@extension("VK_KHR_get_physical_device_properties2")
819 VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2_KHR = 1000059003,
820
821 //@extension("VK_KHR_get_physical_device_properties2")
822 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2_KHR = 1000059004,
823
824 //@extension("VK_KHR_get_physical_device_properties2")
825 VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2_KHR = 1000059005,
826
827 //@extension("VK_KHR_get_physical_device_properties2")
828 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2_KHR = 1000059006,
829
830 //@extension("VK_KHR_get_physical_device_properties2")
831 VK_STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2_KHR = 1000059007,
832
833 //@extension("VK_KHR_get_physical_device_properties2")
834 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2_KHR = 1000059008,
835
Chris Forbes289cb792016-12-30 15:03:55 +1300836 //@extension("VK_EXT_validation_flags")
837 VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT = 1000061000,
838
839 //@extension("VK_KHR_incremental_present")
840 VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR = 1000084000,
841
842 //@extension("VK_NVX_device_generated_commands")
843 VK_STRUCTURE_TYPE_OBJECT_TABLE_CREATE_INFO_NVX = 1000086000,
844
845 //@extension("VK_NVX_device_generated_commands")
846 VK_STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_CREATE_INFO_NVX = 1000086001,
847
848 //@extension("VK_NVX_device_generated_commands")
849 VK_STRUCTURE_TYPE_CMD_PROCESS_COMMANDS_INFO_NVX = 1000086002,
850
851 //@extension("VK_NVX_device_generated_commands")
852 VK_STRUCTURE_TYPE_CMD_RESERVE_SPACE_FOR_COMMANDS_INFO_NVX = 1000086003,
853
854 //@extension("VK_NVX_device_generated_commands")
855 VK_STRUCTURE_TYPE_DEVICE_GENERATED_COMMANDS_LIMITS_NVX = 1000086004,
856
857 //@extension("VK_NVX_device_generated_commands")
858 VK_STRUCTURE_TYPE_DEVICE_GENERATED_COMMANDS_FEATURES_NVX = 1000086005,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700859}
860
Jesse Hall65ab5522015-11-30 00:07:16 -0800861enum VkSubpassContents {
862 VK_SUBPASS_CONTENTS_INLINE = 0x00000000,
863 VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700864}
865
Jesse Hall543a7ff2016-01-08 16:38:30 -0800866enum VkPipelineCacheHeaderVersion {
867 VK_PIPELINE_CACHE_HEADER_VERSION_ONE = 1,
868}
869
Jesse Hallbd888842015-11-30 21:44:14 -0800870@lastUnused(-11)
Jesse Halld27f6aa2015-08-15 17:58:48 -0700871/// Error and return codes
872enum VkResult {
873 // Return codes for successful operation execution (positive values)
Jesse Hallbd888842015-11-30 21:44:14 -0800874 VK_SUCCESS = 0,
875 VK_NOT_READY = 1,
876 VK_TIMEOUT = 2,
877 VK_EVENT_SET = 3,
878 VK_EVENT_RESET = 4,
879 VK_INCOMPLETE = 5,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700880
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800881 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800882 VK_SUBOPTIMAL_KHR = 1000001003,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800883
Jesse Halld27f6aa2015-08-15 17:58:48 -0700884 // Error codes (negative values)
Jesse Hallbd888842015-11-30 21:44:14 -0800885 VK_ERROR_OUT_OF_HOST_MEMORY = 0xFFFFFFFF, // -1
886 VK_ERROR_OUT_OF_DEVICE_MEMORY = 0xFFFFFFFE, // -2
887 VK_ERROR_INITIALIZATION_FAILED = 0xFFFFFFFD, // -3
888 VK_ERROR_DEVICE_LOST = 0xFFFFFFFC, // -4
889 VK_ERROR_MEMORY_MAP_FAILED = 0xFFFFFFFB, // -5
890 VK_ERROR_LAYER_NOT_PRESENT = 0xFFFFFFFA, // -6
891 VK_ERROR_EXTENSION_NOT_PRESENT = 0xFFFFFFF9, // -7
892 VK_ERROR_FEATURE_NOT_PRESENT = 0xFFFFFFF8, // -8
893 VK_ERROR_INCOMPATIBLE_DRIVER = 0xFFFFFFF7, // -9
894 VK_ERROR_TOO_MANY_OBJECTS = 0xFFFFFFF6, // -10
895 VK_ERROR_FORMAT_NOT_SUPPORTED = 0xFFFFFFF5, // -11
Jesse Hall56d386a2016-07-26 15:20:40 -0700896 VK_ERROR_FRAGMENTED_POOL = 0xFFFFFFF4, // -12
Jesse Hall1356b0d2015-11-23 17:24:58 -0800897
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800898 //@extension("VK_KHR_surface")
Jesse Hallbd888842015-11-30 21:44:14 -0800899 VK_ERROR_SURFACE_LOST_KHR = 0xC4653600, // -1000000000
Jesse Halla6429252015-11-29 18:59:42 -0800900
Jesse Hall563380d2016-01-15 23:14:05 -0800901 //@extension("VK_KHR_surface")
902 VK_ERROR_NATIVE_WINDOW_IN_USE_KHR = 0xC46535FF, // -1000008001
903
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800904 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800905 VK_ERROR_OUT_OF_DATE_KHR = 0xC4653214, // -1000001004
Jesse Hall1356b0d2015-11-23 17:24:58 -0800906
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800907 //@extension("VK_KHR_display_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800908 VK_ERROR_INCOMPATIBLE_DISPLAY_KHR = 0xC4652A47, // -1000003001
Jesse Hall1356b0d2015-11-23 17:24:58 -0800909
Jesse Hall543a7ff2016-01-08 16:38:30 -0800910 //@extension("VK_EXT_debug_report")
911 VK_ERROR_VALIDATION_FAILED_EXT = 0xC4650B07, // -1000011001
Jesse Hall26763382016-05-20 07:13:52 -0700912
913 //@extension("VK_NV_glsl_shader")
914 VK_ERROR_INVALID_SHADER_NV = 0xC4650720, // -1000012000
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700915}
916
917enum VkDynamicState {
918 VK_DYNAMIC_STATE_VIEWPORT = 0x00000000,
919 VK_DYNAMIC_STATE_SCISSOR = 0x00000001,
920 VK_DYNAMIC_STATE_LINE_WIDTH = 0x00000002,
921 VK_DYNAMIC_STATE_DEPTH_BIAS = 0x00000003,
922 VK_DYNAMIC_STATE_BLEND_CONSTANTS = 0x00000004,
923 VK_DYNAMIC_STATE_DEPTH_BOUNDS = 0x00000005,
924 VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK = 0x00000006,
925 VK_DYNAMIC_STATE_STENCIL_WRITE_MASK = 0x00000007,
926 VK_DYNAMIC_STATE_STENCIL_REFERENCE = 0x00000008,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700927}
928
Jesse Hall523db342015-11-30 21:12:55 -0800929@extension("VK_KHR_surface")
Michael Lentine88594d72015-11-12 12:49:45 -0800930enum VkPresentModeKHR {
931 VK_PRESENT_MODE_IMMEDIATE_KHR = 0x00000000,
932 VK_PRESENT_MODE_MAILBOX_KHR = 0x00000001,
933 VK_PRESENT_MODE_FIFO_KHR = 0x00000002,
Jesse Hall03b6fe12015-11-24 12:44:21 -0800934 VK_PRESENT_MODE_FIFO_RELAXED_KHR = 0x00000003,
Chris Forbes1d5f68c2017-01-31 10:17:01 +1300935 //@extension("VK_KHR_shared_presentable_image")
936 VK_PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR = 1000111000,
937 //@extension("VK_KHR_shared_presentable_image")
938 VK_PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR = 1000111001,
Michael Lentine88594d72015-11-12 12:49:45 -0800939}
940
Jesse Hall523db342015-11-30 21:12:55 -0800941@extension("VK_KHR_surface")
Michael Lentine88594d72015-11-12 12:49:45 -0800942enum VkColorSpaceKHR {
943 VK_COLORSPACE_SRGB_NONLINEAR_KHR = 0x00000000,
Courtney Goeltzenleuchter7f558ed2017-01-23 17:15:24 -0700944 VK_COLOR_SPACE_DISPLAY_P3_LINEAR_EXT = 1000104001,
945 VK_COLOR_SPACE_DISPLAY_P3_NONLINEAR_EXT = 1000104002,
946 VK_COLOR_SPACE_SCRGB_LINEAR_EXT = 1000104003,
947 VK_COLOR_SPACE_SCRGB_NONLINEAR_EXT = 1000104004,
948 VK_COLOR_SPACE_DCI_P3_LINEAR_EXT = 1000104005,
949 VK_COLOR_SPACE_DCI_P3_NONLINEAR_EXT = 1000104006,
950 VK_COLOR_SPACE_BT709_LINEAR_EXT = 1000104007,
951 VK_COLOR_SPACE_BT709_NONLINEAR_EXT = 1000104008,
952 VK_COLOR_SPACE_BT2020_LINEAR_EXT = 1000104009,
953 VK_COLOR_SPACE_BT2020_NONLINEAR_EXT = 1000104010,
954 VK_COLOR_SPACE_ADOBERGB_LINEAR_EXT = 1000104011,
955 VK_COLOR_SPACE_ADOBERGB_NONLINEAR_EXT = 1000104012,
Michael Lentine88594d72015-11-12 12:49:45 -0800956}
Jesse Halld27f6aa2015-08-15 17:58:48 -0700957
Jesse Hall715b86a2016-01-16 16:34:29 -0800958@extension("VK_EXT_debug_report")
959enum VkDebugReportObjectTypeEXT {
960 VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT = 0,
961 VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT = 1,
962 VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT = 2,
963 VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT = 3,
964 VK_DEBUG_REPORT_OBJECT_TYPE_QUEUE_EXT = 4,
965 VK_DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT = 5,
966 VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT = 6,
967 VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT = 7,
968 VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT = 8,
969 VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT = 9,
970 VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT = 10,
971 VK_DEBUG_REPORT_OBJECT_TYPE_EVENT_EXT = 11,
972 VK_DEBUG_REPORT_OBJECT_TYPE_QUERY_POOL_EXT = 12,
973 VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_VIEW_EXT = 13,
974 VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_VIEW_EXT = 14,
975 VK_DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT = 15,
976 VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_CACHE_EXT = 16,
977 VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_LAYOUT_EXT = 17,
978 VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT = 18,
979 VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT = 19,
980 VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT_EXT = 20,
981 VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_EXT = 21,
982 VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT = 22,
983 VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT = 23,
984 VK_DEBUG_REPORT_OBJECT_TYPE_FRAMEBUFFER_EXT = 24,
985 VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_POOL_EXT = 25,
986 VK_DEBUG_REPORT_OBJECT_TYPE_SURFACE_KHR_EXT = 26,
987 VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT = 27,
988 VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_EXT = 28,
Chris Forbes289cb792016-12-30 15:03:55 +1300989 VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_KHR_EXT = 29,
990 VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_MODE_KHR_EXT = 30,
991 VK_DEBUG_REPORT_OBJECT_TYPE_OBJECT_TABLE_NVX_EXT = 31,
992 VK_DEBUG_REPORT_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NVX_EXT = 32,
Jesse Hall715b86a2016-01-16 16:34:29 -0800993}
994
995@extension("VK_EXT_debug_report")
996enum VkDebugReportErrorEXT {
997 VK_DEBUG_REPORT_ERROR_NONE_EXT = 0,
998 VK_DEBUG_REPORT_ERROR_CALLBACK_REF_EXT = 1,
999}
1000
Jesse Hall26763382016-05-20 07:13:52 -07001001@extension("VK_AMD_rasterization_order")
1002enum VkRasterizationOrderAMD {
1003 VK_RASTERIZATION_ORDER_STRICT_AMD = 0,
1004 VK_RASTERIZATION_ORDER_RELAXED_AMD = 1,
1005}
1006
Chris Forbes289cb792016-12-30 15:03:55 +13001007@extension("VK_EXT_validation_flags")
1008enum VkValidationCheckEXT {
1009 VK_VALIDATION_CHECK_ALL_EXT = 0,
1010}
1011
1012@extension("VK_NVX_device_generated_commands")
1013enum VkIndirectCommandsTokenTypeNVX {
1014 VK_INDIRECT_COMMANDS_TOKEN_PIPELINE_NVX = 0,
1015 VK_INDIRECT_COMMANDS_TOKEN_DESCRIPTOR_SET_NVX = 1,
1016 VK_INDIRECT_COMMANDS_TOKEN_INDEX_BUFFER_NVX = 2,
1017 VK_INDIRECT_COMMANDS_TOKEN_VERTEX_BUFFER_NVX = 3,
1018 VK_INDIRECT_COMMANDS_TOKEN_PUSH_CONSTANT_NVX = 4,
1019 VK_INDIRECT_COMMANDS_TOKEN_DRAW_INDEXED_NVX = 5,
1020 VK_INDIRECT_COMMANDS_TOKEN_DRAW_NVX = 6,
1021 VK_INDIRECT_COMMANDS_TOKEN_DISPATCH_NVX = 7,
1022}
1023
1024@extension("VK_NVX_device_generated_commands")
1025enum VkObjectEntryTypeNVX {
1026 VK_OBJECT_ENTRY_DESCRIPTOR_SET_NVX = 0,
1027 VK_OBJECT_ENTRY_PIPELINE_NVX = 1,
1028 VK_OBJECT_ENTRY_INDEX_BUFFER_NVX = 2,
1029 VK_OBJECT_ENTRY_VERTEX_BUFFER_NVX = 3,
1030 VK_OBJECT_ENTRY_PUSH_CONSTANT_NVX = 4,
1031}
Jesse Hall715b86a2016-01-16 16:34:29 -08001032
Jesse Halld27f6aa2015-08-15 17:58:48 -07001033/////////////////
1034// Bitfields //
1035/////////////////
1036
Jesse Halld27f6aa2015-08-15 17:58:48 -07001037/// Queue capabilities
Jesse Halld8bade02015-11-24 10:24:18 -08001038type VkFlags VkQueueFlags
1039bitfield VkQueueFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001040 VK_QUEUE_GRAPHICS_BIT = 0x00000001, /// Queue supports graphics operations
1041 VK_QUEUE_COMPUTE_BIT = 0x00000002, /// Queue supports compute operations
Jesse Hall65ab5522015-11-30 00:07:16 -08001042 VK_QUEUE_TRANSFER_BIT = 0x00000004, /// Queue supports transfer operations
Jesse Hallb00daad2015-11-29 19:46:20 -08001043 VK_QUEUE_SPARSE_BINDING_BIT = 0x00000008, /// Queue supports sparse resource memory management operations
Jesse Halld27f6aa2015-08-15 17:58:48 -07001044}
1045
1046/// Memory properties passed into vkAllocMemory().
Jesse Halld8bade02015-11-24 10:24:18 -08001047type VkFlags VkMemoryPropertyFlags
1048bitfield VkMemoryPropertyFlagBits {
Jesse Halld1af8122015-11-29 23:50:38 -08001049 VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT = 0x00000001,
1050 VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT = 0x00000002,
1051 VK_MEMORY_PROPERTY_HOST_COHERENT_BIT = 0x00000004,
1052 VK_MEMORY_PROPERTY_HOST_CACHED_BIT = 0x00000008,
1053 VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT = 0x00000010,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001054}
1055
1056/// Memory heap flags
Jesse Halld8bade02015-11-24 10:24:18 -08001057type VkFlags VkMemoryHeapFlags
1058bitfield VkMemoryHeapFlagBits {
Jesse Halld1af8122015-11-29 23:50:38 -08001059 VK_MEMORY_HEAP_DEVICE_LOCAL_BIT = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001060}
1061
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001062/// Access flags
1063type VkFlags VkAccessFlags
1064bitfield VkAccessFlagBits {
1065 VK_ACCESS_INDIRECT_COMMAND_READ_BIT = 0x00000001,
1066 VK_ACCESS_INDEX_READ_BIT = 0x00000002,
1067 VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT = 0x00000004,
1068 VK_ACCESS_UNIFORM_READ_BIT = 0x00000008,
1069 VK_ACCESS_INPUT_ATTACHMENT_READ_BIT = 0x00000010,
1070 VK_ACCESS_SHADER_READ_BIT = 0x00000020,
1071 VK_ACCESS_SHADER_WRITE_BIT = 0x00000040,
1072 VK_ACCESS_COLOR_ATTACHMENT_READ_BIT = 0x00000080,
1073 VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT = 0x00000100,
1074 VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT = 0x00000200,
1075 VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT = 0x00000400,
1076 VK_ACCESS_TRANSFER_READ_BIT = 0x00000800,
1077 VK_ACCESS_TRANSFER_WRITE_BIT = 0x00001000,
1078 VK_ACCESS_HOST_READ_BIT = 0x00002000,
1079 VK_ACCESS_HOST_WRITE_BIT = 0x00004000,
1080 VK_ACCESS_MEMORY_READ_BIT = 0x00008000,
1081 VK_ACCESS_MEMORY_WRITE_BIT = 0x00010000,
Chris Forbes289cb792016-12-30 15:03:55 +13001082
1083 //@extension("VK_NVX_device_generated_commands")
1084 VK_ACCESS_COMMAND_PROCESS_READ_BIT_NVX = 0x00020000,
1085
1086 //@extension("VK_NVX_device_generated_commands")
1087 VK_ACCESS_COMMAND_PROCESS_WRITE_BIT_NVX = 0x00040000,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001088}
1089
1090/// Buffer usage flags
Jesse Halld8bade02015-11-24 10:24:18 -08001091type VkFlags VkBufferUsageFlags
1092bitfield VkBufferUsageFlagBits {
Jesse Hall3fbc8562015-11-29 22:10:52 -08001093 VK_BUFFER_USAGE_TRANSFER_SRC_BIT = 0x00000001, /// Can be used as a source of transfer operations
1094 VK_BUFFER_USAGE_TRANSFER_DST_BIT = 0x00000002, /// Can be used as a destination of transfer operations
Jesse Halld27f6aa2015-08-15 17:58:48 -07001095 VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000004, /// Can be used as TBO
1096 VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT = 0x00000008, /// Can be used as IBO
1097 VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT = 0x00000010, /// Can be used as UBO
1098 VK_BUFFER_USAGE_STORAGE_BUFFER_BIT = 0x00000020, /// Can be used as SSBO
1099 VK_BUFFER_USAGE_INDEX_BUFFER_BIT = 0x00000040, /// Can be used as source of fixed function index fetch (index buffer)
1100 VK_BUFFER_USAGE_VERTEX_BUFFER_BIT = 0x00000080, /// Can be used as source of fixed function vertex fetch (VBO)
1101 VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT = 0x00000100, /// Can be the source of indirect parameters (e.g. indirect buffer, parameter buffer)
1102}
1103
1104/// Buffer creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001105type VkFlags VkBufferCreateFlags
1106bitfield VkBufferCreateFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001107 VK_BUFFER_CREATE_SPARSE_BINDING_BIT = 0x00000001, /// Buffer should support sparse backing
Jesse Halld27f6aa2015-08-15 17:58:48 -07001108 VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002, /// Buffer should support sparse backing with partial residency
1109 VK_BUFFER_CREATE_SPARSE_ALIASED_BIT = 0x00000004, /// Buffer should support constent data access to physical memory blocks mapped into multiple locations of sparse buffers
1110}
1111
1112/// Shader stage flags
Jesse Halld8bade02015-11-24 10:24:18 -08001113type VkFlags VkShaderStageFlags
1114bitfield VkShaderStageFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001115 VK_SHADER_STAGE_VERTEX_BIT = 0x00000001,
Jesse Hallae38f732015-11-19 21:32:50 -08001116 VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT = 0x00000002,
1117 VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001118 VK_SHADER_STAGE_GEOMETRY_BIT = 0x00000008,
1119 VK_SHADER_STAGE_FRAGMENT_BIT = 0x00000010,
1120 VK_SHADER_STAGE_COMPUTE_BIT = 0x00000020,
Jesse Hallc7467b72015-11-29 21:05:26 -08001121 VK_SHADER_STAGE_ALL_GRAPHICS = 0x0000001F,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001122
1123 VK_SHADER_STAGE_ALL = 0x7FFFFFFF,
1124}
1125
Jesse Hallfbf97b02015-11-20 14:17:03 -08001126/// Descriptor pool create flags
Jesse Halld8bade02015-11-24 10:24:18 -08001127type VkFlags VkDescriptorPoolCreateFlags
1128bitfield VkDescriptorPoolCreateFlagBits {
Jesse Hallfbf97b02015-11-20 14:17:03 -08001129 VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT = 0x00000001,
1130}
1131
1132/// Descriptor pool reset flags
Jesse Halld8bade02015-11-24 10:24:18 -08001133type VkFlags VkDescriptorPoolResetFlags
Jesse Halla6429252015-11-29 18:59:42 -08001134//bitfield VkDescriptorPoolResetFlagBits {
1135//}
Jesse Hallfbf97b02015-11-20 14:17:03 -08001136
Jesse Halld27f6aa2015-08-15 17:58:48 -07001137/// Image usage flags
Jesse Halld8bade02015-11-24 10:24:18 -08001138type VkFlags VkImageUsageFlags
1139bitfield VkImageUsageFlagBits {
Jesse Hall3fbc8562015-11-29 22:10:52 -08001140 VK_IMAGE_USAGE_TRANSFER_SRC_BIT = 0x00000001, /// Can be used as a source of transfer operations
1141 VK_IMAGE_USAGE_TRANSFER_DST_BIT = 0x00000002, /// Can be used as a destination of transfer operations
Jesse Halld27f6aa2015-08-15 17:58:48 -07001142 VK_IMAGE_USAGE_SAMPLED_BIT = 0x00000004, /// Can be sampled from (SAMPLED_IMAGE and COMBINED_IMAGE_SAMPLER descriptor types)
1143 VK_IMAGE_USAGE_STORAGE_BIT = 0x00000008, /// Can be used as storage image (STORAGE_IMAGE descriptor type)
1144 VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT = 0x00000010, /// Can be used as framebuffer color attachment
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001145 VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000020, /// Can be used as framebuffer depth/stencil attachment
Jesse Halld27f6aa2015-08-15 17:58:48 -07001146 VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT = 0x00000040, /// Image data not needed outside of rendering
1147 VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT = 0x00000080, /// Can be used as framebuffer input attachment
1148}
1149
1150/// Image creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001151type VkFlags VkImageCreateFlags
1152bitfield VkImageCreateFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001153 VK_IMAGE_CREATE_SPARSE_BINDING_BIT = 0x00000001, /// Image should support sparse backing
Jesse Halld27f6aa2015-08-15 17:58:48 -07001154 VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002, /// Image should support sparse backing with partial residency
1155 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 -07001156 VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT = 0x00000008, /// Allows image views to have different format than the base image
1157 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 -07001158}
1159
Jesse Hallb00daad2015-11-29 19:46:20 -08001160/// Image view creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001161type VkFlags VkImageViewCreateFlags
Jesse Hallb00daad2015-11-29 19:46:20 -08001162//bitfield VkImageViewCreateFlagBits {
1163//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001164
1165/// Pipeline creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001166type VkFlags VkPipelineCreateFlags
1167bitfield VkPipelineCreateFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001168 VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT = 0x00000001,
1169 VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT = 0x00000002,
1170 VK_PIPELINE_CREATE_DERIVATIVE_BIT = 0x00000004,
1171}
1172
Jesse Hall65ab5522015-11-30 00:07:16 -08001173/// Color component flags
1174type VkFlags VkColorComponentFlags
1175bitfield VkColorComponentFlagBits {
1176 VK_COLOR_COMPONENT_R_BIT = 0x00000001,
1177 VK_COLOR_COMPONENT_G_BIT = 0x00000002,
1178 VK_COLOR_COMPONENT_B_BIT = 0x00000004,
1179 VK_COLOR_COMPONENT_A_BIT = 0x00000008,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001180}
1181
1182/// Fence creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001183type VkFlags VkFenceCreateFlags
1184bitfield VkFenceCreateFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001185 VK_FENCE_CREATE_SIGNALED_BIT = 0x00000001,
1186}
1187
1188/// Semaphore creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001189type VkFlags VkSemaphoreCreateFlags
Jesse Halla6429252015-11-29 18:59:42 -08001190//bitfield VkSemaphoreCreateFlagBits {
1191//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001192
1193/// Format capability flags
Jesse Halld8bade02015-11-24 10:24:18 -08001194type VkFlags VkFormatFeatureFlags
1195bitfield VkFormatFeatureFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001196 VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT = 0x00000001, /// Format can be used for sampled images (SAMPLED_IMAGE and COMBINED_IMAGE_SAMPLER descriptor types)
1197 VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT = 0x00000002, /// Format can be used for storage images (STORAGE_IMAGE descriptor type)
1198 VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT = 0x00000004, /// Format supports atomic operations in case it's used for storage images
1199 VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000008, /// Format can be used for uniform texel buffers (TBOs)
1200 VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT = 0x00000010, /// Format can be used for storage texel buffers (IBOs)
1201 VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT = 0x00000020, /// Format supports atomic operations in case it's used for storage texel buffers
1202 VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT = 0x00000040, /// Format can be used for vertex buffers (VBOs)
1203 VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT = 0x00000080, /// Format can be used for color attachment images
1204 VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT = 0x00000100, /// Format supports blending in case it's used for color attachment images
1205 VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000200, /// Format can be used for depth/stencil attachment images
Jesse Hall3fbc8562015-11-29 22:10:52 -08001206 VK_FORMAT_FEATURE_BLIT_SRC_BIT = 0x00000400, /// Format can be used as the source image of blits with vkCommandBlitImage
1207 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 -08001208 VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT = 0x00001000,
Jesse Hall26763382016-05-20 07:13:52 -07001209
1210 //@extension("VK_IMG_filter_cubic")
1211 VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG = 0x00002000,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001212}
1213
1214/// Query control flags
Jesse Halld8bade02015-11-24 10:24:18 -08001215type VkFlags VkQueryControlFlags
1216bitfield VkQueryControlFlagBits {
Jesse Hall65ab5522015-11-30 00:07:16 -08001217 VK_QUERY_CONTROL_PRECISE_BIT = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001218}
1219
1220/// Query result flags
Jesse Halld8bade02015-11-24 10:24:18 -08001221type VkFlags VkQueryResultFlags
1222bitfield VkQueryResultFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001223 VK_QUERY_RESULT_64_BIT = 0x00000001, /// Results of the queries are written to the destination buffer as 64-bit values
1224 VK_QUERY_RESULT_WAIT_BIT = 0x00000002, /// Results of the queries are waited on before proceeding with the result copy
1225 VK_QUERY_RESULT_WITH_AVAILABILITY_BIT = 0x00000004, /// Besides the results of the query, the availability of the results is also written
1226 VK_QUERY_RESULT_PARTIAL_BIT = 0x00000008, /// Copy the partial results of the query even if the final results aren't available
1227}
1228
1229/// Shader module creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001230type VkFlags VkShaderModuleCreateFlags
Jesse Halla6429252015-11-29 18:59:42 -08001231//bitfield VkShaderModuleCreateFlagBits {
1232//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001233
Jesse Halld27f6aa2015-08-15 17:58:48 -07001234/// Event creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001235type VkFlags VkEventCreateFlags
Jesse Halla6429252015-11-29 18:59:42 -08001236//bitfield VkEventCreateFlagBits {
1237//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001238
Jesse Halla15a4bf2015-11-19 22:48:02 -08001239/// Command buffer usage flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001240type VkFlags VkCommandBufferUsageFlags
1241bitfield VkCommandBufferUsageFlagBits {
1242 VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT = 0x00000001,
1243 VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT = 0x00000002,
1244 VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001245}
1246
1247/// Pipeline statistics flags
Jesse Halld8bade02015-11-24 10:24:18 -08001248type VkFlags VkQueryPipelineStatisticFlags
1249bitfield VkQueryPipelineStatisticFlagBits {
Jesse Hallae38f732015-11-19 21:32:50 -08001250 VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_BIT = 0x00000001, /// Optional
1251 VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_PRIMITIVES_BIT = 0x00000002, /// Optional
1252 VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT = 0x00000004, /// Optional
1253 VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_INVOCATIONS_BIT = 0x00000008, /// Optional
1254 VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT = 0x00000010, /// Optional
1255 VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT = 0x00000020, /// Optional
1256 VK_QUERY_PIPELINE_STATISTIC_CLIPPING_PRIMITIVES_BIT = 0x00000040, /// Optional
1257 VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT = 0x00000080, /// Optional
1258 VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT = 0x00000100, /// Optional
1259 VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT = 0x00000200, /// Optional
1260 VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT = 0x00000400, /// Optional
Jesse Halld27f6aa2015-08-15 17:58:48 -07001261}
1262
1263/// Memory mapping flags
Jesse Halld8bade02015-11-24 10:24:18 -08001264type VkFlags VkMemoryMapFlags
Jesse Halla6429252015-11-29 18:59:42 -08001265//bitfield VkMemoryMapFlagBits {
1266//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001267
1268/// Bitfield of image aspects
Jesse Halld8bade02015-11-24 10:24:18 -08001269type VkFlags VkImageAspectFlags
1270bitfield VkImageAspectFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001271 VK_IMAGE_ASPECT_COLOR_BIT = 0x00000001,
1272 VK_IMAGE_ASPECT_DEPTH_BIT = 0x00000002,
1273 VK_IMAGE_ASPECT_STENCIL_BIT = 0x00000004,
1274 VK_IMAGE_ASPECT_METADATA_BIT = 0x00000008,
1275}
1276
1277/// Sparse memory bind flags
Jesse Halld8bade02015-11-24 10:24:18 -08001278type VkFlags VkSparseMemoryBindFlags
Jesse Hall091ed9e2015-11-30 00:55:29 -08001279bitfield VkSparseMemoryBindFlagBits {
1280 VK_SPARSE_MEMORY_BIND_METADATA_BIT = 0x00000001,
1281}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001282
1283/// Sparse image memory requirements flags
Jesse Halld8bade02015-11-24 10:24:18 -08001284type VkFlags VkSparseImageFormatFlags
1285bitfield VkSparseImageFormatFlagBits {
Jesse Hallb00daad2015-11-29 19:46:20 -08001286 VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT = 0x00000001, /// Image uses a single miptail region for all array slices
1287 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.
1288 VK_SPARSE_IMAGE_FORMAT_NONSTANDARD_BLOCK_SIZE_BIT = 0x00000004, /// Image uses a non-standard sparse block size
Jesse Halld27f6aa2015-08-15 17:58:48 -07001289}
1290
1291/// Pipeline stages
Jesse Halld8bade02015-11-24 10:24:18 -08001292type VkFlags VkPipelineStageFlags
1293bitfield VkPipelineStageFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001294 VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT = 0x00000001, /// Before subsequent commands are processed
1295 VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT = 0x00000002, /// Draw/DispatchIndirect command fetch
1296 VK_PIPELINE_STAGE_VERTEX_INPUT_BIT = 0x00000004, /// Vertex/index fetch
1297 VK_PIPELINE_STAGE_VERTEX_SHADER_BIT = 0x00000008, /// Vertex shading
Jesse Hallae38f732015-11-19 21:32:50 -08001298 VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT = 0x00000010, /// Tessellation control shading
1299 VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT = 0x00000020, /// Tessellation evaluation shading
Jesse Halld27f6aa2015-08-15 17:58:48 -07001300 VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT = 0x00000040, /// Geometry shading
1301 VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT = 0x00000080, /// Fragment shading
1302 VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT = 0x00000100, /// Early fragment (depth/stencil) tests
1303 VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT = 0x00000200, /// Late fragment (depth/stencil) tests
1304 VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT = 0x00000400, /// Color attachment writes
1305 VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT = 0x00000800, /// Compute shading
1306 VK_PIPELINE_STAGE_TRANSFER_BIT = 0x00001000, /// Transfer/copy operations
Jesse Hall543a7ff2016-01-08 16:38:30 -08001307 VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT = 0x00002000,
1308 VK_PIPELINE_STAGE_HOST_BIT = 0x00004000, /// Indicates host (CPU) is a source/sink of the dependency
Jesse Halld27f6aa2015-08-15 17:58:48 -07001309
Jesse Hall543a7ff2016-01-08 16:38:30 -08001310 VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT = 0x00008000, /// All stages of the graphics pipeline
1311 VK_PIPELINE_STAGE_ALL_COMMANDS_BIT = 0x00010000, /// All graphics, compute, copy, and transition commands
Chris Forbes289cb792016-12-30 15:03:55 +13001312
1313 //@extension("VK_NVX_device_generated_commands")
1314 VK_PIPELINE_STAGE_COMMAND_PROCESS_BIT_NVX = 0x00020000,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001315}
1316
1317/// Render pass attachment description flags
Jesse Halld8bade02015-11-24 10:24:18 -08001318type VkFlags VkAttachmentDescriptionFlags
1319bitfield VkAttachmentDescriptionFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001320 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 -07001321}
1322
1323/// Subpass description flags
Jesse Halld8bade02015-11-24 10:24:18 -08001324type VkFlags VkSubpassDescriptionFlags
1325bitfield VkSubpassDescriptionFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001326}
1327
1328/// Command pool creation flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001329type VkFlags VkCommandPoolCreateFlags
1330bitfield VkCommandPoolCreateFlagBits {
1331 VK_COMMAND_POOL_CREATE_TRANSIENT_BIT = 0x00000001, /// Command buffers have a short lifetime
1332 VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT = 0x00000002, /// Command buffers may release their memory individually
Jesse Halld27f6aa2015-08-15 17:58:48 -07001333}
1334
1335/// Command pool reset flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001336type VkFlags VkCommandPoolResetFlags
1337bitfield VkCommandPoolResetFlagBits {
1338 VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT = 0x00000001, /// Release resources owned by the pool
Jesse Halld27f6aa2015-08-15 17:58:48 -07001339}
1340
Jesse Hall3fbc8562015-11-29 22:10:52 -08001341type VkFlags VkCommandBufferResetFlags
1342bitfield VkCommandBufferResetFlagBits {
1343 VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT = 0x00000001, /// Release resources owned by the buffer
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001344}
1345
Jesse Halld8bade02015-11-24 10:24:18 -08001346type VkFlags VkSampleCountFlags
1347bitfield VkSampleCountFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001348 VK_SAMPLE_COUNT_1_BIT = 0x00000001,
1349 VK_SAMPLE_COUNT_2_BIT = 0x00000002,
1350 VK_SAMPLE_COUNT_4_BIT = 0x00000004,
1351 VK_SAMPLE_COUNT_8_BIT = 0x00000008,
1352 VK_SAMPLE_COUNT_16_BIT = 0x00000010,
1353 VK_SAMPLE_COUNT_32_BIT = 0x00000020,
1354 VK_SAMPLE_COUNT_64_BIT = 0x00000040,
1355}
1356
Jesse Halld8bade02015-11-24 10:24:18 -08001357type VkFlags VkStencilFaceFlags
1358bitfield VkStencilFaceFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001359 VK_STENCIL_FACE_FRONT_BIT = 0x00000001, /// Front face
1360 VK_STENCIL_FACE_BACK_BIT = 0x00000002, /// Back face
Jesse Hallc7467b72015-11-29 21:05:26 -08001361 VK_STENCIL_FRONT_AND_BACK = 0x00000003,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001362}
1363
Jesse Halla6429252015-11-29 18:59:42 -08001364/// Instance creation flags
1365type VkFlags VkInstanceCreateFlags
1366//bitfield VkInstanceCreateFlagBits {
1367//}
1368
1369/// Device creation flags
1370type VkFlags VkDeviceCreateFlags
1371//bitfield VkDeviceCreateFlagBits {
1372//}
1373
1374/// Device queue creation flags
1375type VkFlags VkDeviceQueueCreateFlags
1376//bitfield VkDeviceQueueCreateFlagBits {
1377//}
1378
1379/// Query pool creation flags
1380type VkFlags VkQueryPoolCreateFlags
1381//bitfield VkQueryPoolCreateFlagBits {
1382//}
1383
1384/// Buffer view creation flags
1385type VkFlags VkBufferViewCreateFlags
1386//bitfield VkBufferViewCreateFlagBits {
1387//}
1388
1389/// Pipeline cache creation flags
1390type VkFlags VkPipelineCacheCreateFlags
1391//bitfield VkPipelineCacheCreateFlagBits {
1392//}
1393
1394/// Pipeline shader stage creation flags
1395type VkFlags VkPipelineShaderStageCreateFlags
1396//bitfield VkPipelineShaderStageCreateFlagBits {
1397//}
1398
1399/// Descriptor set layout creation flags
1400type VkFlags VkDescriptorSetLayoutCreateFlags
1401//bitfield VkDescriptorSetLayoutCreateFlagBits {
1402//}
1403
1404/// Pipeline vertex input state creation flags
1405type VkFlags VkPipelineVertexInputStateCreateFlags
1406//bitfield VkPipelineVertexInputStateCreateFlagBits {
1407//}
1408
1409/// Pipeline input assembly state creation flags
1410type VkFlags VkPipelineInputAssemblyStateCreateFlags
1411//bitfield VkPipelineInputAssemblyStateCreateFlagBits {
1412//}
1413
1414/// Tessellation state creation flags
1415type VkFlags VkPipelineTessellationStateCreateFlags
1416//bitfield VkPipelineTessellationStateCreateFlagBits {
1417//}
1418
1419/// Viewport state creation flags
1420type VkFlags VkPipelineViewportStateCreateFlags
1421//bitfield VkPipelineViewportStateCreateFlagBits {
1422//}
1423
Jesse Hall3fbc8562015-11-29 22:10:52 -08001424/// Rasterization state creation flags
1425type VkFlags VkPipelineRasterizationStateCreateFlags
1426//bitfield VkPipelineRasterizationStateCreateFlagBits {
Jesse Halla6429252015-11-29 18:59:42 -08001427//}
1428
1429/// Multisample state creation flags
1430type VkFlags VkPipelineMultisampleStateCreateFlags
1431//bitfield VkPipelineMultisampleStateCreateFlagBits {
1432//}
1433
1434/// Color blend state creation flags
1435type VkFlags VkPipelineColorBlendStateCreateFlags
1436//bitfield VkPipelineColorBlendStateCreateFlagBits {
1437//}
1438
1439/// Depth/stencil state creation flags
1440type VkFlags VkPipelineDepthStencilStateCreateFlags
1441//bitfield VkPipelineDepthStencilStateCreateFlagBits {
1442//}
1443
1444/// Dynamic state creation flags
1445type VkFlags VkPipelineDynamicStateCreateFlags
1446//bitfield VkPipelineDynamicStateCreateFlagBits {
1447//}
1448
1449/// Pipeline layout creation flags
1450type VkFlags VkPipelineLayoutCreateFlags
1451//bitfield VkPipelineLayoutCreateFlagBits {
1452//}
1453
1454/// Sampler creation flags
1455type VkFlags VkSamplerCreateFlags
1456//bitfield VkSamplerCreateFlagBits {
1457//}
1458
1459/// Render pass creation flags
1460type VkFlags VkRenderPassCreateFlags
1461//bitfield VkRenderPassCreateFlagBits {
1462//}
1463
1464/// Framebuffer creation flags
1465type VkFlags VkFramebufferCreateFlags
1466//bitfield VkFramebufferCreateFlagBits {
1467//}
1468
Jesse Halldc6d36c2015-11-29 19:12:15 -08001469/// Dependency flags
1470type VkFlags VkDependencyFlags
1471bitfield VkDependencyFlagBits {
1472 VK_DEPENDENCY_BY_REGION_BIT = 0x00000001,
1473}
1474
Jesse Hallc7467b72015-11-29 21:05:26 -08001475/// Cull mode flags
1476type VkFlags VkCullModeFlags
1477bitfield VkCullModeFlagBits {
1478 VK_CULL_MODE_NONE = 0x00000000,
1479 VK_CULL_MODE_FRONT_BIT = 0x00000001,
1480 VK_CULL_MODE_BACK_BIT = 0x00000002,
1481 VK_CULL_MODE_FRONT_AND_BACK = 0x00000003,
1482}
1483
Jesse Hall523db342015-11-30 21:12:55 -08001484@extension("VK_KHR_surface")
Jesse Halld8bade02015-11-24 10:24:18 -08001485type VkFlags VkSurfaceTransformFlagsKHR
Jesse Hall523db342015-11-30 21:12:55 -08001486@extension("VK_KHR_surface")
Jesse Halld8bade02015-11-24 10:24:18 -08001487bitfield VkSurfaceTransformFlagBitsKHR {
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001488 VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR = 0x00000001,
Jesse Hall9ba8bc82015-11-30 16:22:16 -08001489 VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR = 0x00000002,
1490 VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR = 0x00000004,
1491 VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR = 0x00000008,
1492 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR = 0x00000010,
1493 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR = 0x00000020,
1494 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR = 0x00000040,
1495 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR = 0x00000080,
1496 VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR = 0x00000100,
Michael Lentine88594d72015-11-12 12:49:45 -08001497}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001498
Jesse Hall523db342015-11-30 21:12:55 -08001499@extension("VK_KHR_surface")
Jesse Halla6429252015-11-29 18:59:42 -08001500type VkFlags VkCompositeAlphaFlagsKHR
Jesse Hall523db342015-11-30 21:12:55 -08001501@extension("VK_KHR_surface")
Jesse Halla6429252015-11-29 18:59:42 -08001502bitfield VkCompositeAlphaFlagBitsKHR {
1503 VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR = 0x00000001,
1504 VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR = 0x00000002,
1505 VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR = 0x00000004,
1506 VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR = 0x00000008,
1507}
1508
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001509@extension("VK_KHR_swapchain")
1510type VkFlags VkSwapchainCreateFlagsKHR
1511//@extension("VK_KHR_swapchain")
1512//bitfield VkSwapchainCreateFlagBitsKHR {
1513//}
1514
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001515@extension("VK_KHR_display")
Jesse Halld8bade02015-11-24 10:24:18 -08001516type VkFlags VkDisplayPlaneAlphaFlagsKHR
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001517@extension("VK_KHR_display")
Jesse Halld8bade02015-11-24 10:24:18 -08001518bitfield VkDisplayPlaneAlphaFlagBitsKHR {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001519 VK_DISPLAY_PLANE_ALPHA_OPAQUE_BIT_KHR = 0x00000001,
1520 VK_DISPLAY_PLANE_ALPHA_GLOBAL_BIT_KHR = 0x00000002,
1521 VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_BIT_KHR = 0x00000004,
1522 VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_PREMULTIPLIED_BIT_KHR = 0x00000008,
Jesse Hall1356b0d2015-11-23 17:24:58 -08001523}
1524
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001525@extension("VK_KHR_display")
1526type VkFlags VkDisplaySurfaceCreateFlagsKHR
1527//@extension("VK_KHR_display")
1528//bitfield VkDisplaySurfaceCreateFlagBitsKHR {
1529//}
1530
Jesse Hall9ba8bc82015-11-30 16:22:16 -08001531@extension("VK_KHR_display")
1532type VkFlags VkDisplayModeCreateFlagsKHR
1533//@extension("VK_KHR_display")
1534//bitfield VkDisplayModeCreateFlagBitsKHR {
1535//}
1536
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001537@extension("VK_KHR_xlib_surface")
1538type VkFlags VkXlibSurfaceCreateFlagsKHR
1539//@extension("VK_KHR_xlib_surface")
1540//bitfield VkXlibSurfaceCreateFlagBitsKHR {
1541//}
1542
1543@extension("VK_KHR_xcb_surface")
1544type VkFlags VkXcbSurfaceCreateFlagsKHR
1545//@extension("VK_KHR_xcb_surface")
1546//bitfield VkXcbSurfaceCreateFlagBitsKHR {
1547//}
1548
1549@extension("VK_KHR_wayland_surface")
1550type VkFlags VkWaylandSurfaceCreateFlagsKHR
1551//@extension("VK_KHR_wayland_surface")
1552//bitfield VkWaylandSurfaceCreateFlagBitsKHR {
1553//}
1554
1555@extension("VK_KHR_mir_surface")
1556type VkFlags VkMirSurfaceCreateFlagsKHR
1557//@extension("VK_KHR_mir_surface")
1558//bitfield VkMirSurfaceCreateFlagBitsKHR {
1559//}
1560
1561@extension("VK_KHR_android_surface")
1562type VkFlags VkAndroidSurfaceCreateFlagsKHR
1563//@extension("VK_KHR_android_surface")
1564//bitfield VkAndroidSurfaceCreateFlagBitsKHR {
1565//}
1566
1567@extension("VK_KHR_win32_surface")
1568type VkFlags VkWin32SurfaceCreateFlagsKHR
1569//@extension("VK_KHR_win32_surface")
1570//bitfield VkWin32SurfaceCreateFlagBitsKHR {
1571//}
1572
Jesse Hall715b86a2016-01-16 16:34:29 -08001573@extension("VK_EXT_debug_report")
1574type VkFlags VkDebugReportFlagsEXT
1575@extension("VK_EXT_debug_report")
1576bitfield VkDebugReportFlagBitsEXT {
Jesse Halle2948d82016-02-25 04:19:32 -08001577 VK_DEBUG_REPORT_INFORMATION_BIT_EXT = 0x00000001,
1578 VK_DEBUG_REPORT_WARNING_BIT_EXT = 0x00000002,
1579 VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT = 0x00000004,
Jesse Hall715b86a2016-01-16 16:34:29 -08001580 VK_DEBUG_REPORT_ERROR_BIT_EXT = 0x00000008,
1581 VK_DEBUG_REPORT_DEBUG_BIT_EXT = 0x00000010,
1582}
1583
Chris Forbes8e4438b2016-12-07 16:26:49 +13001584@extension("VK_ANDROID_native_buffer")
1585type VkFlags VkSwapchainImageUsageFlagsANDROID
1586@extension("VK_ANDROID_native_buffer")
1587bitfield VkSwapchainImageUsageFlagBitsANDROID {
Chris Forbes4da65b92017-01-31 11:48:50 +13001588 VK_SWAPCHAIN_IMAGE_USAGE_FLAGS_SHARED_BIT_ANDROID = 0x00000001,
Chris Forbes8e4438b2016-12-07 16:26:49 +13001589}
1590
Chris Forbes289cb792016-12-30 15:03:55 +13001591@extension("VK_NV_external_memory_capabilities")
1592type VkFlags VkExternalMemoryHandleTypeFlagsNV
1593@extension("VK_NV_external_memory_capabilities")
1594bitfield VkExternalMemoryHandleTypeFlagBitsNV {
1595 VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_NV = 0x00000001,
1596 VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_NV = 0x00000002,
1597 VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_IMAGE_BIT_NV = 0x00000004,
1598 VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_IMAGE_KMT_BIT_NV = 0x00000008,
1599}
1600
1601@extension("VK_NV_external_memory_capabilities")
1602type VkFlags VkExternalMemoryFeatureFlagsNV
1603@extension("VK_NV_external_memory_capabilities")
1604bitfield VkExternalMemoryFeatureFlagBitsNV {
1605 VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT_NV = 0x00000001,
1606 VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT_NV = 0x00000002,
1607 VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT_NV = 0x00000004,
1608}
1609
1610@extension("VK_NVX_device_generated_commands")
1611type VkFlags VkIndirectCommandsLayoutUsageFlagsNVX
1612@extension("VK_NVX_device_generated_commands")
1613bitfield VkIndirectCommandsLayoutUsageFlagBitsNVX {
1614 VK_INDIRECT_COMMANDS_LAYOUT_USAGE_UNORDERED_SEQUENCES_BIT_NVX = 0x00000001,
1615 VK_INDIRECT_COMMANDS_LAYOUT_USAGE_SPARSE_SEQUENCES_BIT_NVX = 0x00000002,
1616 VK_INDIRECT_COMMANDS_LAYOUT_USAGE_EMPTY_EXECUTIONS_BIT_NVX = 0x00000004,
1617 VK_INDIRECT_COMMANDS_LAYOUT_USAGE_INDEXED_SEQUENCES_BIT_NVX = 0x00000008,
1618}
1619
1620@extension("VK_NVX_device_generated_commands")
1621type VkFlags VkObjectEntryUsageFlagsNVX
1622@extension("VK_NVX_device_generated_commands")
1623bitfield VkObjectEntryUsageFlagBitsNVX {
1624 VK_OBJECT_ENTRY_USAGE_GRAPHICS_BIT_NVX = 0x00000001,
1625 VK_OBJECT_ENTRY_USAGE_COMPUTE_BIT_NVX = 0x00000002,
1626}
1627
Jesse Hall1356b0d2015-11-23 17:24:58 -08001628
Jesse Halld27f6aa2015-08-15 17:58:48 -07001629//////////////////
1630// Structures //
1631//////////////////
1632
1633class VkOffset2D {
1634 s32 x
1635 s32 y
1636}
1637
1638class VkOffset3D {
1639 s32 x
1640 s32 y
1641 s32 z
1642}
1643
1644class VkExtent2D {
Jesse Hall3dd678a2016-01-08 21:52:01 -08001645 u32 width
1646 u32 height
Jesse Halld27f6aa2015-08-15 17:58:48 -07001647}
1648
1649class VkExtent3D {
Jesse Hall3dd678a2016-01-08 21:52:01 -08001650 u32 width
1651 u32 height
1652 u32 depth
Jesse Halld27f6aa2015-08-15 17:58:48 -07001653}
1654
1655class VkViewport {
Jesse Hall65ab5522015-11-30 00:07:16 -08001656 f32 x
1657 f32 y
Jesse Halld27f6aa2015-08-15 17:58:48 -07001658 f32 width
1659 f32 height
1660 f32 minDepth
1661 f32 maxDepth
1662}
1663
1664class VkRect2D {
1665 VkOffset2D offset
1666 VkExtent2D extent
1667}
1668
Jesse Halla15a4bf2015-11-19 22:48:02 -08001669class VkClearRect {
1670 VkRect2D rect
1671 u32 baseArrayLayer
Jesse Hall3fbc8562015-11-29 22:10:52 -08001672 u32 layerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001673}
1674
Jesse Hall65ab5522015-11-30 00:07:16 -08001675class VkComponentMapping {
1676 VkComponentSwizzle r
1677 VkComponentSwizzle g
1678 VkComponentSwizzle b
1679 VkComponentSwizzle a
Jesse Halld27f6aa2015-08-15 17:58:48 -07001680}
1681
1682class VkPhysicalDeviceProperties {
1683 u32 apiVersion
1684 u32 driverVersion
Jesse Hall65ab5522015-11-30 00:07:16 -08001685 u32 vendorID
1686 u32 deviceID
Jesse Halld27f6aa2015-08-15 17:58:48 -07001687 VkPhysicalDeviceType deviceType
Jesse Hall65ab5522015-11-30 00:07:16 -08001688 char[VK_MAX_PHYSICAL_DEVICE_NAME_SIZE] deviceName
1689 u8[VK_UUID_SIZE] pipelineCacheUUID
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001690 VkPhysicalDeviceLimits limits
1691 VkPhysicalDeviceSparseProperties sparseProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07001692}
1693
1694class VkExtensionProperties {
Jesse Hall65ab5522015-11-30 00:07:16 -08001695 char[VK_MAX_EXTENSION_NAME_SIZE] extensionName /// extension name
Jesse Halld27f6aa2015-08-15 17:58:48 -07001696 u32 specVersion /// version of the extension specification implemented
1697}
1698
1699class VkLayerProperties {
Jesse Hall65ab5522015-11-30 00:07:16 -08001700 char[VK_MAX_EXTENSION_NAME_SIZE] layerName /// layer name
Jesse Hall3fbc8562015-11-29 22:10:52 -08001701 u32 specVersion /// version of the layer specification implemented
1702 u32 implementationVersion /// build or release version of the layer's library
Jesse Hall65ab5522015-11-30 00:07:16 -08001703 char[VK_MAX_DESCRIPTION_SIZE] description /// Free-form description of the layer
Jesse Halld27f6aa2015-08-15 17:58:48 -07001704}
1705
Jesse Halla366a512015-11-19 22:30:07 -08001706class VkSubmitInfo {
Jesse Hall03b6fe12015-11-24 12:44:21 -08001707 VkStructureType sType /// Type of structure. Should be VK_STRUCTURE_TYPE_SUBMIT_INFO
1708 const void* pNext /// Next structure in chain
1709 u32 waitSemaphoreCount
Jesse Halla366a512015-11-19 22:30:07 -08001710 const VkSemaphore* pWaitSemaphores
Jesse Hall543a7ff2016-01-08 16:38:30 -08001711 const VkPipelineStageFlags* pWaitDstStageMask
Jesse Hall03b6fe12015-11-24 12:44:21 -08001712 u32 commandBufferCount
Jesse Hall3fbc8562015-11-29 22:10:52 -08001713 const VkCommandBuffer* pCommandBuffers
Jesse Hall03b6fe12015-11-24 12:44:21 -08001714 u32 signalSemaphoreCount
Jesse Halla366a512015-11-19 22:30:07 -08001715 const VkSemaphore* pSignalSemaphores
1716}
1717
Jesse Halld27f6aa2015-08-15 17:58:48 -07001718class VkApplicationInfo {
1719 VkStructureType sType /// Type of structure. Should be VK_STRUCTURE_TYPE_APPLICATION_INFO
1720 const void* pNext /// Next structure in chain
Jesse Hall3fbc8562015-11-29 22:10:52 -08001721 const char* pApplicationName
1722 u32 applicationVersion
Jesse Halld27f6aa2015-08-15 17:58:48 -07001723 const char* pEngineName
1724 u32 engineVersion
1725 u32 apiVersion
1726}
1727
Jesse Hall3fbc8562015-11-29 22:10:52 -08001728class VkAllocationCallbacks {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001729 void* pUserData
Jesse Hall3fbc8562015-11-29 22:10:52 -08001730 PFN_vkAllocationFunction pfnAllocation
1731 PFN_vkReallocationFunction pfnReallocation
Jesse Halld27f6aa2015-08-15 17:58:48 -07001732 PFN_vkFreeFunction pfnFree
Jesse Hall3fbc8562015-11-29 22:10:52 -08001733 PFN_vkInternalAllocationNotification pfnInternalAllocation
Jesse Hall03b6fe12015-11-24 12:44:21 -08001734 PFN_vkInternalFreeNotification pfnInternalFree
Jesse Halld27f6aa2015-08-15 17:58:48 -07001735}
1736
1737class VkDeviceQueueCreateInfo {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001738 VkStructureType sStype /// Should be VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO
1739 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001740 VkDeviceQueueCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001741 u32 queueFamilyIndex
Jesse Halldba27f72015-11-30 14:25:46 -08001742 u32 queueCount
Jesse Hallfbf97b02015-11-20 14:17:03 -08001743 const f32* pQueuePriorities
Jesse Halld27f6aa2015-08-15 17:58:48 -07001744}
1745
1746class VkDeviceCreateInfo {
1747 VkStructureType sType /// Should be VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO
1748 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001749 VkDeviceCreateFlags flags
Jesse Halldba27f72015-11-30 14:25:46 -08001750 u32 queueCreateInfoCount
1751 const VkDeviceQueueCreateInfo* pQueueCreateInfos
Jesse Hall3dd678a2016-01-08 21:52:01 -08001752 u32 enabledLayerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001753 const char* const* ppEnabledLayerNames /// Ordered list of layer names to be enabled
Jesse Hall3dd678a2016-01-08 21:52:01 -08001754 u32 enabledExtensionCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001755 const char* const* ppEnabledExtensionNames
1756 const VkPhysicalDeviceFeatures* pEnabledFeatures
Jesse Halld27f6aa2015-08-15 17:58:48 -07001757}
1758
1759class VkInstanceCreateInfo {
1760 VkStructureType sType /// Should be VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO
1761 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001762 VkInstanceCreateFlags flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001763 const VkApplicationInfo* pApplicationInfo
Jesse Hall3dd678a2016-01-08 21:52:01 -08001764 u32 enabledLayerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001765 const char* const* ppEnabledLayerNames /// Ordered list of layer names to be enabled
Jesse Hall3dd678a2016-01-08 21:52:01 -08001766 u32 enabledExtensionCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001767 const char* const* ppEnabledExtensionNames /// Extension names to be enabled
1768}
1769
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001770class VkQueueFamilyProperties {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001771 VkQueueFlags queueFlags /// Queue flags
1772 u32 queueCount
Jesse Hallacfa5342015-11-19 21:51:33 -08001773 u32 timestampValidBits
Jesse Hall65ab5522015-11-30 00:07:16 -08001774 VkExtent3D minImageTransferGranularity
Jesse Halld27f6aa2015-08-15 17:58:48 -07001775}
1776
1777class VkPhysicalDeviceMemoryProperties {
1778 u32 memoryTypeCount
1779 VkMemoryType[VK_MAX_MEMORY_TYPES] memoryTypes
1780 u32 memoryHeapCount
1781 VkMemoryHeap[VK_MAX_MEMORY_HEAPS] memoryHeaps
1782}
1783
Jesse Hall3fbc8562015-11-29 22:10:52 -08001784class VkMemoryAllocateInfo {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001785 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07001786 const void* pNext /// Pointer to next structure
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001787 VkDeviceSize allocationSize /// Size of memory allocation
Jesse Halld27f6aa2015-08-15 17:58:48 -07001788 u32 memoryTypeIndex /// Index of the of the memory type to allocate from
1789}
1790
1791class VkMemoryRequirements {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001792 VkDeviceSize size /// Specified in bytes
1793 VkDeviceSize alignment /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001794 u32 memoryTypeBits /// Bitfield of the allowed memory type indices into memoryTypes[] for this object
1795}
1796
1797class VkSparseImageFormatProperties {
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001798 VkImageAspectFlagBits aspectMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001799 VkExtent3D imageGranularity
1800 VkSparseImageFormatFlags flags
1801}
1802
1803class VkSparseImageMemoryRequirements {
Jesse Hallb00daad2015-11-29 19:46:20 -08001804 VkSparseImageFormatProperties formatProperties
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001805 u32 imageMipTailFirstLod
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001806 VkDeviceSize imageMipTailSize /// Specified in bytes, must be a multiple of image block size / alignment
1807 VkDeviceSize imageMipTailOffset /// Specified in bytes, must be a multiple of image block size / alignment
1808 VkDeviceSize imageMipTailStride /// Specified in bytes, must be a multiple of image block size / alignment
Jesse Halld27f6aa2015-08-15 17:58:48 -07001809}
1810
1811class VkMemoryType {
1812 VkMemoryPropertyFlags propertyFlags /// Memory properties of this memory type
1813 u32 heapIndex /// Index of the memory heap allocations of this memory type are taken from
1814}
1815
1816class VkMemoryHeap {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001817 VkDeviceSize size /// Available memory in the heap
Jesse Halld27f6aa2015-08-15 17:58:48 -07001818 VkMemoryHeapFlags flags /// Flags for the heap
1819}
1820
1821class VkMappedMemoryRange {
1822 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE
1823 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08001824 VkDeviceMemory memory /// Mapped memory object
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001825 VkDeviceSize offset /// Offset within the mapped memory the range starts from
1826 VkDeviceSize size /// Size of the range within the mapped memory
Jesse Halld27f6aa2015-08-15 17:58:48 -07001827}
1828
1829class VkFormatProperties {
1830 VkFormatFeatureFlags linearTilingFeatures /// Format features in case of linear tiling
1831 VkFormatFeatureFlags optimalTilingFeatures /// Format features in case of optimal tiling
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001832 VkFormatFeatureFlags bufferFeatures /// Format features supported by buffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07001833}
1834
1835class VkImageFormatProperties {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001836 VkExtent3D maxExtent /// max image dimensions for this resource type
1837 u32 maxMipLevels /// max number of mipmap levels for this resource type
Jesse Halla15a4bf2015-11-19 22:48:02 -08001838 u32 maxArrayLayers /// max array layers for this resource type
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001839 VkSampleCountFlags sampleCounts /// supported sample counts for this resource type
1840 VkDeviceSize maxResourceSize /// max size (in bytes) of this resource type
1841}
1842
Jesse Halla15a4bf2015-11-19 22:48:02 -08001843class VkDescriptorImageInfo {
1844 VkSampler sampler
1845 VkImageView imageView
1846 VkImageLayout imageLayout
1847}
1848
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001849class VkDescriptorBufferInfo {
1850 VkBuffer buffer /// Buffer used for this descriptor when the descriptor is UNIFORM_BUFFER[_DYNAMIC]
1851 VkDeviceSize offset /// Base offset from buffer start in bytes to update in the descriptor set.
1852 VkDeviceSize range /// Size in bytes of the buffer resource for this descriptor update.
Jesse Halld27f6aa2015-08-15 17:58:48 -07001853}
1854
Jesse Halld27f6aa2015-08-15 17:58:48 -07001855class VkWriteDescriptorSet {
1856 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET
1857 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08001858 VkDescriptorSet dstSet /// Destination descriptor set
1859 u32 dstBinding /// Binding within the destination descriptor set to write
1860 u32 dstArrayElement /// Array element within the destination binding to write
Jesse Hall03b6fe12015-11-24 12:44:21 -08001861 u32 descriptorCount /// Number of descriptors to write (determines the size of the array pointed by <pDescriptors>)
Jesse Halld27f6aa2015-08-15 17:58:48 -07001862 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 -08001863 const VkDescriptorImageInfo* pImageInfo
1864 const VkDescriptorBufferInfo* pBufferInfo
1865 const VkBufferView* pTexelBufferView
Jesse Halld27f6aa2015-08-15 17:58:48 -07001866}
1867
1868class VkCopyDescriptorSet {
1869 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET
1870 const void* pNext /// Pointer to next structure
1871 VkDescriptorSet srcSet /// Source descriptor set
1872 u32 srcBinding /// Binding within the source descriptor set to copy from
1873 u32 srcArrayElement /// Array element within the source binding to copy from
Jesse Hall3fbc8562015-11-29 22:10:52 -08001874 VkDescriptorSet dstSet /// Destination descriptor set
1875 u32 dstBinding /// Binding within the destination descriptor set to copy to
1876 u32 dstArrayElement /// Array element within the destination binding to copy to
Jesse Hall03b6fe12015-11-24 12:44:21 -08001877 u32 descriptorCount /// Number of descriptors to copy
Jesse Halld27f6aa2015-08-15 17:58:48 -07001878}
1879
1880class VkBufferCreateInfo {
1881 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO
1882 const void* pNext /// Pointer to next structure.
Jesse Halla6429252015-11-29 18:59:42 -08001883 VkBufferCreateFlags flags /// Buffer creation flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001884 VkDeviceSize size /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001885 VkBufferUsageFlags usage /// Buffer usage flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001886 VkSharingMode sharingMode
Jesse Hall03b6fe12015-11-24 12:44:21 -08001887 u32 queueFamilyIndexCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001888 const u32* pQueueFamilyIndices
1889}
1890
1891class VkBufferViewCreateInfo {
1892 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO
1893 const void* pNext /// Pointer to next structure.
Jesse Halla6429252015-11-29 18:59:42 -08001894 VkBufferViewCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001895 VkBuffer buffer
Jesse Halld27f6aa2015-08-15 17:58:48 -07001896 VkFormat format /// Optionally specifies format of elements
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001897 VkDeviceSize offset /// Specified in bytes
1898 VkDeviceSize range /// View size specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001899}
1900
1901class VkImageSubresource {
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001902 VkImageAspectFlagBits aspectMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001903 u32 mipLevel
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001904 u32 arrayLayer
Jesse Halld27f6aa2015-08-15 17:58:48 -07001905}
1906
1907class VkImageSubresourceRange {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001908 VkImageAspectFlags aspectMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001909 u32 baseMipLevel
Jesse Hall3fbc8562015-11-29 22:10:52 -08001910 u32 levelCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001911 u32 baseArrayLayer
Jesse Hall3fbc8562015-11-29 22:10:52 -08001912 u32 layerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001913}
1914
1915class VkMemoryBarrier {
1916 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MEMORY_BARRIER
1917 const void* pNext /// Pointer to next structure.
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001918 VkAccessFlags srcAccessMask
1919 VkAccessFlags dstAccessMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001920}
1921
1922class VkBufferMemoryBarrier {
1923 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER
1924 const void* pNext /// Pointer to next structure.
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001925 VkAccessFlags srcAccessMask
1926 VkAccessFlags dstAccessMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001927 u32 srcQueueFamilyIndex /// Queue family to transition ownership from
Jesse Hall3fbc8562015-11-29 22:10:52 -08001928 u32 dstQueueFamilyIndex /// Queue family to transition ownership to
Jesse Halld27f6aa2015-08-15 17:58:48 -07001929 VkBuffer buffer /// Buffer to sync
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001930 VkDeviceSize offset /// Offset within the buffer to sync
1931 VkDeviceSize size /// Amount of bytes to sync
Jesse Halld27f6aa2015-08-15 17:58:48 -07001932}
1933
1934class VkImageMemoryBarrier {
1935 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER
1936 const void* pNext /// Pointer to next structure.
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001937 VkAccessFlags srcAccessMask
1938 VkAccessFlags dstAccessMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001939 VkImageLayout oldLayout /// Current layout of the image
1940 VkImageLayout newLayout /// New layout to transition the image to
1941 u32 srcQueueFamilyIndex /// Queue family to transition ownership from
Jesse Hall3fbc8562015-11-29 22:10:52 -08001942 u32 dstQueueFamilyIndex /// Queue family to transition ownership to
Jesse Halld27f6aa2015-08-15 17:58:48 -07001943 VkImage image /// Image to sync
1944 VkImageSubresourceRange subresourceRange /// Subresource range to sync
1945}
1946
1947class VkImageCreateInfo {
1948 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO
1949 const void* pNext /// Pointer to next structure.
Jesse Halla6429252015-11-29 18:59:42 -08001950 VkImageCreateFlags flags /// Image creation flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001951 VkImageType imageType
1952 VkFormat format
1953 VkExtent3D extent
1954 u32 mipLevels
Jesse Halla15a4bf2015-11-19 22:48:02 -08001955 u32 arrayLayers
Jesse Hall091ed9e2015-11-30 00:55:29 -08001956 VkSampleCountFlagBits samples
Jesse Halld27f6aa2015-08-15 17:58:48 -07001957 VkImageTiling tiling
1958 VkImageUsageFlags usage /// Image usage flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001959 VkSharingMode sharingMode /// Cross-queue-family sharing mode
Jesse Hall03b6fe12015-11-24 12:44:21 -08001960 u32 queueFamilyIndexCount /// Number of queue families to share across
Jesse Halld27f6aa2015-08-15 17:58:48 -07001961 const u32* pQueueFamilyIndices /// Array of queue family indices to share across
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001962 VkImageLayout initialLayout /// Initial image layout for all subresources
Jesse Halld27f6aa2015-08-15 17:58:48 -07001963}
1964
1965class VkSubresourceLayout {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001966 VkDeviceSize offset /// Specified in bytes
1967 VkDeviceSize size /// Specified in bytes
1968 VkDeviceSize rowPitch /// Specified in bytes
Jesse Hall543a7ff2016-01-08 16:38:30 -08001969 VkDeviceSize arrayPitch /// Specified in bytes
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001970 VkDeviceSize depthPitch /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001971}
1972
1973class VkImageViewCreateInfo {
1974 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO
1975 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001976 VkImageViewCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001977 VkImage image
1978 VkImageViewType viewType
1979 VkFormat format
Jesse Hall65ab5522015-11-30 00:07:16 -08001980 VkComponentMapping components
Jesse Halld27f6aa2015-08-15 17:58:48 -07001981 VkImageSubresourceRange subresourceRange
Jesse Halld27f6aa2015-08-15 17:58:48 -07001982}
1983
1984class VkBufferCopy {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001985 VkDeviceSize srcOffset /// Specified in bytes
Jesse Hall3fbc8562015-11-29 22:10:52 -08001986 VkDeviceSize dstOffset /// Specified in bytes
Jesse Hallb00daad2015-11-29 19:46:20 -08001987 VkDeviceSize size /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001988}
1989
Jesse Halla6429252015-11-29 18:59:42 -08001990class VkSparseMemoryBind {
Jesse Hallb00daad2015-11-29 19:46:20 -08001991 VkDeviceSize resourceOffset /// Specified in bytes
1992 VkDeviceSize size /// Specified in bytes
Jesse Hall3fbc8562015-11-29 22:10:52 -08001993 VkDeviceMemory memory
1994 VkDeviceSize memoryOffset /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001995 VkSparseMemoryBindFlags flags
1996}
1997
Jesse Halla6429252015-11-29 18:59:42 -08001998class VkSparseImageMemoryBind {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001999 VkImageSubresource subresource
2000 VkOffset3D offset
2001 VkExtent3D extent
Jesse Hall3fbc8562015-11-29 22:10:52 -08002002 VkDeviceMemory memory
2003 VkDeviceSize memoryOffset /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002004 VkSparseMemoryBindFlags flags
2005}
2006
Jesse Halla6429252015-11-29 18:59:42 -08002007class VkSparseBufferMemoryBindInfo {
2008 VkBuffer buffer
2009 u32 bindCount
2010 const VkSparseMemoryBind* pBinds
2011}
2012
2013class VkSparseImageOpaqueMemoryBindInfo {
2014 VkImage image
2015 u32 bindCount
2016 const VkSparseMemoryBind* pBinds
2017}
2018
2019class VkSparseImageMemoryBindInfo {
2020 VkImage image
2021 u32 bindCount
2022 const VkSparseMemoryBind* pBinds
2023}
2024
2025class VkBindSparseInfo {
2026 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BIND_SPARSE_INFO
2027 const void* pNext
2028 u32 waitSemaphoreCount
2029 const VkSemaphore* pWaitSemaphores
2030 u32 numBufferBinds
2031 const VkSparseBufferMemoryBindInfo* pBufferBinds
2032 u32 numImageOpaqueBinds
2033 const VkSparseImageOpaqueMemoryBindInfo* pImageOpaqueBinds
2034 u32 numImageBinds
2035 const VkSparseImageMemoryBindInfo* pImageBinds
2036 u32 signalSemaphoreCount
2037 const VkSemaphore* pSignalSemaphores
2038}
2039
Jesse Hall65ab5522015-11-30 00:07:16 -08002040class VkImageSubresourceLayers {
2041 VkImageAspectFlags aspectMask
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002042 u32 mipLevel
Jesse Halla15a4bf2015-11-19 22:48:02 -08002043 u32 baseArrayLayer
Jesse Hall3fbc8562015-11-29 22:10:52 -08002044 u32 layerCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002045}
2046
Jesse Halld27f6aa2015-08-15 17:58:48 -07002047class VkImageCopy {
Jesse Hall65ab5522015-11-30 00:07:16 -08002048 VkImageSubresourceLayers srcSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07002049 VkOffset3D srcOffset /// Specified in pixels for both compressed and uncompressed images
Jesse Hall65ab5522015-11-30 00:07:16 -08002050 VkImageSubresourceLayers dstSubresource
Jesse Hall3fbc8562015-11-29 22:10:52 -08002051 VkOffset3D dstOffset /// Specified in pixels for both compressed and uncompressed images
Jesse Halld27f6aa2015-08-15 17:58:48 -07002052 VkExtent3D extent /// Specified in pixels for both compressed and uncompressed images
2053}
2054
2055class VkImageBlit {
Jesse Hall65ab5522015-11-30 00:07:16 -08002056 VkImageSubresourceLayers srcSubresource
Jesse Hall3dd678a2016-01-08 21:52:01 -08002057 VkOffset3D[2] srcOffsets
Jesse Hall65ab5522015-11-30 00:07:16 -08002058 VkImageSubresourceLayers dstSubresource
Jesse Hall3dd678a2016-01-08 21:52:01 -08002059 VkOffset3D[2] dstOffsets
Jesse Halld27f6aa2015-08-15 17:58:48 -07002060}
2061
2062class VkBufferImageCopy {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002063 VkDeviceSize bufferOffset /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002064 u32 bufferRowLength /// Specified in texels
2065 u32 bufferImageHeight
Jesse Hall65ab5522015-11-30 00:07:16 -08002066 VkImageSubresourceLayers imageSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07002067 VkOffset3D imageOffset /// Specified in pixels for both compressed and uncompressed images
2068 VkExtent3D imageExtent /// Specified in pixels for both compressed and uncompressed images
2069}
2070
2071class VkImageResolve {
Jesse Hall65ab5522015-11-30 00:07:16 -08002072 VkImageSubresourceLayers srcSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07002073 VkOffset3D srcOffset
Jesse Hall65ab5522015-11-30 00:07:16 -08002074 VkImageSubresourceLayers dstSubresource
Jesse Hall3fbc8562015-11-29 22:10:52 -08002075 VkOffset3D dstOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07002076 VkExtent3D extent
2077}
2078
2079class VkShaderModuleCreateInfo {
2080 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO
2081 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002082 VkShaderModuleCreateFlags flags /// Reserved
Jesse Halld27f6aa2015-08-15 17:58:48 -07002083 platform.size_t codeSize /// Specified in bytes
Jesse Halla9bb62b2015-11-21 19:31:56 -08002084 const u32* pCode /// Binary code of size codeSize
Jesse Halld27f6aa2015-08-15 17:58:48 -07002085}
2086
Jesse Halld27f6aa2015-08-15 17:58:48 -07002087class VkDescriptorSetLayoutBinding {
Jesse Hall091ed9e2015-11-30 00:55:29 -08002088 u32 binding
Jesse Halld27f6aa2015-08-15 17:58:48 -07002089 VkDescriptorType descriptorType /// Type of the descriptors in this binding
Jesse Halldba27f72015-11-30 14:25:46 -08002090 u32 descriptorCount /// Number of descriptors in this binding
Jesse Halld27f6aa2015-08-15 17:58:48 -07002091 VkShaderStageFlags stageFlags /// Shader stages this binding is visible to
2092 const VkSampler* pImmutableSamplers /// Immutable samplers (used if descriptor type is SAMPLER or COMBINED_IMAGE_SAMPLER, is either NULL or contains <count> number of elements)
2093}
2094
2095class VkDescriptorSetLayoutCreateInfo {
2096 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO
2097 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002098 VkDescriptorSetLayoutCreateFlags flags
Jesse Hall03b6fe12015-11-24 12:44:21 -08002099 u32 bindingCount /// Number of bindings in the descriptor set layout
Jesse Hall543a7ff2016-01-08 16:38:30 -08002100 const VkDescriptorSetLayoutBinding* pBindings /// Array of descriptor set layout bindings
Jesse Halld27f6aa2015-08-15 17:58:48 -07002101}
2102
Jesse Hall65ab5522015-11-30 00:07:16 -08002103class VkDescriptorPoolSize {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002104 VkDescriptorType type
Jesse Hall03b6fe12015-11-24 12:44:21 -08002105 u32 descriptorCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002106}
2107
2108class VkDescriptorPoolCreateInfo {
2109 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO
2110 const void* pNext /// Pointer to next structure
Jesse Hallfbf97b02015-11-20 14:17:03 -08002111 VkDescriptorPoolCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002112 u32 maxSets
Jesse Hall65ab5522015-11-30 00:07:16 -08002113 u32 poolSizeCount
2114 const VkDescriptorPoolSize* pPoolSizes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002115}
2116
Jesse Hall3fbc8562015-11-29 22:10:52 -08002117class VkDescriptorSetAllocateInfo {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002118 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO
Jesse Hallfbf97b02015-11-20 14:17:03 -08002119 const void* pNext /// Pointer to next structure
2120 VkDescriptorPool descriptorPool
Jesse Hall03b6fe12015-11-24 12:44:21 -08002121 u32 setCount
Jesse Hallfbf97b02015-11-20 14:17:03 -08002122 const VkDescriptorSetLayout* pSetLayouts
2123}
2124
Jesse Halld27f6aa2015-08-15 17:58:48 -07002125class VkSpecializationMapEntry {
Jesse Hall65ab5522015-11-30 00:07:16 -08002126 u32 constantID /// The SpecConstant ID specified in the BIL
Jesse Halld27f6aa2015-08-15 17:58:48 -07002127 u32 offset /// Offset of the value in the data block
Jesse Hallb00daad2015-11-29 19:46:20 -08002128 platform.size_t size /// Size in bytes of the SpecConstant
Jesse Halld27f6aa2015-08-15 17:58:48 -07002129}
2130
2131class VkSpecializationInfo {
2132 u32 mapEntryCount /// Number of entries in the map
Jesse Hallb00daad2015-11-29 19:46:20 -08002133 const VkSpecializationMapEntry* pMapEntries /// Array of map entries
Jesse Halld27f6aa2015-08-15 17:58:48 -07002134 platform.size_t dataSize /// Size in bytes of pData
2135 const void* pData /// Pointer to SpecConstant data
2136}
2137
2138class VkPipelineShaderStageCreateInfo {
2139 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO
2140 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002141 VkPipelineShaderStageCreateFlags flags
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002142 VkShaderStageFlagBits stage
2143 VkShaderModule module
2144 const char* pName
Jesse Halld27f6aa2015-08-15 17:58:48 -07002145 const VkSpecializationInfo* pSpecializationInfo
2146}
2147
2148class VkComputePipelineCreateInfo {
2149 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO
2150 const void* pNext /// Pointer to next structure
Jesse Halld27f6aa2015-08-15 17:58:48 -07002151 VkPipelineCreateFlags flags /// Pipeline creation flags
Jesse Halla6429252015-11-29 18:59:42 -08002152 VkPipelineShaderStageCreateInfo stage
Jesse Halld27f6aa2015-08-15 17:58:48 -07002153 VkPipelineLayout layout /// Interface layout of the pipeline
2154 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
2155 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
2156}
2157
2158class VkVertexInputBindingDescription {
Jesse Hallb00daad2015-11-29 19:46:20 -08002159 u32 binding /// Vertex buffer binding id
2160 u32 stride /// Distance between vertices in bytes (0 = no advancement)
Jesse Hall65ab5522015-11-30 00:07:16 -08002161 VkVertexInputRate inputRate /// Rate at which binding is incremented
Jesse Halld27f6aa2015-08-15 17:58:48 -07002162}
2163
2164class VkVertexInputAttributeDescription {
Jesse Hallb00daad2015-11-29 19:46:20 -08002165 u32 location /// location of the shader vertex attrib
2166 u32 binding /// Vertex buffer binding id
2167 VkFormat format /// format of source data
2168 u32 offset /// Offset of first element in bytes from base of vertex
Jesse Halld27f6aa2015-08-15 17:58:48 -07002169}
2170
2171class VkPipelineVertexInputStateCreateInfo {
Jesse Hall03b6fe12015-11-24 12:44:21 -08002172 VkStructureType sType /// Should be VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO
2173 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002174 VkPipelineVertexInputStateCreateFlags flags
Jesse Hall03b6fe12015-11-24 12:44:21 -08002175 u32 vertexBindingDescriptionCount /// number of bindings
Jesse Halld27f6aa2015-08-15 17:58:48 -07002176 const VkVertexInputBindingDescription* pVertexBindingDescriptions
Jesse Hall03b6fe12015-11-24 12:44:21 -08002177 u32 vertexAttributeDescriptionCount /// number of attributes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002178 const VkVertexInputAttributeDescription* pVertexAttributeDescriptions
2179}
2180
2181class VkPipelineInputAssemblyStateCreateInfo {
2182 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO
2183 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002184 VkPipelineInputAssemblyStateCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002185 VkPrimitiveTopology topology
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002186 VkBool32 primitiveRestartEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002187}
2188
2189class VkPipelineTessellationStateCreateInfo {
2190 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO
2191 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002192 VkPipelineTessellationStateCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002193 u32 patchControlPoints
2194}
2195
2196class VkPipelineViewportStateCreateInfo {
2197 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO
2198 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002199 VkPipelineViewportStateCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002200 u32 viewportCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002201 const VkViewport* pViewports
2202 u32 scissorCount
2203 const VkRect2D* pScissors
Jesse Halld27f6aa2015-08-15 17:58:48 -07002204}
2205
Jesse Hall3fbc8562015-11-29 22:10:52 -08002206class VkPipelineRasterizationStateCreateInfo {
Jesse Hall65ab5522015-11-30 00:07:16 -08002207 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002208 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08002209 VkPipelineRasterizationStateCreateFlags flags
Jesse Hallae38f732015-11-19 21:32:50 -08002210 VkBool32 depthClampEnable
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002211 VkBool32 rasterizerDiscardEnable
Jesse Hall65ab5522015-11-30 00:07:16 -08002212 VkPolygonMode polygonMode /// optional (GL45)
Jesse Hallc7467b72015-11-29 21:05:26 -08002213 VkCullModeFlags cullMode
Jesse Halld27f6aa2015-08-15 17:58:48 -07002214 VkFrontFace frontFace
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002215 VkBool32 depthBiasEnable
Jesse Halla9bb62b2015-11-21 19:31:56 -08002216 f32 depthBiasConstantFactor
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002217 f32 depthBiasClamp
Jesse Halla9bb62b2015-11-21 19:31:56 -08002218 f32 depthBiasSlopeFactor
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002219 f32 lineWidth
Jesse Halld27f6aa2015-08-15 17:58:48 -07002220}
2221
2222class VkPipelineMultisampleStateCreateInfo {
2223 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO
2224 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002225 VkPipelineMultisampleStateCreateFlags flags
Jesse Hall091ed9e2015-11-30 00:55:29 -08002226 VkSampleCountFlagBits rasterizationSamples /// Number of samples used for rasterization
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002227 VkBool32 sampleShadingEnable /// optional (GL45)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002228 f32 minSampleShading /// optional (GL45)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002229 const VkSampleMask* pSampleMask
Jesse Hallacfa5342015-11-19 21:51:33 -08002230 VkBool32 alphaToCoverageEnable
2231 VkBool32 alphaToOneEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002232}
2233
2234class VkPipelineColorBlendAttachmentState {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002235 VkBool32 blendEnable
Jesse Hall65ab5522015-11-30 00:07:16 -08002236 VkBlendFactor srcColorBlendFactor
2237 VkBlendFactor dstColorBlendFactor
2238 VkBlendOp colorBlendOp
2239 VkBlendFactor srcAlphaBlendFactor
2240 VkBlendFactor dstAlphaBlendFactor
2241 VkBlendOp alphaBlendOp
2242 VkColorComponentFlags colorWriteMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07002243}
2244
2245class VkPipelineColorBlendStateCreateInfo {
2246 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO
2247 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002248 VkPipelineColorBlendStateCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002249 VkBool32 logicOpEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002250 VkLogicOp logicOp
2251 u32 attachmentCount /// # of pAttachments
2252 const VkPipelineColorBlendAttachmentState* pAttachments
Jesse Hallb00daad2015-11-29 19:46:20 -08002253 f32[4] blendConstants
Jesse Halld27f6aa2015-08-15 17:58:48 -07002254}
2255
2256class VkStencilOpState {
Jesse Hall65ab5522015-11-30 00:07:16 -08002257 VkStencilOp failOp
2258 VkStencilOp passOp
2259 VkStencilOp depthFailOp
2260 VkCompareOp compareOp
2261 u32 compareMask
2262 u32 writeMask
2263 u32 reference
Jesse Halld27f6aa2015-08-15 17:58:48 -07002264}
2265
2266class VkPipelineDepthStencilStateCreateInfo {
2267 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO
2268 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002269 VkPipelineDepthStencilStateCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002270 VkBool32 depthTestEnable
2271 VkBool32 depthWriteEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002272 VkCompareOp depthCompareOp
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002273 VkBool32 depthBoundsTestEnable /// optional (depth_bounds_test)
2274 VkBool32 stencilTestEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002275 VkStencilOpState front
2276 VkStencilOpState back
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002277 f32 minDepthBounds
2278 f32 maxDepthBounds
2279}
2280
2281class VkPipelineDynamicStateCreateInfo {
2282 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO
2283 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002284 VkPipelineDynamicStateCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002285 u32 dynamicStateCount
2286 const VkDynamicState* pDynamicStates
Jesse Halld27f6aa2015-08-15 17:58:48 -07002287}
2288
2289class VkGraphicsPipelineCreateInfo {
Jesse Halla6429252015-11-29 18:59:42 -08002290 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO
2291 const void* pNext /// Pointer to next structure
2292 VkPipelineCreateFlags flags /// Pipeline creation flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002293 u32 stageCount
Jesse Halla6429252015-11-29 18:59:42 -08002294 const VkPipelineShaderStageCreateInfo* pStages /// One entry for each active shader stage
Jesse Halld27f6aa2015-08-15 17:58:48 -07002295 const VkPipelineVertexInputStateCreateInfo* pVertexInputState
2296 const VkPipelineInputAssemblyStateCreateInfo* pInputAssemblyState
2297 const VkPipelineTessellationStateCreateInfo* pTessellationState
2298 const VkPipelineViewportStateCreateInfo* pViewportState
Jesse Hall3fbc8562015-11-29 22:10:52 -08002299 const VkPipelineRasterizationStateCreateInfo* pRasterizationState
Jesse Halld27f6aa2015-08-15 17:58:48 -07002300 const VkPipelineMultisampleStateCreateInfo* pMultisampleState
2301 const VkPipelineDepthStencilStateCreateInfo* pDepthStencilState
2302 const VkPipelineColorBlendStateCreateInfo* pColorBlendState
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002303 const VkPipelineDynamicStateCreateInfo* pDynamicState
Jesse Halla6429252015-11-29 18:59:42 -08002304 VkPipelineLayout layout /// Interface layout of the pipeline
Jesse Halld27f6aa2015-08-15 17:58:48 -07002305 VkRenderPass renderPass
2306 u32 subpass
Jesse Halla6429252015-11-29 18:59:42 -08002307 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
2308 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 -07002309}
2310
2311class VkPipelineCacheCreateInfo {
Jesse Hallb00daad2015-11-29 19:46:20 -08002312 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO
2313 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002314 VkPipelineCacheCreateFlags flags
Jesse Hallb00daad2015-11-29 19:46:20 -08002315 platform.size_t initialDataSize /// Size of initial data to populate cache, in bytes
2316 const void* pInitialData /// Initial data to populate cache
Jesse Halld27f6aa2015-08-15 17:58:48 -07002317}
2318
2319class VkPushConstantRange {
2320 VkShaderStageFlags stageFlags /// Which stages use the range
Jesse Hall03b6fe12015-11-24 12:44:21 -08002321 u32 offset /// Start of the range, in bytes
2322 u32 size /// Length of the range, in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002323}
2324
2325class VkPipelineLayoutCreateInfo {
2326 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO
2327 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002328 VkPipelineLayoutCreateFlags flags
Jesse Hall3dd678a2016-01-08 21:52:01 -08002329 u32 descriptorSetCount /// Number of descriptor sets interfaced by the pipeline
Jesse Halld27f6aa2015-08-15 17:58:48 -07002330 const VkDescriptorSetLayout* pSetLayouts /// Array of <setCount> number of descriptor set layout objects defining the layout of the
2331 u32 pushConstantRangeCount /// Number of push-constant ranges used by the pipeline
2332 const VkPushConstantRange* pPushConstantRanges /// Array of pushConstantRangeCount number of ranges used by various shader stages
2333}
2334
2335class VkSamplerCreateInfo {
2336 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO
2337 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002338 VkSamplerCreateFlags flags
Jesse Hall23ff73f2015-11-29 14:36:39 -08002339 VkFilter magFilter /// Filter mode for magnification
2340 VkFilter minFilter /// Filter mode for minifiation
2341 VkSamplerMipmapMode mipmapMode /// Mipmap selection mode
2342 VkSamplerAddressMode addressModeU
2343 VkSamplerAddressMode addressModeV
2344 VkSamplerAddressMode addressModeW
Jesse Halld27f6aa2015-08-15 17:58:48 -07002345 f32 mipLodBias
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002346 VkBool32 anisotropyEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002347 f32 maxAnisotropy
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002348 VkBool32 compareEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002349 VkCompareOp compareOp
2350 f32 minLod
2351 f32 maxLod
2352 VkBorderColor borderColor
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002353 VkBool32 unnormalizedCoordinates
Jesse Halld27f6aa2015-08-15 17:58:48 -07002354}
2355
Jesse Hall3fbc8562015-11-29 22:10:52 -08002356class VkCommandPoolCreateInfo {
2357 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002358 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08002359 VkCommandPoolCreateFlags flags /// Command pool creation flags
Jesse Halla6429252015-11-29 18:59:42 -08002360 u32 queueFamilyIndex
Jesse Halld27f6aa2015-08-15 17:58:48 -07002361}
2362
Jesse Hall3fbc8562015-11-29 22:10:52 -08002363class VkCommandBufferAllocateInfo {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002364 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002365 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08002366 VkCommandPool commandPool
2367 VkCommandBufferLevel level
Jesse Hall3dd678a2016-01-08 21:52:01 -08002368 u32 commandBufferCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002369}
2370
Jesse Hall3dd678a2016-01-08 21:52:01 -08002371class VkCommandBufferInheritanceInfo {
2372 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002373 const void* pNext /// Pointer to next structure
Jesse Halld27f6aa2015-08-15 17:58:48 -07002374 VkRenderPass renderPass /// Render pass for secondary command buffers
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002375 u32 subpass
Jesse Halld27f6aa2015-08-15 17:58:48 -07002376 VkFramebuffer framebuffer /// Framebuffer for secondary command buffers
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002377 VkBool32 occlusionQueryEnable
2378 VkQueryControlFlags queryFlags
2379 VkQueryPipelineStatisticFlags pipelineStatistics
Jesse Halld27f6aa2015-08-15 17:58:48 -07002380}
2381
Jesse Hall3dd678a2016-01-08 21:52:01 -08002382class VkCommandBufferBeginInfo {
2383 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO
2384 const void* pNext /// Pointer to next structure
2385 VkCommandBufferUsageFlags flags /// Command buffer usage flags
2386 const VkCommandBufferInheritanceInfo* pInheritanceInfo
2387}
2388
Jesse Halld27f6aa2015-08-15 17:58:48 -07002389class VkRenderPassBeginInfo {
2390 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO
2391 const void* pNext /// Pointer to next structure
2392 VkRenderPass renderPass
2393 VkFramebuffer framebuffer
2394 VkRect2D renderArea
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002395 u32 clearValueCount
2396 const VkClearValue* pClearValues
Jesse Halld27f6aa2015-08-15 17:58:48 -07002397}
2398
2399@union
2400/// Union allowing specification of floating point, integer, or unsigned integer color data. Actual value selected is based on image/attachment being cleared.
2401class VkClearColorValue {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002402 f32[4] float32
2403 s32[4] int32
2404 u32[4] uint32
Jesse Halld27f6aa2015-08-15 17:58:48 -07002405}
2406
2407class VkClearDepthStencilValue {
2408 f32 depth
2409 u32 stencil
2410}
2411
2412@union
2413/// Union allowing specification of color, depth, and stencil color values. Actual value selected is based on attachment being cleared.
2414class VkClearValue {
2415 VkClearColorValue color
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002416 VkClearDepthStencilValue depthStencil
Jesse Halld27f6aa2015-08-15 17:58:48 -07002417}
2418
Jesse Hallae38f732015-11-19 21:32:50 -08002419class VkClearAttachment {
2420 VkImageAspectFlags aspectMask
2421 u32 colorAttachment
2422 VkClearValue clearValue
2423}
2424
Jesse Halld27f6aa2015-08-15 17:58:48 -07002425class VkAttachmentDescription {
Jesse Halla6429252015-11-29 18:59:42 -08002426 VkAttachmentDescriptionFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002427 VkFormat format
Jesse Hall091ed9e2015-11-30 00:55:29 -08002428 VkSampleCountFlagBits samples
Jesse Halld27f6aa2015-08-15 17:58:48 -07002429 VkAttachmentLoadOp loadOp /// Load op for color or depth data
2430 VkAttachmentStoreOp storeOp /// Store op for color or depth data
2431 VkAttachmentLoadOp stencilLoadOp /// Load op for stencil data
2432 VkAttachmentStoreOp stencilStoreOp /// Store op for stencil data
2433 VkImageLayout initialLayout
2434 VkImageLayout finalLayout
2435}
2436
2437class VkAttachmentReference {
2438 u32 attachment
2439 VkImageLayout layout
2440}
2441
2442class VkSubpassDescription {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002443 VkSubpassDescriptionFlags flags
Jesse Halla6429252015-11-29 18:59:42 -08002444 VkPipelineBindPoint pipelineBindPoint /// Must be VK_PIPELINE_BIND_POINT_GRAPHICS for now
Jesse Hall03b6fe12015-11-24 12:44:21 -08002445 u32 inputAttachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002446 const VkAttachmentReference* pInputAttachments
Jesse Hall03b6fe12015-11-24 12:44:21 -08002447 u32 colorAttachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002448 const VkAttachmentReference* pColorAttachments
2449 const VkAttachmentReference* pResolveAttachments
Jesse Hallc7467b72015-11-29 21:05:26 -08002450 const VkAttachmentReference* pDepthStencilAttachment
Jesse Hall03b6fe12015-11-24 12:44:21 -08002451 u32 preserveAttachmentCount
Jesse Hall3dd678a2016-01-08 21:52:01 -08002452 const u32* pPreserveAttachments
Jesse Halld27f6aa2015-08-15 17:58:48 -07002453}
2454
2455class VkSubpassDependency {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002456 u32 srcSubpass
Jesse Hall3fbc8562015-11-29 22:10:52 -08002457 u32 dstSubpass
Jesse Halld27f6aa2015-08-15 17:58:48 -07002458 VkPipelineStageFlags srcStageMask
Jesse Hall3fbc8562015-11-29 22:10:52 -08002459 VkPipelineStageFlags dstStageMask
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002460 VkAccessFlags srcAccessMask
2461 VkAccessFlags dstAccessMask
Jesse Halldc6d36c2015-11-29 19:12:15 -08002462 VkDependencyFlags dependencyFlags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002463}
2464
2465class VkRenderPassCreateInfo {
2466 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO
2467 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002468 VkRenderPassCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002469 u32 attachmentCount
2470 const VkAttachmentDescription* pAttachments
2471 u32 subpassCount
2472 const VkSubpassDescription* pSubpasses
2473 u32 dependencyCount
2474 const VkSubpassDependency* pDependencies
2475}
2476
2477class VkEventCreateInfo {
2478 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_EVENT_CREATE_INFO
2479 const void* pNext /// Pointer to next structure
2480 VkEventCreateFlags flags /// Event creation flags
2481}
2482
2483class VkFenceCreateInfo {
2484 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_FENCE_CREATE_INFO
2485 const void* pNext /// Pointer to next structure
2486 VkFenceCreateFlags flags /// Fence creation flags
2487}
2488
2489class VkPhysicalDeviceFeatures {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002490 VkBool32 robustBufferAccess /// out of bounds buffer accesses are well defined
2491 VkBool32 fullDrawIndexUint32 /// full 32-bit range of indices for indexed draw calls
2492 VkBool32 imageCubeArray /// image views which are arrays of cube maps
2493 VkBool32 independentBlend /// blending operations are controlled per-attachment
2494 VkBool32 geometryShader /// geometry stage
2495 VkBool32 tessellationShader /// tessellation control and evaluation stage
2496 VkBool32 sampleRateShading /// per-sample shading and interpolation
Jesse Hall3fbc8562015-11-29 22:10:52 -08002497 VkBool32 dualSrcBlend /// blend operations which take two sources
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002498 VkBool32 logicOp /// logic operations
2499 VkBool32 multiDrawIndirect /// multi draw indirect
Jesse Hall543a7ff2016-01-08 16:38:30 -08002500 VkBool32 drawIndirectFirstInstance
Jesse Hallae38f732015-11-19 21:32:50 -08002501 VkBool32 depthClamp /// depth clamping
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002502 VkBool32 depthBiasClamp /// depth bias clamping
2503 VkBool32 fillModeNonSolid /// point and wireframe fill modes
2504 VkBool32 depthBounds /// depth bounds test
2505 VkBool32 wideLines /// lines with width greater than 1
2506 VkBool32 largePoints /// points with size greater than 1
Jesse Hallfbf97b02015-11-20 14:17:03 -08002507 VkBool32 alphaToOne /// The fragment alpha channel can be forced to maximum representable alpha value
2508 VkBool32 multiViewport
2509 VkBool32 samplerAnisotropy
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002510 VkBool32 textureCompressionETC2 /// ETC texture compression formats
2511 VkBool32 textureCompressionASTC_LDR /// ASTC LDR texture compression formats
2512 VkBool32 textureCompressionBC /// BC1-7 texture compressed formats
Jesse Hall65ab5522015-11-30 00:07:16 -08002513 VkBool32 occlusionQueryPrecise
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002514 VkBool32 pipelineStatisticsQuery /// pipeline statistics query
Jesse Halldc6d36c2015-11-29 19:12:15 -08002515 VkBool32 vertexPipelineStoresAndAtomics
2516 VkBool32 fragmentStoresAndAtomics
2517 VkBool32 shaderTessellationAndGeometryPointSize
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002518 VkBool32 shaderImageGatherExtended /// texture gather with run-time values and independent offsets
2519 VkBool32 shaderStorageImageExtendedFormats /// the extended set of formats can be used for storage images
2520 VkBool32 shaderStorageImageMultisample /// multisample images can be used for storage images
Jesse Halld1af8122015-11-29 23:50:38 -08002521 VkBool32 shaderStorageImageReadWithoutFormat
2522 VkBool32 shaderStorageImageWriteWithoutFormat
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002523 VkBool32 shaderUniformBufferArrayDynamicIndexing /// arrays of uniform buffers can be accessed with dynamically uniform indices
2524 VkBool32 shaderSampledImageArrayDynamicIndexing /// arrays of sampled images can be accessed with dynamically uniform indices
2525 VkBool32 shaderStorageBufferArrayDynamicIndexing /// arrays of storage buffers can be accessed with dynamically uniform indices
2526 VkBool32 shaderStorageImageArrayDynamicIndexing /// arrays of storage images can be accessed with dynamically uniform indices
2527 VkBool32 shaderClipDistance /// clip distance in shaders
2528 VkBool32 shaderCullDistance /// cull distance in shaders
2529 VkBool32 shaderFloat64 /// 64-bit floats (doubles) in shaders
2530 VkBool32 shaderInt64 /// 64-bit integers in shaders
2531 VkBool32 shaderInt16 /// 16-bit integers in shaders
2532 VkBool32 shaderResourceResidency /// shader can use texture operations that return resource residency information (requires sparseNonResident support)
Jesse Hall65ab5522015-11-30 00:07:16 -08002533 VkBool32 shaderResourceMinLod /// shader can use texture operations that specify minimum resource LOD
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002534 VkBool32 sparseBinding /// Sparse resources support: Resource memory can be managed at opaque page level rather than object level
2535 VkBool32 sparseResidencyBuffer /// Sparse resources support: GPU can access partially resident buffers
2536 VkBool32 sparseResidencyImage2D /// Sparse resources support: GPU can access partially resident 2D (non-MSAA non-DepthStencil) images
2537 VkBool32 sparseResidencyImage3D /// Sparse resources support: GPU can access partially resident 3D images
2538 VkBool32 sparseResidency2Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 2 samples
2539 VkBool32 sparseResidency4Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 4 samples
2540 VkBool32 sparseResidency8Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 8 samples
2541 VkBool32 sparseResidency16Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 16 samples
2542 VkBool32 sparseResidencyAliased /// Sparse resources support: GPU can correctly access data aliased into multiple locations (opt-in)
Jesse Halld1af8122015-11-29 23:50:38 -08002543 VkBool32 variableMultisampleRate
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002544 VkBool32 inheritedQueries
Jesse Halld27f6aa2015-08-15 17:58:48 -07002545}
2546
2547class VkPhysicalDeviceLimits {
2548 /// resource maximum sizes
2549 u32 maxImageDimension1D /// max 1D image dimension
2550 u32 maxImageDimension2D /// max 2D image dimension
2551 u32 maxImageDimension3D /// max 3D image dimension
2552 u32 maxImageDimensionCube /// max cubemap image dimension
2553 u32 maxImageArrayLayers /// max layers for image arrays
Jesse Hallb00daad2015-11-29 19:46:20 -08002554 u32 maxTexelBufferElements
Jesse Hallfbf97b02015-11-20 14:17:03 -08002555 u32 maxUniformBufferRange /// max uniform buffer size (bytes)
2556 u32 maxStorageBufferRange /// max storage buffer size (bytes)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002557 u32 maxPushConstantsSize /// max size of the push constants pool (bytes)
2558 /// memory limits
2559 u32 maxMemoryAllocationCount /// max number of device memory allocations supported
Jesse Hall091ed9e2015-11-30 00:55:29 -08002560 u32 maxSamplerAllocationCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002561 VkDeviceSize bufferImageGranularity /// Granularity (in bytes) at which buffers and images can be bound to adjacent memory for simultaneous usage
2562 VkDeviceSize sparseAddressSpaceSize /// Total address space available for sparse allocations (bytes)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002563 /// descriptor set limits
2564 u32 maxBoundDescriptorSets /// max number of descriptors sets that can be bound to a pipeline
Jesse Halld27f6aa2015-08-15 17:58:48 -07002565 u32 maxPerStageDescriptorSamplers /// max num of samplers allowed per-stage in a descriptor set
2566 u32 maxPerStageDescriptorUniformBuffers /// max num of uniform buffers allowed per-stage in a descriptor set
2567 u32 maxPerStageDescriptorStorageBuffers /// max num of storage buffers allowed per-stage in a descriptor set
2568 u32 maxPerStageDescriptorSampledImages /// max num of sampled images allowed per-stage in a descriptor set
2569 u32 maxPerStageDescriptorStorageImages /// max num of storage images allowed per-stage in a descriptor set
Jesse Halle1b12782015-11-30 11:27:32 -08002570 u32 maxPerStageDescriptorInputAttachments
Jesse Halldba27f72015-11-30 14:25:46 -08002571 u32 maxPerStageResources
Jesse Halld27f6aa2015-08-15 17:58:48 -07002572 u32 maxDescriptorSetSamplers /// max num of samplers allowed in all stages in a descriptor set
2573 u32 maxDescriptorSetUniformBuffers /// max num of uniform buffers allowed in all stages in a descriptor set
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002574 u32 maxDescriptorSetUniformBuffersDynamic /// max num of dynamic uniform buffers allowed in all stages in a descriptor set
Jesse Halld27f6aa2015-08-15 17:58:48 -07002575 u32 maxDescriptorSetStorageBuffers /// max num of storage buffers allowed in all stages in a descriptor set
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002576 u32 maxDescriptorSetStorageBuffersDynamic /// max num of dynamic storage buffers allowed in all stages in a descriptor set
Jesse Halld27f6aa2015-08-15 17:58:48 -07002577 u32 maxDescriptorSetSampledImages /// max num of sampled images allowed in all stages in a descriptor set
2578 u32 maxDescriptorSetStorageImages /// max num of storage images allowed in all stages in a descriptor set
Jesse Halle1b12782015-11-30 11:27:32 -08002579 u32 maxDescriptorSetInputAttachments
Jesse Halld27f6aa2015-08-15 17:58:48 -07002580 /// vertex stage limits
2581 u32 maxVertexInputAttributes /// max num of vertex input attribute slots
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002582 u32 maxVertexInputBindings /// max num of vertex input binding slots
Jesse Halld27f6aa2015-08-15 17:58:48 -07002583 u32 maxVertexInputAttributeOffset /// max vertex input attribute offset added to vertex buffer offset
2584 u32 maxVertexInputBindingStride /// max vertex input binding stride
2585 u32 maxVertexOutputComponents /// max num of output components written by vertex shader
2586 /// tessellation control stage limits
Jesse Hall3fbc8562015-11-29 22:10:52 -08002587 u32 maxTessellationGenerationLevel /// max level supported by tess primitive generator
Jesse Hallae38f732015-11-19 21:32:50 -08002588 u32 maxTessellationPatchSize /// max patch size (vertices)
2589 u32 maxTessellationControlPerVertexInputComponents /// max num of input components per-vertex in TCS
2590 u32 maxTessellationControlPerVertexOutputComponents /// max num of output components per-vertex in TCS
2591 u32 maxTessellationControlPerPatchOutputComponents /// max num of output components per-patch in TCS
2592 u32 maxTessellationControlTotalOutputComponents /// max total num of per-vertex and per-patch output components in TCS
2593 u32 maxTessellationEvaluationInputComponents /// max num of input components per vertex in TES
2594 u32 maxTessellationEvaluationOutputComponents /// max num of output components per vertex in TES
Jesse Halld27f6aa2015-08-15 17:58:48 -07002595 /// geometry stage limits
2596 u32 maxGeometryShaderInvocations /// max invocation count supported in geometry shader
2597 u32 maxGeometryInputComponents /// max num of input components read in geometry stage
2598 u32 maxGeometryOutputComponents /// max num of output components written in geometry stage
2599 u32 maxGeometryOutputVertices /// max num of vertices that can be emitted in geometry stage
2600 u32 maxGeometryTotalOutputComponents /// max total num of components (all vertices) written in geometry stage
2601 /// fragment stage limits
2602 u32 maxFragmentInputComponents /// max num of input compontents read in fragment stage
Jesse Hallfbf97b02015-11-20 14:17:03 -08002603 u32 maxFragmentOutputAttachments /// max num of output attachments written in fragment stage
Jesse Hall3fbc8562015-11-29 22:10:52 -08002604 u32 maxFragmentDualSrcAttachments /// max num of output attachments written when using dual source blending
Jesse Halld27f6aa2015-08-15 17:58:48 -07002605 u32 maxFragmentCombinedOutputResources /// max total num of storage buffers, storage images and output buffers
2606 /// compute stage limits
2607 u32 maxComputeSharedMemorySize /// max total storage size of work group local storage (bytes)
2608 u32[3] maxComputeWorkGroupCount /// max num of compute work groups that may be dispatched by a single command (x,y,z)
2609 u32 maxComputeWorkGroupInvocations /// max total compute invocations in a single local work group
2610 u32[3] maxComputeWorkGroupSize /// max local size of a compute work group (x,y,z)
2611
2612 u32 subPixelPrecisionBits /// num bits of subpixel precision in screen x and y
2613 u32 subTexelPrecisionBits /// num bits of subtexel precision
2614 u32 mipmapPrecisionBits /// num bits of mipmap precision
2615
2616 u32 maxDrawIndexedIndexValue /// max index value for indexed draw calls (for 32-bit indices)
Jesse Halldba27f72015-11-30 14:25:46 -08002617 u32 maxDrawIndirectCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002618
2619 f32 maxSamplerLodBias /// max absolute sampler level of detail bias
2620 f32 maxSamplerAnisotropy /// max degree of sampler anisotropy
2621
2622 u32 maxViewports /// max number of active viewports
Jesse Halld27f6aa2015-08-15 17:58:48 -07002623 u32[2] maxViewportDimensions /// max viewport dimensions (x,y)
2624 f32[2] viewportBoundsRange /// viewport bounds range (min,max)
2625 u32 viewportSubPixelBits /// num bits of subpixel precision for viewport
2626
Jesse Halldc6d36c2015-11-29 19:12:15 -08002627 platform.size_t minMemoryMapAlignment /// min required alignment of pointers returned by MapMemory (bytes)
2628 VkDeviceSize minTexelBufferOffsetAlignment /// min required alignment for texel buffer offsets (bytes)
2629 VkDeviceSize minUniformBufferOffsetAlignment /// min required alignment for uniform buffer sizes and offsets (bytes)
2630 VkDeviceSize minStorageBufferOffsetAlignment /// min required alignment for storage buffer offsets (bytes)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002631
Jesse Hallfbf97b02015-11-20 14:17:03 -08002632 s32 minTexelOffset /// min texel offset for OpTextureSampleOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07002633 u32 maxTexelOffset /// max texel offset for OpTextureSampleOffset
Jesse Hallfbf97b02015-11-20 14:17:03 -08002634 s32 minTexelGatherOffset /// min texel offset for OpTextureGatherOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07002635 u32 maxTexelGatherOffset /// max texel offset for OpTextureGatherOffset
2636 f32 minInterpolationOffset /// furthest negative offset for interpolateAtOffset
2637 f32 maxInterpolationOffset /// furthest positive offset for interpolateAtOffset
2638 u32 subPixelInterpolationOffsetBits /// num of subpixel bits for interpolateAtOffset
2639
2640 u32 maxFramebufferWidth /// max width for a framebuffer
2641 u32 maxFramebufferHeight /// max height for a framebuffer
2642 u32 maxFramebufferLayers /// max layer count for a layered framebuffer
Jesse Hall091ed9e2015-11-30 00:55:29 -08002643 VkSampleCountFlags framebufferColorSampleCounts
2644 VkSampleCountFlags framebufferDepthSampleCounts
2645 VkSampleCountFlags framebufferStencilSampleCounts
2646 VkSampleCountFlags framebufferNoAttachmentSampleCounts
Jesse Halld27f6aa2015-08-15 17:58:48 -07002647 u32 maxColorAttachments /// max num of framebuffer color attachments
2648
Jesse Hall091ed9e2015-11-30 00:55:29 -08002649 VkSampleCountFlags sampledImageColorSampleCounts
2650 VkSampleCountFlags sampledImageIntegerSampleCounts
2651 VkSampleCountFlags sampledImageDepthSampleCounts
2652 VkSampleCountFlags sampledImageStencilSampleCounts
2653 VkSampleCountFlags storageImageSampleCounts
Jesse Halld27f6aa2015-08-15 17:58:48 -07002654 u32 maxSampleMaskWords /// max num of sample mask words
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002655 VkBool32 timestampComputeAndGraphics
Jesse Halld27f6aa2015-08-15 17:58:48 -07002656
Jesse Halla9bb62b2015-11-21 19:31:56 -08002657 f32 timestampPeriod
Jesse Halld27f6aa2015-08-15 17:58:48 -07002658
2659 u32 maxClipDistances /// max number of clip distances
2660 u32 maxCullDistances /// max number of cull distances
2661 u32 maxCombinedClipAndCullDistances /// max combined number of user clipping
2662
Jesse Hallfbf97b02015-11-20 14:17:03 -08002663 u32 discreteQueuePriorities
2664
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002665 f32[2] pointSizeRange /// range (min,max) of supported point sizes
2666 f32[2] lineWidthRange /// range (min,max) of supported line widths
Jesse Halld27f6aa2015-08-15 17:58:48 -07002667 f32 pointSizeGranularity /// granularity of supported point sizes
2668 f32 lineWidthGranularity /// granularity of supported line widths
Jesse Hall03b6fe12015-11-24 12:44:21 -08002669 VkBool32 strictLines
Jesse Hall091ed9e2015-11-30 00:55:29 -08002670 VkBool32 standardSampleLocations
Jesse Halla9bb62b2015-11-21 19:31:56 -08002671
Jesse Hall65ab5522015-11-30 00:07:16 -08002672 VkDeviceSize optimalBufferCopyOffsetAlignment
2673 VkDeviceSize optimalBufferCopyRowPitchAlignment
Jesse Halldba27f72015-11-30 14:25:46 -08002674 VkDeviceSize nonCoherentAtomSize
Jesse Halld27f6aa2015-08-15 17:58:48 -07002675}
2676
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002677class VkPhysicalDeviceSparseProperties {
2678 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 -08002679 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 -07002680 VkBool32 residencyStandard3DBlockShape /// Sparse resources support: GPU will access all 3D sparse resources using the standard block shapes (based on pixel format)
2681 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 -07002682 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
2683}
2684
Jesse Halld27f6aa2015-08-15 17:58:48 -07002685class VkSemaphoreCreateInfo {
2686 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO
2687 const void* pNext /// Pointer to next structure
2688 VkSemaphoreCreateFlags flags /// Semaphore creation flags
2689}
2690
2691class VkQueryPoolCreateInfo {
2692 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO
2693 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002694 VkQueryPoolCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002695 VkQueryType queryType
Jesse Hall3dd678a2016-01-08 21:52:01 -08002696 u32 queryCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002697 VkQueryPipelineStatisticFlags pipelineStatistics /// Optional
2698}
2699
2700class VkFramebufferCreateInfo {
2701 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO
2702 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002703 VkFramebufferCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002704 VkRenderPass renderPass
2705 u32 attachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002706 const VkImageView* pAttachments
Jesse Halld27f6aa2015-08-15 17:58:48 -07002707 u32 width
2708 u32 height
2709 u32 layers
2710}
2711
Jesse Hall3fbc8562015-11-29 22:10:52 -08002712class VkDrawIndirectCommand {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002713 u32 vertexCount
2714 u32 instanceCount
2715 u32 firstVertex
2716 u32 firstInstance
2717}
2718
Jesse Hall3fbc8562015-11-29 22:10:52 -08002719class VkDrawIndexedIndirectCommand {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002720 u32 indexCount
2721 u32 instanceCount
2722 u32 firstIndex
2723 s32 vertexOffset
2724 u32 firstInstance
2725}
2726
Jesse Hall3fbc8562015-11-29 22:10:52 -08002727class VkDispatchIndirectCommand {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002728 u32 x
2729 u32 y
2730 u32 z
2731}
2732
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002733@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08002734class VkSurfaceCapabilitiesKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002735 u32 minImageCount
2736 u32 maxImageCount
2737 VkExtent2D currentExtent
2738 VkExtent2D minImageExtent
2739 VkExtent2D maxImageExtent
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002740 u32 maxImageArrayLayers
Jesse Hall1356b0d2015-11-23 17:24:58 -08002741 VkSurfaceTransformFlagsKHR supportedTransforms
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002742 VkSurfaceTransformFlagBitsKHR currentTransform
Jesse Halla6429252015-11-29 18:59:42 -08002743 VkCompositeAlphaFlagsKHR supportedCompositeAlpha
Jesse Hall1356b0d2015-11-23 17:24:58 -08002744 VkImageUsageFlags supportedUsageFlags
Michael Lentine88594d72015-11-12 12:49:45 -08002745}
2746
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002747@extension("VK_KHR_surface")
Michael Lentine88594d72015-11-12 12:49:45 -08002748class VkSurfaceFormatKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002749 VkFormat format
2750 VkColorSpaceKHR colorSpace
Michael Lentine88594d72015-11-12 12:49:45 -08002751}
2752
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002753@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08002754class VkSwapchainCreateInfoKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002755 VkStructureType sType
2756 const void* pNext
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002757 VkSwapchainCreateFlagsKHR flags
Jesse Hall1356b0d2015-11-23 17:24:58 -08002758 VkSurfaceKHR surface
2759 u32 minImageCount
2760 VkFormat imageFormat
2761 VkColorSpaceKHR imageColorSpace
2762 VkExtent2D imageExtent
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002763 u32 imageArrayLayers
2764 VkImageUsageFlags imageUsage
Jesse Hall1356b0d2015-11-23 17:24:58 -08002765 VkSharingMode sharingMode
Jesse Hall03b6fe12015-11-24 12:44:21 -08002766 u32 queueFamilyIndexCount
Jesse Hall1356b0d2015-11-23 17:24:58 -08002767 const u32* pQueueFamilyIndices
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002768 VkSurfaceTransformFlagBitsKHR preTransform
2769 VkCompositeAlphaFlagBitsKHR compositeAlpha
Jesse Hall1356b0d2015-11-23 17:24:58 -08002770 VkPresentModeKHR presentMode
Jesse Hall1356b0d2015-11-23 17:24:58 -08002771 VkBool32 clipped
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002772 VkSwapchainKHR oldSwapchain
Michael Lentine88594d72015-11-12 12:49:45 -08002773}
2774
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002775@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08002776class VkPresentInfoKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002777 VkStructureType sType
2778 const void* pNext
Jesse Hallb00daad2015-11-29 19:46:20 -08002779 u32 waitSemaphoreCount
2780 const VkSemaphore* pWaitSemaphores
Jesse Hall1356b0d2015-11-23 17:24:58 -08002781 u32 swapchainCount
Jesse Hall03b6fe12015-11-24 12:44:21 -08002782 const VkSwapchainKHR* pSwapchains
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002783 const u32* pImageIndices
Jesse Halle1b12782015-11-30 11:27:32 -08002784 VkResult* pResults
Michael Lentine88594d72015-11-12 12:49:45 -08002785}
2786
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002787@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002788class VkDisplayPropertiesKHR {
2789 VkDisplayKHR display
2790 const char* displayName
2791 VkExtent2D physicalDimensions
2792 VkExtent2D physicalResolution
2793 VkSurfaceTransformFlagsKHR supportedTransforms
Jesse Hall1356b0d2015-11-23 17:24:58 -08002794 VkBool32 planeReorderPossible
Jesse Halla6429252015-11-29 18:59:42 -08002795 VkBool32 persistentContent
Michael Lentine88594d72015-11-12 12:49:45 -08002796}
2797
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002798@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08002799class VkDisplayModeParametersKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002800 VkExtent2D visibleRegion
Jesse Halla6429252015-11-29 18:59:42 -08002801 u32 refreshRate
Michael Lentine88594d72015-11-12 12:49:45 -08002802}
Jesse Halld27f6aa2015-08-15 17:58:48 -07002803
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002804@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002805class VkDisplayModePropertiesKHR {
2806 VkDisplayModeKHR displayMode
Jesse Halla6429252015-11-29 18:59:42 -08002807 VkDisplayModeParametersKHR parameters
Jesse Hall1356b0d2015-11-23 17:24:58 -08002808}
2809
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002810@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002811class VkDisplayModeCreateInfoKHR {
2812 VkStructureType sType
2813 const void* pNext
Jesse Hall9ba8bc82015-11-30 16:22:16 -08002814 VkDisplayModeCreateFlagsKHR flags
Jesse Halla6429252015-11-29 18:59:42 -08002815 VkDisplayModeParametersKHR parameters
Jesse Hall1356b0d2015-11-23 17:24:58 -08002816}
2817
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002818@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002819class VkDisplayPlanePropertiesKHR {
Jesse Halla6429252015-11-29 18:59:42 -08002820 VkDisplayKHR currentDisplay
2821 u32 currentStackIndex
2822}
2823
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002824@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08002825class VkDisplayPlaneCapabilitiesKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002826 VkDisplayPlaneAlphaFlagsKHR supportedAlpha
2827 VkOffset2D minSrcPosition
2828 VkOffset2D maxSrcPosition
2829 VkExtent2D minSrcExtent
2830 VkExtent2D maxSrcExtent
2831 VkOffset2D minDstPosition
2832 VkOffset2D maxDstPosition
2833 VkExtent2D minDstExtent
2834 VkExtent2D maxDstExtent
2835}
2836
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002837@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08002838class VkDisplaySurfaceCreateInfoKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002839 VkStructureType sType
2840 const void* pNext
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002841 VkDisplaySurfaceCreateFlagsKHR flags
Jesse Hall1356b0d2015-11-23 17:24:58 -08002842 VkDisplayModeKHR displayMode
2843 u32 planeIndex
2844 u32 planeStackIndex
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002845 VkSurfaceTransformFlagBitsKHR transform
Jesse Hall1356b0d2015-11-23 17:24:58 -08002846 f32 globalAlpha
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002847 VkDisplayPlaneAlphaFlagBitsKHR alphaMode
2848 VkExtent2D imageExtent
Jesse Hall1356b0d2015-11-23 17:24:58 -08002849}
2850
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002851@extension("VK_KHR_display_swapchain")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002852class VkDisplayPresentInfoKHR {
2853 VkStructureType sType
2854 const void* pNext
2855 VkRect2D srcRect
2856 VkRect2D dstRect
Jesse Halla6429252015-11-29 18:59:42 -08002857 VkBool32 persistent
Jesse Hall1356b0d2015-11-23 17:24:58 -08002858}
2859
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002860@extension("VK_KHR_xlib_surface")
2861class VkXlibSurfaceCreateInfoKHR {
2862 VkStructureType sType
2863 const void* pNext
2864 VkXlibSurfaceCreateFlagsKHR flags
2865 platform.Display* dpy
2866 platform.Window window
2867}
2868
2869@extension("VK_KHR_xcb_surface")
2870class VkXcbSurfaceCreateInfoKHR {
2871 VkStructureType sType
2872 const void* pNext
2873 VkXcbSurfaceCreateFlagsKHR flags
2874 platform.xcb_connection_t* connection
2875 platform.xcb_window_t window
2876}
2877
2878@extension("VK_KHR_wayland_surface")
2879class VkWaylandSurfaceCreateInfoKHR {
2880 VkStructureType sType
2881 const void* pNext
2882 VkWaylandSurfaceCreateFlagsKHR flags
2883 platform.wl_display* display
2884 platform.wl_surface* surface
2885}
2886
2887@extension("VK_KHR_mir_surface")
2888class VkMirSurfaceCreateInfoKHR {
2889 VkStructureType sType
2890 const void* pNext
2891 VkMirSurfaceCreateFlagsKHR flags
2892 platform.MirConnection* connection
2893 platform.MirSurface* mirSurface
2894}
2895
2896@extension("VK_KHR_android_surface")
2897class VkAndroidSurfaceCreateInfoKHR {
2898 VkStructureType sType
2899 const void* pNext
2900 VkAndroidSurfaceCreateFlagsKHR flags
2901 platform.ANativeWindow* window
2902}
2903
2904@extension("VK_KHR_win32_surface")
2905class VkWin32SurfaceCreateInfoKHR {
2906 VkStructureType sType
2907 const void* pNext
2908 VkWin32SurfaceCreateFlagsKHR flags
2909 platform.HINSTANCE hinstance
2910 platform.HWND hwnd
2911}
2912
Jesse Halld1abd742017-02-09 21:45:51 -08002913@internal class Gralloc1Usage {
2914 u64 consumer
2915 u64 producer
2916}
2917
Chia-I Wub262ddc2016-03-22 07:38:20 +08002918@extension("VK_ANDROID_native_buffer")
2919class VkNativeBufferANDROID {
2920 VkStructureType sType
2921 const void* pNext
2922 platform.buffer_handle_t handle
Jesse Halld1abd742017-02-09 21:45:51 -08002923 s32 stride
2924 s32 format
2925 s32 usage
2926 Gralloc1Usage usage2
Chia-I Wub262ddc2016-03-22 07:38:20 +08002927}
2928
Chris Forbes8e4438b2016-12-07 16:26:49 +13002929@extension("VK_ANDROID_native_buffer")
2930class VkSwapchainImageCreateInfoANDROID {
2931 VkStructureType sType
2932 const void* pNext
Chris Forbes134d9582017-01-12 14:26:37 +13002933 VkSwapchainImageUsageFlagsANDROID flags
Chris Forbes48853712017-01-12 14:09:33 +13002934}
Ian Elliott4c8bb2a2016-12-29 11:07:26 -07002935
2936@extension("VK_GOOGLE_display_timing")
2937class VkRefreshCycleDurationGOOGLE {
Chris Forbes48853712017-01-12 14:09:33 +13002938 u64 minRefreshDuration
2939 u64 maxRefreshDuration
Ian Elliott4c8bb2a2016-12-29 11:07:26 -07002940}
2941
2942@extension("VK_GOOGLE_display_timing")
2943class VkPastPresentationTimingGOOGLE {
Chris Forbes48853712017-01-12 14:09:33 +13002944 u32 presentID
2945 u64 desiredPresentTime
2946 u64 actualPresentTime
2947 u64 earliestPresentTime
2948 u64 presentMargin
Ian Elliott4c8bb2a2016-12-29 11:07:26 -07002949}
2950
2951@extension("VK_GOOGLE_display_timing")
2952class VkPresentTimeGOOGLE {
Chris Forbes48853712017-01-12 14:09:33 +13002953 u32 presentID
2954 u64 desiredPresentTime
Ian Elliott4c8bb2a2016-12-29 11:07:26 -07002955}
2956
2957@extension("VK_GOOGLE_display_timing")
2958class VkPresentTimesInfoGOOGLE {
2959 VkStructureType sType
2960 const void* pNext
Chris Forbes48853712017-01-12 14:09:33 +13002961 u32 swapchainCount
Ian Elliott4c8bb2a2016-12-29 11:07:26 -07002962 const VkPresentTimeGOOGLE* pTimes
Chris Forbes8e4438b2016-12-07 16:26:49 +13002963}
2964
Jesse Hall715b86a2016-01-16 16:34:29 -08002965@extension("VK_EXT_debug_report")
2966class VkDebugReportCallbackCreateInfoEXT {
2967 VkStructureType sType
2968 const void* pNext
2969 VkDebugReportFlagsEXT flags
2970 PFN_vkDebugReportCallbackEXT pfnCallback
2971 void* pUserData
2972}
2973
Jesse Hall26763382016-05-20 07:13:52 -07002974@extension("VK_AMD_rasterization_order")
2975class VkPipelineRasterizationStateRasterizationOrderAMD {
2976 VkStructureType sType
2977 const void* pNext
2978 VkRasterizationOrderAMD rasterizationOrder
2979}
2980
2981@extension("VK_EXT_debug_marker")
2982class VkDebugMarkerObjectNameInfoEXT {
2983 VkStructureType sType
2984 const void* pNext
2985 VkDebugReportObjectTypeEXT objectType
2986 u64 object
2987 const char* pObjectName
2988}
2989
2990@extension("VK_EXT_debug_marker")
2991class VkDebugMarkerObjectTagInfoEXT {
2992 VkStructureType sType
2993 const void* pNext
2994 VkDebugReportObjectTypeEXT objectType
2995 u64 object
2996 u64 tagName
2997 platform.size_t tagSize
2998 const void* pTag
2999}
3000
3001@extension("VK_EXT_debug_marker")
3002class VkDebugMarkerMarkerInfoEXT {
3003 VkStructureType sType
3004 const void* pNext
3005 const char* pMarkerName
3006 f32[4] color
3007}
3008
Jesse Hall56d386a2016-07-26 15:20:40 -07003009@extension("VK_NV_dedicated_allocation")
3010class VkDedicatedAllocationImageCreateInfoNV {
3011 VkStructureType sType
3012 const void* pNext
3013 VkBool32 dedicatedAllocation
3014}
3015
3016@extension("VK_NV_dedicated_allocation")
3017class VkDedicatedAllocationBufferCreateInfoNV {
3018 VkStructureType sType
3019 const void* pNext
3020 VkBool32 dedicatedAllocation
3021}
3022
3023@extension("VK_NV_dedicated_allocation")
3024class VkDedicatedAllocationMemoryAllocateInfoNV {
3025 VkStructureType sType
3026 const void* pNext
3027 VkImage image
3028 VkBuffer buffer
3029}
3030
Chris Forbes1194ede2016-12-30 16:29:25 +13003031@extension("VK_KHR_get_physical_device_properties2")
3032class VkPhysicalDeviceFeatures2KHR {
3033 VkStructureType sType
3034 void* pNext
3035 VkPhysicalDeviceFeatures features
3036}
3037
3038@extension("VK_KHR_get_physical_device_properties2")
3039class VkPhysicalDeviceProperties2KHR {
3040 VkStructureType sType
3041 void* pNext
3042 VkPhysicalDeviceProperties properties
3043}
3044
3045@extension("VK_KHR_get_physical_device_properties2")
3046class VkFormatProperties2KHR {
3047 VkStructureType sType
3048 void* pNext
3049 VkFormatProperties formatProperties
3050}
3051
3052@extension("VK_KHR_get_physical_device_properties2")
3053class VkImageFormatProperties2KHR {
3054 VkStructureType sType
3055 void* pNext
3056 VkImageFormatProperties imageFormatProperties
3057}
3058
3059@extension("VK_KHR_get_physical_device_properties2")
3060class VkPhysicalDeviceImageFormatInfo2KHR {
3061 VkStructureType sType
3062 const void* pNext
3063 VkFormat format
3064 VkImageType type
3065 VkImageTiling tiling
3066 VkImageUsageFlags usage
3067 VkImageCreateFlags flags
3068}
3069
3070@extension("VK_KHR_get_physical_device_properties2")
3071class VkQueueFamilyProperties2KHR {
3072 VkStructureType sType
3073 void* pNext
3074 VkQueueFamilyProperties queueFamilyProperties
3075}
3076
3077@extension("VK_KHR_get_physical_device_properties2")
3078class VkPhysicalDeviceMemoryProperties2KHR {
3079 VkStructureType sType
3080 void* pNext
3081 VkPhysicalDeviceMemoryProperties memoryProperties
3082}
3083
3084@extension("VK_KHR_get_physical_device_properties2")
3085class VkSparseImageFormatProperties2KHR {
3086 VkStructureType sType
3087 void* pNext
3088 VkSparseImageFormatProperties properties
3089}
3090
3091@extension("VK_KHR_get_physical_device_properties2")
3092class VkPhysicalDeviceSparseImageFormatInfo2KHR {
3093 VkStructureType sType
3094 const void* pNext
3095 VkFormat format
3096 VkImageType type
3097 VkSampleCountFlagBits samples
3098 VkImageUsageFlags usage
3099 VkImageTiling tiling
3100}
3101
Chris Forbes289cb792016-12-30 15:03:55 +13003102@extension("VK_KHR_incremental_present")
3103class VkRectLayerKHR {
3104 VkOffset2D offset
3105 VkExtent2D extent
3106 u32 layer
3107}
3108
3109@extension("VK_KHR_incremental_present")
3110class VkPresentRegionKHR {
3111 u32 rectangleCount
3112 const VkRectLayerKHR* pRectangles
3113}
3114
3115@extension("VK_KHR_incremental_present")
3116class VkPresentRegionsKHR {
3117 VkStructureType sType
3118 const void* pNext
3119 u32 swapchainCount
3120 const VkPresentRegionKHR* pRegions
3121}
3122
3123@extension("VK_NV_external_memory_capabilities")
3124class VkExternalImageFormatPropertiesNV {
3125 VkImageFormatProperties imageFormatProperties
3126 VkExternalMemoryFeatureFlagsNV externalMemoryFeatures
3127 VkExternalMemoryHandleTypeFlagsNV exportFromImportedHandleTypes
3128 VkExternalMemoryHandleTypeFlagsNV compatibleHandleTypes
3129}
3130
3131@extension("VK_NV_external_memory")
3132class VkExternalMemoryImageCreateInfoNV {
3133 VkStructureType sType
3134 const void* pNext
3135 VkExternalMemoryHandleTypeFlagsNV handleTypes
3136}
3137
3138@extension("VK_NV_external_memory")
3139class VkExportMemoryAllocateInfoNV {
3140 VkStructureType sType
3141 const void* pNext
3142 VkExternalMemoryHandleTypeFlagsNV handleTypes
3143}
3144
3145@extension("VK_NV_external_memory_win32")
3146class VkImportMemoryWin32HandleInfoNV {
3147 VkStructureType sType
3148 const void* pNext
3149 VkExternalMemoryHandleTypeFlagsNV handleType
3150 platform.HANDLE handle
3151}
3152
3153@extension("VK_NV_external_memory_win32")
3154class VkExportMemoryWin32HandleInfoNV {
3155 VkStructureType sType
3156 const void* pNext
3157 const platform.SECURITY_ATTRIBUTES* pAttributes
3158 u32 dwAccess
3159}
3160
3161@extension("VK_NV_win32_keyed_mutex")
3162class VkWin32KeyedMutexAcquireReleaseInfoNV {
3163 VkStructureType sType
3164 const void* pNext
3165 u32 acquireCount
3166 const VkDeviceMemory* pAcquireSyncs
3167 const u64* pAcquireKeys
3168 const u32* pAcquireTimeoutMilliseconds
3169 u32 releaseCount
3170 const VkDeviceMemory* pReleaseSyncs
3171 const u64* pReleaseKeys
3172}
3173
3174@extension("VK_EXT_validation_flags")
3175class VkValidationFlagsEXT {
3176 VkStructureType sType
3177 const void* pNext
3178 u32 disabledValidationCheckCount
3179 VkValidationCheckEXT* pDisabledValidationChecks
3180}
3181
3182@extension("VK_NVX_device_generated_commands")
3183class VkDeviceGeneratedCommandsFeaturesNVX {
3184 VkStructureType sType
3185 const void* pNext
3186 VkBool32 computeBindingPointSupport
3187}
3188
3189@extension("VK_NVX_device_generated_commands")
3190class VkDeviceGeneratedCommandsLimitsNVX {
3191 VkStructureType sType
3192 const void* pNext
3193 u32 maxIndirectCommandsLayoutTokenCount
3194 u32 maxObjectEntryCounts
3195 u32 minSequenceCountBufferOffsetAlignment
3196 u32 minSequenceIndexBufferOffsetAlignment
3197 u32 minCommandsTokenBufferOffsetAlignment
3198}
3199
3200@extension("VK_NVX_device_generated_commands")
3201class VkIndirectCommandsTokenNVX {
3202 VkIndirectCommandsTokenTypeNVX tokenType
3203 VkBuffer buffer
3204 VkDeviceSize offset
3205}
3206
3207@extension("VK_NVX_device_generated_commands")
3208class VkIndirectCommandsLayoutTokenNVX {
3209 VkIndirectCommandsTokenTypeNVX tokenType
3210 u32 bindingUnit
3211 u32 dynamicCount
3212 u32 divisor
3213}
3214
3215@extension("VK_NVX_device_generated_commands")
3216class VkIndirectCommandsLayoutCreateInfoNVX {
3217 VkStructureType sType
3218 const void* pNext
3219 VkPipelineBindPoint pipelineBindPoint
3220 VkIndirectCommandsLayoutUsageFlagsNVX flags
3221 u32 tokenCount
3222 const VkIndirectCommandsLayoutTokenNVX* pTokens
3223}
3224
3225@extension("VK_NVX_device_generated_commands")
3226class VkCmdProcessCommandsInfoNVX {
3227 VkStructureType sType
3228 const void* pNext
3229 VkObjectTableNVX objectTable
3230 VkIndirectCommandsLayoutNVX indirectCommandsLayout
3231 u32 indirectCommandsTokenCount
3232 const VkIndirectCommandsTokenNVX* pIndirectCommandsTokens
3233 u32 maxSequencesCount
3234 VkCommandBuffer targetCommandBuffer
3235 VkBuffer sequencesCountBuffer
3236 VkDeviceSize sequencesCountOffset
3237 VkBuffer sequencesIndexBuffer
3238 VkDeviceSize sequencesIndexOffset
3239}
3240
3241@extension("VK_NVX_device_generated_commands")
3242class VkCmdReserveSpaceForCommandsInfoNVX {
3243 VkStructureType sType
3244 const void* pNext
3245 VkObjectTableNVX objectTable
3246 VkIndirectCommandsLayoutNVX indirectCommandsLayout
3247 u32 maxSequencesCount
3248}
3249
3250@extension("VK_NVX_device_generated_commands")
3251class VkObjectTableCreateInfoNVX {
3252 VkStructureType sType
3253 const void* pNext
3254 u32 objectCount
3255 const VkObjectEntryTypeNVX* pObjectEntryTypes
3256 const u32* pObjectEntryCounts
3257 const VkObjectEntryUsageFlagsNVX* pObjectEntryUsageFlags
3258 u32 maxUniformBuffersPerDescriptor
3259 u32 maxStorageBuffersPerDescriptor
3260 u32 maxStorageImagesPerDescriptor
3261 u32 maxSampledImagesPerDescriptor
3262 u32 maxPipelineLayouts
3263}
3264
3265@extension("VK_NVX_device_generated_commands")
3266class VkObjectTableEntryNVX {
3267 VkObjectEntryTypeNVX type
3268 VkObjectEntryUsageFlagsNVX flags
3269}
3270
3271@extension("VK_NVX_device_generated_commands")
3272class VkObjectTablePipelineEntryNVX {
3273 VkObjectEntryTypeNVX type
3274 VkObjectEntryUsageFlagsNVX flags
3275 VkPipeline pipeline
3276}
3277
3278@extension("VK_NVX_device_generated_commands")
3279class VkObjectTableDescriptorSetEntryNVX {
3280 VkObjectEntryTypeNVX type
3281 VkObjectEntryUsageFlagsNVX flags
3282 VkPipelineLayout pipelineLayout
3283 VkDescriptorSet descriptorSet
3284}
3285
3286@extension("VK_NVX_device_generated_commands")
3287class VkObjectTableVertexBufferEntryNVX {
3288 VkObjectEntryTypeNVX type
3289 VkObjectEntryUsageFlagsNVX flags
3290 VkBuffer buffer
3291}
3292
3293@extension("VK_NVX_device_generated_commands")
3294class VkObjectTableIndexBufferEntryNVX {
3295 VkObjectEntryTypeNVX type
3296 VkObjectEntryUsageFlagsNVX flags
3297 VkBuffer buffer
3298}
3299
3300@extension("VK_NVX_device_generated_commands")
3301class VkObjectTablePushConstantEntryNVX {
3302 VkObjectEntryTypeNVX type
3303 VkObjectEntryUsageFlagsNVX flags
3304 VkPipelineLayout pipelineLayout
3305 VkShaderStageFlags stageFlags
3306}
3307
Courtney Goeltzenleuchterd634c482017-01-05 15:55:31 -07003308@extension("VK_EXT_hdr_metadata")
3309class VkXYColorEXT {
3310 f32 x
3311 f32 y
3312}
3313
3314@extension("VK_EXT_hdr_metadata")
3315class VkHdrMetadataEXT {
3316 VkXYColorEXT displayPrimaryRed
3317 VkXYColorEXT displayPrimaryGreen
3318 VkXYColorEXT displayPrimaryBlue
3319 VkXYColorEXT whitePoint
3320 f32 maxLuminance
3321 f32 minLuminance
3322 f32 maxContentLightLevel
3323 f32 maxFrameAverageLightLevel
3324}
3325
Chris Forbes289cb792016-12-30 15:03:55 +13003326
Jesse Hall1356b0d2015-11-23 17:24:58 -08003327
Jesse Halld27f6aa2015-08-15 17:58:48 -07003328////////////////
3329// Commands //
3330////////////////
3331
3332// Function pointers. TODO: add support for function pointers.
3333
3334@external type void* PFN_vkVoidFunction
3335@pfn cmd void vkVoidFunction() {
3336}
3337
Jesse Hall3fbc8562015-11-29 22:10:52 -08003338@external type void* PFN_vkAllocationFunction
3339@pfn cmd void* vkAllocationFunction(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003340 void* pUserData,
3341 platform.size_t size,
3342 platform.size_t alignment,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003343 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08003344 return ?
3345}
3346
Jesse Hall3fbc8562015-11-29 22:10:52 -08003347@external type void* PFN_vkReallocationFunction
3348@pfn cmd void* vkReallocationFunction(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003349 void* pUserData,
3350 void* pOriginal,
3351 platform.size_t size,
3352 platform.size_t alignment,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003353 VkSystemAllocationScope allocationScope) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003354 return ?
3355}
3356
3357@external type void* PFN_vkFreeFunction
3358@pfn cmd void vkFreeFunction(
3359 void* pUserData,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003360 void* pMemory) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003361}
3362
Jesse Hall3fbc8562015-11-29 22:10:52 -08003363@external type void* PFN_vkInternalAllocationNotification
3364@pfn cmd void vkInternalAllocationNotification(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003365 void* pUserData,
3366 platform.size_t size,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003367 VkInternalAllocationType allocationType,
3368 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08003369}
3370
3371@external type void* PFN_vkInternalFreeNotification
3372@pfn cmd void vkInternalFreeNotification(
3373 void* pUserData,
3374 platform.size_t size,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003375 VkInternalAllocationType allocationType,
3376 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08003377}
Jesse Halld27f6aa2015-08-15 17:58:48 -07003378
3379// Global functions
3380
3381@threadSafety("system")
3382cmd VkResult vkCreateInstance(
3383 const VkInstanceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003384 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003385 VkInstance* pInstance) {
3386 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO)
3387
3388 instance := ?
3389 pInstance[0] = instance
3390 State.Instances[instance] = new!InstanceObject()
3391
Jesse Hall3dd678a2016-01-08 21:52:01 -08003392 layers := pCreateInfo.ppEnabledLayerNames[0:pCreateInfo.enabledLayerCount]
3393 extensions := pCreateInfo.ppEnabledExtensionNames[0:pCreateInfo.enabledExtensionCount]
Jesse Halld27f6aa2015-08-15 17:58:48 -07003394
3395 return ?
3396}
3397
3398@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003399cmd void vkDestroyInstance(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003400 VkInstance instance,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003401 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003402 instanceObject := GetInstance(instance)
3403
3404 State.Instances[instance] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003405}
3406
3407@threadSafety("system")
3408cmd VkResult vkEnumeratePhysicalDevices(
3409 VkInstance instance,
3410 u32* pPhysicalDeviceCount,
3411 VkPhysicalDevice* pPhysicalDevices) {
3412 instanceObject := GetInstance(instance)
3413
3414 physicalDeviceCount := as!u32(?)
3415 pPhysicalDeviceCount[0] = physicalDeviceCount
3416 physicalDevices := pPhysicalDevices[0:physicalDeviceCount]
3417
3418 for i in (0 .. physicalDeviceCount) {
3419 physicalDevice := ?
3420 physicalDevices[i] = physicalDevice
3421 if !(physicalDevice in State.PhysicalDevices) {
3422 State.PhysicalDevices[physicalDevice] = new!PhysicalDeviceObject(instance: instance)
3423 }
3424 }
3425
3426 return ?
3427}
3428
3429cmd PFN_vkVoidFunction vkGetDeviceProcAddr(
3430 VkDevice device,
3431 const char* pName) {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003432 if device != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003433 device := GetDevice(device)
3434 }
3435
3436 return ?
3437}
3438
3439cmd PFN_vkVoidFunction vkGetInstanceProcAddr(
3440 VkInstance instance,
3441 const char* pName) {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003442 if instance != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003443 instanceObject := GetInstance(instance)
3444 }
3445
3446 return ?
3447}
3448
Jesse Hall606a54e2015-11-19 22:17:28 -08003449cmd void vkGetPhysicalDeviceProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003450 VkPhysicalDevice physicalDevice,
3451 VkPhysicalDeviceProperties* pProperties) {
3452 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3453
3454 properties := ?
3455 pProperties[0] = properties
Jesse Halld27f6aa2015-08-15 17:58:48 -07003456}
3457
Jesse Hall606a54e2015-11-19 22:17:28 -08003458cmd void vkGetPhysicalDeviceQueueFamilyProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003459 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003460 u32* pQueueFamilyPropertyCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003461 VkQueueFamilyProperties* pQueueFamilyProperties) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003462 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003463 // TODO: Figure out how to express fetch-count-or-properties
3464 // This version fails 'apic validate' with 'fence not allowed in
3465 // *semantic.Branch'. Other attempts have failed with the same or other
3466 // errors.
3467 // if pQueueFamilyProperties != null {
3468 // queuesProperties := pQueueFamilyProperties[0:pCount[0]]
3469 // for i in (0 .. pCount[0]) {
3470 // queueProperties := as!VkQueueFamilyProperties(?)
3471 // queuesProperties[i] = queueProperties
3472 // }
3473 // } else {
3474 // count := ?
3475 // pCount[0] = count
3476 // }
Jesse Halld27f6aa2015-08-15 17:58:48 -07003477}
3478
Jesse Hall606a54e2015-11-19 22:17:28 -08003479cmd void vkGetPhysicalDeviceMemoryProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003480 VkPhysicalDevice physicalDevice,
3481 VkPhysicalDeviceMemoryProperties* pMemoryProperties) {
3482 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3483
3484 memoryProperties := ?
3485 pMemoryProperties[0] = memoryProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07003486}
3487
Jesse Hall606a54e2015-11-19 22:17:28 -08003488cmd void vkGetPhysicalDeviceFeatures(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003489 VkPhysicalDevice physicalDevice,
3490 VkPhysicalDeviceFeatures* pFeatures) {
3491 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3492
3493 features := ?
3494 pFeatures[0] = features
Jesse Halld27f6aa2015-08-15 17:58:48 -07003495}
3496
Jesse Hall606a54e2015-11-19 22:17:28 -08003497cmd void vkGetPhysicalDeviceFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003498 VkPhysicalDevice physicalDevice,
3499 VkFormat format,
3500 VkFormatProperties* pFormatProperties) {
3501 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3502
3503 formatProperties := ?
3504 pFormatProperties[0] = formatProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07003505}
3506
Jesse Halla9e57032015-11-30 01:03:10 -08003507cmd VkResult vkGetPhysicalDeviceImageFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003508 VkPhysicalDevice physicalDevice,
3509 VkFormat format,
3510 VkImageType type,
3511 VkImageTiling tiling,
3512 VkImageUsageFlags usage,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003513 VkImageCreateFlags flags,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003514 VkImageFormatProperties* pImageFormatProperties) {
3515 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3516
3517 imageFormatProperties := ?
3518 pImageFormatProperties[0] = imageFormatProperties
Jesse Halla9e57032015-11-30 01:03:10 -08003519
3520 return ?
Jesse Halld27f6aa2015-08-15 17:58:48 -07003521}
3522
Jesse Halld27f6aa2015-08-15 17:58:48 -07003523
3524// Device functions
3525
3526@threadSafety("system")
3527cmd VkResult vkCreateDevice(
3528 VkPhysicalDevice physicalDevice,
3529 const VkDeviceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003530 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003531 VkDevice* pDevice) {
3532 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO)
3533 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3534
3535 device := ?
3536 pDevice[0] = device
3537 State.Devices[device] = new!DeviceObject(physicalDevice: physicalDevice)
3538
3539 return ?
3540}
3541
3542@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003543cmd void vkDestroyDevice(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003544 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003545 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003546 deviceObject := GetDevice(device)
3547
3548 State.Devices[device] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003549}
3550
3551
3552// Extension discovery functions
3553
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003554cmd VkResult vkEnumerateInstanceLayerProperties(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003555 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003556 VkLayerProperties* pProperties) {
3557 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08003558 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07003559
3560 properties := pProperties[0:count]
3561 for i in (0 .. count) {
3562 property := ?
3563 properties[i] = property
3564 }
3565
3566 return ?
3567}
3568
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003569cmd VkResult vkEnumerateInstanceExtensionProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003570 const char* pLayerName,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003571 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003572 VkExtensionProperties* pProperties) {
3573 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08003574 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07003575
3576 properties := pProperties[0:count]
3577 for i in (0 .. count) {
3578 property := ?
3579 properties[i] = property
3580 }
3581
3582 return ?
3583}
3584
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003585cmd VkResult vkEnumerateDeviceLayerProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003586 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003587 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003588 VkLayerProperties* pProperties) {
3589 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3590 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08003591 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07003592
3593 properties := pProperties[0:count]
3594 for i in (0 .. count) {
3595 property := ?
3596 properties[i] = property
3597 }
3598
3599 return ?
3600}
3601
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003602cmd VkResult vkEnumerateDeviceExtensionProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003603 VkPhysicalDevice physicalDevice,
3604 const char* pLayerName,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003605 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003606 VkExtensionProperties* pProperties) {
3607 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3608
3609 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08003610 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07003611
3612 properties := pProperties[0:count]
3613 for i in (0 .. count) {
3614 property := ?
3615 properties[i] = property
3616 }
3617
3618 return ?
3619}
3620
3621
3622// Queue functions
3623
3624@threadSafety("system")
Jesse Hall606a54e2015-11-19 22:17:28 -08003625cmd void vkGetDeviceQueue(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003626 VkDevice device,
3627 u32 queueFamilyIndex,
3628 u32 queueIndex,
3629 VkQueue* pQueue) {
3630 deviceObject := GetDevice(device)
3631
3632 queue := ?
3633 pQueue[0] = queue
3634
3635 if !(queue in State.Queues) {
3636 State.Queues[queue] = new!QueueObject(device: device)
3637 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07003638}
3639
3640@threadSafety("app")
3641cmd VkResult vkQueueSubmit(
3642 VkQueue queue,
Jesse Halla366a512015-11-19 22:30:07 -08003643 u32 submitCount,
Jesse Hallb00daad2015-11-29 19:46:20 -08003644 const VkSubmitInfo* pSubmits,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003645 VkFence fence) {
3646 queueObject := GetQueue(queue)
3647
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003648 if fence != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003649 fenceObject := GetFence(fence)
3650 assert(fenceObject.device == queueObject.device)
3651 }
3652
Jesse Hall3fbc8562015-11-29 22:10:52 -08003653 // commandBuffers := pcommandBuffers[0:commandBufferCount]
3654 // for i in (0 .. commandBufferCount) {
3655 // commandBuffer := commandBuffers[i]
3656 // commandBufferObject := GetCommandBuffer(commandBuffer)
3657 // assert(commandBufferObject.device == queueObject.device)
Jesse Halla366a512015-11-19 22:30:07 -08003658 //
Jesse Hall3fbc8562015-11-29 22:10:52 -08003659 // validate("QueueCheck", commandBufferObject.queueFlags in queueObject.flags,
3660 // "vkQueueSubmit: enqueued commandBuffer requires missing queue capabilities.")
Jesse Halla366a512015-11-19 22:30:07 -08003661 // }
Jesse Halld27f6aa2015-08-15 17:58:48 -07003662
3663 return ?
3664}
3665
3666@threadSafety("system")
3667cmd VkResult vkQueueWaitIdle(
3668 VkQueue queue) {
3669 queueObject := GetQueue(queue)
3670
3671 return ?
3672}
3673
3674@threadSafety("system")
3675cmd VkResult vkDeviceWaitIdle(
3676 VkDevice device) {
3677 deviceObject := GetDevice(device)
3678
3679 return ?
3680}
3681
3682
3683// Memory functions
3684
3685@threadSafety("system")
Jesse Hall3fbc8562015-11-29 22:10:52 -08003686cmd VkResult vkAllocateMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003687 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003688 const VkMemoryAllocateInfo* pAllocateInfo,
3689 const VkAllocationCallbacks* pAllocator,
3690 VkDeviceMemory* pMemory) {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08003691 assert(pAllocateInfo.sType == VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003692 deviceObject := GetDevice(device)
3693
Jesse Hall3fbc8562015-11-29 22:10:52 -08003694 memory := ?
3695 pMemory[0] = memory
3696 State.DeviceMemories[memory] = new!DeviceMemoryObject(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003697 device: device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003698 allocationSize: pAllocateInfo[0].allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003699
3700 return ?
3701}
3702
3703@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003704cmd void vkFreeMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003705 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003706 VkDeviceMemory memory,
3707 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003708 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003709 memoryObject := GetDeviceMemory(memory)
3710 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003711
3712 // Check that no objects are still bound before freeing.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003713 validate("MemoryCheck", len(memoryObject.boundObjects) == 0,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003714 "vkFreeMemory: objects still bound")
Jesse Hall3fbc8562015-11-29 22:10:52 -08003715 validate("MemoryCheck", len(memoryObject.boundCommandBuffers) == 0,
3716 "vkFreeMemory: commandBuffers still bound")
3717 State.DeviceMemories[memory] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003718}
3719
3720@threadSafety("app")
3721cmd VkResult vkMapMemory(
3722 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003723 VkDeviceMemory memory,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003724 VkDeviceSize offset,
3725 VkDeviceSize size,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003726 VkMemoryMapFlags flags,
3727 void** ppData) {
3728 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003729 memoryObject := GetDeviceMemory(memory)
3730 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003731
3732 assert(flags == as!VkMemoryMapFlags(0))
Jesse Hall3fbc8562015-11-29 22:10:52 -08003733 assert((offset + size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003734
3735 return ?
3736}
3737
3738@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003739cmd void vkUnmapMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003740 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003741 VkDeviceMemory memory) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003742 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003743 memoryObject := GetDeviceMemory(memory)
3744 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003745}
3746
3747cmd VkResult vkFlushMappedMemoryRanges(
3748 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003749 u32 memoryRangeCount
3750 const VkMappedMemoryRange* pMemoryRanges) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003751 deviceObject := GetDevice(device)
3752
Jesse Hall3fbc8562015-11-29 22:10:52 -08003753 memoryRanges := pMemoryRanges[0:memoryRangeCount]
3754 for i in (0 .. memoryRangeCount) {
3755 memoryRange := memoryRanges[i]
3756 memoryObject := GetDeviceMemory(memoryRange.memory)
3757 assert(memoryObject.device == device)
3758 assert((memoryRange.offset + memoryRange.size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003759 }
3760
3761 return ?
3762}
3763
3764cmd VkResult vkInvalidateMappedMemoryRanges(
3765 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003766 u32 memoryRangeCount,
3767 const VkMappedMemoryRange* pMemoryRanges) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003768 deviceObject := GetDevice(device)
3769
Jesse Hall3fbc8562015-11-29 22:10:52 -08003770 memoryRanges := pMemoryRanges[0:memoryRangeCount]
3771 for i in (0 .. memoryRangeCount) {
3772 memoryRange := memoryRanges[i]
3773 memoryObject := GetDeviceMemory(memoryRange.memory)
3774 assert(memoryObject.device == device)
3775 assert((memoryRange.offset + memoryRange.size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003776 }
3777
3778 return ?
3779}
3780
3781
3782// Memory management API functions
3783
Jesse Hall606a54e2015-11-19 22:17:28 -08003784cmd void vkGetDeviceMemoryCommitment(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003785 VkDevice device,
3786 VkDeviceMemory memory,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003787 VkDeviceSize* pCommittedMemoryInBytes) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003788 deviceObject := GetDevice(device)
3789
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003790 if memory != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003791 memoryObject := GetDeviceMemory(memory)
3792 assert(memoryObject.device == device)
3793 }
3794
3795 committedMemoryInBytes := ?
3796 pCommittedMemoryInBytes[0] = committedMemoryInBytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07003797}
3798
Jesse Hall606a54e2015-11-19 22:17:28 -08003799cmd void vkGetBufferMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003800 VkDevice device,
3801 VkBuffer buffer,
3802 VkMemoryRequirements* pMemoryRequirements) {
3803 deviceObject := GetDevice(device)
3804 bufferObject := GetBuffer(buffer)
3805 assert(bufferObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003806}
3807
3808cmd VkResult vkBindBufferMemory(
3809 VkDevice device,
3810 VkBuffer buffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003811 VkDeviceMemory memory,
3812 VkDeviceSize memoryOffset) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003813 deviceObject := GetDevice(device)
3814 bufferObject := GetBuffer(buffer)
3815 assert(bufferObject.device == device)
3816
3817 // Unbind buffer from previous memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003818 if bufferObject.memory != NULL_HANDLE {
3819 memoryObject := GetDeviceMemory(bufferObject.memory)
3820 memoryObject.boundObjects[as!u64(buffer)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003821 }
3822
3823 // Bind buffer to given memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003824 if memory != NULL_HANDLE {
3825 memoryObject := GetDeviceMemory(memory)
3826 assert(memoryObject.device == device)
3827 memoryObject.boundObjects[as!u64(buffer)] = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003828 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08003829 bufferObject.memory = memory
3830 bufferObject.memoryOffset = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003831
3832 return ?
3833}
3834
Jesse Hall606a54e2015-11-19 22:17:28 -08003835cmd void vkGetImageMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003836 VkDevice device,
3837 VkImage image,
3838 VkMemoryRequirements* pMemoryRequirements) {
3839 deviceObject := GetDevice(device)
3840 imageObject := GetImage(image)
3841 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003842}
3843
3844cmd VkResult vkBindImageMemory(
3845 VkDevice device,
3846 VkImage image,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003847 VkDeviceMemory memory,
3848 VkDeviceSize memoryOffset) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003849 deviceObject := GetDevice(device)
3850 imageObject := GetImage(image)
3851 assert(imageObject.device == device)
3852
3853 // Unbind image from previous memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003854 if imageObject.memory != NULL_HANDLE {
3855 memoryObject := GetDeviceMemory(imageObject.memory)
3856 memoryObject.boundObjects[as!u64(image)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003857 }
3858
3859 // Bind image to given memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003860 if memory != NULL_HANDLE {
3861 memoryObject := GetDeviceMemory(memory)
3862 assert(memoryObject.device == device)
3863 memoryObject.boundObjects[as!u64(image)] = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003864 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08003865 imageObject.memory = memory
3866 imageObject.memoryOffset = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003867
3868 return ?
3869}
3870
Jesse Hall606a54e2015-11-19 22:17:28 -08003871cmd void vkGetImageSparseMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003872 VkDevice device,
3873 VkImage image,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003874 u32* pSparseMemoryRequirementCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003875 VkSparseImageMemoryRequirements* pSparseMemoryRequirements) {
3876 deviceObject := GetDevice(device)
3877 imageObject := GetImage(image)
3878 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003879}
3880
Jesse Hall606a54e2015-11-19 22:17:28 -08003881cmd void vkGetPhysicalDeviceSparseImageFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003882 VkPhysicalDevice physicalDevice,
3883 VkFormat format,
3884 VkImageType type,
Jesse Hall091ed9e2015-11-30 00:55:29 -08003885 VkSampleCountFlagBits samples,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003886 VkImageUsageFlags usage,
3887 VkImageTiling tiling,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003888 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003889 VkSparseImageFormatProperties* pProperties) {
3890 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003891}
3892
Jesse Halla6429252015-11-29 18:59:42 -08003893cmd VkResult vkQueueBindSparse(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003894 VkQueue queue,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003895 u32 bindInfoCount,
Jesse Halla6429252015-11-29 18:59:42 -08003896 const VkBindSparseInfo* pBindInfo,
3897 VkFence fence) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003898 queueObject := GetQueue(queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003899
3900 return ?
3901}
3902
3903
3904// Fence functions
3905
3906@threadSafety("system")
3907cmd VkResult vkCreateFence(
3908 VkDevice device,
3909 const VkFenceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003910 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003911 VkFence* pFence) {
3912 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_FENCE_CREATE_INFO)
3913 deviceObject := GetDevice(device)
3914
3915 fence := ?
3916 pFence[0] = fence
3917 State.Fences[fence] = new!FenceObject(
Jesse Halld8bade02015-11-24 10:24:18 -08003918 device: device, signaled: (pCreateInfo.flags == as!VkFenceCreateFlags(VK_FENCE_CREATE_SIGNALED_BIT)))
Jesse Halld27f6aa2015-08-15 17:58:48 -07003919
3920 return ?
3921}
3922
3923@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003924cmd void vkDestroyFence(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003925 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003926 VkFence fence,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003927 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003928 deviceObject := GetDevice(device)
3929 fenceObject := GetFence(fence)
3930 assert(fenceObject.device == device)
3931
3932 State.Fences[fence] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003933}
3934
3935@threadSafety("system")
3936cmd VkResult vkResetFences(
3937 VkDevice device,
3938 u32 fenceCount,
3939 const VkFence* pFences) {
3940 deviceObject := GetDevice(device)
3941
3942 fences := pFences[0:fenceCount]
3943 for i in (0 .. fenceCount) {
3944 fence := fences[i]
3945 fenceObject := GetFence(fence)
3946 assert(fenceObject.device == device)
3947 fenceObject.signaled = false
3948 }
3949
3950 return ?
3951}
3952
3953@threadSafety("system")
3954cmd VkResult vkGetFenceStatus(
3955 VkDevice device,
3956 VkFence fence) {
3957 deviceObject := GetDevice(device)
3958 fenceObject := GetFence(fence)
3959 assert(fenceObject.device == device)
3960
3961 return ?
3962}
3963
3964@threadSafety("system")
3965cmd VkResult vkWaitForFences(
3966 VkDevice device,
3967 u32 fenceCount,
3968 const VkFence* pFences,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003969 VkBool32 waitAll,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003970 u64 timeout) { /// timeout in nanoseconds
3971 deviceObject := GetDevice(device)
3972
3973 fences := pFences[0:fenceCount]
3974 for i in (0 .. fenceCount) {
3975 fence := fences[i]
3976 fenceObject := GetFence(fence)
3977 assert(fenceObject.device == device)
3978 }
3979
3980 return ?
3981}
3982
3983
3984// Queue semaphore functions
3985
3986@threadSafety("system")
3987cmd VkResult vkCreateSemaphore(
3988 VkDevice device,
3989 const VkSemaphoreCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003990 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003991 VkSemaphore* pSemaphore) {
3992 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO)
3993 deviceObject := GetDevice(device)
3994
3995 semaphore := ?
3996 pSemaphore[0] = semaphore
3997 State.Semaphores[semaphore] = new!SemaphoreObject(device: device)
3998
3999 return ?
4000}
4001
4002@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004003cmd void vkDestroySemaphore(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004004 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004005 VkSemaphore semaphore,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004006 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004007 deviceObject := GetDevice(device)
4008 semaphoreObject := GetSemaphore(semaphore)
4009 assert(semaphoreObject.device == device)
4010
4011 State.Semaphores[semaphore] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004012}
4013
Jesse Halld27f6aa2015-08-15 17:58:48 -07004014
4015// Event functions
4016
4017@threadSafety("system")
4018cmd VkResult vkCreateEvent(
4019 VkDevice device,
4020 const VkEventCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004021 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004022 VkEvent* pEvent) {
4023 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_EVENT_CREATE_INFO)
4024 deviceObject := GetDevice(device)
4025
4026 event := ?
4027 pEvent[0] = event
4028 State.Events[event] = new!EventObject(device: device)
4029
4030 return ?
4031}
4032
4033@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004034cmd void vkDestroyEvent(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004035 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004036 VkEvent event,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004037 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004038 deviceObject := GetDevice(device)
4039 eventObject := GetEvent(event)
4040 assert(eventObject.device == device)
4041
4042 State.Events[event] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004043}
4044
4045@threadSafety("system")
4046cmd VkResult vkGetEventStatus(
4047 VkDevice device,
4048 VkEvent event) {
4049 deviceObject := GetDevice(device)
4050 eventObject := GetEvent(event)
4051 assert(eventObject.device == device)
4052
4053 return ?
4054}
4055
4056@threadSafety("system")
4057cmd VkResult vkSetEvent(
4058 VkDevice device,
4059 VkEvent event) {
4060 deviceObject := GetDevice(device)
4061 eventObject := GetEvent(event)
4062 assert(eventObject.device == device)
4063
4064 return ?
4065}
4066
4067@threadSafety("system")
4068cmd VkResult vkResetEvent(
4069 VkDevice device,
4070 VkEvent event) {
4071 deviceObject := GetDevice(device)
4072 eventObject := GetEvent(event)
4073 assert(eventObject.device == device)
4074
4075 return ?
4076}
4077
4078
4079// Query functions
4080
4081@threadSafety("system")
4082cmd VkResult vkCreateQueryPool(
4083 VkDevice device,
4084 const VkQueryPoolCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004085 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004086 VkQueryPool* pQueryPool) {
4087 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO)
4088 deviceObject := GetDevice(device)
4089
4090 queryPool := ?
4091 pQueryPool[0] = queryPool
4092 State.QueryPools[queryPool] = new!QueryPoolObject(device: device)
4093
4094 return ?
4095}
4096
4097@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004098cmd void vkDestroyQueryPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004099 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004100 VkQueryPool queryPool,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004101 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004102 deviceObject := GetDevice(device)
4103 queryPoolObject := GetQueryPool(queryPool)
4104 assert(queryPoolObject.device == device)
4105
4106 State.QueryPools[queryPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004107}
4108
4109@threadSafety("system")
4110cmd VkResult vkGetQueryPoolResults(
4111 VkDevice device,
4112 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004113 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004114 u32 queryCount,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004115 platform.size_t dataSize,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004116 void* pData,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004117 VkDeviceSize stride,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004118 VkQueryResultFlags flags) {
4119 deviceObject := GetDevice(device)
4120 queryPoolObject := GetQueryPool(queryPool)
4121 assert(queryPoolObject.device == device)
4122
Jesse Halld27f6aa2015-08-15 17:58:48 -07004123 data := pData[0:dataSize]
4124
4125 return ?
4126}
4127
4128// Buffer functions
4129
4130@threadSafety("system")
4131cmd VkResult vkCreateBuffer(
4132 VkDevice device,
4133 const VkBufferCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004134 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004135 VkBuffer* pBuffer) {
4136 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO)
4137 deviceObject := GetDevice(device)
4138
4139 buffer := ?
4140 pBuffer[0] = buffer
4141 State.Buffers[buffer] = new!BufferObject(device: device)
4142
4143 return ?
4144}
4145
4146@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004147cmd void vkDestroyBuffer(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004148 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004149 VkBuffer buffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004150 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004151 deviceObject := GetDevice(device)
4152 bufferObject := GetBuffer(buffer)
4153 assert(bufferObject.device == device)
4154
Jesse Hall3fbc8562015-11-29 22:10:52 -08004155 assert(bufferObject.memory == 0)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004156 State.Buffers[buffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004157}
4158
4159
4160// Buffer view functions
4161
4162@threadSafety("system")
4163cmd VkResult vkCreateBufferView(
4164 VkDevice device,
4165 const VkBufferViewCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004166 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004167 VkBufferView* pView) {
4168 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO)
4169 deviceObject := GetDevice(device)
4170
4171 bufferObject := GetBuffer(pCreateInfo.buffer)
4172 assert(bufferObject.device == device)
4173
4174 view := ?
4175 pView[0] = view
4176 State.BufferViews[view] = new!BufferViewObject(device: device, buffer: pCreateInfo.buffer)
4177
4178 return ?
4179}
4180
4181@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004182cmd void vkDestroyBufferView(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004183 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004184 VkBufferView bufferView,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004185 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004186 deviceObject := GetDevice(device)
4187 bufferViewObject := GetBufferView(bufferView)
4188 assert(bufferViewObject.device == device)
4189
4190 State.BufferViews[bufferView] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004191}
4192
4193
4194// Image functions
4195
4196@threadSafety("system")
4197cmd VkResult vkCreateImage(
4198 VkDevice device,
4199 const VkImageCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004200 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004201 VkImage* pImage) {
4202 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO)
4203 deviceObject := GetDevice(device)
4204
4205 image := ?
4206 pImage[0] = image
4207 State.Images[image] = new!ImageObject(device: device)
4208
4209 return ?
4210}
4211
4212@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004213cmd void vkDestroyImage(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004214 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004215 VkImage image,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004216 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004217 deviceObject := GetDevice(device)
4218 imageObject := GetImage(image)
4219 assert(imageObject.device == device)
4220
Jesse Hall3fbc8562015-11-29 22:10:52 -08004221 assert(imageObject.memory == 0)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004222 State.Images[image] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004223}
4224
Jesse Hall606a54e2015-11-19 22:17:28 -08004225cmd void vkGetImageSubresourceLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004226 VkDevice device,
4227 VkImage image,
4228 const VkImageSubresource* pSubresource,
4229 VkSubresourceLayout* pLayout) {
4230 deviceObject := GetDevice(device)
4231 imageObject := GetImage(image)
4232 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004233}
4234
4235
4236// Image view functions
4237
4238@threadSafety("system")
4239cmd VkResult vkCreateImageView(
4240 VkDevice device,
4241 const VkImageViewCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004242 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004243 VkImageView* pView) {
4244 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO)
4245 deviceObject := GetDevice(device)
4246
4247 imageObject := GetImage(pCreateInfo.image)
4248 assert(imageObject.device == device)
4249
4250 view := ?
4251 pView[0] = view
4252 State.ImageViews[view] = new!ImageViewObject(device: device, image: pCreateInfo.image)
4253
4254 return ?
4255}
4256
4257@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004258cmd void vkDestroyImageView(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004259 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004260 VkImageView imageView,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004261 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004262 deviceObject := GetDevice(device)
4263 imageViewObject := GetImageView(imageView)
4264 assert(imageViewObject.device == device)
4265
4266 State.ImageViews[imageView] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004267}
4268
4269
4270// Shader functions
4271
4272cmd VkResult vkCreateShaderModule(
4273 VkDevice device,
4274 const VkShaderModuleCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004275 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004276 VkShaderModule* pShaderModule) {
4277 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO)
4278 deviceObject := GetDevice(device)
4279
4280 shaderModule := ?
4281 pShaderModule[0] = shaderModule
4282 State.ShaderModules[shaderModule] = new!ShaderModuleObject(device: device)
4283
4284 return ?
4285}
4286
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004287cmd void vkDestroyShaderModule(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004288 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004289 VkShaderModule shaderModule,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004290 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004291 deviceObject := GetDevice(device)
4292 shaderModuleObject := GetShaderModule(shaderModule)
4293 assert(shaderModuleObject.device == device)
4294
4295 State.ShaderModules[shaderModule] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004296}
4297
Jesse Halld27f6aa2015-08-15 17:58:48 -07004298
4299// Pipeline functions
4300
4301cmd VkResult vkCreatePipelineCache(
4302 VkDevice device,
4303 const VkPipelineCacheCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004304 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004305 VkPipelineCache* pPipelineCache) {
4306 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO)
4307 deviceObject := GetDevice(device)
4308
4309 pipelineCache := ?
4310 pPipelineCache[0] = pipelineCache
4311 State.PipelineCaches[pipelineCache] = new!PipelineCacheObject(device: device)
4312
4313 return ?
4314}
4315
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004316cmd void vkDestroyPipelineCache(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004317 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004318 VkPipelineCache pipelineCache,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004319 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004320 deviceObject := GetDevice(device)
4321 pipelineCacheObject := GetPipelineCache(pipelineCache)
4322 assert(pipelineCacheObject.device == device)
4323
4324 State.PipelineCaches[pipelineCache] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004325}
4326
Jesse Halld27f6aa2015-08-15 17:58:48 -07004327cmd VkResult vkGetPipelineCacheData(
4328 VkDevice device,
4329 VkPipelineCache pipelineCache,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004330 platform.size_t* pDataSize,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004331 void* pData) {
4332 deviceObject := GetDevice(device)
4333 pipelineCacheObject := GetPipelineCache(pipelineCache)
4334 assert(pipelineCacheObject.device == device)
4335
4336 return ?
4337}
4338
4339cmd VkResult vkMergePipelineCaches(
4340 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004341 VkPipelineCache dstCache,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004342 u32 srcCacheCount,
4343 const VkPipelineCache* pSrcCaches) {
4344 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004345 dstCacheObject := GetPipelineCache(dstCache)
4346 assert(dstCacheObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004347
4348 srcCaches := pSrcCaches[0:srcCacheCount]
4349 for i in (0 .. srcCacheCount) {
4350 srcCache := srcCaches[i]
4351 srcCacheObject := GetPipelineCache(srcCache)
4352 assert(srcCacheObject.device == device)
4353 }
4354
4355 return ?
4356}
4357
4358cmd VkResult vkCreateGraphicsPipelines(
4359 VkDevice device,
4360 VkPipelineCache pipelineCache,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004361 u32 createInfoCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004362 const VkGraphicsPipelineCreateInfo* pCreateInfos,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004363 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004364 VkPipeline* pPipelines) {
4365 deviceObject := GetDevice(device)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004366 if pipelineCache != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004367 pipelineCacheObject := GetPipelineCache(pipelineCache)
4368 assert(pipelineCacheObject.device == device)
4369 }
4370
Jesse Hall03b6fe12015-11-24 12:44:21 -08004371 createInfos := pCreateInfos[0:createInfoCount]
4372 pipelines := pPipelines[0:createInfoCount]
4373 for i in (0 .. createInfoCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004374 pipeline := ?
4375 pipelines[i] = pipeline
4376 State.Pipelines[pipeline] = new!PipelineObject(device: device)
4377 }
4378
4379 return ?
4380}
4381
4382cmd VkResult vkCreateComputePipelines(
4383 VkDevice device,
4384 VkPipelineCache pipelineCache,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004385 u32 createInfoCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004386 const VkComputePipelineCreateInfo* pCreateInfos,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004387 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004388 VkPipeline* pPipelines) {
4389 deviceObject := GetDevice(device)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004390 if pipelineCache != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004391 pipelineCacheObject := GetPipelineCache(pipelineCache)
4392 assert(pipelineCacheObject.device == device)
4393 }
4394
Jesse Hall03b6fe12015-11-24 12:44:21 -08004395 createInfos := pCreateInfos[0:createInfoCount]
4396 pipelines := pPipelines[0:createInfoCount]
4397 for i in (0 .. createInfoCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004398 pipeline := ?
4399 pipelines[i] = pipeline
4400 State.Pipelines[pipeline] = new!PipelineObject(device: device)
4401 }
4402
4403 return ?
4404}
4405
4406@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004407cmd void vkDestroyPipeline(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004408 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004409 VkPipeline pipeline,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004410 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004411 deviceObject := GetDevice(device)
4412 pipelineObjects := GetPipeline(pipeline)
4413 assert(pipelineObjects.device == device)
4414
4415 State.Pipelines[pipeline] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004416}
4417
4418
4419// Pipeline layout functions
4420
4421@threadSafety("system")
4422cmd VkResult vkCreatePipelineLayout(
4423 VkDevice device,
4424 const VkPipelineLayoutCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004425 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004426 VkPipelineLayout* pPipelineLayout) {
4427 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO)
4428 deviceObject := GetDevice(device)
4429
4430 pipelineLayout := ?
4431 pPipelineLayout[0] = pipelineLayout
4432 State.PipelineLayouts[pipelineLayout] = new!PipelineLayoutObject(device: device)
4433
4434 return ?
4435}
4436
4437@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004438cmd void vkDestroyPipelineLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004439 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004440 VkPipelineLayout pipelineLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004441 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004442 deviceObject := GetDevice(device)
4443 pipelineLayoutObjects := GetPipelineLayout(pipelineLayout)
4444 assert(pipelineLayoutObjects.device == device)
4445
4446 State.PipelineLayouts[pipelineLayout] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004447}
4448
4449
4450// Sampler functions
4451
4452@threadSafety("system")
4453cmd VkResult vkCreateSampler(
4454 VkDevice device,
4455 const VkSamplerCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004456 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004457 VkSampler* pSampler) {
4458 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO)
4459 deviceObject := GetDevice(device)
4460
4461 sampler := ?
4462 pSampler[0] = sampler
4463 State.Samplers[sampler] = new!SamplerObject(device: device)
4464
4465 return ?
4466}
4467
4468@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004469cmd void vkDestroySampler(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004470 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004471 VkSampler sampler,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004472 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004473 deviceObject := GetDevice(device)
4474 samplerObject := GetSampler(sampler)
4475 assert(samplerObject.device == device)
4476
4477 State.Samplers[sampler] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004478}
4479
4480
4481// Descriptor set functions
4482
4483@threadSafety("system")
4484cmd VkResult vkCreateDescriptorSetLayout(
4485 VkDevice device,
4486 const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004487 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004488 VkDescriptorSetLayout* pSetLayout) {
4489 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO)
4490 deviceObject := GetDevice(device)
4491
4492 setLayout := ?
4493 pSetLayout[0] = setLayout
4494 State.DescriptorSetLayouts[setLayout] = new!DescriptorSetLayoutObject(device: device)
4495
4496 return ?
4497}
4498
4499@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004500cmd void vkDestroyDescriptorSetLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004501 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004502 VkDescriptorSetLayout descriptorSetLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004503 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004504 deviceObject := GetDevice(device)
4505 descriptorSetLayoutObject := GetDescriptorSetLayout(descriptorSetLayout)
4506 assert(descriptorSetLayoutObject.device == device)
4507
4508 State.DescriptorSetLayouts[descriptorSetLayout] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004509}
4510
4511@threadSafety("system")
4512cmd VkResult vkCreateDescriptorPool(
4513 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004514 const VkDescriptorPoolCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004515 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004516 VkDescriptorPool* pDescriptorPool) {
4517 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO)
4518 deviceObject := GetDevice(device)
4519
4520 descriptorPool := ?
4521 pDescriptorPool[0] = descriptorPool
4522 State.DescriptorPools[descriptorPool] = new!DescriptorPoolObject(device: device)
4523
4524 return ?
4525}
4526
4527@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004528cmd void vkDestroyDescriptorPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004529 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004530 VkDescriptorPool descriptorPool,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004531 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004532 deviceObject := GetDevice(device)
4533 descriptorPoolObject := GetDescriptorPool(descriptorPool)
4534 assert(descriptorPoolObject.device == device)
4535
4536 State.DescriptorPools[descriptorPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004537}
4538
4539@threadSafety("app")
4540cmd VkResult vkResetDescriptorPool(
4541 VkDevice device,
Jesse Hallfbf97b02015-11-20 14:17:03 -08004542 VkDescriptorPool descriptorPool,
4543 VkDescriptorPoolResetFlags flags) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004544 deviceObject := GetDevice(device)
4545 descriptorPoolObject := GetDescriptorPool(descriptorPool)
4546 assert(descriptorPoolObject.device == device)
4547
4548 return ?
4549}
4550
4551@threadSafety("app")
Jesse Hall3fbc8562015-11-29 22:10:52 -08004552cmd VkResult vkAllocateDescriptorSets(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004553 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004554 const VkDescriptorSetAllocateInfo* pAllocateInfo,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004555 VkDescriptorSet* pDescriptorSets) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004556 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004557 allocInfo := pAllocateInfo[0]
Jesse Hallfbf97b02015-11-20 14:17:03 -08004558 descriptorPoolObject := GetDescriptorPool(allocInfo.descriptorPool)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004559
Jesse Hall03b6fe12015-11-24 12:44:21 -08004560 setLayouts := allocInfo.pSetLayouts[0:allocInfo.setCount]
4561 for i in (0 .. allocInfo.setCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004562 setLayout := setLayouts[i]
4563 setLayoutObject := GetDescriptorSetLayout(setLayout)
4564 assert(setLayoutObject.device == device)
4565 }
4566
Jesse Hall03b6fe12015-11-24 12:44:21 -08004567 descriptorSets := pDescriptorSets[0:allocInfo.setCount]
4568 for i in (0 .. allocInfo.setCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004569 descriptorSet := ?
4570 descriptorSets[i] = descriptorSet
4571 State.DescriptorSets[descriptorSet] = new!DescriptorSetObject(device: device)
4572 }
4573
4574 return ?
4575}
4576
Jesse Hallf09c6b12015-08-15 19:54:28 -07004577cmd VkResult vkFreeDescriptorSets(
4578 VkDevice device,
4579 VkDescriptorPool descriptorPool,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004580 u32 descriptorSetCount,
Jesse Hallf09c6b12015-08-15 19:54:28 -07004581 const VkDescriptorSet* pDescriptorSets) {
4582 deviceObject := GetDevice(device)
4583 descriptorPoolObject := GetDescriptorPool(descriptorPool)
4584
Jesse Hall03b6fe12015-11-24 12:44:21 -08004585 descriptorSets := pDescriptorSets[0:descriptorSetCount]
4586 for i in (0 .. descriptorSetCount) {
Jesse Hallf09c6b12015-08-15 19:54:28 -07004587 descriptorSet := descriptorSets[i]
4588 descriptorSetObject := GetDescriptorSet(descriptorSet)
4589 assert(descriptorSetObject.device == device)
4590 State.DescriptorSets[descriptorSet] = null
4591 }
4592
4593 return ?
4594}
4595
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004596cmd void vkUpdateDescriptorSets(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004597 VkDevice device,
Jesse Hallb00daad2015-11-29 19:46:20 -08004598 u32 descriptorWriteCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004599 const VkWriteDescriptorSet* pDescriptorWrites,
Jesse Hallb00daad2015-11-29 19:46:20 -08004600 u32 descriptorCopyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004601 const VkCopyDescriptorSet* pDescriptorCopies) {
4602 deviceObject := GetDevice(device)
4603
Jesse Hallb00daad2015-11-29 19:46:20 -08004604 descriptorWrites := pDescriptorWrites[0:descriptorWriteCount]
4605 for i in (0 .. descriptorWriteCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004606 descriptorWrite := descriptorWrites[i]
Jesse Hall3fbc8562015-11-29 22:10:52 -08004607 descriptorWriteObject := GetDescriptorSet(descriptorWrite.dstSet)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004608 assert(descriptorWriteObject.device == device)
4609 }
4610
Jesse Hallb00daad2015-11-29 19:46:20 -08004611 descriptorCopies := pDescriptorCopies[0:descriptorCopyCount]
4612 for i in (0 .. descriptorCopyCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004613 descriptorCopy := descriptorCopies[i]
Jesse Hall3fbc8562015-11-29 22:10:52 -08004614 descriptorCopyObject := GetDescriptorSet(descriptorCopy.dstSet)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004615 assert(descriptorCopyObject.device == device)
4616 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07004617}
4618
4619
4620// Framebuffer functions
4621
4622@threadSafety("system")
4623cmd VkResult vkCreateFramebuffer(
4624 VkDevice device,
4625 const VkFramebufferCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004626 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004627 VkFramebuffer* pFramebuffer) {
4628 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO)
4629 deviceObject := GetDevice(device)
4630
4631 framebuffer := ?
4632 pFramebuffer[0] = framebuffer
4633 State.Framebuffers[framebuffer] = new!FramebufferObject(device: device)
4634
4635 return ?
4636}
4637
4638@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004639cmd void vkDestroyFramebuffer(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004640 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004641 VkFramebuffer framebuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004642 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004643 deviceObject := GetDevice(device)
4644 framebufferObject := GetFramebuffer(framebuffer)
4645 assert(framebufferObject.device == device)
4646
4647 State.Framebuffers[framebuffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004648}
4649
4650
4651// Renderpass functions
4652
4653@threadSafety("system")
4654cmd VkResult vkCreateRenderPass(
4655 VkDevice device,
4656 const VkRenderPassCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004657 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004658 VkRenderPass* pRenderPass) {
4659 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO)
4660 deviceObject := GetDevice(device)
4661
4662 renderpass := ?
4663 pRenderPass[0] = renderpass
4664 State.RenderPasses[renderpass] = new!RenderPassObject(device: device)
4665
4666 return ?
4667}
4668
4669@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004670cmd void vkDestroyRenderPass(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004671 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004672 VkRenderPass renderPass,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004673 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004674 deviceObject := GetDevice(device)
4675 renderPassObject := GetRenderPass(renderPass)
4676 assert(renderPassObject.device == device)
4677
4678 State.RenderPasses[renderPass] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004679}
4680
Jesse Hall606a54e2015-11-19 22:17:28 -08004681cmd void vkGetRenderAreaGranularity(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004682 VkDevice device,
4683 VkRenderPass renderPass,
4684 VkExtent2D* pGranularity) {
4685 deviceObject := GetDevice(device)
4686 renderPassObject := GetRenderPass(renderPass)
4687
4688 granularity := ?
4689 pGranularity[0] = granularity
Jesse Halld27f6aa2015-08-15 17:58:48 -07004690}
4691
4692// Command pool functions
4693
4694cmd VkResult vkCreateCommandPool(
4695 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004696 const VkCommandPoolCreateInfo* pCreateInfo,
4697 const VkAllocationCallbacks* pAllocator,
4698 VkCommandPool* pCommandPool) {
4699 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004700 deviceObject := GetDevice(device)
4701
Jesse Hall3fbc8562015-11-29 22:10:52 -08004702 commandPool := ?
4703 pCommandPool[0] = commandPool
4704 State.CommandPools[commandPool] = new!CommandPoolObject(device: device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004705
4706 return ?
4707}
4708
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004709cmd void vkDestroyCommandPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004710 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004711 VkCommandPool commandPool,
4712 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004713 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004714 commandPoolObject := GetCommandPool(commandPool)
4715 assert(commandPoolObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004716
Jesse Hall3fbc8562015-11-29 22:10:52 -08004717 State.CommandPools[commandPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004718}
4719
4720cmd VkResult vkResetCommandPool(
4721 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004722 VkCommandPool commandPool,
4723 VkCommandPoolResetFlags flags) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004724 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004725 commandPoolObject := GetCommandPool(commandPool)
4726 assert(commandPoolObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004727
4728 return ?
4729}
4730
4731// Command buffer functions
4732
Jesse Hall3fbc8562015-11-29 22:10:52 -08004733macro void bindCommandBuffer(VkCommandBuffer commandBuffer, any obj, VkDeviceMemory memory) {
4734 memoryObject := GetDeviceMemory(memory)
4735 memoryObject.boundCommandBuffers[commandBuffer] = commandBuffer
Jesse Halld27f6aa2015-08-15 17:58:48 -07004736
Jesse Hall3fbc8562015-11-29 22:10:52 -08004737 commandBufferObject := GetCommandBuffer(commandBuffer)
4738 commandBufferObject.boundObjects[as!u64(obj)] = memory
Jesse Halld27f6aa2015-08-15 17:58:48 -07004739}
4740
Jesse Hall3fbc8562015-11-29 22:10:52 -08004741macro void unbindCommandBuffer(VkCommandBuffer commandBuffer, any obj, VkDeviceMemory memory) {
4742 memoryObject := GetDeviceMemory(memory)
4743 memoryObject.boundCommandBuffers[commandBuffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004744
Jesse Hall3fbc8562015-11-29 22:10:52 -08004745 commandBufferObject := GetCommandBuffer(commandBuffer)
4746 commandBufferObject.boundObjects[as!u64(obj)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004747}
4748
4749@threadSafety("system")
Jesse Hall3fbc8562015-11-29 22:10:52 -08004750cmd VkResult vkAllocateCommandBuffers(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004751 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004752 const VkCommandBufferAllocateInfo* pAllocateInfo,
4753 VkCommandBuffer* pCommandBuffers) {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08004754 assert(pAllocateInfo[0].sType == VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004755
Jesse Hall3dd678a2016-01-08 21:52:01 -08004756 count := pAllocateInfo[0].commandBufferCount
Jesse Hall3fbc8562015-11-29 22:10:52 -08004757 commandBuffers := pCommandBuffers[0:count]
Jesse Hallfbf97b02015-11-20 14:17:03 -08004758 for i in (0 .. count) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004759 commandBuffer := ?
4760 commandBuffers[i] = commandBuffer
4761 State.CommandBuffers[commandBuffer] = new!CommandBufferObject(device: device)
Jesse Hallfbf97b02015-11-20 14:17:03 -08004762 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07004763
4764 return ?
4765}
4766
4767@threadSafety("system")
Jesse Hallfbf97b02015-11-20 14:17:03 -08004768cmd void vkFreeCommandBuffers(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004769 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004770 VkCommandPool commandPool,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004771 u32 commandBufferCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004772 const VkCommandBuffer* pCommandBuffers) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004773 deviceObject := GetDevice(device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004774
Jesse Hall3fbc8562015-11-29 22:10:52 -08004775 commandBuffers := pCommandBuffers[0:commandBufferCount]
Jesse Hall03b6fe12015-11-24 12:44:21 -08004776 for i in (0 .. commandBufferCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004777 commandBufferObject := GetCommandBuffer(commandBuffers[i])
4778 assert(commandBufferObject.device == device)
Jesse Hallfbf97b02015-11-20 14:17:03 -08004779 // TODO: iterate over boundObjects and clear memory bindings
Jesse Hall3fbc8562015-11-29 22:10:52 -08004780 State.CommandBuffers[commandBuffers[i]] = null
Jesse Hallfbf97b02015-11-20 14:17:03 -08004781 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07004782}
4783
4784@threadSafety("app")
4785cmd VkResult vkBeginCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004786 VkCommandBuffer commandBuffer,
4787 const VkCommandBufferBeginInfo* pBeginInfo) {
4788 assert(pBeginInfo.sType == VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO)
4789 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004790
4791 // TODO: iterate over boundObjects and clear memory bindings
4792
4793 return ?
4794}
4795
4796@threadSafety("app")
4797cmd VkResult vkEndCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004798 VkCommandBuffer commandBuffer) {
4799 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004800
4801 return ?
4802}
4803
4804@threadSafety("app")
4805cmd VkResult vkResetCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004806 VkCommandBuffer commandBuffer,
4807 VkCommandBufferResetFlags flags) {
4808 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004809
4810 // TODO: iterate over boundObjects and clear memory bindings
4811
4812 return ?
4813}
4814
4815
4816// Command buffer building functions
4817
4818@threadSafety("app")
4819cmd void vkCmdBindPipeline(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004820 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004821 VkPipelineBindPoint pipelineBindPoint,
4822 VkPipeline pipeline) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004823 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004824 pipelineObject := GetPipeline(pipeline)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004825 assert(commandBufferObject.device == pipelineObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004826
Jesse Halld8bade02015-11-24 10:24:18 -08004827 queue := switch (pipelineBindPoint) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004828 case VK_PIPELINE_BIND_POINT_COMPUTE: VK_QUEUE_COMPUTE_BIT
4829 case VK_PIPELINE_BIND_POINT_GRAPHICS: VK_QUEUE_GRAPHICS_BIT
4830 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08004831 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004832}
4833
4834@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004835cmd void vkCmdSetViewport(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004836 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004837 u32 firstViewport,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004838 u32 viewportCount,
4839 const VkViewport* pViewports) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004840 commandBufferObject := GetCommandBuffer(commandBuffer)
4841 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004842}
4843
4844@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004845cmd void vkCmdSetScissor(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004846 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004847 u32 firstScissor,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004848 u32 scissorCount,
4849 const VkRect2D* pScissors) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004850 commandBufferObject := GetCommandBuffer(commandBuffer)
4851 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004852}
4853
4854@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004855cmd void vkCmdSetLineWidth(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004856 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004857 f32 lineWidth) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004858 commandBufferObject := GetCommandBuffer(commandBuffer)
4859 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004860}
4861
4862@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004863cmd void vkCmdSetDepthBias(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004864 VkCommandBuffer commandBuffer,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004865 f32 depthBiasConstantFactor,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004866 f32 depthBiasClamp,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004867 f32 depthBiasSlopeFactor) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004868 commandBufferObject := GetCommandBuffer(commandBuffer)
4869 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004870}
Jesse Halld27f6aa2015-08-15 17:58:48 -07004871
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004872@threadSafety("app")
4873cmd void vkCmdSetBlendConstants(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004874 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004875 // TODO(jessehall): apic only supports 'const' on pointer types. Using
4876 // an annotation as a quick hack to pass this to the template without
4877 // having to modify the AST and semantic model.
Jesse Hallb00daad2015-11-29 19:46:20 -08004878 @readonly f32[4] blendConstants) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004879 commandBufferObject := GetCommandBuffer(commandBuffer)
4880 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004881}
4882
4883@threadSafety("app")
4884cmd void vkCmdSetDepthBounds(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004885 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004886 f32 minDepthBounds,
4887 f32 maxDepthBounds) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004888 commandBufferObject := GetCommandBuffer(commandBuffer)
4889 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004890}
4891
4892@threadSafety("app")
4893cmd void vkCmdSetStencilCompareMask(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004894 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004895 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08004896 u32 compareMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004897 commandBufferObject := GetCommandBuffer(commandBuffer)
4898 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004899}
4900
4901@threadSafety("app")
4902cmd void vkCmdSetStencilWriteMask(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004903 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004904 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08004905 u32 writeMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004906 commandBufferObject := GetCommandBuffer(commandBuffer)
4907 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004908}
4909
4910@threadSafety("app")
4911cmd void vkCmdSetStencilReference(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004912 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004913 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08004914 u32 reference) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004915 commandBufferObject := GetCommandBuffer(commandBuffer)
4916 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004917}
4918
4919@threadSafety("app")
4920cmd void vkCmdBindDescriptorSets(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004921 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004922 VkPipelineBindPoint pipelineBindPoint,
4923 VkPipelineLayout layout,
4924 u32 firstSet,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004925 u32 descriptorSetCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004926 const VkDescriptorSet* pDescriptorSets,
4927 u32 dynamicOffsetCount,
4928 const u32* pDynamicOffsets) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004929 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004930
Jesse Hall03b6fe12015-11-24 12:44:21 -08004931 descriptorSets := pDescriptorSets[0:descriptorSetCount]
4932 for i in (0 .. descriptorSetCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004933 descriptorSet := descriptorSets[i]
4934 descriptorSetObject := GetDescriptorSet(descriptorSet)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004935 assert(commandBufferObject.device == descriptorSetObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004936 }
4937
4938 dynamicOffsets := pDynamicOffsets[0:dynamicOffsetCount]
4939 for i in (0 .. dynamicOffsetCount) {
4940 dynamicOffset := dynamicOffsets[i]
4941 }
4942
Jesse Halld8bade02015-11-24 10:24:18 -08004943 queue := switch (pipelineBindPoint) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004944 case VK_PIPELINE_BIND_POINT_COMPUTE: VK_QUEUE_COMPUTE_BIT
4945 case VK_PIPELINE_BIND_POINT_GRAPHICS: VK_QUEUE_GRAPHICS_BIT
4946 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08004947 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004948}
4949
4950@threadSafety("app")
4951cmd void vkCmdBindIndexBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004952 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004953 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004954 VkDeviceSize offset,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004955 VkIndexType indexType) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004956 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004957 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004958 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004959
Jesse Hall3fbc8562015-11-29 22:10:52 -08004960 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004961
Jesse Hall3fbc8562015-11-29 22:10:52 -08004962 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004963}
4964
4965@threadSafety("app")
4966cmd void vkCmdBindVertexBuffers(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004967 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004968 u32 firstBinding,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004969 u32 bindingCount,
4970 const VkBuffer* pBuffers,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004971 const VkDeviceSize* pOffsets) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004972 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004973
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004974 // TODO: check if not [firstBinding:firstBinding+bindingCount]
Jesse Halld27f6aa2015-08-15 17:58:48 -07004975 buffers := pBuffers[0:bindingCount]
4976 offsets := pOffsets[0:bindingCount]
4977 for i in (0 .. bindingCount) {
4978 buffer := buffers[i]
4979 offset := offsets[i]
4980 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004981 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004982
Jesse Hall3fbc8562015-11-29 22:10:52 -08004983 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004984 }
4985
Jesse Hall3fbc8562015-11-29 22:10:52 -08004986 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004987}
4988
4989@threadSafety("app")
4990cmd void vkCmdDraw(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004991 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004992 u32 vertexCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004993 u32 instanceCount,
4994 u32 firstVertex,
4995 u32 firstInstance) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004996 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004997
Jesse Hall3fbc8562015-11-29 22:10:52 -08004998 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004999}
5000
5001@threadSafety("app")
5002cmd void vkCmdDrawIndexed(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005003 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005004 u32 indexCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005005 u32 instanceCount,
5006 u32 firstIndex,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005007 s32 vertexOffset,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005008 u32 firstInstance) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005009 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005010
Jesse Hall3fbc8562015-11-29 22:10:52 -08005011 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005012}
5013
5014@threadSafety("app")
5015cmd void vkCmdDrawIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005016 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005017 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005018 VkDeviceSize offset,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005019 u32 drawCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005020 u32 stride) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005021 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005022 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005023 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005024
Jesse Hall3fbc8562015-11-29 22:10:52 -08005025 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005026
Jesse Hall3fbc8562015-11-29 22:10:52 -08005027 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005028}
5029
5030@threadSafety("app")
5031cmd void vkCmdDrawIndexedIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005032 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005033 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005034 VkDeviceSize offset,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005035 u32 drawCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005036 u32 stride) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005037 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005038 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005039 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005040
Jesse Hall3fbc8562015-11-29 22:10:52 -08005041 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005042
Jesse Hall3fbc8562015-11-29 22:10:52 -08005043 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005044}
5045
5046@threadSafety("app")
5047cmd void vkCmdDispatch(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005048 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005049 u32 x,
5050 u32 y,
5051 u32 z) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005052 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005053
Jesse Hall3fbc8562015-11-29 22:10:52 -08005054 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_COMPUTE_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005055}
5056
5057@threadSafety("app")
5058cmd void vkCmdDispatchIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005059 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005060 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005061 VkDeviceSize offset) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005062 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005063 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005064 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005065
Jesse Hall3fbc8562015-11-29 22:10:52 -08005066 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005067
Jesse Hall3fbc8562015-11-29 22:10:52 -08005068 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_COMPUTE_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005069}
5070
5071@threadSafety("app")
5072cmd void vkCmdCopyBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005073 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005074 VkBuffer srcBuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005075 VkBuffer dstBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005076 u32 regionCount,
5077 const VkBufferCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005078 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005079 srcBufferObject := GetBuffer(srcBuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005080 dstBufferObject := GetBuffer(dstBuffer)
5081 assert(commandBufferObject.device == srcBufferObject.device)
5082 assert(commandBufferObject.device == dstBufferObject.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, srcBuffer, srcBufferObject.memory)
5090 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.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 vkCmdCopyImage(
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 VkImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005104 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005105 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005106 dstImageObject := GetImage(dstImage)
5107 assert(commandBufferObject.device == srcImageObject.device)
5108 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005109
5110 regions := pRegions[0:regionCount]
5111 for i in (0 .. regionCount) {
5112 region := regions[i]
5113 }
5114
Jesse Hall3fbc8562015-11-29 22:10:52 -08005115 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
5116 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005117
Jesse Hall65ab5522015-11-30 00:07:16 -08005118 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005119}
5120
5121@threadSafety("app")
5122cmd void vkCmdBlitImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005123 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005124 VkImage srcImage,
5125 VkImageLayout srcImageLayout,
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 VkImageBlit* pRegions,
Jesse Hall23ff73f2015-11-29 14:36:39 -08005130 VkFilter filter) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005131 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005132 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005133 dstImageObject := GetImage(dstImage)
5134 assert(commandBufferObject.device == srcImageObject.device)
5135 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005136
5137 regions := pRegions[0:regionCount]
5138 for i in (0 .. regionCount) {
5139 region := regions[i]
5140 }
5141
Jesse Hall3fbc8562015-11-29 22:10:52 -08005142 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
5143 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005144
Jesse Hall3fbc8562015-11-29 22:10:52 -08005145 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005146}
5147
5148@threadSafety("app")
5149cmd void vkCmdCopyBufferToImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005150 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005151 VkBuffer srcBuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005152 VkImage dstImage,
5153 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005154 u32 regionCount,
5155 const VkBufferImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005156 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005157 srcBufferObject := GetBuffer(srcBuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005158 dstImageObject := GetImage(dstImage)
5159 assert(commandBufferObject.device == srcBufferObject.device)
5160 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005161
5162 regions := pRegions[0:regionCount]
5163 for i in (0 .. regionCount) {
5164 region := regions[i]
5165 }
5166
Jesse Hall3fbc8562015-11-29 22:10:52 -08005167 bindCommandBuffer(commandBuffer, srcBuffer, srcBufferObject.memory)
5168 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005169
Jesse Hall65ab5522015-11-30 00:07:16 -08005170 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005171}
5172
5173@threadSafety("app")
5174cmd void vkCmdCopyImageToBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005175 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005176 VkImage srcImage,
5177 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005178 VkBuffer dstBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005179 u32 regionCount,
5180 const VkBufferImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005181 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005182 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005183 dstBufferObject := GetBuffer(dstBuffer)
5184 assert(commandBufferObject.device == srcImageObject.device)
5185 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005186
5187 regions := pRegions[0:regionCount]
5188 for i in (0 .. regionCount) {
5189 region := regions[i]
5190 }
5191
Jesse Hall3fbc8562015-11-29 22:10:52 -08005192 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
5193 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005194
Jesse Hall65ab5522015-11-30 00:07:16 -08005195 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005196}
5197
5198@threadSafety("app")
5199cmd void vkCmdUpdateBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005200 VkCommandBuffer commandBuffer,
5201 VkBuffer dstBuffer,
5202 VkDeviceSize dstOffset,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005203 VkDeviceSize dataSize,
Jesse Hall56d386a2016-07-26 15:20:40 -07005204 const void* pData) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005205 commandBufferObject := GetCommandBuffer(commandBuffer)
5206 dstBufferObject := GetBuffer(dstBuffer)
5207 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005208
5209 data := pData[0:dataSize]
5210
Jesse Hall3fbc8562015-11-29 22:10:52 -08005211 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005212
Jesse Hall65ab5522015-11-30 00:07:16 -08005213 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005214}
5215
5216@threadSafety("app")
5217cmd void vkCmdFillBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005218 VkCommandBuffer commandBuffer,
5219 VkBuffer dstBuffer,
5220 VkDeviceSize dstOffset,
Jesse Hallb00daad2015-11-29 19:46:20 -08005221 VkDeviceSize size,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005222 u32 data) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005223 commandBufferObject := GetCommandBuffer(commandBuffer)
5224 dstBufferObject := GetBuffer(dstBuffer)
5225 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005226
Jesse Hall65ab5522015-11-30 00:07:16 -08005227 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005228}
5229
5230@threadSafety("app")
5231cmd void vkCmdClearColorImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005232 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005233 VkImage image,
5234 VkImageLayout imageLayout,
5235 const VkClearColorValue* pColor,
5236 u32 rangeCount,
5237 const VkImageSubresourceRange* pRanges) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005238 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005239 imageObject := GetImage(image)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005240 assert(commandBufferObject.device == imageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005241
5242 ranges := pRanges[0:rangeCount]
5243 for i in (0 .. rangeCount) {
5244 range := ranges[i]
5245 }
5246
Jesse Hall3fbc8562015-11-29 22:10:52 -08005247 bindCommandBuffer(commandBuffer, image, imageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005248
Jesse Hall3fbc8562015-11-29 22:10:52 -08005249 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005250}
5251
5252@threadSafety("app")
5253cmd void vkCmdClearDepthStencilImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005254 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005255 VkImage image,
5256 VkImageLayout imageLayout,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005257 const VkClearDepthStencilValue* pDepthStencil,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005258 u32 rangeCount,
5259 const VkImageSubresourceRange* pRanges) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005260 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005261 imageObject := GetImage(image)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005262 assert(commandBufferObject.device == imageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005263
5264 ranges := pRanges[0:rangeCount]
5265 for i in (0 .. rangeCount) {
5266 range := ranges[i]
5267 }
5268
Jesse Hall3fbc8562015-11-29 22:10:52 -08005269 bindCommandBuffer(commandBuffer, image, imageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005270
Jesse Hall3fbc8562015-11-29 22:10:52 -08005271 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005272}
5273
5274@threadSafety("app")
Jesse Hallae38f732015-11-19 21:32:50 -08005275cmd void vkCmdClearAttachments(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005276 VkCommandBuffer commandBuffer,
Jesse Hallae38f732015-11-19 21:32:50 -08005277 u32 attachmentCount,
5278 const VkClearAttachment* pAttachments,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005279 u32 rectCount,
Jesse Halla15a4bf2015-11-19 22:48:02 -08005280 const VkClearRect* pRects) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005281 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005282
5283 rects := pRects[0:rectCount]
5284 for i in (0 .. rectCount) {
5285 rect := rects[i]
5286 }
5287
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 vkCmdResolveImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005293 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005294 VkImage srcImage,
5295 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005296 VkImage dstImage,
5297 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005298 u32 regionCount,
5299 const VkImageResolve* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005300 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005301 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005302 dstImageObject := GetImage(dstImage)
5303 assert(commandBufferObject.device == srcImageObject.device)
5304 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005305
5306 regions := pRegions[0:regionCount]
5307 for i in (0 .. regionCount) {
5308 region := regions[i]
5309 }
5310
Jesse Hall3fbc8562015-11-29 22:10:52 -08005311 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
5312 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005313
Jesse Hall3fbc8562015-11-29 22:10:52 -08005314 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005315}
5316
5317@threadSafety("app")
5318cmd void vkCmdSetEvent(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005319 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005320 VkEvent event,
5321 VkPipelineStageFlags stageMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005322 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005323 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005324 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005325}
5326
5327@threadSafety("app")
5328cmd void vkCmdResetEvent(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005329 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005330 VkEvent event,
5331 VkPipelineStageFlags stageMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005332 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005333 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005334 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005335}
5336
5337@threadSafety("app")
5338cmd void vkCmdWaitEvents(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005339 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005340 u32 eventCount,
5341 const VkEvent* pEvents,
5342 VkPipelineStageFlags srcStageMask,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005343 VkPipelineStageFlags dstStageMask,
5344 u32 memoryBarrierCount,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005345 const VkMemoryBarrier* pMemoryBarriers,
5346 u32 bufferMemoryBarrierCount,
5347 const VkBufferMemoryBarrier* pBufferMemoryBarriers,
5348 u32 imageMemoryBarrierCount,
5349 const VkImageMemoryBarrier* pImageMemoryBarriers) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005350 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005351
5352 events := pEvents[0:eventCount]
5353 for i in (0 .. eventCount) {
5354 event := events[i]
5355 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005356 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005357 }
5358
Jesse Hall3dd678a2016-01-08 21:52:01 -08005359 memoryBarriers := pMemoryBarriers[0:memoryBarrierCount]
Jesse Hall3fbc8562015-11-29 22:10:52 -08005360 for i in (0 .. memoryBarrierCount) {
Jesse Hall3dd678a2016-01-08 21:52:01 -08005361 memoryBarrier := memoryBarriers[i]
5362 }
5363 bufferMemoryBarriers := pBufferMemoryBarriers[0:bufferMemoryBarrierCount]
5364 for i in (0 .. bufferMemoryBarrierCount) {
5365 bufferMemoryBarrier := bufferMemoryBarriers[i]
5366 bufferObject := GetBuffer(bufferMemoryBarrier.buffer)
5367 assert(bufferObject.device == commandBufferObject.device)
5368 }
5369 imageMemoryBarriers := pImageMemoryBarriers[0:imageMemoryBarrierCount]
5370 for i in (0 .. imageMemoryBarrierCount) {
5371 imageMemoryBarrier := imageMemoryBarriers[i]
5372 imageObject := GetImage(imageMemoryBarrier.image)
5373 assert(imageObject.device == commandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005374 }
5375}
5376
5377@threadSafety("app")
5378cmd void vkCmdPipelineBarrier(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005379 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005380 VkPipelineStageFlags srcStageMask,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005381 VkPipelineStageFlags dstStageMask,
Jesse Halldc6d36c2015-11-29 19:12:15 -08005382 VkDependencyFlags dependencyFlags,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005383 u32 memoryBarrierCount,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005384 const VkMemoryBarrier* pMemoryBarriers,
5385 u32 bufferMemoryBarrierCount,
5386 const VkBufferMemoryBarrier* pBufferMemoryBarriers,
5387 u32 imageMemoryBarrierCount,
5388 const VkImageMemoryBarrier* pImageMemoryBarriers) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005389 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005390
Jesse Hall3dd678a2016-01-08 21:52:01 -08005391 memoryBarriers := pMemoryBarriers[0:memoryBarrierCount]
Jesse Hall3fbc8562015-11-29 22:10:52 -08005392 for i in (0 .. memoryBarrierCount) {
Jesse Hall3dd678a2016-01-08 21:52:01 -08005393 memoryBarrier := memoryBarriers[i]
5394 }
5395 bufferMemoryBarriers := pBufferMemoryBarriers[0:bufferMemoryBarrierCount]
5396 for i in (0 .. bufferMemoryBarrierCount) {
5397 bufferMemoryBarrier := bufferMemoryBarriers[i]
5398 bufferObject := GetBuffer(bufferMemoryBarrier.buffer)
5399 assert(bufferObject.device == commandBufferObject.device)
5400 }
5401 imageMemoryBarriers := pImageMemoryBarriers[0:imageMemoryBarrierCount]
5402 for i in (0 .. imageMemoryBarrierCount) {
5403 imageMemoryBarrier := imageMemoryBarriers[i]
5404 imageObject := GetImage(imageMemoryBarrier.image)
5405 assert(imageObject.device == commandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005406 }
5407}
5408
5409@threadSafety("app")
5410cmd void vkCmdBeginQuery(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005411 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005412 VkQueryPool queryPool,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005413 u32 query,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005414 VkQueryControlFlags flags) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005415 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005416 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005417 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005418}
5419
5420@threadSafety("app")
5421cmd void vkCmdEndQuery(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005422 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005423 VkQueryPool queryPool,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005424 u32 query) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005425 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005426 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005427 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005428}
5429
5430@threadSafety("app")
5431cmd void vkCmdResetQueryPool(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005432 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005433 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005434 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005435 u32 queryCount) {
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 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005439}
5440
5441@threadSafety("app")
5442cmd void vkCmdWriteTimestamp(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005443 VkCommandBuffer commandBuffer,
Jesse Hall6f39a6d2015-11-24 11:08:36 -08005444 VkPipelineStageFlagBits pipelineStage,
Jesse Halla3a7a1d2015-11-24 11:37:23 -08005445 VkQueryPool queryPool,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005446 u32 query) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005447 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halla3a7a1d2015-11-24 11:37:23 -08005448 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005449 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005450}
5451
5452@threadSafety("app")
5453cmd void vkCmdCopyQueryPoolResults(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005454 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005455 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005456 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005457 u32 queryCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005458 VkBuffer dstBuffer,
5459 VkDeviceSize dstOffset,
Jesse Halla9bb62b2015-11-21 19:31:56 -08005460 VkDeviceSize stride,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005461 VkQueryResultFlags flags) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005462 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005463 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005464 dstBufferObject := GetBuffer(dstBuffer)
5465 assert(commandBufferObject.device == queryPoolObject.device)
5466 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005467}
5468
5469cmd void vkCmdPushConstants(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005470 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005471 VkPipelineLayout layout,
5472 VkShaderStageFlags stageFlags,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005473 u32 offset,
5474 u32 size,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08005475 const void* pValues) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005476 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005477 layoutObject := GetPipelineLayout(layout)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005478 assert(commandBufferObject.device == layoutObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005479}
5480
5481@threadSafety("app")
5482cmd void vkCmdBeginRenderPass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005483 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005484 const VkRenderPassBeginInfo* pRenderPassBegin,
Jesse Hall65ab5522015-11-30 00:07:16 -08005485 VkSubpassContents contents) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005486 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005487 renderPassObject := GetRenderPass(pRenderPassBegin.renderPass)
5488 framebufferObject := GetFramebuffer(pRenderPassBegin.framebuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005489 assert(commandBufferObject.device == renderPassObject.device)
5490 assert(commandBufferObject.device == framebufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005491
Jesse Hall3fbc8562015-11-29 22:10:52 -08005492 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005493}
5494
5495cmd void vkCmdNextSubpass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005496 VkCommandBuffer commandBuffer,
Jesse Hall65ab5522015-11-30 00:07:16 -08005497 VkSubpassContents contents) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005498 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005499}
5500
5501@threadSafety("app")
5502cmd void vkCmdEndRenderPass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005503 VkCommandBuffer commandBuffer) {
5504 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005505
Jesse Hall3fbc8562015-11-29 22:10:52 -08005506 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005507}
5508
5509cmd void vkCmdExecuteCommands(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005510 VkCommandBuffer commandBuffer,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005511 u32 commandBufferCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005512 const VkCommandBuffer* pCommandBuffers) {
5513 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005514
Jesse Hall3dd678a2016-01-08 21:52:01 -08005515 commandBuffers := pCommandBuffers[0:commandBufferCount]
5516 for i in (0 .. commandBufferCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005517 secondaryCommandBuffer := commandBuffers[i]
5518 secondaryCommandBufferObject := GetCommandBuffer(secondaryCommandBuffer)
5519 assert(commandBufferObject.device == secondaryCommandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005520 }
5521}
5522
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005523@extension("VK_KHR_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005524cmd void vkDestroySurfaceKHR(
5525 VkInstance instance,
Jesse Hall0e74f002015-11-30 11:37:59 -08005526 VkSurfaceKHR surface,
5527 const VkAllocationCallbacks* pAllocator) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005528 instanceObject := GetInstance(instance)
5529 surfaceObject := GetSurface(surface)
5530 assert(surfaceObject.instance == instance)
Michael Lentine88594d72015-11-12 12:49:45 -08005531
Jesse Hall1356b0d2015-11-23 17:24:58 -08005532 State.Surfaces[surface] = null
Jesse Hall2818f932015-11-19 21:19:17 -08005533}
5534
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005535@extension("VK_KHR_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005536cmd VkResult vkGetPhysicalDeviceSurfaceSupportKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005537 VkPhysicalDevice physicalDevice,
5538 u32 queueFamilyIndex,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005539 VkSurfaceKHR surface,
Jesse Hallb00daad2015-11-29 19:46:20 -08005540 VkBool32* pSupported) {
5541 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08005542
5543 return ?
5544}
5545
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005546@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08005547cmd VkResult vkGetPhysicalDeviceSurfaceCapabilitiesKHR(
5548 VkPhysicalDevice physicalDevice,
5549 VkSurfaceKHR surface,
5550 VkSurfaceCapabilitiesKHR* pSurfaceCapabilities) {
5551 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5552
5553 surfaceCapabilities := ?
5554 pSurfaceCapabilities[0] = surfaceCapabilities
5555
5556 return ?
5557}
5558
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005559@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08005560cmd VkResult vkGetPhysicalDeviceSurfaceFormatsKHR(
5561 VkPhysicalDevice physicalDevice,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005562 VkSurfaceKHR surface,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005563 u32* pSurfaceFormatCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005564 VkSurfaceFormatKHR* pSurfaceFormats) {
Jesse Hallb00daad2015-11-29 19:46:20 -08005565 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08005566
5567 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08005568 pSurfaceFormatCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08005569 surfaceFormats := pSurfaceFormats[0:count]
5570
5571 for i in (0 .. count) {
5572 surfaceFormat := ?
5573 surfaceFormats[i] = surfaceFormat
5574 }
5575
5576 return ?
5577}
5578
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005579@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08005580cmd VkResult vkGetPhysicalDeviceSurfacePresentModesKHR(
5581 VkPhysicalDevice physicalDevice,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005582 VkSurfaceKHR surface,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005583 u32* pPresentModeCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005584 VkPresentModeKHR* pPresentModes) {
Jesse Hallb00daad2015-11-29 19:46:20 -08005585 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08005586
5587 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08005588 pPresentModeCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08005589 presentModes := pPresentModes[0:count]
5590
5591 for i in (0 .. count) {
5592 presentMode := ?
5593 presentModes[i] = presentMode
5594 }
5595
5596 return ?
5597}
5598
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005599@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005600cmd VkResult vkCreateSwapchainKHR(
5601 VkDevice device,
5602 const VkSwapchainCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005603 const VkAllocationCallbacks* pAllocator,
Michael Lentine88594d72015-11-12 12:49:45 -08005604 VkSwapchainKHR* pSwapchain) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005605 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR)
Michael Lentine88594d72015-11-12 12:49:45 -08005606 deviceObject := GetDevice(device)
5607
5608 swapchain := ?
5609 pSwapchain[0] = swapchain
5610 State.Swapchains[swapchain] = new!SwapchainObject(device: device)
5611
5612 return ?
5613}
5614
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005615@extension("VK_KHR_swapchain")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005616cmd void vkDestroySwapchainKHR(
Michael Lentine88594d72015-11-12 12:49:45 -08005617 VkDevice device,
Jesse Hall0e74f002015-11-30 11:37:59 -08005618 VkSwapchainKHR swapchain,
5619 const VkAllocationCallbacks* pAllocator) {
Michael Lentine88594d72015-11-12 12:49:45 -08005620 deviceObject := GetDevice(device)
5621 swapchainObject := GetSwapchain(swapchain)
5622 assert(swapchainObject.device == device)
5623
5624 State.Swapchains[swapchain] = null
Michael Lentine88594d72015-11-12 12:49:45 -08005625}
5626
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005627@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005628cmd VkResult vkGetSwapchainImagesKHR(
5629 VkDevice device,
5630 VkSwapchainKHR swapchain,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005631 u32* pSwapchainImageCount,
Michael Lentine88594d72015-11-12 12:49:45 -08005632 VkImage* pSwapchainImages) {
5633 deviceObject := GetDevice(device)
5634
5635 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08005636 pSwapchainImageCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08005637 swapchainImages := pSwapchainImages[0:count]
5638
5639 for i in (0 .. count) {
5640 swapchainImage := ?
5641 swapchainImages[i] = swapchainImage
Jesse Hall1356b0d2015-11-23 17:24:58 -08005642 State.Images[swapchainImage] = new!ImageObject(device: device)
Michael Lentine88594d72015-11-12 12:49:45 -08005643 }
5644
5645 return ?
5646}
5647
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005648@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005649cmd VkResult vkAcquireNextImageKHR(
5650 VkDevice device,
5651 VkSwapchainKHR swapchain,
5652 u64 timeout,
5653 VkSemaphore semaphore,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005654 VkFence fence,
Michael Lentine88594d72015-11-12 12:49:45 -08005655 u32* pImageIndex) {
5656 deviceObject := GetDevice(device)
5657 swapchainObject := GetSwapchain(swapchain)
5658
5659 imageIndex := ?
5660 pImageIndex[0] = imageIndex
5661
5662 return ?
5663}
5664
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005665@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005666cmd VkResult vkQueuePresentKHR(
5667 VkQueue queue,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08005668 const VkPresentInfoKHR* pPresentInfo) {
Michael Lentine88594d72015-11-12 12:49:45 -08005669 queueObject := GetQueue(queue)
5670
5671 presentInfo := ?
5672 pPresentInfo[0] = presentInfo
5673
5674 return ?
5675}
5676
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005677@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005678cmd VkResult vkGetPhysicalDeviceDisplayPropertiesKHR(
5679 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005680 u32* pPropertyCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005681 VkDisplayPropertiesKHR* pProperties) {
5682 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5683 return ?
5684}
5685
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005686@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005687cmd VkResult vkGetPhysicalDeviceDisplayPlanePropertiesKHR(
5688 VkPhysicalDevice physicalDevice,
5689 u32* pPropertyCount,
5690 VkDisplayPlanePropertiesKHR* pProperties) {
5691 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5692 return ?
5693}
5694
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005695@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005696cmd VkResult vkGetDisplayPlaneSupportedDisplaysKHR(
5697 VkPhysicalDevice physicalDevice,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005698 u32 planeIndex,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08005699 u32* pDisplayCount,
5700 VkDisplayKHR* pDisplays) {
Jesse Halla6429252015-11-29 18:59:42 -08005701 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5702 return ?
5703}
5704
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005705@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005706cmd VkResult vkGetDisplayModePropertiesKHR(
5707 VkPhysicalDevice physicalDevice,
5708 VkDisplayKHR display,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005709 u32* pPropertyCount,
5710 VkDisplayModePropertiesKHR* pProperties) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005711 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5712 return ?
5713}
5714
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005715@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005716cmd VkResult vkCreateDisplayModeKHR(
5717 VkPhysicalDevice physicalDevice,
5718 VkDisplayKHR display,
5719 const VkDisplayModeCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005720 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005721 VkDisplayModeKHR* pMode) {
5722 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5723 return ?
5724}
5725
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005726@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005727cmd VkResult vkGetDisplayPlaneCapabilitiesKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005728 VkPhysicalDevice physicalDevice,
Jesse Hall9ba8bc82015-11-30 16:22:16 -08005729 VkDisplayModeKHR mode,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005730 u32 planeIndex,
Jesse Halla6429252015-11-29 18:59:42 -08005731 VkDisplayPlaneCapabilitiesKHR* pCapabilities) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005732 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5733 return ?
5734}
5735
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005736@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005737cmd VkResult vkCreateDisplayPlaneSurfaceKHR(
5738 VkInstance instance,
5739 const VkDisplaySurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005740 const VkAllocationCallbacks* pAllocator,
Jesse Halla6429252015-11-29 18:59:42 -08005741 VkSurfaceKHR* pSurface) {
5742 return ?
5743}
5744
Jesse Hall9ba8bc82015-11-30 16:22:16 -08005745@extension("VK_KHR_display_swapchain")
5746cmd VkResult vkCreateSharedSwapchainsKHR(
5747 VkDevice device,
5748 u32 swapchainCount,
5749 const VkSwapchainCreateInfoKHR* pCreateInfos,
5750 const VkAllocationCallbacks* pAllocator,
5751 VkSwapchainKHR* pSwapchains) {
5752 return ?
5753}
5754
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005755@extension("VK_KHR_xlib_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005756cmd VkResult vkCreateXlibSurfaceKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005757 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005758 const VkXlibSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005759 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005760 VkSurfaceKHR* pSurface) {
5761 instanceObject := GetInstance(instance)
5762 return ?
5763}
5764
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005765@extension("VK_KHR_xlib_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005766cmd VkBool32 vkGetPhysicalDeviceXlibPresentationSupportKHR(
5767 VkPhysicalDevice physicalDevice,
5768 u32 queueFamilyIndex,
5769 platform.Display* dpy,
Jesse Hall65ab5522015-11-30 00:07:16 -08005770 platform.VisualID visualID) {
Jesse Halla6429252015-11-29 18:59:42 -08005771 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5772 return ?
5773}
5774
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005775@extension("VK_KHR_xcb_surface")
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005776cmd VkResult vkCreateXcbSurfaceKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005777 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005778 const VkXcbSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005779 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005780 VkSurfaceKHR* pSurface) {
5781 instanceObject := GetInstance(instance)
5782 return ?
5783}
5784
Jesse Hall523db342015-11-30 21:12:55 -08005785@extension("VK_KHR_xcb_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005786cmd VkBool32 vkGetPhysicalDeviceXcbPresentationSupportKHR(
5787 VkPhysicalDevice physicalDevice,
5788 u32 queueFamilyIndex,
5789 platform.xcb_connection_t* connection,
5790 platform.xcb_visualid_t visual_id) {
5791 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5792 return ?
5793}
5794
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005795@extension("VK_KHR_wayland_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005796cmd VkResult vkCreateWaylandSurfaceKHR(
5797 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005798 const VkWaylandSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005799 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005800 VkSurfaceKHR* pSurface) {
5801 instanceObject := GetInstance(instance)
5802 return ?
5803}
5804
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005805@extension("VK_KHR_wayland_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005806cmd VkBool32 vkGetPhysicalDeviceWaylandPresentationSupportKHR(
5807 VkPhysicalDevice physicalDevice,
5808 u32 queueFamilyIndex,
5809 platform.wl_display* display) {
5810 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5811 return ?
5812}
5813
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005814@extension("VK_KHR_mir_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005815cmd VkResult vkCreateMirSurfaceKHR(
5816 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005817 const VkMirSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005818 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005819 VkSurfaceKHR* pSurface) {
5820 instanceObject := GetInstance(instance)
5821 return ?
5822}
5823
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005824@extension("VK_KHR_mir_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005825cmd VkBool32 vkGetPhysicalDeviceMirPresentationSupportKHR(
5826 VkPhysicalDevice physicalDevice,
5827 u32 queueFamilyIndex,
5828 platform.MirConnection* connection) {
5829 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5830 return ?
5831}
5832
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005833@extension("VK_KHR_android_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005834cmd VkResult vkCreateAndroidSurfaceKHR(
5835 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005836 const VkAndroidSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005837 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005838 VkSurfaceKHR* pSurface) {
5839 instanceObject := GetInstance(instance)
5840 return ?
5841}
5842
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005843@extension("VK_KHR_win32_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005844cmd VkResult vkCreateWin32SurfaceKHR(
5845 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005846 const VkWin32SurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005847 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005848 VkSurfaceKHR* pSurface) {
5849 instanceObject := GetInstance(instance)
5850 return ?
5851}
5852
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005853@extension("VK_KHR_win32_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005854cmd VkResult vkGetPhysicalDeviceWin32PresentationSupportKHR(
5855 VkPhysicalDevice physicalDevice,
5856 u32 queueFamilyIndex) {
Jesse Halle2948d82016-02-25 04:19:32 -08005857 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Jesse Halla6429252015-11-29 18:59:42 -08005858 return ?
5859}
5860
Chia-I Wub262ddc2016-03-22 07:38:20 +08005861@extension("VK_ANDROID_native_buffer")
Jesse Halld1abd742017-02-09 21:45:51 -08005862@optional
Chia-I Wub262ddc2016-03-22 07:38:20 +08005863cmd VkResult vkGetSwapchainGrallocUsageANDROID(
5864 VkDevice device,
5865 VkFormat format,
5866 VkImageUsageFlags imageUsage,
Jesse Halld1abd742017-02-09 21:45:51 -08005867 s32* grallocUsage) {
Chia-I Wub262ddc2016-03-22 07:38:20 +08005868 return ?
5869}
5870
5871@extension("VK_ANDROID_native_buffer")
Jesse Halld1abd742017-02-09 21:45:51 -08005872@optional
Chris Forbes8e4438b2016-12-07 16:26:49 +13005873cmd VkResult vkGetSwapchainGrallocUsage2ANDROID(
5874 VkDevice device,
5875 VkFormat format,
5876 VkImageUsageFlags imageUsage,
5877 VkSwapchainImageUsageFlagsANDROID swapchainImageUsage,
Jesse Halld1abd742017-02-09 21:45:51 -08005878 u64* grallocConsumerUsage,
5879 u64* grallocProducerUsage) {
Chris Forbes8e4438b2016-12-07 16:26:49 +13005880 return ?
5881}
5882
5883@extension("VK_ANDROID_native_buffer")
Chia-I Wub262ddc2016-03-22 07:38:20 +08005884cmd VkResult vkAcquireImageANDROID(
5885 VkDevice device,
5886 VkImage image,
5887 int nativeFenceFd,
5888 VkSemaphore semaphore,
5889 VkFence fence) {
5890 return ?
5891}
5892
5893@extension("VK_ANDROID_native_buffer")
5894cmd VkResult vkQueueSignalReleaseImageANDROID(
5895 VkQueue queue,
5896 u32 waitSemaphoreCount,
5897 const VkSemaphore* pWaitSemaphores,
5898 VkImage image,
5899 int* pNativeFenceFd) {
5900 return ?
5901}
5902
Ian Elliott4c8bb2a2016-12-29 11:07:26 -07005903@extension("VK_GOOGLE_display_timing")
5904cmd VkResult vkGetRefreshCycleDurationGOOGLE(
5905 VkDevice device,
5906 VkSwapchainKHR swapchain,
5907 VkRefreshCycleDurationGOOGLE* pDisplayTimingProperties) {
5908 deviceObject := GetDevice(device)
5909 swapchainObject := GetSwapchain(swapchain)
5910
5911 displayTimingProperties := ?
5912 pDisplayTimingProperties[0] = displayTimingProperties
5913
5914 return ?
5915}
5916
5917@extension("VK_GOOGLE_display_timing")
5918cmd VkResult vkGetPastPresentationTimingGOOGLE(
5919 VkDevice device,
5920 VkSwapchainKHR swapchain,
5921 u32* pPresentationTimingCount,
5922 VkPastPresentationTimingGOOGLE* pPresentationTimings) {
Ian Elliott4c8bb2a2016-12-29 11:07:26 -07005923 return ?
5924}
5925
Jesse Hall715b86a2016-01-16 16:34:29 -08005926@extension("VK_EXT_debug_report")
5927@external type void* PFN_vkDebugReportCallbackEXT
5928@extension("VK_EXT_debug_report")
5929@pfn cmd VkBool32 vkDebugReportCallbackEXT(
5930 VkDebugReportFlagsEXT flags,
5931 VkDebugReportObjectTypeEXT objectType,
5932 u64 object,
5933 platform.size_t location,
5934 s32 messageCode,
5935 const char* pLayerPrefix,
5936 const char* pMessage,
5937 void* pUserData) {
5938 return ?
5939}
5940
5941@extension("VK_EXT_debug_report")
5942cmd VkResult vkCreateDebugReportCallbackEXT(
5943 VkInstance instance,
5944 const VkDebugReportCallbackCreateInfoEXT* pCreateInfo,
5945 const VkAllocationCallbacks* pAllocator,
5946 VkDebugReportCallbackEXT* pCallback) {
5947 return ?
5948}
5949
5950@extension("VK_EXT_debug_report")
5951cmd void vkDestroyDebugReportCallbackEXT(
5952 VkInstance instance,
5953 VkDebugReportCallbackEXT callback,
5954 const VkAllocationCallbacks* pAllocator) {
5955}
5956
5957@extension("VK_EXT_debug_report")
5958cmd void vkDebugReportMessageEXT(
5959 VkInstance instance,
5960 VkDebugReportFlagsEXT flags,
5961 VkDebugReportObjectTypeEXT objectType,
5962 u64 object,
5963 platform.size_t location,
5964 s32 messageCode,
5965 const char* pLayerPrefix,
5966 const char* pMessage) {
5967}
5968
Jesse Hall26763382016-05-20 07:13:52 -07005969@extension("VK_EXT_debug_marker")
5970cmd VkResult vkDebugMarkerSetObjectTagEXT(
5971 VkDevice device,
5972 VkDebugMarkerObjectTagInfoEXT* pTagInfo) {
5973 return ?
5974}
5975
5976@extension("VK_EXT_debug_marker")
5977cmd VkResult vkDebugMarkerSetObjectNameEXT(
5978 VkDevice device,
5979 VkDebugMarkerObjectNameInfoEXT* pNameInfo) {
5980 return ?
5981}
5982
5983@extension("VK_EXT_debug_marker")
5984cmd void vkCmdDebugMarkerBeginEXT(
5985 VkCommandBuffer commandBuffer,
5986 VkDebugMarkerMarkerInfoEXT* pMarkerInfo) {
5987}
5988
5989@extension("VK_EXT_debug_marker")
5990cmd void vkCmdDebugMarkerEndEXT(
5991 VkCommandBuffer commandBuffer) {
5992}
5993
5994@extension("VK_EXT_debug_marker")
5995cmd void vkCmdDebugMarkerInsertEXT(
5996 VkCommandBuffer commandBuffer,
5997 VkDebugMarkerMarkerInfoEXT* pMarkerInfo) {
5998}
5999
Chris Forbes1194ede2016-12-30 16:29:25 +13006000@extension("VK_KHR_get_physical_device_properties2")
6001cmd void vkGetPhysicalDeviceFeatures2KHR(
6002 VkPhysicalDevice physicalDevice,
6003 VkPhysicalDeviceFeatures2KHR* pFeatures) {
6004}
6005
6006@extension("VK_KHR_get_physical_device_properties2")
6007cmd void vkGetPhysicalDeviceProperties2KHR(
6008 VkPhysicalDevice physicalDevice,
6009 VkPhysicalDeviceProperties2KHR* pProperties) {
6010}
6011
6012@extension("VK_KHR_get_physical_device_properties2")
6013cmd void vkGetPhysicalDeviceFormatProperties2KHR(
6014 VkPhysicalDevice physicalDevice,
6015 VkFormat format,
6016 VkFormatProperties2KHR* pFormatProperties) {
6017}
6018
6019@extension("VK_KHR_get_physical_device_properties2")
6020cmd VkResult vkGetPhysicalDeviceImageFormatProperties2KHR(
6021 VkPhysicalDevice physicalDevice,
6022 const VkPhysicalDeviceImageFormatInfo2KHR* pImageFormatInfo,
6023 VkImageFormatProperties2KHR* pImageFormatProperties) {
6024 return ?
6025}
6026
6027@extension("VK_KHR_get_physical_device_properties2")
6028cmd void vkGetPhysicalDeviceQueueFamilyProperties2KHR(
6029 VkPhysicalDevice physicalDevice,
6030 u32* pQueueFamilyPropertyCount,
6031 VkQueueFamilyProperties2KHR* pQueueFamilyProperties) {
6032}
6033
6034@extension("VK_KHR_get_physical_device_properties2")
6035cmd void vkGetPhysicalDeviceMemoryProperties2KHR(
6036 VkPhysicalDevice physicalDevice,
6037 VkPhysicalDeviceMemoryProperties2KHR* pMemoryProperties) {
6038}
6039
6040@extension("VK_KHR_get_physical_device_properties2")
6041cmd void vkGetPhysicalDeviceSparseImageFormatProperties2KHR(
6042 VkPhysicalDevice physicalDevice,
6043 const VkPhysicalDeviceSparseImageFormatInfo2KHR* pFormatInfo,
6044 u32* pPropertyCount,
6045 VkSparseImageFormatProperties2KHR* pProperties) {
6046}
6047
Chris Forbes289cb792016-12-30 15:03:55 +13006048@extension("VK_AMD_draw_indirect_count")
6049cmd void vkCmdDrawIndirectCountAMD(
6050 VkCommandBuffer commandBuffer,
6051 VkBuffer buffer,
6052 VkDeviceSize offset,
6053 VkBuffer countBuffer,
6054 VkDeviceSize countBufferOffset,
6055 u32 maxDrawCount,
6056 u32 stride) {
6057}
6058
6059@extension("VK_AMD_draw_indirect_count")
6060cmd void vkCmdDrawIndexedIndirectCountAMD(
6061 VkCommandBuffer commandBuffer,
6062 VkBuffer buffer,
6063 VkDeviceSize offset,
6064 VkBuffer countBuffer,
6065 VkDeviceSize countBufferOffset,
6066 u32 maxDrawCount,
6067 u32 stride) {
6068}
6069
6070@extension("VK_NV_external_memory_capabilities")
6071cmd VkResult vkGetPhysicalDeviceExternalImageFormatPropertiesNV(
6072 VkPhysicalDevice physicalDevice,
6073 VkFormat format,
6074 VkImageType type,
6075 VkImageTiling tiling,
6076 VkImageUsageFlags usage,
6077 VkImageCreateFlags flags,
6078 VkExternalMemoryHandleTypeFlagsNV externalHandleType,
6079 VkExternalImageFormatPropertiesNV* pExternalImageFormatProperties) {
6080 return ?
6081}
6082
6083@extension("VK_NV_external_memory_win32")
6084cmd VkResult vkGetMemoryWin32HandleNV(
6085 VkDevice device,
6086 VkDeviceMemory memory,
6087 VkExternalMemoryHandleTypeFlagsNV handleType,
6088 platform.HANDLE* pHandle) {
6089 return ?
6090}
6091
6092@extension("VK_NV_external_memory_win32")
6093cmd void vkCmdProcessCommandsNVX(
6094 VkCommandBuffer commandBuffer,
6095 const VkCmdProcessCommandsInfoNVX* pProcessCommandsInfo) {
6096}
6097
6098@extension("VK_NV_external_memory_win32")
6099cmd void vkCmdReserveSpaceForCommandsNVX(
6100 VkCommandBuffer commandBuffer,
6101 const VkCmdReserveSpaceForCommandsInfoNVX* pReserveSpaceInfo) {
6102}
6103
6104@extension("VK_NV_external_memory_win32")
6105cmd VkResult vkCreateIndirectCommandsLayoutNVX(
6106 VkDevice device,
6107 const VkIndirectCommandsLayoutCreateInfoNVX* pCreateInfo,
6108 const VkAllocationCallbacks* pAllocator,
6109 VkIndirectCommandsLayoutNVX* pIndirectCommandsLayout) {
6110 return ?
6111}
6112
6113@extension("VK_NV_external_memory_win32")
6114cmd void vkDestroyIndirectCommandsLayoutNVX(
6115 VkDevice device,
6116 VkIndirectCommandsLayoutNVX indirectCommandsLayout,
6117 const VkAllocationCallbacks* pAllocator) {
6118}
6119
6120@extension("VK_NV_external_memory_win32")
6121cmd VkResult vkCreateObjectTableNVX(
6122 VkDevice device,
6123 const VkObjectTableCreateInfoNVX* pCreateInfo,
6124 const VkAllocationCallbacks* pAllocator,
6125 VkObjectTableNVX* pObjectTable) {
6126 return ?
6127}
6128
6129@extension("VK_NV_external_memory_win32")
6130cmd void vkDestroyObjectTableNVX(
6131 VkDevice device,
6132 VkObjectTableNVX objectTable,
6133 const VkAllocationCallbacks* pAllocator) {
6134}
6135
6136@extension("VK_NV_external_memory_win32")
6137cmd VkResult vkRegisterObjectsNVX(
6138 VkDevice device,
6139 VkObjectTableNVX objectTable,
6140 u32 objectCount,
6141 const VkObjectTableEntryNVX* const* ppObjectTableEntries,
6142 const u32* pObjectIndices) {
6143 return ?
6144}
6145
6146@extension("VK_NV_external_memory_win32")
6147cmd VkResult vkUnregisterObjectsNVX(
6148 VkDevice device,
6149 VkObjectTableNVX objectTable,
6150 u32 objectCount,
6151 const VkObjectEntryTypeNVX* pObjectEntryTypes,
6152 const u32* pObjectIndices) {
6153 return ?
6154}
6155
6156@extension("VK_NV_external_memory_win32")
6157cmd void vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX(
6158 VkPhysicalDevice physicalDevice,
6159 VkDeviceGeneratedCommandsFeaturesNVX* pFeatures,
6160 VkDeviceGeneratedCommandsLimitsNVX* pLimits) {
6161}
6162
Chris Forbes1d5f68c2017-01-31 10:17:01 +13006163@extension("VK_KHR_shared_presentable_image")
Chris Forbes2e12cb82017-01-18 11:45:17 +13006164cmd VkResult vkGetSwapchainStatusKHR(
6165 VkDevice device,
6166 VkSwapchainKHR swapchain) {
6167 return ?
6168}
6169
Courtney Goeltzenleuchterd634c482017-01-05 15:55:31 -07006170@extension("VK_EXT_hdr_metadata")
6171cmd void vkSetHdrMetadataEXT(
6172 VkDevice device,
6173 u32 swapchainCount,
6174 const VkSwapchainKHR* pSwapchains,
6175 const VkHdrMetadataEXT* pMetadata) {
6176}
6177
Jesse Halld27f6aa2015-08-15 17:58:48 -07006178
6179////////////////
6180// Validation //
6181////////////////
6182
6183extern void validate(string layerName, bool condition, string message)
6184
6185
6186/////////////////////////////
6187// Internal State Tracking //
6188/////////////////////////////
6189
6190StateObject State
6191
6192@internal class StateObject {
6193 // Dispatchable objects.
6194 map!(VkInstance, ref!InstanceObject) Instances
6195 map!(VkPhysicalDevice, ref!PhysicalDeviceObject) PhysicalDevices
6196 map!(VkDevice, ref!DeviceObject) Devices
6197 map!(VkQueue, ref!QueueObject) Queues
Jesse Hall3fbc8562015-11-29 22:10:52 -08006198 map!(VkCommandBuffer, ref!CommandBufferObject) CommandBuffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07006199
6200 // Non-dispatchable objects.
6201 map!(VkDeviceMemory, ref!DeviceMemoryObject) DeviceMemories
6202 map!(VkBuffer, ref!BufferObject) Buffers
6203 map!(VkBufferView, ref!BufferViewObject) BufferViews
6204 map!(VkImage, ref!ImageObject) Images
6205 map!(VkImageView, ref!ImageViewObject) ImageViews
Jesse Halld27f6aa2015-08-15 17:58:48 -07006206 map!(VkShaderModule, ref!ShaderModuleObject) ShaderModules
Jesse Halld27f6aa2015-08-15 17:58:48 -07006207 map!(VkPipeline, ref!PipelineObject) Pipelines
6208 map!(VkPipelineLayout, ref!PipelineLayoutObject) PipelineLayouts
6209 map!(VkSampler, ref!SamplerObject) Samplers
6210 map!(VkDescriptorSet, ref!DescriptorSetObject) DescriptorSets
6211 map!(VkDescriptorSetLayout, ref!DescriptorSetLayoutObject) DescriptorSetLayouts
6212 map!(VkDescriptorPool, ref!DescriptorPoolObject) DescriptorPools
Jesse Halld27f6aa2015-08-15 17:58:48 -07006213 map!(VkFence, ref!FenceObject) Fences
6214 map!(VkSemaphore, ref!SemaphoreObject) Semaphores
6215 map!(VkEvent, ref!EventObject) Events
6216 map!(VkQueryPool, ref!QueryPoolObject) QueryPools
6217 map!(VkFramebuffer, ref!FramebufferObject) Framebuffers
6218 map!(VkRenderPass, ref!RenderPassObject) RenderPasses
6219 map!(VkPipelineCache, ref!PipelineCacheObject) PipelineCaches
Jesse Hall3fbc8562015-11-29 22:10:52 -08006220 map!(VkCommandPool, ref!CommandPoolObject) CommandPools
Jesse Hall1356b0d2015-11-23 17:24:58 -08006221 map!(VkSurfaceKHR, ref!SurfaceObject) Surfaces
Michael Lentine88594d72015-11-12 12:49:45 -08006222 map!(VkSwapchainKHR, ref!SwapchainObject) Swapchains
Jesse Halld27f6aa2015-08-15 17:58:48 -07006223}
6224
6225@internal class InstanceObject {
6226}
6227
6228@internal class PhysicalDeviceObject {
6229 VkInstance instance
6230}
6231
6232@internal class DeviceObject {
6233 VkPhysicalDevice physicalDevice
6234}
6235
6236@internal class QueueObject {
6237 VkDevice device
6238 VkQueueFlags flags
6239}
6240
Jesse Hall3fbc8562015-11-29 22:10:52 -08006241@internal class CommandBufferObject {
Jesse Halld27f6aa2015-08-15 17:58:48 -07006242 VkDevice device
6243 map!(u64, VkDeviceMemory) boundObjects
6244 VkQueueFlags queueFlags
6245}
6246
6247@internal class DeviceMemoryObject {
Jesse Hall3fbc8562015-11-29 22:10:52 -08006248 VkDevice device
6249 VkDeviceSize allocationSize
6250 map!(u64, VkDeviceSize) boundObjects
6251 map!(VkCommandBuffer, VkCommandBuffer) boundCommandBuffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07006252}
6253
6254@internal class BufferObject {
6255 VkDevice device
Jesse Hall3fbc8562015-11-29 22:10:52 -08006256 VkDeviceMemory memory
6257 VkDeviceSize memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07006258}
6259
6260@internal class BufferViewObject {
6261 VkDevice device
6262 VkBuffer buffer
6263}
6264
6265@internal class ImageObject {
6266 VkDevice device
Jesse Hall3fbc8562015-11-29 22:10:52 -08006267 VkDeviceMemory memory
6268 VkDeviceSize memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07006269}
6270
6271@internal class ImageViewObject {
6272 VkDevice device
6273 VkImage image
6274}
6275
Jesse Halld27f6aa2015-08-15 17:58:48 -07006276@internal class ShaderObject {
6277 VkDevice device
6278}
6279
6280@internal class ShaderModuleObject {
6281 VkDevice device
6282}
6283
6284@internal class PipelineObject {
6285 VkDevice device
6286}
6287
6288@internal class PipelineLayoutObject {
6289 VkDevice device
6290}
6291
6292@internal class SamplerObject {
6293 VkDevice device
6294}
6295
6296@internal class DescriptorSetObject {
6297 VkDevice device
6298}
6299
6300@internal class DescriptorSetLayoutObject {
6301 VkDevice device
6302}
6303
6304@internal class DescriptorPoolObject {
6305 VkDevice device
6306}
6307
Jesse Halld27f6aa2015-08-15 17:58:48 -07006308@internal class FenceObject {
6309 VkDevice device
6310 bool signaled
6311}
6312
6313@internal class SemaphoreObject {
6314 VkDevice device
6315}
6316
6317@internal class EventObject {
6318 VkDevice device
6319}
6320
6321@internal class QueryPoolObject {
6322 VkDevice device
6323}
6324
6325@internal class FramebufferObject {
6326 VkDevice device
6327}
6328
6329@internal class RenderPassObject {
6330 VkDevice device
6331}
6332
6333@internal class PipelineCacheObject {
6334 VkDevice device
6335}
6336
Jesse Hall3fbc8562015-11-29 22:10:52 -08006337@internal class CommandPoolObject {
Jesse Halld27f6aa2015-08-15 17:58:48 -07006338 VkDevice device
6339}
6340
Jesse Hall1356b0d2015-11-23 17:24:58 -08006341@internal class SurfaceObject {
6342 VkInstance instance
6343}
6344
Michael Lentine88594d72015-11-12 12:49:45 -08006345@internal class SwapchainObject {
6346 VkDevice device
6347}
6348
Jesse Halld27f6aa2015-08-15 17:58:48 -07006349macro ref!InstanceObject GetInstance(VkInstance instance) {
6350 assert(instance in State.Instances)
6351 return State.Instances[instance]
6352}
6353
6354macro ref!PhysicalDeviceObject GetPhysicalDevice(VkPhysicalDevice physicalDevice) {
6355 assert(physicalDevice in State.PhysicalDevices)
6356 return State.PhysicalDevices[physicalDevice]
6357}
6358
6359macro ref!DeviceObject GetDevice(VkDevice device) {
6360 assert(device in State.Devices)
6361 return State.Devices[device]
6362}
6363
6364macro ref!QueueObject GetQueue(VkQueue queue) {
6365 assert(queue in State.Queues)
6366 return State.Queues[queue]
6367}
6368
Jesse Hall3fbc8562015-11-29 22:10:52 -08006369macro ref!CommandBufferObject GetCommandBuffer(VkCommandBuffer commandBuffer) {
6370 assert(commandBuffer in State.CommandBuffers)
6371 return State.CommandBuffers[commandBuffer]
Jesse Halld27f6aa2015-08-15 17:58:48 -07006372}
6373
Jesse Hall3fbc8562015-11-29 22:10:52 -08006374macro ref!DeviceMemoryObject GetDeviceMemory(VkDeviceMemory memory) {
6375 assert(memory in State.DeviceMemories)
6376 return State.DeviceMemories[memory]
Jesse Halld27f6aa2015-08-15 17:58:48 -07006377}
6378
6379macro ref!BufferObject GetBuffer(VkBuffer buffer) {
6380 assert(buffer in State.Buffers)
6381 return State.Buffers[buffer]
6382}
6383
6384macro ref!BufferViewObject GetBufferView(VkBufferView bufferView) {
6385 assert(bufferView in State.BufferViews)
6386 return State.BufferViews[bufferView]
6387}
6388
6389macro ref!ImageObject GetImage(VkImage image) {
6390 assert(image in State.Images)
6391 return State.Images[image]
6392}
6393
6394macro ref!ImageViewObject GetImageView(VkImageView imageView) {
6395 assert(imageView in State.ImageViews)
6396 return State.ImageViews[imageView]
6397}
6398
Jesse Halld27f6aa2015-08-15 17:58:48 -07006399macro ref!ShaderModuleObject GetShaderModule(VkShaderModule shaderModule) {
6400 assert(shaderModule in State.ShaderModules)
6401 return State.ShaderModules[shaderModule]
6402}
6403
6404macro ref!PipelineObject GetPipeline(VkPipeline pipeline) {
6405 assert(pipeline in State.Pipelines)
6406 return State.Pipelines[pipeline]
6407}
6408
6409macro ref!PipelineLayoutObject GetPipelineLayout(VkPipelineLayout pipelineLayout) {
6410 assert(pipelineLayout in State.PipelineLayouts)
6411 return State.PipelineLayouts[pipelineLayout]
6412}
6413
6414macro ref!SamplerObject GetSampler(VkSampler sampler) {
6415 assert(sampler in State.Samplers)
6416 return State.Samplers[sampler]
6417}
6418
6419macro ref!DescriptorSetObject GetDescriptorSet(VkDescriptorSet descriptorSet) {
6420 assert(descriptorSet in State.DescriptorSets)
6421 return State.DescriptorSets[descriptorSet]
6422}
6423
6424macro ref!DescriptorSetLayoutObject GetDescriptorSetLayout(VkDescriptorSetLayout descriptorSetLayout) {
6425 assert(descriptorSetLayout in State.DescriptorSetLayouts)
6426 return State.DescriptorSetLayouts[descriptorSetLayout]
6427}
6428
6429macro ref!DescriptorPoolObject GetDescriptorPool(VkDescriptorPool descriptorPool) {
6430 assert(descriptorPool in State.DescriptorPools)
6431 return State.DescriptorPools[descriptorPool]
6432}
6433
Jesse Halld27f6aa2015-08-15 17:58:48 -07006434macro ref!FenceObject GetFence(VkFence fence) {
6435 assert(fence in State.Fences)
6436 return State.Fences[fence]
6437}
6438
6439macro ref!SemaphoreObject GetSemaphore(VkSemaphore semaphore) {
6440 assert(semaphore in State.Semaphores)
6441 return State.Semaphores[semaphore]
6442}
6443
6444macro ref!EventObject GetEvent(VkEvent event) {
6445 assert(event in State.Events)
6446 return State.Events[event]
6447}
6448
6449macro ref!QueryPoolObject GetQueryPool(VkQueryPool queryPool) {
6450 assert(queryPool in State.QueryPools)
6451 return State.QueryPools[queryPool]
6452}
6453
6454macro ref!FramebufferObject GetFramebuffer(VkFramebuffer framebuffer) {
6455 assert(framebuffer in State.Framebuffers)
6456 return State.Framebuffers[framebuffer]
6457}
6458
6459macro ref!RenderPassObject GetRenderPass(VkRenderPass renderPass) {
6460 assert(renderPass in State.RenderPasses)
6461 return State.RenderPasses[renderPass]
6462}
6463
6464macro ref!PipelineCacheObject GetPipelineCache(VkPipelineCache pipelineCache) {
6465 assert(pipelineCache in State.PipelineCaches)
6466 return State.PipelineCaches[pipelineCache]
6467}
6468
Jesse Hall3fbc8562015-11-29 22:10:52 -08006469macro ref!CommandPoolObject GetCommandPool(VkCommandPool commandPool) {
6470 assert(commandPool in State.CommandPools)
6471 return State.CommandPools[commandPool]
Jesse Hallf09c6b12015-08-15 19:54:28 -07006472}
Michael Lentine88594d72015-11-12 12:49:45 -08006473
Jesse Hall1356b0d2015-11-23 17:24:58 -08006474macro ref!SurfaceObject GetSurface(VkSurfaceKHR surface) {
6475 assert(surface in State.Surfaces)
6476 return State.Surfaces[surface]
6477}
6478
Michael Lentine88594d72015-11-12 12:49:45 -08006479macro ref!SwapchainObject GetSwapchain(VkSwapchainKHR swapchain) {
6480 assert(swapchain in State.Swapchains)
6481 return State.Swapchains[swapchain]
6482}
Jesse Halld8bade02015-11-24 10:24:18 -08006483
6484macro VkQueueFlags AddQueueFlag(VkQueueFlags flags, VkQueueFlagBits bit) {
6485 return as!VkQueueFlags(as!u32(flags) | as!u32(bit))
6486}