blob: 467ae7a691645c4e95c8aa841e21e09dda50c582 [file] [log] [blame]
Jesse Halld27f6aa2015-08-15 17:58:48 -07001// Copyright (c) 2015 The Khronos Group Inc.
2//
3// Permission is hereby granted, free of charge, to any person obtaining a
4// copy of this software and/or associated documentation files (the
5// "Materials"), to deal in the Materials without restriction, including
6// without limitation the rights to use, copy, modify, merge, publish,
7// distribute, sublicense, and/or sell copies of the Materials, and to
8// permit persons to whom the Materials are furnished to do so, subject to
9// the following conditions:
10//
11// The above copyright notice and this permission notice shall be included
12// in all copies or substantial portions of the Materials.
13//
14// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20// MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
21
22import platform "platform.api"
23
24///////////////
25// Constants //
26///////////////
27
28// API version (major.minor.patch)
Jesse Hall3dd678a2016-01-08 21:52:01 -080029define VERSION_MAJOR 1
30define VERSION_MINOR 0
Chris Forbes289cb792016-12-30 15:03:55 +130031define VERSION_PATCH 38
Jesse Halld27f6aa2015-08-15 17:58:48 -070032
33// API limits
Jesse Hall65ab5522015-11-30 00:07:16 -080034define VK_MAX_PHYSICAL_DEVICE_NAME_SIZE 256
35define VK_UUID_SIZE 16
36define VK_MAX_EXTENSION_NAME_SIZE 256
37define VK_MAX_DESCRIPTION_SIZE 256
38define VK_MAX_MEMORY_TYPES 32
39define VK_MAX_MEMORY_HEAPS 16 /// The maximum number of unique memory heaps, each of which supporting 1 or more memory types.
Jesse Halld27f6aa2015-08-15 17:58:48 -070040
41// API keywords
42define VK_TRUE 1
43define VK_FALSE 0
Jesse Hall5ae3abb2015-10-08 14:00:22 -070044
45// API keyword, but needs special handling by some templates
46define NULL_HANDLE 0
Jesse Halld27f6aa2015-08-15 17:58:48 -070047
Jesse Hall33faaad2016-01-24 21:00:49 -080048@extension("VK_KHR_surface") define VK_KHR_SURFACE_SPEC_VERSION 25
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080049@extension("VK_KHR_surface") define VK_KHR_SURFACE_EXTENSION_NAME "VK_KHR_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080050
Jesse Hall26763382016-05-20 07:13:52 -070051@extension("VK_KHR_swapchain") define VK_KHR_SWAPCHAIN_SPEC_VERSION 68
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080052@extension("VK_KHR_swapchain") define VK_KHR_SWAPCHAIN_EXTENSION_NAME "VK_KHR_swapchain"
Jesse Hall1356b0d2015-11-23 17:24:58 -080053
Jesse Hall543a7ff2016-01-08 16:38:30 -080054@extension("VK_KHR_display") define VK_KHR_DISPLAY_SPEC_VERSION 21
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080055@extension("VK_KHR_display") define VK_KHR_DISPLAY_EXTENSION_NAME "VK_KHR_display"
Jesse Hall1356b0d2015-11-23 17:24:58 -080056
Jesse Hall543a7ff2016-01-08 16:38:30 -080057@extension("VK_KHR_display_swapchain") define VK_KHR_DISPLAY_SWAPCHAIN_SPEC_VERSION 9
Jesse Hall0e74f002015-11-30 11:37:59 -080058@extension("VK_KHR_display_swapchain") define VK_KHR_DISPLAY_SWAPCHAIN_EXTENSION_NAME "VK_KHR_display_swapchain"
Jesse Hall1356b0d2015-11-23 17:24:58 -080059
Jesse Hall543a7ff2016-01-08 16:38:30 -080060@extension("VK_KHR_xlib_surface") define VK_KHR_XLIB_SURFACE_SPEC_VERSION 6
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080061@extension("VK_KHR_xlib_surface") define VK_KHR_XLIB_SURFACE_NAME "VK_KHR_xlib_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080062
Jesse Hall543a7ff2016-01-08 16:38:30 -080063@extension("VK_KHR_xcb_surface") define VK_KHR_XCB_SURFACE_SPEC_VERSION 6
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080064@extension("VK_KHR_xcb_surface") define VK_KHR_XCB_SURFACE_NAME "VK_KHR_xcb_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080065
Jesse Hall543a7ff2016-01-08 16:38:30 -080066@extension("VK_KHR_wayland_surface") define VK_KHR_WAYLAND_SURFACE_SPEC_VERSION 5
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080067@extension("VK_KHR_wayland_surface") define VK_KHR_WAYLAND_SURFACE_NAME "VK_KHR_wayland_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080068
Jesse Hall543a7ff2016-01-08 16:38:30 -080069@extension("VK_KHR_mir_surface") define VK_KHR_MIR_SURFACE_SPEC_VERSION 4
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080070@extension("VK_KHR_mir_surface") define VK_KHR_MIR_SURFACE_NAME "VK_KHR_mir_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080071
Jesse Hall33faaad2016-01-24 21:00:49 -080072@extension("VK_KHR_android_surface") define VK_KHR_ANDROID_SURFACE_SPEC_VERSION 6
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080073@extension("VK_KHR_android_surface") define VK_KHR_ANDROID_SURFACE_NAME "VK_KHR_android_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080074
Jesse Hall543a7ff2016-01-08 16:38:30 -080075@extension("VK_KHR_win32_surface") define VK_KHR_WIN32_SURFACE_SPEC_VERSION 5
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080076@extension("VK_KHR_win32_surface") define VK_KHR_WIN32_SURFACE_NAME "VK_KHR_win32_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080077
Ian Elliott948233a2017-01-06 12:13:23 -070078@extension("VK_KHR_incremental_present") define VK_KHR_INCREMENTAL_PRESENT_SPEC_VERSION 1
79@extension("VK_KHR_incremental_present") define VK_KHR_INCREMENTAL_PRESENT_NAME "VK_KHR_incremental_present"
80
Chris Forbes8e4438b2016-12-07 16:26:49 +130081@extension("VK_ANDROID_native_buffer") define VK_ANDROID_NATIVE_BUFFER_SPEC_VERSION 6
Chia-I Wub262ddc2016-03-22 07:38:20 +080082@extension("VK_ANDROID_native_buffer") define VK_ANDROID_NATIVE_BUFFER_NAME "VK_ANDROID_native_buffer"
83
Ian Elliott4c8bb2a2016-12-29 11:07:26 -070084@extension("VK_GOOGLE_display_timing") define VK_GOOGLE_DISPLAY_TIMING_SPEC_VERSION 1
85@extension("VK_GOOGLE_display_timing") define VK_GOOGLE_DISPLAY_TIMING_NAME "VK_GOOGLE_display_timing"
86
Chris Forbes289cb792016-12-30 15:03:55 +130087@extension("VK_EXT_debug_report") define VK_EXT_DEBUG_REPORT_SPEC_VERSION 4
Jesse Hall715b86a2016-01-16 16:34:29 -080088@extension("VK_EXT_debug_report") define VK_EXT_DEBUG_REPORT_NAME "VK_EXT_debug_report"
89
Jesse Hall26763382016-05-20 07:13:52 -070090@extension("VK_NV_glsl_shader") define VK_NV_GLSL_SHADER_SPEC_VERSION 1
91@extension("VK_NV_glsl_shader") define VK_NV_GLSL_SHADER_NAME "VK_NV_glsl_shader"
92
93@extension("VK_KHR_sampler_mirror_clamp_to_edge") define VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_SPEC_VERSION 1
94@extension("VK_KHR_sampler_mirror_clamp_to_edge") define VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_NAME "VK_KHR_sampler_mirror_clamp_to_edge"
95
96@extension("VK_IMG_filter_cubic") define VK_IMG_FILTER_CUBIC_SPEC_VERSION 1
97@extension("VK_IMG_filter_cubic") define VK_IMG_FILTER_CUBIC_NAME "VK_IMG_filter_cubic"
98
99@extension("VK_AMD_rasterization_order") define VK_AMD_RASTERIZATION_ORDER_SPEC_VERSION 1
100@extension("VK_AMD_rasterization_order") define VK_AMD_RASTERIZATION_ORDER_NAME "VK_AMD_rasterization_order"
101
Jesse Hall56d386a2016-07-26 15:20:40 -0700102@extension("VK_AMD_shader_trinary_minmax") define VK_AMD_SHADER_TRINARY_MINMAX_SPEC_VERSION 1
103@extension("VK_AMD_shader_trinary_minmax") define VK_AMD_SHADER_TRINARY_MINMAX_EXTENSION_NAME "VK_AMD_shader_trinary_minmax"
104
105@extension("VK_AMD_shader_explicit_vertex_parameter") define VK_AMD_SHADER_EXPLICIT_VERTEX_PARAMETER_SPEC_VERSION 1
106@extension("VK_AMD_shader_explicit_vertex_parameter") define VK_AMD_SHADER_EXPLICIT_VERTEX_PARAMETER_EXTENSION_NAME "VK_AMD_shader_explicit_vertex_parameter"
107
Jesse Hall26763382016-05-20 07:13:52 -0700108@extension("VK_EXT_debug_marker") define VK_EXT_DEBUG_MARKER_SPEC_VERSION 3
109@extension("VK_EXT_debug_marker") define VK_EXT_DEBUG_MARKER_NAME "VK_EXT_debug_marker"
110
Jesse Hall56d386a2016-07-26 15:20:40 -0700111@extension("VK_AMD_gcn_shader") define VK_AMD_GCN_SHADER_SPEC_VERSION 1
112@extension("VK_AMD_gcn_shader") define VK_AMD_GCN_SHADER_EXTENSION_NAME "VK_AMD_gcn_shader"
113
114@extension("VK_NV_dedicated_allocation") define VK_NV_DEDICATED_ALLOCATION_SPEC_VERSION 1
115@extension("VK_NV_dedicated_allocation") define VK_NV_DEDICATED_ALLOCATION_EXTENSION_NAME "VK_NV_dedicated_allocation"
116
Chris Forbes1194ede2016-12-30 16:29:25 +1300117@extension("VK_KHR_get_physical_device_properties2") define VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_SPEC_VERSION 1
118@extension("VK_KHR_get_physical_device_properties2") define VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME "VK_KHR_get_physical_device_properties2"
119
Chris Forbes289cb792016-12-30 15:03:55 +1300120@extension("VK_AMD_draw_indirect_count") define VK_AMD_DRAW_INDIRECT_COUNT_SPEC_VERSION 1
121@extension("VK_AMD_draw_indirect_count") define VK_AMD_DRAW_INDIRECT_COUNT_EXTENSION_NAME "VK_AMD_draw_indirect_count"
122
123@extension("VK_AMD_negative_viewport_height") define VK_AMD_NEGATIVE_VIEWPORT_HEIGHT_SPEC_VERSION 1
124@extension("VK_AMD_negative_viewport_height") define VK_AMD_NEGATIVE_VIEWPORT_HEIGHT_EXTENSION_NAME "VK_AMD_negative_viewport_height"
125
126@extension("VK_AMD_gpu_shader_half_float") define VK_AMD_GPU_SHADER_HALF_FLOAT_SPEC_VERSION 1
127@extension("VK_AMD_gpu_shader_half_float") define VK_AMD_GPU_SHADER_HALF_FLOAT_EXTENSION_NAME "VK_AMD_gpu_shader_half_float"
128
129@extension("VK_AMD_shader_ballot") define VK_AMD_SHADER_BALLOT_SPEC_VERSION 1
130@extension("VK_AMD_shader_ballot") define VK_AMD_SHADER_BALLOT_EXTENSION_NAME "VK_AMD_shader_ballot"
131
132@extension("VK_IMG_format_pvrtc") define VK_IMG_FORMAT_PVRTC_SPEC_VERSION 1
133@extension("VK_IMG_format_pvrtc") define VK_IMG_FORMAT_PVRTC_EXTENSION_NAME "VK_IMG_format_pvrtc"
134
135@extension("VK_NV_external_memory_capabilities") define VK_NV_EXTERNAL_MEMORY_CAPABILITIES_SPEC_VERSION 1
136@extension("VK_NV_external_memory_capabilities") define VK_NV_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME "VK_NV_external_memory_capabilities"
137
138@extension("VK_NV_external_memory") define VK_NV_EXTERNAL_MEMORY_SPEC_VERSION 1
139@extension("VK_NV_external_memory") define VK_NV_EXTERNAL_MEMORY_EXTENSION_NAME "VK_NV_external_memory"
140
141@extension("VK_NV_external_memory_win32") define VK_NV_EXTERNAL_MEMORY_WIN32_SPEC_VERSION 1
142@extension("VK_NV_external_memory_win32") define VK_NV_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME "VK_NV_external_memory_win32"
143
144@extension("VK_NV_win32_keyed_mutex") define VK_NV_WIN32_KEYED_MUTEX_SPEC_VERSION 1
145@extension("VK_NV_win32_keyed_mutex") define VK_NV_WIN32_KEYED_MUTEX_EXTENSION_NAME "VK_NV_win32_keyed_mutex"
146
147@extension("VK_EXT_validation_flags") define VK_EXT_VALIDATION_FLAGS_SPEC_VERSION 1
148@extension("VK_EXT_validation_flags") define VK_EXT_VALIDATION_FLAGS_EXTENSION_NAME "VK_EXT_validation_flags"
149
150@extension("VK_NVX_device_generated_commands") define VK_NVX_DEVICE_GENERATED_COMMANDS_SPEC_VERSION 1
151@extension("VK_NVX_device_generated_commands") define VK_NVX_DEVICE_GENERATED_COMMANDS_EXTENSION_NAME "VK_NVX_device_generated_commands"
152
Chris Forbes1d5f68c2017-01-31 10:17:01 +1300153@extension("VK_KHR_shared_presentable_image") define VK_KHR_SHARED_PRESENTABLE_IMAGE_SPEC_VERSION 1
154@extension("VK_KHR_shared_presentable_image") define VK_KHR_SHARED_PRESENTABLE_IMAGE_EXTENSION_NAME "VK_KHR_shared_presentable_image"
Chris Forbes2e12cb82017-01-18 11:45:17 +1300155
Chris Forbes289cb792016-12-30 15:03:55 +1300156
Jesse Halld27f6aa2015-08-15 17:58:48 -0700157
158/////////////
159// Types //
160/////////////
161
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700162type u32 VkBool32
163type u32 VkFlags
164type u64 VkDeviceSize
165type u32 VkSampleMask
166
Jesse Halld27f6aa2015-08-15 17:58:48 -0700167/// Dispatchable handle types.
168@dispatchHandle type u64 VkInstance
169@dispatchHandle type u64 VkPhysicalDevice
170@dispatchHandle type u64 VkDevice
171@dispatchHandle type u64 VkQueue
Jesse Hall3fbc8562015-11-29 22:10:52 -0800172@dispatchHandle type u64 VkCommandBuffer
Jesse Halld27f6aa2015-08-15 17:58:48 -0700173
174/// Non dispatchable handle types.
175@nonDispatchHandle type u64 VkDeviceMemory
Jesse Hall3fbc8562015-11-29 22:10:52 -0800176@nonDispatchHandle type u64 VkCommandPool
Jesse Halld27f6aa2015-08-15 17:58:48 -0700177@nonDispatchHandle type u64 VkBuffer
178@nonDispatchHandle type u64 VkBufferView
179@nonDispatchHandle type u64 VkImage
180@nonDispatchHandle type u64 VkImageView
Jesse Halld27f6aa2015-08-15 17:58:48 -0700181@nonDispatchHandle type u64 VkShaderModule
Jesse Halld27f6aa2015-08-15 17:58:48 -0700182@nonDispatchHandle type u64 VkPipeline
183@nonDispatchHandle type u64 VkPipelineLayout
184@nonDispatchHandle type u64 VkSampler
185@nonDispatchHandle type u64 VkDescriptorSet
186@nonDispatchHandle type u64 VkDescriptorSetLayout
187@nonDispatchHandle type u64 VkDescriptorPool
Jesse Halld27f6aa2015-08-15 17:58:48 -0700188@nonDispatchHandle type u64 VkFence
189@nonDispatchHandle type u64 VkSemaphore
190@nonDispatchHandle type u64 VkEvent
191@nonDispatchHandle type u64 VkQueryPool
192@nonDispatchHandle type u64 VkFramebuffer
193@nonDispatchHandle type u64 VkRenderPass
194@nonDispatchHandle type u64 VkPipelineCache
Jesse Hall1356b0d2015-11-23 17:24:58 -0800195
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800196@extension("VK_KHR_surface") @nonDispatchHandle type u64 VkSurfaceKHR
Jesse Hall1356b0d2015-11-23 17:24:58 -0800197
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800198@extension("VK_KHR_swapchain") @nonDispatchHandle type u64 VkSwapchainKHR
Jesse Hall1356b0d2015-11-23 17:24:58 -0800199
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800200@extension("VK_KHR_display") @nonDispatchHandle type u64 VkDisplayKHR
201@extension("VK_KHR_display") @nonDispatchHandle type u64 VkDisplayModeKHR
Jesse Halld27f6aa2015-08-15 17:58:48 -0700202
Jesse Hall715b86a2016-01-16 16:34:29 -0800203@extension("VK_EXT_debug_report") @nonDispatchHandle type u64 VkDebugReportCallbackEXT
204
Chris Forbes289cb792016-12-30 15:03:55 +1300205@extension("VK_NVX_device_generated_commands") @nonDispatchHandle type u64 VkObjectTableNVX
206@extension("VK_NVX_device_generated_commands") @nonDispatchHandle type u64 VkIndirectCommandsLayoutNVX
207
Jesse Halld27f6aa2015-08-15 17:58:48 -0700208
209/////////////
210// Enums //
211/////////////
212
213enum VkImageLayout {
214 VK_IMAGE_LAYOUT_UNDEFINED = 0x00000000, /// Implicit layout an image is when its contents are undefined due to various reasons (e.g. right after creation)
215 VK_IMAGE_LAYOUT_GENERAL = 0x00000001, /// General layout when image can be used for any kind of access
216 VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL = 0x00000002, /// Optimal layout when image is only used for color attachment read/write
217 VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL = 0x00000003, /// Optimal layout when image is only used for depth/stencil attachment read/write
218 VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL = 0x00000004, /// Optimal layout when image is used for read only depth/stencil attachment and shader access
219 VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL = 0x00000005, /// Optimal layout when image is used for read only shader access
Jesse Hall3fbc8562015-11-29 22:10:52 -0800220 VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL = 0x00000006, /// Optimal layout when image is used only as source of transfer operations
221 VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL = 0x00000007, /// Optimal layout when image is used only as destination of transfer operations
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700222 VK_IMAGE_LAYOUT_PREINITIALIZED = 0x00000008, /// Initial layout used when the data is populated by the CPU
Jesse Hall1356b0d2015-11-23 17:24:58 -0800223
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800224 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800225 VK_IMAGE_LAYOUT_PRESENT_SRC_KHR = 1000001002,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700226}
227
228enum VkAttachmentLoadOp {
229 VK_ATTACHMENT_LOAD_OP_LOAD = 0x00000000,
230 VK_ATTACHMENT_LOAD_OP_CLEAR = 0x00000001,
231 VK_ATTACHMENT_LOAD_OP_DONT_CARE = 0x00000002,
232}
233
234enum VkAttachmentStoreOp {
235 VK_ATTACHMENT_STORE_OP_STORE = 0x00000000,
236 VK_ATTACHMENT_STORE_OP_DONT_CARE = 0x00000001,
237}
238
239enum VkImageType {
240 VK_IMAGE_TYPE_1D = 0x00000000,
241 VK_IMAGE_TYPE_2D = 0x00000001,
242 VK_IMAGE_TYPE_3D = 0x00000002,
243}
244
245enum VkImageTiling {
Jesse Hallc7467b72015-11-29 21:05:26 -0800246 VK_IMAGE_TILING_OPTIMAL = 0x00000000,
247 VK_IMAGE_TILING_LINEAR = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700248}
249
250enum VkImageViewType {
251 VK_IMAGE_VIEW_TYPE_1D = 0x00000000,
252 VK_IMAGE_VIEW_TYPE_2D = 0x00000001,
253 VK_IMAGE_VIEW_TYPE_3D = 0x00000002,
254 VK_IMAGE_VIEW_TYPE_CUBE = 0x00000003,
255 VK_IMAGE_VIEW_TYPE_1D_ARRAY = 0x00000004,
256 VK_IMAGE_VIEW_TYPE_2D_ARRAY = 0x00000005,
257 VK_IMAGE_VIEW_TYPE_CUBE_ARRAY = 0x00000006,
258}
259
Jesse Hall3fbc8562015-11-29 22:10:52 -0800260enum VkCommandBufferLevel {
261 VK_COMMAND_BUFFER_LEVEL_PRIMARY = 0x00000000,
262 VK_COMMAND_BUFFER_LEVEL_SECONDARY = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700263}
264
Jesse Hall65ab5522015-11-30 00:07:16 -0800265enum VkComponentSwizzle {
266 VK_COMPONENT_SWIZZLE_IDENTITY = 0x00000000,
267 VK_COMPONENT_SWIZZLE_ZERO = 0x00000001,
268 VK_COMPONENT_SWIZZLE_ONE = 0x00000002,
269 VK_COMPONENT_SWIZZLE_R = 0x00000003,
270 VK_COMPONENT_SWIZZLE_G = 0x00000004,
271 VK_COMPONENT_SWIZZLE_B = 0x00000005,
272 VK_COMPONENT_SWIZZLE_A = 0x00000006,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700273}
274
275enum VkDescriptorType {
276 VK_DESCRIPTOR_TYPE_SAMPLER = 0x00000000,
277 VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER = 0x00000001,
278 VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE = 0x00000002,
279 VK_DESCRIPTOR_TYPE_STORAGE_IMAGE = 0x00000003,
280 VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER = 0x00000004,
281 VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER = 0x00000005,
282 VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER = 0x00000006,
283 VK_DESCRIPTOR_TYPE_STORAGE_BUFFER = 0x00000007,
284 VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC = 0x00000008,
285 VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC = 0x00000009,
286 VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT = 0x0000000a,
287}
288
Jesse Halld27f6aa2015-08-15 17:58:48 -0700289enum VkQueryType {
290 VK_QUERY_TYPE_OCCLUSION = 0x00000000,
291 VK_QUERY_TYPE_PIPELINE_STATISTICS = 0x00000001, /// Optional
Jesse Halla3a7a1d2015-11-24 11:37:23 -0800292 VK_QUERY_TYPE_TIMESTAMP = 0x00000002,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700293}
294
Jesse Halld27f6aa2015-08-15 17:58:48 -0700295enum VkBorderColor {
296 VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK = 0x00000000,
297 VK_BORDER_COLOR_INT_TRANSPARENT_BLACK = 0x00000001,
298 VK_BORDER_COLOR_FLOAT_OPAQUE_BLACK = 0x00000002,
299 VK_BORDER_COLOR_INT_OPAQUE_BLACK = 0x00000003,
300 VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE = 0x00000004,
301 VK_BORDER_COLOR_INT_OPAQUE_WHITE = 0x00000005,
302}
303
304enum VkPipelineBindPoint {
Jesse Hallc7467b72015-11-29 21:05:26 -0800305 VK_PIPELINE_BIND_POINT_GRAPHICS = 0x00000000,
306 VK_PIPELINE_BIND_POINT_COMPUTE = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700307}
308
309enum VkPrimitiveTopology {
310 VK_PRIMITIVE_TOPOLOGY_POINT_LIST = 0x00000000,
311 VK_PRIMITIVE_TOPOLOGY_LINE_LIST = 0x00000001,
312 VK_PRIMITIVE_TOPOLOGY_LINE_STRIP = 0x00000002,
313 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST = 0x00000003,
314 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP = 0x00000004,
315 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN = 0x00000005,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800316 VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY = 0x00000006,
317 VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY = 0x00000007,
318 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY = 0x00000008,
319 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY = 0x00000009,
Jesse Hall091ed9e2015-11-30 00:55:29 -0800320 VK_PRIMITIVE_TOPOLOGY_PATCH_LIST = 0x0000000a,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700321}
322
323enum VkSharingMode {
324 VK_SHARING_MODE_EXCLUSIVE = 0x00000000,
325 VK_SHARING_MODE_CONCURRENT = 0x00000001,
326}
327
328enum VkIndexType {
329 VK_INDEX_TYPE_UINT16 = 0x00000000,
330 VK_INDEX_TYPE_UINT32 = 0x00000001,
331}
332
Jesse Hall23ff73f2015-11-29 14:36:39 -0800333enum VkFilter {
334 VK_FILTER_NEAREST = 0x00000000,
335 VK_FILTER_LINEAR = 0x00000001,
Jesse Hall26763382016-05-20 07:13:52 -0700336
337 //@extension("VK_IMG_filter_cubic")
338 VK_FILTER_CUBIC_IMG = 1000015000,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700339}
340
Jesse Hall23ff73f2015-11-29 14:36:39 -0800341enum VkSamplerMipmapMode {
Jesse Hall23ff73f2015-11-29 14:36:39 -0800342 VK_SAMPLER_MIPMAP_MODE_NEAREST = 0x00000001, /// Choose nearest mip level
343 VK_SAMPLER_MIPMAP_MODE_LINEAR = 0x00000002, /// Linear filter between mip levels
Jesse Halld27f6aa2015-08-15 17:58:48 -0700344}
345
Jesse Hall23ff73f2015-11-29 14:36:39 -0800346enum VkSamplerAddressMode {
Jesse Hallc7467b72015-11-29 21:05:26 -0800347 VK_SAMPLER_ADDRESS_MODE_REPEAT = 0x00000000,
348 VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT = 0x00000001,
349 VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE = 0x00000002,
350 VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER = 0x00000003,
351 VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700352}
353
354enum VkCompareOp {
355 VK_COMPARE_OP_NEVER = 0x00000000,
356 VK_COMPARE_OP_LESS = 0x00000001,
357 VK_COMPARE_OP_EQUAL = 0x00000002,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800358 VK_COMPARE_OP_LESS_OR_EQUAL = 0x00000003,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700359 VK_COMPARE_OP_GREATER = 0x00000004,
360 VK_COMPARE_OP_NOT_EQUAL = 0x00000005,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800361 VK_COMPARE_OP_GREATER_OR_EQUAL = 0x00000006,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700362 VK_COMPARE_OP_ALWAYS = 0x00000007,
363}
364
Jesse Hall65ab5522015-11-30 00:07:16 -0800365enum VkPolygonMode {
366 VK_POLYGON_MODE_FILL = 0x00000000,
367 VK_POLYGON_MODE_LINE = 0x00000001,
368 VK_POLYGON_MODE_POINT = 0x00000002,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700369}
370
371enum VkFrontFace {
Jesse Hall3fbc8562015-11-29 22:10:52 -0800372 VK_FRONT_FACE_COUNTER_CLOCKWISE = 0x00000000,
373 VK_FRONT_FACE_CLOCKWISE = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700374}
375
Jesse Hall65ab5522015-11-30 00:07:16 -0800376enum VkBlendFactor {
377 VK_BLEND_FACTOR_ZERO = 0x00000000,
378 VK_BLEND_FACTOR_ONE = 0x00000001,
379 VK_BLEND_FACTOR_SRC_COLOR = 0x00000002,
380 VK_BLEND_FACTOR_ONE_MINUS_SRC_COLOR = 0x00000003,
381 VK_BLEND_FACTOR_DST_COLOR = 0x00000004,
382 VK_BLEND_FACTOR_ONE_MINUS_DST_COLOR = 0x00000005,
383 VK_BLEND_FACTOR_SRC_ALPHA = 0x00000006,
384 VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA = 0x00000007,
385 VK_BLEND_FACTOR_DST_ALPHA = 0x00000008,
386 VK_BLEND_FACTOR_ONE_MINUS_DST_ALPHA = 0x00000009,
387 VK_BLEND_FACTOR_CONSTANT_COLOR = 0x0000000a,
388 VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR = 0x0000000b,
389 VK_BLEND_FACTOR_CONSTANT_ALPHA = 0x0000000c,
390 VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA = 0x0000000d,
391 VK_BLEND_FACTOR_SRC_ALPHA_SATURATE = 0x0000000e,
392 VK_BLEND_FACTOR_SRC1_COLOR = 0x0000000f,
393 VK_BLEND_FACTOR_ONE_MINUS_SRC1_COLOR = 0x00000010,
394 VK_BLEND_FACTOR_SRC1_ALPHA = 0x00000011,
395 VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA = 0x00000012,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700396}
397
398enum VkBlendOp {
399 VK_BLEND_OP_ADD = 0x00000000,
400 VK_BLEND_OP_SUBTRACT = 0x00000001,
401 VK_BLEND_OP_REVERSE_SUBTRACT = 0x00000002,
402 VK_BLEND_OP_MIN = 0x00000003,
403 VK_BLEND_OP_MAX = 0x00000004,
404}
405
406enum VkStencilOp {
407 VK_STENCIL_OP_KEEP = 0x00000000,
408 VK_STENCIL_OP_ZERO = 0x00000001,
409 VK_STENCIL_OP_REPLACE = 0x00000002,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800410 VK_STENCIL_OP_INCREMENT_AND_CLAMP = 0x00000003,
411 VK_STENCIL_OP_DECREMENT_AND_CLAMP = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700412 VK_STENCIL_OP_INVERT = 0x00000005,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800413 VK_STENCIL_OP_INCREMENT_AND_WRAP = 0x00000006,
414 VK_STENCIL_OP_DECREMENT_AND_WRAP = 0x00000007,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700415}
416
417enum VkLogicOp {
418 VK_LOGIC_OP_CLEAR = 0x00000000,
419 VK_LOGIC_OP_AND = 0x00000001,
420 VK_LOGIC_OP_AND_REVERSE = 0x00000002,
421 VK_LOGIC_OP_COPY = 0x00000003,
422 VK_LOGIC_OP_AND_INVERTED = 0x00000004,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800423 VK_LOGIC_OP_NO_OP = 0x00000005,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700424 VK_LOGIC_OP_XOR = 0x00000006,
425 VK_LOGIC_OP_OR = 0x00000007,
426 VK_LOGIC_OP_NOR = 0x00000008,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800427 VK_LOGIC_OP_EQUIVALENT = 0x00000009,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700428 VK_LOGIC_OP_INVERT = 0x0000000a,
429 VK_LOGIC_OP_OR_REVERSE = 0x0000000b,
430 VK_LOGIC_OP_COPY_INVERTED = 0x0000000c,
431 VK_LOGIC_OP_OR_INVERTED = 0x0000000d,
432 VK_LOGIC_OP_NAND = 0x0000000e,
433 VK_LOGIC_OP_SET = 0x0000000f,
434}
435
Jesse Hall3fbc8562015-11-29 22:10:52 -0800436enum VkSystemAllocationScope {
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800437 VK_SYSTEM_ALLOCATION_SCOPE_COMMAND = 0x00000000,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800438 VK_SYSTEM_ALLOCATION_SCOPE_OBJECT = 0x00000001,
439 VK_SYSTEM_ALLOCATION_SCOPE_CACHE = 0x00000002,
440 VK_SYSTEM_ALLOCATION_SCOPE_DEVICE = 0x00000003,
441 VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE = 0x00000004,
Jesse Hall03b6fe12015-11-24 12:44:21 -0800442}
443
Jesse Hall3fbc8562015-11-29 22:10:52 -0800444enum VkInternalAllocationType {
445 VK_INTERNAL_ALLOCATION_TYPE_EXECUTABLE = 0x00000000,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700446}
447
448enum VkPhysicalDeviceType {
449 VK_PHYSICAL_DEVICE_TYPE_OTHER = 0x00000000,
450 VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU = 0x00000001,
451 VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU = 0x00000002,
452 VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU = 0x00000003,
453 VK_PHYSICAL_DEVICE_TYPE_CPU = 0x00000004,
454}
455
Jesse Hall65ab5522015-11-30 00:07:16 -0800456enum VkVertexInputRate {
457 VK_VERTEX_INPUT_RATE_VERTEX = 0x00000000,
458 VK_VERTEX_INPUT_RATE_INSTANCE = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700459}
460
461/// Vulkan format definitions
462enum VkFormat {
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800463 VK_FORMAT_UNDEFINED = 0,
464 VK_FORMAT_R4G4_UNORM_PACK8 = 1,
465 VK_FORMAT_R4G4B4A4_UNORM_PACK16 = 2,
466 VK_FORMAT_B4G4R4A4_UNORM_PACK16 = 3,
467 VK_FORMAT_R5G6B5_UNORM_PACK16 = 4,
468 VK_FORMAT_B5G6R5_UNORM_PACK16 = 5,
469 VK_FORMAT_R5G5B5A1_UNORM_PACK16 = 6,
470 VK_FORMAT_B5G5R5A1_UNORM_PACK16 = 7,
471 VK_FORMAT_A1R5G5B5_UNORM_PACK16 = 8,
472 VK_FORMAT_R8_UNORM = 9,
473 VK_FORMAT_R8_SNORM = 10,
474 VK_FORMAT_R8_USCALED = 11,
475 VK_FORMAT_R8_SSCALED = 12,
476 VK_FORMAT_R8_UINT = 13,
477 VK_FORMAT_R8_SINT = 14,
478 VK_FORMAT_R8_SRGB = 15,
479 VK_FORMAT_R8G8_UNORM = 16,
480 VK_FORMAT_R8G8_SNORM = 17,
481 VK_FORMAT_R8G8_USCALED = 18,
482 VK_FORMAT_R8G8_SSCALED = 19,
483 VK_FORMAT_R8G8_UINT = 20,
484 VK_FORMAT_R8G8_SINT = 21,
485 VK_FORMAT_R8G8_SRGB = 22,
486 VK_FORMAT_R8G8B8_UNORM = 23,
487 VK_FORMAT_R8G8B8_SNORM = 24,
488 VK_FORMAT_R8G8B8_USCALED = 25,
489 VK_FORMAT_R8G8B8_SSCALED = 26,
490 VK_FORMAT_R8G8B8_UINT = 27,
491 VK_FORMAT_R8G8B8_SINT = 28,
492 VK_FORMAT_R8G8B8_SRGB = 29,
493 VK_FORMAT_B8G8R8_UNORM = 30,
494 VK_FORMAT_B8G8R8_SNORM = 31,
495 VK_FORMAT_B8G8R8_USCALED = 32,
496 VK_FORMAT_B8G8R8_SSCALED = 33,
497 VK_FORMAT_B8G8R8_UINT = 34,
498 VK_FORMAT_B8G8R8_SINT = 35,
499 VK_FORMAT_B8G8R8_SRGB = 36,
500 VK_FORMAT_R8G8B8A8_UNORM = 37,
501 VK_FORMAT_R8G8B8A8_SNORM = 38,
502 VK_FORMAT_R8G8B8A8_USCALED = 39,
503 VK_FORMAT_R8G8B8A8_SSCALED = 40,
504 VK_FORMAT_R8G8B8A8_UINT = 41,
505 VK_FORMAT_R8G8B8A8_SINT = 42,
506 VK_FORMAT_R8G8B8A8_SRGB = 43,
507 VK_FORMAT_B8G8R8A8_UNORM = 44,
508 VK_FORMAT_B8G8R8A8_SNORM = 45,
509 VK_FORMAT_B8G8R8A8_USCALED = 46,
510 VK_FORMAT_B8G8R8A8_SSCALED = 47,
511 VK_FORMAT_B8G8R8A8_UINT = 48,
512 VK_FORMAT_B8G8R8A8_SINT = 49,
513 VK_FORMAT_B8G8R8A8_SRGB = 50,
514 VK_FORMAT_A8B8G8R8_UNORM_PACK32 = 51,
515 VK_FORMAT_A8B8G8R8_SNORM_PACK32 = 52,
516 VK_FORMAT_A8B8G8R8_USCALED_PACK32 = 53,
517 VK_FORMAT_A8B8G8R8_SSCALED_PACK32 = 54,
518 VK_FORMAT_A8B8G8R8_UINT_PACK32 = 55,
519 VK_FORMAT_A8B8G8R8_SINT_PACK32 = 56,
520 VK_FORMAT_A8B8G8R8_SRGB_PACK32 = 57,
521 VK_FORMAT_A2R10G10B10_UNORM_PACK32 = 58,
522 VK_FORMAT_A2R10G10B10_SNORM_PACK32 = 59,
523 VK_FORMAT_A2R10G10B10_USCALED_PACK32 = 60,
524 VK_FORMAT_A2R10G10B10_SSCALED_PACK32 = 61,
525 VK_FORMAT_A2R10G10B10_UINT_PACK32 = 62,
526 VK_FORMAT_A2R10G10B10_SINT_PACK32 = 63,
527 VK_FORMAT_A2B10G10R10_UNORM_PACK32 = 64,
528 VK_FORMAT_A2B10G10R10_SNORM_PACK32 = 65,
529 VK_FORMAT_A2B10G10R10_USCALED_PACK32 = 66,
530 VK_FORMAT_A2B10G10R10_SSCALED_PACK32 = 67,
531 VK_FORMAT_A2B10G10R10_UINT_PACK32 = 68,
532 VK_FORMAT_A2B10G10R10_SINT_PACK32 = 69,
533 VK_FORMAT_R16_UNORM = 70,
534 VK_FORMAT_R16_SNORM = 71,
535 VK_FORMAT_R16_USCALED = 72,
536 VK_FORMAT_R16_SSCALED = 73,
537 VK_FORMAT_R16_UINT = 74,
538 VK_FORMAT_R16_SINT = 75,
539 VK_FORMAT_R16_SFLOAT = 76,
540 VK_FORMAT_R16G16_UNORM = 77,
541 VK_FORMAT_R16G16_SNORM = 78,
542 VK_FORMAT_R16G16_USCALED = 79,
543 VK_FORMAT_R16G16_SSCALED = 80,
544 VK_FORMAT_R16G16_UINT = 81,
545 VK_FORMAT_R16G16_SINT = 82,
546 VK_FORMAT_R16G16_SFLOAT = 83,
547 VK_FORMAT_R16G16B16_UNORM = 84,
548 VK_FORMAT_R16G16B16_SNORM = 85,
549 VK_FORMAT_R16G16B16_USCALED = 86,
550 VK_FORMAT_R16G16B16_SSCALED = 87,
551 VK_FORMAT_R16G16B16_UINT = 88,
552 VK_FORMAT_R16G16B16_SINT = 89,
553 VK_FORMAT_R16G16B16_SFLOAT = 90,
554 VK_FORMAT_R16G16B16A16_UNORM = 91,
555 VK_FORMAT_R16G16B16A16_SNORM = 92,
556 VK_FORMAT_R16G16B16A16_USCALED = 93,
557 VK_FORMAT_R16G16B16A16_SSCALED = 94,
558 VK_FORMAT_R16G16B16A16_UINT = 95,
559 VK_FORMAT_R16G16B16A16_SINT = 96,
560 VK_FORMAT_R16G16B16A16_SFLOAT = 97,
561 VK_FORMAT_R32_UINT = 98,
562 VK_FORMAT_R32_SINT = 99,
563 VK_FORMAT_R32_SFLOAT = 100,
564 VK_FORMAT_R32G32_UINT = 101,
565 VK_FORMAT_R32G32_SINT = 102,
566 VK_FORMAT_R32G32_SFLOAT = 103,
567 VK_FORMAT_R32G32B32_UINT = 104,
568 VK_FORMAT_R32G32B32_SINT = 105,
569 VK_FORMAT_R32G32B32_SFLOAT = 106,
570 VK_FORMAT_R32G32B32A32_UINT = 107,
571 VK_FORMAT_R32G32B32A32_SINT = 108,
572 VK_FORMAT_R32G32B32A32_SFLOAT = 109,
573 VK_FORMAT_R64_UINT = 110,
574 VK_FORMAT_R64_SINT = 111,
575 VK_FORMAT_R64_SFLOAT = 112,
576 VK_FORMAT_R64G64_UINT = 113,
577 VK_FORMAT_R64G64_SINT = 114,
578 VK_FORMAT_R64G64_SFLOAT = 115,
579 VK_FORMAT_R64G64B64_UINT = 116,
580 VK_FORMAT_R64G64B64_SINT = 117,
581 VK_FORMAT_R64G64B64_SFLOAT = 118,
582 VK_FORMAT_R64G64B64A64_UINT = 119,
583 VK_FORMAT_R64G64B64A64_SINT = 120,
584 VK_FORMAT_R64G64B64A64_SFLOAT = 121,
585 VK_FORMAT_B10G11R11_UFLOAT_PACK32 = 122,
586 VK_FORMAT_E5B9G9R9_UFLOAT_PACK32 = 123,
587 VK_FORMAT_D16_UNORM = 124,
588 VK_FORMAT_X8_D24_UNORM_PACK32 = 125,
589 VK_FORMAT_D32_SFLOAT = 126,
590 VK_FORMAT_S8_UINT = 127,
591 VK_FORMAT_D16_UNORM_S8_UINT = 128,
592 VK_FORMAT_D24_UNORM_S8_UINT = 129,
593 VK_FORMAT_D32_SFLOAT_S8_UINT = 130,
594 VK_FORMAT_BC1_RGB_UNORM_BLOCK = 131,
595 VK_FORMAT_BC1_RGB_SRGB_BLOCK = 132,
596 VK_FORMAT_BC1_RGBA_UNORM_BLOCK = 133,
597 VK_FORMAT_BC1_RGBA_SRGB_BLOCK = 134,
598 VK_FORMAT_BC2_UNORM_BLOCK = 135,
599 VK_FORMAT_BC2_SRGB_BLOCK = 136,
600 VK_FORMAT_BC3_UNORM_BLOCK = 137,
601 VK_FORMAT_BC3_SRGB_BLOCK = 138,
602 VK_FORMAT_BC4_UNORM_BLOCK = 139,
603 VK_FORMAT_BC4_SNORM_BLOCK = 140,
604 VK_FORMAT_BC5_UNORM_BLOCK = 141,
605 VK_FORMAT_BC5_SNORM_BLOCK = 142,
606 VK_FORMAT_BC6H_UFLOAT_BLOCK = 143,
607 VK_FORMAT_BC6H_SFLOAT_BLOCK = 144,
608 VK_FORMAT_BC7_UNORM_BLOCK = 145,
609 VK_FORMAT_BC7_SRGB_BLOCK = 146,
610 VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK = 147,
611 VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK = 148,
612 VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK = 149,
613 VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK = 150,
614 VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK = 151,
615 VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK = 152,
616 VK_FORMAT_EAC_R11_UNORM_BLOCK = 153,
617 VK_FORMAT_EAC_R11_SNORM_BLOCK = 154,
618 VK_FORMAT_EAC_R11G11_UNORM_BLOCK = 155,
619 VK_FORMAT_EAC_R11G11_SNORM_BLOCK = 156,
620 VK_FORMAT_ASTC_4x4_UNORM_BLOCK = 157,
621 VK_FORMAT_ASTC_4x4_SRGB_BLOCK = 158,
622 VK_FORMAT_ASTC_5x4_UNORM_BLOCK = 159,
623 VK_FORMAT_ASTC_5x4_SRGB_BLOCK = 160,
624 VK_FORMAT_ASTC_5x5_UNORM_BLOCK = 161,
625 VK_FORMAT_ASTC_5x5_SRGB_BLOCK = 162,
626 VK_FORMAT_ASTC_6x5_UNORM_BLOCK = 163,
627 VK_FORMAT_ASTC_6x5_SRGB_BLOCK = 164,
628 VK_FORMAT_ASTC_6x6_UNORM_BLOCK = 165,
629 VK_FORMAT_ASTC_6x6_SRGB_BLOCK = 166,
630 VK_FORMAT_ASTC_8x5_UNORM_BLOCK = 167,
631 VK_FORMAT_ASTC_8x5_SRGB_BLOCK = 168,
632 VK_FORMAT_ASTC_8x6_UNORM_BLOCK = 169,
633 VK_FORMAT_ASTC_8x6_SRGB_BLOCK = 170,
634 VK_FORMAT_ASTC_8x8_UNORM_BLOCK = 171,
635 VK_FORMAT_ASTC_8x8_SRGB_BLOCK = 172,
636 VK_FORMAT_ASTC_10x5_UNORM_BLOCK = 173,
637 VK_FORMAT_ASTC_10x5_SRGB_BLOCK = 174,
638 VK_FORMAT_ASTC_10x6_UNORM_BLOCK = 175,
639 VK_FORMAT_ASTC_10x6_SRGB_BLOCK = 176,
640 VK_FORMAT_ASTC_10x8_UNORM_BLOCK = 177,
641 VK_FORMAT_ASTC_10x8_SRGB_BLOCK = 178,
642 VK_FORMAT_ASTC_10x10_UNORM_BLOCK = 179,
643 VK_FORMAT_ASTC_10x10_SRGB_BLOCK = 180,
644 VK_FORMAT_ASTC_12x10_UNORM_BLOCK = 181,
645 VK_FORMAT_ASTC_12x10_SRGB_BLOCK = 182,
646 VK_FORMAT_ASTC_12x12_UNORM_BLOCK = 183,
647 VK_FORMAT_ASTC_12x12_SRGB_BLOCK = 184,
Chris Forbes289cb792016-12-30 15:03:55 +1300648
649 //@extension("VK_IMG_format_pvrtc")
650 VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG = 1000054000,
651
652 //@extension("VK_IMG_format_pvrtc")
653 VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG = 1000054001,
654
655 //@extension("VK_IMG_format_pvrtc")
656 VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG = 1000054002,
657
658 //@extension("VK_IMG_format_pvrtc")
659 VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG = 1000054003,
660
661 //@extension("VK_IMG_format_pvrtc")
662 VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG = 1000054004,
663
664 //@extension("VK_IMG_format_pvrtc")
665 VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG = 1000054005,
666
667 //@extension("VK_IMG_format_pvrtc")
668 VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG = 1000054006,
669
670 //@extension("VK_IMG_format_pvrtc")
671 VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG = 1000054007,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700672}
673
Jesse Halld27f6aa2015-08-15 17:58:48 -0700674/// Structure type enumerant
675enum VkStructureType {
676 VK_STRUCTURE_TYPE_APPLICATION_INFO = 0,
Jesse Hallc7467b72015-11-29 21:05:26 -0800677 VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO = 1,
678 VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO = 2,
679 VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO = 3,
680 VK_STRUCTURE_TYPE_SUBMIT_INFO = 4,
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800681 VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO = 5,
Jesse Hallc7467b72015-11-29 21:05:26 -0800682 VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE = 6,
683 VK_STRUCTURE_TYPE_BIND_SPARSE_INFO = 7,
684 VK_STRUCTURE_TYPE_FENCE_CREATE_INFO = 8,
685 VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO = 9,
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700686 VK_STRUCTURE_TYPE_EVENT_CREATE_INFO = 10,
Jesse Hallc7467b72015-11-29 21:05:26 -0800687 VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO = 11,
688 VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO = 12,
689 VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO = 13,
690 VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO = 14,
691 VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO = 15,
692 VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO = 16,
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800693 VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO = 17,
694 VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO = 18,
695 VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO = 19,
696 VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO = 20,
697 VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO = 21,
698 VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO = 22,
699 VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO = 23,
700 VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO = 24,
701 VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO = 25,
702 VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO = 26,
703 VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO = 27,
704 VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO = 28,
705 VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO = 29,
706 VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO = 30,
707 VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO = 31,
708 VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO = 32,
709 VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO = 33,
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800710 VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO = 34,
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800711 VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET = 35,
712 VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET = 36,
713 VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO = 37,
714 VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO = 38,
715 VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO = 39,
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800716 VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO = 40,
Jesse Hall3dd678a2016-01-08 21:52:01 -0800717 VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO = 41,
718 VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO = 42,
719 VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO = 43,
720 VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER = 44,
721 VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER = 45,
722 VK_STRUCTURE_TYPE_MEMORY_BARRIER = 46,
723 VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO = 47,
724 VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO = 48,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800725
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800726 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800727 VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR = 1000001000,
728 VK_STRUCTURE_TYPE_PRESENT_INFO_KHR = 1000001001,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800729
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800730 //@extension("VK_KHR_display")
Jesse Hallbd888842015-11-30 21:44:14 -0800731 VK_STRUCTURE_TYPE_DISPLAY_MODE_CREATE_INFO_KHR = 1000002000,
732 VK_STRUCTURE_TYPE_DISPLAY_SURFACE_CREATE_INFO_KHR = 1000002001,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800733
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800734 //@extension("VK_KHR_display_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800735 VK_STRUCTURE_TYPE_DISPLAY_DISPLAY_PRESENT_INFO_KHR = 1000003000,
Jesse Hallf9fa9a52016-01-08 16:08:51 -0800736
737 //@extension("VK_KHR_xlib_surface")
738 VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR = 1000004000,
739
740 //@extension("VK_KHR_xcb_surface")
741 VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR = 1000005000,
742
743 //@extension("VK_KHR_wayland_surface")
744 VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR = 1000006000,
745
746 //@extension("VK_KHR_mir_surface")
747 VK_STRUCTURE_TYPE_MIR_SURFACE_CREATE_INFO_KHR = 1000007000,
748
749 //@extension("VK_KHR_android_surface")
750 VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR = 1000008000,
751
752 //@extension("VK_KHR_win32_surface")
753 VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR = 1000009000,
Jesse Hall543a7ff2016-01-08 16:38:30 -0800754
Ian Elliott948233a2017-01-06 12:13:23 -0700755 //@extension("VK_KHR_incremental_present")
756 VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR = 1000084000,
757
Chia-I Wub262ddc2016-03-22 07:38:20 +0800758 //@extension("VK_ANDROID_native_buffer")
759 VK_STRUCTURE_TYPE_NATIVE_BUFFER_ANDROID = 1000010000,
Chris Forbes8e4438b2016-12-07 16:26:49 +1300760 VK_STRUCTURE_TYPE_SWAPCHAIN_IMAGE_CREATE_INFO_ANDROID = 1000010001,
Chia-I Wub262ddc2016-03-22 07:38:20 +0800761
Ian Elliott4c8bb2a2016-12-29 11:07:26 -0700762 //@extension("VK_GOOGLE_display_timing")
Ian Elliott14866bb2017-01-20 09:15:48 -0700763 VK_STRUCTURE_TYPE_PRESENT_TIMES_INFO_GOOGLE = 1000092000,
Ian Elliott4c8bb2a2016-12-29 11:07:26 -0700764
Jesse Hall543a7ff2016-01-08 16:38:30 -0800765 //@extension("VK_EXT_debug_report")
Jesse Hall26763382016-05-20 07:13:52 -0700766 VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT = 1000011000,
767
768 //@extension("VK_AMD_rasterization_order")
769 VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD = 1000018000,
770
771 //@extension("VK_EXT_debug_marker")
772 VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_NAME_INFO_EXT = 1000022000,
773
774 //@extension("VK_EXT_debug_marker")
775 VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_TAG_INFO_EXT = 1000022001,
776
777 //@extension("VK_EXT_debug_marker")
778 VK_STRUCTURE_TYPE_DEBUG_MARKER_MARKER_INFO_EXT = 1000022002,
Jesse Hall56d386a2016-07-26 15:20:40 -0700779
780 //@extension("VK_NV_dedicated_allocation")
781 VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV = 1000026000,
782
783 //@extension("VK_NV_dedicated_allocation")
784 VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV = 1000026001,
785
786 //@extension("VK_NV_dedicated_allocation")
787 VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV = 1000026002,
Chris Forbes289cb792016-12-30 15:03:55 +1300788
789 //@extension("VK_NV_external_memory")
790 VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_NV = 1000056000,
791
792 //@extension("VK_NV_external_memory")
793 VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_NV = 1000056001,
794
795 //@extension("VK_NV_external_memory_win32")
796 VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_NV = 1000057000,
797
798 //@extension("VK_NV_external_memory_win32")
799 VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_NV = 1000057001,
800
801 //@extension("VK_NV_win32_keyed_mutex")
802 VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_NV = 1000058000,
803
Chris Forbes1194ede2016-12-30 16:29:25 +1300804 //@extension("VK_KHR_get_physical_device_properties2")
805 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR = 1000059000,
806
807 //@extension("VK_KHR_get_physical_device_properties2")
808 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR = 1000059001,
809
810 //@extension("VK_KHR_get_physical_device_properties2")
811 VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2_KHR = 1000059002,
812
813 //@extension("VK_KHR_get_physical_device_properties2")
814 VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2_KHR = 1000059003,
815
816 //@extension("VK_KHR_get_physical_device_properties2")
817 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2_KHR = 1000059004,
818
819 //@extension("VK_KHR_get_physical_device_properties2")
820 VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2_KHR = 1000059005,
821
822 //@extension("VK_KHR_get_physical_device_properties2")
823 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2_KHR = 1000059006,
824
825 //@extension("VK_KHR_get_physical_device_properties2")
826 VK_STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2_KHR = 1000059007,
827
828 //@extension("VK_KHR_get_physical_device_properties2")
829 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2_KHR = 1000059008,
830
Chris Forbes289cb792016-12-30 15:03:55 +1300831 //@extension("VK_EXT_validation_flags")
832 VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT = 1000061000,
833
834 //@extension("VK_KHR_incremental_present")
835 VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR = 1000084000,
836
837 //@extension("VK_NVX_device_generated_commands")
838 VK_STRUCTURE_TYPE_OBJECT_TABLE_CREATE_INFO_NVX = 1000086000,
839
840 //@extension("VK_NVX_device_generated_commands")
841 VK_STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_CREATE_INFO_NVX = 1000086001,
842
843 //@extension("VK_NVX_device_generated_commands")
844 VK_STRUCTURE_TYPE_CMD_PROCESS_COMMANDS_INFO_NVX = 1000086002,
845
846 //@extension("VK_NVX_device_generated_commands")
847 VK_STRUCTURE_TYPE_CMD_RESERVE_SPACE_FOR_COMMANDS_INFO_NVX = 1000086003,
848
849 //@extension("VK_NVX_device_generated_commands")
850 VK_STRUCTURE_TYPE_DEVICE_GENERATED_COMMANDS_LIMITS_NVX = 1000086004,
851
852 //@extension("VK_NVX_device_generated_commands")
853 VK_STRUCTURE_TYPE_DEVICE_GENERATED_COMMANDS_FEATURES_NVX = 1000086005,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700854}
855
Jesse Hall65ab5522015-11-30 00:07:16 -0800856enum VkSubpassContents {
857 VK_SUBPASS_CONTENTS_INLINE = 0x00000000,
858 VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700859}
860
Jesse Hall543a7ff2016-01-08 16:38:30 -0800861enum VkPipelineCacheHeaderVersion {
862 VK_PIPELINE_CACHE_HEADER_VERSION_ONE = 1,
863}
864
Jesse Hallbd888842015-11-30 21:44:14 -0800865@lastUnused(-11)
Jesse Halld27f6aa2015-08-15 17:58:48 -0700866/// Error and return codes
867enum VkResult {
868 // Return codes for successful operation execution (positive values)
Jesse Hallbd888842015-11-30 21:44:14 -0800869 VK_SUCCESS = 0,
870 VK_NOT_READY = 1,
871 VK_TIMEOUT = 2,
872 VK_EVENT_SET = 3,
873 VK_EVENT_RESET = 4,
874 VK_INCOMPLETE = 5,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700875
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800876 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800877 VK_SUBOPTIMAL_KHR = 1000001003,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800878
Jesse Halld27f6aa2015-08-15 17:58:48 -0700879 // Error codes (negative values)
Jesse Hallbd888842015-11-30 21:44:14 -0800880 VK_ERROR_OUT_OF_HOST_MEMORY = 0xFFFFFFFF, // -1
881 VK_ERROR_OUT_OF_DEVICE_MEMORY = 0xFFFFFFFE, // -2
882 VK_ERROR_INITIALIZATION_FAILED = 0xFFFFFFFD, // -3
883 VK_ERROR_DEVICE_LOST = 0xFFFFFFFC, // -4
884 VK_ERROR_MEMORY_MAP_FAILED = 0xFFFFFFFB, // -5
885 VK_ERROR_LAYER_NOT_PRESENT = 0xFFFFFFFA, // -6
886 VK_ERROR_EXTENSION_NOT_PRESENT = 0xFFFFFFF9, // -7
887 VK_ERROR_FEATURE_NOT_PRESENT = 0xFFFFFFF8, // -8
888 VK_ERROR_INCOMPATIBLE_DRIVER = 0xFFFFFFF7, // -9
889 VK_ERROR_TOO_MANY_OBJECTS = 0xFFFFFFF6, // -10
890 VK_ERROR_FORMAT_NOT_SUPPORTED = 0xFFFFFFF5, // -11
Jesse Hall56d386a2016-07-26 15:20:40 -0700891 VK_ERROR_FRAGMENTED_POOL = 0xFFFFFFF4, // -12
Jesse Hall1356b0d2015-11-23 17:24:58 -0800892
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800893 //@extension("VK_KHR_surface")
Jesse Hallbd888842015-11-30 21:44:14 -0800894 VK_ERROR_SURFACE_LOST_KHR = 0xC4653600, // -1000000000
Jesse Halla6429252015-11-29 18:59:42 -0800895
Jesse Hall563380d2016-01-15 23:14:05 -0800896 //@extension("VK_KHR_surface")
897 VK_ERROR_NATIVE_WINDOW_IN_USE_KHR = 0xC46535FF, // -1000008001
898
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800899 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800900 VK_ERROR_OUT_OF_DATE_KHR = 0xC4653214, // -1000001004
Jesse Hall1356b0d2015-11-23 17:24:58 -0800901
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800902 //@extension("VK_KHR_display_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800903 VK_ERROR_INCOMPATIBLE_DISPLAY_KHR = 0xC4652A47, // -1000003001
Jesse Hall1356b0d2015-11-23 17:24:58 -0800904
Jesse Hall543a7ff2016-01-08 16:38:30 -0800905 //@extension("VK_EXT_debug_report")
906 VK_ERROR_VALIDATION_FAILED_EXT = 0xC4650B07, // -1000011001
Jesse Hall26763382016-05-20 07:13:52 -0700907
908 //@extension("VK_NV_glsl_shader")
909 VK_ERROR_INVALID_SHADER_NV = 0xC4650720, // -1000012000
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700910}
911
912enum VkDynamicState {
913 VK_DYNAMIC_STATE_VIEWPORT = 0x00000000,
914 VK_DYNAMIC_STATE_SCISSOR = 0x00000001,
915 VK_DYNAMIC_STATE_LINE_WIDTH = 0x00000002,
916 VK_DYNAMIC_STATE_DEPTH_BIAS = 0x00000003,
917 VK_DYNAMIC_STATE_BLEND_CONSTANTS = 0x00000004,
918 VK_DYNAMIC_STATE_DEPTH_BOUNDS = 0x00000005,
919 VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK = 0x00000006,
920 VK_DYNAMIC_STATE_STENCIL_WRITE_MASK = 0x00000007,
921 VK_DYNAMIC_STATE_STENCIL_REFERENCE = 0x00000008,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700922}
923
Jesse Hall523db342015-11-30 21:12:55 -0800924@extension("VK_KHR_surface")
Michael Lentine88594d72015-11-12 12:49:45 -0800925enum VkPresentModeKHR {
926 VK_PRESENT_MODE_IMMEDIATE_KHR = 0x00000000,
927 VK_PRESENT_MODE_MAILBOX_KHR = 0x00000001,
928 VK_PRESENT_MODE_FIFO_KHR = 0x00000002,
Jesse Hall03b6fe12015-11-24 12:44:21 -0800929 VK_PRESENT_MODE_FIFO_RELAXED_KHR = 0x00000003,
Chris Forbes1d5f68c2017-01-31 10:17:01 +1300930 //@extension("VK_KHR_shared_presentable_image")
931 VK_PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR = 1000111000,
932 //@extension("VK_KHR_shared_presentable_image")
933 VK_PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR = 1000111001,
Michael Lentine88594d72015-11-12 12:49:45 -0800934}
935
Jesse Hall523db342015-11-30 21:12:55 -0800936@extension("VK_KHR_surface")
Michael Lentine88594d72015-11-12 12:49:45 -0800937enum VkColorSpaceKHR {
938 VK_COLORSPACE_SRGB_NONLINEAR_KHR = 0x00000000,
Courtney Goeltzenleuchter7f558ed2017-01-23 17:15:24 -0700939 VK_COLOR_SPACE_DISPLAY_P3_LINEAR_EXT = 1000104001,
940 VK_COLOR_SPACE_DISPLAY_P3_NONLINEAR_EXT = 1000104002,
941 VK_COLOR_SPACE_SCRGB_LINEAR_EXT = 1000104003,
942 VK_COLOR_SPACE_SCRGB_NONLINEAR_EXT = 1000104004,
943 VK_COLOR_SPACE_DCI_P3_LINEAR_EXT = 1000104005,
944 VK_COLOR_SPACE_DCI_P3_NONLINEAR_EXT = 1000104006,
945 VK_COLOR_SPACE_BT709_LINEAR_EXT = 1000104007,
946 VK_COLOR_SPACE_BT709_NONLINEAR_EXT = 1000104008,
947 VK_COLOR_SPACE_BT2020_LINEAR_EXT = 1000104009,
948 VK_COLOR_SPACE_BT2020_NONLINEAR_EXT = 1000104010,
949 VK_COLOR_SPACE_ADOBERGB_LINEAR_EXT = 1000104011,
950 VK_COLOR_SPACE_ADOBERGB_NONLINEAR_EXT = 1000104012,
Michael Lentine88594d72015-11-12 12:49:45 -0800951}
Jesse Halld27f6aa2015-08-15 17:58:48 -0700952
Jesse Hall715b86a2016-01-16 16:34:29 -0800953@extension("VK_EXT_debug_report")
954enum VkDebugReportObjectTypeEXT {
955 VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT = 0,
956 VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT = 1,
957 VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT = 2,
958 VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT = 3,
959 VK_DEBUG_REPORT_OBJECT_TYPE_QUEUE_EXT = 4,
960 VK_DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT = 5,
961 VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT = 6,
962 VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT = 7,
963 VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT = 8,
964 VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT = 9,
965 VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT = 10,
966 VK_DEBUG_REPORT_OBJECT_TYPE_EVENT_EXT = 11,
967 VK_DEBUG_REPORT_OBJECT_TYPE_QUERY_POOL_EXT = 12,
968 VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_VIEW_EXT = 13,
969 VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_VIEW_EXT = 14,
970 VK_DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT = 15,
971 VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_CACHE_EXT = 16,
972 VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_LAYOUT_EXT = 17,
973 VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT = 18,
974 VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT = 19,
975 VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT_EXT = 20,
976 VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_EXT = 21,
977 VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT = 22,
978 VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT = 23,
979 VK_DEBUG_REPORT_OBJECT_TYPE_FRAMEBUFFER_EXT = 24,
980 VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_POOL_EXT = 25,
981 VK_DEBUG_REPORT_OBJECT_TYPE_SURFACE_KHR_EXT = 26,
982 VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT = 27,
983 VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_EXT = 28,
Chris Forbes289cb792016-12-30 15:03:55 +1300984 VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_KHR_EXT = 29,
985 VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_MODE_KHR_EXT = 30,
986 VK_DEBUG_REPORT_OBJECT_TYPE_OBJECT_TABLE_NVX_EXT = 31,
987 VK_DEBUG_REPORT_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NVX_EXT = 32,
Jesse Hall715b86a2016-01-16 16:34:29 -0800988}
989
990@extension("VK_EXT_debug_report")
991enum VkDebugReportErrorEXT {
992 VK_DEBUG_REPORT_ERROR_NONE_EXT = 0,
993 VK_DEBUG_REPORT_ERROR_CALLBACK_REF_EXT = 1,
994}
995
Jesse Hall26763382016-05-20 07:13:52 -0700996@extension("VK_AMD_rasterization_order")
997enum VkRasterizationOrderAMD {
998 VK_RASTERIZATION_ORDER_STRICT_AMD = 0,
999 VK_RASTERIZATION_ORDER_RELAXED_AMD = 1,
1000}
1001
Chris Forbes289cb792016-12-30 15:03:55 +13001002@extension("VK_EXT_validation_flags")
1003enum VkValidationCheckEXT {
1004 VK_VALIDATION_CHECK_ALL_EXT = 0,
1005}
1006
1007@extension("VK_NVX_device_generated_commands")
1008enum VkIndirectCommandsTokenTypeNVX {
1009 VK_INDIRECT_COMMANDS_TOKEN_PIPELINE_NVX = 0,
1010 VK_INDIRECT_COMMANDS_TOKEN_DESCRIPTOR_SET_NVX = 1,
1011 VK_INDIRECT_COMMANDS_TOKEN_INDEX_BUFFER_NVX = 2,
1012 VK_INDIRECT_COMMANDS_TOKEN_VERTEX_BUFFER_NVX = 3,
1013 VK_INDIRECT_COMMANDS_TOKEN_PUSH_CONSTANT_NVX = 4,
1014 VK_INDIRECT_COMMANDS_TOKEN_DRAW_INDEXED_NVX = 5,
1015 VK_INDIRECT_COMMANDS_TOKEN_DRAW_NVX = 6,
1016 VK_INDIRECT_COMMANDS_TOKEN_DISPATCH_NVX = 7,
1017}
1018
1019@extension("VK_NVX_device_generated_commands")
1020enum VkObjectEntryTypeNVX {
1021 VK_OBJECT_ENTRY_DESCRIPTOR_SET_NVX = 0,
1022 VK_OBJECT_ENTRY_PIPELINE_NVX = 1,
1023 VK_OBJECT_ENTRY_INDEX_BUFFER_NVX = 2,
1024 VK_OBJECT_ENTRY_VERTEX_BUFFER_NVX = 3,
1025 VK_OBJECT_ENTRY_PUSH_CONSTANT_NVX = 4,
1026}
Jesse Hall715b86a2016-01-16 16:34:29 -08001027
Jesse Halld27f6aa2015-08-15 17:58:48 -07001028/////////////////
1029// Bitfields //
1030/////////////////
1031
Jesse Halld27f6aa2015-08-15 17:58:48 -07001032/// Queue capabilities
Jesse Halld8bade02015-11-24 10:24:18 -08001033type VkFlags VkQueueFlags
1034bitfield VkQueueFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001035 VK_QUEUE_GRAPHICS_BIT = 0x00000001, /// Queue supports graphics operations
1036 VK_QUEUE_COMPUTE_BIT = 0x00000002, /// Queue supports compute operations
Jesse Hall65ab5522015-11-30 00:07:16 -08001037 VK_QUEUE_TRANSFER_BIT = 0x00000004, /// Queue supports transfer operations
Jesse Hallb00daad2015-11-29 19:46:20 -08001038 VK_QUEUE_SPARSE_BINDING_BIT = 0x00000008, /// Queue supports sparse resource memory management operations
Jesse Halld27f6aa2015-08-15 17:58:48 -07001039}
1040
1041/// Memory properties passed into vkAllocMemory().
Jesse Halld8bade02015-11-24 10:24:18 -08001042type VkFlags VkMemoryPropertyFlags
1043bitfield VkMemoryPropertyFlagBits {
Jesse Halld1af8122015-11-29 23:50:38 -08001044 VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT = 0x00000001,
1045 VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT = 0x00000002,
1046 VK_MEMORY_PROPERTY_HOST_COHERENT_BIT = 0x00000004,
1047 VK_MEMORY_PROPERTY_HOST_CACHED_BIT = 0x00000008,
1048 VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT = 0x00000010,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001049}
1050
1051/// Memory heap flags
Jesse Halld8bade02015-11-24 10:24:18 -08001052type VkFlags VkMemoryHeapFlags
1053bitfield VkMemoryHeapFlagBits {
Jesse Halld1af8122015-11-29 23:50:38 -08001054 VK_MEMORY_HEAP_DEVICE_LOCAL_BIT = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001055}
1056
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001057/// Access flags
1058type VkFlags VkAccessFlags
1059bitfield VkAccessFlagBits {
1060 VK_ACCESS_INDIRECT_COMMAND_READ_BIT = 0x00000001,
1061 VK_ACCESS_INDEX_READ_BIT = 0x00000002,
1062 VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT = 0x00000004,
1063 VK_ACCESS_UNIFORM_READ_BIT = 0x00000008,
1064 VK_ACCESS_INPUT_ATTACHMENT_READ_BIT = 0x00000010,
1065 VK_ACCESS_SHADER_READ_BIT = 0x00000020,
1066 VK_ACCESS_SHADER_WRITE_BIT = 0x00000040,
1067 VK_ACCESS_COLOR_ATTACHMENT_READ_BIT = 0x00000080,
1068 VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT = 0x00000100,
1069 VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT = 0x00000200,
1070 VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT = 0x00000400,
1071 VK_ACCESS_TRANSFER_READ_BIT = 0x00000800,
1072 VK_ACCESS_TRANSFER_WRITE_BIT = 0x00001000,
1073 VK_ACCESS_HOST_READ_BIT = 0x00002000,
1074 VK_ACCESS_HOST_WRITE_BIT = 0x00004000,
1075 VK_ACCESS_MEMORY_READ_BIT = 0x00008000,
1076 VK_ACCESS_MEMORY_WRITE_BIT = 0x00010000,
Chris Forbes289cb792016-12-30 15:03:55 +13001077
1078 //@extension("VK_NVX_device_generated_commands")
1079 VK_ACCESS_COMMAND_PROCESS_READ_BIT_NVX = 0x00020000,
1080
1081 //@extension("VK_NVX_device_generated_commands")
1082 VK_ACCESS_COMMAND_PROCESS_WRITE_BIT_NVX = 0x00040000,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001083}
1084
1085/// Buffer usage flags
Jesse Halld8bade02015-11-24 10:24:18 -08001086type VkFlags VkBufferUsageFlags
1087bitfield VkBufferUsageFlagBits {
Jesse Hall3fbc8562015-11-29 22:10:52 -08001088 VK_BUFFER_USAGE_TRANSFER_SRC_BIT = 0x00000001, /// Can be used as a source of transfer operations
1089 VK_BUFFER_USAGE_TRANSFER_DST_BIT = 0x00000002, /// Can be used as a destination of transfer operations
Jesse Halld27f6aa2015-08-15 17:58:48 -07001090 VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000004, /// Can be used as TBO
1091 VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT = 0x00000008, /// Can be used as IBO
1092 VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT = 0x00000010, /// Can be used as UBO
1093 VK_BUFFER_USAGE_STORAGE_BUFFER_BIT = 0x00000020, /// Can be used as SSBO
1094 VK_BUFFER_USAGE_INDEX_BUFFER_BIT = 0x00000040, /// Can be used as source of fixed function index fetch (index buffer)
1095 VK_BUFFER_USAGE_VERTEX_BUFFER_BIT = 0x00000080, /// Can be used as source of fixed function vertex fetch (VBO)
1096 VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT = 0x00000100, /// Can be the source of indirect parameters (e.g. indirect buffer, parameter buffer)
1097}
1098
1099/// Buffer creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001100type VkFlags VkBufferCreateFlags
1101bitfield VkBufferCreateFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001102 VK_BUFFER_CREATE_SPARSE_BINDING_BIT = 0x00000001, /// Buffer should support sparse backing
Jesse Halld27f6aa2015-08-15 17:58:48 -07001103 VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002, /// Buffer should support sparse backing with partial residency
1104 VK_BUFFER_CREATE_SPARSE_ALIASED_BIT = 0x00000004, /// Buffer should support constent data access to physical memory blocks mapped into multiple locations of sparse buffers
1105}
1106
1107/// Shader stage flags
Jesse Halld8bade02015-11-24 10:24:18 -08001108type VkFlags VkShaderStageFlags
1109bitfield VkShaderStageFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001110 VK_SHADER_STAGE_VERTEX_BIT = 0x00000001,
Jesse Hallae38f732015-11-19 21:32:50 -08001111 VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT = 0x00000002,
1112 VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001113 VK_SHADER_STAGE_GEOMETRY_BIT = 0x00000008,
1114 VK_SHADER_STAGE_FRAGMENT_BIT = 0x00000010,
1115 VK_SHADER_STAGE_COMPUTE_BIT = 0x00000020,
Jesse Hallc7467b72015-11-29 21:05:26 -08001116 VK_SHADER_STAGE_ALL_GRAPHICS = 0x0000001F,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001117
1118 VK_SHADER_STAGE_ALL = 0x7FFFFFFF,
1119}
1120
Jesse Hallfbf97b02015-11-20 14:17:03 -08001121/// Descriptor pool create flags
Jesse Halld8bade02015-11-24 10:24:18 -08001122type VkFlags VkDescriptorPoolCreateFlags
1123bitfield VkDescriptorPoolCreateFlagBits {
Jesse Hallfbf97b02015-11-20 14:17:03 -08001124 VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT = 0x00000001,
1125}
1126
1127/// Descriptor pool reset flags
Jesse Halld8bade02015-11-24 10:24:18 -08001128type VkFlags VkDescriptorPoolResetFlags
Jesse Halla6429252015-11-29 18:59:42 -08001129//bitfield VkDescriptorPoolResetFlagBits {
1130//}
Jesse Hallfbf97b02015-11-20 14:17:03 -08001131
Jesse Halld27f6aa2015-08-15 17:58:48 -07001132/// Image usage flags
Jesse Halld8bade02015-11-24 10:24:18 -08001133type VkFlags VkImageUsageFlags
1134bitfield VkImageUsageFlagBits {
Jesse Hall3fbc8562015-11-29 22:10:52 -08001135 VK_IMAGE_USAGE_TRANSFER_SRC_BIT = 0x00000001, /// Can be used as a source of transfer operations
1136 VK_IMAGE_USAGE_TRANSFER_DST_BIT = 0x00000002, /// Can be used as a destination of transfer operations
Jesse Halld27f6aa2015-08-15 17:58:48 -07001137 VK_IMAGE_USAGE_SAMPLED_BIT = 0x00000004, /// Can be sampled from (SAMPLED_IMAGE and COMBINED_IMAGE_SAMPLER descriptor types)
1138 VK_IMAGE_USAGE_STORAGE_BIT = 0x00000008, /// Can be used as storage image (STORAGE_IMAGE descriptor type)
1139 VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT = 0x00000010, /// Can be used as framebuffer color attachment
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001140 VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000020, /// Can be used as framebuffer depth/stencil attachment
Jesse Halld27f6aa2015-08-15 17:58:48 -07001141 VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT = 0x00000040, /// Image data not needed outside of rendering
1142 VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT = 0x00000080, /// Can be used as framebuffer input attachment
1143}
1144
1145/// Image creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001146type VkFlags VkImageCreateFlags
1147bitfield VkImageCreateFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001148 VK_IMAGE_CREATE_SPARSE_BINDING_BIT = 0x00000001, /// Image should support sparse backing
Jesse Halld27f6aa2015-08-15 17:58:48 -07001149 VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002, /// Image should support sparse backing with partial residency
1150 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 -07001151 VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT = 0x00000008, /// Allows image views to have different format than the base image
1152 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 -07001153}
1154
Jesse Hallb00daad2015-11-29 19:46:20 -08001155/// Image view creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001156type VkFlags VkImageViewCreateFlags
Jesse Hallb00daad2015-11-29 19:46:20 -08001157//bitfield VkImageViewCreateFlagBits {
1158//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001159
1160/// Pipeline creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001161type VkFlags VkPipelineCreateFlags
1162bitfield VkPipelineCreateFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001163 VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT = 0x00000001,
1164 VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT = 0x00000002,
1165 VK_PIPELINE_CREATE_DERIVATIVE_BIT = 0x00000004,
1166}
1167
Jesse Hall65ab5522015-11-30 00:07:16 -08001168/// Color component flags
1169type VkFlags VkColorComponentFlags
1170bitfield VkColorComponentFlagBits {
1171 VK_COLOR_COMPONENT_R_BIT = 0x00000001,
1172 VK_COLOR_COMPONENT_G_BIT = 0x00000002,
1173 VK_COLOR_COMPONENT_B_BIT = 0x00000004,
1174 VK_COLOR_COMPONENT_A_BIT = 0x00000008,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001175}
1176
1177/// Fence creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001178type VkFlags VkFenceCreateFlags
1179bitfield VkFenceCreateFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001180 VK_FENCE_CREATE_SIGNALED_BIT = 0x00000001,
1181}
1182
1183/// Semaphore creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001184type VkFlags VkSemaphoreCreateFlags
Jesse Halla6429252015-11-29 18:59:42 -08001185//bitfield VkSemaphoreCreateFlagBits {
1186//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001187
1188/// Format capability flags
Jesse Halld8bade02015-11-24 10:24:18 -08001189type VkFlags VkFormatFeatureFlags
1190bitfield VkFormatFeatureFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001191 VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT = 0x00000001, /// Format can be used for sampled images (SAMPLED_IMAGE and COMBINED_IMAGE_SAMPLER descriptor types)
1192 VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT = 0x00000002, /// Format can be used for storage images (STORAGE_IMAGE descriptor type)
1193 VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT = 0x00000004, /// Format supports atomic operations in case it's used for storage images
1194 VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000008, /// Format can be used for uniform texel buffers (TBOs)
1195 VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT = 0x00000010, /// Format can be used for storage texel buffers (IBOs)
1196 VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT = 0x00000020, /// Format supports atomic operations in case it's used for storage texel buffers
1197 VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT = 0x00000040, /// Format can be used for vertex buffers (VBOs)
1198 VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT = 0x00000080, /// Format can be used for color attachment images
1199 VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT = 0x00000100, /// Format supports blending in case it's used for color attachment images
1200 VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000200, /// Format can be used for depth/stencil attachment images
Jesse Hall3fbc8562015-11-29 22:10:52 -08001201 VK_FORMAT_FEATURE_BLIT_SRC_BIT = 0x00000400, /// Format can be used as the source image of blits with vkCommandBlitImage
1202 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 -08001203 VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT = 0x00001000,
Jesse Hall26763382016-05-20 07:13:52 -07001204
1205 //@extension("VK_IMG_filter_cubic")
1206 VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG = 0x00002000,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001207}
1208
1209/// Query control flags
Jesse Halld8bade02015-11-24 10:24:18 -08001210type VkFlags VkQueryControlFlags
1211bitfield VkQueryControlFlagBits {
Jesse Hall65ab5522015-11-30 00:07:16 -08001212 VK_QUERY_CONTROL_PRECISE_BIT = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001213}
1214
1215/// Query result flags
Jesse Halld8bade02015-11-24 10:24:18 -08001216type VkFlags VkQueryResultFlags
1217bitfield VkQueryResultFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001218 VK_QUERY_RESULT_64_BIT = 0x00000001, /// Results of the queries are written to the destination buffer as 64-bit values
1219 VK_QUERY_RESULT_WAIT_BIT = 0x00000002, /// Results of the queries are waited on before proceeding with the result copy
1220 VK_QUERY_RESULT_WITH_AVAILABILITY_BIT = 0x00000004, /// Besides the results of the query, the availability of the results is also written
1221 VK_QUERY_RESULT_PARTIAL_BIT = 0x00000008, /// Copy the partial results of the query even if the final results aren't available
1222}
1223
1224/// Shader module creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001225type VkFlags VkShaderModuleCreateFlags
Jesse Halla6429252015-11-29 18:59:42 -08001226//bitfield VkShaderModuleCreateFlagBits {
1227//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001228
Jesse Halld27f6aa2015-08-15 17:58:48 -07001229/// Event creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001230type VkFlags VkEventCreateFlags
Jesse Halla6429252015-11-29 18:59:42 -08001231//bitfield VkEventCreateFlagBits {
1232//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001233
Jesse Halla15a4bf2015-11-19 22:48:02 -08001234/// Command buffer usage flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001235type VkFlags VkCommandBufferUsageFlags
1236bitfield VkCommandBufferUsageFlagBits {
1237 VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT = 0x00000001,
1238 VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT = 0x00000002,
1239 VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001240}
1241
1242/// Pipeline statistics flags
Jesse Halld8bade02015-11-24 10:24:18 -08001243type VkFlags VkQueryPipelineStatisticFlags
1244bitfield VkQueryPipelineStatisticFlagBits {
Jesse Hallae38f732015-11-19 21:32:50 -08001245 VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_BIT = 0x00000001, /// Optional
1246 VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_PRIMITIVES_BIT = 0x00000002, /// Optional
1247 VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT = 0x00000004, /// Optional
1248 VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_INVOCATIONS_BIT = 0x00000008, /// Optional
1249 VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT = 0x00000010, /// Optional
1250 VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT = 0x00000020, /// Optional
1251 VK_QUERY_PIPELINE_STATISTIC_CLIPPING_PRIMITIVES_BIT = 0x00000040, /// Optional
1252 VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT = 0x00000080, /// Optional
1253 VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT = 0x00000100, /// Optional
1254 VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT = 0x00000200, /// Optional
1255 VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT = 0x00000400, /// Optional
Jesse Halld27f6aa2015-08-15 17:58:48 -07001256}
1257
1258/// Memory mapping flags
Jesse Halld8bade02015-11-24 10:24:18 -08001259type VkFlags VkMemoryMapFlags
Jesse Halla6429252015-11-29 18:59:42 -08001260//bitfield VkMemoryMapFlagBits {
1261//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001262
1263/// Bitfield of image aspects
Jesse Halld8bade02015-11-24 10:24:18 -08001264type VkFlags VkImageAspectFlags
1265bitfield VkImageAspectFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001266 VK_IMAGE_ASPECT_COLOR_BIT = 0x00000001,
1267 VK_IMAGE_ASPECT_DEPTH_BIT = 0x00000002,
1268 VK_IMAGE_ASPECT_STENCIL_BIT = 0x00000004,
1269 VK_IMAGE_ASPECT_METADATA_BIT = 0x00000008,
1270}
1271
1272/// Sparse memory bind flags
Jesse Halld8bade02015-11-24 10:24:18 -08001273type VkFlags VkSparseMemoryBindFlags
Jesse Hall091ed9e2015-11-30 00:55:29 -08001274bitfield VkSparseMemoryBindFlagBits {
1275 VK_SPARSE_MEMORY_BIND_METADATA_BIT = 0x00000001,
1276}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001277
1278/// Sparse image memory requirements flags
Jesse Halld8bade02015-11-24 10:24:18 -08001279type VkFlags VkSparseImageFormatFlags
1280bitfield VkSparseImageFormatFlagBits {
Jesse Hallb00daad2015-11-29 19:46:20 -08001281 VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT = 0x00000001, /// Image uses a single miptail region for all array slices
1282 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.
1283 VK_SPARSE_IMAGE_FORMAT_NONSTANDARD_BLOCK_SIZE_BIT = 0x00000004, /// Image uses a non-standard sparse block size
Jesse Halld27f6aa2015-08-15 17:58:48 -07001284}
1285
1286/// Pipeline stages
Jesse Halld8bade02015-11-24 10:24:18 -08001287type VkFlags VkPipelineStageFlags
1288bitfield VkPipelineStageFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001289 VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT = 0x00000001, /// Before subsequent commands are processed
1290 VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT = 0x00000002, /// Draw/DispatchIndirect command fetch
1291 VK_PIPELINE_STAGE_VERTEX_INPUT_BIT = 0x00000004, /// Vertex/index fetch
1292 VK_PIPELINE_STAGE_VERTEX_SHADER_BIT = 0x00000008, /// Vertex shading
Jesse Hallae38f732015-11-19 21:32:50 -08001293 VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT = 0x00000010, /// Tessellation control shading
1294 VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT = 0x00000020, /// Tessellation evaluation shading
Jesse Halld27f6aa2015-08-15 17:58:48 -07001295 VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT = 0x00000040, /// Geometry shading
1296 VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT = 0x00000080, /// Fragment shading
1297 VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT = 0x00000100, /// Early fragment (depth/stencil) tests
1298 VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT = 0x00000200, /// Late fragment (depth/stencil) tests
1299 VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT = 0x00000400, /// Color attachment writes
1300 VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT = 0x00000800, /// Compute shading
1301 VK_PIPELINE_STAGE_TRANSFER_BIT = 0x00001000, /// Transfer/copy operations
Jesse Hall543a7ff2016-01-08 16:38:30 -08001302 VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT = 0x00002000,
1303 VK_PIPELINE_STAGE_HOST_BIT = 0x00004000, /// Indicates host (CPU) is a source/sink of the dependency
Jesse Halld27f6aa2015-08-15 17:58:48 -07001304
Jesse Hall543a7ff2016-01-08 16:38:30 -08001305 VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT = 0x00008000, /// All stages of the graphics pipeline
1306 VK_PIPELINE_STAGE_ALL_COMMANDS_BIT = 0x00010000, /// All graphics, compute, copy, and transition commands
Chris Forbes289cb792016-12-30 15:03:55 +13001307
1308 //@extension("VK_NVX_device_generated_commands")
1309 VK_PIPELINE_STAGE_COMMAND_PROCESS_BIT_NVX = 0x00020000,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001310}
1311
1312/// Render pass attachment description flags
Jesse Halld8bade02015-11-24 10:24:18 -08001313type VkFlags VkAttachmentDescriptionFlags
1314bitfield VkAttachmentDescriptionFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001315 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 -07001316}
1317
1318/// Subpass description flags
Jesse Halld8bade02015-11-24 10:24:18 -08001319type VkFlags VkSubpassDescriptionFlags
1320bitfield VkSubpassDescriptionFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001321}
1322
1323/// Command pool creation flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001324type VkFlags VkCommandPoolCreateFlags
1325bitfield VkCommandPoolCreateFlagBits {
1326 VK_COMMAND_POOL_CREATE_TRANSIENT_BIT = 0x00000001, /// Command buffers have a short lifetime
1327 VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT = 0x00000002, /// Command buffers may release their memory individually
Jesse Halld27f6aa2015-08-15 17:58:48 -07001328}
1329
1330/// Command pool reset flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001331type VkFlags VkCommandPoolResetFlags
1332bitfield VkCommandPoolResetFlagBits {
1333 VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT = 0x00000001, /// Release resources owned by the pool
Jesse Halld27f6aa2015-08-15 17:58:48 -07001334}
1335
Jesse Hall3fbc8562015-11-29 22:10:52 -08001336type VkFlags VkCommandBufferResetFlags
1337bitfield VkCommandBufferResetFlagBits {
1338 VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT = 0x00000001, /// Release resources owned by the buffer
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001339}
1340
Jesse Halld8bade02015-11-24 10:24:18 -08001341type VkFlags VkSampleCountFlags
1342bitfield VkSampleCountFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001343 VK_SAMPLE_COUNT_1_BIT = 0x00000001,
1344 VK_SAMPLE_COUNT_2_BIT = 0x00000002,
1345 VK_SAMPLE_COUNT_4_BIT = 0x00000004,
1346 VK_SAMPLE_COUNT_8_BIT = 0x00000008,
1347 VK_SAMPLE_COUNT_16_BIT = 0x00000010,
1348 VK_SAMPLE_COUNT_32_BIT = 0x00000020,
1349 VK_SAMPLE_COUNT_64_BIT = 0x00000040,
1350}
1351
Jesse Halld8bade02015-11-24 10:24:18 -08001352type VkFlags VkStencilFaceFlags
1353bitfield VkStencilFaceFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001354 VK_STENCIL_FACE_FRONT_BIT = 0x00000001, /// Front face
1355 VK_STENCIL_FACE_BACK_BIT = 0x00000002, /// Back face
Jesse Hallc7467b72015-11-29 21:05:26 -08001356 VK_STENCIL_FRONT_AND_BACK = 0x00000003,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001357}
1358
Jesse Halla6429252015-11-29 18:59:42 -08001359/// Instance creation flags
1360type VkFlags VkInstanceCreateFlags
1361//bitfield VkInstanceCreateFlagBits {
1362//}
1363
1364/// Device creation flags
1365type VkFlags VkDeviceCreateFlags
1366//bitfield VkDeviceCreateFlagBits {
1367//}
1368
1369/// Device queue creation flags
1370type VkFlags VkDeviceQueueCreateFlags
1371//bitfield VkDeviceQueueCreateFlagBits {
1372//}
1373
1374/// Query pool creation flags
1375type VkFlags VkQueryPoolCreateFlags
1376//bitfield VkQueryPoolCreateFlagBits {
1377//}
1378
1379/// Buffer view creation flags
1380type VkFlags VkBufferViewCreateFlags
1381//bitfield VkBufferViewCreateFlagBits {
1382//}
1383
1384/// Pipeline cache creation flags
1385type VkFlags VkPipelineCacheCreateFlags
1386//bitfield VkPipelineCacheCreateFlagBits {
1387//}
1388
1389/// Pipeline shader stage creation flags
1390type VkFlags VkPipelineShaderStageCreateFlags
1391//bitfield VkPipelineShaderStageCreateFlagBits {
1392//}
1393
1394/// Descriptor set layout creation flags
1395type VkFlags VkDescriptorSetLayoutCreateFlags
1396//bitfield VkDescriptorSetLayoutCreateFlagBits {
1397//}
1398
1399/// Pipeline vertex input state creation flags
1400type VkFlags VkPipelineVertexInputStateCreateFlags
1401//bitfield VkPipelineVertexInputStateCreateFlagBits {
1402//}
1403
1404/// Pipeline input assembly state creation flags
1405type VkFlags VkPipelineInputAssemblyStateCreateFlags
1406//bitfield VkPipelineInputAssemblyStateCreateFlagBits {
1407//}
1408
1409/// Tessellation state creation flags
1410type VkFlags VkPipelineTessellationStateCreateFlags
1411//bitfield VkPipelineTessellationStateCreateFlagBits {
1412//}
1413
1414/// Viewport state creation flags
1415type VkFlags VkPipelineViewportStateCreateFlags
1416//bitfield VkPipelineViewportStateCreateFlagBits {
1417//}
1418
Jesse Hall3fbc8562015-11-29 22:10:52 -08001419/// Rasterization state creation flags
1420type VkFlags VkPipelineRasterizationStateCreateFlags
1421//bitfield VkPipelineRasterizationStateCreateFlagBits {
Jesse Halla6429252015-11-29 18:59:42 -08001422//}
1423
1424/// Multisample state creation flags
1425type VkFlags VkPipelineMultisampleStateCreateFlags
1426//bitfield VkPipelineMultisampleStateCreateFlagBits {
1427//}
1428
1429/// Color blend state creation flags
1430type VkFlags VkPipelineColorBlendStateCreateFlags
1431//bitfield VkPipelineColorBlendStateCreateFlagBits {
1432//}
1433
1434/// Depth/stencil state creation flags
1435type VkFlags VkPipelineDepthStencilStateCreateFlags
1436//bitfield VkPipelineDepthStencilStateCreateFlagBits {
1437//}
1438
1439/// Dynamic state creation flags
1440type VkFlags VkPipelineDynamicStateCreateFlags
1441//bitfield VkPipelineDynamicStateCreateFlagBits {
1442//}
1443
1444/// Pipeline layout creation flags
1445type VkFlags VkPipelineLayoutCreateFlags
1446//bitfield VkPipelineLayoutCreateFlagBits {
1447//}
1448
1449/// Sampler creation flags
1450type VkFlags VkSamplerCreateFlags
1451//bitfield VkSamplerCreateFlagBits {
1452//}
1453
1454/// Render pass creation flags
1455type VkFlags VkRenderPassCreateFlags
1456//bitfield VkRenderPassCreateFlagBits {
1457//}
1458
1459/// Framebuffer creation flags
1460type VkFlags VkFramebufferCreateFlags
1461//bitfield VkFramebufferCreateFlagBits {
1462//}
1463
Jesse Halldc6d36c2015-11-29 19:12:15 -08001464/// Dependency flags
1465type VkFlags VkDependencyFlags
1466bitfield VkDependencyFlagBits {
1467 VK_DEPENDENCY_BY_REGION_BIT = 0x00000001,
1468}
1469
Jesse Hallc7467b72015-11-29 21:05:26 -08001470/// Cull mode flags
1471type VkFlags VkCullModeFlags
1472bitfield VkCullModeFlagBits {
1473 VK_CULL_MODE_NONE = 0x00000000,
1474 VK_CULL_MODE_FRONT_BIT = 0x00000001,
1475 VK_CULL_MODE_BACK_BIT = 0x00000002,
1476 VK_CULL_MODE_FRONT_AND_BACK = 0x00000003,
1477}
1478
Jesse Hall523db342015-11-30 21:12:55 -08001479@extension("VK_KHR_surface")
Jesse Halld8bade02015-11-24 10:24:18 -08001480type VkFlags VkSurfaceTransformFlagsKHR
Jesse Hall523db342015-11-30 21:12:55 -08001481@extension("VK_KHR_surface")
Jesse Halld8bade02015-11-24 10:24:18 -08001482bitfield VkSurfaceTransformFlagBitsKHR {
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001483 VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR = 0x00000001,
Jesse Hall9ba8bc82015-11-30 16:22:16 -08001484 VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR = 0x00000002,
1485 VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR = 0x00000004,
1486 VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR = 0x00000008,
1487 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR = 0x00000010,
1488 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR = 0x00000020,
1489 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR = 0x00000040,
1490 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR = 0x00000080,
1491 VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR = 0x00000100,
Michael Lentine88594d72015-11-12 12:49:45 -08001492}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001493
Jesse Hall523db342015-11-30 21:12:55 -08001494@extension("VK_KHR_surface")
Jesse Halla6429252015-11-29 18:59:42 -08001495type VkFlags VkCompositeAlphaFlagsKHR
Jesse Hall523db342015-11-30 21:12:55 -08001496@extension("VK_KHR_surface")
Jesse Halla6429252015-11-29 18:59:42 -08001497bitfield VkCompositeAlphaFlagBitsKHR {
1498 VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR = 0x00000001,
1499 VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR = 0x00000002,
1500 VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR = 0x00000004,
1501 VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR = 0x00000008,
1502}
1503
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001504@extension("VK_KHR_swapchain")
1505type VkFlags VkSwapchainCreateFlagsKHR
1506//@extension("VK_KHR_swapchain")
1507//bitfield VkSwapchainCreateFlagBitsKHR {
1508//}
1509
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001510@extension("VK_KHR_display")
Jesse Halld8bade02015-11-24 10:24:18 -08001511type VkFlags VkDisplayPlaneAlphaFlagsKHR
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001512@extension("VK_KHR_display")
Jesse Halld8bade02015-11-24 10:24:18 -08001513bitfield VkDisplayPlaneAlphaFlagBitsKHR {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001514 VK_DISPLAY_PLANE_ALPHA_OPAQUE_BIT_KHR = 0x00000001,
1515 VK_DISPLAY_PLANE_ALPHA_GLOBAL_BIT_KHR = 0x00000002,
1516 VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_BIT_KHR = 0x00000004,
1517 VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_PREMULTIPLIED_BIT_KHR = 0x00000008,
Jesse Hall1356b0d2015-11-23 17:24:58 -08001518}
1519
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001520@extension("VK_KHR_display")
1521type VkFlags VkDisplaySurfaceCreateFlagsKHR
1522//@extension("VK_KHR_display")
1523//bitfield VkDisplaySurfaceCreateFlagBitsKHR {
1524//}
1525
Jesse Hall9ba8bc82015-11-30 16:22:16 -08001526@extension("VK_KHR_display")
1527type VkFlags VkDisplayModeCreateFlagsKHR
1528//@extension("VK_KHR_display")
1529//bitfield VkDisplayModeCreateFlagBitsKHR {
1530//}
1531
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001532@extension("VK_KHR_xlib_surface")
1533type VkFlags VkXlibSurfaceCreateFlagsKHR
1534//@extension("VK_KHR_xlib_surface")
1535//bitfield VkXlibSurfaceCreateFlagBitsKHR {
1536//}
1537
1538@extension("VK_KHR_xcb_surface")
1539type VkFlags VkXcbSurfaceCreateFlagsKHR
1540//@extension("VK_KHR_xcb_surface")
1541//bitfield VkXcbSurfaceCreateFlagBitsKHR {
1542//}
1543
1544@extension("VK_KHR_wayland_surface")
1545type VkFlags VkWaylandSurfaceCreateFlagsKHR
1546//@extension("VK_KHR_wayland_surface")
1547//bitfield VkWaylandSurfaceCreateFlagBitsKHR {
1548//}
1549
1550@extension("VK_KHR_mir_surface")
1551type VkFlags VkMirSurfaceCreateFlagsKHR
1552//@extension("VK_KHR_mir_surface")
1553//bitfield VkMirSurfaceCreateFlagBitsKHR {
1554//}
1555
1556@extension("VK_KHR_android_surface")
1557type VkFlags VkAndroidSurfaceCreateFlagsKHR
1558//@extension("VK_KHR_android_surface")
1559//bitfield VkAndroidSurfaceCreateFlagBitsKHR {
1560//}
1561
1562@extension("VK_KHR_win32_surface")
1563type VkFlags VkWin32SurfaceCreateFlagsKHR
1564//@extension("VK_KHR_win32_surface")
1565//bitfield VkWin32SurfaceCreateFlagBitsKHR {
1566//}
1567
Jesse Hall715b86a2016-01-16 16:34:29 -08001568@extension("VK_EXT_debug_report")
1569type VkFlags VkDebugReportFlagsEXT
1570@extension("VK_EXT_debug_report")
1571bitfield VkDebugReportFlagBitsEXT {
Jesse Halle2948d82016-02-25 04:19:32 -08001572 VK_DEBUG_REPORT_INFORMATION_BIT_EXT = 0x00000001,
1573 VK_DEBUG_REPORT_WARNING_BIT_EXT = 0x00000002,
1574 VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT = 0x00000004,
Jesse Hall715b86a2016-01-16 16:34:29 -08001575 VK_DEBUG_REPORT_ERROR_BIT_EXT = 0x00000008,
1576 VK_DEBUG_REPORT_DEBUG_BIT_EXT = 0x00000010,
1577}
1578
Chris Forbes8e4438b2016-12-07 16:26:49 +13001579@extension("VK_ANDROID_native_buffer")
1580type VkFlags VkSwapchainImageUsageFlagsANDROID
1581@extension("VK_ANDROID_native_buffer")
1582bitfield VkSwapchainImageUsageFlagBitsANDROID {
Chris Forbes4da65b92017-01-31 11:48:50 +13001583 VK_SWAPCHAIN_IMAGE_USAGE_FLAGS_SHARED_BIT_ANDROID = 0x00000001,
Chris Forbes8e4438b2016-12-07 16:26:49 +13001584}
1585
Chris Forbes289cb792016-12-30 15:03:55 +13001586@extension("VK_NV_external_memory_capabilities")
1587type VkFlags VkExternalMemoryHandleTypeFlagsNV
1588@extension("VK_NV_external_memory_capabilities")
1589bitfield VkExternalMemoryHandleTypeFlagBitsNV {
1590 VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_NV = 0x00000001,
1591 VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_NV = 0x00000002,
1592 VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_IMAGE_BIT_NV = 0x00000004,
1593 VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_IMAGE_KMT_BIT_NV = 0x00000008,
1594}
1595
1596@extension("VK_NV_external_memory_capabilities")
1597type VkFlags VkExternalMemoryFeatureFlagsNV
1598@extension("VK_NV_external_memory_capabilities")
1599bitfield VkExternalMemoryFeatureFlagBitsNV {
1600 VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT_NV = 0x00000001,
1601 VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT_NV = 0x00000002,
1602 VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT_NV = 0x00000004,
1603}
1604
1605@extension("VK_NVX_device_generated_commands")
1606type VkFlags VkIndirectCommandsLayoutUsageFlagsNVX
1607@extension("VK_NVX_device_generated_commands")
1608bitfield VkIndirectCommandsLayoutUsageFlagBitsNVX {
1609 VK_INDIRECT_COMMANDS_LAYOUT_USAGE_UNORDERED_SEQUENCES_BIT_NVX = 0x00000001,
1610 VK_INDIRECT_COMMANDS_LAYOUT_USAGE_SPARSE_SEQUENCES_BIT_NVX = 0x00000002,
1611 VK_INDIRECT_COMMANDS_LAYOUT_USAGE_EMPTY_EXECUTIONS_BIT_NVX = 0x00000004,
1612 VK_INDIRECT_COMMANDS_LAYOUT_USAGE_INDEXED_SEQUENCES_BIT_NVX = 0x00000008,
1613}
1614
1615@extension("VK_NVX_device_generated_commands")
1616type VkFlags VkObjectEntryUsageFlagsNVX
1617@extension("VK_NVX_device_generated_commands")
1618bitfield VkObjectEntryUsageFlagBitsNVX {
1619 VK_OBJECT_ENTRY_USAGE_GRAPHICS_BIT_NVX = 0x00000001,
1620 VK_OBJECT_ENTRY_USAGE_COMPUTE_BIT_NVX = 0x00000002,
1621}
1622
Jesse Hall1356b0d2015-11-23 17:24:58 -08001623
Jesse Halld27f6aa2015-08-15 17:58:48 -07001624//////////////////
1625// Structures //
1626//////////////////
1627
1628class VkOffset2D {
1629 s32 x
1630 s32 y
1631}
1632
1633class VkOffset3D {
1634 s32 x
1635 s32 y
1636 s32 z
1637}
1638
1639class VkExtent2D {
Jesse Hall3dd678a2016-01-08 21:52:01 -08001640 u32 width
1641 u32 height
Jesse Halld27f6aa2015-08-15 17:58:48 -07001642}
1643
1644class VkExtent3D {
Jesse Hall3dd678a2016-01-08 21:52:01 -08001645 u32 width
1646 u32 height
1647 u32 depth
Jesse Halld27f6aa2015-08-15 17:58:48 -07001648}
1649
1650class VkViewport {
Jesse Hall65ab5522015-11-30 00:07:16 -08001651 f32 x
1652 f32 y
Jesse Halld27f6aa2015-08-15 17:58:48 -07001653 f32 width
1654 f32 height
1655 f32 minDepth
1656 f32 maxDepth
1657}
1658
1659class VkRect2D {
1660 VkOffset2D offset
1661 VkExtent2D extent
1662}
1663
Jesse Halla15a4bf2015-11-19 22:48:02 -08001664class VkClearRect {
1665 VkRect2D rect
1666 u32 baseArrayLayer
Jesse Hall3fbc8562015-11-29 22:10:52 -08001667 u32 layerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001668}
1669
Jesse Hall65ab5522015-11-30 00:07:16 -08001670class VkComponentMapping {
1671 VkComponentSwizzle r
1672 VkComponentSwizzle g
1673 VkComponentSwizzle b
1674 VkComponentSwizzle a
Jesse Halld27f6aa2015-08-15 17:58:48 -07001675}
1676
1677class VkPhysicalDeviceProperties {
1678 u32 apiVersion
1679 u32 driverVersion
Jesse Hall65ab5522015-11-30 00:07:16 -08001680 u32 vendorID
1681 u32 deviceID
Jesse Halld27f6aa2015-08-15 17:58:48 -07001682 VkPhysicalDeviceType deviceType
Jesse Hall65ab5522015-11-30 00:07:16 -08001683 char[VK_MAX_PHYSICAL_DEVICE_NAME_SIZE] deviceName
1684 u8[VK_UUID_SIZE] pipelineCacheUUID
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001685 VkPhysicalDeviceLimits limits
1686 VkPhysicalDeviceSparseProperties sparseProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07001687}
1688
1689class VkExtensionProperties {
Jesse Hall65ab5522015-11-30 00:07:16 -08001690 char[VK_MAX_EXTENSION_NAME_SIZE] extensionName /// extension name
Jesse Halld27f6aa2015-08-15 17:58:48 -07001691 u32 specVersion /// version of the extension specification implemented
1692}
1693
1694class VkLayerProperties {
Jesse Hall65ab5522015-11-30 00:07:16 -08001695 char[VK_MAX_EXTENSION_NAME_SIZE] layerName /// layer name
Jesse Hall3fbc8562015-11-29 22:10:52 -08001696 u32 specVersion /// version of the layer specification implemented
1697 u32 implementationVersion /// build or release version of the layer's library
Jesse Hall65ab5522015-11-30 00:07:16 -08001698 char[VK_MAX_DESCRIPTION_SIZE] description /// Free-form description of the layer
Jesse Halld27f6aa2015-08-15 17:58:48 -07001699}
1700
Jesse Halla366a512015-11-19 22:30:07 -08001701class VkSubmitInfo {
Jesse Hall03b6fe12015-11-24 12:44:21 -08001702 VkStructureType sType /// Type of structure. Should be VK_STRUCTURE_TYPE_SUBMIT_INFO
1703 const void* pNext /// Next structure in chain
1704 u32 waitSemaphoreCount
Jesse Halla366a512015-11-19 22:30:07 -08001705 const VkSemaphore* pWaitSemaphores
Jesse Hall543a7ff2016-01-08 16:38:30 -08001706 const VkPipelineStageFlags* pWaitDstStageMask
Jesse Hall03b6fe12015-11-24 12:44:21 -08001707 u32 commandBufferCount
Jesse Hall3fbc8562015-11-29 22:10:52 -08001708 const VkCommandBuffer* pCommandBuffers
Jesse Hall03b6fe12015-11-24 12:44:21 -08001709 u32 signalSemaphoreCount
Jesse Halla366a512015-11-19 22:30:07 -08001710 const VkSemaphore* pSignalSemaphores
1711}
1712
Jesse Halld27f6aa2015-08-15 17:58:48 -07001713class VkApplicationInfo {
1714 VkStructureType sType /// Type of structure. Should be VK_STRUCTURE_TYPE_APPLICATION_INFO
1715 const void* pNext /// Next structure in chain
Jesse Hall3fbc8562015-11-29 22:10:52 -08001716 const char* pApplicationName
1717 u32 applicationVersion
Jesse Halld27f6aa2015-08-15 17:58:48 -07001718 const char* pEngineName
1719 u32 engineVersion
1720 u32 apiVersion
1721}
1722
Jesse Hall3fbc8562015-11-29 22:10:52 -08001723class VkAllocationCallbacks {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001724 void* pUserData
Jesse Hall3fbc8562015-11-29 22:10:52 -08001725 PFN_vkAllocationFunction pfnAllocation
1726 PFN_vkReallocationFunction pfnReallocation
Jesse Halld27f6aa2015-08-15 17:58:48 -07001727 PFN_vkFreeFunction pfnFree
Jesse Hall3fbc8562015-11-29 22:10:52 -08001728 PFN_vkInternalAllocationNotification pfnInternalAllocation
Jesse Hall03b6fe12015-11-24 12:44:21 -08001729 PFN_vkInternalFreeNotification pfnInternalFree
Jesse Halld27f6aa2015-08-15 17:58:48 -07001730}
1731
1732class VkDeviceQueueCreateInfo {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001733 VkStructureType sStype /// Should be VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO
1734 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001735 VkDeviceQueueCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001736 u32 queueFamilyIndex
Jesse Halldba27f72015-11-30 14:25:46 -08001737 u32 queueCount
Jesse Hallfbf97b02015-11-20 14:17:03 -08001738 const f32* pQueuePriorities
Jesse Halld27f6aa2015-08-15 17:58:48 -07001739}
1740
1741class VkDeviceCreateInfo {
1742 VkStructureType sType /// Should be VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO
1743 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001744 VkDeviceCreateFlags flags
Jesse Halldba27f72015-11-30 14:25:46 -08001745 u32 queueCreateInfoCount
1746 const VkDeviceQueueCreateInfo* pQueueCreateInfos
Jesse Hall3dd678a2016-01-08 21:52:01 -08001747 u32 enabledLayerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001748 const char* const* ppEnabledLayerNames /// Ordered list of layer names to be enabled
Jesse Hall3dd678a2016-01-08 21:52:01 -08001749 u32 enabledExtensionCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001750 const char* const* ppEnabledExtensionNames
1751 const VkPhysicalDeviceFeatures* pEnabledFeatures
Jesse Halld27f6aa2015-08-15 17:58:48 -07001752}
1753
1754class VkInstanceCreateInfo {
1755 VkStructureType sType /// Should be VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO
1756 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001757 VkInstanceCreateFlags flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001758 const VkApplicationInfo* pApplicationInfo
Jesse Hall3dd678a2016-01-08 21:52:01 -08001759 u32 enabledLayerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001760 const char* const* ppEnabledLayerNames /// Ordered list of layer names to be enabled
Jesse Hall3dd678a2016-01-08 21:52:01 -08001761 u32 enabledExtensionCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001762 const char* const* ppEnabledExtensionNames /// Extension names to be enabled
1763}
1764
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001765class VkQueueFamilyProperties {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001766 VkQueueFlags queueFlags /// Queue flags
1767 u32 queueCount
Jesse Hallacfa5342015-11-19 21:51:33 -08001768 u32 timestampValidBits
Jesse Hall65ab5522015-11-30 00:07:16 -08001769 VkExtent3D minImageTransferGranularity
Jesse Halld27f6aa2015-08-15 17:58:48 -07001770}
1771
1772class VkPhysicalDeviceMemoryProperties {
1773 u32 memoryTypeCount
1774 VkMemoryType[VK_MAX_MEMORY_TYPES] memoryTypes
1775 u32 memoryHeapCount
1776 VkMemoryHeap[VK_MAX_MEMORY_HEAPS] memoryHeaps
1777}
1778
Jesse Hall3fbc8562015-11-29 22:10:52 -08001779class VkMemoryAllocateInfo {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001780 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07001781 const void* pNext /// Pointer to next structure
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001782 VkDeviceSize allocationSize /// Size of memory allocation
Jesse Halld27f6aa2015-08-15 17:58:48 -07001783 u32 memoryTypeIndex /// Index of the of the memory type to allocate from
1784}
1785
1786class VkMemoryRequirements {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001787 VkDeviceSize size /// Specified in bytes
1788 VkDeviceSize alignment /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001789 u32 memoryTypeBits /// Bitfield of the allowed memory type indices into memoryTypes[] for this object
1790}
1791
1792class VkSparseImageFormatProperties {
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001793 VkImageAspectFlagBits aspectMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001794 VkExtent3D imageGranularity
1795 VkSparseImageFormatFlags flags
1796}
1797
1798class VkSparseImageMemoryRequirements {
Jesse Hallb00daad2015-11-29 19:46:20 -08001799 VkSparseImageFormatProperties formatProperties
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001800 u32 imageMipTailFirstLod
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001801 VkDeviceSize imageMipTailSize /// Specified in bytes, must be a multiple of image block size / alignment
1802 VkDeviceSize imageMipTailOffset /// Specified in bytes, must be a multiple of image block size / alignment
1803 VkDeviceSize imageMipTailStride /// Specified in bytes, must be a multiple of image block size / alignment
Jesse Halld27f6aa2015-08-15 17:58:48 -07001804}
1805
1806class VkMemoryType {
1807 VkMemoryPropertyFlags propertyFlags /// Memory properties of this memory type
1808 u32 heapIndex /// Index of the memory heap allocations of this memory type are taken from
1809}
1810
1811class VkMemoryHeap {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001812 VkDeviceSize size /// Available memory in the heap
Jesse Halld27f6aa2015-08-15 17:58:48 -07001813 VkMemoryHeapFlags flags /// Flags for the heap
1814}
1815
1816class VkMappedMemoryRange {
1817 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE
1818 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08001819 VkDeviceMemory memory /// Mapped memory object
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001820 VkDeviceSize offset /// Offset within the mapped memory the range starts from
1821 VkDeviceSize size /// Size of the range within the mapped memory
Jesse Halld27f6aa2015-08-15 17:58:48 -07001822}
1823
1824class VkFormatProperties {
1825 VkFormatFeatureFlags linearTilingFeatures /// Format features in case of linear tiling
1826 VkFormatFeatureFlags optimalTilingFeatures /// Format features in case of optimal tiling
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001827 VkFormatFeatureFlags bufferFeatures /// Format features supported by buffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07001828}
1829
1830class VkImageFormatProperties {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001831 VkExtent3D maxExtent /// max image dimensions for this resource type
1832 u32 maxMipLevels /// max number of mipmap levels for this resource type
Jesse Halla15a4bf2015-11-19 22:48:02 -08001833 u32 maxArrayLayers /// max array layers for this resource type
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001834 VkSampleCountFlags sampleCounts /// supported sample counts for this resource type
1835 VkDeviceSize maxResourceSize /// max size (in bytes) of this resource type
1836}
1837
Jesse Halla15a4bf2015-11-19 22:48:02 -08001838class VkDescriptorImageInfo {
1839 VkSampler sampler
1840 VkImageView imageView
1841 VkImageLayout imageLayout
1842}
1843
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001844class VkDescriptorBufferInfo {
1845 VkBuffer buffer /// Buffer used for this descriptor when the descriptor is UNIFORM_BUFFER[_DYNAMIC]
1846 VkDeviceSize offset /// Base offset from buffer start in bytes to update in the descriptor set.
1847 VkDeviceSize range /// Size in bytes of the buffer resource for this descriptor update.
Jesse Halld27f6aa2015-08-15 17:58:48 -07001848}
1849
Jesse Halld27f6aa2015-08-15 17:58:48 -07001850class VkWriteDescriptorSet {
1851 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET
1852 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08001853 VkDescriptorSet dstSet /// Destination descriptor set
1854 u32 dstBinding /// Binding within the destination descriptor set to write
1855 u32 dstArrayElement /// Array element within the destination binding to write
Jesse Hall03b6fe12015-11-24 12:44:21 -08001856 u32 descriptorCount /// Number of descriptors to write (determines the size of the array pointed by <pDescriptors>)
Jesse Halld27f6aa2015-08-15 17:58:48 -07001857 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 -08001858 const VkDescriptorImageInfo* pImageInfo
1859 const VkDescriptorBufferInfo* pBufferInfo
1860 const VkBufferView* pTexelBufferView
Jesse Halld27f6aa2015-08-15 17:58:48 -07001861}
1862
1863class VkCopyDescriptorSet {
1864 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET
1865 const void* pNext /// Pointer to next structure
1866 VkDescriptorSet srcSet /// Source descriptor set
1867 u32 srcBinding /// Binding within the source descriptor set to copy from
1868 u32 srcArrayElement /// Array element within the source binding to copy from
Jesse Hall3fbc8562015-11-29 22:10:52 -08001869 VkDescriptorSet dstSet /// Destination descriptor set
1870 u32 dstBinding /// Binding within the destination descriptor set to copy to
1871 u32 dstArrayElement /// Array element within the destination binding to copy to
Jesse Hall03b6fe12015-11-24 12:44:21 -08001872 u32 descriptorCount /// Number of descriptors to copy
Jesse Halld27f6aa2015-08-15 17:58:48 -07001873}
1874
1875class VkBufferCreateInfo {
1876 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO
1877 const void* pNext /// Pointer to next structure.
Jesse Halla6429252015-11-29 18:59:42 -08001878 VkBufferCreateFlags flags /// Buffer creation flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001879 VkDeviceSize size /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001880 VkBufferUsageFlags usage /// Buffer usage flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001881 VkSharingMode sharingMode
Jesse Hall03b6fe12015-11-24 12:44:21 -08001882 u32 queueFamilyIndexCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001883 const u32* pQueueFamilyIndices
1884}
1885
1886class VkBufferViewCreateInfo {
1887 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO
1888 const void* pNext /// Pointer to next structure.
Jesse Halla6429252015-11-29 18:59:42 -08001889 VkBufferViewCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001890 VkBuffer buffer
Jesse Halld27f6aa2015-08-15 17:58:48 -07001891 VkFormat format /// Optionally specifies format of elements
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001892 VkDeviceSize offset /// Specified in bytes
1893 VkDeviceSize range /// View size specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001894}
1895
1896class VkImageSubresource {
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001897 VkImageAspectFlagBits aspectMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001898 u32 mipLevel
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001899 u32 arrayLayer
Jesse Halld27f6aa2015-08-15 17:58:48 -07001900}
1901
1902class VkImageSubresourceRange {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001903 VkImageAspectFlags aspectMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001904 u32 baseMipLevel
Jesse Hall3fbc8562015-11-29 22:10:52 -08001905 u32 levelCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001906 u32 baseArrayLayer
Jesse Hall3fbc8562015-11-29 22:10:52 -08001907 u32 layerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001908}
1909
1910class VkMemoryBarrier {
1911 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MEMORY_BARRIER
1912 const void* pNext /// Pointer to next structure.
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001913 VkAccessFlags srcAccessMask
1914 VkAccessFlags dstAccessMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001915}
1916
1917class VkBufferMemoryBarrier {
1918 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER
1919 const void* pNext /// Pointer to next structure.
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001920 VkAccessFlags srcAccessMask
1921 VkAccessFlags dstAccessMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001922 u32 srcQueueFamilyIndex /// Queue family to transition ownership from
Jesse Hall3fbc8562015-11-29 22:10:52 -08001923 u32 dstQueueFamilyIndex /// Queue family to transition ownership to
Jesse Halld27f6aa2015-08-15 17:58:48 -07001924 VkBuffer buffer /// Buffer to sync
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001925 VkDeviceSize offset /// Offset within the buffer to sync
1926 VkDeviceSize size /// Amount of bytes to sync
Jesse Halld27f6aa2015-08-15 17:58:48 -07001927}
1928
1929class VkImageMemoryBarrier {
1930 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER
1931 const void* pNext /// Pointer to next structure.
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001932 VkAccessFlags srcAccessMask
1933 VkAccessFlags dstAccessMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001934 VkImageLayout oldLayout /// Current layout of the image
1935 VkImageLayout newLayout /// New layout to transition the image to
1936 u32 srcQueueFamilyIndex /// Queue family to transition ownership from
Jesse Hall3fbc8562015-11-29 22:10:52 -08001937 u32 dstQueueFamilyIndex /// Queue family to transition ownership to
Jesse Halld27f6aa2015-08-15 17:58:48 -07001938 VkImage image /// Image to sync
1939 VkImageSubresourceRange subresourceRange /// Subresource range to sync
1940}
1941
1942class VkImageCreateInfo {
1943 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO
1944 const void* pNext /// Pointer to next structure.
Jesse Halla6429252015-11-29 18:59:42 -08001945 VkImageCreateFlags flags /// Image creation flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001946 VkImageType imageType
1947 VkFormat format
1948 VkExtent3D extent
1949 u32 mipLevels
Jesse Halla15a4bf2015-11-19 22:48:02 -08001950 u32 arrayLayers
Jesse Hall091ed9e2015-11-30 00:55:29 -08001951 VkSampleCountFlagBits samples
Jesse Halld27f6aa2015-08-15 17:58:48 -07001952 VkImageTiling tiling
1953 VkImageUsageFlags usage /// Image usage flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001954 VkSharingMode sharingMode /// Cross-queue-family sharing mode
Jesse Hall03b6fe12015-11-24 12:44:21 -08001955 u32 queueFamilyIndexCount /// Number of queue families to share across
Jesse Halld27f6aa2015-08-15 17:58:48 -07001956 const u32* pQueueFamilyIndices /// Array of queue family indices to share across
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001957 VkImageLayout initialLayout /// Initial image layout for all subresources
Jesse Halld27f6aa2015-08-15 17:58:48 -07001958}
1959
1960class VkSubresourceLayout {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001961 VkDeviceSize offset /// Specified in bytes
1962 VkDeviceSize size /// Specified in bytes
1963 VkDeviceSize rowPitch /// Specified in bytes
Jesse Hall543a7ff2016-01-08 16:38:30 -08001964 VkDeviceSize arrayPitch /// Specified in bytes
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001965 VkDeviceSize depthPitch /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001966}
1967
1968class VkImageViewCreateInfo {
1969 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO
1970 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001971 VkImageViewCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001972 VkImage image
1973 VkImageViewType viewType
1974 VkFormat format
Jesse Hall65ab5522015-11-30 00:07:16 -08001975 VkComponentMapping components
Jesse Halld27f6aa2015-08-15 17:58:48 -07001976 VkImageSubresourceRange subresourceRange
Jesse Halld27f6aa2015-08-15 17:58:48 -07001977}
1978
1979class VkBufferCopy {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001980 VkDeviceSize srcOffset /// Specified in bytes
Jesse Hall3fbc8562015-11-29 22:10:52 -08001981 VkDeviceSize dstOffset /// Specified in bytes
Jesse Hallb00daad2015-11-29 19:46:20 -08001982 VkDeviceSize size /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001983}
1984
Jesse Halla6429252015-11-29 18:59:42 -08001985class VkSparseMemoryBind {
Jesse Hallb00daad2015-11-29 19:46:20 -08001986 VkDeviceSize resourceOffset /// Specified in bytes
1987 VkDeviceSize size /// Specified in bytes
Jesse Hall3fbc8562015-11-29 22:10:52 -08001988 VkDeviceMemory memory
1989 VkDeviceSize memoryOffset /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001990 VkSparseMemoryBindFlags flags
1991}
1992
Jesse Halla6429252015-11-29 18:59:42 -08001993class VkSparseImageMemoryBind {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001994 VkImageSubresource subresource
1995 VkOffset3D offset
1996 VkExtent3D extent
Jesse Hall3fbc8562015-11-29 22:10:52 -08001997 VkDeviceMemory memory
1998 VkDeviceSize memoryOffset /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001999 VkSparseMemoryBindFlags flags
2000}
2001
Jesse Halla6429252015-11-29 18:59:42 -08002002class VkSparseBufferMemoryBindInfo {
2003 VkBuffer buffer
2004 u32 bindCount
2005 const VkSparseMemoryBind* pBinds
2006}
2007
2008class VkSparseImageOpaqueMemoryBindInfo {
2009 VkImage image
2010 u32 bindCount
2011 const VkSparseMemoryBind* pBinds
2012}
2013
2014class VkSparseImageMemoryBindInfo {
2015 VkImage image
2016 u32 bindCount
2017 const VkSparseMemoryBind* pBinds
2018}
2019
2020class VkBindSparseInfo {
2021 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BIND_SPARSE_INFO
2022 const void* pNext
2023 u32 waitSemaphoreCount
2024 const VkSemaphore* pWaitSemaphores
2025 u32 numBufferBinds
2026 const VkSparseBufferMemoryBindInfo* pBufferBinds
2027 u32 numImageOpaqueBinds
2028 const VkSparseImageOpaqueMemoryBindInfo* pImageOpaqueBinds
2029 u32 numImageBinds
2030 const VkSparseImageMemoryBindInfo* pImageBinds
2031 u32 signalSemaphoreCount
2032 const VkSemaphore* pSignalSemaphores
2033}
2034
Jesse Hall65ab5522015-11-30 00:07:16 -08002035class VkImageSubresourceLayers {
2036 VkImageAspectFlags aspectMask
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002037 u32 mipLevel
Jesse Halla15a4bf2015-11-19 22:48:02 -08002038 u32 baseArrayLayer
Jesse Hall3fbc8562015-11-29 22:10:52 -08002039 u32 layerCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002040}
2041
Jesse Halld27f6aa2015-08-15 17:58:48 -07002042class VkImageCopy {
Jesse Hall65ab5522015-11-30 00:07:16 -08002043 VkImageSubresourceLayers srcSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07002044 VkOffset3D srcOffset /// Specified in pixels for both compressed and uncompressed images
Jesse Hall65ab5522015-11-30 00:07:16 -08002045 VkImageSubresourceLayers dstSubresource
Jesse Hall3fbc8562015-11-29 22:10:52 -08002046 VkOffset3D dstOffset /// Specified in pixels for both compressed and uncompressed images
Jesse Halld27f6aa2015-08-15 17:58:48 -07002047 VkExtent3D extent /// Specified in pixels for both compressed and uncompressed images
2048}
2049
2050class VkImageBlit {
Jesse Hall65ab5522015-11-30 00:07:16 -08002051 VkImageSubresourceLayers srcSubresource
Jesse Hall3dd678a2016-01-08 21:52:01 -08002052 VkOffset3D[2] srcOffsets
Jesse Hall65ab5522015-11-30 00:07:16 -08002053 VkImageSubresourceLayers dstSubresource
Jesse Hall3dd678a2016-01-08 21:52:01 -08002054 VkOffset3D[2] dstOffsets
Jesse Halld27f6aa2015-08-15 17:58:48 -07002055}
2056
2057class VkBufferImageCopy {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002058 VkDeviceSize bufferOffset /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002059 u32 bufferRowLength /// Specified in texels
2060 u32 bufferImageHeight
Jesse Hall65ab5522015-11-30 00:07:16 -08002061 VkImageSubresourceLayers imageSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07002062 VkOffset3D imageOffset /// Specified in pixels for both compressed and uncompressed images
2063 VkExtent3D imageExtent /// Specified in pixels for both compressed and uncompressed images
2064}
2065
2066class VkImageResolve {
Jesse Hall65ab5522015-11-30 00:07:16 -08002067 VkImageSubresourceLayers srcSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07002068 VkOffset3D srcOffset
Jesse Hall65ab5522015-11-30 00:07:16 -08002069 VkImageSubresourceLayers dstSubresource
Jesse Hall3fbc8562015-11-29 22:10:52 -08002070 VkOffset3D dstOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07002071 VkExtent3D extent
2072}
2073
2074class VkShaderModuleCreateInfo {
2075 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO
2076 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002077 VkShaderModuleCreateFlags flags /// Reserved
Jesse Halld27f6aa2015-08-15 17:58:48 -07002078 platform.size_t codeSize /// Specified in bytes
Jesse Halla9bb62b2015-11-21 19:31:56 -08002079 const u32* pCode /// Binary code of size codeSize
Jesse Halld27f6aa2015-08-15 17:58:48 -07002080}
2081
Jesse Halld27f6aa2015-08-15 17:58:48 -07002082class VkDescriptorSetLayoutBinding {
Jesse Hall091ed9e2015-11-30 00:55:29 -08002083 u32 binding
Jesse Halld27f6aa2015-08-15 17:58:48 -07002084 VkDescriptorType descriptorType /// Type of the descriptors in this binding
Jesse Halldba27f72015-11-30 14:25:46 -08002085 u32 descriptorCount /// Number of descriptors in this binding
Jesse Halld27f6aa2015-08-15 17:58:48 -07002086 VkShaderStageFlags stageFlags /// Shader stages this binding is visible to
2087 const VkSampler* pImmutableSamplers /// Immutable samplers (used if descriptor type is SAMPLER or COMBINED_IMAGE_SAMPLER, is either NULL or contains <count> number of elements)
2088}
2089
2090class VkDescriptorSetLayoutCreateInfo {
2091 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO
2092 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002093 VkDescriptorSetLayoutCreateFlags flags
Jesse Hall03b6fe12015-11-24 12:44:21 -08002094 u32 bindingCount /// Number of bindings in the descriptor set layout
Jesse Hall543a7ff2016-01-08 16:38:30 -08002095 const VkDescriptorSetLayoutBinding* pBindings /// Array of descriptor set layout bindings
Jesse Halld27f6aa2015-08-15 17:58:48 -07002096}
2097
Jesse Hall65ab5522015-11-30 00:07:16 -08002098class VkDescriptorPoolSize {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002099 VkDescriptorType type
Jesse Hall03b6fe12015-11-24 12:44:21 -08002100 u32 descriptorCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002101}
2102
2103class VkDescriptorPoolCreateInfo {
2104 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO
2105 const void* pNext /// Pointer to next structure
Jesse Hallfbf97b02015-11-20 14:17:03 -08002106 VkDescriptorPoolCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002107 u32 maxSets
Jesse Hall65ab5522015-11-30 00:07:16 -08002108 u32 poolSizeCount
2109 const VkDescriptorPoolSize* pPoolSizes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002110}
2111
Jesse Hall3fbc8562015-11-29 22:10:52 -08002112class VkDescriptorSetAllocateInfo {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002113 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO
Jesse Hallfbf97b02015-11-20 14:17:03 -08002114 const void* pNext /// Pointer to next structure
2115 VkDescriptorPool descriptorPool
Jesse Hall03b6fe12015-11-24 12:44:21 -08002116 u32 setCount
Jesse Hallfbf97b02015-11-20 14:17:03 -08002117 const VkDescriptorSetLayout* pSetLayouts
2118}
2119
Jesse Halld27f6aa2015-08-15 17:58:48 -07002120class VkSpecializationMapEntry {
Jesse Hall65ab5522015-11-30 00:07:16 -08002121 u32 constantID /// The SpecConstant ID specified in the BIL
Jesse Halld27f6aa2015-08-15 17:58:48 -07002122 u32 offset /// Offset of the value in the data block
Jesse Hallb00daad2015-11-29 19:46:20 -08002123 platform.size_t size /// Size in bytes of the SpecConstant
Jesse Halld27f6aa2015-08-15 17:58:48 -07002124}
2125
2126class VkSpecializationInfo {
2127 u32 mapEntryCount /// Number of entries in the map
Jesse Hallb00daad2015-11-29 19:46:20 -08002128 const VkSpecializationMapEntry* pMapEntries /// Array of map entries
Jesse Halld27f6aa2015-08-15 17:58:48 -07002129 platform.size_t dataSize /// Size in bytes of pData
2130 const void* pData /// Pointer to SpecConstant data
2131}
2132
2133class VkPipelineShaderStageCreateInfo {
2134 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO
2135 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002136 VkPipelineShaderStageCreateFlags flags
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002137 VkShaderStageFlagBits stage
2138 VkShaderModule module
2139 const char* pName
Jesse Halld27f6aa2015-08-15 17:58:48 -07002140 const VkSpecializationInfo* pSpecializationInfo
2141}
2142
2143class VkComputePipelineCreateInfo {
2144 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO
2145 const void* pNext /// Pointer to next structure
Jesse Halld27f6aa2015-08-15 17:58:48 -07002146 VkPipelineCreateFlags flags /// Pipeline creation flags
Jesse Halla6429252015-11-29 18:59:42 -08002147 VkPipelineShaderStageCreateInfo stage
Jesse Halld27f6aa2015-08-15 17:58:48 -07002148 VkPipelineLayout layout /// Interface layout of the pipeline
2149 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
2150 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
2151}
2152
2153class VkVertexInputBindingDescription {
Jesse Hallb00daad2015-11-29 19:46:20 -08002154 u32 binding /// Vertex buffer binding id
2155 u32 stride /// Distance between vertices in bytes (0 = no advancement)
Jesse Hall65ab5522015-11-30 00:07:16 -08002156 VkVertexInputRate inputRate /// Rate at which binding is incremented
Jesse Halld27f6aa2015-08-15 17:58:48 -07002157}
2158
2159class VkVertexInputAttributeDescription {
Jesse Hallb00daad2015-11-29 19:46:20 -08002160 u32 location /// location of the shader vertex attrib
2161 u32 binding /// Vertex buffer binding id
2162 VkFormat format /// format of source data
2163 u32 offset /// Offset of first element in bytes from base of vertex
Jesse Halld27f6aa2015-08-15 17:58:48 -07002164}
2165
2166class VkPipelineVertexInputStateCreateInfo {
Jesse Hall03b6fe12015-11-24 12:44:21 -08002167 VkStructureType sType /// Should be VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO
2168 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002169 VkPipelineVertexInputStateCreateFlags flags
Jesse Hall03b6fe12015-11-24 12:44:21 -08002170 u32 vertexBindingDescriptionCount /// number of bindings
Jesse Halld27f6aa2015-08-15 17:58:48 -07002171 const VkVertexInputBindingDescription* pVertexBindingDescriptions
Jesse Hall03b6fe12015-11-24 12:44:21 -08002172 u32 vertexAttributeDescriptionCount /// number of attributes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002173 const VkVertexInputAttributeDescription* pVertexAttributeDescriptions
2174}
2175
2176class VkPipelineInputAssemblyStateCreateInfo {
2177 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO
2178 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002179 VkPipelineInputAssemblyStateCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002180 VkPrimitiveTopology topology
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002181 VkBool32 primitiveRestartEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002182}
2183
2184class VkPipelineTessellationStateCreateInfo {
2185 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO
2186 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002187 VkPipelineTessellationStateCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002188 u32 patchControlPoints
2189}
2190
2191class VkPipelineViewportStateCreateInfo {
2192 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO
2193 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002194 VkPipelineViewportStateCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002195 u32 viewportCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002196 const VkViewport* pViewports
2197 u32 scissorCount
2198 const VkRect2D* pScissors
Jesse Halld27f6aa2015-08-15 17:58:48 -07002199}
2200
Jesse Hall3fbc8562015-11-29 22:10:52 -08002201class VkPipelineRasterizationStateCreateInfo {
Jesse Hall65ab5522015-11-30 00:07:16 -08002202 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002203 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08002204 VkPipelineRasterizationStateCreateFlags flags
Jesse Hallae38f732015-11-19 21:32:50 -08002205 VkBool32 depthClampEnable
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002206 VkBool32 rasterizerDiscardEnable
Jesse Hall65ab5522015-11-30 00:07:16 -08002207 VkPolygonMode polygonMode /// optional (GL45)
Jesse Hallc7467b72015-11-29 21:05:26 -08002208 VkCullModeFlags cullMode
Jesse Halld27f6aa2015-08-15 17:58:48 -07002209 VkFrontFace frontFace
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002210 VkBool32 depthBiasEnable
Jesse Halla9bb62b2015-11-21 19:31:56 -08002211 f32 depthBiasConstantFactor
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002212 f32 depthBiasClamp
Jesse Halla9bb62b2015-11-21 19:31:56 -08002213 f32 depthBiasSlopeFactor
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002214 f32 lineWidth
Jesse Halld27f6aa2015-08-15 17:58:48 -07002215}
2216
2217class VkPipelineMultisampleStateCreateInfo {
2218 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO
2219 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002220 VkPipelineMultisampleStateCreateFlags flags
Jesse Hall091ed9e2015-11-30 00:55:29 -08002221 VkSampleCountFlagBits rasterizationSamples /// Number of samples used for rasterization
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002222 VkBool32 sampleShadingEnable /// optional (GL45)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002223 f32 minSampleShading /// optional (GL45)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002224 const VkSampleMask* pSampleMask
Jesse Hallacfa5342015-11-19 21:51:33 -08002225 VkBool32 alphaToCoverageEnable
2226 VkBool32 alphaToOneEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002227}
2228
2229class VkPipelineColorBlendAttachmentState {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002230 VkBool32 blendEnable
Jesse Hall65ab5522015-11-30 00:07:16 -08002231 VkBlendFactor srcColorBlendFactor
2232 VkBlendFactor dstColorBlendFactor
2233 VkBlendOp colorBlendOp
2234 VkBlendFactor srcAlphaBlendFactor
2235 VkBlendFactor dstAlphaBlendFactor
2236 VkBlendOp alphaBlendOp
2237 VkColorComponentFlags colorWriteMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07002238}
2239
2240class VkPipelineColorBlendStateCreateInfo {
2241 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO
2242 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002243 VkPipelineColorBlendStateCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002244 VkBool32 logicOpEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002245 VkLogicOp logicOp
2246 u32 attachmentCount /// # of pAttachments
2247 const VkPipelineColorBlendAttachmentState* pAttachments
Jesse Hallb00daad2015-11-29 19:46:20 -08002248 f32[4] blendConstants
Jesse Halld27f6aa2015-08-15 17:58:48 -07002249}
2250
2251class VkStencilOpState {
Jesse Hall65ab5522015-11-30 00:07:16 -08002252 VkStencilOp failOp
2253 VkStencilOp passOp
2254 VkStencilOp depthFailOp
2255 VkCompareOp compareOp
2256 u32 compareMask
2257 u32 writeMask
2258 u32 reference
Jesse Halld27f6aa2015-08-15 17:58:48 -07002259}
2260
2261class VkPipelineDepthStencilStateCreateInfo {
2262 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO
2263 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002264 VkPipelineDepthStencilStateCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002265 VkBool32 depthTestEnable
2266 VkBool32 depthWriteEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002267 VkCompareOp depthCompareOp
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002268 VkBool32 depthBoundsTestEnable /// optional (depth_bounds_test)
2269 VkBool32 stencilTestEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002270 VkStencilOpState front
2271 VkStencilOpState back
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002272 f32 minDepthBounds
2273 f32 maxDepthBounds
2274}
2275
2276class VkPipelineDynamicStateCreateInfo {
2277 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO
2278 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002279 VkPipelineDynamicStateCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002280 u32 dynamicStateCount
2281 const VkDynamicState* pDynamicStates
Jesse Halld27f6aa2015-08-15 17:58:48 -07002282}
2283
2284class VkGraphicsPipelineCreateInfo {
Jesse Halla6429252015-11-29 18:59:42 -08002285 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO
2286 const void* pNext /// Pointer to next structure
2287 VkPipelineCreateFlags flags /// Pipeline creation flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002288 u32 stageCount
Jesse Halla6429252015-11-29 18:59:42 -08002289 const VkPipelineShaderStageCreateInfo* pStages /// One entry for each active shader stage
Jesse Halld27f6aa2015-08-15 17:58:48 -07002290 const VkPipelineVertexInputStateCreateInfo* pVertexInputState
2291 const VkPipelineInputAssemblyStateCreateInfo* pInputAssemblyState
2292 const VkPipelineTessellationStateCreateInfo* pTessellationState
2293 const VkPipelineViewportStateCreateInfo* pViewportState
Jesse Hall3fbc8562015-11-29 22:10:52 -08002294 const VkPipelineRasterizationStateCreateInfo* pRasterizationState
Jesse Halld27f6aa2015-08-15 17:58:48 -07002295 const VkPipelineMultisampleStateCreateInfo* pMultisampleState
2296 const VkPipelineDepthStencilStateCreateInfo* pDepthStencilState
2297 const VkPipelineColorBlendStateCreateInfo* pColorBlendState
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002298 const VkPipelineDynamicStateCreateInfo* pDynamicState
Jesse Halla6429252015-11-29 18:59:42 -08002299 VkPipelineLayout layout /// Interface layout of the pipeline
Jesse Halld27f6aa2015-08-15 17:58:48 -07002300 VkRenderPass renderPass
2301 u32 subpass
Jesse Halla6429252015-11-29 18:59:42 -08002302 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
2303 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 -07002304}
2305
2306class VkPipelineCacheCreateInfo {
Jesse Hallb00daad2015-11-29 19:46:20 -08002307 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO
2308 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002309 VkPipelineCacheCreateFlags flags
Jesse Hallb00daad2015-11-29 19:46:20 -08002310 platform.size_t initialDataSize /// Size of initial data to populate cache, in bytes
2311 const void* pInitialData /// Initial data to populate cache
Jesse Halld27f6aa2015-08-15 17:58:48 -07002312}
2313
2314class VkPushConstantRange {
2315 VkShaderStageFlags stageFlags /// Which stages use the range
Jesse Hall03b6fe12015-11-24 12:44:21 -08002316 u32 offset /// Start of the range, in bytes
2317 u32 size /// Length of the range, in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002318}
2319
2320class VkPipelineLayoutCreateInfo {
2321 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO
2322 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002323 VkPipelineLayoutCreateFlags flags
Jesse Hall3dd678a2016-01-08 21:52:01 -08002324 u32 descriptorSetCount /// Number of descriptor sets interfaced by the pipeline
Jesse Halld27f6aa2015-08-15 17:58:48 -07002325 const VkDescriptorSetLayout* pSetLayouts /// Array of <setCount> number of descriptor set layout objects defining the layout of the
2326 u32 pushConstantRangeCount /// Number of push-constant ranges used by the pipeline
2327 const VkPushConstantRange* pPushConstantRanges /// Array of pushConstantRangeCount number of ranges used by various shader stages
2328}
2329
2330class VkSamplerCreateInfo {
2331 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO
2332 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002333 VkSamplerCreateFlags flags
Jesse Hall23ff73f2015-11-29 14:36:39 -08002334 VkFilter magFilter /// Filter mode for magnification
2335 VkFilter minFilter /// Filter mode for minifiation
2336 VkSamplerMipmapMode mipmapMode /// Mipmap selection mode
2337 VkSamplerAddressMode addressModeU
2338 VkSamplerAddressMode addressModeV
2339 VkSamplerAddressMode addressModeW
Jesse Halld27f6aa2015-08-15 17:58:48 -07002340 f32 mipLodBias
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002341 VkBool32 anisotropyEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002342 f32 maxAnisotropy
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002343 VkBool32 compareEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002344 VkCompareOp compareOp
2345 f32 minLod
2346 f32 maxLod
2347 VkBorderColor borderColor
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002348 VkBool32 unnormalizedCoordinates
Jesse Halld27f6aa2015-08-15 17:58:48 -07002349}
2350
Jesse Hall3fbc8562015-11-29 22:10:52 -08002351class VkCommandPoolCreateInfo {
2352 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002353 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08002354 VkCommandPoolCreateFlags flags /// Command pool creation flags
Jesse Halla6429252015-11-29 18:59:42 -08002355 u32 queueFamilyIndex
Jesse Halld27f6aa2015-08-15 17:58:48 -07002356}
2357
Jesse Hall3fbc8562015-11-29 22:10:52 -08002358class VkCommandBufferAllocateInfo {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002359 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002360 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08002361 VkCommandPool commandPool
2362 VkCommandBufferLevel level
Jesse Hall3dd678a2016-01-08 21:52:01 -08002363 u32 commandBufferCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002364}
2365
Jesse Hall3dd678a2016-01-08 21:52:01 -08002366class VkCommandBufferInheritanceInfo {
2367 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002368 const void* pNext /// Pointer to next structure
Jesse Halld27f6aa2015-08-15 17:58:48 -07002369 VkRenderPass renderPass /// Render pass for secondary command buffers
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002370 u32 subpass
Jesse Halld27f6aa2015-08-15 17:58:48 -07002371 VkFramebuffer framebuffer /// Framebuffer for secondary command buffers
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002372 VkBool32 occlusionQueryEnable
2373 VkQueryControlFlags queryFlags
2374 VkQueryPipelineStatisticFlags pipelineStatistics
Jesse Halld27f6aa2015-08-15 17:58:48 -07002375}
2376
Jesse Hall3dd678a2016-01-08 21:52:01 -08002377class VkCommandBufferBeginInfo {
2378 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO
2379 const void* pNext /// Pointer to next structure
2380 VkCommandBufferUsageFlags flags /// Command buffer usage flags
2381 const VkCommandBufferInheritanceInfo* pInheritanceInfo
2382}
2383
Jesse Halld27f6aa2015-08-15 17:58:48 -07002384class VkRenderPassBeginInfo {
2385 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO
2386 const void* pNext /// Pointer to next structure
2387 VkRenderPass renderPass
2388 VkFramebuffer framebuffer
2389 VkRect2D renderArea
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002390 u32 clearValueCount
2391 const VkClearValue* pClearValues
Jesse Halld27f6aa2015-08-15 17:58:48 -07002392}
2393
2394@union
2395/// Union allowing specification of floating point, integer, or unsigned integer color data. Actual value selected is based on image/attachment being cleared.
2396class VkClearColorValue {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002397 f32[4] float32
2398 s32[4] int32
2399 u32[4] uint32
Jesse Halld27f6aa2015-08-15 17:58:48 -07002400}
2401
2402class VkClearDepthStencilValue {
2403 f32 depth
2404 u32 stencil
2405}
2406
2407@union
2408/// Union allowing specification of color, depth, and stencil color values. Actual value selected is based on attachment being cleared.
2409class VkClearValue {
2410 VkClearColorValue color
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002411 VkClearDepthStencilValue depthStencil
Jesse Halld27f6aa2015-08-15 17:58:48 -07002412}
2413
Jesse Hallae38f732015-11-19 21:32:50 -08002414class VkClearAttachment {
2415 VkImageAspectFlags aspectMask
2416 u32 colorAttachment
2417 VkClearValue clearValue
2418}
2419
Jesse Halld27f6aa2015-08-15 17:58:48 -07002420class VkAttachmentDescription {
Jesse Halla6429252015-11-29 18:59:42 -08002421 VkAttachmentDescriptionFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002422 VkFormat format
Jesse Hall091ed9e2015-11-30 00:55:29 -08002423 VkSampleCountFlagBits samples
Jesse Halld27f6aa2015-08-15 17:58:48 -07002424 VkAttachmentLoadOp loadOp /// Load op for color or depth data
2425 VkAttachmentStoreOp storeOp /// Store op for color or depth data
2426 VkAttachmentLoadOp stencilLoadOp /// Load op for stencil data
2427 VkAttachmentStoreOp stencilStoreOp /// Store op for stencil data
2428 VkImageLayout initialLayout
2429 VkImageLayout finalLayout
2430}
2431
2432class VkAttachmentReference {
2433 u32 attachment
2434 VkImageLayout layout
2435}
2436
2437class VkSubpassDescription {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002438 VkSubpassDescriptionFlags flags
Jesse Halla6429252015-11-29 18:59:42 -08002439 VkPipelineBindPoint pipelineBindPoint /// Must be VK_PIPELINE_BIND_POINT_GRAPHICS for now
Jesse Hall03b6fe12015-11-24 12:44:21 -08002440 u32 inputAttachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002441 const VkAttachmentReference* pInputAttachments
Jesse Hall03b6fe12015-11-24 12:44:21 -08002442 u32 colorAttachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002443 const VkAttachmentReference* pColorAttachments
2444 const VkAttachmentReference* pResolveAttachments
Jesse Hallc7467b72015-11-29 21:05:26 -08002445 const VkAttachmentReference* pDepthStencilAttachment
Jesse Hall03b6fe12015-11-24 12:44:21 -08002446 u32 preserveAttachmentCount
Jesse Hall3dd678a2016-01-08 21:52:01 -08002447 const u32* pPreserveAttachments
Jesse Halld27f6aa2015-08-15 17:58:48 -07002448}
2449
2450class VkSubpassDependency {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002451 u32 srcSubpass
Jesse Hall3fbc8562015-11-29 22:10:52 -08002452 u32 dstSubpass
Jesse Halld27f6aa2015-08-15 17:58:48 -07002453 VkPipelineStageFlags srcStageMask
Jesse Hall3fbc8562015-11-29 22:10:52 -08002454 VkPipelineStageFlags dstStageMask
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002455 VkAccessFlags srcAccessMask
2456 VkAccessFlags dstAccessMask
Jesse Halldc6d36c2015-11-29 19:12:15 -08002457 VkDependencyFlags dependencyFlags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002458}
2459
2460class VkRenderPassCreateInfo {
2461 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO
2462 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002463 VkRenderPassCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002464 u32 attachmentCount
2465 const VkAttachmentDescription* pAttachments
2466 u32 subpassCount
2467 const VkSubpassDescription* pSubpasses
2468 u32 dependencyCount
2469 const VkSubpassDependency* pDependencies
2470}
2471
2472class VkEventCreateInfo {
2473 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_EVENT_CREATE_INFO
2474 const void* pNext /// Pointer to next structure
2475 VkEventCreateFlags flags /// Event creation flags
2476}
2477
2478class VkFenceCreateInfo {
2479 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_FENCE_CREATE_INFO
2480 const void* pNext /// Pointer to next structure
2481 VkFenceCreateFlags flags /// Fence creation flags
2482}
2483
2484class VkPhysicalDeviceFeatures {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002485 VkBool32 robustBufferAccess /// out of bounds buffer accesses are well defined
2486 VkBool32 fullDrawIndexUint32 /// full 32-bit range of indices for indexed draw calls
2487 VkBool32 imageCubeArray /// image views which are arrays of cube maps
2488 VkBool32 independentBlend /// blending operations are controlled per-attachment
2489 VkBool32 geometryShader /// geometry stage
2490 VkBool32 tessellationShader /// tessellation control and evaluation stage
2491 VkBool32 sampleRateShading /// per-sample shading and interpolation
Jesse Hall3fbc8562015-11-29 22:10:52 -08002492 VkBool32 dualSrcBlend /// blend operations which take two sources
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002493 VkBool32 logicOp /// logic operations
2494 VkBool32 multiDrawIndirect /// multi draw indirect
Jesse Hall543a7ff2016-01-08 16:38:30 -08002495 VkBool32 drawIndirectFirstInstance
Jesse Hallae38f732015-11-19 21:32:50 -08002496 VkBool32 depthClamp /// depth clamping
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002497 VkBool32 depthBiasClamp /// depth bias clamping
2498 VkBool32 fillModeNonSolid /// point and wireframe fill modes
2499 VkBool32 depthBounds /// depth bounds test
2500 VkBool32 wideLines /// lines with width greater than 1
2501 VkBool32 largePoints /// points with size greater than 1
Jesse Hallfbf97b02015-11-20 14:17:03 -08002502 VkBool32 alphaToOne /// The fragment alpha channel can be forced to maximum representable alpha value
2503 VkBool32 multiViewport
2504 VkBool32 samplerAnisotropy
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002505 VkBool32 textureCompressionETC2 /// ETC texture compression formats
2506 VkBool32 textureCompressionASTC_LDR /// ASTC LDR texture compression formats
2507 VkBool32 textureCompressionBC /// BC1-7 texture compressed formats
Jesse Hall65ab5522015-11-30 00:07:16 -08002508 VkBool32 occlusionQueryPrecise
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002509 VkBool32 pipelineStatisticsQuery /// pipeline statistics query
Jesse Halldc6d36c2015-11-29 19:12:15 -08002510 VkBool32 vertexPipelineStoresAndAtomics
2511 VkBool32 fragmentStoresAndAtomics
2512 VkBool32 shaderTessellationAndGeometryPointSize
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002513 VkBool32 shaderImageGatherExtended /// texture gather with run-time values and independent offsets
2514 VkBool32 shaderStorageImageExtendedFormats /// the extended set of formats can be used for storage images
2515 VkBool32 shaderStorageImageMultisample /// multisample images can be used for storage images
Jesse Halld1af8122015-11-29 23:50:38 -08002516 VkBool32 shaderStorageImageReadWithoutFormat
2517 VkBool32 shaderStorageImageWriteWithoutFormat
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002518 VkBool32 shaderUniformBufferArrayDynamicIndexing /// arrays of uniform buffers can be accessed with dynamically uniform indices
2519 VkBool32 shaderSampledImageArrayDynamicIndexing /// arrays of sampled images can be accessed with dynamically uniform indices
2520 VkBool32 shaderStorageBufferArrayDynamicIndexing /// arrays of storage buffers can be accessed with dynamically uniform indices
2521 VkBool32 shaderStorageImageArrayDynamicIndexing /// arrays of storage images can be accessed with dynamically uniform indices
2522 VkBool32 shaderClipDistance /// clip distance in shaders
2523 VkBool32 shaderCullDistance /// cull distance in shaders
2524 VkBool32 shaderFloat64 /// 64-bit floats (doubles) in shaders
2525 VkBool32 shaderInt64 /// 64-bit integers in shaders
2526 VkBool32 shaderInt16 /// 16-bit integers in shaders
2527 VkBool32 shaderResourceResidency /// shader can use texture operations that return resource residency information (requires sparseNonResident support)
Jesse Hall65ab5522015-11-30 00:07:16 -08002528 VkBool32 shaderResourceMinLod /// shader can use texture operations that specify minimum resource LOD
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002529 VkBool32 sparseBinding /// Sparse resources support: Resource memory can be managed at opaque page level rather than object level
2530 VkBool32 sparseResidencyBuffer /// Sparse resources support: GPU can access partially resident buffers
2531 VkBool32 sparseResidencyImage2D /// Sparse resources support: GPU can access partially resident 2D (non-MSAA non-DepthStencil) images
2532 VkBool32 sparseResidencyImage3D /// Sparse resources support: GPU can access partially resident 3D images
2533 VkBool32 sparseResidency2Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 2 samples
2534 VkBool32 sparseResidency4Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 4 samples
2535 VkBool32 sparseResidency8Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 8 samples
2536 VkBool32 sparseResidency16Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 16 samples
2537 VkBool32 sparseResidencyAliased /// Sparse resources support: GPU can correctly access data aliased into multiple locations (opt-in)
Jesse Halld1af8122015-11-29 23:50:38 -08002538 VkBool32 variableMultisampleRate
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002539 VkBool32 inheritedQueries
Jesse Halld27f6aa2015-08-15 17:58:48 -07002540}
2541
2542class VkPhysicalDeviceLimits {
2543 /// resource maximum sizes
2544 u32 maxImageDimension1D /// max 1D image dimension
2545 u32 maxImageDimension2D /// max 2D image dimension
2546 u32 maxImageDimension3D /// max 3D image dimension
2547 u32 maxImageDimensionCube /// max cubemap image dimension
2548 u32 maxImageArrayLayers /// max layers for image arrays
Jesse Hallb00daad2015-11-29 19:46:20 -08002549 u32 maxTexelBufferElements
Jesse Hallfbf97b02015-11-20 14:17:03 -08002550 u32 maxUniformBufferRange /// max uniform buffer size (bytes)
2551 u32 maxStorageBufferRange /// max storage buffer size (bytes)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002552 u32 maxPushConstantsSize /// max size of the push constants pool (bytes)
2553 /// memory limits
2554 u32 maxMemoryAllocationCount /// max number of device memory allocations supported
Jesse Hall091ed9e2015-11-30 00:55:29 -08002555 u32 maxSamplerAllocationCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002556 VkDeviceSize bufferImageGranularity /// Granularity (in bytes) at which buffers and images can be bound to adjacent memory for simultaneous usage
2557 VkDeviceSize sparseAddressSpaceSize /// Total address space available for sparse allocations (bytes)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002558 /// descriptor set limits
2559 u32 maxBoundDescriptorSets /// max number of descriptors sets that can be bound to a pipeline
Jesse Halld27f6aa2015-08-15 17:58:48 -07002560 u32 maxPerStageDescriptorSamplers /// max num of samplers allowed per-stage in a descriptor set
2561 u32 maxPerStageDescriptorUniformBuffers /// max num of uniform buffers allowed per-stage in a descriptor set
2562 u32 maxPerStageDescriptorStorageBuffers /// max num of storage buffers allowed per-stage in a descriptor set
2563 u32 maxPerStageDescriptorSampledImages /// max num of sampled images allowed per-stage in a descriptor set
2564 u32 maxPerStageDescriptorStorageImages /// max num of storage images allowed per-stage in a descriptor set
Jesse Halle1b12782015-11-30 11:27:32 -08002565 u32 maxPerStageDescriptorInputAttachments
Jesse Halldba27f72015-11-30 14:25:46 -08002566 u32 maxPerStageResources
Jesse Halld27f6aa2015-08-15 17:58:48 -07002567 u32 maxDescriptorSetSamplers /// max num of samplers allowed in all stages in a descriptor set
2568 u32 maxDescriptorSetUniformBuffers /// max num of uniform buffers allowed in all stages in a descriptor set
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002569 u32 maxDescriptorSetUniformBuffersDynamic /// max num of dynamic uniform buffers allowed in all stages in a descriptor set
Jesse Halld27f6aa2015-08-15 17:58:48 -07002570 u32 maxDescriptorSetStorageBuffers /// max num of storage buffers allowed in all stages in a descriptor set
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002571 u32 maxDescriptorSetStorageBuffersDynamic /// max num of dynamic storage buffers allowed in all stages in a descriptor set
Jesse Halld27f6aa2015-08-15 17:58:48 -07002572 u32 maxDescriptorSetSampledImages /// max num of sampled images allowed in all stages in a descriptor set
2573 u32 maxDescriptorSetStorageImages /// max num of storage images allowed in all stages in a descriptor set
Jesse Halle1b12782015-11-30 11:27:32 -08002574 u32 maxDescriptorSetInputAttachments
Jesse Halld27f6aa2015-08-15 17:58:48 -07002575 /// vertex stage limits
2576 u32 maxVertexInputAttributes /// max num of vertex input attribute slots
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002577 u32 maxVertexInputBindings /// max num of vertex input binding slots
Jesse Halld27f6aa2015-08-15 17:58:48 -07002578 u32 maxVertexInputAttributeOffset /// max vertex input attribute offset added to vertex buffer offset
2579 u32 maxVertexInputBindingStride /// max vertex input binding stride
2580 u32 maxVertexOutputComponents /// max num of output components written by vertex shader
2581 /// tessellation control stage limits
Jesse Hall3fbc8562015-11-29 22:10:52 -08002582 u32 maxTessellationGenerationLevel /// max level supported by tess primitive generator
Jesse Hallae38f732015-11-19 21:32:50 -08002583 u32 maxTessellationPatchSize /// max patch size (vertices)
2584 u32 maxTessellationControlPerVertexInputComponents /// max num of input components per-vertex in TCS
2585 u32 maxTessellationControlPerVertexOutputComponents /// max num of output components per-vertex in TCS
2586 u32 maxTessellationControlPerPatchOutputComponents /// max num of output components per-patch in TCS
2587 u32 maxTessellationControlTotalOutputComponents /// max total num of per-vertex and per-patch output components in TCS
2588 u32 maxTessellationEvaluationInputComponents /// max num of input components per vertex in TES
2589 u32 maxTessellationEvaluationOutputComponents /// max num of output components per vertex in TES
Jesse Halld27f6aa2015-08-15 17:58:48 -07002590 /// geometry stage limits
2591 u32 maxGeometryShaderInvocations /// max invocation count supported in geometry shader
2592 u32 maxGeometryInputComponents /// max num of input components read in geometry stage
2593 u32 maxGeometryOutputComponents /// max num of output components written in geometry stage
2594 u32 maxGeometryOutputVertices /// max num of vertices that can be emitted in geometry stage
2595 u32 maxGeometryTotalOutputComponents /// max total num of components (all vertices) written in geometry stage
2596 /// fragment stage limits
2597 u32 maxFragmentInputComponents /// max num of input compontents read in fragment stage
Jesse Hallfbf97b02015-11-20 14:17:03 -08002598 u32 maxFragmentOutputAttachments /// max num of output attachments written in fragment stage
Jesse Hall3fbc8562015-11-29 22:10:52 -08002599 u32 maxFragmentDualSrcAttachments /// max num of output attachments written when using dual source blending
Jesse Halld27f6aa2015-08-15 17:58:48 -07002600 u32 maxFragmentCombinedOutputResources /// max total num of storage buffers, storage images and output buffers
2601 /// compute stage limits
2602 u32 maxComputeSharedMemorySize /// max total storage size of work group local storage (bytes)
2603 u32[3] maxComputeWorkGroupCount /// max num of compute work groups that may be dispatched by a single command (x,y,z)
2604 u32 maxComputeWorkGroupInvocations /// max total compute invocations in a single local work group
2605 u32[3] maxComputeWorkGroupSize /// max local size of a compute work group (x,y,z)
2606
2607 u32 subPixelPrecisionBits /// num bits of subpixel precision in screen x and y
2608 u32 subTexelPrecisionBits /// num bits of subtexel precision
2609 u32 mipmapPrecisionBits /// num bits of mipmap precision
2610
2611 u32 maxDrawIndexedIndexValue /// max index value for indexed draw calls (for 32-bit indices)
Jesse Halldba27f72015-11-30 14:25:46 -08002612 u32 maxDrawIndirectCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002613
2614 f32 maxSamplerLodBias /// max absolute sampler level of detail bias
2615 f32 maxSamplerAnisotropy /// max degree of sampler anisotropy
2616
2617 u32 maxViewports /// max number of active viewports
Jesse Halld27f6aa2015-08-15 17:58:48 -07002618 u32[2] maxViewportDimensions /// max viewport dimensions (x,y)
2619 f32[2] viewportBoundsRange /// viewport bounds range (min,max)
2620 u32 viewportSubPixelBits /// num bits of subpixel precision for viewport
2621
Jesse Halldc6d36c2015-11-29 19:12:15 -08002622 platform.size_t minMemoryMapAlignment /// min required alignment of pointers returned by MapMemory (bytes)
2623 VkDeviceSize minTexelBufferOffsetAlignment /// min required alignment for texel buffer offsets (bytes)
2624 VkDeviceSize minUniformBufferOffsetAlignment /// min required alignment for uniform buffer sizes and offsets (bytes)
2625 VkDeviceSize minStorageBufferOffsetAlignment /// min required alignment for storage buffer offsets (bytes)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002626
Jesse Hallfbf97b02015-11-20 14:17:03 -08002627 s32 minTexelOffset /// min texel offset for OpTextureSampleOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07002628 u32 maxTexelOffset /// max texel offset for OpTextureSampleOffset
Jesse Hallfbf97b02015-11-20 14:17:03 -08002629 s32 minTexelGatherOffset /// min texel offset for OpTextureGatherOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07002630 u32 maxTexelGatherOffset /// max texel offset for OpTextureGatherOffset
2631 f32 minInterpolationOffset /// furthest negative offset for interpolateAtOffset
2632 f32 maxInterpolationOffset /// furthest positive offset for interpolateAtOffset
2633 u32 subPixelInterpolationOffsetBits /// num of subpixel bits for interpolateAtOffset
2634
2635 u32 maxFramebufferWidth /// max width for a framebuffer
2636 u32 maxFramebufferHeight /// max height for a framebuffer
2637 u32 maxFramebufferLayers /// max layer count for a layered framebuffer
Jesse Hall091ed9e2015-11-30 00:55:29 -08002638 VkSampleCountFlags framebufferColorSampleCounts
2639 VkSampleCountFlags framebufferDepthSampleCounts
2640 VkSampleCountFlags framebufferStencilSampleCounts
2641 VkSampleCountFlags framebufferNoAttachmentSampleCounts
Jesse Halld27f6aa2015-08-15 17:58:48 -07002642 u32 maxColorAttachments /// max num of framebuffer color attachments
2643
Jesse Hall091ed9e2015-11-30 00:55:29 -08002644 VkSampleCountFlags sampledImageColorSampleCounts
2645 VkSampleCountFlags sampledImageIntegerSampleCounts
2646 VkSampleCountFlags sampledImageDepthSampleCounts
2647 VkSampleCountFlags sampledImageStencilSampleCounts
2648 VkSampleCountFlags storageImageSampleCounts
Jesse Halld27f6aa2015-08-15 17:58:48 -07002649 u32 maxSampleMaskWords /// max num of sample mask words
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002650 VkBool32 timestampComputeAndGraphics
Jesse Halld27f6aa2015-08-15 17:58:48 -07002651
Jesse Halla9bb62b2015-11-21 19:31:56 -08002652 f32 timestampPeriod
Jesse Halld27f6aa2015-08-15 17:58:48 -07002653
2654 u32 maxClipDistances /// max number of clip distances
2655 u32 maxCullDistances /// max number of cull distances
2656 u32 maxCombinedClipAndCullDistances /// max combined number of user clipping
2657
Jesse Hallfbf97b02015-11-20 14:17:03 -08002658 u32 discreteQueuePriorities
2659
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002660 f32[2] pointSizeRange /// range (min,max) of supported point sizes
2661 f32[2] lineWidthRange /// range (min,max) of supported line widths
Jesse Halld27f6aa2015-08-15 17:58:48 -07002662 f32 pointSizeGranularity /// granularity of supported point sizes
2663 f32 lineWidthGranularity /// granularity of supported line widths
Jesse Hall03b6fe12015-11-24 12:44:21 -08002664 VkBool32 strictLines
Jesse Hall091ed9e2015-11-30 00:55:29 -08002665 VkBool32 standardSampleLocations
Jesse Halla9bb62b2015-11-21 19:31:56 -08002666
Jesse Hall65ab5522015-11-30 00:07:16 -08002667 VkDeviceSize optimalBufferCopyOffsetAlignment
2668 VkDeviceSize optimalBufferCopyRowPitchAlignment
Jesse Halldba27f72015-11-30 14:25:46 -08002669 VkDeviceSize nonCoherentAtomSize
Jesse Halld27f6aa2015-08-15 17:58:48 -07002670}
2671
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002672class VkPhysicalDeviceSparseProperties {
2673 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 -08002674 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 -07002675 VkBool32 residencyStandard3DBlockShape /// Sparse resources support: GPU will access all 3D sparse resources using the standard block shapes (based on pixel format)
2676 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 -07002677 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
2678}
2679
Jesse Halld27f6aa2015-08-15 17:58:48 -07002680class VkSemaphoreCreateInfo {
2681 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO
2682 const void* pNext /// Pointer to next structure
2683 VkSemaphoreCreateFlags flags /// Semaphore creation flags
2684}
2685
2686class VkQueryPoolCreateInfo {
2687 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO
2688 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002689 VkQueryPoolCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002690 VkQueryType queryType
Jesse Hall3dd678a2016-01-08 21:52:01 -08002691 u32 queryCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002692 VkQueryPipelineStatisticFlags pipelineStatistics /// Optional
2693}
2694
2695class VkFramebufferCreateInfo {
2696 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO
2697 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002698 VkFramebufferCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002699 VkRenderPass renderPass
2700 u32 attachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002701 const VkImageView* pAttachments
Jesse Halld27f6aa2015-08-15 17:58:48 -07002702 u32 width
2703 u32 height
2704 u32 layers
2705}
2706
Jesse Hall3fbc8562015-11-29 22:10:52 -08002707class VkDrawIndirectCommand {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002708 u32 vertexCount
2709 u32 instanceCount
2710 u32 firstVertex
2711 u32 firstInstance
2712}
2713
Jesse Hall3fbc8562015-11-29 22:10:52 -08002714class VkDrawIndexedIndirectCommand {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002715 u32 indexCount
2716 u32 instanceCount
2717 u32 firstIndex
2718 s32 vertexOffset
2719 u32 firstInstance
2720}
2721
Jesse Hall3fbc8562015-11-29 22:10:52 -08002722class VkDispatchIndirectCommand {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002723 u32 x
2724 u32 y
2725 u32 z
2726}
2727
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002728@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08002729class VkSurfaceCapabilitiesKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002730 u32 minImageCount
2731 u32 maxImageCount
2732 VkExtent2D currentExtent
2733 VkExtent2D minImageExtent
2734 VkExtent2D maxImageExtent
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002735 u32 maxImageArrayLayers
Jesse Hall1356b0d2015-11-23 17:24:58 -08002736 VkSurfaceTransformFlagsKHR supportedTransforms
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002737 VkSurfaceTransformFlagBitsKHR currentTransform
Jesse Halla6429252015-11-29 18:59:42 -08002738 VkCompositeAlphaFlagsKHR supportedCompositeAlpha
Jesse Hall1356b0d2015-11-23 17:24:58 -08002739 VkImageUsageFlags supportedUsageFlags
Michael Lentine88594d72015-11-12 12:49:45 -08002740}
2741
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002742@extension("VK_KHR_surface")
Michael Lentine88594d72015-11-12 12:49:45 -08002743class VkSurfaceFormatKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002744 VkFormat format
2745 VkColorSpaceKHR colorSpace
Michael Lentine88594d72015-11-12 12:49:45 -08002746}
2747
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002748@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08002749class VkSwapchainCreateInfoKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002750 VkStructureType sType
2751 const void* pNext
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002752 VkSwapchainCreateFlagsKHR flags
Jesse Hall1356b0d2015-11-23 17:24:58 -08002753 VkSurfaceKHR surface
2754 u32 minImageCount
2755 VkFormat imageFormat
2756 VkColorSpaceKHR imageColorSpace
2757 VkExtent2D imageExtent
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002758 u32 imageArrayLayers
2759 VkImageUsageFlags imageUsage
Jesse Hall1356b0d2015-11-23 17:24:58 -08002760 VkSharingMode sharingMode
Jesse Hall03b6fe12015-11-24 12:44:21 -08002761 u32 queueFamilyIndexCount
Jesse Hall1356b0d2015-11-23 17:24:58 -08002762 const u32* pQueueFamilyIndices
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002763 VkSurfaceTransformFlagBitsKHR preTransform
2764 VkCompositeAlphaFlagBitsKHR compositeAlpha
Jesse Hall1356b0d2015-11-23 17:24:58 -08002765 VkPresentModeKHR presentMode
Jesse Hall1356b0d2015-11-23 17:24:58 -08002766 VkBool32 clipped
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002767 VkSwapchainKHR oldSwapchain
Michael Lentine88594d72015-11-12 12:49:45 -08002768}
2769
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002770@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08002771class VkPresentInfoKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002772 VkStructureType sType
2773 const void* pNext
Jesse Hallb00daad2015-11-29 19:46:20 -08002774 u32 waitSemaphoreCount
2775 const VkSemaphore* pWaitSemaphores
Jesse Hall1356b0d2015-11-23 17:24:58 -08002776 u32 swapchainCount
Jesse Hall03b6fe12015-11-24 12:44:21 -08002777 const VkSwapchainKHR* pSwapchains
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002778 const u32* pImageIndices
Jesse Halle1b12782015-11-30 11:27:32 -08002779 VkResult* pResults
Michael Lentine88594d72015-11-12 12:49:45 -08002780}
2781
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002782@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002783class VkDisplayPropertiesKHR {
2784 VkDisplayKHR display
2785 const char* displayName
2786 VkExtent2D physicalDimensions
2787 VkExtent2D physicalResolution
2788 VkSurfaceTransformFlagsKHR supportedTransforms
Jesse Hall1356b0d2015-11-23 17:24:58 -08002789 VkBool32 planeReorderPossible
Jesse Halla6429252015-11-29 18:59:42 -08002790 VkBool32 persistentContent
Michael Lentine88594d72015-11-12 12:49:45 -08002791}
2792
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002793@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08002794class VkDisplayModeParametersKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002795 VkExtent2D visibleRegion
Jesse Halla6429252015-11-29 18:59:42 -08002796 u32 refreshRate
Michael Lentine88594d72015-11-12 12:49:45 -08002797}
Jesse Halld27f6aa2015-08-15 17:58:48 -07002798
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002799@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002800class VkDisplayModePropertiesKHR {
2801 VkDisplayModeKHR displayMode
Jesse Halla6429252015-11-29 18:59:42 -08002802 VkDisplayModeParametersKHR parameters
Jesse Hall1356b0d2015-11-23 17:24:58 -08002803}
2804
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002805@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002806class VkDisplayModeCreateInfoKHR {
2807 VkStructureType sType
2808 const void* pNext
Jesse Hall9ba8bc82015-11-30 16:22:16 -08002809 VkDisplayModeCreateFlagsKHR flags
Jesse Halla6429252015-11-29 18:59:42 -08002810 VkDisplayModeParametersKHR parameters
Jesse Hall1356b0d2015-11-23 17:24:58 -08002811}
2812
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002813@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002814class VkDisplayPlanePropertiesKHR {
Jesse Halla6429252015-11-29 18:59:42 -08002815 VkDisplayKHR currentDisplay
2816 u32 currentStackIndex
2817}
2818
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002819@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08002820class VkDisplayPlaneCapabilitiesKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002821 VkDisplayPlaneAlphaFlagsKHR supportedAlpha
2822 VkOffset2D minSrcPosition
2823 VkOffset2D maxSrcPosition
2824 VkExtent2D minSrcExtent
2825 VkExtent2D maxSrcExtent
2826 VkOffset2D minDstPosition
2827 VkOffset2D maxDstPosition
2828 VkExtent2D minDstExtent
2829 VkExtent2D maxDstExtent
2830}
2831
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002832@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08002833class VkDisplaySurfaceCreateInfoKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002834 VkStructureType sType
2835 const void* pNext
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002836 VkDisplaySurfaceCreateFlagsKHR flags
Jesse Hall1356b0d2015-11-23 17:24:58 -08002837 VkDisplayModeKHR displayMode
2838 u32 planeIndex
2839 u32 planeStackIndex
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002840 VkSurfaceTransformFlagBitsKHR transform
Jesse Hall1356b0d2015-11-23 17:24:58 -08002841 f32 globalAlpha
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002842 VkDisplayPlaneAlphaFlagBitsKHR alphaMode
2843 VkExtent2D imageExtent
Jesse Hall1356b0d2015-11-23 17:24:58 -08002844}
2845
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002846@extension("VK_KHR_display_swapchain")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002847class VkDisplayPresentInfoKHR {
2848 VkStructureType sType
2849 const void* pNext
2850 VkRect2D srcRect
2851 VkRect2D dstRect
Jesse Halla6429252015-11-29 18:59:42 -08002852 VkBool32 persistent
Jesse Hall1356b0d2015-11-23 17:24:58 -08002853}
2854
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002855@extension("VK_KHR_xlib_surface")
2856class VkXlibSurfaceCreateInfoKHR {
2857 VkStructureType sType
2858 const void* pNext
2859 VkXlibSurfaceCreateFlagsKHR flags
2860 platform.Display* dpy
2861 platform.Window window
2862}
2863
2864@extension("VK_KHR_xcb_surface")
2865class VkXcbSurfaceCreateInfoKHR {
2866 VkStructureType sType
2867 const void* pNext
2868 VkXcbSurfaceCreateFlagsKHR flags
2869 platform.xcb_connection_t* connection
2870 platform.xcb_window_t window
2871}
2872
2873@extension("VK_KHR_wayland_surface")
2874class VkWaylandSurfaceCreateInfoKHR {
2875 VkStructureType sType
2876 const void* pNext
2877 VkWaylandSurfaceCreateFlagsKHR flags
2878 platform.wl_display* display
2879 platform.wl_surface* surface
2880}
2881
2882@extension("VK_KHR_mir_surface")
2883class VkMirSurfaceCreateInfoKHR {
2884 VkStructureType sType
2885 const void* pNext
2886 VkMirSurfaceCreateFlagsKHR flags
2887 platform.MirConnection* connection
2888 platform.MirSurface* mirSurface
2889}
2890
2891@extension("VK_KHR_android_surface")
2892class VkAndroidSurfaceCreateInfoKHR {
2893 VkStructureType sType
2894 const void* pNext
2895 VkAndroidSurfaceCreateFlagsKHR flags
2896 platform.ANativeWindow* window
2897}
2898
2899@extension("VK_KHR_win32_surface")
2900class VkWin32SurfaceCreateInfoKHR {
2901 VkStructureType sType
2902 const void* pNext
2903 VkWin32SurfaceCreateFlagsKHR flags
2904 platform.HINSTANCE hinstance
2905 platform.HWND hwnd
2906}
2907
Chia-I Wub262ddc2016-03-22 07:38:20 +08002908@extension("VK_ANDROID_native_buffer")
2909class VkNativeBufferANDROID {
2910 VkStructureType sType
2911 const void* pNext
2912 platform.buffer_handle_t handle
2913 int stride
2914 int format
2915 int usage
2916}
2917
Chris Forbes8e4438b2016-12-07 16:26:49 +13002918@extension("VK_ANDROID_native_buffer")
2919class VkSwapchainImageCreateInfoANDROID {
2920 VkStructureType sType
2921 const void* pNext
Chris Forbes134d9582017-01-12 14:26:37 +13002922 VkSwapchainImageUsageFlagsANDROID flags
Chris Forbes48853712017-01-12 14:09:33 +13002923}
Ian Elliott4c8bb2a2016-12-29 11:07:26 -07002924
2925@extension("VK_GOOGLE_display_timing")
2926class VkRefreshCycleDurationGOOGLE {
Chris Forbes48853712017-01-12 14:09:33 +13002927 u64 minRefreshDuration
2928 u64 maxRefreshDuration
Ian Elliott4c8bb2a2016-12-29 11:07:26 -07002929}
2930
2931@extension("VK_GOOGLE_display_timing")
2932class VkPastPresentationTimingGOOGLE {
Chris Forbes48853712017-01-12 14:09:33 +13002933 u32 presentID
2934 u64 desiredPresentTime
2935 u64 actualPresentTime
2936 u64 earliestPresentTime
2937 u64 presentMargin
Ian Elliott4c8bb2a2016-12-29 11:07:26 -07002938}
2939
2940@extension("VK_GOOGLE_display_timing")
2941class VkPresentTimeGOOGLE {
Chris Forbes48853712017-01-12 14:09:33 +13002942 u32 presentID
2943 u64 desiredPresentTime
Ian Elliott4c8bb2a2016-12-29 11:07:26 -07002944}
2945
2946@extension("VK_GOOGLE_display_timing")
2947class VkPresentTimesInfoGOOGLE {
2948 VkStructureType sType
2949 const void* pNext
Chris Forbes48853712017-01-12 14:09:33 +13002950 u32 swapchainCount
Ian Elliott4c8bb2a2016-12-29 11:07:26 -07002951 const VkPresentTimeGOOGLE* pTimes
Chris Forbes8e4438b2016-12-07 16:26:49 +13002952}
2953
Jesse Hall715b86a2016-01-16 16:34:29 -08002954@extension("VK_EXT_debug_report")
2955class VkDebugReportCallbackCreateInfoEXT {
2956 VkStructureType sType
2957 const void* pNext
2958 VkDebugReportFlagsEXT flags
2959 PFN_vkDebugReportCallbackEXT pfnCallback
2960 void* pUserData
2961}
2962
Jesse Hall26763382016-05-20 07:13:52 -07002963@extension("VK_AMD_rasterization_order")
2964class VkPipelineRasterizationStateRasterizationOrderAMD {
2965 VkStructureType sType
2966 const void* pNext
2967 VkRasterizationOrderAMD rasterizationOrder
2968}
2969
2970@extension("VK_EXT_debug_marker")
2971class VkDebugMarkerObjectNameInfoEXT {
2972 VkStructureType sType
2973 const void* pNext
2974 VkDebugReportObjectTypeEXT objectType
2975 u64 object
2976 const char* pObjectName
2977}
2978
2979@extension("VK_EXT_debug_marker")
2980class VkDebugMarkerObjectTagInfoEXT {
2981 VkStructureType sType
2982 const void* pNext
2983 VkDebugReportObjectTypeEXT objectType
2984 u64 object
2985 u64 tagName
2986 platform.size_t tagSize
2987 const void* pTag
2988}
2989
2990@extension("VK_EXT_debug_marker")
2991class VkDebugMarkerMarkerInfoEXT {
2992 VkStructureType sType
2993 const void* pNext
2994 const char* pMarkerName
2995 f32[4] color
2996}
2997
Jesse Hall56d386a2016-07-26 15:20:40 -07002998@extension("VK_NV_dedicated_allocation")
2999class VkDedicatedAllocationImageCreateInfoNV {
3000 VkStructureType sType
3001 const void* pNext
3002 VkBool32 dedicatedAllocation
3003}
3004
3005@extension("VK_NV_dedicated_allocation")
3006class VkDedicatedAllocationBufferCreateInfoNV {
3007 VkStructureType sType
3008 const void* pNext
3009 VkBool32 dedicatedAllocation
3010}
3011
3012@extension("VK_NV_dedicated_allocation")
3013class VkDedicatedAllocationMemoryAllocateInfoNV {
3014 VkStructureType sType
3015 const void* pNext
3016 VkImage image
3017 VkBuffer buffer
3018}
3019
Chris Forbes1194ede2016-12-30 16:29:25 +13003020@extension("VK_KHR_get_physical_device_properties2")
3021class VkPhysicalDeviceFeatures2KHR {
3022 VkStructureType sType
3023 void* pNext
3024 VkPhysicalDeviceFeatures features
3025}
3026
3027@extension("VK_KHR_get_physical_device_properties2")
3028class VkPhysicalDeviceProperties2KHR {
3029 VkStructureType sType
3030 void* pNext
3031 VkPhysicalDeviceProperties properties
3032}
3033
3034@extension("VK_KHR_get_physical_device_properties2")
3035class VkFormatProperties2KHR {
3036 VkStructureType sType
3037 void* pNext
3038 VkFormatProperties formatProperties
3039}
3040
3041@extension("VK_KHR_get_physical_device_properties2")
3042class VkImageFormatProperties2KHR {
3043 VkStructureType sType
3044 void* pNext
3045 VkImageFormatProperties imageFormatProperties
3046}
3047
3048@extension("VK_KHR_get_physical_device_properties2")
3049class VkPhysicalDeviceImageFormatInfo2KHR {
3050 VkStructureType sType
3051 const void* pNext
3052 VkFormat format
3053 VkImageType type
3054 VkImageTiling tiling
3055 VkImageUsageFlags usage
3056 VkImageCreateFlags flags
3057}
3058
3059@extension("VK_KHR_get_physical_device_properties2")
3060class VkQueueFamilyProperties2KHR {
3061 VkStructureType sType
3062 void* pNext
3063 VkQueueFamilyProperties queueFamilyProperties
3064}
3065
3066@extension("VK_KHR_get_physical_device_properties2")
3067class VkPhysicalDeviceMemoryProperties2KHR {
3068 VkStructureType sType
3069 void* pNext
3070 VkPhysicalDeviceMemoryProperties memoryProperties
3071}
3072
3073@extension("VK_KHR_get_physical_device_properties2")
3074class VkSparseImageFormatProperties2KHR {
3075 VkStructureType sType
3076 void* pNext
3077 VkSparseImageFormatProperties properties
3078}
3079
3080@extension("VK_KHR_get_physical_device_properties2")
3081class VkPhysicalDeviceSparseImageFormatInfo2KHR {
3082 VkStructureType sType
3083 const void* pNext
3084 VkFormat format
3085 VkImageType type
3086 VkSampleCountFlagBits samples
3087 VkImageUsageFlags usage
3088 VkImageTiling tiling
3089}
3090
Chris Forbes289cb792016-12-30 15:03:55 +13003091@extension("VK_KHR_incremental_present")
3092class VkRectLayerKHR {
3093 VkOffset2D offset
3094 VkExtent2D extent
3095 u32 layer
3096}
3097
3098@extension("VK_KHR_incremental_present")
3099class VkPresentRegionKHR {
3100 u32 rectangleCount
3101 const VkRectLayerKHR* pRectangles
3102}
3103
3104@extension("VK_KHR_incremental_present")
3105class VkPresentRegionsKHR {
3106 VkStructureType sType
3107 const void* pNext
3108 u32 swapchainCount
3109 const VkPresentRegionKHR* pRegions
3110}
3111
3112@extension("VK_NV_external_memory_capabilities")
3113class VkExternalImageFormatPropertiesNV {
3114 VkImageFormatProperties imageFormatProperties
3115 VkExternalMemoryFeatureFlagsNV externalMemoryFeatures
3116 VkExternalMemoryHandleTypeFlagsNV exportFromImportedHandleTypes
3117 VkExternalMemoryHandleTypeFlagsNV compatibleHandleTypes
3118}
3119
3120@extension("VK_NV_external_memory")
3121class VkExternalMemoryImageCreateInfoNV {
3122 VkStructureType sType
3123 const void* pNext
3124 VkExternalMemoryHandleTypeFlagsNV handleTypes
3125}
3126
3127@extension("VK_NV_external_memory")
3128class VkExportMemoryAllocateInfoNV {
3129 VkStructureType sType
3130 const void* pNext
3131 VkExternalMemoryHandleTypeFlagsNV handleTypes
3132}
3133
3134@extension("VK_NV_external_memory_win32")
3135class VkImportMemoryWin32HandleInfoNV {
3136 VkStructureType sType
3137 const void* pNext
3138 VkExternalMemoryHandleTypeFlagsNV handleType
3139 platform.HANDLE handle
3140}
3141
3142@extension("VK_NV_external_memory_win32")
3143class VkExportMemoryWin32HandleInfoNV {
3144 VkStructureType sType
3145 const void* pNext
3146 const platform.SECURITY_ATTRIBUTES* pAttributes
3147 u32 dwAccess
3148}
3149
3150@extension("VK_NV_win32_keyed_mutex")
3151class VkWin32KeyedMutexAcquireReleaseInfoNV {
3152 VkStructureType sType
3153 const void* pNext
3154 u32 acquireCount
3155 const VkDeviceMemory* pAcquireSyncs
3156 const u64* pAcquireKeys
3157 const u32* pAcquireTimeoutMilliseconds
3158 u32 releaseCount
3159 const VkDeviceMemory* pReleaseSyncs
3160 const u64* pReleaseKeys
3161}
3162
3163@extension("VK_EXT_validation_flags")
3164class VkValidationFlagsEXT {
3165 VkStructureType sType
3166 const void* pNext
3167 u32 disabledValidationCheckCount
3168 VkValidationCheckEXT* pDisabledValidationChecks
3169}
3170
3171@extension("VK_NVX_device_generated_commands")
3172class VkDeviceGeneratedCommandsFeaturesNVX {
3173 VkStructureType sType
3174 const void* pNext
3175 VkBool32 computeBindingPointSupport
3176}
3177
3178@extension("VK_NVX_device_generated_commands")
3179class VkDeviceGeneratedCommandsLimitsNVX {
3180 VkStructureType sType
3181 const void* pNext
3182 u32 maxIndirectCommandsLayoutTokenCount
3183 u32 maxObjectEntryCounts
3184 u32 minSequenceCountBufferOffsetAlignment
3185 u32 minSequenceIndexBufferOffsetAlignment
3186 u32 minCommandsTokenBufferOffsetAlignment
3187}
3188
3189@extension("VK_NVX_device_generated_commands")
3190class VkIndirectCommandsTokenNVX {
3191 VkIndirectCommandsTokenTypeNVX tokenType
3192 VkBuffer buffer
3193 VkDeviceSize offset
3194}
3195
3196@extension("VK_NVX_device_generated_commands")
3197class VkIndirectCommandsLayoutTokenNVX {
3198 VkIndirectCommandsTokenTypeNVX tokenType
3199 u32 bindingUnit
3200 u32 dynamicCount
3201 u32 divisor
3202}
3203
3204@extension("VK_NVX_device_generated_commands")
3205class VkIndirectCommandsLayoutCreateInfoNVX {
3206 VkStructureType sType
3207 const void* pNext
3208 VkPipelineBindPoint pipelineBindPoint
3209 VkIndirectCommandsLayoutUsageFlagsNVX flags
3210 u32 tokenCount
3211 const VkIndirectCommandsLayoutTokenNVX* pTokens
3212}
3213
3214@extension("VK_NVX_device_generated_commands")
3215class VkCmdProcessCommandsInfoNVX {
3216 VkStructureType sType
3217 const void* pNext
3218 VkObjectTableNVX objectTable
3219 VkIndirectCommandsLayoutNVX indirectCommandsLayout
3220 u32 indirectCommandsTokenCount
3221 const VkIndirectCommandsTokenNVX* pIndirectCommandsTokens
3222 u32 maxSequencesCount
3223 VkCommandBuffer targetCommandBuffer
3224 VkBuffer sequencesCountBuffer
3225 VkDeviceSize sequencesCountOffset
3226 VkBuffer sequencesIndexBuffer
3227 VkDeviceSize sequencesIndexOffset
3228}
3229
3230@extension("VK_NVX_device_generated_commands")
3231class VkCmdReserveSpaceForCommandsInfoNVX {
3232 VkStructureType sType
3233 const void* pNext
3234 VkObjectTableNVX objectTable
3235 VkIndirectCommandsLayoutNVX indirectCommandsLayout
3236 u32 maxSequencesCount
3237}
3238
3239@extension("VK_NVX_device_generated_commands")
3240class VkObjectTableCreateInfoNVX {
3241 VkStructureType sType
3242 const void* pNext
3243 u32 objectCount
3244 const VkObjectEntryTypeNVX* pObjectEntryTypes
3245 const u32* pObjectEntryCounts
3246 const VkObjectEntryUsageFlagsNVX* pObjectEntryUsageFlags
3247 u32 maxUniformBuffersPerDescriptor
3248 u32 maxStorageBuffersPerDescriptor
3249 u32 maxStorageImagesPerDescriptor
3250 u32 maxSampledImagesPerDescriptor
3251 u32 maxPipelineLayouts
3252}
3253
3254@extension("VK_NVX_device_generated_commands")
3255class VkObjectTableEntryNVX {
3256 VkObjectEntryTypeNVX type
3257 VkObjectEntryUsageFlagsNVX flags
3258}
3259
3260@extension("VK_NVX_device_generated_commands")
3261class VkObjectTablePipelineEntryNVX {
3262 VkObjectEntryTypeNVX type
3263 VkObjectEntryUsageFlagsNVX flags
3264 VkPipeline pipeline
3265}
3266
3267@extension("VK_NVX_device_generated_commands")
3268class VkObjectTableDescriptorSetEntryNVX {
3269 VkObjectEntryTypeNVX type
3270 VkObjectEntryUsageFlagsNVX flags
3271 VkPipelineLayout pipelineLayout
3272 VkDescriptorSet descriptorSet
3273}
3274
3275@extension("VK_NVX_device_generated_commands")
3276class VkObjectTableVertexBufferEntryNVX {
3277 VkObjectEntryTypeNVX type
3278 VkObjectEntryUsageFlagsNVX flags
3279 VkBuffer buffer
3280}
3281
3282@extension("VK_NVX_device_generated_commands")
3283class VkObjectTableIndexBufferEntryNVX {
3284 VkObjectEntryTypeNVX type
3285 VkObjectEntryUsageFlagsNVX flags
3286 VkBuffer buffer
3287}
3288
3289@extension("VK_NVX_device_generated_commands")
3290class VkObjectTablePushConstantEntryNVX {
3291 VkObjectEntryTypeNVX type
3292 VkObjectEntryUsageFlagsNVX flags
3293 VkPipelineLayout pipelineLayout
3294 VkShaderStageFlags stageFlags
3295}
3296
3297
Jesse Hall1356b0d2015-11-23 17:24:58 -08003298
Jesse Halld27f6aa2015-08-15 17:58:48 -07003299////////////////
3300// Commands //
3301////////////////
3302
3303// Function pointers. TODO: add support for function pointers.
3304
3305@external type void* PFN_vkVoidFunction
3306@pfn cmd void vkVoidFunction() {
3307}
3308
Jesse Hall3fbc8562015-11-29 22:10:52 -08003309@external type void* PFN_vkAllocationFunction
3310@pfn cmd void* vkAllocationFunction(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003311 void* pUserData,
3312 platform.size_t size,
3313 platform.size_t alignment,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003314 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08003315 return ?
3316}
3317
Jesse Hall3fbc8562015-11-29 22:10:52 -08003318@external type void* PFN_vkReallocationFunction
3319@pfn cmd void* vkReallocationFunction(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003320 void* pUserData,
3321 void* pOriginal,
3322 platform.size_t size,
3323 platform.size_t alignment,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003324 VkSystemAllocationScope allocationScope) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003325 return ?
3326}
3327
3328@external type void* PFN_vkFreeFunction
3329@pfn cmd void vkFreeFunction(
3330 void* pUserData,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003331 void* pMemory) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003332}
3333
Jesse Hall3fbc8562015-11-29 22:10:52 -08003334@external type void* PFN_vkInternalAllocationNotification
3335@pfn cmd void vkInternalAllocationNotification(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003336 void* pUserData,
3337 platform.size_t size,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003338 VkInternalAllocationType allocationType,
3339 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08003340}
3341
3342@external type void* PFN_vkInternalFreeNotification
3343@pfn cmd void vkInternalFreeNotification(
3344 void* pUserData,
3345 platform.size_t size,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003346 VkInternalAllocationType allocationType,
3347 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08003348}
Jesse Halld27f6aa2015-08-15 17:58:48 -07003349
3350// Global functions
3351
3352@threadSafety("system")
3353cmd VkResult vkCreateInstance(
3354 const VkInstanceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003355 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003356 VkInstance* pInstance) {
3357 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO)
3358
3359 instance := ?
3360 pInstance[0] = instance
3361 State.Instances[instance] = new!InstanceObject()
3362
Jesse Hall3dd678a2016-01-08 21:52:01 -08003363 layers := pCreateInfo.ppEnabledLayerNames[0:pCreateInfo.enabledLayerCount]
3364 extensions := pCreateInfo.ppEnabledExtensionNames[0:pCreateInfo.enabledExtensionCount]
Jesse Halld27f6aa2015-08-15 17:58:48 -07003365
3366 return ?
3367}
3368
3369@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003370cmd void vkDestroyInstance(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003371 VkInstance instance,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003372 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003373 instanceObject := GetInstance(instance)
3374
3375 State.Instances[instance] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003376}
3377
3378@threadSafety("system")
3379cmd VkResult vkEnumeratePhysicalDevices(
3380 VkInstance instance,
3381 u32* pPhysicalDeviceCount,
3382 VkPhysicalDevice* pPhysicalDevices) {
3383 instanceObject := GetInstance(instance)
3384
3385 physicalDeviceCount := as!u32(?)
3386 pPhysicalDeviceCount[0] = physicalDeviceCount
3387 physicalDevices := pPhysicalDevices[0:physicalDeviceCount]
3388
3389 for i in (0 .. physicalDeviceCount) {
3390 physicalDevice := ?
3391 physicalDevices[i] = physicalDevice
3392 if !(physicalDevice in State.PhysicalDevices) {
3393 State.PhysicalDevices[physicalDevice] = new!PhysicalDeviceObject(instance: instance)
3394 }
3395 }
3396
3397 return ?
3398}
3399
3400cmd PFN_vkVoidFunction vkGetDeviceProcAddr(
3401 VkDevice device,
3402 const char* pName) {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003403 if device != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003404 device := GetDevice(device)
3405 }
3406
3407 return ?
3408}
3409
3410cmd PFN_vkVoidFunction vkGetInstanceProcAddr(
3411 VkInstance instance,
3412 const char* pName) {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003413 if instance != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003414 instanceObject := GetInstance(instance)
3415 }
3416
3417 return ?
3418}
3419
Jesse Hall606a54e2015-11-19 22:17:28 -08003420cmd void vkGetPhysicalDeviceProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003421 VkPhysicalDevice physicalDevice,
3422 VkPhysicalDeviceProperties* pProperties) {
3423 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3424
3425 properties := ?
3426 pProperties[0] = properties
Jesse Halld27f6aa2015-08-15 17:58:48 -07003427}
3428
Jesse Hall606a54e2015-11-19 22:17:28 -08003429cmd void vkGetPhysicalDeviceQueueFamilyProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003430 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003431 u32* pQueueFamilyPropertyCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003432 VkQueueFamilyProperties* pQueueFamilyProperties) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003433 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003434 // TODO: Figure out how to express fetch-count-or-properties
3435 // This version fails 'apic validate' with 'fence not allowed in
3436 // *semantic.Branch'. Other attempts have failed with the same or other
3437 // errors.
3438 // if pQueueFamilyProperties != null {
3439 // queuesProperties := pQueueFamilyProperties[0:pCount[0]]
3440 // for i in (0 .. pCount[0]) {
3441 // queueProperties := as!VkQueueFamilyProperties(?)
3442 // queuesProperties[i] = queueProperties
3443 // }
3444 // } else {
3445 // count := ?
3446 // pCount[0] = count
3447 // }
Jesse Halld27f6aa2015-08-15 17:58:48 -07003448}
3449
Jesse Hall606a54e2015-11-19 22:17:28 -08003450cmd void vkGetPhysicalDeviceMemoryProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003451 VkPhysicalDevice physicalDevice,
3452 VkPhysicalDeviceMemoryProperties* pMemoryProperties) {
3453 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3454
3455 memoryProperties := ?
3456 pMemoryProperties[0] = memoryProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07003457}
3458
Jesse Hall606a54e2015-11-19 22:17:28 -08003459cmd void vkGetPhysicalDeviceFeatures(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003460 VkPhysicalDevice physicalDevice,
3461 VkPhysicalDeviceFeatures* pFeatures) {
3462 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3463
3464 features := ?
3465 pFeatures[0] = features
Jesse Halld27f6aa2015-08-15 17:58:48 -07003466}
3467
Jesse Hall606a54e2015-11-19 22:17:28 -08003468cmd void vkGetPhysicalDeviceFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003469 VkPhysicalDevice physicalDevice,
3470 VkFormat format,
3471 VkFormatProperties* pFormatProperties) {
3472 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3473
3474 formatProperties := ?
3475 pFormatProperties[0] = formatProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07003476}
3477
Jesse Halla9e57032015-11-30 01:03:10 -08003478cmd VkResult vkGetPhysicalDeviceImageFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003479 VkPhysicalDevice physicalDevice,
3480 VkFormat format,
3481 VkImageType type,
3482 VkImageTiling tiling,
3483 VkImageUsageFlags usage,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003484 VkImageCreateFlags flags,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003485 VkImageFormatProperties* pImageFormatProperties) {
3486 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3487
3488 imageFormatProperties := ?
3489 pImageFormatProperties[0] = imageFormatProperties
Jesse Halla9e57032015-11-30 01:03:10 -08003490
3491 return ?
Jesse Halld27f6aa2015-08-15 17:58:48 -07003492}
3493
Jesse Halld27f6aa2015-08-15 17:58:48 -07003494
3495// Device functions
3496
3497@threadSafety("system")
3498cmd VkResult vkCreateDevice(
3499 VkPhysicalDevice physicalDevice,
3500 const VkDeviceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003501 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003502 VkDevice* pDevice) {
3503 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO)
3504 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3505
3506 device := ?
3507 pDevice[0] = device
3508 State.Devices[device] = new!DeviceObject(physicalDevice: physicalDevice)
3509
3510 return ?
3511}
3512
3513@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003514cmd void vkDestroyDevice(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003515 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003516 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003517 deviceObject := GetDevice(device)
3518
3519 State.Devices[device] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003520}
3521
3522
3523// Extension discovery functions
3524
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003525cmd VkResult vkEnumerateInstanceLayerProperties(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003526 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003527 VkLayerProperties* pProperties) {
3528 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08003529 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07003530
3531 properties := pProperties[0:count]
3532 for i in (0 .. count) {
3533 property := ?
3534 properties[i] = property
3535 }
3536
3537 return ?
3538}
3539
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003540cmd VkResult vkEnumerateInstanceExtensionProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003541 const char* pLayerName,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003542 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003543 VkExtensionProperties* pProperties) {
3544 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08003545 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07003546
3547 properties := pProperties[0:count]
3548 for i in (0 .. count) {
3549 property := ?
3550 properties[i] = property
3551 }
3552
3553 return ?
3554}
3555
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003556cmd VkResult vkEnumerateDeviceLayerProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003557 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003558 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003559 VkLayerProperties* pProperties) {
3560 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3561 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08003562 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07003563
3564 properties := pProperties[0:count]
3565 for i in (0 .. count) {
3566 property := ?
3567 properties[i] = property
3568 }
3569
3570 return ?
3571}
3572
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003573cmd VkResult vkEnumerateDeviceExtensionProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003574 VkPhysicalDevice physicalDevice,
3575 const char* pLayerName,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003576 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003577 VkExtensionProperties* pProperties) {
3578 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3579
3580 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08003581 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07003582
3583 properties := pProperties[0:count]
3584 for i in (0 .. count) {
3585 property := ?
3586 properties[i] = property
3587 }
3588
3589 return ?
3590}
3591
3592
3593// Queue functions
3594
3595@threadSafety("system")
Jesse Hall606a54e2015-11-19 22:17:28 -08003596cmd void vkGetDeviceQueue(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003597 VkDevice device,
3598 u32 queueFamilyIndex,
3599 u32 queueIndex,
3600 VkQueue* pQueue) {
3601 deviceObject := GetDevice(device)
3602
3603 queue := ?
3604 pQueue[0] = queue
3605
3606 if !(queue in State.Queues) {
3607 State.Queues[queue] = new!QueueObject(device: device)
3608 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07003609}
3610
3611@threadSafety("app")
3612cmd VkResult vkQueueSubmit(
3613 VkQueue queue,
Jesse Halla366a512015-11-19 22:30:07 -08003614 u32 submitCount,
Jesse Hallb00daad2015-11-29 19:46:20 -08003615 const VkSubmitInfo* pSubmits,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003616 VkFence fence) {
3617 queueObject := GetQueue(queue)
3618
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003619 if fence != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003620 fenceObject := GetFence(fence)
3621 assert(fenceObject.device == queueObject.device)
3622 }
3623
Jesse Hall3fbc8562015-11-29 22:10:52 -08003624 // commandBuffers := pcommandBuffers[0:commandBufferCount]
3625 // for i in (0 .. commandBufferCount) {
3626 // commandBuffer := commandBuffers[i]
3627 // commandBufferObject := GetCommandBuffer(commandBuffer)
3628 // assert(commandBufferObject.device == queueObject.device)
Jesse Halla366a512015-11-19 22:30:07 -08003629 //
Jesse Hall3fbc8562015-11-29 22:10:52 -08003630 // validate("QueueCheck", commandBufferObject.queueFlags in queueObject.flags,
3631 // "vkQueueSubmit: enqueued commandBuffer requires missing queue capabilities.")
Jesse Halla366a512015-11-19 22:30:07 -08003632 // }
Jesse Halld27f6aa2015-08-15 17:58:48 -07003633
3634 return ?
3635}
3636
3637@threadSafety("system")
3638cmd VkResult vkQueueWaitIdle(
3639 VkQueue queue) {
3640 queueObject := GetQueue(queue)
3641
3642 return ?
3643}
3644
3645@threadSafety("system")
3646cmd VkResult vkDeviceWaitIdle(
3647 VkDevice device) {
3648 deviceObject := GetDevice(device)
3649
3650 return ?
3651}
3652
3653
3654// Memory functions
3655
3656@threadSafety("system")
Jesse Hall3fbc8562015-11-29 22:10:52 -08003657cmd VkResult vkAllocateMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003658 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003659 const VkMemoryAllocateInfo* pAllocateInfo,
3660 const VkAllocationCallbacks* pAllocator,
3661 VkDeviceMemory* pMemory) {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08003662 assert(pAllocateInfo.sType == VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003663 deviceObject := GetDevice(device)
3664
Jesse Hall3fbc8562015-11-29 22:10:52 -08003665 memory := ?
3666 pMemory[0] = memory
3667 State.DeviceMemories[memory] = new!DeviceMemoryObject(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003668 device: device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003669 allocationSize: pAllocateInfo[0].allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003670
3671 return ?
3672}
3673
3674@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003675cmd void vkFreeMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003676 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003677 VkDeviceMemory memory,
3678 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003679 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003680 memoryObject := GetDeviceMemory(memory)
3681 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003682
3683 // Check that no objects are still bound before freeing.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003684 validate("MemoryCheck", len(memoryObject.boundObjects) == 0,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003685 "vkFreeMemory: objects still bound")
Jesse Hall3fbc8562015-11-29 22:10:52 -08003686 validate("MemoryCheck", len(memoryObject.boundCommandBuffers) == 0,
3687 "vkFreeMemory: commandBuffers still bound")
3688 State.DeviceMemories[memory] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003689}
3690
3691@threadSafety("app")
3692cmd VkResult vkMapMemory(
3693 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003694 VkDeviceMemory memory,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003695 VkDeviceSize offset,
3696 VkDeviceSize size,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003697 VkMemoryMapFlags flags,
3698 void** ppData) {
3699 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003700 memoryObject := GetDeviceMemory(memory)
3701 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003702
3703 assert(flags == as!VkMemoryMapFlags(0))
Jesse Hall3fbc8562015-11-29 22:10:52 -08003704 assert((offset + size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003705
3706 return ?
3707}
3708
3709@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003710cmd void vkUnmapMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003711 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003712 VkDeviceMemory memory) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003713 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003714 memoryObject := GetDeviceMemory(memory)
3715 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003716}
3717
3718cmd VkResult vkFlushMappedMemoryRanges(
3719 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003720 u32 memoryRangeCount
3721 const VkMappedMemoryRange* pMemoryRanges) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003722 deviceObject := GetDevice(device)
3723
Jesse Hall3fbc8562015-11-29 22:10:52 -08003724 memoryRanges := pMemoryRanges[0:memoryRangeCount]
3725 for i in (0 .. memoryRangeCount) {
3726 memoryRange := memoryRanges[i]
3727 memoryObject := GetDeviceMemory(memoryRange.memory)
3728 assert(memoryObject.device == device)
3729 assert((memoryRange.offset + memoryRange.size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003730 }
3731
3732 return ?
3733}
3734
3735cmd VkResult vkInvalidateMappedMemoryRanges(
3736 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003737 u32 memoryRangeCount,
3738 const VkMappedMemoryRange* pMemoryRanges) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003739 deviceObject := GetDevice(device)
3740
Jesse Hall3fbc8562015-11-29 22:10:52 -08003741 memoryRanges := pMemoryRanges[0:memoryRangeCount]
3742 for i in (0 .. memoryRangeCount) {
3743 memoryRange := memoryRanges[i]
3744 memoryObject := GetDeviceMemory(memoryRange.memory)
3745 assert(memoryObject.device == device)
3746 assert((memoryRange.offset + memoryRange.size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003747 }
3748
3749 return ?
3750}
3751
3752
3753// Memory management API functions
3754
Jesse Hall606a54e2015-11-19 22:17:28 -08003755cmd void vkGetDeviceMemoryCommitment(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003756 VkDevice device,
3757 VkDeviceMemory memory,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003758 VkDeviceSize* pCommittedMemoryInBytes) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003759 deviceObject := GetDevice(device)
3760
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003761 if memory != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003762 memoryObject := GetDeviceMemory(memory)
3763 assert(memoryObject.device == device)
3764 }
3765
3766 committedMemoryInBytes := ?
3767 pCommittedMemoryInBytes[0] = committedMemoryInBytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07003768}
3769
Jesse Hall606a54e2015-11-19 22:17:28 -08003770cmd void vkGetBufferMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003771 VkDevice device,
3772 VkBuffer buffer,
3773 VkMemoryRequirements* pMemoryRequirements) {
3774 deviceObject := GetDevice(device)
3775 bufferObject := GetBuffer(buffer)
3776 assert(bufferObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003777}
3778
3779cmd VkResult vkBindBufferMemory(
3780 VkDevice device,
3781 VkBuffer buffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003782 VkDeviceMemory memory,
3783 VkDeviceSize memoryOffset) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003784 deviceObject := GetDevice(device)
3785 bufferObject := GetBuffer(buffer)
3786 assert(bufferObject.device == device)
3787
3788 // Unbind buffer from previous memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003789 if bufferObject.memory != NULL_HANDLE {
3790 memoryObject := GetDeviceMemory(bufferObject.memory)
3791 memoryObject.boundObjects[as!u64(buffer)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003792 }
3793
3794 // Bind buffer to given memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003795 if memory != NULL_HANDLE {
3796 memoryObject := GetDeviceMemory(memory)
3797 assert(memoryObject.device == device)
3798 memoryObject.boundObjects[as!u64(buffer)] = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003799 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08003800 bufferObject.memory = memory
3801 bufferObject.memoryOffset = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003802
3803 return ?
3804}
3805
Jesse Hall606a54e2015-11-19 22:17:28 -08003806cmd void vkGetImageMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003807 VkDevice device,
3808 VkImage image,
3809 VkMemoryRequirements* pMemoryRequirements) {
3810 deviceObject := GetDevice(device)
3811 imageObject := GetImage(image)
3812 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003813}
3814
3815cmd VkResult vkBindImageMemory(
3816 VkDevice device,
3817 VkImage image,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003818 VkDeviceMemory memory,
3819 VkDeviceSize memoryOffset) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003820 deviceObject := GetDevice(device)
3821 imageObject := GetImage(image)
3822 assert(imageObject.device == device)
3823
3824 // Unbind image from previous memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003825 if imageObject.memory != NULL_HANDLE {
3826 memoryObject := GetDeviceMemory(imageObject.memory)
3827 memoryObject.boundObjects[as!u64(image)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003828 }
3829
3830 // Bind image to given memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003831 if memory != NULL_HANDLE {
3832 memoryObject := GetDeviceMemory(memory)
3833 assert(memoryObject.device == device)
3834 memoryObject.boundObjects[as!u64(image)] = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003835 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08003836 imageObject.memory = memory
3837 imageObject.memoryOffset = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003838
3839 return ?
3840}
3841
Jesse Hall606a54e2015-11-19 22:17:28 -08003842cmd void vkGetImageSparseMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003843 VkDevice device,
3844 VkImage image,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003845 u32* pSparseMemoryRequirementCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003846 VkSparseImageMemoryRequirements* pSparseMemoryRequirements) {
3847 deviceObject := GetDevice(device)
3848 imageObject := GetImage(image)
3849 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003850}
3851
Jesse Hall606a54e2015-11-19 22:17:28 -08003852cmd void vkGetPhysicalDeviceSparseImageFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003853 VkPhysicalDevice physicalDevice,
3854 VkFormat format,
3855 VkImageType type,
Jesse Hall091ed9e2015-11-30 00:55:29 -08003856 VkSampleCountFlagBits samples,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003857 VkImageUsageFlags usage,
3858 VkImageTiling tiling,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003859 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003860 VkSparseImageFormatProperties* pProperties) {
3861 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003862}
3863
Jesse Halla6429252015-11-29 18:59:42 -08003864cmd VkResult vkQueueBindSparse(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003865 VkQueue queue,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003866 u32 bindInfoCount,
Jesse Halla6429252015-11-29 18:59:42 -08003867 const VkBindSparseInfo* pBindInfo,
3868 VkFence fence) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003869 queueObject := GetQueue(queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003870
3871 return ?
3872}
3873
3874
3875// Fence functions
3876
3877@threadSafety("system")
3878cmd VkResult vkCreateFence(
3879 VkDevice device,
3880 const VkFenceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003881 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003882 VkFence* pFence) {
3883 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_FENCE_CREATE_INFO)
3884 deviceObject := GetDevice(device)
3885
3886 fence := ?
3887 pFence[0] = fence
3888 State.Fences[fence] = new!FenceObject(
Jesse Halld8bade02015-11-24 10:24:18 -08003889 device: device, signaled: (pCreateInfo.flags == as!VkFenceCreateFlags(VK_FENCE_CREATE_SIGNALED_BIT)))
Jesse Halld27f6aa2015-08-15 17:58:48 -07003890
3891 return ?
3892}
3893
3894@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003895cmd void vkDestroyFence(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003896 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003897 VkFence fence,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003898 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003899 deviceObject := GetDevice(device)
3900 fenceObject := GetFence(fence)
3901 assert(fenceObject.device == device)
3902
3903 State.Fences[fence] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003904}
3905
3906@threadSafety("system")
3907cmd VkResult vkResetFences(
3908 VkDevice device,
3909 u32 fenceCount,
3910 const VkFence* pFences) {
3911 deviceObject := GetDevice(device)
3912
3913 fences := pFences[0:fenceCount]
3914 for i in (0 .. fenceCount) {
3915 fence := fences[i]
3916 fenceObject := GetFence(fence)
3917 assert(fenceObject.device == device)
3918 fenceObject.signaled = false
3919 }
3920
3921 return ?
3922}
3923
3924@threadSafety("system")
3925cmd VkResult vkGetFenceStatus(
3926 VkDevice device,
3927 VkFence fence) {
3928 deviceObject := GetDevice(device)
3929 fenceObject := GetFence(fence)
3930 assert(fenceObject.device == device)
3931
3932 return ?
3933}
3934
3935@threadSafety("system")
3936cmd VkResult vkWaitForFences(
3937 VkDevice device,
3938 u32 fenceCount,
3939 const VkFence* pFences,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003940 VkBool32 waitAll,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003941 u64 timeout) { /// timeout in nanoseconds
3942 deviceObject := GetDevice(device)
3943
3944 fences := pFences[0:fenceCount]
3945 for i in (0 .. fenceCount) {
3946 fence := fences[i]
3947 fenceObject := GetFence(fence)
3948 assert(fenceObject.device == device)
3949 }
3950
3951 return ?
3952}
3953
3954
3955// Queue semaphore functions
3956
3957@threadSafety("system")
3958cmd VkResult vkCreateSemaphore(
3959 VkDevice device,
3960 const VkSemaphoreCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003961 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003962 VkSemaphore* pSemaphore) {
3963 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO)
3964 deviceObject := GetDevice(device)
3965
3966 semaphore := ?
3967 pSemaphore[0] = semaphore
3968 State.Semaphores[semaphore] = new!SemaphoreObject(device: device)
3969
3970 return ?
3971}
3972
3973@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003974cmd void vkDestroySemaphore(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003975 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003976 VkSemaphore semaphore,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003977 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003978 deviceObject := GetDevice(device)
3979 semaphoreObject := GetSemaphore(semaphore)
3980 assert(semaphoreObject.device == device)
3981
3982 State.Semaphores[semaphore] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003983}
3984
Jesse Halld27f6aa2015-08-15 17:58:48 -07003985
3986// Event functions
3987
3988@threadSafety("system")
3989cmd VkResult vkCreateEvent(
3990 VkDevice device,
3991 const VkEventCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003992 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003993 VkEvent* pEvent) {
3994 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_EVENT_CREATE_INFO)
3995 deviceObject := GetDevice(device)
3996
3997 event := ?
3998 pEvent[0] = event
3999 State.Events[event] = new!EventObject(device: device)
4000
4001 return ?
4002}
4003
4004@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004005cmd void vkDestroyEvent(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004006 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004007 VkEvent event,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004008 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004009 deviceObject := GetDevice(device)
4010 eventObject := GetEvent(event)
4011 assert(eventObject.device == device)
4012
4013 State.Events[event] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004014}
4015
4016@threadSafety("system")
4017cmd VkResult vkGetEventStatus(
4018 VkDevice device,
4019 VkEvent event) {
4020 deviceObject := GetDevice(device)
4021 eventObject := GetEvent(event)
4022 assert(eventObject.device == device)
4023
4024 return ?
4025}
4026
4027@threadSafety("system")
4028cmd VkResult vkSetEvent(
4029 VkDevice device,
4030 VkEvent event) {
4031 deviceObject := GetDevice(device)
4032 eventObject := GetEvent(event)
4033 assert(eventObject.device == device)
4034
4035 return ?
4036}
4037
4038@threadSafety("system")
4039cmd VkResult vkResetEvent(
4040 VkDevice device,
4041 VkEvent event) {
4042 deviceObject := GetDevice(device)
4043 eventObject := GetEvent(event)
4044 assert(eventObject.device == device)
4045
4046 return ?
4047}
4048
4049
4050// Query functions
4051
4052@threadSafety("system")
4053cmd VkResult vkCreateQueryPool(
4054 VkDevice device,
4055 const VkQueryPoolCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004056 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004057 VkQueryPool* pQueryPool) {
4058 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO)
4059 deviceObject := GetDevice(device)
4060
4061 queryPool := ?
4062 pQueryPool[0] = queryPool
4063 State.QueryPools[queryPool] = new!QueryPoolObject(device: device)
4064
4065 return ?
4066}
4067
4068@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004069cmd void vkDestroyQueryPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004070 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004071 VkQueryPool queryPool,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004072 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004073 deviceObject := GetDevice(device)
4074 queryPoolObject := GetQueryPool(queryPool)
4075 assert(queryPoolObject.device == device)
4076
4077 State.QueryPools[queryPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004078}
4079
4080@threadSafety("system")
4081cmd VkResult vkGetQueryPoolResults(
4082 VkDevice device,
4083 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004084 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004085 u32 queryCount,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004086 platform.size_t dataSize,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004087 void* pData,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004088 VkDeviceSize stride,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004089 VkQueryResultFlags flags) {
4090 deviceObject := GetDevice(device)
4091 queryPoolObject := GetQueryPool(queryPool)
4092 assert(queryPoolObject.device == device)
4093
Jesse Halld27f6aa2015-08-15 17:58:48 -07004094 data := pData[0:dataSize]
4095
4096 return ?
4097}
4098
4099// Buffer functions
4100
4101@threadSafety("system")
4102cmd VkResult vkCreateBuffer(
4103 VkDevice device,
4104 const VkBufferCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004105 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004106 VkBuffer* pBuffer) {
4107 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO)
4108 deviceObject := GetDevice(device)
4109
4110 buffer := ?
4111 pBuffer[0] = buffer
4112 State.Buffers[buffer] = new!BufferObject(device: device)
4113
4114 return ?
4115}
4116
4117@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004118cmd void vkDestroyBuffer(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004119 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004120 VkBuffer buffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004121 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004122 deviceObject := GetDevice(device)
4123 bufferObject := GetBuffer(buffer)
4124 assert(bufferObject.device == device)
4125
Jesse Hall3fbc8562015-11-29 22:10:52 -08004126 assert(bufferObject.memory == 0)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004127 State.Buffers[buffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004128}
4129
4130
4131// Buffer view functions
4132
4133@threadSafety("system")
4134cmd VkResult vkCreateBufferView(
4135 VkDevice device,
4136 const VkBufferViewCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004137 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004138 VkBufferView* pView) {
4139 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO)
4140 deviceObject := GetDevice(device)
4141
4142 bufferObject := GetBuffer(pCreateInfo.buffer)
4143 assert(bufferObject.device == device)
4144
4145 view := ?
4146 pView[0] = view
4147 State.BufferViews[view] = new!BufferViewObject(device: device, buffer: pCreateInfo.buffer)
4148
4149 return ?
4150}
4151
4152@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004153cmd void vkDestroyBufferView(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004154 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004155 VkBufferView bufferView,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004156 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004157 deviceObject := GetDevice(device)
4158 bufferViewObject := GetBufferView(bufferView)
4159 assert(bufferViewObject.device == device)
4160
4161 State.BufferViews[bufferView] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004162}
4163
4164
4165// Image functions
4166
4167@threadSafety("system")
4168cmd VkResult vkCreateImage(
4169 VkDevice device,
4170 const VkImageCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004171 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004172 VkImage* pImage) {
4173 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO)
4174 deviceObject := GetDevice(device)
4175
4176 image := ?
4177 pImage[0] = image
4178 State.Images[image] = new!ImageObject(device: device)
4179
4180 return ?
4181}
4182
4183@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004184cmd void vkDestroyImage(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004185 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004186 VkImage image,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004187 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004188 deviceObject := GetDevice(device)
4189 imageObject := GetImage(image)
4190 assert(imageObject.device == device)
4191
Jesse Hall3fbc8562015-11-29 22:10:52 -08004192 assert(imageObject.memory == 0)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004193 State.Images[image] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004194}
4195
Jesse Hall606a54e2015-11-19 22:17:28 -08004196cmd void vkGetImageSubresourceLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004197 VkDevice device,
4198 VkImage image,
4199 const VkImageSubresource* pSubresource,
4200 VkSubresourceLayout* pLayout) {
4201 deviceObject := GetDevice(device)
4202 imageObject := GetImage(image)
4203 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004204}
4205
4206
4207// Image view functions
4208
4209@threadSafety("system")
4210cmd VkResult vkCreateImageView(
4211 VkDevice device,
4212 const VkImageViewCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004213 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004214 VkImageView* pView) {
4215 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO)
4216 deviceObject := GetDevice(device)
4217
4218 imageObject := GetImage(pCreateInfo.image)
4219 assert(imageObject.device == device)
4220
4221 view := ?
4222 pView[0] = view
4223 State.ImageViews[view] = new!ImageViewObject(device: device, image: pCreateInfo.image)
4224
4225 return ?
4226}
4227
4228@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004229cmd void vkDestroyImageView(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004230 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004231 VkImageView imageView,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004232 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004233 deviceObject := GetDevice(device)
4234 imageViewObject := GetImageView(imageView)
4235 assert(imageViewObject.device == device)
4236
4237 State.ImageViews[imageView] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004238}
4239
4240
4241// Shader functions
4242
4243cmd VkResult vkCreateShaderModule(
4244 VkDevice device,
4245 const VkShaderModuleCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004246 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004247 VkShaderModule* pShaderModule) {
4248 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO)
4249 deviceObject := GetDevice(device)
4250
4251 shaderModule := ?
4252 pShaderModule[0] = shaderModule
4253 State.ShaderModules[shaderModule] = new!ShaderModuleObject(device: device)
4254
4255 return ?
4256}
4257
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004258cmd void vkDestroyShaderModule(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004259 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004260 VkShaderModule shaderModule,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004261 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004262 deviceObject := GetDevice(device)
4263 shaderModuleObject := GetShaderModule(shaderModule)
4264 assert(shaderModuleObject.device == device)
4265
4266 State.ShaderModules[shaderModule] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004267}
4268
Jesse Halld27f6aa2015-08-15 17:58:48 -07004269
4270// Pipeline functions
4271
4272cmd VkResult vkCreatePipelineCache(
4273 VkDevice device,
4274 const VkPipelineCacheCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004275 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004276 VkPipelineCache* pPipelineCache) {
4277 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO)
4278 deviceObject := GetDevice(device)
4279
4280 pipelineCache := ?
4281 pPipelineCache[0] = pipelineCache
4282 State.PipelineCaches[pipelineCache] = new!PipelineCacheObject(device: device)
4283
4284 return ?
4285}
4286
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004287cmd void vkDestroyPipelineCache(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004288 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004289 VkPipelineCache pipelineCache,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004290 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004291 deviceObject := GetDevice(device)
4292 pipelineCacheObject := GetPipelineCache(pipelineCache)
4293 assert(pipelineCacheObject.device == device)
4294
4295 State.PipelineCaches[pipelineCache] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004296}
4297
Jesse Halld27f6aa2015-08-15 17:58:48 -07004298cmd VkResult vkGetPipelineCacheData(
4299 VkDevice device,
4300 VkPipelineCache pipelineCache,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004301 platform.size_t* pDataSize,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004302 void* pData) {
4303 deviceObject := GetDevice(device)
4304 pipelineCacheObject := GetPipelineCache(pipelineCache)
4305 assert(pipelineCacheObject.device == device)
4306
4307 return ?
4308}
4309
4310cmd VkResult vkMergePipelineCaches(
4311 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004312 VkPipelineCache dstCache,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004313 u32 srcCacheCount,
4314 const VkPipelineCache* pSrcCaches) {
4315 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004316 dstCacheObject := GetPipelineCache(dstCache)
4317 assert(dstCacheObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004318
4319 srcCaches := pSrcCaches[0:srcCacheCount]
4320 for i in (0 .. srcCacheCount) {
4321 srcCache := srcCaches[i]
4322 srcCacheObject := GetPipelineCache(srcCache)
4323 assert(srcCacheObject.device == device)
4324 }
4325
4326 return ?
4327}
4328
4329cmd VkResult vkCreateGraphicsPipelines(
4330 VkDevice device,
4331 VkPipelineCache pipelineCache,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004332 u32 createInfoCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004333 const VkGraphicsPipelineCreateInfo* pCreateInfos,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004334 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004335 VkPipeline* pPipelines) {
4336 deviceObject := GetDevice(device)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004337 if pipelineCache != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004338 pipelineCacheObject := GetPipelineCache(pipelineCache)
4339 assert(pipelineCacheObject.device == device)
4340 }
4341
Jesse Hall03b6fe12015-11-24 12:44:21 -08004342 createInfos := pCreateInfos[0:createInfoCount]
4343 pipelines := pPipelines[0:createInfoCount]
4344 for i in (0 .. createInfoCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004345 pipeline := ?
4346 pipelines[i] = pipeline
4347 State.Pipelines[pipeline] = new!PipelineObject(device: device)
4348 }
4349
4350 return ?
4351}
4352
4353cmd VkResult vkCreateComputePipelines(
4354 VkDevice device,
4355 VkPipelineCache pipelineCache,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004356 u32 createInfoCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004357 const VkComputePipelineCreateInfo* pCreateInfos,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004358 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004359 VkPipeline* pPipelines) {
4360 deviceObject := GetDevice(device)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004361 if pipelineCache != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004362 pipelineCacheObject := GetPipelineCache(pipelineCache)
4363 assert(pipelineCacheObject.device == device)
4364 }
4365
Jesse Hall03b6fe12015-11-24 12:44:21 -08004366 createInfos := pCreateInfos[0:createInfoCount]
4367 pipelines := pPipelines[0:createInfoCount]
4368 for i in (0 .. createInfoCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004369 pipeline := ?
4370 pipelines[i] = pipeline
4371 State.Pipelines[pipeline] = new!PipelineObject(device: device)
4372 }
4373
4374 return ?
4375}
4376
4377@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004378cmd void vkDestroyPipeline(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004379 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004380 VkPipeline pipeline,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004381 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004382 deviceObject := GetDevice(device)
4383 pipelineObjects := GetPipeline(pipeline)
4384 assert(pipelineObjects.device == device)
4385
4386 State.Pipelines[pipeline] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004387}
4388
4389
4390// Pipeline layout functions
4391
4392@threadSafety("system")
4393cmd VkResult vkCreatePipelineLayout(
4394 VkDevice device,
4395 const VkPipelineLayoutCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004396 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004397 VkPipelineLayout* pPipelineLayout) {
4398 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO)
4399 deviceObject := GetDevice(device)
4400
4401 pipelineLayout := ?
4402 pPipelineLayout[0] = pipelineLayout
4403 State.PipelineLayouts[pipelineLayout] = new!PipelineLayoutObject(device: device)
4404
4405 return ?
4406}
4407
4408@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004409cmd void vkDestroyPipelineLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004410 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004411 VkPipelineLayout pipelineLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004412 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004413 deviceObject := GetDevice(device)
4414 pipelineLayoutObjects := GetPipelineLayout(pipelineLayout)
4415 assert(pipelineLayoutObjects.device == device)
4416
4417 State.PipelineLayouts[pipelineLayout] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004418}
4419
4420
4421// Sampler functions
4422
4423@threadSafety("system")
4424cmd VkResult vkCreateSampler(
4425 VkDevice device,
4426 const VkSamplerCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004427 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004428 VkSampler* pSampler) {
4429 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO)
4430 deviceObject := GetDevice(device)
4431
4432 sampler := ?
4433 pSampler[0] = sampler
4434 State.Samplers[sampler] = new!SamplerObject(device: device)
4435
4436 return ?
4437}
4438
4439@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004440cmd void vkDestroySampler(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004441 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004442 VkSampler sampler,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004443 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004444 deviceObject := GetDevice(device)
4445 samplerObject := GetSampler(sampler)
4446 assert(samplerObject.device == device)
4447
4448 State.Samplers[sampler] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004449}
4450
4451
4452// Descriptor set functions
4453
4454@threadSafety("system")
4455cmd VkResult vkCreateDescriptorSetLayout(
4456 VkDevice device,
4457 const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004458 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004459 VkDescriptorSetLayout* pSetLayout) {
4460 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO)
4461 deviceObject := GetDevice(device)
4462
4463 setLayout := ?
4464 pSetLayout[0] = setLayout
4465 State.DescriptorSetLayouts[setLayout] = new!DescriptorSetLayoutObject(device: device)
4466
4467 return ?
4468}
4469
4470@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004471cmd void vkDestroyDescriptorSetLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004472 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004473 VkDescriptorSetLayout descriptorSetLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004474 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004475 deviceObject := GetDevice(device)
4476 descriptorSetLayoutObject := GetDescriptorSetLayout(descriptorSetLayout)
4477 assert(descriptorSetLayoutObject.device == device)
4478
4479 State.DescriptorSetLayouts[descriptorSetLayout] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004480}
4481
4482@threadSafety("system")
4483cmd VkResult vkCreateDescriptorPool(
4484 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004485 const VkDescriptorPoolCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004486 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004487 VkDescriptorPool* pDescriptorPool) {
4488 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO)
4489 deviceObject := GetDevice(device)
4490
4491 descriptorPool := ?
4492 pDescriptorPool[0] = descriptorPool
4493 State.DescriptorPools[descriptorPool] = new!DescriptorPoolObject(device: device)
4494
4495 return ?
4496}
4497
4498@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004499cmd void vkDestroyDescriptorPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004500 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004501 VkDescriptorPool descriptorPool,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004502 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004503 deviceObject := GetDevice(device)
4504 descriptorPoolObject := GetDescriptorPool(descriptorPool)
4505 assert(descriptorPoolObject.device == device)
4506
4507 State.DescriptorPools[descriptorPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004508}
4509
4510@threadSafety("app")
4511cmd VkResult vkResetDescriptorPool(
4512 VkDevice device,
Jesse Hallfbf97b02015-11-20 14:17:03 -08004513 VkDescriptorPool descriptorPool,
4514 VkDescriptorPoolResetFlags flags) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004515 deviceObject := GetDevice(device)
4516 descriptorPoolObject := GetDescriptorPool(descriptorPool)
4517 assert(descriptorPoolObject.device == device)
4518
4519 return ?
4520}
4521
4522@threadSafety("app")
Jesse Hall3fbc8562015-11-29 22:10:52 -08004523cmd VkResult vkAllocateDescriptorSets(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004524 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004525 const VkDescriptorSetAllocateInfo* pAllocateInfo,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004526 VkDescriptorSet* pDescriptorSets) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004527 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004528 allocInfo := pAllocateInfo[0]
Jesse Hallfbf97b02015-11-20 14:17:03 -08004529 descriptorPoolObject := GetDescriptorPool(allocInfo.descriptorPool)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004530
Jesse Hall03b6fe12015-11-24 12:44:21 -08004531 setLayouts := allocInfo.pSetLayouts[0:allocInfo.setCount]
4532 for i in (0 .. allocInfo.setCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004533 setLayout := setLayouts[i]
4534 setLayoutObject := GetDescriptorSetLayout(setLayout)
4535 assert(setLayoutObject.device == device)
4536 }
4537
Jesse Hall03b6fe12015-11-24 12:44:21 -08004538 descriptorSets := pDescriptorSets[0:allocInfo.setCount]
4539 for i in (0 .. allocInfo.setCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004540 descriptorSet := ?
4541 descriptorSets[i] = descriptorSet
4542 State.DescriptorSets[descriptorSet] = new!DescriptorSetObject(device: device)
4543 }
4544
4545 return ?
4546}
4547
Jesse Hallf09c6b12015-08-15 19:54:28 -07004548cmd VkResult vkFreeDescriptorSets(
4549 VkDevice device,
4550 VkDescriptorPool descriptorPool,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004551 u32 descriptorSetCount,
Jesse Hallf09c6b12015-08-15 19:54:28 -07004552 const VkDescriptorSet* pDescriptorSets) {
4553 deviceObject := GetDevice(device)
4554 descriptorPoolObject := GetDescriptorPool(descriptorPool)
4555
Jesse Hall03b6fe12015-11-24 12:44:21 -08004556 descriptorSets := pDescriptorSets[0:descriptorSetCount]
4557 for i in (0 .. descriptorSetCount) {
Jesse Hallf09c6b12015-08-15 19:54:28 -07004558 descriptorSet := descriptorSets[i]
4559 descriptorSetObject := GetDescriptorSet(descriptorSet)
4560 assert(descriptorSetObject.device == device)
4561 State.DescriptorSets[descriptorSet] = null
4562 }
4563
4564 return ?
4565}
4566
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004567cmd void vkUpdateDescriptorSets(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004568 VkDevice device,
Jesse Hallb00daad2015-11-29 19:46:20 -08004569 u32 descriptorWriteCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004570 const VkWriteDescriptorSet* pDescriptorWrites,
Jesse Hallb00daad2015-11-29 19:46:20 -08004571 u32 descriptorCopyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004572 const VkCopyDescriptorSet* pDescriptorCopies) {
4573 deviceObject := GetDevice(device)
4574
Jesse Hallb00daad2015-11-29 19:46:20 -08004575 descriptorWrites := pDescriptorWrites[0:descriptorWriteCount]
4576 for i in (0 .. descriptorWriteCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004577 descriptorWrite := descriptorWrites[i]
Jesse Hall3fbc8562015-11-29 22:10:52 -08004578 descriptorWriteObject := GetDescriptorSet(descriptorWrite.dstSet)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004579 assert(descriptorWriteObject.device == device)
4580 }
4581
Jesse Hallb00daad2015-11-29 19:46:20 -08004582 descriptorCopies := pDescriptorCopies[0:descriptorCopyCount]
4583 for i in (0 .. descriptorCopyCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004584 descriptorCopy := descriptorCopies[i]
Jesse Hall3fbc8562015-11-29 22:10:52 -08004585 descriptorCopyObject := GetDescriptorSet(descriptorCopy.dstSet)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004586 assert(descriptorCopyObject.device == device)
4587 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07004588}
4589
4590
4591// Framebuffer functions
4592
4593@threadSafety("system")
4594cmd VkResult vkCreateFramebuffer(
4595 VkDevice device,
4596 const VkFramebufferCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004597 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004598 VkFramebuffer* pFramebuffer) {
4599 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO)
4600 deviceObject := GetDevice(device)
4601
4602 framebuffer := ?
4603 pFramebuffer[0] = framebuffer
4604 State.Framebuffers[framebuffer] = new!FramebufferObject(device: device)
4605
4606 return ?
4607}
4608
4609@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004610cmd void vkDestroyFramebuffer(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004611 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004612 VkFramebuffer framebuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004613 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004614 deviceObject := GetDevice(device)
4615 framebufferObject := GetFramebuffer(framebuffer)
4616 assert(framebufferObject.device == device)
4617
4618 State.Framebuffers[framebuffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004619}
4620
4621
4622// Renderpass functions
4623
4624@threadSafety("system")
4625cmd VkResult vkCreateRenderPass(
4626 VkDevice device,
4627 const VkRenderPassCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004628 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004629 VkRenderPass* pRenderPass) {
4630 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO)
4631 deviceObject := GetDevice(device)
4632
4633 renderpass := ?
4634 pRenderPass[0] = renderpass
4635 State.RenderPasses[renderpass] = new!RenderPassObject(device: device)
4636
4637 return ?
4638}
4639
4640@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004641cmd void vkDestroyRenderPass(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004642 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004643 VkRenderPass renderPass,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004644 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004645 deviceObject := GetDevice(device)
4646 renderPassObject := GetRenderPass(renderPass)
4647 assert(renderPassObject.device == device)
4648
4649 State.RenderPasses[renderPass] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004650}
4651
Jesse Hall606a54e2015-11-19 22:17:28 -08004652cmd void vkGetRenderAreaGranularity(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004653 VkDevice device,
4654 VkRenderPass renderPass,
4655 VkExtent2D* pGranularity) {
4656 deviceObject := GetDevice(device)
4657 renderPassObject := GetRenderPass(renderPass)
4658
4659 granularity := ?
4660 pGranularity[0] = granularity
Jesse Halld27f6aa2015-08-15 17:58:48 -07004661}
4662
4663// Command pool functions
4664
4665cmd VkResult vkCreateCommandPool(
4666 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004667 const VkCommandPoolCreateInfo* pCreateInfo,
4668 const VkAllocationCallbacks* pAllocator,
4669 VkCommandPool* pCommandPool) {
4670 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004671 deviceObject := GetDevice(device)
4672
Jesse Hall3fbc8562015-11-29 22:10:52 -08004673 commandPool := ?
4674 pCommandPool[0] = commandPool
4675 State.CommandPools[commandPool] = new!CommandPoolObject(device: device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004676
4677 return ?
4678}
4679
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004680cmd void vkDestroyCommandPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004681 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004682 VkCommandPool commandPool,
4683 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004684 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004685 commandPoolObject := GetCommandPool(commandPool)
4686 assert(commandPoolObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004687
Jesse Hall3fbc8562015-11-29 22:10:52 -08004688 State.CommandPools[commandPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004689}
4690
4691cmd VkResult vkResetCommandPool(
4692 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004693 VkCommandPool commandPool,
4694 VkCommandPoolResetFlags flags) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004695 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004696 commandPoolObject := GetCommandPool(commandPool)
4697 assert(commandPoolObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004698
4699 return ?
4700}
4701
4702// Command buffer functions
4703
Jesse Hall3fbc8562015-11-29 22:10:52 -08004704macro void bindCommandBuffer(VkCommandBuffer commandBuffer, any obj, VkDeviceMemory memory) {
4705 memoryObject := GetDeviceMemory(memory)
4706 memoryObject.boundCommandBuffers[commandBuffer] = commandBuffer
Jesse Halld27f6aa2015-08-15 17:58:48 -07004707
Jesse Hall3fbc8562015-11-29 22:10:52 -08004708 commandBufferObject := GetCommandBuffer(commandBuffer)
4709 commandBufferObject.boundObjects[as!u64(obj)] = memory
Jesse Halld27f6aa2015-08-15 17:58:48 -07004710}
4711
Jesse Hall3fbc8562015-11-29 22:10:52 -08004712macro void unbindCommandBuffer(VkCommandBuffer commandBuffer, any obj, VkDeviceMemory memory) {
4713 memoryObject := GetDeviceMemory(memory)
4714 memoryObject.boundCommandBuffers[commandBuffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004715
Jesse Hall3fbc8562015-11-29 22:10:52 -08004716 commandBufferObject := GetCommandBuffer(commandBuffer)
4717 commandBufferObject.boundObjects[as!u64(obj)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004718}
4719
4720@threadSafety("system")
Jesse Hall3fbc8562015-11-29 22:10:52 -08004721cmd VkResult vkAllocateCommandBuffers(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004722 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004723 const VkCommandBufferAllocateInfo* pAllocateInfo,
4724 VkCommandBuffer* pCommandBuffers) {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08004725 assert(pAllocateInfo[0].sType == VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004726
Jesse Hall3dd678a2016-01-08 21:52:01 -08004727 count := pAllocateInfo[0].commandBufferCount
Jesse Hall3fbc8562015-11-29 22:10:52 -08004728 commandBuffers := pCommandBuffers[0:count]
Jesse Hallfbf97b02015-11-20 14:17:03 -08004729 for i in (0 .. count) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004730 commandBuffer := ?
4731 commandBuffers[i] = commandBuffer
4732 State.CommandBuffers[commandBuffer] = new!CommandBufferObject(device: device)
Jesse Hallfbf97b02015-11-20 14:17:03 -08004733 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07004734
4735 return ?
4736}
4737
4738@threadSafety("system")
Jesse Hallfbf97b02015-11-20 14:17:03 -08004739cmd void vkFreeCommandBuffers(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004740 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004741 VkCommandPool commandPool,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004742 u32 commandBufferCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004743 const VkCommandBuffer* pCommandBuffers) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004744 deviceObject := GetDevice(device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004745
Jesse Hall3fbc8562015-11-29 22:10:52 -08004746 commandBuffers := pCommandBuffers[0:commandBufferCount]
Jesse Hall03b6fe12015-11-24 12:44:21 -08004747 for i in (0 .. commandBufferCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004748 commandBufferObject := GetCommandBuffer(commandBuffers[i])
4749 assert(commandBufferObject.device == device)
Jesse Hallfbf97b02015-11-20 14:17:03 -08004750 // TODO: iterate over boundObjects and clear memory bindings
Jesse Hall3fbc8562015-11-29 22:10:52 -08004751 State.CommandBuffers[commandBuffers[i]] = null
Jesse Hallfbf97b02015-11-20 14:17:03 -08004752 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07004753}
4754
4755@threadSafety("app")
4756cmd VkResult vkBeginCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004757 VkCommandBuffer commandBuffer,
4758 const VkCommandBufferBeginInfo* pBeginInfo) {
4759 assert(pBeginInfo.sType == VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO)
4760 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004761
4762 // TODO: iterate over boundObjects and clear memory bindings
4763
4764 return ?
4765}
4766
4767@threadSafety("app")
4768cmd VkResult vkEndCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004769 VkCommandBuffer commandBuffer) {
4770 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004771
4772 return ?
4773}
4774
4775@threadSafety("app")
4776cmd VkResult vkResetCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004777 VkCommandBuffer commandBuffer,
4778 VkCommandBufferResetFlags flags) {
4779 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004780
4781 // TODO: iterate over boundObjects and clear memory bindings
4782
4783 return ?
4784}
4785
4786
4787// Command buffer building functions
4788
4789@threadSafety("app")
4790cmd void vkCmdBindPipeline(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004791 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004792 VkPipelineBindPoint pipelineBindPoint,
4793 VkPipeline pipeline) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004794 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004795 pipelineObject := GetPipeline(pipeline)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004796 assert(commandBufferObject.device == pipelineObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004797
Jesse Halld8bade02015-11-24 10:24:18 -08004798 queue := switch (pipelineBindPoint) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004799 case VK_PIPELINE_BIND_POINT_COMPUTE: VK_QUEUE_COMPUTE_BIT
4800 case VK_PIPELINE_BIND_POINT_GRAPHICS: VK_QUEUE_GRAPHICS_BIT
4801 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08004802 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004803}
4804
4805@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004806cmd void vkCmdSetViewport(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004807 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004808 u32 firstViewport,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004809 u32 viewportCount,
4810 const VkViewport* pViewports) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004811 commandBufferObject := GetCommandBuffer(commandBuffer)
4812 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004813}
4814
4815@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004816cmd void vkCmdSetScissor(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004817 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004818 u32 firstScissor,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004819 u32 scissorCount,
4820 const VkRect2D* pScissors) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004821 commandBufferObject := GetCommandBuffer(commandBuffer)
4822 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004823}
4824
4825@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004826cmd void vkCmdSetLineWidth(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004827 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004828 f32 lineWidth) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004829 commandBufferObject := GetCommandBuffer(commandBuffer)
4830 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004831}
4832
4833@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004834cmd void vkCmdSetDepthBias(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004835 VkCommandBuffer commandBuffer,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004836 f32 depthBiasConstantFactor,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004837 f32 depthBiasClamp,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004838 f32 depthBiasSlopeFactor) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004839 commandBufferObject := GetCommandBuffer(commandBuffer)
4840 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004841}
Jesse Halld27f6aa2015-08-15 17:58:48 -07004842
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004843@threadSafety("app")
4844cmd void vkCmdSetBlendConstants(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004845 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004846 // TODO(jessehall): apic only supports 'const' on pointer types. Using
4847 // an annotation as a quick hack to pass this to the template without
4848 // having to modify the AST and semantic model.
Jesse Hallb00daad2015-11-29 19:46:20 -08004849 @readonly f32[4] blendConstants) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004850 commandBufferObject := GetCommandBuffer(commandBuffer)
4851 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004852}
4853
4854@threadSafety("app")
4855cmd void vkCmdSetDepthBounds(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004856 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004857 f32 minDepthBounds,
4858 f32 maxDepthBounds) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004859 commandBufferObject := GetCommandBuffer(commandBuffer)
4860 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004861}
4862
4863@threadSafety("app")
4864cmd void vkCmdSetStencilCompareMask(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004865 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004866 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08004867 u32 compareMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004868 commandBufferObject := GetCommandBuffer(commandBuffer)
4869 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004870}
4871
4872@threadSafety("app")
4873cmd void vkCmdSetStencilWriteMask(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004874 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004875 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08004876 u32 writeMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004877 commandBufferObject := GetCommandBuffer(commandBuffer)
4878 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004879}
4880
4881@threadSafety("app")
4882cmd void vkCmdSetStencilReference(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004883 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004884 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08004885 u32 reference) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004886 commandBufferObject := GetCommandBuffer(commandBuffer)
4887 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004888}
4889
4890@threadSafety("app")
4891cmd void vkCmdBindDescriptorSets(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004892 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004893 VkPipelineBindPoint pipelineBindPoint,
4894 VkPipelineLayout layout,
4895 u32 firstSet,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004896 u32 descriptorSetCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004897 const VkDescriptorSet* pDescriptorSets,
4898 u32 dynamicOffsetCount,
4899 const u32* pDynamicOffsets) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004900 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004901
Jesse Hall03b6fe12015-11-24 12:44:21 -08004902 descriptorSets := pDescriptorSets[0:descriptorSetCount]
4903 for i in (0 .. descriptorSetCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004904 descriptorSet := descriptorSets[i]
4905 descriptorSetObject := GetDescriptorSet(descriptorSet)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004906 assert(commandBufferObject.device == descriptorSetObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004907 }
4908
4909 dynamicOffsets := pDynamicOffsets[0:dynamicOffsetCount]
4910 for i in (0 .. dynamicOffsetCount) {
4911 dynamicOffset := dynamicOffsets[i]
4912 }
4913
Jesse Halld8bade02015-11-24 10:24:18 -08004914 queue := switch (pipelineBindPoint) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004915 case VK_PIPELINE_BIND_POINT_COMPUTE: VK_QUEUE_COMPUTE_BIT
4916 case VK_PIPELINE_BIND_POINT_GRAPHICS: VK_QUEUE_GRAPHICS_BIT
4917 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08004918 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004919}
4920
4921@threadSafety("app")
4922cmd void vkCmdBindIndexBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004923 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004924 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004925 VkDeviceSize offset,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004926 VkIndexType indexType) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004927 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004928 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004929 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004930
Jesse Hall3fbc8562015-11-29 22:10:52 -08004931 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004932
Jesse Hall3fbc8562015-11-29 22:10:52 -08004933 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004934}
4935
4936@threadSafety("app")
4937cmd void vkCmdBindVertexBuffers(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004938 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004939 u32 firstBinding,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004940 u32 bindingCount,
4941 const VkBuffer* pBuffers,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004942 const VkDeviceSize* pOffsets) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004943 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004944
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004945 // TODO: check if not [firstBinding:firstBinding+bindingCount]
Jesse Halld27f6aa2015-08-15 17:58:48 -07004946 buffers := pBuffers[0:bindingCount]
4947 offsets := pOffsets[0:bindingCount]
4948 for i in (0 .. bindingCount) {
4949 buffer := buffers[i]
4950 offset := offsets[i]
4951 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004952 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004953
Jesse Hall3fbc8562015-11-29 22:10:52 -08004954 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004955 }
4956
Jesse Hall3fbc8562015-11-29 22:10:52 -08004957 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004958}
4959
4960@threadSafety("app")
4961cmd void vkCmdDraw(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004962 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004963 u32 vertexCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004964 u32 instanceCount,
4965 u32 firstVertex,
4966 u32 firstInstance) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004967 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004968
Jesse Hall3fbc8562015-11-29 22:10:52 -08004969 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004970}
4971
4972@threadSafety("app")
4973cmd void vkCmdDrawIndexed(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004974 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004975 u32 indexCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004976 u32 instanceCount,
4977 u32 firstIndex,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004978 s32 vertexOffset,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004979 u32 firstInstance) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004980 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004981
Jesse Hall3fbc8562015-11-29 22:10:52 -08004982 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004983}
4984
4985@threadSafety("app")
4986cmd void vkCmdDrawIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004987 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004988 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004989 VkDeviceSize offset,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004990 u32 drawCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004991 u32 stride) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004992 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004993 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004994 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004995
Jesse Hall3fbc8562015-11-29 22:10:52 -08004996 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
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 vkCmdDrawIndexedIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005003 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005004 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005005 VkDeviceSize offset,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005006 u32 drawCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005007 u32 stride) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005008 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005009 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005010 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005011
Jesse Hall3fbc8562015-11-29 22:10:52 -08005012 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005013
Jesse Hall3fbc8562015-11-29 22:10:52 -08005014 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005015}
5016
5017@threadSafety("app")
5018cmd void vkCmdDispatch(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005019 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005020 u32 x,
5021 u32 y,
5022 u32 z) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005023 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005024
Jesse Hall3fbc8562015-11-29 22:10:52 -08005025 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_COMPUTE_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005026}
5027
5028@threadSafety("app")
5029cmd void vkCmdDispatchIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005030 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005031 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005032 VkDeviceSize offset) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005033 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005034 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005035 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005036
Jesse Hall3fbc8562015-11-29 22:10:52 -08005037 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005038
Jesse Hall3fbc8562015-11-29 22:10:52 -08005039 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_COMPUTE_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005040}
5041
5042@threadSafety("app")
5043cmd void vkCmdCopyBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005044 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005045 VkBuffer srcBuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005046 VkBuffer dstBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005047 u32 regionCount,
5048 const VkBufferCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005049 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005050 srcBufferObject := GetBuffer(srcBuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005051 dstBufferObject := GetBuffer(dstBuffer)
5052 assert(commandBufferObject.device == srcBufferObject.device)
5053 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005054
5055 regions := pRegions[0:regionCount]
5056 for i in (0 .. regionCount) {
5057 region := regions[i]
5058 }
5059
Jesse Hall3fbc8562015-11-29 22:10:52 -08005060 bindCommandBuffer(commandBuffer, srcBuffer, srcBufferObject.memory)
5061 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005062
Jesse Hall65ab5522015-11-30 00:07:16 -08005063 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005064}
5065
5066@threadSafety("app")
5067cmd void vkCmdCopyImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005068 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005069 VkImage srcImage,
5070 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005071 VkImage dstImage,
5072 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005073 u32 regionCount,
5074 const VkImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005075 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005076 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005077 dstImageObject := GetImage(dstImage)
5078 assert(commandBufferObject.device == srcImageObject.device)
5079 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005080
5081 regions := pRegions[0:regionCount]
5082 for i in (0 .. regionCount) {
5083 region := regions[i]
5084 }
5085
Jesse Hall3fbc8562015-11-29 22:10:52 -08005086 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
5087 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005088
Jesse Hall65ab5522015-11-30 00:07:16 -08005089 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005090}
5091
5092@threadSafety("app")
5093cmd void vkCmdBlitImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005094 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005095 VkImage srcImage,
5096 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005097 VkImage dstImage,
5098 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005099 u32 regionCount,
5100 const VkImageBlit* pRegions,
Jesse Hall23ff73f2015-11-29 14:36:39 -08005101 VkFilter filter) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005102 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005103 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005104 dstImageObject := GetImage(dstImage)
5105 assert(commandBufferObject.device == srcImageObject.device)
5106 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005107
5108 regions := pRegions[0:regionCount]
5109 for i in (0 .. regionCount) {
5110 region := regions[i]
5111 }
5112
Jesse Hall3fbc8562015-11-29 22:10:52 -08005113 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
5114 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005115
Jesse Hall3fbc8562015-11-29 22:10:52 -08005116 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005117}
5118
5119@threadSafety("app")
5120cmd void vkCmdCopyBufferToImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005121 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005122 VkBuffer srcBuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005123 VkImage dstImage,
5124 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005125 u32 regionCount,
5126 const VkBufferImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005127 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005128 srcBufferObject := GetBuffer(srcBuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005129 dstImageObject := GetImage(dstImage)
5130 assert(commandBufferObject.device == srcBufferObject.device)
5131 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005132
5133 regions := pRegions[0:regionCount]
5134 for i in (0 .. regionCount) {
5135 region := regions[i]
5136 }
5137
Jesse Hall3fbc8562015-11-29 22:10:52 -08005138 bindCommandBuffer(commandBuffer, srcBuffer, srcBufferObject.memory)
5139 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005140
Jesse Hall65ab5522015-11-30 00:07:16 -08005141 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005142}
5143
5144@threadSafety("app")
5145cmd void vkCmdCopyImageToBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005146 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005147 VkImage srcImage,
5148 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005149 VkBuffer dstBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005150 u32 regionCount,
5151 const VkBufferImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005152 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005153 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005154 dstBufferObject := GetBuffer(dstBuffer)
5155 assert(commandBufferObject.device == srcImageObject.device)
5156 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005157
5158 regions := pRegions[0:regionCount]
5159 for i in (0 .. regionCount) {
5160 region := regions[i]
5161 }
5162
Jesse Hall3fbc8562015-11-29 22:10:52 -08005163 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
5164 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005165
Jesse Hall65ab5522015-11-30 00:07:16 -08005166 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005167}
5168
5169@threadSafety("app")
5170cmd void vkCmdUpdateBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005171 VkCommandBuffer commandBuffer,
5172 VkBuffer dstBuffer,
5173 VkDeviceSize dstOffset,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005174 VkDeviceSize dataSize,
Jesse Hall56d386a2016-07-26 15:20:40 -07005175 const void* pData) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005176 commandBufferObject := GetCommandBuffer(commandBuffer)
5177 dstBufferObject := GetBuffer(dstBuffer)
5178 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005179
5180 data := pData[0:dataSize]
5181
Jesse Hall3fbc8562015-11-29 22:10:52 -08005182 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005183
Jesse Hall65ab5522015-11-30 00:07:16 -08005184 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005185}
5186
5187@threadSafety("app")
5188cmd void vkCmdFillBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005189 VkCommandBuffer commandBuffer,
5190 VkBuffer dstBuffer,
5191 VkDeviceSize dstOffset,
Jesse Hallb00daad2015-11-29 19:46:20 -08005192 VkDeviceSize size,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005193 u32 data) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005194 commandBufferObject := GetCommandBuffer(commandBuffer)
5195 dstBufferObject := GetBuffer(dstBuffer)
5196 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005197
Jesse Hall65ab5522015-11-30 00:07:16 -08005198 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005199}
5200
5201@threadSafety("app")
5202cmd void vkCmdClearColorImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005203 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005204 VkImage image,
5205 VkImageLayout imageLayout,
5206 const VkClearColorValue* pColor,
5207 u32 rangeCount,
5208 const VkImageSubresourceRange* pRanges) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005209 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005210 imageObject := GetImage(image)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005211 assert(commandBufferObject.device == imageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005212
5213 ranges := pRanges[0:rangeCount]
5214 for i in (0 .. rangeCount) {
5215 range := ranges[i]
5216 }
5217
Jesse Hall3fbc8562015-11-29 22:10:52 -08005218 bindCommandBuffer(commandBuffer, image, imageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005219
Jesse Hall3fbc8562015-11-29 22:10:52 -08005220 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005221}
5222
5223@threadSafety("app")
5224cmd void vkCmdClearDepthStencilImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005225 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005226 VkImage image,
5227 VkImageLayout imageLayout,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005228 const VkClearDepthStencilValue* pDepthStencil,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005229 u32 rangeCount,
5230 const VkImageSubresourceRange* pRanges) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005231 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005232 imageObject := GetImage(image)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005233 assert(commandBufferObject.device == imageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005234
5235 ranges := pRanges[0:rangeCount]
5236 for i in (0 .. rangeCount) {
5237 range := ranges[i]
5238 }
5239
Jesse Hall3fbc8562015-11-29 22:10:52 -08005240 bindCommandBuffer(commandBuffer, image, imageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005241
Jesse Hall3fbc8562015-11-29 22:10:52 -08005242 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005243}
5244
5245@threadSafety("app")
Jesse Hallae38f732015-11-19 21:32:50 -08005246cmd void vkCmdClearAttachments(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005247 VkCommandBuffer commandBuffer,
Jesse Hallae38f732015-11-19 21:32:50 -08005248 u32 attachmentCount,
5249 const VkClearAttachment* pAttachments,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005250 u32 rectCount,
Jesse Halla15a4bf2015-11-19 22:48:02 -08005251 const VkClearRect* pRects) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005252 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005253
5254 rects := pRects[0:rectCount]
5255 for i in (0 .. rectCount) {
5256 rect := rects[i]
5257 }
5258
Jesse Hall3fbc8562015-11-29 22:10:52 -08005259 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005260}
5261
5262@threadSafety("app")
5263cmd void vkCmdResolveImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005264 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005265 VkImage srcImage,
5266 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005267 VkImage dstImage,
5268 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005269 u32 regionCount,
5270 const VkImageResolve* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005271 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005272 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005273 dstImageObject := GetImage(dstImage)
5274 assert(commandBufferObject.device == srcImageObject.device)
5275 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005276
5277 regions := pRegions[0:regionCount]
5278 for i in (0 .. regionCount) {
5279 region := regions[i]
5280 }
5281
Jesse Hall3fbc8562015-11-29 22:10:52 -08005282 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
5283 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005284
Jesse Hall3fbc8562015-11-29 22:10:52 -08005285 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005286}
5287
5288@threadSafety("app")
5289cmd void vkCmdSetEvent(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005290 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005291 VkEvent event,
5292 VkPipelineStageFlags stageMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005293 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005294 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005295 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005296}
5297
5298@threadSafety("app")
5299cmd void vkCmdResetEvent(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005300 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005301 VkEvent event,
5302 VkPipelineStageFlags stageMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005303 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005304 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005305 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005306}
5307
5308@threadSafety("app")
5309cmd void vkCmdWaitEvents(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005310 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005311 u32 eventCount,
5312 const VkEvent* pEvents,
5313 VkPipelineStageFlags srcStageMask,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005314 VkPipelineStageFlags dstStageMask,
5315 u32 memoryBarrierCount,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005316 const VkMemoryBarrier* pMemoryBarriers,
5317 u32 bufferMemoryBarrierCount,
5318 const VkBufferMemoryBarrier* pBufferMemoryBarriers,
5319 u32 imageMemoryBarrierCount,
5320 const VkImageMemoryBarrier* pImageMemoryBarriers) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005321 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005322
5323 events := pEvents[0:eventCount]
5324 for i in (0 .. eventCount) {
5325 event := events[i]
5326 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005327 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005328 }
5329
Jesse Hall3dd678a2016-01-08 21:52:01 -08005330 memoryBarriers := pMemoryBarriers[0:memoryBarrierCount]
Jesse Hall3fbc8562015-11-29 22:10:52 -08005331 for i in (0 .. memoryBarrierCount) {
Jesse Hall3dd678a2016-01-08 21:52:01 -08005332 memoryBarrier := memoryBarriers[i]
5333 }
5334 bufferMemoryBarriers := pBufferMemoryBarriers[0:bufferMemoryBarrierCount]
5335 for i in (0 .. bufferMemoryBarrierCount) {
5336 bufferMemoryBarrier := bufferMemoryBarriers[i]
5337 bufferObject := GetBuffer(bufferMemoryBarrier.buffer)
5338 assert(bufferObject.device == commandBufferObject.device)
5339 }
5340 imageMemoryBarriers := pImageMemoryBarriers[0:imageMemoryBarrierCount]
5341 for i in (0 .. imageMemoryBarrierCount) {
5342 imageMemoryBarrier := imageMemoryBarriers[i]
5343 imageObject := GetImage(imageMemoryBarrier.image)
5344 assert(imageObject.device == commandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005345 }
5346}
5347
5348@threadSafety("app")
5349cmd void vkCmdPipelineBarrier(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005350 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005351 VkPipelineStageFlags srcStageMask,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005352 VkPipelineStageFlags dstStageMask,
Jesse Halldc6d36c2015-11-29 19:12:15 -08005353 VkDependencyFlags dependencyFlags,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005354 u32 memoryBarrierCount,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005355 const VkMemoryBarrier* pMemoryBarriers,
5356 u32 bufferMemoryBarrierCount,
5357 const VkBufferMemoryBarrier* pBufferMemoryBarriers,
5358 u32 imageMemoryBarrierCount,
5359 const VkImageMemoryBarrier* pImageMemoryBarriers) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005360 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005361
Jesse Hall3dd678a2016-01-08 21:52:01 -08005362 memoryBarriers := pMemoryBarriers[0:memoryBarrierCount]
Jesse Hall3fbc8562015-11-29 22:10:52 -08005363 for i in (0 .. memoryBarrierCount) {
Jesse Hall3dd678a2016-01-08 21:52:01 -08005364 memoryBarrier := memoryBarriers[i]
5365 }
5366 bufferMemoryBarriers := pBufferMemoryBarriers[0:bufferMemoryBarrierCount]
5367 for i in (0 .. bufferMemoryBarrierCount) {
5368 bufferMemoryBarrier := bufferMemoryBarriers[i]
5369 bufferObject := GetBuffer(bufferMemoryBarrier.buffer)
5370 assert(bufferObject.device == commandBufferObject.device)
5371 }
5372 imageMemoryBarriers := pImageMemoryBarriers[0:imageMemoryBarrierCount]
5373 for i in (0 .. imageMemoryBarrierCount) {
5374 imageMemoryBarrier := imageMemoryBarriers[i]
5375 imageObject := GetImage(imageMemoryBarrier.image)
5376 assert(imageObject.device == commandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005377 }
5378}
5379
5380@threadSafety("app")
5381cmd void vkCmdBeginQuery(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005382 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005383 VkQueryPool queryPool,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005384 u32 query,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005385 VkQueryControlFlags flags) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005386 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005387 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005388 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005389}
5390
5391@threadSafety("app")
5392cmd void vkCmdEndQuery(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005393 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005394 VkQueryPool queryPool,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005395 u32 query) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005396 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005397 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005398 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005399}
5400
5401@threadSafety("app")
5402cmd void vkCmdResetQueryPool(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005403 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005404 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005405 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005406 u32 queryCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005407 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005408 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005409 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005410}
5411
5412@threadSafety("app")
5413cmd void vkCmdWriteTimestamp(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005414 VkCommandBuffer commandBuffer,
Jesse Hall6f39a6d2015-11-24 11:08:36 -08005415 VkPipelineStageFlagBits pipelineStage,
Jesse Halla3a7a1d2015-11-24 11:37:23 -08005416 VkQueryPool queryPool,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005417 u32 query) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005418 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halla3a7a1d2015-11-24 11:37:23 -08005419 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005420 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005421}
5422
5423@threadSafety("app")
5424cmd void vkCmdCopyQueryPoolResults(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005425 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005426 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005427 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005428 u32 queryCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005429 VkBuffer dstBuffer,
5430 VkDeviceSize dstOffset,
Jesse Halla9bb62b2015-11-21 19:31:56 -08005431 VkDeviceSize stride,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005432 VkQueryResultFlags flags) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005433 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005434 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005435 dstBufferObject := GetBuffer(dstBuffer)
5436 assert(commandBufferObject.device == queryPoolObject.device)
5437 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005438}
5439
5440cmd void vkCmdPushConstants(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005441 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005442 VkPipelineLayout layout,
5443 VkShaderStageFlags stageFlags,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005444 u32 offset,
5445 u32 size,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08005446 const void* pValues) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005447 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005448 layoutObject := GetPipelineLayout(layout)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005449 assert(commandBufferObject.device == layoutObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005450}
5451
5452@threadSafety("app")
5453cmd void vkCmdBeginRenderPass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005454 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005455 const VkRenderPassBeginInfo* pRenderPassBegin,
Jesse Hall65ab5522015-11-30 00:07:16 -08005456 VkSubpassContents contents) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005457 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005458 renderPassObject := GetRenderPass(pRenderPassBegin.renderPass)
5459 framebufferObject := GetFramebuffer(pRenderPassBegin.framebuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005460 assert(commandBufferObject.device == renderPassObject.device)
5461 assert(commandBufferObject.device == framebufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005462
Jesse Hall3fbc8562015-11-29 22:10:52 -08005463 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005464}
5465
5466cmd void vkCmdNextSubpass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005467 VkCommandBuffer commandBuffer,
Jesse Hall65ab5522015-11-30 00:07:16 -08005468 VkSubpassContents contents) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005469 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005470}
5471
5472@threadSafety("app")
5473cmd void vkCmdEndRenderPass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005474 VkCommandBuffer commandBuffer) {
5475 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005476
Jesse Hall3fbc8562015-11-29 22:10:52 -08005477 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005478}
5479
5480cmd void vkCmdExecuteCommands(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005481 VkCommandBuffer commandBuffer,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005482 u32 commandBufferCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005483 const VkCommandBuffer* pCommandBuffers) {
5484 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005485
Jesse Hall3dd678a2016-01-08 21:52:01 -08005486 commandBuffers := pCommandBuffers[0:commandBufferCount]
5487 for i in (0 .. commandBufferCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005488 secondaryCommandBuffer := commandBuffers[i]
5489 secondaryCommandBufferObject := GetCommandBuffer(secondaryCommandBuffer)
5490 assert(commandBufferObject.device == secondaryCommandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005491 }
5492}
5493
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005494@extension("VK_KHR_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005495cmd void vkDestroySurfaceKHR(
5496 VkInstance instance,
Jesse Hall0e74f002015-11-30 11:37:59 -08005497 VkSurfaceKHR surface,
5498 const VkAllocationCallbacks* pAllocator) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005499 instanceObject := GetInstance(instance)
5500 surfaceObject := GetSurface(surface)
5501 assert(surfaceObject.instance == instance)
Michael Lentine88594d72015-11-12 12:49:45 -08005502
Jesse Hall1356b0d2015-11-23 17:24:58 -08005503 State.Surfaces[surface] = null
Jesse Hall2818f932015-11-19 21:19:17 -08005504}
5505
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005506@extension("VK_KHR_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005507cmd VkResult vkGetPhysicalDeviceSurfaceSupportKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005508 VkPhysicalDevice physicalDevice,
5509 u32 queueFamilyIndex,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005510 VkSurfaceKHR surface,
Jesse Hallb00daad2015-11-29 19:46:20 -08005511 VkBool32* pSupported) {
5512 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08005513
5514 return ?
5515}
5516
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005517@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08005518cmd VkResult vkGetPhysicalDeviceSurfaceCapabilitiesKHR(
5519 VkPhysicalDevice physicalDevice,
5520 VkSurfaceKHR surface,
5521 VkSurfaceCapabilitiesKHR* pSurfaceCapabilities) {
5522 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5523
5524 surfaceCapabilities := ?
5525 pSurfaceCapabilities[0] = surfaceCapabilities
5526
5527 return ?
5528}
5529
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005530@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08005531cmd VkResult vkGetPhysicalDeviceSurfaceFormatsKHR(
5532 VkPhysicalDevice physicalDevice,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005533 VkSurfaceKHR surface,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005534 u32* pSurfaceFormatCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005535 VkSurfaceFormatKHR* pSurfaceFormats) {
Jesse Hallb00daad2015-11-29 19:46:20 -08005536 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08005537
5538 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08005539 pSurfaceFormatCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08005540 surfaceFormats := pSurfaceFormats[0:count]
5541
5542 for i in (0 .. count) {
5543 surfaceFormat := ?
5544 surfaceFormats[i] = surfaceFormat
5545 }
5546
5547 return ?
5548}
5549
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005550@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08005551cmd VkResult vkGetPhysicalDeviceSurfacePresentModesKHR(
5552 VkPhysicalDevice physicalDevice,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005553 VkSurfaceKHR surface,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005554 u32* pPresentModeCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005555 VkPresentModeKHR* pPresentModes) {
Jesse Hallb00daad2015-11-29 19:46:20 -08005556 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08005557
5558 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08005559 pPresentModeCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08005560 presentModes := pPresentModes[0:count]
5561
5562 for i in (0 .. count) {
5563 presentMode := ?
5564 presentModes[i] = presentMode
5565 }
5566
5567 return ?
5568}
5569
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005570@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005571cmd VkResult vkCreateSwapchainKHR(
5572 VkDevice device,
5573 const VkSwapchainCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005574 const VkAllocationCallbacks* pAllocator,
Michael Lentine88594d72015-11-12 12:49:45 -08005575 VkSwapchainKHR* pSwapchain) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005576 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR)
Michael Lentine88594d72015-11-12 12:49:45 -08005577 deviceObject := GetDevice(device)
5578
5579 swapchain := ?
5580 pSwapchain[0] = swapchain
5581 State.Swapchains[swapchain] = new!SwapchainObject(device: device)
5582
5583 return ?
5584}
5585
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005586@extension("VK_KHR_swapchain")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005587cmd void vkDestroySwapchainKHR(
Michael Lentine88594d72015-11-12 12:49:45 -08005588 VkDevice device,
Jesse Hall0e74f002015-11-30 11:37:59 -08005589 VkSwapchainKHR swapchain,
5590 const VkAllocationCallbacks* pAllocator) {
Michael Lentine88594d72015-11-12 12:49:45 -08005591 deviceObject := GetDevice(device)
5592 swapchainObject := GetSwapchain(swapchain)
5593 assert(swapchainObject.device == device)
5594
5595 State.Swapchains[swapchain] = null
Michael Lentine88594d72015-11-12 12:49:45 -08005596}
5597
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005598@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005599cmd VkResult vkGetSwapchainImagesKHR(
5600 VkDevice device,
5601 VkSwapchainKHR swapchain,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005602 u32* pSwapchainImageCount,
Michael Lentine88594d72015-11-12 12:49:45 -08005603 VkImage* pSwapchainImages) {
5604 deviceObject := GetDevice(device)
5605
5606 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08005607 pSwapchainImageCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08005608 swapchainImages := pSwapchainImages[0:count]
5609
5610 for i in (0 .. count) {
5611 swapchainImage := ?
5612 swapchainImages[i] = swapchainImage
Jesse Hall1356b0d2015-11-23 17:24:58 -08005613 State.Images[swapchainImage] = new!ImageObject(device: device)
Michael Lentine88594d72015-11-12 12:49:45 -08005614 }
5615
5616 return ?
5617}
5618
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005619@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005620cmd VkResult vkAcquireNextImageKHR(
5621 VkDevice device,
5622 VkSwapchainKHR swapchain,
5623 u64 timeout,
5624 VkSemaphore semaphore,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005625 VkFence fence,
Michael Lentine88594d72015-11-12 12:49:45 -08005626 u32* pImageIndex) {
5627 deviceObject := GetDevice(device)
5628 swapchainObject := GetSwapchain(swapchain)
5629
5630 imageIndex := ?
5631 pImageIndex[0] = imageIndex
5632
5633 return ?
5634}
5635
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005636@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005637cmd VkResult vkQueuePresentKHR(
5638 VkQueue queue,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08005639 const VkPresentInfoKHR* pPresentInfo) {
Michael Lentine88594d72015-11-12 12:49:45 -08005640 queueObject := GetQueue(queue)
5641
5642 presentInfo := ?
5643 pPresentInfo[0] = presentInfo
5644
5645 return ?
5646}
5647
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005648@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005649cmd VkResult vkGetPhysicalDeviceDisplayPropertiesKHR(
5650 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005651 u32* pPropertyCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005652 VkDisplayPropertiesKHR* pProperties) {
5653 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5654 return ?
5655}
5656
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005657@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005658cmd VkResult vkGetPhysicalDeviceDisplayPlanePropertiesKHR(
5659 VkPhysicalDevice physicalDevice,
5660 u32* pPropertyCount,
5661 VkDisplayPlanePropertiesKHR* pProperties) {
5662 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5663 return ?
5664}
5665
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005666@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005667cmd VkResult vkGetDisplayPlaneSupportedDisplaysKHR(
5668 VkPhysicalDevice physicalDevice,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005669 u32 planeIndex,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08005670 u32* pDisplayCount,
5671 VkDisplayKHR* pDisplays) {
Jesse Halla6429252015-11-29 18:59:42 -08005672 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5673 return ?
5674}
5675
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005676@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005677cmd VkResult vkGetDisplayModePropertiesKHR(
5678 VkPhysicalDevice physicalDevice,
5679 VkDisplayKHR display,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005680 u32* pPropertyCount,
5681 VkDisplayModePropertiesKHR* pProperties) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005682 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5683 return ?
5684}
5685
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005686@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005687cmd VkResult vkCreateDisplayModeKHR(
5688 VkPhysicalDevice physicalDevice,
5689 VkDisplayKHR display,
5690 const VkDisplayModeCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005691 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005692 VkDisplayModeKHR* pMode) {
5693 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5694 return ?
5695}
5696
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005697@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005698cmd VkResult vkGetDisplayPlaneCapabilitiesKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005699 VkPhysicalDevice physicalDevice,
Jesse Hall9ba8bc82015-11-30 16:22:16 -08005700 VkDisplayModeKHR mode,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005701 u32 planeIndex,
Jesse Halla6429252015-11-29 18:59:42 -08005702 VkDisplayPlaneCapabilitiesKHR* pCapabilities) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005703 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5704 return ?
5705}
5706
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005707@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005708cmd VkResult vkCreateDisplayPlaneSurfaceKHR(
5709 VkInstance instance,
5710 const VkDisplaySurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005711 const VkAllocationCallbacks* pAllocator,
Jesse Halla6429252015-11-29 18:59:42 -08005712 VkSurfaceKHR* pSurface) {
5713 return ?
5714}
5715
Jesse Hall9ba8bc82015-11-30 16:22:16 -08005716@extension("VK_KHR_display_swapchain")
5717cmd VkResult vkCreateSharedSwapchainsKHR(
5718 VkDevice device,
5719 u32 swapchainCount,
5720 const VkSwapchainCreateInfoKHR* pCreateInfos,
5721 const VkAllocationCallbacks* pAllocator,
5722 VkSwapchainKHR* pSwapchains) {
5723 return ?
5724}
5725
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005726@extension("VK_KHR_xlib_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005727cmd VkResult vkCreateXlibSurfaceKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005728 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005729 const VkXlibSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005730 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005731 VkSurfaceKHR* pSurface) {
5732 instanceObject := GetInstance(instance)
5733 return ?
5734}
5735
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005736@extension("VK_KHR_xlib_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005737cmd VkBool32 vkGetPhysicalDeviceXlibPresentationSupportKHR(
5738 VkPhysicalDevice physicalDevice,
5739 u32 queueFamilyIndex,
5740 platform.Display* dpy,
Jesse Hall65ab5522015-11-30 00:07:16 -08005741 platform.VisualID visualID) {
Jesse Halla6429252015-11-29 18:59:42 -08005742 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5743 return ?
5744}
5745
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005746@extension("VK_KHR_xcb_surface")
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005747cmd VkResult vkCreateXcbSurfaceKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005748 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005749 const VkXcbSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005750 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005751 VkSurfaceKHR* pSurface) {
5752 instanceObject := GetInstance(instance)
5753 return ?
5754}
5755
Jesse Hall523db342015-11-30 21:12:55 -08005756@extension("VK_KHR_xcb_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005757cmd VkBool32 vkGetPhysicalDeviceXcbPresentationSupportKHR(
5758 VkPhysicalDevice physicalDevice,
5759 u32 queueFamilyIndex,
5760 platform.xcb_connection_t* connection,
5761 platform.xcb_visualid_t visual_id) {
5762 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5763 return ?
5764}
5765
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005766@extension("VK_KHR_wayland_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005767cmd VkResult vkCreateWaylandSurfaceKHR(
5768 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005769 const VkWaylandSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005770 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005771 VkSurfaceKHR* pSurface) {
5772 instanceObject := GetInstance(instance)
5773 return ?
5774}
5775
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005776@extension("VK_KHR_wayland_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005777cmd VkBool32 vkGetPhysicalDeviceWaylandPresentationSupportKHR(
5778 VkPhysicalDevice physicalDevice,
5779 u32 queueFamilyIndex,
5780 platform.wl_display* display) {
5781 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5782 return ?
5783}
5784
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005785@extension("VK_KHR_mir_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005786cmd VkResult vkCreateMirSurfaceKHR(
5787 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005788 const VkMirSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005789 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005790 VkSurfaceKHR* pSurface) {
5791 instanceObject := GetInstance(instance)
5792 return ?
5793}
5794
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005795@extension("VK_KHR_mir_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005796cmd VkBool32 vkGetPhysicalDeviceMirPresentationSupportKHR(
5797 VkPhysicalDevice physicalDevice,
5798 u32 queueFamilyIndex,
5799 platform.MirConnection* connection) {
5800 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5801 return ?
5802}
5803
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005804@extension("VK_KHR_android_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005805cmd VkResult vkCreateAndroidSurfaceKHR(
5806 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005807 const VkAndroidSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005808 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005809 VkSurfaceKHR* pSurface) {
5810 instanceObject := GetInstance(instance)
5811 return ?
5812}
5813
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005814@extension("VK_KHR_win32_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005815cmd VkResult vkCreateWin32SurfaceKHR(
5816 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005817 const VkWin32SurfaceCreateInfoKHR* 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_win32_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005825cmd VkResult vkGetPhysicalDeviceWin32PresentationSupportKHR(
5826 VkPhysicalDevice physicalDevice,
5827 u32 queueFamilyIndex) {
Jesse Halle2948d82016-02-25 04:19:32 -08005828 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Jesse Halla6429252015-11-29 18:59:42 -08005829 return ?
5830}
5831
Chia-I Wub262ddc2016-03-22 07:38:20 +08005832@extension("VK_ANDROID_native_buffer")
5833cmd VkResult vkGetSwapchainGrallocUsageANDROID(
5834 VkDevice device,
5835 VkFormat format,
5836 VkImageUsageFlags imageUsage,
5837 int* grallocUsage) {
5838 return ?
5839}
5840
5841@extension("VK_ANDROID_native_buffer")
Chris Forbes8e4438b2016-12-07 16:26:49 +13005842cmd VkResult vkGetSwapchainGrallocUsage2ANDROID(
5843 VkDevice device,
5844 VkFormat format,
5845 VkImageUsageFlags imageUsage,
5846 VkSwapchainImageUsageFlagsANDROID swapchainImageUsage,
5847 int* grallocUsage) {
5848 return ?
5849}
5850
5851@extension("VK_ANDROID_native_buffer")
Chia-I Wub262ddc2016-03-22 07:38:20 +08005852cmd VkResult vkAcquireImageANDROID(
5853 VkDevice device,
5854 VkImage image,
5855 int nativeFenceFd,
5856 VkSemaphore semaphore,
5857 VkFence fence) {
5858 return ?
5859}
5860
5861@extension("VK_ANDROID_native_buffer")
5862cmd VkResult vkQueueSignalReleaseImageANDROID(
5863 VkQueue queue,
5864 u32 waitSemaphoreCount,
5865 const VkSemaphore* pWaitSemaphores,
5866 VkImage image,
5867 int* pNativeFenceFd) {
5868 return ?
5869}
5870
Ian Elliott4c8bb2a2016-12-29 11:07:26 -07005871@extension("VK_GOOGLE_display_timing")
5872cmd VkResult vkGetRefreshCycleDurationGOOGLE(
5873 VkDevice device,
5874 VkSwapchainKHR swapchain,
5875 VkRefreshCycleDurationGOOGLE* pDisplayTimingProperties) {
5876 deviceObject := GetDevice(device)
5877 swapchainObject := GetSwapchain(swapchain)
5878
5879 displayTimingProperties := ?
5880 pDisplayTimingProperties[0] = displayTimingProperties
5881
5882 return ?
5883}
5884
5885@extension("VK_GOOGLE_display_timing")
5886cmd VkResult vkGetPastPresentationTimingGOOGLE(
5887 VkDevice device,
5888 VkSwapchainKHR swapchain,
5889 u32* pPresentationTimingCount,
5890 VkPastPresentationTimingGOOGLE* pPresentationTimings) {
Ian Elliott4c8bb2a2016-12-29 11:07:26 -07005891 return ?
5892}
5893
Jesse Hall715b86a2016-01-16 16:34:29 -08005894@extension("VK_EXT_debug_report")
5895@external type void* PFN_vkDebugReportCallbackEXT
5896@extension("VK_EXT_debug_report")
5897@pfn cmd VkBool32 vkDebugReportCallbackEXT(
5898 VkDebugReportFlagsEXT flags,
5899 VkDebugReportObjectTypeEXT objectType,
5900 u64 object,
5901 platform.size_t location,
5902 s32 messageCode,
5903 const char* pLayerPrefix,
5904 const char* pMessage,
5905 void* pUserData) {
5906 return ?
5907}
5908
5909@extension("VK_EXT_debug_report")
5910cmd VkResult vkCreateDebugReportCallbackEXT(
5911 VkInstance instance,
5912 const VkDebugReportCallbackCreateInfoEXT* pCreateInfo,
5913 const VkAllocationCallbacks* pAllocator,
5914 VkDebugReportCallbackEXT* pCallback) {
5915 return ?
5916}
5917
5918@extension("VK_EXT_debug_report")
5919cmd void vkDestroyDebugReportCallbackEXT(
5920 VkInstance instance,
5921 VkDebugReportCallbackEXT callback,
5922 const VkAllocationCallbacks* pAllocator) {
5923}
5924
5925@extension("VK_EXT_debug_report")
5926cmd void vkDebugReportMessageEXT(
5927 VkInstance instance,
5928 VkDebugReportFlagsEXT flags,
5929 VkDebugReportObjectTypeEXT objectType,
5930 u64 object,
5931 platform.size_t location,
5932 s32 messageCode,
5933 const char* pLayerPrefix,
5934 const char* pMessage) {
5935}
5936
Jesse Hall26763382016-05-20 07:13:52 -07005937@extension("VK_EXT_debug_marker")
5938cmd VkResult vkDebugMarkerSetObjectTagEXT(
5939 VkDevice device,
5940 VkDebugMarkerObjectTagInfoEXT* pTagInfo) {
5941 return ?
5942}
5943
5944@extension("VK_EXT_debug_marker")
5945cmd VkResult vkDebugMarkerSetObjectNameEXT(
5946 VkDevice device,
5947 VkDebugMarkerObjectNameInfoEXT* pNameInfo) {
5948 return ?
5949}
5950
5951@extension("VK_EXT_debug_marker")
5952cmd void vkCmdDebugMarkerBeginEXT(
5953 VkCommandBuffer commandBuffer,
5954 VkDebugMarkerMarkerInfoEXT* pMarkerInfo) {
5955}
5956
5957@extension("VK_EXT_debug_marker")
5958cmd void vkCmdDebugMarkerEndEXT(
5959 VkCommandBuffer commandBuffer) {
5960}
5961
5962@extension("VK_EXT_debug_marker")
5963cmd void vkCmdDebugMarkerInsertEXT(
5964 VkCommandBuffer commandBuffer,
5965 VkDebugMarkerMarkerInfoEXT* pMarkerInfo) {
5966}
5967
Chris Forbes1194ede2016-12-30 16:29:25 +13005968@extension("VK_KHR_get_physical_device_properties2")
5969cmd void vkGetPhysicalDeviceFeatures2KHR(
5970 VkPhysicalDevice physicalDevice,
5971 VkPhysicalDeviceFeatures2KHR* pFeatures) {
5972}
5973
5974@extension("VK_KHR_get_physical_device_properties2")
5975cmd void vkGetPhysicalDeviceProperties2KHR(
5976 VkPhysicalDevice physicalDevice,
5977 VkPhysicalDeviceProperties2KHR* pProperties) {
5978}
5979
5980@extension("VK_KHR_get_physical_device_properties2")
5981cmd void vkGetPhysicalDeviceFormatProperties2KHR(
5982 VkPhysicalDevice physicalDevice,
5983 VkFormat format,
5984 VkFormatProperties2KHR* pFormatProperties) {
5985}
5986
5987@extension("VK_KHR_get_physical_device_properties2")
5988cmd VkResult vkGetPhysicalDeviceImageFormatProperties2KHR(
5989 VkPhysicalDevice physicalDevice,
5990 const VkPhysicalDeviceImageFormatInfo2KHR* pImageFormatInfo,
5991 VkImageFormatProperties2KHR* pImageFormatProperties) {
5992 return ?
5993}
5994
5995@extension("VK_KHR_get_physical_device_properties2")
5996cmd void vkGetPhysicalDeviceQueueFamilyProperties2KHR(
5997 VkPhysicalDevice physicalDevice,
5998 u32* pQueueFamilyPropertyCount,
5999 VkQueueFamilyProperties2KHR* pQueueFamilyProperties) {
6000}
6001
6002@extension("VK_KHR_get_physical_device_properties2")
6003cmd void vkGetPhysicalDeviceMemoryProperties2KHR(
6004 VkPhysicalDevice physicalDevice,
6005 VkPhysicalDeviceMemoryProperties2KHR* pMemoryProperties) {
6006}
6007
6008@extension("VK_KHR_get_physical_device_properties2")
6009cmd void vkGetPhysicalDeviceSparseImageFormatProperties2KHR(
6010 VkPhysicalDevice physicalDevice,
6011 const VkPhysicalDeviceSparseImageFormatInfo2KHR* pFormatInfo,
6012 u32* pPropertyCount,
6013 VkSparseImageFormatProperties2KHR* pProperties) {
6014}
6015
Chris Forbes289cb792016-12-30 15:03:55 +13006016@extension("VK_AMD_draw_indirect_count")
6017cmd void vkCmdDrawIndirectCountAMD(
6018 VkCommandBuffer commandBuffer,
6019 VkBuffer buffer,
6020 VkDeviceSize offset,
6021 VkBuffer countBuffer,
6022 VkDeviceSize countBufferOffset,
6023 u32 maxDrawCount,
6024 u32 stride) {
6025}
6026
6027@extension("VK_AMD_draw_indirect_count")
6028cmd void vkCmdDrawIndexedIndirectCountAMD(
6029 VkCommandBuffer commandBuffer,
6030 VkBuffer buffer,
6031 VkDeviceSize offset,
6032 VkBuffer countBuffer,
6033 VkDeviceSize countBufferOffset,
6034 u32 maxDrawCount,
6035 u32 stride) {
6036}
6037
6038@extension("VK_NV_external_memory_capabilities")
6039cmd VkResult vkGetPhysicalDeviceExternalImageFormatPropertiesNV(
6040 VkPhysicalDevice physicalDevice,
6041 VkFormat format,
6042 VkImageType type,
6043 VkImageTiling tiling,
6044 VkImageUsageFlags usage,
6045 VkImageCreateFlags flags,
6046 VkExternalMemoryHandleTypeFlagsNV externalHandleType,
6047 VkExternalImageFormatPropertiesNV* pExternalImageFormatProperties) {
6048 return ?
6049}
6050
6051@extension("VK_NV_external_memory_win32")
6052cmd VkResult vkGetMemoryWin32HandleNV(
6053 VkDevice device,
6054 VkDeviceMemory memory,
6055 VkExternalMemoryHandleTypeFlagsNV handleType,
6056 platform.HANDLE* pHandle) {
6057 return ?
6058}
6059
6060@extension("VK_NV_external_memory_win32")
6061cmd void vkCmdProcessCommandsNVX(
6062 VkCommandBuffer commandBuffer,
6063 const VkCmdProcessCommandsInfoNVX* pProcessCommandsInfo) {
6064}
6065
6066@extension("VK_NV_external_memory_win32")
6067cmd void vkCmdReserveSpaceForCommandsNVX(
6068 VkCommandBuffer commandBuffer,
6069 const VkCmdReserveSpaceForCommandsInfoNVX* pReserveSpaceInfo) {
6070}
6071
6072@extension("VK_NV_external_memory_win32")
6073cmd VkResult vkCreateIndirectCommandsLayoutNVX(
6074 VkDevice device,
6075 const VkIndirectCommandsLayoutCreateInfoNVX* pCreateInfo,
6076 const VkAllocationCallbacks* pAllocator,
6077 VkIndirectCommandsLayoutNVX* pIndirectCommandsLayout) {
6078 return ?
6079}
6080
6081@extension("VK_NV_external_memory_win32")
6082cmd void vkDestroyIndirectCommandsLayoutNVX(
6083 VkDevice device,
6084 VkIndirectCommandsLayoutNVX indirectCommandsLayout,
6085 const VkAllocationCallbacks* pAllocator) {
6086}
6087
6088@extension("VK_NV_external_memory_win32")
6089cmd VkResult vkCreateObjectTableNVX(
6090 VkDevice device,
6091 const VkObjectTableCreateInfoNVX* pCreateInfo,
6092 const VkAllocationCallbacks* pAllocator,
6093 VkObjectTableNVX* pObjectTable) {
6094 return ?
6095}
6096
6097@extension("VK_NV_external_memory_win32")
6098cmd void vkDestroyObjectTableNVX(
6099 VkDevice device,
6100 VkObjectTableNVX objectTable,
6101 const VkAllocationCallbacks* pAllocator) {
6102}
6103
6104@extension("VK_NV_external_memory_win32")
6105cmd VkResult vkRegisterObjectsNVX(
6106 VkDevice device,
6107 VkObjectTableNVX objectTable,
6108 u32 objectCount,
6109 const VkObjectTableEntryNVX* const* ppObjectTableEntries,
6110 const u32* pObjectIndices) {
6111 return ?
6112}
6113
6114@extension("VK_NV_external_memory_win32")
6115cmd VkResult vkUnregisterObjectsNVX(
6116 VkDevice device,
6117 VkObjectTableNVX objectTable,
6118 u32 objectCount,
6119 const VkObjectEntryTypeNVX* pObjectEntryTypes,
6120 const u32* pObjectIndices) {
6121 return ?
6122}
6123
6124@extension("VK_NV_external_memory_win32")
6125cmd void vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX(
6126 VkPhysicalDevice physicalDevice,
6127 VkDeviceGeneratedCommandsFeaturesNVX* pFeatures,
6128 VkDeviceGeneratedCommandsLimitsNVX* pLimits) {
6129}
6130
Chris Forbes1d5f68c2017-01-31 10:17:01 +13006131@extension("VK_KHR_shared_presentable_image")
Chris Forbes2e12cb82017-01-18 11:45:17 +13006132cmd VkResult vkGetSwapchainStatusKHR(
6133 VkDevice device,
6134 VkSwapchainKHR swapchain) {
6135 return ?
6136}
6137
Jesse Halld27f6aa2015-08-15 17:58:48 -07006138
6139////////////////
6140// Validation //
6141////////////////
6142
6143extern void validate(string layerName, bool condition, string message)
6144
6145
6146/////////////////////////////
6147// Internal State Tracking //
6148/////////////////////////////
6149
6150StateObject State
6151
6152@internal class StateObject {
6153 // Dispatchable objects.
6154 map!(VkInstance, ref!InstanceObject) Instances
6155 map!(VkPhysicalDevice, ref!PhysicalDeviceObject) PhysicalDevices
6156 map!(VkDevice, ref!DeviceObject) Devices
6157 map!(VkQueue, ref!QueueObject) Queues
Jesse Hall3fbc8562015-11-29 22:10:52 -08006158 map!(VkCommandBuffer, ref!CommandBufferObject) CommandBuffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07006159
6160 // Non-dispatchable objects.
6161 map!(VkDeviceMemory, ref!DeviceMemoryObject) DeviceMemories
6162 map!(VkBuffer, ref!BufferObject) Buffers
6163 map!(VkBufferView, ref!BufferViewObject) BufferViews
6164 map!(VkImage, ref!ImageObject) Images
6165 map!(VkImageView, ref!ImageViewObject) ImageViews
Jesse Halld27f6aa2015-08-15 17:58:48 -07006166 map!(VkShaderModule, ref!ShaderModuleObject) ShaderModules
Jesse Halld27f6aa2015-08-15 17:58:48 -07006167 map!(VkPipeline, ref!PipelineObject) Pipelines
6168 map!(VkPipelineLayout, ref!PipelineLayoutObject) PipelineLayouts
6169 map!(VkSampler, ref!SamplerObject) Samplers
6170 map!(VkDescriptorSet, ref!DescriptorSetObject) DescriptorSets
6171 map!(VkDescriptorSetLayout, ref!DescriptorSetLayoutObject) DescriptorSetLayouts
6172 map!(VkDescriptorPool, ref!DescriptorPoolObject) DescriptorPools
Jesse Halld27f6aa2015-08-15 17:58:48 -07006173 map!(VkFence, ref!FenceObject) Fences
6174 map!(VkSemaphore, ref!SemaphoreObject) Semaphores
6175 map!(VkEvent, ref!EventObject) Events
6176 map!(VkQueryPool, ref!QueryPoolObject) QueryPools
6177 map!(VkFramebuffer, ref!FramebufferObject) Framebuffers
6178 map!(VkRenderPass, ref!RenderPassObject) RenderPasses
6179 map!(VkPipelineCache, ref!PipelineCacheObject) PipelineCaches
Jesse Hall3fbc8562015-11-29 22:10:52 -08006180 map!(VkCommandPool, ref!CommandPoolObject) CommandPools
Jesse Hall1356b0d2015-11-23 17:24:58 -08006181 map!(VkSurfaceKHR, ref!SurfaceObject) Surfaces
Michael Lentine88594d72015-11-12 12:49:45 -08006182 map!(VkSwapchainKHR, ref!SwapchainObject) Swapchains
Jesse Halld27f6aa2015-08-15 17:58:48 -07006183}
6184
6185@internal class InstanceObject {
6186}
6187
6188@internal class PhysicalDeviceObject {
6189 VkInstance instance
6190}
6191
6192@internal class DeviceObject {
6193 VkPhysicalDevice physicalDevice
6194}
6195
6196@internal class QueueObject {
6197 VkDevice device
6198 VkQueueFlags flags
6199}
6200
Jesse Hall3fbc8562015-11-29 22:10:52 -08006201@internal class CommandBufferObject {
Jesse Halld27f6aa2015-08-15 17:58:48 -07006202 VkDevice device
6203 map!(u64, VkDeviceMemory) boundObjects
6204 VkQueueFlags queueFlags
6205}
6206
6207@internal class DeviceMemoryObject {
Jesse Hall3fbc8562015-11-29 22:10:52 -08006208 VkDevice device
6209 VkDeviceSize allocationSize
6210 map!(u64, VkDeviceSize) boundObjects
6211 map!(VkCommandBuffer, VkCommandBuffer) boundCommandBuffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07006212}
6213
6214@internal class BufferObject {
6215 VkDevice device
Jesse Hall3fbc8562015-11-29 22:10:52 -08006216 VkDeviceMemory memory
6217 VkDeviceSize memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07006218}
6219
6220@internal class BufferViewObject {
6221 VkDevice device
6222 VkBuffer buffer
6223}
6224
6225@internal class ImageObject {
6226 VkDevice device
Jesse Hall3fbc8562015-11-29 22:10:52 -08006227 VkDeviceMemory memory
6228 VkDeviceSize memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07006229}
6230
6231@internal class ImageViewObject {
6232 VkDevice device
6233 VkImage image
6234}
6235
Jesse Halld27f6aa2015-08-15 17:58:48 -07006236@internal class ShaderObject {
6237 VkDevice device
6238}
6239
6240@internal class ShaderModuleObject {
6241 VkDevice device
6242}
6243
6244@internal class PipelineObject {
6245 VkDevice device
6246}
6247
6248@internal class PipelineLayoutObject {
6249 VkDevice device
6250}
6251
6252@internal class SamplerObject {
6253 VkDevice device
6254}
6255
6256@internal class DescriptorSetObject {
6257 VkDevice device
6258}
6259
6260@internal class DescriptorSetLayoutObject {
6261 VkDevice device
6262}
6263
6264@internal class DescriptorPoolObject {
6265 VkDevice device
6266}
6267
Jesse Halld27f6aa2015-08-15 17:58:48 -07006268@internal class FenceObject {
6269 VkDevice device
6270 bool signaled
6271}
6272
6273@internal class SemaphoreObject {
6274 VkDevice device
6275}
6276
6277@internal class EventObject {
6278 VkDevice device
6279}
6280
6281@internal class QueryPoolObject {
6282 VkDevice device
6283}
6284
6285@internal class FramebufferObject {
6286 VkDevice device
6287}
6288
6289@internal class RenderPassObject {
6290 VkDevice device
6291}
6292
6293@internal class PipelineCacheObject {
6294 VkDevice device
6295}
6296
Jesse Hall3fbc8562015-11-29 22:10:52 -08006297@internal class CommandPoolObject {
Jesse Halld27f6aa2015-08-15 17:58:48 -07006298 VkDevice device
6299}
6300
Jesse Hall1356b0d2015-11-23 17:24:58 -08006301@internal class SurfaceObject {
6302 VkInstance instance
6303}
6304
Michael Lentine88594d72015-11-12 12:49:45 -08006305@internal class SwapchainObject {
6306 VkDevice device
6307}
6308
Jesse Halld27f6aa2015-08-15 17:58:48 -07006309macro ref!InstanceObject GetInstance(VkInstance instance) {
6310 assert(instance in State.Instances)
6311 return State.Instances[instance]
6312}
6313
6314macro ref!PhysicalDeviceObject GetPhysicalDevice(VkPhysicalDevice physicalDevice) {
6315 assert(physicalDevice in State.PhysicalDevices)
6316 return State.PhysicalDevices[physicalDevice]
6317}
6318
6319macro ref!DeviceObject GetDevice(VkDevice device) {
6320 assert(device in State.Devices)
6321 return State.Devices[device]
6322}
6323
6324macro ref!QueueObject GetQueue(VkQueue queue) {
6325 assert(queue in State.Queues)
6326 return State.Queues[queue]
6327}
6328
Jesse Hall3fbc8562015-11-29 22:10:52 -08006329macro ref!CommandBufferObject GetCommandBuffer(VkCommandBuffer commandBuffer) {
6330 assert(commandBuffer in State.CommandBuffers)
6331 return State.CommandBuffers[commandBuffer]
Jesse Halld27f6aa2015-08-15 17:58:48 -07006332}
6333
Jesse Hall3fbc8562015-11-29 22:10:52 -08006334macro ref!DeviceMemoryObject GetDeviceMemory(VkDeviceMemory memory) {
6335 assert(memory in State.DeviceMemories)
6336 return State.DeviceMemories[memory]
Jesse Halld27f6aa2015-08-15 17:58:48 -07006337}
6338
6339macro ref!BufferObject GetBuffer(VkBuffer buffer) {
6340 assert(buffer in State.Buffers)
6341 return State.Buffers[buffer]
6342}
6343
6344macro ref!BufferViewObject GetBufferView(VkBufferView bufferView) {
6345 assert(bufferView in State.BufferViews)
6346 return State.BufferViews[bufferView]
6347}
6348
6349macro ref!ImageObject GetImage(VkImage image) {
6350 assert(image in State.Images)
6351 return State.Images[image]
6352}
6353
6354macro ref!ImageViewObject GetImageView(VkImageView imageView) {
6355 assert(imageView in State.ImageViews)
6356 return State.ImageViews[imageView]
6357}
6358
Jesse Halld27f6aa2015-08-15 17:58:48 -07006359macro ref!ShaderModuleObject GetShaderModule(VkShaderModule shaderModule) {
6360 assert(shaderModule in State.ShaderModules)
6361 return State.ShaderModules[shaderModule]
6362}
6363
6364macro ref!PipelineObject GetPipeline(VkPipeline pipeline) {
6365 assert(pipeline in State.Pipelines)
6366 return State.Pipelines[pipeline]
6367}
6368
6369macro ref!PipelineLayoutObject GetPipelineLayout(VkPipelineLayout pipelineLayout) {
6370 assert(pipelineLayout in State.PipelineLayouts)
6371 return State.PipelineLayouts[pipelineLayout]
6372}
6373
6374macro ref!SamplerObject GetSampler(VkSampler sampler) {
6375 assert(sampler in State.Samplers)
6376 return State.Samplers[sampler]
6377}
6378
6379macro ref!DescriptorSetObject GetDescriptorSet(VkDescriptorSet descriptorSet) {
6380 assert(descriptorSet in State.DescriptorSets)
6381 return State.DescriptorSets[descriptorSet]
6382}
6383
6384macro ref!DescriptorSetLayoutObject GetDescriptorSetLayout(VkDescriptorSetLayout descriptorSetLayout) {
6385 assert(descriptorSetLayout in State.DescriptorSetLayouts)
6386 return State.DescriptorSetLayouts[descriptorSetLayout]
6387}
6388
6389macro ref!DescriptorPoolObject GetDescriptorPool(VkDescriptorPool descriptorPool) {
6390 assert(descriptorPool in State.DescriptorPools)
6391 return State.DescriptorPools[descriptorPool]
6392}
6393
Jesse Halld27f6aa2015-08-15 17:58:48 -07006394macro ref!FenceObject GetFence(VkFence fence) {
6395 assert(fence in State.Fences)
6396 return State.Fences[fence]
6397}
6398
6399macro ref!SemaphoreObject GetSemaphore(VkSemaphore semaphore) {
6400 assert(semaphore in State.Semaphores)
6401 return State.Semaphores[semaphore]
6402}
6403
6404macro ref!EventObject GetEvent(VkEvent event) {
6405 assert(event in State.Events)
6406 return State.Events[event]
6407}
6408
6409macro ref!QueryPoolObject GetQueryPool(VkQueryPool queryPool) {
6410 assert(queryPool in State.QueryPools)
6411 return State.QueryPools[queryPool]
6412}
6413
6414macro ref!FramebufferObject GetFramebuffer(VkFramebuffer framebuffer) {
6415 assert(framebuffer in State.Framebuffers)
6416 return State.Framebuffers[framebuffer]
6417}
6418
6419macro ref!RenderPassObject GetRenderPass(VkRenderPass renderPass) {
6420 assert(renderPass in State.RenderPasses)
6421 return State.RenderPasses[renderPass]
6422}
6423
6424macro ref!PipelineCacheObject GetPipelineCache(VkPipelineCache pipelineCache) {
6425 assert(pipelineCache in State.PipelineCaches)
6426 return State.PipelineCaches[pipelineCache]
6427}
6428
Jesse Hall3fbc8562015-11-29 22:10:52 -08006429macro ref!CommandPoolObject GetCommandPool(VkCommandPool commandPool) {
6430 assert(commandPool in State.CommandPools)
6431 return State.CommandPools[commandPool]
Jesse Hallf09c6b12015-08-15 19:54:28 -07006432}
Michael Lentine88594d72015-11-12 12:49:45 -08006433
Jesse Hall1356b0d2015-11-23 17:24:58 -08006434macro ref!SurfaceObject GetSurface(VkSurfaceKHR surface) {
6435 assert(surface in State.Surfaces)
6436 return State.Surfaces[surface]
6437}
6438
Michael Lentine88594d72015-11-12 12:49:45 -08006439macro ref!SwapchainObject GetSwapchain(VkSwapchainKHR swapchain) {
6440 assert(swapchain in State.Swapchains)
6441 return State.Swapchains[swapchain]
6442}
Jesse Halld8bade02015-11-24 10:24:18 -08006443
6444macro VkQueueFlags AddQueueFlag(VkQueueFlags flags, VkQueueFlagBits bit) {
6445 return as!VkQueueFlags(as!u32(flags) | as!u32(bit))
6446}