blob: 1264a4e56c553e0caa6c69c8f48c5d9d68a5c546 [file] [log] [blame]
Jesse Halld27f6aa2015-08-15 17:58:48 -07001// Copyright (c) 2015 The Khronos Group Inc.
2//
3// Permission is hereby granted, free of charge, to any person obtaining a
4// copy of this software and/or associated documentation files (the
5// "Materials"), to deal in the Materials without restriction, including
6// without limitation the rights to use, copy, modify, merge, publish,
7// distribute, sublicense, and/or sell copies of the Materials, and to
8// permit persons to whom the Materials are furnished to do so, subject to
9// the following conditions:
10//
11// The above copyright notice and this permission notice shall be included
12// in all copies or substantial portions of the Materials.
13//
14// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20// MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
21
22import platform "platform.api"
23
24///////////////
25// Constants //
26///////////////
27
28// API version (major.minor.patch)
Jesse Hall3dd678a2016-01-08 21:52:01 -080029define VERSION_MAJOR 1
30define VERSION_MINOR 0
Chris Forbes289cb792016-12-30 15:03:55 +130031define VERSION_PATCH 38
Jesse Halld27f6aa2015-08-15 17:58:48 -070032
33// API limits
Jesse Hall65ab5522015-11-30 00:07:16 -080034define VK_MAX_PHYSICAL_DEVICE_NAME_SIZE 256
35define VK_UUID_SIZE 16
36define VK_MAX_EXTENSION_NAME_SIZE 256
37define VK_MAX_DESCRIPTION_SIZE 256
38define VK_MAX_MEMORY_TYPES 32
39define VK_MAX_MEMORY_HEAPS 16 /// The maximum number of unique memory heaps, each of which supporting 1 or more memory types.
Jesse Halld27f6aa2015-08-15 17:58:48 -070040
41// API keywords
42define VK_TRUE 1
43define VK_FALSE 0
Jesse Hall5ae3abb2015-10-08 14:00:22 -070044
45// API keyword, but needs special handling by some templates
46define NULL_HANDLE 0
Jesse Halld27f6aa2015-08-15 17:58:48 -070047
Jesse Hall33faaad2016-01-24 21:00:49 -080048@extension("VK_KHR_surface") define VK_KHR_SURFACE_SPEC_VERSION 25
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080049@extension("VK_KHR_surface") define VK_KHR_SURFACE_EXTENSION_NAME "VK_KHR_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080050
Jesse Hall26763382016-05-20 07:13:52 -070051@extension("VK_KHR_swapchain") define VK_KHR_SWAPCHAIN_SPEC_VERSION 68
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080052@extension("VK_KHR_swapchain") define VK_KHR_SWAPCHAIN_EXTENSION_NAME "VK_KHR_swapchain"
Jesse Hall1356b0d2015-11-23 17:24:58 -080053
Jesse Hall543a7ff2016-01-08 16:38:30 -080054@extension("VK_KHR_display") define VK_KHR_DISPLAY_SPEC_VERSION 21
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080055@extension("VK_KHR_display") define VK_KHR_DISPLAY_EXTENSION_NAME "VK_KHR_display"
Jesse Hall1356b0d2015-11-23 17:24:58 -080056
Jesse Hall543a7ff2016-01-08 16:38:30 -080057@extension("VK_KHR_display_swapchain") define VK_KHR_DISPLAY_SWAPCHAIN_SPEC_VERSION 9
Jesse Hall0e74f002015-11-30 11:37:59 -080058@extension("VK_KHR_display_swapchain") define VK_KHR_DISPLAY_SWAPCHAIN_EXTENSION_NAME "VK_KHR_display_swapchain"
Jesse Hall1356b0d2015-11-23 17:24:58 -080059
Jesse Hall543a7ff2016-01-08 16:38:30 -080060@extension("VK_KHR_xlib_surface") define VK_KHR_XLIB_SURFACE_SPEC_VERSION 6
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080061@extension("VK_KHR_xlib_surface") define VK_KHR_XLIB_SURFACE_NAME "VK_KHR_xlib_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080062
Jesse Hall543a7ff2016-01-08 16:38:30 -080063@extension("VK_KHR_xcb_surface") define VK_KHR_XCB_SURFACE_SPEC_VERSION 6
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080064@extension("VK_KHR_xcb_surface") define VK_KHR_XCB_SURFACE_NAME "VK_KHR_xcb_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080065
Jesse Hall543a7ff2016-01-08 16:38:30 -080066@extension("VK_KHR_wayland_surface") define VK_KHR_WAYLAND_SURFACE_SPEC_VERSION 5
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080067@extension("VK_KHR_wayland_surface") define VK_KHR_WAYLAND_SURFACE_NAME "VK_KHR_wayland_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080068
Jesse Hall543a7ff2016-01-08 16:38:30 -080069@extension("VK_KHR_mir_surface") define VK_KHR_MIR_SURFACE_SPEC_VERSION 4
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080070@extension("VK_KHR_mir_surface") define VK_KHR_MIR_SURFACE_NAME "VK_KHR_mir_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080071
Jesse Hall33faaad2016-01-24 21:00:49 -080072@extension("VK_KHR_android_surface") define VK_KHR_ANDROID_SURFACE_SPEC_VERSION 6
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080073@extension("VK_KHR_android_surface") define VK_KHR_ANDROID_SURFACE_NAME "VK_KHR_android_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080074
Jesse Hall543a7ff2016-01-08 16:38:30 -080075@extension("VK_KHR_win32_surface") define VK_KHR_WIN32_SURFACE_SPEC_VERSION 5
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080076@extension("VK_KHR_win32_surface") define VK_KHR_WIN32_SURFACE_NAME "VK_KHR_win32_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080077
Ian Elliott948233a2017-01-06 12:13:23 -070078@extension("VK_KHR_incremental_present") define VK_KHR_INCREMENTAL_PRESENT_SPEC_VERSION 1
79@extension("VK_KHR_incremental_present") define VK_KHR_INCREMENTAL_PRESENT_NAME "VK_KHR_incremental_present"
80
Chris Forbes8e4438b2016-12-07 16:26:49 +130081@extension("VK_ANDROID_native_buffer") define VK_ANDROID_NATIVE_BUFFER_SPEC_VERSION 6
Chia-I Wub262ddc2016-03-22 07:38:20 +080082@extension("VK_ANDROID_native_buffer") define VK_ANDROID_NATIVE_BUFFER_NAME "VK_ANDROID_native_buffer"
83
Chris Forbes289cb792016-12-30 15:03:55 +130084@extension("VK_EXT_debug_report") define VK_EXT_DEBUG_REPORT_SPEC_VERSION 4
Jesse Hall715b86a2016-01-16 16:34:29 -080085@extension("VK_EXT_debug_report") define VK_EXT_DEBUG_REPORT_NAME "VK_EXT_debug_report"
86
Jesse Hall26763382016-05-20 07:13:52 -070087@extension("VK_NV_glsl_shader") define VK_NV_GLSL_SHADER_SPEC_VERSION 1
88@extension("VK_NV_glsl_shader") define VK_NV_GLSL_SHADER_NAME "VK_NV_glsl_shader"
89
90@extension("VK_KHR_sampler_mirror_clamp_to_edge") define VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_SPEC_VERSION 1
91@extension("VK_KHR_sampler_mirror_clamp_to_edge") define VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_NAME "VK_KHR_sampler_mirror_clamp_to_edge"
92
93@extension("VK_IMG_filter_cubic") define VK_IMG_FILTER_CUBIC_SPEC_VERSION 1
94@extension("VK_IMG_filter_cubic") define VK_IMG_FILTER_CUBIC_NAME "VK_IMG_filter_cubic"
95
96@extension("VK_AMD_rasterization_order") define VK_AMD_RASTERIZATION_ORDER_SPEC_VERSION 1
97@extension("VK_AMD_rasterization_order") define VK_AMD_RASTERIZATION_ORDER_NAME "VK_AMD_rasterization_order"
98
Jesse Hall56d386a2016-07-26 15:20:40 -070099@extension("VK_AMD_shader_trinary_minmax") define VK_AMD_SHADER_TRINARY_MINMAX_SPEC_VERSION 1
100@extension("VK_AMD_shader_trinary_minmax") define VK_AMD_SHADER_TRINARY_MINMAX_EXTENSION_NAME "VK_AMD_shader_trinary_minmax"
101
102@extension("VK_AMD_shader_explicit_vertex_parameter") define VK_AMD_SHADER_EXPLICIT_VERTEX_PARAMETER_SPEC_VERSION 1
103@extension("VK_AMD_shader_explicit_vertex_parameter") define VK_AMD_SHADER_EXPLICIT_VERTEX_PARAMETER_EXTENSION_NAME "VK_AMD_shader_explicit_vertex_parameter"
104
Jesse Hall26763382016-05-20 07:13:52 -0700105@extension("VK_EXT_debug_marker") define VK_EXT_DEBUG_MARKER_SPEC_VERSION 3
106@extension("VK_EXT_debug_marker") define VK_EXT_DEBUG_MARKER_NAME "VK_EXT_debug_marker"
107
Jesse Hall56d386a2016-07-26 15:20:40 -0700108@extension("VK_AMD_gcn_shader") define VK_AMD_GCN_SHADER_SPEC_VERSION 1
109@extension("VK_AMD_gcn_shader") define VK_AMD_GCN_SHADER_EXTENSION_NAME "VK_AMD_gcn_shader"
110
111@extension("VK_NV_dedicated_allocation") define VK_NV_DEDICATED_ALLOCATION_SPEC_VERSION 1
112@extension("VK_NV_dedicated_allocation") define VK_NV_DEDICATED_ALLOCATION_EXTENSION_NAME "VK_NV_dedicated_allocation"
113
Chris Forbes1194ede2016-12-30 16:29:25 +1300114@extension("VK_KHR_get_physical_device_properties2") define VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_SPEC_VERSION 1
115@extension("VK_KHR_get_physical_device_properties2") define VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME "VK_KHR_get_physical_device_properties2"
116
Chris Forbes289cb792016-12-30 15:03:55 +1300117@extension("VK_AMD_draw_indirect_count") define VK_AMD_DRAW_INDIRECT_COUNT_SPEC_VERSION 1
118@extension("VK_AMD_draw_indirect_count") define VK_AMD_DRAW_INDIRECT_COUNT_EXTENSION_NAME "VK_AMD_draw_indirect_count"
119
120@extension("VK_AMD_negative_viewport_height") define VK_AMD_NEGATIVE_VIEWPORT_HEIGHT_SPEC_VERSION 1
121@extension("VK_AMD_negative_viewport_height") define VK_AMD_NEGATIVE_VIEWPORT_HEIGHT_EXTENSION_NAME "VK_AMD_negative_viewport_height"
122
123@extension("VK_AMD_gpu_shader_half_float") define VK_AMD_GPU_SHADER_HALF_FLOAT_SPEC_VERSION 1
124@extension("VK_AMD_gpu_shader_half_float") define VK_AMD_GPU_SHADER_HALF_FLOAT_EXTENSION_NAME "VK_AMD_gpu_shader_half_float"
125
126@extension("VK_AMD_shader_ballot") define VK_AMD_SHADER_BALLOT_SPEC_VERSION 1
127@extension("VK_AMD_shader_ballot") define VK_AMD_SHADER_BALLOT_EXTENSION_NAME "VK_AMD_shader_ballot"
128
129@extension("VK_IMG_format_pvrtc") define VK_IMG_FORMAT_PVRTC_SPEC_VERSION 1
130@extension("VK_IMG_format_pvrtc") define VK_IMG_FORMAT_PVRTC_EXTENSION_NAME "VK_IMG_format_pvrtc"
131
132@extension("VK_NV_external_memory_capabilities") define VK_NV_EXTERNAL_MEMORY_CAPABILITIES_SPEC_VERSION 1
133@extension("VK_NV_external_memory_capabilities") define VK_NV_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME "VK_NV_external_memory_capabilities"
134
135@extension("VK_NV_external_memory") define VK_NV_EXTERNAL_MEMORY_SPEC_VERSION 1
136@extension("VK_NV_external_memory") define VK_NV_EXTERNAL_MEMORY_EXTENSION_NAME "VK_NV_external_memory"
137
138@extension("VK_NV_external_memory_win32") define VK_NV_EXTERNAL_MEMORY_WIN32_SPEC_VERSION 1
139@extension("VK_NV_external_memory_win32") define VK_NV_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME "VK_NV_external_memory_win32"
140
141@extension("VK_NV_win32_keyed_mutex") define VK_NV_WIN32_KEYED_MUTEX_SPEC_VERSION 1
142@extension("VK_NV_win32_keyed_mutex") define VK_NV_WIN32_KEYED_MUTEX_EXTENSION_NAME "VK_NV_win32_keyed_mutex"
143
144@extension("VK_EXT_validation_flags") define VK_EXT_VALIDATION_FLAGS_SPEC_VERSION 1
145@extension("VK_EXT_validation_flags") define VK_EXT_VALIDATION_FLAGS_EXTENSION_NAME "VK_EXT_validation_flags"
146
147@extension("VK_NVX_device_generated_commands") define VK_NVX_DEVICE_GENERATED_COMMANDS_SPEC_VERSION 1
148@extension("VK_NVX_device_generated_commands") define VK_NVX_DEVICE_GENERATED_COMMANDS_EXTENSION_NAME "VK_NVX_device_generated_commands"
149
150
Jesse Halld27f6aa2015-08-15 17:58:48 -0700151
152/////////////
153// Types //
154/////////////
155
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700156type u32 VkBool32
157type u32 VkFlags
158type u64 VkDeviceSize
159type u32 VkSampleMask
160
Jesse Halld27f6aa2015-08-15 17:58:48 -0700161/// Dispatchable handle types.
162@dispatchHandle type u64 VkInstance
163@dispatchHandle type u64 VkPhysicalDevice
164@dispatchHandle type u64 VkDevice
165@dispatchHandle type u64 VkQueue
Jesse Hall3fbc8562015-11-29 22:10:52 -0800166@dispatchHandle type u64 VkCommandBuffer
Jesse Halld27f6aa2015-08-15 17:58:48 -0700167
168/// Non dispatchable handle types.
169@nonDispatchHandle type u64 VkDeviceMemory
Jesse Hall3fbc8562015-11-29 22:10:52 -0800170@nonDispatchHandle type u64 VkCommandPool
Jesse Halld27f6aa2015-08-15 17:58:48 -0700171@nonDispatchHandle type u64 VkBuffer
172@nonDispatchHandle type u64 VkBufferView
173@nonDispatchHandle type u64 VkImage
174@nonDispatchHandle type u64 VkImageView
Jesse Halld27f6aa2015-08-15 17:58:48 -0700175@nonDispatchHandle type u64 VkShaderModule
Jesse Halld27f6aa2015-08-15 17:58:48 -0700176@nonDispatchHandle type u64 VkPipeline
177@nonDispatchHandle type u64 VkPipelineLayout
178@nonDispatchHandle type u64 VkSampler
179@nonDispatchHandle type u64 VkDescriptorSet
180@nonDispatchHandle type u64 VkDescriptorSetLayout
181@nonDispatchHandle type u64 VkDescriptorPool
Jesse Halld27f6aa2015-08-15 17:58:48 -0700182@nonDispatchHandle type u64 VkFence
183@nonDispatchHandle type u64 VkSemaphore
184@nonDispatchHandle type u64 VkEvent
185@nonDispatchHandle type u64 VkQueryPool
186@nonDispatchHandle type u64 VkFramebuffer
187@nonDispatchHandle type u64 VkRenderPass
188@nonDispatchHandle type u64 VkPipelineCache
Jesse Hall1356b0d2015-11-23 17:24:58 -0800189
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800190@extension("VK_KHR_surface") @nonDispatchHandle type u64 VkSurfaceKHR
Jesse Hall1356b0d2015-11-23 17:24:58 -0800191
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800192@extension("VK_KHR_swapchain") @nonDispatchHandle type u64 VkSwapchainKHR
Jesse Hall1356b0d2015-11-23 17:24:58 -0800193
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800194@extension("VK_KHR_display") @nonDispatchHandle type u64 VkDisplayKHR
195@extension("VK_KHR_display") @nonDispatchHandle type u64 VkDisplayModeKHR
Jesse Halld27f6aa2015-08-15 17:58:48 -0700196
Jesse Hall715b86a2016-01-16 16:34:29 -0800197@extension("VK_EXT_debug_report") @nonDispatchHandle type u64 VkDebugReportCallbackEXT
198
Chris Forbes289cb792016-12-30 15:03:55 +1300199@extension("VK_NVX_device_generated_commands") @nonDispatchHandle type u64 VkObjectTableNVX
200@extension("VK_NVX_device_generated_commands") @nonDispatchHandle type u64 VkIndirectCommandsLayoutNVX
201
Jesse Halld27f6aa2015-08-15 17:58:48 -0700202
203/////////////
204// Enums //
205/////////////
206
207enum VkImageLayout {
208 VK_IMAGE_LAYOUT_UNDEFINED = 0x00000000, /// Implicit layout an image is when its contents are undefined due to various reasons (e.g. right after creation)
209 VK_IMAGE_LAYOUT_GENERAL = 0x00000001, /// General layout when image can be used for any kind of access
210 VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL = 0x00000002, /// Optimal layout when image is only used for color attachment read/write
211 VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL = 0x00000003, /// Optimal layout when image is only used for depth/stencil attachment read/write
212 VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL = 0x00000004, /// Optimal layout when image is used for read only depth/stencil attachment and shader access
213 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 -0800214 VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL = 0x00000006, /// Optimal layout when image is used only as source of transfer operations
215 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 -0700216 VK_IMAGE_LAYOUT_PREINITIALIZED = 0x00000008, /// Initial layout used when the data is populated by the CPU
Jesse Hall1356b0d2015-11-23 17:24:58 -0800217
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800218 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800219 VK_IMAGE_LAYOUT_PRESENT_SRC_KHR = 1000001002,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700220}
221
222enum VkAttachmentLoadOp {
223 VK_ATTACHMENT_LOAD_OP_LOAD = 0x00000000,
224 VK_ATTACHMENT_LOAD_OP_CLEAR = 0x00000001,
225 VK_ATTACHMENT_LOAD_OP_DONT_CARE = 0x00000002,
226}
227
228enum VkAttachmentStoreOp {
229 VK_ATTACHMENT_STORE_OP_STORE = 0x00000000,
230 VK_ATTACHMENT_STORE_OP_DONT_CARE = 0x00000001,
231}
232
233enum VkImageType {
234 VK_IMAGE_TYPE_1D = 0x00000000,
235 VK_IMAGE_TYPE_2D = 0x00000001,
236 VK_IMAGE_TYPE_3D = 0x00000002,
237}
238
239enum VkImageTiling {
Jesse Hallc7467b72015-11-29 21:05:26 -0800240 VK_IMAGE_TILING_OPTIMAL = 0x00000000,
241 VK_IMAGE_TILING_LINEAR = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700242}
243
244enum VkImageViewType {
245 VK_IMAGE_VIEW_TYPE_1D = 0x00000000,
246 VK_IMAGE_VIEW_TYPE_2D = 0x00000001,
247 VK_IMAGE_VIEW_TYPE_3D = 0x00000002,
248 VK_IMAGE_VIEW_TYPE_CUBE = 0x00000003,
249 VK_IMAGE_VIEW_TYPE_1D_ARRAY = 0x00000004,
250 VK_IMAGE_VIEW_TYPE_2D_ARRAY = 0x00000005,
251 VK_IMAGE_VIEW_TYPE_CUBE_ARRAY = 0x00000006,
252}
253
Jesse Hall3fbc8562015-11-29 22:10:52 -0800254enum VkCommandBufferLevel {
255 VK_COMMAND_BUFFER_LEVEL_PRIMARY = 0x00000000,
256 VK_COMMAND_BUFFER_LEVEL_SECONDARY = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700257}
258
Jesse Hall65ab5522015-11-30 00:07:16 -0800259enum VkComponentSwizzle {
260 VK_COMPONENT_SWIZZLE_IDENTITY = 0x00000000,
261 VK_COMPONENT_SWIZZLE_ZERO = 0x00000001,
262 VK_COMPONENT_SWIZZLE_ONE = 0x00000002,
263 VK_COMPONENT_SWIZZLE_R = 0x00000003,
264 VK_COMPONENT_SWIZZLE_G = 0x00000004,
265 VK_COMPONENT_SWIZZLE_B = 0x00000005,
266 VK_COMPONENT_SWIZZLE_A = 0x00000006,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700267}
268
269enum VkDescriptorType {
270 VK_DESCRIPTOR_TYPE_SAMPLER = 0x00000000,
271 VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER = 0x00000001,
272 VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE = 0x00000002,
273 VK_DESCRIPTOR_TYPE_STORAGE_IMAGE = 0x00000003,
274 VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER = 0x00000004,
275 VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER = 0x00000005,
276 VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER = 0x00000006,
277 VK_DESCRIPTOR_TYPE_STORAGE_BUFFER = 0x00000007,
278 VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC = 0x00000008,
279 VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC = 0x00000009,
280 VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT = 0x0000000a,
281}
282
Jesse Halld27f6aa2015-08-15 17:58:48 -0700283enum VkQueryType {
284 VK_QUERY_TYPE_OCCLUSION = 0x00000000,
285 VK_QUERY_TYPE_PIPELINE_STATISTICS = 0x00000001, /// Optional
Jesse Halla3a7a1d2015-11-24 11:37:23 -0800286 VK_QUERY_TYPE_TIMESTAMP = 0x00000002,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700287}
288
Jesse Halld27f6aa2015-08-15 17:58:48 -0700289enum VkBorderColor {
290 VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK = 0x00000000,
291 VK_BORDER_COLOR_INT_TRANSPARENT_BLACK = 0x00000001,
292 VK_BORDER_COLOR_FLOAT_OPAQUE_BLACK = 0x00000002,
293 VK_BORDER_COLOR_INT_OPAQUE_BLACK = 0x00000003,
294 VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE = 0x00000004,
295 VK_BORDER_COLOR_INT_OPAQUE_WHITE = 0x00000005,
296}
297
298enum VkPipelineBindPoint {
Jesse Hallc7467b72015-11-29 21:05:26 -0800299 VK_PIPELINE_BIND_POINT_GRAPHICS = 0x00000000,
300 VK_PIPELINE_BIND_POINT_COMPUTE = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700301}
302
303enum VkPrimitiveTopology {
304 VK_PRIMITIVE_TOPOLOGY_POINT_LIST = 0x00000000,
305 VK_PRIMITIVE_TOPOLOGY_LINE_LIST = 0x00000001,
306 VK_PRIMITIVE_TOPOLOGY_LINE_STRIP = 0x00000002,
307 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST = 0x00000003,
308 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP = 0x00000004,
309 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN = 0x00000005,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800310 VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY = 0x00000006,
311 VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY = 0x00000007,
312 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY = 0x00000008,
313 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY = 0x00000009,
Jesse Hall091ed9e2015-11-30 00:55:29 -0800314 VK_PRIMITIVE_TOPOLOGY_PATCH_LIST = 0x0000000a,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700315}
316
317enum VkSharingMode {
318 VK_SHARING_MODE_EXCLUSIVE = 0x00000000,
319 VK_SHARING_MODE_CONCURRENT = 0x00000001,
320}
321
322enum VkIndexType {
323 VK_INDEX_TYPE_UINT16 = 0x00000000,
324 VK_INDEX_TYPE_UINT32 = 0x00000001,
325}
326
Jesse Hall23ff73f2015-11-29 14:36:39 -0800327enum VkFilter {
328 VK_FILTER_NEAREST = 0x00000000,
329 VK_FILTER_LINEAR = 0x00000001,
Jesse Hall26763382016-05-20 07:13:52 -0700330
331 //@extension("VK_IMG_filter_cubic")
332 VK_FILTER_CUBIC_IMG = 1000015000,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700333}
334
Jesse Hall23ff73f2015-11-29 14:36:39 -0800335enum VkSamplerMipmapMode {
Jesse Hall23ff73f2015-11-29 14:36:39 -0800336 VK_SAMPLER_MIPMAP_MODE_NEAREST = 0x00000001, /// Choose nearest mip level
337 VK_SAMPLER_MIPMAP_MODE_LINEAR = 0x00000002, /// Linear filter between mip levels
Jesse Halld27f6aa2015-08-15 17:58:48 -0700338}
339
Jesse Hall23ff73f2015-11-29 14:36:39 -0800340enum VkSamplerAddressMode {
Jesse Hallc7467b72015-11-29 21:05:26 -0800341 VK_SAMPLER_ADDRESS_MODE_REPEAT = 0x00000000,
342 VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT = 0x00000001,
343 VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE = 0x00000002,
344 VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER = 0x00000003,
345 VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700346}
347
348enum VkCompareOp {
349 VK_COMPARE_OP_NEVER = 0x00000000,
350 VK_COMPARE_OP_LESS = 0x00000001,
351 VK_COMPARE_OP_EQUAL = 0x00000002,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800352 VK_COMPARE_OP_LESS_OR_EQUAL = 0x00000003,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700353 VK_COMPARE_OP_GREATER = 0x00000004,
354 VK_COMPARE_OP_NOT_EQUAL = 0x00000005,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800355 VK_COMPARE_OP_GREATER_OR_EQUAL = 0x00000006,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700356 VK_COMPARE_OP_ALWAYS = 0x00000007,
357}
358
Jesse Hall65ab5522015-11-30 00:07:16 -0800359enum VkPolygonMode {
360 VK_POLYGON_MODE_FILL = 0x00000000,
361 VK_POLYGON_MODE_LINE = 0x00000001,
362 VK_POLYGON_MODE_POINT = 0x00000002,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700363}
364
365enum VkFrontFace {
Jesse Hall3fbc8562015-11-29 22:10:52 -0800366 VK_FRONT_FACE_COUNTER_CLOCKWISE = 0x00000000,
367 VK_FRONT_FACE_CLOCKWISE = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700368}
369
Jesse Hall65ab5522015-11-30 00:07:16 -0800370enum VkBlendFactor {
371 VK_BLEND_FACTOR_ZERO = 0x00000000,
372 VK_BLEND_FACTOR_ONE = 0x00000001,
373 VK_BLEND_FACTOR_SRC_COLOR = 0x00000002,
374 VK_BLEND_FACTOR_ONE_MINUS_SRC_COLOR = 0x00000003,
375 VK_BLEND_FACTOR_DST_COLOR = 0x00000004,
376 VK_BLEND_FACTOR_ONE_MINUS_DST_COLOR = 0x00000005,
377 VK_BLEND_FACTOR_SRC_ALPHA = 0x00000006,
378 VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA = 0x00000007,
379 VK_BLEND_FACTOR_DST_ALPHA = 0x00000008,
380 VK_BLEND_FACTOR_ONE_MINUS_DST_ALPHA = 0x00000009,
381 VK_BLEND_FACTOR_CONSTANT_COLOR = 0x0000000a,
382 VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR = 0x0000000b,
383 VK_BLEND_FACTOR_CONSTANT_ALPHA = 0x0000000c,
384 VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA = 0x0000000d,
385 VK_BLEND_FACTOR_SRC_ALPHA_SATURATE = 0x0000000e,
386 VK_BLEND_FACTOR_SRC1_COLOR = 0x0000000f,
387 VK_BLEND_FACTOR_ONE_MINUS_SRC1_COLOR = 0x00000010,
388 VK_BLEND_FACTOR_SRC1_ALPHA = 0x00000011,
389 VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA = 0x00000012,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700390}
391
392enum VkBlendOp {
393 VK_BLEND_OP_ADD = 0x00000000,
394 VK_BLEND_OP_SUBTRACT = 0x00000001,
395 VK_BLEND_OP_REVERSE_SUBTRACT = 0x00000002,
396 VK_BLEND_OP_MIN = 0x00000003,
397 VK_BLEND_OP_MAX = 0x00000004,
398}
399
400enum VkStencilOp {
401 VK_STENCIL_OP_KEEP = 0x00000000,
402 VK_STENCIL_OP_ZERO = 0x00000001,
403 VK_STENCIL_OP_REPLACE = 0x00000002,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800404 VK_STENCIL_OP_INCREMENT_AND_CLAMP = 0x00000003,
405 VK_STENCIL_OP_DECREMENT_AND_CLAMP = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700406 VK_STENCIL_OP_INVERT = 0x00000005,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800407 VK_STENCIL_OP_INCREMENT_AND_WRAP = 0x00000006,
408 VK_STENCIL_OP_DECREMENT_AND_WRAP = 0x00000007,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700409}
410
411enum VkLogicOp {
412 VK_LOGIC_OP_CLEAR = 0x00000000,
413 VK_LOGIC_OP_AND = 0x00000001,
414 VK_LOGIC_OP_AND_REVERSE = 0x00000002,
415 VK_LOGIC_OP_COPY = 0x00000003,
416 VK_LOGIC_OP_AND_INVERTED = 0x00000004,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800417 VK_LOGIC_OP_NO_OP = 0x00000005,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700418 VK_LOGIC_OP_XOR = 0x00000006,
419 VK_LOGIC_OP_OR = 0x00000007,
420 VK_LOGIC_OP_NOR = 0x00000008,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800421 VK_LOGIC_OP_EQUIVALENT = 0x00000009,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700422 VK_LOGIC_OP_INVERT = 0x0000000a,
423 VK_LOGIC_OP_OR_REVERSE = 0x0000000b,
424 VK_LOGIC_OP_COPY_INVERTED = 0x0000000c,
425 VK_LOGIC_OP_OR_INVERTED = 0x0000000d,
426 VK_LOGIC_OP_NAND = 0x0000000e,
427 VK_LOGIC_OP_SET = 0x0000000f,
428}
429
Jesse Hall3fbc8562015-11-29 22:10:52 -0800430enum VkSystemAllocationScope {
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800431 VK_SYSTEM_ALLOCATION_SCOPE_COMMAND = 0x00000000,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800432 VK_SYSTEM_ALLOCATION_SCOPE_OBJECT = 0x00000001,
433 VK_SYSTEM_ALLOCATION_SCOPE_CACHE = 0x00000002,
434 VK_SYSTEM_ALLOCATION_SCOPE_DEVICE = 0x00000003,
435 VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE = 0x00000004,
Jesse Hall03b6fe12015-11-24 12:44:21 -0800436}
437
Jesse Hall3fbc8562015-11-29 22:10:52 -0800438enum VkInternalAllocationType {
439 VK_INTERNAL_ALLOCATION_TYPE_EXECUTABLE = 0x00000000,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700440}
441
442enum VkPhysicalDeviceType {
443 VK_PHYSICAL_DEVICE_TYPE_OTHER = 0x00000000,
444 VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU = 0x00000001,
445 VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU = 0x00000002,
446 VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU = 0x00000003,
447 VK_PHYSICAL_DEVICE_TYPE_CPU = 0x00000004,
448}
449
Jesse Hall65ab5522015-11-30 00:07:16 -0800450enum VkVertexInputRate {
451 VK_VERTEX_INPUT_RATE_VERTEX = 0x00000000,
452 VK_VERTEX_INPUT_RATE_INSTANCE = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700453}
454
455/// Vulkan format definitions
456enum VkFormat {
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800457 VK_FORMAT_UNDEFINED = 0,
458 VK_FORMAT_R4G4_UNORM_PACK8 = 1,
459 VK_FORMAT_R4G4B4A4_UNORM_PACK16 = 2,
460 VK_FORMAT_B4G4R4A4_UNORM_PACK16 = 3,
461 VK_FORMAT_R5G6B5_UNORM_PACK16 = 4,
462 VK_FORMAT_B5G6R5_UNORM_PACK16 = 5,
463 VK_FORMAT_R5G5B5A1_UNORM_PACK16 = 6,
464 VK_FORMAT_B5G5R5A1_UNORM_PACK16 = 7,
465 VK_FORMAT_A1R5G5B5_UNORM_PACK16 = 8,
466 VK_FORMAT_R8_UNORM = 9,
467 VK_FORMAT_R8_SNORM = 10,
468 VK_FORMAT_R8_USCALED = 11,
469 VK_FORMAT_R8_SSCALED = 12,
470 VK_FORMAT_R8_UINT = 13,
471 VK_FORMAT_R8_SINT = 14,
472 VK_FORMAT_R8_SRGB = 15,
473 VK_FORMAT_R8G8_UNORM = 16,
474 VK_FORMAT_R8G8_SNORM = 17,
475 VK_FORMAT_R8G8_USCALED = 18,
476 VK_FORMAT_R8G8_SSCALED = 19,
477 VK_FORMAT_R8G8_UINT = 20,
478 VK_FORMAT_R8G8_SINT = 21,
479 VK_FORMAT_R8G8_SRGB = 22,
480 VK_FORMAT_R8G8B8_UNORM = 23,
481 VK_FORMAT_R8G8B8_SNORM = 24,
482 VK_FORMAT_R8G8B8_USCALED = 25,
483 VK_FORMAT_R8G8B8_SSCALED = 26,
484 VK_FORMAT_R8G8B8_UINT = 27,
485 VK_FORMAT_R8G8B8_SINT = 28,
486 VK_FORMAT_R8G8B8_SRGB = 29,
487 VK_FORMAT_B8G8R8_UNORM = 30,
488 VK_FORMAT_B8G8R8_SNORM = 31,
489 VK_FORMAT_B8G8R8_USCALED = 32,
490 VK_FORMAT_B8G8R8_SSCALED = 33,
491 VK_FORMAT_B8G8R8_UINT = 34,
492 VK_FORMAT_B8G8R8_SINT = 35,
493 VK_FORMAT_B8G8R8_SRGB = 36,
494 VK_FORMAT_R8G8B8A8_UNORM = 37,
495 VK_FORMAT_R8G8B8A8_SNORM = 38,
496 VK_FORMAT_R8G8B8A8_USCALED = 39,
497 VK_FORMAT_R8G8B8A8_SSCALED = 40,
498 VK_FORMAT_R8G8B8A8_UINT = 41,
499 VK_FORMAT_R8G8B8A8_SINT = 42,
500 VK_FORMAT_R8G8B8A8_SRGB = 43,
501 VK_FORMAT_B8G8R8A8_UNORM = 44,
502 VK_FORMAT_B8G8R8A8_SNORM = 45,
503 VK_FORMAT_B8G8R8A8_USCALED = 46,
504 VK_FORMAT_B8G8R8A8_SSCALED = 47,
505 VK_FORMAT_B8G8R8A8_UINT = 48,
506 VK_FORMAT_B8G8R8A8_SINT = 49,
507 VK_FORMAT_B8G8R8A8_SRGB = 50,
508 VK_FORMAT_A8B8G8R8_UNORM_PACK32 = 51,
509 VK_FORMAT_A8B8G8R8_SNORM_PACK32 = 52,
510 VK_FORMAT_A8B8G8R8_USCALED_PACK32 = 53,
511 VK_FORMAT_A8B8G8R8_SSCALED_PACK32 = 54,
512 VK_FORMAT_A8B8G8R8_UINT_PACK32 = 55,
513 VK_FORMAT_A8B8G8R8_SINT_PACK32 = 56,
514 VK_FORMAT_A8B8G8R8_SRGB_PACK32 = 57,
515 VK_FORMAT_A2R10G10B10_UNORM_PACK32 = 58,
516 VK_FORMAT_A2R10G10B10_SNORM_PACK32 = 59,
517 VK_FORMAT_A2R10G10B10_USCALED_PACK32 = 60,
518 VK_FORMAT_A2R10G10B10_SSCALED_PACK32 = 61,
519 VK_FORMAT_A2R10G10B10_UINT_PACK32 = 62,
520 VK_FORMAT_A2R10G10B10_SINT_PACK32 = 63,
521 VK_FORMAT_A2B10G10R10_UNORM_PACK32 = 64,
522 VK_FORMAT_A2B10G10R10_SNORM_PACK32 = 65,
523 VK_FORMAT_A2B10G10R10_USCALED_PACK32 = 66,
524 VK_FORMAT_A2B10G10R10_SSCALED_PACK32 = 67,
525 VK_FORMAT_A2B10G10R10_UINT_PACK32 = 68,
526 VK_FORMAT_A2B10G10R10_SINT_PACK32 = 69,
527 VK_FORMAT_R16_UNORM = 70,
528 VK_FORMAT_R16_SNORM = 71,
529 VK_FORMAT_R16_USCALED = 72,
530 VK_FORMAT_R16_SSCALED = 73,
531 VK_FORMAT_R16_UINT = 74,
532 VK_FORMAT_R16_SINT = 75,
533 VK_FORMAT_R16_SFLOAT = 76,
534 VK_FORMAT_R16G16_UNORM = 77,
535 VK_FORMAT_R16G16_SNORM = 78,
536 VK_FORMAT_R16G16_USCALED = 79,
537 VK_FORMAT_R16G16_SSCALED = 80,
538 VK_FORMAT_R16G16_UINT = 81,
539 VK_FORMAT_R16G16_SINT = 82,
540 VK_FORMAT_R16G16_SFLOAT = 83,
541 VK_FORMAT_R16G16B16_UNORM = 84,
542 VK_FORMAT_R16G16B16_SNORM = 85,
543 VK_FORMAT_R16G16B16_USCALED = 86,
544 VK_FORMAT_R16G16B16_SSCALED = 87,
545 VK_FORMAT_R16G16B16_UINT = 88,
546 VK_FORMAT_R16G16B16_SINT = 89,
547 VK_FORMAT_R16G16B16_SFLOAT = 90,
548 VK_FORMAT_R16G16B16A16_UNORM = 91,
549 VK_FORMAT_R16G16B16A16_SNORM = 92,
550 VK_FORMAT_R16G16B16A16_USCALED = 93,
551 VK_FORMAT_R16G16B16A16_SSCALED = 94,
552 VK_FORMAT_R16G16B16A16_UINT = 95,
553 VK_FORMAT_R16G16B16A16_SINT = 96,
554 VK_FORMAT_R16G16B16A16_SFLOAT = 97,
555 VK_FORMAT_R32_UINT = 98,
556 VK_FORMAT_R32_SINT = 99,
557 VK_FORMAT_R32_SFLOAT = 100,
558 VK_FORMAT_R32G32_UINT = 101,
559 VK_FORMAT_R32G32_SINT = 102,
560 VK_FORMAT_R32G32_SFLOAT = 103,
561 VK_FORMAT_R32G32B32_UINT = 104,
562 VK_FORMAT_R32G32B32_SINT = 105,
563 VK_FORMAT_R32G32B32_SFLOAT = 106,
564 VK_FORMAT_R32G32B32A32_UINT = 107,
565 VK_FORMAT_R32G32B32A32_SINT = 108,
566 VK_FORMAT_R32G32B32A32_SFLOAT = 109,
567 VK_FORMAT_R64_UINT = 110,
568 VK_FORMAT_R64_SINT = 111,
569 VK_FORMAT_R64_SFLOAT = 112,
570 VK_FORMAT_R64G64_UINT = 113,
571 VK_FORMAT_R64G64_SINT = 114,
572 VK_FORMAT_R64G64_SFLOAT = 115,
573 VK_FORMAT_R64G64B64_UINT = 116,
574 VK_FORMAT_R64G64B64_SINT = 117,
575 VK_FORMAT_R64G64B64_SFLOAT = 118,
576 VK_FORMAT_R64G64B64A64_UINT = 119,
577 VK_FORMAT_R64G64B64A64_SINT = 120,
578 VK_FORMAT_R64G64B64A64_SFLOAT = 121,
579 VK_FORMAT_B10G11R11_UFLOAT_PACK32 = 122,
580 VK_FORMAT_E5B9G9R9_UFLOAT_PACK32 = 123,
581 VK_FORMAT_D16_UNORM = 124,
582 VK_FORMAT_X8_D24_UNORM_PACK32 = 125,
583 VK_FORMAT_D32_SFLOAT = 126,
584 VK_FORMAT_S8_UINT = 127,
585 VK_FORMAT_D16_UNORM_S8_UINT = 128,
586 VK_FORMAT_D24_UNORM_S8_UINT = 129,
587 VK_FORMAT_D32_SFLOAT_S8_UINT = 130,
588 VK_FORMAT_BC1_RGB_UNORM_BLOCK = 131,
589 VK_FORMAT_BC1_RGB_SRGB_BLOCK = 132,
590 VK_FORMAT_BC1_RGBA_UNORM_BLOCK = 133,
591 VK_FORMAT_BC1_RGBA_SRGB_BLOCK = 134,
592 VK_FORMAT_BC2_UNORM_BLOCK = 135,
593 VK_FORMAT_BC2_SRGB_BLOCK = 136,
594 VK_FORMAT_BC3_UNORM_BLOCK = 137,
595 VK_FORMAT_BC3_SRGB_BLOCK = 138,
596 VK_FORMAT_BC4_UNORM_BLOCK = 139,
597 VK_FORMAT_BC4_SNORM_BLOCK = 140,
598 VK_FORMAT_BC5_UNORM_BLOCK = 141,
599 VK_FORMAT_BC5_SNORM_BLOCK = 142,
600 VK_FORMAT_BC6H_UFLOAT_BLOCK = 143,
601 VK_FORMAT_BC6H_SFLOAT_BLOCK = 144,
602 VK_FORMAT_BC7_UNORM_BLOCK = 145,
603 VK_FORMAT_BC7_SRGB_BLOCK = 146,
604 VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK = 147,
605 VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK = 148,
606 VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK = 149,
607 VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK = 150,
608 VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK = 151,
609 VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK = 152,
610 VK_FORMAT_EAC_R11_UNORM_BLOCK = 153,
611 VK_FORMAT_EAC_R11_SNORM_BLOCK = 154,
612 VK_FORMAT_EAC_R11G11_UNORM_BLOCK = 155,
613 VK_FORMAT_EAC_R11G11_SNORM_BLOCK = 156,
614 VK_FORMAT_ASTC_4x4_UNORM_BLOCK = 157,
615 VK_FORMAT_ASTC_4x4_SRGB_BLOCK = 158,
616 VK_FORMAT_ASTC_5x4_UNORM_BLOCK = 159,
617 VK_FORMAT_ASTC_5x4_SRGB_BLOCK = 160,
618 VK_FORMAT_ASTC_5x5_UNORM_BLOCK = 161,
619 VK_FORMAT_ASTC_5x5_SRGB_BLOCK = 162,
620 VK_FORMAT_ASTC_6x5_UNORM_BLOCK = 163,
621 VK_FORMAT_ASTC_6x5_SRGB_BLOCK = 164,
622 VK_FORMAT_ASTC_6x6_UNORM_BLOCK = 165,
623 VK_FORMAT_ASTC_6x6_SRGB_BLOCK = 166,
624 VK_FORMAT_ASTC_8x5_UNORM_BLOCK = 167,
625 VK_FORMAT_ASTC_8x5_SRGB_BLOCK = 168,
626 VK_FORMAT_ASTC_8x6_UNORM_BLOCK = 169,
627 VK_FORMAT_ASTC_8x6_SRGB_BLOCK = 170,
628 VK_FORMAT_ASTC_8x8_UNORM_BLOCK = 171,
629 VK_FORMAT_ASTC_8x8_SRGB_BLOCK = 172,
630 VK_FORMAT_ASTC_10x5_UNORM_BLOCK = 173,
631 VK_FORMAT_ASTC_10x5_SRGB_BLOCK = 174,
632 VK_FORMAT_ASTC_10x6_UNORM_BLOCK = 175,
633 VK_FORMAT_ASTC_10x6_SRGB_BLOCK = 176,
634 VK_FORMAT_ASTC_10x8_UNORM_BLOCK = 177,
635 VK_FORMAT_ASTC_10x8_SRGB_BLOCK = 178,
636 VK_FORMAT_ASTC_10x10_UNORM_BLOCK = 179,
637 VK_FORMAT_ASTC_10x10_SRGB_BLOCK = 180,
638 VK_FORMAT_ASTC_12x10_UNORM_BLOCK = 181,
639 VK_FORMAT_ASTC_12x10_SRGB_BLOCK = 182,
640 VK_FORMAT_ASTC_12x12_UNORM_BLOCK = 183,
641 VK_FORMAT_ASTC_12x12_SRGB_BLOCK = 184,
Chris Forbes289cb792016-12-30 15:03:55 +1300642
643 //@extension("VK_IMG_format_pvrtc")
644 VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG = 1000054000,
645
646 //@extension("VK_IMG_format_pvrtc")
647 VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG = 1000054001,
648
649 //@extension("VK_IMG_format_pvrtc")
650 VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG = 1000054002,
651
652 //@extension("VK_IMG_format_pvrtc")
653 VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG = 1000054003,
654
655 //@extension("VK_IMG_format_pvrtc")
656 VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG = 1000054004,
657
658 //@extension("VK_IMG_format_pvrtc")
659 VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG = 1000054005,
660
661 //@extension("VK_IMG_format_pvrtc")
662 VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG = 1000054006,
663
664 //@extension("VK_IMG_format_pvrtc")
665 VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG = 1000054007,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700666}
667
Jesse Halld27f6aa2015-08-15 17:58:48 -0700668/// Structure type enumerant
669enum VkStructureType {
670 VK_STRUCTURE_TYPE_APPLICATION_INFO = 0,
Jesse Hallc7467b72015-11-29 21:05:26 -0800671 VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO = 1,
672 VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO = 2,
673 VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO = 3,
674 VK_STRUCTURE_TYPE_SUBMIT_INFO = 4,
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800675 VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO = 5,
Jesse Hallc7467b72015-11-29 21:05:26 -0800676 VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE = 6,
677 VK_STRUCTURE_TYPE_BIND_SPARSE_INFO = 7,
678 VK_STRUCTURE_TYPE_FENCE_CREATE_INFO = 8,
679 VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO = 9,
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700680 VK_STRUCTURE_TYPE_EVENT_CREATE_INFO = 10,
Jesse Hallc7467b72015-11-29 21:05:26 -0800681 VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO = 11,
682 VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO = 12,
683 VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO = 13,
684 VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO = 14,
685 VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO = 15,
686 VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO = 16,
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800687 VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO = 17,
688 VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO = 18,
689 VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO = 19,
690 VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO = 20,
691 VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO = 21,
692 VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO = 22,
693 VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO = 23,
694 VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO = 24,
695 VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO = 25,
696 VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO = 26,
697 VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO = 27,
698 VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO = 28,
699 VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO = 29,
700 VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO = 30,
701 VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO = 31,
702 VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO = 32,
703 VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO = 33,
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800704 VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO = 34,
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800705 VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET = 35,
706 VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET = 36,
707 VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO = 37,
708 VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO = 38,
709 VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO = 39,
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800710 VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO = 40,
Jesse Hall3dd678a2016-01-08 21:52:01 -0800711 VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO = 41,
712 VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO = 42,
713 VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO = 43,
714 VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER = 44,
715 VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER = 45,
716 VK_STRUCTURE_TYPE_MEMORY_BARRIER = 46,
717 VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO = 47,
718 VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO = 48,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800719
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800720 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800721 VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR = 1000001000,
722 VK_STRUCTURE_TYPE_PRESENT_INFO_KHR = 1000001001,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800723
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800724 //@extension("VK_KHR_display")
Jesse Hallbd888842015-11-30 21:44:14 -0800725 VK_STRUCTURE_TYPE_DISPLAY_MODE_CREATE_INFO_KHR = 1000002000,
726 VK_STRUCTURE_TYPE_DISPLAY_SURFACE_CREATE_INFO_KHR = 1000002001,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800727
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800728 //@extension("VK_KHR_display_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800729 VK_STRUCTURE_TYPE_DISPLAY_DISPLAY_PRESENT_INFO_KHR = 1000003000,
Jesse Hallf9fa9a52016-01-08 16:08:51 -0800730
731 //@extension("VK_KHR_xlib_surface")
732 VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR = 1000004000,
733
734 //@extension("VK_KHR_xcb_surface")
735 VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR = 1000005000,
736
737 //@extension("VK_KHR_wayland_surface")
738 VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR = 1000006000,
739
740 //@extension("VK_KHR_mir_surface")
741 VK_STRUCTURE_TYPE_MIR_SURFACE_CREATE_INFO_KHR = 1000007000,
742
743 //@extension("VK_KHR_android_surface")
744 VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR = 1000008000,
745
746 //@extension("VK_KHR_win32_surface")
747 VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR = 1000009000,
Jesse Hall543a7ff2016-01-08 16:38:30 -0800748
Ian Elliott948233a2017-01-06 12:13:23 -0700749 //@extension("VK_KHR_incremental_present")
750 VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR = 1000084000,
751
Chia-I Wub262ddc2016-03-22 07:38:20 +0800752 //@extension("VK_ANDROID_native_buffer")
753 VK_STRUCTURE_TYPE_NATIVE_BUFFER_ANDROID = 1000010000,
Chris Forbes8e4438b2016-12-07 16:26:49 +1300754 VK_STRUCTURE_TYPE_SWAPCHAIN_IMAGE_CREATE_INFO_ANDROID = 1000010001,
Chia-I Wub262ddc2016-03-22 07:38:20 +0800755
Jesse Hall543a7ff2016-01-08 16:38:30 -0800756 //@extension("VK_EXT_debug_report")
Jesse Hall26763382016-05-20 07:13:52 -0700757 VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT = 1000011000,
758
759 //@extension("VK_AMD_rasterization_order")
760 VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD = 1000018000,
761
762 //@extension("VK_EXT_debug_marker")
763 VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_NAME_INFO_EXT = 1000022000,
764
765 //@extension("VK_EXT_debug_marker")
766 VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_TAG_INFO_EXT = 1000022001,
767
768 //@extension("VK_EXT_debug_marker")
769 VK_STRUCTURE_TYPE_DEBUG_MARKER_MARKER_INFO_EXT = 1000022002,
Jesse Hall56d386a2016-07-26 15:20:40 -0700770
771 //@extension("VK_NV_dedicated_allocation")
772 VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV = 1000026000,
773
774 //@extension("VK_NV_dedicated_allocation")
775 VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV = 1000026001,
776
777 //@extension("VK_NV_dedicated_allocation")
778 VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV = 1000026002,
Chris Forbes289cb792016-12-30 15:03:55 +1300779
780 //@extension("VK_NV_external_memory")
781 VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_NV = 1000056000,
782
783 //@extension("VK_NV_external_memory")
784 VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_NV = 1000056001,
785
786 //@extension("VK_NV_external_memory_win32")
787 VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_NV = 1000057000,
788
789 //@extension("VK_NV_external_memory_win32")
790 VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_NV = 1000057001,
791
792 //@extension("VK_NV_win32_keyed_mutex")
793 VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_NV = 1000058000,
794
Chris Forbes1194ede2016-12-30 16:29:25 +1300795 //@extension("VK_KHR_get_physical_device_properties2")
796 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR = 1000059000,
797
798 //@extension("VK_KHR_get_physical_device_properties2")
799 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR = 1000059001,
800
801 //@extension("VK_KHR_get_physical_device_properties2")
802 VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2_KHR = 1000059002,
803
804 //@extension("VK_KHR_get_physical_device_properties2")
805 VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2_KHR = 1000059003,
806
807 //@extension("VK_KHR_get_physical_device_properties2")
808 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2_KHR = 1000059004,
809
810 //@extension("VK_KHR_get_physical_device_properties2")
811 VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2_KHR = 1000059005,
812
813 //@extension("VK_KHR_get_physical_device_properties2")
814 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2_KHR = 1000059006,
815
816 //@extension("VK_KHR_get_physical_device_properties2")
817 VK_STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2_KHR = 1000059007,
818
819 //@extension("VK_KHR_get_physical_device_properties2")
820 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2_KHR = 1000059008,
821
Chris Forbes289cb792016-12-30 15:03:55 +1300822 //@extension("VK_EXT_validation_flags")
823 VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT = 1000061000,
824
825 //@extension("VK_KHR_incremental_present")
826 VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR = 1000084000,
827
828 //@extension("VK_NVX_device_generated_commands")
829 VK_STRUCTURE_TYPE_OBJECT_TABLE_CREATE_INFO_NVX = 1000086000,
830
831 //@extension("VK_NVX_device_generated_commands")
832 VK_STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_CREATE_INFO_NVX = 1000086001,
833
834 //@extension("VK_NVX_device_generated_commands")
835 VK_STRUCTURE_TYPE_CMD_PROCESS_COMMANDS_INFO_NVX = 1000086002,
836
837 //@extension("VK_NVX_device_generated_commands")
838 VK_STRUCTURE_TYPE_CMD_RESERVE_SPACE_FOR_COMMANDS_INFO_NVX = 1000086003,
839
840 //@extension("VK_NVX_device_generated_commands")
841 VK_STRUCTURE_TYPE_DEVICE_GENERATED_COMMANDS_LIMITS_NVX = 1000086004,
842
843 //@extension("VK_NVX_device_generated_commands")
844 VK_STRUCTURE_TYPE_DEVICE_GENERATED_COMMANDS_FEATURES_NVX = 1000086005,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700845}
846
Jesse Hall65ab5522015-11-30 00:07:16 -0800847enum VkSubpassContents {
848 VK_SUBPASS_CONTENTS_INLINE = 0x00000000,
849 VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700850}
851
Jesse Hall543a7ff2016-01-08 16:38:30 -0800852enum VkPipelineCacheHeaderVersion {
853 VK_PIPELINE_CACHE_HEADER_VERSION_ONE = 1,
854}
855
Jesse Hallbd888842015-11-30 21:44:14 -0800856@lastUnused(-11)
Jesse Halld27f6aa2015-08-15 17:58:48 -0700857/// Error and return codes
858enum VkResult {
859 // Return codes for successful operation execution (positive values)
Jesse Hallbd888842015-11-30 21:44:14 -0800860 VK_SUCCESS = 0,
861 VK_NOT_READY = 1,
862 VK_TIMEOUT = 2,
863 VK_EVENT_SET = 3,
864 VK_EVENT_RESET = 4,
865 VK_INCOMPLETE = 5,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700866
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800867 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800868 VK_SUBOPTIMAL_KHR = 1000001003,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800869
Jesse Halld27f6aa2015-08-15 17:58:48 -0700870 // Error codes (negative values)
Jesse Hallbd888842015-11-30 21:44:14 -0800871 VK_ERROR_OUT_OF_HOST_MEMORY = 0xFFFFFFFF, // -1
872 VK_ERROR_OUT_OF_DEVICE_MEMORY = 0xFFFFFFFE, // -2
873 VK_ERROR_INITIALIZATION_FAILED = 0xFFFFFFFD, // -3
874 VK_ERROR_DEVICE_LOST = 0xFFFFFFFC, // -4
875 VK_ERROR_MEMORY_MAP_FAILED = 0xFFFFFFFB, // -5
876 VK_ERROR_LAYER_NOT_PRESENT = 0xFFFFFFFA, // -6
877 VK_ERROR_EXTENSION_NOT_PRESENT = 0xFFFFFFF9, // -7
878 VK_ERROR_FEATURE_NOT_PRESENT = 0xFFFFFFF8, // -8
879 VK_ERROR_INCOMPATIBLE_DRIVER = 0xFFFFFFF7, // -9
880 VK_ERROR_TOO_MANY_OBJECTS = 0xFFFFFFF6, // -10
881 VK_ERROR_FORMAT_NOT_SUPPORTED = 0xFFFFFFF5, // -11
Jesse Hall56d386a2016-07-26 15:20:40 -0700882 VK_ERROR_FRAGMENTED_POOL = 0xFFFFFFF4, // -12
Jesse Hall1356b0d2015-11-23 17:24:58 -0800883
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800884 //@extension("VK_KHR_surface")
Jesse Hallbd888842015-11-30 21:44:14 -0800885 VK_ERROR_SURFACE_LOST_KHR = 0xC4653600, // -1000000000
Jesse Halla6429252015-11-29 18:59:42 -0800886
Jesse Hall563380d2016-01-15 23:14:05 -0800887 //@extension("VK_KHR_surface")
888 VK_ERROR_NATIVE_WINDOW_IN_USE_KHR = 0xC46535FF, // -1000008001
889
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800890 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800891 VK_ERROR_OUT_OF_DATE_KHR = 0xC4653214, // -1000001004
Jesse Hall1356b0d2015-11-23 17:24:58 -0800892
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800893 //@extension("VK_KHR_display_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800894 VK_ERROR_INCOMPATIBLE_DISPLAY_KHR = 0xC4652A47, // -1000003001
Jesse Hall1356b0d2015-11-23 17:24:58 -0800895
Jesse Hall543a7ff2016-01-08 16:38:30 -0800896 //@extension("VK_EXT_debug_report")
897 VK_ERROR_VALIDATION_FAILED_EXT = 0xC4650B07, // -1000011001
Jesse Hall26763382016-05-20 07:13:52 -0700898
899 //@extension("VK_NV_glsl_shader")
900 VK_ERROR_INVALID_SHADER_NV = 0xC4650720, // -1000012000
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700901}
902
903enum VkDynamicState {
904 VK_DYNAMIC_STATE_VIEWPORT = 0x00000000,
905 VK_DYNAMIC_STATE_SCISSOR = 0x00000001,
906 VK_DYNAMIC_STATE_LINE_WIDTH = 0x00000002,
907 VK_DYNAMIC_STATE_DEPTH_BIAS = 0x00000003,
908 VK_DYNAMIC_STATE_BLEND_CONSTANTS = 0x00000004,
909 VK_DYNAMIC_STATE_DEPTH_BOUNDS = 0x00000005,
910 VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK = 0x00000006,
911 VK_DYNAMIC_STATE_STENCIL_WRITE_MASK = 0x00000007,
912 VK_DYNAMIC_STATE_STENCIL_REFERENCE = 0x00000008,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700913}
914
Jesse Hall523db342015-11-30 21:12:55 -0800915@extension("VK_KHR_surface")
Michael Lentine88594d72015-11-12 12:49:45 -0800916enum VkPresentModeKHR {
917 VK_PRESENT_MODE_IMMEDIATE_KHR = 0x00000000,
918 VK_PRESENT_MODE_MAILBOX_KHR = 0x00000001,
919 VK_PRESENT_MODE_FIFO_KHR = 0x00000002,
Jesse Hall03b6fe12015-11-24 12:44:21 -0800920 VK_PRESENT_MODE_FIFO_RELAXED_KHR = 0x00000003,
Michael Lentine88594d72015-11-12 12:49:45 -0800921}
922
Jesse Hall523db342015-11-30 21:12:55 -0800923@extension("VK_KHR_surface")
Michael Lentine88594d72015-11-12 12:49:45 -0800924enum VkColorSpaceKHR {
925 VK_COLORSPACE_SRGB_NONLINEAR_KHR = 0x00000000,
926}
Jesse Halld27f6aa2015-08-15 17:58:48 -0700927
Jesse Hall715b86a2016-01-16 16:34:29 -0800928@extension("VK_EXT_debug_report")
929enum VkDebugReportObjectTypeEXT {
930 VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT = 0,
931 VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT = 1,
932 VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT = 2,
933 VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT = 3,
934 VK_DEBUG_REPORT_OBJECT_TYPE_QUEUE_EXT = 4,
935 VK_DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT = 5,
936 VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT = 6,
937 VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT = 7,
938 VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT = 8,
939 VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT = 9,
940 VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT = 10,
941 VK_DEBUG_REPORT_OBJECT_TYPE_EVENT_EXT = 11,
942 VK_DEBUG_REPORT_OBJECT_TYPE_QUERY_POOL_EXT = 12,
943 VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_VIEW_EXT = 13,
944 VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_VIEW_EXT = 14,
945 VK_DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT = 15,
946 VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_CACHE_EXT = 16,
947 VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_LAYOUT_EXT = 17,
948 VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT = 18,
949 VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT = 19,
950 VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT_EXT = 20,
951 VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_EXT = 21,
952 VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT = 22,
953 VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT = 23,
954 VK_DEBUG_REPORT_OBJECT_TYPE_FRAMEBUFFER_EXT = 24,
955 VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_POOL_EXT = 25,
956 VK_DEBUG_REPORT_OBJECT_TYPE_SURFACE_KHR_EXT = 26,
957 VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT = 27,
958 VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_EXT = 28,
Chris Forbes289cb792016-12-30 15:03:55 +1300959 VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_KHR_EXT = 29,
960 VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_MODE_KHR_EXT = 30,
961 VK_DEBUG_REPORT_OBJECT_TYPE_OBJECT_TABLE_NVX_EXT = 31,
962 VK_DEBUG_REPORT_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NVX_EXT = 32,
Jesse Hall715b86a2016-01-16 16:34:29 -0800963}
964
965@extension("VK_EXT_debug_report")
966enum VkDebugReportErrorEXT {
967 VK_DEBUG_REPORT_ERROR_NONE_EXT = 0,
968 VK_DEBUG_REPORT_ERROR_CALLBACK_REF_EXT = 1,
969}
970
Jesse Hall26763382016-05-20 07:13:52 -0700971@extension("VK_AMD_rasterization_order")
972enum VkRasterizationOrderAMD {
973 VK_RASTERIZATION_ORDER_STRICT_AMD = 0,
974 VK_RASTERIZATION_ORDER_RELAXED_AMD = 1,
975}
976
Chris Forbes289cb792016-12-30 15:03:55 +1300977@extension("VK_EXT_validation_flags")
978enum VkValidationCheckEXT {
979 VK_VALIDATION_CHECK_ALL_EXT = 0,
980}
981
982@extension("VK_NVX_device_generated_commands")
983enum VkIndirectCommandsTokenTypeNVX {
984 VK_INDIRECT_COMMANDS_TOKEN_PIPELINE_NVX = 0,
985 VK_INDIRECT_COMMANDS_TOKEN_DESCRIPTOR_SET_NVX = 1,
986 VK_INDIRECT_COMMANDS_TOKEN_INDEX_BUFFER_NVX = 2,
987 VK_INDIRECT_COMMANDS_TOKEN_VERTEX_BUFFER_NVX = 3,
988 VK_INDIRECT_COMMANDS_TOKEN_PUSH_CONSTANT_NVX = 4,
989 VK_INDIRECT_COMMANDS_TOKEN_DRAW_INDEXED_NVX = 5,
990 VK_INDIRECT_COMMANDS_TOKEN_DRAW_NVX = 6,
991 VK_INDIRECT_COMMANDS_TOKEN_DISPATCH_NVX = 7,
992}
993
994@extension("VK_NVX_device_generated_commands")
995enum VkObjectEntryTypeNVX {
996 VK_OBJECT_ENTRY_DESCRIPTOR_SET_NVX = 0,
997 VK_OBJECT_ENTRY_PIPELINE_NVX = 1,
998 VK_OBJECT_ENTRY_INDEX_BUFFER_NVX = 2,
999 VK_OBJECT_ENTRY_VERTEX_BUFFER_NVX = 3,
1000 VK_OBJECT_ENTRY_PUSH_CONSTANT_NVX = 4,
1001}
Jesse Hall715b86a2016-01-16 16:34:29 -08001002
Jesse Halld27f6aa2015-08-15 17:58:48 -07001003/////////////////
1004// Bitfields //
1005/////////////////
1006
Jesse Halld27f6aa2015-08-15 17:58:48 -07001007/// Queue capabilities
Jesse Halld8bade02015-11-24 10:24:18 -08001008type VkFlags VkQueueFlags
1009bitfield VkQueueFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001010 VK_QUEUE_GRAPHICS_BIT = 0x00000001, /// Queue supports graphics operations
1011 VK_QUEUE_COMPUTE_BIT = 0x00000002, /// Queue supports compute operations
Jesse Hall65ab5522015-11-30 00:07:16 -08001012 VK_QUEUE_TRANSFER_BIT = 0x00000004, /// Queue supports transfer operations
Jesse Hallb00daad2015-11-29 19:46:20 -08001013 VK_QUEUE_SPARSE_BINDING_BIT = 0x00000008, /// Queue supports sparse resource memory management operations
Jesse Halld27f6aa2015-08-15 17:58:48 -07001014}
1015
1016/// Memory properties passed into vkAllocMemory().
Jesse Halld8bade02015-11-24 10:24:18 -08001017type VkFlags VkMemoryPropertyFlags
1018bitfield VkMemoryPropertyFlagBits {
Jesse Halld1af8122015-11-29 23:50:38 -08001019 VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT = 0x00000001,
1020 VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT = 0x00000002,
1021 VK_MEMORY_PROPERTY_HOST_COHERENT_BIT = 0x00000004,
1022 VK_MEMORY_PROPERTY_HOST_CACHED_BIT = 0x00000008,
1023 VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT = 0x00000010,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001024}
1025
1026/// Memory heap flags
Jesse Halld8bade02015-11-24 10:24:18 -08001027type VkFlags VkMemoryHeapFlags
1028bitfield VkMemoryHeapFlagBits {
Jesse Halld1af8122015-11-29 23:50:38 -08001029 VK_MEMORY_HEAP_DEVICE_LOCAL_BIT = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001030}
1031
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001032/// Access flags
1033type VkFlags VkAccessFlags
1034bitfield VkAccessFlagBits {
1035 VK_ACCESS_INDIRECT_COMMAND_READ_BIT = 0x00000001,
1036 VK_ACCESS_INDEX_READ_BIT = 0x00000002,
1037 VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT = 0x00000004,
1038 VK_ACCESS_UNIFORM_READ_BIT = 0x00000008,
1039 VK_ACCESS_INPUT_ATTACHMENT_READ_BIT = 0x00000010,
1040 VK_ACCESS_SHADER_READ_BIT = 0x00000020,
1041 VK_ACCESS_SHADER_WRITE_BIT = 0x00000040,
1042 VK_ACCESS_COLOR_ATTACHMENT_READ_BIT = 0x00000080,
1043 VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT = 0x00000100,
1044 VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT = 0x00000200,
1045 VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT = 0x00000400,
1046 VK_ACCESS_TRANSFER_READ_BIT = 0x00000800,
1047 VK_ACCESS_TRANSFER_WRITE_BIT = 0x00001000,
1048 VK_ACCESS_HOST_READ_BIT = 0x00002000,
1049 VK_ACCESS_HOST_WRITE_BIT = 0x00004000,
1050 VK_ACCESS_MEMORY_READ_BIT = 0x00008000,
1051 VK_ACCESS_MEMORY_WRITE_BIT = 0x00010000,
Chris Forbes289cb792016-12-30 15:03:55 +13001052
1053 //@extension("VK_NVX_device_generated_commands")
1054 VK_ACCESS_COMMAND_PROCESS_READ_BIT_NVX = 0x00020000,
1055
1056 //@extension("VK_NVX_device_generated_commands")
1057 VK_ACCESS_COMMAND_PROCESS_WRITE_BIT_NVX = 0x00040000,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001058}
1059
1060/// Buffer usage flags
Jesse Halld8bade02015-11-24 10:24:18 -08001061type VkFlags VkBufferUsageFlags
1062bitfield VkBufferUsageFlagBits {
Jesse Hall3fbc8562015-11-29 22:10:52 -08001063 VK_BUFFER_USAGE_TRANSFER_SRC_BIT = 0x00000001, /// Can be used as a source of transfer operations
1064 VK_BUFFER_USAGE_TRANSFER_DST_BIT = 0x00000002, /// Can be used as a destination of transfer operations
Jesse Halld27f6aa2015-08-15 17:58:48 -07001065 VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000004, /// Can be used as TBO
1066 VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT = 0x00000008, /// Can be used as IBO
1067 VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT = 0x00000010, /// Can be used as UBO
1068 VK_BUFFER_USAGE_STORAGE_BUFFER_BIT = 0x00000020, /// Can be used as SSBO
1069 VK_BUFFER_USAGE_INDEX_BUFFER_BIT = 0x00000040, /// Can be used as source of fixed function index fetch (index buffer)
1070 VK_BUFFER_USAGE_VERTEX_BUFFER_BIT = 0x00000080, /// Can be used as source of fixed function vertex fetch (VBO)
1071 VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT = 0x00000100, /// Can be the source of indirect parameters (e.g. indirect buffer, parameter buffer)
1072}
1073
1074/// Buffer creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001075type VkFlags VkBufferCreateFlags
1076bitfield VkBufferCreateFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001077 VK_BUFFER_CREATE_SPARSE_BINDING_BIT = 0x00000001, /// Buffer should support sparse backing
Jesse Halld27f6aa2015-08-15 17:58:48 -07001078 VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002, /// Buffer should support sparse backing with partial residency
1079 VK_BUFFER_CREATE_SPARSE_ALIASED_BIT = 0x00000004, /// Buffer should support constent data access to physical memory blocks mapped into multiple locations of sparse buffers
1080}
1081
1082/// Shader stage flags
Jesse Halld8bade02015-11-24 10:24:18 -08001083type VkFlags VkShaderStageFlags
1084bitfield VkShaderStageFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001085 VK_SHADER_STAGE_VERTEX_BIT = 0x00000001,
Jesse Hallae38f732015-11-19 21:32:50 -08001086 VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT = 0x00000002,
1087 VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001088 VK_SHADER_STAGE_GEOMETRY_BIT = 0x00000008,
1089 VK_SHADER_STAGE_FRAGMENT_BIT = 0x00000010,
1090 VK_SHADER_STAGE_COMPUTE_BIT = 0x00000020,
Jesse Hallc7467b72015-11-29 21:05:26 -08001091 VK_SHADER_STAGE_ALL_GRAPHICS = 0x0000001F,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001092
1093 VK_SHADER_STAGE_ALL = 0x7FFFFFFF,
1094}
1095
Jesse Hallfbf97b02015-11-20 14:17:03 -08001096/// Descriptor pool create flags
Jesse Halld8bade02015-11-24 10:24:18 -08001097type VkFlags VkDescriptorPoolCreateFlags
1098bitfield VkDescriptorPoolCreateFlagBits {
Jesse Hallfbf97b02015-11-20 14:17:03 -08001099 VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT = 0x00000001,
1100}
1101
1102/// Descriptor pool reset flags
Jesse Halld8bade02015-11-24 10:24:18 -08001103type VkFlags VkDescriptorPoolResetFlags
Jesse Halla6429252015-11-29 18:59:42 -08001104//bitfield VkDescriptorPoolResetFlagBits {
1105//}
Jesse Hallfbf97b02015-11-20 14:17:03 -08001106
Jesse Halld27f6aa2015-08-15 17:58:48 -07001107/// Image usage flags
Jesse Halld8bade02015-11-24 10:24:18 -08001108type VkFlags VkImageUsageFlags
1109bitfield VkImageUsageFlagBits {
Jesse Hall3fbc8562015-11-29 22:10:52 -08001110 VK_IMAGE_USAGE_TRANSFER_SRC_BIT = 0x00000001, /// Can be used as a source of transfer operations
1111 VK_IMAGE_USAGE_TRANSFER_DST_BIT = 0x00000002, /// Can be used as a destination of transfer operations
Jesse Halld27f6aa2015-08-15 17:58:48 -07001112 VK_IMAGE_USAGE_SAMPLED_BIT = 0x00000004, /// Can be sampled from (SAMPLED_IMAGE and COMBINED_IMAGE_SAMPLER descriptor types)
1113 VK_IMAGE_USAGE_STORAGE_BIT = 0x00000008, /// Can be used as storage image (STORAGE_IMAGE descriptor type)
1114 VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT = 0x00000010, /// Can be used as framebuffer color attachment
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001115 VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000020, /// Can be used as framebuffer depth/stencil attachment
Jesse Halld27f6aa2015-08-15 17:58:48 -07001116 VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT = 0x00000040, /// Image data not needed outside of rendering
1117 VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT = 0x00000080, /// Can be used as framebuffer input attachment
1118}
1119
1120/// Image creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001121type VkFlags VkImageCreateFlags
1122bitfield VkImageCreateFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001123 VK_IMAGE_CREATE_SPARSE_BINDING_BIT = 0x00000001, /// Image should support sparse backing
Jesse Halld27f6aa2015-08-15 17:58:48 -07001124 VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002, /// Image should support sparse backing with partial residency
1125 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 -07001126 VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT = 0x00000008, /// Allows image views to have different format than the base image
1127 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 -07001128}
1129
Jesse Hallb00daad2015-11-29 19:46:20 -08001130/// Image view creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001131type VkFlags VkImageViewCreateFlags
Jesse Hallb00daad2015-11-29 19:46:20 -08001132//bitfield VkImageViewCreateFlagBits {
1133//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001134
1135/// Pipeline creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001136type VkFlags VkPipelineCreateFlags
1137bitfield VkPipelineCreateFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001138 VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT = 0x00000001,
1139 VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT = 0x00000002,
1140 VK_PIPELINE_CREATE_DERIVATIVE_BIT = 0x00000004,
1141}
1142
Jesse Hall65ab5522015-11-30 00:07:16 -08001143/// Color component flags
1144type VkFlags VkColorComponentFlags
1145bitfield VkColorComponentFlagBits {
1146 VK_COLOR_COMPONENT_R_BIT = 0x00000001,
1147 VK_COLOR_COMPONENT_G_BIT = 0x00000002,
1148 VK_COLOR_COMPONENT_B_BIT = 0x00000004,
1149 VK_COLOR_COMPONENT_A_BIT = 0x00000008,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001150}
1151
1152/// Fence creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001153type VkFlags VkFenceCreateFlags
1154bitfield VkFenceCreateFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001155 VK_FENCE_CREATE_SIGNALED_BIT = 0x00000001,
1156}
1157
1158/// Semaphore creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001159type VkFlags VkSemaphoreCreateFlags
Jesse Halla6429252015-11-29 18:59:42 -08001160//bitfield VkSemaphoreCreateFlagBits {
1161//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001162
1163/// Format capability flags
Jesse Halld8bade02015-11-24 10:24:18 -08001164type VkFlags VkFormatFeatureFlags
1165bitfield VkFormatFeatureFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001166 VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT = 0x00000001, /// Format can be used for sampled images (SAMPLED_IMAGE and COMBINED_IMAGE_SAMPLER descriptor types)
1167 VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT = 0x00000002, /// Format can be used for storage images (STORAGE_IMAGE descriptor type)
1168 VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT = 0x00000004, /// Format supports atomic operations in case it's used for storage images
1169 VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000008, /// Format can be used for uniform texel buffers (TBOs)
1170 VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT = 0x00000010, /// Format can be used for storage texel buffers (IBOs)
1171 VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT = 0x00000020, /// Format supports atomic operations in case it's used for storage texel buffers
1172 VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT = 0x00000040, /// Format can be used for vertex buffers (VBOs)
1173 VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT = 0x00000080, /// Format can be used for color attachment images
1174 VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT = 0x00000100, /// Format supports blending in case it's used for color attachment images
1175 VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000200, /// Format can be used for depth/stencil attachment images
Jesse Hall3fbc8562015-11-29 22:10:52 -08001176 VK_FORMAT_FEATURE_BLIT_SRC_BIT = 0x00000400, /// Format can be used as the source image of blits with vkCommandBlitImage
1177 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 -08001178 VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT = 0x00001000,
Jesse Hall26763382016-05-20 07:13:52 -07001179
1180 //@extension("VK_IMG_filter_cubic")
1181 VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG = 0x00002000,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001182}
1183
1184/// Query control flags
Jesse Halld8bade02015-11-24 10:24:18 -08001185type VkFlags VkQueryControlFlags
1186bitfield VkQueryControlFlagBits {
Jesse Hall65ab5522015-11-30 00:07:16 -08001187 VK_QUERY_CONTROL_PRECISE_BIT = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001188}
1189
1190/// Query result flags
Jesse Halld8bade02015-11-24 10:24:18 -08001191type VkFlags VkQueryResultFlags
1192bitfield VkQueryResultFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001193 VK_QUERY_RESULT_64_BIT = 0x00000001, /// Results of the queries are written to the destination buffer as 64-bit values
1194 VK_QUERY_RESULT_WAIT_BIT = 0x00000002, /// Results of the queries are waited on before proceeding with the result copy
1195 VK_QUERY_RESULT_WITH_AVAILABILITY_BIT = 0x00000004, /// Besides the results of the query, the availability of the results is also written
1196 VK_QUERY_RESULT_PARTIAL_BIT = 0x00000008, /// Copy the partial results of the query even if the final results aren't available
1197}
1198
1199/// Shader module creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001200type VkFlags VkShaderModuleCreateFlags
Jesse Halla6429252015-11-29 18:59:42 -08001201//bitfield VkShaderModuleCreateFlagBits {
1202//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001203
Jesse Halld27f6aa2015-08-15 17:58:48 -07001204/// Event creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001205type VkFlags VkEventCreateFlags
Jesse Halla6429252015-11-29 18:59:42 -08001206//bitfield VkEventCreateFlagBits {
1207//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001208
Jesse Halla15a4bf2015-11-19 22:48:02 -08001209/// Command buffer usage flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001210type VkFlags VkCommandBufferUsageFlags
1211bitfield VkCommandBufferUsageFlagBits {
1212 VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT = 0x00000001,
1213 VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT = 0x00000002,
1214 VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001215}
1216
1217/// Pipeline statistics flags
Jesse Halld8bade02015-11-24 10:24:18 -08001218type VkFlags VkQueryPipelineStatisticFlags
1219bitfield VkQueryPipelineStatisticFlagBits {
Jesse Hallae38f732015-11-19 21:32:50 -08001220 VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_BIT = 0x00000001, /// Optional
1221 VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_PRIMITIVES_BIT = 0x00000002, /// Optional
1222 VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT = 0x00000004, /// Optional
1223 VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_INVOCATIONS_BIT = 0x00000008, /// Optional
1224 VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT = 0x00000010, /// Optional
1225 VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT = 0x00000020, /// Optional
1226 VK_QUERY_PIPELINE_STATISTIC_CLIPPING_PRIMITIVES_BIT = 0x00000040, /// Optional
1227 VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT = 0x00000080, /// Optional
1228 VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT = 0x00000100, /// Optional
1229 VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT = 0x00000200, /// Optional
1230 VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT = 0x00000400, /// Optional
Jesse Halld27f6aa2015-08-15 17:58:48 -07001231}
1232
1233/// Memory mapping flags
Jesse Halld8bade02015-11-24 10:24:18 -08001234type VkFlags VkMemoryMapFlags
Jesse Halla6429252015-11-29 18:59:42 -08001235//bitfield VkMemoryMapFlagBits {
1236//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001237
1238/// Bitfield of image aspects
Jesse Halld8bade02015-11-24 10:24:18 -08001239type VkFlags VkImageAspectFlags
1240bitfield VkImageAspectFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001241 VK_IMAGE_ASPECT_COLOR_BIT = 0x00000001,
1242 VK_IMAGE_ASPECT_DEPTH_BIT = 0x00000002,
1243 VK_IMAGE_ASPECT_STENCIL_BIT = 0x00000004,
1244 VK_IMAGE_ASPECT_METADATA_BIT = 0x00000008,
1245}
1246
1247/// Sparse memory bind flags
Jesse Halld8bade02015-11-24 10:24:18 -08001248type VkFlags VkSparseMemoryBindFlags
Jesse Hall091ed9e2015-11-30 00:55:29 -08001249bitfield VkSparseMemoryBindFlagBits {
1250 VK_SPARSE_MEMORY_BIND_METADATA_BIT = 0x00000001,
1251}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001252
1253/// Sparse image memory requirements flags
Jesse Halld8bade02015-11-24 10:24:18 -08001254type VkFlags VkSparseImageFormatFlags
1255bitfield VkSparseImageFormatFlagBits {
Jesse Hallb00daad2015-11-29 19:46:20 -08001256 VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT = 0x00000001, /// Image uses a single miptail region for all array slices
1257 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.
1258 VK_SPARSE_IMAGE_FORMAT_NONSTANDARD_BLOCK_SIZE_BIT = 0x00000004, /// Image uses a non-standard sparse block size
Jesse Halld27f6aa2015-08-15 17:58:48 -07001259}
1260
1261/// Pipeline stages
Jesse Halld8bade02015-11-24 10:24:18 -08001262type VkFlags VkPipelineStageFlags
1263bitfield VkPipelineStageFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001264 VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT = 0x00000001, /// Before subsequent commands are processed
1265 VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT = 0x00000002, /// Draw/DispatchIndirect command fetch
1266 VK_PIPELINE_STAGE_VERTEX_INPUT_BIT = 0x00000004, /// Vertex/index fetch
1267 VK_PIPELINE_STAGE_VERTEX_SHADER_BIT = 0x00000008, /// Vertex shading
Jesse Hallae38f732015-11-19 21:32:50 -08001268 VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT = 0x00000010, /// Tessellation control shading
1269 VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT = 0x00000020, /// Tessellation evaluation shading
Jesse Halld27f6aa2015-08-15 17:58:48 -07001270 VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT = 0x00000040, /// Geometry shading
1271 VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT = 0x00000080, /// Fragment shading
1272 VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT = 0x00000100, /// Early fragment (depth/stencil) tests
1273 VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT = 0x00000200, /// Late fragment (depth/stencil) tests
1274 VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT = 0x00000400, /// Color attachment writes
1275 VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT = 0x00000800, /// Compute shading
1276 VK_PIPELINE_STAGE_TRANSFER_BIT = 0x00001000, /// Transfer/copy operations
Jesse Hall543a7ff2016-01-08 16:38:30 -08001277 VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT = 0x00002000,
1278 VK_PIPELINE_STAGE_HOST_BIT = 0x00004000, /// Indicates host (CPU) is a source/sink of the dependency
Jesse Halld27f6aa2015-08-15 17:58:48 -07001279
Jesse Hall543a7ff2016-01-08 16:38:30 -08001280 VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT = 0x00008000, /// All stages of the graphics pipeline
1281 VK_PIPELINE_STAGE_ALL_COMMANDS_BIT = 0x00010000, /// All graphics, compute, copy, and transition commands
Chris Forbes289cb792016-12-30 15:03:55 +13001282
1283 //@extension("VK_NVX_device_generated_commands")
1284 VK_PIPELINE_STAGE_COMMAND_PROCESS_BIT_NVX = 0x00020000,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001285}
1286
1287/// Render pass attachment description flags
Jesse Halld8bade02015-11-24 10:24:18 -08001288type VkFlags VkAttachmentDescriptionFlags
1289bitfield VkAttachmentDescriptionFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001290 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 -07001291}
1292
1293/// Subpass description flags
Jesse Halld8bade02015-11-24 10:24:18 -08001294type VkFlags VkSubpassDescriptionFlags
1295bitfield VkSubpassDescriptionFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001296}
1297
1298/// Command pool creation flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001299type VkFlags VkCommandPoolCreateFlags
1300bitfield VkCommandPoolCreateFlagBits {
1301 VK_COMMAND_POOL_CREATE_TRANSIENT_BIT = 0x00000001, /// Command buffers have a short lifetime
1302 VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT = 0x00000002, /// Command buffers may release their memory individually
Jesse Halld27f6aa2015-08-15 17:58:48 -07001303}
1304
1305/// Command pool reset flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001306type VkFlags VkCommandPoolResetFlags
1307bitfield VkCommandPoolResetFlagBits {
1308 VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT = 0x00000001, /// Release resources owned by the pool
Jesse Halld27f6aa2015-08-15 17:58:48 -07001309}
1310
Jesse Hall3fbc8562015-11-29 22:10:52 -08001311type VkFlags VkCommandBufferResetFlags
1312bitfield VkCommandBufferResetFlagBits {
1313 VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT = 0x00000001, /// Release resources owned by the buffer
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001314}
1315
Jesse Halld8bade02015-11-24 10:24:18 -08001316type VkFlags VkSampleCountFlags
1317bitfield VkSampleCountFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001318 VK_SAMPLE_COUNT_1_BIT = 0x00000001,
1319 VK_SAMPLE_COUNT_2_BIT = 0x00000002,
1320 VK_SAMPLE_COUNT_4_BIT = 0x00000004,
1321 VK_SAMPLE_COUNT_8_BIT = 0x00000008,
1322 VK_SAMPLE_COUNT_16_BIT = 0x00000010,
1323 VK_SAMPLE_COUNT_32_BIT = 0x00000020,
1324 VK_SAMPLE_COUNT_64_BIT = 0x00000040,
1325}
1326
Jesse Halld8bade02015-11-24 10:24:18 -08001327type VkFlags VkStencilFaceFlags
1328bitfield VkStencilFaceFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001329 VK_STENCIL_FACE_FRONT_BIT = 0x00000001, /// Front face
1330 VK_STENCIL_FACE_BACK_BIT = 0x00000002, /// Back face
Jesse Hallc7467b72015-11-29 21:05:26 -08001331 VK_STENCIL_FRONT_AND_BACK = 0x00000003,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001332}
1333
Jesse Halla6429252015-11-29 18:59:42 -08001334/// Instance creation flags
1335type VkFlags VkInstanceCreateFlags
1336//bitfield VkInstanceCreateFlagBits {
1337//}
1338
1339/// Device creation flags
1340type VkFlags VkDeviceCreateFlags
1341//bitfield VkDeviceCreateFlagBits {
1342//}
1343
1344/// Device queue creation flags
1345type VkFlags VkDeviceQueueCreateFlags
1346//bitfield VkDeviceQueueCreateFlagBits {
1347//}
1348
1349/// Query pool creation flags
1350type VkFlags VkQueryPoolCreateFlags
1351//bitfield VkQueryPoolCreateFlagBits {
1352//}
1353
1354/// Buffer view creation flags
1355type VkFlags VkBufferViewCreateFlags
1356//bitfield VkBufferViewCreateFlagBits {
1357//}
1358
1359/// Pipeline cache creation flags
1360type VkFlags VkPipelineCacheCreateFlags
1361//bitfield VkPipelineCacheCreateFlagBits {
1362//}
1363
1364/// Pipeline shader stage creation flags
1365type VkFlags VkPipelineShaderStageCreateFlags
1366//bitfield VkPipelineShaderStageCreateFlagBits {
1367//}
1368
1369/// Descriptor set layout creation flags
1370type VkFlags VkDescriptorSetLayoutCreateFlags
1371//bitfield VkDescriptorSetLayoutCreateFlagBits {
1372//}
1373
1374/// Pipeline vertex input state creation flags
1375type VkFlags VkPipelineVertexInputStateCreateFlags
1376//bitfield VkPipelineVertexInputStateCreateFlagBits {
1377//}
1378
1379/// Pipeline input assembly state creation flags
1380type VkFlags VkPipelineInputAssemblyStateCreateFlags
1381//bitfield VkPipelineInputAssemblyStateCreateFlagBits {
1382//}
1383
1384/// Tessellation state creation flags
1385type VkFlags VkPipelineTessellationStateCreateFlags
1386//bitfield VkPipelineTessellationStateCreateFlagBits {
1387//}
1388
1389/// Viewport state creation flags
1390type VkFlags VkPipelineViewportStateCreateFlags
1391//bitfield VkPipelineViewportStateCreateFlagBits {
1392//}
1393
Jesse Hall3fbc8562015-11-29 22:10:52 -08001394/// Rasterization state creation flags
1395type VkFlags VkPipelineRasterizationStateCreateFlags
1396//bitfield VkPipelineRasterizationStateCreateFlagBits {
Jesse Halla6429252015-11-29 18:59:42 -08001397//}
1398
1399/// Multisample state creation flags
1400type VkFlags VkPipelineMultisampleStateCreateFlags
1401//bitfield VkPipelineMultisampleStateCreateFlagBits {
1402//}
1403
1404/// Color blend state creation flags
1405type VkFlags VkPipelineColorBlendStateCreateFlags
1406//bitfield VkPipelineColorBlendStateCreateFlagBits {
1407//}
1408
1409/// Depth/stencil state creation flags
1410type VkFlags VkPipelineDepthStencilStateCreateFlags
1411//bitfield VkPipelineDepthStencilStateCreateFlagBits {
1412//}
1413
1414/// Dynamic state creation flags
1415type VkFlags VkPipelineDynamicStateCreateFlags
1416//bitfield VkPipelineDynamicStateCreateFlagBits {
1417//}
1418
1419/// Pipeline layout creation flags
1420type VkFlags VkPipelineLayoutCreateFlags
1421//bitfield VkPipelineLayoutCreateFlagBits {
1422//}
1423
1424/// Sampler creation flags
1425type VkFlags VkSamplerCreateFlags
1426//bitfield VkSamplerCreateFlagBits {
1427//}
1428
1429/// Render pass creation flags
1430type VkFlags VkRenderPassCreateFlags
1431//bitfield VkRenderPassCreateFlagBits {
1432//}
1433
1434/// Framebuffer creation flags
1435type VkFlags VkFramebufferCreateFlags
1436//bitfield VkFramebufferCreateFlagBits {
1437//}
1438
Jesse Halldc6d36c2015-11-29 19:12:15 -08001439/// Dependency flags
1440type VkFlags VkDependencyFlags
1441bitfield VkDependencyFlagBits {
1442 VK_DEPENDENCY_BY_REGION_BIT = 0x00000001,
1443}
1444
Jesse Hallc7467b72015-11-29 21:05:26 -08001445/// Cull mode flags
1446type VkFlags VkCullModeFlags
1447bitfield VkCullModeFlagBits {
1448 VK_CULL_MODE_NONE = 0x00000000,
1449 VK_CULL_MODE_FRONT_BIT = 0x00000001,
1450 VK_CULL_MODE_BACK_BIT = 0x00000002,
1451 VK_CULL_MODE_FRONT_AND_BACK = 0x00000003,
1452}
1453
Jesse Hall523db342015-11-30 21:12:55 -08001454@extension("VK_KHR_surface")
Jesse Halld8bade02015-11-24 10:24:18 -08001455type VkFlags VkSurfaceTransformFlagsKHR
Jesse Hall523db342015-11-30 21:12:55 -08001456@extension("VK_KHR_surface")
Jesse Halld8bade02015-11-24 10:24:18 -08001457bitfield VkSurfaceTransformFlagBitsKHR {
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001458 VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR = 0x00000001,
Jesse Hall9ba8bc82015-11-30 16:22:16 -08001459 VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR = 0x00000002,
1460 VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR = 0x00000004,
1461 VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR = 0x00000008,
1462 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR = 0x00000010,
1463 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR = 0x00000020,
1464 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR = 0x00000040,
1465 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR = 0x00000080,
1466 VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR = 0x00000100,
Michael Lentine88594d72015-11-12 12:49:45 -08001467}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001468
Jesse Hall523db342015-11-30 21:12:55 -08001469@extension("VK_KHR_surface")
Jesse Halla6429252015-11-29 18:59:42 -08001470type VkFlags VkCompositeAlphaFlagsKHR
Jesse Hall523db342015-11-30 21:12:55 -08001471@extension("VK_KHR_surface")
Jesse Halla6429252015-11-29 18:59:42 -08001472bitfield VkCompositeAlphaFlagBitsKHR {
1473 VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR = 0x00000001,
1474 VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR = 0x00000002,
1475 VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR = 0x00000004,
1476 VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR = 0x00000008,
1477}
1478
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001479@extension("VK_KHR_swapchain")
1480type VkFlags VkSwapchainCreateFlagsKHR
1481//@extension("VK_KHR_swapchain")
1482//bitfield VkSwapchainCreateFlagBitsKHR {
1483//}
1484
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001485@extension("VK_KHR_display")
Jesse Halld8bade02015-11-24 10:24:18 -08001486type VkFlags VkDisplayPlaneAlphaFlagsKHR
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001487@extension("VK_KHR_display")
Jesse Halld8bade02015-11-24 10:24:18 -08001488bitfield VkDisplayPlaneAlphaFlagBitsKHR {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001489 VK_DISPLAY_PLANE_ALPHA_OPAQUE_BIT_KHR = 0x00000001,
1490 VK_DISPLAY_PLANE_ALPHA_GLOBAL_BIT_KHR = 0x00000002,
1491 VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_BIT_KHR = 0x00000004,
1492 VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_PREMULTIPLIED_BIT_KHR = 0x00000008,
Jesse Hall1356b0d2015-11-23 17:24:58 -08001493}
1494
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001495@extension("VK_KHR_display")
1496type VkFlags VkDisplaySurfaceCreateFlagsKHR
1497//@extension("VK_KHR_display")
1498//bitfield VkDisplaySurfaceCreateFlagBitsKHR {
1499//}
1500
Jesse Hall9ba8bc82015-11-30 16:22:16 -08001501@extension("VK_KHR_display")
1502type VkFlags VkDisplayModeCreateFlagsKHR
1503//@extension("VK_KHR_display")
1504//bitfield VkDisplayModeCreateFlagBitsKHR {
1505//}
1506
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001507@extension("VK_KHR_xlib_surface")
1508type VkFlags VkXlibSurfaceCreateFlagsKHR
1509//@extension("VK_KHR_xlib_surface")
1510//bitfield VkXlibSurfaceCreateFlagBitsKHR {
1511//}
1512
1513@extension("VK_KHR_xcb_surface")
1514type VkFlags VkXcbSurfaceCreateFlagsKHR
1515//@extension("VK_KHR_xcb_surface")
1516//bitfield VkXcbSurfaceCreateFlagBitsKHR {
1517//}
1518
1519@extension("VK_KHR_wayland_surface")
1520type VkFlags VkWaylandSurfaceCreateFlagsKHR
1521//@extension("VK_KHR_wayland_surface")
1522//bitfield VkWaylandSurfaceCreateFlagBitsKHR {
1523//}
1524
1525@extension("VK_KHR_mir_surface")
1526type VkFlags VkMirSurfaceCreateFlagsKHR
1527//@extension("VK_KHR_mir_surface")
1528//bitfield VkMirSurfaceCreateFlagBitsKHR {
1529//}
1530
1531@extension("VK_KHR_android_surface")
1532type VkFlags VkAndroidSurfaceCreateFlagsKHR
1533//@extension("VK_KHR_android_surface")
1534//bitfield VkAndroidSurfaceCreateFlagBitsKHR {
1535//}
1536
1537@extension("VK_KHR_win32_surface")
1538type VkFlags VkWin32SurfaceCreateFlagsKHR
1539//@extension("VK_KHR_win32_surface")
1540//bitfield VkWin32SurfaceCreateFlagBitsKHR {
1541//}
1542
Jesse Hall715b86a2016-01-16 16:34:29 -08001543@extension("VK_EXT_debug_report")
1544type VkFlags VkDebugReportFlagsEXT
1545@extension("VK_EXT_debug_report")
1546bitfield VkDebugReportFlagBitsEXT {
Jesse Halle2948d82016-02-25 04:19:32 -08001547 VK_DEBUG_REPORT_INFORMATION_BIT_EXT = 0x00000001,
1548 VK_DEBUG_REPORT_WARNING_BIT_EXT = 0x00000002,
1549 VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT = 0x00000004,
Jesse Hall715b86a2016-01-16 16:34:29 -08001550 VK_DEBUG_REPORT_ERROR_BIT_EXT = 0x00000008,
1551 VK_DEBUG_REPORT_DEBUG_BIT_EXT = 0x00000010,
1552}
1553
Chris Forbes8e4438b2016-12-07 16:26:49 +13001554@extension("VK_ANDROID_native_buffer")
1555type VkFlags VkSwapchainImageUsageFlagsANDROID
1556@extension("VK_ANDROID_native_buffer")
1557bitfield VkSwapchainImageUsageFlagBitsANDROID {
1558 VK_SWAPCHAIN_IMAGE_USAGE_FLAGS_FRONT_BUFFER_BIT_ANDROID = 0x00000001,
1559}
1560
Chris Forbes289cb792016-12-30 15:03:55 +13001561@extension("VK_NV_external_memory_capabilities")
1562type VkFlags VkExternalMemoryHandleTypeFlagsNV
1563@extension("VK_NV_external_memory_capabilities")
1564bitfield VkExternalMemoryHandleTypeFlagBitsNV {
1565 VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_NV = 0x00000001,
1566 VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_NV = 0x00000002,
1567 VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_IMAGE_BIT_NV = 0x00000004,
1568 VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_IMAGE_KMT_BIT_NV = 0x00000008,
1569}
1570
1571@extension("VK_NV_external_memory_capabilities")
1572type VkFlags VkExternalMemoryFeatureFlagsNV
1573@extension("VK_NV_external_memory_capabilities")
1574bitfield VkExternalMemoryFeatureFlagBitsNV {
1575 VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT_NV = 0x00000001,
1576 VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT_NV = 0x00000002,
1577 VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT_NV = 0x00000004,
1578}
1579
1580@extension("VK_NVX_device_generated_commands")
1581type VkFlags VkIndirectCommandsLayoutUsageFlagsNVX
1582@extension("VK_NVX_device_generated_commands")
1583bitfield VkIndirectCommandsLayoutUsageFlagBitsNVX {
1584 VK_INDIRECT_COMMANDS_LAYOUT_USAGE_UNORDERED_SEQUENCES_BIT_NVX = 0x00000001,
1585 VK_INDIRECT_COMMANDS_LAYOUT_USAGE_SPARSE_SEQUENCES_BIT_NVX = 0x00000002,
1586 VK_INDIRECT_COMMANDS_LAYOUT_USAGE_EMPTY_EXECUTIONS_BIT_NVX = 0x00000004,
1587 VK_INDIRECT_COMMANDS_LAYOUT_USAGE_INDEXED_SEQUENCES_BIT_NVX = 0x00000008,
1588}
1589
1590@extension("VK_NVX_device_generated_commands")
1591type VkFlags VkObjectEntryUsageFlagsNVX
1592@extension("VK_NVX_device_generated_commands")
1593bitfield VkObjectEntryUsageFlagBitsNVX {
1594 VK_OBJECT_ENTRY_USAGE_GRAPHICS_BIT_NVX = 0x00000001,
1595 VK_OBJECT_ENTRY_USAGE_COMPUTE_BIT_NVX = 0x00000002,
1596}
1597
Jesse Hall1356b0d2015-11-23 17:24:58 -08001598
Jesse Halld27f6aa2015-08-15 17:58:48 -07001599//////////////////
1600// Structures //
1601//////////////////
1602
1603class VkOffset2D {
1604 s32 x
1605 s32 y
1606}
1607
1608class VkOffset3D {
1609 s32 x
1610 s32 y
1611 s32 z
1612}
1613
1614class VkExtent2D {
Jesse Hall3dd678a2016-01-08 21:52:01 -08001615 u32 width
1616 u32 height
Jesse Halld27f6aa2015-08-15 17:58:48 -07001617}
1618
1619class VkExtent3D {
Jesse Hall3dd678a2016-01-08 21:52:01 -08001620 u32 width
1621 u32 height
1622 u32 depth
Jesse Halld27f6aa2015-08-15 17:58:48 -07001623}
1624
1625class VkViewport {
Jesse Hall65ab5522015-11-30 00:07:16 -08001626 f32 x
1627 f32 y
Jesse Halld27f6aa2015-08-15 17:58:48 -07001628 f32 width
1629 f32 height
1630 f32 minDepth
1631 f32 maxDepth
1632}
1633
1634class VkRect2D {
1635 VkOffset2D offset
1636 VkExtent2D extent
1637}
1638
Jesse Halla15a4bf2015-11-19 22:48:02 -08001639class VkClearRect {
1640 VkRect2D rect
1641 u32 baseArrayLayer
Jesse Hall3fbc8562015-11-29 22:10:52 -08001642 u32 layerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001643}
1644
Jesse Hall65ab5522015-11-30 00:07:16 -08001645class VkComponentMapping {
1646 VkComponentSwizzle r
1647 VkComponentSwizzle g
1648 VkComponentSwizzle b
1649 VkComponentSwizzle a
Jesse Halld27f6aa2015-08-15 17:58:48 -07001650}
1651
1652class VkPhysicalDeviceProperties {
1653 u32 apiVersion
1654 u32 driverVersion
Jesse Hall65ab5522015-11-30 00:07:16 -08001655 u32 vendorID
1656 u32 deviceID
Jesse Halld27f6aa2015-08-15 17:58:48 -07001657 VkPhysicalDeviceType deviceType
Jesse Hall65ab5522015-11-30 00:07:16 -08001658 char[VK_MAX_PHYSICAL_DEVICE_NAME_SIZE] deviceName
1659 u8[VK_UUID_SIZE] pipelineCacheUUID
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001660 VkPhysicalDeviceLimits limits
1661 VkPhysicalDeviceSparseProperties sparseProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07001662}
1663
1664class VkExtensionProperties {
Jesse Hall65ab5522015-11-30 00:07:16 -08001665 char[VK_MAX_EXTENSION_NAME_SIZE] extensionName /// extension name
Jesse Halld27f6aa2015-08-15 17:58:48 -07001666 u32 specVersion /// version of the extension specification implemented
1667}
1668
1669class VkLayerProperties {
Jesse Hall65ab5522015-11-30 00:07:16 -08001670 char[VK_MAX_EXTENSION_NAME_SIZE] layerName /// layer name
Jesse Hall3fbc8562015-11-29 22:10:52 -08001671 u32 specVersion /// version of the layer specification implemented
1672 u32 implementationVersion /// build or release version of the layer's library
Jesse Hall65ab5522015-11-30 00:07:16 -08001673 char[VK_MAX_DESCRIPTION_SIZE] description /// Free-form description of the layer
Jesse Halld27f6aa2015-08-15 17:58:48 -07001674}
1675
Jesse Halla366a512015-11-19 22:30:07 -08001676class VkSubmitInfo {
Jesse Hall03b6fe12015-11-24 12:44:21 -08001677 VkStructureType sType /// Type of structure. Should be VK_STRUCTURE_TYPE_SUBMIT_INFO
1678 const void* pNext /// Next structure in chain
1679 u32 waitSemaphoreCount
Jesse Halla366a512015-11-19 22:30:07 -08001680 const VkSemaphore* pWaitSemaphores
Jesse Hall543a7ff2016-01-08 16:38:30 -08001681 const VkPipelineStageFlags* pWaitDstStageMask
Jesse Hall03b6fe12015-11-24 12:44:21 -08001682 u32 commandBufferCount
Jesse Hall3fbc8562015-11-29 22:10:52 -08001683 const VkCommandBuffer* pCommandBuffers
Jesse Hall03b6fe12015-11-24 12:44:21 -08001684 u32 signalSemaphoreCount
Jesse Halla366a512015-11-19 22:30:07 -08001685 const VkSemaphore* pSignalSemaphores
1686}
1687
Jesse Halld27f6aa2015-08-15 17:58:48 -07001688class VkApplicationInfo {
1689 VkStructureType sType /// Type of structure. Should be VK_STRUCTURE_TYPE_APPLICATION_INFO
1690 const void* pNext /// Next structure in chain
Jesse Hall3fbc8562015-11-29 22:10:52 -08001691 const char* pApplicationName
1692 u32 applicationVersion
Jesse Halld27f6aa2015-08-15 17:58:48 -07001693 const char* pEngineName
1694 u32 engineVersion
1695 u32 apiVersion
1696}
1697
Jesse Hall3fbc8562015-11-29 22:10:52 -08001698class VkAllocationCallbacks {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001699 void* pUserData
Jesse Hall3fbc8562015-11-29 22:10:52 -08001700 PFN_vkAllocationFunction pfnAllocation
1701 PFN_vkReallocationFunction pfnReallocation
Jesse Halld27f6aa2015-08-15 17:58:48 -07001702 PFN_vkFreeFunction pfnFree
Jesse Hall3fbc8562015-11-29 22:10:52 -08001703 PFN_vkInternalAllocationNotification pfnInternalAllocation
Jesse Hall03b6fe12015-11-24 12:44:21 -08001704 PFN_vkInternalFreeNotification pfnInternalFree
Jesse Halld27f6aa2015-08-15 17:58:48 -07001705}
1706
1707class VkDeviceQueueCreateInfo {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001708 VkStructureType sStype /// Should be VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO
1709 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001710 VkDeviceQueueCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001711 u32 queueFamilyIndex
Jesse Halldba27f72015-11-30 14:25:46 -08001712 u32 queueCount
Jesse Hallfbf97b02015-11-20 14:17:03 -08001713 const f32* pQueuePriorities
Jesse Halld27f6aa2015-08-15 17:58:48 -07001714}
1715
1716class VkDeviceCreateInfo {
1717 VkStructureType sType /// Should be VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO
1718 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001719 VkDeviceCreateFlags flags
Jesse Halldba27f72015-11-30 14:25:46 -08001720 u32 queueCreateInfoCount
1721 const VkDeviceQueueCreateInfo* pQueueCreateInfos
Jesse Hall3dd678a2016-01-08 21:52:01 -08001722 u32 enabledLayerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001723 const char* const* ppEnabledLayerNames /// Ordered list of layer names to be enabled
Jesse Hall3dd678a2016-01-08 21:52:01 -08001724 u32 enabledExtensionCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001725 const char* const* ppEnabledExtensionNames
1726 const VkPhysicalDeviceFeatures* pEnabledFeatures
Jesse Halld27f6aa2015-08-15 17:58:48 -07001727}
1728
1729class VkInstanceCreateInfo {
1730 VkStructureType sType /// Should be VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO
1731 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001732 VkInstanceCreateFlags flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001733 const VkApplicationInfo* pApplicationInfo
Jesse Hall3dd678a2016-01-08 21:52:01 -08001734 u32 enabledLayerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001735 const char* const* ppEnabledLayerNames /// Ordered list of layer names to be enabled
Jesse Hall3dd678a2016-01-08 21:52:01 -08001736 u32 enabledExtensionCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001737 const char* const* ppEnabledExtensionNames /// Extension names to be enabled
1738}
1739
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001740class VkQueueFamilyProperties {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001741 VkQueueFlags queueFlags /// Queue flags
1742 u32 queueCount
Jesse Hallacfa5342015-11-19 21:51:33 -08001743 u32 timestampValidBits
Jesse Hall65ab5522015-11-30 00:07:16 -08001744 VkExtent3D minImageTransferGranularity
Jesse Halld27f6aa2015-08-15 17:58:48 -07001745}
1746
1747class VkPhysicalDeviceMemoryProperties {
1748 u32 memoryTypeCount
1749 VkMemoryType[VK_MAX_MEMORY_TYPES] memoryTypes
1750 u32 memoryHeapCount
1751 VkMemoryHeap[VK_MAX_MEMORY_HEAPS] memoryHeaps
1752}
1753
Jesse Hall3fbc8562015-11-29 22:10:52 -08001754class VkMemoryAllocateInfo {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001755 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07001756 const void* pNext /// Pointer to next structure
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001757 VkDeviceSize allocationSize /// Size of memory allocation
Jesse Halld27f6aa2015-08-15 17:58:48 -07001758 u32 memoryTypeIndex /// Index of the of the memory type to allocate from
1759}
1760
1761class VkMemoryRequirements {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001762 VkDeviceSize size /// Specified in bytes
1763 VkDeviceSize alignment /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001764 u32 memoryTypeBits /// Bitfield of the allowed memory type indices into memoryTypes[] for this object
1765}
1766
1767class VkSparseImageFormatProperties {
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001768 VkImageAspectFlagBits aspectMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001769 VkExtent3D imageGranularity
1770 VkSparseImageFormatFlags flags
1771}
1772
1773class VkSparseImageMemoryRequirements {
Jesse Hallb00daad2015-11-29 19:46:20 -08001774 VkSparseImageFormatProperties formatProperties
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001775 u32 imageMipTailFirstLod
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001776 VkDeviceSize imageMipTailSize /// Specified in bytes, must be a multiple of image block size / alignment
1777 VkDeviceSize imageMipTailOffset /// Specified in bytes, must be a multiple of image block size / alignment
1778 VkDeviceSize imageMipTailStride /// Specified in bytes, must be a multiple of image block size / alignment
Jesse Halld27f6aa2015-08-15 17:58:48 -07001779}
1780
1781class VkMemoryType {
1782 VkMemoryPropertyFlags propertyFlags /// Memory properties of this memory type
1783 u32 heapIndex /// Index of the memory heap allocations of this memory type are taken from
1784}
1785
1786class VkMemoryHeap {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001787 VkDeviceSize size /// Available memory in the heap
Jesse Halld27f6aa2015-08-15 17:58:48 -07001788 VkMemoryHeapFlags flags /// Flags for the heap
1789}
1790
1791class VkMappedMemoryRange {
1792 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE
1793 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08001794 VkDeviceMemory memory /// Mapped memory object
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001795 VkDeviceSize offset /// Offset within the mapped memory the range starts from
1796 VkDeviceSize size /// Size of the range within the mapped memory
Jesse Halld27f6aa2015-08-15 17:58:48 -07001797}
1798
1799class VkFormatProperties {
1800 VkFormatFeatureFlags linearTilingFeatures /// Format features in case of linear tiling
1801 VkFormatFeatureFlags optimalTilingFeatures /// Format features in case of optimal tiling
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001802 VkFormatFeatureFlags bufferFeatures /// Format features supported by buffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07001803}
1804
1805class VkImageFormatProperties {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001806 VkExtent3D maxExtent /// max image dimensions for this resource type
1807 u32 maxMipLevels /// max number of mipmap levels for this resource type
Jesse Halla15a4bf2015-11-19 22:48:02 -08001808 u32 maxArrayLayers /// max array layers for this resource type
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001809 VkSampleCountFlags sampleCounts /// supported sample counts for this resource type
1810 VkDeviceSize maxResourceSize /// max size (in bytes) of this resource type
1811}
1812
Jesse Halla15a4bf2015-11-19 22:48:02 -08001813class VkDescriptorImageInfo {
1814 VkSampler sampler
1815 VkImageView imageView
1816 VkImageLayout imageLayout
1817}
1818
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001819class VkDescriptorBufferInfo {
1820 VkBuffer buffer /// Buffer used for this descriptor when the descriptor is UNIFORM_BUFFER[_DYNAMIC]
1821 VkDeviceSize offset /// Base offset from buffer start in bytes to update in the descriptor set.
1822 VkDeviceSize range /// Size in bytes of the buffer resource for this descriptor update.
Jesse Halld27f6aa2015-08-15 17:58:48 -07001823}
1824
Jesse Halld27f6aa2015-08-15 17:58:48 -07001825class VkWriteDescriptorSet {
1826 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET
1827 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08001828 VkDescriptorSet dstSet /// Destination descriptor set
1829 u32 dstBinding /// Binding within the destination descriptor set to write
1830 u32 dstArrayElement /// Array element within the destination binding to write
Jesse Hall03b6fe12015-11-24 12:44:21 -08001831 u32 descriptorCount /// Number of descriptors to write (determines the size of the array pointed by <pDescriptors>)
Jesse Halld27f6aa2015-08-15 17:58:48 -07001832 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 -08001833 const VkDescriptorImageInfo* pImageInfo
1834 const VkDescriptorBufferInfo* pBufferInfo
1835 const VkBufferView* pTexelBufferView
Jesse Halld27f6aa2015-08-15 17:58:48 -07001836}
1837
1838class VkCopyDescriptorSet {
1839 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET
1840 const void* pNext /// Pointer to next structure
1841 VkDescriptorSet srcSet /// Source descriptor set
1842 u32 srcBinding /// Binding within the source descriptor set to copy from
1843 u32 srcArrayElement /// Array element within the source binding to copy from
Jesse Hall3fbc8562015-11-29 22:10:52 -08001844 VkDescriptorSet dstSet /// Destination descriptor set
1845 u32 dstBinding /// Binding within the destination descriptor set to copy to
1846 u32 dstArrayElement /// Array element within the destination binding to copy to
Jesse Hall03b6fe12015-11-24 12:44:21 -08001847 u32 descriptorCount /// Number of descriptors to copy
Jesse Halld27f6aa2015-08-15 17:58:48 -07001848}
1849
1850class VkBufferCreateInfo {
1851 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO
1852 const void* pNext /// Pointer to next structure.
Jesse Halla6429252015-11-29 18:59:42 -08001853 VkBufferCreateFlags flags /// Buffer creation flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001854 VkDeviceSize size /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001855 VkBufferUsageFlags usage /// Buffer usage flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001856 VkSharingMode sharingMode
Jesse Hall03b6fe12015-11-24 12:44:21 -08001857 u32 queueFamilyIndexCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001858 const u32* pQueueFamilyIndices
1859}
1860
1861class VkBufferViewCreateInfo {
1862 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO
1863 const void* pNext /// Pointer to next structure.
Jesse Halla6429252015-11-29 18:59:42 -08001864 VkBufferViewCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001865 VkBuffer buffer
Jesse Halld27f6aa2015-08-15 17:58:48 -07001866 VkFormat format /// Optionally specifies format of elements
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001867 VkDeviceSize offset /// Specified in bytes
1868 VkDeviceSize range /// View size specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001869}
1870
1871class VkImageSubresource {
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001872 VkImageAspectFlagBits aspectMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001873 u32 mipLevel
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001874 u32 arrayLayer
Jesse Halld27f6aa2015-08-15 17:58:48 -07001875}
1876
1877class VkImageSubresourceRange {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001878 VkImageAspectFlags aspectMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001879 u32 baseMipLevel
Jesse Hall3fbc8562015-11-29 22:10:52 -08001880 u32 levelCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001881 u32 baseArrayLayer
Jesse Hall3fbc8562015-11-29 22:10:52 -08001882 u32 layerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001883}
1884
1885class VkMemoryBarrier {
1886 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MEMORY_BARRIER
1887 const void* pNext /// Pointer to next structure.
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001888 VkAccessFlags srcAccessMask
1889 VkAccessFlags dstAccessMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001890}
1891
1892class VkBufferMemoryBarrier {
1893 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER
1894 const void* pNext /// Pointer to next structure.
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001895 VkAccessFlags srcAccessMask
1896 VkAccessFlags dstAccessMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001897 u32 srcQueueFamilyIndex /// Queue family to transition ownership from
Jesse Hall3fbc8562015-11-29 22:10:52 -08001898 u32 dstQueueFamilyIndex /// Queue family to transition ownership to
Jesse Halld27f6aa2015-08-15 17:58:48 -07001899 VkBuffer buffer /// Buffer to sync
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001900 VkDeviceSize offset /// Offset within the buffer to sync
1901 VkDeviceSize size /// Amount of bytes to sync
Jesse Halld27f6aa2015-08-15 17:58:48 -07001902}
1903
1904class VkImageMemoryBarrier {
1905 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER
1906 const void* pNext /// Pointer to next structure.
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001907 VkAccessFlags srcAccessMask
1908 VkAccessFlags dstAccessMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001909 VkImageLayout oldLayout /// Current layout of the image
1910 VkImageLayout newLayout /// New layout to transition the image to
1911 u32 srcQueueFamilyIndex /// Queue family to transition ownership from
Jesse Hall3fbc8562015-11-29 22:10:52 -08001912 u32 dstQueueFamilyIndex /// Queue family to transition ownership to
Jesse Halld27f6aa2015-08-15 17:58:48 -07001913 VkImage image /// Image to sync
1914 VkImageSubresourceRange subresourceRange /// Subresource range to sync
1915}
1916
1917class VkImageCreateInfo {
1918 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO
1919 const void* pNext /// Pointer to next structure.
Jesse Halla6429252015-11-29 18:59:42 -08001920 VkImageCreateFlags flags /// Image creation flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001921 VkImageType imageType
1922 VkFormat format
1923 VkExtent3D extent
1924 u32 mipLevels
Jesse Halla15a4bf2015-11-19 22:48:02 -08001925 u32 arrayLayers
Jesse Hall091ed9e2015-11-30 00:55:29 -08001926 VkSampleCountFlagBits samples
Jesse Halld27f6aa2015-08-15 17:58:48 -07001927 VkImageTiling tiling
1928 VkImageUsageFlags usage /// Image usage flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001929 VkSharingMode sharingMode /// Cross-queue-family sharing mode
Jesse Hall03b6fe12015-11-24 12:44:21 -08001930 u32 queueFamilyIndexCount /// Number of queue families to share across
Jesse Halld27f6aa2015-08-15 17:58:48 -07001931 const u32* pQueueFamilyIndices /// Array of queue family indices to share across
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001932 VkImageLayout initialLayout /// Initial image layout for all subresources
Jesse Halld27f6aa2015-08-15 17:58:48 -07001933}
1934
1935class VkSubresourceLayout {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001936 VkDeviceSize offset /// Specified in bytes
1937 VkDeviceSize size /// Specified in bytes
1938 VkDeviceSize rowPitch /// Specified in bytes
Jesse Hall543a7ff2016-01-08 16:38:30 -08001939 VkDeviceSize arrayPitch /// Specified in bytes
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001940 VkDeviceSize depthPitch /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001941}
1942
1943class VkImageViewCreateInfo {
1944 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO
1945 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001946 VkImageViewCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001947 VkImage image
1948 VkImageViewType viewType
1949 VkFormat format
Jesse Hall65ab5522015-11-30 00:07:16 -08001950 VkComponentMapping components
Jesse Halld27f6aa2015-08-15 17:58:48 -07001951 VkImageSubresourceRange subresourceRange
Jesse Halld27f6aa2015-08-15 17:58:48 -07001952}
1953
1954class VkBufferCopy {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001955 VkDeviceSize srcOffset /// Specified in bytes
Jesse Hall3fbc8562015-11-29 22:10:52 -08001956 VkDeviceSize dstOffset /// Specified in bytes
Jesse Hallb00daad2015-11-29 19:46:20 -08001957 VkDeviceSize size /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001958}
1959
Jesse Halla6429252015-11-29 18:59:42 -08001960class VkSparseMemoryBind {
Jesse Hallb00daad2015-11-29 19:46:20 -08001961 VkDeviceSize resourceOffset /// Specified in bytes
1962 VkDeviceSize size /// Specified in bytes
Jesse Hall3fbc8562015-11-29 22:10:52 -08001963 VkDeviceMemory memory
1964 VkDeviceSize memoryOffset /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001965 VkSparseMemoryBindFlags flags
1966}
1967
Jesse Halla6429252015-11-29 18:59:42 -08001968class VkSparseImageMemoryBind {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001969 VkImageSubresource subresource
1970 VkOffset3D offset
1971 VkExtent3D extent
Jesse Hall3fbc8562015-11-29 22:10:52 -08001972 VkDeviceMemory memory
1973 VkDeviceSize memoryOffset /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001974 VkSparseMemoryBindFlags flags
1975}
1976
Jesse Halla6429252015-11-29 18:59:42 -08001977class VkSparseBufferMemoryBindInfo {
1978 VkBuffer buffer
1979 u32 bindCount
1980 const VkSparseMemoryBind* pBinds
1981}
1982
1983class VkSparseImageOpaqueMemoryBindInfo {
1984 VkImage image
1985 u32 bindCount
1986 const VkSparseMemoryBind* pBinds
1987}
1988
1989class VkSparseImageMemoryBindInfo {
1990 VkImage image
1991 u32 bindCount
1992 const VkSparseMemoryBind* pBinds
1993}
1994
1995class VkBindSparseInfo {
1996 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BIND_SPARSE_INFO
1997 const void* pNext
1998 u32 waitSemaphoreCount
1999 const VkSemaphore* pWaitSemaphores
2000 u32 numBufferBinds
2001 const VkSparseBufferMemoryBindInfo* pBufferBinds
2002 u32 numImageOpaqueBinds
2003 const VkSparseImageOpaqueMemoryBindInfo* pImageOpaqueBinds
2004 u32 numImageBinds
2005 const VkSparseImageMemoryBindInfo* pImageBinds
2006 u32 signalSemaphoreCount
2007 const VkSemaphore* pSignalSemaphores
2008}
2009
Jesse Hall65ab5522015-11-30 00:07:16 -08002010class VkImageSubresourceLayers {
2011 VkImageAspectFlags aspectMask
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002012 u32 mipLevel
Jesse Halla15a4bf2015-11-19 22:48:02 -08002013 u32 baseArrayLayer
Jesse Hall3fbc8562015-11-29 22:10:52 -08002014 u32 layerCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002015}
2016
Jesse Halld27f6aa2015-08-15 17:58:48 -07002017class VkImageCopy {
Jesse Hall65ab5522015-11-30 00:07:16 -08002018 VkImageSubresourceLayers srcSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07002019 VkOffset3D srcOffset /// Specified in pixels for both compressed and uncompressed images
Jesse Hall65ab5522015-11-30 00:07:16 -08002020 VkImageSubresourceLayers dstSubresource
Jesse Hall3fbc8562015-11-29 22:10:52 -08002021 VkOffset3D dstOffset /// Specified in pixels for both compressed and uncompressed images
Jesse Halld27f6aa2015-08-15 17:58:48 -07002022 VkExtent3D extent /// Specified in pixels for both compressed and uncompressed images
2023}
2024
2025class VkImageBlit {
Jesse Hall65ab5522015-11-30 00:07:16 -08002026 VkImageSubresourceLayers srcSubresource
Jesse Hall3dd678a2016-01-08 21:52:01 -08002027 VkOffset3D[2] srcOffsets
Jesse Hall65ab5522015-11-30 00:07:16 -08002028 VkImageSubresourceLayers dstSubresource
Jesse Hall3dd678a2016-01-08 21:52:01 -08002029 VkOffset3D[2] dstOffsets
Jesse Halld27f6aa2015-08-15 17:58:48 -07002030}
2031
2032class VkBufferImageCopy {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002033 VkDeviceSize bufferOffset /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002034 u32 bufferRowLength /// Specified in texels
2035 u32 bufferImageHeight
Jesse Hall65ab5522015-11-30 00:07:16 -08002036 VkImageSubresourceLayers imageSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07002037 VkOffset3D imageOffset /// Specified in pixels for both compressed and uncompressed images
2038 VkExtent3D imageExtent /// Specified in pixels for both compressed and uncompressed images
2039}
2040
2041class VkImageResolve {
Jesse Hall65ab5522015-11-30 00:07:16 -08002042 VkImageSubresourceLayers srcSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07002043 VkOffset3D srcOffset
Jesse Hall65ab5522015-11-30 00:07:16 -08002044 VkImageSubresourceLayers dstSubresource
Jesse Hall3fbc8562015-11-29 22:10:52 -08002045 VkOffset3D dstOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07002046 VkExtent3D extent
2047}
2048
2049class VkShaderModuleCreateInfo {
2050 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO
2051 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002052 VkShaderModuleCreateFlags flags /// Reserved
Jesse Halld27f6aa2015-08-15 17:58:48 -07002053 platform.size_t codeSize /// Specified in bytes
Jesse Halla9bb62b2015-11-21 19:31:56 -08002054 const u32* pCode /// Binary code of size codeSize
Jesse Halld27f6aa2015-08-15 17:58:48 -07002055}
2056
Jesse Halld27f6aa2015-08-15 17:58:48 -07002057class VkDescriptorSetLayoutBinding {
Jesse Hall091ed9e2015-11-30 00:55:29 -08002058 u32 binding
Jesse Halld27f6aa2015-08-15 17:58:48 -07002059 VkDescriptorType descriptorType /// Type of the descriptors in this binding
Jesse Halldba27f72015-11-30 14:25:46 -08002060 u32 descriptorCount /// Number of descriptors in this binding
Jesse Halld27f6aa2015-08-15 17:58:48 -07002061 VkShaderStageFlags stageFlags /// Shader stages this binding is visible to
2062 const VkSampler* pImmutableSamplers /// Immutable samplers (used if descriptor type is SAMPLER or COMBINED_IMAGE_SAMPLER, is either NULL or contains <count> number of elements)
2063}
2064
2065class VkDescriptorSetLayoutCreateInfo {
2066 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO
2067 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002068 VkDescriptorSetLayoutCreateFlags flags
Jesse Hall03b6fe12015-11-24 12:44:21 -08002069 u32 bindingCount /// Number of bindings in the descriptor set layout
Jesse Hall543a7ff2016-01-08 16:38:30 -08002070 const VkDescriptorSetLayoutBinding* pBindings /// Array of descriptor set layout bindings
Jesse Halld27f6aa2015-08-15 17:58:48 -07002071}
2072
Jesse Hall65ab5522015-11-30 00:07:16 -08002073class VkDescriptorPoolSize {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002074 VkDescriptorType type
Jesse Hall03b6fe12015-11-24 12:44:21 -08002075 u32 descriptorCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002076}
2077
2078class VkDescriptorPoolCreateInfo {
2079 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO
2080 const void* pNext /// Pointer to next structure
Jesse Hallfbf97b02015-11-20 14:17:03 -08002081 VkDescriptorPoolCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002082 u32 maxSets
Jesse Hall65ab5522015-11-30 00:07:16 -08002083 u32 poolSizeCount
2084 const VkDescriptorPoolSize* pPoolSizes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002085}
2086
Jesse Hall3fbc8562015-11-29 22:10:52 -08002087class VkDescriptorSetAllocateInfo {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002088 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO
Jesse Hallfbf97b02015-11-20 14:17:03 -08002089 const void* pNext /// Pointer to next structure
2090 VkDescriptorPool descriptorPool
Jesse Hall03b6fe12015-11-24 12:44:21 -08002091 u32 setCount
Jesse Hallfbf97b02015-11-20 14:17:03 -08002092 const VkDescriptorSetLayout* pSetLayouts
2093}
2094
Jesse Halld27f6aa2015-08-15 17:58:48 -07002095class VkSpecializationMapEntry {
Jesse Hall65ab5522015-11-30 00:07:16 -08002096 u32 constantID /// The SpecConstant ID specified in the BIL
Jesse Halld27f6aa2015-08-15 17:58:48 -07002097 u32 offset /// Offset of the value in the data block
Jesse Hallb00daad2015-11-29 19:46:20 -08002098 platform.size_t size /// Size in bytes of the SpecConstant
Jesse Halld27f6aa2015-08-15 17:58:48 -07002099}
2100
2101class VkSpecializationInfo {
2102 u32 mapEntryCount /// Number of entries in the map
Jesse Hallb00daad2015-11-29 19:46:20 -08002103 const VkSpecializationMapEntry* pMapEntries /// Array of map entries
Jesse Halld27f6aa2015-08-15 17:58:48 -07002104 platform.size_t dataSize /// Size in bytes of pData
2105 const void* pData /// Pointer to SpecConstant data
2106}
2107
2108class VkPipelineShaderStageCreateInfo {
2109 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO
2110 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002111 VkPipelineShaderStageCreateFlags flags
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002112 VkShaderStageFlagBits stage
2113 VkShaderModule module
2114 const char* pName
Jesse Halld27f6aa2015-08-15 17:58:48 -07002115 const VkSpecializationInfo* pSpecializationInfo
2116}
2117
2118class VkComputePipelineCreateInfo {
2119 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO
2120 const void* pNext /// Pointer to next structure
Jesse Halld27f6aa2015-08-15 17:58:48 -07002121 VkPipelineCreateFlags flags /// Pipeline creation flags
Jesse Halla6429252015-11-29 18:59:42 -08002122 VkPipelineShaderStageCreateInfo stage
Jesse Halld27f6aa2015-08-15 17:58:48 -07002123 VkPipelineLayout layout /// Interface layout of the pipeline
2124 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
2125 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
2126}
2127
2128class VkVertexInputBindingDescription {
Jesse Hallb00daad2015-11-29 19:46:20 -08002129 u32 binding /// Vertex buffer binding id
2130 u32 stride /// Distance between vertices in bytes (0 = no advancement)
Jesse Hall65ab5522015-11-30 00:07:16 -08002131 VkVertexInputRate inputRate /// Rate at which binding is incremented
Jesse Halld27f6aa2015-08-15 17:58:48 -07002132}
2133
2134class VkVertexInputAttributeDescription {
Jesse Hallb00daad2015-11-29 19:46:20 -08002135 u32 location /// location of the shader vertex attrib
2136 u32 binding /// Vertex buffer binding id
2137 VkFormat format /// format of source data
2138 u32 offset /// Offset of first element in bytes from base of vertex
Jesse Halld27f6aa2015-08-15 17:58:48 -07002139}
2140
2141class VkPipelineVertexInputStateCreateInfo {
Jesse Hall03b6fe12015-11-24 12:44:21 -08002142 VkStructureType sType /// Should be VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO
2143 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002144 VkPipelineVertexInputStateCreateFlags flags
Jesse Hall03b6fe12015-11-24 12:44:21 -08002145 u32 vertexBindingDescriptionCount /// number of bindings
Jesse Halld27f6aa2015-08-15 17:58:48 -07002146 const VkVertexInputBindingDescription* pVertexBindingDescriptions
Jesse Hall03b6fe12015-11-24 12:44:21 -08002147 u32 vertexAttributeDescriptionCount /// number of attributes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002148 const VkVertexInputAttributeDescription* pVertexAttributeDescriptions
2149}
2150
2151class VkPipelineInputAssemblyStateCreateInfo {
2152 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO
2153 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002154 VkPipelineInputAssemblyStateCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002155 VkPrimitiveTopology topology
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002156 VkBool32 primitiveRestartEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002157}
2158
2159class VkPipelineTessellationStateCreateInfo {
2160 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO
2161 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002162 VkPipelineTessellationStateCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002163 u32 patchControlPoints
2164}
2165
2166class VkPipelineViewportStateCreateInfo {
2167 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO
2168 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002169 VkPipelineViewportStateCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002170 u32 viewportCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002171 const VkViewport* pViewports
2172 u32 scissorCount
2173 const VkRect2D* pScissors
Jesse Halld27f6aa2015-08-15 17:58:48 -07002174}
2175
Jesse Hall3fbc8562015-11-29 22:10:52 -08002176class VkPipelineRasterizationStateCreateInfo {
Jesse Hall65ab5522015-11-30 00:07:16 -08002177 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002178 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08002179 VkPipelineRasterizationStateCreateFlags flags
Jesse Hallae38f732015-11-19 21:32:50 -08002180 VkBool32 depthClampEnable
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002181 VkBool32 rasterizerDiscardEnable
Jesse Hall65ab5522015-11-30 00:07:16 -08002182 VkPolygonMode polygonMode /// optional (GL45)
Jesse Hallc7467b72015-11-29 21:05:26 -08002183 VkCullModeFlags cullMode
Jesse Halld27f6aa2015-08-15 17:58:48 -07002184 VkFrontFace frontFace
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002185 VkBool32 depthBiasEnable
Jesse Halla9bb62b2015-11-21 19:31:56 -08002186 f32 depthBiasConstantFactor
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002187 f32 depthBiasClamp
Jesse Halla9bb62b2015-11-21 19:31:56 -08002188 f32 depthBiasSlopeFactor
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002189 f32 lineWidth
Jesse Halld27f6aa2015-08-15 17:58:48 -07002190}
2191
2192class VkPipelineMultisampleStateCreateInfo {
2193 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO
2194 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002195 VkPipelineMultisampleStateCreateFlags flags
Jesse Hall091ed9e2015-11-30 00:55:29 -08002196 VkSampleCountFlagBits rasterizationSamples /// Number of samples used for rasterization
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002197 VkBool32 sampleShadingEnable /// optional (GL45)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002198 f32 minSampleShading /// optional (GL45)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002199 const VkSampleMask* pSampleMask
Jesse Hallacfa5342015-11-19 21:51:33 -08002200 VkBool32 alphaToCoverageEnable
2201 VkBool32 alphaToOneEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002202}
2203
2204class VkPipelineColorBlendAttachmentState {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002205 VkBool32 blendEnable
Jesse Hall65ab5522015-11-30 00:07:16 -08002206 VkBlendFactor srcColorBlendFactor
2207 VkBlendFactor dstColorBlendFactor
2208 VkBlendOp colorBlendOp
2209 VkBlendFactor srcAlphaBlendFactor
2210 VkBlendFactor dstAlphaBlendFactor
2211 VkBlendOp alphaBlendOp
2212 VkColorComponentFlags colorWriteMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07002213}
2214
2215class VkPipelineColorBlendStateCreateInfo {
2216 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO
2217 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002218 VkPipelineColorBlendStateCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002219 VkBool32 logicOpEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002220 VkLogicOp logicOp
2221 u32 attachmentCount /// # of pAttachments
2222 const VkPipelineColorBlendAttachmentState* pAttachments
Jesse Hallb00daad2015-11-29 19:46:20 -08002223 f32[4] blendConstants
Jesse Halld27f6aa2015-08-15 17:58:48 -07002224}
2225
2226class VkStencilOpState {
Jesse Hall65ab5522015-11-30 00:07:16 -08002227 VkStencilOp failOp
2228 VkStencilOp passOp
2229 VkStencilOp depthFailOp
2230 VkCompareOp compareOp
2231 u32 compareMask
2232 u32 writeMask
2233 u32 reference
Jesse Halld27f6aa2015-08-15 17:58:48 -07002234}
2235
2236class VkPipelineDepthStencilStateCreateInfo {
2237 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO
2238 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002239 VkPipelineDepthStencilStateCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002240 VkBool32 depthTestEnable
2241 VkBool32 depthWriteEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002242 VkCompareOp depthCompareOp
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002243 VkBool32 depthBoundsTestEnable /// optional (depth_bounds_test)
2244 VkBool32 stencilTestEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002245 VkStencilOpState front
2246 VkStencilOpState back
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002247 f32 minDepthBounds
2248 f32 maxDepthBounds
2249}
2250
2251class VkPipelineDynamicStateCreateInfo {
2252 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO
2253 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002254 VkPipelineDynamicStateCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002255 u32 dynamicStateCount
2256 const VkDynamicState* pDynamicStates
Jesse Halld27f6aa2015-08-15 17:58:48 -07002257}
2258
2259class VkGraphicsPipelineCreateInfo {
Jesse Halla6429252015-11-29 18:59:42 -08002260 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO
2261 const void* pNext /// Pointer to next structure
2262 VkPipelineCreateFlags flags /// Pipeline creation flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002263 u32 stageCount
Jesse Halla6429252015-11-29 18:59:42 -08002264 const VkPipelineShaderStageCreateInfo* pStages /// One entry for each active shader stage
Jesse Halld27f6aa2015-08-15 17:58:48 -07002265 const VkPipelineVertexInputStateCreateInfo* pVertexInputState
2266 const VkPipelineInputAssemblyStateCreateInfo* pInputAssemblyState
2267 const VkPipelineTessellationStateCreateInfo* pTessellationState
2268 const VkPipelineViewportStateCreateInfo* pViewportState
Jesse Hall3fbc8562015-11-29 22:10:52 -08002269 const VkPipelineRasterizationStateCreateInfo* pRasterizationState
Jesse Halld27f6aa2015-08-15 17:58:48 -07002270 const VkPipelineMultisampleStateCreateInfo* pMultisampleState
2271 const VkPipelineDepthStencilStateCreateInfo* pDepthStencilState
2272 const VkPipelineColorBlendStateCreateInfo* pColorBlendState
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002273 const VkPipelineDynamicStateCreateInfo* pDynamicState
Jesse Halla6429252015-11-29 18:59:42 -08002274 VkPipelineLayout layout /// Interface layout of the pipeline
Jesse Halld27f6aa2015-08-15 17:58:48 -07002275 VkRenderPass renderPass
2276 u32 subpass
Jesse Halla6429252015-11-29 18:59:42 -08002277 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
2278 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 -07002279}
2280
2281class VkPipelineCacheCreateInfo {
Jesse Hallb00daad2015-11-29 19:46:20 -08002282 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO
2283 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002284 VkPipelineCacheCreateFlags flags
Jesse Hallb00daad2015-11-29 19:46:20 -08002285 platform.size_t initialDataSize /// Size of initial data to populate cache, in bytes
2286 const void* pInitialData /// Initial data to populate cache
Jesse Halld27f6aa2015-08-15 17:58:48 -07002287}
2288
2289class VkPushConstantRange {
2290 VkShaderStageFlags stageFlags /// Which stages use the range
Jesse Hall03b6fe12015-11-24 12:44:21 -08002291 u32 offset /// Start of the range, in bytes
2292 u32 size /// Length of the range, in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002293}
2294
2295class VkPipelineLayoutCreateInfo {
2296 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO
2297 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002298 VkPipelineLayoutCreateFlags flags
Jesse Hall3dd678a2016-01-08 21:52:01 -08002299 u32 descriptorSetCount /// Number of descriptor sets interfaced by the pipeline
Jesse Halld27f6aa2015-08-15 17:58:48 -07002300 const VkDescriptorSetLayout* pSetLayouts /// Array of <setCount> number of descriptor set layout objects defining the layout of the
2301 u32 pushConstantRangeCount /// Number of push-constant ranges used by the pipeline
2302 const VkPushConstantRange* pPushConstantRanges /// Array of pushConstantRangeCount number of ranges used by various shader stages
2303}
2304
2305class VkSamplerCreateInfo {
2306 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO
2307 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002308 VkSamplerCreateFlags flags
Jesse Hall23ff73f2015-11-29 14:36:39 -08002309 VkFilter magFilter /// Filter mode for magnification
2310 VkFilter minFilter /// Filter mode for minifiation
2311 VkSamplerMipmapMode mipmapMode /// Mipmap selection mode
2312 VkSamplerAddressMode addressModeU
2313 VkSamplerAddressMode addressModeV
2314 VkSamplerAddressMode addressModeW
Jesse Halld27f6aa2015-08-15 17:58:48 -07002315 f32 mipLodBias
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002316 VkBool32 anisotropyEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002317 f32 maxAnisotropy
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002318 VkBool32 compareEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002319 VkCompareOp compareOp
2320 f32 minLod
2321 f32 maxLod
2322 VkBorderColor borderColor
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002323 VkBool32 unnormalizedCoordinates
Jesse Halld27f6aa2015-08-15 17:58:48 -07002324}
2325
Jesse Hall3fbc8562015-11-29 22:10:52 -08002326class VkCommandPoolCreateInfo {
2327 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002328 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08002329 VkCommandPoolCreateFlags flags /// Command pool creation flags
Jesse Halla6429252015-11-29 18:59:42 -08002330 u32 queueFamilyIndex
Jesse Halld27f6aa2015-08-15 17:58:48 -07002331}
2332
Jesse Hall3fbc8562015-11-29 22:10:52 -08002333class VkCommandBufferAllocateInfo {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002334 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002335 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08002336 VkCommandPool commandPool
2337 VkCommandBufferLevel level
Jesse Hall3dd678a2016-01-08 21:52:01 -08002338 u32 commandBufferCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002339}
2340
Jesse Hall3dd678a2016-01-08 21:52:01 -08002341class VkCommandBufferInheritanceInfo {
2342 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002343 const void* pNext /// Pointer to next structure
Jesse Halld27f6aa2015-08-15 17:58:48 -07002344 VkRenderPass renderPass /// Render pass for secondary command buffers
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002345 u32 subpass
Jesse Halld27f6aa2015-08-15 17:58:48 -07002346 VkFramebuffer framebuffer /// Framebuffer for secondary command buffers
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002347 VkBool32 occlusionQueryEnable
2348 VkQueryControlFlags queryFlags
2349 VkQueryPipelineStatisticFlags pipelineStatistics
Jesse Halld27f6aa2015-08-15 17:58:48 -07002350}
2351
Jesse Hall3dd678a2016-01-08 21:52:01 -08002352class VkCommandBufferBeginInfo {
2353 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO
2354 const void* pNext /// Pointer to next structure
2355 VkCommandBufferUsageFlags flags /// Command buffer usage flags
2356 const VkCommandBufferInheritanceInfo* pInheritanceInfo
2357}
2358
Jesse Halld27f6aa2015-08-15 17:58:48 -07002359class VkRenderPassBeginInfo {
2360 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO
2361 const void* pNext /// Pointer to next structure
2362 VkRenderPass renderPass
2363 VkFramebuffer framebuffer
2364 VkRect2D renderArea
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002365 u32 clearValueCount
2366 const VkClearValue* pClearValues
Jesse Halld27f6aa2015-08-15 17:58:48 -07002367}
2368
2369@union
2370/// Union allowing specification of floating point, integer, or unsigned integer color data. Actual value selected is based on image/attachment being cleared.
2371class VkClearColorValue {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002372 f32[4] float32
2373 s32[4] int32
2374 u32[4] uint32
Jesse Halld27f6aa2015-08-15 17:58:48 -07002375}
2376
2377class VkClearDepthStencilValue {
2378 f32 depth
2379 u32 stencil
2380}
2381
2382@union
2383/// Union allowing specification of color, depth, and stencil color values. Actual value selected is based on attachment being cleared.
2384class VkClearValue {
2385 VkClearColorValue color
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002386 VkClearDepthStencilValue depthStencil
Jesse Halld27f6aa2015-08-15 17:58:48 -07002387}
2388
Jesse Hallae38f732015-11-19 21:32:50 -08002389class VkClearAttachment {
2390 VkImageAspectFlags aspectMask
2391 u32 colorAttachment
2392 VkClearValue clearValue
2393}
2394
Jesse Halld27f6aa2015-08-15 17:58:48 -07002395class VkAttachmentDescription {
Jesse Halla6429252015-11-29 18:59:42 -08002396 VkAttachmentDescriptionFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002397 VkFormat format
Jesse Hall091ed9e2015-11-30 00:55:29 -08002398 VkSampleCountFlagBits samples
Jesse Halld27f6aa2015-08-15 17:58:48 -07002399 VkAttachmentLoadOp loadOp /// Load op for color or depth data
2400 VkAttachmentStoreOp storeOp /// Store op for color or depth data
2401 VkAttachmentLoadOp stencilLoadOp /// Load op for stencil data
2402 VkAttachmentStoreOp stencilStoreOp /// Store op for stencil data
2403 VkImageLayout initialLayout
2404 VkImageLayout finalLayout
2405}
2406
2407class VkAttachmentReference {
2408 u32 attachment
2409 VkImageLayout layout
2410}
2411
2412class VkSubpassDescription {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002413 VkSubpassDescriptionFlags flags
Jesse Halla6429252015-11-29 18:59:42 -08002414 VkPipelineBindPoint pipelineBindPoint /// Must be VK_PIPELINE_BIND_POINT_GRAPHICS for now
Jesse Hall03b6fe12015-11-24 12:44:21 -08002415 u32 inputAttachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002416 const VkAttachmentReference* pInputAttachments
Jesse Hall03b6fe12015-11-24 12:44:21 -08002417 u32 colorAttachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002418 const VkAttachmentReference* pColorAttachments
2419 const VkAttachmentReference* pResolveAttachments
Jesse Hallc7467b72015-11-29 21:05:26 -08002420 const VkAttachmentReference* pDepthStencilAttachment
Jesse Hall03b6fe12015-11-24 12:44:21 -08002421 u32 preserveAttachmentCount
Jesse Hall3dd678a2016-01-08 21:52:01 -08002422 const u32* pPreserveAttachments
Jesse Halld27f6aa2015-08-15 17:58:48 -07002423}
2424
2425class VkSubpassDependency {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002426 u32 srcSubpass
Jesse Hall3fbc8562015-11-29 22:10:52 -08002427 u32 dstSubpass
Jesse Halld27f6aa2015-08-15 17:58:48 -07002428 VkPipelineStageFlags srcStageMask
Jesse Hall3fbc8562015-11-29 22:10:52 -08002429 VkPipelineStageFlags dstStageMask
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002430 VkAccessFlags srcAccessMask
2431 VkAccessFlags dstAccessMask
Jesse Halldc6d36c2015-11-29 19:12:15 -08002432 VkDependencyFlags dependencyFlags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002433}
2434
2435class VkRenderPassCreateInfo {
2436 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO
2437 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002438 VkRenderPassCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002439 u32 attachmentCount
2440 const VkAttachmentDescription* pAttachments
2441 u32 subpassCount
2442 const VkSubpassDescription* pSubpasses
2443 u32 dependencyCount
2444 const VkSubpassDependency* pDependencies
2445}
2446
2447class VkEventCreateInfo {
2448 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_EVENT_CREATE_INFO
2449 const void* pNext /// Pointer to next structure
2450 VkEventCreateFlags flags /// Event creation flags
2451}
2452
2453class VkFenceCreateInfo {
2454 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_FENCE_CREATE_INFO
2455 const void* pNext /// Pointer to next structure
2456 VkFenceCreateFlags flags /// Fence creation flags
2457}
2458
2459class VkPhysicalDeviceFeatures {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002460 VkBool32 robustBufferAccess /// out of bounds buffer accesses are well defined
2461 VkBool32 fullDrawIndexUint32 /// full 32-bit range of indices for indexed draw calls
2462 VkBool32 imageCubeArray /// image views which are arrays of cube maps
2463 VkBool32 independentBlend /// blending operations are controlled per-attachment
2464 VkBool32 geometryShader /// geometry stage
2465 VkBool32 tessellationShader /// tessellation control and evaluation stage
2466 VkBool32 sampleRateShading /// per-sample shading and interpolation
Jesse Hall3fbc8562015-11-29 22:10:52 -08002467 VkBool32 dualSrcBlend /// blend operations which take two sources
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002468 VkBool32 logicOp /// logic operations
2469 VkBool32 multiDrawIndirect /// multi draw indirect
Jesse Hall543a7ff2016-01-08 16:38:30 -08002470 VkBool32 drawIndirectFirstInstance
Jesse Hallae38f732015-11-19 21:32:50 -08002471 VkBool32 depthClamp /// depth clamping
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002472 VkBool32 depthBiasClamp /// depth bias clamping
2473 VkBool32 fillModeNonSolid /// point and wireframe fill modes
2474 VkBool32 depthBounds /// depth bounds test
2475 VkBool32 wideLines /// lines with width greater than 1
2476 VkBool32 largePoints /// points with size greater than 1
Jesse Hallfbf97b02015-11-20 14:17:03 -08002477 VkBool32 alphaToOne /// The fragment alpha channel can be forced to maximum representable alpha value
2478 VkBool32 multiViewport
2479 VkBool32 samplerAnisotropy
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002480 VkBool32 textureCompressionETC2 /// ETC texture compression formats
2481 VkBool32 textureCompressionASTC_LDR /// ASTC LDR texture compression formats
2482 VkBool32 textureCompressionBC /// BC1-7 texture compressed formats
Jesse Hall65ab5522015-11-30 00:07:16 -08002483 VkBool32 occlusionQueryPrecise
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002484 VkBool32 pipelineStatisticsQuery /// pipeline statistics query
Jesse Halldc6d36c2015-11-29 19:12:15 -08002485 VkBool32 vertexPipelineStoresAndAtomics
2486 VkBool32 fragmentStoresAndAtomics
2487 VkBool32 shaderTessellationAndGeometryPointSize
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002488 VkBool32 shaderImageGatherExtended /// texture gather with run-time values and independent offsets
2489 VkBool32 shaderStorageImageExtendedFormats /// the extended set of formats can be used for storage images
2490 VkBool32 shaderStorageImageMultisample /// multisample images can be used for storage images
Jesse Halld1af8122015-11-29 23:50:38 -08002491 VkBool32 shaderStorageImageReadWithoutFormat
2492 VkBool32 shaderStorageImageWriteWithoutFormat
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002493 VkBool32 shaderUniformBufferArrayDynamicIndexing /// arrays of uniform buffers can be accessed with dynamically uniform indices
2494 VkBool32 shaderSampledImageArrayDynamicIndexing /// arrays of sampled images can be accessed with dynamically uniform indices
2495 VkBool32 shaderStorageBufferArrayDynamicIndexing /// arrays of storage buffers can be accessed with dynamically uniform indices
2496 VkBool32 shaderStorageImageArrayDynamicIndexing /// arrays of storage images can be accessed with dynamically uniform indices
2497 VkBool32 shaderClipDistance /// clip distance in shaders
2498 VkBool32 shaderCullDistance /// cull distance in shaders
2499 VkBool32 shaderFloat64 /// 64-bit floats (doubles) in shaders
2500 VkBool32 shaderInt64 /// 64-bit integers in shaders
2501 VkBool32 shaderInt16 /// 16-bit integers in shaders
2502 VkBool32 shaderResourceResidency /// shader can use texture operations that return resource residency information (requires sparseNonResident support)
Jesse Hall65ab5522015-11-30 00:07:16 -08002503 VkBool32 shaderResourceMinLod /// shader can use texture operations that specify minimum resource LOD
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002504 VkBool32 sparseBinding /// Sparse resources support: Resource memory can be managed at opaque page level rather than object level
2505 VkBool32 sparseResidencyBuffer /// Sparse resources support: GPU can access partially resident buffers
2506 VkBool32 sparseResidencyImage2D /// Sparse resources support: GPU can access partially resident 2D (non-MSAA non-DepthStencil) images
2507 VkBool32 sparseResidencyImage3D /// Sparse resources support: GPU can access partially resident 3D images
2508 VkBool32 sparseResidency2Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 2 samples
2509 VkBool32 sparseResidency4Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 4 samples
2510 VkBool32 sparseResidency8Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 8 samples
2511 VkBool32 sparseResidency16Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 16 samples
2512 VkBool32 sparseResidencyAliased /// Sparse resources support: GPU can correctly access data aliased into multiple locations (opt-in)
Jesse Halld1af8122015-11-29 23:50:38 -08002513 VkBool32 variableMultisampleRate
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002514 VkBool32 inheritedQueries
Jesse Halld27f6aa2015-08-15 17:58:48 -07002515}
2516
2517class VkPhysicalDeviceLimits {
2518 /// resource maximum sizes
2519 u32 maxImageDimension1D /// max 1D image dimension
2520 u32 maxImageDimension2D /// max 2D image dimension
2521 u32 maxImageDimension3D /// max 3D image dimension
2522 u32 maxImageDimensionCube /// max cubemap image dimension
2523 u32 maxImageArrayLayers /// max layers for image arrays
Jesse Hallb00daad2015-11-29 19:46:20 -08002524 u32 maxTexelBufferElements
Jesse Hallfbf97b02015-11-20 14:17:03 -08002525 u32 maxUniformBufferRange /// max uniform buffer size (bytes)
2526 u32 maxStorageBufferRange /// max storage buffer size (bytes)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002527 u32 maxPushConstantsSize /// max size of the push constants pool (bytes)
2528 /// memory limits
2529 u32 maxMemoryAllocationCount /// max number of device memory allocations supported
Jesse Hall091ed9e2015-11-30 00:55:29 -08002530 u32 maxSamplerAllocationCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002531 VkDeviceSize bufferImageGranularity /// Granularity (in bytes) at which buffers and images can be bound to adjacent memory for simultaneous usage
2532 VkDeviceSize sparseAddressSpaceSize /// Total address space available for sparse allocations (bytes)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002533 /// descriptor set limits
2534 u32 maxBoundDescriptorSets /// max number of descriptors sets that can be bound to a pipeline
Jesse Halld27f6aa2015-08-15 17:58:48 -07002535 u32 maxPerStageDescriptorSamplers /// max num of samplers allowed per-stage in a descriptor set
2536 u32 maxPerStageDescriptorUniformBuffers /// max num of uniform buffers allowed per-stage in a descriptor set
2537 u32 maxPerStageDescriptorStorageBuffers /// max num of storage buffers allowed per-stage in a descriptor set
2538 u32 maxPerStageDescriptorSampledImages /// max num of sampled images allowed per-stage in a descriptor set
2539 u32 maxPerStageDescriptorStorageImages /// max num of storage images allowed per-stage in a descriptor set
Jesse Halle1b12782015-11-30 11:27:32 -08002540 u32 maxPerStageDescriptorInputAttachments
Jesse Halldba27f72015-11-30 14:25:46 -08002541 u32 maxPerStageResources
Jesse Halld27f6aa2015-08-15 17:58:48 -07002542 u32 maxDescriptorSetSamplers /// max num of samplers allowed in all stages in a descriptor set
2543 u32 maxDescriptorSetUniformBuffers /// max num of uniform buffers allowed in all stages in a descriptor set
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002544 u32 maxDescriptorSetUniformBuffersDynamic /// max num of dynamic uniform buffers allowed in all stages in a descriptor set
Jesse Halld27f6aa2015-08-15 17:58:48 -07002545 u32 maxDescriptorSetStorageBuffers /// max num of storage buffers allowed in all stages in a descriptor set
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002546 u32 maxDescriptorSetStorageBuffersDynamic /// max num of dynamic storage buffers allowed in all stages in a descriptor set
Jesse Halld27f6aa2015-08-15 17:58:48 -07002547 u32 maxDescriptorSetSampledImages /// max num of sampled images allowed in all stages in a descriptor set
2548 u32 maxDescriptorSetStorageImages /// max num of storage images allowed in all stages in a descriptor set
Jesse Halle1b12782015-11-30 11:27:32 -08002549 u32 maxDescriptorSetInputAttachments
Jesse Halld27f6aa2015-08-15 17:58:48 -07002550 /// vertex stage limits
2551 u32 maxVertexInputAttributes /// max num of vertex input attribute slots
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002552 u32 maxVertexInputBindings /// max num of vertex input binding slots
Jesse Halld27f6aa2015-08-15 17:58:48 -07002553 u32 maxVertexInputAttributeOffset /// max vertex input attribute offset added to vertex buffer offset
2554 u32 maxVertexInputBindingStride /// max vertex input binding stride
2555 u32 maxVertexOutputComponents /// max num of output components written by vertex shader
2556 /// tessellation control stage limits
Jesse Hall3fbc8562015-11-29 22:10:52 -08002557 u32 maxTessellationGenerationLevel /// max level supported by tess primitive generator
Jesse Hallae38f732015-11-19 21:32:50 -08002558 u32 maxTessellationPatchSize /// max patch size (vertices)
2559 u32 maxTessellationControlPerVertexInputComponents /// max num of input components per-vertex in TCS
2560 u32 maxTessellationControlPerVertexOutputComponents /// max num of output components per-vertex in TCS
2561 u32 maxTessellationControlPerPatchOutputComponents /// max num of output components per-patch in TCS
2562 u32 maxTessellationControlTotalOutputComponents /// max total num of per-vertex and per-patch output components in TCS
2563 u32 maxTessellationEvaluationInputComponents /// max num of input components per vertex in TES
2564 u32 maxTessellationEvaluationOutputComponents /// max num of output components per vertex in TES
Jesse Halld27f6aa2015-08-15 17:58:48 -07002565 /// geometry stage limits
2566 u32 maxGeometryShaderInvocations /// max invocation count supported in geometry shader
2567 u32 maxGeometryInputComponents /// max num of input components read in geometry stage
2568 u32 maxGeometryOutputComponents /// max num of output components written in geometry stage
2569 u32 maxGeometryOutputVertices /// max num of vertices that can be emitted in geometry stage
2570 u32 maxGeometryTotalOutputComponents /// max total num of components (all vertices) written in geometry stage
2571 /// fragment stage limits
2572 u32 maxFragmentInputComponents /// max num of input compontents read in fragment stage
Jesse Hallfbf97b02015-11-20 14:17:03 -08002573 u32 maxFragmentOutputAttachments /// max num of output attachments written in fragment stage
Jesse Hall3fbc8562015-11-29 22:10:52 -08002574 u32 maxFragmentDualSrcAttachments /// max num of output attachments written when using dual source blending
Jesse Halld27f6aa2015-08-15 17:58:48 -07002575 u32 maxFragmentCombinedOutputResources /// max total num of storage buffers, storage images and output buffers
2576 /// compute stage limits
2577 u32 maxComputeSharedMemorySize /// max total storage size of work group local storage (bytes)
2578 u32[3] maxComputeWorkGroupCount /// max num of compute work groups that may be dispatched by a single command (x,y,z)
2579 u32 maxComputeWorkGroupInvocations /// max total compute invocations in a single local work group
2580 u32[3] maxComputeWorkGroupSize /// max local size of a compute work group (x,y,z)
2581
2582 u32 subPixelPrecisionBits /// num bits of subpixel precision in screen x and y
2583 u32 subTexelPrecisionBits /// num bits of subtexel precision
2584 u32 mipmapPrecisionBits /// num bits of mipmap precision
2585
2586 u32 maxDrawIndexedIndexValue /// max index value for indexed draw calls (for 32-bit indices)
Jesse Halldba27f72015-11-30 14:25:46 -08002587 u32 maxDrawIndirectCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002588
2589 f32 maxSamplerLodBias /// max absolute sampler level of detail bias
2590 f32 maxSamplerAnisotropy /// max degree of sampler anisotropy
2591
2592 u32 maxViewports /// max number of active viewports
Jesse Halld27f6aa2015-08-15 17:58:48 -07002593 u32[2] maxViewportDimensions /// max viewport dimensions (x,y)
2594 f32[2] viewportBoundsRange /// viewport bounds range (min,max)
2595 u32 viewportSubPixelBits /// num bits of subpixel precision for viewport
2596
Jesse Halldc6d36c2015-11-29 19:12:15 -08002597 platform.size_t minMemoryMapAlignment /// min required alignment of pointers returned by MapMemory (bytes)
2598 VkDeviceSize minTexelBufferOffsetAlignment /// min required alignment for texel buffer offsets (bytes)
2599 VkDeviceSize minUniformBufferOffsetAlignment /// min required alignment for uniform buffer sizes and offsets (bytes)
2600 VkDeviceSize minStorageBufferOffsetAlignment /// min required alignment for storage buffer offsets (bytes)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002601
Jesse Hallfbf97b02015-11-20 14:17:03 -08002602 s32 minTexelOffset /// min texel offset for OpTextureSampleOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07002603 u32 maxTexelOffset /// max texel offset for OpTextureSampleOffset
Jesse Hallfbf97b02015-11-20 14:17:03 -08002604 s32 minTexelGatherOffset /// min texel offset for OpTextureGatherOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07002605 u32 maxTexelGatherOffset /// max texel offset for OpTextureGatherOffset
2606 f32 minInterpolationOffset /// furthest negative offset for interpolateAtOffset
2607 f32 maxInterpolationOffset /// furthest positive offset for interpolateAtOffset
2608 u32 subPixelInterpolationOffsetBits /// num of subpixel bits for interpolateAtOffset
2609
2610 u32 maxFramebufferWidth /// max width for a framebuffer
2611 u32 maxFramebufferHeight /// max height for a framebuffer
2612 u32 maxFramebufferLayers /// max layer count for a layered framebuffer
Jesse Hall091ed9e2015-11-30 00:55:29 -08002613 VkSampleCountFlags framebufferColorSampleCounts
2614 VkSampleCountFlags framebufferDepthSampleCounts
2615 VkSampleCountFlags framebufferStencilSampleCounts
2616 VkSampleCountFlags framebufferNoAttachmentSampleCounts
Jesse Halld27f6aa2015-08-15 17:58:48 -07002617 u32 maxColorAttachments /// max num of framebuffer color attachments
2618
Jesse Hall091ed9e2015-11-30 00:55:29 -08002619 VkSampleCountFlags sampledImageColorSampleCounts
2620 VkSampleCountFlags sampledImageIntegerSampleCounts
2621 VkSampleCountFlags sampledImageDepthSampleCounts
2622 VkSampleCountFlags sampledImageStencilSampleCounts
2623 VkSampleCountFlags storageImageSampleCounts
Jesse Halld27f6aa2015-08-15 17:58:48 -07002624 u32 maxSampleMaskWords /// max num of sample mask words
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002625 VkBool32 timestampComputeAndGraphics
Jesse Halld27f6aa2015-08-15 17:58:48 -07002626
Jesse Halla9bb62b2015-11-21 19:31:56 -08002627 f32 timestampPeriod
Jesse Halld27f6aa2015-08-15 17:58:48 -07002628
2629 u32 maxClipDistances /// max number of clip distances
2630 u32 maxCullDistances /// max number of cull distances
2631 u32 maxCombinedClipAndCullDistances /// max combined number of user clipping
2632
Jesse Hallfbf97b02015-11-20 14:17:03 -08002633 u32 discreteQueuePriorities
2634
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002635 f32[2] pointSizeRange /// range (min,max) of supported point sizes
2636 f32[2] lineWidthRange /// range (min,max) of supported line widths
Jesse Halld27f6aa2015-08-15 17:58:48 -07002637 f32 pointSizeGranularity /// granularity of supported point sizes
2638 f32 lineWidthGranularity /// granularity of supported line widths
Jesse Hall03b6fe12015-11-24 12:44:21 -08002639 VkBool32 strictLines
Jesse Hall091ed9e2015-11-30 00:55:29 -08002640 VkBool32 standardSampleLocations
Jesse Halla9bb62b2015-11-21 19:31:56 -08002641
Jesse Hall65ab5522015-11-30 00:07:16 -08002642 VkDeviceSize optimalBufferCopyOffsetAlignment
2643 VkDeviceSize optimalBufferCopyRowPitchAlignment
Jesse Halldba27f72015-11-30 14:25:46 -08002644 VkDeviceSize nonCoherentAtomSize
Jesse Halld27f6aa2015-08-15 17:58:48 -07002645}
2646
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002647class VkPhysicalDeviceSparseProperties {
2648 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 -08002649 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 -07002650 VkBool32 residencyStandard3DBlockShape /// Sparse resources support: GPU will access all 3D sparse resources using the standard block shapes (based on pixel format)
2651 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 -07002652 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
2653}
2654
Jesse Halld27f6aa2015-08-15 17:58:48 -07002655class VkSemaphoreCreateInfo {
2656 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO
2657 const void* pNext /// Pointer to next structure
2658 VkSemaphoreCreateFlags flags /// Semaphore creation flags
2659}
2660
2661class VkQueryPoolCreateInfo {
2662 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO
2663 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002664 VkQueryPoolCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002665 VkQueryType queryType
Jesse Hall3dd678a2016-01-08 21:52:01 -08002666 u32 queryCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002667 VkQueryPipelineStatisticFlags pipelineStatistics /// Optional
2668}
2669
2670class VkFramebufferCreateInfo {
2671 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO
2672 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002673 VkFramebufferCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002674 VkRenderPass renderPass
2675 u32 attachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002676 const VkImageView* pAttachments
Jesse Halld27f6aa2015-08-15 17:58:48 -07002677 u32 width
2678 u32 height
2679 u32 layers
2680}
2681
Jesse Hall3fbc8562015-11-29 22:10:52 -08002682class VkDrawIndirectCommand {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002683 u32 vertexCount
2684 u32 instanceCount
2685 u32 firstVertex
2686 u32 firstInstance
2687}
2688
Jesse Hall3fbc8562015-11-29 22:10:52 -08002689class VkDrawIndexedIndirectCommand {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002690 u32 indexCount
2691 u32 instanceCount
2692 u32 firstIndex
2693 s32 vertexOffset
2694 u32 firstInstance
2695}
2696
Jesse Hall3fbc8562015-11-29 22:10:52 -08002697class VkDispatchIndirectCommand {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002698 u32 x
2699 u32 y
2700 u32 z
2701}
2702
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002703@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08002704class VkSurfaceCapabilitiesKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002705 u32 minImageCount
2706 u32 maxImageCount
2707 VkExtent2D currentExtent
2708 VkExtent2D minImageExtent
2709 VkExtent2D maxImageExtent
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002710 u32 maxImageArrayLayers
Jesse Hall1356b0d2015-11-23 17:24:58 -08002711 VkSurfaceTransformFlagsKHR supportedTransforms
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002712 VkSurfaceTransformFlagBitsKHR currentTransform
Jesse Halla6429252015-11-29 18:59:42 -08002713 VkCompositeAlphaFlagsKHR supportedCompositeAlpha
Jesse Hall1356b0d2015-11-23 17:24:58 -08002714 VkImageUsageFlags supportedUsageFlags
Michael Lentine88594d72015-11-12 12:49:45 -08002715}
2716
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002717@extension("VK_KHR_surface")
Michael Lentine88594d72015-11-12 12:49:45 -08002718class VkSurfaceFormatKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002719 VkFormat format
2720 VkColorSpaceKHR colorSpace
Michael Lentine88594d72015-11-12 12:49:45 -08002721}
2722
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002723@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08002724class VkSwapchainCreateInfoKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002725 VkStructureType sType
2726 const void* pNext
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002727 VkSwapchainCreateFlagsKHR flags
Jesse Hall1356b0d2015-11-23 17:24:58 -08002728 VkSurfaceKHR surface
2729 u32 minImageCount
2730 VkFormat imageFormat
2731 VkColorSpaceKHR imageColorSpace
2732 VkExtent2D imageExtent
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002733 u32 imageArrayLayers
2734 VkImageUsageFlags imageUsage
Jesse Hall1356b0d2015-11-23 17:24:58 -08002735 VkSharingMode sharingMode
Jesse Hall03b6fe12015-11-24 12:44:21 -08002736 u32 queueFamilyIndexCount
Jesse Hall1356b0d2015-11-23 17:24:58 -08002737 const u32* pQueueFamilyIndices
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002738 VkSurfaceTransformFlagBitsKHR preTransform
2739 VkCompositeAlphaFlagBitsKHR compositeAlpha
Jesse Hall1356b0d2015-11-23 17:24:58 -08002740 VkPresentModeKHR presentMode
Jesse Hall1356b0d2015-11-23 17:24:58 -08002741 VkBool32 clipped
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002742 VkSwapchainKHR oldSwapchain
Michael Lentine88594d72015-11-12 12:49:45 -08002743}
2744
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002745@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08002746class VkPresentInfoKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002747 VkStructureType sType
2748 const void* pNext
Jesse Hallb00daad2015-11-29 19:46:20 -08002749 u32 waitSemaphoreCount
2750 const VkSemaphore* pWaitSemaphores
Jesse Hall1356b0d2015-11-23 17:24:58 -08002751 u32 swapchainCount
Jesse Hall03b6fe12015-11-24 12:44:21 -08002752 const VkSwapchainKHR* pSwapchains
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002753 const u32* pImageIndices
Jesse Halle1b12782015-11-30 11:27:32 -08002754 VkResult* pResults
Michael Lentine88594d72015-11-12 12:49:45 -08002755}
2756
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002757@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002758class VkDisplayPropertiesKHR {
2759 VkDisplayKHR display
2760 const char* displayName
2761 VkExtent2D physicalDimensions
2762 VkExtent2D physicalResolution
2763 VkSurfaceTransformFlagsKHR supportedTransforms
Jesse Hall1356b0d2015-11-23 17:24:58 -08002764 VkBool32 planeReorderPossible
Jesse Halla6429252015-11-29 18:59:42 -08002765 VkBool32 persistentContent
Michael Lentine88594d72015-11-12 12:49:45 -08002766}
2767
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002768@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08002769class VkDisplayModeParametersKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002770 VkExtent2D visibleRegion
Jesse Halla6429252015-11-29 18:59:42 -08002771 u32 refreshRate
Michael Lentine88594d72015-11-12 12:49:45 -08002772}
Jesse Halld27f6aa2015-08-15 17:58:48 -07002773
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002774@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002775class VkDisplayModePropertiesKHR {
2776 VkDisplayModeKHR displayMode
Jesse Halla6429252015-11-29 18:59:42 -08002777 VkDisplayModeParametersKHR parameters
Jesse Hall1356b0d2015-11-23 17:24:58 -08002778}
2779
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002780@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002781class VkDisplayModeCreateInfoKHR {
2782 VkStructureType sType
2783 const void* pNext
Jesse Hall9ba8bc82015-11-30 16:22:16 -08002784 VkDisplayModeCreateFlagsKHR flags
Jesse Halla6429252015-11-29 18:59:42 -08002785 VkDisplayModeParametersKHR parameters
Jesse Hall1356b0d2015-11-23 17:24:58 -08002786}
2787
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002788@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002789class VkDisplayPlanePropertiesKHR {
Jesse Halla6429252015-11-29 18:59:42 -08002790 VkDisplayKHR currentDisplay
2791 u32 currentStackIndex
2792}
2793
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002794@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08002795class VkDisplayPlaneCapabilitiesKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002796 VkDisplayPlaneAlphaFlagsKHR supportedAlpha
2797 VkOffset2D minSrcPosition
2798 VkOffset2D maxSrcPosition
2799 VkExtent2D minSrcExtent
2800 VkExtent2D maxSrcExtent
2801 VkOffset2D minDstPosition
2802 VkOffset2D maxDstPosition
2803 VkExtent2D minDstExtent
2804 VkExtent2D maxDstExtent
2805}
2806
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002807@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08002808class VkDisplaySurfaceCreateInfoKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002809 VkStructureType sType
2810 const void* pNext
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002811 VkDisplaySurfaceCreateFlagsKHR flags
Jesse Hall1356b0d2015-11-23 17:24:58 -08002812 VkDisplayModeKHR displayMode
2813 u32 planeIndex
2814 u32 planeStackIndex
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002815 VkSurfaceTransformFlagBitsKHR transform
Jesse Hall1356b0d2015-11-23 17:24:58 -08002816 f32 globalAlpha
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002817 VkDisplayPlaneAlphaFlagBitsKHR alphaMode
2818 VkExtent2D imageExtent
Jesse Hall1356b0d2015-11-23 17:24:58 -08002819}
2820
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002821@extension("VK_KHR_display_swapchain")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002822class VkDisplayPresentInfoKHR {
2823 VkStructureType sType
2824 const void* pNext
2825 VkRect2D srcRect
2826 VkRect2D dstRect
Jesse Halla6429252015-11-29 18:59:42 -08002827 VkBool32 persistent
Jesse Hall1356b0d2015-11-23 17:24:58 -08002828}
2829
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002830@extension("VK_KHR_xlib_surface")
2831class VkXlibSurfaceCreateInfoKHR {
2832 VkStructureType sType
2833 const void* pNext
2834 VkXlibSurfaceCreateFlagsKHR flags
2835 platform.Display* dpy
2836 platform.Window window
2837}
2838
2839@extension("VK_KHR_xcb_surface")
2840class VkXcbSurfaceCreateInfoKHR {
2841 VkStructureType sType
2842 const void* pNext
2843 VkXcbSurfaceCreateFlagsKHR flags
2844 platform.xcb_connection_t* connection
2845 platform.xcb_window_t window
2846}
2847
2848@extension("VK_KHR_wayland_surface")
2849class VkWaylandSurfaceCreateInfoKHR {
2850 VkStructureType sType
2851 const void* pNext
2852 VkWaylandSurfaceCreateFlagsKHR flags
2853 platform.wl_display* display
2854 platform.wl_surface* surface
2855}
2856
2857@extension("VK_KHR_mir_surface")
2858class VkMirSurfaceCreateInfoKHR {
2859 VkStructureType sType
2860 const void* pNext
2861 VkMirSurfaceCreateFlagsKHR flags
2862 platform.MirConnection* connection
2863 platform.MirSurface* mirSurface
2864}
2865
2866@extension("VK_KHR_android_surface")
2867class VkAndroidSurfaceCreateInfoKHR {
2868 VkStructureType sType
2869 const void* pNext
2870 VkAndroidSurfaceCreateFlagsKHR flags
2871 platform.ANativeWindow* window
2872}
2873
2874@extension("VK_KHR_win32_surface")
2875class VkWin32SurfaceCreateInfoKHR {
2876 VkStructureType sType
2877 const void* pNext
2878 VkWin32SurfaceCreateFlagsKHR flags
2879 platform.HINSTANCE hinstance
2880 platform.HWND hwnd
2881}
2882
Ian Elliott948233a2017-01-06 12:13:23 -07002883@extension("VK_KHR_incremental_present")
2884class VkRectLayerKHR {
2885 VkOffset2D offset
2886 VkExtent2D extent
2887 uint32_t layer
2888}
2889
2890@extension("VK_KHR_incremental_present")
2891class VkPresentRegionKHR {
2892 uint32_t rectangleCount
2893 const VkRectLayerKHR* pRectangles
2894}
2895
2896@extension("VK_KHR_incremental_present")
2897class VkPresentRegionsKHR {
2898 VkStructureType sType
2899 const void* pNext
2900 uint32_t swapchainCount
2901 const VkPresentRegionKHR* pRegions
2902}
2903
Chia-I Wub262ddc2016-03-22 07:38:20 +08002904@extension("VK_ANDROID_native_buffer")
2905class VkNativeBufferANDROID {
2906 VkStructureType sType
2907 const void* pNext
2908 platform.buffer_handle_t handle
2909 int stride
2910 int format
2911 int usage
2912}
2913
Chris Forbes8e4438b2016-12-07 16:26:49 +13002914@extension("VK_ANDROID_native_buffer")
2915class VkSwapchainImageCreateInfoANDROID {
2916 VkStructureType sType
2917 const void* pNext
2918 VkSwapchainImageUsageFlagBitsANDROID flags
2919}
2920
Jesse Hall715b86a2016-01-16 16:34:29 -08002921@extension("VK_EXT_debug_report")
2922class VkDebugReportCallbackCreateInfoEXT {
2923 VkStructureType sType
2924 const void* pNext
2925 VkDebugReportFlagsEXT flags
2926 PFN_vkDebugReportCallbackEXT pfnCallback
2927 void* pUserData
2928}
2929
Jesse Hall26763382016-05-20 07:13:52 -07002930@extension("VK_AMD_rasterization_order")
2931class VkPipelineRasterizationStateRasterizationOrderAMD {
2932 VkStructureType sType
2933 const void* pNext
2934 VkRasterizationOrderAMD rasterizationOrder
2935}
2936
2937@extension("VK_EXT_debug_marker")
2938class VkDebugMarkerObjectNameInfoEXT {
2939 VkStructureType sType
2940 const void* pNext
2941 VkDebugReportObjectTypeEXT objectType
2942 u64 object
2943 const char* pObjectName
2944}
2945
2946@extension("VK_EXT_debug_marker")
2947class VkDebugMarkerObjectTagInfoEXT {
2948 VkStructureType sType
2949 const void* pNext
2950 VkDebugReportObjectTypeEXT objectType
2951 u64 object
2952 u64 tagName
2953 platform.size_t tagSize
2954 const void* pTag
2955}
2956
2957@extension("VK_EXT_debug_marker")
2958class VkDebugMarkerMarkerInfoEXT {
2959 VkStructureType sType
2960 const void* pNext
2961 const char* pMarkerName
2962 f32[4] color
2963}
2964
Jesse Hall56d386a2016-07-26 15:20:40 -07002965@extension("VK_NV_dedicated_allocation")
2966class VkDedicatedAllocationImageCreateInfoNV {
2967 VkStructureType sType
2968 const void* pNext
2969 VkBool32 dedicatedAllocation
2970}
2971
2972@extension("VK_NV_dedicated_allocation")
2973class VkDedicatedAllocationBufferCreateInfoNV {
2974 VkStructureType sType
2975 const void* pNext
2976 VkBool32 dedicatedAllocation
2977}
2978
2979@extension("VK_NV_dedicated_allocation")
2980class VkDedicatedAllocationMemoryAllocateInfoNV {
2981 VkStructureType sType
2982 const void* pNext
2983 VkImage image
2984 VkBuffer buffer
2985}
2986
Chris Forbes1194ede2016-12-30 16:29:25 +13002987@extension("VK_KHR_get_physical_device_properties2")
2988class VkPhysicalDeviceFeatures2KHR {
2989 VkStructureType sType
2990 void* pNext
2991 VkPhysicalDeviceFeatures features
2992}
2993
2994@extension("VK_KHR_get_physical_device_properties2")
2995class VkPhysicalDeviceProperties2KHR {
2996 VkStructureType sType
2997 void* pNext
2998 VkPhysicalDeviceProperties properties
2999}
3000
3001@extension("VK_KHR_get_physical_device_properties2")
3002class VkFormatProperties2KHR {
3003 VkStructureType sType
3004 void* pNext
3005 VkFormatProperties formatProperties
3006}
3007
3008@extension("VK_KHR_get_physical_device_properties2")
3009class VkImageFormatProperties2KHR {
3010 VkStructureType sType
3011 void* pNext
3012 VkImageFormatProperties imageFormatProperties
3013}
3014
3015@extension("VK_KHR_get_physical_device_properties2")
3016class VkPhysicalDeviceImageFormatInfo2KHR {
3017 VkStructureType sType
3018 const void* pNext
3019 VkFormat format
3020 VkImageType type
3021 VkImageTiling tiling
3022 VkImageUsageFlags usage
3023 VkImageCreateFlags flags
3024}
3025
3026@extension("VK_KHR_get_physical_device_properties2")
3027class VkQueueFamilyProperties2KHR {
3028 VkStructureType sType
3029 void* pNext
3030 VkQueueFamilyProperties queueFamilyProperties
3031}
3032
3033@extension("VK_KHR_get_physical_device_properties2")
3034class VkPhysicalDeviceMemoryProperties2KHR {
3035 VkStructureType sType
3036 void* pNext
3037 VkPhysicalDeviceMemoryProperties memoryProperties
3038}
3039
3040@extension("VK_KHR_get_physical_device_properties2")
3041class VkSparseImageFormatProperties2KHR {
3042 VkStructureType sType
3043 void* pNext
3044 VkSparseImageFormatProperties properties
3045}
3046
3047@extension("VK_KHR_get_physical_device_properties2")
3048class VkPhysicalDeviceSparseImageFormatInfo2KHR {
3049 VkStructureType sType
3050 const void* pNext
3051 VkFormat format
3052 VkImageType type
3053 VkSampleCountFlagBits samples
3054 VkImageUsageFlags usage
3055 VkImageTiling tiling
3056}
3057
Chris Forbes289cb792016-12-30 15:03:55 +13003058@extension("VK_KHR_incremental_present")
3059class VkRectLayerKHR {
3060 VkOffset2D offset
3061 VkExtent2D extent
3062 u32 layer
3063}
3064
3065@extension("VK_KHR_incremental_present")
3066class VkPresentRegionKHR {
3067 u32 rectangleCount
3068 const VkRectLayerKHR* pRectangles
3069}
3070
3071@extension("VK_KHR_incremental_present")
3072class VkPresentRegionsKHR {
3073 VkStructureType sType
3074 const void* pNext
3075 u32 swapchainCount
3076 const VkPresentRegionKHR* pRegions
3077}
3078
3079@extension("VK_NV_external_memory_capabilities")
3080class VkExternalImageFormatPropertiesNV {
3081 VkImageFormatProperties imageFormatProperties
3082 VkExternalMemoryFeatureFlagsNV externalMemoryFeatures
3083 VkExternalMemoryHandleTypeFlagsNV exportFromImportedHandleTypes
3084 VkExternalMemoryHandleTypeFlagsNV compatibleHandleTypes
3085}
3086
3087@extension("VK_NV_external_memory")
3088class VkExternalMemoryImageCreateInfoNV {
3089 VkStructureType sType
3090 const void* pNext
3091 VkExternalMemoryHandleTypeFlagsNV handleTypes
3092}
3093
3094@extension("VK_NV_external_memory")
3095class VkExportMemoryAllocateInfoNV {
3096 VkStructureType sType
3097 const void* pNext
3098 VkExternalMemoryHandleTypeFlagsNV handleTypes
3099}
3100
3101@extension("VK_NV_external_memory_win32")
3102class VkImportMemoryWin32HandleInfoNV {
3103 VkStructureType sType
3104 const void* pNext
3105 VkExternalMemoryHandleTypeFlagsNV handleType
3106 platform.HANDLE handle
3107}
3108
3109@extension("VK_NV_external_memory_win32")
3110class VkExportMemoryWin32HandleInfoNV {
3111 VkStructureType sType
3112 const void* pNext
3113 const platform.SECURITY_ATTRIBUTES* pAttributes
3114 u32 dwAccess
3115}
3116
3117@extension("VK_NV_win32_keyed_mutex")
3118class VkWin32KeyedMutexAcquireReleaseInfoNV {
3119 VkStructureType sType
3120 const void* pNext
3121 u32 acquireCount
3122 const VkDeviceMemory* pAcquireSyncs
3123 const u64* pAcquireKeys
3124 const u32* pAcquireTimeoutMilliseconds
3125 u32 releaseCount
3126 const VkDeviceMemory* pReleaseSyncs
3127 const u64* pReleaseKeys
3128}
3129
3130@extension("VK_EXT_validation_flags")
3131class VkValidationFlagsEXT {
3132 VkStructureType sType
3133 const void* pNext
3134 u32 disabledValidationCheckCount
3135 VkValidationCheckEXT* pDisabledValidationChecks
3136}
3137
3138@extension("VK_NVX_device_generated_commands")
3139class VkDeviceGeneratedCommandsFeaturesNVX {
3140 VkStructureType sType
3141 const void* pNext
3142 VkBool32 computeBindingPointSupport
3143}
3144
3145@extension("VK_NVX_device_generated_commands")
3146class VkDeviceGeneratedCommandsLimitsNVX {
3147 VkStructureType sType
3148 const void* pNext
3149 u32 maxIndirectCommandsLayoutTokenCount
3150 u32 maxObjectEntryCounts
3151 u32 minSequenceCountBufferOffsetAlignment
3152 u32 minSequenceIndexBufferOffsetAlignment
3153 u32 minCommandsTokenBufferOffsetAlignment
3154}
3155
3156@extension("VK_NVX_device_generated_commands")
3157class VkIndirectCommandsTokenNVX {
3158 VkIndirectCommandsTokenTypeNVX tokenType
3159 VkBuffer buffer
3160 VkDeviceSize offset
3161}
3162
3163@extension("VK_NVX_device_generated_commands")
3164class VkIndirectCommandsLayoutTokenNVX {
3165 VkIndirectCommandsTokenTypeNVX tokenType
3166 u32 bindingUnit
3167 u32 dynamicCount
3168 u32 divisor
3169}
3170
3171@extension("VK_NVX_device_generated_commands")
3172class VkIndirectCommandsLayoutCreateInfoNVX {
3173 VkStructureType sType
3174 const void* pNext
3175 VkPipelineBindPoint pipelineBindPoint
3176 VkIndirectCommandsLayoutUsageFlagsNVX flags
3177 u32 tokenCount
3178 const VkIndirectCommandsLayoutTokenNVX* pTokens
3179}
3180
3181@extension("VK_NVX_device_generated_commands")
3182class VkCmdProcessCommandsInfoNVX {
3183 VkStructureType sType
3184 const void* pNext
3185 VkObjectTableNVX objectTable
3186 VkIndirectCommandsLayoutNVX indirectCommandsLayout
3187 u32 indirectCommandsTokenCount
3188 const VkIndirectCommandsTokenNVX* pIndirectCommandsTokens
3189 u32 maxSequencesCount
3190 VkCommandBuffer targetCommandBuffer
3191 VkBuffer sequencesCountBuffer
3192 VkDeviceSize sequencesCountOffset
3193 VkBuffer sequencesIndexBuffer
3194 VkDeviceSize sequencesIndexOffset
3195}
3196
3197@extension("VK_NVX_device_generated_commands")
3198class VkCmdReserveSpaceForCommandsInfoNVX {
3199 VkStructureType sType
3200 const void* pNext
3201 VkObjectTableNVX objectTable
3202 VkIndirectCommandsLayoutNVX indirectCommandsLayout
3203 u32 maxSequencesCount
3204}
3205
3206@extension("VK_NVX_device_generated_commands")
3207class VkObjectTableCreateInfoNVX {
3208 VkStructureType sType
3209 const void* pNext
3210 u32 objectCount
3211 const VkObjectEntryTypeNVX* pObjectEntryTypes
3212 const u32* pObjectEntryCounts
3213 const VkObjectEntryUsageFlagsNVX* pObjectEntryUsageFlags
3214 u32 maxUniformBuffersPerDescriptor
3215 u32 maxStorageBuffersPerDescriptor
3216 u32 maxStorageImagesPerDescriptor
3217 u32 maxSampledImagesPerDescriptor
3218 u32 maxPipelineLayouts
3219}
3220
3221@extension("VK_NVX_device_generated_commands")
3222class VkObjectTableEntryNVX {
3223 VkObjectEntryTypeNVX type
3224 VkObjectEntryUsageFlagsNVX flags
3225}
3226
3227@extension("VK_NVX_device_generated_commands")
3228class VkObjectTablePipelineEntryNVX {
3229 VkObjectEntryTypeNVX type
3230 VkObjectEntryUsageFlagsNVX flags
3231 VkPipeline pipeline
3232}
3233
3234@extension("VK_NVX_device_generated_commands")
3235class VkObjectTableDescriptorSetEntryNVX {
3236 VkObjectEntryTypeNVX type
3237 VkObjectEntryUsageFlagsNVX flags
3238 VkPipelineLayout pipelineLayout
3239 VkDescriptorSet descriptorSet
3240}
3241
3242@extension("VK_NVX_device_generated_commands")
3243class VkObjectTableVertexBufferEntryNVX {
3244 VkObjectEntryTypeNVX type
3245 VkObjectEntryUsageFlagsNVX flags
3246 VkBuffer buffer
3247}
3248
3249@extension("VK_NVX_device_generated_commands")
3250class VkObjectTableIndexBufferEntryNVX {
3251 VkObjectEntryTypeNVX type
3252 VkObjectEntryUsageFlagsNVX flags
3253 VkBuffer buffer
3254}
3255
3256@extension("VK_NVX_device_generated_commands")
3257class VkObjectTablePushConstantEntryNVX {
3258 VkObjectEntryTypeNVX type
3259 VkObjectEntryUsageFlagsNVX flags
3260 VkPipelineLayout pipelineLayout
3261 VkShaderStageFlags stageFlags
3262}
3263
3264
Jesse Hall1356b0d2015-11-23 17:24:58 -08003265
Jesse Halld27f6aa2015-08-15 17:58:48 -07003266////////////////
3267// Commands //
3268////////////////
3269
3270// Function pointers. TODO: add support for function pointers.
3271
3272@external type void* PFN_vkVoidFunction
3273@pfn cmd void vkVoidFunction() {
3274}
3275
Jesse Hall3fbc8562015-11-29 22:10:52 -08003276@external type void* PFN_vkAllocationFunction
3277@pfn cmd void* vkAllocationFunction(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003278 void* pUserData,
3279 platform.size_t size,
3280 platform.size_t alignment,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003281 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08003282 return ?
3283}
3284
Jesse Hall3fbc8562015-11-29 22:10:52 -08003285@external type void* PFN_vkReallocationFunction
3286@pfn cmd void* vkReallocationFunction(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003287 void* pUserData,
3288 void* pOriginal,
3289 platform.size_t size,
3290 platform.size_t alignment,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003291 VkSystemAllocationScope allocationScope) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003292 return ?
3293}
3294
3295@external type void* PFN_vkFreeFunction
3296@pfn cmd void vkFreeFunction(
3297 void* pUserData,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003298 void* pMemory) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003299}
3300
Jesse Hall3fbc8562015-11-29 22:10:52 -08003301@external type void* PFN_vkInternalAllocationNotification
3302@pfn cmd void vkInternalAllocationNotification(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003303 void* pUserData,
3304 platform.size_t size,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003305 VkInternalAllocationType allocationType,
3306 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08003307}
3308
3309@external type void* PFN_vkInternalFreeNotification
3310@pfn cmd void vkInternalFreeNotification(
3311 void* pUserData,
3312 platform.size_t size,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003313 VkInternalAllocationType allocationType,
3314 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08003315}
Jesse Halld27f6aa2015-08-15 17:58:48 -07003316
3317// Global functions
3318
3319@threadSafety("system")
3320cmd VkResult vkCreateInstance(
3321 const VkInstanceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003322 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003323 VkInstance* pInstance) {
3324 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO)
3325
3326 instance := ?
3327 pInstance[0] = instance
3328 State.Instances[instance] = new!InstanceObject()
3329
Jesse Hall3dd678a2016-01-08 21:52:01 -08003330 layers := pCreateInfo.ppEnabledLayerNames[0:pCreateInfo.enabledLayerCount]
3331 extensions := pCreateInfo.ppEnabledExtensionNames[0:pCreateInfo.enabledExtensionCount]
Jesse Halld27f6aa2015-08-15 17:58:48 -07003332
3333 return ?
3334}
3335
3336@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003337cmd void vkDestroyInstance(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003338 VkInstance instance,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003339 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003340 instanceObject := GetInstance(instance)
3341
3342 State.Instances[instance] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003343}
3344
3345@threadSafety("system")
3346cmd VkResult vkEnumeratePhysicalDevices(
3347 VkInstance instance,
3348 u32* pPhysicalDeviceCount,
3349 VkPhysicalDevice* pPhysicalDevices) {
3350 instanceObject := GetInstance(instance)
3351
3352 physicalDeviceCount := as!u32(?)
3353 pPhysicalDeviceCount[0] = physicalDeviceCount
3354 physicalDevices := pPhysicalDevices[0:physicalDeviceCount]
3355
3356 for i in (0 .. physicalDeviceCount) {
3357 physicalDevice := ?
3358 physicalDevices[i] = physicalDevice
3359 if !(physicalDevice in State.PhysicalDevices) {
3360 State.PhysicalDevices[physicalDevice] = new!PhysicalDeviceObject(instance: instance)
3361 }
3362 }
3363
3364 return ?
3365}
3366
3367cmd PFN_vkVoidFunction vkGetDeviceProcAddr(
3368 VkDevice device,
3369 const char* pName) {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003370 if device != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003371 device := GetDevice(device)
3372 }
3373
3374 return ?
3375}
3376
3377cmd PFN_vkVoidFunction vkGetInstanceProcAddr(
3378 VkInstance instance,
3379 const char* pName) {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003380 if instance != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003381 instanceObject := GetInstance(instance)
3382 }
3383
3384 return ?
3385}
3386
Jesse Hall606a54e2015-11-19 22:17:28 -08003387cmd void vkGetPhysicalDeviceProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003388 VkPhysicalDevice physicalDevice,
3389 VkPhysicalDeviceProperties* pProperties) {
3390 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3391
3392 properties := ?
3393 pProperties[0] = properties
Jesse Halld27f6aa2015-08-15 17:58:48 -07003394}
3395
Jesse Hall606a54e2015-11-19 22:17:28 -08003396cmd void vkGetPhysicalDeviceQueueFamilyProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003397 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003398 u32* pQueueFamilyPropertyCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003399 VkQueueFamilyProperties* pQueueFamilyProperties) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003400 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003401 // TODO: Figure out how to express fetch-count-or-properties
3402 // This version fails 'apic validate' with 'fence not allowed in
3403 // *semantic.Branch'. Other attempts have failed with the same or other
3404 // errors.
3405 // if pQueueFamilyProperties != null {
3406 // queuesProperties := pQueueFamilyProperties[0:pCount[0]]
3407 // for i in (0 .. pCount[0]) {
3408 // queueProperties := as!VkQueueFamilyProperties(?)
3409 // queuesProperties[i] = queueProperties
3410 // }
3411 // } else {
3412 // count := ?
3413 // pCount[0] = count
3414 // }
Jesse Halld27f6aa2015-08-15 17:58:48 -07003415}
3416
Jesse Hall606a54e2015-11-19 22:17:28 -08003417cmd void vkGetPhysicalDeviceMemoryProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003418 VkPhysicalDevice physicalDevice,
3419 VkPhysicalDeviceMemoryProperties* pMemoryProperties) {
3420 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3421
3422 memoryProperties := ?
3423 pMemoryProperties[0] = memoryProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07003424}
3425
Jesse Hall606a54e2015-11-19 22:17:28 -08003426cmd void vkGetPhysicalDeviceFeatures(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003427 VkPhysicalDevice physicalDevice,
3428 VkPhysicalDeviceFeatures* pFeatures) {
3429 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3430
3431 features := ?
3432 pFeatures[0] = features
Jesse Halld27f6aa2015-08-15 17:58:48 -07003433}
3434
Jesse Hall606a54e2015-11-19 22:17:28 -08003435cmd void vkGetPhysicalDeviceFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003436 VkPhysicalDevice physicalDevice,
3437 VkFormat format,
3438 VkFormatProperties* pFormatProperties) {
3439 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3440
3441 formatProperties := ?
3442 pFormatProperties[0] = formatProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07003443}
3444
Jesse Halla9e57032015-11-30 01:03:10 -08003445cmd VkResult vkGetPhysicalDeviceImageFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003446 VkPhysicalDevice physicalDevice,
3447 VkFormat format,
3448 VkImageType type,
3449 VkImageTiling tiling,
3450 VkImageUsageFlags usage,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003451 VkImageCreateFlags flags,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003452 VkImageFormatProperties* pImageFormatProperties) {
3453 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3454
3455 imageFormatProperties := ?
3456 pImageFormatProperties[0] = imageFormatProperties
Jesse Halla9e57032015-11-30 01:03:10 -08003457
3458 return ?
Jesse Halld27f6aa2015-08-15 17:58:48 -07003459}
3460
Jesse Halld27f6aa2015-08-15 17:58:48 -07003461
3462// Device functions
3463
3464@threadSafety("system")
3465cmd VkResult vkCreateDevice(
3466 VkPhysicalDevice physicalDevice,
3467 const VkDeviceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003468 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003469 VkDevice* pDevice) {
3470 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO)
3471 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3472
3473 device := ?
3474 pDevice[0] = device
3475 State.Devices[device] = new!DeviceObject(physicalDevice: physicalDevice)
3476
3477 return ?
3478}
3479
3480@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003481cmd void vkDestroyDevice(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003482 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003483 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003484 deviceObject := GetDevice(device)
3485
3486 State.Devices[device] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003487}
3488
3489
3490// Extension discovery functions
3491
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003492cmd VkResult vkEnumerateInstanceLayerProperties(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003493 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003494 VkLayerProperties* pProperties) {
3495 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08003496 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07003497
3498 properties := pProperties[0:count]
3499 for i in (0 .. count) {
3500 property := ?
3501 properties[i] = property
3502 }
3503
3504 return ?
3505}
3506
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003507cmd VkResult vkEnumerateInstanceExtensionProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003508 const char* pLayerName,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003509 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003510 VkExtensionProperties* pProperties) {
3511 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08003512 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07003513
3514 properties := pProperties[0:count]
3515 for i in (0 .. count) {
3516 property := ?
3517 properties[i] = property
3518 }
3519
3520 return ?
3521}
3522
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003523cmd VkResult vkEnumerateDeviceLayerProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003524 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003525 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003526 VkLayerProperties* pProperties) {
3527 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3528 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08003529 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07003530
3531 properties := pProperties[0:count]
3532 for i in (0 .. count) {
3533 property := ?
3534 properties[i] = property
3535 }
3536
3537 return ?
3538}
3539
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003540cmd VkResult vkEnumerateDeviceExtensionProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003541 VkPhysicalDevice physicalDevice,
3542 const char* pLayerName,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003543 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003544 VkExtensionProperties* pProperties) {
3545 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3546
3547 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08003548 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07003549
3550 properties := pProperties[0:count]
3551 for i in (0 .. count) {
3552 property := ?
3553 properties[i] = property
3554 }
3555
3556 return ?
3557}
3558
3559
3560// Queue functions
3561
3562@threadSafety("system")
Jesse Hall606a54e2015-11-19 22:17:28 -08003563cmd void vkGetDeviceQueue(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003564 VkDevice device,
3565 u32 queueFamilyIndex,
3566 u32 queueIndex,
3567 VkQueue* pQueue) {
3568 deviceObject := GetDevice(device)
3569
3570 queue := ?
3571 pQueue[0] = queue
3572
3573 if !(queue in State.Queues) {
3574 State.Queues[queue] = new!QueueObject(device: device)
3575 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07003576}
3577
3578@threadSafety("app")
3579cmd VkResult vkQueueSubmit(
3580 VkQueue queue,
Jesse Halla366a512015-11-19 22:30:07 -08003581 u32 submitCount,
Jesse Hallb00daad2015-11-29 19:46:20 -08003582 const VkSubmitInfo* pSubmits,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003583 VkFence fence) {
3584 queueObject := GetQueue(queue)
3585
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003586 if fence != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003587 fenceObject := GetFence(fence)
3588 assert(fenceObject.device == queueObject.device)
3589 }
3590
Jesse Hall3fbc8562015-11-29 22:10:52 -08003591 // commandBuffers := pcommandBuffers[0:commandBufferCount]
3592 // for i in (0 .. commandBufferCount) {
3593 // commandBuffer := commandBuffers[i]
3594 // commandBufferObject := GetCommandBuffer(commandBuffer)
3595 // assert(commandBufferObject.device == queueObject.device)
Jesse Halla366a512015-11-19 22:30:07 -08003596 //
Jesse Hall3fbc8562015-11-29 22:10:52 -08003597 // validate("QueueCheck", commandBufferObject.queueFlags in queueObject.flags,
3598 // "vkQueueSubmit: enqueued commandBuffer requires missing queue capabilities.")
Jesse Halla366a512015-11-19 22:30:07 -08003599 // }
Jesse Halld27f6aa2015-08-15 17:58:48 -07003600
3601 return ?
3602}
3603
3604@threadSafety("system")
3605cmd VkResult vkQueueWaitIdle(
3606 VkQueue queue) {
3607 queueObject := GetQueue(queue)
3608
3609 return ?
3610}
3611
3612@threadSafety("system")
3613cmd VkResult vkDeviceWaitIdle(
3614 VkDevice device) {
3615 deviceObject := GetDevice(device)
3616
3617 return ?
3618}
3619
3620
3621// Memory functions
3622
3623@threadSafety("system")
Jesse Hall3fbc8562015-11-29 22:10:52 -08003624cmd VkResult vkAllocateMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003625 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003626 const VkMemoryAllocateInfo* pAllocateInfo,
3627 const VkAllocationCallbacks* pAllocator,
3628 VkDeviceMemory* pMemory) {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08003629 assert(pAllocateInfo.sType == VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003630 deviceObject := GetDevice(device)
3631
Jesse Hall3fbc8562015-11-29 22:10:52 -08003632 memory := ?
3633 pMemory[0] = memory
3634 State.DeviceMemories[memory] = new!DeviceMemoryObject(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003635 device: device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003636 allocationSize: pAllocateInfo[0].allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003637
3638 return ?
3639}
3640
3641@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003642cmd void vkFreeMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003643 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003644 VkDeviceMemory memory,
3645 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003646 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003647 memoryObject := GetDeviceMemory(memory)
3648 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003649
3650 // Check that no objects are still bound before freeing.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003651 validate("MemoryCheck", len(memoryObject.boundObjects) == 0,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003652 "vkFreeMemory: objects still bound")
Jesse Hall3fbc8562015-11-29 22:10:52 -08003653 validate("MemoryCheck", len(memoryObject.boundCommandBuffers) == 0,
3654 "vkFreeMemory: commandBuffers still bound")
3655 State.DeviceMemories[memory] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003656}
3657
3658@threadSafety("app")
3659cmd VkResult vkMapMemory(
3660 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003661 VkDeviceMemory memory,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003662 VkDeviceSize offset,
3663 VkDeviceSize size,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003664 VkMemoryMapFlags flags,
3665 void** ppData) {
3666 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003667 memoryObject := GetDeviceMemory(memory)
3668 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003669
3670 assert(flags == as!VkMemoryMapFlags(0))
Jesse Hall3fbc8562015-11-29 22:10:52 -08003671 assert((offset + size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003672
3673 return ?
3674}
3675
3676@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003677cmd void vkUnmapMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003678 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003679 VkDeviceMemory memory) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003680 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003681 memoryObject := GetDeviceMemory(memory)
3682 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003683}
3684
3685cmd VkResult vkFlushMappedMemoryRanges(
3686 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003687 u32 memoryRangeCount
3688 const VkMappedMemoryRange* pMemoryRanges) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003689 deviceObject := GetDevice(device)
3690
Jesse Hall3fbc8562015-11-29 22:10:52 -08003691 memoryRanges := pMemoryRanges[0:memoryRangeCount]
3692 for i in (0 .. memoryRangeCount) {
3693 memoryRange := memoryRanges[i]
3694 memoryObject := GetDeviceMemory(memoryRange.memory)
3695 assert(memoryObject.device == device)
3696 assert((memoryRange.offset + memoryRange.size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003697 }
3698
3699 return ?
3700}
3701
3702cmd VkResult vkInvalidateMappedMemoryRanges(
3703 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003704 u32 memoryRangeCount,
3705 const VkMappedMemoryRange* pMemoryRanges) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003706 deviceObject := GetDevice(device)
3707
Jesse Hall3fbc8562015-11-29 22:10:52 -08003708 memoryRanges := pMemoryRanges[0:memoryRangeCount]
3709 for i in (0 .. memoryRangeCount) {
3710 memoryRange := memoryRanges[i]
3711 memoryObject := GetDeviceMemory(memoryRange.memory)
3712 assert(memoryObject.device == device)
3713 assert((memoryRange.offset + memoryRange.size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003714 }
3715
3716 return ?
3717}
3718
3719
3720// Memory management API functions
3721
Jesse Hall606a54e2015-11-19 22:17:28 -08003722cmd void vkGetDeviceMemoryCommitment(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003723 VkDevice device,
3724 VkDeviceMemory memory,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003725 VkDeviceSize* pCommittedMemoryInBytes) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003726 deviceObject := GetDevice(device)
3727
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003728 if memory != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003729 memoryObject := GetDeviceMemory(memory)
3730 assert(memoryObject.device == device)
3731 }
3732
3733 committedMemoryInBytes := ?
3734 pCommittedMemoryInBytes[0] = committedMemoryInBytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07003735}
3736
Jesse Hall606a54e2015-11-19 22:17:28 -08003737cmd void vkGetBufferMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003738 VkDevice device,
3739 VkBuffer buffer,
3740 VkMemoryRequirements* pMemoryRequirements) {
3741 deviceObject := GetDevice(device)
3742 bufferObject := GetBuffer(buffer)
3743 assert(bufferObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003744}
3745
3746cmd VkResult vkBindBufferMemory(
3747 VkDevice device,
3748 VkBuffer buffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003749 VkDeviceMemory memory,
3750 VkDeviceSize memoryOffset) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003751 deviceObject := GetDevice(device)
3752 bufferObject := GetBuffer(buffer)
3753 assert(bufferObject.device == device)
3754
3755 // Unbind buffer from previous memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003756 if bufferObject.memory != NULL_HANDLE {
3757 memoryObject := GetDeviceMemory(bufferObject.memory)
3758 memoryObject.boundObjects[as!u64(buffer)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003759 }
3760
3761 // Bind buffer to given memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003762 if memory != NULL_HANDLE {
3763 memoryObject := GetDeviceMemory(memory)
3764 assert(memoryObject.device == device)
3765 memoryObject.boundObjects[as!u64(buffer)] = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003766 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08003767 bufferObject.memory = memory
3768 bufferObject.memoryOffset = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003769
3770 return ?
3771}
3772
Jesse Hall606a54e2015-11-19 22:17:28 -08003773cmd void vkGetImageMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003774 VkDevice device,
3775 VkImage image,
3776 VkMemoryRequirements* pMemoryRequirements) {
3777 deviceObject := GetDevice(device)
3778 imageObject := GetImage(image)
3779 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003780}
3781
3782cmd VkResult vkBindImageMemory(
3783 VkDevice device,
3784 VkImage image,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003785 VkDeviceMemory memory,
3786 VkDeviceSize memoryOffset) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003787 deviceObject := GetDevice(device)
3788 imageObject := GetImage(image)
3789 assert(imageObject.device == device)
3790
3791 // Unbind image from previous memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003792 if imageObject.memory != NULL_HANDLE {
3793 memoryObject := GetDeviceMemory(imageObject.memory)
3794 memoryObject.boundObjects[as!u64(image)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003795 }
3796
3797 // Bind image to given memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003798 if memory != NULL_HANDLE {
3799 memoryObject := GetDeviceMemory(memory)
3800 assert(memoryObject.device == device)
3801 memoryObject.boundObjects[as!u64(image)] = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003802 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08003803 imageObject.memory = memory
3804 imageObject.memoryOffset = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003805
3806 return ?
3807}
3808
Jesse Hall606a54e2015-11-19 22:17:28 -08003809cmd void vkGetImageSparseMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003810 VkDevice device,
3811 VkImage image,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003812 u32* pSparseMemoryRequirementCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003813 VkSparseImageMemoryRequirements* pSparseMemoryRequirements) {
3814 deviceObject := GetDevice(device)
3815 imageObject := GetImage(image)
3816 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003817}
3818
Jesse Hall606a54e2015-11-19 22:17:28 -08003819cmd void vkGetPhysicalDeviceSparseImageFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003820 VkPhysicalDevice physicalDevice,
3821 VkFormat format,
3822 VkImageType type,
Jesse Hall091ed9e2015-11-30 00:55:29 -08003823 VkSampleCountFlagBits samples,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003824 VkImageUsageFlags usage,
3825 VkImageTiling tiling,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003826 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003827 VkSparseImageFormatProperties* pProperties) {
3828 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003829}
3830
Jesse Halla6429252015-11-29 18:59:42 -08003831cmd VkResult vkQueueBindSparse(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003832 VkQueue queue,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003833 u32 bindInfoCount,
Jesse Halla6429252015-11-29 18:59:42 -08003834 const VkBindSparseInfo* pBindInfo,
3835 VkFence fence) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003836 queueObject := GetQueue(queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003837
3838 return ?
3839}
3840
3841
3842// Fence functions
3843
3844@threadSafety("system")
3845cmd VkResult vkCreateFence(
3846 VkDevice device,
3847 const VkFenceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003848 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003849 VkFence* pFence) {
3850 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_FENCE_CREATE_INFO)
3851 deviceObject := GetDevice(device)
3852
3853 fence := ?
3854 pFence[0] = fence
3855 State.Fences[fence] = new!FenceObject(
Jesse Halld8bade02015-11-24 10:24:18 -08003856 device: device, signaled: (pCreateInfo.flags == as!VkFenceCreateFlags(VK_FENCE_CREATE_SIGNALED_BIT)))
Jesse Halld27f6aa2015-08-15 17:58:48 -07003857
3858 return ?
3859}
3860
3861@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003862cmd void vkDestroyFence(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003863 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003864 VkFence fence,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003865 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003866 deviceObject := GetDevice(device)
3867 fenceObject := GetFence(fence)
3868 assert(fenceObject.device == device)
3869
3870 State.Fences[fence] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003871}
3872
3873@threadSafety("system")
3874cmd VkResult vkResetFences(
3875 VkDevice device,
3876 u32 fenceCount,
3877 const VkFence* pFences) {
3878 deviceObject := GetDevice(device)
3879
3880 fences := pFences[0:fenceCount]
3881 for i in (0 .. fenceCount) {
3882 fence := fences[i]
3883 fenceObject := GetFence(fence)
3884 assert(fenceObject.device == device)
3885 fenceObject.signaled = false
3886 }
3887
3888 return ?
3889}
3890
3891@threadSafety("system")
3892cmd VkResult vkGetFenceStatus(
3893 VkDevice device,
3894 VkFence fence) {
3895 deviceObject := GetDevice(device)
3896 fenceObject := GetFence(fence)
3897 assert(fenceObject.device == device)
3898
3899 return ?
3900}
3901
3902@threadSafety("system")
3903cmd VkResult vkWaitForFences(
3904 VkDevice device,
3905 u32 fenceCount,
3906 const VkFence* pFences,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003907 VkBool32 waitAll,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003908 u64 timeout) { /// timeout in nanoseconds
3909 deviceObject := GetDevice(device)
3910
3911 fences := pFences[0:fenceCount]
3912 for i in (0 .. fenceCount) {
3913 fence := fences[i]
3914 fenceObject := GetFence(fence)
3915 assert(fenceObject.device == device)
3916 }
3917
3918 return ?
3919}
3920
3921
3922// Queue semaphore functions
3923
3924@threadSafety("system")
3925cmd VkResult vkCreateSemaphore(
3926 VkDevice device,
3927 const VkSemaphoreCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003928 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003929 VkSemaphore* pSemaphore) {
3930 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO)
3931 deviceObject := GetDevice(device)
3932
3933 semaphore := ?
3934 pSemaphore[0] = semaphore
3935 State.Semaphores[semaphore] = new!SemaphoreObject(device: device)
3936
3937 return ?
3938}
3939
3940@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003941cmd void vkDestroySemaphore(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003942 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003943 VkSemaphore semaphore,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003944 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003945 deviceObject := GetDevice(device)
3946 semaphoreObject := GetSemaphore(semaphore)
3947 assert(semaphoreObject.device == device)
3948
3949 State.Semaphores[semaphore] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003950}
3951
Jesse Halld27f6aa2015-08-15 17:58:48 -07003952
3953// Event functions
3954
3955@threadSafety("system")
3956cmd VkResult vkCreateEvent(
3957 VkDevice device,
3958 const VkEventCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003959 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003960 VkEvent* pEvent) {
3961 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_EVENT_CREATE_INFO)
3962 deviceObject := GetDevice(device)
3963
3964 event := ?
3965 pEvent[0] = event
3966 State.Events[event] = new!EventObject(device: device)
3967
3968 return ?
3969}
3970
3971@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003972cmd void vkDestroyEvent(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003973 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003974 VkEvent event,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003975 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003976 deviceObject := GetDevice(device)
3977 eventObject := GetEvent(event)
3978 assert(eventObject.device == device)
3979
3980 State.Events[event] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003981}
3982
3983@threadSafety("system")
3984cmd VkResult vkGetEventStatus(
3985 VkDevice device,
3986 VkEvent event) {
3987 deviceObject := GetDevice(device)
3988 eventObject := GetEvent(event)
3989 assert(eventObject.device == device)
3990
3991 return ?
3992}
3993
3994@threadSafety("system")
3995cmd VkResult vkSetEvent(
3996 VkDevice device,
3997 VkEvent event) {
3998 deviceObject := GetDevice(device)
3999 eventObject := GetEvent(event)
4000 assert(eventObject.device == device)
4001
4002 return ?
4003}
4004
4005@threadSafety("system")
4006cmd VkResult vkResetEvent(
4007 VkDevice device,
4008 VkEvent event) {
4009 deviceObject := GetDevice(device)
4010 eventObject := GetEvent(event)
4011 assert(eventObject.device == device)
4012
4013 return ?
4014}
4015
4016
4017// Query functions
4018
4019@threadSafety("system")
4020cmd VkResult vkCreateQueryPool(
4021 VkDevice device,
4022 const VkQueryPoolCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004023 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004024 VkQueryPool* pQueryPool) {
4025 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO)
4026 deviceObject := GetDevice(device)
4027
4028 queryPool := ?
4029 pQueryPool[0] = queryPool
4030 State.QueryPools[queryPool] = new!QueryPoolObject(device: device)
4031
4032 return ?
4033}
4034
4035@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004036cmd void vkDestroyQueryPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004037 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004038 VkQueryPool queryPool,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004039 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004040 deviceObject := GetDevice(device)
4041 queryPoolObject := GetQueryPool(queryPool)
4042 assert(queryPoolObject.device == device)
4043
4044 State.QueryPools[queryPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004045}
4046
4047@threadSafety("system")
4048cmd VkResult vkGetQueryPoolResults(
4049 VkDevice device,
4050 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004051 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004052 u32 queryCount,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004053 platform.size_t dataSize,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004054 void* pData,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004055 VkDeviceSize stride,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004056 VkQueryResultFlags flags) {
4057 deviceObject := GetDevice(device)
4058 queryPoolObject := GetQueryPool(queryPool)
4059 assert(queryPoolObject.device == device)
4060
Jesse Halld27f6aa2015-08-15 17:58:48 -07004061 data := pData[0:dataSize]
4062
4063 return ?
4064}
4065
4066// Buffer functions
4067
4068@threadSafety("system")
4069cmd VkResult vkCreateBuffer(
4070 VkDevice device,
4071 const VkBufferCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004072 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004073 VkBuffer* pBuffer) {
4074 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO)
4075 deviceObject := GetDevice(device)
4076
4077 buffer := ?
4078 pBuffer[0] = buffer
4079 State.Buffers[buffer] = new!BufferObject(device: device)
4080
4081 return ?
4082}
4083
4084@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004085cmd void vkDestroyBuffer(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004086 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004087 VkBuffer buffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004088 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004089 deviceObject := GetDevice(device)
4090 bufferObject := GetBuffer(buffer)
4091 assert(bufferObject.device == device)
4092
Jesse Hall3fbc8562015-11-29 22:10:52 -08004093 assert(bufferObject.memory == 0)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004094 State.Buffers[buffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004095}
4096
4097
4098// Buffer view functions
4099
4100@threadSafety("system")
4101cmd VkResult vkCreateBufferView(
4102 VkDevice device,
4103 const VkBufferViewCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004104 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004105 VkBufferView* pView) {
4106 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO)
4107 deviceObject := GetDevice(device)
4108
4109 bufferObject := GetBuffer(pCreateInfo.buffer)
4110 assert(bufferObject.device == device)
4111
4112 view := ?
4113 pView[0] = view
4114 State.BufferViews[view] = new!BufferViewObject(device: device, buffer: pCreateInfo.buffer)
4115
4116 return ?
4117}
4118
4119@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004120cmd void vkDestroyBufferView(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004121 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004122 VkBufferView bufferView,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004123 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004124 deviceObject := GetDevice(device)
4125 bufferViewObject := GetBufferView(bufferView)
4126 assert(bufferViewObject.device == device)
4127
4128 State.BufferViews[bufferView] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004129}
4130
4131
4132// Image functions
4133
4134@threadSafety("system")
4135cmd VkResult vkCreateImage(
4136 VkDevice device,
4137 const VkImageCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004138 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004139 VkImage* pImage) {
4140 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO)
4141 deviceObject := GetDevice(device)
4142
4143 image := ?
4144 pImage[0] = image
4145 State.Images[image] = new!ImageObject(device: device)
4146
4147 return ?
4148}
4149
4150@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004151cmd void vkDestroyImage(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004152 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004153 VkImage image,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004154 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004155 deviceObject := GetDevice(device)
4156 imageObject := GetImage(image)
4157 assert(imageObject.device == device)
4158
Jesse Hall3fbc8562015-11-29 22:10:52 -08004159 assert(imageObject.memory == 0)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004160 State.Images[image] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004161}
4162
Jesse Hall606a54e2015-11-19 22:17:28 -08004163cmd void vkGetImageSubresourceLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004164 VkDevice device,
4165 VkImage image,
4166 const VkImageSubresource* pSubresource,
4167 VkSubresourceLayout* pLayout) {
4168 deviceObject := GetDevice(device)
4169 imageObject := GetImage(image)
4170 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004171}
4172
4173
4174// Image view functions
4175
4176@threadSafety("system")
4177cmd VkResult vkCreateImageView(
4178 VkDevice device,
4179 const VkImageViewCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004180 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004181 VkImageView* pView) {
4182 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO)
4183 deviceObject := GetDevice(device)
4184
4185 imageObject := GetImage(pCreateInfo.image)
4186 assert(imageObject.device == device)
4187
4188 view := ?
4189 pView[0] = view
4190 State.ImageViews[view] = new!ImageViewObject(device: device, image: pCreateInfo.image)
4191
4192 return ?
4193}
4194
4195@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004196cmd void vkDestroyImageView(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004197 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004198 VkImageView imageView,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004199 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004200 deviceObject := GetDevice(device)
4201 imageViewObject := GetImageView(imageView)
4202 assert(imageViewObject.device == device)
4203
4204 State.ImageViews[imageView] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004205}
4206
4207
4208// Shader functions
4209
4210cmd VkResult vkCreateShaderModule(
4211 VkDevice device,
4212 const VkShaderModuleCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004213 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004214 VkShaderModule* pShaderModule) {
4215 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO)
4216 deviceObject := GetDevice(device)
4217
4218 shaderModule := ?
4219 pShaderModule[0] = shaderModule
4220 State.ShaderModules[shaderModule] = new!ShaderModuleObject(device: device)
4221
4222 return ?
4223}
4224
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004225cmd void vkDestroyShaderModule(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004226 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004227 VkShaderModule shaderModule,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004228 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004229 deviceObject := GetDevice(device)
4230 shaderModuleObject := GetShaderModule(shaderModule)
4231 assert(shaderModuleObject.device == device)
4232
4233 State.ShaderModules[shaderModule] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004234}
4235
Jesse Halld27f6aa2015-08-15 17:58:48 -07004236
4237// Pipeline functions
4238
4239cmd VkResult vkCreatePipelineCache(
4240 VkDevice device,
4241 const VkPipelineCacheCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004242 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004243 VkPipelineCache* pPipelineCache) {
4244 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO)
4245 deviceObject := GetDevice(device)
4246
4247 pipelineCache := ?
4248 pPipelineCache[0] = pipelineCache
4249 State.PipelineCaches[pipelineCache] = new!PipelineCacheObject(device: device)
4250
4251 return ?
4252}
4253
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004254cmd void vkDestroyPipelineCache(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004255 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004256 VkPipelineCache pipelineCache,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004257 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004258 deviceObject := GetDevice(device)
4259 pipelineCacheObject := GetPipelineCache(pipelineCache)
4260 assert(pipelineCacheObject.device == device)
4261
4262 State.PipelineCaches[pipelineCache] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004263}
4264
Jesse Halld27f6aa2015-08-15 17:58:48 -07004265cmd VkResult vkGetPipelineCacheData(
4266 VkDevice device,
4267 VkPipelineCache pipelineCache,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004268 platform.size_t* pDataSize,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004269 void* pData) {
4270 deviceObject := GetDevice(device)
4271 pipelineCacheObject := GetPipelineCache(pipelineCache)
4272 assert(pipelineCacheObject.device == device)
4273
4274 return ?
4275}
4276
4277cmd VkResult vkMergePipelineCaches(
4278 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004279 VkPipelineCache dstCache,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004280 u32 srcCacheCount,
4281 const VkPipelineCache* pSrcCaches) {
4282 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004283 dstCacheObject := GetPipelineCache(dstCache)
4284 assert(dstCacheObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004285
4286 srcCaches := pSrcCaches[0:srcCacheCount]
4287 for i in (0 .. srcCacheCount) {
4288 srcCache := srcCaches[i]
4289 srcCacheObject := GetPipelineCache(srcCache)
4290 assert(srcCacheObject.device == device)
4291 }
4292
4293 return ?
4294}
4295
4296cmd VkResult vkCreateGraphicsPipelines(
4297 VkDevice device,
4298 VkPipelineCache pipelineCache,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004299 u32 createInfoCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004300 const VkGraphicsPipelineCreateInfo* pCreateInfos,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004301 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004302 VkPipeline* pPipelines) {
4303 deviceObject := GetDevice(device)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004304 if pipelineCache != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004305 pipelineCacheObject := GetPipelineCache(pipelineCache)
4306 assert(pipelineCacheObject.device == device)
4307 }
4308
Jesse Hall03b6fe12015-11-24 12:44:21 -08004309 createInfos := pCreateInfos[0:createInfoCount]
4310 pipelines := pPipelines[0:createInfoCount]
4311 for i in (0 .. createInfoCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004312 pipeline := ?
4313 pipelines[i] = pipeline
4314 State.Pipelines[pipeline] = new!PipelineObject(device: device)
4315 }
4316
4317 return ?
4318}
4319
4320cmd VkResult vkCreateComputePipelines(
4321 VkDevice device,
4322 VkPipelineCache pipelineCache,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004323 u32 createInfoCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004324 const VkComputePipelineCreateInfo* pCreateInfos,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004325 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004326 VkPipeline* pPipelines) {
4327 deviceObject := GetDevice(device)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004328 if pipelineCache != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004329 pipelineCacheObject := GetPipelineCache(pipelineCache)
4330 assert(pipelineCacheObject.device == device)
4331 }
4332
Jesse Hall03b6fe12015-11-24 12:44:21 -08004333 createInfos := pCreateInfos[0:createInfoCount]
4334 pipelines := pPipelines[0:createInfoCount]
4335 for i in (0 .. createInfoCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004336 pipeline := ?
4337 pipelines[i] = pipeline
4338 State.Pipelines[pipeline] = new!PipelineObject(device: device)
4339 }
4340
4341 return ?
4342}
4343
4344@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004345cmd void vkDestroyPipeline(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004346 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004347 VkPipeline pipeline,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004348 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004349 deviceObject := GetDevice(device)
4350 pipelineObjects := GetPipeline(pipeline)
4351 assert(pipelineObjects.device == device)
4352
4353 State.Pipelines[pipeline] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004354}
4355
4356
4357// Pipeline layout functions
4358
4359@threadSafety("system")
4360cmd VkResult vkCreatePipelineLayout(
4361 VkDevice device,
4362 const VkPipelineLayoutCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004363 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004364 VkPipelineLayout* pPipelineLayout) {
4365 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO)
4366 deviceObject := GetDevice(device)
4367
4368 pipelineLayout := ?
4369 pPipelineLayout[0] = pipelineLayout
4370 State.PipelineLayouts[pipelineLayout] = new!PipelineLayoutObject(device: device)
4371
4372 return ?
4373}
4374
4375@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004376cmd void vkDestroyPipelineLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004377 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004378 VkPipelineLayout pipelineLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004379 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004380 deviceObject := GetDevice(device)
4381 pipelineLayoutObjects := GetPipelineLayout(pipelineLayout)
4382 assert(pipelineLayoutObjects.device == device)
4383
4384 State.PipelineLayouts[pipelineLayout] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004385}
4386
4387
4388// Sampler functions
4389
4390@threadSafety("system")
4391cmd VkResult vkCreateSampler(
4392 VkDevice device,
4393 const VkSamplerCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004394 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004395 VkSampler* pSampler) {
4396 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO)
4397 deviceObject := GetDevice(device)
4398
4399 sampler := ?
4400 pSampler[0] = sampler
4401 State.Samplers[sampler] = new!SamplerObject(device: device)
4402
4403 return ?
4404}
4405
4406@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004407cmd void vkDestroySampler(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004408 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004409 VkSampler sampler,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004410 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004411 deviceObject := GetDevice(device)
4412 samplerObject := GetSampler(sampler)
4413 assert(samplerObject.device == device)
4414
4415 State.Samplers[sampler] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004416}
4417
4418
4419// Descriptor set functions
4420
4421@threadSafety("system")
4422cmd VkResult vkCreateDescriptorSetLayout(
4423 VkDevice device,
4424 const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004425 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004426 VkDescriptorSetLayout* pSetLayout) {
4427 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO)
4428 deviceObject := GetDevice(device)
4429
4430 setLayout := ?
4431 pSetLayout[0] = setLayout
4432 State.DescriptorSetLayouts[setLayout] = new!DescriptorSetLayoutObject(device: device)
4433
4434 return ?
4435}
4436
4437@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004438cmd void vkDestroyDescriptorSetLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004439 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004440 VkDescriptorSetLayout descriptorSetLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004441 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004442 deviceObject := GetDevice(device)
4443 descriptorSetLayoutObject := GetDescriptorSetLayout(descriptorSetLayout)
4444 assert(descriptorSetLayoutObject.device == device)
4445
4446 State.DescriptorSetLayouts[descriptorSetLayout] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004447}
4448
4449@threadSafety("system")
4450cmd VkResult vkCreateDescriptorPool(
4451 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004452 const VkDescriptorPoolCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004453 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004454 VkDescriptorPool* pDescriptorPool) {
4455 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO)
4456 deviceObject := GetDevice(device)
4457
4458 descriptorPool := ?
4459 pDescriptorPool[0] = descriptorPool
4460 State.DescriptorPools[descriptorPool] = new!DescriptorPoolObject(device: device)
4461
4462 return ?
4463}
4464
4465@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004466cmd void vkDestroyDescriptorPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004467 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004468 VkDescriptorPool descriptorPool,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004469 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004470 deviceObject := GetDevice(device)
4471 descriptorPoolObject := GetDescriptorPool(descriptorPool)
4472 assert(descriptorPoolObject.device == device)
4473
4474 State.DescriptorPools[descriptorPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004475}
4476
4477@threadSafety("app")
4478cmd VkResult vkResetDescriptorPool(
4479 VkDevice device,
Jesse Hallfbf97b02015-11-20 14:17:03 -08004480 VkDescriptorPool descriptorPool,
4481 VkDescriptorPoolResetFlags flags) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004482 deviceObject := GetDevice(device)
4483 descriptorPoolObject := GetDescriptorPool(descriptorPool)
4484 assert(descriptorPoolObject.device == device)
4485
4486 return ?
4487}
4488
4489@threadSafety("app")
Jesse Hall3fbc8562015-11-29 22:10:52 -08004490cmd VkResult vkAllocateDescriptorSets(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004491 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004492 const VkDescriptorSetAllocateInfo* pAllocateInfo,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004493 VkDescriptorSet* pDescriptorSets) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004494 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004495 allocInfo := pAllocateInfo[0]
Jesse Hallfbf97b02015-11-20 14:17:03 -08004496 descriptorPoolObject := GetDescriptorPool(allocInfo.descriptorPool)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004497
Jesse Hall03b6fe12015-11-24 12:44:21 -08004498 setLayouts := allocInfo.pSetLayouts[0:allocInfo.setCount]
4499 for i in (0 .. allocInfo.setCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004500 setLayout := setLayouts[i]
4501 setLayoutObject := GetDescriptorSetLayout(setLayout)
4502 assert(setLayoutObject.device == device)
4503 }
4504
Jesse Hall03b6fe12015-11-24 12:44:21 -08004505 descriptorSets := pDescriptorSets[0:allocInfo.setCount]
4506 for i in (0 .. allocInfo.setCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004507 descriptorSet := ?
4508 descriptorSets[i] = descriptorSet
4509 State.DescriptorSets[descriptorSet] = new!DescriptorSetObject(device: device)
4510 }
4511
4512 return ?
4513}
4514
Jesse Hallf09c6b12015-08-15 19:54:28 -07004515cmd VkResult vkFreeDescriptorSets(
4516 VkDevice device,
4517 VkDescriptorPool descriptorPool,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004518 u32 descriptorSetCount,
Jesse Hallf09c6b12015-08-15 19:54:28 -07004519 const VkDescriptorSet* pDescriptorSets) {
4520 deviceObject := GetDevice(device)
4521 descriptorPoolObject := GetDescriptorPool(descriptorPool)
4522
Jesse Hall03b6fe12015-11-24 12:44:21 -08004523 descriptorSets := pDescriptorSets[0:descriptorSetCount]
4524 for i in (0 .. descriptorSetCount) {
Jesse Hallf09c6b12015-08-15 19:54:28 -07004525 descriptorSet := descriptorSets[i]
4526 descriptorSetObject := GetDescriptorSet(descriptorSet)
4527 assert(descriptorSetObject.device == device)
4528 State.DescriptorSets[descriptorSet] = null
4529 }
4530
4531 return ?
4532}
4533
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004534cmd void vkUpdateDescriptorSets(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004535 VkDevice device,
Jesse Hallb00daad2015-11-29 19:46:20 -08004536 u32 descriptorWriteCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004537 const VkWriteDescriptorSet* pDescriptorWrites,
Jesse Hallb00daad2015-11-29 19:46:20 -08004538 u32 descriptorCopyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004539 const VkCopyDescriptorSet* pDescriptorCopies) {
4540 deviceObject := GetDevice(device)
4541
Jesse Hallb00daad2015-11-29 19:46:20 -08004542 descriptorWrites := pDescriptorWrites[0:descriptorWriteCount]
4543 for i in (0 .. descriptorWriteCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004544 descriptorWrite := descriptorWrites[i]
Jesse Hall3fbc8562015-11-29 22:10:52 -08004545 descriptorWriteObject := GetDescriptorSet(descriptorWrite.dstSet)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004546 assert(descriptorWriteObject.device == device)
4547 }
4548
Jesse Hallb00daad2015-11-29 19:46:20 -08004549 descriptorCopies := pDescriptorCopies[0:descriptorCopyCount]
4550 for i in (0 .. descriptorCopyCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004551 descriptorCopy := descriptorCopies[i]
Jesse Hall3fbc8562015-11-29 22:10:52 -08004552 descriptorCopyObject := GetDescriptorSet(descriptorCopy.dstSet)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004553 assert(descriptorCopyObject.device == device)
4554 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07004555}
4556
4557
4558// Framebuffer functions
4559
4560@threadSafety("system")
4561cmd VkResult vkCreateFramebuffer(
4562 VkDevice device,
4563 const VkFramebufferCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004564 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004565 VkFramebuffer* pFramebuffer) {
4566 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO)
4567 deviceObject := GetDevice(device)
4568
4569 framebuffer := ?
4570 pFramebuffer[0] = framebuffer
4571 State.Framebuffers[framebuffer] = new!FramebufferObject(device: device)
4572
4573 return ?
4574}
4575
4576@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004577cmd void vkDestroyFramebuffer(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004578 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004579 VkFramebuffer framebuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004580 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004581 deviceObject := GetDevice(device)
4582 framebufferObject := GetFramebuffer(framebuffer)
4583 assert(framebufferObject.device == device)
4584
4585 State.Framebuffers[framebuffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004586}
4587
4588
4589// Renderpass functions
4590
4591@threadSafety("system")
4592cmd VkResult vkCreateRenderPass(
4593 VkDevice device,
4594 const VkRenderPassCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004595 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004596 VkRenderPass* pRenderPass) {
4597 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO)
4598 deviceObject := GetDevice(device)
4599
4600 renderpass := ?
4601 pRenderPass[0] = renderpass
4602 State.RenderPasses[renderpass] = new!RenderPassObject(device: device)
4603
4604 return ?
4605}
4606
4607@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004608cmd void vkDestroyRenderPass(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004609 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004610 VkRenderPass renderPass,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004611 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004612 deviceObject := GetDevice(device)
4613 renderPassObject := GetRenderPass(renderPass)
4614 assert(renderPassObject.device == device)
4615
4616 State.RenderPasses[renderPass] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004617}
4618
Jesse Hall606a54e2015-11-19 22:17:28 -08004619cmd void vkGetRenderAreaGranularity(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004620 VkDevice device,
4621 VkRenderPass renderPass,
4622 VkExtent2D* pGranularity) {
4623 deviceObject := GetDevice(device)
4624 renderPassObject := GetRenderPass(renderPass)
4625
4626 granularity := ?
4627 pGranularity[0] = granularity
Jesse Halld27f6aa2015-08-15 17:58:48 -07004628}
4629
4630// Command pool functions
4631
4632cmd VkResult vkCreateCommandPool(
4633 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004634 const VkCommandPoolCreateInfo* pCreateInfo,
4635 const VkAllocationCallbacks* pAllocator,
4636 VkCommandPool* pCommandPool) {
4637 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004638 deviceObject := GetDevice(device)
4639
Jesse Hall3fbc8562015-11-29 22:10:52 -08004640 commandPool := ?
4641 pCommandPool[0] = commandPool
4642 State.CommandPools[commandPool] = new!CommandPoolObject(device: device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004643
4644 return ?
4645}
4646
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004647cmd void vkDestroyCommandPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004648 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004649 VkCommandPool commandPool,
4650 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004651 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004652 commandPoolObject := GetCommandPool(commandPool)
4653 assert(commandPoolObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004654
Jesse Hall3fbc8562015-11-29 22:10:52 -08004655 State.CommandPools[commandPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004656}
4657
4658cmd VkResult vkResetCommandPool(
4659 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004660 VkCommandPool commandPool,
4661 VkCommandPoolResetFlags flags) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004662 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004663 commandPoolObject := GetCommandPool(commandPool)
4664 assert(commandPoolObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004665
4666 return ?
4667}
4668
4669// Command buffer functions
4670
Jesse Hall3fbc8562015-11-29 22:10:52 -08004671macro void bindCommandBuffer(VkCommandBuffer commandBuffer, any obj, VkDeviceMemory memory) {
4672 memoryObject := GetDeviceMemory(memory)
4673 memoryObject.boundCommandBuffers[commandBuffer] = commandBuffer
Jesse Halld27f6aa2015-08-15 17:58:48 -07004674
Jesse Hall3fbc8562015-11-29 22:10:52 -08004675 commandBufferObject := GetCommandBuffer(commandBuffer)
4676 commandBufferObject.boundObjects[as!u64(obj)] = memory
Jesse Halld27f6aa2015-08-15 17:58:48 -07004677}
4678
Jesse Hall3fbc8562015-11-29 22:10:52 -08004679macro void unbindCommandBuffer(VkCommandBuffer commandBuffer, any obj, VkDeviceMemory memory) {
4680 memoryObject := GetDeviceMemory(memory)
4681 memoryObject.boundCommandBuffers[commandBuffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004682
Jesse Hall3fbc8562015-11-29 22:10:52 -08004683 commandBufferObject := GetCommandBuffer(commandBuffer)
4684 commandBufferObject.boundObjects[as!u64(obj)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004685}
4686
4687@threadSafety("system")
Jesse Hall3fbc8562015-11-29 22:10:52 -08004688cmd VkResult vkAllocateCommandBuffers(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004689 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004690 const VkCommandBufferAllocateInfo* pAllocateInfo,
4691 VkCommandBuffer* pCommandBuffers) {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08004692 assert(pAllocateInfo[0].sType == VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004693
Jesse Hall3dd678a2016-01-08 21:52:01 -08004694 count := pAllocateInfo[0].commandBufferCount
Jesse Hall3fbc8562015-11-29 22:10:52 -08004695 commandBuffers := pCommandBuffers[0:count]
Jesse Hallfbf97b02015-11-20 14:17:03 -08004696 for i in (0 .. count) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004697 commandBuffer := ?
4698 commandBuffers[i] = commandBuffer
4699 State.CommandBuffers[commandBuffer] = new!CommandBufferObject(device: device)
Jesse Hallfbf97b02015-11-20 14:17:03 -08004700 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07004701
4702 return ?
4703}
4704
4705@threadSafety("system")
Jesse Hallfbf97b02015-11-20 14:17:03 -08004706cmd void vkFreeCommandBuffers(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004707 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004708 VkCommandPool commandPool,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004709 u32 commandBufferCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004710 const VkCommandBuffer* pCommandBuffers) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004711 deviceObject := GetDevice(device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004712
Jesse Hall3fbc8562015-11-29 22:10:52 -08004713 commandBuffers := pCommandBuffers[0:commandBufferCount]
Jesse Hall03b6fe12015-11-24 12:44:21 -08004714 for i in (0 .. commandBufferCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004715 commandBufferObject := GetCommandBuffer(commandBuffers[i])
4716 assert(commandBufferObject.device == device)
Jesse Hallfbf97b02015-11-20 14:17:03 -08004717 // TODO: iterate over boundObjects and clear memory bindings
Jesse Hall3fbc8562015-11-29 22:10:52 -08004718 State.CommandBuffers[commandBuffers[i]] = null
Jesse Hallfbf97b02015-11-20 14:17:03 -08004719 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07004720}
4721
4722@threadSafety("app")
4723cmd VkResult vkBeginCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004724 VkCommandBuffer commandBuffer,
4725 const VkCommandBufferBeginInfo* pBeginInfo) {
4726 assert(pBeginInfo.sType == VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO)
4727 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004728
4729 // TODO: iterate over boundObjects and clear memory bindings
4730
4731 return ?
4732}
4733
4734@threadSafety("app")
4735cmd VkResult vkEndCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004736 VkCommandBuffer commandBuffer) {
4737 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004738
4739 return ?
4740}
4741
4742@threadSafety("app")
4743cmd VkResult vkResetCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004744 VkCommandBuffer commandBuffer,
4745 VkCommandBufferResetFlags flags) {
4746 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004747
4748 // TODO: iterate over boundObjects and clear memory bindings
4749
4750 return ?
4751}
4752
4753
4754// Command buffer building functions
4755
4756@threadSafety("app")
4757cmd void vkCmdBindPipeline(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004758 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004759 VkPipelineBindPoint pipelineBindPoint,
4760 VkPipeline pipeline) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004761 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004762 pipelineObject := GetPipeline(pipeline)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004763 assert(commandBufferObject.device == pipelineObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004764
Jesse Halld8bade02015-11-24 10:24:18 -08004765 queue := switch (pipelineBindPoint) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004766 case VK_PIPELINE_BIND_POINT_COMPUTE: VK_QUEUE_COMPUTE_BIT
4767 case VK_PIPELINE_BIND_POINT_GRAPHICS: VK_QUEUE_GRAPHICS_BIT
4768 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08004769 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004770}
4771
4772@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004773cmd void vkCmdSetViewport(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004774 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004775 u32 firstViewport,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004776 u32 viewportCount,
4777 const VkViewport* pViewports) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004778 commandBufferObject := GetCommandBuffer(commandBuffer)
4779 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004780}
4781
4782@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004783cmd void vkCmdSetScissor(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004784 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004785 u32 firstScissor,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004786 u32 scissorCount,
4787 const VkRect2D* pScissors) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004788 commandBufferObject := GetCommandBuffer(commandBuffer)
4789 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004790}
4791
4792@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004793cmd void vkCmdSetLineWidth(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004794 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004795 f32 lineWidth) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004796 commandBufferObject := GetCommandBuffer(commandBuffer)
4797 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004798}
4799
4800@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004801cmd void vkCmdSetDepthBias(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004802 VkCommandBuffer commandBuffer,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004803 f32 depthBiasConstantFactor,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004804 f32 depthBiasClamp,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004805 f32 depthBiasSlopeFactor) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004806 commandBufferObject := GetCommandBuffer(commandBuffer)
4807 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004808}
Jesse Halld27f6aa2015-08-15 17:58:48 -07004809
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004810@threadSafety("app")
4811cmd void vkCmdSetBlendConstants(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004812 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004813 // TODO(jessehall): apic only supports 'const' on pointer types. Using
4814 // an annotation as a quick hack to pass this to the template without
4815 // having to modify the AST and semantic model.
Jesse Hallb00daad2015-11-29 19:46:20 -08004816 @readonly f32[4] blendConstants) {
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 vkCmdSetDepthBounds(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004823 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004824 f32 minDepthBounds,
4825 f32 maxDepthBounds) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004826 commandBufferObject := GetCommandBuffer(commandBuffer)
4827 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004828}
4829
4830@threadSafety("app")
4831cmd void vkCmdSetStencilCompareMask(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004832 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004833 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08004834 u32 compareMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004835 commandBufferObject := GetCommandBuffer(commandBuffer)
4836 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004837}
4838
4839@threadSafety("app")
4840cmd void vkCmdSetStencilWriteMask(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004841 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004842 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08004843 u32 writeMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004844 commandBufferObject := GetCommandBuffer(commandBuffer)
4845 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004846}
4847
4848@threadSafety("app")
4849cmd void vkCmdSetStencilReference(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004850 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004851 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08004852 u32 reference) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004853 commandBufferObject := GetCommandBuffer(commandBuffer)
4854 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004855}
4856
4857@threadSafety("app")
4858cmd void vkCmdBindDescriptorSets(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004859 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004860 VkPipelineBindPoint pipelineBindPoint,
4861 VkPipelineLayout layout,
4862 u32 firstSet,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004863 u32 descriptorSetCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004864 const VkDescriptorSet* pDescriptorSets,
4865 u32 dynamicOffsetCount,
4866 const u32* pDynamicOffsets) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004867 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004868
Jesse Hall03b6fe12015-11-24 12:44:21 -08004869 descriptorSets := pDescriptorSets[0:descriptorSetCount]
4870 for i in (0 .. descriptorSetCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004871 descriptorSet := descriptorSets[i]
4872 descriptorSetObject := GetDescriptorSet(descriptorSet)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004873 assert(commandBufferObject.device == descriptorSetObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004874 }
4875
4876 dynamicOffsets := pDynamicOffsets[0:dynamicOffsetCount]
4877 for i in (0 .. dynamicOffsetCount) {
4878 dynamicOffset := dynamicOffsets[i]
4879 }
4880
Jesse Halld8bade02015-11-24 10:24:18 -08004881 queue := switch (pipelineBindPoint) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004882 case VK_PIPELINE_BIND_POINT_COMPUTE: VK_QUEUE_COMPUTE_BIT
4883 case VK_PIPELINE_BIND_POINT_GRAPHICS: VK_QUEUE_GRAPHICS_BIT
4884 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08004885 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004886}
4887
4888@threadSafety("app")
4889cmd void vkCmdBindIndexBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004890 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004891 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004892 VkDeviceSize offset,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004893 VkIndexType indexType) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004894 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004895 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004896 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004897
Jesse Hall3fbc8562015-11-29 22:10:52 -08004898 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004899
Jesse Hall3fbc8562015-11-29 22:10:52 -08004900 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004901}
4902
4903@threadSafety("app")
4904cmd void vkCmdBindVertexBuffers(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004905 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004906 u32 firstBinding,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004907 u32 bindingCount,
4908 const VkBuffer* pBuffers,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004909 const VkDeviceSize* pOffsets) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004910 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004911
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004912 // TODO: check if not [firstBinding:firstBinding+bindingCount]
Jesse Halld27f6aa2015-08-15 17:58:48 -07004913 buffers := pBuffers[0:bindingCount]
4914 offsets := pOffsets[0:bindingCount]
4915 for i in (0 .. bindingCount) {
4916 buffer := buffers[i]
4917 offset := offsets[i]
4918 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004919 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004920
Jesse Hall3fbc8562015-11-29 22:10:52 -08004921 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004922 }
4923
Jesse Hall3fbc8562015-11-29 22:10:52 -08004924 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004925}
4926
4927@threadSafety("app")
4928cmd void vkCmdDraw(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004929 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004930 u32 vertexCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004931 u32 instanceCount,
4932 u32 firstVertex,
4933 u32 firstInstance) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004934 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004935
Jesse Hall3fbc8562015-11-29 22:10:52 -08004936 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004937}
4938
4939@threadSafety("app")
4940cmd void vkCmdDrawIndexed(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004941 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004942 u32 indexCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004943 u32 instanceCount,
4944 u32 firstIndex,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004945 s32 vertexOffset,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004946 u32 firstInstance) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004947 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004948
Jesse Hall3fbc8562015-11-29 22:10:52 -08004949 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004950}
4951
4952@threadSafety("app")
4953cmd void vkCmdDrawIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004954 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004955 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004956 VkDeviceSize offset,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004957 u32 drawCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004958 u32 stride) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004959 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004960 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004961 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004962
Jesse Hall3fbc8562015-11-29 22:10:52 -08004963 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004964
Jesse Hall3fbc8562015-11-29 22:10:52 -08004965 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004966}
4967
4968@threadSafety("app")
4969cmd void vkCmdDrawIndexedIndirect(
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 Hall03b6fe12015-11-24 12:44:21 -08004973 u32 drawCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004974 u32 stride) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004975 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004976 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004977 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004978
Jesse Hall3fbc8562015-11-29 22:10:52 -08004979 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004980
Jesse Hall3fbc8562015-11-29 22:10:52 -08004981 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004982}
4983
4984@threadSafety("app")
4985cmd void vkCmdDispatch(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004986 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004987 u32 x,
4988 u32 y,
4989 u32 z) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004990 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004991
Jesse Hall3fbc8562015-11-29 22:10:52 -08004992 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_COMPUTE_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004993}
4994
4995@threadSafety("app")
4996cmd void vkCmdDispatchIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004997 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004998 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004999 VkDeviceSize offset) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005000 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005001 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005002 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005003
Jesse Hall3fbc8562015-11-29 22:10:52 -08005004 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005005
Jesse Hall3fbc8562015-11-29 22:10:52 -08005006 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_COMPUTE_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005007}
5008
5009@threadSafety("app")
5010cmd void vkCmdCopyBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005011 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005012 VkBuffer srcBuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005013 VkBuffer dstBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005014 u32 regionCount,
5015 const VkBufferCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005016 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005017 srcBufferObject := GetBuffer(srcBuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005018 dstBufferObject := GetBuffer(dstBuffer)
5019 assert(commandBufferObject.device == srcBufferObject.device)
5020 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005021
5022 regions := pRegions[0:regionCount]
5023 for i in (0 .. regionCount) {
5024 region := regions[i]
5025 }
5026
Jesse Hall3fbc8562015-11-29 22:10:52 -08005027 bindCommandBuffer(commandBuffer, srcBuffer, srcBufferObject.memory)
5028 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005029
Jesse Hall65ab5522015-11-30 00:07:16 -08005030 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005031}
5032
5033@threadSafety("app")
5034cmd void vkCmdCopyImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005035 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005036 VkImage srcImage,
5037 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005038 VkImage dstImage,
5039 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005040 u32 regionCount,
5041 const VkImageCopy* pRegions) {
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 Hall65ab5522015-11-30 00:07:16 -08005056 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005057}
5058
5059@threadSafety("app")
5060cmd void vkCmdBlitImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005061 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005062 VkImage srcImage,
5063 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005064 VkImage dstImage,
5065 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005066 u32 regionCount,
5067 const VkImageBlit* pRegions,
Jesse Hall23ff73f2015-11-29 14:36:39 -08005068 VkFilter filter) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005069 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005070 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005071 dstImageObject := GetImage(dstImage)
5072 assert(commandBufferObject.device == srcImageObject.device)
5073 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005074
5075 regions := pRegions[0:regionCount]
5076 for i in (0 .. regionCount) {
5077 region := regions[i]
5078 }
5079
Jesse Hall3fbc8562015-11-29 22:10:52 -08005080 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
5081 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005082
Jesse Hall3fbc8562015-11-29 22:10:52 -08005083 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005084}
5085
5086@threadSafety("app")
5087cmd void vkCmdCopyBufferToImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005088 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005089 VkBuffer srcBuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005090 VkImage dstImage,
5091 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005092 u32 regionCount,
5093 const VkBufferImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005094 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005095 srcBufferObject := GetBuffer(srcBuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005096 dstImageObject := GetImage(dstImage)
5097 assert(commandBufferObject.device == srcBufferObject.device)
5098 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005099
5100 regions := pRegions[0:regionCount]
5101 for i in (0 .. regionCount) {
5102 region := regions[i]
5103 }
5104
Jesse Hall3fbc8562015-11-29 22:10:52 -08005105 bindCommandBuffer(commandBuffer, srcBuffer, srcBufferObject.memory)
5106 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005107
Jesse Hall65ab5522015-11-30 00:07:16 -08005108 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005109}
5110
5111@threadSafety("app")
5112cmd void vkCmdCopyImageToBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005113 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005114 VkImage srcImage,
5115 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005116 VkBuffer dstBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005117 u32 regionCount,
5118 const VkBufferImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005119 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005120 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005121 dstBufferObject := GetBuffer(dstBuffer)
5122 assert(commandBufferObject.device == srcImageObject.device)
5123 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005124
5125 regions := pRegions[0:regionCount]
5126 for i in (0 .. regionCount) {
5127 region := regions[i]
5128 }
5129
Jesse Hall3fbc8562015-11-29 22:10:52 -08005130 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
5131 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005132
Jesse Hall65ab5522015-11-30 00:07:16 -08005133 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005134}
5135
5136@threadSafety("app")
5137cmd void vkCmdUpdateBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005138 VkCommandBuffer commandBuffer,
5139 VkBuffer dstBuffer,
5140 VkDeviceSize dstOffset,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005141 VkDeviceSize dataSize,
Jesse Hall56d386a2016-07-26 15:20:40 -07005142 const void* pData) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005143 commandBufferObject := GetCommandBuffer(commandBuffer)
5144 dstBufferObject := GetBuffer(dstBuffer)
5145 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005146
5147 data := pData[0:dataSize]
5148
Jesse Hall3fbc8562015-11-29 22:10:52 -08005149 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005150
Jesse Hall65ab5522015-11-30 00:07:16 -08005151 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005152}
5153
5154@threadSafety("app")
5155cmd void vkCmdFillBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005156 VkCommandBuffer commandBuffer,
5157 VkBuffer dstBuffer,
5158 VkDeviceSize dstOffset,
Jesse Hallb00daad2015-11-29 19:46:20 -08005159 VkDeviceSize size,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005160 u32 data) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005161 commandBufferObject := GetCommandBuffer(commandBuffer)
5162 dstBufferObject := GetBuffer(dstBuffer)
5163 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005164
Jesse Hall65ab5522015-11-30 00:07:16 -08005165 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005166}
5167
5168@threadSafety("app")
5169cmd void vkCmdClearColorImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005170 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005171 VkImage image,
5172 VkImageLayout imageLayout,
5173 const VkClearColorValue* pColor,
5174 u32 rangeCount,
5175 const VkImageSubresourceRange* pRanges) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005176 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005177 imageObject := GetImage(image)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005178 assert(commandBufferObject.device == imageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005179
5180 ranges := pRanges[0:rangeCount]
5181 for i in (0 .. rangeCount) {
5182 range := ranges[i]
5183 }
5184
Jesse Hall3fbc8562015-11-29 22:10:52 -08005185 bindCommandBuffer(commandBuffer, image, imageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005186
Jesse Hall3fbc8562015-11-29 22:10:52 -08005187 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005188}
5189
5190@threadSafety("app")
5191cmd void vkCmdClearDepthStencilImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005192 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005193 VkImage image,
5194 VkImageLayout imageLayout,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005195 const VkClearDepthStencilValue* pDepthStencil,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005196 u32 rangeCount,
5197 const VkImageSubresourceRange* pRanges) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005198 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005199 imageObject := GetImage(image)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005200 assert(commandBufferObject.device == imageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005201
5202 ranges := pRanges[0:rangeCount]
5203 for i in (0 .. rangeCount) {
5204 range := ranges[i]
5205 }
5206
Jesse Hall3fbc8562015-11-29 22:10:52 -08005207 bindCommandBuffer(commandBuffer, image, imageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005208
Jesse Hall3fbc8562015-11-29 22:10:52 -08005209 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005210}
5211
5212@threadSafety("app")
Jesse Hallae38f732015-11-19 21:32:50 -08005213cmd void vkCmdClearAttachments(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005214 VkCommandBuffer commandBuffer,
Jesse Hallae38f732015-11-19 21:32:50 -08005215 u32 attachmentCount,
5216 const VkClearAttachment* pAttachments,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005217 u32 rectCount,
Jesse Halla15a4bf2015-11-19 22:48:02 -08005218 const VkClearRect* pRects) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005219 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005220
5221 rects := pRects[0:rectCount]
5222 for i in (0 .. rectCount) {
5223 rect := rects[i]
5224 }
5225
Jesse Hall3fbc8562015-11-29 22:10:52 -08005226 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005227}
5228
5229@threadSafety("app")
5230cmd void vkCmdResolveImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005231 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005232 VkImage srcImage,
5233 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005234 VkImage dstImage,
5235 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005236 u32 regionCount,
5237 const VkImageResolve* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005238 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005239 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005240 dstImageObject := GetImage(dstImage)
5241 assert(commandBufferObject.device == srcImageObject.device)
5242 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005243
5244 regions := pRegions[0:regionCount]
5245 for i in (0 .. regionCount) {
5246 region := regions[i]
5247 }
5248
Jesse Hall3fbc8562015-11-29 22:10:52 -08005249 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
5250 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005251
Jesse Hall3fbc8562015-11-29 22:10:52 -08005252 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005253}
5254
5255@threadSafety("app")
5256cmd void vkCmdSetEvent(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005257 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005258 VkEvent event,
5259 VkPipelineStageFlags stageMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005260 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005261 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005262 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005263}
5264
5265@threadSafety("app")
5266cmd void vkCmdResetEvent(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005267 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005268 VkEvent event,
5269 VkPipelineStageFlags stageMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005270 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005271 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005272 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005273}
5274
5275@threadSafety("app")
5276cmd void vkCmdWaitEvents(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005277 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005278 u32 eventCount,
5279 const VkEvent* pEvents,
5280 VkPipelineStageFlags srcStageMask,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005281 VkPipelineStageFlags dstStageMask,
5282 u32 memoryBarrierCount,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005283 const VkMemoryBarrier* pMemoryBarriers,
5284 u32 bufferMemoryBarrierCount,
5285 const VkBufferMemoryBarrier* pBufferMemoryBarriers,
5286 u32 imageMemoryBarrierCount,
5287 const VkImageMemoryBarrier* pImageMemoryBarriers) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005288 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005289
5290 events := pEvents[0:eventCount]
5291 for i in (0 .. eventCount) {
5292 event := events[i]
5293 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005294 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005295 }
5296
Jesse Hall3dd678a2016-01-08 21:52:01 -08005297 memoryBarriers := pMemoryBarriers[0:memoryBarrierCount]
Jesse Hall3fbc8562015-11-29 22:10:52 -08005298 for i in (0 .. memoryBarrierCount) {
Jesse Hall3dd678a2016-01-08 21:52:01 -08005299 memoryBarrier := memoryBarriers[i]
5300 }
5301 bufferMemoryBarriers := pBufferMemoryBarriers[0:bufferMemoryBarrierCount]
5302 for i in (0 .. bufferMemoryBarrierCount) {
5303 bufferMemoryBarrier := bufferMemoryBarriers[i]
5304 bufferObject := GetBuffer(bufferMemoryBarrier.buffer)
5305 assert(bufferObject.device == commandBufferObject.device)
5306 }
5307 imageMemoryBarriers := pImageMemoryBarriers[0:imageMemoryBarrierCount]
5308 for i in (0 .. imageMemoryBarrierCount) {
5309 imageMemoryBarrier := imageMemoryBarriers[i]
5310 imageObject := GetImage(imageMemoryBarrier.image)
5311 assert(imageObject.device == commandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005312 }
5313}
5314
5315@threadSafety("app")
5316cmd void vkCmdPipelineBarrier(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005317 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005318 VkPipelineStageFlags srcStageMask,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005319 VkPipelineStageFlags dstStageMask,
Jesse Halldc6d36c2015-11-29 19:12:15 -08005320 VkDependencyFlags dependencyFlags,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005321 u32 memoryBarrierCount,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005322 const VkMemoryBarrier* pMemoryBarriers,
5323 u32 bufferMemoryBarrierCount,
5324 const VkBufferMemoryBarrier* pBufferMemoryBarriers,
5325 u32 imageMemoryBarrierCount,
5326 const VkImageMemoryBarrier* pImageMemoryBarriers) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005327 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005328
Jesse Hall3dd678a2016-01-08 21:52:01 -08005329 memoryBarriers := pMemoryBarriers[0:memoryBarrierCount]
Jesse Hall3fbc8562015-11-29 22:10:52 -08005330 for i in (0 .. memoryBarrierCount) {
Jesse Hall3dd678a2016-01-08 21:52:01 -08005331 memoryBarrier := memoryBarriers[i]
5332 }
5333 bufferMemoryBarriers := pBufferMemoryBarriers[0:bufferMemoryBarrierCount]
5334 for i in (0 .. bufferMemoryBarrierCount) {
5335 bufferMemoryBarrier := bufferMemoryBarriers[i]
5336 bufferObject := GetBuffer(bufferMemoryBarrier.buffer)
5337 assert(bufferObject.device == commandBufferObject.device)
5338 }
5339 imageMemoryBarriers := pImageMemoryBarriers[0:imageMemoryBarrierCount]
5340 for i in (0 .. imageMemoryBarrierCount) {
5341 imageMemoryBarrier := imageMemoryBarriers[i]
5342 imageObject := GetImage(imageMemoryBarrier.image)
5343 assert(imageObject.device == commandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005344 }
5345}
5346
5347@threadSafety("app")
5348cmd void vkCmdBeginQuery(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005349 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005350 VkQueryPool queryPool,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005351 u32 query,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005352 VkQueryControlFlags flags) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005353 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005354 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005355 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005356}
5357
5358@threadSafety("app")
5359cmd void vkCmdEndQuery(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005360 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005361 VkQueryPool queryPool,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005362 u32 query) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005363 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005364 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005365 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005366}
5367
5368@threadSafety("app")
5369cmd void vkCmdResetQueryPool(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005370 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005371 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005372 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005373 u32 queryCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005374 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005375 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005376 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005377}
5378
5379@threadSafety("app")
5380cmd void vkCmdWriteTimestamp(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005381 VkCommandBuffer commandBuffer,
Jesse Hall6f39a6d2015-11-24 11:08:36 -08005382 VkPipelineStageFlagBits pipelineStage,
Jesse Halla3a7a1d2015-11-24 11:37:23 -08005383 VkQueryPool queryPool,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005384 u32 query) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005385 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halla3a7a1d2015-11-24 11:37:23 -08005386 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005387 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005388}
5389
5390@threadSafety("app")
5391cmd void vkCmdCopyQueryPoolResults(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005392 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005393 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005394 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005395 u32 queryCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005396 VkBuffer dstBuffer,
5397 VkDeviceSize dstOffset,
Jesse Halla9bb62b2015-11-21 19:31:56 -08005398 VkDeviceSize stride,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005399 VkQueryResultFlags flags) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005400 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005401 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005402 dstBufferObject := GetBuffer(dstBuffer)
5403 assert(commandBufferObject.device == queryPoolObject.device)
5404 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005405}
5406
5407cmd void vkCmdPushConstants(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005408 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005409 VkPipelineLayout layout,
5410 VkShaderStageFlags stageFlags,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005411 u32 offset,
5412 u32 size,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08005413 const void* pValues) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005414 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005415 layoutObject := GetPipelineLayout(layout)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005416 assert(commandBufferObject.device == layoutObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005417}
5418
5419@threadSafety("app")
5420cmd void vkCmdBeginRenderPass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005421 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005422 const VkRenderPassBeginInfo* pRenderPassBegin,
Jesse Hall65ab5522015-11-30 00:07:16 -08005423 VkSubpassContents contents) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005424 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005425 renderPassObject := GetRenderPass(pRenderPassBegin.renderPass)
5426 framebufferObject := GetFramebuffer(pRenderPassBegin.framebuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005427 assert(commandBufferObject.device == renderPassObject.device)
5428 assert(commandBufferObject.device == framebufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005429
Jesse Hall3fbc8562015-11-29 22:10:52 -08005430 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005431}
5432
5433cmd void vkCmdNextSubpass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005434 VkCommandBuffer commandBuffer,
Jesse Hall65ab5522015-11-30 00:07:16 -08005435 VkSubpassContents contents) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005436 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005437}
5438
5439@threadSafety("app")
5440cmd void vkCmdEndRenderPass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005441 VkCommandBuffer commandBuffer) {
5442 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005443
Jesse Hall3fbc8562015-11-29 22:10:52 -08005444 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005445}
5446
5447cmd void vkCmdExecuteCommands(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005448 VkCommandBuffer commandBuffer,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005449 u32 commandBufferCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005450 const VkCommandBuffer* pCommandBuffers) {
5451 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005452
Jesse Hall3dd678a2016-01-08 21:52:01 -08005453 commandBuffers := pCommandBuffers[0:commandBufferCount]
5454 for i in (0 .. commandBufferCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005455 secondaryCommandBuffer := commandBuffers[i]
5456 secondaryCommandBufferObject := GetCommandBuffer(secondaryCommandBuffer)
5457 assert(commandBufferObject.device == secondaryCommandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005458 }
5459}
5460
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005461@extension("VK_KHR_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005462cmd void vkDestroySurfaceKHR(
5463 VkInstance instance,
Jesse Hall0e74f002015-11-30 11:37:59 -08005464 VkSurfaceKHR surface,
5465 const VkAllocationCallbacks* pAllocator) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005466 instanceObject := GetInstance(instance)
5467 surfaceObject := GetSurface(surface)
5468 assert(surfaceObject.instance == instance)
Michael Lentine88594d72015-11-12 12:49:45 -08005469
Jesse Hall1356b0d2015-11-23 17:24:58 -08005470 State.Surfaces[surface] = null
Jesse Hall2818f932015-11-19 21:19:17 -08005471}
5472
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005473@extension("VK_KHR_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005474cmd VkResult vkGetPhysicalDeviceSurfaceSupportKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005475 VkPhysicalDevice physicalDevice,
5476 u32 queueFamilyIndex,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005477 VkSurfaceKHR surface,
Jesse Hallb00daad2015-11-29 19:46:20 -08005478 VkBool32* pSupported) {
5479 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08005480
5481 return ?
5482}
5483
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005484@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08005485cmd VkResult vkGetPhysicalDeviceSurfaceCapabilitiesKHR(
5486 VkPhysicalDevice physicalDevice,
5487 VkSurfaceKHR surface,
5488 VkSurfaceCapabilitiesKHR* pSurfaceCapabilities) {
5489 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5490
5491 surfaceCapabilities := ?
5492 pSurfaceCapabilities[0] = surfaceCapabilities
5493
5494 return ?
5495}
5496
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005497@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08005498cmd VkResult vkGetPhysicalDeviceSurfaceFormatsKHR(
5499 VkPhysicalDevice physicalDevice,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005500 VkSurfaceKHR surface,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005501 u32* pSurfaceFormatCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005502 VkSurfaceFormatKHR* pSurfaceFormats) {
Jesse Hallb00daad2015-11-29 19:46:20 -08005503 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08005504
5505 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08005506 pSurfaceFormatCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08005507 surfaceFormats := pSurfaceFormats[0:count]
5508
5509 for i in (0 .. count) {
5510 surfaceFormat := ?
5511 surfaceFormats[i] = surfaceFormat
5512 }
5513
5514 return ?
5515}
5516
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005517@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08005518cmd VkResult vkGetPhysicalDeviceSurfacePresentModesKHR(
5519 VkPhysicalDevice physicalDevice,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005520 VkSurfaceKHR surface,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005521 u32* pPresentModeCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005522 VkPresentModeKHR* pPresentModes) {
Jesse Hallb00daad2015-11-29 19:46:20 -08005523 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08005524
5525 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08005526 pPresentModeCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08005527 presentModes := pPresentModes[0:count]
5528
5529 for i in (0 .. count) {
5530 presentMode := ?
5531 presentModes[i] = presentMode
5532 }
5533
5534 return ?
5535}
5536
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005537@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005538cmd VkResult vkCreateSwapchainKHR(
5539 VkDevice device,
5540 const VkSwapchainCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005541 const VkAllocationCallbacks* pAllocator,
Michael Lentine88594d72015-11-12 12:49:45 -08005542 VkSwapchainKHR* pSwapchain) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005543 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR)
Michael Lentine88594d72015-11-12 12:49:45 -08005544 deviceObject := GetDevice(device)
5545
5546 swapchain := ?
5547 pSwapchain[0] = swapchain
5548 State.Swapchains[swapchain] = new!SwapchainObject(device: device)
5549
5550 return ?
5551}
5552
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005553@extension("VK_KHR_swapchain")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005554cmd void vkDestroySwapchainKHR(
Michael Lentine88594d72015-11-12 12:49:45 -08005555 VkDevice device,
Jesse Hall0e74f002015-11-30 11:37:59 -08005556 VkSwapchainKHR swapchain,
5557 const VkAllocationCallbacks* pAllocator) {
Michael Lentine88594d72015-11-12 12:49:45 -08005558 deviceObject := GetDevice(device)
5559 swapchainObject := GetSwapchain(swapchain)
5560 assert(swapchainObject.device == device)
5561
5562 State.Swapchains[swapchain] = null
Michael Lentine88594d72015-11-12 12:49:45 -08005563}
5564
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005565@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005566cmd VkResult vkGetSwapchainImagesKHR(
5567 VkDevice device,
5568 VkSwapchainKHR swapchain,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005569 u32* pSwapchainImageCount,
Michael Lentine88594d72015-11-12 12:49:45 -08005570 VkImage* pSwapchainImages) {
5571 deviceObject := GetDevice(device)
5572
5573 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08005574 pSwapchainImageCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08005575 swapchainImages := pSwapchainImages[0:count]
5576
5577 for i in (0 .. count) {
5578 swapchainImage := ?
5579 swapchainImages[i] = swapchainImage
Jesse Hall1356b0d2015-11-23 17:24:58 -08005580 State.Images[swapchainImage] = new!ImageObject(device: device)
Michael Lentine88594d72015-11-12 12:49:45 -08005581 }
5582
5583 return ?
5584}
5585
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005586@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005587cmd VkResult vkAcquireNextImageKHR(
5588 VkDevice device,
5589 VkSwapchainKHR swapchain,
5590 u64 timeout,
5591 VkSemaphore semaphore,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005592 VkFence fence,
Michael Lentine88594d72015-11-12 12:49:45 -08005593 u32* pImageIndex) {
5594 deviceObject := GetDevice(device)
5595 swapchainObject := GetSwapchain(swapchain)
5596
5597 imageIndex := ?
5598 pImageIndex[0] = imageIndex
5599
5600 return ?
5601}
5602
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005603@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005604cmd VkResult vkQueuePresentKHR(
5605 VkQueue queue,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08005606 const VkPresentInfoKHR* pPresentInfo) {
Michael Lentine88594d72015-11-12 12:49:45 -08005607 queueObject := GetQueue(queue)
5608
5609 presentInfo := ?
5610 pPresentInfo[0] = presentInfo
5611
5612 return ?
5613}
5614
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005615@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005616cmd VkResult vkGetPhysicalDeviceDisplayPropertiesKHR(
5617 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005618 u32* pPropertyCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005619 VkDisplayPropertiesKHR* pProperties) {
5620 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5621 return ?
5622}
5623
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005624@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005625cmd VkResult vkGetPhysicalDeviceDisplayPlanePropertiesKHR(
5626 VkPhysicalDevice physicalDevice,
5627 u32* pPropertyCount,
5628 VkDisplayPlanePropertiesKHR* pProperties) {
5629 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5630 return ?
5631}
5632
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005633@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005634cmd VkResult vkGetDisplayPlaneSupportedDisplaysKHR(
5635 VkPhysicalDevice physicalDevice,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005636 u32 planeIndex,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08005637 u32* pDisplayCount,
5638 VkDisplayKHR* pDisplays) {
Jesse Halla6429252015-11-29 18:59:42 -08005639 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5640 return ?
5641}
5642
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005643@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005644cmd VkResult vkGetDisplayModePropertiesKHR(
5645 VkPhysicalDevice physicalDevice,
5646 VkDisplayKHR display,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005647 u32* pPropertyCount,
5648 VkDisplayModePropertiesKHR* pProperties) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005649 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5650 return ?
5651}
5652
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005653@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005654cmd VkResult vkCreateDisplayModeKHR(
5655 VkPhysicalDevice physicalDevice,
5656 VkDisplayKHR display,
5657 const VkDisplayModeCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005658 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005659 VkDisplayModeKHR* pMode) {
5660 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5661 return ?
5662}
5663
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005664@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005665cmd VkResult vkGetDisplayPlaneCapabilitiesKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005666 VkPhysicalDevice physicalDevice,
Jesse Hall9ba8bc82015-11-30 16:22:16 -08005667 VkDisplayModeKHR mode,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005668 u32 planeIndex,
Jesse Halla6429252015-11-29 18:59:42 -08005669 VkDisplayPlaneCapabilitiesKHR* pCapabilities) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005670 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5671 return ?
5672}
5673
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005674@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005675cmd VkResult vkCreateDisplayPlaneSurfaceKHR(
5676 VkInstance instance,
5677 const VkDisplaySurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005678 const VkAllocationCallbacks* pAllocator,
Jesse Halla6429252015-11-29 18:59:42 -08005679 VkSurfaceKHR* pSurface) {
5680 return ?
5681}
5682
Jesse Hall9ba8bc82015-11-30 16:22:16 -08005683@extension("VK_KHR_display_swapchain")
5684cmd VkResult vkCreateSharedSwapchainsKHR(
5685 VkDevice device,
5686 u32 swapchainCount,
5687 const VkSwapchainCreateInfoKHR* pCreateInfos,
5688 const VkAllocationCallbacks* pAllocator,
5689 VkSwapchainKHR* pSwapchains) {
5690 return ?
5691}
5692
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005693@extension("VK_KHR_xlib_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005694cmd VkResult vkCreateXlibSurfaceKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005695 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005696 const VkXlibSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005697 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005698 VkSurfaceKHR* pSurface) {
5699 instanceObject := GetInstance(instance)
5700 return ?
5701}
5702
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005703@extension("VK_KHR_xlib_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005704cmd VkBool32 vkGetPhysicalDeviceXlibPresentationSupportKHR(
5705 VkPhysicalDevice physicalDevice,
5706 u32 queueFamilyIndex,
5707 platform.Display* dpy,
Jesse Hall65ab5522015-11-30 00:07:16 -08005708 platform.VisualID visualID) {
Jesse Halla6429252015-11-29 18:59:42 -08005709 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5710 return ?
5711}
5712
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005713@extension("VK_KHR_xcb_surface")
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005714cmd VkResult vkCreateXcbSurfaceKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005715 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005716 const VkXcbSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005717 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005718 VkSurfaceKHR* pSurface) {
5719 instanceObject := GetInstance(instance)
5720 return ?
5721}
5722
Jesse Hall523db342015-11-30 21:12:55 -08005723@extension("VK_KHR_xcb_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005724cmd VkBool32 vkGetPhysicalDeviceXcbPresentationSupportKHR(
5725 VkPhysicalDevice physicalDevice,
5726 u32 queueFamilyIndex,
5727 platform.xcb_connection_t* connection,
5728 platform.xcb_visualid_t visual_id) {
5729 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5730 return ?
5731}
5732
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005733@extension("VK_KHR_wayland_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005734cmd VkResult vkCreateWaylandSurfaceKHR(
5735 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005736 const VkWaylandSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005737 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005738 VkSurfaceKHR* pSurface) {
5739 instanceObject := GetInstance(instance)
5740 return ?
5741}
5742
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005743@extension("VK_KHR_wayland_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005744cmd VkBool32 vkGetPhysicalDeviceWaylandPresentationSupportKHR(
5745 VkPhysicalDevice physicalDevice,
5746 u32 queueFamilyIndex,
5747 platform.wl_display* display) {
5748 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5749 return ?
5750}
5751
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005752@extension("VK_KHR_mir_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005753cmd VkResult vkCreateMirSurfaceKHR(
5754 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005755 const VkMirSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005756 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005757 VkSurfaceKHR* pSurface) {
5758 instanceObject := GetInstance(instance)
5759 return ?
5760}
5761
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005762@extension("VK_KHR_mir_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005763cmd VkBool32 vkGetPhysicalDeviceMirPresentationSupportKHR(
5764 VkPhysicalDevice physicalDevice,
5765 u32 queueFamilyIndex,
5766 platform.MirConnection* connection) {
5767 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5768 return ?
5769}
5770
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005771@extension("VK_KHR_android_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005772cmd VkResult vkCreateAndroidSurfaceKHR(
5773 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005774 const VkAndroidSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005775 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005776 VkSurfaceKHR* pSurface) {
5777 instanceObject := GetInstance(instance)
5778 return ?
5779}
5780
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005781@extension("VK_KHR_win32_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005782cmd VkResult vkCreateWin32SurfaceKHR(
5783 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005784 const VkWin32SurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005785 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005786 VkSurfaceKHR* pSurface) {
5787 instanceObject := GetInstance(instance)
5788 return ?
5789}
5790
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005791@extension("VK_KHR_win32_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005792cmd VkResult vkGetPhysicalDeviceWin32PresentationSupportKHR(
5793 VkPhysicalDevice physicalDevice,
5794 u32 queueFamilyIndex) {
Jesse Halle2948d82016-02-25 04:19:32 -08005795 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Jesse Halla6429252015-11-29 18:59:42 -08005796 return ?
5797}
5798
Chia-I Wub262ddc2016-03-22 07:38:20 +08005799@extension("VK_ANDROID_native_buffer")
5800cmd VkResult vkGetSwapchainGrallocUsageANDROID(
5801 VkDevice device,
5802 VkFormat format,
5803 VkImageUsageFlags imageUsage,
5804 int* grallocUsage) {
5805 return ?
5806}
5807
5808@extension("VK_ANDROID_native_buffer")
Chris Forbes8e4438b2016-12-07 16:26:49 +13005809cmd VkResult vkGetSwapchainGrallocUsage2ANDROID(
5810 VkDevice device,
5811 VkFormat format,
5812 VkImageUsageFlags imageUsage,
5813 VkSwapchainImageUsageFlagsANDROID swapchainImageUsage,
5814 int* grallocUsage) {
5815 return ?
5816}
5817
5818@extension("VK_ANDROID_native_buffer")
Chia-I Wub262ddc2016-03-22 07:38:20 +08005819cmd VkResult vkAcquireImageANDROID(
5820 VkDevice device,
5821 VkImage image,
5822 int nativeFenceFd,
5823 VkSemaphore semaphore,
5824 VkFence fence) {
5825 return ?
5826}
5827
5828@extension("VK_ANDROID_native_buffer")
5829cmd VkResult vkQueueSignalReleaseImageANDROID(
5830 VkQueue queue,
5831 u32 waitSemaphoreCount,
5832 const VkSemaphore* pWaitSemaphores,
5833 VkImage image,
5834 int* pNativeFenceFd) {
5835 return ?
5836}
5837
Jesse Hall715b86a2016-01-16 16:34:29 -08005838@extension("VK_EXT_debug_report")
5839@external type void* PFN_vkDebugReportCallbackEXT
5840@extension("VK_EXT_debug_report")
5841@pfn cmd VkBool32 vkDebugReportCallbackEXT(
5842 VkDebugReportFlagsEXT flags,
5843 VkDebugReportObjectTypeEXT objectType,
5844 u64 object,
5845 platform.size_t location,
5846 s32 messageCode,
5847 const char* pLayerPrefix,
5848 const char* pMessage,
5849 void* pUserData) {
5850 return ?
5851}
5852
5853@extension("VK_EXT_debug_report")
5854cmd VkResult vkCreateDebugReportCallbackEXT(
5855 VkInstance instance,
5856 const VkDebugReportCallbackCreateInfoEXT* pCreateInfo,
5857 const VkAllocationCallbacks* pAllocator,
5858 VkDebugReportCallbackEXT* pCallback) {
5859 return ?
5860}
5861
5862@extension("VK_EXT_debug_report")
5863cmd void vkDestroyDebugReportCallbackEXT(
5864 VkInstance instance,
5865 VkDebugReportCallbackEXT callback,
5866 const VkAllocationCallbacks* pAllocator) {
5867}
5868
5869@extension("VK_EXT_debug_report")
5870cmd void vkDebugReportMessageEXT(
5871 VkInstance instance,
5872 VkDebugReportFlagsEXT flags,
5873 VkDebugReportObjectTypeEXT objectType,
5874 u64 object,
5875 platform.size_t location,
5876 s32 messageCode,
5877 const char* pLayerPrefix,
5878 const char* pMessage) {
5879}
5880
Jesse Hall26763382016-05-20 07:13:52 -07005881@extension("VK_EXT_debug_marker")
5882cmd VkResult vkDebugMarkerSetObjectTagEXT(
5883 VkDevice device,
5884 VkDebugMarkerObjectTagInfoEXT* pTagInfo) {
5885 return ?
5886}
5887
5888@extension("VK_EXT_debug_marker")
5889cmd VkResult vkDebugMarkerSetObjectNameEXT(
5890 VkDevice device,
5891 VkDebugMarkerObjectNameInfoEXT* pNameInfo) {
5892 return ?
5893}
5894
5895@extension("VK_EXT_debug_marker")
5896cmd void vkCmdDebugMarkerBeginEXT(
5897 VkCommandBuffer commandBuffer,
5898 VkDebugMarkerMarkerInfoEXT* pMarkerInfo) {
5899}
5900
5901@extension("VK_EXT_debug_marker")
5902cmd void vkCmdDebugMarkerEndEXT(
5903 VkCommandBuffer commandBuffer) {
5904}
5905
5906@extension("VK_EXT_debug_marker")
5907cmd void vkCmdDebugMarkerInsertEXT(
5908 VkCommandBuffer commandBuffer,
5909 VkDebugMarkerMarkerInfoEXT* pMarkerInfo) {
5910}
5911
Chris Forbes1194ede2016-12-30 16:29:25 +13005912@extension("VK_KHR_get_physical_device_properties2")
5913cmd void vkGetPhysicalDeviceFeatures2KHR(
5914 VkPhysicalDevice physicalDevice,
5915 VkPhysicalDeviceFeatures2KHR* pFeatures) {
5916}
5917
5918@extension("VK_KHR_get_physical_device_properties2")
5919cmd void vkGetPhysicalDeviceProperties2KHR(
5920 VkPhysicalDevice physicalDevice,
5921 VkPhysicalDeviceProperties2KHR* pProperties) {
5922}
5923
5924@extension("VK_KHR_get_physical_device_properties2")
5925cmd void vkGetPhysicalDeviceFormatProperties2KHR(
5926 VkPhysicalDevice physicalDevice,
5927 VkFormat format,
5928 VkFormatProperties2KHR* pFormatProperties) {
5929}
5930
5931@extension("VK_KHR_get_physical_device_properties2")
5932cmd VkResult vkGetPhysicalDeviceImageFormatProperties2KHR(
5933 VkPhysicalDevice physicalDevice,
5934 const VkPhysicalDeviceImageFormatInfo2KHR* pImageFormatInfo,
5935 VkImageFormatProperties2KHR* pImageFormatProperties) {
5936 return ?
5937}
5938
5939@extension("VK_KHR_get_physical_device_properties2")
5940cmd void vkGetPhysicalDeviceQueueFamilyProperties2KHR(
5941 VkPhysicalDevice physicalDevice,
5942 u32* pQueueFamilyPropertyCount,
5943 VkQueueFamilyProperties2KHR* pQueueFamilyProperties) {
5944}
5945
5946@extension("VK_KHR_get_physical_device_properties2")
5947cmd void vkGetPhysicalDeviceMemoryProperties2KHR(
5948 VkPhysicalDevice physicalDevice,
5949 VkPhysicalDeviceMemoryProperties2KHR* pMemoryProperties) {
5950}
5951
5952@extension("VK_KHR_get_physical_device_properties2")
5953cmd void vkGetPhysicalDeviceSparseImageFormatProperties2KHR(
5954 VkPhysicalDevice physicalDevice,
5955 const VkPhysicalDeviceSparseImageFormatInfo2KHR* pFormatInfo,
5956 u32* pPropertyCount,
5957 VkSparseImageFormatProperties2KHR* pProperties) {
5958}
5959
Chris Forbes289cb792016-12-30 15:03:55 +13005960@extension("VK_AMD_draw_indirect_count")
5961cmd void vkCmdDrawIndirectCountAMD(
5962 VkCommandBuffer commandBuffer,
5963 VkBuffer buffer,
5964 VkDeviceSize offset,
5965 VkBuffer countBuffer,
5966 VkDeviceSize countBufferOffset,
5967 u32 maxDrawCount,
5968 u32 stride) {
5969}
5970
5971@extension("VK_AMD_draw_indirect_count")
5972cmd void vkCmdDrawIndexedIndirectCountAMD(
5973 VkCommandBuffer commandBuffer,
5974 VkBuffer buffer,
5975 VkDeviceSize offset,
5976 VkBuffer countBuffer,
5977 VkDeviceSize countBufferOffset,
5978 u32 maxDrawCount,
5979 u32 stride) {
5980}
5981
5982@extension("VK_NV_external_memory_capabilities")
5983cmd VkResult vkGetPhysicalDeviceExternalImageFormatPropertiesNV(
5984 VkPhysicalDevice physicalDevice,
5985 VkFormat format,
5986 VkImageType type,
5987 VkImageTiling tiling,
5988 VkImageUsageFlags usage,
5989 VkImageCreateFlags flags,
5990 VkExternalMemoryHandleTypeFlagsNV externalHandleType,
5991 VkExternalImageFormatPropertiesNV* pExternalImageFormatProperties) {
5992 return ?
5993}
5994
5995@extension("VK_NV_external_memory_win32")
5996cmd VkResult vkGetMemoryWin32HandleNV(
5997 VkDevice device,
5998 VkDeviceMemory memory,
5999 VkExternalMemoryHandleTypeFlagsNV handleType,
6000 platform.HANDLE* pHandle) {
6001 return ?
6002}
6003
6004@extension("VK_NV_external_memory_win32")
6005cmd void vkCmdProcessCommandsNVX(
6006 VkCommandBuffer commandBuffer,
6007 const VkCmdProcessCommandsInfoNVX* pProcessCommandsInfo) {
6008}
6009
6010@extension("VK_NV_external_memory_win32")
6011cmd void vkCmdReserveSpaceForCommandsNVX(
6012 VkCommandBuffer commandBuffer,
6013 const VkCmdReserveSpaceForCommandsInfoNVX* pReserveSpaceInfo) {
6014}
6015
6016@extension("VK_NV_external_memory_win32")
6017cmd VkResult vkCreateIndirectCommandsLayoutNVX(
6018 VkDevice device,
6019 const VkIndirectCommandsLayoutCreateInfoNVX* pCreateInfo,
6020 const VkAllocationCallbacks* pAllocator,
6021 VkIndirectCommandsLayoutNVX* pIndirectCommandsLayout) {
6022 return ?
6023}
6024
6025@extension("VK_NV_external_memory_win32")
6026cmd void vkDestroyIndirectCommandsLayoutNVX(
6027 VkDevice device,
6028 VkIndirectCommandsLayoutNVX indirectCommandsLayout,
6029 const VkAllocationCallbacks* pAllocator) {
6030}
6031
6032@extension("VK_NV_external_memory_win32")
6033cmd VkResult vkCreateObjectTableNVX(
6034 VkDevice device,
6035 const VkObjectTableCreateInfoNVX* pCreateInfo,
6036 const VkAllocationCallbacks* pAllocator,
6037 VkObjectTableNVX* pObjectTable) {
6038 return ?
6039}
6040
6041@extension("VK_NV_external_memory_win32")
6042cmd void vkDestroyObjectTableNVX(
6043 VkDevice device,
6044 VkObjectTableNVX objectTable,
6045 const VkAllocationCallbacks* pAllocator) {
6046}
6047
6048@extension("VK_NV_external_memory_win32")
6049cmd VkResult vkRegisterObjectsNVX(
6050 VkDevice device,
6051 VkObjectTableNVX objectTable,
6052 u32 objectCount,
6053 const VkObjectTableEntryNVX* const* ppObjectTableEntries,
6054 const u32* pObjectIndices) {
6055 return ?
6056}
6057
6058@extension("VK_NV_external_memory_win32")
6059cmd VkResult vkUnregisterObjectsNVX(
6060 VkDevice device,
6061 VkObjectTableNVX objectTable,
6062 u32 objectCount,
6063 const VkObjectEntryTypeNVX* pObjectEntryTypes,
6064 const u32* pObjectIndices) {
6065 return ?
6066}
6067
6068@extension("VK_NV_external_memory_win32")
6069cmd void vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX(
6070 VkPhysicalDevice physicalDevice,
6071 VkDeviceGeneratedCommandsFeaturesNVX* pFeatures,
6072 VkDeviceGeneratedCommandsLimitsNVX* pLimits) {
6073}
6074
Jesse Halld27f6aa2015-08-15 17:58:48 -07006075
6076////////////////
6077// Validation //
6078////////////////
6079
6080extern void validate(string layerName, bool condition, string message)
6081
6082
6083/////////////////////////////
6084// Internal State Tracking //
6085/////////////////////////////
6086
6087StateObject State
6088
6089@internal class StateObject {
6090 // Dispatchable objects.
6091 map!(VkInstance, ref!InstanceObject) Instances
6092 map!(VkPhysicalDevice, ref!PhysicalDeviceObject) PhysicalDevices
6093 map!(VkDevice, ref!DeviceObject) Devices
6094 map!(VkQueue, ref!QueueObject) Queues
Jesse Hall3fbc8562015-11-29 22:10:52 -08006095 map!(VkCommandBuffer, ref!CommandBufferObject) CommandBuffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07006096
6097 // Non-dispatchable objects.
6098 map!(VkDeviceMemory, ref!DeviceMemoryObject) DeviceMemories
6099 map!(VkBuffer, ref!BufferObject) Buffers
6100 map!(VkBufferView, ref!BufferViewObject) BufferViews
6101 map!(VkImage, ref!ImageObject) Images
6102 map!(VkImageView, ref!ImageViewObject) ImageViews
Jesse Halld27f6aa2015-08-15 17:58:48 -07006103 map!(VkShaderModule, ref!ShaderModuleObject) ShaderModules
Jesse Halld27f6aa2015-08-15 17:58:48 -07006104 map!(VkPipeline, ref!PipelineObject) Pipelines
6105 map!(VkPipelineLayout, ref!PipelineLayoutObject) PipelineLayouts
6106 map!(VkSampler, ref!SamplerObject) Samplers
6107 map!(VkDescriptorSet, ref!DescriptorSetObject) DescriptorSets
6108 map!(VkDescriptorSetLayout, ref!DescriptorSetLayoutObject) DescriptorSetLayouts
6109 map!(VkDescriptorPool, ref!DescriptorPoolObject) DescriptorPools
Jesse Halld27f6aa2015-08-15 17:58:48 -07006110 map!(VkFence, ref!FenceObject) Fences
6111 map!(VkSemaphore, ref!SemaphoreObject) Semaphores
6112 map!(VkEvent, ref!EventObject) Events
6113 map!(VkQueryPool, ref!QueryPoolObject) QueryPools
6114 map!(VkFramebuffer, ref!FramebufferObject) Framebuffers
6115 map!(VkRenderPass, ref!RenderPassObject) RenderPasses
6116 map!(VkPipelineCache, ref!PipelineCacheObject) PipelineCaches
Jesse Hall3fbc8562015-11-29 22:10:52 -08006117 map!(VkCommandPool, ref!CommandPoolObject) CommandPools
Jesse Hall1356b0d2015-11-23 17:24:58 -08006118 map!(VkSurfaceKHR, ref!SurfaceObject) Surfaces
Michael Lentine88594d72015-11-12 12:49:45 -08006119 map!(VkSwapchainKHR, ref!SwapchainObject) Swapchains
Jesse Halld27f6aa2015-08-15 17:58:48 -07006120}
6121
6122@internal class InstanceObject {
6123}
6124
6125@internal class PhysicalDeviceObject {
6126 VkInstance instance
6127}
6128
6129@internal class DeviceObject {
6130 VkPhysicalDevice physicalDevice
6131}
6132
6133@internal class QueueObject {
6134 VkDevice device
6135 VkQueueFlags flags
6136}
6137
Jesse Hall3fbc8562015-11-29 22:10:52 -08006138@internal class CommandBufferObject {
Jesse Halld27f6aa2015-08-15 17:58:48 -07006139 VkDevice device
6140 map!(u64, VkDeviceMemory) boundObjects
6141 VkQueueFlags queueFlags
6142}
6143
6144@internal class DeviceMemoryObject {
Jesse Hall3fbc8562015-11-29 22:10:52 -08006145 VkDevice device
6146 VkDeviceSize allocationSize
6147 map!(u64, VkDeviceSize) boundObjects
6148 map!(VkCommandBuffer, VkCommandBuffer) boundCommandBuffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07006149}
6150
6151@internal class BufferObject {
6152 VkDevice device
Jesse Hall3fbc8562015-11-29 22:10:52 -08006153 VkDeviceMemory memory
6154 VkDeviceSize memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07006155}
6156
6157@internal class BufferViewObject {
6158 VkDevice device
6159 VkBuffer buffer
6160}
6161
6162@internal class ImageObject {
6163 VkDevice device
Jesse Hall3fbc8562015-11-29 22:10:52 -08006164 VkDeviceMemory memory
6165 VkDeviceSize memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07006166}
6167
6168@internal class ImageViewObject {
6169 VkDevice device
6170 VkImage image
6171}
6172
Jesse Halld27f6aa2015-08-15 17:58:48 -07006173@internal class ShaderObject {
6174 VkDevice device
6175}
6176
6177@internal class ShaderModuleObject {
6178 VkDevice device
6179}
6180
6181@internal class PipelineObject {
6182 VkDevice device
6183}
6184
6185@internal class PipelineLayoutObject {
6186 VkDevice device
6187}
6188
6189@internal class SamplerObject {
6190 VkDevice device
6191}
6192
6193@internal class DescriptorSetObject {
6194 VkDevice device
6195}
6196
6197@internal class DescriptorSetLayoutObject {
6198 VkDevice device
6199}
6200
6201@internal class DescriptorPoolObject {
6202 VkDevice device
6203}
6204
Jesse Halld27f6aa2015-08-15 17:58:48 -07006205@internal class FenceObject {
6206 VkDevice device
6207 bool signaled
6208}
6209
6210@internal class SemaphoreObject {
6211 VkDevice device
6212}
6213
6214@internal class EventObject {
6215 VkDevice device
6216}
6217
6218@internal class QueryPoolObject {
6219 VkDevice device
6220}
6221
6222@internal class FramebufferObject {
6223 VkDevice device
6224}
6225
6226@internal class RenderPassObject {
6227 VkDevice device
6228}
6229
6230@internal class PipelineCacheObject {
6231 VkDevice device
6232}
6233
Jesse Hall3fbc8562015-11-29 22:10:52 -08006234@internal class CommandPoolObject {
Jesse Halld27f6aa2015-08-15 17:58:48 -07006235 VkDevice device
6236}
6237
Jesse Hall1356b0d2015-11-23 17:24:58 -08006238@internal class SurfaceObject {
6239 VkInstance instance
6240}
6241
Michael Lentine88594d72015-11-12 12:49:45 -08006242@internal class SwapchainObject {
6243 VkDevice device
6244}
6245
Jesse Halld27f6aa2015-08-15 17:58:48 -07006246macro ref!InstanceObject GetInstance(VkInstance instance) {
6247 assert(instance in State.Instances)
6248 return State.Instances[instance]
6249}
6250
6251macro ref!PhysicalDeviceObject GetPhysicalDevice(VkPhysicalDevice physicalDevice) {
6252 assert(physicalDevice in State.PhysicalDevices)
6253 return State.PhysicalDevices[physicalDevice]
6254}
6255
6256macro ref!DeviceObject GetDevice(VkDevice device) {
6257 assert(device in State.Devices)
6258 return State.Devices[device]
6259}
6260
6261macro ref!QueueObject GetQueue(VkQueue queue) {
6262 assert(queue in State.Queues)
6263 return State.Queues[queue]
6264}
6265
Jesse Hall3fbc8562015-11-29 22:10:52 -08006266macro ref!CommandBufferObject GetCommandBuffer(VkCommandBuffer commandBuffer) {
6267 assert(commandBuffer in State.CommandBuffers)
6268 return State.CommandBuffers[commandBuffer]
Jesse Halld27f6aa2015-08-15 17:58:48 -07006269}
6270
Jesse Hall3fbc8562015-11-29 22:10:52 -08006271macro ref!DeviceMemoryObject GetDeviceMemory(VkDeviceMemory memory) {
6272 assert(memory in State.DeviceMemories)
6273 return State.DeviceMemories[memory]
Jesse Halld27f6aa2015-08-15 17:58:48 -07006274}
6275
6276macro ref!BufferObject GetBuffer(VkBuffer buffer) {
6277 assert(buffer in State.Buffers)
6278 return State.Buffers[buffer]
6279}
6280
6281macro ref!BufferViewObject GetBufferView(VkBufferView bufferView) {
6282 assert(bufferView in State.BufferViews)
6283 return State.BufferViews[bufferView]
6284}
6285
6286macro ref!ImageObject GetImage(VkImage image) {
6287 assert(image in State.Images)
6288 return State.Images[image]
6289}
6290
6291macro ref!ImageViewObject GetImageView(VkImageView imageView) {
6292 assert(imageView in State.ImageViews)
6293 return State.ImageViews[imageView]
6294}
6295
Jesse Halld27f6aa2015-08-15 17:58:48 -07006296macro ref!ShaderModuleObject GetShaderModule(VkShaderModule shaderModule) {
6297 assert(shaderModule in State.ShaderModules)
6298 return State.ShaderModules[shaderModule]
6299}
6300
6301macro ref!PipelineObject GetPipeline(VkPipeline pipeline) {
6302 assert(pipeline in State.Pipelines)
6303 return State.Pipelines[pipeline]
6304}
6305
6306macro ref!PipelineLayoutObject GetPipelineLayout(VkPipelineLayout pipelineLayout) {
6307 assert(pipelineLayout in State.PipelineLayouts)
6308 return State.PipelineLayouts[pipelineLayout]
6309}
6310
6311macro ref!SamplerObject GetSampler(VkSampler sampler) {
6312 assert(sampler in State.Samplers)
6313 return State.Samplers[sampler]
6314}
6315
6316macro ref!DescriptorSetObject GetDescriptorSet(VkDescriptorSet descriptorSet) {
6317 assert(descriptorSet in State.DescriptorSets)
6318 return State.DescriptorSets[descriptorSet]
6319}
6320
6321macro ref!DescriptorSetLayoutObject GetDescriptorSetLayout(VkDescriptorSetLayout descriptorSetLayout) {
6322 assert(descriptorSetLayout in State.DescriptorSetLayouts)
6323 return State.DescriptorSetLayouts[descriptorSetLayout]
6324}
6325
6326macro ref!DescriptorPoolObject GetDescriptorPool(VkDescriptorPool descriptorPool) {
6327 assert(descriptorPool in State.DescriptorPools)
6328 return State.DescriptorPools[descriptorPool]
6329}
6330
Jesse Halld27f6aa2015-08-15 17:58:48 -07006331macro ref!FenceObject GetFence(VkFence fence) {
6332 assert(fence in State.Fences)
6333 return State.Fences[fence]
6334}
6335
6336macro ref!SemaphoreObject GetSemaphore(VkSemaphore semaphore) {
6337 assert(semaphore in State.Semaphores)
6338 return State.Semaphores[semaphore]
6339}
6340
6341macro ref!EventObject GetEvent(VkEvent event) {
6342 assert(event in State.Events)
6343 return State.Events[event]
6344}
6345
6346macro ref!QueryPoolObject GetQueryPool(VkQueryPool queryPool) {
6347 assert(queryPool in State.QueryPools)
6348 return State.QueryPools[queryPool]
6349}
6350
6351macro ref!FramebufferObject GetFramebuffer(VkFramebuffer framebuffer) {
6352 assert(framebuffer in State.Framebuffers)
6353 return State.Framebuffers[framebuffer]
6354}
6355
6356macro ref!RenderPassObject GetRenderPass(VkRenderPass renderPass) {
6357 assert(renderPass in State.RenderPasses)
6358 return State.RenderPasses[renderPass]
6359}
6360
6361macro ref!PipelineCacheObject GetPipelineCache(VkPipelineCache pipelineCache) {
6362 assert(pipelineCache in State.PipelineCaches)
6363 return State.PipelineCaches[pipelineCache]
6364}
6365
Jesse Hall3fbc8562015-11-29 22:10:52 -08006366macro ref!CommandPoolObject GetCommandPool(VkCommandPool commandPool) {
6367 assert(commandPool in State.CommandPools)
6368 return State.CommandPools[commandPool]
Jesse Hallf09c6b12015-08-15 19:54:28 -07006369}
Michael Lentine88594d72015-11-12 12:49:45 -08006370
Jesse Hall1356b0d2015-11-23 17:24:58 -08006371macro ref!SurfaceObject GetSurface(VkSurfaceKHR surface) {
6372 assert(surface in State.Surfaces)
6373 return State.Surfaces[surface]
6374}
6375
Michael Lentine88594d72015-11-12 12:49:45 -08006376macro ref!SwapchainObject GetSwapchain(VkSwapchainKHR swapchain) {
6377 assert(swapchain in State.Swapchains)
6378 return State.Swapchains[swapchain]
6379}
Jesse Halld8bade02015-11-24 10:24:18 -08006380
6381macro VkQueueFlags AddQueueFlag(VkQueueFlags flags, VkQueueFlagBits bit) {
6382 return as!VkQueueFlags(as!u32(flags) | as!u32(bit))
6383}