blob: 3b79d5aee4e0ce540fc289f363a0e506a904c269 [file] [log] [blame]
Jesse Halld27f6aa2015-08-15 17:58:48 -07001// Copyright (c) 2015 The Khronos Group Inc.
2//
3// Permission is hereby granted, free of charge, to any person obtaining a
4// copy of this software and/or associated documentation files (the
5// "Materials"), to deal in the Materials without restriction, including
6// without limitation the rights to use, copy, modify, merge, publish,
7// distribute, sublicense, and/or sell copies of the Materials, and to
8// permit persons to whom the Materials are furnished to do so, subject to
9// the following conditions:
10//
11// The above copyright notice and this permission notice shall be included
12// in all copies or substantial portions of the Materials.
13//
14// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20// MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
21
22import platform "platform.api"
23
24///////////////
25// Constants //
26///////////////
27
28// API version (major.minor.patch)
Jesse Hall3dd678a2016-01-08 21:52:01 -080029define VERSION_MAJOR 1
30define VERSION_MINOR 0
Chris Forbes289cb792016-12-30 15:03:55 +130031define VERSION_PATCH 38
Jesse Halld27f6aa2015-08-15 17:58:48 -070032
33// API limits
Jesse Hall65ab5522015-11-30 00:07:16 -080034define VK_MAX_PHYSICAL_DEVICE_NAME_SIZE 256
35define VK_UUID_SIZE 16
36define VK_MAX_EXTENSION_NAME_SIZE 256
37define VK_MAX_DESCRIPTION_SIZE 256
38define VK_MAX_MEMORY_TYPES 32
39define VK_MAX_MEMORY_HEAPS 16 /// The maximum number of unique memory heaps, each of which supporting 1 or more memory types.
Jesse Halld27f6aa2015-08-15 17:58:48 -070040
41// API keywords
42define VK_TRUE 1
43define VK_FALSE 0
Jesse Hall5ae3abb2015-10-08 14:00:22 -070044
45// API keyword, but needs special handling by some templates
46define NULL_HANDLE 0
Jesse Halld27f6aa2015-08-15 17:58:48 -070047
Jesse Hall33faaad2016-01-24 21:00:49 -080048@extension("VK_KHR_surface") define VK_KHR_SURFACE_SPEC_VERSION 25
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080049@extension("VK_KHR_surface") define VK_KHR_SURFACE_EXTENSION_NAME "VK_KHR_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080050
Jesse Hall26763382016-05-20 07:13:52 -070051@extension("VK_KHR_swapchain") define VK_KHR_SWAPCHAIN_SPEC_VERSION 68
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080052@extension("VK_KHR_swapchain") define VK_KHR_SWAPCHAIN_EXTENSION_NAME "VK_KHR_swapchain"
Jesse Hall1356b0d2015-11-23 17:24:58 -080053
Jesse Hall543a7ff2016-01-08 16:38:30 -080054@extension("VK_KHR_display") define VK_KHR_DISPLAY_SPEC_VERSION 21
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080055@extension("VK_KHR_display") define VK_KHR_DISPLAY_EXTENSION_NAME "VK_KHR_display"
Jesse Hall1356b0d2015-11-23 17:24:58 -080056
Jesse Hall543a7ff2016-01-08 16:38:30 -080057@extension("VK_KHR_display_swapchain") define VK_KHR_DISPLAY_SWAPCHAIN_SPEC_VERSION 9
Jesse Hall0e74f002015-11-30 11:37:59 -080058@extension("VK_KHR_display_swapchain") define VK_KHR_DISPLAY_SWAPCHAIN_EXTENSION_NAME "VK_KHR_display_swapchain"
Jesse Hall1356b0d2015-11-23 17:24:58 -080059
Jesse Hall543a7ff2016-01-08 16:38:30 -080060@extension("VK_KHR_xlib_surface") define VK_KHR_XLIB_SURFACE_SPEC_VERSION 6
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080061@extension("VK_KHR_xlib_surface") define VK_KHR_XLIB_SURFACE_NAME "VK_KHR_xlib_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080062
Jesse Hall543a7ff2016-01-08 16:38:30 -080063@extension("VK_KHR_xcb_surface") define VK_KHR_XCB_SURFACE_SPEC_VERSION 6
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080064@extension("VK_KHR_xcb_surface") define VK_KHR_XCB_SURFACE_NAME "VK_KHR_xcb_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080065
Jesse Hall543a7ff2016-01-08 16:38:30 -080066@extension("VK_KHR_wayland_surface") define VK_KHR_WAYLAND_SURFACE_SPEC_VERSION 5
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080067@extension("VK_KHR_wayland_surface") define VK_KHR_WAYLAND_SURFACE_NAME "VK_KHR_wayland_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080068
Jesse Hall543a7ff2016-01-08 16:38:30 -080069@extension("VK_KHR_mir_surface") define VK_KHR_MIR_SURFACE_SPEC_VERSION 4
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080070@extension("VK_KHR_mir_surface") define VK_KHR_MIR_SURFACE_NAME "VK_KHR_mir_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080071
Jesse Hall33faaad2016-01-24 21:00:49 -080072@extension("VK_KHR_android_surface") define VK_KHR_ANDROID_SURFACE_SPEC_VERSION 6
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080073@extension("VK_KHR_android_surface") define VK_KHR_ANDROID_SURFACE_NAME "VK_KHR_android_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080074
Jesse Hall543a7ff2016-01-08 16:38:30 -080075@extension("VK_KHR_win32_surface") define VK_KHR_WIN32_SURFACE_SPEC_VERSION 5
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080076@extension("VK_KHR_win32_surface") define VK_KHR_WIN32_SURFACE_NAME "VK_KHR_win32_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080077
Ian Elliott948233a2017-01-06 12:13:23 -070078@extension("VK_KHR_incremental_present") define VK_KHR_INCREMENTAL_PRESENT_SPEC_VERSION 1
79@extension("VK_KHR_incremental_present") define VK_KHR_INCREMENTAL_PRESENT_NAME "VK_KHR_incremental_present"
80
Chris Forbes8e4438b2016-12-07 16:26:49 +130081@extension("VK_ANDROID_native_buffer") define VK_ANDROID_NATIVE_BUFFER_SPEC_VERSION 6
Chia-I Wub262ddc2016-03-22 07:38:20 +080082@extension("VK_ANDROID_native_buffer") define VK_ANDROID_NATIVE_BUFFER_NAME "VK_ANDROID_native_buffer"
83
Ian Elliott4c8bb2a2016-12-29 11:07:26 -070084@extension("VK_GOOGLE_display_timing") define VK_GOOGLE_DISPLAY_TIMING_SPEC_VERSION 1
85@extension("VK_GOOGLE_display_timing") define VK_GOOGLE_DISPLAY_TIMING_NAME "VK_GOOGLE_display_timing"
86
Chris Forbes289cb792016-12-30 15:03:55 +130087@extension("VK_EXT_debug_report") define VK_EXT_DEBUG_REPORT_SPEC_VERSION 4
Jesse Hall715b86a2016-01-16 16:34:29 -080088@extension("VK_EXT_debug_report") define VK_EXT_DEBUG_REPORT_NAME "VK_EXT_debug_report"
89
Jesse Hall26763382016-05-20 07:13:52 -070090@extension("VK_NV_glsl_shader") define VK_NV_GLSL_SHADER_SPEC_VERSION 1
91@extension("VK_NV_glsl_shader") define VK_NV_GLSL_SHADER_NAME "VK_NV_glsl_shader"
92
93@extension("VK_KHR_sampler_mirror_clamp_to_edge") define VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_SPEC_VERSION 1
94@extension("VK_KHR_sampler_mirror_clamp_to_edge") define VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_NAME "VK_KHR_sampler_mirror_clamp_to_edge"
95
96@extension("VK_IMG_filter_cubic") define VK_IMG_FILTER_CUBIC_SPEC_VERSION 1
97@extension("VK_IMG_filter_cubic") define VK_IMG_FILTER_CUBIC_NAME "VK_IMG_filter_cubic"
98
99@extension("VK_AMD_rasterization_order") define VK_AMD_RASTERIZATION_ORDER_SPEC_VERSION 1
100@extension("VK_AMD_rasterization_order") define VK_AMD_RASTERIZATION_ORDER_NAME "VK_AMD_rasterization_order"
101
Jesse Hall56d386a2016-07-26 15:20:40 -0700102@extension("VK_AMD_shader_trinary_minmax") define VK_AMD_SHADER_TRINARY_MINMAX_SPEC_VERSION 1
103@extension("VK_AMD_shader_trinary_minmax") define VK_AMD_SHADER_TRINARY_MINMAX_EXTENSION_NAME "VK_AMD_shader_trinary_minmax"
104
105@extension("VK_AMD_shader_explicit_vertex_parameter") define VK_AMD_SHADER_EXPLICIT_VERTEX_PARAMETER_SPEC_VERSION 1
106@extension("VK_AMD_shader_explicit_vertex_parameter") define VK_AMD_SHADER_EXPLICIT_VERTEX_PARAMETER_EXTENSION_NAME "VK_AMD_shader_explicit_vertex_parameter"
107
Jesse Hall26763382016-05-20 07:13:52 -0700108@extension("VK_EXT_debug_marker") define VK_EXT_DEBUG_MARKER_SPEC_VERSION 3
109@extension("VK_EXT_debug_marker") define VK_EXT_DEBUG_MARKER_NAME "VK_EXT_debug_marker"
110
Jesse Hall56d386a2016-07-26 15:20:40 -0700111@extension("VK_AMD_gcn_shader") define VK_AMD_GCN_SHADER_SPEC_VERSION 1
112@extension("VK_AMD_gcn_shader") define VK_AMD_GCN_SHADER_EXTENSION_NAME "VK_AMD_gcn_shader"
113
114@extension("VK_NV_dedicated_allocation") define VK_NV_DEDICATED_ALLOCATION_SPEC_VERSION 1
115@extension("VK_NV_dedicated_allocation") define VK_NV_DEDICATED_ALLOCATION_EXTENSION_NAME "VK_NV_dedicated_allocation"
116
Chris Forbes1194ede2016-12-30 16:29:25 +1300117@extension("VK_KHR_get_physical_device_properties2") define VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_SPEC_VERSION 1
118@extension("VK_KHR_get_physical_device_properties2") define VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME "VK_KHR_get_physical_device_properties2"
119
Chris Forbes289cb792016-12-30 15:03:55 +1300120@extension("VK_AMD_draw_indirect_count") define VK_AMD_DRAW_INDIRECT_COUNT_SPEC_VERSION 1
121@extension("VK_AMD_draw_indirect_count") define VK_AMD_DRAW_INDIRECT_COUNT_EXTENSION_NAME "VK_AMD_draw_indirect_count"
122
123@extension("VK_AMD_negative_viewport_height") define VK_AMD_NEGATIVE_VIEWPORT_HEIGHT_SPEC_VERSION 1
124@extension("VK_AMD_negative_viewport_height") define VK_AMD_NEGATIVE_VIEWPORT_HEIGHT_EXTENSION_NAME "VK_AMD_negative_viewport_height"
125
126@extension("VK_AMD_gpu_shader_half_float") define VK_AMD_GPU_SHADER_HALF_FLOAT_SPEC_VERSION 1
127@extension("VK_AMD_gpu_shader_half_float") define VK_AMD_GPU_SHADER_HALF_FLOAT_EXTENSION_NAME "VK_AMD_gpu_shader_half_float"
128
129@extension("VK_AMD_shader_ballot") define VK_AMD_SHADER_BALLOT_SPEC_VERSION 1
130@extension("VK_AMD_shader_ballot") define VK_AMD_SHADER_BALLOT_EXTENSION_NAME "VK_AMD_shader_ballot"
131
132@extension("VK_IMG_format_pvrtc") define VK_IMG_FORMAT_PVRTC_SPEC_VERSION 1
133@extension("VK_IMG_format_pvrtc") define VK_IMG_FORMAT_PVRTC_EXTENSION_NAME "VK_IMG_format_pvrtc"
134
135@extension("VK_NV_external_memory_capabilities") define VK_NV_EXTERNAL_MEMORY_CAPABILITIES_SPEC_VERSION 1
136@extension("VK_NV_external_memory_capabilities") define VK_NV_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME "VK_NV_external_memory_capabilities"
137
138@extension("VK_NV_external_memory") define VK_NV_EXTERNAL_MEMORY_SPEC_VERSION 1
139@extension("VK_NV_external_memory") define VK_NV_EXTERNAL_MEMORY_EXTENSION_NAME "VK_NV_external_memory"
140
141@extension("VK_NV_external_memory_win32") define VK_NV_EXTERNAL_MEMORY_WIN32_SPEC_VERSION 1
142@extension("VK_NV_external_memory_win32") define VK_NV_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME "VK_NV_external_memory_win32"
143
144@extension("VK_NV_win32_keyed_mutex") define VK_NV_WIN32_KEYED_MUTEX_SPEC_VERSION 1
145@extension("VK_NV_win32_keyed_mutex") define VK_NV_WIN32_KEYED_MUTEX_EXTENSION_NAME "VK_NV_win32_keyed_mutex"
146
147@extension("VK_EXT_validation_flags") define VK_EXT_VALIDATION_FLAGS_SPEC_VERSION 1
148@extension("VK_EXT_validation_flags") define VK_EXT_VALIDATION_FLAGS_EXTENSION_NAME "VK_EXT_validation_flags"
149
150@extension("VK_NVX_device_generated_commands") define VK_NVX_DEVICE_GENERATED_COMMANDS_SPEC_VERSION 1
151@extension("VK_NVX_device_generated_commands") define VK_NVX_DEVICE_GENERATED_COMMANDS_EXTENSION_NAME "VK_NVX_device_generated_commands"
152
Chris Forbes1d5f68c2017-01-31 10:17:01 +1300153@extension("VK_KHR_shared_presentable_image") define VK_KHR_SHARED_PRESENTABLE_IMAGE_SPEC_VERSION 1
154@extension("VK_KHR_shared_presentable_image") define VK_KHR_SHARED_PRESENTABLE_IMAGE_EXTENSION_NAME "VK_KHR_shared_presentable_image"
Chris Forbes2e12cb82017-01-18 11:45:17 +1300155
Chris Forbes289cb792016-12-30 15:03:55 +1300156
Jesse Halld27f6aa2015-08-15 17:58:48 -0700157
158/////////////
159// Types //
160/////////////
161
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700162type u32 VkBool32
163type u32 VkFlags
164type u64 VkDeviceSize
165type u32 VkSampleMask
166
Jesse Halld27f6aa2015-08-15 17:58:48 -0700167/// Dispatchable handle types.
168@dispatchHandle type u64 VkInstance
169@dispatchHandle type u64 VkPhysicalDevice
170@dispatchHandle type u64 VkDevice
171@dispatchHandle type u64 VkQueue
Jesse Hall3fbc8562015-11-29 22:10:52 -0800172@dispatchHandle type u64 VkCommandBuffer
Jesse Halld27f6aa2015-08-15 17:58:48 -0700173
174/// Non dispatchable handle types.
175@nonDispatchHandle type u64 VkDeviceMemory
Jesse Hall3fbc8562015-11-29 22:10:52 -0800176@nonDispatchHandle type u64 VkCommandPool
Jesse Halld27f6aa2015-08-15 17:58:48 -0700177@nonDispatchHandle type u64 VkBuffer
178@nonDispatchHandle type u64 VkBufferView
179@nonDispatchHandle type u64 VkImage
180@nonDispatchHandle type u64 VkImageView
Jesse Halld27f6aa2015-08-15 17:58:48 -0700181@nonDispatchHandle type u64 VkShaderModule
Jesse Halld27f6aa2015-08-15 17:58:48 -0700182@nonDispatchHandle type u64 VkPipeline
183@nonDispatchHandle type u64 VkPipelineLayout
184@nonDispatchHandle type u64 VkSampler
185@nonDispatchHandle type u64 VkDescriptorSet
186@nonDispatchHandle type u64 VkDescriptorSetLayout
187@nonDispatchHandle type u64 VkDescriptorPool
Jesse Halld27f6aa2015-08-15 17:58:48 -0700188@nonDispatchHandle type u64 VkFence
189@nonDispatchHandle type u64 VkSemaphore
190@nonDispatchHandle type u64 VkEvent
191@nonDispatchHandle type u64 VkQueryPool
192@nonDispatchHandle type u64 VkFramebuffer
193@nonDispatchHandle type u64 VkRenderPass
194@nonDispatchHandle type u64 VkPipelineCache
Jesse Hall1356b0d2015-11-23 17:24:58 -0800195
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800196@extension("VK_KHR_surface") @nonDispatchHandle type u64 VkSurfaceKHR
Jesse Hall1356b0d2015-11-23 17:24:58 -0800197
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800198@extension("VK_KHR_swapchain") @nonDispatchHandle type u64 VkSwapchainKHR
Jesse Hall1356b0d2015-11-23 17:24:58 -0800199
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800200@extension("VK_KHR_display") @nonDispatchHandle type u64 VkDisplayKHR
201@extension("VK_KHR_display") @nonDispatchHandle type u64 VkDisplayModeKHR
Jesse Halld27f6aa2015-08-15 17:58:48 -0700202
Jesse Hall715b86a2016-01-16 16:34:29 -0800203@extension("VK_EXT_debug_report") @nonDispatchHandle type u64 VkDebugReportCallbackEXT
204
Chris Forbes289cb792016-12-30 15:03:55 +1300205@extension("VK_NVX_device_generated_commands") @nonDispatchHandle type u64 VkObjectTableNVX
206@extension("VK_NVX_device_generated_commands") @nonDispatchHandle type u64 VkIndirectCommandsLayoutNVX
207
Jesse Halld27f6aa2015-08-15 17:58:48 -0700208
209/////////////
210// Enums //
211/////////////
212
213enum VkImageLayout {
214 VK_IMAGE_LAYOUT_UNDEFINED = 0x00000000, /// Implicit layout an image is when its contents are undefined due to various reasons (e.g. right after creation)
215 VK_IMAGE_LAYOUT_GENERAL = 0x00000001, /// General layout when image can be used for any kind of access
216 VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL = 0x00000002, /// Optimal layout when image is only used for color attachment read/write
217 VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL = 0x00000003, /// Optimal layout when image is only used for depth/stencil attachment read/write
218 VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL = 0x00000004, /// Optimal layout when image is used for read only depth/stencil attachment and shader access
219 VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL = 0x00000005, /// Optimal layout when image is used for read only shader access
Jesse Hall3fbc8562015-11-29 22:10:52 -0800220 VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL = 0x00000006, /// Optimal layout when image is used only as source of transfer operations
221 VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL = 0x00000007, /// Optimal layout when image is used only as destination of transfer operations
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700222 VK_IMAGE_LAYOUT_PREINITIALIZED = 0x00000008, /// Initial layout used when the data is populated by the CPU
Jesse Hall1356b0d2015-11-23 17:24:58 -0800223
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800224 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800225 VK_IMAGE_LAYOUT_PRESENT_SRC_KHR = 1000001002,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700226}
227
228enum VkAttachmentLoadOp {
229 VK_ATTACHMENT_LOAD_OP_LOAD = 0x00000000,
230 VK_ATTACHMENT_LOAD_OP_CLEAR = 0x00000001,
231 VK_ATTACHMENT_LOAD_OP_DONT_CARE = 0x00000002,
232}
233
234enum VkAttachmentStoreOp {
235 VK_ATTACHMENT_STORE_OP_STORE = 0x00000000,
236 VK_ATTACHMENT_STORE_OP_DONT_CARE = 0x00000001,
237}
238
239enum VkImageType {
240 VK_IMAGE_TYPE_1D = 0x00000000,
241 VK_IMAGE_TYPE_2D = 0x00000001,
242 VK_IMAGE_TYPE_3D = 0x00000002,
243}
244
245enum VkImageTiling {
Jesse Hallc7467b72015-11-29 21:05:26 -0800246 VK_IMAGE_TILING_OPTIMAL = 0x00000000,
247 VK_IMAGE_TILING_LINEAR = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700248}
249
250enum VkImageViewType {
251 VK_IMAGE_VIEW_TYPE_1D = 0x00000000,
252 VK_IMAGE_VIEW_TYPE_2D = 0x00000001,
253 VK_IMAGE_VIEW_TYPE_3D = 0x00000002,
254 VK_IMAGE_VIEW_TYPE_CUBE = 0x00000003,
255 VK_IMAGE_VIEW_TYPE_1D_ARRAY = 0x00000004,
256 VK_IMAGE_VIEW_TYPE_2D_ARRAY = 0x00000005,
257 VK_IMAGE_VIEW_TYPE_CUBE_ARRAY = 0x00000006,
258}
259
Jesse Hall3fbc8562015-11-29 22:10:52 -0800260enum VkCommandBufferLevel {
261 VK_COMMAND_BUFFER_LEVEL_PRIMARY = 0x00000000,
262 VK_COMMAND_BUFFER_LEVEL_SECONDARY = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700263}
264
Jesse Hall65ab5522015-11-30 00:07:16 -0800265enum VkComponentSwizzle {
266 VK_COMPONENT_SWIZZLE_IDENTITY = 0x00000000,
267 VK_COMPONENT_SWIZZLE_ZERO = 0x00000001,
268 VK_COMPONENT_SWIZZLE_ONE = 0x00000002,
269 VK_COMPONENT_SWIZZLE_R = 0x00000003,
270 VK_COMPONENT_SWIZZLE_G = 0x00000004,
271 VK_COMPONENT_SWIZZLE_B = 0x00000005,
272 VK_COMPONENT_SWIZZLE_A = 0x00000006,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700273}
274
275enum VkDescriptorType {
276 VK_DESCRIPTOR_TYPE_SAMPLER = 0x00000000,
277 VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER = 0x00000001,
278 VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE = 0x00000002,
279 VK_DESCRIPTOR_TYPE_STORAGE_IMAGE = 0x00000003,
280 VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER = 0x00000004,
281 VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER = 0x00000005,
282 VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER = 0x00000006,
283 VK_DESCRIPTOR_TYPE_STORAGE_BUFFER = 0x00000007,
284 VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC = 0x00000008,
285 VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC = 0x00000009,
286 VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT = 0x0000000a,
287}
288
Jesse Halld27f6aa2015-08-15 17:58:48 -0700289enum VkQueryType {
290 VK_QUERY_TYPE_OCCLUSION = 0x00000000,
291 VK_QUERY_TYPE_PIPELINE_STATISTICS = 0x00000001, /// Optional
Jesse Halla3a7a1d2015-11-24 11:37:23 -0800292 VK_QUERY_TYPE_TIMESTAMP = 0x00000002,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700293}
294
Jesse Halld27f6aa2015-08-15 17:58:48 -0700295enum VkBorderColor {
296 VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK = 0x00000000,
297 VK_BORDER_COLOR_INT_TRANSPARENT_BLACK = 0x00000001,
298 VK_BORDER_COLOR_FLOAT_OPAQUE_BLACK = 0x00000002,
299 VK_BORDER_COLOR_INT_OPAQUE_BLACK = 0x00000003,
300 VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE = 0x00000004,
301 VK_BORDER_COLOR_INT_OPAQUE_WHITE = 0x00000005,
302}
303
304enum VkPipelineBindPoint {
Jesse Hallc7467b72015-11-29 21:05:26 -0800305 VK_PIPELINE_BIND_POINT_GRAPHICS = 0x00000000,
306 VK_PIPELINE_BIND_POINT_COMPUTE = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700307}
308
309enum VkPrimitiveTopology {
310 VK_PRIMITIVE_TOPOLOGY_POINT_LIST = 0x00000000,
311 VK_PRIMITIVE_TOPOLOGY_LINE_LIST = 0x00000001,
312 VK_PRIMITIVE_TOPOLOGY_LINE_STRIP = 0x00000002,
313 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST = 0x00000003,
314 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP = 0x00000004,
315 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN = 0x00000005,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800316 VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY = 0x00000006,
317 VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY = 0x00000007,
318 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY = 0x00000008,
319 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY = 0x00000009,
Jesse Hall091ed9e2015-11-30 00:55:29 -0800320 VK_PRIMITIVE_TOPOLOGY_PATCH_LIST = 0x0000000a,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700321}
322
323enum VkSharingMode {
324 VK_SHARING_MODE_EXCLUSIVE = 0x00000000,
325 VK_SHARING_MODE_CONCURRENT = 0x00000001,
326}
327
328enum VkIndexType {
329 VK_INDEX_TYPE_UINT16 = 0x00000000,
330 VK_INDEX_TYPE_UINT32 = 0x00000001,
331}
332
Jesse Hall23ff73f2015-11-29 14:36:39 -0800333enum VkFilter {
334 VK_FILTER_NEAREST = 0x00000000,
335 VK_FILTER_LINEAR = 0x00000001,
Jesse Hall26763382016-05-20 07:13:52 -0700336
337 //@extension("VK_IMG_filter_cubic")
338 VK_FILTER_CUBIC_IMG = 1000015000,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700339}
340
Jesse Hall23ff73f2015-11-29 14:36:39 -0800341enum VkSamplerMipmapMode {
Jesse Hall23ff73f2015-11-29 14:36:39 -0800342 VK_SAMPLER_MIPMAP_MODE_NEAREST = 0x00000001, /// Choose nearest mip level
343 VK_SAMPLER_MIPMAP_MODE_LINEAR = 0x00000002, /// Linear filter between mip levels
Jesse Halld27f6aa2015-08-15 17:58:48 -0700344}
345
Jesse Hall23ff73f2015-11-29 14:36:39 -0800346enum VkSamplerAddressMode {
Jesse Hallc7467b72015-11-29 21:05:26 -0800347 VK_SAMPLER_ADDRESS_MODE_REPEAT = 0x00000000,
348 VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT = 0x00000001,
349 VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE = 0x00000002,
350 VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER = 0x00000003,
351 VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700352}
353
354enum VkCompareOp {
355 VK_COMPARE_OP_NEVER = 0x00000000,
356 VK_COMPARE_OP_LESS = 0x00000001,
357 VK_COMPARE_OP_EQUAL = 0x00000002,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800358 VK_COMPARE_OP_LESS_OR_EQUAL = 0x00000003,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700359 VK_COMPARE_OP_GREATER = 0x00000004,
360 VK_COMPARE_OP_NOT_EQUAL = 0x00000005,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800361 VK_COMPARE_OP_GREATER_OR_EQUAL = 0x00000006,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700362 VK_COMPARE_OP_ALWAYS = 0x00000007,
363}
364
Jesse Hall65ab5522015-11-30 00:07:16 -0800365enum VkPolygonMode {
366 VK_POLYGON_MODE_FILL = 0x00000000,
367 VK_POLYGON_MODE_LINE = 0x00000001,
368 VK_POLYGON_MODE_POINT = 0x00000002,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700369}
370
371enum VkFrontFace {
Jesse Hall3fbc8562015-11-29 22:10:52 -0800372 VK_FRONT_FACE_COUNTER_CLOCKWISE = 0x00000000,
373 VK_FRONT_FACE_CLOCKWISE = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700374}
375
Jesse Hall65ab5522015-11-30 00:07:16 -0800376enum VkBlendFactor {
377 VK_BLEND_FACTOR_ZERO = 0x00000000,
378 VK_BLEND_FACTOR_ONE = 0x00000001,
379 VK_BLEND_FACTOR_SRC_COLOR = 0x00000002,
380 VK_BLEND_FACTOR_ONE_MINUS_SRC_COLOR = 0x00000003,
381 VK_BLEND_FACTOR_DST_COLOR = 0x00000004,
382 VK_BLEND_FACTOR_ONE_MINUS_DST_COLOR = 0x00000005,
383 VK_BLEND_FACTOR_SRC_ALPHA = 0x00000006,
384 VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA = 0x00000007,
385 VK_BLEND_FACTOR_DST_ALPHA = 0x00000008,
386 VK_BLEND_FACTOR_ONE_MINUS_DST_ALPHA = 0x00000009,
387 VK_BLEND_FACTOR_CONSTANT_COLOR = 0x0000000a,
388 VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR = 0x0000000b,
389 VK_BLEND_FACTOR_CONSTANT_ALPHA = 0x0000000c,
390 VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA = 0x0000000d,
391 VK_BLEND_FACTOR_SRC_ALPHA_SATURATE = 0x0000000e,
392 VK_BLEND_FACTOR_SRC1_COLOR = 0x0000000f,
393 VK_BLEND_FACTOR_ONE_MINUS_SRC1_COLOR = 0x00000010,
394 VK_BLEND_FACTOR_SRC1_ALPHA = 0x00000011,
395 VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA = 0x00000012,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700396}
397
398enum VkBlendOp {
399 VK_BLEND_OP_ADD = 0x00000000,
400 VK_BLEND_OP_SUBTRACT = 0x00000001,
401 VK_BLEND_OP_REVERSE_SUBTRACT = 0x00000002,
402 VK_BLEND_OP_MIN = 0x00000003,
403 VK_BLEND_OP_MAX = 0x00000004,
404}
405
406enum VkStencilOp {
407 VK_STENCIL_OP_KEEP = 0x00000000,
408 VK_STENCIL_OP_ZERO = 0x00000001,
409 VK_STENCIL_OP_REPLACE = 0x00000002,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800410 VK_STENCIL_OP_INCREMENT_AND_CLAMP = 0x00000003,
411 VK_STENCIL_OP_DECREMENT_AND_CLAMP = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700412 VK_STENCIL_OP_INVERT = 0x00000005,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800413 VK_STENCIL_OP_INCREMENT_AND_WRAP = 0x00000006,
414 VK_STENCIL_OP_DECREMENT_AND_WRAP = 0x00000007,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700415}
416
417enum VkLogicOp {
418 VK_LOGIC_OP_CLEAR = 0x00000000,
419 VK_LOGIC_OP_AND = 0x00000001,
420 VK_LOGIC_OP_AND_REVERSE = 0x00000002,
421 VK_LOGIC_OP_COPY = 0x00000003,
422 VK_LOGIC_OP_AND_INVERTED = 0x00000004,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800423 VK_LOGIC_OP_NO_OP = 0x00000005,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700424 VK_LOGIC_OP_XOR = 0x00000006,
425 VK_LOGIC_OP_OR = 0x00000007,
426 VK_LOGIC_OP_NOR = 0x00000008,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800427 VK_LOGIC_OP_EQUIVALENT = 0x00000009,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700428 VK_LOGIC_OP_INVERT = 0x0000000a,
429 VK_LOGIC_OP_OR_REVERSE = 0x0000000b,
430 VK_LOGIC_OP_COPY_INVERTED = 0x0000000c,
431 VK_LOGIC_OP_OR_INVERTED = 0x0000000d,
432 VK_LOGIC_OP_NAND = 0x0000000e,
433 VK_LOGIC_OP_SET = 0x0000000f,
434}
435
Jesse Hall3fbc8562015-11-29 22:10:52 -0800436enum VkSystemAllocationScope {
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800437 VK_SYSTEM_ALLOCATION_SCOPE_COMMAND = 0x00000000,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800438 VK_SYSTEM_ALLOCATION_SCOPE_OBJECT = 0x00000001,
439 VK_SYSTEM_ALLOCATION_SCOPE_CACHE = 0x00000002,
440 VK_SYSTEM_ALLOCATION_SCOPE_DEVICE = 0x00000003,
441 VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE = 0x00000004,
Jesse Hall03b6fe12015-11-24 12:44:21 -0800442}
443
Jesse Hall3fbc8562015-11-29 22:10:52 -0800444enum VkInternalAllocationType {
445 VK_INTERNAL_ALLOCATION_TYPE_EXECUTABLE = 0x00000000,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700446}
447
448enum VkPhysicalDeviceType {
449 VK_PHYSICAL_DEVICE_TYPE_OTHER = 0x00000000,
450 VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU = 0x00000001,
451 VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU = 0x00000002,
452 VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU = 0x00000003,
453 VK_PHYSICAL_DEVICE_TYPE_CPU = 0x00000004,
454}
455
Jesse Hall65ab5522015-11-30 00:07:16 -0800456enum VkVertexInputRate {
457 VK_VERTEX_INPUT_RATE_VERTEX = 0x00000000,
458 VK_VERTEX_INPUT_RATE_INSTANCE = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700459}
460
461/// Vulkan format definitions
462enum VkFormat {
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800463 VK_FORMAT_UNDEFINED = 0,
464 VK_FORMAT_R4G4_UNORM_PACK8 = 1,
465 VK_FORMAT_R4G4B4A4_UNORM_PACK16 = 2,
466 VK_FORMAT_B4G4R4A4_UNORM_PACK16 = 3,
467 VK_FORMAT_R5G6B5_UNORM_PACK16 = 4,
468 VK_FORMAT_B5G6R5_UNORM_PACK16 = 5,
469 VK_FORMAT_R5G5B5A1_UNORM_PACK16 = 6,
470 VK_FORMAT_B5G5R5A1_UNORM_PACK16 = 7,
471 VK_FORMAT_A1R5G5B5_UNORM_PACK16 = 8,
472 VK_FORMAT_R8_UNORM = 9,
473 VK_FORMAT_R8_SNORM = 10,
474 VK_FORMAT_R8_USCALED = 11,
475 VK_FORMAT_R8_SSCALED = 12,
476 VK_FORMAT_R8_UINT = 13,
477 VK_FORMAT_R8_SINT = 14,
478 VK_FORMAT_R8_SRGB = 15,
479 VK_FORMAT_R8G8_UNORM = 16,
480 VK_FORMAT_R8G8_SNORM = 17,
481 VK_FORMAT_R8G8_USCALED = 18,
482 VK_FORMAT_R8G8_SSCALED = 19,
483 VK_FORMAT_R8G8_UINT = 20,
484 VK_FORMAT_R8G8_SINT = 21,
485 VK_FORMAT_R8G8_SRGB = 22,
486 VK_FORMAT_R8G8B8_UNORM = 23,
487 VK_FORMAT_R8G8B8_SNORM = 24,
488 VK_FORMAT_R8G8B8_USCALED = 25,
489 VK_FORMAT_R8G8B8_SSCALED = 26,
490 VK_FORMAT_R8G8B8_UINT = 27,
491 VK_FORMAT_R8G8B8_SINT = 28,
492 VK_FORMAT_R8G8B8_SRGB = 29,
493 VK_FORMAT_B8G8R8_UNORM = 30,
494 VK_FORMAT_B8G8R8_SNORM = 31,
495 VK_FORMAT_B8G8R8_USCALED = 32,
496 VK_FORMAT_B8G8R8_SSCALED = 33,
497 VK_FORMAT_B8G8R8_UINT = 34,
498 VK_FORMAT_B8G8R8_SINT = 35,
499 VK_FORMAT_B8G8R8_SRGB = 36,
500 VK_FORMAT_R8G8B8A8_UNORM = 37,
501 VK_FORMAT_R8G8B8A8_SNORM = 38,
502 VK_FORMAT_R8G8B8A8_USCALED = 39,
503 VK_FORMAT_R8G8B8A8_SSCALED = 40,
504 VK_FORMAT_R8G8B8A8_UINT = 41,
505 VK_FORMAT_R8G8B8A8_SINT = 42,
506 VK_FORMAT_R8G8B8A8_SRGB = 43,
507 VK_FORMAT_B8G8R8A8_UNORM = 44,
508 VK_FORMAT_B8G8R8A8_SNORM = 45,
509 VK_FORMAT_B8G8R8A8_USCALED = 46,
510 VK_FORMAT_B8G8R8A8_SSCALED = 47,
511 VK_FORMAT_B8G8R8A8_UINT = 48,
512 VK_FORMAT_B8G8R8A8_SINT = 49,
513 VK_FORMAT_B8G8R8A8_SRGB = 50,
514 VK_FORMAT_A8B8G8R8_UNORM_PACK32 = 51,
515 VK_FORMAT_A8B8G8R8_SNORM_PACK32 = 52,
516 VK_FORMAT_A8B8G8R8_USCALED_PACK32 = 53,
517 VK_FORMAT_A8B8G8R8_SSCALED_PACK32 = 54,
518 VK_FORMAT_A8B8G8R8_UINT_PACK32 = 55,
519 VK_FORMAT_A8B8G8R8_SINT_PACK32 = 56,
520 VK_FORMAT_A8B8G8R8_SRGB_PACK32 = 57,
521 VK_FORMAT_A2R10G10B10_UNORM_PACK32 = 58,
522 VK_FORMAT_A2R10G10B10_SNORM_PACK32 = 59,
523 VK_FORMAT_A2R10G10B10_USCALED_PACK32 = 60,
524 VK_FORMAT_A2R10G10B10_SSCALED_PACK32 = 61,
525 VK_FORMAT_A2R10G10B10_UINT_PACK32 = 62,
526 VK_FORMAT_A2R10G10B10_SINT_PACK32 = 63,
527 VK_FORMAT_A2B10G10R10_UNORM_PACK32 = 64,
528 VK_FORMAT_A2B10G10R10_SNORM_PACK32 = 65,
529 VK_FORMAT_A2B10G10R10_USCALED_PACK32 = 66,
530 VK_FORMAT_A2B10G10R10_SSCALED_PACK32 = 67,
531 VK_FORMAT_A2B10G10R10_UINT_PACK32 = 68,
532 VK_FORMAT_A2B10G10R10_SINT_PACK32 = 69,
533 VK_FORMAT_R16_UNORM = 70,
534 VK_FORMAT_R16_SNORM = 71,
535 VK_FORMAT_R16_USCALED = 72,
536 VK_FORMAT_R16_SSCALED = 73,
537 VK_FORMAT_R16_UINT = 74,
538 VK_FORMAT_R16_SINT = 75,
539 VK_FORMAT_R16_SFLOAT = 76,
540 VK_FORMAT_R16G16_UNORM = 77,
541 VK_FORMAT_R16G16_SNORM = 78,
542 VK_FORMAT_R16G16_USCALED = 79,
543 VK_FORMAT_R16G16_SSCALED = 80,
544 VK_FORMAT_R16G16_UINT = 81,
545 VK_FORMAT_R16G16_SINT = 82,
546 VK_FORMAT_R16G16_SFLOAT = 83,
547 VK_FORMAT_R16G16B16_UNORM = 84,
548 VK_FORMAT_R16G16B16_SNORM = 85,
549 VK_FORMAT_R16G16B16_USCALED = 86,
550 VK_FORMAT_R16G16B16_SSCALED = 87,
551 VK_FORMAT_R16G16B16_UINT = 88,
552 VK_FORMAT_R16G16B16_SINT = 89,
553 VK_FORMAT_R16G16B16_SFLOAT = 90,
554 VK_FORMAT_R16G16B16A16_UNORM = 91,
555 VK_FORMAT_R16G16B16A16_SNORM = 92,
556 VK_FORMAT_R16G16B16A16_USCALED = 93,
557 VK_FORMAT_R16G16B16A16_SSCALED = 94,
558 VK_FORMAT_R16G16B16A16_UINT = 95,
559 VK_FORMAT_R16G16B16A16_SINT = 96,
560 VK_FORMAT_R16G16B16A16_SFLOAT = 97,
561 VK_FORMAT_R32_UINT = 98,
562 VK_FORMAT_R32_SINT = 99,
563 VK_FORMAT_R32_SFLOAT = 100,
564 VK_FORMAT_R32G32_UINT = 101,
565 VK_FORMAT_R32G32_SINT = 102,
566 VK_FORMAT_R32G32_SFLOAT = 103,
567 VK_FORMAT_R32G32B32_UINT = 104,
568 VK_FORMAT_R32G32B32_SINT = 105,
569 VK_FORMAT_R32G32B32_SFLOAT = 106,
570 VK_FORMAT_R32G32B32A32_UINT = 107,
571 VK_FORMAT_R32G32B32A32_SINT = 108,
572 VK_FORMAT_R32G32B32A32_SFLOAT = 109,
573 VK_FORMAT_R64_UINT = 110,
574 VK_FORMAT_R64_SINT = 111,
575 VK_FORMAT_R64_SFLOAT = 112,
576 VK_FORMAT_R64G64_UINT = 113,
577 VK_FORMAT_R64G64_SINT = 114,
578 VK_FORMAT_R64G64_SFLOAT = 115,
579 VK_FORMAT_R64G64B64_UINT = 116,
580 VK_FORMAT_R64G64B64_SINT = 117,
581 VK_FORMAT_R64G64B64_SFLOAT = 118,
582 VK_FORMAT_R64G64B64A64_UINT = 119,
583 VK_FORMAT_R64G64B64A64_SINT = 120,
584 VK_FORMAT_R64G64B64A64_SFLOAT = 121,
585 VK_FORMAT_B10G11R11_UFLOAT_PACK32 = 122,
586 VK_FORMAT_E5B9G9R9_UFLOAT_PACK32 = 123,
587 VK_FORMAT_D16_UNORM = 124,
588 VK_FORMAT_X8_D24_UNORM_PACK32 = 125,
589 VK_FORMAT_D32_SFLOAT = 126,
590 VK_FORMAT_S8_UINT = 127,
591 VK_FORMAT_D16_UNORM_S8_UINT = 128,
592 VK_FORMAT_D24_UNORM_S8_UINT = 129,
593 VK_FORMAT_D32_SFLOAT_S8_UINT = 130,
594 VK_FORMAT_BC1_RGB_UNORM_BLOCK = 131,
595 VK_FORMAT_BC1_RGB_SRGB_BLOCK = 132,
596 VK_FORMAT_BC1_RGBA_UNORM_BLOCK = 133,
597 VK_FORMAT_BC1_RGBA_SRGB_BLOCK = 134,
598 VK_FORMAT_BC2_UNORM_BLOCK = 135,
599 VK_FORMAT_BC2_SRGB_BLOCK = 136,
600 VK_FORMAT_BC3_UNORM_BLOCK = 137,
601 VK_FORMAT_BC3_SRGB_BLOCK = 138,
602 VK_FORMAT_BC4_UNORM_BLOCK = 139,
603 VK_FORMAT_BC4_SNORM_BLOCK = 140,
604 VK_FORMAT_BC5_UNORM_BLOCK = 141,
605 VK_FORMAT_BC5_SNORM_BLOCK = 142,
606 VK_FORMAT_BC6H_UFLOAT_BLOCK = 143,
607 VK_FORMAT_BC6H_SFLOAT_BLOCK = 144,
608 VK_FORMAT_BC7_UNORM_BLOCK = 145,
609 VK_FORMAT_BC7_SRGB_BLOCK = 146,
610 VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK = 147,
611 VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK = 148,
612 VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK = 149,
613 VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK = 150,
614 VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK = 151,
615 VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK = 152,
616 VK_FORMAT_EAC_R11_UNORM_BLOCK = 153,
617 VK_FORMAT_EAC_R11_SNORM_BLOCK = 154,
618 VK_FORMAT_EAC_R11G11_UNORM_BLOCK = 155,
619 VK_FORMAT_EAC_R11G11_SNORM_BLOCK = 156,
620 VK_FORMAT_ASTC_4x4_UNORM_BLOCK = 157,
621 VK_FORMAT_ASTC_4x4_SRGB_BLOCK = 158,
622 VK_FORMAT_ASTC_5x4_UNORM_BLOCK = 159,
623 VK_FORMAT_ASTC_5x4_SRGB_BLOCK = 160,
624 VK_FORMAT_ASTC_5x5_UNORM_BLOCK = 161,
625 VK_FORMAT_ASTC_5x5_SRGB_BLOCK = 162,
626 VK_FORMAT_ASTC_6x5_UNORM_BLOCK = 163,
627 VK_FORMAT_ASTC_6x5_SRGB_BLOCK = 164,
628 VK_FORMAT_ASTC_6x6_UNORM_BLOCK = 165,
629 VK_FORMAT_ASTC_6x6_SRGB_BLOCK = 166,
630 VK_FORMAT_ASTC_8x5_UNORM_BLOCK = 167,
631 VK_FORMAT_ASTC_8x5_SRGB_BLOCK = 168,
632 VK_FORMAT_ASTC_8x6_UNORM_BLOCK = 169,
633 VK_FORMAT_ASTC_8x6_SRGB_BLOCK = 170,
634 VK_FORMAT_ASTC_8x8_UNORM_BLOCK = 171,
635 VK_FORMAT_ASTC_8x8_SRGB_BLOCK = 172,
636 VK_FORMAT_ASTC_10x5_UNORM_BLOCK = 173,
637 VK_FORMAT_ASTC_10x5_SRGB_BLOCK = 174,
638 VK_FORMAT_ASTC_10x6_UNORM_BLOCK = 175,
639 VK_FORMAT_ASTC_10x6_SRGB_BLOCK = 176,
640 VK_FORMAT_ASTC_10x8_UNORM_BLOCK = 177,
641 VK_FORMAT_ASTC_10x8_SRGB_BLOCK = 178,
642 VK_FORMAT_ASTC_10x10_UNORM_BLOCK = 179,
643 VK_FORMAT_ASTC_10x10_SRGB_BLOCK = 180,
644 VK_FORMAT_ASTC_12x10_UNORM_BLOCK = 181,
645 VK_FORMAT_ASTC_12x10_SRGB_BLOCK = 182,
646 VK_FORMAT_ASTC_12x12_UNORM_BLOCK = 183,
647 VK_FORMAT_ASTC_12x12_SRGB_BLOCK = 184,
Chris Forbes289cb792016-12-30 15:03:55 +1300648
649 //@extension("VK_IMG_format_pvrtc")
650 VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG = 1000054000,
651
652 //@extension("VK_IMG_format_pvrtc")
653 VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG = 1000054001,
654
655 //@extension("VK_IMG_format_pvrtc")
656 VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG = 1000054002,
657
658 //@extension("VK_IMG_format_pvrtc")
659 VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG = 1000054003,
660
661 //@extension("VK_IMG_format_pvrtc")
662 VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG = 1000054004,
663
664 //@extension("VK_IMG_format_pvrtc")
665 VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG = 1000054005,
666
667 //@extension("VK_IMG_format_pvrtc")
668 VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG = 1000054006,
669
670 //@extension("VK_IMG_format_pvrtc")
671 VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG = 1000054007,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700672}
673
Jesse Halld27f6aa2015-08-15 17:58:48 -0700674/// Structure type enumerant
675enum VkStructureType {
676 VK_STRUCTURE_TYPE_APPLICATION_INFO = 0,
Jesse Hallc7467b72015-11-29 21:05:26 -0800677 VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO = 1,
678 VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO = 2,
679 VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO = 3,
680 VK_STRUCTURE_TYPE_SUBMIT_INFO = 4,
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800681 VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO = 5,
Jesse Hallc7467b72015-11-29 21:05:26 -0800682 VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE = 6,
683 VK_STRUCTURE_TYPE_BIND_SPARSE_INFO = 7,
684 VK_STRUCTURE_TYPE_FENCE_CREATE_INFO = 8,
685 VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO = 9,
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700686 VK_STRUCTURE_TYPE_EVENT_CREATE_INFO = 10,
Jesse Hallc7467b72015-11-29 21:05:26 -0800687 VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO = 11,
688 VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO = 12,
689 VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO = 13,
690 VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO = 14,
691 VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO = 15,
692 VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO = 16,
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800693 VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO = 17,
694 VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO = 18,
695 VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO = 19,
696 VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO = 20,
697 VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO = 21,
698 VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO = 22,
699 VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO = 23,
700 VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO = 24,
701 VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO = 25,
702 VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO = 26,
703 VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO = 27,
704 VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO = 28,
705 VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO = 29,
706 VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO = 30,
707 VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO = 31,
708 VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO = 32,
709 VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO = 33,
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800710 VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO = 34,
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800711 VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET = 35,
712 VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET = 36,
713 VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO = 37,
714 VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO = 38,
715 VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO = 39,
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800716 VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO = 40,
Jesse Hall3dd678a2016-01-08 21:52:01 -0800717 VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO = 41,
718 VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO = 42,
719 VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO = 43,
720 VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER = 44,
721 VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER = 45,
722 VK_STRUCTURE_TYPE_MEMORY_BARRIER = 46,
723 VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO = 47,
724 VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO = 48,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800725
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800726 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800727 VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR = 1000001000,
728 VK_STRUCTURE_TYPE_PRESENT_INFO_KHR = 1000001001,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800729
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800730 //@extension("VK_KHR_display")
Jesse Hallbd888842015-11-30 21:44:14 -0800731 VK_STRUCTURE_TYPE_DISPLAY_MODE_CREATE_INFO_KHR = 1000002000,
732 VK_STRUCTURE_TYPE_DISPLAY_SURFACE_CREATE_INFO_KHR = 1000002001,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800733
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800734 //@extension("VK_KHR_display_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800735 VK_STRUCTURE_TYPE_DISPLAY_DISPLAY_PRESENT_INFO_KHR = 1000003000,
Jesse Hallf9fa9a52016-01-08 16:08:51 -0800736
737 //@extension("VK_KHR_xlib_surface")
738 VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR = 1000004000,
739
740 //@extension("VK_KHR_xcb_surface")
741 VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR = 1000005000,
742
743 //@extension("VK_KHR_wayland_surface")
744 VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR = 1000006000,
745
746 //@extension("VK_KHR_mir_surface")
747 VK_STRUCTURE_TYPE_MIR_SURFACE_CREATE_INFO_KHR = 1000007000,
748
749 //@extension("VK_KHR_android_surface")
750 VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR = 1000008000,
751
752 //@extension("VK_KHR_win32_surface")
753 VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR = 1000009000,
Jesse Hall543a7ff2016-01-08 16:38:30 -0800754
Ian Elliott948233a2017-01-06 12:13:23 -0700755 //@extension("VK_KHR_incremental_present")
756 VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR = 1000084000,
757
Chia-I Wub262ddc2016-03-22 07:38:20 +0800758 //@extension("VK_ANDROID_native_buffer")
759 VK_STRUCTURE_TYPE_NATIVE_BUFFER_ANDROID = 1000010000,
Chris Forbes8e4438b2016-12-07 16:26:49 +1300760 VK_STRUCTURE_TYPE_SWAPCHAIN_IMAGE_CREATE_INFO_ANDROID = 1000010001,
Chia-I Wub262ddc2016-03-22 07:38:20 +0800761
Ian Elliott4c8bb2a2016-12-29 11:07:26 -0700762 //@extension("VK_GOOGLE_display_timing")
Ian Elliott14866bb2017-01-20 09:15:48 -0700763 VK_STRUCTURE_TYPE_PRESENT_TIMES_INFO_GOOGLE = 1000092000,
Ian Elliott4c8bb2a2016-12-29 11:07:26 -0700764
Jesse Hall543a7ff2016-01-08 16:38:30 -0800765 //@extension("VK_EXT_debug_report")
Jesse Hall26763382016-05-20 07:13:52 -0700766 VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT = 1000011000,
767
768 //@extension("VK_AMD_rasterization_order")
769 VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD = 1000018000,
770
771 //@extension("VK_EXT_debug_marker")
772 VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_NAME_INFO_EXT = 1000022000,
773
774 //@extension("VK_EXT_debug_marker")
775 VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_TAG_INFO_EXT = 1000022001,
776
777 //@extension("VK_EXT_debug_marker")
778 VK_STRUCTURE_TYPE_DEBUG_MARKER_MARKER_INFO_EXT = 1000022002,
Jesse Hall56d386a2016-07-26 15:20:40 -0700779
780 //@extension("VK_NV_dedicated_allocation")
781 VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV = 1000026000,
782
783 //@extension("VK_NV_dedicated_allocation")
784 VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV = 1000026001,
785
786 //@extension("VK_NV_dedicated_allocation")
787 VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV = 1000026002,
Chris Forbes289cb792016-12-30 15:03:55 +1300788
789 //@extension("VK_NV_external_memory")
790 VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_NV = 1000056000,
791
792 //@extension("VK_NV_external_memory")
793 VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_NV = 1000056001,
794
795 //@extension("VK_NV_external_memory_win32")
796 VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_NV = 1000057000,
797
798 //@extension("VK_NV_external_memory_win32")
799 VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_NV = 1000057001,
800
801 //@extension("VK_NV_win32_keyed_mutex")
802 VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_NV = 1000058000,
803
Chris Forbes1194ede2016-12-30 16:29:25 +1300804 //@extension("VK_KHR_get_physical_device_properties2")
805 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR = 1000059000,
806
807 //@extension("VK_KHR_get_physical_device_properties2")
808 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR = 1000059001,
809
810 //@extension("VK_KHR_get_physical_device_properties2")
811 VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2_KHR = 1000059002,
812
813 //@extension("VK_KHR_get_physical_device_properties2")
814 VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2_KHR = 1000059003,
815
816 //@extension("VK_KHR_get_physical_device_properties2")
817 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2_KHR = 1000059004,
818
819 //@extension("VK_KHR_get_physical_device_properties2")
820 VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2_KHR = 1000059005,
821
822 //@extension("VK_KHR_get_physical_device_properties2")
823 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2_KHR = 1000059006,
824
825 //@extension("VK_KHR_get_physical_device_properties2")
826 VK_STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2_KHR = 1000059007,
827
828 //@extension("VK_KHR_get_physical_device_properties2")
829 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2_KHR = 1000059008,
830
Chris Forbes289cb792016-12-30 15:03:55 +1300831 //@extension("VK_EXT_validation_flags")
832 VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT = 1000061000,
833
834 //@extension("VK_KHR_incremental_present")
835 VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR = 1000084000,
836
837 //@extension("VK_NVX_device_generated_commands")
838 VK_STRUCTURE_TYPE_OBJECT_TABLE_CREATE_INFO_NVX = 1000086000,
839
840 //@extension("VK_NVX_device_generated_commands")
841 VK_STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_CREATE_INFO_NVX = 1000086001,
842
843 //@extension("VK_NVX_device_generated_commands")
844 VK_STRUCTURE_TYPE_CMD_PROCESS_COMMANDS_INFO_NVX = 1000086002,
845
846 //@extension("VK_NVX_device_generated_commands")
847 VK_STRUCTURE_TYPE_CMD_RESERVE_SPACE_FOR_COMMANDS_INFO_NVX = 1000086003,
848
849 //@extension("VK_NVX_device_generated_commands")
850 VK_STRUCTURE_TYPE_DEVICE_GENERATED_COMMANDS_LIMITS_NVX = 1000086004,
851
852 //@extension("VK_NVX_device_generated_commands")
853 VK_STRUCTURE_TYPE_DEVICE_GENERATED_COMMANDS_FEATURES_NVX = 1000086005,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700854}
855
Jesse Hall65ab5522015-11-30 00:07:16 -0800856enum VkSubpassContents {
857 VK_SUBPASS_CONTENTS_INLINE = 0x00000000,
858 VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700859}
860
Jesse Hall543a7ff2016-01-08 16:38:30 -0800861enum VkPipelineCacheHeaderVersion {
862 VK_PIPELINE_CACHE_HEADER_VERSION_ONE = 1,
863}
864
Jesse Hallbd888842015-11-30 21:44:14 -0800865@lastUnused(-11)
Jesse Halld27f6aa2015-08-15 17:58:48 -0700866/// Error and return codes
867enum VkResult {
868 // Return codes for successful operation execution (positive values)
Jesse Hallbd888842015-11-30 21:44:14 -0800869 VK_SUCCESS = 0,
870 VK_NOT_READY = 1,
871 VK_TIMEOUT = 2,
872 VK_EVENT_SET = 3,
873 VK_EVENT_RESET = 4,
874 VK_INCOMPLETE = 5,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700875
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800876 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800877 VK_SUBOPTIMAL_KHR = 1000001003,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800878
Jesse Halld27f6aa2015-08-15 17:58:48 -0700879 // Error codes (negative values)
Jesse Hallbd888842015-11-30 21:44:14 -0800880 VK_ERROR_OUT_OF_HOST_MEMORY = 0xFFFFFFFF, // -1
881 VK_ERROR_OUT_OF_DEVICE_MEMORY = 0xFFFFFFFE, // -2
882 VK_ERROR_INITIALIZATION_FAILED = 0xFFFFFFFD, // -3
883 VK_ERROR_DEVICE_LOST = 0xFFFFFFFC, // -4
884 VK_ERROR_MEMORY_MAP_FAILED = 0xFFFFFFFB, // -5
885 VK_ERROR_LAYER_NOT_PRESENT = 0xFFFFFFFA, // -6
886 VK_ERROR_EXTENSION_NOT_PRESENT = 0xFFFFFFF9, // -7
887 VK_ERROR_FEATURE_NOT_PRESENT = 0xFFFFFFF8, // -8
888 VK_ERROR_INCOMPATIBLE_DRIVER = 0xFFFFFFF7, // -9
889 VK_ERROR_TOO_MANY_OBJECTS = 0xFFFFFFF6, // -10
890 VK_ERROR_FORMAT_NOT_SUPPORTED = 0xFFFFFFF5, // -11
Jesse Hall56d386a2016-07-26 15:20:40 -0700891 VK_ERROR_FRAGMENTED_POOL = 0xFFFFFFF4, // -12
Jesse Hall1356b0d2015-11-23 17:24:58 -0800892
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800893 //@extension("VK_KHR_surface")
Jesse Hallbd888842015-11-30 21:44:14 -0800894 VK_ERROR_SURFACE_LOST_KHR = 0xC4653600, // -1000000000
Jesse Halla6429252015-11-29 18:59:42 -0800895
Jesse Hall563380d2016-01-15 23:14:05 -0800896 //@extension("VK_KHR_surface")
897 VK_ERROR_NATIVE_WINDOW_IN_USE_KHR = 0xC46535FF, // -1000008001
898
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800899 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800900 VK_ERROR_OUT_OF_DATE_KHR = 0xC4653214, // -1000001004
Jesse Hall1356b0d2015-11-23 17:24:58 -0800901
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800902 //@extension("VK_KHR_display_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800903 VK_ERROR_INCOMPATIBLE_DISPLAY_KHR = 0xC4652A47, // -1000003001
Jesse Hall1356b0d2015-11-23 17:24:58 -0800904
Jesse Hall543a7ff2016-01-08 16:38:30 -0800905 //@extension("VK_EXT_debug_report")
906 VK_ERROR_VALIDATION_FAILED_EXT = 0xC4650B07, // -1000011001
Jesse Hall26763382016-05-20 07:13:52 -0700907
908 //@extension("VK_NV_glsl_shader")
909 VK_ERROR_INVALID_SHADER_NV = 0xC4650720, // -1000012000
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700910}
911
912enum VkDynamicState {
913 VK_DYNAMIC_STATE_VIEWPORT = 0x00000000,
914 VK_DYNAMIC_STATE_SCISSOR = 0x00000001,
915 VK_DYNAMIC_STATE_LINE_WIDTH = 0x00000002,
916 VK_DYNAMIC_STATE_DEPTH_BIAS = 0x00000003,
917 VK_DYNAMIC_STATE_BLEND_CONSTANTS = 0x00000004,
918 VK_DYNAMIC_STATE_DEPTH_BOUNDS = 0x00000005,
919 VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK = 0x00000006,
920 VK_DYNAMIC_STATE_STENCIL_WRITE_MASK = 0x00000007,
921 VK_DYNAMIC_STATE_STENCIL_REFERENCE = 0x00000008,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700922}
923
Jesse Hall523db342015-11-30 21:12:55 -0800924@extension("VK_KHR_surface")
Michael Lentine88594d72015-11-12 12:49:45 -0800925enum VkPresentModeKHR {
926 VK_PRESENT_MODE_IMMEDIATE_KHR = 0x00000000,
927 VK_PRESENT_MODE_MAILBOX_KHR = 0x00000001,
928 VK_PRESENT_MODE_FIFO_KHR = 0x00000002,
Jesse Hall03b6fe12015-11-24 12:44:21 -0800929 VK_PRESENT_MODE_FIFO_RELAXED_KHR = 0x00000003,
Chris Forbes1d5f68c2017-01-31 10:17:01 +1300930 //@extension("VK_KHR_shared_presentable_image")
931 VK_PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR = 1000111000,
932 //@extension("VK_KHR_shared_presentable_image")
933 VK_PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR = 1000111001,
Michael Lentine88594d72015-11-12 12:49:45 -0800934}
935
Jesse Hall523db342015-11-30 21:12:55 -0800936@extension("VK_KHR_surface")
Michael Lentine88594d72015-11-12 12:49:45 -0800937enum VkColorSpaceKHR {
938 VK_COLORSPACE_SRGB_NONLINEAR_KHR = 0x00000000,
939}
Jesse Halld27f6aa2015-08-15 17:58:48 -0700940
Jesse Hall715b86a2016-01-16 16:34:29 -0800941@extension("VK_EXT_debug_report")
942enum VkDebugReportObjectTypeEXT {
943 VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT = 0,
944 VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT = 1,
945 VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT = 2,
946 VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT = 3,
947 VK_DEBUG_REPORT_OBJECT_TYPE_QUEUE_EXT = 4,
948 VK_DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT = 5,
949 VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT = 6,
950 VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT = 7,
951 VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT = 8,
952 VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT = 9,
953 VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT = 10,
954 VK_DEBUG_REPORT_OBJECT_TYPE_EVENT_EXT = 11,
955 VK_DEBUG_REPORT_OBJECT_TYPE_QUERY_POOL_EXT = 12,
956 VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_VIEW_EXT = 13,
957 VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_VIEW_EXT = 14,
958 VK_DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT = 15,
959 VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_CACHE_EXT = 16,
960 VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_LAYOUT_EXT = 17,
961 VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT = 18,
962 VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT = 19,
963 VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT_EXT = 20,
964 VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_EXT = 21,
965 VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT = 22,
966 VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT = 23,
967 VK_DEBUG_REPORT_OBJECT_TYPE_FRAMEBUFFER_EXT = 24,
968 VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_POOL_EXT = 25,
969 VK_DEBUG_REPORT_OBJECT_TYPE_SURFACE_KHR_EXT = 26,
970 VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT = 27,
971 VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_EXT = 28,
Chris Forbes289cb792016-12-30 15:03:55 +1300972 VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_KHR_EXT = 29,
973 VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_MODE_KHR_EXT = 30,
974 VK_DEBUG_REPORT_OBJECT_TYPE_OBJECT_TABLE_NVX_EXT = 31,
975 VK_DEBUG_REPORT_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NVX_EXT = 32,
Jesse Hall715b86a2016-01-16 16:34:29 -0800976}
977
978@extension("VK_EXT_debug_report")
979enum VkDebugReportErrorEXT {
980 VK_DEBUG_REPORT_ERROR_NONE_EXT = 0,
981 VK_DEBUG_REPORT_ERROR_CALLBACK_REF_EXT = 1,
982}
983
Jesse Hall26763382016-05-20 07:13:52 -0700984@extension("VK_AMD_rasterization_order")
985enum VkRasterizationOrderAMD {
986 VK_RASTERIZATION_ORDER_STRICT_AMD = 0,
987 VK_RASTERIZATION_ORDER_RELAXED_AMD = 1,
988}
989
Chris Forbes289cb792016-12-30 15:03:55 +1300990@extension("VK_EXT_validation_flags")
991enum VkValidationCheckEXT {
992 VK_VALIDATION_CHECK_ALL_EXT = 0,
993}
994
995@extension("VK_NVX_device_generated_commands")
996enum VkIndirectCommandsTokenTypeNVX {
997 VK_INDIRECT_COMMANDS_TOKEN_PIPELINE_NVX = 0,
998 VK_INDIRECT_COMMANDS_TOKEN_DESCRIPTOR_SET_NVX = 1,
999 VK_INDIRECT_COMMANDS_TOKEN_INDEX_BUFFER_NVX = 2,
1000 VK_INDIRECT_COMMANDS_TOKEN_VERTEX_BUFFER_NVX = 3,
1001 VK_INDIRECT_COMMANDS_TOKEN_PUSH_CONSTANT_NVX = 4,
1002 VK_INDIRECT_COMMANDS_TOKEN_DRAW_INDEXED_NVX = 5,
1003 VK_INDIRECT_COMMANDS_TOKEN_DRAW_NVX = 6,
1004 VK_INDIRECT_COMMANDS_TOKEN_DISPATCH_NVX = 7,
1005}
1006
1007@extension("VK_NVX_device_generated_commands")
1008enum VkObjectEntryTypeNVX {
1009 VK_OBJECT_ENTRY_DESCRIPTOR_SET_NVX = 0,
1010 VK_OBJECT_ENTRY_PIPELINE_NVX = 1,
1011 VK_OBJECT_ENTRY_INDEX_BUFFER_NVX = 2,
1012 VK_OBJECT_ENTRY_VERTEX_BUFFER_NVX = 3,
1013 VK_OBJECT_ENTRY_PUSH_CONSTANT_NVX = 4,
1014}
Jesse Hall715b86a2016-01-16 16:34:29 -08001015
Jesse Halld27f6aa2015-08-15 17:58:48 -07001016/////////////////
1017// Bitfields //
1018/////////////////
1019
Jesse Halld27f6aa2015-08-15 17:58:48 -07001020/// Queue capabilities
Jesse Halld8bade02015-11-24 10:24:18 -08001021type VkFlags VkQueueFlags
1022bitfield VkQueueFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001023 VK_QUEUE_GRAPHICS_BIT = 0x00000001, /// Queue supports graphics operations
1024 VK_QUEUE_COMPUTE_BIT = 0x00000002, /// Queue supports compute operations
Jesse Hall65ab5522015-11-30 00:07:16 -08001025 VK_QUEUE_TRANSFER_BIT = 0x00000004, /// Queue supports transfer operations
Jesse Hallb00daad2015-11-29 19:46:20 -08001026 VK_QUEUE_SPARSE_BINDING_BIT = 0x00000008, /// Queue supports sparse resource memory management operations
Jesse Halld27f6aa2015-08-15 17:58:48 -07001027}
1028
1029/// Memory properties passed into vkAllocMemory().
Jesse Halld8bade02015-11-24 10:24:18 -08001030type VkFlags VkMemoryPropertyFlags
1031bitfield VkMemoryPropertyFlagBits {
Jesse Halld1af8122015-11-29 23:50:38 -08001032 VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT = 0x00000001,
1033 VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT = 0x00000002,
1034 VK_MEMORY_PROPERTY_HOST_COHERENT_BIT = 0x00000004,
1035 VK_MEMORY_PROPERTY_HOST_CACHED_BIT = 0x00000008,
1036 VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT = 0x00000010,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001037}
1038
1039/// Memory heap flags
Jesse Halld8bade02015-11-24 10:24:18 -08001040type VkFlags VkMemoryHeapFlags
1041bitfield VkMemoryHeapFlagBits {
Jesse Halld1af8122015-11-29 23:50:38 -08001042 VK_MEMORY_HEAP_DEVICE_LOCAL_BIT = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001043}
1044
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001045/// Access flags
1046type VkFlags VkAccessFlags
1047bitfield VkAccessFlagBits {
1048 VK_ACCESS_INDIRECT_COMMAND_READ_BIT = 0x00000001,
1049 VK_ACCESS_INDEX_READ_BIT = 0x00000002,
1050 VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT = 0x00000004,
1051 VK_ACCESS_UNIFORM_READ_BIT = 0x00000008,
1052 VK_ACCESS_INPUT_ATTACHMENT_READ_BIT = 0x00000010,
1053 VK_ACCESS_SHADER_READ_BIT = 0x00000020,
1054 VK_ACCESS_SHADER_WRITE_BIT = 0x00000040,
1055 VK_ACCESS_COLOR_ATTACHMENT_READ_BIT = 0x00000080,
1056 VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT = 0x00000100,
1057 VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT = 0x00000200,
1058 VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT = 0x00000400,
1059 VK_ACCESS_TRANSFER_READ_BIT = 0x00000800,
1060 VK_ACCESS_TRANSFER_WRITE_BIT = 0x00001000,
1061 VK_ACCESS_HOST_READ_BIT = 0x00002000,
1062 VK_ACCESS_HOST_WRITE_BIT = 0x00004000,
1063 VK_ACCESS_MEMORY_READ_BIT = 0x00008000,
1064 VK_ACCESS_MEMORY_WRITE_BIT = 0x00010000,
Chris Forbes289cb792016-12-30 15:03:55 +13001065
1066 //@extension("VK_NVX_device_generated_commands")
1067 VK_ACCESS_COMMAND_PROCESS_READ_BIT_NVX = 0x00020000,
1068
1069 //@extension("VK_NVX_device_generated_commands")
1070 VK_ACCESS_COMMAND_PROCESS_WRITE_BIT_NVX = 0x00040000,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001071}
1072
1073/// Buffer usage flags
Jesse Halld8bade02015-11-24 10:24:18 -08001074type VkFlags VkBufferUsageFlags
1075bitfield VkBufferUsageFlagBits {
Jesse Hall3fbc8562015-11-29 22:10:52 -08001076 VK_BUFFER_USAGE_TRANSFER_SRC_BIT = 0x00000001, /// Can be used as a source of transfer operations
1077 VK_BUFFER_USAGE_TRANSFER_DST_BIT = 0x00000002, /// Can be used as a destination of transfer operations
Jesse Halld27f6aa2015-08-15 17:58:48 -07001078 VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000004, /// Can be used as TBO
1079 VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT = 0x00000008, /// Can be used as IBO
1080 VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT = 0x00000010, /// Can be used as UBO
1081 VK_BUFFER_USAGE_STORAGE_BUFFER_BIT = 0x00000020, /// Can be used as SSBO
1082 VK_BUFFER_USAGE_INDEX_BUFFER_BIT = 0x00000040, /// Can be used as source of fixed function index fetch (index buffer)
1083 VK_BUFFER_USAGE_VERTEX_BUFFER_BIT = 0x00000080, /// Can be used as source of fixed function vertex fetch (VBO)
1084 VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT = 0x00000100, /// Can be the source of indirect parameters (e.g. indirect buffer, parameter buffer)
1085}
1086
1087/// Buffer creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001088type VkFlags VkBufferCreateFlags
1089bitfield VkBufferCreateFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001090 VK_BUFFER_CREATE_SPARSE_BINDING_BIT = 0x00000001, /// Buffer should support sparse backing
Jesse Halld27f6aa2015-08-15 17:58:48 -07001091 VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002, /// Buffer should support sparse backing with partial residency
1092 VK_BUFFER_CREATE_SPARSE_ALIASED_BIT = 0x00000004, /// Buffer should support constent data access to physical memory blocks mapped into multiple locations of sparse buffers
1093}
1094
1095/// Shader stage flags
Jesse Halld8bade02015-11-24 10:24:18 -08001096type VkFlags VkShaderStageFlags
1097bitfield VkShaderStageFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001098 VK_SHADER_STAGE_VERTEX_BIT = 0x00000001,
Jesse Hallae38f732015-11-19 21:32:50 -08001099 VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT = 0x00000002,
1100 VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001101 VK_SHADER_STAGE_GEOMETRY_BIT = 0x00000008,
1102 VK_SHADER_STAGE_FRAGMENT_BIT = 0x00000010,
1103 VK_SHADER_STAGE_COMPUTE_BIT = 0x00000020,
Jesse Hallc7467b72015-11-29 21:05:26 -08001104 VK_SHADER_STAGE_ALL_GRAPHICS = 0x0000001F,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001105
1106 VK_SHADER_STAGE_ALL = 0x7FFFFFFF,
1107}
1108
Jesse Hallfbf97b02015-11-20 14:17:03 -08001109/// Descriptor pool create flags
Jesse Halld8bade02015-11-24 10:24:18 -08001110type VkFlags VkDescriptorPoolCreateFlags
1111bitfield VkDescriptorPoolCreateFlagBits {
Jesse Hallfbf97b02015-11-20 14:17:03 -08001112 VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT = 0x00000001,
1113}
1114
1115/// Descriptor pool reset flags
Jesse Halld8bade02015-11-24 10:24:18 -08001116type VkFlags VkDescriptorPoolResetFlags
Jesse Halla6429252015-11-29 18:59:42 -08001117//bitfield VkDescriptorPoolResetFlagBits {
1118//}
Jesse Hallfbf97b02015-11-20 14:17:03 -08001119
Jesse Halld27f6aa2015-08-15 17:58:48 -07001120/// Image usage flags
Jesse Halld8bade02015-11-24 10:24:18 -08001121type VkFlags VkImageUsageFlags
1122bitfield VkImageUsageFlagBits {
Jesse Hall3fbc8562015-11-29 22:10:52 -08001123 VK_IMAGE_USAGE_TRANSFER_SRC_BIT = 0x00000001, /// Can be used as a source of transfer operations
1124 VK_IMAGE_USAGE_TRANSFER_DST_BIT = 0x00000002, /// Can be used as a destination of transfer operations
Jesse Halld27f6aa2015-08-15 17:58:48 -07001125 VK_IMAGE_USAGE_SAMPLED_BIT = 0x00000004, /// Can be sampled from (SAMPLED_IMAGE and COMBINED_IMAGE_SAMPLER descriptor types)
1126 VK_IMAGE_USAGE_STORAGE_BIT = 0x00000008, /// Can be used as storage image (STORAGE_IMAGE descriptor type)
1127 VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT = 0x00000010, /// Can be used as framebuffer color attachment
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001128 VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000020, /// Can be used as framebuffer depth/stencil attachment
Jesse Halld27f6aa2015-08-15 17:58:48 -07001129 VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT = 0x00000040, /// Image data not needed outside of rendering
1130 VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT = 0x00000080, /// Can be used as framebuffer input attachment
1131}
1132
1133/// Image creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001134type VkFlags VkImageCreateFlags
1135bitfield VkImageCreateFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001136 VK_IMAGE_CREATE_SPARSE_BINDING_BIT = 0x00000001, /// Image should support sparse backing
Jesse Halld27f6aa2015-08-15 17:58:48 -07001137 VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002, /// Image should support sparse backing with partial residency
1138 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 -07001139 VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT = 0x00000008, /// Allows image views to have different format than the base image
1140 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 -07001141}
1142
Jesse Hallb00daad2015-11-29 19:46:20 -08001143/// Image view creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001144type VkFlags VkImageViewCreateFlags
Jesse Hallb00daad2015-11-29 19:46:20 -08001145//bitfield VkImageViewCreateFlagBits {
1146//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001147
1148/// Pipeline creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001149type VkFlags VkPipelineCreateFlags
1150bitfield VkPipelineCreateFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001151 VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT = 0x00000001,
1152 VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT = 0x00000002,
1153 VK_PIPELINE_CREATE_DERIVATIVE_BIT = 0x00000004,
1154}
1155
Jesse Hall65ab5522015-11-30 00:07:16 -08001156/// Color component flags
1157type VkFlags VkColorComponentFlags
1158bitfield VkColorComponentFlagBits {
1159 VK_COLOR_COMPONENT_R_BIT = 0x00000001,
1160 VK_COLOR_COMPONENT_G_BIT = 0x00000002,
1161 VK_COLOR_COMPONENT_B_BIT = 0x00000004,
1162 VK_COLOR_COMPONENT_A_BIT = 0x00000008,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001163}
1164
1165/// Fence creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001166type VkFlags VkFenceCreateFlags
1167bitfield VkFenceCreateFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001168 VK_FENCE_CREATE_SIGNALED_BIT = 0x00000001,
1169}
1170
1171/// Semaphore creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001172type VkFlags VkSemaphoreCreateFlags
Jesse Halla6429252015-11-29 18:59:42 -08001173//bitfield VkSemaphoreCreateFlagBits {
1174//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001175
1176/// Format capability flags
Jesse Halld8bade02015-11-24 10:24:18 -08001177type VkFlags VkFormatFeatureFlags
1178bitfield VkFormatFeatureFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001179 VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT = 0x00000001, /// Format can be used for sampled images (SAMPLED_IMAGE and COMBINED_IMAGE_SAMPLER descriptor types)
1180 VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT = 0x00000002, /// Format can be used for storage images (STORAGE_IMAGE descriptor type)
1181 VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT = 0x00000004, /// Format supports atomic operations in case it's used for storage images
1182 VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000008, /// Format can be used for uniform texel buffers (TBOs)
1183 VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT = 0x00000010, /// Format can be used for storage texel buffers (IBOs)
1184 VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT = 0x00000020, /// Format supports atomic operations in case it's used for storage texel buffers
1185 VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT = 0x00000040, /// Format can be used for vertex buffers (VBOs)
1186 VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT = 0x00000080, /// Format can be used for color attachment images
1187 VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT = 0x00000100, /// Format supports blending in case it's used for color attachment images
1188 VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000200, /// Format can be used for depth/stencil attachment images
Jesse Hall3fbc8562015-11-29 22:10:52 -08001189 VK_FORMAT_FEATURE_BLIT_SRC_BIT = 0x00000400, /// Format can be used as the source image of blits with vkCommandBlitImage
1190 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 -08001191 VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT = 0x00001000,
Jesse Hall26763382016-05-20 07:13:52 -07001192
1193 //@extension("VK_IMG_filter_cubic")
1194 VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG = 0x00002000,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001195}
1196
1197/// Query control flags
Jesse Halld8bade02015-11-24 10:24:18 -08001198type VkFlags VkQueryControlFlags
1199bitfield VkQueryControlFlagBits {
Jesse Hall65ab5522015-11-30 00:07:16 -08001200 VK_QUERY_CONTROL_PRECISE_BIT = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001201}
1202
1203/// Query result flags
Jesse Halld8bade02015-11-24 10:24:18 -08001204type VkFlags VkQueryResultFlags
1205bitfield VkQueryResultFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001206 VK_QUERY_RESULT_64_BIT = 0x00000001, /// Results of the queries are written to the destination buffer as 64-bit values
1207 VK_QUERY_RESULT_WAIT_BIT = 0x00000002, /// Results of the queries are waited on before proceeding with the result copy
1208 VK_QUERY_RESULT_WITH_AVAILABILITY_BIT = 0x00000004, /// Besides the results of the query, the availability of the results is also written
1209 VK_QUERY_RESULT_PARTIAL_BIT = 0x00000008, /// Copy the partial results of the query even if the final results aren't available
1210}
1211
1212/// Shader module creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001213type VkFlags VkShaderModuleCreateFlags
Jesse Halla6429252015-11-29 18:59:42 -08001214//bitfield VkShaderModuleCreateFlagBits {
1215//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001216
Jesse Halld27f6aa2015-08-15 17:58:48 -07001217/// Event creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001218type VkFlags VkEventCreateFlags
Jesse Halla6429252015-11-29 18:59:42 -08001219//bitfield VkEventCreateFlagBits {
1220//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001221
Jesse Halla15a4bf2015-11-19 22:48:02 -08001222/// Command buffer usage flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001223type VkFlags VkCommandBufferUsageFlags
1224bitfield VkCommandBufferUsageFlagBits {
1225 VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT = 0x00000001,
1226 VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT = 0x00000002,
1227 VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001228}
1229
1230/// Pipeline statistics flags
Jesse Halld8bade02015-11-24 10:24:18 -08001231type VkFlags VkQueryPipelineStatisticFlags
1232bitfield VkQueryPipelineStatisticFlagBits {
Jesse Hallae38f732015-11-19 21:32:50 -08001233 VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_BIT = 0x00000001, /// Optional
1234 VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_PRIMITIVES_BIT = 0x00000002, /// Optional
1235 VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT = 0x00000004, /// Optional
1236 VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_INVOCATIONS_BIT = 0x00000008, /// Optional
1237 VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT = 0x00000010, /// Optional
1238 VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT = 0x00000020, /// Optional
1239 VK_QUERY_PIPELINE_STATISTIC_CLIPPING_PRIMITIVES_BIT = 0x00000040, /// Optional
1240 VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT = 0x00000080, /// Optional
1241 VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT = 0x00000100, /// Optional
1242 VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT = 0x00000200, /// Optional
1243 VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT = 0x00000400, /// Optional
Jesse Halld27f6aa2015-08-15 17:58:48 -07001244}
1245
1246/// Memory mapping flags
Jesse Halld8bade02015-11-24 10:24:18 -08001247type VkFlags VkMemoryMapFlags
Jesse Halla6429252015-11-29 18:59:42 -08001248//bitfield VkMemoryMapFlagBits {
1249//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001250
1251/// Bitfield of image aspects
Jesse Halld8bade02015-11-24 10:24:18 -08001252type VkFlags VkImageAspectFlags
1253bitfield VkImageAspectFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001254 VK_IMAGE_ASPECT_COLOR_BIT = 0x00000001,
1255 VK_IMAGE_ASPECT_DEPTH_BIT = 0x00000002,
1256 VK_IMAGE_ASPECT_STENCIL_BIT = 0x00000004,
1257 VK_IMAGE_ASPECT_METADATA_BIT = 0x00000008,
1258}
1259
1260/// Sparse memory bind flags
Jesse Halld8bade02015-11-24 10:24:18 -08001261type VkFlags VkSparseMemoryBindFlags
Jesse Hall091ed9e2015-11-30 00:55:29 -08001262bitfield VkSparseMemoryBindFlagBits {
1263 VK_SPARSE_MEMORY_BIND_METADATA_BIT = 0x00000001,
1264}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001265
1266/// Sparse image memory requirements flags
Jesse Halld8bade02015-11-24 10:24:18 -08001267type VkFlags VkSparseImageFormatFlags
1268bitfield VkSparseImageFormatFlagBits {
Jesse Hallb00daad2015-11-29 19:46:20 -08001269 VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT = 0x00000001, /// Image uses a single miptail region for all array slices
1270 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.
1271 VK_SPARSE_IMAGE_FORMAT_NONSTANDARD_BLOCK_SIZE_BIT = 0x00000004, /// Image uses a non-standard sparse block size
Jesse Halld27f6aa2015-08-15 17:58:48 -07001272}
1273
1274/// Pipeline stages
Jesse Halld8bade02015-11-24 10:24:18 -08001275type VkFlags VkPipelineStageFlags
1276bitfield VkPipelineStageFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001277 VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT = 0x00000001, /// Before subsequent commands are processed
1278 VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT = 0x00000002, /// Draw/DispatchIndirect command fetch
1279 VK_PIPELINE_STAGE_VERTEX_INPUT_BIT = 0x00000004, /// Vertex/index fetch
1280 VK_PIPELINE_STAGE_VERTEX_SHADER_BIT = 0x00000008, /// Vertex shading
Jesse Hallae38f732015-11-19 21:32:50 -08001281 VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT = 0x00000010, /// Tessellation control shading
1282 VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT = 0x00000020, /// Tessellation evaluation shading
Jesse Halld27f6aa2015-08-15 17:58:48 -07001283 VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT = 0x00000040, /// Geometry shading
1284 VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT = 0x00000080, /// Fragment shading
1285 VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT = 0x00000100, /// Early fragment (depth/stencil) tests
1286 VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT = 0x00000200, /// Late fragment (depth/stencil) tests
1287 VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT = 0x00000400, /// Color attachment writes
1288 VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT = 0x00000800, /// Compute shading
1289 VK_PIPELINE_STAGE_TRANSFER_BIT = 0x00001000, /// Transfer/copy operations
Jesse Hall543a7ff2016-01-08 16:38:30 -08001290 VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT = 0x00002000,
1291 VK_PIPELINE_STAGE_HOST_BIT = 0x00004000, /// Indicates host (CPU) is a source/sink of the dependency
Jesse Halld27f6aa2015-08-15 17:58:48 -07001292
Jesse Hall543a7ff2016-01-08 16:38:30 -08001293 VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT = 0x00008000, /// All stages of the graphics pipeline
1294 VK_PIPELINE_STAGE_ALL_COMMANDS_BIT = 0x00010000, /// All graphics, compute, copy, and transition commands
Chris Forbes289cb792016-12-30 15:03:55 +13001295
1296 //@extension("VK_NVX_device_generated_commands")
1297 VK_PIPELINE_STAGE_COMMAND_PROCESS_BIT_NVX = 0x00020000,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001298}
1299
1300/// Render pass attachment description flags
Jesse Halld8bade02015-11-24 10:24:18 -08001301type VkFlags VkAttachmentDescriptionFlags
1302bitfield VkAttachmentDescriptionFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001303 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 -07001304}
1305
1306/// Subpass description flags
Jesse Halld8bade02015-11-24 10:24:18 -08001307type VkFlags VkSubpassDescriptionFlags
1308bitfield VkSubpassDescriptionFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001309}
1310
1311/// Command pool creation flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001312type VkFlags VkCommandPoolCreateFlags
1313bitfield VkCommandPoolCreateFlagBits {
1314 VK_COMMAND_POOL_CREATE_TRANSIENT_BIT = 0x00000001, /// Command buffers have a short lifetime
1315 VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT = 0x00000002, /// Command buffers may release their memory individually
Jesse Halld27f6aa2015-08-15 17:58:48 -07001316}
1317
1318/// Command pool reset flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001319type VkFlags VkCommandPoolResetFlags
1320bitfield VkCommandPoolResetFlagBits {
1321 VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT = 0x00000001, /// Release resources owned by the pool
Jesse Halld27f6aa2015-08-15 17:58:48 -07001322}
1323
Jesse Hall3fbc8562015-11-29 22:10:52 -08001324type VkFlags VkCommandBufferResetFlags
1325bitfield VkCommandBufferResetFlagBits {
1326 VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT = 0x00000001, /// Release resources owned by the buffer
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001327}
1328
Jesse Halld8bade02015-11-24 10:24:18 -08001329type VkFlags VkSampleCountFlags
1330bitfield VkSampleCountFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001331 VK_SAMPLE_COUNT_1_BIT = 0x00000001,
1332 VK_SAMPLE_COUNT_2_BIT = 0x00000002,
1333 VK_SAMPLE_COUNT_4_BIT = 0x00000004,
1334 VK_SAMPLE_COUNT_8_BIT = 0x00000008,
1335 VK_SAMPLE_COUNT_16_BIT = 0x00000010,
1336 VK_SAMPLE_COUNT_32_BIT = 0x00000020,
1337 VK_SAMPLE_COUNT_64_BIT = 0x00000040,
1338}
1339
Jesse Halld8bade02015-11-24 10:24:18 -08001340type VkFlags VkStencilFaceFlags
1341bitfield VkStencilFaceFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001342 VK_STENCIL_FACE_FRONT_BIT = 0x00000001, /// Front face
1343 VK_STENCIL_FACE_BACK_BIT = 0x00000002, /// Back face
Jesse Hallc7467b72015-11-29 21:05:26 -08001344 VK_STENCIL_FRONT_AND_BACK = 0x00000003,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001345}
1346
Jesse Halla6429252015-11-29 18:59:42 -08001347/// Instance creation flags
1348type VkFlags VkInstanceCreateFlags
1349//bitfield VkInstanceCreateFlagBits {
1350//}
1351
1352/// Device creation flags
1353type VkFlags VkDeviceCreateFlags
1354//bitfield VkDeviceCreateFlagBits {
1355//}
1356
1357/// Device queue creation flags
1358type VkFlags VkDeviceQueueCreateFlags
1359//bitfield VkDeviceQueueCreateFlagBits {
1360//}
1361
1362/// Query pool creation flags
1363type VkFlags VkQueryPoolCreateFlags
1364//bitfield VkQueryPoolCreateFlagBits {
1365//}
1366
1367/// Buffer view creation flags
1368type VkFlags VkBufferViewCreateFlags
1369//bitfield VkBufferViewCreateFlagBits {
1370//}
1371
1372/// Pipeline cache creation flags
1373type VkFlags VkPipelineCacheCreateFlags
1374//bitfield VkPipelineCacheCreateFlagBits {
1375//}
1376
1377/// Pipeline shader stage creation flags
1378type VkFlags VkPipelineShaderStageCreateFlags
1379//bitfield VkPipelineShaderStageCreateFlagBits {
1380//}
1381
1382/// Descriptor set layout creation flags
1383type VkFlags VkDescriptorSetLayoutCreateFlags
1384//bitfield VkDescriptorSetLayoutCreateFlagBits {
1385//}
1386
1387/// Pipeline vertex input state creation flags
1388type VkFlags VkPipelineVertexInputStateCreateFlags
1389//bitfield VkPipelineVertexInputStateCreateFlagBits {
1390//}
1391
1392/// Pipeline input assembly state creation flags
1393type VkFlags VkPipelineInputAssemblyStateCreateFlags
1394//bitfield VkPipelineInputAssemblyStateCreateFlagBits {
1395//}
1396
1397/// Tessellation state creation flags
1398type VkFlags VkPipelineTessellationStateCreateFlags
1399//bitfield VkPipelineTessellationStateCreateFlagBits {
1400//}
1401
1402/// Viewport state creation flags
1403type VkFlags VkPipelineViewportStateCreateFlags
1404//bitfield VkPipelineViewportStateCreateFlagBits {
1405//}
1406
Jesse Hall3fbc8562015-11-29 22:10:52 -08001407/// Rasterization state creation flags
1408type VkFlags VkPipelineRasterizationStateCreateFlags
1409//bitfield VkPipelineRasterizationStateCreateFlagBits {
Jesse Halla6429252015-11-29 18:59:42 -08001410//}
1411
1412/// Multisample state creation flags
1413type VkFlags VkPipelineMultisampleStateCreateFlags
1414//bitfield VkPipelineMultisampleStateCreateFlagBits {
1415//}
1416
1417/// Color blend state creation flags
1418type VkFlags VkPipelineColorBlendStateCreateFlags
1419//bitfield VkPipelineColorBlendStateCreateFlagBits {
1420//}
1421
1422/// Depth/stencil state creation flags
1423type VkFlags VkPipelineDepthStencilStateCreateFlags
1424//bitfield VkPipelineDepthStencilStateCreateFlagBits {
1425//}
1426
1427/// Dynamic state creation flags
1428type VkFlags VkPipelineDynamicStateCreateFlags
1429//bitfield VkPipelineDynamicStateCreateFlagBits {
1430//}
1431
1432/// Pipeline layout creation flags
1433type VkFlags VkPipelineLayoutCreateFlags
1434//bitfield VkPipelineLayoutCreateFlagBits {
1435//}
1436
1437/// Sampler creation flags
1438type VkFlags VkSamplerCreateFlags
1439//bitfield VkSamplerCreateFlagBits {
1440//}
1441
1442/// Render pass creation flags
1443type VkFlags VkRenderPassCreateFlags
1444//bitfield VkRenderPassCreateFlagBits {
1445//}
1446
1447/// Framebuffer creation flags
1448type VkFlags VkFramebufferCreateFlags
1449//bitfield VkFramebufferCreateFlagBits {
1450//}
1451
Jesse Halldc6d36c2015-11-29 19:12:15 -08001452/// Dependency flags
1453type VkFlags VkDependencyFlags
1454bitfield VkDependencyFlagBits {
1455 VK_DEPENDENCY_BY_REGION_BIT = 0x00000001,
1456}
1457
Jesse Hallc7467b72015-11-29 21:05:26 -08001458/// Cull mode flags
1459type VkFlags VkCullModeFlags
1460bitfield VkCullModeFlagBits {
1461 VK_CULL_MODE_NONE = 0x00000000,
1462 VK_CULL_MODE_FRONT_BIT = 0x00000001,
1463 VK_CULL_MODE_BACK_BIT = 0x00000002,
1464 VK_CULL_MODE_FRONT_AND_BACK = 0x00000003,
1465}
1466
Jesse Hall523db342015-11-30 21:12:55 -08001467@extension("VK_KHR_surface")
Jesse Halld8bade02015-11-24 10:24:18 -08001468type VkFlags VkSurfaceTransformFlagsKHR
Jesse Hall523db342015-11-30 21:12:55 -08001469@extension("VK_KHR_surface")
Jesse Halld8bade02015-11-24 10:24:18 -08001470bitfield VkSurfaceTransformFlagBitsKHR {
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001471 VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR = 0x00000001,
Jesse Hall9ba8bc82015-11-30 16:22:16 -08001472 VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR = 0x00000002,
1473 VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR = 0x00000004,
1474 VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR = 0x00000008,
1475 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR = 0x00000010,
1476 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR = 0x00000020,
1477 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR = 0x00000040,
1478 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR = 0x00000080,
1479 VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR = 0x00000100,
Michael Lentine88594d72015-11-12 12:49:45 -08001480}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001481
Jesse Hall523db342015-11-30 21:12:55 -08001482@extension("VK_KHR_surface")
Jesse Halla6429252015-11-29 18:59:42 -08001483type VkFlags VkCompositeAlphaFlagsKHR
Jesse Hall523db342015-11-30 21:12:55 -08001484@extension("VK_KHR_surface")
Jesse Halla6429252015-11-29 18:59:42 -08001485bitfield VkCompositeAlphaFlagBitsKHR {
1486 VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR = 0x00000001,
1487 VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR = 0x00000002,
1488 VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR = 0x00000004,
1489 VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR = 0x00000008,
1490}
1491
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001492@extension("VK_KHR_swapchain")
1493type VkFlags VkSwapchainCreateFlagsKHR
1494//@extension("VK_KHR_swapchain")
1495//bitfield VkSwapchainCreateFlagBitsKHR {
1496//}
1497
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001498@extension("VK_KHR_display")
Jesse Halld8bade02015-11-24 10:24:18 -08001499type VkFlags VkDisplayPlaneAlphaFlagsKHR
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001500@extension("VK_KHR_display")
Jesse Halld8bade02015-11-24 10:24:18 -08001501bitfield VkDisplayPlaneAlphaFlagBitsKHR {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001502 VK_DISPLAY_PLANE_ALPHA_OPAQUE_BIT_KHR = 0x00000001,
1503 VK_DISPLAY_PLANE_ALPHA_GLOBAL_BIT_KHR = 0x00000002,
1504 VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_BIT_KHR = 0x00000004,
1505 VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_PREMULTIPLIED_BIT_KHR = 0x00000008,
Jesse Hall1356b0d2015-11-23 17:24:58 -08001506}
1507
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001508@extension("VK_KHR_display")
1509type VkFlags VkDisplaySurfaceCreateFlagsKHR
1510//@extension("VK_KHR_display")
1511//bitfield VkDisplaySurfaceCreateFlagBitsKHR {
1512//}
1513
Jesse Hall9ba8bc82015-11-30 16:22:16 -08001514@extension("VK_KHR_display")
1515type VkFlags VkDisplayModeCreateFlagsKHR
1516//@extension("VK_KHR_display")
1517//bitfield VkDisplayModeCreateFlagBitsKHR {
1518//}
1519
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001520@extension("VK_KHR_xlib_surface")
1521type VkFlags VkXlibSurfaceCreateFlagsKHR
1522//@extension("VK_KHR_xlib_surface")
1523//bitfield VkXlibSurfaceCreateFlagBitsKHR {
1524//}
1525
1526@extension("VK_KHR_xcb_surface")
1527type VkFlags VkXcbSurfaceCreateFlagsKHR
1528//@extension("VK_KHR_xcb_surface")
1529//bitfield VkXcbSurfaceCreateFlagBitsKHR {
1530//}
1531
1532@extension("VK_KHR_wayland_surface")
1533type VkFlags VkWaylandSurfaceCreateFlagsKHR
1534//@extension("VK_KHR_wayland_surface")
1535//bitfield VkWaylandSurfaceCreateFlagBitsKHR {
1536//}
1537
1538@extension("VK_KHR_mir_surface")
1539type VkFlags VkMirSurfaceCreateFlagsKHR
1540//@extension("VK_KHR_mir_surface")
1541//bitfield VkMirSurfaceCreateFlagBitsKHR {
1542//}
1543
1544@extension("VK_KHR_android_surface")
1545type VkFlags VkAndroidSurfaceCreateFlagsKHR
1546//@extension("VK_KHR_android_surface")
1547//bitfield VkAndroidSurfaceCreateFlagBitsKHR {
1548//}
1549
1550@extension("VK_KHR_win32_surface")
1551type VkFlags VkWin32SurfaceCreateFlagsKHR
1552//@extension("VK_KHR_win32_surface")
1553//bitfield VkWin32SurfaceCreateFlagBitsKHR {
1554//}
1555
Jesse Hall715b86a2016-01-16 16:34:29 -08001556@extension("VK_EXT_debug_report")
1557type VkFlags VkDebugReportFlagsEXT
1558@extension("VK_EXT_debug_report")
1559bitfield VkDebugReportFlagBitsEXT {
Jesse Halle2948d82016-02-25 04:19:32 -08001560 VK_DEBUG_REPORT_INFORMATION_BIT_EXT = 0x00000001,
1561 VK_DEBUG_REPORT_WARNING_BIT_EXT = 0x00000002,
1562 VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT = 0x00000004,
Jesse Hall715b86a2016-01-16 16:34:29 -08001563 VK_DEBUG_REPORT_ERROR_BIT_EXT = 0x00000008,
1564 VK_DEBUG_REPORT_DEBUG_BIT_EXT = 0x00000010,
1565}
1566
Chris Forbes8e4438b2016-12-07 16:26:49 +13001567@extension("VK_ANDROID_native_buffer")
1568type VkFlags VkSwapchainImageUsageFlagsANDROID
1569@extension("VK_ANDROID_native_buffer")
1570bitfield VkSwapchainImageUsageFlagBitsANDROID {
1571 VK_SWAPCHAIN_IMAGE_USAGE_FLAGS_FRONT_BUFFER_BIT_ANDROID = 0x00000001,
1572}
1573
Chris Forbes289cb792016-12-30 15:03:55 +13001574@extension("VK_NV_external_memory_capabilities")
1575type VkFlags VkExternalMemoryHandleTypeFlagsNV
1576@extension("VK_NV_external_memory_capabilities")
1577bitfield VkExternalMemoryHandleTypeFlagBitsNV {
1578 VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_NV = 0x00000001,
1579 VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_NV = 0x00000002,
1580 VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_IMAGE_BIT_NV = 0x00000004,
1581 VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_IMAGE_KMT_BIT_NV = 0x00000008,
1582}
1583
1584@extension("VK_NV_external_memory_capabilities")
1585type VkFlags VkExternalMemoryFeatureFlagsNV
1586@extension("VK_NV_external_memory_capabilities")
1587bitfield VkExternalMemoryFeatureFlagBitsNV {
1588 VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT_NV = 0x00000001,
1589 VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT_NV = 0x00000002,
1590 VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT_NV = 0x00000004,
1591}
1592
1593@extension("VK_NVX_device_generated_commands")
1594type VkFlags VkIndirectCommandsLayoutUsageFlagsNVX
1595@extension("VK_NVX_device_generated_commands")
1596bitfield VkIndirectCommandsLayoutUsageFlagBitsNVX {
1597 VK_INDIRECT_COMMANDS_LAYOUT_USAGE_UNORDERED_SEQUENCES_BIT_NVX = 0x00000001,
1598 VK_INDIRECT_COMMANDS_LAYOUT_USAGE_SPARSE_SEQUENCES_BIT_NVX = 0x00000002,
1599 VK_INDIRECT_COMMANDS_LAYOUT_USAGE_EMPTY_EXECUTIONS_BIT_NVX = 0x00000004,
1600 VK_INDIRECT_COMMANDS_LAYOUT_USAGE_INDEXED_SEQUENCES_BIT_NVX = 0x00000008,
1601}
1602
1603@extension("VK_NVX_device_generated_commands")
1604type VkFlags VkObjectEntryUsageFlagsNVX
1605@extension("VK_NVX_device_generated_commands")
1606bitfield VkObjectEntryUsageFlagBitsNVX {
1607 VK_OBJECT_ENTRY_USAGE_GRAPHICS_BIT_NVX = 0x00000001,
1608 VK_OBJECT_ENTRY_USAGE_COMPUTE_BIT_NVX = 0x00000002,
1609}
1610
Jesse Hall1356b0d2015-11-23 17:24:58 -08001611
Jesse Halld27f6aa2015-08-15 17:58:48 -07001612//////////////////
1613// Structures //
1614//////////////////
1615
1616class VkOffset2D {
1617 s32 x
1618 s32 y
1619}
1620
1621class VkOffset3D {
1622 s32 x
1623 s32 y
1624 s32 z
1625}
1626
1627class VkExtent2D {
Jesse Hall3dd678a2016-01-08 21:52:01 -08001628 u32 width
1629 u32 height
Jesse Halld27f6aa2015-08-15 17:58:48 -07001630}
1631
1632class VkExtent3D {
Jesse Hall3dd678a2016-01-08 21:52:01 -08001633 u32 width
1634 u32 height
1635 u32 depth
Jesse Halld27f6aa2015-08-15 17:58:48 -07001636}
1637
1638class VkViewport {
Jesse Hall65ab5522015-11-30 00:07:16 -08001639 f32 x
1640 f32 y
Jesse Halld27f6aa2015-08-15 17:58:48 -07001641 f32 width
1642 f32 height
1643 f32 minDepth
1644 f32 maxDepth
1645}
1646
1647class VkRect2D {
1648 VkOffset2D offset
1649 VkExtent2D extent
1650}
1651
Jesse Halla15a4bf2015-11-19 22:48:02 -08001652class VkClearRect {
1653 VkRect2D rect
1654 u32 baseArrayLayer
Jesse Hall3fbc8562015-11-29 22:10:52 -08001655 u32 layerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001656}
1657
Jesse Hall65ab5522015-11-30 00:07:16 -08001658class VkComponentMapping {
1659 VkComponentSwizzle r
1660 VkComponentSwizzle g
1661 VkComponentSwizzle b
1662 VkComponentSwizzle a
Jesse Halld27f6aa2015-08-15 17:58:48 -07001663}
1664
1665class VkPhysicalDeviceProperties {
1666 u32 apiVersion
1667 u32 driverVersion
Jesse Hall65ab5522015-11-30 00:07:16 -08001668 u32 vendorID
1669 u32 deviceID
Jesse Halld27f6aa2015-08-15 17:58:48 -07001670 VkPhysicalDeviceType deviceType
Jesse Hall65ab5522015-11-30 00:07:16 -08001671 char[VK_MAX_PHYSICAL_DEVICE_NAME_SIZE] deviceName
1672 u8[VK_UUID_SIZE] pipelineCacheUUID
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001673 VkPhysicalDeviceLimits limits
1674 VkPhysicalDeviceSparseProperties sparseProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07001675}
1676
1677class VkExtensionProperties {
Jesse Hall65ab5522015-11-30 00:07:16 -08001678 char[VK_MAX_EXTENSION_NAME_SIZE] extensionName /// extension name
Jesse Halld27f6aa2015-08-15 17:58:48 -07001679 u32 specVersion /// version of the extension specification implemented
1680}
1681
1682class VkLayerProperties {
Jesse Hall65ab5522015-11-30 00:07:16 -08001683 char[VK_MAX_EXTENSION_NAME_SIZE] layerName /// layer name
Jesse Hall3fbc8562015-11-29 22:10:52 -08001684 u32 specVersion /// version of the layer specification implemented
1685 u32 implementationVersion /// build or release version of the layer's library
Jesse Hall65ab5522015-11-30 00:07:16 -08001686 char[VK_MAX_DESCRIPTION_SIZE] description /// Free-form description of the layer
Jesse Halld27f6aa2015-08-15 17:58:48 -07001687}
1688
Jesse Halla366a512015-11-19 22:30:07 -08001689class VkSubmitInfo {
Jesse Hall03b6fe12015-11-24 12:44:21 -08001690 VkStructureType sType /// Type of structure. Should be VK_STRUCTURE_TYPE_SUBMIT_INFO
1691 const void* pNext /// Next structure in chain
1692 u32 waitSemaphoreCount
Jesse Halla366a512015-11-19 22:30:07 -08001693 const VkSemaphore* pWaitSemaphores
Jesse Hall543a7ff2016-01-08 16:38:30 -08001694 const VkPipelineStageFlags* pWaitDstStageMask
Jesse Hall03b6fe12015-11-24 12:44:21 -08001695 u32 commandBufferCount
Jesse Hall3fbc8562015-11-29 22:10:52 -08001696 const VkCommandBuffer* pCommandBuffers
Jesse Hall03b6fe12015-11-24 12:44:21 -08001697 u32 signalSemaphoreCount
Jesse Halla366a512015-11-19 22:30:07 -08001698 const VkSemaphore* pSignalSemaphores
1699}
1700
Jesse Halld27f6aa2015-08-15 17:58:48 -07001701class VkApplicationInfo {
1702 VkStructureType sType /// Type of structure. Should be VK_STRUCTURE_TYPE_APPLICATION_INFO
1703 const void* pNext /// Next structure in chain
Jesse Hall3fbc8562015-11-29 22:10:52 -08001704 const char* pApplicationName
1705 u32 applicationVersion
Jesse Halld27f6aa2015-08-15 17:58:48 -07001706 const char* pEngineName
1707 u32 engineVersion
1708 u32 apiVersion
1709}
1710
Jesse Hall3fbc8562015-11-29 22:10:52 -08001711class VkAllocationCallbacks {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001712 void* pUserData
Jesse Hall3fbc8562015-11-29 22:10:52 -08001713 PFN_vkAllocationFunction pfnAllocation
1714 PFN_vkReallocationFunction pfnReallocation
Jesse Halld27f6aa2015-08-15 17:58:48 -07001715 PFN_vkFreeFunction pfnFree
Jesse Hall3fbc8562015-11-29 22:10:52 -08001716 PFN_vkInternalAllocationNotification pfnInternalAllocation
Jesse Hall03b6fe12015-11-24 12:44:21 -08001717 PFN_vkInternalFreeNotification pfnInternalFree
Jesse Halld27f6aa2015-08-15 17:58:48 -07001718}
1719
1720class VkDeviceQueueCreateInfo {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001721 VkStructureType sStype /// Should be VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO
1722 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001723 VkDeviceQueueCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001724 u32 queueFamilyIndex
Jesse Halldba27f72015-11-30 14:25:46 -08001725 u32 queueCount
Jesse Hallfbf97b02015-11-20 14:17:03 -08001726 const f32* pQueuePriorities
Jesse Halld27f6aa2015-08-15 17:58:48 -07001727}
1728
1729class VkDeviceCreateInfo {
1730 VkStructureType sType /// Should be VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO
1731 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001732 VkDeviceCreateFlags flags
Jesse Halldba27f72015-11-30 14:25:46 -08001733 u32 queueCreateInfoCount
1734 const VkDeviceQueueCreateInfo* pQueueCreateInfos
Jesse Hall3dd678a2016-01-08 21:52:01 -08001735 u32 enabledLayerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001736 const char* const* ppEnabledLayerNames /// Ordered list of layer names to be enabled
Jesse Hall3dd678a2016-01-08 21:52:01 -08001737 u32 enabledExtensionCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001738 const char* const* ppEnabledExtensionNames
1739 const VkPhysicalDeviceFeatures* pEnabledFeatures
Jesse Halld27f6aa2015-08-15 17:58:48 -07001740}
1741
1742class VkInstanceCreateInfo {
1743 VkStructureType sType /// Should be VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO
1744 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001745 VkInstanceCreateFlags flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001746 const VkApplicationInfo* pApplicationInfo
Jesse Hall3dd678a2016-01-08 21:52:01 -08001747 u32 enabledLayerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001748 const char* const* ppEnabledLayerNames /// Ordered list of layer names to be enabled
Jesse Hall3dd678a2016-01-08 21:52:01 -08001749 u32 enabledExtensionCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001750 const char* const* ppEnabledExtensionNames /// Extension names to be enabled
1751}
1752
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001753class VkQueueFamilyProperties {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001754 VkQueueFlags queueFlags /// Queue flags
1755 u32 queueCount
Jesse Hallacfa5342015-11-19 21:51:33 -08001756 u32 timestampValidBits
Jesse Hall65ab5522015-11-30 00:07:16 -08001757 VkExtent3D minImageTransferGranularity
Jesse Halld27f6aa2015-08-15 17:58:48 -07001758}
1759
1760class VkPhysicalDeviceMemoryProperties {
1761 u32 memoryTypeCount
1762 VkMemoryType[VK_MAX_MEMORY_TYPES] memoryTypes
1763 u32 memoryHeapCount
1764 VkMemoryHeap[VK_MAX_MEMORY_HEAPS] memoryHeaps
1765}
1766
Jesse Hall3fbc8562015-11-29 22:10:52 -08001767class VkMemoryAllocateInfo {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001768 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07001769 const void* pNext /// Pointer to next structure
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001770 VkDeviceSize allocationSize /// Size of memory allocation
Jesse Halld27f6aa2015-08-15 17:58:48 -07001771 u32 memoryTypeIndex /// Index of the of the memory type to allocate from
1772}
1773
1774class VkMemoryRequirements {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001775 VkDeviceSize size /// Specified in bytes
1776 VkDeviceSize alignment /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001777 u32 memoryTypeBits /// Bitfield of the allowed memory type indices into memoryTypes[] for this object
1778}
1779
1780class VkSparseImageFormatProperties {
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001781 VkImageAspectFlagBits aspectMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001782 VkExtent3D imageGranularity
1783 VkSparseImageFormatFlags flags
1784}
1785
1786class VkSparseImageMemoryRequirements {
Jesse Hallb00daad2015-11-29 19:46:20 -08001787 VkSparseImageFormatProperties formatProperties
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001788 u32 imageMipTailFirstLod
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001789 VkDeviceSize imageMipTailSize /// Specified in bytes, must be a multiple of image block size / alignment
1790 VkDeviceSize imageMipTailOffset /// Specified in bytes, must be a multiple of image block size / alignment
1791 VkDeviceSize imageMipTailStride /// Specified in bytes, must be a multiple of image block size / alignment
Jesse Halld27f6aa2015-08-15 17:58:48 -07001792}
1793
1794class VkMemoryType {
1795 VkMemoryPropertyFlags propertyFlags /// Memory properties of this memory type
1796 u32 heapIndex /// Index of the memory heap allocations of this memory type are taken from
1797}
1798
1799class VkMemoryHeap {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001800 VkDeviceSize size /// Available memory in the heap
Jesse Halld27f6aa2015-08-15 17:58:48 -07001801 VkMemoryHeapFlags flags /// Flags for the heap
1802}
1803
1804class VkMappedMemoryRange {
1805 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE
1806 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08001807 VkDeviceMemory memory /// Mapped memory object
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001808 VkDeviceSize offset /// Offset within the mapped memory the range starts from
1809 VkDeviceSize size /// Size of the range within the mapped memory
Jesse Halld27f6aa2015-08-15 17:58:48 -07001810}
1811
1812class VkFormatProperties {
1813 VkFormatFeatureFlags linearTilingFeatures /// Format features in case of linear tiling
1814 VkFormatFeatureFlags optimalTilingFeatures /// Format features in case of optimal tiling
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001815 VkFormatFeatureFlags bufferFeatures /// Format features supported by buffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07001816}
1817
1818class VkImageFormatProperties {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001819 VkExtent3D maxExtent /// max image dimensions for this resource type
1820 u32 maxMipLevels /// max number of mipmap levels for this resource type
Jesse Halla15a4bf2015-11-19 22:48:02 -08001821 u32 maxArrayLayers /// max array layers for this resource type
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001822 VkSampleCountFlags sampleCounts /// supported sample counts for this resource type
1823 VkDeviceSize maxResourceSize /// max size (in bytes) of this resource type
1824}
1825
Jesse Halla15a4bf2015-11-19 22:48:02 -08001826class VkDescriptorImageInfo {
1827 VkSampler sampler
1828 VkImageView imageView
1829 VkImageLayout imageLayout
1830}
1831
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001832class VkDescriptorBufferInfo {
1833 VkBuffer buffer /// Buffer used for this descriptor when the descriptor is UNIFORM_BUFFER[_DYNAMIC]
1834 VkDeviceSize offset /// Base offset from buffer start in bytes to update in the descriptor set.
1835 VkDeviceSize range /// Size in bytes of the buffer resource for this descriptor update.
Jesse Halld27f6aa2015-08-15 17:58:48 -07001836}
1837
Jesse Halld27f6aa2015-08-15 17:58:48 -07001838class VkWriteDescriptorSet {
1839 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET
1840 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08001841 VkDescriptorSet dstSet /// Destination descriptor set
1842 u32 dstBinding /// Binding within the destination descriptor set to write
1843 u32 dstArrayElement /// Array element within the destination binding to write
Jesse Hall03b6fe12015-11-24 12:44:21 -08001844 u32 descriptorCount /// Number of descriptors to write (determines the size of the array pointed by <pDescriptors>)
Jesse Halld27f6aa2015-08-15 17:58:48 -07001845 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 -08001846 const VkDescriptorImageInfo* pImageInfo
1847 const VkDescriptorBufferInfo* pBufferInfo
1848 const VkBufferView* pTexelBufferView
Jesse Halld27f6aa2015-08-15 17:58:48 -07001849}
1850
1851class VkCopyDescriptorSet {
1852 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET
1853 const void* pNext /// Pointer to next structure
1854 VkDescriptorSet srcSet /// Source descriptor set
1855 u32 srcBinding /// Binding within the source descriptor set to copy from
1856 u32 srcArrayElement /// Array element within the source binding to copy from
Jesse Hall3fbc8562015-11-29 22:10:52 -08001857 VkDescriptorSet dstSet /// Destination descriptor set
1858 u32 dstBinding /// Binding within the destination descriptor set to copy to
1859 u32 dstArrayElement /// Array element within the destination binding to copy to
Jesse Hall03b6fe12015-11-24 12:44:21 -08001860 u32 descriptorCount /// Number of descriptors to copy
Jesse Halld27f6aa2015-08-15 17:58:48 -07001861}
1862
1863class VkBufferCreateInfo {
1864 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO
1865 const void* pNext /// Pointer to next structure.
Jesse Halla6429252015-11-29 18:59:42 -08001866 VkBufferCreateFlags flags /// Buffer creation flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001867 VkDeviceSize size /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001868 VkBufferUsageFlags usage /// Buffer usage flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001869 VkSharingMode sharingMode
Jesse Hall03b6fe12015-11-24 12:44:21 -08001870 u32 queueFamilyIndexCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001871 const u32* pQueueFamilyIndices
1872}
1873
1874class VkBufferViewCreateInfo {
1875 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO
1876 const void* pNext /// Pointer to next structure.
Jesse Halla6429252015-11-29 18:59:42 -08001877 VkBufferViewCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001878 VkBuffer buffer
Jesse Halld27f6aa2015-08-15 17:58:48 -07001879 VkFormat format /// Optionally specifies format of elements
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001880 VkDeviceSize offset /// Specified in bytes
1881 VkDeviceSize range /// View size specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001882}
1883
1884class VkImageSubresource {
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001885 VkImageAspectFlagBits aspectMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001886 u32 mipLevel
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001887 u32 arrayLayer
Jesse Halld27f6aa2015-08-15 17:58:48 -07001888}
1889
1890class VkImageSubresourceRange {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001891 VkImageAspectFlags aspectMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001892 u32 baseMipLevel
Jesse Hall3fbc8562015-11-29 22:10:52 -08001893 u32 levelCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001894 u32 baseArrayLayer
Jesse Hall3fbc8562015-11-29 22:10:52 -08001895 u32 layerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001896}
1897
1898class VkMemoryBarrier {
1899 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MEMORY_BARRIER
1900 const void* pNext /// Pointer to next structure.
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001901 VkAccessFlags srcAccessMask
1902 VkAccessFlags dstAccessMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001903}
1904
1905class VkBufferMemoryBarrier {
1906 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER
1907 const void* pNext /// Pointer to next structure.
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001908 VkAccessFlags srcAccessMask
1909 VkAccessFlags dstAccessMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001910 u32 srcQueueFamilyIndex /// Queue family to transition ownership from
Jesse Hall3fbc8562015-11-29 22:10:52 -08001911 u32 dstQueueFamilyIndex /// Queue family to transition ownership to
Jesse Halld27f6aa2015-08-15 17:58:48 -07001912 VkBuffer buffer /// Buffer to sync
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001913 VkDeviceSize offset /// Offset within the buffer to sync
1914 VkDeviceSize size /// Amount of bytes to sync
Jesse Halld27f6aa2015-08-15 17:58:48 -07001915}
1916
1917class VkImageMemoryBarrier {
1918 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER
1919 const void* pNext /// Pointer to next structure.
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001920 VkAccessFlags srcAccessMask
1921 VkAccessFlags dstAccessMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001922 VkImageLayout oldLayout /// Current layout of the image
1923 VkImageLayout newLayout /// New layout to transition the image to
1924 u32 srcQueueFamilyIndex /// Queue family to transition ownership from
Jesse Hall3fbc8562015-11-29 22:10:52 -08001925 u32 dstQueueFamilyIndex /// Queue family to transition ownership to
Jesse Halld27f6aa2015-08-15 17:58:48 -07001926 VkImage image /// Image to sync
1927 VkImageSubresourceRange subresourceRange /// Subresource range to sync
1928}
1929
1930class VkImageCreateInfo {
1931 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO
1932 const void* pNext /// Pointer to next structure.
Jesse Halla6429252015-11-29 18:59:42 -08001933 VkImageCreateFlags flags /// Image creation flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001934 VkImageType imageType
1935 VkFormat format
1936 VkExtent3D extent
1937 u32 mipLevels
Jesse Halla15a4bf2015-11-19 22:48:02 -08001938 u32 arrayLayers
Jesse Hall091ed9e2015-11-30 00:55:29 -08001939 VkSampleCountFlagBits samples
Jesse Halld27f6aa2015-08-15 17:58:48 -07001940 VkImageTiling tiling
1941 VkImageUsageFlags usage /// Image usage flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001942 VkSharingMode sharingMode /// Cross-queue-family sharing mode
Jesse Hall03b6fe12015-11-24 12:44:21 -08001943 u32 queueFamilyIndexCount /// Number of queue families to share across
Jesse Halld27f6aa2015-08-15 17:58:48 -07001944 const u32* pQueueFamilyIndices /// Array of queue family indices to share across
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001945 VkImageLayout initialLayout /// Initial image layout for all subresources
Jesse Halld27f6aa2015-08-15 17:58:48 -07001946}
1947
1948class VkSubresourceLayout {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001949 VkDeviceSize offset /// Specified in bytes
1950 VkDeviceSize size /// Specified in bytes
1951 VkDeviceSize rowPitch /// Specified in bytes
Jesse Hall543a7ff2016-01-08 16:38:30 -08001952 VkDeviceSize arrayPitch /// Specified in bytes
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001953 VkDeviceSize depthPitch /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001954}
1955
1956class VkImageViewCreateInfo {
1957 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO
1958 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001959 VkImageViewCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001960 VkImage image
1961 VkImageViewType viewType
1962 VkFormat format
Jesse Hall65ab5522015-11-30 00:07:16 -08001963 VkComponentMapping components
Jesse Halld27f6aa2015-08-15 17:58:48 -07001964 VkImageSubresourceRange subresourceRange
Jesse Halld27f6aa2015-08-15 17:58:48 -07001965}
1966
1967class VkBufferCopy {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001968 VkDeviceSize srcOffset /// Specified in bytes
Jesse Hall3fbc8562015-11-29 22:10:52 -08001969 VkDeviceSize dstOffset /// Specified in bytes
Jesse Hallb00daad2015-11-29 19:46:20 -08001970 VkDeviceSize size /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001971}
1972
Jesse Halla6429252015-11-29 18:59:42 -08001973class VkSparseMemoryBind {
Jesse Hallb00daad2015-11-29 19:46:20 -08001974 VkDeviceSize resourceOffset /// Specified in bytes
1975 VkDeviceSize size /// Specified in bytes
Jesse Hall3fbc8562015-11-29 22:10:52 -08001976 VkDeviceMemory memory
1977 VkDeviceSize memoryOffset /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001978 VkSparseMemoryBindFlags flags
1979}
1980
Jesse Halla6429252015-11-29 18:59:42 -08001981class VkSparseImageMemoryBind {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001982 VkImageSubresource subresource
1983 VkOffset3D offset
1984 VkExtent3D extent
Jesse Hall3fbc8562015-11-29 22:10:52 -08001985 VkDeviceMemory memory
1986 VkDeviceSize memoryOffset /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001987 VkSparseMemoryBindFlags flags
1988}
1989
Jesse Halla6429252015-11-29 18:59:42 -08001990class VkSparseBufferMemoryBindInfo {
1991 VkBuffer buffer
1992 u32 bindCount
1993 const VkSparseMemoryBind* pBinds
1994}
1995
1996class VkSparseImageOpaqueMemoryBindInfo {
1997 VkImage image
1998 u32 bindCount
1999 const VkSparseMemoryBind* pBinds
2000}
2001
2002class VkSparseImageMemoryBindInfo {
2003 VkImage image
2004 u32 bindCount
2005 const VkSparseMemoryBind* pBinds
2006}
2007
2008class VkBindSparseInfo {
2009 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BIND_SPARSE_INFO
2010 const void* pNext
2011 u32 waitSemaphoreCount
2012 const VkSemaphore* pWaitSemaphores
2013 u32 numBufferBinds
2014 const VkSparseBufferMemoryBindInfo* pBufferBinds
2015 u32 numImageOpaqueBinds
2016 const VkSparseImageOpaqueMemoryBindInfo* pImageOpaqueBinds
2017 u32 numImageBinds
2018 const VkSparseImageMemoryBindInfo* pImageBinds
2019 u32 signalSemaphoreCount
2020 const VkSemaphore* pSignalSemaphores
2021}
2022
Jesse Hall65ab5522015-11-30 00:07:16 -08002023class VkImageSubresourceLayers {
2024 VkImageAspectFlags aspectMask
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002025 u32 mipLevel
Jesse Halla15a4bf2015-11-19 22:48:02 -08002026 u32 baseArrayLayer
Jesse Hall3fbc8562015-11-29 22:10:52 -08002027 u32 layerCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002028}
2029
Jesse Halld27f6aa2015-08-15 17:58:48 -07002030class VkImageCopy {
Jesse Hall65ab5522015-11-30 00:07:16 -08002031 VkImageSubresourceLayers srcSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07002032 VkOffset3D srcOffset /// Specified in pixels for both compressed and uncompressed images
Jesse Hall65ab5522015-11-30 00:07:16 -08002033 VkImageSubresourceLayers dstSubresource
Jesse Hall3fbc8562015-11-29 22:10:52 -08002034 VkOffset3D dstOffset /// Specified in pixels for both compressed and uncompressed images
Jesse Halld27f6aa2015-08-15 17:58:48 -07002035 VkExtent3D extent /// Specified in pixels for both compressed and uncompressed images
2036}
2037
2038class VkImageBlit {
Jesse Hall65ab5522015-11-30 00:07:16 -08002039 VkImageSubresourceLayers srcSubresource
Jesse Hall3dd678a2016-01-08 21:52:01 -08002040 VkOffset3D[2] srcOffsets
Jesse Hall65ab5522015-11-30 00:07:16 -08002041 VkImageSubresourceLayers dstSubresource
Jesse Hall3dd678a2016-01-08 21:52:01 -08002042 VkOffset3D[2] dstOffsets
Jesse Halld27f6aa2015-08-15 17:58:48 -07002043}
2044
2045class VkBufferImageCopy {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002046 VkDeviceSize bufferOffset /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002047 u32 bufferRowLength /// Specified in texels
2048 u32 bufferImageHeight
Jesse Hall65ab5522015-11-30 00:07:16 -08002049 VkImageSubresourceLayers imageSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07002050 VkOffset3D imageOffset /// Specified in pixels for both compressed and uncompressed images
2051 VkExtent3D imageExtent /// Specified in pixels for both compressed and uncompressed images
2052}
2053
2054class VkImageResolve {
Jesse Hall65ab5522015-11-30 00:07:16 -08002055 VkImageSubresourceLayers srcSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07002056 VkOffset3D srcOffset
Jesse Hall65ab5522015-11-30 00:07:16 -08002057 VkImageSubresourceLayers dstSubresource
Jesse Hall3fbc8562015-11-29 22:10:52 -08002058 VkOffset3D dstOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07002059 VkExtent3D extent
2060}
2061
2062class VkShaderModuleCreateInfo {
2063 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO
2064 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002065 VkShaderModuleCreateFlags flags /// Reserved
Jesse Halld27f6aa2015-08-15 17:58:48 -07002066 platform.size_t codeSize /// Specified in bytes
Jesse Halla9bb62b2015-11-21 19:31:56 -08002067 const u32* pCode /// Binary code of size codeSize
Jesse Halld27f6aa2015-08-15 17:58:48 -07002068}
2069
Jesse Halld27f6aa2015-08-15 17:58:48 -07002070class VkDescriptorSetLayoutBinding {
Jesse Hall091ed9e2015-11-30 00:55:29 -08002071 u32 binding
Jesse Halld27f6aa2015-08-15 17:58:48 -07002072 VkDescriptorType descriptorType /// Type of the descriptors in this binding
Jesse Halldba27f72015-11-30 14:25:46 -08002073 u32 descriptorCount /// Number of descriptors in this binding
Jesse Halld27f6aa2015-08-15 17:58:48 -07002074 VkShaderStageFlags stageFlags /// Shader stages this binding is visible to
2075 const VkSampler* pImmutableSamplers /// Immutable samplers (used if descriptor type is SAMPLER or COMBINED_IMAGE_SAMPLER, is either NULL or contains <count> number of elements)
2076}
2077
2078class VkDescriptorSetLayoutCreateInfo {
2079 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO
2080 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002081 VkDescriptorSetLayoutCreateFlags flags
Jesse Hall03b6fe12015-11-24 12:44:21 -08002082 u32 bindingCount /// Number of bindings in the descriptor set layout
Jesse Hall543a7ff2016-01-08 16:38:30 -08002083 const VkDescriptorSetLayoutBinding* pBindings /// Array of descriptor set layout bindings
Jesse Halld27f6aa2015-08-15 17:58:48 -07002084}
2085
Jesse Hall65ab5522015-11-30 00:07:16 -08002086class VkDescriptorPoolSize {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002087 VkDescriptorType type
Jesse Hall03b6fe12015-11-24 12:44:21 -08002088 u32 descriptorCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002089}
2090
2091class VkDescriptorPoolCreateInfo {
2092 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO
2093 const void* pNext /// Pointer to next structure
Jesse Hallfbf97b02015-11-20 14:17:03 -08002094 VkDescriptorPoolCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002095 u32 maxSets
Jesse Hall65ab5522015-11-30 00:07:16 -08002096 u32 poolSizeCount
2097 const VkDescriptorPoolSize* pPoolSizes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002098}
2099
Jesse Hall3fbc8562015-11-29 22:10:52 -08002100class VkDescriptorSetAllocateInfo {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002101 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO
Jesse Hallfbf97b02015-11-20 14:17:03 -08002102 const void* pNext /// Pointer to next structure
2103 VkDescriptorPool descriptorPool
Jesse Hall03b6fe12015-11-24 12:44:21 -08002104 u32 setCount
Jesse Hallfbf97b02015-11-20 14:17:03 -08002105 const VkDescriptorSetLayout* pSetLayouts
2106}
2107
Jesse Halld27f6aa2015-08-15 17:58:48 -07002108class VkSpecializationMapEntry {
Jesse Hall65ab5522015-11-30 00:07:16 -08002109 u32 constantID /// The SpecConstant ID specified in the BIL
Jesse Halld27f6aa2015-08-15 17:58:48 -07002110 u32 offset /// Offset of the value in the data block
Jesse Hallb00daad2015-11-29 19:46:20 -08002111 platform.size_t size /// Size in bytes of the SpecConstant
Jesse Halld27f6aa2015-08-15 17:58:48 -07002112}
2113
2114class VkSpecializationInfo {
2115 u32 mapEntryCount /// Number of entries in the map
Jesse Hallb00daad2015-11-29 19:46:20 -08002116 const VkSpecializationMapEntry* pMapEntries /// Array of map entries
Jesse Halld27f6aa2015-08-15 17:58:48 -07002117 platform.size_t dataSize /// Size in bytes of pData
2118 const void* pData /// Pointer to SpecConstant data
2119}
2120
2121class VkPipelineShaderStageCreateInfo {
2122 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO
2123 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002124 VkPipelineShaderStageCreateFlags flags
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002125 VkShaderStageFlagBits stage
2126 VkShaderModule module
2127 const char* pName
Jesse Halld27f6aa2015-08-15 17:58:48 -07002128 const VkSpecializationInfo* pSpecializationInfo
2129}
2130
2131class VkComputePipelineCreateInfo {
2132 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO
2133 const void* pNext /// Pointer to next structure
Jesse Halld27f6aa2015-08-15 17:58:48 -07002134 VkPipelineCreateFlags flags /// Pipeline creation flags
Jesse Halla6429252015-11-29 18:59:42 -08002135 VkPipelineShaderStageCreateInfo stage
Jesse Halld27f6aa2015-08-15 17:58:48 -07002136 VkPipelineLayout layout /// Interface layout of the pipeline
2137 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
2138 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
2139}
2140
2141class VkVertexInputBindingDescription {
Jesse Hallb00daad2015-11-29 19:46:20 -08002142 u32 binding /// Vertex buffer binding id
2143 u32 stride /// Distance between vertices in bytes (0 = no advancement)
Jesse Hall65ab5522015-11-30 00:07:16 -08002144 VkVertexInputRate inputRate /// Rate at which binding is incremented
Jesse Halld27f6aa2015-08-15 17:58:48 -07002145}
2146
2147class VkVertexInputAttributeDescription {
Jesse Hallb00daad2015-11-29 19:46:20 -08002148 u32 location /// location of the shader vertex attrib
2149 u32 binding /// Vertex buffer binding id
2150 VkFormat format /// format of source data
2151 u32 offset /// Offset of first element in bytes from base of vertex
Jesse Halld27f6aa2015-08-15 17:58:48 -07002152}
2153
2154class VkPipelineVertexInputStateCreateInfo {
Jesse Hall03b6fe12015-11-24 12:44:21 -08002155 VkStructureType sType /// Should be VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO
2156 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002157 VkPipelineVertexInputStateCreateFlags flags
Jesse Hall03b6fe12015-11-24 12:44:21 -08002158 u32 vertexBindingDescriptionCount /// number of bindings
Jesse Halld27f6aa2015-08-15 17:58:48 -07002159 const VkVertexInputBindingDescription* pVertexBindingDescriptions
Jesse Hall03b6fe12015-11-24 12:44:21 -08002160 u32 vertexAttributeDescriptionCount /// number of attributes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002161 const VkVertexInputAttributeDescription* pVertexAttributeDescriptions
2162}
2163
2164class VkPipelineInputAssemblyStateCreateInfo {
2165 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO
2166 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002167 VkPipelineInputAssemblyStateCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002168 VkPrimitiveTopology topology
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002169 VkBool32 primitiveRestartEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002170}
2171
2172class VkPipelineTessellationStateCreateInfo {
2173 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO
2174 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002175 VkPipelineTessellationStateCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002176 u32 patchControlPoints
2177}
2178
2179class VkPipelineViewportStateCreateInfo {
2180 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO
2181 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002182 VkPipelineViewportStateCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002183 u32 viewportCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002184 const VkViewport* pViewports
2185 u32 scissorCount
2186 const VkRect2D* pScissors
Jesse Halld27f6aa2015-08-15 17:58:48 -07002187}
2188
Jesse Hall3fbc8562015-11-29 22:10:52 -08002189class VkPipelineRasterizationStateCreateInfo {
Jesse Hall65ab5522015-11-30 00:07:16 -08002190 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002191 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08002192 VkPipelineRasterizationStateCreateFlags flags
Jesse Hallae38f732015-11-19 21:32:50 -08002193 VkBool32 depthClampEnable
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002194 VkBool32 rasterizerDiscardEnable
Jesse Hall65ab5522015-11-30 00:07:16 -08002195 VkPolygonMode polygonMode /// optional (GL45)
Jesse Hallc7467b72015-11-29 21:05:26 -08002196 VkCullModeFlags cullMode
Jesse Halld27f6aa2015-08-15 17:58:48 -07002197 VkFrontFace frontFace
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002198 VkBool32 depthBiasEnable
Jesse Halla9bb62b2015-11-21 19:31:56 -08002199 f32 depthBiasConstantFactor
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002200 f32 depthBiasClamp
Jesse Halla9bb62b2015-11-21 19:31:56 -08002201 f32 depthBiasSlopeFactor
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002202 f32 lineWidth
Jesse Halld27f6aa2015-08-15 17:58:48 -07002203}
2204
2205class VkPipelineMultisampleStateCreateInfo {
2206 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO
2207 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002208 VkPipelineMultisampleStateCreateFlags flags
Jesse Hall091ed9e2015-11-30 00:55:29 -08002209 VkSampleCountFlagBits rasterizationSamples /// Number of samples used for rasterization
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002210 VkBool32 sampleShadingEnable /// optional (GL45)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002211 f32 minSampleShading /// optional (GL45)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002212 const VkSampleMask* pSampleMask
Jesse Hallacfa5342015-11-19 21:51:33 -08002213 VkBool32 alphaToCoverageEnable
2214 VkBool32 alphaToOneEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002215}
2216
2217class VkPipelineColorBlendAttachmentState {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002218 VkBool32 blendEnable
Jesse Hall65ab5522015-11-30 00:07:16 -08002219 VkBlendFactor srcColorBlendFactor
2220 VkBlendFactor dstColorBlendFactor
2221 VkBlendOp colorBlendOp
2222 VkBlendFactor srcAlphaBlendFactor
2223 VkBlendFactor dstAlphaBlendFactor
2224 VkBlendOp alphaBlendOp
2225 VkColorComponentFlags colorWriteMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07002226}
2227
2228class VkPipelineColorBlendStateCreateInfo {
2229 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO
2230 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002231 VkPipelineColorBlendStateCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002232 VkBool32 logicOpEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002233 VkLogicOp logicOp
2234 u32 attachmentCount /// # of pAttachments
2235 const VkPipelineColorBlendAttachmentState* pAttachments
Jesse Hallb00daad2015-11-29 19:46:20 -08002236 f32[4] blendConstants
Jesse Halld27f6aa2015-08-15 17:58:48 -07002237}
2238
2239class VkStencilOpState {
Jesse Hall65ab5522015-11-30 00:07:16 -08002240 VkStencilOp failOp
2241 VkStencilOp passOp
2242 VkStencilOp depthFailOp
2243 VkCompareOp compareOp
2244 u32 compareMask
2245 u32 writeMask
2246 u32 reference
Jesse Halld27f6aa2015-08-15 17:58:48 -07002247}
2248
2249class VkPipelineDepthStencilStateCreateInfo {
2250 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO
2251 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002252 VkPipelineDepthStencilStateCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002253 VkBool32 depthTestEnable
2254 VkBool32 depthWriteEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002255 VkCompareOp depthCompareOp
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002256 VkBool32 depthBoundsTestEnable /// optional (depth_bounds_test)
2257 VkBool32 stencilTestEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002258 VkStencilOpState front
2259 VkStencilOpState back
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002260 f32 minDepthBounds
2261 f32 maxDepthBounds
2262}
2263
2264class VkPipelineDynamicStateCreateInfo {
2265 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO
2266 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002267 VkPipelineDynamicStateCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002268 u32 dynamicStateCount
2269 const VkDynamicState* pDynamicStates
Jesse Halld27f6aa2015-08-15 17:58:48 -07002270}
2271
2272class VkGraphicsPipelineCreateInfo {
Jesse Halla6429252015-11-29 18:59:42 -08002273 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO
2274 const void* pNext /// Pointer to next structure
2275 VkPipelineCreateFlags flags /// Pipeline creation flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002276 u32 stageCount
Jesse Halla6429252015-11-29 18:59:42 -08002277 const VkPipelineShaderStageCreateInfo* pStages /// One entry for each active shader stage
Jesse Halld27f6aa2015-08-15 17:58:48 -07002278 const VkPipelineVertexInputStateCreateInfo* pVertexInputState
2279 const VkPipelineInputAssemblyStateCreateInfo* pInputAssemblyState
2280 const VkPipelineTessellationStateCreateInfo* pTessellationState
2281 const VkPipelineViewportStateCreateInfo* pViewportState
Jesse Hall3fbc8562015-11-29 22:10:52 -08002282 const VkPipelineRasterizationStateCreateInfo* pRasterizationState
Jesse Halld27f6aa2015-08-15 17:58:48 -07002283 const VkPipelineMultisampleStateCreateInfo* pMultisampleState
2284 const VkPipelineDepthStencilStateCreateInfo* pDepthStencilState
2285 const VkPipelineColorBlendStateCreateInfo* pColorBlendState
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002286 const VkPipelineDynamicStateCreateInfo* pDynamicState
Jesse Halla6429252015-11-29 18:59:42 -08002287 VkPipelineLayout layout /// Interface layout of the pipeline
Jesse Halld27f6aa2015-08-15 17:58:48 -07002288 VkRenderPass renderPass
2289 u32 subpass
Jesse Halla6429252015-11-29 18:59:42 -08002290 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
2291 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 -07002292}
2293
2294class VkPipelineCacheCreateInfo {
Jesse Hallb00daad2015-11-29 19:46:20 -08002295 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO
2296 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002297 VkPipelineCacheCreateFlags flags
Jesse Hallb00daad2015-11-29 19:46:20 -08002298 platform.size_t initialDataSize /// Size of initial data to populate cache, in bytes
2299 const void* pInitialData /// Initial data to populate cache
Jesse Halld27f6aa2015-08-15 17:58:48 -07002300}
2301
2302class VkPushConstantRange {
2303 VkShaderStageFlags stageFlags /// Which stages use the range
Jesse Hall03b6fe12015-11-24 12:44:21 -08002304 u32 offset /// Start of the range, in bytes
2305 u32 size /// Length of the range, in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002306}
2307
2308class VkPipelineLayoutCreateInfo {
2309 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO
2310 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002311 VkPipelineLayoutCreateFlags flags
Jesse Hall3dd678a2016-01-08 21:52:01 -08002312 u32 descriptorSetCount /// Number of descriptor sets interfaced by the pipeline
Jesse Halld27f6aa2015-08-15 17:58:48 -07002313 const VkDescriptorSetLayout* pSetLayouts /// Array of <setCount> number of descriptor set layout objects defining the layout of the
2314 u32 pushConstantRangeCount /// Number of push-constant ranges used by the pipeline
2315 const VkPushConstantRange* pPushConstantRanges /// Array of pushConstantRangeCount number of ranges used by various shader stages
2316}
2317
2318class VkSamplerCreateInfo {
2319 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO
2320 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002321 VkSamplerCreateFlags flags
Jesse Hall23ff73f2015-11-29 14:36:39 -08002322 VkFilter magFilter /// Filter mode for magnification
2323 VkFilter minFilter /// Filter mode for minifiation
2324 VkSamplerMipmapMode mipmapMode /// Mipmap selection mode
2325 VkSamplerAddressMode addressModeU
2326 VkSamplerAddressMode addressModeV
2327 VkSamplerAddressMode addressModeW
Jesse Halld27f6aa2015-08-15 17:58:48 -07002328 f32 mipLodBias
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002329 VkBool32 anisotropyEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002330 f32 maxAnisotropy
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002331 VkBool32 compareEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002332 VkCompareOp compareOp
2333 f32 minLod
2334 f32 maxLod
2335 VkBorderColor borderColor
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002336 VkBool32 unnormalizedCoordinates
Jesse Halld27f6aa2015-08-15 17:58:48 -07002337}
2338
Jesse Hall3fbc8562015-11-29 22:10:52 -08002339class VkCommandPoolCreateInfo {
2340 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002341 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08002342 VkCommandPoolCreateFlags flags /// Command pool creation flags
Jesse Halla6429252015-11-29 18:59:42 -08002343 u32 queueFamilyIndex
Jesse Halld27f6aa2015-08-15 17:58:48 -07002344}
2345
Jesse Hall3fbc8562015-11-29 22:10:52 -08002346class VkCommandBufferAllocateInfo {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002347 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002348 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08002349 VkCommandPool commandPool
2350 VkCommandBufferLevel level
Jesse Hall3dd678a2016-01-08 21:52:01 -08002351 u32 commandBufferCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002352}
2353
Jesse Hall3dd678a2016-01-08 21:52:01 -08002354class VkCommandBufferInheritanceInfo {
2355 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002356 const void* pNext /// Pointer to next structure
Jesse Halld27f6aa2015-08-15 17:58:48 -07002357 VkRenderPass renderPass /// Render pass for secondary command buffers
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002358 u32 subpass
Jesse Halld27f6aa2015-08-15 17:58:48 -07002359 VkFramebuffer framebuffer /// Framebuffer for secondary command buffers
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002360 VkBool32 occlusionQueryEnable
2361 VkQueryControlFlags queryFlags
2362 VkQueryPipelineStatisticFlags pipelineStatistics
Jesse Halld27f6aa2015-08-15 17:58:48 -07002363}
2364
Jesse Hall3dd678a2016-01-08 21:52:01 -08002365class VkCommandBufferBeginInfo {
2366 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO
2367 const void* pNext /// Pointer to next structure
2368 VkCommandBufferUsageFlags flags /// Command buffer usage flags
2369 const VkCommandBufferInheritanceInfo* pInheritanceInfo
2370}
2371
Jesse Halld27f6aa2015-08-15 17:58:48 -07002372class VkRenderPassBeginInfo {
2373 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO
2374 const void* pNext /// Pointer to next structure
2375 VkRenderPass renderPass
2376 VkFramebuffer framebuffer
2377 VkRect2D renderArea
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002378 u32 clearValueCount
2379 const VkClearValue* pClearValues
Jesse Halld27f6aa2015-08-15 17:58:48 -07002380}
2381
2382@union
2383/// Union allowing specification of floating point, integer, or unsigned integer color data. Actual value selected is based on image/attachment being cleared.
2384class VkClearColorValue {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002385 f32[4] float32
2386 s32[4] int32
2387 u32[4] uint32
Jesse Halld27f6aa2015-08-15 17:58:48 -07002388}
2389
2390class VkClearDepthStencilValue {
2391 f32 depth
2392 u32 stencil
2393}
2394
2395@union
2396/// Union allowing specification of color, depth, and stencil color values. Actual value selected is based on attachment being cleared.
2397class VkClearValue {
2398 VkClearColorValue color
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002399 VkClearDepthStencilValue depthStencil
Jesse Halld27f6aa2015-08-15 17:58:48 -07002400}
2401
Jesse Hallae38f732015-11-19 21:32:50 -08002402class VkClearAttachment {
2403 VkImageAspectFlags aspectMask
2404 u32 colorAttachment
2405 VkClearValue clearValue
2406}
2407
Jesse Halld27f6aa2015-08-15 17:58:48 -07002408class VkAttachmentDescription {
Jesse Halla6429252015-11-29 18:59:42 -08002409 VkAttachmentDescriptionFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002410 VkFormat format
Jesse Hall091ed9e2015-11-30 00:55:29 -08002411 VkSampleCountFlagBits samples
Jesse Halld27f6aa2015-08-15 17:58:48 -07002412 VkAttachmentLoadOp loadOp /// Load op for color or depth data
2413 VkAttachmentStoreOp storeOp /// Store op for color or depth data
2414 VkAttachmentLoadOp stencilLoadOp /// Load op for stencil data
2415 VkAttachmentStoreOp stencilStoreOp /// Store op for stencil data
2416 VkImageLayout initialLayout
2417 VkImageLayout finalLayout
2418}
2419
2420class VkAttachmentReference {
2421 u32 attachment
2422 VkImageLayout layout
2423}
2424
2425class VkSubpassDescription {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002426 VkSubpassDescriptionFlags flags
Jesse Halla6429252015-11-29 18:59:42 -08002427 VkPipelineBindPoint pipelineBindPoint /// Must be VK_PIPELINE_BIND_POINT_GRAPHICS for now
Jesse Hall03b6fe12015-11-24 12:44:21 -08002428 u32 inputAttachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002429 const VkAttachmentReference* pInputAttachments
Jesse Hall03b6fe12015-11-24 12:44:21 -08002430 u32 colorAttachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002431 const VkAttachmentReference* pColorAttachments
2432 const VkAttachmentReference* pResolveAttachments
Jesse Hallc7467b72015-11-29 21:05:26 -08002433 const VkAttachmentReference* pDepthStencilAttachment
Jesse Hall03b6fe12015-11-24 12:44:21 -08002434 u32 preserveAttachmentCount
Jesse Hall3dd678a2016-01-08 21:52:01 -08002435 const u32* pPreserveAttachments
Jesse Halld27f6aa2015-08-15 17:58:48 -07002436}
2437
2438class VkSubpassDependency {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002439 u32 srcSubpass
Jesse Hall3fbc8562015-11-29 22:10:52 -08002440 u32 dstSubpass
Jesse Halld27f6aa2015-08-15 17:58:48 -07002441 VkPipelineStageFlags srcStageMask
Jesse Hall3fbc8562015-11-29 22:10:52 -08002442 VkPipelineStageFlags dstStageMask
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002443 VkAccessFlags srcAccessMask
2444 VkAccessFlags dstAccessMask
Jesse Halldc6d36c2015-11-29 19:12:15 -08002445 VkDependencyFlags dependencyFlags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002446}
2447
2448class VkRenderPassCreateInfo {
2449 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO
2450 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002451 VkRenderPassCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002452 u32 attachmentCount
2453 const VkAttachmentDescription* pAttachments
2454 u32 subpassCount
2455 const VkSubpassDescription* pSubpasses
2456 u32 dependencyCount
2457 const VkSubpassDependency* pDependencies
2458}
2459
2460class VkEventCreateInfo {
2461 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_EVENT_CREATE_INFO
2462 const void* pNext /// Pointer to next structure
2463 VkEventCreateFlags flags /// Event creation flags
2464}
2465
2466class VkFenceCreateInfo {
2467 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_FENCE_CREATE_INFO
2468 const void* pNext /// Pointer to next structure
2469 VkFenceCreateFlags flags /// Fence creation flags
2470}
2471
2472class VkPhysicalDeviceFeatures {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002473 VkBool32 robustBufferAccess /// out of bounds buffer accesses are well defined
2474 VkBool32 fullDrawIndexUint32 /// full 32-bit range of indices for indexed draw calls
2475 VkBool32 imageCubeArray /// image views which are arrays of cube maps
2476 VkBool32 independentBlend /// blending operations are controlled per-attachment
2477 VkBool32 geometryShader /// geometry stage
2478 VkBool32 tessellationShader /// tessellation control and evaluation stage
2479 VkBool32 sampleRateShading /// per-sample shading and interpolation
Jesse Hall3fbc8562015-11-29 22:10:52 -08002480 VkBool32 dualSrcBlend /// blend operations which take two sources
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002481 VkBool32 logicOp /// logic operations
2482 VkBool32 multiDrawIndirect /// multi draw indirect
Jesse Hall543a7ff2016-01-08 16:38:30 -08002483 VkBool32 drawIndirectFirstInstance
Jesse Hallae38f732015-11-19 21:32:50 -08002484 VkBool32 depthClamp /// depth clamping
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002485 VkBool32 depthBiasClamp /// depth bias clamping
2486 VkBool32 fillModeNonSolid /// point and wireframe fill modes
2487 VkBool32 depthBounds /// depth bounds test
2488 VkBool32 wideLines /// lines with width greater than 1
2489 VkBool32 largePoints /// points with size greater than 1
Jesse Hallfbf97b02015-11-20 14:17:03 -08002490 VkBool32 alphaToOne /// The fragment alpha channel can be forced to maximum representable alpha value
2491 VkBool32 multiViewport
2492 VkBool32 samplerAnisotropy
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002493 VkBool32 textureCompressionETC2 /// ETC texture compression formats
2494 VkBool32 textureCompressionASTC_LDR /// ASTC LDR texture compression formats
2495 VkBool32 textureCompressionBC /// BC1-7 texture compressed formats
Jesse Hall65ab5522015-11-30 00:07:16 -08002496 VkBool32 occlusionQueryPrecise
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002497 VkBool32 pipelineStatisticsQuery /// pipeline statistics query
Jesse Halldc6d36c2015-11-29 19:12:15 -08002498 VkBool32 vertexPipelineStoresAndAtomics
2499 VkBool32 fragmentStoresAndAtomics
2500 VkBool32 shaderTessellationAndGeometryPointSize
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002501 VkBool32 shaderImageGatherExtended /// texture gather with run-time values and independent offsets
2502 VkBool32 shaderStorageImageExtendedFormats /// the extended set of formats can be used for storage images
2503 VkBool32 shaderStorageImageMultisample /// multisample images can be used for storage images
Jesse Halld1af8122015-11-29 23:50:38 -08002504 VkBool32 shaderStorageImageReadWithoutFormat
2505 VkBool32 shaderStorageImageWriteWithoutFormat
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002506 VkBool32 shaderUniformBufferArrayDynamicIndexing /// arrays of uniform buffers can be accessed with dynamically uniform indices
2507 VkBool32 shaderSampledImageArrayDynamicIndexing /// arrays of sampled images can be accessed with dynamically uniform indices
2508 VkBool32 shaderStorageBufferArrayDynamicIndexing /// arrays of storage buffers can be accessed with dynamically uniform indices
2509 VkBool32 shaderStorageImageArrayDynamicIndexing /// arrays of storage images can be accessed with dynamically uniform indices
2510 VkBool32 shaderClipDistance /// clip distance in shaders
2511 VkBool32 shaderCullDistance /// cull distance in shaders
2512 VkBool32 shaderFloat64 /// 64-bit floats (doubles) in shaders
2513 VkBool32 shaderInt64 /// 64-bit integers in shaders
2514 VkBool32 shaderInt16 /// 16-bit integers in shaders
2515 VkBool32 shaderResourceResidency /// shader can use texture operations that return resource residency information (requires sparseNonResident support)
Jesse Hall65ab5522015-11-30 00:07:16 -08002516 VkBool32 shaderResourceMinLod /// shader can use texture operations that specify minimum resource LOD
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002517 VkBool32 sparseBinding /// Sparse resources support: Resource memory can be managed at opaque page level rather than object level
2518 VkBool32 sparseResidencyBuffer /// Sparse resources support: GPU can access partially resident buffers
2519 VkBool32 sparseResidencyImage2D /// Sparse resources support: GPU can access partially resident 2D (non-MSAA non-DepthStencil) images
2520 VkBool32 sparseResidencyImage3D /// Sparse resources support: GPU can access partially resident 3D images
2521 VkBool32 sparseResidency2Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 2 samples
2522 VkBool32 sparseResidency4Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 4 samples
2523 VkBool32 sparseResidency8Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 8 samples
2524 VkBool32 sparseResidency16Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 16 samples
2525 VkBool32 sparseResidencyAliased /// Sparse resources support: GPU can correctly access data aliased into multiple locations (opt-in)
Jesse Halld1af8122015-11-29 23:50:38 -08002526 VkBool32 variableMultisampleRate
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002527 VkBool32 inheritedQueries
Jesse Halld27f6aa2015-08-15 17:58:48 -07002528}
2529
2530class VkPhysicalDeviceLimits {
2531 /// resource maximum sizes
2532 u32 maxImageDimension1D /// max 1D image dimension
2533 u32 maxImageDimension2D /// max 2D image dimension
2534 u32 maxImageDimension3D /// max 3D image dimension
2535 u32 maxImageDimensionCube /// max cubemap image dimension
2536 u32 maxImageArrayLayers /// max layers for image arrays
Jesse Hallb00daad2015-11-29 19:46:20 -08002537 u32 maxTexelBufferElements
Jesse Hallfbf97b02015-11-20 14:17:03 -08002538 u32 maxUniformBufferRange /// max uniform buffer size (bytes)
2539 u32 maxStorageBufferRange /// max storage buffer size (bytes)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002540 u32 maxPushConstantsSize /// max size of the push constants pool (bytes)
2541 /// memory limits
2542 u32 maxMemoryAllocationCount /// max number of device memory allocations supported
Jesse Hall091ed9e2015-11-30 00:55:29 -08002543 u32 maxSamplerAllocationCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002544 VkDeviceSize bufferImageGranularity /// Granularity (in bytes) at which buffers and images can be bound to adjacent memory for simultaneous usage
2545 VkDeviceSize sparseAddressSpaceSize /// Total address space available for sparse allocations (bytes)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002546 /// descriptor set limits
2547 u32 maxBoundDescriptorSets /// max number of descriptors sets that can be bound to a pipeline
Jesse Halld27f6aa2015-08-15 17:58:48 -07002548 u32 maxPerStageDescriptorSamplers /// max num of samplers allowed per-stage in a descriptor set
2549 u32 maxPerStageDescriptorUniformBuffers /// max num of uniform buffers allowed per-stage in a descriptor set
2550 u32 maxPerStageDescriptorStorageBuffers /// max num of storage buffers allowed per-stage in a descriptor set
2551 u32 maxPerStageDescriptorSampledImages /// max num of sampled images allowed per-stage in a descriptor set
2552 u32 maxPerStageDescriptorStorageImages /// max num of storage images allowed per-stage in a descriptor set
Jesse Halle1b12782015-11-30 11:27:32 -08002553 u32 maxPerStageDescriptorInputAttachments
Jesse Halldba27f72015-11-30 14:25:46 -08002554 u32 maxPerStageResources
Jesse Halld27f6aa2015-08-15 17:58:48 -07002555 u32 maxDescriptorSetSamplers /// max num of samplers allowed in all stages in a descriptor set
2556 u32 maxDescriptorSetUniformBuffers /// max num of uniform buffers allowed in all stages in a descriptor set
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002557 u32 maxDescriptorSetUniformBuffersDynamic /// max num of dynamic uniform buffers allowed in all stages in a descriptor set
Jesse Halld27f6aa2015-08-15 17:58:48 -07002558 u32 maxDescriptorSetStorageBuffers /// max num of storage buffers allowed in all stages in a descriptor set
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002559 u32 maxDescriptorSetStorageBuffersDynamic /// max num of dynamic storage buffers allowed in all stages in a descriptor set
Jesse Halld27f6aa2015-08-15 17:58:48 -07002560 u32 maxDescriptorSetSampledImages /// max num of sampled images allowed in all stages in a descriptor set
2561 u32 maxDescriptorSetStorageImages /// max num of storage images allowed in all stages in a descriptor set
Jesse Halle1b12782015-11-30 11:27:32 -08002562 u32 maxDescriptorSetInputAttachments
Jesse Halld27f6aa2015-08-15 17:58:48 -07002563 /// vertex stage limits
2564 u32 maxVertexInputAttributes /// max num of vertex input attribute slots
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002565 u32 maxVertexInputBindings /// max num of vertex input binding slots
Jesse Halld27f6aa2015-08-15 17:58:48 -07002566 u32 maxVertexInputAttributeOffset /// max vertex input attribute offset added to vertex buffer offset
2567 u32 maxVertexInputBindingStride /// max vertex input binding stride
2568 u32 maxVertexOutputComponents /// max num of output components written by vertex shader
2569 /// tessellation control stage limits
Jesse Hall3fbc8562015-11-29 22:10:52 -08002570 u32 maxTessellationGenerationLevel /// max level supported by tess primitive generator
Jesse Hallae38f732015-11-19 21:32:50 -08002571 u32 maxTessellationPatchSize /// max patch size (vertices)
2572 u32 maxTessellationControlPerVertexInputComponents /// max num of input components per-vertex in TCS
2573 u32 maxTessellationControlPerVertexOutputComponents /// max num of output components per-vertex in TCS
2574 u32 maxTessellationControlPerPatchOutputComponents /// max num of output components per-patch in TCS
2575 u32 maxTessellationControlTotalOutputComponents /// max total num of per-vertex and per-patch output components in TCS
2576 u32 maxTessellationEvaluationInputComponents /// max num of input components per vertex in TES
2577 u32 maxTessellationEvaluationOutputComponents /// max num of output components per vertex in TES
Jesse Halld27f6aa2015-08-15 17:58:48 -07002578 /// geometry stage limits
2579 u32 maxGeometryShaderInvocations /// max invocation count supported in geometry shader
2580 u32 maxGeometryInputComponents /// max num of input components read in geometry stage
2581 u32 maxGeometryOutputComponents /// max num of output components written in geometry stage
2582 u32 maxGeometryOutputVertices /// max num of vertices that can be emitted in geometry stage
2583 u32 maxGeometryTotalOutputComponents /// max total num of components (all vertices) written in geometry stage
2584 /// fragment stage limits
2585 u32 maxFragmentInputComponents /// max num of input compontents read in fragment stage
Jesse Hallfbf97b02015-11-20 14:17:03 -08002586 u32 maxFragmentOutputAttachments /// max num of output attachments written in fragment stage
Jesse Hall3fbc8562015-11-29 22:10:52 -08002587 u32 maxFragmentDualSrcAttachments /// max num of output attachments written when using dual source blending
Jesse Halld27f6aa2015-08-15 17:58:48 -07002588 u32 maxFragmentCombinedOutputResources /// max total num of storage buffers, storage images and output buffers
2589 /// compute stage limits
2590 u32 maxComputeSharedMemorySize /// max total storage size of work group local storage (bytes)
2591 u32[3] maxComputeWorkGroupCount /// max num of compute work groups that may be dispatched by a single command (x,y,z)
2592 u32 maxComputeWorkGroupInvocations /// max total compute invocations in a single local work group
2593 u32[3] maxComputeWorkGroupSize /// max local size of a compute work group (x,y,z)
2594
2595 u32 subPixelPrecisionBits /// num bits of subpixel precision in screen x and y
2596 u32 subTexelPrecisionBits /// num bits of subtexel precision
2597 u32 mipmapPrecisionBits /// num bits of mipmap precision
2598
2599 u32 maxDrawIndexedIndexValue /// max index value for indexed draw calls (for 32-bit indices)
Jesse Halldba27f72015-11-30 14:25:46 -08002600 u32 maxDrawIndirectCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002601
2602 f32 maxSamplerLodBias /// max absolute sampler level of detail bias
2603 f32 maxSamplerAnisotropy /// max degree of sampler anisotropy
2604
2605 u32 maxViewports /// max number of active viewports
Jesse Halld27f6aa2015-08-15 17:58:48 -07002606 u32[2] maxViewportDimensions /// max viewport dimensions (x,y)
2607 f32[2] viewportBoundsRange /// viewport bounds range (min,max)
2608 u32 viewportSubPixelBits /// num bits of subpixel precision for viewport
2609
Jesse Halldc6d36c2015-11-29 19:12:15 -08002610 platform.size_t minMemoryMapAlignment /// min required alignment of pointers returned by MapMemory (bytes)
2611 VkDeviceSize minTexelBufferOffsetAlignment /// min required alignment for texel buffer offsets (bytes)
2612 VkDeviceSize minUniformBufferOffsetAlignment /// min required alignment for uniform buffer sizes and offsets (bytes)
2613 VkDeviceSize minStorageBufferOffsetAlignment /// min required alignment for storage buffer offsets (bytes)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002614
Jesse Hallfbf97b02015-11-20 14:17:03 -08002615 s32 minTexelOffset /// min texel offset for OpTextureSampleOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07002616 u32 maxTexelOffset /// max texel offset for OpTextureSampleOffset
Jesse Hallfbf97b02015-11-20 14:17:03 -08002617 s32 minTexelGatherOffset /// min texel offset for OpTextureGatherOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07002618 u32 maxTexelGatherOffset /// max texel offset for OpTextureGatherOffset
2619 f32 minInterpolationOffset /// furthest negative offset for interpolateAtOffset
2620 f32 maxInterpolationOffset /// furthest positive offset for interpolateAtOffset
2621 u32 subPixelInterpolationOffsetBits /// num of subpixel bits for interpolateAtOffset
2622
2623 u32 maxFramebufferWidth /// max width for a framebuffer
2624 u32 maxFramebufferHeight /// max height for a framebuffer
2625 u32 maxFramebufferLayers /// max layer count for a layered framebuffer
Jesse Hall091ed9e2015-11-30 00:55:29 -08002626 VkSampleCountFlags framebufferColorSampleCounts
2627 VkSampleCountFlags framebufferDepthSampleCounts
2628 VkSampleCountFlags framebufferStencilSampleCounts
2629 VkSampleCountFlags framebufferNoAttachmentSampleCounts
Jesse Halld27f6aa2015-08-15 17:58:48 -07002630 u32 maxColorAttachments /// max num of framebuffer color attachments
2631
Jesse Hall091ed9e2015-11-30 00:55:29 -08002632 VkSampleCountFlags sampledImageColorSampleCounts
2633 VkSampleCountFlags sampledImageIntegerSampleCounts
2634 VkSampleCountFlags sampledImageDepthSampleCounts
2635 VkSampleCountFlags sampledImageStencilSampleCounts
2636 VkSampleCountFlags storageImageSampleCounts
Jesse Halld27f6aa2015-08-15 17:58:48 -07002637 u32 maxSampleMaskWords /// max num of sample mask words
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002638 VkBool32 timestampComputeAndGraphics
Jesse Halld27f6aa2015-08-15 17:58:48 -07002639
Jesse Halla9bb62b2015-11-21 19:31:56 -08002640 f32 timestampPeriod
Jesse Halld27f6aa2015-08-15 17:58:48 -07002641
2642 u32 maxClipDistances /// max number of clip distances
2643 u32 maxCullDistances /// max number of cull distances
2644 u32 maxCombinedClipAndCullDistances /// max combined number of user clipping
2645
Jesse Hallfbf97b02015-11-20 14:17:03 -08002646 u32 discreteQueuePriorities
2647
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002648 f32[2] pointSizeRange /// range (min,max) of supported point sizes
2649 f32[2] lineWidthRange /// range (min,max) of supported line widths
Jesse Halld27f6aa2015-08-15 17:58:48 -07002650 f32 pointSizeGranularity /// granularity of supported point sizes
2651 f32 lineWidthGranularity /// granularity of supported line widths
Jesse Hall03b6fe12015-11-24 12:44:21 -08002652 VkBool32 strictLines
Jesse Hall091ed9e2015-11-30 00:55:29 -08002653 VkBool32 standardSampleLocations
Jesse Halla9bb62b2015-11-21 19:31:56 -08002654
Jesse Hall65ab5522015-11-30 00:07:16 -08002655 VkDeviceSize optimalBufferCopyOffsetAlignment
2656 VkDeviceSize optimalBufferCopyRowPitchAlignment
Jesse Halldba27f72015-11-30 14:25:46 -08002657 VkDeviceSize nonCoherentAtomSize
Jesse Halld27f6aa2015-08-15 17:58:48 -07002658}
2659
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002660class VkPhysicalDeviceSparseProperties {
2661 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 -08002662 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 -07002663 VkBool32 residencyStandard3DBlockShape /// Sparse resources support: GPU will access all 3D sparse resources using the standard block shapes (based on pixel format)
2664 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 -07002665 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
2666}
2667
Jesse Halld27f6aa2015-08-15 17:58:48 -07002668class VkSemaphoreCreateInfo {
2669 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO
2670 const void* pNext /// Pointer to next structure
2671 VkSemaphoreCreateFlags flags /// Semaphore creation flags
2672}
2673
2674class VkQueryPoolCreateInfo {
2675 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO
2676 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002677 VkQueryPoolCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002678 VkQueryType queryType
Jesse Hall3dd678a2016-01-08 21:52:01 -08002679 u32 queryCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002680 VkQueryPipelineStatisticFlags pipelineStatistics /// Optional
2681}
2682
2683class VkFramebufferCreateInfo {
2684 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO
2685 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002686 VkFramebufferCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002687 VkRenderPass renderPass
2688 u32 attachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002689 const VkImageView* pAttachments
Jesse Halld27f6aa2015-08-15 17:58:48 -07002690 u32 width
2691 u32 height
2692 u32 layers
2693}
2694
Jesse Hall3fbc8562015-11-29 22:10:52 -08002695class VkDrawIndirectCommand {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002696 u32 vertexCount
2697 u32 instanceCount
2698 u32 firstVertex
2699 u32 firstInstance
2700}
2701
Jesse Hall3fbc8562015-11-29 22:10:52 -08002702class VkDrawIndexedIndirectCommand {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002703 u32 indexCount
2704 u32 instanceCount
2705 u32 firstIndex
2706 s32 vertexOffset
2707 u32 firstInstance
2708}
2709
Jesse Hall3fbc8562015-11-29 22:10:52 -08002710class VkDispatchIndirectCommand {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002711 u32 x
2712 u32 y
2713 u32 z
2714}
2715
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002716@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08002717class VkSurfaceCapabilitiesKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002718 u32 minImageCount
2719 u32 maxImageCount
2720 VkExtent2D currentExtent
2721 VkExtent2D minImageExtent
2722 VkExtent2D maxImageExtent
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002723 u32 maxImageArrayLayers
Jesse Hall1356b0d2015-11-23 17:24:58 -08002724 VkSurfaceTransformFlagsKHR supportedTransforms
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002725 VkSurfaceTransformFlagBitsKHR currentTransform
Jesse Halla6429252015-11-29 18:59:42 -08002726 VkCompositeAlphaFlagsKHR supportedCompositeAlpha
Jesse Hall1356b0d2015-11-23 17:24:58 -08002727 VkImageUsageFlags supportedUsageFlags
Michael Lentine88594d72015-11-12 12:49:45 -08002728}
2729
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002730@extension("VK_KHR_surface")
Michael Lentine88594d72015-11-12 12:49:45 -08002731class VkSurfaceFormatKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002732 VkFormat format
2733 VkColorSpaceKHR colorSpace
Michael Lentine88594d72015-11-12 12:49:45 -08002734}
2735
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002736@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08002737class VkSwapchainCreateInfoKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002738 VkStructureType sType
2739 const void* pNext
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002740 VkSwapchainCreateFlagsKHR flags
Jesse Hall1356b0d2015-11-23 17:24:58 -08002741 VkSurfaceKHR surface
2742 u32 minImageCount
2743 VkFormat imageFormat
2744 VkColorSpaceKHR imageColorSpace
2745 VkExtent2D imageExtent
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002746 u32 imageArrayLayers
2747 VkImageUsageFlags imageUsage
Jesse Hall1356b0d2015-11-23 17:24:58 -08002748 VkSharingMode sharingMode
Jesse Hall03b6fe12015-11-24 12:44:21 -08002749 u32 queueFamilyIndexCount
Jesse Hall1356b0d2015-11-23 17:24:58 -08002750 const u32* pQueueFamilyIndices
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002751 VkSurfaceTransformFlagBitsKHR preTransform
2752 VkCompositeAlphaFlagBitsKHR compositeAlpha
Jesse Hall1356b0d2015-11-23 17:24:58 -08002753 VkPresentModeKHR presentMode
Jesse Hall1356b0d2015-11-23 17:24:58 -08002754 VkBool32 clipped
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002755 VkSwapchainKHR oldSwapchain
Michael Lentine88594d72015-11-12 12:49:45 -08002756}
2757
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002758@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08002759class VkPresentInfoKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002760 VkStructureType sType
2761 const void* pNext
Jesse Hallb00daad2015-11-29 19:46:20 -08002762 u32 waitSemaphoreCount
2763 const VkSemaphore* pWaitSemaphores
Jesse Hall1356b0d2015-11-23 17:24:58 -08002764 u32 swapchainCount
Jesse Hall03b6fe12015-11-24 12:44:21 -08002765 const VkSwapchainKHR* pSwapchains
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002766 const u32* pImageIndices
Jesse Halle1b12782015-11-30 11:27:32 -08002767 VkResult* pResults
Michael Lentine88594d72015-11-12 12:49:45 -08002768}
2769
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002770@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002771class VkDisplayPropertiesKHR {
2772 VkDisplayKHR display
2773 const char* displayName
2774 VkExtent2D physicalDimensions
2775 VkExtent2D physicalResolution
2776 VkSurfaceTransformFlagsKHR supportedTransforms
Jesse Hall1356b0d2015-11-23 17:24:58 -08002777 VkBool32 planeReorderPossible
Jesse Halla6429252015-11-29 18:59:42 -08002778 VkBool32 persistentContent
Michael Lentine88594d72015-11-12 12:49:45 -08002779}
2780
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002781@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08002782class VkDisplayModeParametersKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002783 VkExtent2D visibleRegion
Jesse Halla6429252015-11-29 18:59:42 -08002784 u32 refreshRate
Michael Lentine88594d72015-11-12 12:49:45 -08002785}
Jesse Halld27f6aa2015-08-15 17:58:48 -07002786
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002787@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002788class VkDisplayModePropertiesKHR {
2789 VkDisplayModeKHR displayMode
Jesse Halla6429252015-11-29 18:59:42 -08002790 VkDisplayModeParametersKHR parameters
Jesse Hall1356b0d2015-11-23 17:24:58 -08002791}
2792
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002793@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002794class VkDisplayModeCreateInfoKHR {
2795 VkStructureType sType
2796 const void* pNext
Jesse Hall9ba8bc82015-11-30 16:22:16 -08002797 VkDisplayModeCreateFlagsKHR flags
Jesse Halla6429252015-11-29 18:59:42 -08002798 VkDisplayModeParametersKHR parameters
Jesse Hall1356b0d2015-11-23 17:24:58 -08002799}
2800
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002801@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002802class VkDisplayPlanePropertiesKHR {
Jesse Halla6429252015-11-29 18:59:42 -08002803 VkDisplayKHR currentDisplay
2804 u32 currentStackIndex
2805}
2806
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002807@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08002808class VkDisplayPlaneCapabilitiesKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002809 VkDisplayPlaneAlphaFlagsKHR supportedAlpha
2810 VkOffset2D minSrcPosition
2811 VkOffset2D maxSrcPosition
2812 VkExtent2D minSrcExtent
2813 VkExtent2D maxSrcExtent
2814 VkOffset2D minDstPosition
2815 VkOffset2D maxDstPosition
2816 VkExtent2D minDstExtent
2817 VkExtent2D maxDstExtent
2818}
2819
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002820@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08002821class VkDisplaySurfaceCreateInfoKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002822 VkStructureType sType
2823 const void* pNext
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002824 VkDisplaySurfaceCreateFlagsKHR flags
Jesse Hall1356b0d2015-11-23 17:24:58 -08002825 VkDisplayModeKHR displayMode
2826 u32 planeIndex
2827 u32 planeStackIndex
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002828 VkSurfaceTransformFlagBitsKHR transform
Jesse Hall1356b0d2015-11-23 17:24:58 -08002829 f32 globalAlpha
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002830 VkDisplayPlaneAlphaFlagBitsKHR alphaMode
2831 VkExtent2D imageExtent
Jesse Hall1356b0d2015-11-23 17:24:58 -08002832}
2833
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002834@extension("VK_KHR_display_swapchain")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002835class VkDisplayPresentInfoKHR {
2836 VkStructureType sType
2837 const void* pNext
2838 VkRect2D srcRect
2839 VkRect2D dstRect
Jesse Halla6429252015-11-29 18:59:42 -08002840 VkBool32 persistent
Jesse Hall1356b0d2015-11-23 17:24:58 -08002841}
2842
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002843@extension("VK_KHR_xlib_surface")
2844class VkXlibSurfaceCreateInfoKHR {
2845 VkStructureType sType
2846 const void* pNext
2847 VkXlibSurfaceCreateFlagsKHR flags
2848 platform.Display* dpy
2849 platform.Window window
2850}
2851
2852@extension("VK_KHR_xcb_surface")
2853class VkXcbSurfaceCreateInfoKHR {
2854 VkStructureType sType
2855 const void* pNext
2856 VkXcbSurfaceCreateFlagsKHR flags
2857 platform.xcb_connection_t* connection
2858 platform.xcb_window_t window
2859}
2860
2861@extension("VK_KHR_wayland_surface")
2862class VkWaylandSurfaceCreateInfoKHR {
2863 VkStructureType sType
2864 const void* pNext
2865 VkWaylandSurfaceCreateFlagsKHR flags
2866 platform.wl_display* display
2867 platform.wl_surface* surface
2868}
2869
2870@extension("VK_KHR_mir_surface")
2871class VkMirSurfaceCreateInfoKHR {
2872 VkStructureType sType
2873 const void* pNext
2874 VkMirSurfaceCreateFlagsKHR flags
2875 platform.MirConnection* connection
2876 platform.MirSurface* mirSurface
2877}
2878
2879@extension("VK_KHR_android_surface")
2880class VkAndroidSurfaceCreateInfoKHR {
2881 VkStructureType sType
2882 const void* pNext
2883 VkAndroidSurfaceCreateFlagsKHR flags
2884 platform.ANativeWindow* window
2885}
2886
2887@extension("VK_KHR_win32_surface")
2888class VkWin32SurfaceCreateInfoKHR {
2889 VkStructureType sType
2890 const void* pNext
2891 VkWin32SurfaceCreateFlagsKHR flags
2892 platform.HINSTANCE hinstance
2893 platform.HWND hwnd
2894}
2895
Chia-I Wub262ddc2016-03-22 07:38:20 +08002896@extension("VK_ANDROID_native_buffer")
2897class VkNativeBufferANDROID {
2898 VkStructureType sType
2899 const void* pNext
2900 platform.buffer_handle_t handle
2901 int stride
2902 int format
2903 int usage
2904}
2905
Chris Forbes8e4438b2016-12-07 16:26:49 +13002906@extension("VK_ANDROID_native_buffer")
2907class VkSwapchainImageCreateInfoANDROID {
2908 VkStructureType sType
2909 const void* pNext
Chris Forbes134d9582017-01-12 14:26:37 +13002910 VkSwapchainImageUsageFlagsANDROID flags
Chris Forbes48853712017-01-12 14:09:33 +13002911}
Ian Elliott4c8bb2a2016-12-29 11:07:26 -07002912
2913@extension("VK_GOOGLE_display_timing")
2914class VkRefreshCycleDurationGOOGLE {
Chris Forbes48853712017-01-12 14:09:33 +13002915 u64 minRefreshDuration
2916 u64 maxRefreshDuration
Ian Elliott4c8bb2a2016-12-29 11:07:26 -07002917}
2918
2919@extension("VK_GOOGLE_display_timing")
2920class VkPastPresentationTimingGOOGLE {
Chris Forbes48853712017-01-12 14:09:33 +13002921 u32 presentID
2922 u64 desiredPresentTime
2923 u64 actualPresentTime
2924 u64 earliestPresentTime
2925 u64 presentMargin
Ian Elliott4c8bb2a2016-12-29 11:07:26 -07002926}
2927
2928@extension("VK_GOOGLE_display_timing")
2929class VkPresentTimeGOOGLE {
Chris Forbes48853712017-01-12 14:09:33 +13002930 u32 presentID
2931 u64 desiredPresentTime
Ian Elliott4c8bb2a2016-12-29 11:07:26 -07002932}
2933
2934@extension("VK_GOOGLE_display_timing")
2935class VkPresentTimesInfoGOOGLE {
2936 VkStructureType sType
2937 const void* pNext
Chris Forbes48853712017-01-12 14:09:33 +13002938 u32 swapchainCount
Ian Elliott4c8bb2a2016-12-29 11:07:26 -07002939 const VkPresentTimeGOOGLE* pTimes
Chris Forbes8e4438b2016-12-07 16:26:49 +13002940}
2941
Jesse Hall715b86a2016-01-16 16:34:29 -08002942@extension("VK_EXT_debug_report")
2943class VkDebugReportCallbackCreateInfoEXT {
2944 VkStructureType sType
2945 const void* pNext
2946 VkDebugReportFlagsEXT flags
2947 PFN_vkDebugReportCallbackEXT pfnCallback
2948 void* pUserData
2949}
2950
Jesse Hall26763382016-05-20 07:13:52 -07002951@extension("VK_AMD_rasterization_order")
2952class VkPipelineRasterizationStateRasterizationOrderAMD {
2953 VkStructureType sType
2954 const void* pNext
2955 VkRasterizationOrderAMD rasterizationOrder
2956}
2957
2958@extension("VK_EXT_debug_marker")
2959class VkDebugMarkerObjectNameInfoEXT {
2960 VkStructureType sType
2961 const void* pNext
2962 VkDebugReportObjectTypeEXT objectType
2963 u64 object
2964 const char* pObjectName
2965}
2966
2967@extension("VK_EXT_debug_marker")
2968class VkDebugMarkerObjectTagInfoEXT {
2969 VkStructureType sType
2970 const void* pNext
2971 VkDebugReportObjectTypeEXT objectType
2972 u64 object
2973 u64 tagName
2974 platform.size_t tagSize
2975 const void* pTag
2976}
2977
2978@extension("VK_EXT_debug_marker")
2979class VkDebugMarkerMarkerInfoEXT {
2980 VkStructureType sType
2981 const void* pNext
2982 const char* pMarkerName
2983 f32[4] color
2984}
2985
Jesse Hall56d386a2016-07-26 15:20:40 -07002986@extension("VK_NV_dedicated_allocation")
2987class VkDedicatedAllocationImageCreateInfoNV {
2988 VkStructureType sType
2989 const void* pNext
2990 VkBool32 dedicatedAllocation
2991}
2992
2993@extension("VK_NV_dedicated_allocation")
2994class VkDedicatedAllocationBufferCreateInfoNV {
2995 VkStructureType sType
2996 const void* pNext
2997 VkBool32 dedicatedAllocation
2998}
2999
3000@extension("VK_NV_dedicated_allocation")
3001class VkDedicatedAllocationMemoryAllocateInfoNV {
3002 VkStructureType sType
3003 const void* pNext
3004 VkImage image
3005 VkBuffer buffer
3006}
3007
Chris Forbes1194ede2016-12-30 16:29:25 +13003008@extension("VK_KHR_get_physical_device_properties2")
3009class VkPhysicalDeviceFeatures2KHR {
3010 VkStructureType sType
3011 void* pNext
3012 VkPhysicalDeviceFeatures features
3013}
3014
3015@extension("VK_KHR_get_physical_device_properties2")
3016class VkPhysicalDeviceProperties2KHR {
3017 VkStructureType sType
3018 void* pNext
3019 VkPhysicalDeviceProperties properties
3020}
3021
3022@extension("VK_KHR_get_physical_device_properties2")
3023class VkFormatProperties2KHR {
3024 VkStructureType sType
3025 void* pNext
3026 VkFormatProperties formatProperties
3027}
3028
3029@extension("VK_KHR_get_physical_device_properties2")
3030class VkImageFormatProperties2KHR {
3031 VkStructureType sType
3032 void* pNext
3033 VkImageFormatProperties imageFormatProperties
3034}
3035
3036@extension("VK_KHR_get_physical_device_properties2")
3037class VkPhysicalDeviceImageFormatInfo2KHR {
3038 VkStructureType sType
3039 const void* pNext
3040 VkFormat format
3041 VkImageType type
3042 VkImageTiling tiling
3043 VkImageUsageFlags usage
3044 VkImageCreateFlags flags
3045}
3046
3047@extension("VK_KHR_get_physical_device_properties2")
3048class VkQueueFamilyProperties2KHR {
3049 VkStructureType sType
3050 void* pNext
3051 VkQueueFamilyProperties queueFamilyProperties
3052}
3053
3054@extension("VK_KHR_get_physical_device_properties2")
3055class VkPhysicalDeviceMemoryProperties2KHR {
3056 VkStructureType sType
3057 void* pNext
3058 VkPhysicalDeviceMemoryProperties memoryProperties
3059}
3060
3061@extension("VK_KHR_get_physical_device_properties2")
3062class VkSparseImageFormatProperties2KHR {
3063 VkStructureType sType
3064 void* pNext
3065 VkSparseImageFormatProperties properties
3066}
3067
3068@extension("VK_KHR_get_physical_device_properties2")
3069class VkPhysicalDeviceSparseImageFormatInfo2KHR {
3070 VkStructureType sType
3071 const void* pNext
3072 VkFormat format
3073 VkImageType type
3074 VkSampleCountFlagBits samples
3075 VkImageUsageFlags usage
3076 VkImageTiling tiling
3077}
3078
Chris Forbes289cb792016-12-30 15:03:55 +13003079@extension("VK_KHR_incremental_present")
3080class VkRectLayerKHR {
3081 VkOffset2D offset
3082 VkExtent2D extent
3083 u32 layer
3084}
3085
3086@extension("VK_KHR_incremental_present")
3087class VkPresentRegionKHR {
3088 u32 rectangleCount
3089 const VkRectLayerKHR* pRectangles
3090}
3091
3092@extension("VK_KHR_incremental_present")
3093class VkPresentRegionsKHR {
3094 VkStructureType sType
3095 const void* pNext
3096 u32 swapchainCount
3097 const VkPresentRegionKHR* pRegions
3098}
3099
3100@extension("VK_NV_external_memory_capabilities")
3101class VkExternalImageFormatPropertiesNV {
3102 VkImageFormatProperties imageFormatProperties
3103 VkExternalMemoryFeatureFlagsNV externalMemoryFeatures
3104 VkExternalMemoryHandleTypeFlagsNV exportFromImportedHandleTypes
3105 VkExternalMemoryHandleTypeFlagsNV compatibleHandleTypes
3106}
3107
3108@extension("VK_NV_external_memory")
3109class VkExternalMemoryImageCreateInfoNV {
3110 VkStructureType sType
3111 const void* pNext
3112 VkExternalMemoryHandleTypeFlagsNV handleTypes
3113}
3114
3115@extension("VK_NV_external_memory")
3116class VkExportMemoryAllocateInfoNV {
3117 VkStructureType sType
3118 const void* pNext
3119 VkExternalMemoryHandleTypeFlagsNV handleTypes
3120}
3121
3122@extension("VK_NV_external_memory_win32")
3123class VkImportMemoryWin32HandleInfoNV {
3124 VkStructureType sType
3125 const void* pNext
3126 VkExternalMemoryHandleTypeFlagsNV handleType
3127 platform.HANDLE handle
3128}
3129
3130@extension("VK_NV_external_memory_win32")
3131class VkExportMemoryWin32HandleInfoNV {
3132 VkStructureType sType
3133 const void* pNext
3134 const platform.SECURITY_ATTRIBUTES* pAttributes
3135 u32 dwAccess
3136}
3137
3138@extension("VK_NV_win32_keyed_mutex")
3139class VkWin32KeyedMutexAcquireReleaseInfoNV {
3140 VkStructureType sType
3141 const void* pNext
3142 u32 acquireCount
3143 const VkDeviceMemory* pAcquireSyncs
3144 const u64* pAcquireKeys
3145 const u32* pAcquireTimeoutMilliseconds
3146 u32 releaseCount
3147 const VkDeviceMemory* pReleaseSyncs
3148 const u64* pReleaseKeys
3149}
3150
3151@extension("VK_EXT_validation_flags")
3152class VkValidationFlagsEXT {
3153 VkStructureType sType
3154 const void* pNext
3155 u32 disabledValidationCheckCount
3156 VkValidationCheckEXT* pDisabledValidationChecks
3157}
3158
3159@extension("VK_NVX_device_generated_commands")
3160class VkDeviceGeneratedCommandsFeaturesNVX {
3161 VkStructureType sType
3162 const void* pNext
3163 VkBool32 computeBindingPointSupport
3164}
3165
3166@extension("VK_NVX_device_generated_commands")
3167class VkDeviceGeneratedCommandsLimitsNVX {
3168 VkStructureType sType
3169 const void* pNext
3170 u32 maxIndirectCommandsLayoutTokenCount
3171 u32 maxObjectEntryCounts
3172 u32 minSequenceCountBufferOffsetAlignment
3173 u32 minSequenceIndexBufferOffsetAlignment
3174 u32 minCommandsTokenBufferOffsetAlignment
3175}
3176
3177@extension("VK_NVX_device_generated_commands")
3178class VkIndirectCommandsTokenNVX {
3179 VkIndirectCommandsTokenTypeNVX tokenType
3180 VkBuffer buffer
3181 VkDeviceSize offset
3182}
3183
3184@extension("VK_NVX_device_generated_commands")
3185class VkIndirectCommandsLayoutTokenNVX {
3186 VkIndirectCommandsTokenTypeNVX tokenType
3187 u32 bindingUnit
3188 u32 dynamicCount
3189 u32 divisor
3190}
3191
3192@extension("VK_NVX_device_generated_commands")
3193class VkIndirectCommandsLayoutCreateInfoNVX {
3194 VkStructureType sType
3195 const void* pNext
3196 VkPipelineBindPoint pipelineBindPoint
3197 VkIndirectCommandsLayoutUsageFlagsNVX flags
3198 u32 tokenCount
3199 const VkIndirectCommandsLayoutTokenNVX* pTokens
3200}
3201
3202@extension("VK_NVX_device_generated_commands")
3203class VkCmdProcessCommandsInfoNVX {
3204 VkStructureType sType
3205 const void* pNext
3206 VkObjectTableNVX objectTable
3207 VkIndirectCommandsLayoutNVX indirectCommandsLayout
3208 u32 indirectCommandsTokenCount
3209 const VkIndirectCommandsTokenNVX* pIndirectCommandsTokens
3210 u32 maxSequencesCount
3211 VkCommandBuffer targetCommandBuffer
3212 VkBuffer sequencesCountBuffer
3213 VkDeviceSize sequencesCountOffset
3214 VkBuffer sequencesIndexBuffer
3215 VkDeviceSize sequencesIndexOffset
3216}
3217
3218@extension("VK_NVX_device_generated_commands")
3219class VkCmdReserveSpaceForCommandsInfoNVX {
3220 VkStructureType sType
3221 const void* pNext
3222 VkObjectTableNVX objectTable
3223 VkIndirectCommandsLayoutNVX indirectCommandsLayout
3224 u32 maxSequencesCount
3225}
3226
3227@extension("VK_NVX_device_generated_commands")
3228class VkObjectTableCreateInfoNVX {
3229 VkStructureType sType
3230 const void* pNext
3231 u32 objectCount
3232 const VkObjectEntryTypeNVX* pObjectEntryTypes
3233 const u32* pObjectEntryCounts
3234 const VkObjectEntryUsageFlagsNVX* pObjectEntryUsageFlags
3235 u32 maxUniformBuffersPerDescriptor
3236 u32 maxStorageBuffersPerDescriptor
3237 u32 maxStorageImagesPerDescriptor
3238 u32 maxSampledImagesPerDescriptor
3239 u32 maxPipelineLayouts
3240}
3241
3242@extension("VK_NVX_device_generated_commands")
3243class VkObjectTableEntryNVX {
3244 VkObjectEntryTypeNVX type
3245 VkObjectEntryUsageFlagsNVX flags
3246}
3247
3248@extension("VK_NVX_device_generated_commands")
3249class VkObjectTablePipelineEntryNVX {
3250 VkObjectEntryTypeNVX type
3251 VkObjectEntryUsageFlagsNVX flags
3252 VkPipeline pipeline
3253}
3254
3255@extension("VK_NVX_device_generated_commands")
3256class VkObjectTableDescriptorSetEntryNVX {
3257 VkObjectEntryTypeNVX type
3258 VkObjectEntryUsageFlagsNVX flags
3259 VkPipelineLayout pipelineLayout
3260 VkDescriptorSet descriptorSet
3261}
3262
3263@extension("VK_NVX_device_generated_commands")
3264class VkObjectTableVertexBufferEntryNVX {
3265 VkObjectEntryTypeNVX type
3266 VkObjectEntryUsageFlagsNVX flags
3267 VkBuffer buffer
3268}
3269
3270@extension("VK_NVX_device_generated_commands")
3271class VkObjectTableIndexBufferEntryNVX {
3272 VkObjectEntryTypeNVX type
3273 VkObjectEntryUsageFlagsNVX flags
3274 VkBuffer buffer
3275}
3276
3277@extension("VK_NVX_device_generated_commands")
3278class VkObjectTablePushConstantEntryNVX {
3279 VkObjectEntryTypeNVX type
3280 VkObjectEntryUsageFlagsNVX flags
3281 VkPipelineLayout pipelineLayout
3282 VkShaderStageFlags stageFlags
3283}
3284
3285
Jesse Hall1356b0d2015-11-23 17:24:58 -08003286
Jesse Halld27f6aa2015-08-15 17:58:48 -07003287////////////////
3288// Commands //
3289////////////////
3290
3291// Function pointers. TODO: add support for function pointers.
3292
3293@external type void* PFN_vkVoidFunction
3294@pfn cmd void vkVoidFunction() {
3295}
3296
Jesse Hall3fbc8562015-11-29 22:10:52 -08003297@external type void* PFN_vkAllocationFunction
3298@pfn cmd void* vkAllocationFunction(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003299 void* pUserData,
3300 platform.size_t size,
3301 platform.size_t alignment,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003302 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08003303 return ?
3304}
3305
Jesse Hall3fbc8562015-11-29 22:10:52 -08003306@external type void* PFN_vkReallocationFunction
3307@pfn cmd void* vkReallocationFunction(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003308 void* pUserData,
3309 void* pOriginal,
3310 platform.size_t size,
3311 platform.size_t alignment,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003312 VkSystemAllocationScope allocationScope) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003313 return ?
3314}
3315
3316@external type void* PFN_vkFreeFunction
3317@pfn cmd void vkFreeFunction(
3318 void* pUserData,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003319 void* pMemory) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003320}
3321
Jesse Hall3fbc8562015-11-29 22:10:52 -08003322@external type void* PFN_vkInternalAllocationNotification
3323@pfn cmd void vkInternalAllocationNotification(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003324 void* pUserData,
3325 platform.size_t size,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003326 VkInternalAllocationType allocationType,
3327 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08003328}
3329
3330@external type void* PFN_vkInternalFreeNotification
3331@pfn cmd void vkInternalFreeNotification(
3332 void* pUserData,
3333 platform.size_t size,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003334 VkInternalAllocationType allocationType,
3335 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08003336}
Jesse Halld27f6aa2015-08-15 17:58:48 -07003337
3338// Global functions
3339
3340@threadSafety("system")
3341cmd VkResult vkCreateInstance(
3342 const VkInstanceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003343 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003344 VkInstance* pInstance) {
3345 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO)
3346
3347 instance := ?
3348 pInstance[0] = instance
3349 State.Instances[instance] = new!InstanceObject()
3350
Jesse Hall3dd678a2016-01-08 21:52:01 -08003351 layers := pCreateInfo.ppEnabledLayerNames[0:pCreateInfo.enabledLayerCount]
3352 extensions := pCreateInfo.ppEnabledExtensionNames[0:pCreateInfo.enabledExtensionCount]
Jesse Halld27f6aa2015-08-15 17:58:48 -07003353
3354 return ?
3355}
3356
3357@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003358cmd void vkDestroyInstance(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003359 VkInstance instance,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003360 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003361 instanceObject := GetInstance(instance)
3362
3363 State.Instances[instance] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003364}
3365
3366@threadSafety("system")
3367cmd VkResult vkEnumeratePhysicalDevices(
3368 VkInstance instance,
3369 u32* pPhysicalDeviceCount,
3370 VkPhysicalDevice* pPhysicalDevices) {
3371 instanceObject := GetInstance(instance)
3372
3373 physicalDeviceCount := as!u32(?)
3374 pPhysicalDeviceCount[0] = physicalDeviceCount
3375 physicalDevices := pPhysicalDevices[0:physicalDeviceCount]
3376
3377 for i in (0 .. physicalDeviceCount) {
3378 physicalDevice := ?
3379 physicalDevices[i] = physicalDevice
3380 if !(physicalDevice in State.PhysicalDevices) {
3381 State.PhysicalDevices[physicalDevice] = new!PhysicalDeviceObject(instance: instance)
3382 }
3383 }
3384
3385 return ?
3386}
3387
3388cmd PFN_vkVoidFunction vkGetDeviceProcAddr(
3389 VkDevice device,
3390 const char* pName) {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003391 if device != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003392 device := GetDevice(device)
3393 }
3394
3395 return ?
3396}
3397
3398cmd PFN_vkVoidFunction vkGetInstanceProcAddr(
3399 VkInstance instance,
3400 const char* pName) {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003401 if instance != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003402 instanceObject := GetInstance(instance)
3403 }
3404
3405 return ?
3406}
3407
Jesse Hall606a54e2015-11-19 22:17:28 -08003408cmd void vkGetPhysicalDeviceProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003409 VkPhysicalDevice physicalDevice,
3410 VkPhysicalDeviceProperties* pProperties) {
3411 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3412
3413 properties := ?
3414 pProperties[0] = properties
Jesse Halld27f6aa2015-08-15 17:58:48 -07003415}
3416
Jesse Hall606a54e2015-11-19 22:17:28 -08003417cmd void vkGetPhysicalDeviceQueueFamilyProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003418 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003419 u32* pQueueFamilyPropertyCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003420 VkQueueFamilyProperties* pQueueFamilyProperties) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003421 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003422 // TODO: Figure out how to express fetch-count-or-properties
3423 // This version fails 'apic validate' with 'fence not allowed in
3424 // *semantic.Branch'. Other attempts have failed with the same or other
3425 // errors.
3426 // if pQueueFamilyProperties != null {
3427 // queuesProperties := pQueueFamilyProperties[0:pCount[0]]
3428 // for i in (0 .. pCount[0]) {
3429 // queueProperties := as!VkQueueFamilyProperties(?)
3430 // queuesProperties[i] = queueProperties
3431 // }
3432 // } else {
3433 // count := ?
3434 // pCount[0] = count
3435 // }
Jesse Halld27f6aa2015-08-15 17:58:48 -07003436}
3437
Jesse Hall606a54e2015-11-19 22:17:28 -08003438cmd void vkGetPhysicalDeviceMemoryProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003439 VkPhysicalDevice physicalDevice,
3440 VkPhysicalDeviceMemoryProperties* pMemoryProperties) {
3441 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3442
3443 memoryProperties := ?
3444 pMemoryProperties[0] = memoryProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07003445}
3446
Jesse Hall606a54e2015-11-19 22:17:28 -08003447cmd void vkGetPhysicalDeviceFeatures(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003448 VkPhysicalDevice physicalDevice,
3449 VkPhysicalDeviceFeatures* pFeatures) {
3450 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3451
3452 features := ?
3453 pFeatures[0] = features
Jesse Halld27f6aa2015-08-15 17:58:48 -07003454}
3455
Jesse Hall606a54e2015-11-19 22:17:28 -08003456cmd void vkGetPhysicalDeviceFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003457 VkPhysicalDevice physicalDevice,
3458 VkFormat format,
3459 VkFormatProperties* pFormatProperties) {
3460 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3461
3462 formatProperties := ?
3463 pFormatProperties[0] = formatProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07003464}
3465
Jesse Halla9e57032015-11-30 01:03:10 -08003466cmd VkResult vkGetPhysicalDeviceImageFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003467 VkPhysicalDevice physicalDevice,
3468 VkFormat format,
3469 VkImageType type,
3470 VkImageTiling tiling,
3471 VkImageUsageFlags usage,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003472 VkImageCreateFlags flags,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003473 VkImageFormatProperties* pImageFormatProperties) {
3474 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3475
3476 imageFormatProperties := ?
3477 pImageFormatProperties[0] = imageFormatProperties
Jesse Halla9e57032015-11-30 01:03:10 -08003478
3479 return ?
Jesse Halld27f6aa2015-08-15 17:58:48 -07003480}
3481
Jesse Halld27f6aa2015-08-15 17:58:48 -07003482
3483// Device functions
3484
3485@threadSafety("system")
3486cmd VkResult vkCreateDevice(
3487 VkPhysicalDevice physicalDevice,
3488 const VkDeviceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003489 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003490 VkDevice* pDevice) {
3491 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO)
3492 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3493
3494 device := ?
3495 pDevice[0] = device
3496 State.Devices[device] = new!DeviceObject(physicalDevice: physicalDevice)
3497
3498 return ?
3499}
3500
3501@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003502cmd void vkDestroyDevice(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003503 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003504 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003505 deviceObject := GetDevice(device)
3506
3507 State.Devices[device] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003508}
3509
3510
3511// Extension discovery functions
3512
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003513cmd VkResult vkEnumerateInstanceLayerProperties(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003514 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003515 VkLayerProperties* pProperties) {
3516 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08003517 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07003518
3519 properties := pProperties[0:count]
3520 for i in (0 .. count) {
3521 property := ?
3522 properties[i] = property
3523 }
3524
3525 return ?
3526}
3527
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003528cmd VkResult vkEnumerateInstanceExtensionProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003529 const char* pLayerName,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003530 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003531 VkExtensionProperties* pProperties) {
3532 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08003533 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07003534
3535 properties := pProperties[0:count]
3536 for i in (0 .. count) {
3537 property := ?
3538 properties[i] = property
3539 }
3540
3541 return ?
3542}
3543
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003544cmd VkResult vkEnumerateDeviceLayerProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003545 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003546 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003547 VkLayerProperties* pProperties) {
3548 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3549 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08003550 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07003551
3552 properties := pProperties[0:count]
3553 for i in (0 .. count) {
3554 property := ?
3555 properties[i] = property
3556 }
3557
3558 return ?
3559}
3560
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003561cmd VkResult vkEnumerateDeviceExtensionProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003562 VkPhysicalDevice physicalDevice,
3563 const char* pLayerName,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003564 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003565 VkExtensionProperties* pProperties) {
3566 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3567
3568 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08003569 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07003570
3571 properties := pProperties[0:count]
3572 for i in (0 .. count) {
3573 property := ?
3574 properties[i] = property
3575 }
3576
3577 return ?
3578}
3579
3580
3581// Queue functions
3582
3583@threadSafety("system")
Jesse Hall606a54e2015-11-19 22:17:28 -08003584cmd void vkGetDeviceQueue(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003585 VkDevice device,
3586 u32 queueFamilyIndex,
3587 u32 queueIndex,
3588 VkQueue* pQueue) {
3589 deviceObject := GetDevice(device)
3590
3591 queue := ?
3592 pQueue[0] = queue
3593
3594 if !(queue in State.Queues) {
3595 State.Queues[queue] = new!QueueObject(device: device)
3596 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07003597}
3598
3599@threadSafety("app")
3600cmd VkResult vkQueueSubmit(
3601 VkQueue queue,
Jesse Halla366a512015-11-19 22:30:07 -08003602 u32 submitCount,
Jesse Hallb00daad2015-11-29 19:46:20 -08003603 const VkSubmitInfo* pSubmits,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003604 VkFence fence) {
3605 queueObject := GetQueue(queue)
3606
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003607 if fence != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003608 fenceObject := GetFence(fence)
3609 assert(fenceObject.device == queueObject.device)
3610 }
3611
Jesse Hall3fbc8562015-11-29 22:10:52 -08003612 // commandBuffers := pcommandBuffers[0:commandBufferCount]
3613 // for i in (0 .. commandBufferCount) {
3614 // commandBuffer := commandBuffers[i]
3615 // commandBufferObject := GetCommandBuffer(commandBuffer)
3616 // assert(commandBufferObject.device == queueObject.device)
Jesse Halla366a512015-11-19 22:30:07 -08003617 //
Jesse Hall3fbc8562015-11-29 22:10:52 -08003618 // validate("QueueCheck", commandBufferObject.queueFlags in queueObject.flags,
3619 // "vkQueueSubmit: enqueued commandBuffer requires missing queue capabilities.")
Jesse Halla366a512015-11-19 22:30:07 -08003620 // }
Jesse Halld27f6aa2015-08-15 17:58:48 -07003621
3622 return ?
3623}
3624
3625@threadSafety("system")
3626cmd VkResult vkQueueWaitIdle(
3627 VkQueue queue) {
3628 queueObject := GetQueue(queue)
3629
3630 return ?
3631}
3632
3633@threadSafety("system")
3634cmd VkResult vkDeviceWaitIdle(
3635 VkDevice device) {
3636 deviceObject := GetDevice(device)
3637
3638 return ?
3639}
3640
3641
3642// Memory functions
3643
3644@threadSafety("system")
Jesse Hall3fbc8562015-11-29 22:10:52 -08003645cmd VkResult vkAllocateMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003646 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003647 const VkMemoryAllocateInfo* pAllocateInfo,
3648 const VkAllocationCallbacks* pAllocator,
3649 VkDeviceMemory* pMemory) {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08003650 assert(pAllocateInfo.sType == VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003651 deviceObject := GetDevice(device)
3652
Jesse Hall3fbc8562015-11-29 22:10:52 -08003653 memory := ?
3654 pMemory[0] = memory
3655 State.DeviceMemories[memory] = new!DeviceMemoryObject(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003656 device: device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003657 allocationSize: pAllocateInfo[0].allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003658
3659 return ?
3660}
3661
3662@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003663cmd void vkFreeMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003664 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003665 VkDeviceMemory memory,
3666 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003667 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003668 memoryObject := GetDeviceMemory(memory)
3669 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003670
3671 // Check that no objects are still bound before freeing.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003672 validate("MemoryCheck", len(memoryObject.boundObjects) == 0,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003673 "vkFreeMemory: objects still bound")
Jesse Hall3fbc8562015-11-29 22:10:52 -08003674 validate("MemoryCheck", len(memoryObject.boundCommandBuffers) == 0,
3675 "vkFreeMemory: commandBuffers still bound")
3676 State.DeviceMemories[memory] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003677}
3678
3679@threadSafety("app")
3680cmd VkResult vkMapMemory(
3681 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003682 VkDeviceMemory memory,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003683 VkDeviceSize offset,
3684 VkDeviceSize size,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003685 VkMemoryMapFlags flags,
3686 void** ppData) {
3687 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003688 memoryObject := GetDeviceMemory(memory)
3689 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003690
3691 assert(flags == as!VkMemoryMapFlags(0))
Jesse Hall3fbc8562015-11-29 22:10:52 -08003692 assert((offset + size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003693
3694 return ?
3695}
3696
3697@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003698cmd void vkUnmapMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003699 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003700 VkDeviceMemory memory) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003701 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003702 memoryObject := GetDeviceMemory(memory)
3703 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003704}
3705
3706cmd VkResult vkFlushMappedMemoryRanges(
3707 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003708 u32 memoryRangeCount
3709 const VkMappedMemoryRange* pMemoryRanges) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003710 deviceObject := GetDevice(device)
3711
Jesse Hall3fbc8562015-11-29 22:10:52 -08003712 memoryRanges := pMemoryRanges[0:memoryRangeCount]
3713 for i in (0 .. memoryRangeCount) {
3714 memoryRange := memoryRanges[i]
3715 memoryObject := GetDeviceMemory(memoryRange.memory)
3716 assert(memoryObject.device == device)
3717 assert((memoryRange.offset + memoryRange.size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003718 }
3719
3720 return ?
3721}
3722
3723cmd VkResult vkInvalidateMappedMemoryRanges(
3724 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003725 u32 memoryRangeCount,
3726 const VkMappedMemoryRange* pMemoryRanges) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003727 deviceObject := GetDevice(device)
3728
Jesse Hall3fbc8562015-11-29 22:10:52 -08003729 memoryRanges := pMemoryRanges[0:memoryRangeCount]
3730 for i in (0 .. memoryRangeCount) {
3731 memoryRange := memoryRanges[i]
3732 memoryObject := GetDeviceMemory(memoryRange.memory)
3733 assert(memoryObject.device == device)
3734 assert((memoryRange.offset + memoryRange.size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003735 }
3736
3737 return ?
3738}
3739
3740
3741// Memory management API functions
3742
Jesse Hall606a54e2015-11-19 22:17:28 -08003743cmd void vkGetDeviceMemoryCommitment(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003744 VkDevice device,
3745 VkDeviceMemory memory,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003746 VkDeviceSize* pCommittedMemoryInBytes) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003747 deviceObject := GetDevice(device)
3748
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003749 if memory != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003750 memoryObject := GetDeviceMemory(memory)
3751 assert(memoryObject.device == device)
3752 }
3753
3754 committedMemoryInBytes := ?
3755 pCommittedMemoryInBytes[0] = committedMemoryInBytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07003756}
3757
Jesse Hall606a54e2015-11-19 22:17:28 -08003758cmd void vkGetBufferMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003759 VkDevice device,
3760 VkBuffer buffer,
3761 VkMemoryRequirements* pMemoryRequirements) {
3762 deviceObject := GetDevice(device)
3763 bufferObject := GetBuffer(buffer)
3764 assert(bufferObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003765}
3766
3767cmd VkResult vkBindBufferMemory(
3768 VkDevice device,
3769 VkBuffer buffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003770 VkDeviceMemory memory,
3771 VkDeviceSize memoryOffset) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003772 deviceObject := GetDevice(device)
3773 bufferObject := GetBuffer(buffer)
3774 assert(bufferObject.device == device)
3775
3776 // Unbind buffer from previous memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003777 if bufferObject.memory != NULL_HANDLE {
3778 memoryObject := GetDeviceMemory(bufferObject.memory)
3779 memoryObject.boundObjects[as!u64(buffer)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003780 }
3781
3782 // Bind buffer to given memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003783 if memory != NULL_HANDLE {
3784 memoryObject := GetDeviceMemory(memory)
3785 assert(memoryObject.device == device)
3786 memoryObject.boundObjects[as!u64(buffer)] = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003787 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08003788 bufferObject.memory = memory
3789 bufferObject.memoryOffset = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003790
3791 return ?
3792}
3793
Jesse Hall606a54e2015-11-19 22:17:28 -08003794cmd void vkGetImageMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003795 VkDevice device,
3796 VkImage image,
3797 VkMemoryRequirements* pMemoryRequirements) {
3798 deviceObject := GetDevice(device)
3799 imageObject := GetImage(image)
3800 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003801}
3802
3803cmd VkResult vkBindImageMemory(
3804 VkDevice device,
3805 VkImage image,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003806 VkDeviceMemory memory,
3807 VkDeviceSize memoryOffset) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003808 deviceObject := GetDevice(device)
3809 imageObject := GetImage(image)
3810 assert(imageObject.device == device)
3811
3812 // Unbind image from previous memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003813 if imageObject.memory != NULL_HANDLE {
3814 memoryObject := GetDeviceMemory(imageObject.memory)
3815 memoryObject.boundObjects[as!u64(image)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003816 }
3817
3818 // Bind image to given memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003819 if memory != NULL_HANDLE {
3820 memoryObject := GetDeviceMemory(memory)
3821 assert(memoryObject.device == device)
3822 memoryObject.boundObjects[as!u64(image)] = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003823 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08003824 imageObject.memory = memory
3825 imageObject.memoryOffset = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003826
3827 return ?
3828}
3829
Jesse Hall606a54e2015-11-19 22:17:28 -08003830cmd void vkGetImageSparseMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003831 VkDevice device,
3832 VkImage image,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003833 u32* pSparseMemoryRequirementCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003834 VkSparseImageMemoryRequirements* pSparseMemoryRequirements) {
3835 deviceObject := GetDevice(device)
3836 imageObject := GetImage(image)
3837 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003838}
3839
Jesse Hall606a54e2015-11-19 22:17:28 -08003840cmd void vkGetPhysicalDeviceSparseImageFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003841 VkPhysicalDevice physicalDevice,
3842 VkFormat format,
3843 VkImageType type,
Jesse Hall091ed9e2015-11-30 00:55:29 -08003844 VkSampleCountFlagBits samples,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003845 VkImageUsageFlags usage,
3846 VkImageTiling tiling,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003847 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003848 VkSparseImageFormatProperties* pProperties) {
3849 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003850}
3851
Jesse Halla6429252015-11-29 18:59:42 -08003852cmd VkResult vkQueueBindSparse(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003853 VkQueue queue,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003854 u32 bindInfoCount,
Jesse Halla6429252015-11-29 18:59:42 -08003855 const VkBindSparseInfo* pBindInfo,
3856 VkFence fence) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003857 queueObject := GetQueue(queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003858
3859 return ?
3860}
3861
3862
3863// Fence functions
3864
3865@threadSafety("system")
3866cmd VkResult vkCreateFence(
3867 VkDevice device,
3868 const VkFenceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003869 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003870 VkFence* pFence) {
3871 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_FENCE_CREATE_INFO)
3872 deviceObject := GetDevice(device)
3873
3874 fence := ?
3875 pFence[0] = fence
3876 State.Fences[fence] = new!FenceObject(
Jesse Halld8bade02015-11-24 10:24:18 -08003877 device: device, signaled: (pCreateInfo.flags == as!VkFenceCreateFlags(VK_FENCE_CREATE_SIGNALED_BIT)))
Jesse Halld27f6aa2015-08-15 17:58:48 -07003878
3879 return ?
3880}
3881
3882@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003883cmd void vkDestroyFence(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003884 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003885 VkFence fence,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003886 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003887 deviceObject := GetDevice(device)
3888 fenceObject := GetFence(fence)
3889 assert(fenceObject.device == device)
3890
3891 State.Fences[fence] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003892}
3893
3894@threadSafety("system")
3895cmd VkResult vkResetFences(
3896 VkDevice device,
3897 u32 fenceCount,
3898 const VkFence* pFences) {
3899 deviceObject := GetDevice(device)
3900
3901 fences := pFences[0:fenceCount]
3902 for i in (0 .. fenceCount) {
3903 fence := fences[i]
3904 fenceObject := GetFence(fence)
3905 assert(fenceObject.device == device)
3906 fenceObject.signaled = false
3907 }
3908
3909 return ?
3910}
3911
3912@threadSafety("system")
3913cmd VkResult vkGetFenceStatus(
3914 VkDevice device,
3915 VkFence fence) {
3916 deviceObject := GetDevice(device)
3917 fenceObject := GetFence(fence)
3918 assert(fenceObject.device == device)
3919
3920 return ?
3921}
3922
3923@threadSafety("system")
3924cmd VkResult vkWaitForFences(
3925 VkDevice device,
3926 u32 fenceCount,
3927 const VkFence* pFences,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003928 VkBool32 waitAll,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003929 u64 timeout) { /// timeout in nanoseconds
3930 deviceObject := GetDevice(device)
3931
3932 fences := pFences[0:fenceCount]
3933 for i in (0 .. fenceCount) {
3934 fence := fences[i]
3935 fenceObject := GetFence(fence)
3936 assert(fenceObject.device == device)
3937 }
3938
3939 return ?
3940}
3941
3942
3943// Queue semaphore functions
3944
3945@threadSafety("system")
3946cmd VkResult vkCreateSemaphore(
3947 VkDevice device,
3948 const VkSemaphoreCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003949 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003950 VkSemaphore* pSemaphore) {
3951 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO)
3952 deviceObject := GetDevice(device)
3953
3954 semaphore := ?
3955 pSemaphore[0] = semaphore
3956 State.Semaphores[semaphore] = new!SemaphoreObject(device: device)
3957
3958 return ?
3959}
3960
3961@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003962cmd void vkDestroySemaphore(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003963 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003964 VkSemaphore semaphore,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003965 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003966 deviceObject := GetDevice(device)
3967 semaphoreObject := GetSemaphore(semaphore)
3968 assert(semaphoreObject.device == device)
3969
3970 State.Semaphores[semaphore] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003971}
3972
Jesse Halld27f6aa2015-08-15 17:58:48 -07003973
3974// Event functions
3975
3976@threadSafety("system")
3977cmd VkResult vkCreateEvent(
3978 VkDevice device,
3979 const VkEventCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003980 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003981 VkEvent* pEvent) {
3982 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_EVENT_CREATE_INFO)
3983 deviceObject := GetDevice(device)
3984
3985 event := ?
3986 pEvent[0] = event
3987 State.Events[event] = new!EventObject(device: device)
3988
3989 return ?
3990}
3991
3992@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003993cmd void vkDestroyEvent(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003994 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003995 VkEvent event,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003996 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003997 deviceObject := GetDevice(device)
3998 eventObject := GetEvent(event)
3999 assert(eventObject.device == device)
4000
4001 State.Events[event] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004002}
4003
4004@threadSafety("system")
4005cmd VkResult vkGetEventStatus(
4006 VkDevice device,
4007 VkEvent event) {
4008 deviceObject := GetDevice(device)
4009 eventObject := GetEvent(event)
4010 assert(eventObject.device == device)
4011
4012 return ?
4013}
4014
4015@threadSafety("system")
4016cmd VkResult vkSetEvent(
4017 VkDevice device,
4018 VkEvent event) {
4019 deviceObject := GetDevice(device)
4020 eventObject := GetEvent(event)
4021 assert(eventObject.device == device)
4022
4023 return ?
4024}
4025
4026@threadSafety("system")
4027cmd VkResult vkResetEvent(
4028 VkDevice device,
4029 VkEvent event) {
4030 deviceObject := GetDevice(device)
4031 eventObject := GetEvent(event)
4032 assert(eventObject.device == device)
4033
4034 return ?
4035}
4036
4037
4038// Query functions
4039
4040@threadSafety("system")
4041cmd VkResult vkCreateQueryPool(
4042 VkDevice device,
4043 const VkQueryPoolCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004044 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004045 VkQueryPool* pQueryPool) {
4046 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO)
4047 deviceObject := GetDevice(device)
4048
4049 queryPool := ?
4050 pQueryPool[0] = queryPool
4051 State.QueryPools[queryPool] = new!QueryPoolObject(device: device)
4052
4053 return ?
4054}
4055
4056@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004057cmd void vkDestroyQueryPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004058 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004059 VkQueryPool queryPool,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004060 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004061 deviceObject := GetDevice(device)
4062 queryPoolObject := GetQueryPool(queryPool)
4063 assert(queryPoolObject.device == device)
4064
4065 State.QueryPools[queryPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004066}
4067
4068@threadSafety("system")
4069cmd VkResult vkGetQueryPoolResults(
4070 VkDevice device,
4071 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004072 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004073 u32 queryCount,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004074 platform.size_t dataSize,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004075 void* pData,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004076 VkDeviceSize stride,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004077 VkQueryResultFlags flags) {
4078 deviceObject := GetDevice(device)
4079 queryPoolObject := GetQueryPool(queryPool)
4080 assert(queryPoolObject.device == device)
4081
Jesse Halld27f6aa2015-08-15 17:58:48 -07004082 data := pData[0:dataSize]
4083
4084 return ?
4085}
4086
4087// Buffer functions
4088
4089@threadSafety("system")
4090cmd VkResult vkCreateBuffer(
4091 VkDevice device,
4092 const VkBufferCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004093 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004094 VkBuffer* pBuffer) {
4095 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO)
4096 deviceObject := GetDevice(device)
4097
4098 buffer := ?
4099 pBuffer[0] = buffer
4100 State.Buffers[buffer] = new!BufferObject(device: device)
4101
4102 return ?
4103}
4104
4105@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004106cmd void vkDestroyBuffer(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004107 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004108 VkBuffer buffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004109 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004110 deviceObject := GetDevice(device)
4111 bufferObject := GetBuffer(buffer)
4112 assert(bufferObject.device == device)
4113
Jesse Hall3fbc8562015-11-29 22:10:52 -08004114 assert(bufferObject.memory == 0)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004115 State.Buffers[buffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004116}
4117
4118
4119// Buffer view functions
4120
4121@threadSafety("system")
4122cmd VkResult vkCreateBufferView(
4123 VkDevice device,
4124 const VkBufferViewCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004125 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004126 VkBufferView* pView) {
4127 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO)
4128 deviceObject := GetDevice(device)
4129
4130 bufferObject := GetBuffer(pCreateInfo.buffer)
4131 assert(bufferObject.device == device)
4132
4133 view := ?
4134 pView[0] = view
4135 State.BufferViews[view] = new!BufferViewObject(device: device, buffer: pCreateInfo.buffer)
4136
4137 return ?
4138}
4139
4140@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004141cmd void vkDestroyBufferView(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004142 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004143 VkBufferView bufferView,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004144 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004145 deviceObject := GetDevice(device)
4146 bufferViewObject := GetBufferView(bufferView)
4147 assert(bufferViewObject.device == device)
4148
4149 State.BufferViews[bufferView] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004150}
4151
4152
4153// Image functions
4154
4155@threadSafety("system")
4156cmd VkResult vkCreateImage(
4157 VkDevice device,
4158 const VkImageCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004159 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004160 VkImage* pImage) {
4161 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO)
4162 deviceObject := GetDevice(device)
4163
4164 image := ?
4165 pImage[0] = image
4166 State.Images[image] = new!ImageObject(device: device)
4167
4168 return ?
4169}
4170
4171@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004172cmd void vkDestroyImage(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004173 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004174 VkImage image,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004175 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004176 deviceObject := GetDevice(device)
4177 imageObject := GetImage(image)
4178 assert(imageObject.device == device)
4179
Jesse Hall3fbc8562015-11-29 22:10:52 -08004180 assert(imageObject.memory == 0)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004181 State.Images[image] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004182}
4183
Jesse Hall606a54e2015-11-19 22:17:28 -08004184cmd void vkGetImageSubresourceLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004185 VkDevice device,
4186 VkImage image,
4187 const VkImageSubresource* pSubresource,
4188 VkSubresourceLayout* pLayout) {
4189 deviceObject := GetDevice(device)
4190 imageObject := GetImage(image)
4191 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004192}
4193
4194
4195// Image view functions
4196
4197@threadSafety("system")
4198cmd VkResult vkCreateImageView(
4199 VkDevice device,
4200 const VkImageViewCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004201 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004202 VkImageView* pView) {
4203 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO)
4204 deviceObject := GetDevice(device)
4205
4206 imageObject := GetImage(pCreateInfo.image)
4207 assert(imageObject.device == device)
4208
4209 view := ?
4210 pView[0] = view
4211 State.ImageViews[view] = new!ImageViewObject(device: device, image: pCreateInfo.image)
4212
4213 return ?
4214}
4215
4216@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004217cmd void vkDestroyImageView(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004218 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004219 VkImageView imageView,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004220 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004221 deviceObject := GetDevice(device)
4222 imageViewObject := GetImageView(imageView)
4223 assert(imageViewObject.device == device)
4224
4225 State.ImageViews[imageView] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004226}
4227
4228
4229// Shader functions
4230
4231cmd VkResult vkCreateShaderModule(
4232 VkDevice device,
4233 const VkShaderModuleCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004234 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004235 VkShaderModule* pShaderModule) {
4236 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO)
4237 deviceObject := GetDevice(device)
4238
4239 shaderModule := ?
4240 pShaderModule[0] = shaderModule
4241 State.ShaderModules[shaderModule] = new!ShaderModuleObject(device: device)
4242
4243 return ?
4244}
4245
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004246cmd void vkDestroyShaderModule(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004247 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004248 VkShaderModule shaderModule,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004249 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004250 deviceObject := GetDevice(device)
4251 shaderModuleObject := GetShaderModule(shaderModule)
4252 assert(shaderModuleObject.device == device)
4253
4254 State.ShaderModules[shaderModule] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004255}
4256
Jesse Halld27f6aa2015-08-15 17:58:48 -07004257
4258// Pipeline functions
4259
4260cmd VkResult vkCreatePipelineCache(
4261 VkDevice device,
4262 const VkPipelineCacheCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004263 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004264 VkPipelineCache* pPipelineCache) {
4265 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO)
4266 deviceObject := GetDevice(device)
4267
4268 pipelineCache := ?
4269 pPipelineCache[0] = pipelineCache
4270 State.PipelineCaches[pipelineCache] = new!PipelineCacheObject(device: device)
4271
4272 return ?
4273}
4274
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004275cmd void vkDestroyPipelineCache(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004276 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004277 VkPipelineCache pipelineCache,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004278 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004279 deviceObject := GetDevice(device)
4280 pipelineCacheObject := GetPipelineCache(pipelineCache)
4281 assert(pipelineCacheObject.device == device)
4282
4283 State.PipelineCaches[pipelineCache] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004284}
4285
Jesse Halld27f6aa2015-08-15 17:58:48 -07004286cmd VkResult vkGetPipelineCacheData(
4287 VkDevice device,
4288 VkPipelineCache pipelineCache,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004289 platform.size_t* pDataSize,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004290 void* pData) {
4291 deviceObject := GetDevice(device)
4292 pipelineCacheObject := GetPipelineCache(pipelineCache)
4293 assert(pipelineCacheObject.device == device)
4294
4295 return ?
4296}
4297
4298cmd VkResult vkMergePipelineCaches(
4299 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004300 VkPipelineCache dstCache,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004301 u32 srcCacheCount,
4302 const VkPipelineCache* pSrcCaches) {
4303 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004304 dstCacheObject := GetPipelineCache(dstCache)
4305 assert(dstCacheObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004306
4307 srcCaches := pSrcCaches[0:srcCacheCount]
4308 for i in (0 .. srcCacheCount) {
4309 srcCache := srcCaches[i]
4310 srcCacheObject := GetPipelineCache(srcCache)
4311 assert(srcCacheObject.device == device)
4312 }
4313
4314 return ?
4315}
4316
4317cmd VkResult vkCreateGraphicsPipelines(
4318 VkDevice device,
4319 VkPipelineCache pipelineCache,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004320 u32 createInfoCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004321 const VkGraphicsPipelineCreateInfo* pCreateInfos,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004322 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004323 VkPipeline* pPipelines) {
4324 deviceObject := GetDevice(device)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004325 if pipelineCache != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004326 pipelineCacheObject := GetPipelineCache(pipelineCache)
4327 assert(pipelineCacheObject.device == device)
4328 }
4329
Jesse Hall03b6fe12015-11-24 12:44:21 -08004330 createInfos := pCreateInfos[0:createInfoCount]
4331 pipelines := pPipelines[0:createInfoCount]
4332 for i in (0 .. createInfoCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004333 pipeline := ?
4334 pipelines[i] = pipeline
4335 State.Pipelines[pipeline] = new!PipelineObject(device: device)
4336 }
4337
4338 return ?
4339}
4340
4341cmd VkResult vkCreateComputePipelines(
4342 VkDevice device,
4343 VkPipelineCache pipelineCache,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004344 u32 createInfoCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004345 const VkComputePipelineCreateInfo* pCreateInfos,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004346 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004347 VkPipeline* pPipelines) {
4348 deviceObject := GetDevice(device)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004349 if pipelineCache != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004350 pipelineCacheObject := GetPipelineCache(pipelineCache)
4351 assert(pipelineCacheObject.device == device)
4352 }
4353
Jesse Hall03b6fe12015-11-24 12:44:21 -08004354 createInfos := pCreateInfos[0:createInfoCount]
4355 pipelines := pPipelines[0:createInfoCount]
4356 for i in (0 .. createInfoCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004357 pipeline := ?
4358 pipelines[i] = pipeline
4359 State.Pipelines[pipeline] = new!PipelineObject(device: device)
4360 }
4361
4362 return ?
4363}
4364
4365@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004366cmd void vkDestroyPipeline(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004367 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004368 VkPipeline pipeline,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004369 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004370 deviceObject := GetDevice(device)
4371 pipelineObjects := GetPipeline(pipeline)
4372 assert(pipelineObjects.device == device)
4373
4374 State.Pipelines[pipeline] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004375}
4376
4377
4378// Pipeline layout functions
4379
4380@threadSafety("system")
4381cmd VkResult vkCreatePipelineLayout(
4382 VkDevice device,
4383 const VkPipelineLayoutCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004384 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004385 VkPipelineLayout* pPipelineLayout) {
4386 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO)
4387 deviceObject := GetDevice(device)
4388
4389 pipelineLayout := ?
4390 pPipelineLayout[0] = pipelineLayout
4391 State.PipelineLayouts[pipelineLayout] = new!PipelineLayoutObject(device: device)
4392
4393 return ?
4394}
4395
4396@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004397cmd void vkDestroyPipelineLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004398 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004399 VkPipelineLayout pipelineLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004400 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004401 deviceObject := GetDevice(device)
4402 pipelineLayoutObjects := GetPipelineLayout(pipelineLayout)
4403 assert(pipelineLayoutObjects.device == device)
4404
4405 State.PipelineLayouts[pipelineLayout] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004406}
4407
4408
4409// Sampler functions
4410
4411@threadSafety("system")
4412cmd VkResult vkCreateSampler(
4413 VkDevice device,
4414 const VkSamplerCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004415 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004416 VkSampler* pSampler) {
4417 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO)
4418 deviceObject := GetDevice(device)
4419
4420 sampler := ?
4421 pSampler[0] = sampler
4422 State.Samplers[sampler] = new!SamplerObject(device: device)
4423
4424 return ?
4425}
4426
4427@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004428cmd void vkDestroySampler(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004429 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004430 VkSampler sampler,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004431 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004432 deviceObject := GetDevice(device)
4433 samplerObject := GetSampler(sampler)
4434 assert(samplerObject.device == device)
4435
4436 State.Samplers[sampler] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004437}
4438
4439
4440// Descriptor set functions
4441
4442@threadSafety("system")
4443cmd VkResult vkCreateDescriptorSetLayout(
4444 VkDevice device,
4445 const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004446 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004447 VkDescriptorSetLayout* pSetLayout) {
4448 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO)
4449 deviceObject := GetDevice(device)
4450
4451 setLayout := ?
4452 pSetLayout[0] = setLayout
4453 State.DescriptorSetLayouts[setLayout] = new!DescriptorSetLayoutObject(device: device)
4454
4455 return ?
4456}
4457
4458@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004459cmd void vkDestroyDescriptorSetLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004460 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004461 VkDescriptorSetLayout descriptorSetLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004462 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004463 deviceObject := GetDevice(device)
4464 descriptorSetLayoutObject := GetDescriptorSetLayout(descriptorSetLayout)
4465 assert(descriptorSetLayoutObject.device == device)
4466
4467 State.DescriptorSetLayouts[descriptorSetLayout] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004468}
4469
4470@threadSafety("system")
4471cmd VkResult vkCreateDescriptorPool(
4472 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004473 const VkDescriptorPoolCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004474 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004475 VkDescriptorPool* pDescriptorPool) {
4476 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO)
4477 deviceObject := GetDevice(device)
4478
4479 descriptorPool := ?
4480 pDescriptorPool[0] = descriptorPool
4481 State.DescriptorPools[descriptorPool] = new!DescriptorPoolObject(device: device)
4482
4483 return ?
4484}
4485
4486@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004487cmd void vkDestroyDescriptorPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004488 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004489 VkDescriptorPool descriptorPool,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004490 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004491 deviceObject := GetDevice(device)
4492 descriptorPoolObject := GetDescriptorPool(descriptorPool)
4493 assert(descriptorPoolObject.device == device)
4494
4495 State.DescriptorPools[descriptorPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004496}
4497
4498@threadSafety("app")
4499cmd VkResult vkResetDescriptorPool(
4500 VkDevice device,
Jesse Hallfbf97b02015-11-20 14:17:03 -08004501 VkDescriptorPool descriptorPool,
4502 VkDescriptorPoolResetFlags flags) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004503 deviceObject := GetDevice(device)
4504 descriptorPoolObject := GetDescriptorPool(descriptorPool)
4505 assert(descriptorPoolObject.device == device)
4506
4507 return ?
4508}
4509
4510@threadSafety("app")
Jesse Hall3fbc8562015-11-29 22:10:52 -08004511cmd VkResult vkAllocateDescriptorSets(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004512 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004513 const VkDescriptorSetAllocateInfo* pAllocateInfo,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004514 VkDescriptorSet* pDescriptorSets) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004515 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004516 allocInfo := pAllocateInfo[0]
Jesse Hallfbf97b02015-11-20 14:17:03 -08004517 descriptorPoolObject := GetDescriptorPool(allocInfo.descriptorPool)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004518
Jesse Hall03b6fe12015-11-24 12:44:21 -08004519 setLayouts := allocInfo.pSetLayouts[0:allocInfo.setCount]
4520 for i in (0 .. allocInfo.setCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004521 setLayout := setLayouts[i]
4522 setLayoutObject := GetDescriptorSetLayout(setLayout)
4523 assert(setLayoutObject.device == device)
4524 }
4525
Jesse Hall03b6fe12015-11-24 12:44:21 -08004526 descriptorSets := pDescriptorSets[0:allocInfo.setCount]
4527 for i in (0 .. allocInfo.setCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004528 descriptorSet := ?
4529 descriptorSets[i] = descriptorSet
4530 State.DescriptorSets[descriptorSet] = new!DescriptorSetObject(device: device)
4531 }
4532
4533 return ?
4534}
4535
Jesse Hallf09c6b12015-08-15 19:54:28 -07004536cmd VkResult vkFreeDescriptorSets(
4537 VkDevice device,
4538 VkDescriptorPool descriptorPool,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004539 u32 descriptorSetCount,
Jesse Hallf09c6b12015-08-15 19:54:28 -07004540 const VkDescriptorSet* pDescriptorSets) {
4541 deviceObject := GetDevice(device)
4542 descriptorPoolObject := GetDescriptorPool(descriptorPool)
4543
Jesse Hall03b6fe12015-11-24 12:44:21 -08004544 descriptorSets := pDescriptorSets[0:descriptorSetCount]
4545 for i in (0 .. descriptorSetCount) {
Jesse Hallf09c6b12015-08-15 19:54:28 -07004546 descriptorSet := descriptorSets[i]
4547 descriptorSetObject := GetDescriptorSet(descriptorSet)
4548 assert(descriptorSetObject.device == device)
4549 State.DescriptorSets[descriptorSet] = null
4550 }
4551
4552 return ?
4553}
4554
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004555cmd void vkUpdateDescriptorSets(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004556 VkDevice device,
Jesse Hallb00daad2015-11-29 19:46:20 -08004557 u32 descriptorWriteCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004558 const VkWriteDescriptorSet* pDescriptorWrites,
Jesse Hallb00daad2015-11-29 19:46:20 -08004559 u32 descriptorCopyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004560 const VkCopyDescriptorSet* pDescriptorCopies) {
4561 deviceObject := GetDevice(device)
4562
Jesse Hallb00daad2015-11-29 19:46:20 -08004563 descriptorWrites := pDescriptorWrites[0:descriptorWriteCount]
4564 for i in (0 .. descriptorWriteCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004565 descriptorWrite := descriptorWrites[i]
Jesse Hall3fbc8562015-11-29 22:10:52 -08004566 descriptorWriteObject := GetDescriptorSet(descriptorWrite.dstSet)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004567 assert(descriptorWriteObject.device == device)
4568 }
4569
Jesse Hallb00daad2015-11-29 19:46:20 -08004570 descriptorCopies := pDescriptorCopies[0:descriptorCopyCount]
4571 for i in (0 .. descriptorCopyCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004572 descriptorCopy := descriptorCopies[i]
Jesse Hall3fbc8562015-11-29 22:10:52 -08004573 descriptorCopyObject := GetDescriptorSet(descriptorCopy.dstSet)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004574 assert(descriptorCopyObject.device == device)
4575 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07004576}
4577
4578
4579// Framebuffer functions
4580
4581@threadSafety("system")
4582cmd VkResult vkCreateFramebuffer(
4583 VkDevice device,
4584 const VkFramebufferCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004585 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004586 VkFramebuffer* pFramebuffer) {
4587 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO)
4588 deviceObject := GetDevice(device)
4589
4590 framebuffer := ?
4591 pFramebuffer[0] = framebuffer
4592 State.Framebuffers[framebuffer] = new!FramebufferObject(device: device)
4593
4594 return ?
4595}
4596
4597@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004598cmd void vkDestroyFramebuffer(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004599 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004600 VkFramebuffer framebuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004601 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004602 deviceObject := GetDevice(device)
4603 framebufferObject := GetFramebuffer(framebuffer)
4604 assert(framebufferObject.device == device)
4605
4606 State.Framebuffers[framebuffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004607}
4608
4609
4610// Renderpass functions
4611
4612@threadSafety("system")
4613cmd VkResult vkCreateRenderPass(
4614 VkDevice device,
4615 const VkRenderPassCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004616 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004617 VkRenderPass* pRenderPass) {
4618 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO)
4619 deviceObject := GetDevice(device)
4620
4621 renderpass := ?
4622 pRenderPass[0] = renderpass
4623 State.RenderPasses[renderpass] = new!RenderPassObject(device: device)
4624
4625 return ?
4626}
4627
4628@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004629cmd void vkDestroyRenderPass(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004630 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004631 VkRenderPass renderPass,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004632 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004633 deviceObject := GetDevice(device)
4634 renderPassObject := GetRenderPass(renderPass)
4635 assert(renderPassObject.device == device)
4636
4637 State.RenderPasses[renderPass] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004638}
4639
Jesse Hall606a54e2015-11-19 22:17:28 -08004640cmd void vkGetRenderAreaGranularity(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004641 VkDevice device,
4642 VkRenderPass renderPass,
4643 VkExtent2D* pGranularity) {
4644 deviceObject := GetDevice(device)
4645 renderPassObject := GetRenderPass(renderPass)
4646
4647 granularity := ?
4648 pGranularity[0] = granularity
Jesse Halld27f6aa2015-08-15 17:58:48 -07004649}
4650
4651// Command pool functions
4652
4653cmd VkResult vkCreateCommandPool(
4654 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004655 const VkCommandPoolCreateInfo* pCreateInfo,
4656 const VkAllocationCallbacks* pAllocator,
4657 VkCommandPool* pCommandPool) {
4658 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004659 deviceObject := GetDevice(device)
4660
Jesse Hall3fbc8562015-11-29 22:10:52 -08004661 commandPool := ?
4662 pCommandPool[0] = commandPool
4663 State.CommandPools[commandPool] = new!CommandPoolObject(device: device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004664
4665 return ?
4666}
4667
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004668cmd void vkDestroyCommandPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004669 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004670 VkCommandPool commandPool,
4671 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004672 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004673 commandPoolObject := GetCommandPool(commandPool)
4674 assert(commandPoolObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004675
Jesse Hall3fbc8562015-11-29 22:10:52 -08004676 State.CommandPools[commandPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004677}
4678
4679cmd VkResult vkResetCommandPool(
4680 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004681 VkCommandPool commandPool,
4682 VkCommandPoolResetFlags flags) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004683 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004684 commandPoolObject := GetCommandPool(commandPool)
4685 assert(commandPoolObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004686
4687 return ?
4688}
4689
4690// Command buffer functions
4691
Jesse Hall3fbc8562015-11-29 22:10:52 -08004692macro void bindCommandBuffer(VkCommandBuffer commandBuffer, any obj, VkDeviceMemory memory) {
4693 memoryObject := GetDeviceMemory(memory)
4694 memoryObject.boundCommandBuffers[commandBuffer] = commandBuffer
Jesse Halld27f6aa2015-08-15 17:58:48 -07004695
Jesse Hall3fbc8562015-11-29 22:10:52 -08004696 commandBufferObject := GetCommandBuffer(commandBuffer)
4697 commandBufferObject.boundObjects[as!u64(obj)] = memory
Jesse Halld27f6aa2015-08-15 17:58:48 -07004698}
4699
Jesse Hall3fbc8562015-11-29 22:10:52 -08004700macro void unbindCommandBuffer(VkCommandBuffer commandBuffer, any obj, VkDeviceMemory memory) {
4701 memoryObject := GetDeviceMemory(memory)
4702 memoryObject.boundCommandBuffers[commandBuffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004703
Jesse Hall3fbc8562015-11-29 22:10:52 -08004704 commandBufferObject := GetCommandBuffer(commandBuffer)
4705 commandBufferObject.boundObjects[as!u64(obj)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004706}
4707
4708@threadSafety("system")
Jesse Hall3fbc8562015-11-29 22:10:52 -08004709cmd VkResult vkAllocateCommandBuffers(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004710 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004711 const VkCommandBufferAllocateInfo* pAllocateInfo,
4712 VkCommandBuffer* pCommandBuffers) {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08004713 assert(pAllocateInfo[0].sType == VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004714
Jesse Hall3dd678a2016-01-08 21:52:01 -08004715 count := pAllocateInfo[0].commandBufferCount
Jesse Hall3fbc8562015-11-29 22:10:52 -08004716 commandBuffers := pCommandBuffers[0:count]
Jesse Hallfbf97b02015-11-20 14:17:03 -08004717 for i in (0 .. count) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004718 commandBuffer := ?
4719 commandBuffers[i] = commandBuffer
4720 State.CommandBuffers[commandBuffer] = new!CommandBufferObject(device: device)
Jesse Hallfbf97b02015-11-20 14:17:03 -08004721 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07004722
4723 return ?
4724}
4725
4726@threadSafety("system")
Jesse Hallfbf97b02015-11-20 14:17:03 -08004727cmd void vkFreeCommandBuffers(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004728 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004729 VkCommandPool commandPool,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004730 u32 commandBufferCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004731 const VkCommandBuffer* pCommandBuffers) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004732 deviceObject := GetDevice(device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004733
Jesse Hall3fbc8562015-11-29 22:10:52 -08004734 commandBuffers := pCommandBuffers[0:commandBufferCount]
Jesse Hall03b6fe12015-11-24 12:44:21 -08004735 for i in (0 .. commandBufferCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004736 commandBufferObject := GetCommandBuffer(commandBuffers[i])
4737 assert(commandBufferObject.device == device)
Jesse Hallfbf97b02015-11-20 14:17:03 -08004738 // TODO: iterate over boundObjects and clear memory bindings
Jesse Hall3fbc8562015-11-29 22:10:52 -08004739 State.CommandBuffers[commandBuffers[i]] = null
Jesse Hallfbf97b02015-11-20 14:17:03 -08004740 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07004741}
4742
4743@threadSafety("app")
4744cmd VkResult vkBeginCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004745 VkCommandBuffer commandBuffer,
4746 const VkCommandBufferBeginInfo* pBeginInfo) {
4747 assert(pBeginInfo.sType == VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO)
4748 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004749
4750 // TODO: iterate over boundObjects and clear memory bindings
4751
4752 return ?
4753}
4754
4755@threadSafety("app")
4756cmd VkResult vkEndCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004757 VkCommandBuffer commandBuffer) {
4758 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004759
4760 return ?
4761}
4762
4763@threadSafety("app")
4764cmd VkResult vkResetCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004765 VkCommandBuffer commandBuffer,
4766 VkCommandBufferResetFlags flags) {
4767 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004768
4769 // TODO: iterate over boundObjects and clear memory bindings
4770
4771 return ?
4772}
4773
4774
4775// Command buffer building functions
4776
4777@threadSafety("app")
4778cmd void vkCmdBindPipeline(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004779 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004780 VkPipelineBindPoint pipelineBindPoint,
4781 VkPipeline pipeline) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004782 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004783 pipelineObject := GetPipeline(pipeline)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004784 assert(commandBufferObject.device == pipelineObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004785
Jesse Halld8bade02015-11-24 10:24:18 -08004786 queue := switch (pipelineBindPoint) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004787 case VK_PIPELINE_BIND_POINT_COMPUTE: VK_QUEUE_COMPUTE_BIT
4788 case VK_PIPELINE_BIND_POINT_GRAPHICS: VK_QUEUE_GRAPHICS_BIT
4789 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08004790 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004791}
4792
4793@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004794cmd void vkCmdSetViewport(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004795 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004796 u32 firstViewport,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004797 u32 viewportCount,
4798 const VkViewport* pViewports) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004799 commandBufferObject := GetCommandBuffer(commandBuffer)
4800 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004801}
4802
4803@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004804cmd void vkCmdSetScissor(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004805 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004806 u32 firstScissor,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004807 u32 scissorCount,
4808 const VkRect2D* pScissors) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004809 commandBufferObject := GetCommandBuffer(commandBuffer)
4810 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004811}
4812
4813@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004814cmd void vkCmdSetLineWidth(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004815 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004816 f32 lineWidth) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004817 commandBufferObject := GetCommandBuffer(commandBuffer)
4818 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004819}
4820
4821@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004822cmd void vkCmdSetDepthBias(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004823 VkCommandBuffer commandBuffer,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004824 f32 depthBiasConstantFactor,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004825 f32 depthBiasClamp,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004826 f32 depthBiasSlopeFactor) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004827 commandBufferObject := GetCommandBuffer(commandBuffer)
4828 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004829}
Jesse Halld27f6aa2015-08-15 17:58:48 -07004830
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004831@threadSafety("app")
4832cmd void vkCmdSetBlendConstants(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004833 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004834 // TODO(jessehall): apic only supports 'const' on pointer types. Using
4835 // an annotation as a quick hack to pass this to the template without
4836 // having to modify the AST and semantic model.
Jesse Hallb00daad2015-11-29 19:46:20 -08004837 @readonly f32[4] blendConstants) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004838 commandBufferObject := GetCommandBuffer(commandBuffer)
4839 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004840}
4841
4842@threadSafety("app")
4843cmd void vkCmdSetDepthBounds(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004844 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004845 f32 minDepthBounds,
4846 f32 maxDepthBounds) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004847 commandBufferObject := GetCommandBuffer(commandBuffer)
4848 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004849}
4850
4851@threadSafety("app")
4852cmd void vkCmdSetStencilCompareMask(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004853 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004854 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08004855 u32 compareMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004856 commandBufferObject := GetCommandBuffer(commandBuffer)
4857 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004858}
4859
4860@threadSafety("app")
4861cmd void vkCmdSetStencilWriteMask(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004862 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004863 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08004864 u32 writeMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004865 commandBufferObject := GetCommandBuffer(commandBuffer)
4866 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004867}
4868
4869@threadSafety("app")
4870cmd void vkCmdSetStencilReference(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004871 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004872 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08004873 u32 reference) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004874 commandBufferObject := GetCommandBuffer(commandBuffer)
4875 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004876}
4877
4878@threadSafety("app")
4879cmd void vkCmdBindDescriptorSets(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004880 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004881 VkPipelineBindPoint pipelineBindPoint,
4882 VkPipelineLayout layout,
4883 u32 firstSet,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004884 u32 descriptorSetCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004885 const VkDescriptorSet* pDescriptorSets,
4886 u32 dynamicOffsetCount,
4887 const u32* pDynamicOffsets) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004888 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004889
Jesse Hall03b6fe12015-11-24 12:44:21 -08004890 descriptorSets := pDescriptorSets[0:descriptorSetCount]
4891 for i in (0 .. descriptorSetCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004892 descriptorSet := descriptorSets[i]
4893 descriptorSetObject := GetDescriptorSet(descriptorSet)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004894 assert(commandBufferObject.device == descriptorSetObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004895 }
4896
4897 dynamicOffsets := pDynamicOffsets[0:dynamicOffsetCount]
4898 for i in (0 .. dynamicOffsetCount) {
4899 dynamicOffset := dynamicOffsets[i]
4900 }
4901
Jesse Halld8bade02015-11-24 10:24:18 -08004902 queue := switch (pipelineBindPoint) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004903 case VK_PIPELINE_BIND_POINT_COMPUTE: VK_QUEUE_COMPUTE_BIT
4904 case VK_PIPELINE_BIND_POINT_GRAPHICS: VK_QUEUE_GRAPHICS_BIT
4905 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08004906 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004907}
4908
4909@threadSafety("app")
4910cmd void vkCmdBindIndexBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004911 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004912 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004913 VkDeviceSize offset,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004914 VkIndexType indexType) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004915 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004916 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004917 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004918
Jesse Hall3fbc8562015-11-29 22:10:52 -08004919 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004920
Jesse Hall3fbc8562015-11-29 22:10:52 -08004921 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004922}
4923
4924@threadSafety("app")
4925cmd void vkCmdBindVertexBuffers(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004926 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004927 u32 firstBinding,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004928 u32 bindingCount,
4929 const VkBuffer* pBuffers,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004930 const VkDeviceSize* pOffsets) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004931 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004932
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004933 // TODO: check if not [firstBinding:firstBinding+bindingCount]
Jesse Halld27f6aa2015-08-15 17:58:48 -07004934 buffers := pBuffers[0:bindingCount]
4935 offsets := pOffsets[0:bindingCount]
4936 for i in (0 .. bindingCount) {
4937 buffer := buffers[i]
4938 offset := offsets[i]
4939 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004940 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004941
Jesse Hall3fbc8562015-11-29 22:10:52 -08004942 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004943 }
4944
Jesse Hall3fbc8562015-11-29 22:10:52 -08004945 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004946}
4947
4948@threadSafety("app")
4949cmd void vkCmdDraw(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004950 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004951 u32 vertexCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004952 u32 instanceCount,
4953 u32 firstVertex,
4954 u32 firstInstance) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004955 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004956
Jesse Hall3fbc8562015-11-29 22:10:52 -08004957 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004958}
4959
4960@threadSafety("app")
4961cmd void vkCmdDrawIndexed(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004962 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004963 u32 indexCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004964 u32 instanceCount,
4965 u32 firstIndex,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004966 s32 vertexOffset,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004967 u32 firstInstance) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004968 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004969
Jesse Hall3fbc8562015-11-29 22:10:52 -08004970 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004971}
4972
4973@threadSafety("app")
4974cmd void vkCmdDrawIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004975 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004976 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004977 VkDeviceSize offset,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004978 u32 drawCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004979 u32 stride) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004980 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004981 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004982 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004983
Jesse Hall3fbc8562015-11-29 22:10:52 -08004984 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004985
Jesse Hall3fbc8562015-11-29 22:10:52 -08004986 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004987}
4988
4989@threadSafety("app")
4990cmd void vkCmdDrawIndexedIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004991 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004992 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004993 VkDeviceSize offset,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004994 u32 drawCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004995 u32 stride) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004996 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004997 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004998 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004999
Jesse Hall3fbc8562015-11-29 22:10:52 -08005000 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005001
Jesse Hall3fbc8562015-11-29 22:10:52 -08005002 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005003}
5004
5005@threadSafety("app")
5006cmd void vkCmdDispatch(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005007 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005008 u32 x,
5009 u32 y,
5010 u32 z) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005011 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005012
Jesse Hall3fbc8562015-11-29 22:10:52 -08005013 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_COMPUTE_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005014}
5015
5016@threadSafety("app")
5017cmd void vkCmdDispatchIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005018 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005019 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005020 VkDeviceSize offset) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005021 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005022 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005023 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005024
Jesse Hall3fbc8562015-11-29 22:10:52 -08005025 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005026
Jesse Hall3fbc8562015-11-29 22:10:52 -08005027 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_COMPUTE_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005028}
5029
5030@threadSafety("app")
5031cmd void vkCmdCopyBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005032 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005033 VkBuffer srcBuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005034 VkBuffer dstBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005035 u32 regionCount,
5036 const VkBufferCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005037 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005038 srcBufferObject := GetBuffer(srcBuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005039 dstBufferObject := GetBuffer(dstBuffer)
5040 assert(commandBufferObject.device == srcBufferObject.device)
5041 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005042
5043 regions := pRegions[0:regionCount]
5044 for i in (0 .. regionCount) {
5045 region := regions[i]
5046 }
5047
Jesse Hall3fbc8562015-11-29 22:10:52 -08005048 bindCommandBuffer(commandBuffer, srcBuffer, srcBufferObject.memory)
5049 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005050
Jesse Hall65ab5522015-11-30 00:07:16 -08005051 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005052}
5053
5054@threadSafety("app")
5055cmd void vkCmdCopyImage(
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 VkImageCopy* 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 Hall65ab5522015-11-30 00:07:16 -08005077 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005078}
5079
5080@threadSafety("app")
5081cmd void vkCmdBlitImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005082 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005083 VkImage srcImage,
5084 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005085 VkImage dstImage,
5086 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005087 u32 regionCount,
5088 const VkImageBlit* pRegions,
Jesse Hall23ff73f2015-11-29 14:36:39 -08005089 VkFilter filter) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005090 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005091 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005092 dstImageObject := GetImage(dstImage)
5093 assert(commandBufferObject.device == srcImageObject.device)
5094 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005095
5096 regions := pRegions[0:regionCount]
5097 for i in (0 .. regionCount) {
5098 region := regions[i]
5099 }
5100
Jesse Hall3fbc8562015-11-29 22:10:52 -08005101 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
5102 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005103
Jesse Hall3fbc8562015-11-29 22:10:52 -08005104 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005105}
5106
5107@threadSafety("app")
5108cmd void vkCmdCopyBufferToImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005109 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005110 VkBuffer srcBuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005111 VkImage dstImage,
5112 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005113 u32 regionCount,
5114 const VkBufferImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005115 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005116 srcBufferObject := GetBuffer(srcBuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005117 dstImageObject := GetImage(dstImage)
5118 assert(commandBufferObject.device == srcBufferObject.device)
5119 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005120
5121 regions := pRegions[0:regionCount]
5122 for i in (0 .. regionCount) {
5123 region := regions[i]
5124 }
5125
Jesse Hall3fbc8562015-11-29 22:10:52 -08005126 bindCommandBuffer(commandBuffer, srcBuffer, srcBufferObject.memory)
5127 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005128
Jesse Hall65ab5522015-11-30 00:07:16 -08005129 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005130}
5131
5132@threadSafety("app")
5133cmd void vkCmdCopyImageToBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005134 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005135 VkImage srcImage,
5136 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005137 VkBuffer dstBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005138 u32 regionCount,
5139 const VkBufferImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005140 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005141 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005142 dstBufferObject := GetBuffer(dstBuffer)
5143 assert(commandBufferObject.device == srcImageObject.device)
5144 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005145
5146 regions := pRegions[0:regionCount]
5147 for i in (0 .. regionCount) {
5148 region := regions[i]
5149 }
5150
Jesse Hall3fbc8562015-11-29 22:10:52 -08005151 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
5152 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005153
Jesse Hall65ab5522015-11-30 00:07:16 -08005154 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005155}
5156
5157@threadSafety("app")
5158cmd void vkCmdUpdateBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005159 VkCommandBuffer commandBuffer,
5160 VkBuffer dstBuffer,
5161 VkDeviceSize dstOffset,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005162 VkDeviceSize dataSize,
Jesse Hall56d386a2016-07-26 15:20:40 -07005163 const void* pData) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005164 commandBufferObject := GetCommandBuffer(commandBuffer)
5165 dstBufferObject := GetBuffer(dstBuffer)
5166 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005167
5168 data := pData[0:dataSize]
5169
Jesse Hall3fbc8562015-11-29 22:10:52 -08005170 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005171
Jesse Hall65ab5522015-11-30 00:07:16 -08005172 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005173}
5174
5175@threadSafety("app")
5176cmd void vkCmdFillBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005177 VkCommandBuffer commandBuffer,
5178 VkBuffer dstBuffer,
5179 VkDeviceSize dstOffset,
Jesse Hallb00daad2015-11-29 19:46:20 -08005180 VkDeviceSize size,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005181 u32 data) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005182 commandBufferObject := GetCommandBuffer(commandBuffer)
5183 dstBufferObject := GetBuffer(dstBuffer)
5184 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005185
Jesse Hall65ab5522015-11-30 00:07:16 -08005186 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005187}
5188
5189@threadSafety("app")
5190cmd void vkCmdClearColorImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005191 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005192 VkImage image,
5193 VkImageLayout imageLayout,
5194 const VkClearColorValue* pColor,
5195 u32 rangeCount,
5196 const VkImageSubresourceRange* pRanges) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005197 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005198 imageObject := GetImage(image)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005199 assert(commandBufferObject.device == imageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005200
5201 ranges := pRanges[0:rangeCount]
5202 for i in (0 .. rangeCount) {
5203 range := ranges[i]
5204 }
5205
Jesse Hall3fbc8562015-11-29 22:10:52 -08005206 bindCommandBuffer(commandBuffer, image, imageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005207
Jesse Hall3fbc8562015-11-29 22:10:52 -08005208 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005209}
5210
5211@threadSafety("app")
5212cmd void vkCmdClearDepthStencilImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005213 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005214 VkImage image,
5215 VkImageLayout imageLayout,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005216 const VkClearDepthStencilValue* pDepthStencil,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005217 u32 rangeCount,
5218 const VkImageSubresourceRange* pRanges) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005219 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005220 imageObject := GetImage(image)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005221 assert(commandBufferObject.device == imageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005222
5223 ranges := pRanges[0:rangeCount]
5224 for i in (0 .. rangeCount) {
5225 range := ranges[i]
5226 }
5227
Jesse Hall3fbc8562015-11-29 22:10:52 -08005228 bindCommandBuffer(commandBuffer, image, imageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005229
Jesse Hall3fbc8562015-11-29 22:10:52 -08005230 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005231}
5232
5233@threadSafety("app")
Jesse Hallae38f732015-11-19 21:32:50 -08005234cmd void vkCmdClearAttachments(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005235 VkCommandBuffer commandBuffer,
Jesse Hallae38f732015-11-19 21:32:50 -08005236 u32 attachmentCount,
5237 const VkClearAttachment* pAttachments,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005238 u32 rectCount,
Jesse Halla15a4bf2015-11-19 22:48:02 -08005239 const VkClearRect* pRects) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005240 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005241
5242 rects := pRects[0:rectCount]
5243 for i in (0 .. rectCount) {
5244 rect := rects[i]
5245 }
5246
Jesse Hall3fbc8562015-11-29 22:10:52 -08005247 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005248}
5249
5250@threadSafety("app")
5251cmd void vkCmdResolveImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005252 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005253 VkImage srcImage,
5254 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005255 VkImage dstImage,
5256 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005257 u32 regionCount,
5258 const VkImageResolve* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005259 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005260 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005261 dstImageObject := GetImage(dstImage)
5262 assert(commandBufferObject.device == srcImageObject.device)
5263 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005264
5265 regions := pRegions[0:regionCount]
5266 for i in (0 .. regionCount) {
5267 region := regions[i]
5268 }
5269
Jesse Hall3fbc8562015-11-29 22:10:52 -08005270 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
5271 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005272
Jesse Hall3fbc8562015-11-29 22:10:52 -08005273 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005274}
5275
5276@threadSafety("app")
5277cmd void vkCmdSetEvent(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005278 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005279 VkEvent event,
5280 VkPipelineStageFlags stageMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005281 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005282 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005283 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005284}
5285
5286@threadSafety("app")
5287cmd void vkCmdResetEvent(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005288 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005289 VkEvent event,
5290 VkPipelineStageFlags stageMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005291 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005292 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005293 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005294}
5295
5296@threadSafety("app")
5297cmd void vkCmdWaitEvents(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005298 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005299 u32 eventCount,
5300 const VkEvent* pEvents,
5301 VkPipelineStageFlags srcStageMask,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005302 VkPipelineStageFlags dstStageMask,
5303 u32 memoryBarrierCount,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005304 const VkMemoryBarrier* pMemoryBarriers,
5305 u32 bufferMemoryBarrierCount,
5306 const VkBufferMemoryBarrier* pBufferMemoryBarriers,
5307 u32 imageMemoryBarrierCount,
5308 const VkImageMemoryBarrier* pImageMemoryBarriers) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005309 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005310
5311 events := pEvents[0:eventCount]
5312 for i in (0 .. eventCount) {
5313 event := events[i]
5314 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005315 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005316 }
5317
Jesse Hall3dd678a2016-01-08 21:52:01 -08005318 memoryBarriers := pMemoryBarriers[0:memoryBarrierCount]
Jesse Hall3fbc8562015-11-29 22:10:52 -08005319 for i in (0 .. memoryBarrierCount) {
Jesse Hall3dd678a2016-01-08 21:52:01 -08005320 memoryBarrier := memoryBarriers[i]
5321 }
5322 bufferMemoryBarriers := pBufferMemoryBarriers[0:bufferMemoryBarrierCount]
5323 for i in (0 .. bufferMemoryBarrierCount) {
5324 bufferMemoryBarrier := bufferMemoryBarriers[i]
5325 bufferObject := GetBuffer(bufferMemoryBarrier.buffer)
5326 assert(bufferObject.device == commandBufferObject.device)
5327 }
5328 imageMemoryBarriers := pImageMemoryBarriers[0:imageMemoryBarrierCount]
5329 for i in (0 .. imageMemoryBarrierCount) {
5330 imageMemoryBarrier := imageMemoryBarriers[i]
5331 imageObject := GetImage(imageMemoryBarrier.image)
5332 assert(imageObject.device == commandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005333 }
5334}
5335
5336@threadSafety("app")
5337cmd void vkCmdPipelineBarrier(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005338 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005339 VkPipelineStageFlags srcStageMask,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005340 VkPipelineStageFlags dstStageMask,
Jesse Halldc6d36c2015-11-29 19:12:15 -08005341 VkDependencyFlags dependencyFlags,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005342 u32 memoryBarrierCount,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005343 const VkMemoryBarrier* pMemoryBarriers,
5344 u32 bufferMemoryBarrierCount,
5345 const VkBufferMemoryBarrier* pBufferMemoryBarriers,
5346 u32 imageMemoryBarrierCount,
5347 const VkImageMemoryBarrier* pImageMemoryBarriers) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005348 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005349
Jesse Hall3dd678a2016-01-08 21:52:01 -08005350 memoryBarriers := pMemoryBarriers[0:memoryBarrierCount]
Jesse Hall3fbc8562015-11-29 22:10:52 -08005351 for i in (0 .. memoryBarrierCount) {
Jesse Hall3dd678a2016-01-08 21:52:01 -08005352 memoryBarrier := memoryBarriers[i]
5353 }
5354 bufferMemoryBarriers := pBufferMemoryBarriers[0:bufferMemoryBarrierCount]
5355 for i in (0 .. bufferMemoryBarrierCount) {
5356 bufferMemoryBarrier := bufferMemoryBarriers[i]
5357 bufferObject := GetBuffer(bufferMemoryBarrier.buffer)
5358 assert(bufferObject.device == commandBufferObject.device)
5359 }
5360 imageMemoryBarriers := pImageMemoryBarriers[0:imageMemoryBarrierCount]
5361 for i in (0 .. imageMemoryBarrierCount) {
5362 imageMemoryBarrier := imageMemoryBarriers[i]
5363 imageObject := GetImage(imageMemoryBarrier.image)
5364 assert(imageObject.device == commandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005365 }
5366}
5367
5368@threadSafety("app")
5369cmd void vkCmdBeginQuery(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005370 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005371 VkQueryPool queryPool,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005372 u32 query,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005373 VkQueryControlFlags flags) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005374 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005375 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005376 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005377}
5378
5379@threadSafety("app")
5380cmd void vkCmdEndQuery(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005381 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005382 VkQueryPool queryPool,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005383 u32 query) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005384 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005385 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005386 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005387}
5388
5389@threadSafety("app")
5390cmd void vkCmdResetQueryPool(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005391 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005392 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005393 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005394 u32 queryCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005395 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005396 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005397 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005398}
5399
5400@threadSafety("app")
5401cmd void vkCmdWriteTimestamp(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005402 VkCommandBuffer commandBuffer,
Jesse Hall6f39a6d2015-11-24 11:08:36 -08005403 VkPipelineStageFlagBits pipelineStage,
Jesse Halla3a7a1d2015-11-24 11:37:23 -08005404 VkQueryPool queryPool,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005405 u32 query) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005406 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halla3a7a1d2015-11-24 11:37:23 -08005407 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005408 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005409}
5410
5411@threadSafety("app")
5412cmd void vkCmdCopyQueryPoolResults(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005413 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005414 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005415 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005416 u32 queryCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005417 VkBuffer dstBuffer,
5418 VkDeviceSize dstOffset,
Jesse Halla9bb62b2015-11-21 19:31:56 -08005419 VkDeviceSize stride,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005420 VkQueryResultFlags flags) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005421 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005422 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005423 dstBufferObject := GetBuffer(dstBuffer)
5424 assert(commandBufferObject.device == queryPoolObject.device)
5425 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005426}
5427
5428cmd void vkCmdPushConstants(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005429 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005430 VkPipelineLayout layout,
5431 VkShaderStageFlags stageFlags,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005432 u32 offset,
5433 u32 size,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08005434 const void* pValues) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005435 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005436 layoutObject := GetPipelineLayout(layout)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005437 assert(commandBufferObject.device == layoutObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005438}
5439
5440@threadSafety("app")
5441cmd void vkCmdBeginRenderPass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005442 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005443 const VkRenderPassBeginInfo* pRenderPassBegin,
Jesse Hall65ab5522015-11-30 00:07:16 -08005444 VkSubpassContents contents) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005445 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005446 renderPassObject := GetRenderPass(pRenderPassBegin.renderPass)
5447 framebufferObject := GetFramebuffer(pRenderPassBegin.framebuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005448 assert(commandBufferObject.device == renderPassObject.device)
5449 assert(commandBufferObject.device == framebufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005450
Jesse Hall3fbc8562015-11-29 22:10:52 -08005451 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005452}
5453
5454cmd void vkCmdNextSubpass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005455 VkCommandBuffer commandBuffer,
Jesse Hall65ab5522015-11-30 00:07:16 -08005456 VkSubpassContents contents) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005457 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005458}
5459
5460@threadSafety("app")
5461cmd void vkCmdEndRenderPass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005462 VkCommandBuffer commandBuffer) {
5463 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005464
Jesse Hall3fbc8562015-11-29 22:10:52 -08005465 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005466}
5467
5468cmd void vkCmdExecuteCommands(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005469 VkCommandBuffer commandBuffer,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005470 u32 commandBufferCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005471 const VkCommandBuffer* pCommandBuffers) {
5472 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005473
Jesse Hall3dd678a2016-01-08 21:52:01 -08005474 commandBuffers := pCommandBuffers[0:commandBufferCount]
5475 for i in (0 .. commandBufferCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005476 secondaryCommandBuffer := commandBuffers[i]
5477 secondaryCommandBufferObject := GetCommandBuffer(secondaryCommandBuffer)
5478 assert(commandBufferObject.device == secondaryCommandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005479 }
5480}
5481
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005482@extension("VK_KHR_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005483cmd void vkDestroySurfaceKHR(
5484 VkInstance instance,
Jesse Hall0e74f002015-11-30 11:37:59 -08005485 VkSurfaceKHR surface,
5486 const VkAllocationCallbacks* pAllocator) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005487 instanceObject := GetInstance(instance)
5488 surfaceObject := GetSurface(surface)
5489 assert(surfaceObject.instance == instance)
Michael Lentine88594d72015-11-12 12:49:45 -08005490
Jesse Hall1356b0d2015-11-23 17:24:58 -08005491 State.Surfaces[surface] = null
Jesse Hall2818f932015-11-19 21:19:17 -08005492}
5493
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005494@extension("VK_KHR_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005495cmd VkResult vkGetPhysicalDeviceSurfaceSupportKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005496 VkPhysicalDevice physicalDevice,
5497 u32 queueFamilyIndex,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005498 VkSurfaceKHR surface,
Jesse Hallb00daad2015-11-29 19:46:20 -08005499 VkBool32* pSupported) {
5500 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08005501
5502 return ?
5503}
5504
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005505@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08005506cmd VkResult vkGetPhysicalDeviceSurfaceCapabilitiesKHR(
5507 VkPhysicalDevice physicalDevice,
5508 VkSurfaceKHR surface,
5509 VkSurfaceCapabilitiesKHR* pSurfaceCapabilities) {
5510 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5511
5512 surfaceCapabilities := ?
5513 pSurfaceCapabilities[0] = surfaceCapabilities
5514
5515 return ?
5516}
5517
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005518@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08005519cmd VkResult vkGetPhysicalDeviceSurfaceFormatsKHR(
5520 VkPhysicalDevice physicalDevice,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005521 VkSurfaceKHR surface,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005522 u32* pSurfaceFormatCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005523 VkSurfaceFormatKHR* pSurfaceFormats) {
Jesse Hallb00daad2015-11-29 19:46:20 -08005524 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08005525
5526 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08005527 pSurfaceFormatCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08005528 surfaceFormats := pSurfaceFormats[0:count]
5529
5530 for i in (0 .. count) {
5531 surfaceFormat := ?
5532 surfaceFormats[i] = surfaceFormat
5533 }
5534
5535 return ?
5536}
5537
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005538@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08005539cmd VkResult vkGetPhysicalDeviceSurfacePresentModesKHR(
5540 VkPhysicalDevice physicalDevice,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005541 VkSurfaceKHR surface,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005542 u32* pPresentModeCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005543 VkPresentModeKHR* pPresentModes) {
Jesse Hallb00daad2015-11-29 19:46:20 -08005544 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08005545
5546 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08005547 pPresentModeCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08005548 presentModes := pPresentModes[0:count]
5549
5550 for i in (0 .. count) {
5551 presentMode := ?
5552 presentModes[i] = presentMode
5553 }
5554
5555 return ?
5556}
5557
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005558@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005559cmd VkResult vkCreateSwapchainKHR(
5560 VkDevice device,
5561 const VkSwapchainCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005562 const VkAllocationCallbacks* pAllocator,
Michael Lentine88594d72015-11-12 12:49:45 -08005563 VkSwapchainKHR* pSwapchain) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005564 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR)
Michael Lentine88594d72015-11-12 12:49:45 -08005565 deviceObject := GetDevice(device)
5566
5567 swapchain := ?
5568 pSwapchain[0] = swapchain
5569 State.Swapchains[swapchain] = new!SwapchainObject(device: device)
5570
5571 return ?
5572}
5573
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005574@extension("VK_KHR_swapchain")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005575cmd void vkDestroySwapchainKHR(
Michael Lentine88594d72015-11-12 12:49:45 -08005576 VkDevice device,
Jesse Hall0e74f002015-11-30 11:37:59 -08005577 VkSwapchainKHR swapchain,
5578 const VkAllocationCallbacks* pAllocator) {
Michael Lentine88594d72015-11-12 12:49:45 -08005579 deviceObject := GetDevice(device)
5580 swapchainObject := GetSwapchain(swapchain)
5581 assert(swapchainObject.device == device)
5582
5583 State.Swapchains[swapchain] = null
Michael Lentine88594d72015-11-12 12:49:45 -08005584}
5585
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005586@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005587cmd VkResult vkGetSwapchainImagesKHR(
5588 VkDevice device,
5589 VkSwapchainKHR swapchain,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005590 u32* pSwapchainImageCount,
Michael Lentine88594d72015-11-12 12:49:45 -08005591 VkImage* pSwapchainImages) {
5592 deviceObject := GetDevice(device)
5593
5594 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08005595 pSwapchainImageCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08005596 swapchainImages := pSwapchainImages[0:count]
5597
5598 for i in (0 .. count) {
5599 swapchainImage := ?
5600 swapchainImages[i] = swapchainImage
Jesse Hall1356b0d2015-11-23 17:24:58 -08005601 State.Images[swapchainImage] = new!ImageObject(device: device)
Michael Lentine88594d72015-11-12 12:49:45 -08005602 }
5603
5604 return ?
5605}
5606
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005607@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005608cmd VkResult vkAcquireNextImageKHR(
5609 VkDevice device,
5610 VkSwapchainKHR swapchain,
5611 u64 timeout,
5612 VkSemaphore semaphore,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005613 VkFence fence,
Michael Lentine88594d72015-11-12 12:49:45 -08005614 u32* pImageIndex) {
5615 deviceObject := GetDevice(device)
5616 swapchainObject := GetSwapchain(swapchain)
5617
5618 imageIndex := ?
5619 pImageIndex[0] = imageIndex
5620
5621 return ?
5622}
5623
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005624@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005625cmd VkResult vkQueuePresentKHR(
5626 VkQueue queue,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08005627 const VkPresentInfoKHR* pPresentInfo) {
Michael Lentine88594d72015-11-12 12:49:45 -08005628 queueObject := GetQueue(queue)
5629
5630 presentInfo := ?
5631 pPresentInfo[0] = presentInfo
5632
5633 return ?
5634}
5635
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005636@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005637cmd VkResult vkGetPhysicalDeviceDisplayPropertiesKHR(
5638 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005639 u32* pPropertyCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005640 VkDisplayPropertiesKHR* pProperties) {
5641 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5642 return ?
5643}
5644
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005645@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005646cmd VkResult vkGetPhysicalDeviceDisplayPlanePropertiesKHR(
5647 VkPhysicalDevice physicalDevice,
5648 u32* pPropertyCount,
5649 VkDisplayPlanePropertiesKHR* pProperties) {
5650 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5651 return ?
5652}
5653
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005654@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005655cmd VkResult vkGetDisplayPlaneSupportedDisplaysKHR(
5656 VkPhysicalDevice physicalDevice,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005657 u32 planeIndex,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08005658 u32* pDisplayCount,
5659 VkDisplayKHR* pDisplays) {
Jesse Halla6429252015-11-29 18:59:42 -08005660 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5661 return ?
5662}
5663
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005664@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005665cmd VkResult vkGetDisplayModePropertiesKHR(
5666 VkPhysicalDevice physicalDevice,
5667 VkDisplayKHR display,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005668 u32* pPropertyCount,
5669 VkDisplayModePropertiesKHR* pProperties) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005670 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5671 return ?
5672}
5673
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005674@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005675cmd VkResult vkCreateDisplayModeKHR(
5676 VkPhysicalDevice physicalDevice,
5677 VkDisplayKHR display,
5678 const VkDisplayModeCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005679 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005680 VkDisplayModeKHR* pMode) {
5681 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5682 return ?
5683}
5684
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005685@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005686cmd VkResult vkGetDisplayPlaneCapabilitiesKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005687 VkPhysicalDevice physicalDevice,
Jesse Hall9ba8bc82015-11-30 16:22:16 -08005688 VkDisplayModeKHR mode,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005689 u32 planeIndex,
Jesse Halla6429252015-11-29 18:59:42 -08005690 VkDisplayPlaneCapabilitiesKHR* pCapabilities) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005691 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5692 return ?
5693}
5694
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005695@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005696cmd VkResult vkCreateDisplayPlaneSurfaceKHR(
5697 VkInstance instance,
5698 const VkDisplaySurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005699 const VkAllocationCallbacks* pAllocator,
Jesse Halla6429252015-11-29 18:59:42 -08005700 VkSurfaceKHR* pSurface) {
5701 return ?
5702}
5703
Jesse Hall9ba8bc82015-11-30 16:22:16 -08005704@extension("VK_KHR_display_swapchain")
5705cmd VkResult vkCreateSharedSwapchainsKHR(
5706 VkDevice device,
5707 u32 swapchainCount,
5708 const VkSwapchainCreateInfoKHR* pCreateInfos,
5709 const VkAllocationCallbacks* pAllocator,
5710 VkSwapchainKHR* pSwapchains) {
5711 return ?
5712}
5713
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005714@extension("VK_KHR_xlib_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005715cmd VkResult vkCreateXlibSurfaceKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005716 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005717 const VkXlibSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005718 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005719 VkSurfaceKHR* pSurface) {
5720 instanceObject := GetInstance(instance)
5721 return ?
5722}
5723
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005724@extension("VK_KHR_xlib_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005725cmd VkBool32 vkGetPhysicalDeviceXlibPresentationSupportKHR(
5726 VkPhysicalDevice physicalDevice,
5727 u32 queueFamilyIndex,
5728 platform.Display* dpy,
Jesse Hall65ab5522015-11-30 00:07:16 -08005729 platform.VisualID visualID) {
Jesse Halla6429252015-11-29 18:59:42 -08005730 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5731 return ?
5732}
5733
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005734@extension("VK_KHR_xcb_surface")
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005735cmd VkResult vkCreateXcbSurfaceKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005736 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005737 const VkXcbSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005738 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005739 VkSurfaceKHR* pSurface) {
5740 instanceObject := GetInstance(instance)
5741 return ?
5742}
5743
Jesse Hall523db342015-11-30 21:12:55 -08005744@extension("VK_KHR_xcb_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005745cmd VkBool32 vkGetPhysicalDeviceXcbPresentationSupportKHR(
5746 VkPhysicalDevice physicalDevice,
5747 u32 queueFamilyIndex,
5748 platform.xcb_connection_t* connection,
5749 platform.xcb_visualid_t visual_id) {
5750 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5751 return ?
5752}
5753
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005754@extension("VK_KHR_wayland_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005755cmd VkResult vkCreateWaylandSurfaceKHR(
5756 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005757 const VkWaylandSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005758 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005759 VkSurfaceKHR* pSurface) {
5760 instanceObject := GetInstance(instance)
5761 return ?
5762}
5763
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005764@extension("VK_KHR_wayland_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005765cmd VkBool32 vkGetPhysicalDeviceWaylandPresentationSupportKHR(
5766 VkPhysicalDevice physicalDevice,
5767 u32 queueFamilyIndex,
5768 platform.wl_display* display) {
5769 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5770 return ?
5771}
5772
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005773@extension("VK_KHR_mir_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005774cmd VkResult vkCreateMirSurfaceKHR(
5775 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005776 const VkMirSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005777 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005778 VkSurfaceKHR* pSurface) {
5779 instanceObject := GetInstance(instance)
5780 return ?
5781}
5782
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005783@extension("VK_KHR_mir_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005784cmd VkBool32 vkGetPhysicalDeviceMirPresentationSupportKHR(
5785 VkPhysicalDevice physicalDevice,
5786 u32 queueFamilyIndex,
5787 platform.MirConnection* connection) {
5788 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5789 return ?
5790}
5791
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005792@extension("VK_KHR_android_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005793cmd VkResult vkCreateAndroidSurfaceKHR(
5794 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005795 const VkAndroidSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005796 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005797 VkSurfaceKHR* pSurface) {
5798 instanceObject := GetInstance(instance)
5799 return ?
5800}
5801
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005802@extension("VK_KHR_win32_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005803cmd VkResult vkCreateWin32SurfaceKHR(
5804 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005805 const VkWin32SurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005806 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005807 VkSurfaceKHR* pSurface) {
5808 instanceObject := GetInstance(instance)
5809 return ?
5810}
5811
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005812@extension("VK_KHR_win32_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005813cmd VkResult vkGetPhysicalDeviceWin32PresentationSupportKHR(
5814 VkPhysicalDevice physicalDevice,
5815 u32 queueFamilyIndex) {
Jesse Halle2948d82016-02-25 04:19:32 -08005816 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Jesse Halla6429252015-11-29 18:59:42 -08005817 return ?
5818}
5819
Chia-I Wub262ddc2016-03-22 07:38:20 +08005820@extension("VK_ANDROID_native_buffer")
5821cmd VkResult vkGetSwapchainGrallocUsageANDROID(
5822 VkDevice device,
5823 VkFormat format,
5824 VkImageUsageFlags imageUsage,
5825 int* grallocUsage) {
5826 return ?
5827}
5828
5829@extension("VK_ANDROID_native_buffer")
Chris Forbes8e4438b2016-12-07 16:26:49 +13005830cmd VkResult vkGetSwapchainGrallocUsage2ANDROID(
5831 VkDevice device,
5832 VkFormat format,
5833 VkImageUsageFlags imageUsage,
5834 VkSwapchainImageUsageFlagsANDROID swapchainImageUsage,
5835 int* grallocUsage) {
5836 return ?
5837}
5838
5839@extension("VK_ANDROID_native_buffer")
Chia-I Wub262ddc2016-03-22 07:38:20 +08005840cmd VkResult vkAcquireImageANDROID(
5841 VkDevice device,
5842 VkImage image,
5843 int nativeFenceFd,
5844 VkSemaphore semaphore,
5845 VkFence fence) {
5846 return ?
5847}
5848
5849@extension("VK_ANDROID_native_buffer")
5850cmd VkResult vkQueueSignalReleaseImageANDROID(
5851 VkQueue queue,
5852 u32 waitSemaphoreCount,
5853 const VkSemaphore* pWaitSemaphores,
5854 VkImage image,
5855 int* pNativeFenceFd) {
5856 return ?
5857}
5858
Ian Elliott4c8bb2a2016-12-29 11:07:26 -07005859@extension("VK_GOOGLE_display_timing")
5860cmd VkResult vkGetRefreshCycleDurationGOOGLE(
5861 VkDevice device,
5862 VkSwapchainKHR swapchain,
5863 VkRefreshCycleDurationGOOGLE* pDisplayTimingProperties) {
5864 deviceObject := GetDevice(device)
5865 swapchainObject := GetSwapchain(swapchain)
5866
5867 displayTimingProperties := ?
5868 pDisplayTimingProperties[0] = displayTimingProperties
5869
5870 return ?
5871}
5872
5873@extension("VK_GOOGLE_display_timing")
5874cmd VkResult vkGetPastPresentationTimingGOOGLE(
5875 VkDevice device,
5876 VkSwapchainKHR swapchain,
5877 u32* pPresentationTimingCount,
5878 VkPastPresentationTimingGOOGLE* pPresentationTimings) {
Ian Elliott4c8bb2a2016-12-29 11:07:26 -07005879 return ?
5880}
5881
Jesse Hall715b86a2016-01-16 16:34:29 -08005882@extension("VK_EXT_debug_report")
5883@external type void* PFN_vkDebugReportCallbackEXT
5884@extension("VK_EXT_debug_report")
5885@pfn cmd VkBool32 vkDebugReportCallbackEXT(
5886 VkDebugReportFlagsEXT flags,
5887 VkDebugReportObjectTypeEXT objectType,
5888 u64 object,
5889 platform.size_t location,
5890 s32 messageCode,
5891 const char* pLayerPrefix,
5892 const char* pMessage,
5893 void* pUserData) {
5894 return ?
5895}
5896
5897@extension("VK_EXT_debug_report")
5898cmd VkResult vkCreateDebugReportCallbackEXT(
5899 VkInstance instance,
5900 const VkDebugReportCallbackCreateInfoEXT* pCreateInfo,
5901 const VkAllocationCallbacks* pAllocator,
5902 VkDebugReportCallbackEXT* pCallback) {
5903 return ?
5904}
5905
5906@extension("VK_EXT_debug_report")
5907cmd void vkDestroyDebugReportCallbackEXT(
5908 VkInstance instance,
5909 VkDebugReportCallbackEXT callback,
5910 const VkAllocationCallbacks* pAllocator) {
5911}
5912
5913@extension("VK_EXT_debug_report")
5914cmd void vkDebugReportMessageEXT(
5915 VkInstance instance,
5916 VkDebugReportFlagsEXT flags,
5917 VkDebugReportObjectTypeEXT objectType,
5918 u64 object,
5919 platform.size_t location,
5920 s32 messageCode,
5921 const char* pLayerPrefix,
5922 const char* pMessage) {
5923}
5924
Jesse Hall26763382016-05-20 07:13:52 -07005925@extension("VK_EXT_debug_marker")
5926cmd VkResult vkDebugMarkerSetObjectTagEXT(
5927 VkDevice device,
5928 VkDebugMarkerObjectTagInfoEXT* pTagInfo) {
5929 return ?
5930}
5931
5932@extension("VK_EXT_debug_marker")
5933cmd VkResult vkDebugMarkerSetObjectNameEXT(
5934 VkDevice device,
5935 VkDebugMarkerObjectNameInfoEXT* pNameInfo) {
5936 return ?
5937}
5938
5939@extension("VK_EXT_debug_marker")
5940cmd void vkCmdDebugMarkerBeginEXT(
5941 VkCommandBuffer commandBuffer,
5942 VkDebugMarkerMarkerInfoEXT* pMarkerInfo) {
5943}
5944
5945@extension("VK_EXT_debug_marker")
5946cmd void vkCmdDebugMarkerEndEXT(
5947 VkCommandBuffer commandBuffer) {
5948}
5949
5950@extension("VK_EXT_debug_marker")
5951cmd void vkCmdDebugMarkerInsertEXT(
5952 VkCommandBuffer commandBuffer,
5953 VkDebugMarkerMarkerInfoEXT* pMarkerInfo) {
5954}
5955
Chris Forbes1194ede2016-12-30 16:29:25 +13005956@extension("VK_KHR_get_physical_device_properties2")
5957cmd void vkGetPhysicalDeviceFeatures2KHR(
5958 VkPhysicalDevice physicalDevice,
5959 VkPhysicalDeviceFeatures2KHR* pFeatures) {
5960}
5961
5962@extension("VK_KHR_get_physical_device_properties2")
5963cmd void vkGetPhysicalDeviceProperties2KHR(
5964 VkPhysicalDevice physicalDevice,
5965 VkPhysicalDeviceProperties2KHR* pProperties) {
5966}
5967
5968@extension("VK_KHR_get_physical_device_properties2")
5969cmd void vkGetPhysicalDeviceFormatProperties2KHR(
5970 VkPhysicalDevice physicalDevice,
5971 VkFormat format,
5972 VkFormatProperties2KHR* pFormatProperties) {
5973}
5974
5975@extension("VK_KHR_get_physical_device_properties2")
5976cmd VkResult vkGetPhysicalDeviceImageFormatProperties2KHR(
5977 VkPhysicalDevice physicalDevice,
5978 const VkPhysicalDeviceImageFormatInfo2KHR* pImageFormatInfo,
5979 VkImageFormatProperties2KHR* pImageFormatProperties) {
5980 return ?
5981}
5982
5983@extension("VK_KHR_get_physical_device_properties2")
5984cmd void vkGetPhysicalDeviceQueueFamilyProperties2KHR(
5985 VkPhysicalDevice physicalDevice,
5986 u32* pQueueFamilyPropertyCount,
5987 VkQueueFamilyProperties2KHR* pQueueFamilyProperties) {
5988}
5989
5990@extension("VK_KHR_get_physical_device_properties2")
5991cmd void vkGetPhysicalDeviceMemoryProperties2KHR(
5992 VkPhysicalDevice physicalDevice,
5993 VkPhysicalDeviceMemoryProperties2KHR* pMemoryProperties) {
5994}
5995
5996@extension("VK_KHR_get_physical_device_properties2")
5997cmd void vkGetPhysicalDeviceSparseImageFormatProperties2KHR(
5998 VkPhysicalDevice physicalDevice,
5999 const VkPhysicalDeviceSparseImageFormatInfo2KHR* pFormatInfo,
6000 u32* pPropertyCount,
6001 VkSparseImageFormatProperties2KHR* pProperties) {
6002}
6003
Chris Forbes289cb792016-12-30 15:03:55 +13006004@extension("VK_AMD_draw_indirect_count")
6005cmd void vkCmdDrawIndirectCountAMD(
6006 VkCommandBuffer commandBuffer,
6007 VkBuffer buffer,
6008 VkDeviceSize offset,
6009 VkBuffer countBuffer,
6010 VkDeviceSize countBufferOffset,
6011 u32 maxDrawCount,
6012 u32 stride) {
6013}
6014
6015@extension("VK_AMD_draw_indirect_count")
6016cmd void vkCmdDrawIndexedIndirectCountAMD(
6017 VkCommandBuffer commandBuffer,
6018 VkBuffer buffer,
6019 VkDeviceSize offset,
6020 VkBuffer countBuffer,
6021 VkDeviceSize countBufferOffset,
6022 u32 maxDrawCount,
6023 u32 stride) {
6024}
6025
6026@extension("VK_NV_external_memory_capabilities")
6027cmd VkResult vkGetPhysicalDeviceExternalImageFormatPropertiesNV(
6028 VkPhysicalDevice physicalDevice,
6029 VkFormat format,
6030 VkImageType type,
6031 VkImageTiling tiling,
6032 VkImageUsageFlags usage,
6033 VkImageCreateFlags flags,
6034 VkExternalMemoryHandleTypeFlagsNV externalHandleType,
6035 VkExternalImageFormatPropertiesNV* pExternalImageFormatProperties) {
6036 return ?
6037}
6038
6039@extension("VK_NV_external_memory_win32")
6040cmd VkResult vkGetMemoryWin32HandleNV(
6041 VkDevice device,
6042 VkDeviceMemory memory,
6043 VkExternalMemoryHandleTypeFlagsNV handleType,
6044 platform.HANDLE* pHandle) {
6045 return ?
6046}
6047
6048@extension("VK_NV_external_memory_win32")
6049cmd void vkCmdProcessCommandsNVX(
6050 VkCommandBuffer commandBuffer,
6051 const VkCmdProcessCommandsInfoNVX* pProcessCommandsInfo) {
6052}
6053
6054@extension("VK_NV_external_memory_win32")
6055cmd void vkCmdReserveSpaceForCommandsNVX(
6056 VkCommandBuffer commandBuffer,
6057 const VkCmdReserveSpaceForCommandsInfoNVX* pReserveSpaceInfo) {
6058}
6059
6060@extension("VK_NV_external_memory_win32")
6061cmd VkResult vkCreateIndirectCommandsLayoutNVX(
6062 VkDevice device,
6063 const VkIndirectCommandsLayoutCreateInfoNVX* pCreateInfo,
6064 const VkAllocationCallbacks* pAllocator,
6065 VkIndirectCommandsLayoutNVX* pIndirectCommandsLayout) {
6066 return ?
6067}
6068
6069@extension("VK_NV_external_memory_win32")
6070cmd void vkDestroyIndirectCommandsLayoutNVX(
6071 VkDevice device,
6072 VkIndirectCommandsLayoutNVX indirectCommandsLayout,
6073 const VkAllocationCallbacks* pAllocator) {
6074}
6075
6076@extension("VK_NV_external_memory_win32")
6077cmd VkResult vkCreateObjectTableNVX(
6078 VkDevice device,
6079 const VkObjectTableCreateInfoNVX* pCreateInfo,
6080 const VkAllocationCallbacks* pAllocator,
6081 VkObjectTableNVX* pObjectTable) {
6082 return ?
6083}
6084
6085@extension("VK_NV_external_memory_win32")
6086cmd void vkDestroyObjectTableNVX(
6087 VkDevice device,
6088 VkObjectTableNVX objectTable,
6089 const VkAllocationCallbacks* pAllocator) {
6090}
6091
6092@extension("VK_NV_external_memory_win32")
6093cmd VkResult vkRegisterObjectsNVX(
6094 VkDevice device,
6095 VkObjectTableNVX objectTable,
6096 u32 objectCount,
6097 const VkObjectTableEntryNVX* const* ppObjectTableEntries,
6098 const u32* pObjectIndices) {
6099 return ?
6100}
6101
6102@extension("VK_NV_external_memory_win32")
6103cmd VkResult vkUnregisterObjectsNVX(
6104 VkDevice device,
6105 VkObjectTableNVX objectTable,
6106 u32 objectCount,
6107 const VkObjectEntryTypeNVX* pObjectEntryTypes,
6108 const u32* pObjectIndices) {
6109 return ?
6110}
6111
6112@extension("VK_NV_external_memory_win32")
6113cmd void vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX(
6114 VkPhysicalDevice physicalDevice,
6115 VkDeviceGeneratedCommandsFeaturesNVX* pFeatures,
6116 VkDeviceGeneratedCommandsLimitsNVX* pLimits) {
6117}
6118
Chris Forbes1d5f68c2017-01-31 10:17:01 +13006119@extension("VK_KHR_shared_presentable_image")
Chris Forbes2e12cb82017-01-18 11:45:17 +13006120cmd VkResult vkGetSwapchainStatusKHR(
6121 VkDevice device,
6122 VkSwapchainKHR swapchain) {
6123 return ?
6124}
6125
Jesse Halld27f6aa2015-08-15 17:58:48 -07006126
6127////////////////
6128// Validation //
6129////////////////
6130
6131extern void validate(string layerName, bool condition, string message)
6132
6133
6134/////////////////////////////
6135// Internal State Tracking //
6136/////////////////////////////
6137
6138StateObject State
6139
6140@internal class StateObject {
6141 // Dispatchable objects.
6142 map!(VkInstance, ref!InstanceObject) Instances
6143 map!(VkPhysicalDevice, ref!PhysicalDeviceObject) PhysicalDevices
6144 map!(VkDevice, ref!DeviceObject) Devices
6145 map!(VkQueue, ref!QueueObject) Queues
Jesse Hall3fbc8562015-11-29 22:10:52 -08006146 map!(VkCommandBuffer, ref!CommandBufferObject) CommandBuffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07006147
6148 // Non-dispatchable objects.
6149 map!(VkDeviceMemory, ref!DeviceMemoryObject) DeviceMemories
6150 map!(VkBuffer, ref!BufferObject) Buffers
6151 map!(VkBufferView, ref!BufferViewObject) BufferViews
6152 map!(VkImage, ref!ImageObject) Images
6153 map!(VkImageView, ref!ImageViewObject) ImageViews
Jesse Halld27f6aa2015-08-15 17:58:48 -07006154 map!(VkShaderModule, ref!ShaderModuleObject) ShaderModules
Jesse Halld27f6aa2015-08-15 17:58:48 -07006155 map!(VkPipeline, ref!PipelineObject) Pipelines
6156 map!(VkPipelineLayout, ref!PipelineLayoutObject) PipelineLayouts
6157 map!(VkSampler, ref!SamplerObject) Samplers
6158 map!(VkDescriptorSet, ref!DescriptorSetObject) DescriptorSets
6159 map!(VkDescriptorSetLayout, ref!DescriptorSetLayoutObject) DescriptorSetLayouts
6160 map!(VkDescriptorPool, ref!DescriptorPoolObject) DescriptorPools
Jesse Halld27f6aa2015-08-15 17:58:48 -07006161 map!(VkFence, ref!FenceObject) Fences
6162 map!(VkSemaphore, ref!SemaphoreObject) Semaphores
6163 map!(VkEvent, ref!EventObject) Events
6164 map!(VkQueryPool, ref!QueryPoolObject) QueryPools
6165 map!(VkFramebuffer, ref!FramebufferObject) Framebuffers
6166 map!(VkRenderPass, ref!RenderPassObject) RenderPasses
6167 map!(VkPipelineCache, ref!PipelineCacheObject) PipelineCaches
Jesse Hall3fbc8562015-11-29 22:10:52 -08006168 map!(VkCommandPool, ref!CommandPoolObject) CommandPools
Jesse Hall1356b0d2015-11-23 17:24:58 -08006169 map!(VkSurfaceKHR, ref!SurfaceObject) Surfaces
Michael Lentine88594d72015-11-12 12:49:45 -08006170 map!(VkSwapchainKHR, ref!SwapchainObject) Swapchains
Jesse Halld27f6aa2015-08-15 17:58:48 -07006171}
6172
6173@internal class InstanceObject {
6174}
6175
6176@internal class PhysicalDeviceObject {
6177 VkInstance instance
6178}
6179
6180@internal class DeviceObject {
6181 VkPhysicalDevice physicalDevice
6182}
6183
6184@internal class QueueObject {
6185 VkDevice device
6186 VkQueueFlags flags
6187}
6188
Jesse Hall3fbc8562015-11-29 22:10:52 -08006189@internal class CommandBufferObject {
Jesse Halld27f6aa2015-08-15 17:58:48 -07006190 VkDevice device
6191 map!(u64, VkDeviceMemory) boundObjects
6192 VkQueueFlags queueFlags
6193}
6194
6195@internal class DeviceMemoryObject {
Jesse Hall3fbc8562015-11-29 22:10:52 -08006196 VkDevice device
6197 VkDeviceSize allocationSize
6198 map!(u64, VkDeviceSize) boundObjects
6199 map!(VkCommandBuffer, VkCommandBuffer) boundCommandBuffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07006200}
6201
6202@internal class BufferObject {
6203 VkDevice device
Jesse Hall3fbc8562015-11-29 22:10:52 -08006204 VkDeviceMemory memory
6205 VkDeviceSize memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07006206}
6207
6208@internal class BufferViewObject {
6209 VkDevice device
6210 VkBuffer buffer
6211}
6212
6213@internal class ImageObject {
6214 VkDevice device
Jesse Hall3fbc8562015-11-29 22:10:52 -08006215 VkDeviceMemory memory
6216 VkDeviceSize memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07006217}
6218
6219@internal class ImageViewObject {
6220 VkDevice device
6221 VkImage image
6222}
6223
Jesse Halld27f6aa2015-08-15 17:58:48 -07006224@internal class ShaderObject {
6225 VkDevice device
6226}
6227
6228@internal class ShaderModuleObject {
6229 VkDevice device
6230}
6231
6232@internal class PipelineObject {
6233 VkDevice device
6234}
6235
6236@internal class PipelineLayoutObject {
6237 VkDevice device
6238}
6239
6240@internal class SamplerObject {
6241 VkDevice device
6242}
6243
6244@internal class DescriptorSetObject {
6245 VkDevice device
6246}
6247
6248@internal class DescriptorSetLayoutObject {
6249 VkDevice device
6250}
6251
6252@internal class DescriptorPoolObject {
6253 VkDevice device
6254}
6255
Jesse Halld27f6aa2015-08-15 17:58:48 -07006256@internal class FenceObject {
6257 VkDevice device
6258 bool signaled
6259}
6260
6261@internal class SemaphoreObject {
6262 VkDevice device
6263}
6264
6265@internal class EventObject {
6266 VkDevice device
6267}
6268
6269@internal class QueryPoolObject {
6270 VkDevice device
6271}
6272
6273@internal class FramebufferObject {
6274 VkDevice device
6275}
6276
6277@internal class RenderPassObject {
6278 VkDevice device
6279}
6280
6281@internal class PipelineCacheObject {
6282 VkDevice device
6283}
6284
Jesse Hall3fbc8562015-11-29 22:10:52 -08006285@internal class CommandPoolObject {
Jesse Halld27f6aa2015-08-15 17:58:48 -07006286 VkDevice device
6287}
6288
Jesse Hall1356b0d2015-11-23 17:24:58 -08006289@internal class SurfaceObject {
6290 VkInstance instance
6291}
6292
Michael Lentine88594d72015-11-12 12:49:45 -08006293@internal class SwapchainObject {
6294 VkDevice device
6295}
6296
Jesse Halld27f6aa2015-08-15 17:58:48 -07006297macro ref!InstanceObject GetInstance(VkInstance instance) {
6298 assert(instance in State.Instances)
6299 return State.Instances[instance]
6300}
6301
6302macro ref!PhysicalDeviceObject GetPhysicalDevice(VkPhysicalDevice physicalDevice) {
6303 assert(physicalDevice in State.PhysicalDevices)
6304 return State.PhysicalDevices[physicalDevice]
6305}
6306
6307macro ref!DeviceObject GetDevice(VkDevice device) {
6308 assert(device in State.Devices)
6309 return State.Devices[device]
6310}
6311
6312macro ref!QueueObject GetQueue(VkQueue queue) {
6313 assert(queue in State.Queues)
6314 return State.Queues[queue]
6315}
6316
Jesse Hall3fbc8562015-11-29 22:10:52 -08006317macro ref!CommandBufferObject GetCommandBuffer(VkCommandBuffer commandBuffer) {
6318 assert(commandBuffer in State.CommandBuffers)
6319 return State.CommandBuffers[commandBuffer]
Jesse Halld27f6aa2015-08-15 17:58:48 -07006320}
6321
Jesse Hall3fbc8562015-11-29 22:10:52 -08006322macro ref!DeviceMemoryObject GetDeviceMemory(VkDeviceMemory memory) {
6323 assert(memory in State.DeviceMemories)
6324 return State.DeviceMemories[memory]
Jesse Halld27f6aa2015-08-15 17:58:48 -07006325}
6326
6327macro ref!BufferObject GetBuffer(VkBuffer buffer) {
6328 assert(buffer in State.Buffers)
6329 return State.Buffers[buffer]
6330}
6331
6332macro ref!BufferViewObject GetBufferView(VkBufferView bufferView) {
6333 assert(bufferView in State.BufferViews)
6334 return State.BufferViews[bufferView]
6335}
6336
6337macro ref!ImageObject GetImage(VkImage image) {
6338 assert(image in State.Images)
6339 return State.Images[image]
6340}
6341
6342macro ref!ImageViewObject GetImageView(VkImageView imageView) {
6343 assert(imageView in State.ImageViews)
6344 return State.ImageViews[imageView]
6345}
6346
Jesse Halld27f6aa2015-08-15 17:58:48 -07006347macro ref!ShaderModuleObject GetShaderModule(VkShaderModule shaderModule) {
6348 assert(shaderModule in State.ShaderModules)
6349 return State.ShaderModules[shaderModule]
6350}
6351
6352macro ref!PipelineObject GetPipeline(VkPipeline pipeline) {
6353 assert(pipeline in State.Pipelines)
6354 return State.Pipelines[pipeline]
6355}
6356
6357macro ref!PipelineLayoutObject GetPipelineLayout(VkPipelineLayout pipelineLayout) {
6358 assert(pipelineLayout in State.PipelineLayouts)
6359 return State.PipelineLayouts[pipelineLayout]
6360}
6361
6362macro ref!SamplerObject GetSampler(VkSampler sampler) {
6363 assert(sampler in State.Samplers)
6364 return State.Samplers[sampler]
6365}
6366
6367macro ref!DescriptorSetObject GetDescriptorSet(VkDescriptorSet descriptorSet) {
6368 assert(descriptorSet in State.DescriptorSets)
6369 return State.DescriptorSets[descriptorSet]
6370}
6371
6372macro ref!DescriptorSetLayoutObject GetDescriptorSetLayout(VkDescriptorSetLayout descriptorSetLayout) {
6373 assert(descriptorSetLayout in State.DescriptorSetLayouts)
6374 return State.DescriptorSetLayouts[descriptorSetLayout]
6375}
6376
6377macro ref!DescriptorPoolObject GetDescriptorPool(VkDescriptorPool descriptorPool) {
6378 assert(descriptorPool in State.DescriptorPools)
6379 return State.DescriptorPools[descriptorPool]
6380}
6381
Jesse Halld27f6aa2015-08-15 17:58:48 -07006382macro ref!FenceObject GetFence(VkFence fence) {
6383 assert(fence in State.Fences)
6384 return State.Fences[fence]
6385}
6386
6387macro ref!SemaphoreObject GetSemaphore(VkSemaphore semaphore) {
6388 assert(semaphore in State.Semaphores)
6389 return State.Semaphores[semaphore]
6390}
6391
6392macro ref!EventObject GetEvent(VkEvent event) {
6393 assert(event in State.Events)
6394 return State.Events[event]
6395}
6396
6397macro ref!QueryPoolObject GetQueryPool(VkQueryPool queryPool) {
6398 assert(queryPool in State.QueryPools)
6399 return State.QueryPools[queryPool]
6400}
6401
6402macro ref!FramebufferObject GetFramebuffer(VkFramebuffer framebuffer) {
6403 assert(framebuffer in State.Framebuffers)
6404 return State.Framebuffers[framebuffer]
6405}
6406
6407macro ref!RenderPassObject GetRenderPass(VkRenderPass renderPass) {
6408 assert(renderPass in State.RenderPasses)
6409 return State.RenderPasses[renderPass]
6410}
6411
6412macro ref!PipelineCacheObject GetPipelineCache(VkPipelineCache pipelineCache) {
6413 assert(pipelineCache in State.PipelineCaches)
6414 return State.PipelineCaches[pipelineCache]
6415}
6416
Jesse Hall3fbc8562015-11-29 22:10:52 -08006417macro ref!CommandPoolObject GetCommandPool(VkCommandPool commandPool) {
6418 assert(commandPool in State.CommandPools)
6419 return State.CommandPools[commandPool]
Jesse Hallf09c6b12015-08-15 19:54:28 -07006420}
Michael Lentine88594d72015-11-12 12:49:45 -08006421
Jesse Hall1356b0d2015-11-23 17:24:58 -08006422macro ref!SurfaceObject GetSurface(VkSurfaceKHR surface) {
6423 assert(surface in State.Surfaces)
6424 return State.Surfaces[surface]
6425}
6426
Michael Lentine88594d72015-11-12 12:49:45 -08006427macro ref!SwapchainObject GetSwapchain(VkSwapchainKHR swapchain) {
6428 assert(swapchain in State.Swapchains)
6429 return State.Swapchains[swapchain]
6430}
Jesse Halld8bade02015-11-24 10:24:18 -08006431
6432macro VkQueueFlags AddQueueFlag(VkQueueFlags flags, VkQueueFlagBits bit) {
6433 return as!VkQueueFlags(as!u32(flags) | as!u32(bit))
6434}