blob: 754c441ebdac61a690f0339c617505f423ed64f0 [file] [log] [blame]
Jesse Halld27f6aa2015-08-15 17:58:48 -07001// Copyright (c) 2015 The Khronos Group Inc.
2//
3// Permission is hereby granted, free of charge, to any person obtaining a
4// copy of this software and/or associated documentation files (the
5// "Materials"), to deal in the Materials without restriction, including
6// without limitation the rights to use, copy, modify, merge, publish,
7// distribute, sublicense, and/or sell copies of the Materials, and to
8// permit persons to whom the Materials are furnished to do so, subject to
9// the following conditions:
10//
11// The above copyright notice and this permission notice shall be included
12// in all copies or substantial portions of the Materials.
13//
14// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20// MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
21
22import platform "platform.api"
23
24///////////////
25// Constants //
26///////////////
27
28// API version (major.minor.patch)
Jesse Hall3dd678a2016-01-08 21:52:01 -080029define VERSION_MAJOR 1
30define VERSION_MINOR 0
Jesse Halleb02c472017-02-24 15:13:45 -080031define 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 Halleb02c472017-02-24 15:13:45 -080048// 1
Jesse Hall33faaad2016-01-24 21:00:49 -080049@extension("VK_KHR_surface") define VK_KHR_SURFACE_SPEC_VERSION 25
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080050@extension("VK_KHR_surface") define VK_KHR_SURFACE_EXTENSION_NAME "VK_KHR_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080051
Jesse Halleb02c472017-02-24 15:13:45 -080052// 2
Jesse Hall26763382016-05-20 07:13:52 -070053@extension("VK_KHR_swapchain") define VK_KHR_SWAPCHAIN_SPEC_VERSION 68
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080054@extension("VK_KHR_swapchain") define VK_KHR_SWAPCHAIN_EXTENSION_NAME "VK_KHR_swapchain"
Jesse Hall1356b0d2015-11-23 17:24:58 -080055
Jesse Halleb02c472017-02-24 15:13:45 -080056// 3
Jesse Hall543a7ff2016-01-08 16:38:30 -080057@extension("VK_KHR_display") define VK_KHR_DISPLAY_SPEC_VERSION 21
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080058@extension("VK_KHR_display") define VK_KHR_DISPLAY_EXTENSION_NAME "VK_KHR_display"
Jesse Hall1356b0d2015-11-23 17:24:58 -080059
Jesse Halleb02c472017-02-24 15:13:45 -080060// 4
Jesse Hall543a7ff2016-01-08 16:38:30 -080061@extension("VK_KHR_display_swapchain") define VK_KHR_DISPLAY_SWAPCHAIN_SPEC_VERSION 9
Jesse Hall0e74f002015-11-30 11:37:59 -080062@extension("VK_KHR_display_swapchain") define VK_KHR_DISPLAY_SWAPCHAIN_EXTENSION_NAME "VK_KHR_display_swapchain"
Jesse Hall1356b0d2015-11-23 17:24:58 -080063
Jesse Halleb02c472017-02-24 15:13:45 -080064// 5
Jesse Hall543a7ff2016-01-08 16:38:30 -080065@extension("VK_KHR_xlib_surface") define VK_KHR_XLIB_SURFACE_SPEC_VERSION 6
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080066@extension("VK_KHR_xlib_surface") define VK_KHR_XLIB_SURFACE_NAME "VK_KHR_xlib_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080067
Jesse Halleb02c472017-02-24 15:13:45 -080068// 6
Jesse Hall543a7ff2016-01-08 16:38:30 -080069@extension("VK_KHR_xcb_surface") define VK_KHR_XCB_SURFACE_SPEC_VERSION 6
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080070@extension("VK_KHR_xcb_surface") define VK_KHR_XCB_SURFACE_NAME "VK_KHR_xcb_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080071
Jesse Halleb02c472017-02-24 15:13:45 -080072// 7
Jesse Hall543a7ff2016-01-08 16:38:30 -080073@extension("VK_KHR_wayland_surface") define VK_KHR_WAYLAND_SURFACE_SPEC_VERSION 5
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080074@extension("VK_KHR_wayland_surface") define VK_KHR_WAYLAND_SURFACE_NAME "VK_KHR_wayland_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080075
Jesse Halleb02c472017-02-24 15:13:45 -080076// 8
Jesse Hall543a7ff2016-01-08 16:38:30 -080077@extension("VK_KHR_mir_surface") define VK_KHR_MIR_SURFACE_SPEC_VERSION 4
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080078@extension("VK_KHR_mir_surface") define VK_KHR_MIR_SURFACE_NAME "VK_KHR_mir_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080079
Jesse Halleb02c472017-02-24 15:13:45 -080080// 9
Jesse Hall33faaad2016-01-24 21:00:49 -080081@extension("VK_KHR_android_surface") define VK_KHR_ANDROID_SURFACE_SPEC_VERSION 6
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080082@extension("VK_KHR_android_surface") define VK_KHR_ANDROID_SURFACE_NAME "VK_KHR_android_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080083
Jesse Halleb02c472017-02-24 15:13:45 -080084// 10
Jesse Hall543a7ff2016-01-08 16:38:30 -080085@extension("VK_KHR_win32_surface") define VK_KHR_WIN32_SURFACE_SPEC_VERSION 5
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080086@extension("VK_KHR_win32_surface") define VK_KHR_WIN32_SURFACE_NAME "VK_KHR_win32_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080087
Jesse Halleb02c472017-02-24 15:13:45 -080088// 11
Chia-I Wub262ddc2016-03-22 07:38:20 +080089@extension("VK_ANDROID_native_buffer") define VK_ANDROID_NATIVE_BUFFER_SPEC_VERSION 5
90@extension("VK_ANDROID_native_buffer") define VK_ANDROID_NATIVE_BUFFER_NAME "VK_ANDROID_native_buffer"
91
Jesse Halleb02c472017-02-24 15:13:45 -080092// 12
93@extension("VK_EXT_debug_report") define VK_EXT_DEBUG_REPORT_SPEC_VERSION 4
Jesse Hall715b86a2016-01-16 16:34:29 -080094@extension("VK_EXT_debug_report") define VK_EXT_DEBUG_REPORT_NAME "VK_EXT_debug_report"
95
Jesse Halleb02c472017-02-24 15:13:45 -080096// 13
Jesse Hall26763382016-05-20 07:13:52 -070097@extension("VK_NV_glsl_shader") define VK_NV_GLSL_SHADER_SPEC_VERSION 1
98@extension("VK_NV_glsl_shader") define VK_NV_GLSL_SHADER_NAME "VK_NV_glsl_shader"
99
Jesse Halleb02c472017-02-24 15:13:45 -0800100// 15
Jesse Hall26763382016-05-20 07:13:52 -0700101@extension("VK_KHR_sampler_mirror_clamp_to_edge") define VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_SPEC_VERSION 1
102@extension("VK_KHR_sampler_mirror_clamp_to_edge") define VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_NAME "VK_KHR_sampler_mirror_clamp_to_edge"
103
Jesse Halleb02c472017-02-24 15:13:45 -0800104// 16
Jesse Hall26763382016-05-20 07:13:52 -0700105@extension("VK_IMG_filter_cubic") define VK_IMG_FILTER_CUBIC_SPEC_VERSION 1
106@extension("VK_IMG_filter_cubic") define VK_IMG_FILTER_CUBIC_NAME "VK_IMG_filter_cubic"
107
Jesse Halleb02c472017-02-24 15:13:45 -0800108// 19
Jesse Hall26763382016-05-20 07:13:52 -0700109@extension("VK_AMD_rasterization_order") define VK_AMD_RASTERIZATION_ORDER_SPEC_VERSION 1
110@extension("VK_AMD_rasterization_order") define VK_AMD_RASTERIZATION_ORDER_NAME "VK_AMD_rasterization_order"
111
Jesse Halleb02c472017-02-24 15:13:45 -0800112// 21
Jesse Hall3f5499b2016-07-26 15:20:40 -0700113@extension("VK_AMD_shader_trinary_minmax") define VK_AMD_SHADER_TRINARY_MINMAX_SPEC_VERSION 1
114@extension("VK_AMD_shader_trinary_minmax") define VK_AMD_SHADER_TRINARY_MINMAX_EXTENSION_NAME "VK_AMD_shader_trinary_minmax"
115
Jesse Halleb02c472017-02-24 15:13:45 -0800116// 22
Jesse Hall3f5499b2016-07-26 15:20:40 -0700117@extension("VK_AMD_shader_explicit_vertex_parameter") define VK_AMD_SHADER_EXPLICIT_VERTEX_PARAMETER_SPEC_VERSION 1
118@extension("VK_AMD_shader_explicit_vertex_parameter") define VK_AMD_SHADER_EXPLICIT_VERTEX_PARAMETER_EXTENSION_NAME "VK_AMD_shader_explicit_vertex_parameter"
119
Jesse Halleb02c472017-02-24 15:13:45 -0800120// 23
Jesse Hall26763382016-05-20 07:13:52 -0700121@extension("VK_EXT_debug_marker") define VK_EXT_DEBUG_MARKER_SPEC_VERSION 3
122@extension("VK_EXT_debug_marker") define VK_EXT_DEBUG_MARKER_NAME "VK_EXT_debug_marker"
123
Jesse Halleb02c472017-02-24 15:13:45 -0800124// 26
Jesse Hall3f5499b2016-07-26 15:20:40 -0700125@extension("VK_AMD_gcn_shader") define VK_AMD_GCN_SHADER_SPEC_VERSION 1
126@extension("VK_AMD_gcn_shader") define VK_AMD_GCN_SHADER_EXTENSION_NAME "VK_AMD_gcn_shader"
127
Jesse Halleb02c472017-02-24 15:13:45 -0800128// 27
Jesse Hall3f5499b2016-07-26 15:20:40 -0700129@extension("VK_NV_dedicated_allocation") define VK_NV_DEDICATED_ALLOCATION_SPEC_VERSION 1
130@extension("VK_NV_dedicated_allocation") define VK_NV_DEDICATED_ALLOCATION_EXTENSION_NAME "VK_NV_dedicated_allocation"
131
Jesse Halleb02c472017-02-24 15:13:45 -0800132// 28
133@extension("VK_IMG_format_pvrtc") define VK_IMG_FORMAT_PVRTC_SPEC_VERSION 1
134@extension("VK_IMG_format_pvrtc") define VK_IMG_FORMAT_PVRTC_EXTENSION_NAME "VK_IMG_format_pvrtc"
135
136// 34
137@extension("VK_AMD_draw_indirect_count") define VK_AMD_DRAW_INDIRECT_COUNT_SPEC_VERSION 1
138@extension("VK_AMD_draw_indirect_count") define VK_AMD_DRAW_INDIRECT_COUNT_EXTENSION_NAME "VK_AMD_draw_indirect_count"
139
140// 36
141@extension("VK_AMD_negative_viewport_height") define VK_AMD_NEGATIVE_VIEWPORT_HEIGHT_SPEC_VERSION 1
142@extension("VK_AMD_negative_viewport_height") define VK_AMD_NEGATIVE_VIEWPORT_HEIGHT_EXTENSION_NAME "VK_AMD_negative_viewport_height"
143
144// 37
145@extension("VK_AMD_gpu_shader_half_float") define VK_AMD_GPU_SHADER_HALF_FLOAT_SPEC_VERSION 1
146@extension("VK_AMD_gpu_shader_half_float") define VK_AMD_GPU_SHADER_HALF_FLOAT_EXTENSION_NAME "VK_AMD_gpu_shader_half_float"
147
148// 38
149@extension("VK_AMD_shader_ballot") define VK_AMD_SHADER_BALLOT_SPEC_VERSION 1
150@extension("VK_AMD_shader_ballot") define VK_AMD_SHADER_BALLOT_EXTENSION_NAME "VK_AMD_shader_ballot"
151
152// 56
153@extension("VK_NV_external_memory_capabilities") define VK_NV_EXTERNAL_MEMORY_CAPABILITIES_SPEC_VERSION 1
154@extension("VK_NV_external_memory_capabilities") define VK_NV_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME "VK_NV_external_memory_capabilities"
155
156// 57
157@extension("VK_NV_external_memory") define VK_NV_EXTERNAL_MEMORY_SPEC_VERSION 1
158@extension("VK_NV_external_memory") define VK_NV_EXTERNAL_MEMORY_EXTENSION_NAME "VK_NV_external_memory"
159
160// 58
161@extension("VK_NV_external_memory_win32") define VK_NV_EXTERNAL_MEMORY_WIN32_SPEC_VERSION 1
162@extension("VK_NV_external_memory_win32") define VK_NV_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME "VK_NV_external_memory_win32"
163
164// 59
165@extension("VK_NV_win32_keyed_mutex") define VK_NV_WIN32_KEYED_MUTEX_SPEC_VERSION 1
166@extension("VK_NV_win32_keyed_mutex") define VK_NV_WIN32_KEYED_MUTEX_EXTENSION_NAME "VK_NV_win32_keyed_mutex"
167
168// 62
169@extension("VK_EXT_validation_flags") define VK_EXT_VALIDATION_FLAGS_SPEC_VERSION 1
170@extension("VK_EXT_validation_flags") define VK_EXT_VALIDATION_FLAGS_EXTENSION_NAME "VK_EXT_validation_flags"
171
172// 87
173@extension("VK_NVX_device_generated_commands") define VK_NVX_DEVICE_GENERATED_COMMANDS_SPEC_VERSION 1
174@extension("VK_NVX_device_generated_commands") define VK_NVX_DEVICE_GENERATED_COMMANDS_EXTENSION_NAME "VK_NVX_device_generated_commands"
175
Jesse Halld27f6aa2015-08-15 17:58:48 -0700176
177/////////////
178// Types //
179/////////////
180
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700181type u32 VkBool32
182type u32 VkFlags
183type u64 VkDeviceSize
184type u32 VkSampleMask
185
Jesse Halld27f6aa2015-08-15 17:58:48 -0700186/// Dispatchable handle types.
187@dispatchHandle type u64 VkInstance
188@dispatchHandle type u64 VkPhysicalDevice
189@dispatchHandle type u64 VkDevice
190@dispatchHandle type u64 VkQueue
Jesse Hall3fbc8562015-11-29 22:10:52 -0800191@dispatchHandle type u64 VkCommandBuffer
Jesse Halld27f6aa2015-08-15 17:58:48 -0700192
193/// Non dispatchable handle types.
194@nonDispatchHandle type u64 VkDeviceMemory
Jesse Hall3fbc8562015-11-29 22:10:52 -0800195@nonDispatchHandle type u64 VkCommandPool
Jesse Halld27f6aa2015-08-15 17:58:48 -0700196@nonDispatchHandle type u64 VkBuffer
197@nonDispatchHandle type u64 VkBufferView
198@nonDispatchHandle type u64 VkImage
199@nonDispatchHandle type u64 VkImageView
Jesse Halld27f6aa2015-08-15 17:58:48 -0700200@nonDispatchHandle type u64 VkShaderModule
Jesse Halld27f6aa2015-08-15 17:58:48 -0700201@nonDispatchHandle type u64 VkPipeline
202@nonDispatchHandle type u64 VkPipelineLayout
203@nonDispatchHandle type u64 VkSampler
204@nonDispatchHandle type u64 VkDescriptorSet
205@nonDispatchHandle type u64 VkDescriptorSetLayout
206@nonDispatchHandle type u64 VkDescriptorPool
Jesse Halld27f6aa2015-08-15 17:58:48 -0700207@nonDispatchHandle type u64 VkFence
208@nonDispatchHandle type u64 VkSemaphore
209@nonDispatchHandle type u64 VkEvent
210@nonDispatchHandle type u64 VkQueryPool
211@nonDispatchHandle type u64 VkFramebuffer
212@nonDispatchHandle type u64 VkRenderPass
213@nonDispatchHandle type u64 VkPipelineCache
Jesse Hall1356b0d2015-11-23 17:24:58 -0800214
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800215@extension("VK_KHR_surface") @nonDispatchHandle type u64 VkSurfaceKHR
Jesse Hall1356b0d2015-11-23 17:24:58 -0800216
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800217@extension("VK_KHR_swapchain") @nonDispatchHandle type u64 VkSwapchainKHR
Jesse Hall1356b0d2015-11-23 17:24:58 -0800218
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800219@extension("VK_KHR_display") @nonDispatchHandle type u64 VkDisplayKHR
220@extension("VK_KHR_display") @nonDispatchHandle type u64 VkDisplayModeKHR
Jesse Halld27f6aa2015-08-15 17:58:48 -0700221
Jesse Hall715b86a2016-01-16 16:34:29 -0800222@extension("VK_EXT_debug_report") @nonDispatchHandle type u64 VkDebugReportCallbackEXT
223
Jesse Halleb02c472017-02-24 15:13:45 -0800224@extension("VK_NVX_device_generated_commands") @nonDispatchHandle type u64 VkObjectTableNVX
225@extension("VK_NVX_device_generated_commands") @nonDispatchHandle type u64 VkIndirectCommandsLayoutNVX
226
Jesse Halld27f6aa2015-08-15 17:58:48 -0700227
228/////////////
229// Enums //
230/////////////
231
232enum VkImageLayout {
233 VK_IMAGE_LAYOUT_UNDEFINED = 0x00000000, /// Implicit layout an image is when its contents are undefined due to various reasons (e.g. right after creation)
234 VK_IMAGE_LAYOUT_GENERAL = 0x00000001, /// General layout when image can be used for any kind of access
235 VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL = 0x00000002, /// Optimal layout when image is only used for color attachment read/write
236 VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL = 0x00000003, /// Optimal layout when image is only used for depth/stencil attachment read/write
237 VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL = 0x00000004, /// Optimal layout when image is used for read only depth/stencil attachment and shader access
238 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 -0800239 VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL = 0x00000006, /// Optimal layout when image is used only as source of transfer operations
240 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 -0700241 VK_IMAGE_LAYOUT_PREINITIALIZED = 0x00000008, /// Initial layout used when the data is populated by the CPU
Jesse Hall1356b0d2015-11-23 17:24:58 -0800242
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800243 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800244 VK_IMAGE_LAYOUT_PRESENT_SRC_KHR = 1000001002,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700245}
246
247enum VkAttachmentLoadOp {
248 VK_ATTACHMENT_LOAD_OP_LOAD = 0x00000000,
249 VK_ATTACHMENT_LOAD_OP_CLEAR = 0x00000001,
250 VK_ATTACHMENT_LOAD_OP_DONT_CARE = 0x00000002,
251}
252
253enum VkAttachmentStoreOp {
254 VK_ATTACHMENT_STORE_OP_STORE = 0x00000000,
255 VK_ATTACHMENT_STORE_OP_DONT_CARE = 0x00000001,
256}
257
258enum VkImageType {
259 VK_IMAGE_TYPE_1D = 0x00000000,
260 VK_IMAGE_TYPE_2D = 0x00000001,
261 VK_IMAGE_TYPE_3D = 0x00000002,
262}
263
264enum VkImageTiling {
Jesse Hallc7467b72015-11-29 21:05:26 -0800265 VK_IMAGE_TILING_OPTIMAL = 0x00000000,
266 VK_IMAGE_TILING_LINEAR = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700267}
268
269enum VkImageViewType {
270 VK_IMAGE_VIEW_TYPE_1D = 0x00000000,
271 VK_IMAGE_VIEW_TYPE_2D = 0x00000001,
272 VK_IMAGE_VIEW_TYPE_3D = 0x00000002,
273 VK_IMAGE_VIEW_TYPE_CUBE = 0x00000003,
274 VK_IMAGE_VIEW_TYPE_1D_ARRAY = 0x00000004,
275 VK_IMAGE_VIEW_TYPE_2D_ARRAY = 0x00000005,
276 VK_IMAGE_VIEW_TYPE_CUBE_ARRAY = 0x00000006,
277}
278
Jesse Hall3fbc8562015-11-29 22:10:52 -0800279enum VkCommandBufferLevel {
280 VK_COMMAND_BUFFER_LEVEL_PRIMARY = 0x00000000,
281 VK_COMMAND_BUFFER_LEVEL_SECONDARY = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700282}
283
Jesse Hall65ab5522015-11-30 00:07:16 -0800284enum VkComponentSwizzle {
285 VK_COMPONENT_SWIZZLE_IDENTITY = 0x00000000,
286 VK_COMPONENT_SWIZZLE_ZERO = 0x00000001,
287 VK_COMPONENT_SWIZZLE_ONE = 0x00000002,
288 VK_COMPONENT_SWIZZLE_R = 0x00000003,
289 VK_COMPONENT_SWIZZLE_G = 0x00000004,
290 VK_COMPONENT_SWIZZLE_B = 0x00000005,
291 VK_COMPONENT_SWIZZLE_A = 0x00000006,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700292}
293
294enum VkDescriptorType {
295 VK_DESCRIPTOR_TYPE_SAMPLER = 0x00000000,
296 VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER = 0x00000001,
297 VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE = 0x00000002,
298 VK_DESCRIPTOR_TYPE_STORAGE_IMAGE = 0x00000003,
299 VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER = 0x00000004,
300 VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER = 0x00000005,
301 VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER = 0x00000006,
302 VK_DESCRIPTOR_TYPE_STORAGE_BUFFER = 0x00000007,
303 VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC = 0x00000008,
304 VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC = 0x00000009,
305 VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT = 0x0000000a,
306}
307
Jesse Halld27f6aa2015-08-15 17:58:48 -0700308enum VkQueryType {
309 VK_QUERY_TYPE_OCCLUSION = 0x00000000,
310 VK_QUERY_TYPE_PIPELINE_STATISTICS = 0x00000001, /// Optional
Jesse Halla3a7a1d2015-11-24 11:37:23 -0800311 VK_QUERY_TYPE_TIMESTAMP = 0x00000002,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700312}
313
Jesse Halld27f6aa2015-08-15 17:58:48 -0700314enum VkBorderColor {
315 VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK = 0x00000000,
316 VK_BORDER_COLOR_INT_TRANSPARENT_BLACK = 0x00000001,
317 VK_BORDER_COLOR_FLOAT_OPAQUE_BLACK = 0x00000002,
318 VK_BORDER_COLOR_INT_OPAQUE_BLACK = 0x00000003,
319 VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE = 0x00000004,
320 VK_BORDER_COLOR_INT_OPAQUE_WHITE = 0x00000005,
321}
322
323enum VkPipelineBindPoint {
Jesse Hallc7467b72015-11-29 21:05:26 -0800324 VK_PIPELINE_BIND_POINT_GRAPHICS = 0x00000000,
325 VK_PIPELINE_BIND_POINT_COMPUTE = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700326}
327
328enum VkPrimitiveTopology {
329 VK_PRIMITIVE_TOPOLOGY_POINT_LIST = 0x00000000,
330 VK_PRIMITIVE_TOPOLOGY_LINE_LIST = 0x00000001,
331 VK_PRIMITIVE_TOPOLOGY_LINE_STRIP = 0x00000002,
332 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST = 0x00000003,
333 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP = 0x00000004,
334 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN = 0x00000005,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800335 VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY = 0x00000006,
336 VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY = 0x00000007,
337 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY = 0x00000008,
338 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY = 0x00000009,
Jesse Hall091ed9e2015-11-30 00:55:29 -0800339 VK_PRIMITIVE_TOPOLOGY_PATCH_LIST = 0x0000000a,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700340}
341
342enum VkSharingMode {
343 VK_SHARING_MODE_EXCLUSIVE = 0x00000000,
344 VK_SHARING_MODE_CONCURRENT = 0x00000001,
345}
346
347enum VkIndexType {
348 VK_INDEX_TYPE_UINT16 = 0x00000000,
349 VK_INDEX_TYPE_UINT32 = 0x00000001,
350}
351
Jesse Hall23ff73f2015-11-29 14:36:39 -0800352enum VkFilter {
353 VK_FILTER_NEAREST = 0x00000000,
354 VK_FILTER_LINEAR = 0x00000001,
Jesse Hall26763382016-05-20 07:13:52 -0700355
356 //@extension("VK_IMG_filter_cubic")
357 VK_FILTER_CUBIC_IMG = 1000015000,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700358}
359
Jesse Hall23ff73f2015-11-29 14:36:39 -0800360enum VkSamplerMipmapMode {
Jesse Hall23ff73f2015-11-29 14:36:39 -0800361 VK_SAMPLER_MIPMAP_MODE_NEAREST = 0x00000001, /// Choose nearest mip level
362 VK_SAMPLER_MIPMAP_MODE_LINEAR = 0x00000002, /// Linear filter between mip levels
Jesse Halld27f6aa2015-08-15 17:58:48 -0700363}
364
Jesse Hall23ff73f2015-11-29 14:36:39 -0800365enum VkSamplerAddressMode {
Jesse Hallc7467b72015-11-29 21:05:26 -0800366 VK_SAMPLER_ADDRESS_MODE_REPEAT = 0x00000000,
367 VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT = 0x00000001,
368 VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE = 0x00000002,
369 VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER = 0x00000003,
370 VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700371}
372
373enum VkCompareOp {
374 VK_COMPARE_OP_NEVER = 0x00000000,
375 VK_COMPARE_OP_LESS = 0x00000001,
376 VK_COMPARE_OP_EQUAL = 0x00000002,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800377 VK_COMPARE_OP_LESS_OR_EQUAL = 0x00000003,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700378 VK_COMPARE_OP_GREATER = 0x00000004,
379 VK_COMPARE_OP_NOT_EQUAL = 0x00000005,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800380 VK_COMPARE_OP_GREATER_OR_EQUAL = 0x00000006,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700381 VK_COMPARE_OP_ALWAYS = 0x00000007,
382}
383
Jesse Hall65ab5522015-11-30 00:07:16 -0800384enum VkPolygonMode {
385 VK_POLYGON_MODE_FILL = 0x00000000,
386 VK_POLYGON_MODE_LINE = 0x00000001,
387 VK_POLYGON_MODE_POINT = 0x00000002,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700388}
389
390enum VkFrontFace {
Jesse Hall3fbc8562015-11-29 22:10:52 -0800391 VK_FRONT_FACE_COUNTER_CLOCKWISE = 0x00000000,
392 VK_FRONT_FACE_CLOCKWISE = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700393}
394
Jesse Hall65ab5522015-11-30 00:07:16 -0800395enum VkBlendFactor {
396 VK_BLEND_FACTOR_ZERO = 0x00000000,
397 VK_BLEND_FACTOR_ONE = 0x00000001,
398 VK_BLEND_FACTOR_SRC_COLOR = 0x00000002,
399 VK_BLEND_FACTOR_ONE_MINUS_SRC_COLOR = 0x00000003,
400 VK_BLEND_FACTOR_DST_COLOR = 0x00000004,
401 VK_BLEND_FACTOR_ONE_MINUS_DST_COLOR = 0x00000005,
402 VK_BLEND_FACTOR_SRC_ALPHA = 0x00000006,
403 VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA = 0x00000007,
404 VK_BLEND_FACTOR_DST_ALPHA = 0x00000008,
405 VK_BLEND_FACTOR_ONE_MINUS_DST_ALPHA = 0x00000009,
406 VK_BLEND_FACTOR_CONSTANT_COLOR = 0x0000000a,
407 VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR = 0x0000000b,
408 VK_BLEND_FACTOR_CONSTANT_ALPHA = 0x0000000c,
409 VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA = 0x0000000d,
410 VK_BLEND_FACTOR_SRC_ALPHA_SATURATE = 0x0000000e,
411 VK_BLEND_FACTOR_SRC1_COLOR = 0x0000000f,
412 VK_BLEND_FACTOR_ONE_MINUS_SRC1_COLOR = 0x00000010,
413 VK_BLEND_FACTOR_SRC1_ALPHA = 0x00000011,
414 VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA = 0x00000012,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700415}
416
417enum VkBlendOp {
418 VK_BLEND_OP_ADD = 0x00000000,
419 VK_BLEND_OP_SUBTRACT = 0x00000001,
420 VK_BLEND_OP_REVERSE_SUBTRACT = 0x00000002,
421 VK_BLEND_OP_MIN = 0x00000003,
422 VK_BLEND_OP_MAX = 0x00000004,
423}
424
425enum VkStencilOp {
426 VK_STENCIL_OP_KEEP = 0x00000000,
427 VK_STENCIL_OP_ZERO = 0x00000001,
428 VK_STENCIL_OP_REPLACE = 0x00000002,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800429 VK_STENCIL_OP_INCREMENT_AND_CLAMP = 0x00000003,
430 VK_STENCIL_OP_DECREMENT_AND_CLAMP = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700431 VK_STENCIL_OP_INVERT = 0x00000005,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800432 VK_STENCIL_OP_INCREMENT_AND_WRAP = 0x00000006,
433 VK_STENCIL_OP_DECREMENT_AND_WRAP = 0x00000007,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700434}
435
436enum VkLogicOp {
437 VK_LOGIC_OP_CLEAR = 0x00000000,
438 VK_LOGIC_OP_AND = 0x00000001,
439 VK_LOGIC_OP_AND_REVERSE = 0x00000002,
440 VK_LOGIC_OP_COPY = 0x00000003,
441 VK_LOGIC_OP_AND_INVERTED = 0x00000004,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800442 VK_LOGIC_OP_NO_OP = 0x00000005,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700443 VK_LOGIC_OP_XOR = 0x00000006,
444 VK_LOGIC_OP_OR = 0x00000007,
445 VK_LOGIC_OP_NOR = 0x00000008,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800446 VK_LOGIC_OP_EQUIVALENT = 0x00000009,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700447 VK_LOGIC_OP_INVERT = 0x0000000a,
448 VK_LOGIC_OP_OR_REVERSE = 0x0000000b,
449 VK_LOGIC_OP_COPY_INVERTED = 0x0000000c,
450 VK_LOGIC_OP_OR_INVERTED = 0x0000000d,
451 VK_LOGIC_OP_NAND = 0x0000000e,
452 VK_LOGIC_OP_SET = 0x0000000f,
453}
454
Jesse Hall3fbc8562015-11-29 22:10:52 -0800455enum VkSystemAllocationScope {
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800456 VK_SYSTEM_ALLOCATION_SCOPE_COMMAND = 0x00000000,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800457 VK_SYSTEM_ALLOCATION_SCOPE_OBJECT = 0x00000001,
458 VK_SYSTEM_ALLOCATION_SCOPE_CACHE = 0x00000002,
459 VK_SYSTEM_ALLOCATION_SCOPE_DEVICE = 0x00000003,
460 VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE = 0x00000004,
Jesse Hall03b6fe12015-11-24 12:44:21 -0800461}
462
Jesse Hall3fbc8562015-11-29 22:10:52 -0800463enum VkInternalAllocationType {
464 VK_INTERNAL_ALLOCATION_TYPE_EXECUTABLE = 0x00000000,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700465}
466
467enum VkPhysicalDeviceType {
468 VK_PHYSICAL_DEVICE_TYPE_OTHER = 0x00000000,
469 VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU = 0x00000001,
470 VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU = 0x00000002,
471 VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU = 0x00000003,
472 VK_PHYSICAL_DEVICE_TYPE_CPU = 0x00000004,
473}
474
Jesse Hall65ab5522015-11-30 00:07:16 -0800475enum VkVertexInputRate {
476 VK_VERTEX_INPUT_RATE_VERTEX = 0x00000000,
477 VK_VERTEX_INPUT_RATE_INSTANCE = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700478}
479
480/// Vulkan format definitions
481enum VkFormat {
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800482 VK_FORMAT_UNDEFINED = 0,
483 VK_FORMAT_R4G4_UNORM_PACK8 = 1,
484 VK_FORMAT_R4G4B4A4_UNORM_PACK16 = 2,
485 VK_FORMAT_B4G4R4A4_UNORM_PACK16 = 3,
486 VK_FORMAT_R5G6B5_UNORM_PACK16 = 4,
487 VK_FORMAT_B5G6R5_UNORM_PACK16 = 5,
488 VK_FORMAT_R5G5B5A1_UNORM_PACK16 = 6,
489 VK_FORMAT_B5G5R5A1_UNORM_PACK16 = 7,
490 VK_FORMAT_A1R5G5B5_UNORM_PACK16 = 8,
491 VK_FORMAT_R8_UNORM = 9,
492 VK_FORMAT_R8_SNORM = 10,
493 VK_FORMAT_R8_USCALED = 11,
494 VK_FORMAT_R8_SSCALED = 12,
495 VK_FORMAT_R8_UINT = 13,
496 VK_FORMAT_R8_SINT = 14,
497 VK_FORMAT_R8_SRGB = 15,
498 VK_FORMAT_R8G8_UNORM = 16,
499 VK_FORMAT_R8G8_SNORM = 17,
500 VK_FORMAT_R8G8_USCALED = 18,
501 VK_FORMAT_R8G8_SSCALED = 19,
502 VK_FORMAT_R8G8_UINT = 20,
503 VK_FORMAT_R8G8_SINT = 21,
504 VK_FORMAT_R8G8_SRGB = 22,
505 VK_FORMAT_R8G8B8_UNORM = 23,
506 VK_FORMAT_R8G8B8_SNORM = 24,
507 VK_FORMAT_R8G8B8_USCALED = 25,
508 VK_FORMAT_R8G8B8_SSCALED = 26,
509 VK_FORMAT_R8G8B8_UINT = 27,
510 VK_FORMAT_R8G8B8_SINT = 28,
511 VK_FORMAT_R8G8B8_SRGB = 29,
512 VK_FORMAT_B8G8R8_UNORM = 30,
513 VK_FORMAT_B8G8R8_SNORM = 31,
514 VK_FORMAT_B8G8R8_USCALED = 32,
515 VK_FORMAT_B8G8R8_SSCALED = 33,
516 VK_FORMAT_B8G8R8_UINT = 34,
517 VK_FORMAT_B8G8R8_SINT = 35,
518 VK_FORMAT_B8G8R8_SRGB = 36,
519 VK_FORMAT_R8G8B8A8_UNORM = 37,
520 VK_FORMAT_R8G8B8A8_SNORM = 38,
521 VK_FORMAT_R8G8B8A8_USCALED = 39,
522 VK_FORMAT_R8G8B8A8_SSCALED = 40,
523 VK_FORMAT_R8G8B8A8_UINT = 41,
524 VK_FORMAT_R8G8B8A8_SINT = 42,
525 VK_FORMAT_R8G8B8A8_SRGB = 43,
526 VK_FORMAT_B8G8R8A8_UNORM = 44,
527 VK_FORMAT_B8G8R8A8_SNORM = 45,
528 VK_FORMAT_B8G8R8A8_USCALED = 46,
529 VK_FORMAT_B8G8R8A8_SSCALED = 47,
530 VK_FORMAT_B8G8R8A8_UINT = 48,
531 VK_FORMAT_B8G8R8A8_SINT = 49,
532 VK_FORMAT_B8G8R8A8_SRGB = 50,
533 VK_FORMAT_A8B8G8R8_UNORM_PACK32 = 51,
534 VK_FORMAT_A8B8G8R8_SNORM_PACK32 = 52,
535 VK_FORMAT_A8B8G8R8_USCALED_PACK32 = 53,
536 VK_FORMAT_A8B8G8R8_SSCALED_PACK32 = 54,
537 VK_FORMAT_A8B8G8R8_UINT_PACK32 = 55,
538 VK_FORMAT_A8B8G8R8_SINT_PACK32 = 56,
539 VK_FORMAT_A8B8G8R8_SRGB_PACK32 = 57,
540 VK_FORMAT_A2R10G10B10_UNORM_PACK32 = 58,
541 VK_FORMAT_A2R10G10B10_SNORM_PACK32 = 59,
542 VK_FORMAT_A2R10G10B10_USCALED_PACK32 = 60,
543 VK_FORMAT_A2R10G10B10_SSCALED_PACK32 = 61,
544 VK_FORMAT_A2R10G10B10_UINT_PACK32 = 62,
545 VK_FORMAT_A2R10G10B10_SINT_PACK32 = 63,
546 VK_FORMAT_A2B10G10R10_UNORM_PACK32 = 64,
547 VK_FORMAT_A2B10G10R10_SNORM_PACK32 = 65,
548 VK_FORMAT_A2B10G10R10_USCALED_PACK32 = 66,
549 VK_FORMAT_A2B10G10R10_SSCALED_PACK32 = 67,
550 VK_FORMAT_A2B10G10R10_UINT_PACK32 = 68,
551 VK_FORMAT_A2B10G10R10_SINT_PACK32 = 69,
552 VK_FORMAT_R16_UNORM = 70,
553 VK_FORMAT_R16_SNORM = 71,
554 VK_FORMAT_R16_USCALED = 72,
555 VK_FORMAT_R16_SSCALED = 73,
556 VK_FORMAT_R16_UINT = 74,
557 VK_FORMAT_R16_SINT = 75,
558 VK_FORMAT_R16_SFLOAT = 76,
559 VK_FORMAT_R16G16_UNORM = 77,
560 VK_FORMAT_R16G16_SNORM = 78,
561 VK_FORMAT_R16G16_USCALED = 79,
562 VK_FORMAT_R16G16_SSCALED = 80,
563 VK_FORMAT_R16G16_UINT = 81,
564 VK_FORMAT_R16G16_SINT = 82,
565 VK_FORMAT_R16G16_SFLOAT = 83,
566 VK_FORMAT_R16G16B16_UNORM = 84,
567 VK_FORMAT_R16G16B16_SNORM = 85,
568 VK_FORMAT_R16G16B16_USCALED = 86,
569 VK_FORMAT_R16G16B16_SSCALED = 87,
570 VK_FORMAT_R16G16B16_UINT = 88,
571 VK_FORMAT_R16G16B16_SINT = 89,
572 VK_FORMAT_R16G16B16_SFLOAT = 90,
573 VK_FORMAT_R16G16B16A16_UNORM = 91,
574 VK_FORMAT_R16G16B16A16_SNORM = 92,
575 VK_FORMAT_R16G16B16A16_USCALED = 93,
576 VK_FORMAT_R16G16B16A16_SSCALED = 94,
577 VK_FORMAT_R16G16B16A16_UINT = 95,
578 VK_FORMAT_R16G16B16A16_SINT = 96,
579 VK_FORMAT_R16G16B16A16_SFLOAT = 97,
580 VK_FORMAT_R32_UINT = 98,
581 VK_FORMAT_R32_SINT = 99,
582 VK_FORMAT_R32_SFLOAT = 100,
583 VK_FORMAT_R32G32_UINT = 101,
584 VK_FORMAT_R32G32_SINT = 102,
585 VK_FORMAT_R32G32_SFLOAT = 103,
586 VK_FORMAT_R32G32B32_UINT = 104,
587 VK_FORMAT_R32G32B32_SINT = 105,
588 VK_FORMAT_R32G32B32_SFLOAT = 106,
589 VK_FORMAT_R32G32B32A32_UINT = 107,
590 VK_FORMAT_R32G32B32A32_SINT = 108,
591 VK_FORMAT_R32G32B32A32_SFLOAT = 109,
592 VK_FORMAT_R64_UINT = 110,
593 VK_FORMAT_R64_SINT = 111,
594 VK_FORMAT_R64_SFLOAT = 112,
595 VK_FORMAT_R64G64_UINT = 113,
596 VK_FORMAT_R64G64_SINT = 114,
597 VK_FORMAT_R64G64_SFLOAT = 115,
598 VK_FORMAT_R64G64B64_UINT = 116,
599 VK_FORMAT_R64G64B64_SINT = 117,
600 VK_FORMAT_R64G64B64_SFLOAT = 118,
601 VK_FORMAT_R64G64B64A64_UINT = 119,
602 VK_FORMAT_R64G64B64A64_SINT = 120,
603 VK_FORMAT_R64G64B64A64_SFLOAT = 121,
604 VK_FORMAT_B10G11R11_UFLOAT_PACK32 = 122,
605 VK_FORMAT_E5B9G9R9_UFLOAT_PACK32 = 123,
606 VK_FORMAT_D16_UNORM = 124,
607 VK_FORMAT_X8_D24_UNORM_PACK32 = 125,
608 VK_FORMAT_D32_SFLOAT = 126,
609 VK_FORMAT_S8_UINT = 127,
610 VK_FORMAT_D16_UNORM_S8_UINT = 128,
611 VK_FORMAT_D24_UNORM_S8_UINT = 129,
612 VK_FORMAT_D32_SFLOAT_S8_UINT = 130,
613 VK_FORMAT_BC1_RGB_UNORM_BLOCK = 131,
614 VK_FORMAT_BC1_RGB_SRGB_BLOCK = 132,
615 VK_FORMAT_BC1_RGBA_UNORM_BLOCK = 133,
616 VK_FORMAT_BC1_RGBA_SRGB_BLOCK = 134,
617 VK_FORMAT_BC2_UNORM_BLOCK = 135,
618 VK_FORMAT_BC2_SRGB_BLOCK = 136,
619 VK_FORMAT_BC3_UNORM_BLOCK = 137,
620 VK_FORMAT_BC3_SRGB_BLOCK = 138,
621 VK_FORMAT_BC4_UNORM_BLOCK = 139,
622 VK_FORMAT_BC4_SNORM_BLOCK = 140,
623 VK_FORMAT_BC5_UNORM_BLOCK = 141,
624 VK_FORMAT_BC5_SNORM_BLOCK = 142,
625 VK_FORMAT_BC6H_UFLOAT_BLOCK = 143,
626 VK_FORMAT_BC6H_SFLOAT_BLOCK = 144,
627 VK_FORMAT_BC7_UNORM_BLOCK = 145,
628 VK_FORMAT_BC7_SRGB_BLOCK = 146,
629 VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK = 147,
630 VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK = 148,
631 VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK = 149,
632 VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK = 150,
633 VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK = 151,
634 VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK = 152,
635 VK_FORMAT_EAC_R11_UNORM_BLOCK = 153,
636 VK_FORMAT_EAC_R11_SNORM_BLOCK = 154,
637 VK_FORMAT_EAC_R11G11_UNORM_BLOCK = 155,
638 VK_FORMAT_EAC_R11G11_SNORM_BLOCK = 156,
639 VK_FORMAT_ASTC_4x4_UNORM_BLOCK = 157,
640 VK_FORMAT_ASTC_4x4_SRGB_BLOCK = 158,
641 VK_FORMAT_ASTC_5x4_UNORM_BLOCK = 159,
642 VK_FORMAT_ASTC_5x4_SRGB_BLOCK = 160,
643 VK_FORMAT_ASTC_5x5_UNORM_BLOCK = 161,
644 VK_FORMAT_ASTC_5x5_SRGB_BLOCK = 162,
645 VK_FORMAT_ASTC_6x5_UNORM_BLOCK = 163,
646 VK_FORMAT_ASTC_6x5_SRGB_BLOCK = 164,
647 VK_FORMAT_ASTC_6x6_UNORM_BLOCK = 165,
648 VK_FORMAT_ASTC_6x6_SRGB_BLOCK = 166,
649 VK_FORMAT_ASTC_8x5_UNORM_BLOCK = 167,
650 VK_FORMAT_ASTC_8x5_SRGB_BLOCK = 168,
651 VK_FORMAT_ASTC_8x6_UNORM_BLOCK = 169,
652 VK_FORMAT_ASTC_8x6_SRGB_BLOCK = 170,
653 VK_FORMAT_ASTC_8x8_UNORM_BLOCK = 171,
654 VK_FORMAT_ASTC_8x8_SRGB_BLOCK = 172,
655 VK_FORMAT_ASTC_10x5_UNORM_BLOCK = 173,
656 VK_FORMAT_ASTC_10x5_SRGB_BLOCK = 174,
657 VK_FORMAT_ASTC_10x6_UNORM_BLOCK = 175,
658 VK_FORMAT_ASTC_10x6_SRGB_BLOCK = 176,
659 VK_FORMAT_ASTC_10x8_UNORM_BLOCK = 177,
660 VK_FORMAT_ASTC_10x8_SRGB_BLOCK = 178,
661 VK_FORMAT_ASTC_10x10_UNORM_BLOCK = 179,
662 VK_FORMAT_ASTC_10x10_SRGB_BLOCK = 180,
663 VK_FORMAT_ASTC_12x10_UNORM_BLOCK = 181,
664 VK_FORMAT_ASTC_12x10_SRGB_BLOCK = 182,
665 VK_FORMAT_ASTC_12x12_UNORM_BLOCK = 183,
666 VK_FORMAT_ASTC_12x12_SRGB_BLOCK = 184,
Jesse Halleb02c472017-02-24 15:13:45 -0800667
668 //@extension("VK_IMG_format_pvrtc")
669 VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG = 1000054000,
670 VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG = 1000054001,
671 VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG = 1000054002,
672 VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG = 1000054003,
673 VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG = 1000054004,
674 VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG = 1000054005,
675 VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG = 1000054006,
676 VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG = 1000054007,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700677}
678
Jesse Halld27f6aa2015-08-15 17:58:48 -0700679/// Structure type enumerant
680enum VkStructureType {
681 VK_STRUCTURE_TYPE_APPLICATION_INFO = 0,
Jesse Hallc7467b72015-11-29 21:05:26 -0800682 VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO = 1,
683 VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO = 2,
684 VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO = 3,
685 VK_STRUCTURE_TYPE_SUBMIT_INFO = 4,
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800686 VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO = 5,
Jesse Hallc7467b72015-11-29 21:05:26 -0800687 VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE = 6,
688 VK_STRUCTURE_TYPE_BIND_SPARSE_INFO = 7,
689 VK_STRUCTURE_TYPE_FENCE_CREATE_INFO = 8,
690 VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO = 9,
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700691 VK_STRUCTURE_TYPE_EVENT_CREATE_INFO = 10,
Jesse Hallc7467b72015-11-29 21:05:26 -0800692 VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO = 11,
693 VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO = 12,
694 VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO = 13,
695 VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO = 14,
696 VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO = 15,
697 VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO = 16,
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800698 VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO = 17,
699 VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO = 18,
700 VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO = 19,
701 VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO = 20,
702 VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO = 21,
703 VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO = 22,
704 VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO = 23,
705 VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO = 24,
706 VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO = 25,
707 VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO = 26,
708 VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO = 27,
709 VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO = 28,
710 VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO = 29,
711 VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO = 30,
712 VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO = 31,
713 VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO = 32,
714 VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO = 33,
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800715 VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO = 34,
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800716 VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET = 35,
717 VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET = 36,
718 VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO = 37,
719 VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO = 38,
720 VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO = 39,
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800721 VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO = 40,
Jesse Hall3dd678a2016-01-08 21:52:01 -0800722 VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO = 41,
723 VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO = 42,
724 VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO = 43,
725 VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER = 44,
726 VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER = 45,
727 VK_STRUCTURE_TYPE_MEMORY_BARRIER = 46,
728 VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO = 47,
729 VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO = 48,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800730
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800731 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800732 VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR = 1000001000,
733 VK_STRUCTURE_TYPE_PRESENT_INFO_KHR = 1000001001,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800734
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800735 //@extension("VK_KHR_display")
Jesse Hallbd888842015-11-30 21:44:14 -0800736 VK_STRUCTURE_TYPE_DISPLAY_MODE_CREATE_INFO_KHR = 1000002000,
737 VK_STRUCTURE_TYPE_DISPLAY_SURFACE_CREATE_INFO_KHR = 1000002001,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800738
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800739 //@extension("VK_KHR_display_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800740 VK_STRUCTURE_TYPE_DISPLAY_DISPLAY_PRESENT_INFO_KHR = 1000003000,
Jesse Hallf9fa9a52016-01-08 16:08:51 -0800741
742 //@extension("VK_KHR_xlib_surface")
743 VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR = 1000004000,
744
745 //@extension("VK_KHR_xcb_surface")
746 VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR = 1000005000,
747
748 //@extension("VK_KHR_wayland_surface")
749 VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR = 1000006000,
750
751 //@extension("VK_KHR_mir_surface")
752 VK_STRUCTURE_TYPE_MIR_SURFACE_CREATE_INFO_KHR = 1000007000,
753
754 //@extension("VK_KHR_android_surface")
755 VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR = 1000008000,
756
757 //@extension("VK_KHR_win32_surface")
758 VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR = 1000009000,
Jesse Hall543a7ff2016-01-08 16:38:30 -0800759
Chia-I Wub262ddc2016-03-22 07:38:20 +0800760 //@extension("VK_ANDROID_native_buffer")
761 VK_STRUCTURE_TYPE_NATIVE_BUFFER_ANDROID = 1000010000,
762
Jesse Hall543a7ff2016-01-08 16:38:30 -0800763 //@extension("VK_EXT_debug_report")
Jesse Hall26763382016-05-20 07:13:52 -0700764 VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT = 1000011000,
765
766 //@extension("VK_AMD_rasterization_order")
767 VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD = 1000018000,
768
769 //@extension("VK_EXT_debug_marker")
770 VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_NAME_INFO_EXT = 1000022000,
Jesse Hall26763382016-05-20 07:13:52 -0700771 VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_TAG_INFO_EXT = 1000022001,
Jesse Hall26763382016-05-20 07:13:52 -0700772 VK_STRUCTURE_TYPE_DEBUG_MARKER_MARKER_INFO_EXT = 1000022002,
Jesse Hall3f5499b2016-07-26 15:20:40 -0700773
774 //@extension("VK_NV_dedicated_allocation")
775 VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV = 1000026000,
Jesse Hall3f5499b2016-07-26 15:20:40 -0700776 VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV = 1000026001,
Jesse Hall3f5499b2016-07-26 15:20:40 -0700777 VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV = 1000026002,
Jesse Halleb02c472017-02-24 15:13:45 -0800778
779 //@extension("VK_NV_external_memory")
780 VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_NV = 1000056000,
781 VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_NV = 1000056001,
782
783 //@extension("VK_NV_external_memory_win32")
784 VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_NV = 1000057000,
785 VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_NV = 1000057001,
786
787 //@extension("VK_NV_win32_keyed_mutex")
788 VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_NV = 1000058000,
789
790 //@extension("VK_EXT_validation_flags")
791 VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT = 1000061000,
792
793 //@extension("VK_NVX_device_generated_commands")
794 VK_STRUCTURE_TYPE_OBJECT_TABLE_CREATE_INFO_NVX = 1000086000,
795 VK_STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_CREATE_INFO_NVX = 1000086001,
796 VK_STRUCTURE_TYPE_CMD_PROCESS_COMMANDS_INFO_NVX = 1000086002,
797 VK_STRUCTURE_TYPE_CMD_RESERVE_SPACE_FOR_COMMANDS_INFO_NVX = 1000086003,
798 VK_STRUCTURE_TYPE_DEVICE_GENERATED_COMMANDS_LIMITS_NVX = 1000086004,
799 VK_STRUCTURE_TYPE_DEVICE_GENERATED_COMMANDS_FEATURES_NVX = 1000086005,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700800}
801
Jesse Hall65ab5522015-11-30 00:07:16 -0800802enum VkSubpassContents {
803 VK_SUBPASS_CONTENTS_INLINE = 0x00000000,
804 VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700805}
806
Jesse Hall543a7ff2016-01-08 16:38:30 -0800807enum VkPipelineCacheHeaderVersion {
808 VK_PIPELINE_CACHE_HEADER_VERSION_ONE = 1,
809}
810
Jesse Hallbd888842015-11-30 21:44:14 -0800811@lastUnused(-11)
Jesse Halld27f6aa2015-08-15 17:58:48 -0700812/// Error and return codes
813enum VkResult {
814 // Return codes for successful operation execution (positive values)
Jesse Hallbd888842015-11-30 21:44:14 -0800815 VK_SUCCESS = 0,
816 VK_NOT_READY = 1,
817 VK_TIMEOUT = 2,
818 VK_EVENT_SET = 3,
819 VK_EVENT_RESET = 4,
820 VK_INCOMPLETE = 5,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700821
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800822 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800823 VK_SUBOPTIMAL_KHR = 1000001003,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800824
Jesse Halld27f6aa2015-08-15 17:58:48 -0700825 // Error codes (negative values)
Jesse Hallbd888842015-11-30 21:44:14 -0800826 VK_ERROR_OUT_OF_HOST_MEMORY = 0xFFFFFFFF, // -1
827 VK_ERROR_OUT_OF_DEVICE_MEMORY = 0xFFFFFFFE, // -2
828 VK_ERROR_INITIALIZATION_FAILED = 0xFFFFFFFD, // -3
829 VK_ERROR_DEVICE_LOST = 0xFFFFFFFC, // -4
830 VK_ERROR_MEMORY_MAP_FAILED = 0xFFFFFFFB, // -5
831 VK_ERROR_LAYER_NOT_PRESENT = 0xFFFFFFFA, // -6
832 VK_ERROR_EXTENSION_NOT_PRESENT = 0xFFFFFFF9, // -7
833 VK_ERROR_FEATURE_NOT_PRESENT = 0xFFFFFFF8, // -8
834 VK_ERROR_INCOMPATIBLE_DRIVER = 0xFFFFFFF7, // -9
835 VK_ERROR_TOO_MANY_OBJECTS = 0xFFFFFFF6, // -10
836 VK_ERROR_FORMAT_NOT_SUPPORTED = 0xFFFFFFF5, // -11
Jesse Hall3f5499b2016-07-26 15:20:40 -0700837 VK_ERROR_FRAGMENTED_POOL = 0xFFFFFFF4, // -12
Jesse Hall1356b0d2015-11-23 17:24:58 -0800838
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800839 //@extension("VK_KHR_surface")
Jesse Hallbd888842015-11-30 21:44:14 -0800840 VK_ERROR_SURFACE_LOST_KHR = 0xC4653600, // -1000000000
Jesse Halla6429252015-11-29 18:59:42 -0800841
Jesse Hall563380d2016-01-15 23:14:05 -0800842 //@extension("VK_KHR_surface")
843 VK_ERROR_NATIVE_WINDOW_IN_USE_KHR = 0xC46535FF, // -1000008001
844
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800845 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800846 VK_ERROR_OUT_OF_DATE_KHR = 0xC4653214, // -1000001004
Jesse Hall1356b0d2015-11-23 17:24:58 -0800847
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800848 //@extension("VK_KHR_display_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800849 VK_ERROR_INCOMPATIBLE_DISPLAY_KHR = 0xC4652A47, // -1000003001
Jesse Hall1356b0d2015-11-23 17:24:58 -0800850
Jesse Hall543a7ff2016-01-08 16:38:30 -0800851 //@extension("VK_EXT_debug_report")
852 VK_ERROR_VALIDATION_FAILED_EXT = 0xC4650B07, // -1000011001
Jesse Hall26763382016-05-20 07:13:52 -0700853
854 //@extension("VK_NV_glsl_shader")
855 VK_ERROR_INVALID_SHADER_NV = 0xC4650720, // -1000012000
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700856}
857
858enum VkDynamicState {
859 VK_DYNAMIC_STATE_VIEWPORT = 0x00000000,
860 VK_DYNAMIC_STATE_SCISSOR = 0x00000001,
861 VK_DYNAMIC_STATE_LINE_WIDTH = 0x00000002,
862 VK_DYNAMIC_STATE_DEPTH_BIAS = 0x00000003,
863 VK_DYNAMIC_STATE_BLEND_CONSTANTS = 0x00000004,
864 VK_DYNAMIC_STATE_DEPTH_BOUNDS = 0x00000005,
865 VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK = 0x00000006,
866 VK_DYNAMIC_STATE_STENCIL_WRITE_MASK = 0x00000007,
867 VK_DYNAMIC_STATE_STENCIL_REFERENCE = 0x00000008,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700868}
869
Jesse Hall523db342015-11-30 21:12:55 -0800870@extension("VK_KHR_surface")
Michael Lentine88594d72015-11-12 12:49:45 -0800871enum VkPresentModeKHR {
872 VK_PRESENT_MODE_IMMEDIATE_KHR = 0x00000000,
873 VK_PRESENT_MODE_MAILBOX_KHR = 0x00000001,
874 VK_PRESENT_MODE_FIFO_KHR = 0x00000002,
Jesse Hall03b6fe12015-11-24 12:44:21 -0800875 VK_PRESENT_MODE_FIFO_RELAXED_KHR = 0x00000003,
Michael Lentine88594d72015-11-12 12:49:45 -0800876}
877
Jesse Hall523db342015-11-30 21:12:55 -0800878@extension("VK_KHR_surface")
Michael Lentine88594d72015-11-12 12:49:45 -0800879enum VkColorSpaceKHR {
880 VK_COLORSPACE_SRGB_NONLINEAR_KHR = 0x00000000,
881}
Jesse Halld27f6aa2015-08-15 17:58:48 -0700882
Jesse Hall715b86a2016-01-16 16:34:29 -0800883@extension("VK_EXT_debug_report")
884enum VkDebugReportObjectTypeEXT {
885 VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT = 0,
886 VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT = 1,
887 VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT = 2,
888 VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT = 3,
889 VK_DEBUG_REPORT_OBJECT_TYPE_QUEUE_EXT = 4,
890 VK_DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT = 5,
891 VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT = 6,
892 VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT = 7,
893 VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT = 8,
894 VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT = 9,
895 VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT = 10,
896 VK_DEBUG_REPORT_OBJECT_TYPE_EVENT_EXT = 11,
897 VK_DEBUG_REPORT_OBJECT_TYPE_QUERY_POOL_EXT = 12,
898 VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_VIEW_EXT = 13,
899 VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_VIEW_EXT = 14,
900 VK_DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT = 15,
901 VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_CACHE_EXT = 16,
902 VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_LAYOUT_EXT = 17,
903 VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT = 18,
904 VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT = 19,
905 VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT_EXT = 20,
906 VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_EXT = 21,
907 VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT = 22,
908 VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT = 23,
909 VK_DEBUG_REPORT_OBJECT_TYPE_FRAMEBUFFER_EXT = 24,
910 VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_POOL_EXT = 25,
911 VK_DEBUG_REPORT_OBJECT_TYPE_SURFACE_KHR_EXT = 26,
912 VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT = 27,
913 VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_EXT = 28,
Jesse Halleb02c472017-02-24 15:13:45 -0800914 VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_KHR_EXT = 29,
915 VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_MODE_KHR_EXT = 30,
916 VK_DEBUG_REPORT_OBJECT_TYPE_OBJECT_TABLE_NVX_EXT = 31,
917 VK_DEBUG_REPORT_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NVX_EXT = 32,
Jesse Hall715b86a2016-01-16 16:34:29 -0800918}
919
920@extension("VK_EXT_debug_report")
921enum VkDebugReportErrorEXT {
922 VK_DEBUG_REPORT_ERROR_NONE_EXT = 0,
923 VK_DEBUG_REPORT_ERROR_CALLBACK_REF_EXT = 1,
924}
925
Jesse Hall26763382016-05-20 07:13:52 -0700926@extension("VK_AMD_rasterization_order")
927enum VkRasterizationOrderAMD {
928 VK_RASTERIZATION_ORDER_STRICT_AMD = 0,
929 VK_RASTERIZATION_ORDER_RELAXED_AMD = 1,
930}
931
Jesse Halleb02c472017-02-24 15:13:45 -0800932@extension("VK_EXT_validation_flags")
933enum VkValidationCheckEXT {
934 VK_VALIDATION_CHECK_ALL_EXT = 0,
935}
936
937@extension("VK_NVX_device_generated_commands")
938enum VkIndirectCommandsTokenTypeNVX {
939 VK_INDIRECT_COMMANDS_TOKEN_PIPELINE_NVX = 0,
940 VK_INDIRECT_COMMANDS_TOKEN_DESCRIPTOR_SET_NVX = 1,
941 VK_INDIRECT_COMMANDS_TOKEN_INDEX_BUFFER_NVX = 2,
942 VK_INDIRECT_COMMANDS_TOKEN_VERTEX_BUFFER_NVX = 3,
943 VK_INDIRECT_COMMANDS_TOKEN_PUSH_CONSTANT_NVX = 4,
944 VK_INDIRECT_COMMANDS_TOKEN_DRAW_INDEXED_NVX = 5,
945 VK_INDIRECT_COMMANDS_TOKEN_DRAW_NVX = 6,
946 VK_INDIRECT_COMMANDS_TOKEN_DISPATCH_NVX = 7,
947}
948
949@extension("VK_NVX_device_generated_commands")
950enum VkObjectEntryTypeNVX {
951 VK_OBJECT_ENTRY_DESCRIPTOR_SET_NVX = 0,
952 VK_OBJECT_ENTRY_PIPELINE_NVX = 1,
953 VK_OBJECT_ENTRY_INDEX_BUFFER_NVX = 2,
954 VK_OBJECT_ENTRY_VERTEX_BUFFER_NVX = 3,
955 VK_OBJECT_ENTRY_PUSH_CONSTANT_NVX = 4,
956}
Jesse Hall715b86a2016-01-16 16:34:29 -0800957
Jesse Halld27f6aa2015-08-15 17:58:48 -0700958/////////////////
959// Bitfields //
960/////////////////
961
Jesse Halld27f6aa2015-08-15 17:58:48 -0700962/// Queue capabilities
Jesse Halld8bade02015-11-24 10:24:18 -0800963type VkFlags VkQueueFlags
964bitfield VkQueueFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -0700965 VK_QUEUE_GRAPHICS_BIT = 0x00000001, /// Queue supports graphics operations
966 VK_QUEUE_COMPUTE_BIT = 0x00000002, /// Queue supports compute operations
Jesse Hall65ab5522015-11-30 00:07:16 -0800967 VK_QUEUE_TRANSFER_BIT = 0x00000004, /// Queue supports transfer operations
Jesse Hallb00daad2015-11-29 19:46:20 -0800968 VK_QUEUE_SPARSE_BINDING_BIT = 0x00000008, /// Queue supports sparse resource memory management operations
Jesse Halld27f6aa2015-08-15 17:58:48 -0700969}
970
971/// Memory properties passed into vkAllocMemory().
Jesse Halld8bade02015-11-24 10:24:18 -0800972type VkFlags VkMemoryPropertyFlags
973bitfield VkMemoryPropertyFlagBits {
Jesse Halld1af8122015-11-29 23:50:38 -0800974 VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT = 0x00000001,
975 VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT = 0x00000002,
976 VK_MEMORY_PROPERTY_HOST_COHERENT_BIT = 0x00000004,
977 VK_MEMORY_PROPERTY_HOST_CACHED_BIT = 0x00000008,
978 VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT = 0x00000010,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700979}
980
981/// Memory heap flags
Jesse Halld8bade02015-11-24 10:24:18 -0800982type VkFlags VkMemoryHeapFlags
983bitfield VkMemoryHeapFlagBits {
Jesse Halld1af8122015-11-29 23:50:38 -0800984 VK_MEMORY_HEAP_DEVICE_LOCAL_BIT = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700985}
986
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800987/// Access flags
988type VkFlags VkAccessFlags
989bitfield VkAccessFlagBits {
990 VK_ACCESS_INDIRECT_COMMAND_READ_BIT = 0x00000001,
991 VK_ACCESS_INDEX_READ_BIT = 0x00000002,
992 VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT = 0x00000004,
993 VK_ACCESS_UNIFORM_READ_BIT = 0x00000008,
994 VK_ACCESS_INPUT_ATTACHMENT_READ_BIT = 0x00000010,
995 VK_ACCESS_SHADER_READ_BIT = 0x00000020,
996 VK_ACCESS_SHADER_WRITE_BIT = 0x00000040,
997 VK_ACCESS_COLOR_ATTACHMENT_READ_BIT = 0x00000080,
998 VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT = 0x00000100,
999 VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT = 0x00000200,
1000 VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT = 0x00000400,
1001 VK_ACCESS_TRANSFER_READ_BIT = 0x00000800,
1002 VK_ACCESS_TRANSFER_WRITE_BIT = 0x00001000,
1003 VK_ACCESS_HOST_READ_BIT = 0x00002000,
1004 VK_ACCESS_HOST_WRITE_BIT = 0x00004000,
1005 VK_ACCESS_MEMORY_READ_BIT = 0x00008000,
1006 VK_ACCESS_MEMORY_WRITE_BIT = 0x00010000,
Jesse Halleb02c472017-02-24 15:13:45 -08001007
1008 //@extension("VK_NVX_device_generated_commands")
1009 VK_ACCESS_COMMAND_PROCESS_READ_BIT_NVX = 0x00020000,
1010 VK_ACCESS_COMMAND_PROCESS_WRITE_BIT_NVX = 0x00040000,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001011}
1012
1013/// Buffer usage flags
Jesse Halld8bade02015-11-24 10:24:18 -08001014type VkFlags VkBufferUsageFlags
1015bitfield VkBufferUsageFlagBits {
Jesse Hall3fbc8562015-11-29 22:10:52 -08001016 VK_BUFFER_USAGE_TRANSFER_SRC_BIT = 0x00000001, /// Can be used as a source of transfer operations
1017 VK_BUFFER_USAGE_TRANSFER_DST_BIT = 0x00000002, /// Can be used as a destination of transfer operations
Jesse Halld27f6aa2015-08-15 17:58:48 -07001018 VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000004, /// Can be used as TBO
1019 VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT = 0x00000008, /// Can be used as IBO
1020 VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT = 0x00000010, /// Can be used as UBO
1021 VK_BUFFER_USAGE_STORAGE_BUFFER_BIT = 0x00000020, /// Can be used as SSBO
1022 VK_BUFFER_USAGE_INDEX_BUFFER_BIT = 0x00000040, /// Can be used as source of fixed function index fetch (index buffer)
1023 VK_BUFFER_USAGE_VERTEX_BUFFER_BIT = 0x00000080, /// Can be used as source of fixed function vertex fetch (VBO)
1024 VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT = 0x00000100, /// Can be the source of indirect parameters (e.g. indirect buffer, parameter buffer)
1025}
1026
1027/// Buffer creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001028type VkFlags VkBufferCreateFlags
1029bitfield VkBufferCreateFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001030 VK_BUFFER_CREATE_SPARSE_BINDING_BIT = 0x00000001, /// Buffer should support sparse backing
Jesse Halld27f6aa2015-08-15 17:58:48 -07001031 VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002, /// Buffer should support sparse backing with partial residency
1032 VK_BUFFER_CREATE_SPARSE_ALIASED_BIT = 0x00000004, /// Buffer should support constent data access to physical memory blocks mapped into multiple locations of sparse buffers
1033}
1034
1035/// Shader stage flags
Jesse Halld8bade02015-11-24 10:24:18 -08001036type VkFlags VkShaderStageFlags
1037bitfield VkShaderStageFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001038 VK_SHADER_STAGE_VERTEX_BIT = 0x00000001,
Jesse Hallae38f732015-11-19 21:32:50 -08001039 VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT = 0x00000002,
1040 VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001041 VK_SHADER_STAGE_GEOMETRY_BIT = 0x00000008,
1042 VK_SHADER_STAGE_FRAGMENT_BIT = 0x00000010,
1043 VK_SHADER_STAGE_COMPUTE_BIT = 0x00000020,
Jesse Hallc7467b72015-11-29 21:05:26 -08001044 VK_SHADER_STAGE_ALL_GRAPHICS = 0x0000001F,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001045
1046 VK_SHADER_STAGE_ALL = 0x7FFFFFFF,
1047}
1048
Jesse Hallfbf97b02015-11-20 14:17:03 -08001049/// Descriptor pool create flags
Jesse Halld8bade02015-11-24 10:24:18 -08001050type VkFlags VkDescriptorPoolCreateFlags
1051bitfield VkDescriptorPoolCreateFlagBits {
Jesse Hallfbf97b02015-11-20 14:17:03 -08001052 VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT = 0x00000001,
1053}
1054
1055/// Descriptor pool reset flags
Jesse Halld8bade02015-11-24 10:24:18 -08001056type VkFlags VkDescriptorPoolResetFlags
Jesse Halla6429252015-11-29 18:59:42 -08001057//bitfield VkDescriptorPoolResetFlagBits {
1058//}
Jesse Hallfbf97b02015-11-20 14:17:03 -08001059
Jesse Halld27f6aa2015-08-15 17:58:48 -07001060/// Image usage flags
Jesse Halld8bade02015-11-24 10:24:18 -08001061type VkFlags VkImageUsageFlags
1062bitfield VkImageUsageFlagBits {
Jesse Hall3fbc8562015-11-29 22:10:52 -08001063 VK_IMAGE_USAGE_TRANSFER_SRC_BIT = 0x00000001, /// Can be used as a source of transfer operations
1064 VK_IMAGE_USAGE_TRANSFER_DST_BIT = 0x00000002, /// Can be used as a destination of transfer operations
Jesse Halld27f6aa2015-08-15 17:58:48 -07001065 VK_IMAGE_USAGE_SAMPLED_BIT = 0x00000004, /// Can be sampled from (SAMPLED_IMAGE and COMBINED_IMAGE_SAMPLER descriptor types)
1066 VK_IMAGE_USAGE_STORAGE_BIT = 0x00000008, /// Can be used as storage image (STORAGE_IMAGE descriptor type)
1067 VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT = 0x00000010, /// Can be used as framebuffer color attachment
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001068 VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000020, /// Can be used as framebuffer depth/stencil attachment
Jesse Halld27f6aa2015-08-15 17:58:48 -07001069 VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT = 0x00000040, /// Image data not needed outside of rendering
1070 VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT = 0x00000080, /// Can be used as framebuffer input attachment
1071}
1072
1073/// Image creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001074type VkFlags VkImageCreateFlags
1075bitfield VkImageCreateFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001076 VK_IMAGE_CREATE_SPARSE_BINDING_BIT = 0x00000001, /// Image should support sparse backing
Jesse Halld27f6aa2015-08-15 17:58:48 -07001077 VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002, /// Image should support sparse backing with partial residency
1078 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 -07001079 VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT = 0x00000008, /// Allows image views to have different format than the base image
1080 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 -07001081}
1082
Jesse Hallb00daad2015-11-29 19:46:20 -08001083/// Image view creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001084type VkFlags VkImageViewCreateFlags
Jesse Hallb00daad2015-11-29 19:46:20 -08001085//bitfield VkImageViewCreateFlagBits {
1086//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001087
1088/// Pipeline creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001089type VkFlags VkPipelineCreateFlags
1090bitfield VkPipelineCreateFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001091 VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT = 0x00000001,
1092 VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT = 0x00000002,
1093 VK_PIPELINE_CREATE_DERIVATIVE_BIT = 0x00000004,
1094}
1095
Jesse Hall65ab5522015-11-30 00:07:16 -08001096/// Color component flags
1097type VkFlags VkColorComponentFlags
1098bitfield VkColorComponentFlagBits {
1099 VK_COLOR_COMPONENT_R_BIT = 0x00000001,
1100 VK_COLOR_COMPONENT_G_BIT = 0x00000002,
1101 VK_COLOR_COMPONENT_B_BIT = 0x00000004,
1102 VK_COLOR_COMPONENT_A_BIT = 0x00000008,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001103}
1104
1105/// Fence creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001106type VkFlags VkFenceCreateFlags
1107bitfield VkFenceCreateFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001108 VK_FENCE_CREATE_SIGNALED_BIT = 0x00000001,
1109}
1110
1111/// Semaphore creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001112type VkFlags VkSemaphoreCreateFlags
Jesse Halla6429252015-11-29 18:59:42 -08001113//bitfield VkSemaphoreCreateFlagBits {
1114//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001115
1116/// Format capability flags
Jesse Halld8bade02015-11-24 10:24:18 -08001117type VkFlags VkFormatFeatureFlags
1118bitfield VkFormatFeatureFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001119 VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT = 0x00000001, /// Format can be used for sampled images (SAMPLED_IMAGE and COMBINED_IMAGE_SAMPLER descriptor types)
1120 VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT = 0x00000002, /// Format can be used for storage images (STORAGE_IMAGE descriptor type)
1121 VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT = 0x00000004, /// Format supports atomic operations in case it's used for storage images
1122 VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000008, /// Format can be used for uniform texel buffers (TBOs)
1123 VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT = 0x00000010, /// Format can be used for storage texel buffers (IBOs)
1124 VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT = 0x00000020, /// Format supports atomic operations in case it's used for storage texel buffers
1125 VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT = 0x00000040, /// Format can be used for vertex buffers (VBOs)
1126 VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT = 0x00000080, /// Format can be used for color attachment images
1127 VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT = 0x00000100, /// Format supports blending in case it's used for color attachment images
1128 VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000200, /// Format can be used for depth/stencil attachment images
Jesse Hall3fbc8562015-11-29 22:10:52 -08001129 VK_FORMAT_FEATURE_BLIT_SRC_BIT = 0x00000400, /// Format can be used as the source image of blits with vkCommandBlitImage
1130 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 -08001131 VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT = 0x00001000,
Jesse Hall26763382016-05-20 07:13:52 -07001132
1133 //@extension("VK_IMG_filter_cubic")
1134 VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG = 0x00002000,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001135}
1136
1137/// Query control flags
Jesse Halld8bade02015-11-24 10:24:18 -08001138type VkFlags VkQueryControlFlags
1139bitfield VkQueryControlFlagBits {
Jesse Hall65ab5522015-11-30 00:07:16 -08001140 VK_QUERY_CONTROL_PRECISE_BIT = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001141}
1142
1143/// Query result flags
Jesse Halld8bade02015-11-24 10:24:18 -08001144type VkFlags VkQueryResultFlags
1145bitfield VkQueryResultFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001146 VK_QUERY_RESULT_64_BIT = 0x00000001, /// Results of the queries are written to the destination buffer as 64-bit values
1147 VK_QUERY_RESULT_WAIT_BIT = 0x00000002, /// Results of the queries are waited on before proceeding with the result copy
1148 VK_QUERY_RESULT_WITH_AVAILABILITY_BIT = 0x00000004, /// Besides the results of the query, the availability of the results is also written
1149 VK_QUERY_RESULT_PARTIAL_BIT = 0x00000008, /// Copy the partial results of the query even if the final results aren't available
1150}
1151
1152/// Shader module creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001153type VkFlags VkShaderModuleCreateFlags
Jesse Halla6429252015-11-29 18:59:42 -08001154//bitfield VkShaderModuleCreateFlagBits {
1155//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001156
Jesse Halld27f6aa2015-08-15 17:58:48 -07001157/// Event creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001158type VkFlags VkEventCreateFlags
Jesse Halla6429252015-11-29 18:59:42 -08001159//bitfield VkEventCreateFlagBits {
1160//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001161
Jesse Halla15a4bf2015-11-19 22:48:02 -08001162/// Command buffer usage flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001163type VkFlags VkCommandBufferUsageFlags
1164bitfield VkCommandBufferUsageFlagBits {
1165 VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT = 0x00000001,
1166 VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT = 0x00000002,
1167 VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001168}
1169
1170/// Pipeline statistics flags
Jesse Halld8bade02015-11-24 10:24:18 -08001171type VkFlags VkQueryPipelineStatisticFlags
1172bitfield VkQueryPipelineStatisticFlagBits {
Jesse Hallae38f732015-11-19 21:32:50 -08001173 VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_BIT = 0x00000001, /// Optional
1174 VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_PRIMITIVES_BIT = 0x00000002, /// Optional
1175 VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT = 0x00000004, /// Optional
1176 VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_INVOCATIONS_BIT = 0x00000008, /// Optional
1177 VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT = 0x00000010, /// Optional
1178 VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT = 0x00000020, /// Optional
1179 VK_QUERY_PIPELINE_STATISTIC_CLIPPING_PRIMITIVES_BIT = 0x00000040, /// Optional
1180 VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT = 0x00000080, /// Optional
1181 VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT = 0x00000100, /// Optional
1182 VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT = 0x00000200, /// Optional
1183 VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT = 0x00000400, /// Optional
Jesse Halld27f6aa2015-08-15 17:58:48 -07001184}
1185
1186/// Memory mapping flags
Jesse Halld8bade02015-11-24 10:24:18 -08001187type VkFlags VkMemoryMapFlags
Jesse Halla6429252015-11-29 18:59:42 -08001188//bitfield VkMemoryMapFlagBits {
1189//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001190
1191/// Bitfield of image aspects
Jesse Halld8bade02015-11-24 10:24:18 -08001192type VkFlags VkImageAspectFlags
1193bitfield VkImageAspectFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001194 VK_IMAGE_ASPECT_COLOR_BIT = 0x00000001,
1195 VK_IMAGE_ASPECT_DEPTH_BIT = 0x00000002,
1196 VK_IMAGE_ASPECT_STENCIL_BIT = 0x00000004,
1197 VK_IMAGE_ASPECT_METADATA_BIT = 0x00000008,
1198}
1199
1200/// Sparse memory bind flags
Jesse Halld8bade02015-11-24 10:24:18 -08001201type VkFlags VkSparseMemoryBindFlags
Jesse Hall091ed9e2015-11-30 00:55:29 -08001202bitfield VkSparseMemoryBindFlagBits {
1203 VK_SPARSE_MEMORY_BIND_METADATA_BIT = 0x00000001,
1204}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001205
1206/// Sparse image memory requirements flags
Jesse Halld8bade02015-11-24 10:24:18 -08001207type VkFlags VkSparseImageFormatFlags
1208bitfield VkSparseImageFormatFlagBits {
Jesse Hallb00daad2015-11-29 19:46:20 -08001209 VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT = 0x00000001, /// Image uses a single miptail region for all array slices
1210 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.
1211 VK_SPARSE_IMAGE_FORMAT_NONSTANDARD_BLOCK_SIZE_BIT = 0x00000004, /// Image uses a non-standard sparse block size
Jesse Halld27f6aa2015-08-15 17:58:48 -07001212}
1213
1214/// Pipeline stages
Jesse Halld8bade02015-11-24 10:24:18 -08001215type VkFlags VkPipelineStageFlags
1216bitfield VkPipelineStageFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001217 VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT = 0x00000001, /// Before subsequent commands are processed
1218 VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT = 0x00000002, /// Draw/DispatchIndirect command fetch
1219 VK_PIPELINE_STAGE_VERTEX_INPUT_BIT = 0x00000004, /// Vertex/index fetch
1220 VK_PIPELINE_STAGE_VERTEX_SHADER_BIT = 0x00000008, /// Vertex shading
Jesse Hallae38f732015-11-19 21:32:50 -08001221 VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT = 0x00000010, /// Tessellation control shading
1222 VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT = 0x00000020, /// Tessellation evaluation shading
Jesse Halld27f6aa2015-08-15 17:58:48 -07001223 VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT = 0x00000040, /// Geometry shading
1224 VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT = 0x00000080, /// Fragment shading
1225 VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT = 0x00000100, /// Early fragment (depth/stencil) tests
1226 VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT = 0x00000200, /// Late fragment (depth/stencil) tests
1227 VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT = 0x00000400, /// Color attachment writes
1228 VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT = 0x00000800, /// Compute shading
1229 VK_PIPELINE_STAGE_TRANSFER_BIT = 0x00001000, /// Transfer/copy operations
Jesse Hall543a7ff2016-01-08 16:38:30 -08001230 VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT = 0x00002000,
1231 VK_PIPELINE_STAGE_HOST_BIT = 0x00004000, /// Indicates host (CPU) is a source/sink of the dependency
Jesse Halld27f6aa2015-08-15 17:58:48 -07001232
Jesse Hall543a7ff2016-01-08 16:38:30 -08001233 VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT = 0x00008000, /// All stages of the graphics pipeline
1234 VK_PIPELINE_STAGE_ALL_COMMANDS_BIT = 0x00010000, /// All graphics, compute, copy, and transition commands
Jesse Halleb02c472017-02-24 15:13:45 -08001235
1236 //@extension("VK_NVX_device_generated_commands")
1237 VK_PIPELINE_STAGE_COMMAND_PROCESS_BIT_NVX = 0x00020000,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001238}
1239
1240/// Render pass attachment description flags
Jesse Halld8bade02015-11-24 10:24:18 -08001241type VkFlags VkAttachmentDescriptionFlags
1242bitfield VkAttachmentDescriptionFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001243 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 -07001244}
1245
1246/// Subpass description flags
Jesse Halld8bade02015-11-24 10:24:18 -08001247type VkFlags VkSubpassDescriptionFlags
1248bitfield VkSubpassDescriptionFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001249}
1250
1251/// Command pool creation flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001252type VkFlags VkCommandPoolCreateFlags
1253bitfield VkCommandPoolCreateFlagBits {
1254 VK_COMMAND_POOL_CREATE_TRANSIENT_BIT = 0x00000001, /// Command buffers have a short lifetime
1255 VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT = 0x00000002, /// Command buffers may release their memory individually
Jesse Halld27f6aa2015-08-15 17:58:48 -07001256}
1257
1258/// Command pool reset flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001259type VkFlags VkCommandPoolResetFlags
1260bitfield VkCommandPoolResetFlagBits {
1261 VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT = 0x00000001, /// Release resources owned by the pool
Jesse Halld27f6aa2015-08-15 17:58:48 -07001262}
1263
Jesse Hall3fbc8562015-11-29 22:10:52 -08001264type VkFlags VkCommandBufferResetFlags
1265bitfield VkCommandBufferResetFlagBits {
1266 VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT = 0x00000001, /// Release resources owned by the buffer
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001267}
1268
Jesse Halld8bade02015-11-24 10:24:18 -08001269type VkFlags VkSampleCountFlags
1270bitfield VkSampleCountFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001271 VK_SAMPLE_COUNT_1_BIT = 0x00000001,
1272 VK_SAMPLE_COUNT_2_BIT = 0x00000002,
1273 VK_SAMPLE_COUNT_4_BIT = 0x00000004,
1274 VK_SAMPLE_COUNT_8_BIT = 0x00000008,
1275 VK_SAMPLE_COUNT_16_BIT = 0x00000010,
1276 VK_SAMPLE_COUNT_32_BIT = 0x00000020,
1277 VK_SAMPLE_COUNT_64_BIT = 0x00000040,
1278}
1279
Jesse Halld8bade02015-11-24 10:24:18 -08001280type VkFlags VkStencilFaceFlags
1281bitfield VkStencilFaceFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001282 VK_STENCIL_FACE_FRONT_BIT = 0x00000001, /// Front face
1283 VK_STENCIL_FACE_BACK_BIT = 0x00000002, /// Back face
Jesse Hallc7467b72015-11-29 21:05:26 -08001284 VK_STENCIL_FRONT_AND_BACK = 0x00000003,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001285}
1286
Jesse Halla6429252015-11-29 18:59:42 -08001287/// Instance creation flags
1288type VkFlags VkInstanceCreateFlags
1289//bitfield VkInstanceCreateFlagBits {
1290//}
1291
1292/// Device creation flags
1293type VkFlags VkDeviceCreateFlags
1294//bitfield VkDeviceCreateFlagBits {
1295//}
1296
1297/// Device queue creation flags
1298type VkFlags VkDeviceQueueCreateFlags
1299//bitfield VkDeviceQueueCreateFlagBits {
1300//}
1301
1302/// Query pool creation flags
1303type VkFlags VkQueryPoolCreateFlags
1304//bitfield VkQueryPoolCreateFlagBits {
1305//}
1306
1307/// Buffer view creation flags
1308type VkFlags VkBufferViewCreateFlags
1309//bitfield VkBufferViewCreateFlagBits {
1310//}
1311
1312/// Pipeline cache creation flags
1313type VkFlags VkPipelineCacheCreateFlags
1314//bitfield VkPipelineCacheCreateFlagBits {
1315//}
1316
1317/// Pipeline shader stage creation flags
1318type VkFlags VkPipelineShaderStageCreateFlags
1319//bitfield VkPipelineShaderStageCreateFlagBits {
1320//}
1321
1322/// Descriptor set layout creation flags
1323type VkFlags VkDescriptorSetLayoutCreateFlags
1324//bitfield VkDescriptorSetLayoutCreateFlagBits {
1325//}
1326
1327/// Pipeline vertex input state creation flags
1328type VkFlags VkPipelineVertexInputStateCreateFlags
1329//bitfield VkPipelineVertexInputStateCreateFlagBits {
1330//}
1331
1332/// Pipeline input assembly state creation flags
1333type VkFlags VkPipelineInputAssemblyStateCreateFlags
1334//bitfield VkPipelineInputAssemblyStateCreateFlagBits {
1335//}
1336
1337/// Tessellation state creation flags
1338type VkFlags VkPipelineTessellationStateCreateFlags
1339//bitfield VkPipelineTessellationStateCreateFlagBits {
1340//}
1341
1342/// Viewport state creation flags
1343type VkFlags VkPipelineViewportStateCreateFlags
1344//bitfield VkPipelineViewportStateCreateFlagBits {
1345//}
1346
Jesse Hall3fbc8562015-11-29 22:10:52 -08001347/// Rasterization state creation flags
1348type VkFlags VkPipelineRasterizationStateCreateFlags
1349//bitfield VkPipelineRasterizationStateCreateFlagBits {
Jesse Halla6429252015-11-29 18:59:42 -08001350//}
1351
1352/// Multisample state creation flags
1353type VkFlags VkPipelineMultisampleStateCreateFlags
1354//bitfield VkPipelineMultisampleStateCreateFlagBits {
1355//}
1356
1357/// Color blend state creation flags
1358type VkFlags VkPipelineColorBlendStateCreateFlags
1359//bitfield VkPipelineColorBlendStateCreateFlagBits {
1360//}
1361
1362/// Depth/stencil state creation flags
1363type VkFlags VkPipelineDepthStencilStateCreateFlags
1364//bitfield VkPipelineDepthStencilStateCreateFlagBits {
1365//}
1366
1367/// Dynamic state creation flags
1368type VkFlags VkPipelineDynamicStateCreateFlags
1369//bitfield VkPipelineDynamicStateCreateFlagBits {
1370//}
1371
1372/// Pipeline layout creation flags
1373type VkFlags VkPipelineLayoutCreateFlags
1374//bitfield VkPipelineLayoutCreateFlagBits {
1375//}
1376
1377/// Sampler creation flags
1378type VkFlags VkSamplerCreateFlags
1379//bitfield VkSamplerCreateFlagBits {
1380//}
1381
1382/// Render pass creation flags
1383type VkFlags VkRenderPassCreateFlags
1384//bitfield VkRenderPassCreateFlagBits {
1385//}
1386
1387/// Framebuffer creation flags
1388type VkFlags VkFramebufferCreateFlags
1389//bitfield VkFramebufferCreateFlagBits {
1390//}
1391
Jesse Halldc6d36c2015-11-29 19:12:15 -08001392/// Dependency flags
1393type VkFlags VkDependencyFlags
1394bitfield VkDependencyFlagBits {
1395 VK_DEPENDENCY_BY_REGION_BIT = 0x00000001,
1396}
1397
Jesse Hallc7467b72015-11-29 21:05:26 -08001398/// Cull mode flags
1399type VkFlags VkCullModeFlags
1400bitfield VkCullModeFlagBits {
1401 VK_CULL_MODE_NONE = 0x00000000,
1402 VK_CULL_MODE_FRONT_BIT = 0x00000001,
1403 VK_CULL_MODE_BACK_BIT = 0x00000002,
1404 VK_CULL_MODE_FRONT_AND_BACK = 0x00000003,
1405}
1406
Jesse Hall523db342015-11-30 21:12:55 -08001407@extension("VK_KHR_surface")
Jesse Halld8bade02015-11-24 10:24:18 -08001408type VkFlags VkSurfaceTransformFlagsKHR
Jesse Hall523db342015-11-30 21:12:55 -08001409@extension("VK_KHR_surface")
Jesse Halld8bade02015-11-24 10:24:18 -08001410bitfield VkSurfaceTransformFlagBitsKHR {
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001411 VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR = 0x00000001,
Jesse Hall9ba8bc82015-11-30 16:22:16 -08001412 VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR = 0x00000002,
1413 VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR = 0x00000004,
1414 VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR = 0x00000008,
1415 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR = 0x00000010,
1416 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR = 0x00000020,
1417 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR = 0x00000040,
1418 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR = 0x00000080,
1419 VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR = 0x00000100,
Michael Lentine88594d72015-11-12 12:49:45 -08001420}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001421
Jesse Hall523db342015-11-30 21:12:55 -08001422@extension("VK_KHR_surface")
Jesse Halla6429252015-11-29 18:59:42 -08001423type VkFlags VkCompositeAlphaFlagsKHR
Jesse Hall523db342015-11-30 21:12:55 -08001424@extension("VK_KHR_surface")
Jesse Halla6429252015-11-29 18:59:42 -08001425bitfield VkCompositeAlphaFlagBitsKHR {
1426 VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR = 0x00000001,
1427 VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR = 0x00000002,
1428 VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR = 0x00000004,
1429 VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR = 0x00000008,
1430}
1431
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001432@extension("VK_KHR_swapchain")
1433type VkFlags VkSwapchainCreateFlagsKHR
1434//@extension("VK_KHR_swapchain")
1435//bitfield VkSwapchainCreateFlagBitsKHR {
1436//}
1437
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001438@extension("VK_KHR_display")
Jesse Halld8bade02015-11-24 10:24:18 -08001439type VkFlags VkDisplayPlaneAlphaFlagsKHR
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001440@extension("VK_KHR_display")
Jesse Halld8bade02015-11-24 10:24:18 -08001441bitfield VkDisplayPlaneAlphaFlagBitsKHR {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001442 VK_DISPLAY_PLANE_ALPHA_OPAQUE_BIT_KHR = 0x00000001,
1443 VK_DISPLAY_PLANE_ALPHA_GLOBAL_BIT_KHR = 0x00000002,
1444 VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_BIT_KHR = 0x00000004,
1445 VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_PREMULTIPLIED_BIT_KHR = 0x00000008,
Jesse Hall1356b0d2015-11-23 17:24:58 -08001446}
1447
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001448@extension("VK_KHR_display")
1449type VkFlags VkDisplaySurfaceCreateFlagsKHR
1450//@extension("VK_KHR_display")
1451//bitfield VkDisplaySurfaceCreateFlagBitsKHR {
1452//}
1453
Jesse Hall9ba8bc82015-11-30 16:22:16 -08001454@extension("VK_KHR_display")
1455type VkFlags VkDisplayModeCreateFlagsKHR
1456//@extension("VK_KHR_display")
1457//bitfield VkDisplayModeCreateFlagBitsKHR {
1458//}
1459
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001460@extension("VK_KHR_xlib_surface")
1461type VkFlags VkXlibSurfaceCreateFlagsKHR
1462//@extension("VK_KHR_xlib_surface")
1463//bitfield VkXlibSurfaceCreateFlagBitsKHR {
1464//}
1465
1466@extension("VK_KHR_xcb_surface")
1467type VkFlags VkXcbSurfaceCreateFlagsKHR
1468//@extension("VK_KHR_xcb_surface")
1469//bitfield VkXcbSurfaceCreateFlagBitsKHR {
1470//}
1471
1472@extension("VK_KHR_wayland_surface")
1473type VkFlags VkWaylandSurfaceCreateFlagsKHR
1474//@extension("VK_KHR_wayland_surface")
1475//bitfield VkWaylandSurfaceCreateFlagBitsKHR {
1476//}
1477
1478@extension("VK_KHR_mir_surface")
1479type VkFlags VkMirSurfaceCreateFlagsKHR
1480//@extension("VK_KHR_mir_surface")
1481//bitfield VkMirSurfaceCreateFlagBitsKHR {
1482//}
1483
1484@extension("VK_KHR_android_surface")
1485type VkFlags VkAndroidSurfaceCreateFlagsKHR
1486//@extension("VK_KHR_android_surface")
1487//bitfield VkAndroidSurfaceCreateFlagBitsKHR {
1488//}
1489
1490@extension("VK_KHR_win32_surface")
1491type VkFlags VkWin32SurfaceCreateFlagsKHR
1492//@extension("VK_KHR_win32_surface")
1493//bitfield VkWin32SurfaceCreateFlagBitsKHR {
1494//}
1495
Jesse Hall715b86a2016-01-16 16:34:29 -08001496@extension("VK_EXT_debug_report")
1497type VkFlags VkDebugReportFlagsEXT
1498@extension("VK_EXT_debug_report")
1499bitfield VkDebugReportFlagBitsEXT {
Jesse Halle2948d82016-02-25 04:19:32 -08001500 VK_DEBUG_REPORT_INFORMATION_BIT_EXT = 0x00000001,
1501 VK_DEBUG_REPORT_WARNING_BIT_EXT = 0x00000002,
1502 VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT = 0x00000004,
Jesse Hall715b86a2016-01-16 16:34:29 -08001503 VK_DEBUG_REPORT_ERROR_BIT_EXT = 0x00000008,
1504 VK_DEBUG_REPORT_DEBUG_BIT_EXT = 0x00000010,
1505}
1506
Jesse Halleb02c472017-02-24 15:13:45 -08001507@extension("VK_NV_external_memory_capabilities")
1508type VkFlags VkExternalMemoryHandleTypeFlagsNV
1509@extension("VK_NV_external_memory_capabilities")
1510bitfield VkExternalMemoryHandleTypeFlagBitsNV {
1511 VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_NV = 0x00000001,
1512 VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_NV = 0x00000002,
1513 VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_IMAGE_BIT_NV = 0x00000004,
1514 VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_IMAGE_KMT_BIT_NV = 0x00000008,
1515}
1516
1517@extension("VK_NV_external_memory_capabilities")
1518type VkFlags VkExternalMemoryFeatureFlagsNV
1519@extension("VK_NV_external_memory_capabilities")
1520bitfield VkExternalMemoryFeatureFlagBitsNV {
1521 VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT_NV = 0x00000001,
1522 VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT_NV = 0x00000002,
1523 VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT_NV = 0x00000004,
1524}
1525
1526@extension("VK_NVX_device_generated_commands")
1527type VkFlags VkIndirectCommandsLayoutUsageFlagsNVX
1528@extension("VK_NVX_device_generated_commands")
1529bitfield VkIndirectCommandsLayoutUsageFlagBitsNVX {
1530 VK_INDIRECT_COMMANDS_LAYOUT_USAGE_UNORDERED_SEQUENCES_BIT_NVX = 0x00000001,
1531 VK_INDIRECT_COMMANDS_LAYOUT_USAGE_SPARSE_SEQUENCES_BIT_NVX = 0x00000002,
1532 VK_INDIRECT_COMMANDS_LAYOUT_USAGE_EMPTY_EXECUTIONS_BIT_NVX = 0x00000004,
1533 VK_INDIRECT_COMMANDS_LAYOUT_USAGE_INDEXED_SEQUENCES_BIT_NVX = 0x00000008,
1534}
1535
1536@extension("VK_NVX_device_generated_commands")
1537type VkFlags VkObjectEntryUsageFlagsNVX
1538@extension("VK_NVX_device_generated_commands")
1539bitfield VkObjectEntryUsageFlagBitsNVX {
1540 VK_OBJECT_ENTRY_USAGE_GRAPHICS_BIT_NVX = 0x00000001,
1541 VK_OBJECT_ENTRY_USAGE_COMPUTE_BIT_NVX = 0x00000002,
1542}
1543
Jesse Hall1356b0d2015-11-23 17:24:58 -08001544
Jesse Halld27f6aa2015-08-15 17:58:48 -07001545//////////////////
1546// Structures //
1547//////////////////
1548
1549class VkOffset2D {
1550 s32 x
1551 s32 y
1552}
1553
1554class VkOffset3D {
1555 s32 x
1556 s32 y
1557 s32 z
1558}
1559
1560class VkExtent2D {
Jesse Hall3dd678a2016-01-08 21:52:01 -08001561 u32 width
1562 u32 height
Jesse Halld27f6aa2015-08-15 17:58:48 -07001563}
1564
1565class VkExtent3D {
Jesse Hall3dd678a2016-01-08 21:52:01 -08001566 u32 width
1567 u32 height
1568 u32 depth
Jesse Halld27f6aa2015-08-15 17:58:48 -07001569}
1570
1571class VkViewport {
Jesse Hall65ab5522015-11-30 00:07:16 -08001572 f32 x
1573 f32 y
Jesse Halld27f6aa2015-08-15 17:58:48 -07001574 f32 width
1575 f32 height
1576 f32 minDepth
1577 f32 maxDepth
1578}
1579
1580class VkRect2D {
1581 VkOffset2D offset
1582 VkExtent2D extent
1583}
1584
Jesse Halla15a4bf2015-11-19 22:48:02 -08001585class VkClearRect {
1586 VkRect2D rect
1587 u32 baseArrayLayer
Jesse Hall3fbc8562015-11-29 22:10:52 -08001588 u32 layerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001589}
1590
Jesse Hall65ab5522015-11-30 00:07:16 -08001591class VkComponentMapping {
1592 VkComponentSwizzle r
1593 VkComponentSwizzle g
1594 VkComponentSwizzle b
1595 VkComponentSwizzle a
Jesse Halld27f6aa2015-08-15 17:58:48 -07001596}
1597
1598class VkPhysicalDeviceProperties {
1599 u32 apiVersion
1600 u32 driverVersion
Jesse Hall65ab5522015-11-30 00:07:16 -08001601 u32 vendorID
1602 u32 deviceID
Jesse Halld27f6aa2015-08-15 17:58:48 -07001603 VkPhysicalDeviceType deviceType
Jesse Hall65ab5522015-11-30 00:07:16 -08001604 char[VK_MAX_PHYSICAL_DEVICE_NAME_SIZE] deviceName
1605 u8[VK_UUID_SIZE] pipelineCacheUUID
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001606 VkPhysicalDeviceLimits limits
1607 VkPhysicalDeviceSparseProperties sparseProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07001608}
1609
1610class VkExtensionProperties {
Jesse Hall65ab5522015-11-30 00:07:16 -08001611 char[VK_MAX_EXTENSION_NAME_SIZE] extensionName /// extension name
Jesse Halld27f6aa2015-08-15 17:58:48 -07001612 u32 specVersion /// version of the extension specification implemented
1613}
1614
1615class VkLayerProperties {
Jesse Hall65ab5522015-11-30 00:07:16 -08001616 char[VK_MAX_EXTENSION_NAME_SIZE] layerName /// layer name
Jesse Hall3fbc8562015-11-29 22:10:52 -08001617 u32 specVersion /// version of the layer specification implemented
1618 u32 implementationVersion /// build or release version of the layer's library
Jesse Hall65ab5522015-11-30 00:07:16 -08001619 char[VK_MAX_DESCRIPTION_SIZE] description /// Free-form description of the layer
Jesse Halld27f6aa2015-08-15 17:58:48 -07001620}
1621
Jesse Halla366a512015-11-19 22:30:07 -08001622class VkSubmitInfo {
Jesse Hall03b6fe12015-11-24 12:44:21 -08001623 VkStructureType sType /// Type of structure. Should be VK_STRUCTURE_TYPE_SUBMIT_INFO
1624 const void* pNext /// Next structure in chain
1625 u32 waitSemaphoreCount
Jesse Halla366a512015-11-19 22:30:07 -08001626 const VkSemaphore* pWaitSemaphores
Jesse Hall543a7ff2016-01-08 16:38:30 -08001627 const VkPipelineStageFlags* pWaitDstStageMask
Jesse Hall03b6fe12015-11-24 12:44:21 -08001628 u32 commandBufferCount
Jesse Hall3fbc8562015-11-29 22:10:52 -08001629 const VkCommandBuffer* pCommandBuffers
Jesse Hall03b6fe12015-11-24 12:44:21 -08001630 u32 signalSemaphoreCount
Jesse Halla366a512015-11-19 22:30:07 -08001631 const VkSemaphore* pSignalSemaphores
1632}
1633
Jesse Halld27f6aa2015-08-15 17:58:48 -07001634class VkApplicationInfo {
1635 VkStructureType sType /// Type of structure. Should be VK_STRUCTURE_TYPE_APPLICATION_INFO
1636 const void* pNext /// Next structure in chain
Jesse Hall3fbc8562015-11-29 22:10:52 -08001637 const char* pApplicationName
1638 u32 applicationVersion
Jesse Halld27f6aa2015-08-15 17:58:48 -07001639 const char* pEngineName
1640 u32 engineVersion
1641 u32 apiVersion
1642}
1643
Jesse Hall3fbc8562015-11-29 22:10:52 -08001644class VkAllocationCallbacks {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001645 void* pUserData
Jesse Hall3fbc8562015-11-29 22:10:52 -08001646 PFN_vkAllocationFunction pfnAllocation
1647 PFN_vkReallocationFunction pfnReallocation
Jesse Halld27f6aa2015-08-15 17:58:48 -07001648 PFN_vkFreeFunction pfnFree
Jesse Hall3fbc8562015-11-29 22:10:52 -08001649 PFN_vkInternalAllocationNotification pfnInternalAllocation
Jesse Hall03b6fe12015-11-24 12:44:21 -08001650 PFN_vkInternalFreeNotification pfnInternalFree
Jesse Halld27f6aa2015-08-15 17:58:48 -07001651}
1652
1653class VkDeviceQueueCreateInfo {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001654 VkStructureType sStype /// Should be VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO
1655 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001656 VkDeviceQueueCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001657 u32 queueFamilyIndex
Jesse Halldba27f72015-11-30 14:25:46 -08001658 u32 queueCount
Jesse Hallfbf97b02015-11-20 14:17:03 -08001659 const f32* pQueuePriorities
Jesse Halld27f6aa2015-08-15 17:58:48 -07001660}
1661
1662class VkDeviceCreateInfo {
1663 VkStructureType sType /// Should be VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO
1664 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001665 VkDeviceCreateFlags flags
Jesse Halldba27f72015-11-30 14:25:46 -08001666 u32 queueCreateInfoCount
1667 const VkDeviceQueueCreateInfo* pQueueCreateInfos
Jesse Hall3dd678a2016-01-08 21:52:01 -08001668 u32 enabledLayerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001669 const char* const* ppEnabledLayerNames /// Ordered list of layer names to be enabled
Jesse Hall3dd678a2016-01-08 21:52:01 -08001670 u32 enabledExtensionCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001671 const char* const* ppEnabledExtensionNames
1672 const VkPhysicalDeviceFeatures* pEnabledFeatures
Jesse Halld27f6aa2015-08-15 17:58:48 -07001673}
1674
1675class VkInstanceCreateInfo {
1676 VkStructureType sType /// Should be VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO
1677 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001678 VkInstanceCreateFlags flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001679 const VkApplicationInfo* pApplicationInfo
Jesse Hall3dd678a2016-01-08 21:52:01 -08001680 u32 enabledLayerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001681 const char* const* ppEnabledLayerNames /// Ordered list of layer names to be enabled
Jesse Hall3dd678a2016-01-08 21:52:01 -08001682 u32 enabledExtensionCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001683 const char* const* ppEnabledExtensionNames /// Extension names to be enabled
1684}
1685
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001686class VkQueueFamilyProperties {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001687 VkQueueFlags queueFlags /// Queue flags
1688 u32 queueCount
Jesse Hallacfa5342015-11-19 21:51:33 -08001689 u32 timestampValidBits
Jesse Hall65ab5522015-11-30 00:07:16 -08001690 VkExtent3D minImageTransferGranularity
Jesse Halld27f6aa2015-08-15 17:58:48 -07001691}
1692
1693class VkPhysicalDeviceMemoryProperties {
1694 u32 memoryTypeCount
1695 VkMemoryType[VK_MAX_MEMORY_TYPES] memoryTypes
1696 u32 memoryHeapCount
1697 VkMemoryHeap[VK_MAX_MEMORY_HEAPS] memoryHeaps
1698}
1699
Jesse Hall3fbc8562015-11-29 22:10:52 -08001700class VkMemoryAllocateInfo {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001701 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07001702 const void* pNext /// Pointer to next structure
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001703 VkDeviceSize allocationSize /// Size of memory allocation
Jesse Halld27f6aa2015-08-15 17:58:48 -07001704 u32 memoryTypeIndex /// Index of the of the memory type to allocate from
1705}
1706
1707class VkMemoryRequirements {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001708 VkDeviceSize size /// Specified in bytes
1709 VkDeviceSize alignment /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001710 u32 memoryTypeBits /// Bitfield of the allowed memory type indices into memoryTypes[] for this object
1711}
1712
1713class VkSparseImageFormatProperties {
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001714 VkImageAspectFlagBits aspectMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001715 VkExtent3D imageGranularity
1716 VkSparseImageFormatFlags flags
1717}
1718
1719class VkSparseImageMemoryRequirements {
Jesse Hallb00daad2015-11-29 19:46:20 -08001720 VkSparseImageFormatProperties formatProperties
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001721 u32 imageMipTailFirstLod
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001722 VkDeviceSize imageMipTailSize /// Specified in bytes, must be a multiple of image block size / alignment
1723 VkDeviceSize imageMipTailOffset /// Specified in bytes, must be a multiple of image block size / alignment
1724 VkDeviceSize imageMipTailStride /// Specified in bytes, must be a multiple of image block size / alignment
Jesse Halld27f6aa2015-08-15 17:58:48 -07001725}
1726
1727class VkMemoryType {
1728 VkMemoryPropertyFlags propertyFlags /// Memory properties of this memory type
1729 u32 heapIndex /// Index of the memory heap allocations of this memory type are taken from
1730}
1731
1732class VkMemoryHeap {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001733 VkDeviceSize size /// Available memory in the heap
Jesse Halld27f6aa2015-08-15 17:58:48 -07001734 VkMemoryHeapFlags flags /// Flags for the heap
1735}
1736
1737class VkMappedMemoryRange {
1738 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE
1739 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08001740 VkDeviceMemory memory /// Mapped memory object
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001741 VkDeviceSize offset /// Offset within the mapped memory the range starts from
1742 VkDeviceSize size /// Size of the range within the mapped memory
Jesse Halld27f6aa2015-08-15 17:58:48 -07001743}
1744
1745class VkFormatProperties {
1746 VkFormatFeatureFlags linearTilingFeatures /// Format features in case of linear tiling
1747 VkFormatFeatureFlags optimalTilingFeatures /// Format features in case of optimal tiling
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001748 VkFormatFeatureFlags bufferFeatures /// Format features supported by buffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07001749}
1750
1751class VkImageFormatProperties {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001752 VkExtent3D maxExtent /// max image dimensions for this resource type
1753 u32 maxMipLevels /// max number of mipmap levels for this resource type
Jesse Halla15a4bf2015-11-19 22:48:02 -08001754 u32 maxArrayLayers /// max array layers for this resource type
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001755 VkSampleCountFlags sampleCounts /// supported sample counts for this resource type
1756 VkDeviceSize maxResourceSize /// max size (in bytes) of this resource type
1757}
1758
Jesse Halla15a4bf2015-11-19 22:48:02 -08001759class VkDescriptorImageInfo {
1760 VkSampler sampler
1761 VkImageView imageView
1762 VkImageLayout imageLayout
1763}
1764
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001765class VkDescriptorBufferInfo {
1766 VkBuffer buffer /// Buffer used for this descriptor when the descriptor is UNIFORM_BUFFER[_DYNAMIC]
1767 VkDeviceSize offset /// Base offset from buffer start in bytes to update in the descriptor set.
1768 VkDeviceSize range /// Size in bytes of the buffer resource for this descriptor update.
Jesse Halld27f6aa2015-08-15 17:58:48 -07001769}
1770
Jesse Halld27f6aa2015-08-15 17:58:48 -07001771class VkWriteDescriptorSet {
1772 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET
1773 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08001774 VkDescriptorSet dstSet /// Destination descriptor set
1775 u32 dstBinding /// Binding within the destination descriptor set to write
1776 u32 dstArrayElement /// Array element within the destination binding to write
Jesse Hall03b6fe12015-11-24 12:44:21 -08001777 u32 descriptorCount /// Number of descriptors to write (determines the size of the array pointed by <pDescriptors>)
Jesse Halld27f6aa2015-08-15 17:58:48 -07001778 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 -08001779 const VkDescriptorImageInfo* pImageInfo
1780 const VkDescriptorBufferInfo* pBufferInfo
1781 const VkBufferView* pTexelBufferView
Jesse Halld27f6aa2015-08-15 17:58:48 -07001782}
1783
1784class VkCopyDescriptorSet {
1785 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET
1786 const void* pNext /// Pointer to next structure
1787 VkDescriptorSet srcSet /// Source descriptor set
1788 u32 srcBinding /// Binding within the source descriptor set to copy from
1789 u32 srcArrayElement /// Array element within the source binding to copy from
Jesse Hall3fbc8562015-11-29 22:10:52 -08001790 VkDescriptorSet dstSet /// Destination descriptor set
1791 u32 dstBinding /// Binding within the destination descriptor set to copy to
1792 u32 dstArrayElement /// Array element within the destination binding to copy to
Jesse Hall03b6fe12015-11-24 12:44:21 -08001793 u32 descriptorCount /// Number of descriptors to copy
Jesse Halld27f6aa2015-08-15 17:58:48 -07001794}
1795
1796class VkBufferCreateInfo {
1797 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO
1798 const void* pNext /// Pointer to next structure.
Jesse Halla6429252015-11-29 18:59:42 -08001799 VkBufferCreateFlags flags /// Buffer creation flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001800 VkDeviceSize size /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001801 VkBufferUsageFlags usage /// Buffer usage flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001802 VkSharingMode sharingMode
Jesse Hall03b6fe12015-11-24 12:44:21 -08001803 u32 queueFamilyIndexCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001804 const u32* pQueueFamilyIndices
1805}
1806
1807class VkBufferViewCreateInfo {
1808 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO
1809 const void* pNext /// Pointer to next structure.
Jesse Halla6429252015-11-29 18:59:42 -08001810 VkBufferViewCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001811 VkBuffer buffer
Jesse Halld27f6aa2015-08-15 17:58:48 -07001812 VkFormat format /// Optionally specifies format of elements
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001813 VkDeviceSize offset /// Specified in bytes
1814 VkDeviceSize range /// View size specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001815}
1816
1817class VkImageSubresource {
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001818 VkImageAspectFlagBits aspectMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001819 u32 mipLevel
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001820 u32 arrayLayer
Jesse Halld27f6aa2015-08-15 17:58:48 -07001821}
1822
1823class VkImageSubresourceRange {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001824 VkImageAspectFlags aspectMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001825 u32 baseMipLevel
Jesse Hall3fbc8562015-11-29 22:10:52 -08001826 u32 levelCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001827 u32 baseArrayLayer
Jesse Hall3fbc8562015-11-29 22:10:52 -08001828 u32 layerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001829}
1830
1831class VkMemoryBarrier {
1832 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MEMORY_BARRIER
1833 const void* pNext /// Pointer to next structure.
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001834 VkAccessFlags srcAccessMask
1835 VkAccessFlags dstAccessMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001836}
1837
1838class VkBufferMemoryBarrier {
1839 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER
1840 const void* pNext /// Pointer to next structure.
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001841 VkAccessFlags srcAccessMask
1842 VkAccessFlags dstAccessMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001843 u32 srcQueueFamilyIndex /// Queue family to transition ownership from
Jesse Hall3fbc8562015-11-29 22:10:52 -08001844 u32 dstQueueFamilyIndex /// Queue family to transition ownership to
Jesse Halld27f6aa2015-08-15 17:58:48 -07001845 VkBuffer buffer /// Buffer to sync
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001846 VkDeviceSize offset /// Offset within the buffer to sync
1847 VkDeviceSize size /// Amount of bytes to sync
Jesse Halld27f6aa2015-08-15 17:58:48 -07001848}
1849
1850class VkImageMemoryBarrier {
1851 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER
1852 const void* pNext /// Pointer to next structure.
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001853 VkAccessFlags srcAccessMask
1854 VkAccessFlags dstAccessMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001855 VkImageLayout oldLayout /// Current layout of the image
1856 VkImageLayout newLayout /// New layout to transition the image to
1857 u32 srcQueueFamilyIndex /// Queue family to transition ownership from
Jesse Hall3fbc8562015-11-29 22:10:52 -08001858 u32 dstQueueFamilyIndex /// Queue family to transition ownership to
Jesse Halld27f6aa2015-08-15 17:58:48 -07001859 VkImage image /// Image to sync
1860 VkImageSubresourceRange subresourceRange /// Subresource range to sync
1861}
1862
1863class VkImageCreateInfo {
1864 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO
1865 const void* pNext /// Pointer to next structure.
Jesse Halla6429252015-11-29 18:59:42 -08001866 VkImageCreateFlags flags /// Image creation flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001867 VkImageType imageType
1868 VkFormat format
1869 VkExtent3D extent
1870 u32 mipLevels
Jesse Halla15a4bf2015-11-19 22:48:02 -08001871 u32 arrayLayers
Jesse Hall091ed9e2015-11-30 00:55:29 -08001872 VkSampleCountFlagBits samples
Jesse Halld27f6aa2015-08-15 17:58:48 -07001873 VkImageTiling tiling
1874 VkImageUsageFlags usage /// Image usage flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001875 VkSharingMode sharingMode /// Cross-queue-family sharing mode
Jesse Hall03b6fe12015-11-24 12:44:21 -08001876 u32 queueFamilyIndexCount /// Number of queue families to share across
Jesse Halld27f6aa2015-08-15 17:58:48 -07001877 const u32* pQueueFamilyIndices /// Array of queue family indices to share across
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001878 VkImageLayout initialLayout /// Initial image layout for all subresources
Jesse Halld27f6aa2015-08-15 17:58:48 -07001879}
1880
1881class VkSubresourceLayout {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001882 VkDeviceSize offset /// Specified in bytes
1883 VkDeviceSize size /// Specified in bytes
1884 VkDeviceSize rowPitch /// Specified in bytes
Jesse Hall543a7ff2016-01-08 16:38:30 -08001885 VkDeviceSize arrayPitch /// Specified in bytes
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001886 VkDeviceSize depthPitch /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001887}
1888
1889class VkImageViewCreateInfo {
1890 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO
1891 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001892 VkImageViewCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001893 VkImage image
1894 VkImageViewType viewType
1895 VkFormat format
Jesse Hall65ab5522015-11-30 00:07:16 -08001896 VkComponentMapping components
Jesse Halld27f6aa2015-08-15 17:58:48 -07001897 VkImageSubresourceRange subresourceRange
Jesse Halld27f6aa2015-08-15 17:58:48 -07001898}
1899
1900class VkBufferCopy {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001901 VkDeviceSize srcOffset /// Specified in bytes
Jesse Hall3fbc8562015-11-29 22:10:52 -08001902 VkDeviceSize dstOffset /// Specified in bytes
Jesse Hallb00daad2015-11-29 19:46:20 -08001903 VkDeviceSize size /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001904}
1905
Jesse Halla6429252015-11-29 18:59:42 -08001906class VkSparseMemoryBind {
Jesse Hallb00daad2015-11-29 19:46:20 -08001907 VkDeviceSize resourceOffset /// Specified in bytes
1908 VkDeviceSize size /// Specified in bytes
Jesse Hall3fbc8562015-11-29 22:10:52 -08001909 VkDeviceMemory memory
1910 VkDeviceSize memoryOffset /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001911 VkSparseMemoryBindFlags flags
1912}
1913
Jesse Halla6429252015-11-29 18:59:42 -08001914class VkSparseImageMemoryBind {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001915 VkImageSubresource subresource
1916 VkOffset3D offset
1917 VkExtent3D extent
Jesse Hall3fbc8562015-11-29 22:10:52 -08001918 VkDeviceMemory memory
1919 VkDeviceSize memoryOffset /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001920 VkSparseMemoryBindFlags flags
1921}
1922
Jesse Halla6429252015-11-29 18:59:42 -08001923class VkSparseBufferMemoryBindInfo {
1924 VkBuffer buffer
1925 u32 bindCount
1926 const VkSparseMemoryBind* pBinds
1927}
1928
1929class VkSparseImageOpaqueMemoryBindInfo {
1930 VkImage image
1931 u32 bindCount
1932 const VkSparseMemoryBind* pBinds
1933}
1934
1935class VkSparseImageMemoryBindInfo {
1936 VkImage image
1937 u32 bindCount
1938 const VkSparseMemoryBind* pBinds
1939}
1940
1941class VkBindSparseInfo {
1942 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BIND_SPARSE_INFO
1943 const void* pNext
1944 u32 waitSemaphoreCount
1945 const VkSemaphore* pWaitSemaphores
1946 u32 numBufferBinds
1947 const VkSparseBufferMemoryBindInfo* pBufferBinds
1948 u32 numImageOpaqueBinds
1949 const VkSparseImageOpaqueMemoryBindInfo* pImageOpaqueBinds
1950 u32 numImageBinds
1951 const VkSparseImageMemoryBindInfo* pImageBinds
1952 u32 signalSemaphoreCount
1953 const VkSemaphore* pSignalSemaphores
1954}
1955
Jesse Hall65ab5522015-11-30 00:07:16 -08001956class VkImageSubresourceLayers {
1957 VkImageAspectFlags aspectMask
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001958 u32 mipLevel
Jesse Halla15a4bf2015-11-19 22:48:02 -08001959 u32 baseArrayLayer
Jesse Hall3fbc8562015-11-29 22:10:52 -08001960 u32 layerCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001961}
1962
Jesse Halld27f6aa2015-08-15 17:58:48 -07001963class VkImageCopy {
Jesse Hall65ab5522015-11-30 00:07:16 -08001964 VkImageSubresourceLayers srcSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07001965 VkOffset3D srcOffset /// Specified in pixels for both compressed and uncompressed images
Jesse Hall65ab5522015-11-30 00:07:16 -08001966 VkImageSubresourceLayers dstSubresource
Jesse Hall3fbc8562015-11-29 22:10:52 -08001967 VkOffset3D dstOffset /// Specified in pixels for both compressed and uncompressed images
Jesse Halld27f6aa2015-08-15 17:58:48 -07001968 VkExtent3D extent /// Specified in pixels for both compressed and uncompressed images
1969}
1970
1971class VkImageBlit {
Jesse Hall65ab5522015-11-30 00:07:16 -08001972 VkImageSubresourceLayers srcSubresource
Jesse Hall3dd678a2016-01-08 21:52:01 -08001973 VkOffset3D[2] srcOffsets
Jesse Hall65ab5522015-11-30 00:07:16 -08001974 VkImageSubresourceLayers dstSubresource
Jesse Hall3dd678a2016-01-08 21:52:01 -08001975 VkOffset3D[2] dstOffsets
Jesse Halld27f6aa2015-08-15 17:58:48 -07001976}
1977
1978class VkBufferImageCopy {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001979 VkDeviceSize bufferOffset /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001980 u32 bufferRowLength /// Specified in texels
1981 u32 bufferImageHeight
Jesse Hall65ab5522015-11-30 00:07:16 -08001982 VkImageSubresourceLayers imageSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07001983 VkOffset3D imageOffset /// Specified in pixels for both compressed and uncompressed images
1984 VkExtent3D imageExtent /// Specified in pixels for both compressed and uncompressed images
1985}
1986
1987class VkImageResolve {
Jesse Hall65ab5522015-11-30 00:07:16 -08001988 VkImageSubresourceLayers srcSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07001989 VkOffset3D srcOffset
Jesse Hall65ab5522015-11-30 00:07:16 -08001990 VkImageSubresourceLayers dstSubresource
Jesse Hall3fbc8562015-11-29 22:10:52 -08001991 VkOffset3D dstOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07001992 VkExtent3D extent
1993}
1994
1995class VkShaderModuleCreateInfo {
1996 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO
1997 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001998 VkShaderModuleCreateFlags flags /// Reserved
Jesse Halld27f6aa2015-08-15 17:58:48 -07001999 platform.size_t codeSize /// Specified in bytes
Jesse Halla9bb62b2015-11-21 19:31:56 -08002000 const u32* pCode /// Binary code of size codeSize
Jesse Halld27f6aa2015-08-15 17:58:48 -07002001}
2002
Jesse Halld27f6aa2015-08-15 17:58:48 -07002003class VkDescriptorSetLayoutBinding {
Jesse Hall091ed9e2015-11-30 00:55:29 -08002004 u32 binding
Jesse Halld27f6aa2015-08-15 17:58:48 -07002005 VkDescriptorType descriptorType /// Type of the descriptors in this binding
Jesse Halldba27f72015-11-30 14:25:46 -08002006 u32 descriptorCount /// Number of descriptors in this binding
Jesse Halld27f6aa2015-08-15 17:58:48 -07002007 VkShaderStageFlags stageFlags /// Shader stages this binding is visible to
2008 const VkSampler* pImmutableSamplers /// Immutable samplers (used if descriptor type is SAMPLER or COMBINED_IMAGE_SAMPLER, is either NULL or contains <count> number of elements)
2009}
2010
2011class VkDescriptorSetLayoutCreateInfo {
2012 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO
2013 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002014 VkDescriptorSetLayoutCreateFlags flags
Jesse Hall03b6fe12015-11-24 12:44:21 -08002015 u32 bindingCount /// Number of bindings in the descriptor set layout
Jesse Hall543a7ff2016-01-08 16:38:30 -08002016 const VkDescriptorSetLayoutBinding* pBindings /// Array of descriptor set layout bindings
Jesse Halld27f6aa2015-08-15 17:58:48 -07002017}
2018
Jesse Hall65ab5522015-11-30 00:07:16 -08002019class VkDescriptorPoolSize {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002020 VkDescriptorType type
Jesse Hall03b6fe12015-11-24 12:44:21 -08002021 u32 descriptorCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002022}
2023
2024class VkDescriptorPoolCreateInfo {
2025 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO
2026 const void* pNext /// Pointer to next structure
Jesse Hallfbf97b02015-11-20 14:17:03 -08002027 VkDescriptorPoolCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002028 u32 maxSets
Jesse Hall65ab5522015-11-30 00:07:16 -08002029 u32 poolSizeCount
2030 const VkDescriptorPoolSize* pPoolSizes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002031}
2032
Jesse Hall3fbc8562015-11-29 22:10:52 -08002033class VkDescriptorSetAllocateInfo {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002034 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO
Jesse Hallfbf97b02015-11-20 14:17:03 -08002035 const void* pNext /// Pointer to next structure
2036 VkDescriptorPool descriptorPool
Jesse Hall03b6fe12015-11-24 12:44:21 -08002037 u32 setCount
Jesse Hallfbf97b02015-11-20 14:17:03 -08002038 const VkDescriptorSetLayout* pSetLayouts
2039}
2040
Jesse Halld27f6aa2015-08-15 17:58:48 -07002041class VkSpecializationMapEntry {
Jesse Hall65ab5522015-11-30 00:07:16 -08002042 u32 constantID /// The SpecConstant ID specified in the BIL
Jesse Halld27f6aa2015-08-15 17:58:48 -07002043 u32 offset /// Offset of the value in the data block
Jesse Hallb00daad2015-11-29 19:46:20 -08002044 platform.size_t size /// Size in bytes of the SpecConstant
Jesse Halld27f6aa2015-08-15 17:58:48 -07002045}
2046
2047class VkSpecializationInfo {
2048 u32 mapEntryCount /// Number of entries in the map
Jesse Hallb00daad2015-11-29 19:46:20 -08002049 const VkSpecializationMapEntry* pMapEntries /// Array of map entries
Jesse Halld27f6aa2015-08-15 17:58:48 -07002050 platform.size_t dataSize /// Size in bytes of pData
2051 const void* pData /// Pointer to SpecConstant data
2052}
2053
2054class VkPipelineShaderStageCreateInfo {
2055 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO
2056 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002057 VkPipelineShaderStageCreateFlags flags
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002058 VkShaderStageFlagBits stage
2059 VkShaderModule module
2060 const char* pName
Jesse Halld27f6aa2015-08-15 17:58:48 -07002061 const VkSpecializationInfo* pSpecializationInfo
2062}
2063
2064class VkComputePipelineCreateInfo {
2065 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO
2066 const void* pNext /// Pointer to next structure
Jesse Halld27f6aa2015-08-15 17:58:48 -07002067 VkPipelineCreateFlags flags /// Pipeline creation flags
Jesse Halla6429252015-11-29 18:59:42 -08002068 VkPipelineShaderStageCreateInfo stage
Jesse Halld27f6aa2015-08-15 17:58:48 -07002069 VkPipelineLayout layout /// Interface layout of the pipeline
2070 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
2071 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
2072}
2073
2074class VkVertexInputBindingDescription {
Jesse Hallb00daad2015-11-29 19:46:20 -08002075 u32 binding /// Vertex buffer binding id
2076 u32 stride /// Distance between vertices in bytes (0 = no advancement)
Jesse Hall65ab5522015-11-30 00:07:16 -08002077 VkVertexInputRate inputRate /// Rate at which binding is incremented
Jesse Halld27f6aa2015-08-15 17:58:48 -07002078}
2079
2080class VkVertexInputAttributeDescription {
Jesse Hallb00daad2015-11-29 19:46:20 -08002081 u32 location /// location of the shader vertex attrib
2082 u32 binding /// Vertex buffer binding id
2083 VkFormat format /// format of source data
2084 u32 offset /// Offset of first element in bytes from base of vertex
Jesse Halld27f6aa2015-08-15 17:58:48 -07002085}
2086
2087class VkPipelineVertexInputStateCreateInfo {
Jesse Hall03b6fe12015-11-24 12:44:21 -08002088 VkStructureType sType /// Should be VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO
2089 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002090 VkPipelineVertexInputStateCreateFlags flags
Jesse Hall03b6fe12015-11-24 12:44:21 -08002091 u32 vertexBindingDescriptionCount /// number of bindings
Jesse Halld27f6aa2015-08-15 17:58:48 -07002092 const VkVertexInputBindingDescription* pVertexBindingDescriptions
Jesse Hall03b6fe12015-11-24 12:44:21 -08002093 u32 vertexAttributeDescriptionCount /// number of attributes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002094 const VkVertexInputAttributeDescription* pVertexAttributeDescriptions
2095}
2096
2097class VkPipelineInputAssemblyStateCreateInfo {
2098 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO
2099 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002100 VkPipelineInputAssemblyStateCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002101 VkPrimitiveTopology topology
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002102 VkBool32 primitiveRestartEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002103}
2104
2105class VkPipelineTessellationStateCreateInfo {
2106 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO
2107 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002108 VkPipelineTessellationStateCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002109 u32 patchControlPoints
2110}
2111
2112class VkPipelineViewportStateCreateInfo {
2113 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO
2114 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002115 VkPipelineViewportStateCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002116 u32 viewportCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002117 const VkViewport* pViewports
2118 u32 scissorCount
2119 const VkRect2D* pScissors
Jesse Halld27f6aa2015-08-15 17:58:48 -07002120}
2121
Jesse Hall3fbc8562015-11-29 22:10:52 -08002122class VkPipelineRasterizationStateCreateInfo {
Jesse Hall65ab5522015-11-30 00:07:16 -08002123 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002124 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08002125 VkPipelineRasterizationStateCreateFlags flags
Jesse Hallae38f732015-11-19 21:32:50 -08002126 VkBool32 depthClampEnable
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002127 VkBool32 rasterizerDiscardEnable
Jesse Hall65ab5522015-11-30 00:07:16 -08002128 VkPolygonMode polygonMode /// optional (GL45)
Jesse Hallc7467b72015-11-29 21:05:26 -08002129 VkCullModeFlags cullMode
Jesse Halld27f6aa2015-08-15 17:58:48 -07002130 VkFrontFace frontFace
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002131 VkBool32 depthBiasEnable
Jesse Halla9bb62b2015-11-21 19:31:56 -08002132 f32 depthBiasConstantFactor
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002133 f32 depthBiasClamp
Jesse Halla9bb62b2015-11-21 19:31:56 -08002134 f32 depthBiasSlopeFactor
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002135 f32 lineWidth
Jesse Halld27f6aa2015-08-15 17:58:48 -07002136}
2137
2138class VkPipelineMultisampleStateCreateInfo {
2139 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO
2140 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002141 VkPipelineMultisampleStateCreateFlags flags
Jesse Hall091ed9e2015-11-30 00:55:29 -08002142 VkSampleCountFlagBits rasterizationSamples /// Number of samples used for rasterization
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002143 VkBool32 sampleShadingEnable /// optional (GL45)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002144 f32 minSampleShading /// optional (GL45)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002145 const VkSampleMask* pSampleMask
Jesse Hallacfa5342015-11-19 21:51:33 -08002146 VkBool32 alphaToCoverageEnable
2147 VkBool32 alphaToOneEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002148}
2149
2150class VkPipelineColorBlendAttachmentState {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002151 VkBool32 blendEnable
Jesse Hall65ab5522015-11-30 00:07:16 -08002152 VkBlendFactor srcColorBlendFactor
2153 VkBlendFactor dstColorBlendFactor
2154 VkBlendOp colorBlendOp
2155 VkBlendFactor srcAlphaBlendFactor
2156 VkBlendFactor dstAlphaBlendFactor
2157 VkBlendOp alphaBlendOp
2158 VkColorComponentFlags colorWriteMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07002159}
2160
2161class VkPipelineColorBlendStateCreateInfo {
2162 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO
2163 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002164 VkPipelineColorBlendStateCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002165 VkBool32 logicOpEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002166 VkLogicOp logicOp
2167 u32 attachmentCount /// # of pAttachments
2168 const VkPipelineColorBlendAttachmentState* pAttachments
Jesse Hallb00daad2015-11-29 19:46:20 -08002169 f32[4] blendConstants
Jesse Halld27f6aa2015-08-15 17:58:48 -07002170}
2171
2172class VkStencilOpState {
Jesse Hall65ab5522015-11-30 00:07:16 -08002173 VkStencilOp failOp
2174 VkStencilOp passOp
2175 VkStencilOp depthFailOp
2176 VkCompareOp compareOp
2177 u32 compareMask
2178 u32 writeMask
2179 u32 reference
Jesse Halld27f6aa2015-08-15 17:58:48 -07002180}
2181
2182class VkPipelineDepthStencilStateCreateInfo {
2183 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO
2184 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002185 VkPipelineDepthStencilStateCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002186 VkBool32 depthTestEnable
2187 VkBool32 depthWriteEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002188 VkCompareOp depthCompareOp
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002189 VkBool32 depthBoundsTestEnable /// optional (depth_bounds_test)
2190 VkBool32 stencilTestEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002191 VkStencilOpState front
2192 VkStencilOpState back
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002193 f32 minDepthBounds
2194 f32 maxDepthBounds
2195}
2196
2197class VkPipelineDynamicStateCreateInfo {
2198 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO
2199 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002200 VkPipelineDynamicStateCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002201 u32 dynamicStateCount
2202 const VkDynamicState* pDynamicStates
Jesse Halld27f6aa2015-08-15 17:58:48 -07002203}
2204
2205class VkGraphicsPipelineCreateInfo {
Jesse Halla6429252015-11-29 18:59:42 -08002206 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO
2207 const void* pNext /// Pointer to next structure
2208 VkPipelineCreateFlags flags /// Pipeline creation flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002209 u32 stageCount
Jesse Halla6429252015-11-29 18:59:42 -08002210 const VkPipelineShaderStageCreateInfo* pStages /// One entry for each active shader stage
Jesse Halld27f6aa2015-08-15 17:58:48 -07002211 const VkPipelineVertexInputStateCreateInfo* pVertexInputState
2212 const VkPipelineInputAssemblyStateCreateInfo* pInputAssemblyState
2213 const VkPipelineTessellationStateCreateInfo* pTessellationState
2214 const VkPipelineViewportStateCreateInfo* pViewportState
Jesse Hall3fbc8562015-11-29 22:10:52 -08002215 const VkPipelineRasterizationStateCreateInfo* pRasterizationState
Jesse Halld27f6aa2015-08-15 17:58:48 -07002216 const VkPipelineMultisampleStateCreateInfo* pMultisampleState
2217 const VkPipelineDepthStencilStateCreateInfo* pDepthStencilState
2218 const VkPipelineColorBlendStateCreateInfo* pColorBlendState
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002219 const VkPipelineDynamicStateCreateInfo* pDynamicState
Jesse Halla6429252015-11-29 18:59:42 -08002220 VkPipelineLayout layout /// Interface layout of the pipeline
Jesse Halld27f6aa2015-08-15 17:58:48 -07002221 VkRenderPass renderPass
2222 u32 subpass
Jesse Halla6429252015-11-29 18:59:42 -08002223 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
2224 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 -07002225}
2226
2227class VkPipelineCacheCreateInfo {
Jesse Hallb00daad2015-11-29 19:46:20 -08002228 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO
2229 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002230 VkPipelineCacheCreateFlags flags
Jesse Hallb00daad2015-11-29 19:46:20 -08002231 platform.size_t initialDataSize /// Size of initial data to populate cache, in bytes
2232 const void* pInitialData /// Initial data to populate cache
Jesse Halld27f6aa2015-08-15 17:58:48 -07002233}
2234
2235class VkPushConstantRange {
2236 VkShaderStageFlags stageFlags /// Which stages use the range
Jesse Hall03b6fe12015-11-24 12:44:21 -08002237 u32 offset /// Start of the range, in bytes
2238 u32 size /// Length of the range, in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002239}
2240
2241class VkPipelineLayoutCreateInfo {
2242 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO
2243 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002244 VkPipelineLayoutCreateFlags flags
Jesse Hall3dd678a2016-01-08 21:52:01 -08002245 u32 descriptorSetCount /// Number of descriptor sets interfaced by the pipeline
Jesse Halld27f6aa2015-08-15 17:58:48 -07002246 const VkDescriptorSetLayout* pSetLayouts /// Array of <setCount> number of descriptor set layout objects defining the layout of the
2247 u32 pushConstantRangeCount /// Number of push-constant ranges used by the pipeline
2248 const VkPushConstantRange* pPushConstantRanges /// Array of pushConstantRangeCount number of ranges used by various shader stages
2249}
2250
2251class VkSamplerCreateInfo {
2252 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO
2253 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002254 VkSamplerCreateFlags flags
Jesse Hall23ff73f2015-11-29 14:36:39 -08002255 VkFilter magFilter /// Filter mode for magnification
2256 VkFilter minFilter /// Filter mode for minifiation
2257 VkSamplerMipmapMode mipmapMode /// Mipmap selection mode
2258 VkSamplerAddressMode addressModeU
2259 VkSamplerAddressMode addressModeV
2260 VkSamplerAddressMode addressModeW
Jesse Halld27f6aa2015-08-15 17:58:48 -07002261 f32 mipLodBias
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002262 VkBool32 anisotropyEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002263 f32 maxAnisotropy
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002264 VkBool32 compareEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002265 VkCompareOp compareOp
2266 f32 minLod
2267 f32 maxLod
2268 VkBorderColor borderColor
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002269 VkBool32 unnormalizedCoordinates
Jesse Halld27f6aa2015-08-15 17:58:48 -07002270}
2271
Jesse Hall3fbc8562015-11-29 22:10:52 -08002272class VkCommandPoolCreateInfo {
2273 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002274 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08002275 VkCommandPoolCreateFlags flags /// Command pool creation flags
Jesse Halla6429252015-11-29 18:59:42 -08002276 u32 queueFamilyIndex
Jesse Halld27f6aa2015-08-15 17:58:48 -07002277}
2278
Jesse Hall3fbc8562015-11-29 22:10:52 -08002279class VkCommandBufferAllocateInfo {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002280 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002281 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08002282 VkCommandPool commandPool
2283 VkCommandBufferLevel level
Jesse Hall3dd678a2016-01-08 21:52:01 -08002284 u32 commandBufferCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002285}
2286
Jesse Hall3dd678a2016-01-08 21:52:01 -08002287class VkCommandBufferInheritanceInfo {
2288 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002289 const void* pNext /// Pointer to next structure
Jesse Halld27f6aa2015-08-15 17:58:48 -07002290 VkRenderPass renderPass /// Render pass for secondary command buffers
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002291 u32 subpass
Jesse Halld27f6aa2015-08-15 17:58:48 -07002292 VkFramebuffer framebuffer /// Framebuffer for secondary command buffers
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002293 VkBool32 occlusionQueryEnable
2294 VkQueryControlFlags queryFlags
2295 VkQueryPipelineStatisticFlags pipelineStatistics
Jesse Halld27f6aa2015-08-15 17:58:48 -07002296}
2297
Jesse Hall3dd678a2016-01-08 21:52:01 -08002298class VkCommandBufferBeginInfo {
2299 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO
2300 const void* pNext /// Pointer to next structure
2301 VkCommandBufferUsageFlags flags /// Command buffer usage flags
2302 const VkCommandBufferInheritanceInfo* pInheritanceInfo
2303}
2304
Jesse Halld27f6aa2015-08-15 17:58:48 -07002305class VkRenderPassBeginInfo {
2306 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO
2307 const void* pNext /// Pointer to next structure
2308 VkRenderPass renderPass
2309 VkFramebuffer framebuffer
2310 VkRect2D renderArea
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002311 u32 clearValueCount
2312 const VkClearValue* pClearValues
Jesse Halld27f6aa2015-08-15 17:58:48 -07002313}
2314
2315@union
2316/// Union allowing specification of floating point, integer, or unsigned integer color data. Actual value selected is based on image/attachment being cleared.
2317class VkClearColorValue {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002318 f32[4] float32
2319 s32[4] int32
2320 u32[4] uint32
Jesse Halld27f6aa2015-08-15 17:58:48 -07002321}
2322
2323class VkClearDepthStencilValue {
2324 f32 depth
2325 u32 stencil
2326}
2327
2328@union
2329/// Union allowing specification of color, depth, and stencil color values. Actual value selected is based on attachment being cleared.
2330class VkClearValue {
2331 VkClearColorValue color
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002332 VkClearDepthStencilValue depthStencil
Jesse Halld27f6aa2015-08-15 17:58:48 -07002333}
2334
Jesse Hallae38f732015-11-19 21:32:50 -08002335class VkClearAttachment {
2336 VkImageAspectFlags aspectMask
2337 u32 colorAttachment
2338 VkClearValue clearValue
2339}
2340
Jesse Halld27f6aa2015-08-15 17:58:48 -07002341class VkAttachmentDescription {
Jesse Halla6429252015-11-29 18:59:42 -08002342 VkAttachmentDescriptionFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002343 VkFormat format
Jesse Hall091ed9e2015-11-30 00:55:29 -08002344 VkSampleCountFlagBits samples
Jesse Halld27f6aa2015-08-15 17:58:48 -07002345 VkAttachmentLoadOp loadOp /// Load op for color or depth data
2346 VkAttachmentStoreOp storeOp /// Store op for color or depth data
2347 VkAttachmentLoadOp stencilLoadOp /// Load op for stencil data
2348 VkAttachmentStoreOp stencilStoreOp /// Store op for stencil data
2349 VkImageLayout initialLayout
2350 VkImageLayout finalLayout
2351}
2352
2353class VkAttachmentReference {
2354 u32 attachment
2355 VkImageLayout layout
2356}
2357
2358class VkSubpassDescription {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002359 VkSubpassDescriptionFlags flags
Jesse Halla6429252015-11-29 18:59:42 -08002360 VkPipelineBindPoint pipelineBindPoint /// Must be VK_PIPELINE_BIND_POINT_GRAPHICS for now
Jesse Hall03b6fe12015-11-24 12:44:21 -08002361 u32 inputAttachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002362 const VkAttachmentReference* pInputAttachments
Jesse Hall03b6fe12015-11-24 12:44:21 -08002363 u32 colorAttachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002364 const VkAttachmentReference* pColorAttachments
2365 const VkAttachmentReference* pResolveAttachments
Jesse Hallc7467b72015-11-29 21:05:26 -08002366 const VkAttachmentReference* pDepthStencilAttachment
Jesse Hall03b6fe12015-11-24 12:44:21 -08002367 u32 preserveAttachmentCount
Jesse Hall3dd678a2016-01-08 21:52:01 -08002368 const u32* pPreserveAttachments
Jesse Halld27f6aa2015-08-15 17:58:48 -07002369}
2370
2371class VkSubpassDependency {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002372 u32 srcSubpass
Jesse Hall3fbc8562015-11-29 22:10:52 -08002373 u32 dstSubpass
Jesse Halld27f6aa2015-08-15 17:58:48 -07002374 VkPipelineStageFlags srcStageMask
Jesse Hall3fbc8562015-11-29 22:10:52 -08002375 VkPipelineStageFlags dstStageMask
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002376 VkAccessFlags srcAccessMask
2377 VkAccessFlags dstAccessMask
Jesse Halldc6d36c2015-11-29 19:12:15 -08002378 VkDependencyFlags dependencyFlags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002379}
2380
2381class VkRenderPassCreateInfo {
2382 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO
2383 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002384 VkRenderPassCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002385 u32 attachmentCount
2386 const VkAttachmentDescription* pAttachments
2387 u32 subpassCount
2388 const VkSubpassDescription* pSubpasses
2389 u32 dependencyCount
2390 const VkSubpassDependency* pDependencies
2391}
2392
2393class VkEventCreateInfo {
2394 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_EVENT_CREATE_INFO
2395 const void* pNext /// Pointer to next structure
2396 VkEventCreateFlags flags /// Event creation flags
2397}
2398
2399class VkFenceCreateInfo {
2400 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_FENCE_CREATE_INFO
2401 const void* pNext /// Pointer to next structure
2402 VkFenceCreateFlags flags /// Fence creation flags
2403}
2404
2405class VkPhysicalDeviceFeatures {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002406 VkBool32 robustBufferAccess /// out of bounds buffer accesses are well defined
2407 VkBool32 fullDrawIndexUint32 /// full 32-bit range of indices for indexed draw calls
2408 VkBool32 imageCubeArray /// image views which are arrays of cube maps
2409 VkBool32 independentBlend /// blending operations are controlled per-attachment
2410 VkBool32 geometryShader /// geometry stage
2411 VkBool32 tessellationShader /// tessellation control and evaluation stage
2412 VkBool32 sampleRateShading /// per-sample shading and interpolation
Jesse Hall3fbc8562015-11-29 22:10:52 -08002413 VkBool32 dualSrcBlend /// blend operations which take two sources
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002414 VkBool32 logicOp /// logic operations
2415 VkBool32 multiDrawIndirect /// multi draw indirect
Jesse Hall543a7ff2016-01-08 16:38:30 -08002416 VkBool32 drawIndirectFirstInstance
Jesse Hallae38f732015-11-19 21:32:50 -08002417 VkBool32 depthClamp /// depth clamping
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002418 VkBool32 depthBiasClamp /// depth bias clamping
2419 VkBool32 fillModeNonSolid /// point and wireframe fill modes
2420 VkBool32 depthBounds /// depth bounds test
2421 VkBool32 wideLines /// lines with width greater than 1
2422 VkBool32 largePoints /// points with size greater than 1
Jesse Hallfbf97b02015-11-20 14:17:03 -08002423 VkBool32 alphaToOne /// The fragment alpha channel can be forced to maximum representable alpha value
2424 VkBool32 multiViewport
2425 VkBool32 samplerAnisotropy
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002426 VkBool32 textureCompressionETC2 /// ETC texture compression formats
2427 VkBool32 textureCompressionASTC_LDR /// ASTC LDR texture compression formats
2428 VkBool32 textureCompressionBC /// BC1-7 texture compressed formats
Jesse Hall65ab5522015-11-30 00:07:16 -08002429 VkBool32 occlusionQueryPrecise
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002430 VkBool32 pipelineStatisticsQuery /// pipeline statistics query
Jesse Halldc6d36c2015-11-29 19:12:15 -08002431 VkBool32 vertexPipelineStoresAndAtomics
2432 VkBool32 fragmentStoresAndAtomics
2433 VkBool32 shaderTessellationAndGeometryPointSize
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002434 VkBool32 shaderImageGatherExtended /// texture gather with run-time values and independent offsets
2435 VkBool32 shaderStorageImageExtendedFormats /// the extended set of formats can be used for storage images
2436 VkBool32 shaderStorageImageMultisample /// multisample images can be used for storage images
Jesse Halld1af8122015-11-29 23:50:38 -08002437 VkBool32 shaderStorageImageReadWithoutFormat
2438 VkBool32 shaderStorageImageWriteWithoutFormat
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002439 VkBool32 shaderUniformBufferArrayDynamicIndexing /// arrays of uniform buffers can be accessed with dynamically uniform indices
2440 VkBool32 shaderSampledImageArrayDynamicIndexing /// arrays of sampled images can be accessed with dynamically uniform indices
2441 VkBool32 shaderStorageBufferArrayDynamicIndexing /// arrays of storage buffers can be accessed with dynamically uniform indices
2442 VkBool32 shaderStorageImageArrayDynamicIndexing /// arrays of storage images can be accessed with dynamically uniform indices
2443 VkBool32 shaderClipDistance /// clip distance in shaders
2444 VkBool32 shaderCullDistance /// cull distance in shaders
2445 VkBool32 shaderFloat64 /// 64-bit floats (doubles) in shaders
2446 VkBool32 shaderInt64 /// 64-bit integers in shaders
2447 VkBool32 shaderInt16 /// 16-bit integers in shaders
2448 VkBool32 shaderResourceResidency /// shader can use texture operations that return resource residency information (requires sparseNonResident support)
Jesse Hall65ab5522015-11-30 00:07:16 -08002449 VkBool32 shaderResourceMinLod /// shader can use texture operations that specify minimum resource LOD
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002450 VkBool32 sparseBinding /// Sparse resources support: Resource memory can be managed at opaque page level rather than object level
2451 VkBool32 sparseResidencyBuffer /// Sparse resources support: GPU can access partially resident buffers
2452 VkBool32 sparseResidencyImage2D /// Sparse resources support: GPU can access partially resident 2D (non-MSAA non-DepthStencil) images
2453 VkBool32 sparseResidencyImage3D /// Sparse resources support: GPU can access partially resident 3D images
2454 VkBool32 sparseResidency2Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 2 samples
2455 VkBool32 sparseResidency4Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 4 samples
2456 VkBool32 sparseResidency8Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 8 samples
2457 VkBool32 sparseResidency16Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 16 samples
2458 VkBool32 sparseResidencyAliased /// Sparse resources support: GPU can correctly access data aliased into multiple locations (opt-in)
Jesse Halld1af8122015-11-29 23:50:38 -08002459 VkBool32 variableMultisampleRate
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002460 VkBool32 inheritedQueries
Jesse Halld27f6aa2015-08-15 17:58:48 -07002461}
2462
2463class VkPhysicalDeviceLimits {
2464 /// resource maximum sizes
2465 u32 maxImageDimension1D /// max 1D image dimension
2466 u32 maxImageDimension2D /// max 2D image dimension
2467 u32 maxImageDimension3D /// max 3D image dimension
2468 u32 maxImageDimensionCube /// max cubemap image dimension
2469 u32 maxImageArrayLayers /// max layers for image arrays
Jesse Hallb00daad2015-11-29 19:46:20 -08002470 u32 maxTexelBufferElements
Jesse Hallfbf97b02015-11-20 14:17:03 -08002471 u32 maxUniformBufferRange /// max uniform buffer size (bytes)
2472 u32 maxStorageBufferRange /// max storage buffer size (bytes)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002473 u32 maxPushConstantsSize /// max size of the push constants pool (bytes)
2474 /// memory limits
2475 u32 maxMemoryAllocationCount /// max number of device memory allocations supported
Jesse Hall091ed9e2015-11-30 00:55:29 -08002476 u32 maxSamplerAllocationCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002477 VkDeviceSize bufferImageGranularity /// Granularity (in bytes) at which buffers and images can be bound to adjacent memory for simultaneous usage
2478 VkDeviceSize sparseAddressSpaceSize /// Total address space available for sparse allocations (bytes)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002479 /// descriptor set limits
2480 u32 maxBoundDescriptorSets /// max number of descriptors sets that can be bound to a pipeline
Jesse Halld27f6aa2015-08-15 17:58:48 -07002481 u32 maxPerStageDescriptorSamplers /// max num of samplers allowed per-stage in a descriptor set
2482 u32 maxPerStageDescriptorUniformBuffers /// max num of uniform buffers allowed per-stage in a descriptor set
2483 u32 maxPerStageDescriptorStorageBuffers /// max num of storage buffers allowed per-stage in a descriptor set
2484 u32 maxPerStageDescriptorSampledImages /// max num of sampled images allowed per-stage in a descriptor set
2485 u32 maxPerStageDescriptorStorageImages /// max num of storage images allowed per-stage in a descriptor set
Jesse Halle1b12782015-11-30 11:27:32 -08002486 u32 maxPerStageDescriptorInputAttachments
Jesse Halldba27f72015-11-30 14:25:46 -08002487 u32 maxPerStageResources
Jesse Halld27f6aa2015-08-15 17:58:48 -07002488 u32 maxDescriptorSetSamplers /// max num of samplers allowed in all stages in a descriptor set
2489 u32 maxDescriptorSetUniformBuffers /// max num of uniform buffers allowed in all stages in a descriptor set
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002490 u32 maxDescriptorSetUniformBuffersDynamic /// max num of dynamic uniform buffers allowed in all stages in a descriptor set
Jesse Halld27f6aa2015-08-15 17:58:48 -07002491 u32 maxDescriptorSetStorageBuffers /// max num of storage buffers allowed in all stages in a descriptor set
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002492 u32 maxDescriptorSetStorageBuffersDynamic /// max num of dynamic storage buffers allowed in all stages in a descriptor set
Jesse Halld27f6aa2015-08-15 17:58:48 -07002493 u32 maxDescriptorSetSampledImages /// max num of sampled images allowed in all stages in a descriptor set
2494 u32 maxDescriptorSetStorageImages /// max num of storage images allowed in all stages in a descriptor set
Jesse Halle1b12782015-11-30 11:27:32 -08002495 u32 maxDescriptorSetInputAttachments
Jesse Halld27f6aa2015-08-15 17:58:48 -07002496 /// vertex stage limits
2497 u32 maxVertexInputAttributes /// max num of vertex input attribute slots
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002498 u32 maxVertexInputBindings /// max num of vertex input binding slots
Jesse Halld27f6aa2015-08-15 17:58:48 -07002499 u32 maxVertexInputAttributeOffset /// max vertex input attribute offset added to vertex buffer offset
2500 u32 maxVertexInputBindingStride /// max vertex input binding stride
2501 u32 maxVertexOutputComponents /// max num of output components written by vertex shader
2502 /// tessellation control stage limits
Jesse Hall3fbc8562015-11-29 22:10:52 -08002503 u32 maxTessellationGenerationLevel /// max level supported by tess primitive generator
Jesse Hallae38f732015-11-19 21:32:50 -08002504 u32 maxTessellationPatchSize /// max patch size (vertices)
2505 u32 maxTessellationControlPerVertexInputComponents /// max num of input components per-vertex in TCS
2506 u32 maxTessellationControlPerVertexOutputComponents /// max num of output components per-vertex in TCS
2507 u32 maxTessellationControlPerPatchOutputComponents /// max num of output components per-patch in TCS
2508 u32 maxTessellationControlTotalOutputComponents /// max total num of per-vertex and per-patch output components in TCS
2509 u32 maxTessellationEvaluationInputComponents /// max num of input components per vertex in TES
2510 u32 maxTessellationEvaluationOutputComponents /// max num of output components per vertex in TES
Jesse Halld27f6aa2015-08-15 17:58:48 -07002511 /// geometry stage limits
2512 u32 maxGeometryShaderInvocations /// max invocation count supported in geometry shader
2513 u32 maxGeometryInputComponents /// max num of input components read in geometry stage
2514 u32 maxGeometryOutputComponents /// max num of output components written in geometry stage
2515 u32 maxGeometryOutputVertices /// max num of vertices that can be emitted in geometry stage
2516 u32 maxGeometryTotalOutputComponents /// max total num of components (all vertices) written in geometry stage
2517 /// fragment stage limits
2518 u32 maxFragmentInputComponents /// max num of input compontents read in fragment stage
Jesse Hallfbf97b02015-11-20 14:17:03 -08002519 u32 maxFragmentOutputAttachments /// max num of output attachments written in fragment stage
Jesse Hall3fbc8562015-11-29 22:10:52 -08002520 u32 maxFragmentDualSrcAttachments /// max num of output attachments written when using dual source blending
Jesse Halld27f6aa2015-08-15 17:58:48 -07002521 u32 maxFragmentCombinedOutputResources /// max total num of storage buffers, storage images and output buffers
2522 /// compute stage limits
2523 u32 maxComputeSharedMemorySize /// max total storage size of work group local storage (bytes)
2524 u32[3] maxComputeWorkGroupCount /// max num of compute work groups that may be dispatched by a single command (x,y,z)
2525 u32 maxComputeWorkGroupInvocations /// max total compute invocations in a single local work group
2526 u32[3] maxComputeWorkGroupSize /// max local size of a compute work group (x,y,z)
2527
2528 u32 subPixelPrecisionBits /// num bits of subpixel precision in screen x and y
2529 u32 subTexelPrecisionBits /// num bits of subtexel precision
2530 u32 mipmapPrecisionBits /// num bits of mipmap precision
2531
2532 u32 maxDrawIndexedIndexValue /// max index value for indexed draw calls (for 32-bit indices)
Jesse Halldba27f72015-11-30 14:25:46 -08002533 u32 maxDrawIndirectCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002534
2535 f32 maxSamplerLodBias /// max absolute sampler level of detail bias
2536 f32 maxSamplerAnisotropy /// max degree of sampler anisotropy
2537
2538 u32 maxViewports /// max number of active viewports
Jesse Halld27f6aa2015-08-15 17:58:48 -07002539 u32[2] maxViewportDimensions /// max viewport dimensions (x,y)
2540 f32[2] viewportBoundsRange /// viewport bounds range (min,max)
2541 u32 viewportSubPixelBits /// num bits of subpixel precision for viewport
2542
Jesse Halldc6d36c2015-11-29 19:12:15 -08002543 platform.size_t minMemoryMapAlignment /// min required alignment of pointers returned by MapMemory (bytes)
2544 VkDeviceSize minTexelBufferOffsetAlignment /// min required alignment for texel buffer offsets (bytes)
2545 VkDeviceSize minUniformBufferOffsetAlignment /// min required alignment for uniform buffer sizes and offsets (bytes)
2546 VkDeviceSize minStorageBufferOffsetAlignment /// min required alignment for storage buffer offsets (bytes)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002547
Jesse Hallfbf97b02015-11-20 14:17:03 -08002548 s32 minTexelOffset /// min texel offset for OpTextureSampleOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07002549 u32 maxTexelOffset /// max texel offset for OpTextureSampleOffset
Jesse Hallfbf97b02015-11-20 14:17:03 -08002550 s32 minTexelGatherOffset /// min texel offset for OpTextureGatherOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07002551 u32 maxTexelGatherOffset /// max texel offset for OpTextureGatherOffset
2552 f32 minInterpolationOffset /// furthest negative offset for interpolateAtOffset
2553 f32 maxInterpolationOffset /// furthest positive offset for interpolateAtOffset
2554 u32 subPixelInterpolationOffsetBits /// num of subpixel bits for interpolateAtOffset
2555
2556 u32 maxFramebufferWidth /// max width for a framebuffer
2557 u32 maxFramebufferHeight /// max height for a framebuffer
2558 u32 maxFramebufferLayers /// max layer count for a layered framebuffer
Jesse Hall091ed9e2015-11-30 00:55:29 -08002559 VkSampleCountFlags framebufferColorSampleCounts
2560 VkSampleCountFlags framebufferDepthSampleCounts
2561 VkSampleCountFlags framebufferStencilSampleCounts
2562 VkSampleCountFlags framebufferNoAttachmentSampleCounts
Jesse Halld27f6aa2015-08-15 17:58:48 -07002563 u32 maxColorAttachments /// max num of framebuffer color attachments
2564
Jesse Hall091ed9e2015-11-30 00:55:29 -08002565 VkSampleCountFlags sampledImageColorSampleCounts
2566 VkSampleCountFlags sampledImageIntegerSampleCounts
2567 VkSampleCountFlags sampledImageDepthSampleCounts
2568 VkSampleCountFlags sampledImageStencilSampleCounts
2569 VkSampleCountFlags storageImageSampleCounts
Jesse Halld27f6aa2015-08-15 17:58:48 -07002570 u32 maxSampleMaskWords /// max num of sample mask words
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002571 VkBool32 timestampComputeAndGraphics
Jesse Halld27f6aa2015-08-15 17:58:48 -07002572
Jesse Halla9bb62b2015-11-21 19:31:56 -08002573 f32 timestampPeriod
Jesse Halld27f6aa2015-08-15 17:58:48 -07002574
2575 u32 maxClipDistances /// max number of clip distances
2576 u32 maxCullDistances /// max number of cull distances
2577 u32 maxCombinedClipAndCullDistances /// max combined number of user clipping
2578
Jesse Hallfbf97b02015-11-20 14:17:03 -08002579 u32 discreteQueuePriorities
2580
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002581 f32[2] pointSizeRange /// range (min,max) of supported point sizes
2582 f32[2] lineWidthRange /// range (min,max) of supported line widths
Jesse Halld27f6aa2015-08-15 17:58:48 -07002583 f32 pointSizeGranularity /// granularity of supported point sizes
2584 f32 lineWidthGranularity /// granularity of supported line widths
Jesse Hall03b6fe12015-11-24 12:44:21 -08002585 VkBool32 strictLines
Jesse Hall091ed9e2015-11-30 00:55:29 -08002586 VkBool32 standardSampleLocations
Jesse Halla9bb62b2015-11-21 19:31:56 -08002587
Jesse Hall65ab5522015-11-30 00:07:16 -08002588 VkDeviceSize optimalBufferCopyOffsetAlignment
2589 VkDeviceSize optimalBufferCopyRowPitchAlignment
Jesse Halldba27f72015-11-30 14:25:46 -08002590 VkDeviceSize nonCoherentAtomSize
Jesse Halld27f6aa2015-08-15 17:58:48 -07002591}
2592
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002593class VkPhysicalDeviceSparseProperties {
2594 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 -08002595 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 -07002596 VkBool32 residencyStandard3DBlockShape /// Sparse resources support: GPU will access all 3D sparse resources using the standard block shapes (based on pixel format)
2597 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 -07002598 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
2599}
2600
Jesse Halld27f6aa2015-08-15 17:58:48 -07002601class VkSemaphoreCreateInfo {
2602 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO
2603 const void* pNext /// Pointer to next structure
2604 VkSemaphoreCreateFlags flags /// Semaphore creation flags
2605}
2606
2607class VkQueryPoolCreateInfo {
2608 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO
2609 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002610 VkQueryPoolCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002611 VkQueryType queryType
Jesse Hall3dd678a2016-01-08 21:52:01 -08002612 u32 queryCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002613 VkQueryPipelineStatisticFlags pipelineStatistics /// Optional
2614}
2615
2616class VkFramebufferCreateInfo {
2617 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO
2618 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002619 VkFramebufferCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002620 VkRenderPass renderPass
2621 u32 attachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002622 const VkImageView* pAttachments
Jesse Halld27f6aa2015-08-15 17:58:48 -07002623 u32 width
2624 u32 height
2625 u32 layers
2626}
2627
Jesse Hall3fbc8562015-11-29 22:10:52 -08002628class VkDrawIndirectCommand {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002629 u32 vertexCount
2630 u32 instanceCount
2631 u32 firstVertex
2632 u32 firstInstance
2633}
2634
Jesse Hall3fbc8562015-11-29 22:10:52 -08002635class VkDrawIndexedIndirectCommand {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002636 u32 indexCount
2637 u32 instanceCount
2638 u32 firstIndex
2639 s32 vertexOffset
2640 u32 firstInstance
2641}
2642
Jesse Hall3fbc8562015-11-29 22:10:52 -08002643class VkDispatchIndirectCommand {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002644 u32 x
2645 u32 y
2646 u32 z
2647}
2648
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002649@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08002650class VkSurfaceCapabilitiesKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002651 u32 minImageCount
2652 u32 maxImageCount
2653 VkExtent2D currentExtent
2654 VkExtent2D minImageExtent
2655 VkExtent2D maxImageExtent
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002656 u32 maxImageArrayLayers
Jesse Hall1356b0d2015-11-23 17:24:58 -08002657 VkSurfaceTransformFlagsKHR supportedTransforms
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002658 VkSurfaceTransformFlagBitsKHR currentTransform
Jesse Halla6429252015-11-29 18:59:42 -08002659 VkCompositeAlphaFlagsKHR supportedCompositeAlpha
Jesse Hall1356b0d2015-11-23 17:24:58 -08002660 VkImageUsageFlags supportedUsageFlags
Michael Lentine88594d72015-11-12 12:49:45 -08002661}
2662
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002663@extension("VK_KHR_surface")
Michael Lentine88594d72015-11-12 12:49:45 -08002664class VkSurfaceFormatKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002665 VkFormat format
2666 VkColorSpaceKHR colorSpace
Michael Lentine88594d72015-11-12 12:49:45 -08002667}
2668
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002669@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08002670class VkSwapchainCreateInfoKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002671 VkStructureType sType
2672 const void* pNext
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002673 VkSwapchainCreateFlagsKHR flags
Jesse Hall1356b0d2015-11-23 17:24:58 -08002674 VkSurfaceKHR surface
2675 u32 minImageCount
2676 VkFormat imageFormat
2677 VkColorSpaceKHR imageColorSpace
2678 VkExtent2D imageExtent
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002679 u32 imageArrayLayers
2680 VkImageUsageFlags imageUsage
Jesse Hall1356b0d2015-11-23 17:24:58 -08002681 VkSharingMode sharingMode
Jesse Hall03b6fe12015-11-24 12:44:21 -08002682 u32 queueFamilyIndexCount
Jesse Hall1356b0d2015-11-23 17:24:58 -08002683 const u32* pQueueFamilyIndices
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002684 VkSurfaceTransformFlagBitsKHR preTransform
2685 VkCompositeAlphaFlagBitsKHR compositeAlpha
Jesse Hall1356b0d2015-11-23 17:24:58 -08002686 VkPresentModeKHR presentMode
Jesse Hall1356b0d2015-11-23 17:24:58 -08002687 VkBool32 clipped
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002688 VkSwapchainKHR oldSwapchain
Michael Lentine88594d72015-11-12 12:49:45 -08002689}
2690
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002691@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08002692class VkPresentInfoKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002693 VkStructureType sType
2694 const void* pNext
Jesse Hallb00daad2015-11-29 19:46:20 -08002695 u32 waitSemaphoreCount
2696 const VkSemaphore* pWaitSemaphores
Jesse Hall1356b0d2015-11-23 17:24:58 -08002697 u32 swapchainCount
Jesse Hall03b6fe12015-11-24 12:44:21 -08002698 const VkSwapchainKHR* pSwapchains
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002699 const u32* pImageIndices
Jesse Halle1b12782015-11-30 11:27:32 -08002700 VkResult* pResults
Michael Lentine88594d72015-11-12 12:49:45 -08002701}
2702
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002703@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002704class VkDisplayPropertiesKHR {
2705 VkDisplayKHR display
2706 const char* displayName
2707 VkExtent2D physicalDimensions
2708 VkExtent2D physicalResolution
2709 VkSurfaceTransformFlagsKHR supportedTransforms
Jesse Hall1356b0d2015-11-23 17:24:58 -08002710 VkBool32 planeReorderPossible
Jesse Halla6429252015-11-29 18:59:42 -08002711 VkBool32 persistentContent
Michael Lentine88594d72015-11-12 12:49:45 -08002712}
2713
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002714@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08002715class VkDisplayModeParametersKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002716 VkExtent2D visibleRegion
Jesse Halla6429252015-11-29 18:59:42 -08002717 u32 refreshRate
Michael Lentine88594d72015-11-12 12:49:45 -08002718}
Jesse Halld27f6aa2015-08-15 17:58:48 -07002719
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002720@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002721class VkDisplayModePropertiesKHR {
2722 VkDisplayModeKHR displayMode
Jesse Halla6429252015-11-29 18:59:42 -08002723 VkDisplayModeParametersKHR parameters
Jesse Hall1356b0d2015-11-23 17:24:58 -08002724}
2725
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002726@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002727class VkDisplayModeCreateInfoKHR {
2728 VkStructureType sType
2729 const void* pNext
Jesse Hall9ba8bc82015-11-30 16:22:16 -08002730 VkDisplayModeCreateFlagsKHR flags
Jesse Halla6429252015-11-29 18:59:42 -08002731 VkDisplayModeParametersKHR parameters
Jesse Hall1356b0d2015-11-23 17:24:58 -08002732}
2733
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002734@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002735class VkDisplayPlanePropertiesKHR {
Jesse Halla6429252015-11-29 18:59:42 -08002736 VkDisplayKHR currentDisplay
2737 u32 currentStackIndex
2738}
2739
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002740@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08002741class VkDisplayPlaneCapabilitiesKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002742 VkDisplayPlaneAlphaFlagsKHR supportedAlpha
2743 VkOffset2D minSrcPosition
2744 VkOffset2D maxSrcPosition
2745 VkExtent2D minSrcExtent
2746 VkExtent2D maxSrcExtent
2747 VkOffset2D minDstPosition
2748 VkOffset2D maxDstPosition
2749 VkExtent2D minDstExtent
2750 VkExtent2D maxDstExtent
2751}
2752
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002753@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08002754class VkDisplaySurfaceCreateInfoKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002755 VkStructureType sType
2756 const void* pNext
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002757 VkDisplaySurfaceCreateFlagsKHR flags
Jesse Hall1356b0d2015-11-23 17:24:58 -08002758 VkDisplayModeKHR displayMode
2759 u32 planeIndex
2760 u32 planeStackIndex
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002761 VkSurfaceTransformFlagBitsKHR transform
Jesse Hall1356b0d2015-11-23 17:24:58 -08002762 f32 globalAlpha
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002763 VkDisplayPlaneAlphaFlagBitsKHR alphaMode
2764 VkExtent2D imageExtent
Jesse Hall1356b0d2015-11-23 17:24:58 -08002765}
2766
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002767@extension("VK_KHR_display_swapchain")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002768class VkDisplayPresentInfoKHR {
2769 VkStructureType sType
2770 const void* pNext
2771 VkRect2D srcRect
2772 VkRect2D dstRect
Jesse Halla6429252015-11-29 18:59:42 -08002773 VkBool32 persistent
Jesse Hall1356b0d2015-11-23 17:24:58 -08002774}
2775
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002776@extension("VK_KHR_xlib_surface")
2777class VkXlibSurfaceCreateInfoKHR {
2778 VkStructureType sType
2779 const void* pNext
2780 VkXlibSurfaceCreateFlagsKHR flags
2781 platform.Display* dpy
2782 platform.Window window
2783}
2784
2785@extension("VK_KHR_xcb_surface")
2786class VkXcbSurfaceCreateInfoKHR {
2787 VkStructureType sType
2788 const void* pNext
2789 VkXcbSurfaceCreateFlagsKHR flags
2790 platform.xcb_connection_t* connection
2791 platform.xcb_window_t window
2792}
2793
2794@extension("VK_KHR_wayland_surface")
2795class VkWaylandSurfaceCreateInfoKHR {
2796 VkStructureType sType
2797 const void* pNext
2798 VkWaylandSurfaceCreateFlagsKHR flags
2799 platform.wl_display* display
2800 platform.wl_surface* surface
2801}
2802
2803@extension("VK_KHR_mir_surface")
2804class VkMirSurfaceCreateInfoKHR {
2805 VkStructureType sType
2806 const void* pNext
2807 VkMirSurfaceCreateFlagsKHR flags
2808 platform.MirConnection* connection
2809 platform.MirSurface* mirSurface
2810}
2811
2812@extension("VK_KHR_android_surface")
2813class VkAndroidSurfaceCreateInfoKHR {
2814 VkStructureType sType
2815 const void* pNext
2816 VkAndroidSurfaceCreateFlagsKHR flags
2817 platform.ANativeWindow* window
2818}
2819
2820@extension("VK_KHR_win32_surface")
2821class VkWin32SurfaceCreateInfoKHR {
2822 VkStructureType sType
2823 const void* pNext
2824 VkWin32SurfaceCreateFlagsKHR flags
2825 platform.HINSTANCE hinstance
2826 platform.HWND hwnd
2827}
2828
Chia-I Wub262ddc2016-03-22 07:38:20 +08002829@extension("VK_ANDROID_native_buffer")
2830class VkNativeBufferANDROID {
2831 VkStructureType sType
2832 const void* pNext
2833 platform.buffer_handle_t handle
2834 int stride
2835 int format
2836 int usage
2837}
2838
Jesse Hall715b86a2016-01-16 16:34:29 -08002839@extension("VK_EXT_debug_report")
2840class VkDebugReportCallbackCreateInfoEXT {
2841 VkStructureType sType
2842 const void* pNext
2843 VkDebugReportFlagsEXT flags
2844 PFN_vkDebugReportCallbackEXT pfnCallback
2845 void* pUserData
2846}
2847
Jesse Hall26763382016-05-20 07:13:52 -07002848@extension("VK_AMD_rasterization_order")
2849class VkPipelineRasterizationStateRasterizationOrderAMD {
2850 VkStructureType sType
2851 const void* pNext
2852 VkRasterizationOrderAMD rasterizationOrder
2853}
2854
2855@extension("VK_EXT_debug_marker")
2856class VkDebugMarkerObjectNameInfoEXT {
2857 VkStructureType sType
2858 const void* pNext
2859 VkDebugReportObjectTypeEXT objectType
2860 u64 object
2861 const char* pObjectName
2862}
2863
2864@extension("VK_EXT_debug_marker")
2865class VkDebugMarkerObjectTagInfoEXT {
2866 VkStructureType sType
2867 const void* pNext
2868 VkDebugReportObjectTypeEXT objectType
2869 u64 object
2870 u64 tagName
2871 platform.size_t tagSize
2872 const void* pTag
2873}
2874
2875@extension("VK_EXT_debug_marker")
2876class VkDebugMarkerMarkerInfoEXT {
2877 VkStructureType sType
2878 const void* pNext
2879 const char* pMarkerName
2880 f32[4] color
2881}
2882
Jesse Hall3f5499b2016-07-26 15:20:40 -07002883@extension("VK_NV_dedicated_allocation")
2884class VkDedicatedAllocationImageCreateInfoNV {
2885 VkStructureType sType
2886 const void* pNext
2887 VkBool32 dedicatedAllocation
2888}
2889
2890@extension("VK_NV_dedicated_allocation")
2891class VkDedicatedAllocationBufferCreateInfoNV {
2892 VkStructureType sType
2893 const void* pNext
2894 VkBool32 dedicatedAllocation
2895}
2896
2897@extension("VK_NV_dedicated_allocation")
2898class VkDedicatedAllocationMemoryAllocateInfoNV {
2899 VkStructureType sType
2900 const void* pNext
2901 VkImage image
2902 VkBuffer buffer
2903}
2904
Jesse Halleb02c472017-02-24 15:13:45 -08002905@extension("VK_NV_external_memory_capabilities")
2906class VkExternalImageFormatPropertiesNV {
2907 VkImageFormatProperties imageFormatProperties
2908 VkExternalMemoryFeatureFlagsNV externalMemoryFeatures
2909 VkExternalMemoryHandleTypeFlagsNV exportFromImportedHandleTypes
2910 VkExternalMemoryHandleTypeFlagsNV compatibleHandleTypes
2911}
2912
2913@extension("VK_NV_external_memory")
2914class VkExternalMemoryImageCreateInfoNV {
2915 VkStructureType sType
2916 const void* pNext
2917 VkExternalMemoryHandleTypeFlagsNV handleTypes
2918}
2919
2920@extension("VK_NV_external_memory")
2921class VkExportMemoryAllocateInfoNV {
2922 VkStructureType sType
2923 const void* pNext
2924 VkExternalMemoryHandleTypeFlagsNV handleTypes
2925}
2926
2927@extension("VK_NV_external_memory_win32")
2928class VkImportMemoryWin32HandleInfoNV {
2929 VkStructureType sType
2930 const void* pNext
2931 VkExternalMemoryHandleTypeFlagsNV handleType
2932 platform.HANDLE handle
2933}
2934
2935@extension("VK_NV_external_memory_win32")
2936class VkExportMemoryWin32HandleInfoNV {
2937 VkStructureType sType
2938 const void* pNext
2939 const platform.SECURITY_ATTRIBUTES* pAttributes
2940 platform.DWORD dwAccess
2941}
2942
2943@extension("VK_NV_win32_keyed_mutex")
2944class VkWin32KeyedMutexAcquireReleaseInfoNV {
2945 VkStructureType sType
2946 const void* pNext
2947 u32 acquireCount
2948 const VkDeviceMemory* pAcquireSyncs
2949 const u64* pAcquireKeys
2950 const u32* pAcquireTimeoutMilliseconds
2951 u32 releaseCount
2952 const VkDeviceMemory* pReleaseSyncs
2953 const u64* pReleaseKeys
2954}
2955
2956@extension("VK_EXT_validation_flags")
2957class VkValidationFlagsEXT {
2958 VkStructureType sType
2959 const void* pNext
2960 u32 disabledValidationCheckCount
2961 VkValidationCheckEXT* pDisabledValidationChecks
2962}
2963
2964@extension("VK_NVX_device_generated_commands")
2965class VkDeviceGeneratedCommandsFeaturesNVX {
2966 VkStructureType sType
2967 const void* pNext
2968 VkBool32 computeBindingPointSupport
2969}
2970
2971@extension("VK_NVX_device_generated_commands")
2972class VkDeviceGeneratedCommandsLimitsNVX {
2973 VkStructureType sType
2974 const void* pNext
2975 u32 maxIndirectCommandsLayoutTokenCount
2976 u32 maxObjectEntryCounts
2977 u32 minSequenceCountBufferOffsetAlignment
2978 u32 minSequenceIndexBufferOffsetAlignment
2979 u32 minCommandsTokenBufferOffsetAlignment
2980}
2981
2982@extension("VK_NVX_device_generated_commands")
2983class VkIndirectCommandsTokenNVX {
2984 VkIndirectCommandsTokenTypeNVX tokenType
2985 VkBuffer buffer
2986 VkDeviceSize offset
2987}
2988
2989@extension("VK_NVX_device_generated_commands")
2990class VkIndirectCommandsLayoutTokenNVX {
2991 VkIndirectCommandsTokenTypeNVX tokenType
2992 u32 bindingUnit
2993 u32 dynamicCount
2994 u32 divisor
2995}
2996
2997@extension("VK_NVX_device_generated_commands")
2998class VkIndirectCommandsLayoutCreateInfoNVX {
2999 VkStructureType sType
3000 const void* pNext
3001 VkPipelineBindPoint pipelineBindPoint
3002 VkIndirectCommandsLayoutUsageFlagsNVX flags
3003 u32 tokenCount
3004 const VkIndirectCommandsLayoutTokenNVX* pTokens
3005}
3006
3007@extension("VK_NVX_device_generated_commands")
3008class VkCmdProcessCommandsInfoNVX {
3009 VkStructureType sType
3010 const void* pNext
3011 VkObjectTableNVX objectTable
3012 VkIndirectCommandsLayoutNVX indirectCommandsLayout
3013 u32 indirectCommandsTokenCount
3014 const VkIndirectCommandsTokenNVX* pIndirectCommandsTokens
3015 u32 maxSequencesCount
3016 VkCommandBuffer targetCommandBuffer
3017 VkBuffer sequencesCountBuffer
3018 VkDeviceSize sequencesCountOffset
3019 VkBuffer sequencesIndexBuffer
3020 VkDeviceSize sequencesIndexOffset
3021}
3022
3023@extension("VK_NVX_device_generated_commands")
3024class VkCmdReserveSpaceForCommandsInfoNVX {
3025 VkStructureType sType
3026 const void* pNext
3027 VkObjectTableNVX objectTable
3028 VkIndirectCommandsLayoutNVX indirectCommandsLayout
3029 u32 maxSequencesCount
3030}
3031
3032@extension("VK_NVX_device_generated_commands")
3033class VkObjectTableCreateInfoNVX {
3034 VkStructureType sType
3035 const void* pNext
3036 u32 objectCount
3037 const VkObjectEntryTypeNVX* pObjectEntryTypes
3038 const u32* pObjectEntryCounts
3039 const VkObjectEntryUsageFlagsNVX* pObjectEntryUsageFlags
3040 u32 maxUniformBuffersPerDescriptor
3041 u32 maxStorageBuffersPerDescriptor
3042 u32 maxStorageImagesPerDescriptor
3043 u32 maxSampledImagesPerDescriptor
3044 u32 maxPipelineLayouts
3045}
3046
3047@extension("VK_NVX_device_generated_commands")
3048class VkObjectTableEntryNVX {
3049 VkObjectEntryTypeNVX type
3050 VkObjectEntryUsageFlagsNVX flags
3051}
3052
3053@extension("VK_NVX_device_generated_commands")
3054class VkObjectTablePipelineEntryNVX {
3055 VkObjectEntryTypeNVX type
3056 VkObjectEntryUsageFlagsNVX flags
3057 VkPipeline pipeline
3058}
3059
3060@extension("VK_NVX_device_generated_commands")
3061class VkObjectTableDescriptorSetEntryNVX {
3062 VkObjectEntryTypeNVX type
3063 VkObjectEntryUsageFlagsNVX flags
3064 VkPipelineLayout pipelineLayout
3065 VkDescriptorSet descriptorSet
3066}
3067
3068@extension("VK_NVX_device_generated_commands")
3069class VkObjectTableVertexBufferEntryNVX {
3070 VkObjectEntryTypeNVX type
3071 VkObjectEntryUsageFlagsNVX flags
3072 VkBuffer buffer
3073}
3074
3075@extension("VK_NVX_device_generated_commands")
3076class VkObjectTableIndexBufferEntryNVX {
3077 VkObjectEntryTypeNVX type
3078 VkObjectEntryUsageFlagsNVX flags
3079 VkBuffer buffer
3080}
3081
3082@extension("VK_NVX_device_generated_commands")
3083class VkObjectTablePushConstantEntryNVX {
3084 VkObjectEntryTypeNVX type
3085 VkObjectEntryUsageFlagsNVX flags
3086 VkPipelineLayout pipelineLayout
3087 VkShaderStageFlags stageFlags
3088}
3089
Jesse Hall1356b0d2015-11-23 17:24:58 -08003090
Jesse Halld27f6aa2015-08-15 17:58:48 -07003091////////////////
3092// Commands //
3093////////////////
3094
3095// Function pointers. TODO: add support for function pointers.
3096
3097@external type void* PFN_vkVoidFunction
3098@pfn cmd void vkVoidFunction() {
3099}
3100
Jesse Hall3fbc8562015-11-29 22:10:52 -08003101@external type void* PFN_vkAllocationFunction
3102@pfn cmd void* vkAllocationFunction(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003103 void* pUserData,
3104 platform.size_t size,
3105 platform.size_t alignment,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003106 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08003107 return ?
3108}
3109
Jesse Hall3fbc8562015-11-29 22:10:52 -08003110@external type void* PFN_vkReallocationFunction
3111@pfn cmd void* vkReallocationFunction(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003112 void* pUserData,
3113 void* pOriginal,
3114 platform.size_t size,
3115 platform.size_t alignment,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003116 VkSystemAllocationScope allocationScope) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003117 return ?
3118}
3119
3120@external type void* PFN_vkFreeFunction
3121@pfn cmd void vkFreeFunction(
3122 void* pUserData,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003123 void* pMemory) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003124}
3125
Jesse Hall3fbc8562015-11-29 22:10:52 -08003126@external type void* PFN_vkInternalAllocationNotification
3127@pfn cmd void vkInternalAllocationNotification(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003128 void* pUserData,
3129 platform.size_t size,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003130 VkInternalAllocationType allocationType,
3131 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08003132}
3133
3134@external type void* PFN_vkInternalFreeNotification
3135@pfn cmd void vkInternalFreeNotification(
3136 void* pUserData,
3137 platform.size_t size,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003138 VkInternalAllocationType allocationType,
3139 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08003140}
Jesse Halld27f6aa2015-08-15 17:58:48 -07003141
3142// Global functions
3143
3144@threadSafety("system")
3145cmd VkResult vkCreateInstance(
3146 const VkInstanceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003147 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003148 VkInstance* pInstance) {
3149 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO)
3150
3151 instance := ?
3152 pInstance[0] = instance
3153 State.Instances[instance] = new!InstanceObject()
3154
Jesse Hall3dd678a2016-01-08 21:52:01 -08003155 layers := pCreateInfo.ppEnabledLayerNames[0:pCreateInfo.enabledLayerCount]
3156 extensions := pCreateInfo.ppEnabledExtensionNames[0:pCreateInfo.enabledExtensionCount]
Jesse Halld27f6aa2015-08-15 17:58:48 -07003157
3158 return ?
3159}
3160
3161@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003162cmd void vkDestroyInstance(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003163 VkInstance instance,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003164 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003165 instanceObject := GetInstance(instance)
3166
3167 State.Instances[instance] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003168}
3169
3170@threadSafety("system")
3171cmd VkResult vkEnumeratePhysicalDevices(
3172 VkInstance instance,
3173 u32* pPhysicalDeviceCount,
3174 VkPhysicalDevice* pPhysicalDevices) {
3175 instanceObject := GetInstance(instance)
3176
3177 physicalDeviceCount := as!u32(?)
3178 pPhysicalDeviceCount[0] = physicalDeviceCount
3179 physicalDevices := pPhysicalDevices[0:physicalDeviceCount]
3180
3181 for i in (0 .. physicalDeviceCount) {
3182 physicalDevice := ?
3183 physicalDevices[i] = physicalDevice
3184 if !(physicalDevice in State.PhysicalDevices) {
3185 State.PhysicalDevices[physicalDevice] = new!PhysicalDeviceObject(instance: instance)
3186 }
3187 }
3188
3189 return ?
3190}
3191
3192cmd PFN_vkVoidFunction vkGetDeviceProcAddr(
3193 VkDevice device,
3194 const char* pName) {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003195 if device != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003196 device := GetDevice(device)
3197 }
3198
3199 return ?
3200}
3201
3202cmd PFN_vkVoidFunction vkGetInstanceProcAddr(
3203 VkInstance instance,
3204 const char* pName) {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003205 if instance != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003206 instanceObject := GetInstance(instance)
3207 }
3208
3209 return ?
3210}
3211
Jesse Hall606a54e2015-11-19 22:17:28 -08003212cmd void vkGetPhysicalDeviceProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003213 VkPhysicalDevice physicalDevice,
3214 VkPhysicalDeviceProperties* pProperties) {
3215 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3216
3217 properties := ?
3218 pProperties[0] = properties
Jesse Halld27f6aa2015-08-15 17:58:48 -07003219}
3220
Jesse Hall606a54e2015-11-19 22:17:28 -08003221cmd void vkGetPhysicalDeviceQueueFamilyProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003222 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003223 u32* pQueueFamilyPropertyCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003224 VkQueueFamilyProperties* pQueueFamilyProperties) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003225 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003226 // TODO: Figure out how to express fetch-count-or-properties
3227 // This version fails 'apic validate' with 'fence not allowed in
3228 // *semantic.Branch'. Other attempts have failed with the same or other
3229 // errors.
3230 // if pQueueFamilyProperties != null {
3231 // queuesProperties := pQueueFamilyProperties[0:pCount[0]]
3232 // for i in (0 .. pCount[0]) {
3233 // queueProperties := as!VkQueueFamilyProperties(?)
3234 // queuesProperties[i] = queueProperties
3235 // }
3236 // } else {
3237 // count := ?
3238 // pCount[0] = count
3239 // }
Jesse Halld27f6aa2015-08-15 17:58:48 -07003240}
3241
Jesse Hall606a54e2015-11-19 22:17:28 -08003242cmd void vkGetPhysicalDeviceMemoryProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003243 VkPhysicalDevice physicalDevice,
3244 VkPhysicalDeviceMemoryProperties* pMemoryProperties) {
3245 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3246
3247 memoryProperties := ?
3248 pMemoryProperties[0] = memoryProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07003249}
3250
Jesse Hall606a54e2015-11-19 22:17:28 -08003251cmd void vkGetPhysicalDeviceFeatures(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003252 VkPhysicalDevice physicalDevice,
3253 VkPhysicalDeviceFeatures* pFeatures) {
3254 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3255
3256 features := ?
3257 pFeatures[0] = features
Jesse Halld27f6aa2015-08-15 17:58:48 -07003258}
3259
Jesse Hall606a54e2015-11-19 22:17:28 -08003260cmd void vkGetPhysicalDeviceFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003261 VkPhysicalDevice physicalDevice,
3262 VkFormat format,
3263 VkFormatProperties* pFormatProperties) {
3264 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3265
3266 formatProperties := ?
3267 pFormatProperties[0] = formatProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07003268}
3269
Jesse Halla9e57032015-11-30 01:03:10 -08003270cmd VkResult vkGetPhysicalDeviceImageFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003271 VkPhysicalDevice physicalDevice,
3272 VkFormat format,
3273 VkImageType type,
3274 VkImageTiling tiling,
3275 VkImageUsageFlags usage,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003276 VkImageCreateFlags flags,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003277 VkImageFormatProperties* pImageFormatProperties) {
3278 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3279
3280 imageFormatProperties := ?
3281 pImageFormatProperties[0] = imageFormatProperties
Jesse Halla9e57032015-11-30 01:03:10 -08003282
3283 return ?
Jesse Halld27f6aa2015-08-15 17:58:48 -07003284}
3285
Jesse Halld27f6aa2015-08-15 17:58:48 -07003286
3287// Device functions
3288
3289@threadSafety("system")
3290cmd VkResult vkCreateDevice(
3291 VkPhysicalDevice physicalDevice,
3292 const VkDeviceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003293 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003294 VkDevice* pDevice) {
3295 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO)
3296 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3297
3298 device := ?
3299 pDevice[0] = device
3300 State.Devices[device] = new!DeviceObject(physicalDevice: physicalDevice)
3301
3302 return ?
3303}
3304
3305@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003306cmd void vkDestroyDevice(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003307 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003308 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003309 deviceObject := GetDevice(device)
3310
3311 State.Devices[device] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003312}
3313
3314
3315// Extension discovery functions
3316
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003317cmd VkResult vkEnumerateInstanceLayerProperties(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003318 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003319 VkLayerProperties* pProperties) {
3320 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08003321 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07003322
3323 properties := pProperties[0:count]
3324 for i in (0 .. count) {
3325 property := ?
3326 properties[i] = property
3327 }
3328
3329 return ?
3330}
3331
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003332cmd VkResult vkEnumerateInstanceExtensionProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003333 const char* pLayerName,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003334 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003335 VkExtensionProperties* pProperties) {
3336 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08003337 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07003338
3339 properties := pProperties[0:count]
3340 for i in (0 .. count) {
3341 property := ?
3342 properties[i] = property
3343 }
3344
3345 return ?
3346}
3347
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003348cmd VkResult vkEnumerateDeviceLayerProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003349 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003350 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003351 VkLayerProperties* pProperties) {
3352 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3353 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08003354 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07003355
3356 properties := pProperties[0:count]
3357 for i in (0 .. count) {
3358 property := ?
3359 properties[i] = property
3360 }
3361
3362 return ?
3363}
3364
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003365cmd VkResult vkEnumerateDeviceExtensionProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003366 VkPhysicalDevice physicalDevice,
3367 const char* pLayerName,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003368 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003369 VkExtensionProperties* pProperties) {
3370 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3371
3372 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08003373 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07003374
3375 properties := pProperties[0:count]
3376 for i in (0 .. count) {
3377 property := ?
3378 properties[i] = property
3379 }
3380
3381 return ?
3382}
3383
3384
3385// Queue functions
3386
3387@threadSafety("system")
Jesse Hall606a54e2015-11-19 22:17:28 -08003388cmd void vkGetDeviceQueue(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003389 VkDevice device,
3390 u32 queueFamilyIndex,
3391 u32 queueIndex,
3392 VkQueue* pQueue) {
3393 deviceObject := GetDevice(device)
3394
3395 queue := ?
3396 pQueue[0] = queue
3397
3398 if !(queue in State.Queues) {
3399 State.Queues[queue] = new!QueueObject(device: device)
3400 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07003401}
3402
3403@threadSafety("app")
3404cmd VkResult vkQueueSubmit(
3405 VkQueue queue,
Jesse Halla366a512015-11-19 22:30:07 -08003406 u32 submitCount,
Jesse Hallb00daad2015-11-29 19:46:20 -08003407 const VkSubmitInfo* pSubmits,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003408 VkFence fence) {
3409 queueObject := GetQueue(queue)
3410
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003411 if fence != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003412 fenceObject := GetFence(fence)
3413 assert(fenceObject.device == queueObject.device)
3414 }
3415
Jesse Hall3fbc8562015-11-29 22:10:52 -08003416 // commandBuffers := pcommandBuffers[0:commandBufferCount]
3417 // for i in (0 .. commandBufferCount) {
3418 // commandBuffer := commandBuffers[i]
3419 // commandBufferObject := GetCommandBuffer(commandBuffer)
3420 // assert(commandBufferObject.device == queueObject.device)
Jesse Halla366a512015-11-19 22:30:07 -08003421 //
Jesse Hall3fbc8562015-11-29 22:10:52 -08003422 // validate("QueueCheck", commandBufferObject.queueFlags in queueObject.flags,
3423 // "vkQueueSubmit: enqueued commandBuffer requires missing queue capabilities.")
Jesse Halla366a512015-11-19 22:30:07 -08003424 // }
Jesse Halld27f6aa2015-08-15 17:58:48 -07003425
3426 return ?
3427}
3428
3429@threadSafety("system")
3430cmd VkResult vkQueueWaitIdle(
3431 VkQueue queue) {
3432 queueObject := GetQueue(queue)
3433
3434 return ?
3435}
3436
3437@threadSafety("system")
3438cmd VkResult vkDeviceWaitIdle(
3439 VkDevice device) {
3440 deviceObject := GetDevice(device)
3441
3442 return ?
3443}
3444
3445
3446// Memory functions
3447
3448@threadSafety("system")
Jesse Hall3fbc8562015-11-29 22:10:52 -08003449cmd VkResult vkAllocateMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003450 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003451 const VkMemoryAllocateInfo* pAllocateInfo,
3452 const VkAllocationCallbacks* pAllocator,
3453 VkDeviceMemory* pMemory) {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08003454 assert(pAllocateInfo.sType == VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003455 deviceObject := GetDevice(device)
3456
Jesse Hall3fbc8562015-11-29 22:10:52 -08003457 memory := ?
3458 pMemory[0] = memory
3459 State.DeviceMemories[memory] = new!DeviceMemoryObject(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003460 device: device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003461 allocationSize: pAllocateInfo[0].allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003462
3463 return ?
3464}
3465
3466@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003467cmd void vkFreeMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003468 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003469 VkDeviceMemory memory,
3470 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003471 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003472 memoryObject := GetDeviceMemory(memory)
3473 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003474
3475 // Check that no objects are still bound before freeing.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003476 validate("MemoryCheck", len(memoryObject.boundObjects) == 0,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003477 "vkFreeMemory: objects still bound")
Jesse Hall3fbc8562015-11-29 22:10:52 -08003478 validate("MemoryCheck", len(memoryObject.boundCommandBuffers) == 0,
3479 "vkFreeMemory: commandBuffers still bound")
3480 State.DeviceMemories[memory] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003481}
3482
3483@threadSafety("app")
3484cmd VkResult vkMapMemory(
3485 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003486 VkDeviceMemory memory,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003487 VkDeviceSize offset,
3488 VkDeviceSize size,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003489 VkMemoryMapFlags flags,
3490 void** ppData) {
3491 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003492 memoryObject := GetDeviceMemory(memory)
3493 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003494
3495 assert(flags == as!VkMemoryMapFlags(0))
Jesse Hall3fbc8562015-11-29 22:10:52 -08003496 assert((offset + size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003497
3498 return ?
3499}
3500
3501@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003502cmd void vkUnmapMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003503 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003504 VkDeviceMemory memory) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003505 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003506 memoryObject := GetDeviceMemory(memory)
3507 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003508}
3509
3510cmd VkResult vkFlushMappedMemoryRanges(
3511 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003512 u32 memoryRangeCount
3513 const VkMappedMemoryRange* pMemoryRanges) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003514 deviceObject := GetDevice(device)
3515
Jesse Hall3fbc8562015-11-29 22:10:52 -08003516 memoryRanges := pMemoryRanges[0:memoryRangeCount]
3517 for i in (0 .. memoryRangeCount) {
3518 memoryRange := memoryRanges[i]
3519 memoryObject := GetDeviceMemory(memoryRange.memory)
3520 assert(memoryObject.device == device)
3521 assert((memoryRange.offset + memoryRange.size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003522 }
3523
3524 return ?
3525}
3526
3527cmd VkResult vkInvalidateMappedMemoryRanges(
3528 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003529 u32 memoryRangeCount,
3530 const VkMappedMemoryRange* pMemoryRanges) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003531 deviceObject := GetDevice(device)
3532
Jesse Hall3fbc8562015-11-29 22:10:52 -08003533 memoryRanges := pMemoryRanges[0:memoryRangeCount]
3534 for i in (0 .. memoryRangeCount) {
3535 memoryRange := memoryRanges[i]
3536 memoryObject := GetDeviceMemory(memoryRange.memory)
3537 assert(memoryObject.device == device)
3538 assert((memoryRange.offset + memoryRange.size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003539 }
3540
3541 return ?
3542}
3543
3544
3545// Memory management API functions
3546
Jesse Hall606a54e2015-11-19 22:17:28 -08003547cmd void vkGetDeviceMemoryCommitment(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003548 VkDevice device,
3549 VkDeviceMemory memory,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003550 VkDeviceSize* pCommittedMemoryInBytes) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003551 deviceObject := GetDevice(device)
3552
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003553 if memory != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003554 memoryObject := GetDeviceMemory(memory)
3555 assert(memoryObject.device == device)
3556 }
3557
3558 committedMemoryInBytes := ?
3559 pCommittedMemoryInBytes[0] = committedMemoryInBytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07003560}
3561
Jesse Hall606a54e2015-11-19 22:17:28 -08003562cmd void vkGetBufferMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003563 VkDevice device,
3564 VkBuffer buffer,
3565 VkMemoryRequirements* pMemoryRequirements) {
3566 deviceObject := GetDevice(device)
3567 bufferObject := GetBuffer(buffer)
3568 assert(bufferObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003569}
3570
3571cmd VkResult vkBindBufferMemory(
3572 VkDevice device,
3573 VkBuffer buffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003574 VkDeviceMemory memory,
3575 VkDeviceSize memoryOffset) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003576 deviceObject := GetDevice(device)
3577 bufferObject := GetBuffer(buffer)
3578 assert(bufferObject.device == device)
3579
3580 // Unbind buffer from previous memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003581 if bufferObject.memory != NULL_HANDLE {
3582 memoryObject := GetDeviceMemory(bufferObject.memory)
3583 memoryObject.boundObjects[as!u64(buffer)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003584 }
3585
3586 // Bind buffer to given memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003587 if memory != NULL_HANDLE {
3588 memoryObject := GetDeviceMemory(memory)
3589 assert(memoryObject.device == device)
3590 memoryObject.boundObjects[as!u64(buffer)] = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003591 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08003592 bufferObject.memory = memory
3593 bufferObject.memoryOffset = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003594
3595 return ?
3596}
3597
Jesse Hall606a54e2015-11-19 22:17:28 -08003598cmd void vkGetImageMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003599 VkDevice device,
3600 VkImage image,
3601 VkMemoryRequirements* pMemoryRequirements) {
3602 deviceObject := GetDevice(device)
3603 imageObject := GetImage(image)
3604 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003605}
3606
3607cmd VkResult vkBindImageMemory(
3608 VkDevice device,
3609 VkImage image,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003610 VkDeviceMemory memory,
3611 VkDeviceSize memoryOffset) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003612 deviceObject := GetDevice(device)
3613 imageObject := GetImage(image)
3614 assert(imageObject.device == device)
3615
3616 // Unbind image from previous memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003617 if imageObject.memory != NULL_HANDLE {
3618 memoryObject := GetDeviceMemory(imageObject.memory)
3619 memoryObject.boundObjects[as!u64(image)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003620 }
3621
3622 // Bind image to given memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003623 if memory != NULL_HANDLE {
3624 memoryObject := GetDeviceMemory(memory)
3625 assert(memoryObject.device == device)
3626 memoryObject.boundObjects[as!u64(image)] = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003627 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08003628 imageObject.memory = memory
3629 imageObject.memoryOffset = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003630
3631 return ?
3632}
3633
Jesse Hall606a54e2015-11-19 22:17:28 -08003634cmd void vkGetImageSparseMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003635 VkDevice device,
3636 VkImage image,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003637 u32* pSparseMemoryRequirementCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003638 VkSparseImageMemoryRequirements* pSparseMemoryRequirements) {
3639 deviceObject := GetDevice(device)
3640 imageObject := GetImage(image)
3641 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003642}
3643
Jesse Hall606a54e2015-11-19 22:17:28 -08003644cmd void vkGetPhysicalDeviceSparseImageFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003645 VkPhysicalDevice physicalDevice,
3646 VkFormat format,
3647 VkImageType type,
Jesse Hall091ed9e2015-11-30 00:55:29 -08003648 VkSampleCountFlagBits samples,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003649 VkImageUsageFlags usage,
3650 VkImageTiling tiling,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003651 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003652 VkSparseImageFormatProperties* pProperties) {
3653 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003654}
3655
Jesse Halla6429252015-11-29 18:59:42 -08003656cmd VkResult vkQueueBindSparse(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003657 VkQueue queue,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003658 u32 bindInfoCount,
Jesse Halla6429252015-11-29 18:59:42 -08003659 const VkBindSparseInfo* pBindInfo,
3660 VkFence fence) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003661 queueObject := GetQueue(queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003662
3663 return ?
3664}
3665
3666
3667// Fence functions
3668
3669@threadSafety("system")
3670cmd VkResult vkCreateFence(
3671 VkDevice device,
3672 const VkFenceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003673 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003674 VkFence* pFence) {
3675 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_FENCE_CREATE_INFO)
3676 deviceObject := GetDevice(device)
3677
3678 fence := ?
3679 pFence[0] = fence
3680 State.Fences[fence] = new!FenceObject(
Jesse Halld8bade02015-11-24 10:24:18 -08003681 device: device, signaled: (pCreateInfo.flags == as!VkFenceCreateFlags(VK_FENCE_CREATE_SIGNALED_BIT)))
Jesse Halld27f6aa2015-08-15 17:58:48 -07003682
3683 return ?
3684}
3685
3686@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003687cmd void vkDestroyFence(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003688 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003689 VkFence fence,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003690 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003691 deviceObject := GetDevice(device)
3692 fenceObject := GetFence(fence)
3693 assert(fenceObject.device == device)
3694
3695 State.Fences[fence] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003696}
3697
3698@threadSafety("system")
3699cmd VkResult vkResetFences(
3700 VkDevice device,
3701 u32 fenceCount,
3702 const VkFence* pFences) {
3703 deviceObject := GetDevice(device)
3704
3705 fences := pFences[0:fenceCount]
3706 for i in (0 .. fenceCount) {
3707 fence := fences[i]
3708 fenceObject := GetFence(fence)
3709 assert(fenceObject.device == device)
3710 fenceObject.signaled = false
3711 }
3712
3713 return ?
3714}
3715
3716@threadSafety("system")
3717cmd VkResult vkGetFenceStatus(
3718 VkDevice device,
3719 VkFence fence) {
3720 deviceObject := GetDevice(device)
3721 fenceObject := GetFence(fence)
3722 assert(fenceObject.device == device)
3723
3724 return ?
3725}
3726
3727@threadSafety("system")
3728cmd VkResult vkWaitForFences(
3729 VkDevice device,
3730 u32 fenceCount,
3731 const VkFence* pFences,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003732 VkBool32 waitAll,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003733 u64 timeout) { /// timeout in nanoseconds
3734 deviceObject := GetDevice(device)
3735
3736 fences := pFences[0:fenceCount]
3737 for i in (0 .. fenceCount) {
3738 fence := fences[i]
3739 fenceObject := GetFence(fence)
3740 assert(fenceObject.device == device)
3741 }
3742
3743 return ?
3744}
3745
3746
3747// Queue semaphore functions
3748
3749@threadSafety("system")
3750cmd VkResult vkCreateSemaphore(
3751 VkDevice device,
3752 const VkSemaphoreCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003753 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003754 VkSemaphore* pSemaphore) {
3755 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO)
3756 deviceObject := GetDevice(device)
3757
3758 semaphore := ?
3759 pSemaphore[0] = semaphore
3760 State.Semaphores[semaphore] = new!SemaphoreObject(device: device)
3761
3762 return ?
3763}
3764
3765@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003766cmd void vkDestroySemaphore(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003767 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003768 VkSemaphore semaphore,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003769 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003770 deviceObject := GetDevice(device)
3771 semaphoreObject := GetSemaphore(semaphore)
3772 assert(semaphoreObject.device == device)
3773
3774 State.Semaphores[semaphore] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003775}
3776
Jesse Halld27f6aa2015-08-15 17:58:48 -07003777
3778// Event functions
3779
3780@threadSafety("system")
3781cmd VkResult vkCreateEvent(
3782 VkDevice device,
3783 const VkEventCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003784 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003785 VkEvent* pEvent) {
3786 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_EVENT_CREATE_INFO)
3787 deviceObject := GetDevice(device)
3788
3789 event := ?
3790 pEvent[0] = event
3791 State.Events[event] = new!EventObject(device: device)
3792
3793 return ?
3794}
3795
3796@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003797cmd void vkDestroyEvent(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003798 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003799 VkEvent event,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003800 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003801 deviceObject := GetDevice(device)
3802 eventObject := GetEvent(event)
3803 assert(eventObject.device == device)
3804
3805 State.Events[event] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003806}
3807
3808@threadSafety("system")
3809cmd VkResult vkGetEventStatus(
3810 VkDevice device,
3811 VkEvent event) {
3812 deviceObject := GetDevice(device)
3813 eventObject := GetEvent(event)
3814 assert(eventObject.device == device)
3815
3816 return ?
3817}
3818
3819@threadSafety("system")
3820cmd VkResult vkSetEvent(
3821 VkDevice device,
3822 VkEvent event) {
3823 deviceObject := GetDevice(device)
3824 eventObject := GetEvent(event)
3825 assert(eventObject.device == device)
3826
3827 return ?
3828}
3829
3830@threadSafety("system")
3831cmd VkResult vkResetEvent(
3832 VkDevice device,
3833 VkEvent event) {
3834 deviceObject := GetDevice(device)
3835 eventObject := GetEvent(event)
3836 assert(eventObject.device == device)
3837
3838 return ?
3839}
3840
3841
3842// Query functions
3843
3844@threadSafety("system")
3845cmd VkResult vkCreateQueryPool(
3846 VkDevice device,
3847 const VkQueryPoolCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003848 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003849 VkQueryPool* pQueryPool) {
3850 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO)
3851 deviceObject := GetDevice(device)
3852
3853 queryPool := ?
3854 pQueryPool[0] = queryPool
3855 State.QueryPools[queryPool] = new!QueryPoolObject(device: device)
3856
3857 return ?
3858}
3859
3860@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003861cmd void vkDestroyQueryPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003862 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003863 VkQueryPool queryPool,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003864 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003865 deviceObject := GetDevice(device)
3866 queryPoolObject := GetQueryPool(queryPool)
3867 assert(queryPoolObject.device == device)
3868
3869 State.QueryPools[queryPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003870}
3871
3872@threadSafety("system")
3873cmd VkResult vkGetQueryPoolResults(
3874 VkDevice device,
3875 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08003876 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003877 u32 queryCount,
Jesse Halla9bb62b2015-11-21 19:31:56 -08003878 platform.size_t dataSize,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003879 void* pData,
Jesse Halla9bb62b2015-11-21 19:31:56 -08003880 VkDeviceSize stride,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003881 VkQueryResultFlags flags) {
3882 deviceObject := GetDevice(device)
3883 queryPoolObject := GetQueryPool(queryPool)
3884 assert(queryPoolObject.device == device)
3885
Jesse Halld27f6aa2015-08-15 17:58:48 -07003886 data := pData[0:dataSize]
3887
3888 return ?
3889}
3890
3891// Buffer functions
3892
3893@threadSafety("system")
3894cmd VkResult vkCreateBuffer(
3895 VkDevice device,
3896 const VkBufferCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003897 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003898 VkBuffer* pBuffer) {
3899 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO)
3900 deviceObject := GetDevice(device)
3901
3902 buffer := ?
3903 pBuffer[0] = buffer
3904 State.Buffers[buffer] = new!BufferObject(device: device)
3905
3906 return ?
3907}
3908
3909@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003910cmd void vkDestroyBuffer(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003911 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003912 VkBuffer buffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003913 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003914 deviceObject := GetDevice(device)
3915 bufferObject := GetBuffer(buffer)
3916 assert(bufferObject.device == device)
3917
Jesse Hall3fbc8562015-11-29 22:10:52 -08003918 assert(bufferObject.memory == 0)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003919 State.Buffers[buffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003920}
3921
3922
3923// Buffer view functions
3924
3925@threadSafety("system")
3926cmd VkResult vkCreateBufferView(
3927 VkDevice device,
3928 const VkBufferViewCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003929 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003930 VkBufferView* pView) {
3931 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO)
3932 deviceObject := GetDevice(device)
3933
3934 bufferObject := GetBuffer(pCreateInfo.buffer)
3935 assert(bufferObject.device == device)
3936
3937 view := ?
3938 pView[0] = view
3939 State.BufferViews[view] = new!BufferViewObject(device: device, buffer: pCreateInfo.buffer)
3940
3941 return ?
3942}
3943
3944@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003945cmd void vkDestroyBufferView(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003946 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003947 VkBufferView bufferView,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003948 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003949 deviceObject := GetDevice(device)
3950 bufferViewObject := GetBufferView(bufferView)
3951 assert(bufferViewObject.device == device)
3952
3953 State.BufferViews[bufferView] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003954}
3955
3956
3957// Image functions
3958
3959@threadSafety("system")
3960cmd VkResult vkCreateImage(
3961 VkDevice device,
3962 const VkImageCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003963 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003964 VkImage* pImage) {
3965 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO)
3966 deviceObject := GetDevice(device)
3967
3968 image := ?
3969 pImage[0] = image
3970 State.Images[image] = new!ImageObject(device: device)
3971
3972 return ?
3973}
3974
3975@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003976cmd void vkDestroyImage(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003977 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003978 VkImage image,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003979 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003980 deviceObject := GetDevice(device)
3981 imageObject := GetImage(image)
3982 assert(imageObject.device == device)
3983
Jesse Hall3fbc8562015-11-29 22:10:52 -08003984 assert(imageObject.memory == 0)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003985 State.Images[image] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003986}
3987
Jesse Hall606a54e2015-11-19 22:17:28 -08003988cmd void vkGetImageSubresourceLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003989 VkDevice device,
3990 VkImage image,
3991 const VkImageSubresource* pSubresource,
3992 VkSubresourceLayout* pLayout) {
3993 deviceObject := GetDevice(device)
3994 imageObject := GetImage(image)
3995 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003996}
3997
3998
3999// Image view functions
4000
4001@threadSafety("system")
4002cmd VkResult vkCreateImageView(
4003 VkDevice device,
4004 const VkImageViewCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004005 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004006 VkImageView* pView) {
4007 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO)
4008 deviceObject := GetDevice(device)
4009
4010 imageObject := GetImage(pCreateInfo.image)
4011 assert(imageObject.device == device)
4012
4013 view := ?
4014 pView[0] = view
4015 State.ImageViews[view] = new!ImageViewObject(device: device, image: pCreateInfo.image)
4016
4017 return ?
4018}
4019
4020@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004021cmd void vkDestroyImageView(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004022 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004023 VkImageView imageView,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004024 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004025 deviceObject := GetDevice(device)
4026 imageViewObject := GetImageView(imageView)
4027 assert(imageViewObject.device == device)
4028
4029 State.ImageViews[imageView] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004030}
4031
4032
4033// Shader functions
4034
4035cmd VkResult vkCreateShaderModule(
4036 VkDevice device,
4037 const VkShaderModuleCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004038 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004039 VkShaderModule* pShaderModule) {
4040 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO)
4041 deviceObject := GetDevice(device)
4042
4043 shaderModule := ?
4044 pShaderModule[0] = shaderModule
4045 State.ShaderModules[shaderModule] = new!ShaderModuleObject(device: device)
4046
4047 return ?
4048}
4049
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004050cmd void vkDestroyShaderModule(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004051 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004052 VkShaderModule shaderModule,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004053 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004054 deviceObject := GetDevice(device)
4055 shaderModuleObject := GetShaderModule(shaderModule)
4056 assert(shaderModuleObject.device == device)
4057
4058 State.ShaderModules[shaderModule] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004059}
4060
Jesse Halld27f6aa2015-08-15 17:58:48 -07004061
4062// Pipeline functions
4063
4064cmd VkResult vkCreatePipelineCache(
4065 VkDevice device,
4066 const VkPipelineCacheCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004067 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004068 VkPipelineCache* pPipelineCache) {
4069 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO)
4070 deviceObject := GetDevice(device)
4071
4072 pipelineCache := ?
4073 pPipelineCache[0] = pipelineCache
4074 State.PipelineCaches[pipelineCache] = new!PipelineCacheObject(device: device)
4075
4076 return ?
4077}
4078
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004079cmd void vkDestroyPipelineCache(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004080 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004081 VkPipelineCache pipelineCache,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004082 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004083 deviceObject := GetDevice(device)
4084 pipelineCacheObject := GetPipelineCache(pipelineCache)
4085 assert(pipelineCacheObject.device == device)
4086
4087 State.PipelineCaches[pipelineCache] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004088}
4089
Jesse Halld27f6aa2015-08-15 17:58:48 -07004090cmd VkResult vkGetPipelineCacheData(
4091 VkDevice device,
4092 VkPipelineCache pipelineCache,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004093 platform.size_t* pDataSize,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004094 void* pData) {
4095 deviceObject := GetDevice(device)
4096 pipelineCacheObject := GetPipelineCache(pipelineCache)
4097 assert(pipelineCacheObject.device == device)
4098
4099 return ?
4100}
4101
4102cmd VkResult vkMergePipelineCaches(
4103 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004104 VkPipelineCache dstCache,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004105 u32 srcCacheCount,
4106 const VkPipelineCache* pSrcCaches) {
4107 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004108 dstCacheObject := GetPipelineCache(dstCache)
4109 assert(dstCacheObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004110
4111 srcCaches := pSrcCaches[0:srcCacheCount]
4112 for i in (0 .. srcCacheCount) {
4113 srcCache := srcCaches[i]
4114 srcCacheObject := GetPipelineCache(srcCache)
4115 assert(srcCacheObject.device == device)
4116 }
4117
4118 return ?
4119}
4120
4121cmd VkResult vkCreateGraphicsPipelines(
4122 VkDevice device,
4123 VkPipelineCache pipelineCache,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004124 u32 createInfoCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004125 const VkGraphicsPipelineCreateInfo* pCreateInfos,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004126 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004127 VkPipeline* pPipelines) {
4128 deviceObject := GetDevice(device)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004129 if pipelineCache != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004130 pipelineCacheObject := GetPipelineCache(pipelineCache)
4131 assert(pipelineCacheObject.device == device)
4132 }
4133
Jesse Hall03b6fe12015-11-24 12:44:21 -08004134 createInfos := pCreateInfos[0:createInfoCount]
4135 pipelines := pPipelines[0:createInfoCount]
4136 for i in (0 .. createInfoCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004137 pipeline := ?
4138 pipelines[i] = pipeline
4139 State.Pipelines[pipeline] = new!PipelineObject(device: device)
4140 }
4141
4142 return ?
4143}
4144
4145cmd VkResult vkCreateComputePipelines(
4146 VkDevice device,
4147 VkPipelineCache pipelineCache,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004148 u32 createInfoCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004149 const VkComputePipelineCreateInfo* pCreateInfos,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004150 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004151 VkPipeline* pPipelines) {
4152 deviceObject := GetDevice(device)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004153 if pipelineCache != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004154 pipelineCacheObject := GetPipelineCache(pipelineCache)
4155 assert(pipelineCacheObject.device == device)
4156 }
4157
Jesse Hall03b6fe12015-11-24 12:44:21 -08004158 createInfos := pCreateInfos[0:createInfoCount]
4159 pipelines := pPipelines[0:createInfoCount]
4160 for i in (0 .. createInfoCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004161 pipeline := ?
4162 pipelines[i] = pipeline
4163 State.Pipelines[pipeline] = new!PipelineObject(device: device)
4164 }
4165
4166 return ?
4167}
4168
4169@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004170cmd void vkDestroyPipeline(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004171 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004172 VkPipeline pipeline,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004173 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004174 deviceObject := GetDevice(device)
4175 pipelineObjects := GetPipeline(pipeline)
4176 assert(pipelineObjects.device == device)
4177
4178 State.Pipelines[pipeline] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004179}
4180
4181
4182// Pipeline layout functions
4183
4184@threadSafety("system")
4185cmd VkResult vkCreatePipelineLayout(
4186 VkDevice device,
4187 const VkPipelineLayoutCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004188 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004189 VkPipelineLayout* pPipelineLayout) {
4190 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO)
4191 deviceObject := GetDevice(device)
4192
4193 pipelineLayout := ?
4194 pPipelineLayout[0] = pipelineLayout
4195 State.PipelineLayouts[pipelineLayout] = new!PipelineLayoutObject(device: device)
4196
4197 return ?
4198}
4199
4200@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004201cmd void vkDestroyPipelineLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004202 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004203 VkPipelineLayout pipelineLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004204 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004205 deviceObject := GetDevice(device)
4206 pipelineLayoutObjects := GetPipelineLayout(pipelineLayout)
4207 assert(pipelineLayoutObjects.device == device)
4208
4209 State.PipelineLayouts[pipelineLayout] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004210}
4211
4212
4213// Sampler functions
4214
4215@threadSafety("system")
4216cmd VkResult vkCreateSampler(
4217 VkDevice device,
4218 const VkSamplerCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004219 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004220 VkSampler* pSampler) {
4221 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO)
4222 deviceObject := GetDevice(device)
4223
4224 sampler := ?
4225 pSampler[0] = sampler
4226 State.Samplers[sampler] = new!SamplerObject(device: device)
4227
4228 return ?
4229}
4230
4231@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004232cmd void vkDestroySampler(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004233 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004234 VkSampler sampler,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004235 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004236 deviceObject := GetDevice(device)
4237 samplerObject := GetSampler(sampler)
4238 assert(samplerObject.device == device)
4239
4240 State.Samplers[sampler] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004241}
4242
4243
4244// Descriptor set functions
4245
4246@threadSafety("system")
4247cmd VkResult vkCreateDescriptorSetLayout(
4248 VkDevice device,
4249 const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004250 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004251 VkDescriptorSetLayout* pSetLayout) {
4252 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO)
4253 deviceObject := GetDevice(device)
4254
4255 setLayout := ?
4256 pSetLayout[0] = setLayout
4257 State.DescriptorSetLayouts[setLayout] = new!DescriptorSetLayoutObject(device: device)
4258
4259 return ?
4260}
4261
4262@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004263cmd void vkDestroyDescriptorSetLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004264 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004265 VkDescriptorSetLayout descriptorSetLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004266 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004267 deviceObject := GetDevice(device)
4268 descriptorSetLayoutObject := GetDescriptorSetLayout(descriptorSetLayout)
4269 assert(descriptorSetLayoutObject.device == device)
4270
4271 State.DescriptorSetLayouts[descriptorSetLayout] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004272}
4273
4274@threadSafety("system")
4275cmd VkResult vkCreateDescriptorPool(
4276 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004277 const VkDescriptorPoolCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004278 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004279 VkDescriptorPool* pDescriptorPool) {
4280 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO)
4281 deviceObject := GetDevice(device)
4282
4283 descriptorPool := ?
4284 pDescriptorPool[0] = descriptorPool
4285 State.DescriptorPools[descriptorPool] = new!DescriptorPoolObject(device: device)
4286
4287 return ?
4288}
4289
4290@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004291cmd void vkDestroyDescriptorPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004292 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004293 VkDescriptorPool descriptorPool,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004294 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004295 deviceObject := GetDevice(device)
4296 descriptorPoolObject := GetDescriptorPool(descriptorPool)
4297 assert(descriptorPoolObject.device == device)
4298
4299 State.DescriptorPools[descriptorPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004300}
4301
4302@threadSafety("app")
4303cmd VkResult vkResetDescriptorPool(
4304 VkDevice device,
Jesse Hallfbf97b02015-11-20 14:17:03 -08004305 VkDescriptorPool descriptorPool,
4306 VkDescriptorPoolResetFlags flags) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004307 deviceObject := GetDevice(device)
4308 descriptorPoolObject := GetDescriptorPool(descriptorPool)
4309 assert(descriptorPoolObject.device == device)
4310
4311 return ?
4312}
4313
4314@threadSafety("app")
Jesse Hall3fbc8562015-11-29 22:10:52 -08004315cmd VkResult vkAllocateDescriptorSets(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004316 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004317 const VkDescriptorSetAllocateInfo* pAllocateInfo,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004318 VkDescriptorSet* pDescriptorSets) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004319 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004320 allocInfo := pAllocateInfo[0]
Jesse Hallfbf97b02015-11-20 14:17:03 -08004321 descriptorPoolObject := GetDescriptorPool(allocInfo.descriptorPool)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004322
Jesse Hall03b6fe12015-11-24 12:44:21 -08004323 setLayouts := allocInfo.pSetLayouts[0:allocInfo.setCount]
4324 for i in (0 .. allocInfo.setCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004325 setLayout := setLayouts[i]
4326 setLayoutObject := GetDescriptorSetLayout(setLayout)
4327 assert(setLayoutObject.device == device)
4328 }
4329
Jesse Hall03b6fe12015-11-24 12:44:21 -08004330 descriptorSets := pDescriptorSets[0:allocInfo.setCount]
4331 for i in (0 .. allocInfo.setCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004332 descriptorSet := ?
4333 descriptorSets[i] = descriptorSet
4334 State.DescriptorSets[descriptorSet] = new!DescriptorSetObject(device: device)
4335 }
4336
4337 return ?
4338}
4339
Jesse Hallf09c6b12015-08-15 19:54:28 -07004340cmd VkResult vkFreeDescriptorSets(
4341 VkDevice device,
4342 VkDescriptorPool descriptorPool,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004343 u32 descriptorSetCount,
Jesse Hallf09c6b12015-08-15 19:54:28 -07004344 const VkDescriptorSet* pDescriptorSets) {
4345 deviceObject := GetDevice(device)
4346 descriptorPoolObject := GetDescriptorPool(descriptorPool)
4347
Jesse Hall03b6fe12015-11-24 12:44:21 -08004348 descriptorSets := pDescriptorSets[0:descriptorSetCount]
4349 for i in (0 .. descriptorSetCount) {
Jesse Hallf09c6b12015-08-15 19:54:28 -07004350 descriptorSet := descriptorSets[i]
4351 descriptorSetObject := GetDescriptorSet(descriptorSet)
4352 assert(descriptorSetObject.device == device)
4353 State.DescriptorSets[descriptorSet] = null
4354 }
4355
4356 return ?
4357}
4358
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004359cmd void vkUpdateDescriptorSets(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004360 VkDevice device,
Jesse Hallb00daad2015-11-29 19:46:20 -08004361 u32 descriptorWriteCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004362 const VkWriteDescriptorSet* pDescriptorWrites,
Jesse Hallb00daad2015-11-29 19:46:20 -08004363 u32 descriptorCopyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004364 const VkCopyDescriptorSet* pDescriptorCopies) {
4365 deviceObject := GetDevice(device)
4366
Jesse Hallb00daad2015-11-29 19:46:20 -08004367 descriptorWrites := pDescriptorWrites[0:descriptorWriteCount]
4368 for i in (0 .. descriptorWriteCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004369 descriptorWrite := descriptorWrites[i]
Jesse Hall3fbc8562015-11-29 22:10:52 -08004370 descriptorWriteObject := GetDescriptorSet(descriptorWrite.dstSet)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004371 assert(descriptorWriteObject.device == device)
4372 }
4373
Jesse Hallb00daad2015-11-29 19:46:20 -08004374 descriptorCopies := pDescriptorCopies[0:descriptorCopyCount]
4375 for i in (0 .. descriptorCopyCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004376 descriptorCopy := descriptorCopies[i]
Jesse Hall3fbc8562015-11-29 22:10:52 -08004377 descriptorCopyObject := GetDescriptorSet(descriptorCopy.dstSet)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004378 assert(descriptorCopyObject.device == device)
4379 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07004380}
4381
4382
4383// Framebuffer functions
4384
4385@threadSafety("system")
4386cmd VkResult vkCreateFramebuffer(
4387 VkDevice device,
4388 const VkFramebufferCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004389 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004390 VkFramebuffer* pFramebuffer) {
4391 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO)
4392 deviceObject := GetDevice(device)
4393
4394 framebuffer := ?
4395 pFramebuffer[0] = framebuffer
4396 State.Framebuffers[framebuffer] = new!FramebufferObject(device: device)
4397
4398 return ?
4399}
4400
4401@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004402cmd void vkDestroyFramebuffer(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004403 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004404 VkFramebuffer framebuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004405 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004406 deviceObject := GetDevice(device)
4407 framebufferObject := GetFramebuffer(framebuffer)
4408 assert(framebufferObject.device == device)
4409
4410 State.Framebuffers[framebuffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004411}
4412
4413
4414// Renderpass functions
4415
4416@threadSafety("system")
4417cmd VkResult vkCreateRenderPass(
4418 VkDevice device,
4419 const VkRenderPassCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004420 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004421 VkRenderPass* pRenderPass) {
4422 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO)
4423 deviceObject := GetDevice(device)
4424
4425 renderpass := ?
4426 pRenderPass[0] = renderpass
4427 State.RenderPasses[renderpass] = new!RenderPassObject(device: device)
4428
4429 return ?
4430}
4431
4432@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004433cmd void vkDestroyRenderPass(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004434 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004435 VkRenderPass renderPass,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004436 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004437 deviceObject := GetDevice(device)
4438 renderPassObject := GetRenderPass(renderPass)
4439 assert(renderPassObject.device == device)
4440
4441 State.RenderPasses[renderPass] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004442}
4443
Jesse Hall606a54e2015-11-19 22:17:28 -08004444cmd void vkGetRenderAreaGranularity(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004445 VkDevice device,
4446 VkRenderPass renderPass,
4447 VkExtent2D* pGranularity) {
4448 deviceObject := GetDevice(device)
4449 renderPassObject := GetRenderPass(renderPass)
4450
4451 granularity := ?
4452 pGranularity[0] = granularity
Jesse Halld27f6aa2015-08-15 17:58:48 -07004453}
4454
4455// Command pool functions
4456
4457cmd VkResult vkCreateCommandPool(
4458 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004459 const VkCommandPoolCreateInfo* pCreateInfo,
4460 const VkAllocationCallbacks* pAllocator,
4461 VkCommandPool* pCommandPool) {
4462 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004463 deviceObject := GetDevice(device)
4464
Jesse Hall3fbc8562015-11-29 22:10:52 -08004465 commandPool := ?
4466 pCommandPool[0] = commandPool
4467 State.CommandPools[commandPool] = new!CommandPoolObject(device: device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004468
4469 return ?
4470}
4471
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004472cmd void vkDestroyCommandPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004473 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004474 VkCommandPool commandPool,
4475 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004476 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004477 commandPoolObject := GetCommandPool(commandPool)
4478 assert(commandPoolObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004479
Jesse Hall3fbc8562015-11-29 22:10:52 -08004480 State.CommandPools[commandPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004481}
4482
4483cmd VkResult vkResetCommandPool(
4484 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004485 VkCommandPool commandPool,
4486 VkCommandPoolResetFlags flags) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004487 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004488 commandPoolObject := GetCommandPool(commandPool)
4489 assert(commandPoolObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004490
4491 return ?
4492}
4493
4494// Command buffer functions
4495
Jesse Hall3fbc8562015-11-29 22:10:52 -08004496macro void bindCommandBuffer(VkCommandBuffer commandBuffer, any obj, VkDeviceMemory memory) {
4497 memoryObject := GetDeviceMemory(memory)
4498 memoryObject.boundCommandBuffers[commandBuffer] = commandBuffer
Jesse Halld27f6aa2015-08-15 17:58:48 -07004499
Jesse Hall3fbc8562015-11-29 22:10:52 -08004500 commandBufferObject := GetCommandBuffer(commandBuffer)
4501 commandBufferObject.boundObjects[as!u64(obj)] = memory
Jesse Halld27f6aa2015-08-15 17:58:48 -07004502}
4503
Jesse Hall3fbc8562015-11-29 22:10:52 -08004504macro void unbindCommandBuffer(VkCommandBuffer commandBuffer, any obj, VkDeviceMemory memory) {
4505 memoryObject := GetDeviceMemory(memory)
4506 memoryObject.boundCommandBuffers[commandBuffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004507
Jesse Hall3fbc8562015-11-29 22:10:52 -08004508 commandBufferObject := GetCommandBuffer(commandBuffer)
4509 commandBufferObject.boundObjects[as!u64(obj)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004510}
4511
4512@threadSafety("system")
Jesse Hall3fbc8562015-11-29 22:10:52 -08004513cmd VkResult vkAllocateCommandBuffers(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004514 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004515 const VkCommandBufferAllocateInfo* pAllocateInfo,
4516 VkCommandBuffer* pCommandBuffers) {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08004517 assert(pAllocateInfo[0].sType == VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004518
Jesse Hall3dd678a2016-01-08 21:52:01 -08004519 count := pAllocateInfo[0].commandBufferCount
Jesse Hall3fbc8562015-11-29 22:10:52 -08004520 commandBuffers := pCommandBuffers[0:count]
Jesse Hallfbf97b02015-11-20 14:17:03 -08004521 for i in (0 .. count) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004522 commandBuffer := ?
4523 commandBuffers[i] = commandBuffer
4524 State.CommandBuffers[commandBuffer] = new!CommandBufferObject(device: device)
Jesse Hallfbf97b02015-11-20 14:17:03 -08004525 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07004526
4527 return ?
4528}
4529
4530@threadSafety("system")
Jesse Hallfbf97b02015-11-20 14:17:03 -08004531cmd void vkFreeCommandBuffers(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004532 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004533 VkCommandPool commandPool,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004534 u32 commandBufferCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004535 const VkCommandBuffer* pCommandBuffers) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004536 deviceObject := GetDevice(device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004537
Jesse Hall3fbc8562015-11-29 22:10:52 -08004538 commandBuffers := pCommandBuffers[0:commandBufferCount]
Jesse Hall03b6fe12015-11-24 12:44:21 -08004539 for i in (0 .. commandBufferCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004540 commandBufferObject := GetCommandBuffer(commandBuffers[i])
4541 assert(commandBufferObject.device == device)
Jesse Hallfbf97b02015-11-20 14:17:03 -08004542 // TODO: iterate over boundObjects and clear memory bindings
Jesse Hall3fbc8562015-11-29 22:10:52 -08004543 State.CommandBuffers[commandBuffers[i]] = null
Jesse Hallfbf97b02015-11-20 14:17:03 -08004544 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07004545}
4546
4547@threadSafety("app")
4548cmd VkResult vkBeginCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004549 VkCommandBuffer commandBuffer,
4550 const VkCommandBufferBeginInfo* pBeginInfo) {
4551 assert(pBeginInfo.sType == VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO)
4552 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004553
4554 // TODO: iterate over boundObjects and clear memory bindings
4555
4556 return ?
4557}
4558
4559@threadSafety("app")
4560cmd VkResult vkEndCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004561 VkCommandBuffer commandBuffer) {
4562 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004563
4564 return ?
4565}
4566
4567@threadSafety("app")
4568cmd VkResult vkResetCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004569 VkCommandBuffer commandBuffer,
4570 VkCommandBufferResetFlags flags) {
4571 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004572
4573 // TODO: iterate over boundObjects and clear memory bindings
4574
4575 return ?
4576}
4577
4578
4579// Command buffer building functions
4580
4581@threadSafety("app")
4582cmd void vkCmdBindPipeline(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004583 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004584 VkPipelineBindPoint pipelineBindPoint,
4585 VkPipeline pipeline) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004586 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004587 pipelineObject := GetPipeline(pipeline)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004588 assert(commandBufferObject.device == pipelineObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004589
Jesse Halld8bade02015-11-24 10:24:18 -08004590 queue := switch (pipelineBindPoint) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004591 case VK_PIPELINE_BIND_POINT_COMPUTE: VK_QUEUE_COMPUTE_BIT
4592 case VK_PIPELINE_BIND_POINT_GRAPHICS: VK_QUEUE_GRAPHICS_BIT
4593 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08004594 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004595}
4596
4597@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004598cmd void vkCmdSetViewport(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004599 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004600 u32 firstViewport,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004601 u32 viewportCount,
4602 const VkViewport* pViewports) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004603 commandBufferObject := GetCommandBuffer(commandBuffer)
4604 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004605}
4606
4607@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004608cmd void vkCmdSetScissor(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004609 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004610 u32 firstScissor,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004611 u32 scissorCount,
4612 const VkRect2D* pScissors) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004613 commandBufferObject := GetCommandBuffer(commandBuffer)
4614 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004615}
4616
4617@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004618cmd void vkCmdSetLineWidth(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004619 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004620 f32 lineWidth) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004621 commandBufferObject := GetCommandBuffer(commandBuffer)
4622 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004623}
4624
4625@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004626cmd void vkCmdSetDepthBias(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004627 VkCommandBuffer commandBuffer,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004628 f32 depthBiasConstantFactor,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004629 f32 depthBiasClamp,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004630 f32 depthBiasSlopeFactor) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004631 commandBufferObject := GetCommandBuffer(commandBuffer)
4632 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004633}
Jesse Halld27f6aa2015-08-15 17:58:48 -07004634
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004635@threadSafety("app")
4636cmd void vkCmdSetBlendConstants(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004637 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004638 // TODO(jessehall): apic only supports 'const' on pointer types. Using
4639 // an annotation as a quick hack to pass this to the template without
4640 // having to modify the AST and semantic model.
Jesse Hallb00daad2015-11-29 19:46:20 -08004641 @readonly f32[4] blendConstants) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004642 commandBufferObject := GetCommandBuffer(commandBuffer)
4643 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004644}
4645
4646@threadSafety("app")
4647cmd void vkCmdSetDepthBounds(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004648 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004649 f32 minDepthBounds,
4650 f32 maxDepthBounds) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004651 commandBufferObject := GetCommandBuffer(commandBuffer)
4652 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004653}
4654
4655@threadSafety("app")
4656cmd void vkCmdSetStencilCompareMask(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004657 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004658 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08004659 u32 compareMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004660 commandBufferObject := GetCommandBuffer(commandBuffer)
4661 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004662}
4663
4664@threadSafety("app")
4665cmd void vkCmdSetStencilWriteMask(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004666 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004667 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08004668 u32 writeMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004669 commandBufferObject := GetCommandBuffer(commandBuffer)
4670 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004671}
4672
4673@threadSafety("app")
4674cmd void vkCmdSetStencilReference(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004675 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004676 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08004677 u32 reference) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004678 commandBufferObject := GetCommandBuffer(commandBuffer)
4679 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004680}
4681
4682@threadSafety("app")
4683cmd void vkCmdBindDescriptorSets(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004684 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004685 VkPipelineBindPoint pipelineBindPoint,
4686 VkPipelineLayout layout,
4687 u32 firstSet,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004688 u32 descriptorSetCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004689 const VkDescriptorSet* pDescriptorSets,
4690 u32 dynamicOffsetCount,
4691 const u32* pDynamicOffsets) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004692 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004693
Jesse Hall03b6fe12015-11-24 12:44:21 -08004694 descriptorSets := pDescriptorSets[0:descriptorSetCount]
4695 for i in (0 .. descriptorSetCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004696 descriptorSet := descriptorSets[i]
4697 descriptorSetObject := GetDescriptorSet(descriptorSet)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004698 assert(commandBufferObject.device == descriptorSetObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004699 }
4700
4701 dynamicOffsets := pDynamicOffsets[0:dynamicOffsetCount]
4702 for i in (0 .. dynamicOffsetCount) {
4703 dynamicOffset := dynamicOffsets[i]
4704 }
4705
Jesse Halld8bade02015-11-24 10:24:18 -08004706 queue := switch (pipelineBindPoint) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004707 case VK_PIPELINE_BIND_POINT_COMPUTE: VK_QUEUE_COMPUTE_BIT
4708 case VK_PIPELINE_BIND_POINT_GRAPHICS: VK_QUEUE_GRAPHICS_BIT
4709 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08004710 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004711}
4712
4713@threadSafety("app")
4714cmd void vkCmdBindIndexBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004715 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004716 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004717 VkDeviceSize offset,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004718 VkIndexType indexType) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004719 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004720 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004721 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004722
Jesse Hall3fbc8562015-11-29 22:10:52 -08004723 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004724
Jesse Hall3fbc8562015-11-29 22:10:52 -08004725 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004726}
4727
4728@threadSafety("app")
4729cmd void vkCmdBindVertexBuffers(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004730 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004731 u32 firstBinding,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004732 u32 bindingCount,
4733 const VkBuffer* pBuffers,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004734 const VkDeviceSize* pOffsets) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004735 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004736
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004737 // TODO: check if not [firstBinding:firstBinding+bindingCount]
Jesse Halld27f6aa2015-08-15 17:58:48 -07004738 buffers := pBuffers[0:bindingCount]
4739 offsets := pOffsets[0:bindingCount]
4740 for i in (0 .. bindingCount) {
4741 buffer := buffers[i]
4742 offset := offsets[i]
4743 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004744 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004745
Jesse Hall3fbc8562015-11-29 22:10:52 -08004746 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004747 }
4748
Jesse Hall3fbc8562015-11-29 22:10:52 -08004749 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004750}
4751
4752@threadSafety("app")
4753cmd void vkCmdDraw(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004754 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004755 u32 vertexCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004756 u32 instanceCount,
4757 u32 firstVertex,
4758 u32 firstInstance) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004759 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004760
Jesse Hall3fbc8562015-11-29 22:10:52 -08004761 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004762}
4763
4764@threadSafety("app")
4765cmd void vkCmdDrawIndexed(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004766 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004767 u32 indexCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004768 u32 instanceCount,
4769 u32 firstIndex,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004770 s32 vertexOffset,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004771 u32 firstInstance) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004772 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004773
Jesse Hall3fbc8562015-11-29 22:10:52 -08004774 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004775}
4776
4777@threadSafety("app")
4778cmd void vkCmdDrawIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004779 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004780 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004781 VkDeviceSize offset,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004782 u32 drawCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004783 u32 stride) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004784 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004785 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004786 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004787
Jesse Hall3fbc8562015-11-29 22:10:52 -08004788 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004789
Jesse Hall3fbc8562015-11-29 22:10:52 -08004790 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004791}
4792
4793@threadSafety("app")
4794cmd void vkCmdDrawIndexedIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004795 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004796 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004797 VkDeviceSize offset,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004798 u32 drawCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004799 u32 stride) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004800 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004801 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004802 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004803
Jesse Hall3fbc8562015-11-29 22:10:52 -08004804 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004805
Jesse Hall3fbc8562015-11-29 22:10:52 -08004806 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004807}
4808
4809@threadSafety("app")
4810cmd void vkCmdDispatch(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004811 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004812 u32 x,
4813 u32 y,
4814 u32 z) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004815 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004816
Jesse Hall3fbc8562015-11-29 22:10:52 -08004817 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_COMPUTE_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004818}
4819
4820@threadSafety("app")
4821cmd void vkCmdDispatchIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004822 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004823 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004824 VkDeviceSize offset) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004825 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004826 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004827 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004828
Jesse Hall3fbc8562015-11-29 22:10:52 -08004829 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004830
Jesse Hall3fbc8562015-11-29 22:10:52 -08004831 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_COMPUTE_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004832}
4833
4834@threadSafety("app")
4835cmd void vkCmdCopyBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004836 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004837 VkBuffer srcBuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004838 VkBuffer dstBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004839 u32 regionCount,
4840 const VkBufferCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004841 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004842 srcBufferObject := GetBuffer(srcBuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004843 dstBufferObject := GetBuffer(dstBuffer)
4844 assert(commandBufferObject.device == srcBufferObject.device)
4845 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004846
4847 regions := pRegions[0:regionCount]
4848 for i in (0 .. regionCount) {
4849 region := regions[i]
4850 }
4851
Jesse Hall3fbc8562015-11-29 22:10:52 -08004852 bindCommandBuffer(commandBuffer, srcBuffer, srcBufferObject.memory)
4853 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004854
Jesse Hall65ab5522015-11-30 00:07:16 -08004855 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004856}
4857
4858@threadSafety("app")
4859cmd void vkCmdCopyImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004860 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004861 VkImage srcImage,
4862 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004863 VkImage dstImage,
4864 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004865 u32 regionCount,
4866 const VkImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004867 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004868 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004869 dstImageObject := GetImage(dstImage)
4870 assert(commandBufferObject.device == srcImageObject.device)
4871 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004872
4873 regions := pRegions[0:regionCount]
4874 for i in (0 .. regionCount) {
4875 region := regions[i]
4876 }
4877
Jesse Hall3fbc8562015-11-29 22:10:52 -08004878 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
4879 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004880
Jesse Hall65ab5522015-11-30 00:07:16 -08004881 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004882}
4883
4884@threadSafety("app")
4885cmd void vkCmdBlitImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004886 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004887 VkImage srcImage,
4888 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004889 VkImage dstImage,
4890 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004891 u32 regionCount,
4892 const VkImageBlit* pRegions,
Jesse Hall23ff73f2015-11-29 14:36:39 -08004893 VkFilter filter) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004894 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004895 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004896 dstImageObject := GetImage(dstImage)
4897 assert(commandBufferObject.device == srcImageObject.device)
4898 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004899
4900 regions := pRegions[0:regionCount]
4901 for i in (0 .. regionCount) {
4902 region := regions[i]
4903 }
4904
Jesse Hall3fbc8562015-11-29 22:10:52 -08004905 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
4906 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004907
Jesse Hall3fbc8562015-11-29 22:10:52 -08004908 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004909}
4910
4911@threadSafety("app")
4912cmd void vkCmdCopyBufferToImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004913 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004914 VkBuffer srcBuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004915 VkImage dstImage,
4916 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004917 u32 regionCount,
4918 const VkBufferImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004919 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004920 srcBufferObject := GetBuffer(srcBuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004921 dstImageObject := GetImage(dstImage)
4922 assert(commandBufferObject.device == srcBufferObject.device)
4923 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004924
4925 regions := pRegions[0:regionCount]
4926 for i in (0 .. regionCount) {
4927 region := regions[i]
4928 }
4929
Jesse Hall3fbc8562015-11-29 22:10:52 -08004930 bindCommandBuffer(commandBuffer, srcBuffer, srcBufferObject.memory)
4931 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004932
Jesse Hall65ab5522015-11-30 00:07:16 -08004933 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004934}
4935
4936@threadSafety("app")
4937cmd void vkCmdCopyImageToBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004938 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004939 VkImage srcImage,
4940 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004941 VkBuffer dstBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004942 u32 regionCount,
4943 const VkBufferImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004944 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004945 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004946 dstBufferObject := GetBuffer(dstBuffer)
4947 assert(commandBufferObject.device == srcImageObject.device)
4948 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004949
4950 regions := pRegions[0:regionCount]
4951 for i in (0 .. regionCount) {
4952 region := regions[i]
4953 }
4954
Jesse Hall3fbc8562015-11-29 22:10:52 -08004955 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
4956 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004957
Jesse Hall65ab5522015-11-30 00:07:16 -08004958 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004959}
4960
4961@threadSafety("app")
4962cmd void vkCmdUpdateBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004963 VkCommandBuffer commandBuffer,
4964 VkBuffer dstBuffer,
4965 VkDeviceSize dstOffset,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004966 VkDeviceSize dataSize,
Jesse Hall3f5499b2016-07-26 15:20:40 -07004967 const void* pData) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004968 commandBufferObject := GetCommandBuffer(commandBuffer)
4969 dstBufferObject := GetBuffer(dstBuffer)
4970 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004971
4972 data := pData[0:dataSize]
4973
Jesse Hall3fbc8562015-11-29 22:10:52 -08004974 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004975
Jesse Hall65ab5522015-11-30 00:07:16 -08004976 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004977}
4978
4979@threadSafety("app")
4980cmd void vkCmdFillBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004981 VkCommandBuffer commandBuffer,
4982 VkBuffer dstBuffer,
4983 VkDeviceSize dstOffset,
Jesse Hallb00daad2015-11-29 19:46:20 -08004984 VkDeviceSize size,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004985 u32 data) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004986 commandBufferObject := GetCommandBuffer(commandBuffer)
4987 dstBufferObject := GetBuffer(dstBuffer)
4988 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004989
Jesse Hall65ab5522015-11-30 00:07:16 -08004990 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004991}
4992
4993@threadSafety("app")
4994cmd void vkCmdClearColorImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004995 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004996 VkImage image,
4997 VkImageLayout imageLayout,
4998 const VkClearColorValue* pColor,
4999 u32 rangeCount,
5000 const VkImageSubresourceRange* pRanges) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005001 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005002 imageObject := GetImage(image)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005003 assert(commandBufferObject.device == imageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005004
5005 ranges := pRanges[0:rangeCount]
5006 for i in (0 .. rangeCount) {
5007 range := ranges[i]
5008 }
5009
Jesse Hall3fbc8562015-11-29 22:10:52 -08005010 bindCommandBuffer(commandBuffer, image, imageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005011
Jesse Hall3fbc8562015-11-29 22:10:52 -08005012 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005013}
5014
5015@threadSafety("app")
5016cmd void vkCmdClearDepthStencilImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005017 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005018 VkImage image,
5019 VkImageLayout imageLayout,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005020 const VkClearDepthStencilValue* pDepthStencil,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005021 u32 rangeCount,
5022 const VkImageSubresourceRange* pRanges) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005023 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005024 imageObject := GetImage(image)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005025 assert(commandBufferObject.device == imageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005026
5027 ranges := pRanges[0:rangeCount]
5028 for i in (0 .. rangeCount) {
5029 range := ranges[i]
5030 }
5031
Jesse Hall3fbc8562015-11-29 22:10:52 -08005032 bindCommandBuffer(commandBuffer, image, imageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005033
Jesse Hall3fbc8562015-11-29 22:10:52 -08005034 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005035}
5036
5037@threadSafety("app")
Jesse Hallae38f732015-11-19 21:32:50 -08005038cmd void vkCmdClearAttachments(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005039 VkCommandBuffer commandBuffer,
Jesse Hallae38f732015-11-19 21:32:50 -08005040 u32 attachmentCount,
5041 const VkClearAttachment* pAttachments,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005042 u32 rectCount,
Jesse Halla15a4bf2015-11-19 22:48:02 -08005043 const VkClearRect* pRects) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005044 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005045
5046 rects := pRects[0:rectCount]
5047 for i in (0 .. rectCount) {
5048 rect := rects[i]
5049 }
5050
Jesse Hall3fbc8562015-11-29 22:10:52 -08005051 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005052}
5053
5054@threadSafety("app")
5055cmd void vkCmdResolveImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005056 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005057 VkImage srcImage,
5058 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005059 VkImage dstImage,
5060 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005061 u32 regionCount,
5062 const VkImageResolve* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005063 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005064 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005065 dstImageObject := GetImage(dstImage)
5066 assert(commandBufferObject.device == srcImageObject.device)
5067 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005068
5069 regions := pRegions[0:regionCount]
5070 for i in (0 .. regionCount) {
5071 region := regions[i]
5072 }
5073
Jesse Hall3fbc8562015-11-29 22:10:52 -08005074 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
5075 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005076
Jesse Hall3fbc8562015-11-29 22:10:52 -08005077 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005078}
5079
5080@threadSafety("app")
5081cmd void vkCmdSetEvent(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005082 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005083 VkEvent event,
5084 VkPipelineStageFlags stageMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005085 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005086 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005087 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005088}
5089
5090@threadSafety("app")
5091cmd void vkCmdResetEvent(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005092 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005093 VkEvent event,
5094 VkPipelineStageFlags stageMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005095 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005096 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005097 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005098}
5099
5100@threadSafety("app")
5101cmd void vkCmdWaitEvents(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005102 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005103 u32 eventCount,
5104 const VkEvent* pEvents,
5105 VkPipelineStageFlags srcStageMask,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005106 VkPipelineStageFlags dstStageMask,
5107 u32 memoryBarrierCount,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005108 const VkMemoryBarrier* pMemoryBarriers,
5109 u32 bufferMemoryBarrierCount,
5110 const VkBufferMemoryBarrier* pBufferMemoryBarriers,
5111 u32 imageMemoryBarrierCount,
5112 const VkImageMemoryBarrier* pImageMemoryBarriers) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005113 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005114
5115 events := pEvents[0:eventCount]
5116 for i in (0 .. eventCount) {
5117 event := events[i]
5118 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005119 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005120 }
5121
Jesse Hall3dd678a2016-01-08 21:52:01 -08005122 memoryBarriers := pMemoryBarriers[0:memoryBarrierCount]
Jesse Hall3fbc8562015-11-29 22:10:52 -08005123 for i in (0 .. memoryBarrierCount) {
Jesse Hall3dd678a2016-01-08 21:52:01 -08005124 memoryBarrier := memoryBarriers[i]
5125 }
5126 bufferMemoryBarriers := pBufferMemoryBarriers[0:bufferMemoryBarrierCount]
5127 for i in (0 .. bufferMemoryBarrierCount) {
5128 bufferMemoryBarrier := bufferMemoryBarriers[i]
5129 bufferObject := GetBuffer(bufferMemoryBarrier.buffer)
5130 assert(bufferObject.device == commandBufferObject.device)
5131 }
5132 imageMemoryBarriers := pImageMemoryBarriers[0:imageMemoryBarrierCount]
5133 for i in (0 .. imageMemoryBarrierCount) {
5134 imageMemoryBarrier := imageMemoryBarriers[i]
5135 imageObject := GetImage(imageMemoryBarrier.image)
5136 assert(imageObject.device == commandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005137 }
5138}
5139
5140@threadSafety("app")
5141cmd void vkCmdPipelineBarrier(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005142 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005143 VkPipelineStageFlags srcStageMask,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005144 VkPipelineStageFlags dstStageMask,
Jesse Halldc6d36c2015-11-29 19:12:15 -08005145 VkDependencyFlags dependencyFlags,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005146 u32 memoryBarrierCount,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005147 const VkMemoryBarrier* pMemoryBarriers,
5148 u32 bufferMemoryBarrierCount,
5149 const VkBufferMemoryBarrier* pBufferMemoryBarriers,
5150 u32 imageMemoryBarrierCount,
5151 const VkImageMemoryBarrier* pImageMemoryBarriers) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005152 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005153
Jesse Hall3dd678a2016-01-08 21:52:01 -08005154 memoryBarriers := pMemoryBarriers[0:memoryBarrierCount]
Jesse Hall3fbc8562015-11-29 22:10:52 -08005155 for i in (0 .. memoryBarrierCount) {
Jesse Hall3dd678a2016-01-08 21:52:01 -08005156 memoryBarrier := memoryBarriers[i]
5157 }
5158 bufferMemoryBarriers := pBufferMemoryBarriers[0:bufferMemoryBarrierCount]
5159 for i in (0 .. bufferMemoryBarrierCount) {
5160 bufferMemoryBarrier := bufferMemoryBarriers[i]
5161 bufferObject := GetBuffer(bufferMemoryBarrier.buffer)
5162 assert(bufferObject.device == commandBufferObject.device)
5163 }
5164 imageMemoryBarriers := pImageMemoryBarriers[0:imageMemoryBarrierCount]
5165 for i in (0 .. imageMemoryBarrierCount) {
5166 imageMemoryBarrier := imageMemoryBarriers[i]
5167 imageObject := GetImage(imageMemoryBarrier.image)
5168 assert(imageObject.device == commandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005169 }
5170}
5171
5172@threadSafety("app")
5173cmd void vkCmdBeginQuery(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005174 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005175 VkQueryPool queryPool,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005176 u32 query,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005177 VkQueryControlFlags flags) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005178 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005179 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005180 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005181}
5182
5183@threadSafety("app")
5184cmd void vkCmdEndQuery(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005185 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005186 VkQueryPool queryPool,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005187 u32 query) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005188 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005189 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005190 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005191}
5192
5193@threadSafety("app")
5194cmd void vkCmdResetQueryPool(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005195 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005196 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005197 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005198 u32 queryCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005199 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005200 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005201 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005202}
5203
5204@threadSafety("app")
5205cmd void vkCmdWriteTimestamp(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005206 VkCommandBuffer commandBuffer,
Jesse Hall6f39a6d2015-11-24 11:08:36 -08005207 VkPipelineStageFlagBits pipelineStage,
Jesse Halla3a7a1d2015-11-24 11:37:23 -08005208 VkQueryPool queryPool,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005209 u32 query) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005210 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halla3a7a1d2015-11-24 11:37:23 -08005211 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005212 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005213}
5214
5215@threadSafety("app")
5216cmd void vkCmdCopyQueryPoolResults(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005217 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005218 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005219 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005220 u32 queryCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005221 VkBuffer dstBuffer,
5222 VkDeviceSize dstOffset,
Jesse Halla9bb62b2015-11-21 19:31:56 -08005223 VkDeviceSize stride,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005224 VkQueryResultFlags flags) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005225 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005226 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005227 dstBufferObject := GetBuffer(dstBuffer)
5228 assert(commandBufferObject.device == queryPoolObject.device)
5229 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005230}
5231
5232cmd void vkCmdPushConstants(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005233 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005234 VkPipelineLayout layout,
5235 VkShaderStageFlags stageFlags,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005236 u32 offset,
5237 u32 size,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08005238 const void* pValues) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005239 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005240 layoutObject := GetPipelineLayout(layout)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005241 assert(commandBufferObject.device == layoutObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005242}
5243
5244@threadSafety("app")
5245cmd void vkCmdBeginRenderPass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005246 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005247 const VkRenderPassBeginInfo* pRenderPassBegin,
Jesse Hall65ab5522015-11-30 00:07:16 -08005248 VkSubpassContents contents) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005249 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005250 renderPassObject := GetRenderPass(pRenderPassBegin.renderPass)
5251 framebufferObject := GetFramebuffer(pRenderPassBegin.framebuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005252 assert(commandBufferObject.device == renderPassObject.device)
5253 assert(commandBufferObject.device == framebufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005254
Jesse Hall3fbc8562015-11-29 22:10:52 -08005255 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005256}
5257
5258cmd void vkCmdNextSubpass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005259 VkCommandBuffer commandBuffer,
Jesse Hall65ab5522015-11-30 00:07:16 -08005260 VkSubpassContents contents) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005261 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005262}
5263
5264@threadSafety("app")
5265cmd void vkCmdEndRenderPass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005266 VkCommandBuffer commandBuffer) {
5267 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005268
Jesse Hall3fbc8562015-11-29 22:10:52 -08005269 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005270}
5271
5272cmd void vkCmdExecuteCommands(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005273 VkCommandBuffer commandBuffer,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005274 u32 commandBufferCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005275 const VkCommandBuffer* pCommandBuffers) {
5276 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005277
Jesse Hall3dd678a2016-01-08 21:52:01 -08005278 commandBuffers := pCommandBuffers[0:commandBufferCount]
5279 for i in (0 .. commandBufferCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005280 secondaryCommandBuffer := commandBuffers[i]
5281 secondaryCommandBufferObject := GetCommandBuffer(secondaryCommandBuffer)
5282 assert(commandBufferObject.device == secondaryCommandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005283 }
5284}
5285
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005286@extension("VK_KHR_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005287cmd void vkDestroySurfaceKHR(
5288 VkInstance instance,
Jesse Hall0e74f002015-11-30 11:37:59 -08005289 VkSurfaceKHR surface,
5290 const VkAllocationCallbacks* pAllocator) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005291 instanceObject := GetInstance(instance)
5292 surfaceObject := GetSurface(surface)
5293 assert(surfaceObject.instance == instance)
Michael Lentine88594d72015-11-12 12:49:45 -08005294
Jesse Hall1356b0d2015-11-23 17:24:58 -08005295 State.Surfaces[surface] = null
Jesse Hall2818f932015-11-19 21:19:17 -08005296}
5297
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005298@extension("VK_KHR_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005299cmd VkResult vkGetPhysicalDeviceSurfaceSupportKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005300 VkPhysicalDevice physicalDevice,
5301 u32 queueFamilyIndex,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005302 VkSurfaceKHR surface,
Jesse Hallb00daad2015-11-29 19:46:20 -08005303 VkBool32* pSupported) {
5304 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08005305
5306 return ?
5307}
5308
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005309@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08005310cmd VkResult vkGetPhysicalDeviceSurfaceCapabilitiesKHR(
5311 VkPhysicalDevice physicalDevice,
5312 VkSurfaceKHR surface,
5313 VkSurfaceCapabilitiesKHR* pSurfaceCapabilities) {
5314 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5315
5316 surfaceCapabilities := ?
5317 pSurfaceCapabilities[0] = surfaceCapabilities
5318
5319 return ?
5320}
5321
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005322@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08005323cmd VkResult vkGetPhysicalDeviceSurfaceFormatsKHR(
5324 VkPhysicalDevice physicalDevice,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005325 VkSurfaceKHR surface,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005326 u32* pSurfaceFormatCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005327 VkSurfaceFormatKHR* pSurfaceFormats) {
Jesse Hallb00daad2015-11-29 19:46:20 -08005328 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08005329
5330 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08005331 pSurfaceFormatCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08005332 surfaceFormats := pSurfaceFormats[0:count]
5333
5334 for i in (0 .. count) {
5335 surfaceFormat := ?
5336 surfaceFormats[i] = surfaceFormat
5337 }
5338
5339 return ?
5340}
5341
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005342@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08005343cmd VkResult vkGetPhysicalDeviceSurfacePresentModesKHR(
5344 VkPhysicalDevice physicalDevice,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005345 VkSurfaceKHR surface,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005346 u32* pPresentModeCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005347 VkPresentModeKHR* pPresentModes) {
Jesse Hallb00daad2015-11-29 19:46:20 -08005348 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08005349
5350 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08005351 pPresentModeCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08005352 presentModes := pPresentModes[0:count]
5353
5354 for i in (0 .. count) {
5355 presentMode := ?
5356 presentModes[i] = presentMode
5357 }
5358
5359 return ?
5360}
5361
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005362@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005363cmd VkResult vkCreateSwapchainKHR(
5364 VkDevice device,
5365 const VkSwapchainCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005366 const VkAllocationCallbacks* pAllocator,
Michael Lentine88594d72015-11-12 12:49:45 -08005367 VkSwapchainKHR* pSwapchain) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005368 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR)
Michael Lentine88594d72015-11-12 12:49:45 -08005369 deviceObject := GetDevice(device)
5370
5371 swapchain := ?
5372 pSwapchain[0] = swapchain
5373 State.Swapchains[swapchain] = new!SwapchainObject(device: device)
5374
5375 return ?
5376}
5377
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005378@extension("VK_KHR_swapchain")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005379cmd void vkDestroySwapchainKHR(
Michael Lentine88594d72015-11-12 12:49:45 -08005380 VkDevice device,
Jesse Hall0e74f002015-11-30 11:37:59 -08005381 VkSwapchainKHR swapchain,
5382 const VkAllocationCallbacks* pAllocator) {
Michael Lentine88594d72015-11-12 12:49:45 -08005383 deviceObject := GetDevice(device)
5384 swapchainObject := GetSwapchain(swapchain)
5385 assert(swapchainObject.device == device)
5386
5387 State.Swapchains[swapchain] = null
Michael Lentine88594d72015-11-12 12:49:45 -08005388}
5389
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005390@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005391cmd VkResult vkGetSwapchainImagesKHR(
5392 VkDevice device,
5393 VkSwapchainKHR swapchain,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005394 u32* pSwapchainImageCount,
Michael Lentine88594d72015-11-12 12:49:45 -08005395 VkImage* pSwapchainImages) {
5396 deviceObject := GetDevice(device)
5397
5398 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08005399 pSwapchainImageCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08005400 swapchainImages := pSwapchainImages[0:count]
5401
5402 for i in (0 .. count) {
5403 swapchainImage := ?
5404 swapchainImages[i] = swapchainImage
Jesse Hall1356b0d2015-11-23 17:24:58 -08005405 State.Images[swapchainImage] = new!ImageObject(device: device)
Michael Lentine88594d72015-11-12 12:49:45 -08005406 }
5407
5408 return ?
5409}
5410
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005411@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005412cmd VkResult vkAcquireNextImageKHR(
5413 VkDevice device,
5414 VkSwapchainKHR swapchain,
5415 u64 timeout,
5416 VkSemaphore semaphore,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005417 VkFence fence,
Michael Lentine88594d72015-11-12 12:49:45 -08005418 u32* pImageIndex) {
5419 deviceObject := GetDevice(device)
5420 swapchainObject := GetSwapchain(swapchain)
5421
5422 imageIndex := ?
5423 pImageIndex[0] = imageIndex
5424
5425 return ?
5426}
5427
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005428@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005429cmd VkResult vkQueuePresentKHR(
5430 VkQueue queue,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08005431 const VkPresentInfoKHR* pPresentInfo) {
Michael Lentine88594d72015-11-12 12:49:45 -08005432 queueObject := GetQueue(queue)
5433
5434 presentInfo := ?
5435 pPresentInfo[0] = presentInfo
5436
5437 return ?
5438}
5439
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005440@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005441cmd VkResult vkGetPhysicalDeviceDisplayPropertiesKHR(
5442 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005443 u32* pPropertyCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005444 VkDisplayPropertiesKHR* pProperties) {
5445 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5446 return ?
5447}
5448
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005449@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005450cmd VkResult vkGetPhysicalDeviceDisplayPlanePropertiesKHR(
5451 VkPhysicalDevice physicalDevice,
5452 u32* pPropertyCount,
5453 VkDisplayPlanePropertiesKHR* pProperties) {
5454 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5455 return ?
5456}
5457
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005458@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005459cmd VkResult vkGetDisplayPlaneSupportedDisplaysKHR(
5460 VkPhysicalDevice physicalDevice,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005461 u32 planeIndex,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08005462 u32* pDisplayCount,
5463 VkDisplayKHR* pDisplays) {
Jesse Halla6429252015-11-29 18:59:42 -08005464 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5465 return ?
5466}
5467
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005468@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005469cmd VkResult vkGetDisplayModePropertiesKHR(
5470 VkPhysicalDevice physicalDevice,
5471 VkDisplayKHR display,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005472 u32* pPropertyCount,
5473 VkDisplayModePropertiesKHR* pProperties) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005474 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5475 return ?
5476}
5477
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005478@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005479cmd VkResult vkCreateDisplayModeKHR(
5480 VkPhysicalDevice physicalDevice,
5481 VkDisplayKHR display,
5482 const VkDisplayModeCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005483 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005484 VkDisplayModeKHR* pMode) {
5485 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5486 return ?
5487}
5488
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005489@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005490cmd VkResult vkGetDisplayPlaneCapabilitiesKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005491 VkPhysicalDevice physicalDevice,
Jesse Hall9ba8bc82015-11-30 16:22:16 -08005492 VkDisplayModeKHR mode,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005493 u32 planeIndex,
Jesse Halla6429252015-11-29 18:59:42 -08005494 VkDisplayPlaneCapabilitiesKHR* pCapabilities) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005495 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5496 return ?
5497}
5498
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005499@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005500cmd VkResult vkCreateDisplayPlaneSurfaceKHR(
5501 VkInstance instance,
5502 const VkDisplaySurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005503 const VkAllocationCallbacks* pAllocator,
Jesse Halla6429252015-11-29 18:59:42 -08005504 VkSurfaceKHR* pSurface) {
5505 return ?
5506}
5507
Jesse Hall9ba8bc82015-11-30 16:22:16 -08005508@extension("VK_KHR_display_swapchain")
5509cmd VkResult vkCreateSharedSwapchainsKHR(
5510 VkDevice device,
5511 u32 swapchainCount,
5512 const VkSwapchainCreateInfoKHR* pCreateInfos,
5513 const VkAllocationCallbacks* pAllocator,
5514 VkSwapchainKHR* pSwapchains) {
5515 return ?
5516}
5517
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005518@extension("VK_KHR_xlib_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005519cmd VkResult vkCreateXlibSurfaceKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005520 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005521 const VkXlibSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005522 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005523 VkSurfaceKHR* pSurface) {
5524 instanceObject := GetInstance(instance)
5525 return ?
5526}
5527
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005528@extension("VK_KHR_xlib_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005529cmd VkBool32 vkGetPhysicalDeviceXlibPresentationSupportKHR(
5530 VkPhysicalDevice physicalDevice,
5531 u32 queueFamilyIndex,
5532 platform.Display* dpy,
Jesse Hall65ab5522015-11-30 00:07:16 -08005533 platform.VisualID visualID) {
Jesse Halla6429252015-11-29 18:59:42 -08005534 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5535 return ?
5536}
5537
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005538@extension("VK_KHR_xcb_surface")
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005539cmd VkResult vkCreateXcbSurfaceKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005540 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005541 const VkXcbSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005542 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005543 VkSurfaceKHR* pSurface) {
5544 instanceObject := GetInstance(instance)
5545 return ?
5546}
5547
Jesse Hall523db342015-11-30 21:12:55 -08005548@extension("VK_KHR_xcb_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005549cmd VkBool32 vkGetPhysicalDeviceXcbPresentationSupportKHR(
5550 VkPhysicalDevice physicalDevice,
5551 u32 queueFamilyIndex,
5552 platform.xcb_connection_t* connection,
5553 platform.xcb_visualid_t visual_id) {
5554 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5555 return ?
5556}
5557
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005558@extension("VK_KHR_wayland_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005559cmd VkResult vkCreateWaylandSurfaceKHR(
5560 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005561 const VkWaylandSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005562 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005563 VkSurfaceKHR* pSurface) {
5564 instanceObject := GetInstance(instance)
5565 return ?
5566}
5567
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005568@extension("VK_KHR_wayland_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005569cmd VkBool32 vkGetPhysicalDeviceWaylandPresentationSupportKHR(
5570 VkPhysicalDevice physicalDevice,
5571 u32 queueFamilyIndex,
5572 platform.wl_display* display) {
5573 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5574 return ?
5575}
5576
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005577@extension("VK_KHR_mir_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005578cmd VkResult vkCreateMirSurfaceKHR(
5579 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005580 const VkMirSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005581 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005582 VkSurfaceKHR* pSurface) {
5583 instanceObject := GetInstance(instance)
5584 return ?
5585}
5586
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005587@extension("VK_KHR_mir_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005588cmd VkBool32 vkGetPhysicalDeviceMirPresentationSupportKHR(
5589 VkPhysicalDevice physicalDevice,
5590 u32 queueFamilyIndex,
5591 platform.MirConnection* connection) {
5592 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5593 return ?
5594}
5595
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005596@extension("VK_KHR_android_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005597cmd VkResult vkCreateAndroidSurfaceKHR(
5598 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005599 const VkAndroidSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005600 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005601 VkSurfaceKHR* pSurface) {
5602 instanceObject := GetInstance(instance)
5603 return ?
5604}
5605
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005606@extension("VK_KHR_win32_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005607cmd VkResult vkCreateWin32SurfaceKHR(
5608 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005609 const VkWin32SurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005610 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005611 VkSurfaceKHR* pSurface) {
5612 instanceObject := GetInstance(instance)
5613 return ?
5614}
5615
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005616@extension("VK_KHR_win32_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005617cmd VkResult vkGetPhysicalDeviceWin32PresentationSupportKHR(
5618 VkPhysicalDevice physicalDevice,
5619 u32 queueFamilyIndex) {
Jesse Halle2948d82016-02-25 04:19:32 -08005620 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Jesse Halla6429252015-11-29 18:59:42 -08005621 return ?
5622}
5623
Chia-I Wub262ddc2016-03-22 07:38:20 +08005624@extension("VK_ANDROID_native_buffer")
5625cmd VkResult vkGetSwapchainGrallocUsageANDROID(
5626 VkDevice device,
5627 VkFormat format,
5628 VkImageUsageFlags imageUsage,
5629 int* grallocUsage) {
5630 return ?
5631}
5632
5633@extension("VK_ANDROID_native_buffer")
5634cmd VkResult vkAcquireImageANDROID(
5635 VkDevice device,
5636 VkImage image,
5637 int nativeFenceFd,
5638 VkSemaphore semaphore,
5639 VkFence fence) {
5640 return ?
5641}
5642
5643@extension("VK_ANDROID_native_buffer")
5644cmd VkResult vkQueueSignalReleaseImageANDROID(
5645 VkQueue queue,
5646 u32 waitSemaphoreCount,
5647 const VkSemaphore* pWaitSemaphores,
5648 VkImage image,
5649 int* pNativeFenceFd) {
5650 return ?
5651}
5652
Jesse Hall715b86a2016-01-16 16:34:29 -08005653@extension("VK_EXT_debug_report")
5654@external type void* PFN_vkDebugReportCallbackEXT
5655@extension("VK_EXT_debug_report")
5656@pfn cmd VkBool32 vkDebugReportCallbackEXT(
5657 VkDebugReportFlagsEXT flags,
5658 VkDebugReportObjectTypeEXT objectType,
5659 u64 object,
5660 platform.size_t location,
5661 s32 messageCode,
5662 const char* pLayerPrefix,
5663 const char* pMessage,
5664 void* pUserData) {
5665 return ?
5666}
5667
5668@extension("VK_EXT_debug_report")
5669cmd VkResult vkCreateDebugReportCallbackEXT(
5670 VkInstance instance,
5671 const VkDebugReportCallbackCreateInfoEXT* pCreateInfo,
5672 const VkAllocationCallbacks* pAllocator,
5673 VkDebugReportCallbackEXT* pCallback) {
5674 return ?
5675}
5676
5677@extension("VK_EXT_debug_report")
5678cmd void vkDestroyDebugReportCallbackEXT(
5679 VkInstance instance,
5680 VkDebugReportCallbackEXT callback,
5681 const VkAllocationCallbacks* pAllocator) {
5682}
5683
5684@extension("VK_EXT_debug_report")
5685cmd void vkDebugReportMessageEXT(
5686 VkInstance instance,
5687 VkDebugReportFlagsEXT flags,
5688 VkDebugReportObjectTypeEXT objectType,
5689 u64 object,
5690 platform.size_t location,
5691 s32 messageCode,
5692 const char* pLayerPrefix,
5693 const char* pMessage) {
5694}
5695
Jesse Hall26763382016-05-20 07:13:52 -07005696@extension("VK_EXT_debug_marker")
5697cmd VkResult vkDebugMarkerSetObjectTagEXT(
5698 VkDevice device,
5699 VkDebugMarkerObjectTagInfoEXT* pTagInfo) {
5700 return ?
5701}
5702
5703@extension("VK_EXT_debug_marker")
5704cmd VkResult vkDebugMarkerSetObjectNameEXT(
5705 VkDevice device,
5706 VkDebugMarkerObjectNameInfoEXT* pNameInfo) {
5707 return ?
5708}
5709
5710@extension("VK_EXT_debug_marker")
5711cmd void vkCmdDebugMarkerBeginEXT(
5712 VkCommandBuffer commandBuffer,
5713 VkDebugMarkerMarkerInfoEXT* pMarkerInfo) {
5714}
5715
5716@extension("VK_EXT_debug_marker")
5717cmd void vkCmdDebugMarkerEndEXT(
5718 VkCommandBuffer commandBuffer) {
5719}
5720
5721@extension("VK_EXT_debug_marker")
5722cmd void vkCmdDebugMarkerInsertEXT(
5723 VkCommandBuffer commandBuffer,
5724 VkDebugMarkerMarkerInfoEXT* pMarkerInfo) {
5725}
5726
Jesse Halleb02c472017-02-24 15:13:45 -08005727@extension("VK_AMD_draw_indirect_count")
5728cmd void vkCmdDrawIndirectCountAMD(
5729 VkCommandBuffer commandBuffer,
5730 VkBuffer buffer,
5731 VkDeviceSize offset,
5732 VkBuffer countBuffer,
5733 VkDeviceSize countBufferOffset,
5734 u32 maxDrawCount,
5735 u32 stride) {
5736}
5737
5738@extension("VK_AMD_draw_indirect_count")
5739cmd void vkCmdDrawIndexedIndirectCountAMD(
5740 VkCommandBuffer commandBuffer,
5741 VkBuffer buffer,
5742 VkDeviceSize offset,
5743 VkBuffer countBuffer,
5744 VkDeviceSize countBufferOffset,
5745 u32 maxDrawCount,
5746 u32 stride) {
5747}
5748
5749@extension("VK_NV_external_memory_capabilities")
5750cmd VkResult vkGetPhysicalDeviceExternalImageFormatPropertiesNV(
5751 VkPhysicalDevice physicalDevice,
5752 VkFormat format,
5753 VkImageType type,
5754 VkImageTiling tiling,
5755 VkImageUsageFlags usage,
5756 VkImageCreateFlags flags,
5757 VkExternalMemoryHandleTypeFlagsNV externalHandleType,
5758 VkExternalImageFormatPropertiesNV* pExternalImageFormatProperties) {
5759 return ?
5760}
5761
5762@extension("VK_NV_external_memory_win32")
5763cmd VkResult vkGetMemoryWin32HandleNV(
5764 VkDevice device,
5765 VkDeviceMemory memory,
5766 VkExternalMemoryHandleTypeFlagsNV handleType,
5767 platform.HANDLE* pHandle) {
5768 return ?
5769}
5770
5771@extension("VK_NVX_device_generated_commands")
5772cmd void vkCmdProcessCommandsNVX(
5773 VkCommandBuffer commandBuffer,
5774 const VkCmdProcessCommandsInfoNVX* pProcessCommandsInfo) {
5775}
5776
5777@extension("VK_NVX_device_generated_commands")
5778cmd void vkCmdReserveSpaceForCommandsNVX(
5779 VkCommandBuffer commandBuffer,
5780 const VkCmdReserveSpaceForCommandsInfoNVX* pReserveSpaceInfo) {
5781}
5782
5783@extension("VK_NVX_device_generated_commands")
5784cmd VkResult vkCreateIndirectCommandsLayoutNVX(
5785 VkDevice device,
5786 const VkIndirectCommandsLayoutCreateInfoNVX* pCreateInfo,
5787 const VkAllocationCallbacks* pAllocator,
5788 VkIndirectCommandsLayoutNVX* pIndirectCommandsLayout) {
5789 return ?
5790}
5791
5792@extension("VK_NVX_device_generated_commands")
5793cmd void vkDestroyIndirectCommandsLayoutNVX(
5794 VkDevice device,
5795 VkIndirectCommandsLayoutNVX indirectCommandsLayout,
5796 const VkAllocationCallbacks* pAllocator) {
5797}
5798
5799@extension("VK_NVX_device_generated_commands")
5800cmd VkResult vkCreateObjectTableNVX(
5801 VkDevice device,
5802 const VkObjectTableCreateInfoNVX* pCreateInfo,
5803 const VkAllocationCallbacks* pAllocator,
5804 VkObjectTableNVX* pObjectTable) {
5805 return ?
5806}
5807
5808@extension("VK_NVX_device_generated_commands")
5809cmd void vkDestroyObjectTableNVX(
5810 VkDevice device,
5811 VkObjectTableNVX objectTable,
5812 const VkAllocationCallbacks* pAllocator) {
5813}
5814
5815@extension("VK_NVX_device_generated_commands")
5816cmd VkResult vkRegisterObjectsNVX(
5817 VkDevice device,
5818 VkObjectTableNVX objectTable,
5819 u32 objectCount,
5820 const VkObjectTableEntryNVX* const* ppObjectTableEntries,
5821 const u32* pObjectIndices) {
5822 return ?
5823}
5824
5825@extension("VK_NVX_device_generated_commands")
5826cmd VkResult vkUnregisterObjectsNVX(
5827 VkDevice device,
5828 VkObjectTableNVX objectTable,
5829 u32 objectCount,
5830 const VkObjectEntryTypeNVX* pObjectEntryTypes,
5831 const u32* pObjectIndices) {
5832 return ?
5833}
5834
5835@extension("VK_NVX_device_generated_commands")
5836cmd void vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX(
5837 VkPhysicalDevice physicalDevice,
5838 VkDeviceGeneratedCommandsFeaturesNVX* pFeatures,
5839 VkDeviceGeneratedCommandsLimitsNVX* pLimits) {
5840}
Jesse Halld27f6aa2015-08-15 17:58:48 -07005841
5842////////////////
5843// Validation //
5844////////////////
5845
5846extern void validate(string layerName, bool condition, string message)
5847
5848
5849/////////////////////////////
5850// Internal State Tracking //
5851/////////////////////////////
5852
5853StateObject State
5854
5855@internal class StateObject {
5856 // Dispatchable objects.
5857 map!(VkInstance, ref!InstanceObject) Instances
5858 map!(VkPhysicalDevice, ref!PhysicalDeviceObject) PhysicalDevices
5859 map!(VkDevice, ref!DeviceObject) Devices
5860 map!(VkQueue, ref!QueueObject) Queues
Jesse Hall3fbc8562015-11-29 22:10:52 -08005861 map!(VkCommandBuffer, ref!CommandBufferObject) CommandBuffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07005862
5863 // Non-dispatchable objects.
5864 map!(VkDeviceMemory, ref!DeviceMemoryObject) DeviceMemories
5865 map!(VkBuffer, ref!BufferObject) Buffers
5866 map!(VkBufferView, ref!BufferViewObject) BufferViews
5867 map!(VkImage, ref!ImageObject) Images
5868 map!(VkImageView, ref!ImageViewObject) ImageViews
Jesse Halld27f6aa2015-08-15 17:58:48 -07005869 map!(VkShaderModule, ref!ShaderModuleObject) ShaderModules
Jesse Halld27f6aa2015-08-15 17:58:48 -07005870 map!(VkPipeline, ref!PipelineObject) Pipelines
5871 map!(VkPipelineLayout, ref!PipelineLayoutObject) PipelineLayouts
5872 map!(VkSampler, ref!SamplerObject) Samplers
5873 map!(VkDescriptorSet, ref!DescriptorSetObject) DescriptorSets
5874 map!(VkDescriptorSetLayout, ref!DescriptorSetLayoutObject) DescriptorSetLayouts
5875 map!(VkDescriptorPool, ref!DescriptorPoolObject) DescriptorPools
Jesse Halld27f6aa2015-08-15 17:58:48 -07005876 map!(VkFence, ref!FenceObject) Fences
5877 map!(VkSemaphore, ref!SemaphoreObject) Semaphores
5878 map!(VkEvent, ref!EventObject) Events
5879 map!(VkQueryPool, ref!QueryPoolObject) QueryPools
5880 map!(VkFramebuffer, ref!FramebufferObject) Framebuffers
5881 map!(VkRenderPass, ref!RenderPassObject) RenderPasses
5882 map!(VkPipelineCache, ref!PipelineCacheObject) PipelineCaches
Jesse Hall3fbc8562015-11-29 22:10:52 -08005883 map!(VkCommandPool, ref!CommandPoolObject) CommandPools
Jesse Hall1356b0d2015-11-23 17:24:58 -08005884 map!(VkSurfaceKHR, ref!SurfaceObject) Surfaces
Michael Lentine88594d72015-11-12 12:49:45 -08005885 map!(VkSwapchainKHR, ref!SwapchainObject) Swapchains
Jesse Halld27f6aa2015-08-15 17:58:48 -07005886}
5887
5888@internal class InstanceObject {
5889}
5890
5891@internal class PhysicalDeviceObject {
5892 VkInstance instance
5893}
5894
5895@internal class DeviceObject {
5896 VkPhysicalDevice physicalDevice
5897}
5898
5899@internal class QueueObject {
5900 VkDevice device
5901 VkQueueFlags flags
5902}
5903
Jesse Hall3fbc8562015-11-29 22:10:52 -08005904@internal class CommandBufferObject {
Jesse Halld27f6aa2015-08-15 17:58:48 -07005905 VkDevice device
5906 map!(u64, VkDeviceMemory) boundObjects
5907 VkQueueFlags queueFlags
5908}
5909
5910@internal class DeviceMemoryObject {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005911 VkDevice device
5912 VkDeviceSize allocationSize
5913 map!(u64, VkDeviceSize) boundObjects
5914 map!(VkCommandBuffer, VkCommandBuffer) boundCommandBuffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07005915}
5916
5917@internal class BufferObject {
5918 VkDevice device
Jesse Hall3fbc8562015-11-29 22:10:52 -08005919 VkDeviceMemory memory
5920 VkDeviceSize memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07005921}
5922
5923@internal class BufferViewObject {
5924 VkDevice device
5925 VkBuffer buffer
5926}
5927
5928@internal class ImageObject {
5929 VkDevice device
Jesse Hall3fbc8562015-11-29 22:10:52 -08005930 VkDeviceMemory memory
5931 VkDeviceSize memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07005932}
5933
5934@internal class ImageViewObject {
5935 VkDevice device
5936 VkImage image
5937}
5938
Jesse Halld27f6aa2015-08-15 17:58:48 -07005939@internal class ShaderObject {
5940 VkDevice device
5941}
5942
5943@internal class ShaderModuleObject {
5944 VkDevice device
5945}
5946
5947@internal class PipelineObject {
5948 VkDevice device
5949}
5950
5951@internal class PipelineLayoutObject {
5952 VkDevice device
5953}
5954
5955@internal class SamplerObject {
5956 VkDevice device
5957}
5958
5959@internal class DescriptorSetObject {
5960 VkDevice device
5961}
5962
5963@internal class DescriptorSetLayoutObject {
5964 VkDevice device
5965}
5966
5967@internal class DescriptorPoolObject {
5968 VkDevice device
5969}
5970
Jesse Halld27f6aa2015-08-15 17:58:48 -07005971@internal class FenceObject {
5972 VkDevice device
5973 bool signaled
5974}
5975
5976@internal class SemaphoreObject {
5977 VkDevice device
5978}
5979
5980@internal class EventObject {
5981 VkDevice device
5982}
5983
5984@internal class QueryPoolObject {
5985 VkDevice device
5986}
5987
5988@internal class FramebufferObject {
5989 VkDevice device
5990}
5991
5992@internal class RenderPassObject {
5993 VkDevice device
5994}
5995
5996@internal class PipelineCacheObject {
5997 VkDevice device
5998}
5999
Jesse Hall3fbc8562015-11-29 22:10:52 -08006000@internal class CommandPoolObject {
Jesse Halld27f6aa2015-08-15 17:58:48 -07006001 VkDevice device
6002}
6003
Jesse Hall1356b0d2015-11-23 17:24:58 -08006004@internal class SurfaceObject {
6005 VkInstance instance
6006}
6007
Michael Lentine88594d72015-11-12 12:49:45 -08006008@internal class SwapchainObject {
6009 VkDevice device
6010}
6011
Jesse Halld27f6aa2015-08-15 17:58:48 -07006012macro ref!InstanceObject GetInstance(VkInstance instance) {
6013 assert(instance in State.Instances)
6014 return State.Instances[instance]
6015}
6016
6017macro ref!PhysicalDeviceObject GetPhysicalDevice(VkPhysicalDevice physicalDevice) {
6018 assert(physicalDevice in State.PhysicalDevices)
6019 return State.PhysicalDevices[physicalDevice]
6020}
6021
6022macro ref!DeviceObject GetDevice(VkDevice device) {
6023 assert(device in State.Devices)
6024 return State.Devices[device]
6025}
6026
6027macro ref!QueueObject GetQueue(VkQueue queue) {
6028 assert(queue in State.Queues)
6029 return State.Queues[queue]
6030}
6031
Jesse Hall3fbc8562015-11-29 22:10:52 -08006032macro ref!CommandBufferObject GetCommandBuffer(VkCommandBuffer commandBuffer) {
6033 assert(commandBuffer in State.CommandBuffers)
6034 return State.CommandBuffers[commandBuffer]
Jesse Halld27f6aa2015-08-15 17:58:48 -07006035}
6036
Jesse Hall3fbc8562015-11-29 22:10:52 -08006037macro ref!DeviceMemoryObject GetDeviceMemory(VkDeviceMemory memory) {
6038 assert(memory in State.DeviceMemories)
6039 return State.DeviceMemories[memory]
Jesse Halld27f6aa2015-08-15 17:58:48 -07006040}
6041
6042macro ref!BufferObject GetBuffer(VkBuffer buffer) {
6043 assert(buffer in State.Buffers)
6044 return State.Buffers[buffer]
6045}
6046
6047macro ref!BufferViewObject GetBufferView(VkBufferView bufferView) {
6048 assert(bufferView in State.BufferViews)
6049 return State.BufferViews[bufferView]
6050}
6051
6052macro ref!ImageObject GetImage(VkImage image) {
6053 assert(image in State.Images)
6054 return State.Images[image]
6055}
6056
6057macro ref!ImageViewObject GetImageView(VkImageView imageView) {
6058 assert(imageView in State.ImageViews)
6059 return State.ImageViews[imageView]
6060}
6061
Jesse Halld27f6aa2015-08-15 17:58:48 -07006062macro ref!ShaderModuleObject GetShaderModule(VkShaderModule shaderModule) {
6063 assert(shaderModule in State.ShaderModules)
6064 return State.ShaderModules[shaderModule]
6065}
6066
6067macro ref!PipelineObject GetPipeline(VkPipeline pipeline) {
6068 assert(pipeline in State.Pipelines)
6069 return State.Pipelines[pipeline]
6070}
6071
6072macro ref!PipelineLayoutObject GetPipelineLayout(VkPipelineLayout pipelineLayout) {
6073 assert(pipelineLayout in State.PipelineLayouts)
6074 return State.PipelineLayouts[pipelineLayout]
6075}
6076
6077macro ref!SamplerObject GetSampler(VkSampler sampler) {
6078 assert(sampler in State.Samplers)
6079 return State.Samplers[sampler]
6080}
6081
6082macro ref!DescriptorSetObject GetDescriptorSet(VkDescriptorSet descriptorSet) {
6083 assert(descriptorSet in State.DescriptorSets)
6084 return State.DescriptorSets[descriptorSet]
6085}
6086
6087macro ref!DescriptorSetLayoutObject GetDescriptorSetLayout(VkDescriptorSetLayout descriptorSetLayout) {
6088 assert(descriptorSetLayout in State.DescriptorSetLayouts)
6089 return State.DescriptorSetLayouts[descriptorSetLayout]
6090}
6091
6092macro ref!DescriptorPoolObject GetDescriptorPool(VkDescriptorPool descriptorPool) {
6093 assert(descriptorPool in State.DescriptorPools)
6094 return State.DescriptorPools[descriptorPool]
6095}
6096
Jesse Halld27f6aa2015-08-15 17:58:48 -07006097macro ref!FenceObject GetFence(VkFence fence) {
6098 assert(fence in State.Fences)
6099 return State.Fences[fence]
6100}
6101
6102macro ref!SemaphoreObject GetSemaphore(VkSemaphore semaphore) {
6103 assert(semaphore in State.Semaphores)
6104 return State.Semaphores[semaphore]
6105}
6106
6107macro ref!EventObject GetEvent(VkEvent event) {
6108 assert(event in State.Events)
6109 return State.Events[event]
6110}
6111
6112macro ref!QueryPoolObject GetQueryPool(VkQueryPool queryPool) {
6113 assert(queryPool in State.QueryPools)
6114 return State.QueryPools[queryPool]
6115}
6116
6117macro ref!FramebufferObject GetFramebuffer(VkFramebuffer framebuffer) {
6118 assert(framebuffer in State.Framebuffers)
6119 return State.Framebuffers[framebuffer]
6120}
6121
6122macro ref!RenderPassObject GetRenderPass(VkRenderPass renderPass) {
6123 assert(renderPass in State.RenderPasses)
6124 return State.RenderPasses[renderPass]
6125}
6126
6127macro ref!PipelineCacheObject GetPipelineCache(VkPipelineCache pipelineCache) {
6128 assert(pipelineCache in State.PipelineCaches)
6129 return State.PipelineCaches[pipelineCache]
6130}
6131
Jesse Hall3fbc8562015-11-29 22:10:52 -08006132macro ref!CommandPoolObject GetCommandPool(VkCommandPool commandPool) {
6133 assert(commandPool in State.CommandPools)
6134 return State.CommandPools[commandPool]
Jesse Hallf09c6b12015-08-15 19:54:28 -07006135}
Michael Lentine88594d72015-11-12 12:49:45 -08006136
Jesse Hall1356b0d2015-11-23 17:24:58 -08006137macro ref!SurfaceObject GetSurface(VkSurfaceKHR surface) {
6138 assert(surface in State.Surfaces)
6139 return State.Surfaces[surface]
6140}
6141
Michael Lentine88594d72015-11-12 12:49:45 -08006142macro ref!SwapchainObject GetSwapchain(VkSwapchainKHR swapchain) {
6143 assert(swapchain in State.Swapchains)
6144 return State.Swapchains[swapchain]
6145}
Jesse Halld8bade02015-11-24 10:24:18 -08006146
6147macro VkQueueFlags AddQueueFlag(VkQueueFlags flags, VkQueueFlagBits bit) {
6148 return as!VkQueueFlags(as!u32(flags) | as!u32(bit))
6149}