blob: bdb75dc7468392aeb52ab920524895e44e6b72b8 [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
Chris Forbes8e4438b2016-12-07 16:26:49 +130078@extension("VK_ANDROID_native_buffer") define VK_ANDROID_NATIVE_BUFFER_SPEC_VERSION 6
Chia-I Wub262ddc2016-03-22 07:38:20 +080079@extension("VK_ANDROID_native_buffer") define VK_ANDROID_NATIVE_BUFFER_NAME "VK_ANDROID_native_buffer"
80
Chris Forbes289cb792016-12-30 15:03:55 +130081@extension("VK_EXT_debug_report") define VK_EXT_DEBUG_REPORT_SPEC_VERSION 4
Jesse Hall715b86a2016-01-16 16:34:29 -080082@extension("VK_EXT_debug_report") define VK_EXT_DEBUG_REPORT_NAME "VK_EXT_debug_report"
83
Jesse Hall26763382016-05-20 07:13:52 -070084@extension("VK_NV_glsl_shader") define VK_NV_GLSL_SHADER_SPEC_VERSION 1
85@extension("VK_NV_glsl_shader") define VK_NV_GLSL_SHADER_NAME "VK_NV_glsl_shader"
86
87@extension("VK_KHR_sampler_mirror_clamp_to_edge") define VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_SPEC_VERSION 1
88@extension("VK_KHR_sampler_mirror_clamp_to_edge") define VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_NAME "VK_KHR_sampler_mirror_clamp_to_edge"
89
90@extension("VK_IMG_filter_cubic") define VK_IMG_FILTER_CUBIC_SPEC_VERSION 1
91@extension("VK_IMG_filter_cubic") define VK_IMG_FILTER_CUBIC_NAME "VK_IMG_filter_cubic"
92
93@extension("VK_AMD_rasterization_order") define VK_AMD_RASTERIZATION_ORDER_SPEC_VERSION 1
94@extension("VK_AMD_rasterization_order") define VK_AMD_RASTERIZATION_ORDER_NAME "VK_AMD_rasterization_order"
95
Jesse Hall56d386a2016-07-26 15:20:40 -070096@extension("VK_AMD_shader_trinary_minmax") define VK_AMD_SHADER_TRINARY_MINMAX_SPEC_VERSION 1
97@extension("VK_AMD_shader_trinary_minmax") define VK_AMD_SHADER_TRINARY_MINMAX_EXTENSION_NAME "VK_AMD_shader_trinary_minmax"
98
99@extension("VK_AMD_shader_explicit_vertex_parameter") define VK_AMD_SHADER_EXPLICIT_VERTEX_PARAMETER_SPEC_VERSION 1
100@extension("VK_AMD_shader_explicit_vertex_parameter") define VK_AMD_SHADER_EXPLICIT_VERTEX_PARAMETER_EXTENSION_NAME "VK_AMD_shader_explicit_vertex_parameter"
101
Jesse Hall26763382016-05-20 07:13:52 -0700102@extension("VK_EXT_debug_marker") define VK_EXT_DEBUG_MARKER_SPEC_VERSION 3
103@extension("VK_EXT_debug_marker") define VK_EXT_DEBUG_MARKER_NAME "VK_EXT_debug_marker"
104
Jesse Hall56d386a2016-07-26 15:20:40 -0700105@extension("VK_AMD_gcn_shader") define VK_AMD_GCN_SHADER_SPEC_VERSION 1
106@extension("VK_AMD_gcn_shader") define VK_AMD_GCN_SHADER_EXTENSION_NAME "VK_AMD_gcn_shader"
107
108@extension("VK_NV_dedicated_allocation") define VK_NV_DEDICATED_ALLOCATION_SPEC_VERSION 1
109@extension("VK_NV_dedicated_allocation") define VK_NV_DEDICATED_ALLOCATION_EXTENSION_NAME "VK_NV_dedicated_allocation"
110
Chris Forbes1194ede2016-12-30 16:29:25 +1300111@extension("VK_KHR_get_physical_device_properties2") define VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_SPEC_VERSION 1
112@extension("VK_KHR_get_physical_device_properties2") define VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME "VK_KHR_get_physical_device_properties2"
113
Chris Forbes289cb792016-12-30 15:03:55 +1300114@extension("VK_AMD_draw_indirect_count") define VK_AMD_DRAW_INDIRECT_COUNT_SPEC_VERSION 1
115@extension("VK_AMD_draw_indirect_count") define VK_AMD_DRAW_INDIRECT_COUNT_EXTENSION_NAME "VK_AMD_draw_indirect_count"
116
117@extension("VK_AMD_negative_viewport_height") define VK_AMD_NEGATIVE_VIEWPORT_HEIGHT_SPEC_VERSION 1
118@extension("VK_AMD_negative_viewport_height") define VK_AMD_NEGATIVE_VIEWPORT_HEIGHT_EXTENSION_NAME "VK_AMD_negative_viewport_height"
119
120@extension("VK_AMD_gpu_shader_half_float") define VK_AMD_GPU_SHADER_HALF_FLOAT_SPEC_VERSION 1
121@extension("VK_AMD_gpu_shader_half_float") define VK_AMD_GPU_SHADER_HALF_FLOAT_EXTENSION_NAME "VK_AMD_gpu_shader_half_float"
122
123@extension("VK_AMD_shader_ballot") define VK_AMD_SHADER_BALLOT_SPEC_VERSION 1
124@extension("VK_AMD_shader_ballot") define VK_AMD_SHADER_BALLOT_EXTENSION_NAME "VK_AMD_shader_ballot"
125
126@extension("VK_IMG_format_pvrtc") define VK_IMG_FORMAT_PVRTC_SPEC_VERSION 1
127@extension("VK_IMG_format_pvrtc") define VK_IMG_FORMAT_PVRTC_EXTENSION_NAME "VK_IMG_format_pvrtc"
128
129@extension("VK_NV_external_memory_capabilities") define VK_NV_EXTERNAL_MEMORY_CAPABILITIES_SPEC_VERSION 1
130@extension("VK_NV_external_memory_capabilities") define VK_NV_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME "VK_NV_external_memory_capabilities"
131
132@extension("VK_NV_external_memory") define VK_NV_EXTERNAL_MEMORY_SPEC_VERSION 1
133@extension("VK_NV_external_memory") define VK_NV_EXTERNAL_MEMORY_EXTENSION_NAME "VK_NV_external_memory"
134
135@extension("VK_NV_external_memory_win32") define VK_NV_EXTERNAL_MEMORY_WIN32_SPEC_VERSION 1
136@extension("VK_NV_external_memory_win32") define VK_NV_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME "VK_NV_external_memory_win32"
137
138@extension("VK_NV_win32_keyed_mutex") define VK_NV_WIN32_KEYED_MUTEX_SPEC_VERSION 1
139@extension("VK_NV_win32_keyed_mutex") define VK_NV_WIN32_KEYED_MUTEX_EXTENSION_NAME "VK_NV_win32_keyed_mutex"
140
141@extension("VK_EXT_validation_flags") define VK_EXT_VALIDATION_FLAGS_SPEC_VERSION 1
142@extension("VK_EXT_validation_flags") define VK_EXT_VALIDATION_FLAGS_EXTENSION_NAME "VK_EXT_validation_flags"
143
144@extension("VK_NVX_device_generated_commands") define VK_NVX_DEVICE_GENERATED_COMMANDS_SPEC_VERSION 1
145@extension("VK_NVX_device_generated_commands") define VK_NVX_DEVICE_GENERATED_COMMANDS_EXTENSION_NAME "VK_NVX_device_generated_commands"
146
147
Jesse Halld27f6aa2015-08-15 17:58:48 -0700148
149/////////////
150// Types //
151/////////////
152
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700153type u32 VkBool32
154type u32 VkFlags
155type u64 VkDeviceSize
156type u32 VkSampleMask
157
Jesse Halld27f6aa2015-08-15 17:58:48 -0700158/// Dispatchable handle types.
159@dispatchHandle type u64 VkInstance
160@dispatchHandle type u64 VkPhysicalDevice
161@dispatchHandle type u64 VkDevice
162@dispatchHandle type u64 VkQueue
Jesse Hall3fbc8562015-11-29 22:10:52 -0800163@dispatchHandle type u64 VkCommandBuffer
Jesse Halld27f6aa2015-08-15 17:58:48 -0700164
165/// Non dispatchable handle types.
166@nonDispatchHandle type u64 VkDeviceMemory
Jesse Hall3fbc8562015-11-29 22:10:52 -0800167@nonDispatchHandle type u64 VkCommandPool
Jesse Halld27f6aa2015-08-15 17:58:48 -0700168@nonDispatchHandle type u64 VkBuffer
169@nonDispatchHandle type u64 VkBufferView
170@nonDispatchHandle type u64 VkImage
171@nonDispatchHandle type u64 VkImageView
Jesse Halld27f6aa2015-08-15 17:58:48 -0700172@nonDispatchHandle type u64 VkShaderModule
Jesse Halld27f6aa2015-08-15 17:58:48 -0700173@nonDispatchHandle type u64 VkPipeline
174@nonDispatchHandle type u64 VkPipelineLayout
175@nonDispatchHandle type u64 VkSampler
176@nonDispatchHandle type u64 VkDescriptorSet
177@nonDispatchHandle type u64 VkDescriptorSetLayout
178@nonDispatchHandle type u64 VkDescriptorPool
Jesse Halld27f6aa2015-08-15 17:58:48 -0700179@nonDispatchHandle type u64 VkFence
180@nonDispatchHandle type u64 VkSemaphore
181@nonDispatchHandle type u64 VkEvent
182@nonDispatchHandle type u64 VkQueryPool
183@nonDispatchHandle type u64 VkFramebuffer
184@nonDispatchHandle type u64 VkRenderPass
185@nonDispatchHandle type u64 VkPipelineCache
Jesse Hall1356b0d2015-11-23 17:24:58 -0800186
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800187@extension("VK_KHR_surface") @nonDispatchHandle type u64 VkSurfaceKHR
Jesse Hall1356b0d2015-11-23 17:24:58 -0800188
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800189@extension("VK_KHR_swapchain") @nonDispatchHandle type u64 VkSwapchainKHR
Jesse Hall1356b0d2015-11-23 17:24:58 -0800190
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800191@extension("VK_KHR_display") @nonDispatchHandle type u64 VkDisplayKHR
192@extension("VK_KHR_display") @nonDispatchHandle type u64 VkDisplayModeKHR
Jesse Halld27f6aa2015-08-15 17:58:48 -0700193
Jesse Hall715b86a2016-01-16 16:34:29 -0800194@extension("VK_EXT_debug_report") @nonDispatchHandle type u64 VkDebugReportCallbackEXT
195
Chris Forbes289cb792016-12-30 15:03:55 +1300196@extension("VK_NVX_device_generated_commands") @nonDispatchHandle type u64 VkObjectTableNVX
197@extension("VK_NVX_device_generated_commands") @nonDispatchHandle type u64 VkIndirectCommandsLayoutNVX
198
Jesse Halld27f6aa2015-08-15 17:58:48 -0700199
200/////////////
201// Enums //
202/////////////
203
204enum VkImageLayout {
205 VK_IMAGE_LAYOUT_UNDEFINED = 0x00000000, /// Implicit layout an image is when its contents are undefined due to various reasons (e.g. right after creation)
206 VK_IMAGE_LAYOUT_GENERAL = 0x00000001, /// General layout when image can be used for any kind of access
207 VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL = 0x00000002, /// Optimal layout when image is only used for color attachment read/write
208 VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL = 0x00000003, /// Optimal layout when image is only used for depth/stencil attachment read/write
209 VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL = 0x00000004, /// Optimal layout when image is used for read only depth/stencil attachment and shader access
210 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 -0800211 VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL = 0x00000006, /// Optimal layout when image is used only as source of transfer operations
212 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 -0700213 VK_IMAGE_LAYOUT_PREINITIALIZED = 0x00000008, /// Initial layout used when the data is populated by the CPU
Jesse Hall1356b0d2015-11-23 17:24:58 -0800214
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800215 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800216 VK_IMAGE_LAYOUT_PRESENT_SRC_KHR = 1000001002,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700217}
218
219enum VkAttachmentLoadOp {
220 VK_ATTACHMENT_LOAD_OP_LOAD = 0x00000000,
221 VK_ATTACHMENT_LOAD_OP_CLEAR = 0x00000001,
222 VK_ATTACHMENT_LOAD_OP_DONT_CARE = 0x00000002,
223}
224
225enum VkAttachmentStoreOp {
226 VK_ATTACHMENT_STORE_OP_STORE = 0x00000000,
227 VK_ATTACHMENT_STORE_OP_DONT_CARE = 0x00000001,
228}
229
230enum VkImageType {
231 VK_IMAGE_TYPE_1D = 0x00000000,
232 VK_IMAGE_TYPE_2D = 0x00000001,
233 VK_IMAGE_TYPE_3D = 0x00000002,
234}
235
236enum VkImageTiling {
Jesse Hallc7467b72015-11-29 21:05:26 -0800237 VK_IMAGE_TILING_OPTIMAL = 0x00000000,
238 VK_IMAGE_TILING_LINEAR = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700239}
240
241enum VkImageViewType {
242 VK_IMAGE_VIEW_TYPE_1D = 0x00000000,
243 VK_IMAGE_VIEW_TYPE_2D = 0x00000001,
244 VK_IMAGE_VIEW_TYPE_3D = 0x00000002,
245 VK_IMAGE_VIEW_TYPE_CUBE = 0x00000003,
246 VK_IMAGE_VIEW_TYPE_1D_ARRAY = 0x00000004,
247 VK_IMAGE_VIEW_TYPE_2D_ARRAY = 0x00000005,
248 VK_IMAGE_VIEW_TYPE_CUBE_ARRAY = 0x00000006,
249}
250
Jesse Hall3fbc8562015-11-29 22:10:52 -0800251enum VkCommandBufferLevel {
252 VK_COMMAND_BUFFER_LEVEL_PRIMARY = 0x00000000,
253 VK_COMMAND_BUFFER_LEVEL_SECONDARY = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700254}
255
Jesse Hall65ab5522015-11-30 00:07:16 -0800256enum VkComponentSwizzle {
257 VK_COMPONENT_SWIZZLE_IDENTITY = 0x00000000,
258 VK_COMPONENT_SWIZZLE_ZERO = 0x00000001,
259 VK_COMPONENT_SWIZZLE_ONE = 0x00000002,
260 VK_COMPONENT_SWIZZLE_R = 0x00000003,
261 VK_COMPONENT_SWIZZLE_G = 0x00000004,
262 VK_COMPONENT_SWIZZLE_B = 0x00000005,
263 VK_COMPONENT_SWIZZLE_A = 0x00000006,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700264}
265
266enum VkDescriptorType {
267 VK_DESCRIPTOR_TYPE_SAMPLER = 0x00000000,
268 VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER = 0x00000001,
269 VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE = 0x00000002,
270 VK_DESCRIPTOR_TYPE_STORAGE_IMAGE = 0x00000003,
271 VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER = 0x00000004,
272 VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER = 0x00000005,
273 VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER = 0x00000006,
274 VK_DESCRIPTOR_TYPE_STORAGE_BUFFER = 0x00000007,
275 VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC = 0x00000008,
276 VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC = 0x00000009,
277 VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT = 0x0000000a,
278}
279
Jesse Halld27f6aa2015-08-15 17:58:48 -0700280enum VkQueryType {
281 VK_QUERY_TYPE_OCCLUSION = 0x00000000,
282 VK_QUERY_TYPE_PIPELINE_STATISTICS = 0x00000001, /// Optional
Jesse Halla3a7a1d2015-11-24 11:37:23 -0800283 VK_QUERY_TYPE_TIMESTAMP = 0x00000002,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700284}
285
Jesse Halld27f6aa2015-08-15 17:58:48 -0700286enum VkBorderColor {
287 VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK = 0x00000000,
288 VK_BORDER_COLOR_INT_TRANSPARENT_BLACK = 0x00000001,
289 VK_BORDER_COLOR_FLOAT_OPAQUE_BLACK = 0x00000002,
290 VK_BORDER_COLOR_INT_OPAQUE_BLACK = 0x00000003,
291 VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE = 0x00000004,
292 VK_BORDER_COLOR_INT_OPAQUE_WHITE = 0x00000005,
293}
294
295enum VkPipelineBindPoint {
Jesse Hallc7467b72015-11-29 21:05:26 -0800296 VK_PIPELINE_BIND_POINT_GRAPHICS = 0x00000000,
297 VK_PIPELINE_BIND_POINT_COMPUTE = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700298}
299
300enum VkPrimitiveTopology {
301 VK_PRIMITIVE_TOPOLOGY_POINT_LIST = 0x00000000,
302 VK_PRIMITIVE_TOPOLOGY_LINE_LIST = 0x00000001,
303 VK_PRIMITIVE_TOPOLOGY_LINE_STRIP = 0x00000002,
304 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST = 0x00000003,
305 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP = 0x00000004,
306 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN = 0x00000005,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800307 VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY = 0x00000006,
308 VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY = 0x00000007,
309 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY = 0x00000008,
310 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY = 0x00000009,
Jesse Hall091ed9e2015-11-30 00:55:29 -0800311 VK_PRIMITIVE_TOPOLOGY_PATCH_LIST = 0x0000000a,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700312}
313
314enum VkSharingMode {
315 VK_SHARING_MODE_EXCLUSIVE = 0x00000000,
316 VK_SHARING_MODE_CONCURRENT = 0x00000001,
317}
318
319enum VkIndexType {
320 VK_INDEX_TYPE_UINT16 = 0x00000000,
321 VK_INDEX_TYPE_UINT32 = 0x00000001,
322}
323
Jesse Hall23ff73f2015-11-29 14:36:39 -0800324enum VkFilter {
325 VK_FILTER_NEAREST = 0x00000000,
326 VK_FILTER_LINEAR = 0x00000001,
Jesse Hall26763382016-05-20 07:13:52 -0700327
328 //@extension("VK_IMG_filter_cubic")
329 VK_FILTER_CUBIC_IMG = 1000015000,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700330}
331
Jesse Hall23ff73f2015-11-29 14:36:39 -0800332enum VkSamplerMipmapMode {
Jesse Hall23ff73f2015-11-29 14:36:39 -0800333 VK_SAMPLER_MIPMAP_MODE_NEAREST = 0x00000001, /// Choose nearest mip level
334 VK_SAMPLER_MIPMAP_MODE_LINEAR = 0x00000002, /// Linear filter between mip levels
Jesse Halld27f6aa2015-08-15 17:58:48 -0700335}
336
Jesse Hall23ff73f2015-11-29 14:36:39 -0800337enum VkSamplerAddressMode {
Jesse Hallc7467b72015-11-29 21:05:26 -0800338 VK_SAMPLER_ADDRESS_MODE_REPEAT = 0x00000000,
339 VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT = 0x00000001,
340 VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE = 0x00000002,
341 VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER = 0x00000003,
342 VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700343}
344
345enum VkCompareOp {
346 VK_COMPARE_OP_NEVER = 0x00000000,
347 VK_COMPARE_OP_LESS = 0x00000001,
348 VK_COMPARE_OP_EQUAL = 0x00000002,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800349 VK_COMPARE_OP_LESS_OR_EQUAL = 0x00000003,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700350 VK_COMPARE_OP_GREATER = 0x00000004,
351 VK_COMPARE_OP_NOT_EQUAL = 0x00000005,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800352 VK_COMPARE_OP_GREATER_OR_EQUAL = 0x00000006,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700353 VK_COMPARE_OP_ALWAYS = 0x00000007,
354}
355
Jesse Hall65ab5522015-11-30 00:07:16 -0800356enum VkPolygonMode {
357 VK_POLYGON_MODE_FILL = 0x00000000,
358 VK_POLYGON_MODE_LINE = 0x00000001,
359 VK_POLYGON_MODE_POINT = 0x00000002,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700360}
361
362enum VkFrontFace {
Jesse Hall3fbc8562015-11-29 22:10:52 -0800363 VK_FRONT_FACE_COUNTER_CLOCKWISE = 0x00000000,
364 VK_FRONT_FACE_CLOCKWISE = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700365}
366
Jesse Hall65ab5522015-11-30 00:07:16 -0800367enum VkBlendFactor {
368 VK_BLEND_FACTOR_ZERO = 0x00000000,
369 VK_BLEND_FACTOR_ONE = 0x00000001,
370 VK_BLEND_FACTOR_SRC_COLOR = 0x00000002,
371 VK_BLEND_FACTOR_ONE_MINUS_SRC_COLOR = 0x00000003,
372 VK_BLEND_FACTOR_DST_COLOR = 0x00000004,
373 VK_BLEND_FACTOR_ONE_MINUS_DST_COLOR = 0x00000005,
374 VK_BLEND_FACTOR_SRC_ALPHA = 0x00000006,
375 VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA = 0x00000007,
376 VK_BLEND_FACTOR_DST_ALPHA = 0x00000008,
377 VK_BLEND_FACTOR_ONE_MINUS_DST_ALPHA = 0x00000009,
378 VK_BLEND_FACTOR_CONSTANT_COLOR = 0x0000000a,
379 VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR = 0x0000000b,
380 VK_BLEND_FACTOR_CONSTANT_ALPHA = 0x0000000c,
381 VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA = 0x0000000d,
382 VK_BLEND_FACTOR_SRC_ALPHA_SATURATE = 0x0000000e,
383 VK_BLEND_FACTOR_SRC1_COLOR = 0x0000000f,
384 VK_BLEND_FACTOR_ONE_MINUS_SRC1_COLOR = 0x00000010,
385 VK_BLEND_FACTOR_SRC1_ALPHA = 0x00000011,
386 VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA = 0x00000012,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700387}
388
389enum VkBlendOp {
390 VK_BLEND_OP_ADD = 0x00000000,
391 VK_BLEND_OP_SUBTRACT = 0x00000001,
392 VK_BLEND_OP_REVERSE_SUBTRACT = 0x00000002,
393 VK_BLEND_OP_MIN = 0x00000003,
394 VK_BLEND_OP_MAX = 0x00000004,
395}
396
397enum VkStencilOp {
398 VK_STENCIL_OP_KEEP = 0x00000000,
399 VK_STENCIL_OP_ZERO = 0x00000001,
400 VK_STENCIL_OP_REPLACE = 0x00000002,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800401 VK_STENCIL_OP_INCREMENT_AND_CLAMP = 0x00000003,
402 VK_STENCIL_OP_DECREMENT_AND_CLAMP = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700403 VK_STENCIL_OP_INVERT = 0x00000005,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800404 VK_STENCIL_OP_INCREMENT_AND_WRAP = 0x00000006,
405 VK_STENCIL_OP_DECREMENT_AND_WRAP = 0x00000007,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700406}
407
408enum VkLogicOp {
409 VK_LOGIC_OP_CLEAR = 0x00000000,
410 VK_LOGIC_OP_AND = 0x00000001,
411 VK_LOGIC_OP_AND_REVERSE = 0x00000002,
412 VK_LOGIC_OP_COPY = 0x00000003,
413 VK_LOGIC_OP_AND_INVERTED = 0x00000004,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800414 VK_LOGIC_OP_NO_OP = 0x00000005,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700415 VK_LOGIC_OP_XOR = 0x00000006,
416 VK_LOGIC_OP_OR = 0x00000007,
417 VK_LOGIC_OP_NOR = 0x00000008,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800418 VK_LOGIC_OP_EQUIVALENT = 0x00000009,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700419 VK_LOGIC_OP_INVERT = 0x0000000a,
420 VK_LOGIC_OP_OR_REVERSE = 0x0000000b,
421 VK_LOGIC_OP_COPY_INVERTED = 0x0000000c,
422 VK_LOGIC_OP_OR_INVERTED = 0x0000000d,
423 VK_LOGIC_OP_NAND = 0x0000000e,
424 VK_LOGIC_OP_SET = 0x0000000f,
425}
426
Jesse Hall3fbc8562015-11-29 22:10:52 -0800427enum VkSystemAllocationScope {
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800428 VK_SYSTEM_ALLOCATION_SCOPE_COMMAND = 0x00000000,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800429 VK_SYSTEM_ALLOCATION_SCOPE_OBJECT = 0x00000001,
430 VK_SYSTEM_ALLOCATION_SCOPE_CACHE = 0x00000002,
431 VK_SYSTEM_ALLOCATION_SCOPE_DEVICE = 0x00000003,
432 VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE = 0x00000004,
Jesse Hall03b6fe12015-11-24 12:44:21 -0800433}
434
Jesse Hall3fbc8562015-11-29 22:10:52 -0800435enum VkInternalAllocationType {
436 VK_INTERNAL_ALLOCATION_TYPE_EXECUTABLE = 0x00000000,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700437}
438
439enum VkPhysicalDeviceType {
440 VK_PHYSICAL_DEVICE_TYPE_OTHER = 0x00000000,
441 VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU = 0x00000001,
442 VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU = 0x00000002,
443 VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU = 0x00000003,
444 VK_PHYSICAL_DEVICE_TYPE_CPU = 0x00000004,
445}
446
Jesse Hall65ab5522015-11-30 00:07:16 -0800447enum VkVertexInputRate {
448 VK_VERTEX_INPUT_RATE_VERTEX = 0x00000000,
449 VK_VERTEX_INPUT_RATE_INSTANCE = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700450}
451
452/// Vulkan format definitions
453enum VkFormat {
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800454 VK_FORMAT_UNDEFINED = 0,
455 VK_FORMAT_R4G4_UNORM_PACK8 = 1,
456 VK_FORMAT_R4G4B4A4_UNORM_PACK16 = 2,
457 VK_FORMAT_B4G4R4A4_UNORM_PACK16 = 3,
458 VK_FORMAT_R5G6B5_UNORM_PACK16 = 4,
459 VK_FORMAT_B5G6R5_UNORM_PACK16 = 5,
460 VK_FORMAT_R5G5B5A1_UNORM_PACK16 = 6,
461 VK_FORMAT_B5G5R5A1_UNORM_PACK16 = 7,
462 VK_FORMAT_A1R5G5B5_UNORM_PACK16 = 8,
463 VK_FORMAT_R8_UNORM = 9,
464 VK_FORMAT_R8_SNORM = 10,
465 VK_FORMAT_R8_USCALED = 11,
466 VK_FORMAT_R8_SSCALED = 12,
467 VK_FORMAT_R8_UINT = 13,
468 VK_FORMAT_R8_SINT = 14,
469 VK_FORMAT_R8_SRGB = 15,
470 VK_FORMAT_R8G8_UNORM = 16,
471 VK_FORMAT_R8G8_SNORM = 17,
472 VK_FORMAT_R8G8_USCALED = 18,
473 VK_FORMAT_R8G8_SSCALED = 19,
474 VK_FORMAT_R8G8_UINT = 20,
475 VK_FORMAT_R8G8_SINT = 21,
476 VK_FORMAT_R8G8_SRGB = 22,
477 VK_FORMAT_R8G8B8_UNORM = 23,
478 VK_FORMAT_R8G8B8_SNORM = 24,
479 VK_FORMAT_R8G8B8_USCALED = 25,
480 VK_FORMAT_R8G8B8_SSCALED = 26,
481 VK_FORMAT_R8G8B8_UINT = 27,
482 VK_FORMAT_R8G8B8_SINT = 28,
483 VK_FORMAT_R8G8B8_SRGB = 29,
484 VK_FORMAT_B8G8R8_UNORM = 30,
485 VK_FORMAT_B8G8R8_SNORM = 31,
486 VK_FORMAT_B8G8R8_USCALED = 32,
487 VK_FORMAT_B8G8R8_SSCALED = 33,
488 VK_FORMAT_B8G8R8_UINT = 34,
489 VK_FORMAT_B8G8R8_SINT = 35,
490 VK_FORMAT_B8G8R8_SRGB = 36,
491 VK_FORMAT_R8G8B8A8_UNORM = 37,
492 VK_FORMAT_R8G8B8A8_SNORM = 38,
493 VK_FORMAT_R8G8B8A8_USCALED = 39,
494 VK_FORMAT_R8G8B8A8_SSCALED = 40,
495 VK_FORMAT_R8G8B8A8_UINT = 41,
496 VK_FORMAT_R8G8B8A8_SINT = 42,
497 VK_FORMAT_R8G8B8A8_SRGB = 43,
498 VK_FORMAT_B8G8R8A8_UNORM = 44,
499 VK_FORMAT_B8G8R8A8_SNORM = 45,
500 VK_FORMAT_B8G8R8A8_USCALED = 46,
501 VK_FORMAT_B8G8R8A8_SSCALED = 47,
502 VK_FORMAT_B8G8R8A8_UINT = 48,
503 VK_FORMAT_B8G8R8A8_SINT = 49,
504 VK_FORMAT_B8G8R8A8_SRGB = 50,
505 VK_FORMAT_A8B8G8R8_UNORM_PACK32 = 51,
506 VK_FORMAT_A8B8G8R8_SNORM_PACK32 = 52,
507 VK_FORMAT_A8B8G8R8_USCALED_PACK32 = 53,
508 VK_FORMAT_A8B8G8R8_SSCALED_PACK32 = 54,
509 VK_FORMAT_A8B8G8R8_UINT_PACK32 = 55,
510 VK_FORMAT_A8B8G8R8_SINT_PACK32 = 56,
511 VK_FORMAT_A8B8G8R8_SRGB_PACK32 = 57,
512 VK_FORMAT_A2R10G10B10_UNORM_PACK32 = 58,
513 VK_FORMAT_A2R10G10B10_SNORM_PACK32 = 59,
514 VK_FORMAT_A2R10G10B10_USCALED_PACK32 = 60,
515 VK_FORMAT_A2R10G10B10_SSCALED_PACK32 = 61,
516 VK_FORMAT_A2R10G10B10_UINT_PACK32 = 62,
517 VK_FORMAT_A2R10G10B10_SINT_PACK32 = 63,
518 VK_FORMAT_A2B10G10R10_UNORM_PACK32 = 64,
519 VK_FORMAT_A2B10G10R10_SNORM_PACK32 = 65,
520 VK_FORMAT_A2B10G10R10_USCALED_PACK32 = 66,
521 VK_FORMAT_A2B10G10R10_SSCALED_PACK32 = 67,
522 VK_FORMAT_A2B10G10R10_UINT_PACK32 = 68,
523 VK_FORMAT_A2B10G10R10_SINT_PACK32 = 69,
524 VK_FORMAT_R16_UNORM = 70,
525 VK_FORMAT_R16_SNORM = 71,
526 VK_FORMAT_R16_USCALED = 72,
527 VK_FORMAT_R16_SSCALED = 73,
528 VK_FORMAT_R16_UINT = 74,
529 VK_FORMAT_R16_SINT = 75,
530 VK_FORMAT_R16_SFLOAT = 76,
531 VK_FORMAT_R16G16_UNORM = 77,
532 VK_FORMAT_R16G16_SNORM = 78,
533 VK_FORMAT_R16G16_USCALED = 79,
534 VK_FORMAT_R16G16_SSCALED = 80,
535 VK_FORMAT_R16G16_UINT = 81,
536 VK_FORMAT_R16G16_SINT = 82,
537 VK_FORMAT_R16G16_SFLOAT = 83,
538 VK_FORMAT_R16G16B16_UNORM = 84,
539 VK_FORMAT_R16G16B16_SNORM = 85,
540 VK_FORMAT_R16G16B16_USCALED = 86,
541 VK_FORMAT_R16G16B16_SSCALED = 87,
542 VK_FORMAT_R16G16B16_UINT = 88,
543 VK_FORMAT_R16G16B16_SINT = 89,
544 VK_FORMAT_R16G16B16_SFLOAT = 90,
545 VK_FORMAT_R16G16B16A16_UNORM = 91,
546 VK_FORMAT_R16G16B16A16_SNORM = 92,
547 VK_FORMAT_R16G16B16A16_USCALED = 93,
548 VK_FORMAT_R16G16B16A16_SSCALED = 94,
549 VK_FORMAT_R16G16B16A16_UINT = 95,
550 VK_FORMAT_R16G16B16A16_SINT = 96,
551 VK_FORMAT_R16G16B16A16_SFLOAT = 97,
552 VK_FORMAT_R32_UINT = 98,
553 VK_FORMAT_R32_SINT = 99,
554 VK_FORMAT_R32_SFLOAT = 100,
555 VK_FORMAT_R32G32_UINT = 101,
556 VK_FORMAT_R32G32_SINT = 102,
557 VK_FORMAT_R32G32_SFLOAT = 103,
558 VK_FORMAT_R32G32B32_UINT = 104,
559 VK_FORMAT_R32G32B32_SINT = 105,
560 VK_FORMAT_R32G32B32_SFLOAT = 106,
561 VK_FORMAT_R32G32B32A32_UINT = 107,
562 VK_FORMAT_R32G32B32A32_SINT = 108,
563 VK_FORMAT_R32G32B32A32_SFLOAT = 109,
564 VK_FORMAT_R64_UINT = 110,
565 VK_FORMAT_R64_SINT = 111,
566 VK_FORMAT_R64_SFLOAT = 112,
567 VK_FORMAT_R64G64_UINT = 113,
568 VK_FORMAT_R64G64_SINT = 114,
569 VK_FORMAT_R64G64_SFLOAT = 115,
570 VK_FORMAT_R64G64B64_UINT = 116,
571 VK_FORMAT_R64G64B64_SINT = 117,
572 VK_FORMAT_R64G64B64_SFLOAT = 118,
573 VK_FORMAT_R64G64B64A64_UINT = 119,
574 VK_FORMAT_R64G64B64A64_SINT = 120,
575 VK_FORMAT_R64G64B64A64_SFLOAT = 121,
576 VK_FORMAT_B10G11R11_UFLOAT_PACK32 = 122,
577 VK_FORMAT_E5B9G9R9_UFLOAT_PACK32 = 123,
578 VK_FORMAT_D16_UNORM = 124,
579 VK_FORMAT_X8_D24_UNORM_PACK32 = 125,
580 VK_FORMAT_D32_SFLOAT = 126,
581 VK_FORMAT_S8_UINT = 127,
582 VK_FORMAT_D16_UNORM_S8_UINT = 128,
583 VK_FORMAT_D24_UNORM_S8_UINT = 129,
584 VK_FORMAT_D32_SFLOAT_S8_UINT = 130,
585 VK_FORMAT_BC1_RGB_UNORM_BLOCK = 131,
586 VK_FORMAT_BC1_RGB_SRGB_BLOCK = 132,
587 VK_FORMAT_BC1_RGBA_UNORM_BLOCK = 133,
588 VK_FORMAT_BC1_RGBA_SRGB_BLOCK = 134,
589 VK_FORMAT_BC2_UNORM_BLOCK = 135,
590 VK_FORMAT_BC2_SRGB_BLOCK = 136,
591 VK_FORMAT_BC3_UNORM_BLOCK = 137,
592 VK_FORMAT_BC3_SRGB_BLOCK = 138,
593 VK_FORMAT_BC4_UNORM_BLOCK = 139,
594 VK_FORMAT_BC4_SNORM_BLOCK = 140,
595 VK_FORMAT_BC5_UNORM_BLOCK = 141,
596 VK_FORMAT_BC5_SNORM_BLOCK = 142,
597 VK_FORMAT_BC6H_UFLOAT_BLOCK = 143,
598 VK_FORMAT_BC6H_SFLOAT_BLOCK = 144,
599 VK_FORMAT_BC7_UNORM_BLOCK = 145,
600 VK_FORMAT_BC7_SRGB_BLOCK = 146,
601 VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK = 147,
602 VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK = 148,
603 VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK = 149,
604 VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK = 150,
605 VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK = 151,
606 VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK = 152,
607 VK_FORMAT_EAC_R11_UNORM_BLOCK = 153,
608 VK_FORMAT_EAC_R11_SNORM_BLOCK = 154,
609 VK_FORMAT_EAC_R11G11_UNORM_BLOCK = 155,
610 VK_FORMAT_EAC_R11G11_SNORM_BLOCK = 156,
611 VK_FORMAT_ASTC_4x4_UNORM_BLOCK = 157,
612 VK_FORMAT_ASTC_4x4_SRGB_BLOCK = 158,
613 VK_FORMAT_ASTC_5x4_UNORM_BLOCK = 159,
614 VK_FORMAT_ASTC_5x4_SRGB_BLOCK = 160,
615 VK_FORMAT_ASTC_5x5_UNORM_BLOCK = 161,
616 VK_FORMAT_ASTC_5x5_SRGB_BLOCK = 162,
617 VK_FORMAT_ASTC_6x5_UNORM_BLOCK = 163,
618 VK_FORMAT_ASTC_6x5_SRGB_BLOCK = 164,
619 VK_FORMAT_ASTC_6x6_UNORM_BLOCK = 165,
620 VK_FORMAT_ASTC_6x6_SRGB_BLOCK = 166,
621 VK_FORMAT_ASTC_8x5_UNORM_BLOCK = 167,
622 VK_FORMAT_ASTC_8x5_SRGB_BLOCK = 168,
623 VK_FORMAT_ASTC_8x6_UNORM_BLOCK = 169,
624 VK_FORMAT_ASTC_8x6_SRGB_BLOCK = 170,
625 VK_FORMAT_ASTC_8x8_UNORM_BLOCK = 171,
626 VK_FORMAT_ASTC_8x8_SRGB_BLOCK = 172,
627 VK_FORMAT_ASTC_10x5_UNORM_BLOCK = 173,
628 VK_FORMAT_ASTC_10x5_SRGB_BLOCK = 174,
629 VK_FORMAT_ASTC_10x6_UNORM_BLOCK = 175,
630 VK_FORMAT_ASTC_10x6_SRGB_BLOCK = 176,
631 VK_FORMAT_ASTC_10x8_UNORM_BLOCK = 177,
632 VK_FORMAT_ASTC_10x8_SRGB_BLOCK = 178,
633 VK_FORMAT_ASTC_10x10_UNORM_BLOCK = 179,
634 VK_FORMAT_ASTC_10x10_SRGB_BLOCK = 180,
635 VK_FORMAT_ASTC_12x10_UNORM_BLOCK = 181,
636 VK_FORMAT_ASTC_12x10_SRGB_BLOCK = 182,
637 VK_FORMAT_ASTC_12x12_UNORM_BLOCK = 183,
638 VK_FORMAT_ASTC_12x12_SRGB_BLOCK = 184,
Chris Forbes289cb792016-12-30 15:03:55 +1300639
640 //@extension("VK_IMG_format_pvrtc")
641 VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG = 1000054000,
642
643 //@extension("VK_IMG_format_pvrtc")
644 VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG = 1000054001,
645
646 //@extension("VK_IMG_format_pvrtc")
647 VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG = 1000054002,
648
649 //@extension("VK_IMG_format_pvrtc")
650 VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG = 1000054003,
651
652 //@extension("VK_IMG_format_pvrtc")
653 VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG = 1000054004,
654
655 //@extension("VK_IMG_format_pvrtc")
656 VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG = 1000054005,
657
658 //@extension("VK_IMG_format_pvrtc")
659 VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG = 1000054006,
660
661 //@extension("VK_IMG_format_pvrtc")
662 VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG = 1000054007,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700663}
664
Jesse Halld27f6aa2015-08-15 17:58:48 -0700665/// Structure type enumerant
666enum VkStructureType {
667 VK_STRUCTURE_TYPE_APPLICATION_INFO = 0,
Jesse Hallc7467b72015-11-29 21:05:26 -0800668 VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO = 1,
669 VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO = 2,
670 VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO = 3,
671 VK_STRUCTURE_TYPE_SUBMIT_INFO = 4,
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800672 VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO = 5,
Jesse Hallc7467b72015-11-29 21:05:26 -0800673 VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE = 6,
674 VK_STRUCTURE_TYPE_BIND_SPARSE_INFO = 7,
675 VK_STRUCTURE_TYPE_FENCE_CREATE_INFO = 8,
676 VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO = 9,
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700677 VK_STRUCTURE_TYPE_EVENT_CREATE_INFO = 10,
Jesse Hallc7467b72015-11-29 21:05:26 -0800678 VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO = 11,
679 VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO = 12,
680 VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO = 13,
681 VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO = 14,
682 VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO = 15,
683 VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO = 16,
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800684 VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO = 17,
685 VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO = 18,
686 VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO = 19,
687 VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO = 20,
688 VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO = 21,
689 VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO = 22,
690 VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO = 23,
691 VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO = 24,
692 VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO = 25,
693 VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO = 26,
694 VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO = 27,
695 VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO = 28,
696 VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO = 29,
697 VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO = 30,
698 VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO = 31,
699 VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO = 32,
700 VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO = 33,
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800701 VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO = 34,
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800702 VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET = 35,
703 VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET = 36,
704 VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO = 37,
705 VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO = 38,
706 VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO = 39,
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800707 VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO = 40,
Jesse Hall3dd678a2016-01-08 21:52:01 -0800708 VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO = 41,
709 VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO = 42,
710 VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO = 43,
711 VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER = 44,
712 VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER = 45,
713 VK_STRUCTURE_TYPE_MEMORY_BARRIER = 46,
714 VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO = 47,
715 VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO = 48,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800716
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800717 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800718 VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR = 1000001000,
719 VK_STRUCTURE_TYPE_PRESENT_INFO_KHR = 1000001001,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800720
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800721 //@extension("VK_KHR_display")
Jesse Hallbd888842015-11-30 21:44:14 -0800722 VK_STRUCTURE_TYPE_DISPLAY_MODE_CREATE_INFO_KHR = 1000002000,
723 VK_STRUCTURE_TYPE_DISPLAY_SURFACE_CREATE_INFO_KHR = 1000002001,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800724
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800725 //@extension("VK_KHR_display_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800726 VK_STRUCTURE_TYPE_DISPLAY_DISPLAY_PRESENT_INFO_KHR = 1000003000,
Jesse Hallf9fa9a52016-01-08 16:08:51 -0800727
728 //@extension("VK_KHR_xlib_surface")
729 VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR = 1000004000,
730
731 //@extension("VK_KHR_xcb_surface")
732 VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR = 1000005000,
733
734 //@extension("VK_KHR_wayland_surface")
735 VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR = 1000006000,
736
737 //@extension("VK_KHR_mir_surface")
738 VK_STRUCTURE_TYPE_MIR_SURFACE_CREATE_INFO_KHR = 1000007000,
739
740 //@extension("VK_KHR_android_surface")
741 VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR = 1000008000,
742
743 //@extension("VK_KHR_win32_surface")
744 VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR = 1000009000,
Jesse Hall543a7ff2016-01-08 16:38:30 -0800745
Chia-I Wub262ddc2016-03-22 07:38:20 +0800746 //@extension("VK_ANDROID_native_buffer")
747 VK_STRUCTURE_TYPE_NATIVE_BUFFER_ANDROID = 1000010000,
Chris Forbes8e4438b2016-12-07 16:26:49 +1300748 VK_STRUCTURE_TYPE_SWAPCHAIN_IMAGE_CREATE_INFO_ANDROID = 1000010001,
Chia-I Wub262ddc2016-03-22 07:38:20 +0800749
Jesse Hall543a7ff2016-01-08 16:38:30 -0800750 //@extension("VK_EXT_debug_report")
Jesse Hall26763382016-05-20 07:13:52 -0700751 VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT = 1000011000,
752
753 //@extension("VK_AMD_rasterization_order")
754 VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD = 1000018000,
755
756 //@extension("VK_EXT_debug_marker")
757 VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_NAME_INFO_EXT = 1000022000,
758
759 //@extension("VK_EXT_debug_marker")
760 VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_TAG_INFO_EXT = 1000022001,
761
762 //@extension("VK_EXT_debug_marker")
763 VK_STRUCTURE_TYPE_DEBUG_MARKER_MARKER_INFO_EXT = 1000022002,
Jesse Hall56d386a2016-07-26 15:20:40 -0700764
765 //@extension("VK_NV_dedicated_allocation")
766 VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV = 1000026000,
767
768 //@extension("VK_NV_dedicated_allocation")
769 VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV = 1000026001,
770
771 //@extension("VK_NV_dedicated_allocation")
772 VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV = 1000026002,
Chris Forbes289cb792016-12-30 15:03:55 +1300773
774 //@extension("VK_NV_external_memory")
775 VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_NV = 1000056000,
776
777 //@extension("VK_NV_external_memory")
778 VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_NV = 1000056001,
779
780 //@extension("VK_NV_external_memory_win32")
781 VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_NV = 1000057000,
782
783 //@extension("VK_NV_external_memory_win32")
784 VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_NV = 1000057001,
785
786 //@extension("VK_NV_win32_keyed_mutex")
787 VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_NV = 1000058000,
788
Chris Forbes1194ede2016-12-30 16:29:25 +1300789 //@extension("VK_KHR_get_physical_device_properties2")
790 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR = 1000059000,
791
792 //@extension("VK_KHR_get_physical_device_properties2")
793 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR = 1000059001,
794
795 //@extension("VK_KHR_get_physical_device_properties2")
796 VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2_KHR = 1000059002,
797
798 //@extension("VK_KHR_get_physical_device_properties2")
799 VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2_KHR = 1000059003,
800
801 //@extension("VK_KHR_get_physical_device_properties2")
802 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2_KHR = 1000059004,
803
804 //@extension("VK_KHR_get_physical_device_properties2")
805 VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2_KHR = 1000059005,
806
807 //@extension("VK_KHR_get_physical_device_properties2")
808 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2_KHR = 1000059006,
809
810 //@extension("VK_KHR_get_physical_device_properties2")
811 VK_STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2_KHR = 1000059007,
812
813 //@extension("VK_KHR_get_physical_device_properties2")
814 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2_KHR = 1000059008,
815
Chris Forbes289cb792016-12-30 15:03:55 +1300816 //@extension("VK_EXT_validation_flags")
817 VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT = 1000061000,
818
819 //@extension("VK_KHR_incremental_present")
820 VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR = 1000084000,
821
822 //@extension("VK_NVX_device_generated_commands")
823 VK_STRUCTURE_TYPE_OBJECT_TABLE_CREATE_INFO_NVX = 1000086000,
824
825 //@extension("VK_NVX_device_generated_commands")
826 VK_STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_CREATE_INFO_NVX = 1000086001,
827
828 //@extension("VK_NVX_device_generated_commands")
829 VK_STRUCTURE_TYPE_CMD_PROCESS_COMMANDS_INFO_NVX = 1000086002,
830
831 //@extension("VK_NVX_device_generated_commands")
832 VK_STRUCTURE_TYPE_CMD_RESERVE_SPACE_FOR_COMMANDS_INFO_NVX = 1000086003,
833
834 //@extension("VK_NVX_device_generated_commands")
835 VK_STRUCTURE_TYPE_DEVICE_GENERATED_COMMANDS_LIMITS_NVX = 1000086004,
836
837 //@extension("VK_NVX_device_generated_commands")
838 VK_STRUCTURE_TYPE_DEVICE_GENERATED_COMMANDS_FEATURES_NVX = 1000086005,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700839}
840
Jesse Hall65ab5522015-11-30 00:07:16 -0800841enum VkSubpassContents {
842 VK_SUBPASS_CONTENTS_INLINE = 0x00000000,
843 VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700844}
845
Jesse Hall543a7ff2016-01-08 16:38:30 -0800846enum VkPipelineCacheHeaderVersion {
847 VK_PIPELINE_CACHE_HEADER_VERSION_ONE = 1,
848}
849
Jesse Hallbd888842015-11-30 21:44:14 -0800850@lastUnused(-11)
Jesse Halld27f6aa2015-08-15 17:58:48 -0700851/// Error and return codes
852enum VkResult {
853 // Return codes for successful operation execution (positive values)
Jesse Hallbd888842015-11-30 21:44:14 -0800854 VK_SUCCESS = 0,
855 VK_NOT_READY = 1,
856 VK_TIMEOUT = 2,
857 VK_EVENT_SET = 3,
858 VK_EVENT_RESET = 4,
859 VK_INCOMPLETE = 5,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700860
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800861 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800862 VK_SUBOPTIMAL_KHR = 1000001003,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800863
Jesse Halld27f6aa2015-08-15 17:58:48 -0700864 // Error codes (negative values)
Jesse Hallbd888842015-11-30 21:44:14 -0800865 VK_ERROR_OUT_OF_HOST_MEMORY = 0xFFFFFFFF, // -1
866 VK_ERROR_OUT_OF_DEVICE_MEMORY = 0xFFFFFFFE, // -2
867 VK_ERROR_INITIALIZATION_FAILED = 0xFFFFFFFD, // -3
868 VK_ERROR_DEVICE_LOST = 0xFFFFFFFC, // -4
869 VK_ERROR_MEMORY_MAP_FAILED = 0xFFFFFFFB, // -5
870 VK_ERROR_LAYER_NOT_PRESENT = 0xFFFFFFFA, // -6
871 VK_ERROR_EXTENSION_NOT_PRESENT = 0xFFFFFFF9, // -7
872 VK_ERROR_FEATURE_NOT_PRESENT = 0xFFFFFFF8, // -8
873 VK_ERROR_INCOMPATIBLE_DRIVER = 0xFFFFFFF7, // -9
874 VK_ERROR_TOO_MANY_OBJECTS = 0xFFFFFFF6, // -10
875 VK_ERROR_FORMAT_NOT_SUPPORTED = 0xFFFFFFF5, // -11
Jesse Hall56d386a2016-07-26 15:20:40 -0700876 VK_ERROR_FRAGMENTED_POOL = 0xFFFFFFF4, // -12
Jesse Hall1356b0d2015-11-23 17:24:58 -0800877
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800878 //@extension("VK_KHR_surface")
Jesse Hallbd888842015-11-30 21:44:14 -0800879 VK_ERROR_SURFACE_LOST_KHR = 0xC4653600, // -1000000000
Jesse Halla6429252015-11-29 18:59:42 -0800880
Jesse Hall563380d2016-01-15 23:14:05 -0800881 //@extension("VK_KHR_surface")
882 VK_ERROR_NATIVE_WINDOW_IN_USE_KHR = 0xC46535FF, // -1000008001
883
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800884 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800885 VK_ERROR_OUT_OF_DATE_KHR = 0xC4653214, // -1000001004
Jesse Hall1356b0d2015-11-23 17:24:58 -0800886
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800887 //@extension("VK_KHR_display_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800888 VK_ERROR_INCOMPATIBLE_DISPLAY_KHR = 0xC4652A47, // -1000003001
Jesse Hall1356b0d2015-11-23 17:24:58 -0800889
Jesse Hall543a7ff2016-01-08 16:38:30 -0800890 //@extension("VK_EXT_debug_report")
891 VK_ERROR_VALIDATION_FAILED_EXT = 0xC4650B07, // -1000011001
Jesse Hall26763382016-05-20 07:13:52 -0700892
893 //@extension("VK_NV_glsl_shader")
894 VK_ERROR_INVALID_SHADER_NV = 0xC4650720, // -1000012000
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700895}
896
897enum VkDynamicState {
898 VK_DYNAMIC_STATE_VIEWPORT = 0x00000000,
899 VK_DYNAMIC_STATE_SCISSOR = 0x00000001,
900 VK_DYNAMIC_STATE_LINE_WIDTH = 0x00000002,
901 VK_DYNAMIC_STATE_DEPTH_BIAS = 0x00000003,
902 VK_DYNAMIC_STATE_BLEND_CONSTANTS = 0x00000004,
903 VK_DYNAMIC_STATE_DEPTH_BOUNDS = 0x00000005,
904 VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK = 0x00000006,
905 VK_DYNAMIC_STATE_STENCIL_WRITE_MASK = 0x00000007,
906 VK_DYNAMIC_STATE_STENCIL_REFERENCE = 0x00000008,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700907}
908
Jesse Hall523db342015-11-30 21:12:55 -0800909@extension("VK_KHR_surface")
Michael Lentine88594d72015-11-12 12:49:45 -0800910enum VkPresentModeKHR {
911 VK_PRESENT_MODE_IMMEDIATE_KHR = 0x00000000,
912 VK_PRESENT_MODE_MAILBOX_KHR = 0x00000001,
913 VK_PRESENT_MODE_FIFO_KHR = 0x00000002,
Jesse Hall03b6fe12015-11-24 12:44:21 -0800914 VK_PRESENT_MODE_FIFO_RELAXED_KHR = 0x00000003,
Michael Lentine88594d72015-11-12 12:49:45 -0800915}
916
Jesse Hall523db342015-11-30 21:12:55 -0800917@extension("VK_KHR_surface")
Michael Lentine88594d72015-11-12 12:49:45 -0800918enum VkColorSpaceKHR {
919 VK_COLORSPACE_SRGB_NONLINEAR_KHR = 0x00000000,
920}
Jesse Halld27f6aa2015-08-15 17:58:48 -0700921
Jesse Hall715b86a2016-01-16 16:34:29 -0800922@extension("VK_EXT_debug_report")
923enum VkDebugReportObjectTypeEXT {
924 VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT = 0,
925 VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT = 1,
926 VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT = 2,
927 VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT = 3,
928 VK_DEBUG_REPORT_OBJECT_TYPE_QUEUE_EXT = 4,
929 VK_DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT = 5,
930 VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT = 6,
931 VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT = 7,
932 VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT = 8,
933 VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT = 9,
934 VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT = 10,
935 VK_DEBUG_REPORT_OBJECT_TYPE_EVENT_EXT = 11,
936 VK_DEBUG_REPORT_OBJECT_TYPE_QUERY_POOL_EXT = 12,
937 VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_VIEW_EXT = 13,
938 VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_VIEW_EXT = 14,
939 VK_DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT = 15,
940 VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_CACHE_EXT = 16,
941 VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_LAYOUT_EXT = 17,
942 VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT = 18,
943 VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT = 19,
944 VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT_EXT = 20,
945 VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_EXT = 21,
946 VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT = 22,
947 VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT = 23,
948 VK_DEBUG_REPORT_OBJECT_TYPE_FRAMEBUFFER_EXT = 24,
949 VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_POOL_EXT = 25,
950 VK_DEBUG_REPORT_OBJECT_TYPE_SURFACE_KHR_EXT = 26,
951 VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT = 27,
952 VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_EXT = 28,
Chris Forbes289cb792016-12-30 15:03:55 +1300953 VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_KHR_EXT = 29,
954 VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_MODE_KHR_EXT = 30,
955 VK_DEBUG_REPORT_OBJECT_TYPE_OBJECT_TABLE_NVX_EXT = 31,
956 VK_DEBUG_REPORT_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NVX_EXT = 32,
Jesse Hall715b86a2016-01-16 16:34:29 -0800957}
958
959@extension("VK_EXT_debug_report")
960enum VkDebugReportErrorEXT {
961 VK_DEBUG_REPORT_ERROR_NONE_EXT = 0,
962 VK_DEBUG_REPORT_ERROR_CALLBACK_REF_EXT = 1,
963}
964
Jesse Hall26763382016-05-20 07:13:52 -0700965@extension("VK_AMD_rasterization_order")
966enum VkRasterizationOrderAMD {
967 VK_RASTERIZATION_ORDER_STRICT_AMD = 0,
968 VK_RASTERIZATION_ORDER_RELAXED_AMD = 1,
969}
970
Chris Forbes289cb792016-12-30 15:03:55 +1300971@extension("VK_EXT_validation_flags")
972enum VkValidationCheckEXT {
973 VK_VALIDATION_CHECK_ALL_EXT = 0,
974}
975
976@extension("VK_NVX_device_generated_commands")
977enum VkIndirectCommandsTokenTypeNVX {
978 VK_INDIRECT_COMMANDS_TOKEN_PIPELINE_NVX = 0,
979 VK_INDIRECT_COMMANDS_TOKEN_DESCRIPTOR_SET_NVX = 1,
980 VK_INDIRECT_COMMANDS_TOKEN_INDEX_BUFFER_NVX = 2,
981 VK_INDIRECT_COMMANDS_TOKEN_VERTEX_BUFFER_NVX = 3,
982 VK_INDIRECT_COMMANDS_TOKEN_PUSH_CONSTANT_NVX = 4,
983 VK_INDIRECT_COMMANDS_TOKEN_DRAW_INDEXED_NVX = 5,
984 VK_INDIRECT_COMMANDS_TOKEN_DRAW_NVX = 6,
985 VK_INDIRECT_COMMANDS_TOKEN_DISPATCH_NVX = 7,
986}
987
988@extension("VK_NVX_device_generated_commands")
989enum VkObjectEntryTypeNVX {
990 VK_OBJECT_ENTRY_DESCRIPTOR_SET_NVX = 0,
991 VK_OBJECT_ENTRY_PIPELINE_NVX = 1,
992 VK_OBJECT_ENTRY_INDEX_BUFFER_NVX = 2,
993 VK_OBJECT_ENTRY_VERTEX_BUFFER_NVX = 3,
994 VK_OBJECT_ENTRY_PUSH_CONSTANT_NVX = 4,
995}
Jesse Hall715b86a2016-01-16 16:34:29 -0800996
Jesse Halld27f6aa2015-08-15 17:58:48 -0700997/////////////////
998// Bitfields //
999/////////////////
1000
Jesse Halld27f6aa2015-08-15 17:58:48 -07001001/// Queue capabilities
Jesse Halld8bade02015-11-24 10:24:18 -08001002type VkFlags VkQueueFlags
1003bitfield VkQueueFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001004 VK_QUEUE_GRAPHICS_BIT = 0x00000001, /// Queue supports graphics operations
1005 VK_QUEUE_COMPUTE_BIT = 0x00000002, /// Queue supports compute operations
Jesse Hall65ab5522015-11-30 00:07:16 -08001006 VK_QUEUE_TRANSFER_BIT = 0x00000004, /// Queue supports transfer operations
Jesse Hallb00daad2015-11-29 19:46:20 -08001007 VK_QUEUE_SPARSE_BINDING_BIT = 0x00000008, /// Queue supports sparse resource memory management operations
Jesse Halld27f6aa2015-08-15 17:58:48 -07001008}
1009
1010/// Memory properties passed into vkAllocMemory().
Jesse Halld8bade02015-11-24 10:24:18 -08001011type VkFlags VkMemoryPropertyFlags
1012bitfield VkMemoryPropertyFlagBits {
Jesse Halld1af8122015-11-29 23:50:38 -08001013 VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT = 0x00000001,
1014 VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT = 0x00000002,
1015 VK_MEMORY_PROPERTY_HOST_COHERENT_BIT = 0x00000004,
1016 VK_MEMORY_PROPERTY_HOST_CACHED_BIT = 0x00000008,
1017 VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT = 0x00000010,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001018}
1019
1020/// Memory heap flags
Jesse Halld8bade02015-11-24 10:24:18 -08001021type VkFlags VkMemoryHeapFlags
1022bitfield VkMemoryHeapFlagBits {
Jesse Halld1af8122015-11-29 23:50:38 -08001023 VK_MEMORY_HEAP_DEVICE_LOCAL_BIT = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001024}
1025
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001026/// Access flags
1027type VkFlags VkAccessFlags
1028bitfield VkAccessFlagBits {
1029 VK_ACCESS_INDIRECT_COMMAND_READ_BIT = 0x00000001,
1030 VK_ACCESS_INDEX_READ_BIT = 0x00000002,
1031 VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT = 0x00000004,
1032 VK_ACCESS_UNIFORM_READ_BIT = 0x00000008,
1033 VK_ACCESS_INPUT_ATTACHMENT_READ_BIT = 0x00000010,
1034 VK_ACCESS_SHADER_READ_BIT = 0x00000020,
1035 VK_ACCESS_SHADER_WRITE_BIT = 0x00000040,
1036 VK_ACCESS_COLOR_ATTACHMENT_READ_BIT = 0x00000080,
1037 VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT = 0x00000100,
1038 VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT = 0x00000200,
1039 VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT = 0x00000400,
1040 VK_ACCESS_TRANSFER_READ_BIT = 0x00000800,
1041 VK_ACCESS_TRANSFER_WRITE_BIT = 0x00001000,
1042 VK_ACCESS_HOST_READ_BIT = 0x00002000,
1043 VK_ACCESS_HOST_WRITE_BIT = 0x00004000,
1044 VK_ACCESS_MEMORY_READ_BIT = 0x00008000,
1045 VK_ACCESS_MEMORY_WRITE_BIT = 0x00010000,
Chris Forbes289cb792016-12-30 15:03:55 +13001046
1047 //@extension("VK_NVX_device_generated_commands")
1048 VK_ACCESS_COMMAND_PROCESS_READ_BIT_NVX = 0x00020000,
1049
1050 //@extension("VK_NVX_device_generated_commands")
1051 VK_ACCESS_COMMAND_PROCESS_WRITE_BIT_NVX = 0x00040000,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001052}
1053
1054/// Buffer usage flags
Jesse Halld8bade02015-11-24 10:24:18 -08001055type VkFlags VkBufferUsageFlags
1056bitfield VkBufferUsageFlagBits {
Jesse Hall3fbc8562015-11-29 22:10:52 -08001057 VK_BUFFER_USAGE_TRANSFER_SRC_BIT = 0x00000001, /// Can be used as a source of transfer operations
1058 VK_BUFFER_USAGE_TRANSFER_DST_BIT = 0x00000002, /// Can be used as a destination of transfer operations
Jesse Halld27f6aa2015-08-15 17:58:48 -07001059 VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000004, /// Can be used as TBO
1060 VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT = 0x00000008, /// Can be used as IBO
1061 VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT = 0x00000010, /// Can be used as UBO
1062 VK_BUFFER_USAGE_STORAGE_BUFFER_BIT = 0x00000020, /// Can be used as SSBO
1063 VK_BUFFER_USAGE_INDEX_BUFFER_BIT = 0x00000040, /// Can be used as source of fixed function index fetch (index buffer)
1064 VK_BUFFER_USAGE_VERTEX_BUFFER_BIT = 0x00000080, /// Can be used as source of fixed function vertex fetch (VBO)
1065 VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT = 0x00000100, /// Can be the source of indirect parameters (e.g. indirect buffer, parameter buffer)
1066}
1067
1068/// Buffer creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001069type VkFlags VkBufferCreateFlags
1070bitfield VkBufferCreateFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001071 VK_BUFFER_CREATE_SPARSE_BINDING_BIT = 0x00000001, /// Buffer should support sparse backing
Jesse Halld27f6aa2015-08-15 17:58:48 -07001072 VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002, /// Buffer should support sparse backing with partial residency
1073 VK_BUFFER_CREATE_SPARSE_ALIASED_BIT = 0x00000004, /// Buffer should support constent data access to physical memory blocks mapped into multiple locations of sparse buffers
1074}
1075
1076/// Shader stage flags
Jesse Halld8bade02015-11-24 10:24:18 -08001077type VkFlags VkShaderStageFlags
1078bitfield VkShaderStageFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001079 VK_SHADER_STAGE_VERTEX_BIT = 0x00000001,
Jesse Hallae38f732015-11-19 21:32:50 -08001080 VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT = 0x00000002,
1081 VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001082 VK_SHADER_STAGE_GEOMETRY_BIT = 0x00000008,
1083 VK_SHADER_STAGE_FRAGMENT_BIT = 0x00000010,
1084 VK_SHADER_STAGE_COMPUTE_BIT = 0x00000020,
Jesse Hallc7467b72015-11-29 21:05:26 -08001085 VK_SHADER_STAGE_ALL_GRAPHICS = 0x0000001F,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001086
1087 VK_SHADER_STAGE_ALL = 0x7FFFFFFF,
1088}
1089
Jesse Hallfbf97b02015-11-20 14:17:03 -08001090/// Descriptor pool create flags
Jesse Halld8bade02015-11-24 10:24:18 -08001091type VkFlags VkDescriptorPoolCreateFlags
1092bitfield VkDescriptorPoolCreateFlagBits {
Jesse Hallfbf97b02015-11-20 14:17:03 -08001093 VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT = 0x00000001,
1094}
1095
1096/// Descriptor pool reset flags
Jesse Halld8bade02015-11-24 10:24:18 -08001097type VkFlags VkDescriptorPoolResetFlags
Jesse Halla6429252015-11-29 18:59:42 -08001098//bitfield VkDescriptorPoolResetFlagBits {
1099//}
Jesse Hallfbf97b02015-11-20 14:17:03 -08001100
Jesse Halld27f6aa2015-08-15 17:58:48 -07001101/// Image usage flags
Jesse Halld8bade02015-11-24 10:24:18 -08001102type VkFlags VkImageUsageFlags
1103bitfield VkImageUsageFlagBits {
Jesse Hall3fbc8562015-11-29 22:10:52 -08001104 VK_IMAGE_USAGE_TRANSFER_SRC_BIT = 0x00000001, /// Can be used as a source of transfer operations
1105 VK_IMAGE_USAGE_TRANSFER_DST_BIT = 0x00000002, /// Can be used as a destination of transfer operations
Jesse Halld27f6aa2015-08-15 17:58:48 -07001106 VK_IMAGE_USAGE_SAMPLED_BIT = 0x00000004, /// Can be sampled from (SAMPLED_IMAGE and COMBINED_IMAGE_SAMPLER descriptor types)
1107 VK_IMAGE_USAGE_STORAGE_BIT = 0x00000008, /// Can be used as storage image (STORAGE_IMAGE descriptor type)
1108 VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT = 0x00000010, /// Can be used as framebuffer color attachment
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001109 VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000020, /// Can be used as framebuffer depth/stencil attachment
Jesse Halld27f6aa2015-08-15 17:58:48 -07001110 VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT = 0x00000040, /// Image data not needed outside of rendering
1111 VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT = 0x00000080, /// Can be used as framebuffer input attachment
1112}
1113
1114/// Image creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001115type VkFlags VkImageCreateFlags
1116bitfield VkImageCreateFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001117 VK_IMAGE_CREATE_SPARSE_BINDING_BIT = 0x00000001, /// Image should support sparse backing
Jesse Halld27f6aa2015-08-15 17:58:48 -07001118 VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002, /// Image should support sparse backing with partial residency
1119 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 -07001120 VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT = 0x00000008, /// Allows image views to have different format than the base image
1121 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 -07001122}
1123
Jesse Hallb00daad2015-11-29 19:46:20 -08001124/// Image view creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001125type VkFlags VkImageViewCreateFlags
Jesse Hallb00daad2015-11-29 19:46:20 -08001126//bitfield VkImageViewCreateFlagBits {
1127//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001128
1129/// Pipeline creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001130type VkFlags VkPipelineCreateFlags
1131bitfield VkPipelineCreateFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001132 VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT = 0x00000001,
1133 VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT = 0x00000002,
1134 VK_PIPELINE_CREATE_DERIVATIVE_BIT = 0x00000004,
1135}
1136
Jesse Hall65ab5522015-11-30 00:07:16 -08001137/// Color component flags
1138type VkFlags VkColorComponentFlags
1139bitfield VkColorComponentFlagBits {
1140 VK_COLOR_COMPONENT_R_BIT = 0x00000001,
1141 VK_COLOR_COMPONENT_G_BIT = 0x00000002,
1142 VK_COLOR_COMPONENT_B_BIT = 0x00000004,
1143 VK_COLOR_COMPONENT_A_BIT = 0x00000008,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001144}
1145
1146/// Fence creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001147type VkFlags VkFenceCreateFlags
1148bitfield VkFenceCreateFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001149 VK_FENCE_CREATE_SIGNALED_BIT = 0x00000001,
1150}
1151
1152/// Semaphore creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001153type VkFlags VkSemaphoreCreateFlags
Jesse Halla6429252015-11-29 18:59:42 -08001154//bitfield VkSemaphoreCreateFlagBits {
1155//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001156
1157/// Format capability flags
Jesse Halld8bade02015-11-24 10:24:18 -08001158type VkFlags VkFormatFeatureFlags
1159bitfield VkFormatFeatureFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001160 VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT = 0x00000001, /// Format can be used for sampled images (SAMPLED_IMAGE and COMBINED_IMAGE_SAMPLER descriptor types)
1161 VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT = 0x00000002, /// Format can be used for storage images (STORAGE_IMAGE descriptor type)
1162 VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT = 0x00000004, /// Format supports atomic operations in case it's used for storage images
1163 VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000008, /// Format can be used for uniform texel buffers (TBOs)
1164 VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT = 0x00000010, /// Format can be used for storage texel buffers (IBOs)
1165 VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT = 0x00000020, /// Format supports atomic operations in case it's used for storage texel buffers
1166 VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT = 0x00000040, /// Format can be used for vertex buffers (VBOs)
1167 VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT = 0x00000080, /// Format can be used for color attachment images
1168 VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT = 0x00000100, /// Format supports blending in case it's used for color attachment images
1169 VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000200, /// Format can be used for depth/stencil attachment images
Jesse Hall3fbc8562015-11-29 22:10:52 -08001170 VK_FORMAT_FEATURE_BLIT_SRC_BIT = 0x00000400, /// Format can be used as the source image of blits with vkCommandBlitImage
1171 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 -08001172 VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT = 0x00001000,
Jesse Hall26763382016-05-20 07:13:52 -07001173
1174 //@extension("VK_IMG_filter_cubic")
1175 VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG = 0x00002000,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001176}
1177
1178/// Query control flags
Jesse Halld8bade02015-11-24 10:24:18 -08001179type VkFlags VkQueryControlFlags
1180bitfield VkQueryControlFlagBits {
Jesse Hall65ab5522015-11-30 00:07:16 -08001181 VK_QUERY_CONTROL_PRECISE_BIT = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001182}
1183
1184/// Query result flags
Jesse Halld8bade02015-11-24 10:24:18 -08001185type VkFlags VkQueryResultFlags
1186bitfield VkQueryResultFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001187 VK_QUERY_RESULT_64_BIT = 0x00000001, /// Results of the queries are written to the destination buffer as 64-bit values
1188 VK_QUERY_RESULT_WAIT_BIT = 0x00000002, /// Results of the queries are waited on before proceeding with the result copy
1189 VK_QUERY_RESULT_WITH_AVAILABILITY_BIT = 0x00000004, /// Besides the results of the query, the availability of the results is also written
1190 VK_QUERY_RESULT_PARTIAL_BIT = 0x00000008, /// Copy the partial results of the query even if the final results aren't available
1191}
1192
1193/// Shader module creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001194type VkFlags VkShaderModuleCreateFlags
Jesse Halla6429252015-11-29 18:59:42 -08001195//bitfield VkShaderModuleCreateFlagBits {
1196//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001197
Jesse Halld27f6aa2015-08-15 17:58:48 -07001198/// Event creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001199type VkFlags VkEventCreateFlags
Jesse Halla6429252015-11-29 18:59:42 -08001200//bitfield VkEventCreateFlagBits {
1201//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001202
Jesse Halla15a4bf2015-11-19 22:48:02 -08001203/// Command buffer usage flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001204type VkFlags VkCommandBufferUsageFlags
1205bitfield VkCommandBufferUsageFlagBits {
1206 VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT = 0x00000001,
1207 VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT = 0x00000002,
1208 VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001209}
1210
1211/// Pipeline statistics flags
Jesse Halld8bade02015-11-24 10:24:18 -08001212type VkFlags VkQueryPipelineStatisticFlags
1213bitfield VkQueryPipelineStatisticFlagBits {
Jesse Hallae38f732015-11-19 21:32:50 -08001214 VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_BIT = 0x00000001, /// Optional
1215 VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_PRIMITIVES_BIT = 0x00000002, /// Optional
1216 VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT = 0x00000004, /// Optional
1217 VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_INVOCATIONS_BIT = 0x00000008, /// Optional
1218 VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT = 0x00000010, /// Optional
1219 VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT = 0x00000020, /// Optional
1220 VK_QUERY_PIPELINE_STATISTIC_CLIPPING_PRIMITIVES_BIT = 0x00000040, /// Optional
1221 VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT = 0x00000080, /// Optional
1222 VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT = 0x00000100, /// Optional
1223 VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT = 0x00000200, /// Optional
1224 VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT = 0x00000400, /// Optional
Jesse Halld27f6aa2015-08-15 17:58:48 -07001225}
1226
1227/// Memory mapping flags
Jesse Halld8bade02015-11-24 10:24:18 -08001228type VkFlags VkMemoryMapFlags
Jesse Halla6429252015-11-29 18:59:42 -08001229//bitfield VkMemoryMapFlagBits {
1230//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001231
1232/// Bitfield of image aspects
Jesse Halld8bade02015-11-24 10:24:18 -08001233type VkFlags VkImageAspectFlags
1234bitfield VkImageAspectFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001235 VK_IMAGE_ASPECT_COLOR_BIT = 0x00000001,
1236 VK_IMAGE_ASPECT_DEPTH_BIT = 0x00000002,
1237 VK_IMAGE_ASPECT_STENCIL_BIT = 0x00000004,
1238 VK_IMAGE_ASPECT_METADATA_BIT = 0x00000008,
1239}
1240
1241/// Sparse memory bind flags
Jesse Halld8bade02015-11-24 10:24:18 -08001242type VkFlags VkSparseMemoryBindFlags
Jesse Hall091ed9e2015-11-30 00:55:29 -08001243bitfield VkSparseMemoryBindFlagBits {
1244 VK_SPARSE_MEMORY_BIND_METADATA_BIT = 0x00000001,
1245}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001246
1247/// Sparse image memory requirements flags
Jesse Halld8bade02015-11-24 10:24:18 -08001248type VkFlags VkSparseImageFormatFlags
1249bitfield VkSparseImageFormatFlagBits {
Jesse Hallb00daad2015-11-29 19:46:20 -08001250 VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT = 0x00000001, /// Image uses a single miptail region for all array slices
1251 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.
1252 VK_SPARSE_IMAGE_FORMAT_NONSTANDARD_BLOCK_SIZE_BIT = 0x00000004, /// Image uses a non-standard sparse block size
Jesse Halld27f6aa2015-08-15 17:58:48 -07001253}
1254
1255/// Pipeline stages
Jesse Halld8bade02015-11-24 10:24:18 -08001256type VkFlags VkPipelineStageFlags
1257bitfield VkPipelineStageFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001258 VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT = 0x00000001, /// Before subsequent commands are processed
1259 VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT = 0x00000002, /// Draw/DispatchIndirect command fetch
1260 VK_PIPELINE_STAGE_VERTEX_INPUT_BIT = 0x00000004, /// Vertex/index fetch
1261 VK_PIPELINE_STAGE_VERTEX_SHADER_BIT = 0x00000008, /// Vertex shading
Jesse Hallae38f732015-11-19 21:32:50 -08001262 VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT = 0x00000010, /// Tessellation control shading
1263 VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT = 0x00000020, /// Tessellation evaluation shading
Jesse Halld27f6aa2015-08-15 17:58:48 -07001264 VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT = 0x00000040, /// Geometry shading
1265 VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT = 0x00000080, /// Fragment shading
1266 VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT = 0x00000100, /// Early fragment (depth/stencil) tests
1267 VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT = 0x00000200, /// Late fragment (depth/stencil) tests
1268 VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT = 0x00000400, /// Color attachment writes
1269 VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT = 0x00000800, /// Compute shading
1270 VK_PIPELINE_STAGE_TRANSFER_BIT = 0x00001000, /// Transfer/copy operations
Jesse Hall543a7ff2016-01-08 16:38:30 -08001271 VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT = 0x00002000,
1272 VK_PIPELINE_STAGE_HOST_BIT = 0x00004000, /// Indicates host (CPU) is a source/sink of the dependency
Jesse Halld27f6aa2015-08-15 17:58:48 -07001273
Jesse Hall543a7ff2016-01-08 16:38:30 -08001274 VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT = 0x00008000, /// All stages of the graphics pipeline
1275 VK_PIPELINE_STAGE_ALL_COMMANDS_BIT = 0x00010000, /// All graphics, compute, copy, and transition commands
Chris Forbes289cb792016-12-30 15:03:55 +13001276
1277 //@extension("VK_NVX_device_generated_commands")
1278 VK_PIPELINE_STAGE_COMMAND_PROCESS_BIT_NVX = 0x00020000,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001279}
1280
1281/// Render pass attachment description flags
Jesse Halld8bade02015-11-24 10:24:18 -08001282type VkFlags VkAttachmentDescriptionFlags
1283bitfield VkAttachmentDescriptionFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001284 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 -07001285}
1286
1287/// Subpass description flags
Jesse Halld8bade02015-11-24 10:24:18 -08001288type VkFlags VkSubpassDescriptionFlags
1289bitfield VkSubpassDescriptionFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001290}
1291
1292/// Command pool creation flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001293type VkFlags VkCommandPoolCreateFlags
1294bitfield VkCommandPoolCreateFlagBits {
1295 VK_COMMAND_POOL_CREATE_TRANSIENT_BIT = 0x00000001, /// Command buffers have a short lifetime
1296 VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT = 0x00000002, /// Command buffers may release their memory individually
Jesse Halld27f6aa2015-08-15 17:58:48 -07001297}
1298
1299/// Command pool reset flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001300type VkFlags VkCommandPoolResetFlags
1301bitfield VkCommandPoolResetFlagBits {
1302 VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT = 0x00000001, /// Release resources owned by the pool
Jesse Halld27f6aa2015-08-15 17:58:48 -07001303}
1304
Jesse Hall3fbc8562015-11-29 22:10:52 -08001305type VkFlags VkCommandBufferResetFlags
1306bitfield VkCommandBufferResetFlagBits {
1307 VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT = 0x00000001, /// Release resources owned by the buffer
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001308}
1309
Jesse Halld8bade02015-11-24 10:24:18 -08001310type VkFlags VkSampleCountFlags
1311bitfield VkSampleCountFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001312 VK_SAMPLE_COUNT_1_BIT = 0x00000001,
1313 VK_SAMPLE_COUNT_2_BIT = 0x00000002,
1314 VK_SAMPLE_COUNT_4_BIT = 0x00000004,
1315 VK_SAMPLE_COUNT_8_BIT = 0x00000008,
1316 VK_SAMPLE_COUNT_16_BIT = 0x00000010,
1317 VK_SAMPLE_COUNT_32_BIT = 0x00000020,
1318 VK_SAMPLE_COUNT_64_BIT = 0x00000040,
1319}
1320
Jesse Halld8bade02015-11-24 10:24:18 -08001321type VkFlags VkStencilFaceFlags
1322bitfield VkStencilFaceFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001323 VK_STENCIL_FACE_FRONT_BIT = 0x00000001, /// Front face
1324 VK_STENCIL_FACE_BACK_BIT = 0x00000002, /// Back face
Jesse Hallc7467b72015-11-29 21:05:26 -08001325 VK_STENCIL_FRONT_AND_BACK = 0x00000003,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001326}
1327
Jesse Halla6429252015-11-29 18:59:42 -08001328/// Instance creation flags
1329type VkFlags VkInstanceCreateFlags
1330//bitfield VkInstanceCreateFlagBits {
1331//}
1332
1333/// Device creation flags
1334type VkFlags VkDeviceCreateFlags
1335//bitfield VkDeviceCreateFlagBits {
1336//}
1337
1338/// Device queue creation flags
1339type VkFlags VkDeviceQueueCreateFlags
1340//bitfield VkDeviceQueueCreateFlagBits {
1341//}
1342
1343/// Query pool creation flags
1344type VkFlags VkQueryPoolCreateFlags
1345//bitfield VkQueryPoolCreateFlagBits {
1346//}
1347
1348/// Buffer view creation flags
1349type VkFlags VkBufferViewCreateFlags
1350//bitfield VkBufferViewCreateFlagBits {
1351//}
1352
1353/// Pipeline cache creation flags
1354type VkFlags VkPipelineCacheCreateFlags
1355//bitfield VkPipelineCacheCreateFlagBits {
1356//}
1357
1358/// Pipeline shader stage creation flags
1359type VkFlags VkPipelineShaderStageCreateFlags
1360//bitfield VkPipelineShaderStageCreateFlagBits {
1361//}
1362
1363/// Descriptor set layout creation flags
1364type VkFlags VkDescriptorSetLayoutCreateFlags
1365//bitfield VkDescriptorSetLayoutCreateFlagBits {
1366//}
1367
1368/// Pipeline vertex input state creation flags
1369type VkFlags VkPipelineVertexInputStateCreateFlags
1370//bitfield VkPipelineVertexInputStateCreateFlagBits {
1371//}
1372
1373/// Pipeline input assembly state creation flags
1374type VkFlags VkPipelineInputAssemblyStateCreateFlags
1375//bitfield VkPipelineInputAssemblyStateCreateFlagBits {
1376//}
1377
1378/// Tessellation state creation flags
1379type VkFlags VkPipelineTessellationStateCreateFlags
1380//bitfield VkPipelineTessellationStateCreateFlagBits {
1381//}
1382
1383/// Viewport state creation flags
1384type VkFlags VkPipelineViewportStateCreateFlags
1385//bitfield VkPipelineViewportStateCreateFlagBits {
1386//}
1387
Jesse Hall3fbc8562015-11-29 22:10:52 -08001388/// Rasterization state creation flags
1389type VkFlags VkPipelineRasterizationStateCreateFlags
1390//bitfield VkPipelineRasterizationStateCreateFlagBits {
Jesse Halla6429252015-11-29 18:59:42 -08001391//}
1392
1393/// Multisample state creation flags
1394type VkFlags VkPipelineMultisampleStateCreateFlags
1395//bitfield VkPipelineMultisampleStateCreateFlagBits {
1396//}
1397
1398/// Color blend state creation flags
1399type VkFlags VkPipelineColorBlendStateCreateFlags
1400//bitfield VkPipelineColorBlendStateCreateFlagBits {
1401//}
1402
1403/// Depth/stencil state creation flags
1404type VkFlags VkPipelineDepthStencilStateCreateFlags
1405//bitfield VkPipelineDepthStencilStateCreateFlagBits {
1406//}
1407
1408/// Dynamic state creation flags
1409type VkFlags VkPipelineDynamicStateCreateFlags
1410//bitfield VkPipelineDynamicStateCreateFlagBits {
1411//}
1412
1413/// Pipeline layout creation flags
1414type VkFlags VkPipelineLayoutCreateFlags
1415//bitfield VkPipelineLayoutCreateFlagBits {
1416//}
1417
1418/// Sampler creation flags
1419type VkFlags VkSamplerCreateFlags
1420//bitfield VkSamplerCreateFlagBits {
1421//}
1422
1423/// Render pass creation flags
1424type VkFlags VkRenderPassCreateFlags
1425//bitfield VkRenderPassCreateFlagBits {
1426//}
1427
1428/// Framebuffer creation flags
1429type VkFlags VkFramebufferCreateFlags
1430//bitfield VkFramebufferCreateFlagBits {
1431//}
1432
Jesse Halldc6d36c2015-11-29 19:12:15 -08001433/// Dependency flags
1434type VkFlags VkDependencyFlags
1435bitfield VkDependencyFlagBits {
1436 VK_DEPENDENCY_BY_REGION_BIT = 0x00000001,
1437}
1438
Jesse Hallc7467b72015-11-29 21:05:26 -08001439/// Cull mode flags
1440type VkFlags VkCullModeFlags
1441bitfield VkCullModeFlagBits {
1442 VK_CULL_MODE_NONE = 0x00000000,
1443 VK_CULL_MODE_FRONT_BIT = 0x00000001,
1444 VK_CULL_MODE_BACK_BIT = 0x00000002,
1445 VK_CULL_MODE_FRONT_AND_BACK = 0x00000003,
1446}
1447
Jesse Hall523db342015-11-30 21:12:55 -08001448@extension("VK_KHR_surface")
Jesse Halld8bade02015-11-24 10:24:18 -08001449type VkFlags VkSurfaceTransformFlagsKHR
Jesse Hall523db342015-11-30 21:12:55 -08001450@extension("VK_KHR_surface")
Jesse Halld8bade02015-11-24 10:24:18 -08001451bitfield VkSurfaceTransformFlagBitsKHR {
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001452 VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR = 0x00000001,
Jesse Hall9ba8bc82015-11-30 16:22:16 -08001453 VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR = 0x00000002,
1454 VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR = 0x00000004,
1455 VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR = 0x00000008,
1456 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR = 0x00000010,
1457 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR = 0x00000020,
1458 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR = 0x00000040,
1459 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR = 0x00000080,
1460 VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR = 0x00000100,
Michael Lentine88594d72015-11-12 12:49:45 -08001461}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001462
Jesse Hall523db342015-11-30 21:12:55 -08001463@extension("VK_KHR_surface")
Jesse Halla6429252015-11-29 18:59:42 -08001464type VkFlags VkCompositeAlphaFlagsKHR
Jesse Hall523db342015-11-30 21:12:55 -08001465@extension("VK_KHR_surface")
Jesse Halla6429252015-11-29 18:59:42 -08001466bitfield VkCompositeAlphaFlagBitsKHR {
1467 VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR = 0x00000001,
1468 VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR = 0x00000002,
1469 VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR = 0x00000004,
1470 VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR = 0x00000008,
1471}
1472
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001473@extension("VK_KHR_swapchain")
1474type VkFlags VkSwapchainCreateFlagsKHR
1475//@extension("VK_KHR_swapchain")
1476//bitfield VkSwapchainCreateFlagBitsKHR {
1477//}
1478
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001479@extension("VK_KHR_display")
Jesse Halld8bade02015-11-24 10:24:18 -08001480type VkFlags VkDisplayPlaneAlphaFlagsKHR
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001481@extension("VK_KHR_display")
Jesse Halld8bade02015-11-24 10:24:18 -08001482bitfield VkDisplayPlaneAlphaFlagBitsKHR {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001483 VK_DISPLAY_PLANE_ALPHA_OPAQUE_BIT_KHR = 0x00000001,
1484 VK_DISPLAY_PLANE_ALPHA_GLOBAL_BIT_KHR = 0x00000002,
1485 VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_BIT_KHR = 0x00000004,
1486 VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_PREMULTIPLIED_BIT_KHR = 0x00000008,
Jesse Hall1356b0d2015-11-23 17:24:58 -08001487}
1488
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001489@extension("VK_KHR_display")
1490type VkFlags VkDisplaySurfaceCreateFlagsKHR
1491//@extension("VK_KHR_display")
1492//bitfield VkDisplaySurfaceCreateFlagBitsKHR {
1493//}
1494
Jesse Hall9ba8bc82015-11-30 16:22:16 -08001495@extension("VK_KHR_display")
1496type VkFlags VkDisplayModeCreateFlagsKHR
1497//@extension("VK_KHR_display")
1498//bitfield VkDisplayModeCreateFlagBitsKHR {
1499//}
1500
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001501@extension("VK_KHR_xlib_surface")
1502type VkFlags VkXlibSurfaceCreateFlagsKHR
1503//@extension("VK_KHR_xlib_surface")
1504//bitfield VkXlibSurfaceCreateFlagBitsKHR {
1505//}
1506
1507@extension("VK_KHR_xcb_surface")
1508type VkFlags VkXcbSurfaceCreateFlagsKHR
1509//@extension("VK_KHR_xcb_surface")
1510//bitfield VkXcbSurfaceCreateFlagBitsKHR {
1511//}
1512
1513@extension("VK_KHR_wayland_surface")
1514type VkFlags VkWaylandSurfaceCreateFlagsKHR
1515//@extension("VK_KHR_wayland_surface")
1516//bitfield VkWaylandSurfaceCreateFlagBitsKHR {
1517//}
1518
1519@extension("VK_KHR_mir_surface")
1520type VkFlags VkMirSurfaceCreateFlagsKHR
1521//@extension("VK_KHR_mir_surface")
1522//bitfield VkMirSurfaceCreateFlagBitsKHR {
1523//}
1524
1525@extension("VK_KHR_android_surface")
1526type VkFlags VkAndroidSurfaceCreateFlagsKHR
1527//@extension("VK_KHR_android_surface")
1528//bitfield VkAndroidSurfaceCreateFlagBitsKHR {
1529//}
1530
1531@extension("VK_KHR_win32_surface")
1532type VkFlags VkWin32SurfaceCreateFlagsKHR
1533//@extension("VK_KHR_win32_surface")
1534//bitfield VkWin32SurfaceCreateFlagBitsKHR {
1535//}
1536
Jesse Hall715b86a2016-01-16 16:34:29 -08001537@extension("VK_EXT_debug_report")
1538type VkFlags VkDebugReportFlagsEXT
1539@extension("VK_EXT_debug_report")
1540bitfield VkDebugReportFlagBitsEXT {
Jesse Halle2948d82016-02-25 04:19:32 -08001541 VK_DEBUG_REPORT_INFORMATION_BIT_EXT = 0x00000001,
1542 VK_DEBUG_REPORT_WARNING_BIT_EXT = 0x00000002,
1543 VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT = 0x00000004,
Jesse Hall715b86a2016-01-16 16:34:29 -08001544 VK_DEBUG_REPORT_ERROR_BIT_EXT = 0x00000008,
1545 VK_DEBUG_REPORT_DEBUG_BIT_EXT = 0x00000010,
1546}
1547
Chris Forbes8e4438b2016-12-07 16:26:49 +13001548@extension("VK_ANDROID_native_buffer")
1549type VkFlags VkSwapchainImageUsageFlagsANDROID
1550@extension("VK_ANDROID_native_buffer")
1551bitfield VkSwapchainImageUsageFlagBitsANDROID {
1552 VK_SWAPCHAIN_IMAGE_USAGE_FLAGS_FRONT_BUFFER_BIT_ANDROID = 0x00000001,
1553}
1554
Chris Forbes289cb792016-12-30 15:03:55 +13001555@extension("VK_NV_external_memory_capabilities")
1556type VkFlags VkExternalMemoryHandleTypeFlagsNV
1557@extension("VK_NV_external_memory_capabilities")
1558bitfield VkExternalMemoryHandleTypeFlagBitsNV {
1559 VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_NV = 0x00000001,
1560 VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_NV = 0x00000002,
1561 VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_IMAGE_BIT_NV = 0x00000004,
1562 VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_IMAGE_KMT_BIT_NV = 0x00000008,
1563}
1564
1565@extension("VK_NV_external_memory_capabilities")
1566type VkFlags VkExternalMemoryFeatureFlagsNV
1567@extension("VK_NV_external_memory_capabilities")
1568bitfield VkExternalMemoryFeatureFlagBitsNV {
1569 VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT_NV = 0x00000001,
1570 VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT_NV = 0x00000002,
1571 VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT_NV = 0x00000004,
1572}
1573
1574@extension("VK_NVX_device_generated_commands")
1575type VkFlags VkIndirectCommandsLayoutUsageFlagsNVX
1576@extension("VK_NVX_device_generated_commands")
1577bitfield VkIndirectCommandsLayoutUsageFlagBitsNVX {
1578 VK_INDIRECT_COMMANDS_LAYOUT_USAGE_UNORDERED_SEQUENCES_BIT_NVX = 0x00000001,
1579 VK_INDIRECT_COMMANDS_LAYOUT_USAGE_SPARSE_SEQUENCES_BIT_NVX = 0x00000002,
1580 VK_INDIRECT_COMMANDS_LAYOUT_USAGE_EMPTY_EXECUTIONS_BIT_NVX = 0x00000004,
1581 VK_INDIRECT_COMMANDS_LAYOUT_USAGE_INDEXED_SEQUENCES_BIT_NVX = 0x00000008,
1582}
1583
1584@extension("VK_NVX_device_generated_commands")
1585type VkFlags VkObjectEntryUsageFlagsNVX
1586@extension("VK_NVX_device_generated_commands")
1587bitfield VkObjectEntryUsageFlagBitsNVX {
1588 VK_OBJECT_ENTRY_USAGE_GRAPHICS_BIT_NVX = 0x00000001,
1589 VK_OBJECT_ENTRY_USAGE_COMPUTE_BIT_NVX = 0x00000002,
1590}
1591
Jesse Hall1356b0d2015-11-23 17:24:58 -08001592
Jesse Halld27f6aa2015-08-15 17:58:48 -07001593//////////////////
1594// Structures //
1595//////////////////
1596
1597class VkOffset2D {
1598 s32 x
1599 s32 y
1600}
1601
1602class VkOffset3D {
1603 s32 x
1604 s32 y
1605 s32 z
1606}
1607
1608class VkExtent2D {
Jesse Hall3dd678a2016-01-08 21:52:01 -08001609 u32 width
1610 u32 height
Jesse Halld27f6aa2015-08-15 17:58:48 -07001611}
1612
1613class VkExtent3D {
Jesse Hall3dd678a2016-01-08 21:52:01 -08001614 u32 width
1615 u32 height
1616 u32 depth
Jesse Halld27f6aa2015-08-15 17:58:48 -07001617}
1618
1619class VkViewport {
Jesse Hall65ab5522015-11-30 00:07:16 -08001620 f32 x
1621 f32 y
Jesse Halld27f6aa2015-08-15 17:58:48 -07001622 f32 width
1623 f32 height
1624 f32 minDepth
1625 f32 maxDepth
1626}
1627
1628class VkRect2D {
1629 VkOffset2D offset
1630 VkExtent2D extent
1631}
1632
Jesse Halla15a4bf2015-11-19 22:48:02 -08001633class VkClearRect {
1634 VkRect2D rect
1635 u32 baseArrayLayer
Jesse Hall3fbc8562015-11-29 22:10:52 -08001636 u32 layerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001637}
1638
Jesse Hall65ab5522015-11-30 00:07:16 -08001639class VkComponentMapping {
1640 VkComponentSwizzle r
1641 VkComponentSwizzle g
1642 VkComponentSwizzle b
1643 VkComponentSwizzle a
Jesse Halld27f6aa2015-08-15 17:58:48 -07001644}
1645
1646class VkPhysicalDeviceProperties {
1647 u32 apiVersion
1648 u32 driverVersion
Jesse Hall65ab5522015-11-30 00:07:16 -08001649 u32 vendorID
1650 u32 deviceID
Jesse Halld27f6aa2015-08-15 17:58:48 -07001651 VkPhysicalDeviceType deviceType
Jesse Hall65ab5522015-11-30 00:07:16 -08001652 char[VK_MAX_PHYSICAL_DEVICE_NAME_SIZE] deviceName
1653 u8[VK_UUID_SIZE] pipelineCacheUUID
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001654 VkPhysicalDeviceLimits limits
1655 VkPhysicalDeviceSparseProperties sparseProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07001656}
1657
1658class VkExtensionProperties {
Jesse Hall65ab5522015-11-30 00:07:16 -08001659 char[VK_MAX_EXTENSION_NAME_SIZE] extensionName /// extension name
Jesse Halld27f6aa2015-08-15 17:58:48 -07001660 u32 specVersion /// version of the extension specification implemented
1661}
1662
1663class VkLayerProperties {
Jesse Hall65ab5522015-11-30 00:07:16 -08001664 char[VK_MAX_EXTENSION_NAME_SIZE] layerName /// layer name
Jesse Hall3fbc8562015-11-29 22:10:52 -08001665 u32 specVersion /// version of the layer specification implemented
1666 u32 implementationVersion /// build or release version of the layer's library
Jesse Hall65ab5522015-11-30 00:07:16 -08001667 char[VK_MAX_DESCRIPTION_SIZE] description /// Free-form description of the layer
Jesse Halld27f6aa2015-08-15 17:58:48 -07001668}
1669
Jesse Halla366a512015-11-19 22:30:07 -08001670class VkSubmitInfo {
Jesse Hall03b6fe12015-11-24 12:44:21 -08001671 VkStructureType sType /// Type of structure. Should be VK_STRUCTURE_TYPE_SUBMIT_INFO
1672 const void* pNext /// Next structure in chain
1673 u32 waitSemaphoreCount
Jesse Halla366a512015-11-19 22:30:07 -08001674 const VkSemaphore* pWaitSemaphores
Jesse Hall543a7ff2016-01-08 16:38:30 -08001675 const VkPipelineStageFlags* pWaitDstStageMask
Jesse Hall03b6fe12015-11-24 12:44:21 -08001676 u32 commandBufferCount
Jesse Hall3fbc8562015-11-29 22:10:52 -08001677 const VkCommandBuffer* pCommandBuffers
Jesse Hall03b6fe12015-11-24 12:44:21 -08001678 u32 signalSemaphoreCount
Jesse Halla366a512015-11-19 22:30:07 -08001679 const VkSemaphore* pSignalSemaphores
1680}
1681
Jesse Halld27f6aa2015-08-15 17:58:48 -07001682class VkApplicationInfo {
1683 VkStructureType sType /// Type of structure. Should be VK_STRUCTURE_TYPE_APPLICATION_INFO
1684 const void* pNext /// Next structure in chain
Jesse Hall3fbc8562015-11-29 22:10:52 -08001685 const char* pApplicationName
1686 u32 applicationVersion
Jesse Halld27f6aa2015-08-15 17:58:48 -07001687 const char* pEngineName
1688 u32 engineVersion
1689 u32 apiVersion
1690}
1691
Jesse Hall3fbc8562015-11-29 22:10:52 -08001692class VkAllocationCallbacks {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001693 void* pUserData
Jesse Hall3fbc8562015-11-29 22:10:52 -08001694 PFN_vkAllocationFunction pfnAllocation
1695 PFN_vkReallocationFunction pfnReallocation
Jesse Halld27f6aa2015-08-15 17:58:48 -07001696 PFN_vkFreeFunction pfnFree
Jesse Hall3fbc8562015-11-29 22:10:52 -08001697 PFN_vkInternalAllocationNotification pfnInternalAllocation
Jesse Hall03b6fe12015-11-24 12:44:21 -08001698 PFN_vkInternalFreeNotification pfnInternalFree
Jesse Halld27f6aa2015-08-15 17:58:48 -07001699}
1700
1701class VkDeviceQueueCreateInfo {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001702 VkStructureType sStype /// Should be VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO
1703 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001704 VkDeviceQueueCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001705 u32 queueFamilyIndex
Jesse Halldba27f72015-11-30 14:25:46 -08001706 u32 queueCount
Jesse Hallfbf97b02015-11-20 14:17:03 -08001707 const f32* pQueuePriorities
Jesse Halld27f6aa2015-08-15 17:58:48 -07001708}
1709
1710class VkDeviceCreateInfo {
1711 VkStructureType sType /// Should be VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO
1712 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001713 VkDeviceCreateFlags flags
Jesse Halldba27f72015-11-30 14:25:46 -08001714 u32 queueCreateInfoCount
1715 const VkDeviceQueueCreateInfo* pQueueCreateInfos
Jesse Hall3dd678a2016-01-08 21:52:01 -08001716 u32 enabledLayerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001717 const char* const* ppEnabledLayerNames /// Ordered list of layer names to be enabled
Jesse Hall3dd678a2016-01-08 21:52:01 -08001718 u32 enabledExtensionCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001719 const char* const* ppEnabledExtensionNames
1720 const VkPhysicalDeviceFeatures* pEnabledFeatures
Jesse Halld27f6aa2015-08-15 17:58:48 -07001721}
1722
1723class VkInstanceCreateInfo {
1724 VkStructureType sType /// Should be VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO
1725 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001726 VkInstanceCreateFlags flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001727 const VkApplicationInfo* pApplicationInfo
Jesse Hall3dd678a2016-01-08 21:52:01 -08001728 u32 enabledLayerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001729 const char* const* ppEnabledLayerNames /// Ordered list of layer names to be enabled
Jesse Hall3dd678a2016-01-08 21:52:01 -08001730 u32 enabledExtensionCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001731 const char* const* ppEnabledExtensionNames /// Extension names to be enabled
1732}
1733
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001734class VkQueueFamilyProperties {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001735 VkQueueFlags queueFlags /// Queue flags
1736 u32 queueCount
Jesse Hallacfa5342015-11-19 21:51:33 -08001737 u32 timestampValidBits
Jesse Hall65ab5522015-11-30 00:07:16 -08001738 VkExtent3D minImageTransferGranularity
Jesse Halld27f6aa2015-08-15 17:58:48 -07001739}
1740
1741class VkPhysicalDeviceMemoryProperties {
1742 u32 memoryTypeCount
1743 VkMemoryType[VK_MAX_MEMORY_TYPES] memoryTypes
1744 u32 memoryHeapCount
1745 VkMemoryHeap[VK_MAX_MEMORY_HEAPS] memoryHeaps
1746}
1747
Jesse Hall3fbc8562015-11-29 22:10:52 -08001748class VkMemoryAllocateInfo {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001749 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07001750 const void* pNext /// Pointer to next structure
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001751 VkDeviceSize allocationSize /// Size of memory allocation
Jesse Halld27f6aa2015-08-15 17:58:48 -07001752 u32 memoryTypeIndex /// Index of the of the memory type to allocate from
1753}
1754
1755class VkMemoryRequirements {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001756 VkDeviceSize size /// Specified in bytes
1757 VkDeviceSize alignment /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001758 u32 memoryTypeBits /// Bitfield of the allowed memory type indices into memoryTypes[] for this object
1759}
1760
1761class VkSparseImageFormatProperties {
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001762 VkImageAspectFlagBits aspectMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001763 VkExtent3D imageGranularity
1764 VkSparseImageFormatFlags flags
1765}
1766
1767class VkSparseImageMemoryRequirements {
Jesse Hallb00daad2015-11-29 19:46:20 -08001768 VkSparseImageFormatProperties formatProperties
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001769 u32 imageMipTailFirstLod
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001770 VkDeviceSize imageMipTailSize /// Specified in bytes, must be a multiple of image block size / alignment
1771 VkDeviceSize imageMipTailOffset /// Specified in bytes, must be a multiple of image block size / alignment
1772 VkDeviceSize imageMipTailStride /// Specified in bytes, must be a multiple of image block size / alignment
Jesse Halld27f6aa2015-08-15 17:58:48 -07001773}
1774
1775class VkMemoryType {
1776 VkMemoryPropertyFlags propertyFlags /// Memory properties of this memory type
1777 u32 heapIndex /// Index of the memory heap allocations of this memory type are taken from
1778}
1779
1780class VkMemoryHeap {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001781 VkDeviceSize size /// Available memory in the heap
Jesse Halld27f6aa2015-08-15 17:58:48 -07001782 VkMemoryHeapFlags flags /// Flags for the heap
1783}
1784
1785class VkMappedMemoryRange {
1786 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE
1787 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08001788 VkDeviceMemory memory /// Mapped memory object
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001789 VkDeviceSize offset /// Offset within the mapped memory the range starts from
1790 VkDeviceSize size /// Size of the range within the mapped memory
Jesse Halld27f6aa2015-08-15 17:58:48 -07001791}
1792
1793class VkFormatProperties {
1794 VkFormatFeatureFlags linearTilingFeatures /// Format features in case of linear tiling
1795 VkFormatFeatureFlags optimalTilingFeatures /// Format features in case of optimal tiling
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001796 VkFormatFeatureFlags bufferFeatures /// Format features supported by buffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07001797}
1798
1799class VkImageFormatProperties {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001800 VkExtent3D maxExtent /// max image dimensions for this resource type
1801 u32 maxMipLevels /// max number of mipmap levels for this resource type
Jesse Halla15a4bf2015-11-19 22:48:02 -08001802 u32 maxArrayLayers /// max array layers for this resource type
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001803 VkSampleCountFlags sampleCounts /// supported sample counts for this resource type
1804 VkDeviceSize maxResourceSize /// max size (in bytes) of this resource type
1805}
1806
Jesse Halla15a4bf2015-11-19 22:48:02 -08001807class VkDescriptorImageInfo {
1808 VkSampler sampler
1809 VkImageView imageView
1810 VkImageLayout imageLayout
1811}
1812
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001813class VkDescriptorBufferInfo {
1814 VkBuffer buffer /// Buffer used for this descriptor when the descriptor is UNIFORM_BUFFER[_DYNAMIC]
1815 VkDeviceSize offset /// Base offset from buffer start in bytes to update in the descriptor set.
1816 VkDeviceSize range /// Size in bytes of the buffer resource for this descriptor update.
Jesse Halld27f6aa2015-08-15 17:58:48 -07001817}
1818
Jesse Halld27f6aa2015-08-15 17:58:48 -07001819class VkWriteDescriptorSet {
1820 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET
1821 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08001822 VkDescriptorSet dstSet /// Destination descriptor set
1823 u32 dstBinding /// Binding within the destination descriptor set to write
1824 u32 dstArrayElement /// Array element within the destination binding to write
Jesse Hall03b6fe12015-11-24 12:44:21 -08001825 u32 descriptorCount /// Number of descriptors to write (determines the size of the array pointed by <pDescriptors>)
Jesse Halld27f6aa2015-08-15 17:58:48 -07001826 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 -08001827 const VkDescriptorImageInfo* pImageInfo
1828 const VkDescriptorBufferInfo* pBufferInfo
1829 const VkBufferView* pTexelBufferView
Jesse Halld27f6aa2015-08-15 17:58:48 -07001830}
1831
1832class VkCopyDescriptorSet {
1833 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET
1834 const void* pNext /// Pointer to next structure
1835 VkDescriptorSet srcSet /// Source descriptor set
1836 u32 srcBinding /// Binding within the source descriptor set to copy from
1837 u32 srcArrayElement /// Array element within the source binding to copy from
Jesse Hall3fbc8562015-11-29 22:10:52 -08001838 VkDescriptorSet dstSet /// Destination descriptor set
1839 u32 dstBinding /// Binding within the destination descriptor set to copy to
1840 u32 dstArrayElement /// Array element within the destination binding to copy to
Jesse Hall03b6fe12015-11-24 12:44:21 -08001841 u32 descriptorCount /// Number of descriptors to copy
Jesse Halld27f6aa2015-08-15 17:58:48 -07001842}
1843
1844class VkBufferCreateInfo {
1845 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO
1846 const void* pNext /// Pointer to next structure.
Jesse Halla6429252015-11-29 18:59:42 -08001847 VkBufferCreateFlags flags /// Buffer creation flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001848 VkDeviceSize size /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001849 VkBufferUsageFlags usage /// Buffer usage flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001850 VkSharingMode sharingMode
Jesse Hall03b6fe12015-11-24 12:44:21 -08001851 u32 queueFamilyIndexCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001852 const u32* pQueueFamilyIndices
1853}
1854
1855class VkBufferViewCreateInfo {
1856 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO
1857 const void* pNext /// Pointer to next structure.
Jesse Halla6429252015-11-29 18:59:42 -08001858 VkBufferViewCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001859 VkBuffer buffer
Jesse Halld27f6aa2015-08-15 17:58:48 -07001860 VkFormat format /// Optionally specifies format of elements
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001861 VkDeviceSize offset /// Specified in bytes
1862 VkDeviceSize range /// View size specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001863}
1864
1865class VkImageSubresource {
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001866 VkImageAspectFlagBits aspectMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001867 u32 mipLevel
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001868 u32 arrayLayer
Jesse Halld27f6aa2015-08-15 17:58:48 -07001869}
1870
1871class VkImageSubresourceRange {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001872 VkImageAspectFlags aspectMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001873 u32 baseMipLevel
Jesse Hall3fbc8562015-11-29 22:10:52 -08001874 u32 levelCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001875 u32 baseArrayLayer
Jesse Hall3fbc8562015-11-29 22:10:52 -08001876 u32 layerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001877}
1878
1879class VkMemoryBarrier {
1880 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MEMORY_BARRIER
1881 const void* pNext /// Pointer to next structure.
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001882 VkAccessFlags srcAccessMask
1883 VkAccessFlags dstAccessMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001884}
1885
1886class VkBufferMemoryBarrier {
1887 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER
1888 const void* pNext /// Pointer to next structure.
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001889 VkAccessFlags srcAccessMask
1890 VkAccessFlags dstAccessMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001891 u32 srcQueueFamilyIndex /// Queue family to transition ownership from
Jesse Hall3fbc8562015-11-29 22:10:52 -08001892 u32 dstQueueFamilyIndex /// Queue family to transition ownership to
Jesse Halld27f6aa2015-08-15 17:58:48 -07001893 VkBuffer buffer /// Buffer to sync
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001894 VkDeviceSize offset /// Offset within the buffer to sync
1895 VkDeviceSize size /// Amount of bytes to sync
Jesse Halld27f6aa2015-08-15 17:58:48 -07001896}
1897
1898class VkImageMemoryBarrier {
1899 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_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 VkImageLayout oldLayout /// Current layout of the image
1904 VkImageLayout newLayout /// New layout to transition the image to
1905 u32 srcQueueFamilyIndex /// Queue family to transition ownership from
Jesse Hall3fbc8562015-11-29 22:10:52 -08001906 u32 dstQueueFamilyIndex /// Queue family to transition ownership to
Jesse Halld27f6aa2015-08-15 17:58:48 -07001907 VkImage image /// Image to sync
1908 VkImageSubresourceRange subresourceRange /// Subresource range to sync
1909}
1910
1911class VkImageCreateInfo {
1912 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO
1913 const void* pNext /// Pointer to next structure.
Jesse Halla6429252015-11-29 18:59:42 -08001914 VkImageCreateFlags flags /// Image creation flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001915 VkImageType imageType
1916 VkFormat format
1917 VkExtent3D extent
1918 u32 mipLevels
Jesse Halla15a4bf2015-11-19 22:48:02 -08001919 u32 arrayLayers
Jesse Hall091ed9e2015-11-30 00:55:29 -08001920 VkSampleCountFlagBits samples
Jesse Halld27f6aa2015-08-15 17:58:48 -07001921 VkImageTiling tiling
1922 VkImageUsageFlags usage /// Image usage flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001923 VkSharingMode sharingMode /// Cross-queue-family sharing mode
Jesse Hall03b6fe12015-11-24 12:44:21 -08001924 u32 queueFamilyIndexCount /// Number of queue families to share across
Jesse Halld27f6aa2015-08-15 17:58:48 -07001925 const u32* pQueueFamilyIndices /// Array of queue family indices to share across
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001926 VkImageLayout initialLayout /// Initial image layout for all subresources
Jesse Halld27f6aa2015-08-15 17:58:48 -07001927}
1928
1929class VkSubresourceLayout {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001930 VkDeviceSize offset /// Specified in bytes
1931 VkDeviceSize size /// Specified in bytes
1932 VkDeviceSize rowPitch /// Specified in bytes
Jesse Hall543a7ff2016-01-08 16:38:30 -08001933 VkDeviceSize arrayPitch /// Specified in bytes
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001934 VkDeviceSize depthPitch /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001935}
1936
1937class VkImageViewCreateInfo {
1938 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO
1939 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001940 VkImageViewCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001941 VkImage image
1942 VkImageViewType viewType
1943 VkFormat format
Jesse Hall65ab5522015-11-30 00:07:16 -08001944 VkComponentMapping components
Jesse Halld27f6aa2015-08-15 17:58:48 -07001945 VkImageSubresourceRange subresourceRange
Jesse Halld27f6aa2015-08-15 17:58:48 -07001946}
1947
1948class VkBufferCopy {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001949 VkDeviceSize srcOffset /// Specified in bytes
Jesse Hall3fbc8562015-11-29 22:10:52 -08001950 VkDeviceSize dstOffset /// Specified in bytes
Jesse Hallb00daad2015-11-29 19:46:20 -08001951 VkDeviceSize size /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001952}
1953
Jesse Halla6429252015-11-29 18:59:42 -08001954class VkSparseMemoryBind {
Jesse Hallb00daad2015-11-29 19:46:20 -08001955 VkDeviceSize resourceOffset /// Specified in bytes
1956 VkDeviceSize size /// Specified in bytes
Jesse Hall3fbc8562015-11-29 22:10:52 -08001957 VkDeviceMemory memory
1958 VkDeviceSize memoryOffset /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001959 VkSparseMemoryBindFlags flags
1960}
1961
Jesse Halla6429252015-11-29 18:59:42 -08001962class VkSparseImageMemoryBind {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001963 VkImageSubresource subresource
1964 VkOffset3D offset
1965 VkExtent3D extent
Jesse Hall3fbc8562015-11-29 22:10:52 -08001966 VkDeviceMemory memory
1967 VkDeviceSize memoryOffset /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001968 VkSparseMemoryBindFlags flags
1969}
1970
Jesse Halla6429252015-11-29 18:59:42 -08001971class VkSparseBufferMemoryBindInfo {
1972 VkBuffer buffer
1973 u32 bindCount
1974 const VkSparseMemoryBind* pBinds
1975}
1976
1977class VkSparseImageOpaqueMemoryBindInfo {
1978 VkImage image
1979 u32 bindCount
1980 const VkSparseMemoryBind* pBinds
1981}
1982
1983class VkSparseImageMemoryBindInfo {
1984 VkImage image
1985 u32 bindCount
1986 const VkSparseMemoryBind* pBinds
1987}
1988
1989class VkBindSparseInfo {
1990 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BIND_SPARSE_INFO
1991 const void* pNext
1992 u32 waitSemaphoreCount
1993 const VkSemaphore* pWaitSemaphores
1994 u32 numBufferBinds
1995 const VkSparseBufferMemoryBindInfo* pBufferBinds
1996 u32 numImageOpaqueBinds
1997 const VkSparseImageOpaqueMemoryBindInfo* pImageOpaqueBinds
1998 u32 numImageBinds
1999 const VkSparseImageMemoryBindInfo* pImageBinds
2000 u32 signalSemaphoreCount
2001 const VkSemaphore* pSignalSemaphores
2002}
2003
Jesse Hall65ab5522015-11-30 00:07:16 -08002004class VkImageSubresourceLayers {
2005 VkImageAspectFlags aspectMask
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002006 u32 mipLevel
Jesse Halla15a4bf2015-11-19 22:48:02 -08002007 u32 baseArrayLayer
Jesse Hall3fbc8562015-11-29 22:10:52 -08002008 u32 layerCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002009}
2010
Jesse Halld27f6aa2015-08-15 17:58:48 -07002011class VkImageCopy {
Jesse Hall65ab5522015-11-30 00:07:16 -08002012 VkImageSubresourceLayers srcSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07002013 VkOffset3D srcOffset /// Specified in pixels for both compressed and uncompressed images
Jesse Hall65ab5522015-11-30 00:07:16 -08002014 VkImageSubresourceLayers dstSubresource
Jesse Hall3fbc8562015-11-29 22:10:52 -08002015 VkOffset3D dstOffset /// Specified in pixels for both compressed and uncompressed images
Jesse Halld27f6aa2015-08-15 17:58:48 -07002016 VkExtent3D extent /// Specified in pixels for both compressed and uncompressed images
2017}
2018
2019class VkImageBlit {
Jesse Hall65ab5522015-11-30 00:07:16 -08002020 VkImageSubresourceLayers srcSubresource
Jesse Hall3dd678a2016-01-08 21:52:01 -08002021 VkOffset3D[2] srcOffsets
Jesse Hall65ab5522015-11-30 00:07:16 -08002022 VkImageSubresourceLayers dstSubresource
Jesse Hall3dd678a2016-01-08 21:52:01 -08002023 VkOffset3D[2] dstOffsets
Jesse Halld27f6aa2015-08-15 17:58:48 -07002024}
2025
2026class VkBufferImageCopy {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002027 VkDeviceSize bufferOffset /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002028 u32 bufferRowLength /// Specified in texels
2029 u32 bufferImageHeight
Jesse Hall65ab5522015-11-30 00:07:16 -08002030 VkImageSubresourceLayers imageSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07002031 VkOffset3D imageOffset /// Specified in pixels for both compressed and uncompressed images
2032 VkExtent3D imageExtent /// Specified in pixels for both compressed and uncompressed images
2033}
2034
2035class VkImageResolve {
Jesse Hall65ab5522015-11-30 00:07:16 -08002036 VkImageSubresourceLayers srcSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07002037 VkOffset3D srcOffset
Jesse Hall65ab5522015-11-30 00:07:16 -08002038 VkImageSubresourceLayers dstSubresource
Jesse Hall3fbc8562015-11-29 22:10:52 -08002039 VkOffset3D dstOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07002040 VkExtent3D extent
2041}
2042
2043class VkShaderModuleCreateInfo {
2044 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO
2045 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002046 VkShaderModuleCreateFlags flags /// Reserved
Jesse Halld27f6aa2015-08-15 17:58:48 -07002047 platform.size_t codeSize /// Specified in bytes
Jesse Halla9bb62b2015-11-21 19:31:56 -08002048 const u32* pCode /// Binary code of size codeSize
Jesse Halld27f6aa2015-08-15 17:58:48 -07002049}
2050
Jesse Halld27f6aa2015-08-15 17:58:48 -07002051class VkDescriptorSetLayoutBinding {
Jesse Hall091ed9e2015-11-30 00:55:29 -08002052 u32 binding
Jesse Halld27f6aa2015-08-15 17:58:48 -07002053 VkDescriptorType descriptorType /// Type of the descriptors in this binding
Jesse Halldba27f72015-11-30 14:25:46 -08002054 u32 descriptorCount /// Number of descriptors in this binding
Jesse Halld27f6aa2015-08-15 17:58:48 -07002055 VkShaderStageFlags stageFlags /// Shader stages this binding is visible to
2056 const VkSampler* pImmutableSamplers /// Immutable samplers (used if descriptor type is SAMPLER or COMBINED_IMAGE_SAMPLER, is either NULL or contains <count> number of elements)
2057}
2058
2059class VkDescriptorSetLayoutCreateInfo {
2060 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO
2061 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002062 VkDescriptorSetLayoutCreateFlags flags
Jesse Hall03b6fe12015-11-24 12:44:21 -08002063 u32 bindingCount /// Number of bindings in the descriptor set layout
Jesse Hall543a7ff2016-01-08 16:38:30 -08002064 const VkDescriptorSetLayoutBinding* pBindings /// Array of descriptor set layout bindings
Jesse Halld27f6aa2015-08-15 17:58:48 -07002065}
2066
Jesse Hall65ab5522015-11-30 00:07:16 -08002067class VkDescriptorPoolSize {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002068 VkDescriptorType type
Jesse Hall03b6fe12015-11-24 12:44:21 -08002069 u32 descriptorCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002070}
2071
2072class VkDescriptorPoolCreateInfo {
2073 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO
2074 const void* pNext /// Pointer to next structure
Jesse Hallfbf97b02015-11-20 14:17:03 -08002075 VkDescriptorPoolCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002076 u32 maxSets
Jesse Hall65ab5522015-11-30 00:07:16 -08002077 u32 poolSizeCount
2078 const VkDescriptorPoolSize* pPoolSizes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002079}
2080
Jesse Hall3fbc8562015-11-29 22:10:52 -08002081class VkDescriptorSetAllocateInfo {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002082 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO
Jesse Hallfbf97b02015-11-20 14:17:03 -08002083 const void* pNext /// Pointer to next structure
2084 VkDescriptorPool descriptorPool
Jesse Hall03b6fe12015-11-24 12:44:21 -08002085 u32 setCount
Jesse Hallfbf97b02015-11-20 14:17:03 -08002086 const VkDescriptorSetLayout* pSetLayouts
2087}
2088
Jesse Halld27f6aa2015-08-15 17:58:48 -07002089class VkSpecializationMapEntry {
Jesse Hall65ab5522015-11-30 00:07:16 -08002090 u32 constantID /// The SpecConstant ID specified in the BIL
Jesse Halld27f6aa2015-08-15 17:58:48 -07002091 u32 offset /// Offset of the value in the data block
Jesse Hallb00daad2015-11-29 19:46:20 -08002092 platform.size_t size /// Size in bytes of the SpecConstant
Jesse Halld27f6aa2015-08-15 17:58:48 -07002093}
2094
2095class VkSpecializationInfo {
2096 u32 mapEntryCount /// Number of entries in the map
Jesse Hallb00daad2015-11-29 19:46:20 -08002097 const VkSpecializationMapEntry* pMapEntries /// Array of map entries
Jesse Halld27f6aa2015-08-15 17:58:48 -07002098 platform.size_t dataSize /// Size in bytes of pData
2099 const void* pData /// Pointer to SpecConstant data
2100}
2101
2102class VkPipelineShaderStageCreateInfo {
2103 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO
2104 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002105 VkPipelineShaderStageCreateFlags flags
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002106 VkShaderStageFlagBits stage
2107 VkShaderModule module
2108 const char* pName
Jesse Halld27f6aa2015-08-15 17:58:48 -07002109 const VkSpecializationInfo* pSpecializationInfo
2110}
2111
2112class VkComputePipelineCreateInfo {
2113 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO
2114 const void* pNext /// Pointer to next structure
Jesse Halld27f6aa2015-08-15 17:58:48 -07002115 VkPipelineCreateFlags flags /// Pipeline creation flags
Jesse Halla6429252015-11-29 18:59:42 -08002116 VkPipelineShaderStageCreateInfo stage
Jesse Halld27f6aa2015-08-15 17:58:48 -07002117 VkPipelineLayout layout /// Interface layout of the pipeline
2118 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
2119 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
2120}
2121
2122class VkVertexInputBindingDescription {
Jesse Hallb00daad2015-11-29 19:46:20 -08002123 u32 binding /// Vertex buffer binding id
2124 u32 stride /// Distance between vertices in bytes (0 = no advancement)
Jesse Hall65ab5522015-11-30 00:07:16 -08002125 VkVertexInputRate inputRate /// Rate at which binding is incremented
Jesse Halld27f6aa2015-08-15 17:58:48 -07002126}
2127
2128class VkVertexInputAttributeDescription {
Jesse Hallb00daad2015-11-29 19:46:20 -08002129 u32 location /// location of the shader vertex attrib
2130 u32 binding /// Vertex buffer binding id
2131 VkFormat format /// format of source data
2132 u32 offset /// Offset of first element in bytes from base of vertex
Jesse Halld27f6aa2015-08-15 17:58:48 -07002133}
2134
2135class VkPipelineVertexInputStateCreateInfo {
Jesse Hall03b6fe12015-11-24 12:44:21 -08002136 VkStructureType sType /// Should be VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO
2137 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002138 VkPipelineVertexInputStateCreateFlags flags
Jesse Hall03b6fe12015-11-24 12:44:21 -08002139 u32 vertexBindingDescriptionCount /// number of bindings
Jesse Halld27f6aa2015-08-15 17:58:48 -07002140 const VkVertexInputBindingDescription* pVertexBindingDescriptions
Jesse Hall03b6fe12015-11-24 12:44:21 -08002141 u32 vertexAttributeDescriptionCount /// number of attributes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002142 const VkVertexInputAttributeDescription* pVertexAttributeDescriptions
2143}
2144
2145class VkPipelineInputAssemblyStateCreateInfo {
2146 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO
2147 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002148 VkPipelineInputAssemblyStateCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002149 VkPrimitiveTopology topology
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002150 VkBool32 primitiveRestartEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002151}
2152
2153class VkPipelineTessellationStateCreateInfo {
2154 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO
2155 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002156 VkPipelineTessellationStateCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002157 u32 patchControlPoints
2158}
2159
2160class VkPipelineViewportStateCreateInfo {
2161 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO
2162 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002163 VkPipelineViewportStateCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002164 u32 viewportCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002165 const VkViewport* pViewports
2166 u32 scissorCount
2167 const VkRect2D* pScissors
Jesse Halld27f6aa2015-08-15 17:58:48 -07002168}
2169
Jesse Hall3fbc8562015-11-29 22:10:52 -08002170class VkPipelineRasterizationStateCreateInfo {
Jesse Hall65ab5522015-11-30 00:07:16 -08002171 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002172 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08002173 VkPipelineRasterizationStateCreateFlags flags
Jesse Hallae38f732015-11-19 21:32:50 -08002174 VkBool32 depthClampEnable
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002175 VkBool32 rasterizerDiscardEnable
Jesse Hall65ab5522015-11-30 00:07:16 -08002176 VkPolygonMode polygonMode /// optional (GL45)
Jesse Hallc7467b72015-11-29 21:05:26 -08002177 VkCullModeFlags cullMode
Jesse Halld27f6aa2015-08-15 17:58:48 -07002178 VkFrontFace frontFace
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002179 VkBool32 depthBiasEnable
Jesse Halla9bb62b2015-11-21 19:31:56 -08002180 f32 depthBiasConstantFactor
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002181 f32 depthBiasClamp
Jesse Halla9bb62b2015-11-21 19:31:56 -08002182 f32 depthBiasSlopeFactor
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002183 f32 lineWidth
Jesse Halld27f6aa2015-08-15 17:58:48 -07002184}
2185
2186class VkPipelineMultisampleStateCreateInfo {
2187 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO
2188 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002189 VkPipelineMultisampleStateCreateFlags flags
Jesse Hall091ed9e2015-11-30 00:55:29 -08002190 VkSampleCountFlagBits rasterizationSamples /// Number of samples used for rasterization
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002191 VkBool32 sampleShadingEnable /// optional (GL45)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002192 f32 minSampleShading /// optional (GL45)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002193 const VkSampleMask* pSampleMask
Jesse Hallacfa5342015-11-19 21:51:33 -08002194 VkBool32 alphaToCoverageEnable
2195 VkBool32 alphaToOneEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002196}
2197
2198class VkPipelineColorBlendAttachmentState {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002199 VkBool32 blendEnable
Jesse Hall65ab5522015-11-30 00:07:16 -08002200 VkBlendFactor srcColorBlendFactor
2201 VkBlendFactor dstColorBlendFactor
2202 VkBlendOp colorBlendOp
2203 VkBlendFactor srcAlphaBlendFactor
2204 VkBlendFactor dstAlphaBlendFactor
2205 VkBlendOp alphaBlendOp
2206 VkColorComponentFlags colorWriteMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07002207}
2208
2209class VkPipelineColorBlendStateCreateInfo {
2210 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO
2211 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002212 VkPipelineColorBlendStateCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002213 VkBool32 logicOpEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002214 VkLogicOp logicOp
2215 u32 attachmentCount /// # of pAttachments
2216 const VkPipelineColorBlendAttachmentState* pAttachments
Jesse Hallb00daad2015-11-29 19:46:20 -08002217 f32[4] blendConstants
Jesse Halld27f6aa2015-08-15 17:58:48 -07002218}
2219
2220class VkStencilOpState {
Jesse Hall65ab5522015-11-30 00:07:16 -08002221 VkStencilOp failOp
2222 VkStencilOp passOp
2223 VkStencilOp depthFailOp
2224 VkCompareOp compareOp
2225 u32 compareMask
2226 u32 writeMask
2227 u32 reference
Jesse Halld27f6aa2015-08-15 17:58:48 -07002228}
2229
2230class VkPipelineDepthStencilStateCreateInfo {
2231 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO
2232 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002233 VkPipelineDepthStencilStateCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002234 VkBool32 depthTestEnable
2235 VkBool32 depthWriteEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002236 VkCompareOp depthCompareOp
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002237 VkBool32 depthBoundsTestEnable /// optional (depth_bounds_test)
2238 VkBool32 stencilTestEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002239 VkStencilOpState front
2240 VkStencilOpState back
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002241 f32 minDepthBounds
2242 f32 maxDepthBounds
2243}
2244
2245class VkPipelineDynamicStateCreateInfo {
2246 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO
2247 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002248 VkPipelineDynamicStateCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002249 u32 dynamicStateCount
2250 const VkDynamicState* pDynamicStates
Jesse Halld27f6aa2015-08-15 17:58:48 -07002251}
2252
2253class VkGraphicsPipelineCreateInfo {
Jesse Halla6429252015-11-29 18:59:42 -08002254 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO
2255 const void* pNext /// Pointer to next structure
2256 VkPipelineCreateFlags flags /// Pipeline creation flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002257 u32 stageCount
Jesse Halla6429252015-11-29 18:59:42 -08002258 const VkPipelineShaderStageCreateInfo* pStages /// One entry for each active shader stage
Jesse Halld27f6aa2015-08-15 17:58:48 -07002259 const VkPipelineVertexInputStateCreateInfo* pVertexInputState
2260 const VkPipelineInputAssemblyStateCreateInfo* pInputAssemblyState
2261 const VkPipelineTessellationStateCreateInfo* pTessellationState
2262 const VkPipelineViewportStateCreateInfo* pViewportState
Jesse Hall3fbc8562015-11-29 22:10:52 -08002263 const VkPipelineRasterizationStateCreateInfo* pRasterizationState
Jesse Halld27f6aa2015-08-15 17:58:48 -07002264 const VkPipelineMultisampleStateCreateInfo* pMultisampleState
2265 const VkPipelineDepthStencilStateCreateInfo* pDepthStencilState
2266 const VkPipelineColorBlendStateCreateInfo* pColorBlendState
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002267 const VkPipelineDynamicStateCreateInfo* pDynamicState
Jesse Halla6429252015-11-29 18:59:42 -08002268 VkPipelineLayout layout /// Interface layout of the pipeline
Jesse Halld27f6aa2015-08-15 17:58:48 -07002269 VkRenderPass renderPass
2270 u32 subpass
Jesse Halla6429252015-11-29 18:59:42 -08002271 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
2272 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 -07002273}
2274
2275class VkPipelineCacheCreateInfo {
Jesse Hallb00daad2015-11-29 19:46:20 -08002276 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO
2277 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002278 VkPipelineCacheCreateFlags flags
Jesse Hallb00daad2015-11-29 19:46:20 -08002279 platform.size_t initialDataSize /// Size of initial data to populate cache, in bytes
2280 const void* pInitialData /// Initial data to populate cache
Jesse Halld27f6aa2015-08-15 17:58:48 -07002281}
2282
2283class VkPushConstantRange {
2284 VkShaderStageFlags stageFlags /// Which stages use the range
Jesse Hall03b6fe12015-11-24 12:44:21 -08002285 u32 offset /// Start of the range, in bytes
2286 u32 size /// Length of the range, in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002287}
2288
2289class VkPipelineLayoutCreateInfo {
2290 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO
2291 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002292 VkPipelineLayoutCreateFlags flags
Jesse Hall3dd678a2016-01-08 21:52:01 -08002293 u32 descriptorSetCount /// Number of descriptor sets interfaced by the pipeline
Jesse Halld27f6aa2015-08-15 17:58:48 -07002294 const VkDescriptorSetLayout* pSetLayouts /// Array of <setCount> number of descriptor set layout objects defining the layout of the
2295 u32 pushConstantRangeCount /// Number of push-constant ranges used by the pipeline
2296 const VkPushConstantRange* pPushConstantRanges /// Array of pushConstantRangeCount number of ranges used by various shader stages
2297}
2298
2299class VkSamplerCreateInfo {
2300 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO
2301 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002302 VkSamplerCreateFlags flags
Jesse Hall23ff73f2015-11-29 14:36:39 -08002303 VkFilter magFilter /// Filter mode for magnification
2304 VkFilter minFilter /// Filter mode for minifiation
2305 VkSamplerMipmapMode mipmapMode /// Mipmap selection mode
2306 VkSamplerAddressMode addressModeU
2307 VkSamplerAddressMode addressModeV
2308 VkSamplerAddressMode addressModeW
Jesse Halld27f6aa2015-08-15 17:58:48 -07002309 f32 mipLodBias
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002310 VkBool32 anisotropyEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002311 f32 maxAnisotropy
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002312 VkBool32 compareEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002313 VkCompareOp compareOp
2314 f32 minLod
2315 f32 maxLod
2316 VkBorderColor borderColor
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002317 VkBool32 unnormalizedCoordinates
Jesse Halld27f6aa2015-08-15 17:58:48 -07002318}
2319
Jesse Hall3fbc8562015-11-29 22:10:52 -08002320class VkCommandPoolCreateInfo {
2321 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002322 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08002323 VkCommandPoolCreateFlags flags /// Command pool creation flags
Jesse Halla6429252015-11-29 18:59:42 -08002324 u32 queueFamilyIndex
Jesse Halld27f6aa2015-08-15 17:58:48 -07002325}
2326
Jesse Hall3fbc8562015-11-29 22:10:52 -08002327class VkCommandBufferAllocateInfo {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002328 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002329 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08002330 VkCommandPool commandPool
2331 VkCommandBufferLevel level
Jesse Hall3dd678a2016-01-08 21:52:01 -08002332 u32 commandBufferCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002333}
2334
Jesse Hall3dd678a2016-01-08 21:52:01 -08002335class VkCommandBufferInheritanceInfo {
2336 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002337 const void* pNext /// Pointer to next structure
Jesse Halld27f6aa2015-08-15 17:58:48 -07002338 VkRenderPass renderPass /// Render pass for secondary command buffers
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002339 u32 subpass
Jesse Halld27f6aa2015-08-15 17:58:48 -07002340 VkFramebuffer framebuffer /// Framebuffer for secondary command buffers
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002341 VkBool32 occlusionQueryEnable
2342 VkQueryControlFlags queryFlags
2343 VkQueryPipelineStatisticFlags pipelineStatistics
Jesse Halld27f6aa2015-08-15 17:58:48 -07002344}
2345
Jesse Hall3dd678a2016-01-08 21:52:01 -08002346class VkCommandBufferBeginInfo {
2347 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO
2348 const void* pNext /// Pointer to next structure
2349 VkCommandBufferUsageFlags flags /// Command buffer usage flags
2350 const VkCommandBufferInheritanceInfo* pInheritanceInfo
2351}
2352
Jesse Halld27f6aa2015-08-15 17:58:48 -07002353class VkRenderPassBeginInfo {
2354 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO
2355 const void* pNext /// Pointer to next structure
2356 VkRenderPass renderPass
2357 VkFramebuffer framebuffer
2358 VkRect2D renderArea
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002359 u32 clearValueCount
2360 const VkClearValue* pClearValues
Jesse Halld27f6aa2015-08-15 17:58:48 -07002361}
2362
2363@union
2364/// Union allowing specification of floating point, integer, or unsigned integer color data. Actual value selected is based on image/attachment being cleared.
2365class VkClearColorValue {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002366 f32[4] float32
2367 s32[4] int32
2368 u32[4] uint32
Jesse Halld27f6aa2015-08-15 17:58:48 -07002369}
2370
2371class VkClearDepthStencilValue {
2372 f32 depth
2373 u32 stencil
2374}
2375
2376@union
2377/// Union allowing specification of color, depth, and stencil color values. Actual value selected is based on attachment being cleared.
2378class VkClearValue {
2379 VkClearColorValue color
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002380 VkClearDepthStencilValue depthStencil
Jesse Halld27f6aa2015-08-15 17:58:48 -07002381}
2382
Jesse Hallae38f732015-11-19 21:32:50 -08002383class VkClearAttachment {
2384 VkImageAspectFlags aspectMask
2385 u32 colorAttachment
2386 VkClearValue clearValue
2387}
2388
Jesse Halld27f6aa2015-08-15 17:58:48 -07002389class VkAttachmentDescription {
Jesse Halla6429252015-11-29 18:59:42 -08002390 VkAttachmentDescriptionFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002391 VkFormat format
Jesse Hall091ed9e2015-11-30 00:55:29 -08002392 VkSampleCountFlagBits samples
Jesse Halld27f6aa2015-08-15 17:58:48 -07002393 VkAttachmentLoadOp loadOp /// Load op for color or depth data
2394 VkAttachmentStoreOp storeOp /// Store op for color or depth data
2395 VkAttachmentLoadOp stencilLoadOp /// Load op for stencil data
2396 VkAttachmentStoreOp stencilStoreOp /// Store op for stencil data
2397 VkImageLayout initialLayout
2398 VkImageLayout finalLayout
2399}
2400
2401class VkAttachmentReference {
2402 u32 attachment
2403 VkImageLayout layout
2404}
2405
2406class VkSubpassDescription {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002407 VkSubpassDescriptionFlags flags
Jesse Halla6429252015-11-29 18:59:42 -08002408 VkPipelineBindPoint pipelineBindPoint /// Must be VK_PIPELINE_BIND_POINT_GRAPHICS for now
Jesse Hall03b6fe12015-11-24 12:44:21 -08002409 u32 inputAttachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002410 const VkAttachmentReference* pInputAttachments
Jesse Hall03b6fe12015-11-24 12:44:21 -08002411 u32 colorAttachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002412 const VkAttachmentReference* pColorAttachments
2413 const VkAttachmentReference* pResolveAttachments
Jesse Hallc7467b72015-11-29 21:05:26 -08002414 const VkAttachmentReference* pDepthStencilAttachment
Jesse Hall03b6fe12015-11-24 12:44:21 -08002415 u32 preserveAttachmentCount
Jesse Hall3dd678a2016-01-08 21:52:01 -08002416 const u32* pPreserveAttachments
Jesse Halld27f6aa2015-08-15 17:58:48 -07002417}
2418
2419class VkSubpassDependency {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002420 u32 srcSubpass
Jesse Hall3fbc8562015-11-29 22:10:52 -08002421 u32 dstSubpass
Jesse Halld27f6aa2015-08-15 17:58:48 -07002422 VkPipelineStageFlags srcStageMask
Jesse Hall3fbc8562015-11-29 22:10:52 -08002423 VkPipelineStageFlags dstStageMask
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002424 VkAccessFlags srcAccessMask
2425 VkAccessFlags dstAccessMask
Jesse Halldc6d36c2015-11-29 19:12:15 -08002426 VkDependencyFlags dependencyFlags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002427}
2428
2429class VkRenderPassCreateInfo {
2430 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO
2431 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002432 VkRenderPassCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002433 u32 attachmentCount
2434 const VkAttachmentDescription* pAttachments
2435 u32 subpassCount
2436 const VkSubpassDescription* pSubpasses
2437 u32 dependencyCount
2438 const VkSubpassDependency* pDependencies
2439}
2440
2441class VkEventCreateInfo {
2442 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_EVENT_CREATE_INFO
2443 const void* pNext /// Pointer to next structure
2444 VkEventCreateFlags flags /// Event creation flags
2445}
2446
2447class VkFenceCreateInfo {
2448 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_FENCE_CREATE_INFO
2449 const void* pNext /// Pointer to next structure
2450 VkFenceCreateFlags flags /// Fence creation flags
2451}
2452
2453class VkPhysicalDeviceFeatures {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002454 VkBool32 robustBufferAccess /// out of bounds buffer accesses are well defined
2455 VkBool32 fullDrawIndexUint32 /// full 32-bit range of indices for indexed draw calls
2456 VkBool32 imageCubeArray /// image views which are arrays of cube maps
2457 VkBool32 independentBlend /// blending operations are controlled per-attachment
2458 VkBool32 geometryShader /// geometry stage
2459 VkBool32 tessellationShader /// tessellation control and evaluation stage
2460 VkBool32 sampleRateShading /// per-sample shading and interpolation
Jesse Hall3fbc8562015-11-29 22:10:52 -08002461 VkBool32 dualSrcBlend /// blend operations which take two sources
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002462 VkBool32 logicOp /// logic operations
2463 VkBool32 multiDrawIndirect /// multi draw indirect
Jesse Hall543a7ff2016-01-08 16:38:30 -08002464 VkBool32 drawIndirectFirstInstance
Jesse Hallae38f732015-11-19 21:32:50 -08002465 VkBool32 depthClamp /// depth clamping
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002466 VkBool32 depthBiasClamp /// depth bias clamping
2467 VkBool32 fillModeNonSolid /// point and wireframe fill modes
2468 VkBool32 depthBounds /// depth bounds test
2469 VkBool32 wideLines /// lines with width greater than 1
2470 VkBool32 largePoints /// points with size greater than 1
Jesse Hallfbf97b02015-11-20 14:17:03 -08002471 VkBool32 alphaToOne /// The fragment alpha channel can be forced to maximum representable alpha value
2472 VkBool32 multiViewport
2473 VkBool32 samplerAnisotropy
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002474 VkBool32 textureCompressionETC2 /// ETC texture compression formats
2475 VkBool32 textureCompressionASTC_LDR /// ASTC LDR texture compression formats
2476 VkBool32 textureCompressionBC /// BC1-7 texture compressed formats
Jesse Hall65ab5522015-11-30 00:07:16 -08002477 VkBool32 occlusionQueryPrecise
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002478 VkBool32 pipelineStatisticsQuery /// pipeline statistics query
Jesse Halldc6d36c2015-11-29 19:12:15 -08002479 VkBool32 vertexPipelineStoresAndAtomics
2480 VkBool32 fragmentStoresAndAtomics
2481 VkBool32 shaderTessellationAndGeometryPointSize
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002482 VkBool32 shaderImageGatherExtended /// texture gather with run-time values and independent offsets
2483 VkBool32 shaderStorageImageExtendedFormats /// the extended set of formats can be used for storage images
2484 VkBool32 shaderStorageImageMultisample /// multisample images can be used for storage images
Jesse Halld1af8122015-11-29 23:50:38 -08002485 VkBool32 shaderStorageImageReadWithoutFormat
2486 VkBool32 shaderStorageImageWriteWithoutFormat
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002487 VkBool32 shaderUniformBufferArrayDynamicIndexing /// arrays of uniform buffers can be accessed with dynamically uniform indices
2488 VkBool32 shaderSampledImageArrayDynamicIndexing /// arrays of sampled images can be accessed with dynamically uniform indices
2489 VkBool32 shaderStorageBufferArrayDynamicIndexing /// arrays of storage buffers can be accessed with dynamically uniform indices
2490 VkBool32 shaderStorageImageArrayDynamicIndexing /// arrays of storage images can be accessed with dynamically uniform indices
2491 VkBool32 shaderClipDistance /// clip distance in shaders
2492 VkBool32 shaderCullDistance /// cull distance in shaders
2493 VkBool32 shaderFloat64 /// 64-bit floats (doubles) in shaders
2494 VkBool32 shaderInt64 /// 64-bit integers in shaders
2495 VkBool32 shaderInt16 /// 16-bit integers in shaders
2496 VkBool32 shaderResourceResidency /// shader can use texture operations that return resource residency information (requires sparseNonResident support)
Jesse Hall65ab5522015-11-30 00:07:16 -08002497 VkBool32 shaderResourceMinLod /// shader can use texture operations that specify minimum resource LOD
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002498 VkBool32 sparseBinding /// Sparse resources support: Resource memory can be managed at opaque page level rather than object level
2499 VkBool32 sparseResidencyBuffer /// Sparse resources support: GPU can access partially resident buffers
2500 VkBool32 sparseResidencyImage2D /// Sparse resources support: GPU can access partially resident 2D (non-MSAA non-DepthStencil) images
2501 VkBool32 sparseResidencyImage3D /// Sparse resources support: GPU can access partially resident 3D images
2502 VkBool32 sparseResidency2Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 2 samples
2503 VkBool32 sparseResidency4Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 4 samples
2504 VkBool32 sparseResidency8Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 8 samples
2505 VkBool32 sparseResidency16Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 16 samples
2506 VkBool32 sparseResidencyAliased /// Sparse resources support: GPU can correctly access data aliased into multiple locations (opt-in)
Jesse Halld1af8122015-11-29 23:50:38 -08002507 VkBool32 variableMultisampleRate
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002508 VkBool32 inheritedQueries
Jesse Halld27f6aa2015-08-15 17:58:48 -07002509}
2510
2511class VkPhysicalDeviceLimits {
2512 /// resource maximum sizes
2513 u32 maxImageDimension1D /// max 1D image dimension
2514 u32 maxImageDimension2D /// max 2D image dimension
2515 u32 maxImageDimension3D /// max 3D image dimension
2516 u32 maxImageDimensionCube /// max cubemap image dimension
2517 u32 maxImageArrayLayers /// max layers for image arrays
Jesse Hallb00daad2015-11-29 19:46:20 -08002518 u32 maxTexelBufferElements
Jesse Hallfbf97b02015-11-20 14:17:03 -08002519 u32 maxUniformBufferRange /// max uniform buffer size (bytes)
2520 u32 maxStorageBufferRange /// max storage buffer size (bytes)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002521 u32 maxPushConstantsSize /// max size of the push constants pool (bytes)
2522 /// memory limits
2523 u32 maxMemoryAllocationCount /// max number of device memory allocations supported
Jesse Hall091ed9e2015-11-30 00:55:29 -08002524 u32 maxSamplerAllocationCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002525 VkDeviceSize bufferImageGranularity /// Granularity (in bytes) at which buffers and images can be bound to adjacent memory for simultaneous usage
2526 VkDeviceSize sparseAddressSpaceSize /// Total address space available for sparse allocations (bytes)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002527 /// descriptor set limits
2528 u32 maxBoundDescriptorSets /// max number of descriptors sets that can be bound to a pipeline
Jesse Halld27f6aa2015-08-15 17:58:48 -07002529 u32 maxPerStageDescriptorSamplers /// max num of samplers allowed per-stage in a descriptor set
2530 u32 maxPerStageDescriptorUniformBuffers /// max num of uniform buffers allowed per-stage in a descriptor set
2531 u32 maxPerStageDescriptorStorageBuffers /// max num of storage buffers allowed per-stage in a descriptor set
2532 u32 maxPerStageDescriptorSampledImages /// max num of sampled images allowed per-stage in a descriptor set
2533 u32 maxPerStageDescriptorStorageImages /// max num of storage images allowed per-stage in a descriptor set
Jesse Halle1b12782015-11-30 11:27:32 -08002534 u32 maxPerStageDescriptorInputAttachments
Jesse Halldba27f72015-11-30 14:25:46 -08002535 u32 maxPerStageResources
Jesse Halld27f6aa2015-08-15 17:58:48 -07002536 u32 maxDescriptorSetSamplers /// max num of samplers allowed in all stages in a descriptor set
2537 u32 maxDescriptorSetUniformBuffers /// max num of uniform buffers allowed in all stages in a descriptor set
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002538 u32 maxDescriptorSetUniformBuffersDynamic /// max num of dynamic uniform buffers allowed in all stages in a descriptor set
Jesse Halld27f6aa2015-08-15 17:58:48 -07002539 u32 maxDescriptorSetStorageBuffers /// max num of storage buffers allowed in all stages in a descriptor set
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002540 u32 maxDescriptorSetStorageBuffersDynamic /// max num of dynamic storage buffers allowed in all stages in a descriptor set
Jesse Halld27f6aa2015-08-15 17:58:48 -07002541 u32 maxDescriptorSetSampledImages /// max num of sampled images allowed in all stages in a descriptor set
2542 u32 maxDescriptorSetStorageImages /// max num of storage images allowed in all stages in a descriptor set
Jesse Halle1b12782015-11-30 11:27:32 -08002543 u32 maxDescriptorSetInputAttachments
Jesse Halld27f6aa2015-08-15 17:58:48 -07002544 /// vertex stage limits
2545 u32 maxVertexInputAttributes /// max num of vertex input attribute slots
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002546 u32 maxVertexInputBindings /// max num of vertex input binding slots
Jesse Halld27f6aa2015-08-15 17:58:48 -07002547 u32 maxVertexInputAttributeOffset /// max vertex input attribute offset added to vertex buffer offset
2548 u32 maxVertexInputBindingStride /// max vertex input binding stride
2549 u32 maxVertexOutputComponents /// max num of output components written by vertex shader
2550 /// tessellation control stage limits
Jesse Hall3fbc8562015-11-29 22:10:52 -08002551 u32 maxTessellationGenerationLevel /// max level supported by tess primitive generator
Jesse Hallae38f732015-11-19 21:32:50 -08002552 u32 maxTessellationPatchSize /// max patch size (vertices)
2553 u32 maxTessellationControlPerVertexInputComponents /// max num of input components per-vertex in TCS
2554 u32 maxTessellationControlPerVertexOutputComponents /// max num of output components per-vertex in TCS
2555 u32 maxTessellationControlPerPatchOutputComponents /// max num of output components per-patch in TCS
2556 u32 maxTessellationControlTotalOutputComponents /// max total num of per-vertex and per-patch output components in TCS
2557 u32 maxTessellationEvaluationInputComponents /// max num of input components per vertex in TES
2558 u32 maxTessellationEvaluationOutputComponents /// max num of output components per vertex in TES
Jesse Halld27f6aa2015-08-15 17:58:48 -07002559 /// geometry stage limits
2560 u32 maxGeometryShaderInvocations /// max invocation count supported in geometry shader
2561 u32 maxGeometryInputComponents /// max num of input components read in geometry stage
2562 u32 maxGeometryOutputComponents /// max num of output components written in geometry stage
2563 u32 maxGeometryOutputVertices /// max num of vertices that can be emitted in geometry stage
2564 u32 maxGeometryTotalOutputComponents /// max total num of components (all vertices) written in geometry stage
2565 /// fragment stage limits
2566 u32 maxFragmentInputComponents /// max num of input compontents read in fragment stage
Jesse Hallfbf97b02015-11-20 14:17:03 -08002567 u32 maxFragmentOutputAttachments /// max num of output attachments written in fragment stage
Jesse Hall3fbc8562015-11-29 22:10:52 -08002568 u32 maxFragmentDualSrcAttachments /// max num of output attachments written when using dual source blending
Jesse Halld27f6aa2015-08-15 17:58:48 -07002569 u32 maxFragmentCombinedOutputResources /// max total num of storage buffers, storage images and output buffers
2570 /// compute stage limits
2571 u32 maxComputeSharedMemorySize /// max total storage size of work group local storage (bytes)
2572 u32[3] maxComputeWorkGroupCount /// max num of compute work groups that may be dispatched by a single command (x,y,z)
2573 u32 maxComputeWorkGroupInvocations /// max total compute invocations in a single local work group
2574 u32[3] maxComputeWorkGroupSize /// max local size of a compute work group (x,y,z)
2575
2576 u32 subPixelPrecisionBits /// num bits of subpixel precision in screen x and y
2577 u32 subTexelPrecisionBits /// num bits of subtexel precision
2578 u32 mipmapPrecisionBits /// num bits of mipmap precision
2579
2580 u32 maxDrawIndexedIndexValue /// max index value for indexed draw calls (for 32-bit indices)
Jesse Halldba27f72015-11-30 14:25:46 -08002581 u32 maxDrawIndirectCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002582
2583 f32 maxSamplerLodBias /// max absolute sampler level of detail bias
2584 f32 maxSamplerAnisotropy /// max degree of sampler anisotropy
2585
2586 u32 maxViewports /// max number of active viewports
Jesse Halld27f6aa2015-08-15 17:58:48 -07002587 u32[2] maxViewportDimensions /// max viewport dimensions (x,y)
2588 f32[2] viewportBoundsRange /// viewport bounds range (min,max)
2589 u32 viewportSubPixelBits /// num bits of subpixel precision for viewport
2590
Jesse Halldc6d36c2015-11-29 19:12:15 -08002591 platform.size_t minMemoryMapAlignment /// min required alignment of pointers returned by MapMemory (bytes)
2592 VkDeviceSize minTexelBufferOffsetAlignment /// min required alignment for texel buffer offsets (bytes)
2593 VkDeviceSize minUniformBufferOffsetAlignment /// min required alignment for uniform buffer sizes and offsets (bytes)
2594 VkDeviceSize minStorageBufferOffsetAlignment /// min required alignment for storage buffer offsets (bytes)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002595
Jesse Hallfbf97b02015-11-20 14:17:03 -08002596 s32 minTexelOffset /// min texel offset for OpTextureSampleOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07002597 u32 maxTexelOffset /// max texel offset for OpTextureSampleOffset
Jesse Hallfbf97b02015-11-20 14:17:03 -08002598 s32 minTexelGatherOffset /// min texel offset for OpTextureGatherOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07002599 u32 maxTexelGatherOffset /// max texel offset for OpTextureGatherOffset
2600 f32 minInterpolationOffset /// furthest negative offset for interpolateAtOffset
2601 f32 maxInterpolationOffset /// furthest positive offset for interpolateAtOffset
2602 u32 subPixelInterpolationOffsetBits /// num of subpixel bits for interpolateAtOffset
2603
2604 u32 maxFramebufferWidth /// max width for a framebuffer
2605 u32 maxFramebufferHeight /// max height for a framebuffer
2606 u32 maxFramebufferLayers /// max layer count for a layered framebuffer
Jesse Hall091ed9e2015-11-30 00:55:29 -08002607 VkSampleCountFlags framebufferColorSampleCounts
2608 VkSampleCountFlags framebufferDepthSampleCounts
2609 VkSampleCountFlags framebufferStencilSampleCounts
2610 VkSampleCountFlags framebufferNoAttachmentSampleCounts
Jesse Halld27f6aa2015-08-15 17:58:48 -07002611 u32 maxColorAttachments /// max num of framebuffer color attachments
2612
Jesse Hall091ed9e2015-11-30 00:55:29 -08002613 VkSampleCountFlags sampledImageColorSampleCounts
2614 VkSampleCountFlags sampledImageIntegerSampleCounts
2615 VkSampleCountFlags sampledImageDepthSampleCounts
2616 VkSampleCountFlags sampledImageStencilSampleCounts
2617 VkSampleCountFlags storageImageSampleCounts
Jesse Halld27f6aa2015-08-15 17:58:48 -07002618 u32 maxSampleMaskWords /// max num of sample mask words
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002619 VkBool32 timestampComputeAndGraphics
Jesse Halld27f6aa2015-08-15 17:58:48 -07002620
Jesse Halla9bb62b2015-11-21 19:31:56 -08002621 f32 timestampPeriod
Jesse Halld27f6aa2015-08-15 17:58:48 -07002622
2623 u32 maxClipDistances /// max number of clip distances
2624 u32 maxCullDistances /// max number of cull distances
2625 u32 maxCombinedClipAndCullDistances /// max combined number of user clipping
2626
Jesse Hallfbf97b02015-11-20 14:17:03 -08002627 u32 discreteQueuePriorities
2628
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002629 f32[2] pointSizeRange /// range (min,max) of supported point sizes
2630 f32[2] lineWidthRange /// range (min,max) of supported line widths
Jesse Halld27f6aa2015-08-15 17:58:48 -07002631 f32 pointSizeGranularity /// granularity of supported point sizes
2632 f32 lineWidthGranularity /// granularity of supported line widths
Jesse Hall03b6fe12015-11-24 12:44:21 -08002633 VkBool32 strictLines
Jesse Hall091ed9e2015-11-30 00:55:29 -08002634 VkBool32 standardSampleLocations
Jesse Halla9bb62b2015-11-21 19:31:56 -08002635
Jesse Hall65ab5522015-11-30 00:07:16 -08002636 VkDeviceSize optimalBufferCopyOffsetAlignment
2637 VkDeviceSize optimalBufferCopyRowPitchAlignment
Jesse Halldba27f72015-11-30 14:25:46 -08002638 VkDeviceSize nonCoherentAtomSize
Jesse Halld27f6aa2015-08-15 17:58:48 -07002639}
2640
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002641class VkPhysicalDeviceSparseProperties {
2642 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 -08002643 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 -07002644 VkBool32 residencyStandard3DBlockShape /// Sparse resources support: GPU will access all 3D sparse resources using the standard block shapes (based on pixel format)
2645 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 -07002646 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
2647}
2648
Jesse Halld27f6aa2015-08-15 17:58:48 -07002649class VkSemaphoreCreateInfo {
2650 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO
2651 const void* pNext /// Pointer to next structure
2652 VkSemaphoreCreateFlags flags /// Semaphore creation flags
2653}
2654
2655class VkQueryPoolCreateInfo {
2656 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO
2657 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002658 VkQueryPoolCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002659 VkQueryType queryType
Jesse Hall3dd678a2016-01-08 21:52:01 -08002660 u32 queryCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002661 VkQueryPipelineStatisticFlags pipelineStatistics /// Optional
2662}
2663
2664class VkFramebufferCreateInfo {
2665 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO
2666 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002667 VkFramebufferCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002668 VkRenderPass renderPass
2669 u32 attachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002670 const VkImageView* pAttachments
Jesse Halld27f6aa2015-08-15 17:58:48 -07002671 u32 width
2672 u32 height
2673 u32 layers
2674}
2675
Jesse Hall3fbc8562015-11-29 22:10:52 -08002676class VkDrawIndirectCommand {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002677 u32 vertexCount
2678 u32 instanceCount
2679 u32 firstVertex
2680 u32 firstInstance
2681}
2682
Jesse Hall3fbc8562015-11-29 22:10:52 -08002683class VkDrawIndexedIndirectCommand {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002684 u32 indexCount
2685 u32 instanceCount
2686 u32 firstIndex
2687 s32 vertexOffset
2688 u32 firstInstance
2689}
2690
Jesse Hall3fbc8562015-11-29 22:10:52 -08002691class VkDispatchIndirectCommand {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002692 u32 x
2693 u32 y
2694 u32 z
2695}
2696
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002697@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08002698class VkSurfaceCapabilitiesKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002699 u32 minImageCount
2700 u32 maxImageCount
2701 VkExtent2D currentExtent
2702 VkExtent2D minImageExtent
2703 VkExtent2D maxImageExtent
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002704 u32 maxImageArrayLayers
Jesse Hall1356b0d2015-11-23 17:24:58 -08002705 VkSurfaceTransformFlagsKHR supportedTransforms
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002706 VkSurfaceTransformFlagBitsKHR currentTransform
Jesse Halla6429252015-11-29 18:59:42 -08002707 VkCompositeAlphaFlagsKHR supportedCompositeAlpha
Jesse Hall1356b0d2015-11-23 17:24:58 -08002708 VkImageUsageFlags supportedUsageFlags
Michael Lentine88594d72015-11-12 12:49:45 -08002709}
2710
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002711@extension("VK_KHR_surface")
Michael Lentine88594d72015-11-12 12:49:45 -08002712class VkSurfaceFormatKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002713 VkFormat format
2714 VkColorSpaceKHR colorSpace
Michael Lentine88594d72015-11-12 12:49:45 -08002715}
2716
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002717@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08002718class VkSwapchainCreateInfoKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002719 VkStructureType sType
2720 const void* pNext
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002721 VkSwapchainCreateFlagsKHR flags
Jesse Hall1356b0d2015-11-23 17:24:58 -08002722 VkSurfaceKHR surface
2723 u32 minImageCount
2724 VkFormat imageFormat
2725 VkColorSpaceKHR imageColorSpace
2726 VkExtent2D imageExtent
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002727 u32 imageArrayLayers
2728 VkImageUsageFlags imageUsage
Jesse Hall1356b0d2015-11-23 17:24:58 -08002729 VkSharingMode sharingMode
Jesse Hall03b6fe12015-11-24 12:44:21 -08002730 u32 queueFamilyIndexCount
Jesse Hall1356b0d2015-11-23 17:24:58 -08002731 const u32* pQueueFamilyIndices
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002732 VkSurfaceTransformFlagBitsKHR preTransform
2733 VkCompositeAlphaFlagBitsKHR compositeAlpha
Jesse Hall1356b0d2015-11-23 17:24:58 -08002734 VkPresentModeKHR presentMode
Jesse Hall1356b0d2015-11-23 17:24:58 -08002735 VkBool32 clipped
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002736 VkSwapchainKHR oldSwapchain
Michael Lentine88594d72015-11-12 12:49:45 -08002737}
2738
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002739@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08002740class VkPresentInfoKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002741 VkStructureType sType
2742 const void* pNext
Jesse Hallb00daad2015-11-29 19:46:20 -08002743 u32 waitSemaphoreCount
2744 const VkSemaphore* pWaitSemaphores
Jesse Hall1356b0d2015-11-23 17:24:58 -08002745 u32 swapchainCount
Jesse Hall03b6fe12015-11-24 12:44:21 -08002746 const VkSwapchainKHR* pSwapchains
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002747 const u32* pImageIndices
Jesse Halle1b12782015-11-30 11:27:32 -08002748 VkResult* pResults
Michael Lentine88594d72015-11-12 12:49:45 -08002749}
2750
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002751@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002752class VkDisplayPropertiesKHR {
2753 VkDisplayKHR display
2754 const char* displayName
2755 VkExtent2D physicalDimensions
2756 VkExtent2D physicalResolution
2757 VkSurfaceTransformFlagsKHR supportedTransforms
Jesse Hall1356b0d2015-11-23 17:24:58 -08002758 VkBool32 planeReorderPossible
Jesse Halla6429252015-11-29 18:59:42 -08002759 VkBool32 persistentContent
Michael Lentine88594d72015-11-12 12:49:45 -08002760}
2761
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002762@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08002763class VkDisplayModeParametersKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002764 VkExtent2D visibleRegion
Jesse Halla6429252015-11-29 18:59:42 -08002765 u32 refreshRate
Michael Lentine88594d72015-11-12 12:49:45 -08002766}
Jesse Halld27f6aa2015-08-15 17:58:48 -07002767
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002768@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002769class VkDisplayModePropertiesKHR {
2770 VkDisplayModeKHR displayMode
Jesse Halla6429252015-11-29 18:59:42 -08002771 VkDisplayModeParametersKHR parameters
Jesse Hall1356b0d2015-11-23 17:24:58 -08002772}
2773
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002774@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002775class VkDisplayModeCreateInfoKHR {
2776 VkStructureType sType
2777 const void* pNext
Jesse Hall9ba8bc82015-11-30 16:22:16 -08002778 VkDisplayModeCreateFlagsKHR flags
Jesse Halla6429252015-11-29 18:59:42 -08002779 VkDisplayModeParametersKHR parameters
Jesse Hall1356b0d2015-11-23 17:24:58 -08002780}
2781
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002782@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002783class VkDisplayPlanePropertiesKHR {
Jesse Halla6429252015-11-29 18:59:42 -08002784 VkDisplayKHR currentDisplay
2785 u32 currentStackIndex
2786}
2787
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002788@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08002789class VkDisplayPlaneCapabilitiesKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002790 VkDisplayPlaneAlphaFlagsKHR supportedAlpha
2791 VkOffset2D minSrcPosition
2792 VkOffset2D maxSrcPosition
2793 VkExtent2D minSrcExtent
2794 VkExtent2D maxSrcExtent
2795 VkOffset2D minDstPosition
2796 VkOffset2D maxDstPosition
2797 VkExtent2D minDstExtent
2798 VkExtent2D maxDstExtent
2799}
2800
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002801@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08002802class VkDisplaySurfaceCreateInfoKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002803 VkStructureType sType
2804 const void* pNext
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002805 VkDisplaySurfaceCreateFlagsKHR flags
Jesse Hall1356b0d2015-11-23 17:24:58 -08002806 VkDisplayModeKHR displayMode
2807 u32 planeIndex
2808 u32 planeStackIndex
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002809 VkSurfaceTransformFlagBitsKHR transform
Jesse Hall1356b0d2015-11-23 17:24:58 -08002810 f32 globalAlpha
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002811 VkDisplayPlaneAlphaFlagBitsKHR alphaMode
2812 VkExtent2D imageExtent
Jesse Hall1356b0d2015-11-23 17:24:58 -08002813}
2814
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002815@extension("VK_KHR_display_swapchain")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002816class VkDisplayPresentInfoKHR {
2817 VkStructureType sType
2818 const void* pNext
2819 VkRect2D srcRect
2820 VkRect2D dstRect
Jesse Halla6429252015-11-29 18:59:42 -08002821 VkBool32 persistent
Jesse Hall1356b0d2015-11-23 17:24:58 -08002822}
2823
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002824@extension("VK_KHR_xlib_surface")
2825class VkXlibSurfaceCreateInfoKHR {
2826 VkStructureType sType
2827 const void* pNext
2828 VkXlibSurfaceCreateFlagsKHR flags
2829 platform.Display* dpy
2830 platform.Window window
2831}
2832
2833@extension("VK_KHR_xcb_surface")
2834class VkXcbSurfaceCreateInfoKHR {
2835 VkStructureType sType
2836 const void* pNext
2837 VkXcbSurfaceCreateFlagsKHR flags
2838 platform.xcb_connection_t* connection
2839 platform.xcb_window_t window
2840}
2841
2842@extension("VK_KHR_wayland_surface")
2843class VkWaylandSurfaceCreateInfoKHR {
2844 VkStructureType sType
2845 const void* pNext
2846 VkWaylandSurfaceCreateFlagsKHR flags
2847 platform.wl_display* display
2848 platform.wl_surface* surface
2849}
2850
2851@extension("VK_KHR_mir_surface")
2852class VkMirSurfaceCreateInfoKHR {
2853 VkStructureType sType
2854 const void* pNext
2855 VkMirSurfaceCreateFlagsKHR flags
2856 platform.MirConnection* connection
2857 platform.MirSurface* mirSurface
2858}
2859
2860@extension("VK_KHR_android_surface")
2861class VkAndroidSurfaceCreateInfoKHR {
2862 VkStructureType sType
2863 const void* pNext
2864 VkAndroidSurfaceCreateFlagsKHR flags
2865 platform.ANativeWindow* window
2866}
2867
2868@extension("VK_KHR_win32_surface")
2869class VkWin32SurfaceCreateInfoKHR {
2870 VkStructureType sType
2871 const void* pNext
2872 VkWin32SurfaceCreateFlagsKHR flags
2873 platform.HINSTANCE hinstance
2874 platform.HWND hwnd
2875}
2876
Chia-I Wub262ddc2016-03-22 07:38:20 +08002877@extension("VK_ANDROID_native_buffer")
2878class VkNativeBufferANDROID {
2879 VkStructureType sType
2880 const void* pNext
2881 platform.buffer_handle_t handle
2882 int stride
2883 int format
2884 int usage
2885}
2886
Chris Forbes8e4438b2016-12-07 16:26:49 +13002887@extension("VK_ANDROID_native_buffer")
2888class VkSwapchainImageCreateInfoANDROID {
2889 VkStructureType sType
2890 const void* pNext
2891 VkSwapchainImageUsageFlagBitsANDROID flags
2892}
2893
Jesse Hall715b86a2016-01-16 16:34:29 -08002894@extension("VK_EXT_debug_report")
2895class VkDebugReportCallbackCreateInfoEXT {
2896 VkStructureType sType
2897 const void* pNext
2898 VkDebugReportFlagsEXT flags
2899 PFN_vkDebugReportCallbackEXT pfnCallback
2900 void* pUserData
2901}
2902
Jesse Hall26763382016-05-20 07:13:52 -07002903@extension("VK_AMD_rasterization_order")
2904class VkPipelineRasterizationStateRasterizationOrderAMD {
2905 VkStructureType sType
2906 const void* pNext
2907 VkRasterizationOrderAMD rasterizationOrder
2908}
2909
2910@extension("VK_EXT_debug_marker")
2911class VkDebugMarkerObjectNameInfoEXT {
2912 VkStructureType sType
2913 const void* pNext
2914 VkDebugReportObjectTypeEXT objectType
2915 u64 object
2916 const char* pObjectName
2917}
2918
2919@extension("VK_EXT_debug_marker")
2920class VkDebugMarkerObjectTagInfoEXT {
2921 VkStructureType sType
2922 const void* pNext
2923 VkDebugReportObjectTypeEXT objectType
2924 u64 object
2925 u64 tagName
2926 platform.size_t tagSize
2927 const void* pTag
2928}
2929
2930@extension("VK_EXT_debug_marker")
2931class VkDebugMarkerMarkerInfoEXT {
2932 VkStructureType sType
2933 const void* pNext
2934 const char* pMarkerName
2935 f32[4] color
2936}
2937
Jesse Hall56d386a2016-07-26 15:20:40 -07002938@extension("VK_NV_dedicated_allocation")
2939class VkDedicatedAllocationImageCreateInfoNV {
2940 VkStructureType sType
2941 const void* pNext
2942 VkBool32 dedicatedAllocation
2943}
2944
2945@extension("VK_NV_dedicated_allocation")
2946class VkDedicatedAllocationBufferCreateInfoNV {
2947 VkStructureType sType
2948 const void* pNext
2949 VkBool32 dedicatedAllocation
2950}
2951
2952@extension("VK_NV_dedicated_allocation")
2953class VkDedicatedAllocationMemoryAllocateInfoNV {
2954 VkStructureType sType
2955 const void* pNext
2956 VkImage image
2957 VkBuffer buffer
2958}
2959
Chris Forbes1194ede2016-12-30 16:29:25 +13002960@extension("VK_KHR_get_physical_device_properties2")
2961class VkPhysicalDeviceFeatures2KHR {
2962 VkStructureType sType
2963 void* pNext
2964 VkPhysicalDeviceFeatures features
2965}
2966
2967@extension("VK_KHR_get_physical_device_properties2")
2968class VkPhysicalDeviceProperties2KHR {
2969 VkStructureType sType
2970 void* pNext
2971 VkPhysicalDeviceProperties properties
2972}
2973
2974@extension("VK_KHR_get_physical_device_properties2")
2975class VkFormatProperties2KHR {
2976 VkStructureType sType
2977 void* pNext
2978 VkFormatProperties formatProperties
2979}
2980
2981@extension("VK_KHR_get_physical_device_properties2")
2982class VkImageFormatProperties2KHR {
2983 VkStructureType sType
2984 void* pNext
2985 VkImageFormatProperties imageFormatProperties
2986}
2987
2988@extension("VK_KHR_get_physical_device_properties2")
2989class VkPhysicalDeviceImageFormatInfo2KHR {
2990 VkStructureType sType
2991 const void* pNext
2992 VkFormat format
2993 VkImageType type
2994 VkImageTiling tiling
2995 VkImageUsageFlags usage
2996 VkImageCreateFlags flags
2997}
2998
2999@extension("VK_KHR_get_physical_device_properties2")
3000class VkQueueFamilyProperties2KHR {
3001 VkStructureType sType
3002 void* pNext
3003 VkQueueFamilyProperties queueFamilyProperties
3004}
3005
3006@extension("VK_KHR_get_physical_device_properties2")
3007class VkPhysicalDeviceMemoryProperties2KHR {
3008 VkStructureType sType
3009 void* pNext
3010 VkPhysicalDeviceMemoryProperties memoryProperties
3011}
3012
3013@extension("VK_KHR_get_physical_device_properties2")
3014class VkSparseImageFormatProperties2KHR {
3015 VkStructureType sType
3016 void* pNext
3017 VkSparseImageFormatProperties properties
3018}
3019
3020@extension("VK_KHR_get_physical_device_properties2")
3021class VkPhysicalDeviceSparseImageFormatInfo2KHR {
3022 VkStructureType sType
3023 const void* pNext
3024 VkFormat format
3025 VkImageType type
3026 VkSampleCountFlagBits samples
3027 VkImageUsageFlags usage
3028 VkImageTiling tiling
3029}
3030
Chris Forbes289cb792016-12-30 15:03:55 +13003031@extension("VK_KHR_incremental_present")
3032class VkRectLayerKHR {
3033 VkOffset2D offset
3034 VkExtent2D extent
3035 u32 layer
3036}
3037
3038@extension("VK_KHR_incremental_present")
3039class VkPresentRegionKHR {
3040 u32 rectangleCount
3041 const VkRectLayerKHR* pRectangles
3042}
3043
3044@extension("VK_KHR_incremental_present")
3045class VkPresentRegionsKHR {
3046 VkStructureType sType
3047 const void* pNext
3048 u32 swapchainCount
3049 const VkPresentRegionKHR* pRegions
3050}
3051
3052@extension("VK_NV_external_memory_capabilities")
3053class VkExternalImageFormatPropertiesNV {
3054 VkImageFormatProperties imageFormatProperties
3055 VkExternalMemoryFeatureFlagsNV externalMemoryFeatures
3056 VkExternalMemoryHandleTypeFlagsNV exportFromImportedHandleTypes
3057 VkExternalMemoryHandleTypeFlagsNV compatibleHandleTypes
3058}
3059
3060@extension("VK_NV_external_memory")
3061class VkExternalMemoryImageCreateInfoNV {
3062 VkStructureType sType
3063 const void* pNext
3064 VkExternalMemoryHandleTypeFlagsNV handleTypes
3065}
3066
3067@extension("VK_NV_external_memory")
3068class VkExportMemoryAllocateInfoNV {
3069 VkStructureType sType
3070 const void* pNext
3071 VkExternalMemoryHandleTypeFlagsNV handleTypes
3072}
3073
3074@extension("VK_NV_external_memory_win32")
3075class VkImportMemoryWin32HandleInfoNV {
3076 VkStructureType sType
3077 const void* pNext
3078 VkExternalMemoryHandleTypeFlagsNV handleType
3079 platform.HANDLE handle
3080}
3081
3082@extension("VK_NV_external_memory_win32")
3083class VkExportMemoryWin32HandleInfoNV {
3084 VkStructureType sType
3085 const void* pNext
3086 const platform.SECURITY_ATTRIBUTES* pAttributes
3087 u32 dwAccess
3088}
3089
3090@extension("VK_NV_win32_keyed_mutex")
3091class VkWin32KeyedMutexAcquireReleaseInfoNV {
3092 VkStructureType sType
3093 const void* pNext
3094 u32 acquireCount
3095 const VkDeviceMemory* pAcquireSyncs
3096 const u64* pAcquireKeys
3097 const u32* pAcquireTimeoutMilliseconds
3098 u32 releaseCount
3099 const VkDeviceMemory* pReleaseSyncs
3100 const u64* pReleaseKeys
3101}
3102
3103@extension("VK_EXT_validation_flags")
3104class VkValidationFlagsEXT {
3105 VkStructureType sType
3106 const void* pNext
3107 u32 disabledValidationCheckCount
3108 VkValidationCheckEXT* pDisabledValidationChecks
3109}
3110
3111@extension("VK_NVX_device_generated_commands")
3112class VkDeviceGeneratedCommandsFeaturesNVX {
3113 VkStructureType sType
3114 const void* pNext
3115 VkBool32 computeBindingPointSupport
3116}
3117
3118@extension("VK_NVX_device_generated_commands")
3119class VkDeviceGeneratedCommandsLimitsNVX {
3120 VkStructureType sType
3121 const void* pNext
3122 u32 maxIndirectCommandsLayoutTokenCount
3123 u32 maxObjectEntryCounts
3124 u32 minSequenceCountBufferOffsetAlignment
3125 u32 minSequenceIndexBufferOffsetAlignment
3126 u32 minCommandsTokenBufferOffsetAlignment
3127}
3128
3129@extension("VK_NVX_device_generated_commands")
3130class VkIndirectCommandsTokenNVX {
3131 VkIndirectCommandsTokenTypeNVX tokenType
3132 VkBuffer buffer
3133 VkDeviceSize offset
3134}
3135
3136@extension("VK_NVX_device_generated_commands")
3137class VkIndirectCommandsLayoutTokenNVX {
3138 VkIndirectCommandsTokenTypeNVX tokenType
3139 u32 bindingUnit
3140 u32 dynamicCount
3141 u32 divisor
3142}
3143
3144@extension("VK_NVX_device_generated_commands")
3145class VkIndirectCommandsLayoutCreateInfoNVX {
3146 VkStructureType sType
3147 const void* pNext
3148 VkPipelineBindPoint pipelineBindPoint
3149 VkIndirectCommandsLayoutUsageFlagsNVX flags
3150 u32 tokenCount
3151 const VkIndirectCommandsLayoutTokenNVX* pTokens
3152}
3153
3154@extension("VK_NVX_device_generated_commands")
3155class VkCmdProcessCommandsInfoNVX {
3156 VkStructureType sType
3157 const void* pNext
3158 VkObjectTableNVX objectTable
3159 VkIndirectCommandsLayoutNVX indirectCommandsLayout
3160 u32 indirectCommandsTokenCount
3161 const VkIndirectCommandsTokenNVX* pIndirectCommandsTokens
3162 u32 maxSequencesCount
3163 VkCommandBuffer targetCommandBuffer
3164 VkBuffer sequencesCountBuffer
3165 VkDeviceSize sequencesCountOffset
3166 VkBuffer sequencesIndexBuffer
3167 VkDeviceSize sequencesIndexOffset
3168}
3169
3170@extension("VK_NVX_device_generated_commands")
3171class VkCmdReserveSpaceForCommandsInfoNVX {
3172 VkStructureType sType
3173 const void* pNext
3174 VkObjectTableNVX objectTable
3175 VkIndirectCommandsLayoutNVX indirectCommandsLayout
3176 u32 maxSequencesCount
3177}
3178
3179@extension("VK_NVX_device_generated_commands")
3180class VkObjectTableCreateInfoNVX {
3181 VkStructureType sType
3182 const void* pNext
3183 u32 objectCount
3184 const VkObjectEntryTypeNVX* pObjectEntryTypes
3185 const u32* pObjectEntryCounts
3186 const VkObjectEntryUsageFlagsNVX* pObjectEntryUsageFlags
3187 u32 maxUniformBuffersPerDescriptor
3188 u32 maxStorageBuffersPerDescriptor
3189 u32 maxStorageImagesPerDescriptor
3190 u32 maxSampledImagesPerDescriptor
3191 u32 maxPipelineLayouts
3192}
3193
3194@extension("VK_NVX_device_generated_commands")
3195class VkObjectTableEntryNVX {
3196 VkObjectEntryTypeNVX type
3197 VkObjectEntryUsageFlagsNVX flags
3198}
3199
3200@extension("VK_NVX_device_generated_commands")
3201class VkObjectTablePipelineEntryNVX {
3202 VkObjectEntryTypeNVX type
3203 VkObjectEntryUsageFlagsNVX flags
3204 VkPipeline pipeline
3205}
3206
3207@extension("VK_NVX_device_generated_commands")
3208class VkObjectTableDescriptorSetEntryNVX {
3209 VkObjectEntryTypeNVX type
3210 VkObjectEntryUsageFlagsNVX flags
3211 VkPipelineLayout pipelineLayout
3212 VkDescriptorSet descriptorSet
3213}
3214
3215@extension("VK_NVX_device_generated_commands")
3216class VkObjectTableVertexBufferEntryNVX {
3217 VkObjectEntryTypeNVX type
3218 VkObjectEntryUsageFlagsNVX flags
3219 VkBuffer buffer
3220}
3221
3222@extension("VK_NVX_device_generated_commands")
3223class VkObjectTableIndexBufferEntryNVX {
3224 VkObjectEntryTypeNVX type
3225 VkObjectEntryUsageFlagsNVX flags
3226 VkBuffer buffer
3227}
3228
3229@extension("VK_NVX_device_generated_commands")
3230class VkObjectTablePushConstantEntryNVX {
3231 VkObjectEntryTypeNVX type
3232 VkObjectEntryUsageFlagsNVX flags
3233 VkPipelineLayout pipelineLayout
3234 VkShaderStageFlags stageFlags
3235}
3236
3237
Jesse Hall1356b0d2015-11-23 17:24:58 -08003238
Jesse Halld27f6aa2015-08-15 17:58:48 -07003239////////////////
3240// Commands //
3241////////////////
3242
3243// Function pointers. TODO: add support for function pointers.
3244
3245@external type void* PFN_vkVoidFunction
3246@pfn cmd void vkVoidFunction() {
3247}
3248
Jesse Hall3fbc8562015-11-29 22:10:52 -08003249@external type void* PFN_vkAllocationFunction
3250@pfn cmd void* vkAllocationFunction(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003251 void* pUserData,
3252 platform.size_t size,
3253 platform.size_t alignment,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003254 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08003255 return ?
3256}
3257
Jesse Hall3fbc8562015-11-29 22:10:52 -08003258@external type void* PFN_vkReallocationFunction
3259@pfn cmd void* vkReallocationFunction(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003260 void* pUserData,
3261 void* pOriginal,
3262 platform.size_t size,
3263 platform.size_t alignment,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003264 VkSystemAllocationScope allocationScope) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003265 return ?
3266}
3267
3268@external type void* PFN_vkFreeFunction
3269@pfn cmd void vkFreeFunction(
3270 void* pUserData,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003271 void* pMemory) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003272}
3273
Jesse Hall3fbc8562015-11-29 22:10:52 -08003274@external type void* PFN_vkInternalAllocationNotification
3275@pfn cmd void vkInternalAllocationNotification(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003276 void* pUserData,
3277 platform.size_t size,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003278 VkInternalAllocationType allocationType,
3279 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08003280}
3281
3282@external type void* PFN_vkInternalFreeNotification
3283@pfn cmd void vkInternalFreeNotification(
3284 void* pUserData,
3285 platform.size_t size,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003286 VkInternalAllocationType allocationType,
3287 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08003288}
Jesse Halld27f6aa2015-08-15 17:58:48 -07003289
3290// Global functions
3291
3292@threadSafety("system")
3293cmd VkResult vkCreateInstance(
3294 const VkInstanceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003295 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003296 VkInstance* pInstance) {
3297 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO)
3298
3299 instance := ?
3300 pInstance[0] = instance
3301 State.Instances[instance] = new!InstanceObject()
3302
Jesse Hall3dd678a2016-01-08 21:52:01 -08003303 layers := pCreateInfo.ppEnabledLayerNames[0:pCreateInfo.enabledLayerCount]
3304 extensions := pCreateInfo.ppEnabledExtensionNames[0:pCreateInfo.enabledExtensionCount]
Jesse Halld27f6aa2015-08-15 17:58:48 -07003305
3306 return ?
3307}
3308
3309@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003310cmd void vkDestroyInstance(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003311 VkInstance instance,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003312 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003313 instanceObject := GetInstance(instance)
3314
3315 State.Instances[instance] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003316}
3317
3318@threadSafety("system")
3319cmd VkResult vkEnumeratePhysicalDevices(
3320 VkInstance instance,
3321 u32* pPhysicalDeviceCount,
3322 VkPhysicalDevice* pPhysicalDevices) {
3323 instanceObject := GetInstance(instance)
3324
3325 physicalDeviceCount := as!u32(?)
3326 pPhysicalDeviceCount[0] = physicalDeviceCount
3327 physicalDevices := pPhysicalDevices[0:physicalDeviceCount]
3328
3329 for i in (0 .. physicalDeviceCount) {
3330 physicalDevice := ?
3331 physicalDevices[i] = physicalDevice
3332 if !(physicalDevice in State.PhysicalDevices) {
3333 State.PhysicalDevices[physicalDevice] = new!PhysicalDeviceObject(instance: instance)
3334 }
3335 }
3336
3337 return ?
3338}
3339
3340cmd PFN_vkVoidFunction vkGetDeviceProcAddr(
3341 VkDevice device,
3342 const char* pName) {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003343 if device != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003344 device := GetDevice(device)
3345 }
3346
3347 return ?
3348}
3349
3350cmd PFN_vkVoidFunction vkGetInstanceProcAddr(
3351 VkInstance instance,
3352 const char* pName) {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003353 if instance != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003354 instanceObject := GetInstance(instance)
3355 }
3356
3357 return ?
3358}
3359
Jesse Hall606a54e2015-11-19 22:17:28 -08003360cmd void vkGetPhysicalDeviceProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003361 VkPhysicalDevice physicalDevice,
3362 VkPhysicalDeviceProperties* pProperties) {
3363 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3364
3365 properties := ?
3366 pProperties[0] = properties
Jesse Halld27f6aa2015-08-15 17:58:48 -07003367}
3368
Jesse Hall606a54e2015-11-19 22:17:28 -08003369cmd void vkGetPhysicalDeviceQueueFamilyProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003370 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003371 u32* pQueueFamilyPropertyCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003372 VkQueueFamilyProperties* pQueueFamilyProperties) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003373 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003374 // TODO: Figure out how to express fetch-count-or-properties
3375 // This version fails 'apic validate' with 'fence not allowed in
3376 // *semantic.Branch'. Other attempts have failed with the same or other
3377 // errors.
3378 // if pQueueFamilyProperties != null {
3379 // queuesProperties := pQueueFamilyProperties[0:pCount[0]]
3380 // for i in (0 .. pCount[0]) {
3381 // queueProperties := as!VkQueueFamilyProperties(?)
3382 // queuesProperties[i] = queueProperties
3383 // }
3384 // } else {
3385 // count := ?
3386 // pCount[0] = count
3387 // }
Jesse Halld27f6aa2015-08-15 17:58:48 -07003388}
3389
Jesse Hall606a54e2015-11-19 22:17:28 -08003390cmd void vkGetPhysicalDeviceMemoryProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003391 VkPhysicalDevice physicalDevice,
3392 VkPhysicalDeviceMemoryProperties* pMemoryProperties) {
3393 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3394
3395 memoryProperties := ?
3396 pMemoryProperties[0] = memoryProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07003397}
3398
Jesse Hall606a54e2015-11-19 22:17:28 -08003399cmd void vkGetPhysicalDeviceFeatures(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003400 VkPhysicalDevice physicalDevice,
3401 VkPhysicalDeviceFeatures* pFeatures) {
3402 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3403
3404 features := ?
3405 pFeatures[0] = features
Jesse Halld27f6aa2015-08-15 17:58:48 -07003406}
3407
Jesse Hall606a54e2015-11-19 22:17:28 -08003408cmd void vkGetPhysicalDeviceFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003409 VkPhysicalDevice physicalDevice,
3410 VkFormat format,
3411 VkFormatProperties* pFormatProperties) {
3412 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3413
3414 formatProperties := ?
3415 pFormatProperties[0] = formatProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07003416}
3417
Jesse Halla9e57032015-11-30 01:03:10 -08003418cmd VkResult vkGetPhysicalDeviceImageFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003419 VkPhysicalDevice physicalDevice,
3420 VkFormat format,
3421 VkImageType type,
3422 VkImageTiling tiling,
3423 VkImageUsageFlags usage,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003424 VkImageCreateFlags flags,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003425 VkImageFormatProperties* pImageFormatProperties) {
3426 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3427
3428 imageFormatProperties := ?
3429 pImageFormatProperties[0] = imageFormatProperties
Jesse Halla9e57032015-11-30 01:03:10 -08003430
3431 return ?
Jesse Halld27f6aa2015-08-15 17:58:48 -07003432}
3433
Jesse Halld27f6aa2015-08-15 17:58:48 -07003434
3435// Device functions
3436
3437@threadSafety("system")
3438cmd VkResult vkCreateDevice(
3439 VkPhysicalDevice physicalDevice,
3440 const VkDeviceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003441 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003442 VkDevice* pDevice) {
3443 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO)
3444 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3445
3446 device := ?
3447 pDevice[0] = device
3448 State.Devices[device] = new!DeviceObject(physicalDevice: physicalDevice)
3449
3450 return ?
3451}
3452
3453@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003454cmd void vkDestroyDevice(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003455 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003456 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003457 deviceObject := GetDevice(device)
3458
3459 State.Devices[device] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003460}
3461
3462
3463// Extension discovery functions
3464
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003465cmd VkResult vkEnumerateInstanceLayerProperties(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003466 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003467 VkLayerProperties* pProperties) {
3468 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08003469 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07003470
3471 properties := pProperties[0:count]
3472 for i in (0 .. count) {
3473 property := ?
3474 properties[i] = property
3475 }
3476
3477 return ?
3478}
3479
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003480cmd VkResult vkEnumerateInstanceExtensionProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003481 const char* pLayerName,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003482 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003483 VkExtensionProperties* pProperties) {
3484 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08003485 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07003486
3487 properties := pProperties[0:count]
3488 for i in (0 .. count) {
3489 property := ?
3490 properties[i] = property
3491 }
3492
3493 return ?
3494}
3495
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003496cmd VkResult vkEnumerateDeviceLayerProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003497 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003498 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003499 VkLayerProperties* pProperties) {
3500 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3501 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08003502 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07003503
3504 properties := pProperties[0:count]
3505 for i in (0 .. count) {
3506 property := ?
3507 properties[i] = property
3508 }
3509
3510 return ?
3511}
3512
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003513cmd VkResult vkEnumerateDeviceExtensionProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003514 VkPhysicalDevice physicalDevice,
3515 const char* pLayerName,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003516 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003517 VkExtensionProperties* pProperties) {
3518 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3519
3520 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08003521 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07003522
3523 properties := pProperties[0:count]
3524 for i in (0 .. count) {
3525 property := ?
3526 properties[i] = property
3527 }
3528
3529 return ?
3530}
3531
3532
3533// Queue functions
3534
3535@threadSafety("system")
Jesse Hall606a54e2015-11-19 22:17:28 -08003536cmd void vkGetDeviceQueue(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003537 VkDevice device,
3538 u32 queueFamilyIndex,
3539 u32 queueIndex,
3540 VkQueue* pQueue) {
3541 deviceObject := GetDevice(device)
3542
3543 queue := ?
3544 pQueue[0] = queue
3545
3546 if !(queue in State.Queues) {
3547 State.Queues[queue] = new!QueueObject(device: device)
3548 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07003549}
3550
3551@threadSafety("app")
3552cmd VkResult vkQueueSubmit(
3553 VkQueue queue,
Jesse Halla366a512015-11-19 22:30:07 -08003554 u32 submitCount,
Jesse Hallb00daad2015-11-29 19:46:20 -08003555 const VkSubmitInfo* pSubmits,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003556 VkFence fence) {
3557 queueObject := GetQueue(queue)
3558
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003559 if fence != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003560 fenceObject := GetFence(fence)
3561 assert(fenceObject.device == queueObject.device)
3562 }
3563
Jesse Hall3fbc8562015-11-29 22:10:52 -08003564 // commandBuffers := pcommandBuffers[0:commandBufferCount]
3565 // for i in (0 .. commandBufferCount) {
3566 // commandBuffer := commandBuffers[i]
3567 // commandBufferObject := GetCommandBuffer(commandBuffer)
3568 // assert(commandBufferObject.device == queueObject.device)
Jesse Halla366a512015-11-19 22:30:07 -08003569 //
Jesse Hall3fbc8562015-11-29 22:10:52 -08003570 // validate("QueueCheck", commandBufferObject.queueFlags in queueObject.flags,
3571 // "vkQueueSubmit: enqueued commandBuffer requires missing queue capabilities.")
Jesse Halla366a512015-11-19 22:30:07 -08003572 // }
Jesse Halld27f6aa2015-08-15 17:58:48 -07003573
3574 return ?
3575}
3576
3577@threadSafety("system")
3578cmd VkResult vkQueueWaitIdle(
3579 VkQueue queue) {
3580 queueObject := GetQueue(queue)
3581
3582 return ?
3583}
3584
3585@threadSafety("system")
3586cmd VkResult vkDeviceWaitIdle(
3587 VkDevice device) {
3588 deviceObject := GetDevice(device)
3589
3590 return ?
3591}
3592
3593
3594// Memory functions
3595
3596@threadSafety("system")
Jesse Hall3fbc8562015-11-29 22:10:52 -08003597cmd VkResult vkAllocateMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003598 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003599 const VkMemoryAllocateInfo* pAllocateInfo,
3600 const VkAllocationCallbacks* pAllocator,
3601 VkDeviceMemory* pMemory) {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08003602 assert(pAllocateInfo.sType == VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003603 deviceObject := GetDevice(device)
3604
Jesse Hall3fbc8562015-11-29 22:10:52 -08003605 memory := ?
3606 pMemory[0] = memory
3607 State.DeviceMemories[memory] = new!DeviceMemoryObject(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003608 device: device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003609 allocationSize: pAllocateInfo[0].allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003610
3611 return ?
3612}
3613
3614@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003615cmd void vkFreeMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003616 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003617 VkDeviceMemory memory,
3618 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003619 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003620 memoryObject := GetDeviceMemory(memory)
3621 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003622
3623 // Check that no objects are still bound before freeing.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003624 validate("MemoryCheck", len(memoryObject.boundObjects) == 0,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003625 "vkFreeMemory: objects still bound")
Jesse Hall3fbc8562015-11-29 22:10:52 -08003626 validate("MemoryCheck", len(memoryObject.boundCommandBuffers) == 0,
3627 "vkFreeMemory: commandBuffers still bound")
3628 State.DeviceMemories[memory] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003629}
3630
3631@threadSafety("app")
3632cmd VkResult vkMapMemory(
3633 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003634 VkDeviceMemory memory,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003635 VkDeviceSize offset,
3636 VkDeviceSize size,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003637 VkMemoryMapFlags flags,
3638 void** ppData) {
3639 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003640 memoryObject := GetDeviceMemory(memory)
3641 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003642
3643 assert(flags == as!VkMemoryMapFlags(0))
Jesse Hall3fbc8562015-11-29 22:10:52 -08003644 assert((offset + size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003645
3646 return ?
3647}
3648
3649@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003650cmd void vkUnmapMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003651 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003652 VkDeviceMemory memory) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003653 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003654 memoryObject := GetDeviceMemory(memory)
3655 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003656}
3657
3658cmd VkResult vkFlushMappedMemoryRanges(
3659 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003660 u32 memoryRangeCount
3661 const VkMappedMemoryRange* pMemoryRanges) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003662 deviceObject := GetDevice(device)
3663
Jesse Hall3fbc8562015-11-29 22:10:52 -08003664 memoryRanges := pMemoryRanges[0:memoryRangeCount]
3665 for i in (0 .. memoryRangeCount) {
3666 memoryRange := memoryRanges[i]
3667 memoryObject := GetDeviceMemory(memoryRange.memory)
3668 assert(memoryObject.device == device)
3669 assert((memoryRange.offset + memoryRange.size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003670 }
3671
3672 return ?
3673}
3674
3675cmd VkResult vkInvalidateMappedMemoryRanges(
3676 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003677 u32 memoryRangeCount,
3678 const VkMappedMemoryRange* pMemoryRanges) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003679 deviceObject := GetDevice(device)
3680
Jesse Hall3fbc8562015-11-29 22:10:52 -08003681 memoryRanges := pMemoryRanges[0:memoryRangeCount]
3682 for i in (0 .. memoryRangeCount) {
3683 memoryRange := memoryRanges[i]
3684 memoryObject := GetDeviceMemory(memoryRange.memory)
3685 assert(memoryObject.device == device)
3686 assert((memoryRange.offset + memoryRange.size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003687 }
3688
3689 return ?
3690}
3691
3692
3693// Memory management API functions
3694
Jesse Hall606a54e2015-11-19 22:17:28 -08003695cmd void vkGetDeviceMemoryCommitment(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003696 VkDevice device,
3697 VkDeviceMemory memory,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003698 VkDeviceSize* pCommittedMemoryInBytes) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003699 deviceObject := GetDevice(device)
3700
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003701 if memory != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003702 memoryObject := GetDeviceMemory(memory)
3703 assert(memoryObject.device == device)
3704 }
3705
3706 committedMemoryInBytes := ?
3707 pCommittedMemoryInBytes[0] = committedMemoryInBytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07003708}
3709
Jesse Hall606a54e2015-11-19 22:17:28 -08003710cmd void vkGetBufferMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003711 VkDevice device,
3712 VkBuffer buffer,
3713 VkMemoryRequirements* pMemoryRequirements) {
3714 deviceObject := GetDevice(device)
3715 bufferObject := GetBuffer(buffer)
3716 assert(bufferObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003717}
3718
3719cmd VkResult vkBindBufferMemory(
3720 VkDevice device,
3721 VkBuffer buffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003722 VkDeviceMemory memory,
3723 VkDeviceSize memoryOffset) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003724 deviceObject := GetDevice(device)
3725 bufferObject := GetBuffer(buffer)
3726 assert(bufferObject.device == device)
3727
3728 // Unbind buffer from previous memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003729 if bufferObject.memory != NULL_HANDLE {
3730 memoryObject := GetDeviceMemory(bufferObject.memory)
3731 memoryObject.boundObjects[as!u64(buffer)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003732 }
3733
3734 // Bind buffer to given memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003735 if memory != NULL_HANDLE {
3736 memoryObject := GetDeviceMemory(memory)
3737 assert(memoryObject.device == device)
3738 memoryObject.boundObjects[as!u64(buffer)] = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003739 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08003740 bufferObject.memory = memory
3741 bufferObject.memoryOffset = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003742
3743 return ?
3744}
3745
Jesse Hall606a54e2015-11-19 22:17:28 -08003746cmd void vkGetImageMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003747 VkDevice device,
3748 VkImage image,
3749 VkMemoryRequirements* pMemoryRequirements) {
3750 deviceObject := GetDevice(device)
3751 imageObject := GetImage(image)
3752 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003753}
3754
3755cmd VkResult vkBindImageMemory(
3756 VkDevice device,
3757 VkImage image,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003758 VkDeviceMemory memory,
3759 VkDeviceSize memoryOffset) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003760 deviceObject := GetDevice(device)
3761 imageObject := GetImage(image)
3762 assert(imageObject.device == device)
3763
3764 // Unbind image from previous memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003765 if imageObject.memory != NULL_HANDLE {
3766 memoryObject := GetDeviceMemory(imageObject.memory)
3767 memoryObject.boundObjects[as!u64(image)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003768 }
3769
3770 // Bind image to given memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003771 if memory != NULL_HANDLE {
3772 memoryObject := GetDeviceMemory(memory)
3773 assert(memoryObject.device == device)
3774 memoryObject.boundObjects[as!u64(image)] = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003775 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08003776 imageObject.memory = memory
3777 imageObject.memoryOffset = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003778
3779 return ?
3780}
3781
Jesse Hall606a54e2015-11-19 22:17:28 -08003782cmd void vkGetImageSparseMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003783 VkDevice device,
3784 VkImage image,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003785 u32* pSparseMemoryRequirementCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003786 VkSparseImageMemoryRequirements* pSparseMemoryRequirements) {
3787 deviceObject := GetDevice(device)
3788 imageObject := GetImage(image)
3789 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003790}
3791
Jesse Hall606a54e2015-11-19 22:17:28 -08003792cmd void vkGetPhysicalDeviceSparseImageFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003793 VkPhysicalDevice physicalDevice,
3794 VkFormat format,
3795 VkImageType type,
Jesse Hall091ed9e2015-11-30 00:55:29 -08003796 VkSampleCountFlagBits samples,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003797 VkImageUsageFlags usage,
3798 VkImageTiling tiling,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003799 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003800 VkSparseImageFormatProperties* pProperties) {
3801 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003802}
3803
Jesse Halla6429252015-11-29 18:59:42 -08003804cmd VkResult vkQueueBindSparse(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003805 VkQueue queue,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003806 u32 bindInfoCount,
Jesse Halla6429252015-11-29 18:59:42 -08003807 const VkBindSparseInfo* pBindInfo,
3808 VkFence fence) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003809 queueObject := GetQueue(queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003810
3811 return ?
3812}
3813
3814
3815// Fence functions
3816
3817@threadSafety("system")
3818cmd VkResult vkCreateFence(
3819 VkDevice device,
3820 const VkFenceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003821 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003822 VkFence* pFence) {
3823 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_FENCE_CREATE_INFO)
3824 deviceObject := GetDevice(device)
3825
3826 fence := ?
3827 pFence[0] = fence
3828 State.Fences[fence] = new!FenceObject(
Jesse Halld8bade02015-11-24 10:24:18 -08003829 device: device, signaled: (pCreateInfo.flags == as!VkFenceCreateFlags(VK_FENCE_CREATE_SIGNALED_BIT)))
Jesse Halld27f6aa2015-08-15 17:58:48 -07003830
3831 return ?
3832}
3833
3834@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003835cmd void vkDestroyFence(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003836 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003837 VkFence fence,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003838 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003839 deviceObject := GetDevice(device)
3840 fenceObject := GetFence(fence)
3841 assert(fenceObject.device == device)
3842
3843 State.Fences[fence] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003844}
3845
3846@threadSafety("system")
3847cmd VkResult vkResetFences(
3848 VkDevice device,
3849 u32 fenceCount,
3850 const VkFence* pFences) {
3851 deviceObject := GetDevice(device)
3852
3853 fences := pFences[0:fenceCount]
3854 for i in (0 .. fenceCount) {
3855 fence := fences[i]
3856 fenceObject := GetFence(fence)
3857 assert(fenceObject.device == device)
3858 fenceObject.signaled = false
3859 }
3860
3861 return ?
3862}
3863
3864@threadSafety("system")
3865cmd VkResult vkGetFenceStatus(
3866 VkDevice device,
3867 VkFence fence) {
3868 deviceObject := GetDevice(device)
3869 fenceObject := GetFence(fence)
3870 assert(fenceObject.device == device)
3871
3872 return ?
3873}
3874
3875@threadSafety("system")
3876cmd VkResult vkWaitForFences(
3877 VkDevice device,
3878 u32 fenceCount,
3879 const VkFence* pFences,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003880 VkBool32 waitAll,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003881 u64 timeout) { /// timeout in nanoseconds
3882 deviceObject := GetDevice(device)
3883
3884 fences := pFences[0:fenceCount]
3885 for i in (0 .. fenceCount) {
3886 fence := fences[i]
3887 fenceObject := GetFence(fence)
3888 assert(fenceObject.device == device)
3889 }
3890
3891 return ?
3892}
3893
3894
3895// Queue semaphore functions
3896
3897@threadSafety("system")
3898cmd VkResult vkCreateSemaphore(
3899 VkDevice device,
3900 const VkSemaphoreCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003901 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003902 VkSemaphore* pSemaphore) {
3903 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO)
3904 deviceObject := GetDevice(device)
3905
3906 semaphore := ?
3907 pSemaphore[0] = semaphore
3908 State.Semaphores[semaphore] = new!SemaphoreObject(device: device)
3909
3910 return ?
3911}
3912
3913@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003914cmd void vkDestroySemaphore(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003915 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003916 VkSemaphore semaphore,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003917 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003918 deviceObject := GetDevice(device)
3919 semaphoreObject := GetSemaphore(semaphore)
3920 assert(semaphoreObject.device == device)
3921
3922 State.Semaphores[semaphore] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003923}
3924
Jesse Halld27f6aa2015-08-15 17:58:48 -07003925
3926// Event functions
3927
3928@threadSafety("system")
3929cmd VkResult vkCreateEvent(
3930 VkDevice device,
3931 const VkEventCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003932 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003933 VkEvent* pEvent) {
3934 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_EVENT_CREATE_INFO)
3935 deviceObject := GetDevice(device)
3936
3937 event := ?
3938 pEvent[0] = event
3939 State.Events[event] = new!EventObject(device: device)
3940
3941 return ?
3942}
3943
3944@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003945cmd void vkDestroyEvent(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003946 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003947 VkEvent event,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003948 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003949 deviceObject := GetDevice(device)
3950 eventObject := GetEvent(event)
3951 assert(eventObject.device == device)
3952
3953 State.Events[event] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003954}
3955
3956@threadSafety("system")
3957cmd VkResult vkGetEventStatus(
3958 VkDevice device,
3959 VkEvent event) {
3960 deviceObject := GetDevice(device)
3961 eventObject := GetEvent(event)
3962 assert(eventObject.device == device)
3963
3964 return ?
3965}
3966
3967@threadSafety("system")
3968cmd VkResult vkSetEvent(
3969 VkDevice device,
3970 VkEvent event) {
3971 deviceObject := GetDevice(device)
3972 eventObject := GetEvent(event)
3973 assert(eventObject.device == device)
3974
3975 return ?
3976}
3977
3978@threadSafety("system")
3979cmd VkResult vkResetEvent(
3980 VkDevice device,
3981 VkEvent event) {
3982 deviceObject := GetDevice(device)
3983 eventObject := GetEvent(event)
3984 assert(eventObject.device == device)
3985
3986 return ?
3987}
3988
3989
3990// Query functions
3991
3992@threadSafety("system")
3993cmd VkResult vkCreateQueryPool(
3994 VkDevice device,
3995 const VkQueryPoolCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003996 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003997 VkQueryPool* pQueryPool) {
3998 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO)
3999 deviceObject := GetDevice(device)
4000
4001 queryPool := ?
4002 pQueryPool[0] = queryPool
4003 State.QueryPools[queryPool] = new!QueryPoolObject(device: device)
4004
4005 return ?
4006}
4007
4008@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004009cmd void vkDestroyQueryPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004010 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004011 VkQueryPool queryPool,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004012 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004013 deviceObject := GetDevice(device)
4014 queryPoolObject := GetQueryPool(queryPool)
4015 assert(queryPoolObject.device == device)
4016
4017 State.QueryPools[queryPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004018}
4019
4020@threadSafety("system")
4021cmd VkResult vkGetQueryPoolResults(
4022 VkDevice device,
4023 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004024 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004025 u32 queryCount,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004026 platform.size_t dataSize,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004027 void* pData,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004028 VkDeviceSize stride,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004029 VkQueryResultFlags flags) {
4030 deviceObject := GetDevice(device)
4031 queryPoolObject := GetQueryPool(queryPool)
4032 assert(queryPoolObject.device == device)
4033
Jesse Halld27f6aa2015-08-15 17:58:48 -07004034 data := pData[0:dataSize]
4035
4036 return ?
4037}
4038
4039// Buffer functions
4040
4041@threadSafety("system")
4042cmd VkResult vkCreateBuffer(
4043 VkDevice device,
4044 const VkBufferCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004045 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004046 VkBuffer* pBuffer) {
4047 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO)
4048 deviceObject := GetDevice(device)
4049
4050 buffer := ?
4051 pBuffer[0] = buffer
4052 State.Buffers[buffer] = new!BufferObject(device: device)
4053
4054 return ?
4055}
4056
4057@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004058cmd void vkDestroyBuffer(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004059 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004060 VkBuffer buffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004061 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004062 deviceObject := GetDevice(device)
4063 bufferObject := GetBuffer(buffer)
4064 assert(bufferObject.device == device)
4065
Jesse Hall3fbc8562015-11-29 22:10:52 -08004066 assert(bufferObject.memory == 0)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004067 State.Buffers[buffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004068}
4069
4070
4071// Buffer view functions
4072
4073@threadSafety("system")
4074cmd VkResult vkCreateBufferView(
4075 VkDevice device,
4076 const VkBufferViewCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004077 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004078 VkBufferView* pView) {
4079 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO)
4080 deviceObject := GetDevice(device)
4081
4082 bufferObject := GetBuffer(pCreateInfo.buffer)
4083 assert(bufferObject.device == device)
4084
4085 view := ?
4086 pView[0] = view
4087 State.BufferViews[view] = new!BufferViewObject(device: device, buffer: pCreateInfo.buffer)
4088
4089 return ?
4090}
4091
4092@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004093cmd void vkDestroyBufferView(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004094 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004095 VkBufferView bufferView,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004096 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004097 deviceObject := GetDevice(device)
4098 bufferViewObject := GetBufferView(bufferView)
4099 assert(bufferViewObject.device == device)
4100
4101 State.BufferViews[bufferView] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004102}
4103
4104
4105// Image functions
4106
4107@threadSafety("system")
4108cmd VkResult vkCreateImage(
4109 VkDevice device,
4110 const VkImageCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004111 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004112 VkImage* pImage) {
4113 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO)
4114 deviceObject := GetDevice(device)
4115
4116 image := ?
4117 pImage[0] = image
4118 State.Images[image] = new!ImageObject(device: device)
4119
4120 return ?
4121}
4122
4123@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004124cmd void vkDestroyImage(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004125 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004126 VkImage image,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004127 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004128 deviceObject := GetDevice(device)
4129 imageObject := GetImage(image)
4130 assert(imageObject.device == device)
4131
Jesse Hall3fbc8562015-11-29 22:10:52 -08004132 assert(imageObject.memory == 0)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004133 State.Images[image] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004134}
4135
Jesse Hall606a54e2015-11-19 22:17:28 -08004136cmd void vkGetImageSubresourceLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004137 VkDevice device,
4138 VkImage image,
4139 const VkImageSubresource* pSubresource,
4140 VkSubresourceLayout* pLayout) {
4141 deviceObject := GetDevice(device)
4142 imageObject := GetImage(image)
4143 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004144}
4145
4146
4147// Image view functions
4148
4149@threadSafety("system")
4150cmd VkResult vkCreateImageView(
4151 VkDevice device,
4152 const VkImageViewCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004153 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004154 VkImageView* pView) {
4155 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO)
4156 deviceObject := GetDevice(device)
4157
4158 imageObject := GetImage(pCreateInfo.image)
4159 assert(imageObject.device == device)
4160
4161 view := ?
4162 pView[0] = view
4163 State.ImageViews[view] = new!ImageViewObject(device: device, image: pCreateInfo.image)
4164
4165 return ?
4166}
4167
4168@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004169cmd void vkDestroyImageView(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004170 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004171 VkImageView imageView,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004172 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004173 deviceObject := GetDevice(device)
4174 imageViewObject := GetImageView(imageView)
4175 assert(imageViewObject.device == device)
4176
4177 State.ImageViews[imageView] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004178}
4179
4180
4181// Shader functions
4182
4183cmd VkResult vkCreateShaderModule(
4184 VkDevice device,
4185 const VkShaderModuleCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004186 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004187 VkShaderModule* pShaderModule) {
4188 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO)
4189 deviceObject := GetDevice(device)
4190
4191 shaderModule := ?
4192 pShaderModule[0] = shaderModule
4193 State.ShaderModules[shaderModule] = new!ShaderModuleObject(device: device)
4194
4195 return ?
4196}
4197
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004198cmd void vkDestroyShaderModule(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004199 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004200 VkShaderModule shaderModule,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004201 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004202 deviceObject := GetDevice(device)
4203 shaderModuleObject := GetShaderModule(shaderModule)
4204 assert(shaderModuleObject.device == device)
4205
4206 State.ShaderModules[shaderModule] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004207}
4208
Jesse Halld27f6aa2015-08-15 17:58:48 -07004209
4210// Pipeline functions
4211
4212cmd VkResult vkCreatePipelineCache(
4213 VkDevice device,
4214 const VkPipelineCacheCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004215 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004216 VkPipelineCache* pPipelineCache) {
4217 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO)
4218 deviceObject := GetDevice(device)
4219
4220 pipelineCache := ?
4221 pPipelineCache[0] = pipelineCache
4222 State.PipelineCaches[pipelineCache] = new!PipelineCacheObject(device: device)
4223
4224 return ?
4225}
4226
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004227cmd void vkDestroyPipelineCache(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004228 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004229 VkPipelineCache pipelineCache,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004230 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004231 deviceObject := GetDevice(device)
4232 pipelineCacheObject := GetPipelineCache(pipelineCache)
4233 assert(pipelineCacheObject.device == device)
4234
4235 State.PipelineCaches[pipelineCache] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004236}
4237
Jesse Halld27f6aa2015-08-15 17:58:48 -07004238cmd VkResult vkGetPipelineCacheData(
4239 VkDevice device,
4240 VkPipelineCache pipelineCache,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004241 platform.size_t* pDataSize,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004242 void* pData) {
4243 deviceObject := GetDevice(device)
4244 pipelineCacheObject := GetPipelineCache(pipelineCache)
4245 assert(pipelineCacheObject.device == device)
4246
4247 return ?
4248}
4249
4250cmd VkResult vkMergePipelineCaches(
4251 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004252 VkPipelineCache dstCache,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004253 u32 srcCacheCount,
4254 const VkPipelineCache* pSrcCaches) {
4255 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004256 dstCacheObject := GetPipelineCache(dstCache)
4257 assert(dstCacheObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004258
4259 srcCaches := pSrcCaches[0:srcCacheCount]
4260 for i in (0 .. srcCacheCount) {
4261 srcCache := srcCaches[i]
4262 srcCacheObject := GetPipelineCache(srcCache)
4263 assert(srcCacheObject.device == device)
4264 }
4265
4266 return ?
4267}
4268
4269cmd VkResult vkCreateGraphicsPipelines(
4270 VkDevice device,
4271 VkPipelineCache pipelineCache,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004272 u32 createInfoCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004273 const VkGraphicsPipelineCreateInfo* pCreateInfos,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004274 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004275 VkPipeline* pPipelines) {
4276 deviceObject := GetDevice(device)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004277 if pipelineCache != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004278 pipelineCacheObject := GetPipelineCache(pipelineCache)
4279 assert(pipelineCacheObject.device == device)
4280 }
4281
Jesse Hall03b6fe12015-11-24 12:44:21 -08004282 createInfos := pCreateInfos[0:createInfoCount]
4283 pipelines := pPipelines[0:createInfoCount]
4284 for i in (0 .. createInfoCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004285 pipeline := ?
4286 pipelines[i] = pipeline
4287 State.Pipelines[pipeline] = new!PipelineObject(device: device)
4288 }
4289
4290 return ?
4291}
4292
4293cmd VkResult vkCreateComputePipelines(
4294 VkDevice device,
4295 VkPipelineCache pipelineCache,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004296 u32 createInfoCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004297 const VkComputePipelineCreateInfo* pCreateInfos,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004298 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004299 VkPipeline* pPipelines) {
4300 deviceObject := GetDevice(device)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004301 if pipelineCache != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004302 pipelineCacheObject := GetPipelineCache(pipelineCache)
4303 assert(pipelineCacheObject.device == device)
4304 }
4305
Jesse Hall03b6fe12015-11-24 12:44:21 -08004306 createInfos := pCreateInfos[0:createInfoCount]
4307 pipelines := pPipelines[0:createInfoCount]
4308 for i in (0 .. createInfoCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004309 pipeline := ?
4310 pipelines[i] = pipeline
4311 State.Pipelines[pipeline] = new!PipelineObject(device: device)
4312 }
4313
4314 return ?
4315}
4316
4317@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004318cmd void vkDestroyPipeline(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004319 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004320 VkPipeline pipeline,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004321 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004322 deviceObject := GetDevice(device)
4323 pipelineObjects := GetPipeline(pipeline)
4324 assert(pipelineObjects.device == device)
4325
4326 State.Pipelines[pipeline] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004327}
4328
4329
4330// Pipeline layout functions
4331
4332@threadSafety("system")
4333cmd VkResult vkCreatePipelineLayout(
4334 VkDevice device,
4335 const VkPipelineLayoutCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004336 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004337 VkPipelineLayout* pPipelineLayout) {
4338 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO)
4339 deviceObject := GetDevice(device)
4340
4341 pipelineLayout := ?
4342 pPipelineLayout[0] = pipelineLayout
4343 State.PipelineLayouts[pipelineLayout] = new!PipelineLayoutObject(device: device)
4344
4345 return ?
4346}
4347
4348@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004349cmd void vkDestroyPipelineLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004350 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004351 VkPipelineLayout pipelineLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004352 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004353 deviceObject := GetDevice(device)
4354 pipelineLayoutObjects := GetPipelineLayout(pipelineLayout)
4355 assert(pipelineLayoutObjects.device == device)
4356
4357 State.PipelineLayouts[pipelineLayout] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004358}
4359
4360
4361// Sampler functions
4362
4363@threadSafety("system")
4364cmd VkResult vkCreateSampler(
4365 VkDevice device,
4366 const VkSamplerCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004367 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004368 VkSampler* pSampler) {
4369 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO)
4370 deviceObject := GetDevice(device)
4371
4372 sampler := ?
4373 pSampler[0] = sampler
4374 State.Samplers[sampler] = new!SamplerObject(device: device)
4375
4376 return ?
4377}
4378
4379@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004380cmd void vkDestroySampler(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004381 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004382 VkSampler sampler,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004383 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004384 deviceObject := GetDevice(device)
4385 samplerObject := GetSampler(sampler)
4386 assert(samplerObject.device == device)
4387
4388 State.Samplers[sampler] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004389}
4390
4391
4392// Descriptor set functions
4393
4394@threadSafety("system")
4395cmd VkResult vkCreateDescriptorSetLayout(
4396 VkDevice device,
4397 const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004398 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004399 VkDescriptorSetLayout* pSetLayout) {
4400 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO)
4401 deviceObject := GetDevice(device)
4402
4403 setLayout := ?
4404 pSetLayout[0] = setLayout
4405 State.DescriptorSetLayouts[setLayout] = new!DescriptorSetLayoutObject(device: device)
4406
4407 return ?
4408}
4409
4410@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004411cmd void vkDestroyDescriptorSetLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004412 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004413 VkDescriptorSetLayout descriptorSetLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004414 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004415 deviceObject := GetDevice(device)
4416 descriptorSetLayoutObject := GetDescriptorSetLayout(descriptorSetLayout)
4417 assert(descriptorSetLayoutObject.device == device)
4418
4419 State.DescriptorSetLayouts[descriptorSetLayout] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004420}
4421
4422@threadSafety("system")
4423cmd VkResult vkCreateDescriptorPool(
4424 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004425 const VkDescriptorPoolCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004426 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004427 VkDescriptorPool* pDescriptorPool) {
4428 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO)
4429 deviceObject := GetDevice(device)
4430
4431 descriptorPool := ?
4432 pDescriptorPool[0] = descriptorPool
4433 State.DescriptorPools[descriptorPool] = new!DescriptorPoolObject(device: device)
4434
4435 return ?
4436}
4437
4438@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004439cmd void vkDestroyDescriptorPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004440 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004441 VkDescriptorPool descriptorPool,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004442 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004443 deviceObject := GetDevice(device)
4444 descriptorPoolObject := GetDescriptorPool(descriptorPool)
4445 assert(descriptorPoolObject.device == device)
4446
4447 State.DescriptorPools[descriptorPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004448}
4449
4450@threadSafety("app")
4451cmd VkResult vkResetDescriptorPool(
4452 VkDevice device,
Jesse Hallfbf97b02015-11-20 14:17:03 -08004453 VkDescriptorPool descriptorPool,
4454 VkDescriptorPoolResetFlags flags) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004455 deviceObject := GetDevice(device)
4456 descriptorPoolObject := GetDescriptorPool(descriptorPool)
4457 assert(descriptorPoolObject.device == device)
4458
4459 return ?
4460}
4461
4462@threadSafety("app")
Jesse Hall3fbc8562015-11-29 22:10:52 -08004463cmd VkResult vkAllocateDescriptorSets(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004464 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004465 const VkDescriptorSetAllocateInfo* pAllocateInfo,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004466 VkDescriptorSet* pDescriptorSets) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004467 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004468 allocInfo := pAllocateInfo[0]
Jesse Hallfbf97b02015-11-20 14:17:03 -08004469 descriptorPoolObject := GetDescriptorPool(allocInfo.descriptorPool)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004470
Jesse Hall03b6fe12015-11-24 12:44:21 -08004471 setLayouts := allocInfo.pSetLayouts[0:allocInfo.setCount]
4472 for i in (0 .. allocInfo.setCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004473 setLayout := setLayouts[i]
4474 setLayoutObject := GetDescriptorSetLayout(setLayout)
4475 assert(setLayoutObject.device == device)
4476 }
4477
Jesse Hall03b6fe12015-11-24 12:44:21 -08004478 descriptorSets := pDescriptorSets[0:allocInfo.setCount]
4479 for i in (0 .. allocInfo.setCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004480 descriptorSet := ?
4481 descriptorSets[i] = descriptorSet
4482 State.DescriptorSets[descriptorSet] = new!DescriptorSetObject(device: device)
4483 }
4484
4485 return ?
4486}
4487
Jesse Hallf09c6b12015-08-15 19:54:28 -07004488cmd VkResult vkFreeDescriptorSets(
4489 VkDevice device,
4490 VkDescriptorPool descriptorPool,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004491 u32 descriptorSetCount,
Jesse Hallf09c6b12015-08-15 19:54:28 -07004492 const VkDescriptorSet* pDescriptorSets) {
4493 deviceObject := GetDevice(device)
4494 descriptorPoolObject := GetDescriptorPool(descriptorPool)
4495
Jesse Hall03b6fe12015-11-24 12:44:21 -08004496 descriptorSets := pDescriptorSets[0:descriptorSetCount]
4497 for i in (0 .. descriptorSetCount) {
Jesse Hallf09c6b12015-08-15 19:54:28 -07004498 descriptorSet := descriptorSets[i]
4499 descriptorSetObject := GetDescriptorSet(descriptorSet)
4500 assert(descriptorSetObject.device == device)
4501 State.DescriptorSets[descriptorSet] = null
4502 }
4503
4504 return ?
4505}
4506
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004507cmd void vkUpdateDescriptorSets(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004508 VkDevice device,
Jesse Hallb00daad2015-11-29 19:46:20 -08004509 u32 descriptorWriteCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004510 const VkWriteDescriptorSet* pDescriptorWrites,
Jesse Hallb00daad2015-11-29 19:46:20 -08004511 u32 descriptorCopyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004512 const VkCopyDescriptorSet* pDescriptorCopies) {
4513 deviceObject := GetDevice(device)
4514
Jesse Hallb00daad2015-11-29 19:46:20 -08004515 descriptorWrites := pDescriptorWrites[0:descriptorWriteCount]
4516 for i in (0 .. descriptorWriteCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004517 descriptorWrite := descriptorWrites[i]
Jesse Hall3fbc8562015-11-29 22:10:52 -08004518 descriptorWriteObject := GetDescriptorSet(descriptorWrite.dstSet)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004519 assert(descriptorWriteObject.device == device)
4520 }
4521
Jesse Hallb00daad2015-11-29 19:46:20 -08004522 descriptorCopies := pDescriptorCopies[0:descriptorCopyCount]
4523 for i in (0 .. descriptorCopyCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004524 descriptorCopy := descriptorCopies[i]
Jesse Hall3fbc8562015-11-29 22:10:52 -08004525 descriptorCopyObject := GetDescriptorSet(descriptorCopy.dstSet)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004526 assert(descriptorCopyObject.device == device)
4527 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07004528}
4529
4530
4531// Framebuffer functions
4532
4533@threadSafety("system")
4534cmd VkResult vkCreateFramebuffer(
4535 VkDevice device,
4536 const VkFramebufferCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004537 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004538 VkFramebuffer* pFramebuffer) {
4539 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO)
4540 deviceObject := GetDevice(device)
4541
4542 framebuffer := ?
4543 pFramebuffer[0] = framebuffer
4544 State.Framebuffers[framebuffer] = new!FramebufferObject(device: device)
4545
4546 return ?
4547}
4548
4549@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004550cmd void vkDestroyFramebuffer(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004551 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004552 VkFramebuffer framebuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004553 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004554 deviceObject := GetDevice(device)
4555 framebufferObject := GetFramebuffer(framebuffer)
4556 assert(framebufferObject.device == device)
4557
4558 State.Framebuffers[framebuffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004559}
4560
4561
4562// Renderpass functions
4563
4564@threadSafety("system")
4565cmd VkResult vkCreateRenderPass(
4566 VkDevice device,
4567 const VkRenderPassCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004568 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004569 VkRenderPass* pRenderPass) {
4570 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO)
4571 deviceObject := GetDevice(device)
4572
4573 renderpass := ?
4574 pRenderPass[0] = renderpass
4575 State.RenderPasses[renderpass] = new!RenderPassObject(device: device)
4576
4577 return ?
4578}
4579
4580@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004581cmd void vkDestroyRenderPass(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004582 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004583 VkRenderPass renderPass,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004584 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004585 deviceObject := GetDevice(device)
4586 renderPassObject := GetRenderPass(renderPass)
4587 assert(renderPassObject.device == device)
4588
4589 State.RenderPasses[renderPass] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004590}
4591
Jesse Hall606a54e2015-11-19 22:17:28 -08004592cmd void vkGetRenderAreaGranularity(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004593 VkDevice device,
4594 VkRenderPass renderPass,
4595 VkExtent2D* pGranularity) {
4596 deviceObject := GetDevice(device)
4597 renderPassObject := GetRenderPass(renderPass)
4598
4599 granularity := ?
4600 pGranularity[0] = granularity
Jesse Halld27f6aa2015-08-15 17:58:48 -07004601}
4602
4603// Command pool functions
4604
4605cmd VkResult vkCreateCommandPool(
4606 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004607 const VkCommandPoolCreateInfo* pCreateInfo,
4608 const VkAllocationCallbacks* pAllocator,
4609 VkCommandPool* pCommandPool) {
4610 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004611 deviceObject := GetDevice(device)
4612
Jesse Hall3fbc8562015-11-29 22:10:52 -08004613 commandPool := ?
4614 pCommandPool[0] = commandPool
4615 State.CommandPools[commandPool] = new!CommandPoolObject(device: device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004616
4617 return ?
4618}
4619
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004620cmd void vkDestroyCommandPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004621 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004622 VkCommandPool commandPool,
4623 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004624 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004625 commandPoolObject := GetCommandPool(commandPool)
4626 assert(commandPoolObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004627
Jesse Hall3fbc8562015-11-29 22:10:52 -08004628 State.CommandPools[commandPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004629}
4630
4631cmd VkResult vkResetCommandPool(
4632 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004633 VkCommandPool commandPool,
4634 VkCommandPoolResetFlags flags) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004635 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004636 commandPoolObject := GetCommandPool(commandPool)
4637 assert(commandPoolObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004638
4639 return ?
4640}
4641
4642// Command buffer functions
4643
Jesse Hall3fbc8562015-11-29 22:10:52 -08004644macro void bindCommandBuffer(VkCommandBuffer commandBuffer, any obj, VkDeviceMemory memory) {
4645 memoryObject := GetDeviceMemory(memory)
4646 memoryObject.boundCommandBuffers[commandBuffer] = commandBuffer
Jesse Halld27f6aa2015-08-15 17:58:48 -07004647
Jesse Hall3fbc8562015-11-29 22:10:52 -08004648 commandBufferObject := GetCommandBuffer(commandBuffer)
4649 commandBufferObject.boundObjects[as!u64(obj)] = memory
Jesse Halld27f6aa2015-08-15 17:58:48 -07004650}
4651
Jesse Hall3fbc8562015-11-29 22:10:52 -08004652macro void unbindCommandBuffer(VkCommandBuffer commandBuffer, any obj, VkDeviceMemory memory) {
4653 memoryObject := GetDeviceMemory(memory)
4654 memoryObject.boundCommandBuffers[commandBuffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004655
Jesse Hall3fbc8562015-11-29 22:10:52 -08004656 commandBufferObject := GetCommandBuffer(commandBuffer)
4657 commandBufferObject.boundObjects[as!u64(obj)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004658}
4659
4660@threadSafety("system")
Jesse Hall3fbc8562015-11-29 22:10:52 -08004661cmd VkResult vkAllocateCommandBuffers(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004662 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004663 const VkCommandBufferAllocateInfo* pAllocateInfo,
4664 VkCommandBuffer* pCommandBuffers) {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08004665 assert(pAllocateInfo[0].sType == VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004666
Jesse Hall3dd678a2016-01-08 21:52:01 -08004667 count := pAllocateInfo[0].commandBufferCount
Jesse Hall3fbc8562015-11-29 22:10:52 -08004668 commandBuffers := pCommandBuffers[0:count]
Jesse Hallfbf97b02015-11-20 14:17:03 -08004669 for i in (0 .. count) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004670 commandBuffer := ?
4671 commandBuffers[i] = commandBuffer
4672 State.CommandBuffers[commandBuffer] = new!CommandBufferObject(device: device)
Jesse Hallfbf97b02015-11-20 14:17:03 -08004673 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07004674
4675 return ?
4676}
4677
4678@threadSafety("system")
Jesse Hallfbf97b02015-11-20 14:17:03 -08004679cmd void vkFreeCommandBuffers(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004680 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004681 VkCommandPool commandPool,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004682 u32 commandBufferCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004683 const VkCommandBuffer* pCommandBuffers) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004684 deviceObject := GetDevice(device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004685
Jesse Hall3fbc8562015-11-29 22:10:52 -08004686 commandBuffers := pCommandBuffers[0:commandBufferCount]
Jesse Hall03b6fe12015-11-24 12:44:21 -08004687 for i in (0 .. commandBufferCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004688 commandBufferObject := GetCommandBuffer(commandBuffers[i])
4689 assert(commandBufferObject.device == device)
Jesse Hallfbf97b02015-11-20 14:17:03 -08004690 // TODO: iterate over boundObjects and clear memory bindings
Jesse Hall3fbc8562015-11-29 22:10:52 -08004691 State.CommandBuffers[commandBuffers[i]] = null
Jesse Hallfbf97b02015-11-20 14:17:03 -08004692 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07004693}
4694
4695@threadSafety("app")
4696cmd VkResult vkBeginCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004697 VkCommandBuffer commandBuffer,
4698 const VkCommandBufferBeginInfo* pBeginInfo) {
4699 assert(pBeginInfo.sType == VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO)
4700 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004701
4702 // TODO: iterate over boundObjects and clear memory bindings
4703
4704 return ?
4705}
4706
4707@threadSafety("app")
4708cmd VkResult vkEndCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004709 VkCommandBuffer commandBuffer) {
4710 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004711
4712 return ?
4713}
4714
4715@threadSafety("app")
4716cmd VkResult vkResetCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004717 VkCommandBuffer commandBuffer,
4718 VkCommandBufferResetFlags flags) {
4719 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004720
4721 // TODO: iterate over boundObjects and clear memory bindings
4722
4723 return ?
4724}
4725
4726
4727// Command buffer building functions
4728
4729@threadSafety("app")
4730cmd void vkCmdBindPipeline(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004731 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004732 VkPipelineBindPoint pipelineBindPoint,
4733 VkPipeline pipeline) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004734 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004735 pipelineObject := GetPipeline(pipeline)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004736 assert(commandBufferObject.device == pipelineObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004737
Jesse Halld8bade02015-11-24 10:24:18 -08004738 queue := switch (pipelineBindPoint) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004739 case VK_PIPELINE_BIND_POINT_COMPUTE: VK_QUEUE_COMPUTE_BIT
4740 case VK_PIPELINE_BIND_POINT_GRAPHICS: VK_QUEUE_GRAPHICS_BIT
4741 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08004742 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004743}
4744
4745@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004746cmd void vkCmdSetViewport(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004747 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004748 u32 firstViewport,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004749 u32 viewportCount,
4750 const VkViewport* pViewports) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004751 commandBufferObject := GetCommandBuffer(commandBuffer)
4752 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004753}
4754
4755@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004756cmd void vkCmdSetScissor(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004757 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004758 u32 firstScissor,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004759 u32 scissorCount,
4760 const VkRect2D* pScissors) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004761 commandBufferObject := GetCommandBuffer(commandBuffer)
4762 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004763}
4764
4765@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004766cmd void vkCmdSetLineWidth(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004767 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004768 f32 lineWidth) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004769 commandBufferObject := GetCommandBuffer(commandBuffer)
4770 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004771}
4772
4773@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004774cmd void vkCmdSetDepthBias(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004775 VkCommandBuffer commandBuffer,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004776 f32 depthBiasConstantFactor,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004777 f32 depthBiasClamp,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004778 f32 depthBiasSlopeFactor) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004779 commandBufferObject := GetCommandBuffer(commandBuffer)
4780 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004781}
Jesse Halld27f6aa2015-08-15 17:58:48 -07004782
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004783@threadSafety("app")
4784cmd void vkCmdSetBlendConstants(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004785 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004786 // TODO(jessehall): apic only supports 'const' on pointer types. Using
4787 // an annotation as a quick hack to pass this to the template without
4788 // having to modify the AST and semantic model.
Jesse Hallb00daad2015-11-29 19:46:20 -08004789 @readonly f32[4] blendConstants) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004790 commandBufferObject := GetCommandBuffer(commandBuffer)
4791 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004792}
4793
4794@threadSafety("app")
4795cmd void vkCmdSetDepthBounds(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004796 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004797 f32 minDepthBounds,
4798 f32 maxDepthBounds) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004799 commandBufferObject := GetCommandBuffer(commandBuffer)
4800 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004801}
4802
4803@threadSafety("app")
4804cmd void vkCmdSetStencilCompareMask(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004805 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004806 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08004807 u32 compareMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004808 commandBufferObject := GetCommandBuffer(commandBuffer)
4809 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004810}
4811
4812@threadSafety("app")
4813cmd void vkCmdSetStencilWriteMask(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004814 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004815 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08004816 u32 writeMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004817 commandBufferObject := GetCommandBuffer(commandBuffer)
4818 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004819}
4820
4821@threadSafety("app")
4822cmd void vkCmdSetStencilReference(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004823 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004824 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08004825 u32 reference) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004826 commandBufferObject := GetCommandBuffer(commandBuffer)
4827 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004828}
4829
4830@threadSafety("app")
4831cmd void vkCmdBindDescriptorSets(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004832 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004833 VkPipelineBindPoint pipelineBindPoint,
4834 VkPipelineLayout layout,
4835 u32 firstSet,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004836 u32 descriptorSetCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004837 const VkDescriptorSet* pDescriptorSets,
4838 u32 dynamicOffsetCount,
4839 const u32* pDynamicOffsets) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004840 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004841
Jesse Hall03b6fe12015-11-24 12:44:21 -08004842 descriptorSets := pDescriptorSets[0:descriptorSetCount]
4843 for i in (0 .. descriptorSetCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004844 descriptorSet := descriptorSets[i]
4845 descriptorSetObject := GetDescriptorSet(descriptorSet)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004846 assert(commandBufferObject.device == descriptorSetObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004847 }
4848
4849 dynamicOffsets := pDynamicOffsets[0:dynamicOffsetCount]
4850 for i in (0 .. dynamicOffsetCount) {
4851 dynamicOffset := dynamicOffsets[i]
4852 }
4853
Jesse Halld8bade02015-11-24 10:24:18 -08004854 queue := switch (pipelineBindPoint) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004855 case VK_PIPELINE_BIND_POINT_COMPUTE: VK_QUEUE_COMPUTE_BIT
4856 case VK_PIPELINE_BIND_POINT_GRAPHICS: VK_QUEUE_GRAPHICS_BIT
4857 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08004858 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004859}
4860
4861@threadSafety("app")
4862cmd void vkCmdBindIndexBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004863 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004864 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004865 VkDeviceSize offset,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004866 VkIndexType indexType) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004867 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004868 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004869 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004870
Jesse Hall3fbc8562015-11-29 22:10:52 -08004871 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004872
Jesse Hall3fbc8562015-11-29 22:10:52 -08004873 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004874}
4875
4876@threadSafety("app")
4877cmd void vkCmdBindVertexBuffers(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004878 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004879 u32 firstBinding,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004880 u32 bindingCount,
4881 const VkBuffer* pBuffers,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004882 const VkDeviceSize* pOffsets) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004883 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004884
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004885 // TODO: check if not [firstBinding:firstBinding+bindingCount]
Jesse Halld27f6aa2015-08-15 17:58:48 -07004886 buffers := pBuffers[0:bindingCount]
4887 offsets := pOffsets[0:bindingCount]
4888 for i in (0 .. bindingCount) {
4889 buffer := buffers[i]
4890 offset := offsets[i]
4891 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004892 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004893
Jesse Hall3fbc8562015-11-29 22:10:52 -08004894 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004895 }
4896
Jesse Hall3fbc8562015-11-29 22:10:52 -08004897 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004898}
4899
4900@threadSafety("app")
4901cmd void vkCmdDraw(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004902 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004903 u32 vertexCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004904 u32 instanceCount,
4905 u32 firstVertex,
4906 u32 firstInstance) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004907 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004908
Jesse Hall3fbc8562015-11-29 22:10:52 -08004909 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004910}
4911
4912@threadSafety("app")
4913cmd void vkCmdDrawIndexed(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004914 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004915 u32 indexCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004916 u32 instanceCount,
4917 u32 firstIndex,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004918 s32 vertexOffset,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004919 u32 firstInstance) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004920 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004921
Jesse Hall3fbc8562015-11-29 22:10:52 -08004922 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004923}
4924
4925@threadSafety("app")
4926cmd void vkCmdDrawIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004927 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004928 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004929 VkDeviceSize offset,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004930 u32 drawCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004931 u32 stride) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004932 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004933 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004934 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004935
Jesse Hall3fbc8562015-11-29 22:10:52 -08004936 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004937
Jesse Hall3fbc8562015-11-29 22:10:52 -08004938 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004939}
4940
4941@threadSafety("app")
4942cmd void vkCmdDrawIndexedIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004943 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004944 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004945 VkDeviceSize offset,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004946 u32 drawCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004947 u32 stride) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004948 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004949 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004950 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004951
Jesse Hall3fbc8562015-11-29 22:10:52 -08004952 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004953
Jesse Hall3fbc8562015-11-29 22:10:52 -08004954 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004955}
4956
4957@threadSafety("app")
4958cmd void vkCmdDispatch(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004959 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004960 u32 x,
4961 u32 y,
4962 u32 z) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004963 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004964
Jesse Hall3fbc8562015-11-29 22:10:52 -08004965 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_COMPUTE_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004966}
4967
4968@threadSafety("app")
4969cmd void vkCmdDispatchIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004970 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004971 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004972 VkDeviceSize offset) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004973 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004974 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004975 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004976
Jesse Hall3fbc8562015-11-29 22:10:52 -08004977 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004978
Jesse Hall3fbc8562015-11-29 22:10:52 -08004979 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_COMPUTE_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004980}
4981
4982@threadSafety("app")
4983cmd void vkCmdCopyBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004984 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004985 VkBuffer srcBuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004986 VkBuffer dstBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004987 u32 regionCount,
4988 const VkBufferCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004989 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004990 srcBufferObject := GetBuffer(srcBuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004991 dstBufferObject := GetBuffer(dstBuffer)
4992 assert(commandBufferObject.device == srcBufferObject.device)
4993 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004994
4995 regions := pRegions[0:regionCount]
4996 for i in (0 .. regionCount) {
4997 region := regions[i]
4998 }
4999
Jesse Hall3fbc8562015-11-29 22:10:52 -08005000 bindCommandBuffer(commandBuffer, srcBuffer, srcBufferObject.memory)
5001 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005002
Jesse Hall65ab5522015-11-30 00:07:16 -08005003 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005004}
5005
5006@threadSafety("app")
5007cmd void vkCmdCopyImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005008 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005009 VkImage srcImage,
5010 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005011 VkImage dstImage,
5012 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005013 u32 regionCount,
5014 const VkImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005015 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005016 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005017 dstImageObject := GetImage(dstImage)
5018 assert(commandBufferObject.device == srcImageObject.device)
5019 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005020
5021 regions := pRegions[0:regionCount]
5022 for i in (0 .. regionCount) {
5023 region := regions[i]
5024 }
5025
Jesse Hall3fbc8562015-11-29 22:10:52 -08005026 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
5027 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005028
Jesse Hall65ab5522015-11-30 00:07:16 -08005029 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005030}
5031
5032@threadSafety("app")
5033cmd void vkCmdBlitImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005034 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005035 VkImage srcImage,
5036 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005037 VkImage dstImage,
5038 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005039 u32 regionCount,
5040 const VkImageBlit* pRegions,
Jesse Hall23ff73f2015-11-29 14:36:39 -08005041 VkFilter filter) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005042 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005043 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005044 dstImageObject := GetImage(dstImage)
5045 assert(commandBufferObject.device == srcImageObject.device)
5046 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005047
5048 regions := pRegions[0:regionCount]
5049 for i in (0 .. regionCount) {
5050 region := regions[i]
5051 }
5052
Jesse Hall3fbc8562015-11-29 22:10:52 -08005053 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
5054 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005055
Jesse Hall3fbc8562015-11-29 22:10:52 -08005056 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005057}
5058
5059@threadSafety("app")
5060cmd void vkCmdCopyBufferToImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005061 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005062 VkBuffer srcBuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005063 VkImage dstImage,
5064 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005065 u32 regionCount,
5066 const VkBufferImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005067 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005068 srcBufferObject := GetBuffer(srcBuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005069 dstImageObject := GetImage(dstImage)
5070 assert(commandBufferObject.device == srcBufferObject.device)
5071 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005072
5073 regions := pRegions[0:regionCount]
5074 for i in (0 .. regionCount) {
5075 region := regions[i]
5076 }
5077
Jesse Hall3fbc8562015-11-29 22:10:52 -08005078 bindCommandBuffer(commandBuffer, srcBuffer, srcBufferObject.memory)
5079 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005080
Jesse Hall65ab5522015-11-30 00:07:16 -08005081 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005082}
5083
5084@threadSafety("app")
5085cmd void vkCmdCopyImageToBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005086 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005087 VkImage srcImage,
5088 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005089 VkBuffer dstBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005090 u32 regionCount,
5091 const VkBufferImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005092 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005093 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005094 dstBufferObject := GetBuffer(dstBuffer)
5095 assert(commandBufferObject.device == srcImageObject.device)
5096 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005097
5098 regions := pRegions[0:regionCount]
5099 for i in (0 .. regionCount) {
5100 region := regions[i]
5101 }
5102
Jesse Hall3fbc8562015-11-29 22:10:52 -08005103 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
5104 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005105
Jesse Hall65ab5522015-11-30 00:07:16 -08005106 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005107}
5108
5109@threadSafety("app")
5110cmd void vkCmdUpdateBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005111 VkCommandBuffer commandBuffer,
5112 VkBuffer dstBuffer,
5113 VkDeviceSize dstOffset,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005114 VkDeviceSize dataSize,
Jesse Hall56d386a2016-07-26 15:20:40 -07005115 const void* pData) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005116 commandBufferObject := GetCommandBuffer(commandBuffer)
5117 dstBufferObject := GetBuffer(dstBuffer)
5118 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005119
5120 data := pData[0:dataSize]
5121
Jesse Hall3fbc8562015-11-29 22:10:52 -08005122 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005123
Jesse Hall65ab5522015-11-30 00:07:16 -08005124 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005125}
5126
5127@threadSafety("app")
5128cmd void vkCmdFillBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005129 VkCommandBuffer commandBuffer,
5130 VkBuffer dstBuffer,
5131 VkDeviceSize dstOffset,
Jesse Hallb00daad2015-11-29 19:46:20 -08005132 VkDeviceSize size,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005133 u32 data) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005134 commandBufferObject := GetCommandBuffer(commandBuffer)
5135 dstBufferObject := GetBuffer(dstBuffer)
5136 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005137
Jesse Hall65ab5522015-11-30 00:07:16 -08005138 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005139}
5140
5141@threadSafety("app")
5142cmd void vkCmdClearColorImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005143 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005144 VkImage image,
5145 VkImageLayout imageLayout,
5146 const VkClearColorValue* pColor,
5147 u32 rangeCount,
5148 const VkImageSubresourceRange* pRanges) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005149 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005150 imageObject := GetImage(image)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005151 assert(commandBufferObject.device == imageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005152
5153 ranges := pRanges[0:rangeCount]
5154 for i in (0 .. rangeCount) {
5155 range := ranges[i]
5156 }
5157
Jesse Hall3fbc8562015-11-29 22:10:52 -08005158 bindCommandBuffer(commandBuffer, image, imageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005159
Jesse Hall3fbc8562015-11-29 22:10:52 -08005160 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005161}
5162
5163@threadSafety("app")
5164cmd void vkCmdClearDepthStencilImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005165 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005166 VkImage image,
5167 VkImageLayout imageLayout,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005168 const VkClearDepthStencilValue* pDepthStencil,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005169 u32 rangeCount,
5170 const VkImageSubresourceRange* pRanges) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005171 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005172 imageObject := GetImage(image)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005173 assert(commandBufferObject.device == imageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005174
5175 ranges := pRanges[0:rangeCount]
5176 for i in (0 .. rangeCount) {
5177 range := ranges[i]
5178 }
5179
Jesse Hall3fbc8562015-11-29 22:10:52 -08005180 bindCommandBuffer(commandBuffer, image, imageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005181
Jesse Hall3fbc8562015-11-29 22:10:52 -08005182 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005183}
5184
5185@threadSafety("app")
Jesse Hallae38f732015-11-19 21:32:50 -08005186cmd void vkCmdClearAttachments(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005187 VkCommandBuffer commandBuffer,
Jesse Hallae38f732015-11-19 21:32:50 -08005188 u32 attachmentCount,
5189 const VkClearAttachment* pAttachments,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005190 u32 rectCount,
Jesse Halla15a4bf2015-11-19 22:48:02 -08005191 const VkClearRect* pRects) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005192 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005193
5194 rects := pRects[0:rectCount]
5195 for i in (0 .. rectCount) {
5196 rect := rects[i]
5197 }
5198
Jesse Hall3fbc8562015-11-29 22:10:52 -08005199 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005200}
5201
5202@threadSafety("app")
5203cmd void vkCmdResolveImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005204 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005205 VkImage srcImage,
5206 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005207 VkImage dstImage,
5208 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005209 u32 regionCount,
5210 const VkImageResolve* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005211 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005212 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005213 dstImageObject := GetImage(dstImage)
5214 assert(commandBufferObject.device == srcImageObject.device)
5215 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005216
5217 regions := pRegions[0:regionCount]
5218 for i in (0 .. regionCount) {
5219 region := regions[i]
5220 }
5221
Jesse Hall3fbc8562015-11-29 22:10:52 -08005222 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
5223 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005224
Jesse Hall3fbc8562015-11-29 22:10:52 -08005225 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005226}
5227
5228@threadSafety("app")
5229cmd void vkCmdSetEvent(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005230 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005231 VkEvent event,
5232 VkPipelineStageFlags stageMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005233 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005234 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005235 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005236}
5237
5238@threadSafety("app")
5239cmd void vkCmdResetEvent(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005240 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005241 VkEvent event,
5242 VkPipelineStageFlags stageMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005243 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005244 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005245 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005246}
5247
5248@threadSafety("app")
5249cmd void vkCmdWaitEvents(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005250 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005251 u32 eventCount,
5252 const VkEvent* pEvents,
5253 VkPipelineStageFlags srcStageMask,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005254 VkPipelineStageFlags dstStageMask,
5255 u32 memoryBarrierCount,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005256 const VkMemoryBarrier* pMemoryBarriers,
5257 u32 bufferMemoryBarrierCount,
5258 const VkBufferMemoryBarrier* pBufferMemoryBarriers,
5259 u32 imageMemoryBarrierCount,
5260 const VkImageMemoryBarrier* pImageMemoryBarriers) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005261 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005262
5263 events := pEvents[0:eventCount]
5264 for i in (0 .. eventCount) {
5265 event := events[i]
5266 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005267 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005268 }
5269
Jesse Hall3dd678a2016-01-08 21:52:01 -08005270 memoryBarriers := pMemoryBarriers[0:memoryBarrierCount]
Jesse Hall3fbc8562015-11-29 22:10:52 -08005271 for i in (0 .. memoryBarrierCount) {
Jesse Hall3dd678a2016-01-08 21:52:01 -08005272 memoryBarrier := memoryBarriers[i]
5273 }
5274 bufferMemoryBarriers := pBufferMemoryBarriers[0:bufferMemoryBarrierCount]
5275 for i in (0 .. bufferMemoryBarrierCount) {
5276 bufferMemoryBarrier := bufferMemoryBarriers[i]
5277 bufferObject := GetBuffer(bufferMemoryBarrier.buffer)
5278 assert(bufferObject.device == commandBufferObject.device)
5279 }
5280 imageMemoryBarriers := pImageMemoryBarriers[0:imageMemoryBarrierCount]
5281 for i in (0 .. imageMemoryBarrierCount) {
5282 imageMemoryBarrier := imageMemoryBarriers[i]
5283 imageObject := GetImage(imageMemoryBarrier.image)
5284 assert(imageObject.device == commandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005285 }
5286}
5287
5288@threadSafety("app")
5289cmd void vkCmdPipelineBarrier(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005290 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005291 VkPipelineStageFlags srcStageMask,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005292 VkPipelineStageFlags dstStageMask,
Jesse Halldc6d36c2015-11-29 19:12:15 -08005293 VkDependencyFlags dependencyFlags,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005294 u32 memoryBarrierCount,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005295 const VkMemoryBarrier* pMemoryBarriers,
5296 u32 bufferMemoryBarrierCount,
5297 const VkBufferMemoryBarrier* pBufferMemoryBarriers,
5298 u32 imageMemoryBarrierCount,
5299 const VkImageMemoryBarrier* pImageMemoryBarriers) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005300 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005301
Jesse Hall3dd678a2016-01-08 21:52:01 -08005302 memoryBarriers := pMemoryBarriers[0:memoryBarrierCount]
Jesse Hall3fbc8562015-11-29 22:10:52 -08005303 for i in (0 .. memoryBarrierCount) {
Jesse Hall3dd678a2016-01-08 21:52:01 -08005304 memoryBarrier := memoryBarriers[i]
5305 }
5306 bufferMemoryBarriers := pBufferMemoryBarriers[0:bufferMemoryBarrierCount]
5307 for i in (0 .. bufferMemoryBarrierCount) {
5308 bufferMemoryBarrier := bufferMemoryBarriers[i]
5309 bufferObject := GetBuffer(bufferMemoryBarrier.buffer)
5310 assert(bufferObject.device == commandBufferObject.device)
5311 }
5312 imageMemoryBarriers := pImageMemoryBarriers[0:imageMemoryBarrierCount]
5313 for i in (0 .. imageMemoryBarrierCount) {
5314 imageMemoryBarrier := imageMemoryBarriers[i]
5315 imageObject := GetImage(imageMemoryBarrier.image)
5316 assert(imageObject.device == commandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005317 }
5318}
5319
5320@threadSafety("app")
5321cmd void vkCmdBeginQuery(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005322 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005323 VkQueryPool queryPool,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005324 u32 query,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005325 VkQueryControlFlags flags) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005326 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005327 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005328 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005329}
5330
5331@threadSafety("app")
5332cmd void vkCmdEndQuery(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005333 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005334 VkQueryPool queryPool,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005335 u32 query) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005336 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005337 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005338 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005339}
5340
5341@threadSafety("app")
5342cmd void vkCmdResetQueryPool(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005343 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005344 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005345 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005346 u32 queryCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005347 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005348 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005349 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005350}
5351
5352@threadSafety("app")
5353cmd void vkCmdWriteTimestamp(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005354 VkCommandBuffer commandBuffer,
Jesse Hall6f39a6d2015-11-24 11:08:36 -08005355 VkPipelineStageFlagBits pipelineStage,
Jesse Halla3a7a1d2015-11-24 11:37:23 -08005356 VkQueryPool queryPool,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005357 u32 query) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005358 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halla3a7a1d2015-11-24 11:37:23 -08005359 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005360 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005361}
5362
5363@threadSafety("app")
5364cmd void vkCmdCopyQueryPoolResults(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005365 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005366 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005367 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005368 u32 queryCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005369 VkBuffer dstBuffer,
5370 VkDeviceSize dstOffset,
Jesse Halla9bb62b2015-11-21 19:31:56 -08005371 VkDeviceSize stride,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005372 VkQueryResultFlags flags) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005373 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005374 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005375 dstBufferObject := GetBuffer(dstBuffer)
5376 assert(commandBufferObject.device == queryPoolObject.device)
5377 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005378}
5379
5380cmd void vkCmdPushConstants(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005381 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005382 VkPipelineLayout layout,
5383 VkShaderStageFlags stageFlags,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005384 u32 offset,
5385 u32 size,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08005386 const void* pValues) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005387 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005388 layoutObject := GetPipelineLayout(layout)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005389 assert(commandBufferObject.device == layoutObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005390}
5391
5392@threadSafety("app")
5393cmd void vkCmdBeginRenderPass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005394 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005395 const VkRenderPassBeginInfo* pRenderPassBegin,
Jesse Hall65ab5522015-11-30 00:07:16 -08005396 VkSubpassContents contents) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005397 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005398 renderPassObject := GetRenderPass(pRenderPassBegin.renderPass)
5399 framebufferObject := GetFramebuffer(pRenderPassBegin.framebuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005400 assert(commandBufferObject.device == renderPassObject.device)
5401 assert(commandBufferObject.device == framebufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005402
Jesse Hall3fbc8562015-11-29 22:10:52 -08005403 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005404}
5405
5406cmd void vkCmdNextSubpass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005407 VkCommandBuffer commandBuffer,
Jesse Hall65ab5522015-11-30 00:07:16 -08005408 VkSubpassContents contents) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005409 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005410}
5411
5412@threadSafety("app")
5413cmd void vkCmdEndRenderPass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005414 VkCommandBuffer commandBuffer) {
5415 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005416
Jesse Hall3fbc8562015-11-29 22:10:52 -08005417 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005418}
5419
5420cmd void vkCmdExecuteCommands(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005421 VkCommandBuffer commandBuffer,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005422 u32 commandBufferCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005423 const VkCommandBuffer* pCommandBuffers) {
5424 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005425
Jesse Hall3dd678a2016-01-08 21:52:01 -08005426 commandBuffers := pCommandBuffers[0:commandBufferCount]
5427 for i in (0 .. commandBufferCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005428 secondaryCommandBuffer := commandBuffers[i]
5429 secondaryCommandBufferObject := GetCommandBuffer(secondaryCommandBuffer)
5430 assert(commandBufferObject.device == secondaryCommandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005431 }
5432}
5433
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005434@extension("VK_KHR_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005435cmd void vkDestroySurfaceKHR(
5436 VkInstance instance,
Jesse Hall0e74f002015-11-30 11:37:59 -08005437 VkSurfaceKHR surface,
5438 const VkAllocationCallbacks* pAllocator) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005439 instanceObject := GetInstance(instance)
5440 surfaceObject := GetSurface(surface)
5441 assert(surfaceObject.instance == instance)
Michael Lentine88594d72015-11-12 12:49:45 -08005442
Jesse Hall1356b0d2015-11-23 17:24:58 -08005443 State.Surfaces[surface] = null
Jesse Hall2818f932015-11-19 21:19:17 -08005444}
5445
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005446@extension("VK_KHR_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005447cmd VkResult vkGetPhysicalDeviceSurfaceSupportKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005448 VkPhysicalDevice physicalDevice,
5449 u32 queueFamilyIndex,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005450 VkSurfaceKHR surface,
Jesse Hallb00daad2015-11-29 19:46:20 -08005451 VkBool32* pSupported) {
5452 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08005453
5454 return ?
5455}
5456
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005457@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08005458cmd VkResult vkGetPhysicalDeviceSurfaceCapabilitiesKHR(
5459 VkPhysicalDevice physicalDevice,
5460 VkSurfaceKHR surface,
5461 VkSurfaceCapabilitiesKHR* pSurfaceCapabilities) {
5462 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5463
5464 surfaceCapabilities := ?
5465 pSurfaceCapabilities[0] = surfaceCapabilities
5466
5467 return ?
5468}
5469
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005470@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08005471cmd VkResult vkGetPhysicalDeviceSurfaceFormatsKHR(
5472 VkPhysicalDevice physicalDevice,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005473 VkSurfaceKHR surface,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005474 u32* pSurfaceFormatCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005475 VkSurfaceFormatKHR* pSurfaceFormats) {
Jesse Hallb00daad2015-11-29 19:46:20 -08005476 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08005477
5478 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08005479 pSurfaceFormatCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08005480 surfaceFormats := pSurfaceFormats[0:count]
5481
5482 for i in (0 .. count) {
5483 surfaceFormat := ?
5484 surfaceFormats[i] = surfaceFormat
5485 }
5486
5487 return ?
5488}
5489
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005490@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08005491cmd VkResult vkGetPhysicalDeviceSurfacePresentModesKHR(
5492 VkPhysicalDevice physicalDevice,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005493 VkSurfaceKHR surface,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005494 u32* pPresentModeCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005495 VkPresentModeKHR* pPresentModes) {
Jesse Hallb00daad2015-11-29 19:46:20 -08005496 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08005497
5498 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08005499 pPresentModeCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08005500 presentModes := pPresentModes[0:count]
5501
5502 for i in (0 .. count) {
5503 presentMode := ?
5504 presentModes[i] = presentMode
5505 }
5506
5507 return ?
5508}
5509
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005510@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005511cmd VkResult vkCreateSwapchainKHR(
5512 VkDevice device,
5513 const VkSwapchainCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005514 const VkAllocationCallbacks* pAllocator,
Michael Lentine88594d72015-11-12 12:49:45 -08005515 VkSwapchainKHR* pSwapchain) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005516 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR)
Michael Lentine88594d72015-11-12 12:49:45 -08005517 deviceObject := GetDevice(device)
5518
5519 swapchain := ?
5520 pSwapchain[0] = swapchain
5521 State.Swapchains[swapchain] = new!SwapchainObject(device: device)
5522
5523 return ?
5524}
5525
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005526@extension("VK_KHR_swapchain")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005527cmd void vkDestroySwapchainKHR(
Michael Lentine88594d72015-11-12 12:49:45 -08005528 VkDevice device,
Jesse Hall0e74f002015-11-30 11:37:59 -08005529 VkSwapchainKHR swapchain,
5530 const VkAllocationCallbacks* pAllocator) {
Michael Lentine88594d72015-11-12 12:49:45 -08005531 deviceObject := GetDevice(device)
5532 swapchainObject := GetSwapchain(swapchain)
5533 assert(swapchainObject.device == device)
5534
5535 State.Swapchains[swapchain] = null
Michael Lentine88594d72015-11-12 12:49:45 -08005536}
5537
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005538@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005539cmd VkResult vkGetSwapchainImagesKHR(
5540 VkDevice device,
5541 VkSwapchainKHR swapchain,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005542 u32* pSwapchainImageCount,
Michael Lentine88594d72015-11-12 12:49:45 -08005543 VkImage* pSwapchainImages) {
5544 deviceObject := GetDevice(device)
5545
5546 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08005547 pSwapchainImageCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08005548 swapchainImages := pSwapchainImages[0:count]
5549
5550 for i in (0 .. count) {
5551 swapchainImage := ?
5552 swapchainImages[i] = swapchainImage
Jesse Hall1356b0d2015-11-23 17:24:58 -08005553 State.Images[swapchainImage] = new!ImageObject(device: device)
Michael Lentine88594d72015-11-12 12:49:45 -08005554 }
5555
5556 return ?
5557}
5558
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005559@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005560cmd VkResult vkAcquireNextImageKHR(
5561 VkDevice device,
5562 VkSwapchainKHR swapchain,
5563 u64 timeout,
5564 VkSemaphore semaphore,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005565 VkFence fence,
Michael Lentine88594d72015-11-12 12:49:45 -08005566 u32* pImageIndex) {
5567 deviceObject := GetDevice(device)
5568 swapchainObject := GetSwapchain(swapchain)
5569
5570 imageIndex := ?
5571 pImageIndex[0] = imageIndex
5572
5573 return ?
5574}
5575
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005576@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005577cmd VkResult vkQueuePresentKHR(
5578 VkQueue queue,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08005579 const VkPresentInfoKHR* pPresentInfo) {
Michael Lentine88594d72015-11-12 12:49:45 -08005580 queueObject := GetQueue(queue)
5581
5582 presentInfo := ?
5583 pPresentInfo[0] = presentInfo
5584
5585 return ?
5586}
5587
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005588@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005589cmd VkResult vkGetPhysicalDeviceDisplayPropertiesKHR(
5590 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005591 u32* pPropertyCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005592 VkDisplayPropertiesKHR* pProperties) {
5593 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5594 return ?
5595}
5596
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005597@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005598cmd VkResult vkGetPhysicalDeviceDisplayPlanePropertiesKHR(
5599 VkPhysicalDevice physicalDevice,
5600 u32* pPropertyCount,
5601 VkDisplayPlanePropertiesKHR* pProperties) {
5602 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5603 return ?
5604}
5605
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005606@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005607cmd VkResult vkGetDisplayPlaneSupportedDisplaysKHR(
5608 VkPhysicalDevice physicalDevice,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005609 u32 planeIndex,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08005610 u32* pDisplayCount,
5611 VkDisplayKHR* pDisplays) {
Jesse Halla6429252015-11-29 18:59:42 -08005612 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5613 return ?
5614}
5615
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005616@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005617cmd VkResult vkGetDisplayModePropertiesKHR(
5618 VkPhysicalDevice physicalDevice,
5619 VkDisplayKHR display,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005620 u32* pPropertyCount,
5621 VkDisplayModePropertiesKHR* pProperties) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005622 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5623 return ?
5624}
5625
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005626@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005627cmd VkResult vkCreateDisplayModeKHR(
5628 VkPhysicalDevice physicalDevice,
5629 VkDisplayKHR display,
5630 const VkDisplayModeCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005631 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005632 VkDisplayModeKHR* pMode) {
5633 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5634 return ?
5635}
5636
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005637@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005638cmd VkResult vkGetDisplayPlaneCapabilitiesKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005639 VkPhysicalDevice physicalDevice,
Jesse Hall9ba8bc82015-11-30 16:22:16 -08005640 VkDisplayModeKHR mode,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005641 u32 planeIndex,
Jesse Halla6429252015-11-29 18:59:42 -08005642 VkDisplayPlaneCapabilitiesKHR* pCapabilities) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005643 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5644 return ?
5645}
5646
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005647@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005648cmd VkResult vkCreateDisplayPlaneSurfaceKHR(
5649 VkInstance instance,
5650 const VkDisplaySurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005651 const VkAllocationCallbacks* pAllocator,
Jesse Halla6429252015-11-29 18:59:42 -08005652 VkSurfaceKHR* pSurface) {
5653 return ?
5654}
5655
Jesse Hall9ba8bc82015-11-30 16:22:16 -08005656@extension("VK_KHR_display_swapchain")
5657cmd VkResult vkCreateSharedSwapchainsKHR(
5658 VkDevice device,
5659 u32 swapchainCount,
5660 const VkSwapchainCreateInfoKHR* pCreateInfos,
5661 const VkAllocationCallbacks* pAllocator,
5662 VkSwapchainKHR* pSwapchains) {
5663 return ?
5664}
5665
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005666@extension("VK_KHR_xlib_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005667cmd VkResult vkCreateXlibSurfaceKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005668 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005669 const VkXlibSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005670 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005671 VkSurfaceKHR* pSurface) {
5672 instanceObject := GetInstance(instance)
5673 return ?
5674}
5675
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005676@extension("VK_KHR_xlib_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005677cmd VkBool32 vkGetPhysicalDeviceXlibPresentationSupportKHR(
5678 VkPhysicalDevice physicalDevice,
5679 u32 queueFamilyIndex,
5680 platform.Display* dpy,
Jesse Hall65ab5522015-11-30 00:07:16 -08005681 platform.VisualID visualID) {
Jesse Halla6429252015-11-29 18:59:42 -08005682 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5683 return ?
5684}
5685
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005686@extension("VK_KHR_xcb_surface")
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005687cmd VkResult vkCreateXcbSurfaceKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005688 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005689 const VkXcbSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005690 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005691 VkSurfaceKHR* pSurface) {
5692 instanceObject := GetInstance(instance)
5693 return ?
5694}
5695
Jesse Hall523db342015-11-30 21:12:55 -08005696@extension("VK_KHR_xcb_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005697cmd VkBool32 vkGetPhysicalDeviceXcbPresentationSupportKHR(
5698 VkPhysicalDevice physicalDevice,
5699 u32 queueFamilyIndex,
5700 platform.xcb_connection_t* connection,
5701 platform.xcb_visualid_t visual_id) {
5702 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5703 return ?
5704}
5705
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005706@extension("VK_KHR_wayland_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005707cmd VkResult vkCreateWaylandSurfaceKHR(
5708 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005709 const VkWaylandSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005710 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005711 VkSurfaceKHR* pSurface) {
5712 instanceObject := GetInstance(instance)
5713 return ?
5714}
5715
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005716@extension("VK_KHR_wayland_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005717cmd VkBool32 vkGetPhysicalDeviceWaylandPresentationSupportKHR(
5718 VkPhysicalDevice physicalDevice,
5719 u32 queueFamilyIndex,
5720 platform.wl_display* display) {
5721 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5722 return ?
5723}
5724
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005725@extension("VK_KHR_mir_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005726cmd VkResult vkCreateMirSurfaceKHR(
5727 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005728 const VkMirSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005729 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005730 VkSurfaceKHR* pSurface) {
5731 instanceObject := GetInstance(instance)
5732 return ?
5733}
5734
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005735@extension("VK_KHR_mir_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005736cmd VkBool32 vkGetPhysicalDeviceMirPresentationSupportKHR(
5737 VkPhysicalDevice physicalDevice,
5738 u32 queueFamilyIndex,
5739 platform.MirConnection* connection) {
5740 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5741 return ?
5742}
5743
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005744@extension("VK_KHR_android_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005745cmd VkResult vkCreateAndroidSurfaceKHR(
5746 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005747 const VkAndroidSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005748 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005749 VkSurfaceKHR* pSurface) {
5750 instanceObject := GetInstance(instance)
5751 return ?
5752}
5753
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005754@extension("VK_KHR_win32_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005755cmd VkResult vkCreateWin32SurfaceKHR(
5756 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005757 const VkWin32SurfaceCreateInfoKHR* 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_win32_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005765cmd VkResult vkGetPhysicalDeviceWin32PresentationSupportKHR(
5766 VkPhysicalDevice physicalDevice,
5767 u32 queueFamilyIndex) {
Jesse Halle2948d82016-02-25 04:19:32 -08005768 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Jesse Halla6429252015-11-29 18:59:42 -08005769 return ?
5770}
5771
Chia-I Wub262ddc2016-03-22 07:38:20 +08005772@extension("VK_ANDROID_native_buffer")
5773cmd VkResult vkGetSwapchainGrallocUsageANDROID(
5774 VkDevice device,
5775 VkFormat format,
5776 VkImageUsageFlags imageUsage,
5777 int* grallocUsage) {
5778 return ?
5779}
5780
5781@extension("VK_ANDROID_native_buffer")
Chris Forbes8e4438b2016-12-07 16:26:49 +13005782cmd VkResult vkGetSwapchainGrallocUsage2ANDROID(
5783 VkDevice device,
5784 VkFormat format,
5785 VkImageUsageFlags imageUsage,
5786 VkSwapchainImageUsageFlagsANDROID swapchainImageUsage,
5787 int* grallocUsage) {
5788 return ?
5789}
5790
5791@extension("VK_ANDROID_native_buffer")
Chia-I Wub262ddc2016-03-22 07:38:20 +08005792cmd VkResult vkAcquireImageANDROID(
5793 VkDevice device,
5794 VkImage image,
5795 int nativeFenceFd,
5796 VkSemaphore semaphore,
5797 VkFence fence) {
5798 return ?
5799}
5800
5801@extension("VK_ANDROID_native_buffer")
5802cmd VkResult vkQueueSignalReleaseImageANDROID(
5803 VkQueue queue,
5804 u32 waitSemaphoreCount,
5805 const VkSemaphore* pWaitSemaphores,
5806 VkImage image,
5807 int* pNativeFenceFd) {
5808 return ?
5809}
5810
Jesse Hall715b86a2016-01-16 16:34:29 -08005811@extension("VK_EXT_debug_report")
5812@external type void* PFN_vkDebugReportCallbackEXT
5813@extension("VK_EXT_debug_report")
5814@pfn cmd VkBool32 vkDebugReportCallbackEXT(
5815 VkDebugReportFlagsEXT flags,
5816 VkDebugReportObjectTypeEXT objectType,
5817 u64 object,
5818 platform.size_t location,
5819 s32 messageCode,
5820 const char* pLayerPrefix,
5821 const char* pMessage,
5822 void* pUserData) {
5823 return ?
5824}
5825
5826@extension("VK_EXT_debug_report")
5827cmd VkResult vkCreateDebugReportCallbackEXT(
5828 VkInstance instance,
5829 const VkDebugReportCallbackCreateInfoEXT* pCreateInfo,
5830 const VkAllocationCallbacks* pAllocator,
5831 VkDebugReportCallbackEXT* pCallback) {
5832 return ?
5833}
5834
5835@extension("VK_EXT_debug_report")
5836cmd void vkDestroyDebugReportCallbackEXT(
5837 VkInstance instance,
5838 VkDebugReportCallbackEXT callback,
5839 const VkAllocationCallbacks* pAllocator) {
5840}
5841
5842@extension("VK_EXT_debug_report")
5843cmd void vkDebugReportMessageEXT(
5844 VkInstance instance,
5845 VkDebugReportFlagsEXT flags,
5846 VkDebugReportObjectTypeEXT objectType,
5847 u64 object,
5848 platform.size_t location,
5849 s32 messageCode,
5850 const char* pLayerPrefix,
5851 const char* pMessage) {
5852}
5853
Jesse Hall26763382016-05-20 07:13:52 -07005854@extension("VK_EXT_debug_marker")
5855cmd VkResult vkDebugMarkerSetObjectTagEXT(
5856 VkDevice device,
5857 VkDebugMarkerObjectTagInfoEXT* pTagInfo) {
5858 return ?
5859}
5860
5861@extension("VK_EXT_debug_marker")
5862cmd VkResult vkDebugMarkerSetObjectNameEXT(
5863 VkDevice device,
5864 VkDebugMarkerObjectNameInfoEXT* pNameInfo) {
5865 return ?
5866}
5867
5868@extension("VK_EXT_debug_marker")
5869cmd void vkCmdDebugMarkerBeginEXT(
5870 VkCommandBuffer commandBuffer,
5871 VkDebugMarkerMarkerInfoEXT* pMarkerInfo) {
5872}
5873
5874@extension("VK_EXT_debug_marker")
5875cmd void vkCmdDebugMarkerEndEXT(
5876 VkCommandBuffer commandBuffer) {
5877}
5878
5879@extension("VK_EXT_debug_marker")
5880cmd void vkCmdDebugMarkerInsertEXT(
5881 VkCommandBuffer commandBuffer,
5882 VkDebugMarkerMarkerInfoEXT* pMarkerInfo) {
5883}
5884
Chris Forbes1194ede2016-12-30 16:29:25 +13005885@extension("VK_KHR_get_physical_device_properties2")
5886cmd void vkGetPhysicalDeviceFeatures2KHR(
5887 VkPhysicalDevice physicalDevice,
5888 VkPhysicalDeviceFeatures2KHR* pFeatures) {
5889}
5890
5891@extension("VK_KHR_get_physical_device_properties2")
5892cmd void vkGetPhysicalDeviceProperties2KHR(
5893 VkPhysicalDevice physicalDevice,
5894 VkPhysicalDeviceProperties2KHR* pProperties) {
5895}
5896
5897@extension("VK_KHR_get_physical_device_properties2")
5898cmd void vkGetPhysicalDeviceFormatProperties2KHR(
5899 VkPhysicalDevice physicalDevice,
5900 VkFormat format,
5901 VkFormatProperties2KHR* pFormatProperties) {
5902}
5903
5904@extension("VK_KHR_get_physical_device_properties2")
5905cmd VkResult vkGetPhysicalDeviceImageFormatProperties2KHR(
5906 VkPhysicalDevice physicalDevice,
5907 const VkPhysicalDeviceImageFormatInfo2KHR* pImageFormatInfo,
5908 VkImageFormatProperties2KHR* pImageFormatProperties) {
5909 return ?
5910}
5911
5912@extension("VK_KHR_get_physical_device_properties2")
5913cmd void vkGetPhysicalDeviceQueueFamilyProperties2KHR(
5914 VkPhysicalDevice physicalDevice,
5915 u32* pQueueFamilyPropertyCount,
5916 VkQueueFamilyProperties2KHR* pQueueFamilyProperties) {
5917}
5918
5919@extension("VK_KHR_get_physical_device_properties2")
5920cmd void vkGetPhysicalDeviceMemoryProperties2KHR(
5921 VkPhysicalDevice physicalDevice,
5922 VkPhysicalDeviceMemoryProperties2KHR* pMemoryProperties) {
5923}
5924
5925@extension("VK_KHR_get_physical_device_properties2")
5926cmd void vkGetPhysicalDeviceSparseImageFormatProperties2KHR(
5927 VkPhysicalDevice physicalDevice,
5928 const VkPhysicalDeviceSparseImageFormatInfo2KHR* pFormatInfo,
5929 u32* pPropertyCount,
5930 VkSparseImageFormatProperties2KHR* pProperties) {
5931}
5932
Chris Forbes289cb792016-12-30 15:03:55 +13005933@extension("VK_AMD_draw_indirect_count")
5934cmd void vkCmdDrawIndirectCountAMD(
5935 VkCommandBuffer commandBuffer,
5936 VkBuffer buffer,
5937 VkDeviceSize offset,
5938 VkBuffer countBuffer,
5939 VkDeviceSize countBufferOffset,
5940 u32 maxDrawCount,
5941 u32 stride) {
5942}
5943
5944@extension("VK_AMD_draw_indirect_count")
5945cmd void vkCmdDrawIndexedIndirectCountAMD(
5946 VkCommandBuffer commandBuffer,
5947 VkBuffer buffer,
5948 VkDeviceSize offset,
5949 VkBuffer countBuffer,
5950 VkDeviceSize countBufferOffset,
5951 u32 maxDrawCount,
5952 u32 stride) {
5953}
5954
5955@extension("VK_NV_external_memory_capabilities")
5956cmd VkResult vkGetPhysicalDeviceExternalImageFormatPropertiesNV(
5957 VkPhysicalDevice physicalDevice,
5958 VkFormat format,
5959 VkImageType type,
5960 VkImageTiling tiling,
5961 VkImageUsageFlags usage,
5962 VkImageCreateFlags flags,
5963 VkExternalMemoryHandleTypeFlagsNV externalHandleType,
5964 VkExternalImageFormatPropertiesNV* pExternalImageFormatProperties) {
5965 return ?
5966}
5967
5968@extension("VK_NV_external_memory_win32")
5969cmd VkResult vkGetMemoryWin32HandleNV(
5970 VkDevice device,
5971 VkDeviceMemory memory,
5972 VkExternalMemoryHandleTypeFlagsNV handleType,
5973 platform.HANDLE* pHandle) {
5974 return ?
5975}
5976
5977@extension("VK_NV_external_memory_win32")
5978cmd void vkCmdProcessCommandsNVX(
5979 VkCommandBuffer commandBuffer,
5980 const VkCmdProcessCommandsInfoNVX* pProcessCommandsInfo) {
5981}
5982
5983@extension("VK_NV_external_memory_win32")
5984cmd void vkCmdReserveSpaceForCommandsNVX(
5985 VkCommandBuffer commandBuffer,
5986 const VkCmdReserveSpaceForCommandsInfoNVX* pReserveSpaceInfo) {
5987}
5988
5989@extension("VK_NV_external_memory_win32")
5990cmd VkResult vkCreateIndirectCommandsLayoutNVX(
5991 VkDevice device,
5992 const VkIndirectCommandsLayoutCreateInfoNVX* pCreateInfo,
5993 const VkAllocationCallbacks* pAllocator,
5994 VkIndirectCommandsLayoutNVX* pIndirectCommandsLayout) {
5995 return ?
5996}
5997
5998@extension("VK_NV_external_memory_win32")
5999cmd void vkDestroyIndirectCommandsLayoutNVX(
6000 VkDevice device,
6001 VkIndirectCommandsLayoutNVX indirectCommandsLayout,
6002 const VkAllocationCallbacks* pAllocator) {
6003}
6004
6005@extension("VK_NV_external_memory_win32")
6006cmd VkResult vkCreateObjectTableNVX(
6007 VkDevice device,
6008 const VkObjectTableCreateInfoNVX* pCreateInfo,
6009 const VkAllocationCallbacks* pAllocator,
6010 VkObjectTableNVX* pObjectTable) {
6011 return ?
6012}
6013
6014@extension("VK_NV_external_memory_win32")
6015cmd void vkDestroyObjectTableNVX(
6016 VkDevice device,
6017 VkObjectTableNVX objectTable,
6018 const VkAllocationCallbacks* pAllocator) {
6019}
6020
6021@extension("VK_NV_external_memory_win32")
6022cmd VkResult vkRegisterObjectsNVX(
6023 VkDevice device,
6024 VkObjectTableNVX objectTable,
6025 u32 objectCount,
6026 const VkObjectTableEntryNVX* const* ppObjectTableEntries,
6027 const u32* pObjectIndices) {
6028 return ?
6029}
6030
6031@extension("VK_NV_external_memory_win32")
6032cmd VkResult vkUnregisterObjectsNVX(
6033 VkDevice device,
6034 VkObjectTableNVX objectTable,
6035 u32 objectCount,
6036 const VkObjectEntryTypeNVX* pObjectEntryTypes,
6037 const u32* pObjectIndices) {
6038 return ?
6039}
6040
6041@extension("VK_NV_external_memory_win32")
6042cmd void vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX(
6043 VkPhysicalDevice physicalDevice,
6044 VkDeviceGeneratedCommandsFeaturesNVX* pFeatures,
6045 VkDeviceGeneratedCommandsLimitsNVX* pLimits) {
6046}
6047
Jesse Halld27f6aa2015-08-15 17:58:48 -07006048
6049////////////////
6050// Validation //
6051////////////////
6052
6053extern void validate(string layerName, bool condition, string message)
6054
6055
6056/////////////////////////////
6057// Internal State Tracking //
6058/////////////////////////////
6059
6060StateObject State
6061
6062@internal class StateObject {
6063 // Dispatchable objects.
6064 map!(VkInstance, ref!InstanceObject) Instances
6065 map!(VkPhysicalDevice, ref!PhysicalDeviceObject) PhysicalDevices
6066 map!(VkDevice, ref!DeviceObject) Devices
6067 map!(VkQueue, ref!QueueObject) Queues
Jesse Hall3fbc8562015-11-29 22:10:52 -08006068 map!(VkCommandBuffer, ref!CommandBufferObject) CommandBuffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07006069
6070 // Non-dispatchable objects.
6071 map!(VkDeviceMemory, ref!DeviceMemoryObject) DeviceMemories
6072 map!(VkBuffer, ref!BufferObject) Buffers
6073 map!(VkBufferView, ref!BufferViewObject) BufferViews
6074 map!(VkImage, ref!ImageObject) Images
6075 map!(VkImageView, ref!ImageViewObject) ImageViews
Jesse Halld27f6aa2015-08-15 17:58:48 -07006076 map!(VkShaderModule, ref!ShaderModuleObject) ShaderModules
Jesse Halld27f6aa2015-08-15 17:58:48 -07006077 map!(VkPipeline, ref!PipelineObject) Pipelines
6078 map!(VkPipelineLayout, ref!PipelineLayoutObject) PipelineLayouts
6079 map!(VkSampler, ref!SamplerObject) Samplers
6080 map!(VkDescriptorSet, ref!DescriptorSetObject) DescriptorSets
6081 map!(VkDescriptorSetLayout, ref!DescriptorSetLayoutObject) DescriptorSetLayouts
6082 map!(VkDescriptorPool, ref!DescriptorPoolObject) DescriptorPools
Jesse Halld27f6aa2015-08-15 17:58:48 -07006083 map!(VkFence, ref!FenceObject) Fences
6084 map!(VkSemaphore, ref!SemaphoreObject) Semaphores
6085 map!(VkEvent, ref!EventObject) Events
6086 map!(VkQueryPool, ref!QueryPoolObject) QueryPools
6087 map!(VkFramebuffer, ref!FramebufferObject) Framebuffers
6088 map!(VkRenderPass, ref!RenderPassObject) RenderPasses
6089 map!(VkPipelineCache, ref!PipelineCacheObject) PipelineCaches
Jesse Hall3fbc8562015-11-29 22:10:52 -08006090 map!(VkCommandPool, ref!CommandPoolObject) CommandPools
Jesse Hall1356b0d2015-11-23 17:24:58 -08006091 map!(VkSurfaceKHR, ref!SurfaceObject) Surfaces
Michael Lentine88594d72015-11-12 12:49:45 -08006092 map!(VkSwapchainKHR, ref!SwapchainObject) Swapchains
Jesse Halld27f6aa2015-08-15 17:58:48 -07006093}
6094
6095@internal class InstanceObject {
6096}
6097
6098@internal class PhysicalDeviceObject {
6099 VkInstance instance
6100}
6101
6102@internal class DeviceObject {
6103 VkPhysicalDevice physicalDevice
6104}
6105
6106@internal class QueueObject {
6107 VkDevice device
6108 VkQueueFlags flags
6109}
6110
Jesse Hall3fbc8562015-11-29 22:10:52 -08006111@internal class CommandBufferObject {
Jesse Halld27f6aa2015-08-15 17:58:48 -07006112 VkDevice device
6113 map!(u64, VkDeviceMemory) boundObjects
6114 VkQueueFlags queueFlags
6115}
6116
6117@internal class DeviceMemoryObject {
Jesse Hall3fbc8562015-11-29 22:10:52 -08006118 VkDevice device
6119 VkDeviceSize allocationSize
6120 map!(u64, VkDeviceSize) boundObjects
6121 map!(VkCommandBuffer, VkCommandBuffer) boundCommandBuffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07006122}
6123
6124@internal class BufferObject {
6125 VkDevice device
Jesse Hall3fbc8562015-11-29 22:10:52 -08006126 VkDeviceMemory memory
6127 VkDeviceSize memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07006128}
6129
6130@internal class BufferViewObject {
6131 VkDevice device
6132 VkBuffer buffer
6133}
6134
6135@internal class ImageObject {
6136 VkDevice device
Jesse Hall3fbc8562015-11-29 22:10:52 -08006137 VkDeviceMemory memory
6138 VkDeviceSize memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07006139}
6140
6141@internal class ImageViewObject {
6142 VkDevice device
6143 VkImage image
6144}
6145
Jesse Halld27f6aa2015-08-15 17:58:48 -07006146@internal class ShaderObject {
6147 VkDevice device
6148}
6149
6150@internal class ShaderModuleObject {
6151 VkDevice device
6152}
6153
6154@internal class PipelineObject {
6155 VkDevice device
6156}
6157
6158@internal class PipelineLayoutObject {
6159 VkDevice device
6160}
6161
6162@internal class SamplerObject {
6163 VkDevice device
6164}
6165
6166@internal class DescriptorSetObject {
6167 VkDevice device
6168}
6169
6170@internal class DescriptorSetLayoutObject {
6171 VkDevice device
6172}
6173
6174@internal class DescriptorPoolObject {
6175 VkDevice device
6176}
6177
Jesse Halld27f6aa2015-08-15 17:58:48 -07006178@internal class FenceObject {
6179 VkDevice device
6180 bool signaled
6181}
6182
6183@internal class SemaphoreObject {
6184 VkDevice device
6185}
6186
6187@internal class EventObject {
6188 VkDevice device
6189}
6190
6191@internal class QueryPoolObject {
6192 VkDevice device
6193}
6194
6195@internal class FramebufferObject {
6196 VkDevice device
6197}
6198
6199@internal class RenderPassObject {
6200 VkDevice device
6201}
6202
6203@internal class PipelineCacheObject {
6204 VkDevice device
6205}
6206
Jesse Hall3fbc8562015-11-29 22:10:52 -08006207@internal class CommandPoolObject {
Jesse Halld27f6aa2015-08-15 17:58:48 -07006208 VkDevice device
6209}
6210
Jesse Hall1356b0d2015-11-23 17:24:58 -08006211@internal class SurfaceObject {
6212 VkInstance instance
6213}
6214
Michael Lentine88594d72015-11-12 12:49:45 -08006215@internal class SwapchainObject {
6216 VkDevice device
6217}
6218
Jesse Halld27f6aa2015-08-15 17:58:48 -07006219macro ref!InstanceObject GetInstance(VkInstance instance) {
6220 assert(instance in State.Instances)
6221 return State.Instances[instance]
6222}
6223
6224macro ref!PhysicalDeviceObject GetPhysicalDevice(VkPhysicalDevice physicalDevice) {
6225 assert(physicalDevice in State.PhysicalDevices)
6226 return State.PhysicalDevices[physicalDevice]
6227}
6228
6229macro ref!DeviceObject GetDevice(VkDevice device) {
6230 assert(device in State.Devices)
6231 return State.Devices[device]
6232}
6233
6234macro ref!QueueObject GetQueue(VkQueue queue) {
6235 assert(queue in State.Queues)
6236 return State.Queues[queue]
6237}
6238
Jesse Hall3fbc8562015-11-29 22:10:52 -08006239macro ref!CommandBufferObject GetCommandBuffer(VkCommandBuffer commandBuffer) {
6240 assert(commandBuffer in State.CommandBuffers)
6241 return State.CommandBuffers[commandBuffer]
Jesse Halld27f6aa2015-08-15 17:58:48 -07006242}
6243
Jesse Hall3fbc8562015-11-29 22:10:52 -08006244macro ref!DeviceMemoryObject GetDeviceMemory(VkDeviceMemory memory) {
6245 assert(memory in State.DeviceMemories)
6246 return State.DeviceMemories[memory]
Jesse Halld27f6aa2015-08-15 17:58:48 -07006247}
6248
6249macro ref!BufferObject GetBuffer(VkBuffer buffer) {
6250 assert(buffer in State.Buffers)
6251 return State.Buffers[buffer]
6252}
6253
6254macro ref!BufferViewObject GetBufferView(VkBufferView bufferView) {
6255 assert(bufferView in State.BufferViews)
6256 return State.BufferViews[bufferView]
6257}
6258
6259macro ref!ImageObject GetImage(VkImage image) {
6260 assert(image in State.Images)
6261 return State.Images[image]
6262}
6263
6264macro ref!ImageViewObject GetImageView(VkImageView imageView) {
6265 assert(imageView in State.ImageViews)
6266 return State.ImageViews[imageView]
6267}
6268
Jesse Halld27f6aa2015-08-15 17:58:48 -07006269macro ref!ShaderModuleObject GetShaderModule(VkShaderModule shaderModule) {
6270 assert(shaderModule in State.ShaderModules)
6271 return State.ShaderModules[shaderModule]
6272}
6273
6274macro ref!PipelineObject GetPipeline(VkPipeline pipeline) {
6275 assert(pipeline in State.Pipelines)
6276 return State.Pipelines[pipeline]
6277}
6278
6279macro ref!PipelineLayoutObject GetPipelineLayout(VkPipelineLayout pipelineLayout) {
6280 assert(pipelineLayout in State.PipelineLayouts)
6281 return State.PipelineLayouts[pipelineLayout]
6282}
6283
6284macro ref!SamplerObject GetSampler(VkSampler sampler) {
6285 assert(sampler in State.Samplers)
6286 return State.Samplers[sampler]
6287}
6288
6289macro ref!DescriptorSetObject GetDescriptorSet(VkDescriptorSet descriptorSet) {
6290 assert(descriptorSet in State.DescriptorSets)
6291 return State.DescriptorSets[descriptorSet]
6292}
6293
6294macro ref!DescriptorSetLayoutObject GetDescriptorSetLayout(VkDescriptorSetLayout descriptorSetLayout) {
6295 assert(descriptorSetLayout in State.DescriptorSetLayouts)
6296 return State.DescriptorSetLayouts[descriptorSetLayout]
6297}
6298
6299macro ref!DescriptorPoolObject GetDescriptorPool(VkDescriptorPool descriptorPool) {
6300 assert(descriptorPool in State.DescriptorPools)
6301 return State.DescriptorPools[descriptorPool]
6302}
6303
Jesse Halld27f6aa2015-08-15 17:58:48 -07006304macro ref!FenceObject GetFence(VkFence fence) {
6305 assert(fence in State.Fences)
6306 return State.Fences[fence]
6307}
6308
6309macro ref!SemaphoreObject GetSemaphore(VkSemaphore semaphore) {
6310 assert(semaphore in State.Semaphores)
6311 return State.Semaphores[semaphore]
6312}
6313
6314macro ref!EventObject GetEvent(VkEvent event) {
6315 assert(event in State.Events)
6316 return State.Events[event]
6317}
6318
6319macro ref!QueryPoolObject GetQueryPool(VkQueryPool queryPool) {
6320 assert(queryPool in State.QueryPools)
6321 return State.QueryPools[queryPool]
6322}
6323
6324macro ref!FramebufferObject GetFramebuffer(VkFramebuffer framebuffer) {
6325 assert(framebuffer in State.Framebuffers)
6326 return State.Framebuffers[framebuffer]
6327}
6328
6329macro ref!RenderPassObject GetRenderPass(VkRenderPass renderPass) {
6330 assert(renderPass in State.RenderPasses)
6331 return State.RenderPasses[renderPass]
6332}
6333
6334macro ref!PipelineCacheObject GetPipelineCache(VkPipelineCache pipelineCache) {
6335 assert(pipelineCache in State.PipelineCaches)
6336 return State.PipelineCaches[pipelineCache]
6337}
6338
Jesse Hall3fbc8562015-11-29 22:10:52 -08006339macro ref!CommandPoolObject GetCommandPool(VkCommandPool commandPool) {
6340 assert(commandPool in State.CommandPools)
6341 return State.CommandPools[commandPool]
Jesse Hallf09c6b12015-08-15 19:54:28 -07006342}
Michael Lentine88594d72015-11-12 12:49:45 -08006343
Jesse Hall1356b0d2015-11-23 17:24:58 -08006344macro ref!SurfaceObject GetSurface(VkSurfaceKHR surface) {
6345 assert(surface in State.Surfaces)
6346 return State.Surfaces[surface]
6347}
6348
Michael Lentine88594d72015-11-12 12:49:45 -08006349macro ref!SwapchainObject GetSwapchain(VkSwapchainKHR swapchain) {
6350 assert(swapchain in State.Swapchains)
6351 return State.Swapchains[swapchain]
6352}
Jesse Halld8bade02015-11-24 10:24:18 -08006353
6354macro VkQueueFlags AddQueueFlag(VkQueueFlags flags, VkQueueFlagBits bit) {
6355 return as!VkQueueFlags(as!u32(flags) | as!u32(bit))
6356}