blob: 12fc935273dc549f4090a69211b951d6f02d2a77 [file] [log] [blame]
Jesse Halld27f6aa2015-08-15 17:58:48 -07001// Copyright (c) 2015 The Khronos Group Inc.
2//
3// Permission is hereby granted, free of charge, to any person obtaining a
4// copy of this software and/or associated documentation files (the
5// "Materials"), to deal in the Materials without restriction, including
6// without limitation the rights to use, copy, modify, merge, publish,
7// distribute, sublicense, and/or sell copies of the Materials, and to
8// permit persons to whom the Materials are furnished to do so, subject to
9// the following conditions:
10//
11// The above copyright notice and this permission notice shall be included
12// in all copies or substantial portions of the Materials.
13//
14// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20// MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
21
22import platform "platform.api"
23
24///////////////
25// Constants //
26///////////////
27
28// API version (major.minor.patch)
Jesse Hall3dd678a2016-01-08 21:52:01 -080029define VERSION_MAJOR 1
30define VERSION_MINOR 0
Chris Forbes289cb792016-12-30 15:03:55 +130031define VERSION_PATCH 38
Jesse Halld27f6aa2015-08-15 17:58:48 -070032
33// API limits
Jesse Hall65ab5522015-11-30 00:07:16 -080034define VK_MAX_PHYSICAL_DEVICE_NAME_SIZE 256
35define VK_UUID_SIZE 16
36define VK_MAX_EXTENSION_NAME_SIZE 256
37define VK_MAX_DESCRIPTION_SIZE 256
38define VK_MAX_MEMORY_TYPES 32
39define VK_MAX_MEMORY_HEAPS 16 /// The maximum number of unique memory heaps, each of which supporting 1 or more memory types.
Jesse Halld27f6aa2015-08-15 17:58:48 -070040
41// API keywords
42define VK_TRUE 1
43define VK_FALSE 0
Jesse Hall5ae3abb2015-10-08 14:00:22 -070044
45// API keyword, but needs special handling by some templates
46define NULL_HANDLE 0
Jesse Halld27f6aa2015-08-15 17:58:48 -070047
Jesse Hall33faaad2016-01-24 21:00:49 -080048@extension("VK_KHR_surface") define VK_KHR_SURFACE_SPEC_VERSION 25
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080049@extension("VK_KHR_surface") define VK_KHR_SURFACE_EXTENSION_NAME "VK_KHR_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080050
Jesse Hall26763382016-05-20 07:13:52 -070051@extension("VK_KHR_swapchain") define VK_KHR_SWAPCHAIN_SPEC_VERSION 68
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080052@extension("VK_KHR_swapchain") define VK_KHR_SWAPCHAIN_EXTENSION_NAME "VK_KHR_swapchain"
Jesse Hall1356b0d2015-11-23 17:24:58 -080053
Jesse Hall543a7ff2016-01-08 16:38:30 -080054@extension("VK_KHR_display") define VK_KHR_DISPLAY_SPEC_VERSION 21
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080055@extension("VK_KHR_display") define VK_KHR_DISPLAY_EXTENSION_NAME "VK_KHR_display"
Jesse Hall1356b0d2015-11-23 17:24:58 -080056
Jesse Hall543a7ff2016-01-08 16:38:30 -080057@extension("VK_KHR_display_swapchain") define VK_KHR_DISPLAY_SWAPCHAIN_SPEC_VERSION 9
Jesse Hall0e74f002015-11-30 11:37:59 -080058@extension("VK_KHR_display_swapchain") define VK_KHR_DISPLAY_SWAPCHAIN_EXTENSION_NAME "VK_KHR_display_swapchain"
Jesse Hall1356b0d2015-11-23 17:24:58 -080059
Jesse Hall543a7ff2016-01-08 16:38:30 -080060@extension("VK_KHR_xlib_surface") define VK_KHR_XLIB_SURFACE_SPEC_VERSION 6
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080061@extension("VK_KHR_xlib_surface") define VK_KHR_XLIB_SURFACE_NAME "VK_KHR_xlib_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080062
Jesse Hall543a7ff2016-01-08 16:38:30 -080063@extension("VK_KHR_xcb_surface") define VK_KHR_XCB_SURFACE_SPEC_VERSION 6
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080064@extension("VK_KHR_xcb_surface") define VK_KHR_XCB_SURFACE_NAME "VK_KHR_xcb_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080065
Jesse Hall543a7ff2016-01-08 16:38:30 -080066@extension("VK_KHR_wayland_surface") define VK_KHR_WAYLAND_SURFACE_SPEC_VERSION 5
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080067@extension("VK_KHR_wayland_surface") define VK_KHR_WAYLAND_SURFACE_NAME "VK_KHR_wayland_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080068
Jesse Hall543a7ff2016-01-08 16:38:30 -080069@extension("VK_KHR_mir_surface") define VK_KHR_MIR_SURFACE_SPEC_VERSION 4
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080070@extension("VK_KHR_mir_surface") define VK_KHR_MIR_SURFACE_NAME "VK_KHR_mir_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080071
Jesse Hall33faaad2016-01-24 21:00:49 -080072@extension("VK_KHR_android_surface") define VK_KHR_ANDROID_SURFACE_SPEC_VERSION 6
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080073@extension("VK_KHR_android_surface") define VK_KHR_ANDROID_SURFACE_NAME "VK_KHR_android_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080074
Jesse Hall543a7ff2016-01-08 16:38:30 -080075@extension("VK_KHR_win32_surface") define VK_KHR_WIN32_SURFACE_SPEC_VERSION 5
Jesse Hall3e0dc8f2015-11-30 00:42:57 -080076@extension("VK_KHR_win32_surface") define VK_KHR_WIN32_SURFACE_NAME "VK_KHR_win32_surface"
Jesse Hall1356b0d2015-11-23 17:24:58 -080077
Ian Elliott948233a2017-01-06 12:13:23 -070078@extension("VK_KHR_incremental_present") define VK_KHR_INCREMENTAL_PRESENT_SPEC_VERSION 1
79@extension("VK_KHR_incremental_present") define VK_KHR_INCREMENTAL_PRESENT_NAME "VK_KHR_incremental_present"
80
Chris Forbes8e4438b2016-12-07 16:26:49 +130081@extension("VK_ANDROID_native_buffer") define VK_ANDROID_NATIVE_BUFFER_SPEC_VERSION 6
Chia-I Wub262ddc2016-03-22 07:38:20 +080082@extension("VK_ANDROID_native_buffer") define VK_ANDROID_NATIVE_BUFFER_NAME "VK_ANDROID_native_buffer"
83
Ian Elliott4c8bb2a2016-12-29 11:07:26 -070084@extension("VK_GOOGLE_display_timing") define VK_GOOGLE_DISPLAY_TIMING_SPEC_VERSION 1
85@extension("VK_GOOGLE_display_timing") define VK_GOOGLE_DISPLAY_TIMING_NAME "VK_GOOGLE_display_timing"
86
Chris Forbes289cb792016-12-30 15:03:55 +130087@extension("VK_EXT_debug_report") define VK_EXT_DEBUG_REPORT_SPEC_VERSION 4
Jesse Hall715b86a2016-01-16 16:34:29 -080088@extension("VK_EXT_debug_report") define VK_EXT_DEBUG_REPORT_NAME "VK_EXT_debug_report"
89
Jesse Hall26763382016-05-20 07:13:52 -070090@extension("VK_NV_glsl_shader") define VK_NV_GLSL_SHADER_SPEC_VERSION 1
91@extension("VK_NV_glsl_shader") define VK_NV_GLSL_SHADER_NAME "VK_NV_glsl_shader"
92
93@extension("VK_KHR_sampler_mirror_clamp_to_edge") define VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_SPEC_VERSION 1
94@extension("VK_KHR_sampler_mirror_clamp_to_edge") define VK_KHR_SAMPLER_MIRROR_CLAMP_TO_EDGE_NAME "VK_KHR_sampler_mirror_clamp_to_edge"
95
96@extension("VK_IMG_filter_cubic") define VK_IMG_FILTER_CUBIC_SPEC_VERSION 1
97@extension("VK_IMG_filter_cubic") define VK_IMG_FILTER_CUBIC_NAME "VK_IMG_filter_cubic"
98
99@extension("VK_AMD_rasterization_order") define VK_AMD_RASTERIZATION_ORDER_SPEC_VERSION 1
100@extension("VK_AMD_rasterization_order") define VK_AMD_RASTERIZATION_ORDER_NAME "VK_AMD_rasterization_order"
101
Jesse Hall56d386a2016-07-26 15:20:40 -0700102@extension("VK_AMD_shader_trinary_minmax") define VK_AMD_SHADER_TRINARY_MINMAX_SPEC_VERSION 1
103@extension("VK_AMD_shader_trinary_minmax") define VK_AMD_SHADER_TRINARY_MINMAX_EXTENSION_NAME "VK_AMD_shader_trinary_minmax"
104
105@extension("VK_AMD_shader_explicit_vertex_parameter") define VK_AMD_SHADER_EXPLICIT_VERTEX_PARAMETER_SPEC_VERSION 1
106@extension("VK_AMD_shader_explicit_vertex_parameter") define VK_AMD_SHADER_EXPLICIT_VERTEX_PARAMETER_EXTENSION_NAME "VK_AMD_shader_explicit_vertex_parameter"
107
Jesse Hall26763382016-05-20 07:13:52 -0700108@extension("VK_EXT_debug_marker") define VK_EXT_DEBUG_MARKER_SPEC_VERSION 3
109@extension("VK_EXT_debug_marker") define VK_EXT_DEBUG_MARKER_NAME "VK_EXT_debug_marker"
110
Jesse Hall56d386a2016-07-26 15:20:40 -0700111@extension("VK_AMD_gcn_shader") define VK_AMD_GCN_SHADER_SPEC_VERSION 1
112@extension("VK_AMD_gcn_shader") define VK_AMD_GCN_SHADER_EXTENSION_NAME "VK_AMD_gcn_shader"
113
114@extension("VK_NV_dedicated_allocation") define VK_NV_DEDICATED_ALLOCATION_SPEC_VERSION 1
115@extension("VK_NV_dedicated_allocation") define VK_NV_DEDICATED_ALLOCATION_EXTENSION_NAME "VK_NV_dedicated_allocation"
116
Chris Forbes1194ede2016-12-30 16:29:25 +1300117@extension("VK_KHR_get_physical_device_properties2") define VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_SPEC_VERSION 1
118@extension("VK_KHR_get_physical_device_properties2") define VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME "VK_KHR_get_physical_device_properties2"
119
Chris Forbes289cb792016-12-30 15:03:55 +1300120@extension("VK_AMD_draw_indirect_count") define VK_AMD_DRAW_INDIRECT_COUNT_SPEC_VERSION 1
121@extension("VK_AMD_draw_indirect_count") define VK_AMD_DRAW_INDIRECT_COUNT_EXTENSION_NAME "VK_AMD_draw_indirect_count"
122
123@extension("VK_AMD_negative_viewport_height") define VK_AMD_NEGATIVE_VIEWPORT_HEIGHT_SPEC_VERSION 1
124@extension("VK_AMD_negative_viewport_height") define VK_AMD_NEGATIVE_VIEWPORT_HEIGHT_EXTENSION_NAME "VK_AMD_negative_viewport_height"
125
126@extension("VK_AMD_gpu_shader_half_float") define VK_AMD_GPU_SHADER_HALF_FLOAT_SPEC_VERSION 1
127@extension("VK_AMD_gpu_shader_half_float") define VK_AMD_GPU_SHADER_HALF_FLOAT_EXTENSION_NAME "VK_AMD_gpu_shader_half_float"
128
129@extension("VK_AMD_shader_ballot") define VK_AMD_SHADER_BALLOT_SPEC_VERSION 1
130@extension("VK_AMD_shader_ballot") define VK_AMD_SHADER_BALLOT_EXTENSION_NAME "VK_AMD_shader_ballot"
131
132@extension("VK_IMG_format_pvrtc") define VK_IMG_FORMAT_PVRTC_SPEC_VERSION 1
133@extension("VK_IMG_format_pvrtc") define VK_IMG_FORMAT_PVRTC_EXTENSION_NAME "VK_IMG_format_pvrtc"
134
135@extension("VK_NV_external_memory_capabilities") define VK_NV_EXTERNAL_MEMORY_CAPABILITIES_SPEC_VERSION 1
136@extension("VK_NV_external_memory_capabilities") define VK_NV_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME "VK_NV_external_memory_capabilities"
137
138@extension("VK_NV_external_memory") define VK_NV_EXTERNAL_MEMORY_SPEC_VERSION 1
139@extension("VK_NV_external_memory") define VK_NV_EXTERNAL_MEMORY_EXTENSION_NAME "VK_NV_external_memory"
140
141@extension("VK_NV_external_memory_win32") define VK_NV_EXTERNAL_MEMORY_WIN32_SPEC_VERSION 1
142@extension("VK_NV_external_memory_win32") define VK_NV_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME "VK_NV_external_memory_win32"
143
144@extension("VK_NV_win32_keyed_mutex") define VK_NV_WIN32_KEYED_MUTEX_SPEC_VERSION 1
145@extension("VK_NV_win32_keyed_mutex") define VK_NV_WIN32_KEYED_MUTEX_EXTENSION_NAME "VK_NV_win32_keyed_mutex"
146
147@extension("VK_EXT_validation_flags") define VK_EXT_VALIDATION_FLAGS_SPEC_VERSION 1
148@extension("VK_EXT_validation_flags") define VK_EXT_VALIDATION_FLAGS_EXTENSION_NAME "VK_EXT_validation_flags"
149
150@extension("VK_NVX_device_generated_commands") define VK_NVX_DEVICE_GENERATED_COMMANDS_SPEC_VERSION 1
151@extension("VK_NVX_device_generated_commands") define VK_NVX_DEVICE_GENERATED_COMMANDS_EXTENSION_NAME "VK_NVX_device_generated_commands"
152
153
Jesse Halld27f6aa2015-08-15 17:58:48 -0700154
155/////////////
156// Types //
157/////////////
158
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700159type u32 VkBool32
160type u32 VkFlags
161type u64 VkDeviceSize
162type u32 VkSampleMask
163
Jesse Halld27f6aa2015-08-15 17:58:48 -0700164/// Dispatchable handle types.
165@dispatchHandle type u64 VkInstance
166@dispatchHandle type u64 VkPhysicalDevice
167@dispatchHandle type u64 VkDevice
168@dispatchHandle type u64 VkQueue
Jesse Hall3fbc8562015-11-29 22:10:52 -0800169@dispatchHandle type u64 VkCommandBuffer
Jesse Halld27f6aa2015-08-15 17:58:48 -0700170
171/// Non dispatchable handle types.
172@nonDispatchHandle type u64 VkDeviceMemory
Jesse Hall3fbc8562015-11-29 22:10:52 -0800173@nonDispatchHandle type u64 VkCommandPool
Jesse Halld27f6aa2015-08-15 17:58:48 -0700174@nonDispatchHandle type u64 VkBuffer
175@nonDispatchHandle type u64 VkBufferView
176@nonDispatchHandle type u64 VkImage
177@nonDispatchHandle type u64 VkImageView
Jesse Halld27f6aa2015-08-15 17:58:48 -0700178@nonDispatchHandle type u64 VkShaderModule
Jesse Halld27f6aa2015-08-15 17:58:48 -0700179@nonDispatchHandle type u64 VkPipeline
180@nonDispatchHandle type u64 VkPipelineLayout
181@nonDispatchHandle type u64 VkSampler
182@nonDispatchHandle type u64 VkDescriptorSet
183@nonDispatchHandle type u64 VkDescriptorSetLayout
184@nonDispatchHandle type u64 VkDescriptorPool
Jesse Halld27f6aa2015-08-15 17:58:48 -0700185@nonDispatchHandle type u64 VkFence
186@nonDispatchHandle type u64 VkSemaphore
187@nonDispatchHandle type u64 VkEvent
188@nonDispatchHandle type u64 VkQueryPool
189@nonDispatchHandle type u64 VkFramebuffer
190@nonDispatchHandle type u64 VkRenderPass
191@nonDispatchHandle type u64 VkPipelineCache
Jesse Hall1356b0d2015-11-23 17:24:58 -0800192
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800193@extension("VK_KHR_surface") @nonDispatchHandle type u64 VkSurfaceKHR
Jesse Hall1356b0d2015-11-23 17:24:58 -0800194
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800195@extension("VK_KHR_swapchain") @nonDispatchHandle type u64 VkSwapchainKHR
Jesse Hall1356b0d2015-11-23 17:24:58 -0800196
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800197@extension("VK_KHR_display") @nonDispatchHandle type u64 VkDisplayKHR
198@extension("VK_KHR_display") @nonDispatchHandle type u64 VkDisplayModeKHR
Jesse Halld27f6aa2015-08-15 17:58:48 -0700199
Jesse Hall715b86a2016-01-16 16:34:29 -0800200@extension("VK_EXT_debug_report") @nonDispatchHandle type u64 VkDebugReportCallbackEXT
201
Chris Forbes289cb792016-12-30 15:03:55 +1300202@extension("VK_NVX_device_generated_commands") @nonDispatchHandle type u64 VkObjectTableNVX
203@extension("VK_NVX_device_generated_commands") @nonDispatchHandle type u64 VkIndirectCommandsLayoutNVX
204
Jesse Halld27f6aa2015-08-15 17:58:48 -0700205
206/////////////
207// Enums //
208/////////////
209
210enum VkImageLayout {
211 VK_IMAGE_LAYOUT_UNDEFINED = 0x00000000, /// Implicit layout an image is when its contents are undefined due to various reasons (e.g. right after creation)
212 VK_IMAGE_LAYOUT_GENERAL = 0x00000001, /// General layout when image can be used for any kind of access
213 VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL = 0x00000002, /// Optimal layout when image is only used for color attachment read/write
214 VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL = 0x00000003, /// Optimal layout when image is only used for depth/stencil attachment read/write
215 VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL = 0x00000004, /// Optimal layout when image is used for read only depth/stencil attachment and shader access
216 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 -0800217 VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL = 0x00000006, /// Optimal layout when image is used only as source of transfer operations
218 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 -0700219 VK_IMAGE_LAYOUT_PREINITIALIZED = 0x00000008, /// Initial layout used when the data is populated by the CPU
Jesse Hall1356b0d2015-11-23 17:24:58 -0800220
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800221 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800222 VK_IMAGE_LAYOUT_PRESENT_SRC_KHR = 1000001002,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700223}
224
225enum VkAttachmentLoadOp {
226 VK_ATTACHMENT_LOAD_OP_LOAD = 0x00000000,
227 VK_ATTACHMENT_LOAD_OP_CLEAR = 0x00000001,
228 VK_ATTACHMENT_LOAD_OP_DONT_CARE = 0x00000002,
229}
230
231enum VkAttachmentStoreOp {
232 VK_ATTACHMENT_STORE_OP_STORE = 0x00000000,
233 VK_ATTACHMENT_STORE_OP_DONT_CARE = 0x00000001,
234}
235
236enum VkImageType {
237 VK_IMAGE_TYPE_1D = 0x00000000,
238 VK_IMAGE_TYPE_2D = 0x00000001,
239 VK_IMAGE_TYPE_3D = 0x00000002,
240}
241
242enum VkImageTiling {
Jesse Hallc7467b72015-11-29 21:05:26 -0800243 VK_IMAGE_TILING_OPTIMAL = 0x00000000,
244 VK_IMAGE_TILING_LINEAR = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700245}
246
247enum VkImageViewType {
248 VK_IMAGE_VIEW_TYPE_1D = 0x00000000,
249 VK_IMAGE_VIEW_TYPE_2D = 0x00000001,
250 VK_IMAGE_VIEW_TYPE_3D = 0x00000002,
251 VK_IMAGE_VIEW_TYPE_CUBE = 0x00000003,
252 VK_IMAGE_VIEW_TYPE_1D_ARRAY = 0x00000004,
253 VK_IMAGE_VIEW_TYPE_2D_ARRAY = 0x00000005,
254 VK_IMAGE_VIEW_TYPE_CUBE_ARRAY = 0x00000006,
255}
256
Jesse Hall3fbc8562015-11-29 22:10:52 -0800257enum VkCommandBufferLevel {
258 VK_COMMAND_BUFFER_LEVEL_PRIMARY = 0x00000000,
259 VK_COMMAND_BUFFER_LEVEL_SECONDARY = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700260}
261
Jesse Hall65ab5522015-11-30 00:07:16 -0800262enum VkComponentSwizzle {
263 VK_COMPONENT_SWIZZLE_IDENTITY = 0x00000000,
264 VK_COMPONENT_SWIZZLE_ZERO = 0x00000001,
265 VK_COMPONENT_SWIZZLE_ONE = 0x00000002,
266 VK_COMPONENT_SWIZZLE_R = 0x00000003,
267 VK_COMPONENT_SWIZZLE_G = 0x00000004,
268 VK_COMPONENT_SWIZZLE_B = 0x00000005,
269 VK_COMPONENT_SWIZZLE_A = 0x00000006,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700270}
271
272enum VkDescriptorType {
273 VK_DESCRIPTOR_TYPE_SAMPLER = 0x00000000,
274 VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER = 0x00000001,
275 VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE = 0x00000002,
276 VK_DESCRIPTOR_TYPE_STORAGE_IMAGE = 0x00000003,
277 VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER = 0x00000004,
278 VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER = 0x00000005,
279 VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER = 0x00000006,
280 VK_DESCRIPTOR_TYPE_STORAGE_BUFFER = 0x00000007,
281 VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC = 0x00000008,
282 VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC = 0x00000009,
283 VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT = 0x0000000a,
284}
285
Jesse Halld27f6aa2015-08-15 17:58:48 -0700286enum VkQueryType {
287 VK_QUERY_TYPE_OCCLUSION = 0x00000000,
288 VK_QUERY_TYPE_PIPELINE_STATISTICS = 0x00000001, /// Optional
Jesse Halla3a7a1d2015-11-24 11:37:23 -0800289 VK_QUERY_TYPE_TIMESTAMP = 0x00000002,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700290}
291
Jesse Halld27f6aa2015-08-15 17:58:48 -0700292enum VkBorderColor {
293 VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK = 0x00000000,
294 VK_BORDER_COLOR_INT_TRANSPARENT_BLACK = 0x00000001,
295 VK_BORDER_COLOR_FLOAT_OPAQUE_BLACK = 0x00000002,
296 VK_BORDER_COLOR_INT_OPAQUE_BLACK = 0x00000003,
297 VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE = 0x00000004,
298 VK_BORDER_COLOR_INT_OPAQUE_WHITE = 0x00000005,
299}
300
301enum VkPipelineBindPoint {
Jesse Hallc7467b72015-11-29 21:05:26 -0800302 VK_PIPELINE_BIND_POINT_GRAPHICS = 0x00000000,
303 VK_PIPELINE_BIND_POINT_COMPUTE = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700304}
305
306enum VkPrimitiveTopology {
307 VK_PRIMITIVE_TOPOLOGY_POINT_LIST = 0x00000000,
308 VK_PRIMITIVE_TOPOLOGY_LINE_LIST = 0x00000001,
309 VK_PRIMITIVE_TOPOLOGY_LINE_STRIP = 0x00000002,
310 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST = 0x00000003,
311 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP = 0x00000004,
312 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN = 0x00000005,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800313 VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY = 0x00000006,
314 VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY = 0x00000007,
315 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY = 0x00000008,
316 VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY = 0x00000009,
Jesse Hall091ed9e2015-11-30 00:55:29 -0800317 VK_PRIMITIVE_TOPOLOGY_PATCH_LIST = 0x0000000a,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700318}
319
320enum VkSharingMode {
321 VK_SHARING_MODE_EXCLUSIVE = 0x00000000,
322 VK_SHARING_MODE_CONCURRENT = 0x00000001,
323}
324
325enum VkIndexType {
326 VK_INDEX_TYPE_UINT16 = 0x00000000,
327 VK_INDEX_TYPE_UINT32 = 0x00000001,
328}
329
Jesse Hall23ff73f2015-11-29 14:36:39 -0800330enum VkFilter {
331 VK_FILTER_NEAREST = 0x00000000,
332 VK_FILTER_LINEAR = 0x00000001,
Jesse Hall26763382016-05-20 07:13:52 -0700333
334 //@extension("VK_IMG_filter_cubic")
335 VK_FILTER_CUBIC_IMG = 1000015000,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700336}
337
Jesse Hall23ff73f2015-11-29 14:36:39 -0800338enum VkSamplerMipmapMode {
Jesse Hall23ff73f2015-11-29 14:36:39 -0800339 VK_SAMPLER_MIPMAP_MODE_NEAREST = 0x00000001, /// Choose nearest mip level
340 VK_SAMPLER_MIPMAP_MODE_LINEAR = 0x00000002, /// Linear filter between mip levels
Jesse Halld27f6aa2015-08-15 17:58:48 -0700341}
342
Jesse Hall23ff73f2015-11-29 14:36:39 -0800343enum VkSamplerAddressMode {
Jesse Hallc7467b72015-11-29 21:05:26 -0800344 VK_SAMPLER_ADDRESS_MODE_REPEAT = 0x00000000,
345 VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT = 0x00000001,
346 VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE = 0x00000002,
347 VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_BORDER = 0x00000003,
348 VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700349}
350
351enum VkCompareOp {
352 VK_COMPARE_OP_NEVER = 0x00000000,
353 VK_COMPARE_OP_LESS = 0x00000001,
354 VK_COMPARE_OP_EQUAL = 0x00000002,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800355 VK_COMPARE_OP_LESS_OR_EQUAL = 0x00000003,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700356 VK_COMPARE_OP_GREATER = 0x00000004,
357 VK_COMPARE_OP_NOT_EQUAL = 0x00000005,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800358 VK_COMPARE_OP_GREATER_OR_EQUAL = 0x00000006,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700359 VK_COMPARE_OP_ALWAYS = 0x00000007,
360}
361
Jesse Hall65ab5522015-11-30 00:07:16 -0800362enum VkPolygonMode {
363 VK_POLYGON_MODE_FILL = 0x00000000,
364 VK_POLYGON_MODE_LINE = 0x00000001,
365 VK_POLYGON_MODE_POINT = 0x00000002,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700366}
367
368enum VkFrontFace {
Jesse Hall3fbc8562015-11-29 22:10:52 -0800369 VK_FRONT_FACE_COUNTER_CLOCKWISE = 0x00000000,
370 VK_FRONT_FACE_CLOCKWISE = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700371}
372
Jesse Hall65ab5522015-11-30 00:07:16 -0800373enum VkBlendFactor {
374 VK_BLEND_FACTOR_ZERO = 0x00000000,
375 VK_BLEND_FACTOR_ONE = 0x00000001,
376 VK_BLEND_FACTOR_SRC_COLOR = 0x00000002,
377 VK_BLEND_FACTOR_ONE_MINUS_SRC_COLOR = 0x00000003,
378 VK_BLEND_FACTOR_DST_COLOR = 0x00000004,
379 VK_BLEND_FACTOR_ONE_MINUS_DST_COLOR = 0x00000005,
380 VK_BLEND_FACTOR_SRC_ALPHA = 0x00000006,
381 VK_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA = 0x00000007,
382 VK_BLEND_FACTOR_DST_ALPHA = 0x00000008,
383 VK_BLEND_FACTOR_ONE_MINUS_DST_ALPHA = 0x00000009,
384 VK_BLEND_FACTOR_CONSTANT_COLOR = 0x0000000a,
385 VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR = 0x0000000b,
386 VK_BLEND_FACTOR_CONSTANT_ALPHA = 0x0000000c,
387 VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA = 0x0000000d,
388 VK_BLEND_FACTOR_SRC_ALPHA_SATURATE = 0x0000000e,
389 VK_BLEND_FACTOR_SRC1_COLOR = 0x0000000f,
390 VK_BLEND_FACTOR_ONE_MINUS_SRC1_COLOR = 0x00000010,
391 VK_BLEND_FACTOR_SRC1_ALPHA = 0x00000011,
392 VK_BLEND_FACTOR_ONE_MINUS_SRC1_ALPHA = 0x00000012,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700393}
394
395enum VkBlendOp {
396 VK_BLEND_OP_ADD = 0x00000000,
397 VK_BLEND_OP_SUBTRACT = 0x00000001,
398 VK_BLEND_OP_REVERSE_SUBTRACT = 0x00000002,
399 VK_BLEND_OP_MIN = 0x00000003,
400 VK_BLEND_OP_MAX = 0x00000004,
401}
402
403enum VkStencilOp {
404 VK_STENCIL_OP_KEEP = 0x00000000,
405 VK_STENCIL_OP_ZERO = 0x00000001,
406 VK_STENCIL_OP_REPLACE = 0x00000002,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800407 VK_STENCIL_OP_INCREMENT_AND_CLAMP = 0x00000003,
408 VK_STENCIL_OP_DECREMENT_AND_CLAMP = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700409 VK_STENCIL_OP_INVERT = 0x00000005,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800410 VK_STENCIL_OP_INCREMENT_AND_WRAP = 0x00000006,
411 VK_STENCIL_OP_DECREMENT_AND_WRAP = 0x00000007,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700412}
413
414enum VkLogicOp {
415 VK_LOGIC_OP_CLEAR = 0x00000000,
416 VK_LOGIC_OP_AND = 0x00000001,
417 VK_LOGIC_OP_AND_REVERSE = 0x00000002,
418 VK_LOGIC_OP_COPY = 0x00000003,
419 VK_LOGIC_OP_AND_INVERTED = 0x00000004,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800420 VK_LOGIC_OP_NO_OP = 0x00000005,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700421 VK_LOGIC_OP_XOR = 0x00000006,
422 VK_LOGIC_OP_OR = 0x00000007,
423 VK_LOGIC_OP_NOR = 0x00000008,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800424 VK_LOGIC_OP_EQUIVALENT = 0x00000009,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700425 VK_LOGIC_OP_INVERT = 0x0000000a,
426 VK_LOGIC_OP_OR_REVERSE = 0x0000000b,
427 VK_LOGIC_OP_COPY_INVERTED = 0x0000000c,
428 VK_LOGIC_OP_OR_INVERTED = 0x0000000d,
429 VK_LOGIC_OP_NAND = 0x0000000e,
430 VK_LOGIC_OP_SET = 0x0000000f,
431}
432
Jesse Hall3fbc8562015-11-29 22:10:52 -0800433enum VkSystemAllocationScope {
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800434 VK_SYSTEM_ALLOCATION_SCOPE_COMMAND = 0x00000000,
Jesse Hall3fbc8562015-11-29 22:10:52 -0800435 VK_SYSTEM_ALLOCATION_SCOPE_OBJECT = 0x00000001,
436 VK_SYSTEM_ALLOCATION_SCOPE_CACHE = 0x00000002,
437 VK_SYSTEM_ALLOCATION_SCOPE_DEVICE = 0x00000003,
438 VK_SYSTEM_ALLOCATION_SCOPE_INSTANCE = 0x00000004,
Jesse Hall03b6fe12015-11-24 12:44:21 -0800439}
440
Jesse Hall3fbc8562015-11-29 22:10:52 -0800441enum VkInternalAllocationType {
442 VK_INTERNAL_ALLOCATION_TYPE_EXECUTABLE = 0x00000000,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700443}
444
445enum VkPhysicalDeviceType {
446 VK_PHYSICAL_DEVICE_TYPE_OTHER = 0x00000000,
447 VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU = 0x00000001,
448 VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU = 0x00000002,
449 VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU = 0x00000003,
450 VK_PHYSICAL_DEVICE_TYPE_CPU = 0x00000004,
451}
452
Jesse Hall65ab5522015-11-30 00:07:16 -0800453enum VkVertexInputRate {
454 VK_VERTEX_INPUT_RATE_VERTEX = 0x00000000,
455 VK_VERTEX_INPUT_RATE_INSTANCE = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700456}
457
458/// Vulkan format definitions
459enum VkFormat {
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800460 VK_FORMAT_UNDEFINED = 0,
461 VK_FORMAT_R4G4_UNORM_PACK8 = 1,
462 VK_FORMAT_R4G4B4A4_UNORM_PACK16 = 2,
463 VK_FORMAT_B4G4R4A4_UNORM_PACK16 = 3,
464 VK_FORMAT_R5G6B5_UNORM_PACK16 = 4,
465 VK_FORMAT_B5G6R5_UNORM_PACK16 = 5,
466 VK_FORMAT_R5G5B5A1_UNORM_PACK16 = 6,
467 VK_FORMAT_B5G5R5A1_UNORM_PACK16 = 7,
468 VK_FORMAT_A1R5G5B5_UNORM_PACK16 = 8,
469 VK_FORMAT_R8_UNORM = 9,
470 VK_FORMAT_R8_SNORM = 10,
471 VK_FORMAT_R8_USCALED = 11,
472 VK_FORMAT_R8_SSCALED = 12,
473 VK_FORMAT_R8_UINT = 13,
474 VK_FORMAT_R8_SINT = 14,
475 VK_FORMAT_R8_SRGB = 15,
476 VK_FORMAT_R8G8_UNORM = 16,
477 VK_FORMAT_R8G8_SNORM = 17,
478 VK_FORMAT_R8G8_USCALED = 18,
479 VK_FORMAT_R8G8_SSCALED = 19,
480 VK_FORMAT_R8G8_UINT = 20,
481 VK_FORMAT_R8G8_SINT = 21,
482 VK_FORMAT_R8G8_SRGB = 22,
483 VK_FORMAT_R8G8B8_UNORM = 23,
484 VK_FORMAT_R8G8B8_SNORM = 24,
485 VK_FORMAT_R8G8B8_USCALED = 25,
486 VK_FORMAT_R8G8B8_SSCALED = 26,
487 VK_FORMAT_R8G8B8_UINT = 27,
488 VK_FORMAT_R8G8B8_SINT = 28,
489 VK_FORMAT_R8G8B8_SRGB = 29,
490 VK_FORMAT_B8G8R8_UNORM = 30,
491 VK_FORMAT_B8G8R8_SNORM = 31,
492 VK_FORMAT_B8G8R8_USCALED = 32,
493 VK_FORMAT_B8G8R8_SSCALED = 33,
494 VK_FORMAT_B8G8R8_UINT = 34,
495 VK_FORMAT_B8G8R8_SINT = 35,
496 VK_FORMAT_B8G8R8_SRGB = 36,
497 VK_FORMAT_R8G8B8A8_UNORM = 37,
498 VK_FORMAT_R8G8B8A8_SNORM = 38,
499 VK_FORMAT_R8G8B8A8_USCALED = 39,
500 VK_FORMAT_R8G8B8A8_SSCALED = 40,
501 VK_FORMAT_R8G8B8A8_UINT = 41,
502 VK_FORMAT_R8G8B8A8_SINT = 42,
503 VK_FORMAT_R8G8B8A8_SRGB = 43,
504 VK_FORMAT_B8G8R8A8_UNORM = 44,
505 VK_FORMAT_B8G8R8A8_SNORM = 45,
506 VK_FORMAT_B8G8R8A8_USCALED = 46,
507 VK_FORMAT_B8G8R8A8_SSCALED = 47,
508 VK_FORMAT_B8G8R8A8_UINT = 48,
509 VK_FORMAT_B8G8R8A8_SINT = 49,
510 VK_FORMAT_B8G8R8A8_SRGB = 50,
511 VK_FORMAT_A8B8G8R8_UNORM_PACK32 = 51,
512 VK_FORMAT_A8B8G8R8_SNORM_PACK32 = 52,
513 VK_FORMAT_A8B8G8R8_USCALED_PACK32 = 53,
514 VK_FORMAT_A8B8G8R8_SSCALED_PACK32 = 54,
515 VK_FORMAT_A8B8G8R8_UINT_PACK32 = 55,
516 VK_FORMAT_A8B8G8R8_SINT_PACK32 = 56,
517 VK_FORMAT_A8B8G8R8_SRGB_PACK32 = 57,
518 VK_FORMAT_A2R10G10B10_UNORM_PACK32 = 58,
519 VK_FORMAT_A2R10G10B10_SNORM_PACK32 = 59,
520 VK_FORMAT_A2R10G10B10_USCALED_PACK32 = 60,
521 VK_FORMAT_A2R10G10B10_SSCALED_PACK32 = 61,
522 VK_FORMAT_A2R10G10B10_UINT_PACK32 = 62,
523 VK_FORMAT_A2R10G10B10_SINT_PACK32 = 63,
524 VK_FORMAT_A2B10G10R10_UNORM_PACK32 = 64,
525 VK_FORMAT_A2B10G10R10_SNORM_PACK32 = 65,
526 VK_FORMAT_A2B10G10R10_USCALED_PACK32 = 66,
527 VK_FORMAT_A2B10G10R10_SSCALED_PACK32 = 67,
528 VK_FORMAT_A2B10G10R10_UINT_PACK32 = 68,
529 VK_FORMAT_A2B10G10R10_SINT_PACK32 = 69,
530 VK_FORMAT_R16_UNORM = 70,
531 VK_FORMAT_R16_SNORM = 71,
532 VK_FORMAT_R16_USCALED = 72,
533 VK_FORMAT_R16_SSCALED = 73,
534 VK_FORMAT_R16_UINT = 74,
535 VK_FORMAT_R16_SINT = 75,
536 VK_FORMAT_R16_SFLOAT = 76,
537 VK_FORMAT_R16G16_UNORM = 77,
538 VK_FORMAT_R16G16_SNORM = 78,
539 VK_FORMAT_R16G16_USCALED = 79,
540 VK_FORMAT_R16G16_SSCALED = 80,
541 VK_FORMAT_R16G16_UINT = 81,
542 VK_FORMAT_R16G16_SINT = 82,
543 VK_FORMAT_R16G16_SFLOAT = 83,
544 VK_FORMAT_R16G16B16_UNORM = 84,
545 VK_FORMAT_R16G16B16_SNORM = 85,
546 VK_FORMAT_R16G16B16_USCALED = 86,
547 VK_FORMAT_R16G16B16_SSCALED = 87,
548 VK_FORMAT_R16G16B16_UINT = 88,
549 VK_FORMAT_R16G16B16_SINT = 89,
550 VK_FORMAT_R16G16B16_SFLOAT = 90,
551 VK_FORMAT_R16G16B16A16_UNORM = 91,
552 VK_FORMAT_R16G16B16A16_SNORM = 92,
553 VK_FORMAT_R16G16B16A16_USCALED = 93,
554 VK_FORMAT_R16G16B16A16_SSCALED = 94,
555 VK_FORMAT_R16G16B16A16_UINT = 95,
556 VK_FORMAT_R16G16B16A16_SINT = 96,
557 VK_FORMAT_R16G16B16A16_SFLOAT = 97,
558 VK_FORMAT_R32_UINT = 98,
559 VK_FORMAT_R32_SINT = 99,
560 VK_FORMAT_R32_SFLOAT = 100,
561 VK_FORMAT_R32G32_UINT = 101,
562 VK_FORMAT_R32G32_SINT = 102,
563 VK_FORMAT_R32G32_SFLOAT = 103,
564 VK_FORMAT_R32G32B32_UINT = 104,
565 VK_FORMAT_R32G32B32_SINT = 105,
566 VK_FORMAT_R32G32B32_SFLOAT = 106,
567 VK_FORMAT_R32G32B32A32_UINT = 107,
568 VK_FORMAT_R32G32B32A32_SINT = 108,
569 VK_FORMAT_R32G32B32A32_SFLOAT = 109,
570 VK_FORMAT_R64_UINT = 110,
571 VK_FORMAT_R64_SINT = 111,
572 VK_FORMAT_R64_SFLOAT = 112,
573 VK_FORMAT_R64G64_UINT = 113,
574 VK_FORMAT_R64G64_SINT = 114,
575 VK_FORMAT_R64G64_SFLOAT = 115,
576 VK_FORMAT_R64G64B64_UINT = 116,
577 VK_FORMAT_R64G64B64_SINT = 117,
578 VK_FORMAT_R64G64B64_SFLOAT = 118,
579 VK_FORMAT_R64G64B64A64_UINT = 119,
580 VK_FORMAT_R64G64B64A64_SINT = 120,
581 VK_FORMAT_R64G64B64A64_SFLOAT = 121,
582 VK_FORMAT_B10G11R11_UFLOAT_PACK32 = 122,
583 VK_FORMAT_E5B9G9R9_UFLOAT_PACK32 = 123,
584 VK_FORMAT_D16_UNORM = 124,
585 VK_FORMAT_X8_D24_UNORM_PACK32 = 125,
586 VK_FORMAT_D32_SFLOAT = 126,
587 VK_FORMAT_S8_UINT = 127,
588 VK_FORMAT_D16_UNORM_S8_UINT = 128,
589 VK_FORMAT_D24_UNORM_S8_UINT = 129,
590 VK_FORMAT_D32_SFLOAT_S8_UINT = 130,
591 VK_FORMAT_BC1_RGB_UNORM_BLOCK = 131,
592 VK_FORMAT_BC1_RGB_SRGB_BLOCK = 132,
593 VK_FORMAT_BC1_RGBA_UNORM_BLOCK = 133,
594 VK_FORMAT_BC1_RGBA_SRGB_BLOCK = 134,
595 VK_FORMAT_BC2_UNORM_BLOCK = 135,
596 VK_FORMAT_BC2_SRGB_BLOCK = 136,
597 VK_FORMAT_BC3_UNORM_BLOCK = 137,
598 VK_FORMAT_BC3_SRGB_BLOCK = 138,
599 VK_FORMAT_BC4_UNORM_BLOCK = 139,
600 VK_FORMAT_BC4_SNORM_BLOCK = 140,
601 VK_FORMAT_BC5_UNORM_BLOCK = 141,
602 VK_FORMAT_BC5_SNORM_BLOCK = 142,
603 VK_FORMAT_BC6H_UFLOAT_BLOCK = 143,
604 VK_FORMAT_BC6H_SFLOAT_BLOCK = 144,
605 VK_FORMAT_BC7_UNORM_BLOCK = 145,
606 VK_FORMAT_BC7_SRGB_BLOCK = 146,
607 VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK = 147,
608 VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK = 148,
609 VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK = 149,
610 VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK = 150,
611 VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK = 151,
612 VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK = 152,
613 VK_FORMAT_EAC_R11_UNORM_BLOCK = 153,
614 VK_FORMAT_EAC_R11_SNORM_BLOCK = 154,
615 VK_FORMAT_EAC_R11G11_UNORM_BLOCK = 155,
616 VK_FORMAT_EAC_R11G11_SNORM_BLOCK = 156,
617 VK_FORMAT_ASTC_4x4_UNORM_BLOCK = 157,
618 VK_FORMAT_ASTC_4x4_SRGB_BLOCK = 158,
619 VK_FORMAT_ASTC_5x4_UNORM_BLOCK = 159,
620 VK_FORMAT_ASTC_5x4_SRGB_BLOCK = 160,
621 VK_FORMAT_ASTC_5x5_UNORM_BLOCK = 161,
622 VK_FORMAT_ASTC_5x5_SRGB_BLOCK = 162,
623 VK_FORMAT_ASTC_6x5_UNORM_BLOCK = 163,
624 VK_FORMAT_ASTC_6x5_SRGB_BLOCK = 164,
625 VK_FORMAT_ASTC_6x6_UNORM_BLOCK = 165,
626 VK_FORMAT_ASTC_6x6_SRGB_BLOCK = 166,
627 VK_FORMAT_ASTC_8x5_UNORM_BLOCK = 167,
628 VK_FORMAT_ASTC_8x5_SRGB_BLOCK = 168,
629 VK_FORMAT_ASTC_8x6_UNORM_BLOCK = 169,
630 VK_FORMAT_ASTC_8x6_SRGB_BLOCK = 170,
631 VK_FORMAT_ASTC_8x8_UNORM_BLOCK = 171,
632 VK_FORMAT_ASTC_8x8_SRGB_BLOCK = 172,
633 VK_FORMAT_ASTC_10x5_UNORM_BLOCK = 173,
634 VK_FORMAT_ASTC_10x5_SRGB_BLOCK = 174,
635 VK_FORMAT_ASTC_10x6_UNORM_BLOCK = 175,
636 VK_FORMAT_ASTC_10x6_SRGB_BLOCK = 176,
637 VK_FORMAT_ASTC_10x8_UNORM_BLOCK = 177,
638 VK_FORMAT_ASTC_10x8_SRGB_BLOCK = 178,
639 VK_FORMAT_ASTC_10x10_UNORM_BLOCK = 179,
640 VK_FORMAT_ASTC_10x10_SRGB_BLOCK = 180,
641 VK_FORMAT_ASTC_12x10_UNORM_BLOCK = 181,
642 VK_FORMAT_ASTC_12x10_SRGB_BLOCK = 182,
643 VK_FORMAT_ASTC_12x12_UNORM_BLOCK = 183,
644 VK_FORMAT_ASTC_12x12_SRGB_BLOCK = 184,
Chris Forbes289cb792016-12-30 15:03:55 +1300645
646 //@extension("VK_IMG_format_pvrtc")
647 VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG = 1000054000,
648
649 //@extension("VK_IMG_format_pvrtc")
650 VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG = 1000054001,
651
652 //@extension("VK_IMG_format_pvrtc")
653 VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG = 1000054002,
654
655 //@extension("VK_IMG_format_pvrtc")
656 VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG = 1000054003,
657
658 //@extension("VK_IMG_format_pvrtc")
659 VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG = 1000054004,
660
661 //@extension("VK_IMG_format_pvrtc")
662 VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG = 1000054005,
663
664 //@extension("VK_IMG_format_pvrtc")
665 VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG = 1000054006,
666
667 //@extension("VK_IMG_format_pvrtc")
668 VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG = 1000054007,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700669}
670
Jesse Halld27f6aa2015-08-15 17:58:48 -0700671/// Structure type enumerant
672enum VkStructureType {
673 VK_STRUCTURE_TYPE_APPLICATION_INFO = 0,
Jesse Hallc7467b72015-11-29 21:05:26 -0800674 VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO = 1,
675 VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO = 2,
676 VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO = 3,
677 VK_STRUCTURE_TYPE_SUBMIT_INFO = 4,
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800678 VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO = 5,
Jesse Hallc7467b72015-11-29 21:05:26 -0800679 VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE = 6,
680 VK_STRUCTURE_TYPE_BIND_SPARSE_INFO = 7,
681 VK_STRUCTURE_TYPE_FENCE_CREATE_INFO = 8,
682 VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO = 9,
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700683 VK_STRUCTURE_TYPE_EVENT_CREATE_INFO = 10,
Jesse Hallc7467b72015-11-29 21:05:26 -0800684 VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO = 11,
685 VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO = 12,
686 VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO = 13,
687 VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO = 14,
688 VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO = 15,
689 VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO = 16,
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800690 VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO = 17,
691 VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO = 18,
692 VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO = 19,
693 VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO = 20,
694 VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO = 21,
695 VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO = 22,
696 VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO = 23,
697 VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO = 24,
698 VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO = 25,
699 VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO = 26,
700 VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO = 27,
701 VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO = 28,
702 VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO = 29,
703 VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO = 30,
704 VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO = 31,
705 VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO = 32,
706 VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO = 33,
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800707 VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO = 34,
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800708 VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET = 35,
709 VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET = 36,
710 VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO = 37,
711 VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO = 38,
712 VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO = 39,
Jesse Hallf4ab2b12015-11-30 16:04:55 -0800713 VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO = 40,
Jesse Hall3dd678a2016-01-08 21:52:01 -0800714 VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO = 41,
715 VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO = 42,
716 VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO = 43,
717 VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER = 44,
718 VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER = 45,
719 VK_STRUCTURE_TYPE_MEMORY_BARRIER = 46,
720 VK_STRUCTURE_TYPE_LOADER_INSTANCE_CREATE_INFO = 47,
721 VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO = 48,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800722
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800723 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800724 VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR = 1000001000,
725 VK_STRUCTURE_TYPE_PRESENT_INFO_KHR = 1000001001,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800726
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800727 //@extension("VK_KHR_display")
Jesse Hallbd888842015-11-30 21:44:14 -0800728 VK_STRUCTURE_TYPE_DISPLAY_MODE_CREATE_INFO_KHR = 1000002000,
729 VK_STRUCTURE_TYPE_DISPLAY_SURFACE_CREATE_INFO_KHR = 1000002001,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800730
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800731 //@extension("VK_KHR_display_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800732 VK_STRUCTURE_TYPE_DISPLAY_DISPLAY_PRESENT_INFO_KHR = 1000003000,
Jesse Hallf9fa9a52016-01-08 16:08:51 -0800733
734 //@extension("VK_KHR_xlib_surface")
735 VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR = 1000004000,
736
737 //@extension("VK_KHR_xcb_surface")
738 VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR = 1000005000,
739
740 //@extension("VK_KHR_wayland_surface")
741 VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR = 1000006000,
742
743 //@extension("VK_KHR_mir_surface")
744 VK_STRUCTURE_TYPE_MIR_SURFACE_CREATE_INFO_KHR = 1000007000,
745
746 //@extension("VK_KHR_android_surface")
747 VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR = 1000008000,
748
749 //@extension("VK_KHR_win32_surface")
750 VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR = 1000009000,
Jesse Hall543a7ff2016-01-08 16:38:30 -0800751
Ian Elliott948233a2017-01-06 12:13:23 -0700752 //@extension("VK_KHR_incremental_present")
753 VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR = 1000084000,
754
Chia-I Wub262ddc2016-03-22 07:38:20 +0800755 //@extension("VK_ANDROID_native_buffer")
756 VK_STRUCTURE_TYPE_NATIVE_BUFFER_ANDROID = 1000010000,
Chris Forbes8e4438b2016-12-07 16:26:49 +1300757 VK_STRUCTURE_TYPE_SWAPCHAIN_IMAGE_CREATE_INFO_ANDROID = 1000010001,
Chia-I Wub262ddc2016-03-22 07:38:20 +0800758
Ian Elliott4c8bb2a2016-12-29 11:07:26 -0700759 //@extension("VK_GOOGLE_display_timing")
760 VK_STRUCTURE_TYPE_PRESENT_TIMES_GOOGLE = 1000092000,
761
Jesse Hall543a7ff2016-01-08 16:38:30 -0800762 //@extension("VK_EXT_debug_report")
Jesse Hall26763382016-05-20 07:13:52 -0700763 VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT = 1000011000,
764
765 //@extension("VK_AMD_rasterization_order")
766 VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD = 1000018000,
767
768 //@extension("VK_EXT_debug_marker")
769 VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_NAME_INFO_EXT = 1000022000,
770
771 //@extension("VK_EXT_debug_marker")
772 VK_STRUCTURE_TYPE_DEBUG_MARKER_OBJECT_TAG_INFO_EXT = 1000022001,
773
774 //@extension("VK_EXT_debug_marker")
775 VK_STRUCTURE_TYPE_DEBUG_MARKER_MARKER_INFO_EXT = 1000022002,
Jesse Hall56d386a2016-07-26 15:20:40 -0700776
777 //@extension("VK_NV_dedicated_allocation")
778 VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_IMAGE_CREATE_INFO_NV = 1000026000,
779
780 //@extension("VK_NV_dedicated_allocation")
781 VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_BUFFER_CREATE_INFO_NV = 1000026001,
782
783 //@extension("VK_NV_dedicated_allocation")
784 VK_STRUCTURE_TYPE_DEDICATED_ALLOCATION_MEMORY_ALLOCATE_INFO_NV = 1000026002,
Chris Forbes289cb792016-12-30 15:03:55 +1300785
786 //@extension("VK_NV_external_memory")
787 VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_NV = 1000056000,
788
789 //@extension("VK_NV_external_memory")
790 VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_NV = 1000056001,
791
792 //@extension("VK_NV_external_memory_win32")
793 VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_NV = 1000057000,
794
795 //@extension("VK_NV_external_memory_win32")
796 VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_NV = 1000057001,
797
798 //@extension("VK_NV_win32_keyed_mutex")
799 VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_NV = 1000058000,
800
Chris Forbes1194ede2016-12-30 16:29:25 +1300801 //@extension("VK_KHR_get_physical_device_properties2")
802 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR = 1000059000,
803
804 //@extension("VK_KHR_get_physical_device_properties2")
805 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR = 1000059001,
806
807 //@extension("VK_KHR_get_physical_device_properties2")
808 VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2_KHR = 1000059002,
809
810 //@extension("VK_KHR_get_physical_device_properties2")
811 VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2_KHR = 1000059003,
812
813 //@extension("VK_KHR_get_physical_device_properties2")
814 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_FORMAT_INFO_2_KHR = 1000059004,
815
816 //@extension("VK_KHR_get_physical_device_properties2")
817 VK_STRUCTURE_TYPE_QUEUE_FAMILY_PROPERTIES_2_KHR = 1000059005,
818
819 //@extension("VK_KHR_get_physical_device_properties2")
820 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_PROPERTIES_2_KHR = 1000059006,
821
822 //@extension("VK_KHR_get_physical_device_properties2")
823 VK_STRUCTURE_TYPE_SPARSE_IMAGE_FORMAT_PROPERTIES_2_KHR = 1000059007,
824
825 //@extension("VK_KHR_get_physical_device_properties2")
826 VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SPARSE_IMAGE_FORMAT_INFO_2_KHR = 1000059008,
827
Chris Forbes289cb792016-12-30 15:03:55 +1300828 //@extension("VK_EXT_validation_flags")
829 VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT = 1000061000,
830
831 //@extension("VK_KHR_incremental_present")
832 VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR = 1000084000,
833
834 //@extension("VK_NVX_device_generated_commands")
835 VK_STRUCTURE_TYPE_OBJECT_TABLE_CREATE_INFO_NVX = 1000086000,
836
837 //@extension("VK_NVX_device_generated_commands")
838 VK_STRUCTURE_TYPE_INDIRECT_COMMANDS_LAYOUT_CREATE_INFO_NVX = 1000086001,
839
840 //@extension("VK_NVX_device_generated_commands")
841 VK_STRUCTURE_TYPE_CMD_PROCESS_COMMANDS_INFO_NVX = 1000086002,
842
843 //@extension("VK_NVX_device_generated_commands")
844 VK_STRUCTURE_TYPE_CMD_RESERVE_SPACE_FOR_COMMANDS_INFO_NVX = 1000086003,
845
846 //@extension("VK_NVX_device_generated_commands")
847 VK_STRUCTURE_TYPE_DEVICE_GENERATED_COMMANDS_LIMITS_NVX = 1000086004,
848
849 //@extension("VK_NVX_device_generated_commands")
850 VK_STRUCTURE_TYPE_DEVICE_GENERATED_COMMANDS_FEATURES_NVX = 1000086005,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700851}
852
Jesse Hall65ab5522015-11-30 00:07:16 -0800853enum VkSubpassContents {
854 VK_SUBPASS_CONTENTS_INLINE = 0x00000000,
855 VK_SUBPASS_CONTENTS_SECONDARY_COMMAND_BUFFERS = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700856}
857
Jesse Hall543a7ff2016-01-08 16:38:30 -0800858enum VkPipelineCacheHeaderVersion {
859 VK_PIPELINE_CACHE_HEADER_VERSION_ONE = 1,
860}
861
Jesse Hallbd888842015-11-30 21:44:14 -0800862@lastUnused(-11)
Jesse Halld27f6aa2015-08-15 17:58:48 -0700863/// Error and return codes
864enum VkResult {
865 // Return codes for successful operation execution (positive values)
Jesse Hallbd888842015-11-30 21:44:14 -0800866 VK_SUCCESS = 0,
867 VK_NOT_READY = 1,
868 VK_TIMEOUT = 2,
869 VK_EVENT_SET = 3,
870 VK_EVENT_RESET = 4,
871 VK_INCOMPLETE = 5,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700872
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800873 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800874 VK_SUBOPTIMAL_KHR = 1000001003,
Jesse Hall1356b0d2015-11-23 17:24:58 -0800875
Jesse Halld27f6aa2015-08-15 17:58:48 -0700876 // Error codes (negative values)
Jesse Hallbd888842015-11-30 21:44:14 -0800877 VK_ERROR_OUT_OF_HOST_MEMORY = 0xFFFFFFFF, // -1
878 VK_ERROR_OUT_OF_DEVICE_MEMORY = 0xFFFFFFFE, // -2
879 VK_ERROR_INITIALIZATION_FAILED = 0xFFFFFFFD, // -3
880 VK_ERROR_DEVICE_LOST = 0xFFFFFFFC, // -4
881 VK_ERROR_MEMORY_MAP_FAILED = 0xFFFFFFFB, // -5
882 VK_ERROR_LAYER_NOT_PRESENT = 0xFFFFFFFA, // -6
883 VK_ERROR_EXTENSION_NOT_PRESENT = 0xFFFFFFF9, // -7
884 VK_ERROR_FEATURE_NOT_PRESENT = 0xFFFFFFF8, // -8
885 VK_ERROR_INCOMPATIBLE_DRIVER = 0xFFFFFFF7, // -9
886 VK_ERROR_TOO_MANY_OBJECTS = 0xFFFFFFF6, // -10
887 VK_ERROR_FORMAT_NOT_SUPPORTED = 0xFFFFFFF5, // -11
Jesse Hall56d386a2016-07-26 15:20:40 -0700888 VK_ERROR_FRAGMENTED_POOL = 0xFFFFFFF4, // -12
Jesse Hall1356b0d2015-11-23 17:24:58 -0800889
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800890 //@extension("VK_KHR_surface")
Jesse Hallbd888842015-11-30 21:44:14 -0800891 VK_ERROR_SURFACE_LOST_KHR = 0xC4653600, // -1000000000
Jesse Halla6429252015-11-29 18:59:42 -0800892
Jesse Hall563380d2016-01-15 23:14:05 -0800893 //@extension("VK_KHR_surface")
894 VK_ERROR_NATIVE_WINDOW_IN_USE_KHR = 0xC46535FF, // -1000008001
895
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800896 //@extension("VK_KHR_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800897 VK_ERROR_OUT_OF_DATE_KHR = 0xC4653214, // -1000001004
Jesse Hall1356b0d2015-11-23 17:24:58 -0800898
Jesse Hall3e0dc8f2015-11-30 00:42:57 -0800899 //@extension("VK_KHR_display_swapchain")
Jesse Hallbd888842015-11-30 21:44:14 -0800900 VK_ERROR_INCOMPATIBLE_DISPLAY_KHR = 0xC4652A47, // -1000003001
Jesse Hall1356b0d2015-11-23 17:24:58 -0800901
Jesse Hall543a7ff2016-01-08 16:38:30 -0800902 //@extension("VK_EXT_debug_report")
903 VK_ERROR_VALIDATION_FAILED_EXT = 0xC4650B07, // -1000011001
Jesse Hall26763382016-05-20 07:13:52 -0700904
905 //@extension("VK_NV_glsl_shader")
906 VK_ERROR_INVALID_SHADER_NV = 0xC4650720, // -1000012000
Jesse Hall5ae3abb2015-10-08 14:00:22 -0700907}
908
909enum VkDynamicState {
910 VK_DYNAMIC_STATE_VIEWPORT = 0x00000000,
911 VK_DYNAMIC_STATE_SCISSOR = 0x00000001,
912 VK_DYNAMIC_STATE_LINE_WIDTH = 0x00000002,
913 VK_DYNAMIC_STATE_DEPTH_BIAS = 0x00000003,
914 VK_DYNAMIC_STATE_BLEND_CONSTANTS = 0x00000004,
915 VK_DYNAMIC_STATE_DEPTH_BOUNDS = 0x00000005,
916 VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK = 0x00000006,
917 VK_DYNAMIC_STATE_STENCIL_WRITE_MASK = 0x00000007,
918 VK_DYNAMIC_STATE_STENCIL_REFERENCE = 0x00000008,
Jesse Halld27f6aa2015-08-15 17:58:48 -0700919}
920
Jesse Hall523db342015-11-30 21:12:55 -0800921@extension("VK_KHR_surface")
Michael Lentine88594d72015-11-12 12:49:45 -0800922enum VkPresentModeKHR {
923 VK_PRESENT_MODE_IMMEDIATE_KHR = 0x00000000,
924 VK_PRESENT_MODE_MAILBOX_KHR = 0x00000001,
925 VK_PRESENT_MODE_FIFO_KHR = 0x00000002,
Jesse Hall03b6fe12015-11-24 12:44:21 -0800926 VK_PRESENT_MODE_FIFO_RELAXED_KHR = 0x00000003,
Michael Lentine88594d72015-11-12 12:49:45 -0800927}
928
Jesse Hall523db342015-11-30 21:12:55 -0800929@extension("VK_KHR_surface")
Michael Lentine88594d72015-11-12 12:49:45 -0800930enum VkColorSpaceKHR {
931 VK_COLORSPACE_SRGB_NONLINEAR_KHR = 0x00000000,
932}
Jesse Halld27f6aa2015-08-15 17:58:48 -0700933
Jesse Hall715b86a2016-01-16 16:34:29 -0800934@extension("VK_EXT_debug_report")
935enum VkDebugReportObjectTypeEXT {
936 VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT = 0,
937 VK_DEBUG_REPORT_OBJECT_TYPE_INSTANCE_EXT = 1,
938 VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT = 2,
939 VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT = 3,
940 VK_DEBUG_REPORT_OBJECT_TYPE_QUEUE_EXT = 4,
941 VK_DEBUG_REPORT_OBJECT_TYPE_SEMAPHORE_EXT = 5,
942 VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT = 6,
943 VK_DEBUG_REPORT_OBJECT_TYPE_FENCE_EXT = 7,
944 VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_MEMORY_EXT = 8,
945 VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT = 9,
946 VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT = 10,
947 VK_DEBUG_REPORT_OBJECT_TYPE_EVENT_EXT = 11,
948 VK_DEBUG_REPORT_OBJECT_TYPE_QUERY_POOL_EXT = 12,
949 VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_VIEW_EXT = 13,
950 VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_VIEW_EXT = 14,
951 VK_DEBUG_REPORT_OBJECT_TYPE_SHADER_MODULE_EXT = 15,
952 VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_CACHE_EXT = 16,
953 VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_LAYOUT_EXT = 17,
954 VK_DEBUG_REPORT_OBJECT_TYPE_RENDER_PASS_EXT = 18,
955 VK_DEBUG_REPORT_OBJECT_TYPE_PIPELINE_EXT = 19,
956 VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_LAYOUT_EXT = 20,
957 VK_DEBUG_REPORT_OBJECT_TYPE_SAMPLER_EXT = 21,
958 VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_POOL_EXT = 22,
959 VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT = 23,
960 VK_DEBUG_REPORT_OBJECT_TYPE_FRAMEBUFFER_EXT = 24,
961 VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_POOL_EXT = 25,
962 VK_DEBUG_REPORT_OBJECT_TYPE_SURFACE_KHR_EXT = 26,
963 VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT = 27,
964 VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_EXT = 28,
Chris Forbes289cb792016-12-30 15:03:55 +1300965 VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_KHR_EXT = 29,
966 VK_DEBUG_REPORT_OBJECT_TYPE_DISPLAY_MODE_KHR_EXT = 30,
967 VK_DEBUG_REPORT_OBJECT_TYPE_OBJECT_TABLE_NVX_EXT = 31,
968 VK_DEBUG_REPORT_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NVX_EXT = 32,
Jesse Hall715b86a2016-01-16 16:34:29 -0800969}
970
971@extension("VK_EXT_debug_report")
972enum VkDebugReportErrorEXT {
973 VK_DEBUG_REPORT_ERROR_NONE_EXT = 0,
974 VK_DEBUG_REPORT_ERROR_CALLBACK_REF_EXT = 1,
975}
976
Jesse Hall26763382016-05-20 07:13:52 -0700977@extension("VK_AMD_rasterization_order")
978enum VkRasterizationOrderAMD {
979 VK_RASTERIZATION_ORDER_STRICT_AMD = 0,
980 VK_RASTERIZATION_ORDER_RELAXED_AMD = 1,
981}
982
Chris Forbes289cb792016-12-30 15:03:55 +1300983@extension("VK_EXT_validation_flags")
984enum VkValidationCheckEXT {
985 VK_VALIDATION_CHECK_ALL_EXT = 0,
986}
987
988@extension("VK_NVX_device_generated_commands")
989enum VkIndirectCommandsTokenTypeNVX {
990 VK_INDIRECT_COMMANDS_TOKEN_PIPELINE_NVX = 0,
991 VK_INDIRECT_COMMANDS_TOKEN_DESCRIPTOR_SET_NVX = 1,
992 VK_INDIRECT_COMMANDS_TOKEN_INDEX_BUFFER_NVX = 2,
993 VK_INDIRECT_COMMANDS_TOKEN_VERTEX_BUFFER_NVX = 3,
994 VK_INDIRECT_COMMANDS_TOKEN_PUSH_CONSTANT_NVX = 4,
995 VK_INDIRECT_COMMANDS_TOKEN_DRAW_INDEXED_NVX = 5,
996 VK_INDIRECT_COMMANDS_TOKEN_DRAW_NVX = 6,
997 VK_INDIRECT_COMMANDS_TOKEN_DISPATCH_NVX = 7,
998}
999
1000@extension("VK_NVX_device_generated_commands")
1001enum VkObjectEntryTypeNVX {
1002 VK_OBJECT_ENTRY_DESCRIPTOR_SET_NVX = 0,
1003 VK_OBJECT_ENTRY_PIPELINE_NVX = 1,
1004 VK_OBJECT_ENTRY_INDEX_BUFFER_NVX = 2,
1005 VK_OBJECT_ENTRY_VERTEX_BUFFER_NVX = 3,
1006 VK_OBJECT_ENTRY_PUSH_CONSTANT_NVX = 4,
1007}
Jesse Hall715b86a2016-01-16 16:34:29 -08001008
Jesse Halld27f6aa2015-08-15 17:58:48 -07001009/////////////////
1010// Bitfields //
1011/////////////////
1012
Jesse Halld27f6aa2015-08-15 17:58:48 -07001013/// Queue capabilities
Jesse Halld8bade02015-11-24 10:24:18 -08001014type VkFlags VkQueueFlags
1015bitfield VkQueueFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001016 VK_QUEUE_GRAPHICS_BIT = 0x00000001, /// Queue supports graphics operations
1017 VK_QUEUE_COMPUTE_BIT = 0x00000002, /// Queue supports compute operations
Jesse Hall65ab5522015-11-30 00:07:16 -08001018 VK_QUEUE_TRANSFER_BIT = 0x00000004, /// Queue supports transfer operations
Jesse Hallb00daad2015-11-29 19:46:20 -08001019 VK_QUEUE_SPARSE_BINDING_BIT = 0x00000008, /// Queue supports sparse resource memory management operations
Jesse Halld27f6aa2015-08-15 17:58:48 -07001020}
1021
1022/// Memory properties passed into vkAllocMemory().
Jesse Halld8bade02015-11-24 10:24:18 -08001023type VkFlags VkMemoryPropertyFlags
1024bitfield VkMemoryPropertyFlagBits {
Jesse Halld1af8122015-11-29 23:50:38 -08001025 VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT = 0x00000001,
1026 VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT = 0x00000002,
1027 VK_MEMORY_PROPERTY_HOST_COHERENT_BIT = 0x00000004,
1028 VK_MEMORY_PROPERTY_HOST_CACHED_BIT = 0x00000008,
1029 VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT = 0x00000010,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001030}
1031
1032/// Memory heap flags
Jesse Halld8bade02015-11-24 10:24:18 -08001033type VkFlags VkMemoryHeapFlags
1034bitfield VkMemoryHeapFlagBits {
Jesse Halld1af8122015-11-29 23:50:38 -08001035 VK_MEMORY_HEAP_DEVICE_LOCAL_BIT = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001036}
1037
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001038/// Access flags
1039type VkFlags VkAccessFlags
1040bitfield VkAccessFlagBits {
1041 VK_ACCESS_INDIRECT_COMMAND_READ_BIT = 0x00000001,
1042 VK_ACCESS_INDEX_READ_BIT = 0x00000002,
1043 VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT = 0x00000004,
1044 VK_ACCESS_UNIFORM_READ_BIT = 0x00000008,
1045 VK_ACCESS_INPUT_ATTACHMENT_READ_BIT = 0x00000010,
1046 VK_ACCESS_SHADER_READ_BIT = 0x00000020,
1047 VK_ACCESS_SHADER_WRITE_BIT = 0x00000040,
1048 VK_ACCESS_COLOR_ATTACHMENT_READ_BIT = 0x00000080,
1049 VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT = 0x00000100,
1050 VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT = 0x00000200,
1051 VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT = 0x00000400,
1052 VK_ACCESS_TRANSFER_READ_BIT = 0x00000800,
1053 VK_ACCESS_TRANSFER_WRITE_BIT = 0x00001000,
1054 VK_ACCESS_HOST_READ_BIT = 0x00002000,
1055 VK_ACCESS_HOST_WRITE_BIT = 0x00004000,
1056 VK_ACCESS_MEMORY_READ_BIT = 0x00008000,
1057 VK_ACCESS_MEMORY_WRITE_BIT = 0x00010000,
Chris Forbes289cb792016-12-30 15:03:55 +13001058
1059 //@extension("VK_NVX_device_generated_commands")
1060 VK_ACCESS_COMMAND_PROCESS_READ_BIT_NVX = 0x00020000,
1061
1062 //@extension("VK_NVX_device_generated_commands")
1063 VK_ACCESS_COMMAND_PROCESS_WRITE_BIT_NVX = 0x00040000,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001064}
1065
1066/// Buffer usage flags
Jesse Halld8bade02015-11-24 10:24:18 -08001067type VkFlags VkBufferUsageFlags
1068bitfield VkBufferUsageFlagBits {
Jesse Hall3fbc8562015-11-29 22:10:52 -08001069 VK_BUFFER_USAGE_TRANSFER_SRC_BIT = 0x00000001, /// Can be used as a source of transfer operations
1070 VK_BUFFER_USAGE_TRANSFER_DST_BIT = 0x00000002, /// Can be used as a destination of transfer operations
Jesse Halld27f6aa2015-08-15 17:58:48 -07001071 VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000004, /// Can be used as TBO
1072 VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT = 0x00000008, /// Can be used as IBO
1073 VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT = 0x00000010, /// Can be used as UBO
1074 VK_BUFFER_USAGE_STORAGE_BUFFER_BIT = 0x00000020, /// Can be used as SSBO
1075 VK_BUFFER_USAGE_INDEX_BUFFER_BIT = 0x00000040, /// Can be used as source of fixed function index fetch (index buffer)
1076 VK_BUFFER_USAGE_VERTEX_BUFFER_BIT = 0x00000080, /// Can be used as source of fixed function vertex fetch (VBO)
1077 VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT = 0x00000100, /// Can be the source of indirect parameters (e.g. indirect buffer, parameter buffer)
1078}
1079
1080/// Buffer creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001081type VkFlags VkBufferCreateFlags
1082bitfield VkBufferCreateFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001083 VK_BUFFER_CREATE_SPARSE_BINDING_BIT = 0x00000001, /// Buffer should support sparse backing
Jesse Halld27f6aa2015-08-15 17:58:48 -07001084 VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002, /// Buffer should support sparse backing with partial residency
1085 VK_BUFFER_CREATE_SPARSE_ALIASED_BIT = 0x00000004, /// Buffer should support constent data access to physical memory blocks mapped into multiple locations of sparse buffers
1086}
1087
1088/// Shader stage flags
Jesse Halld8bade02015-11-24 10:24:18 -08001089type VkFlags VkShaderStageFlags
1090bitfield VkShaderStageFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001091 VK_SHADER_STAGE_VERTEX_BIT = 0x00000001,
Jesse Hallae38f732015-11-19 21:32:50 -08001092 VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT = 0x00000002,
1093 VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001094 VK_SHADER_STAGE_GEOMETRY_BIT = 0x00000008,
1095 VK_SHADER_STAGE_FRAGMENT_BIT = 0x00000010,
1096 VK_SHADER_STAGE_COMPUTE_BIT = 0x00000020,
Jesse Hallc7467b72015-11-29 21:05:26 -08001097 VK_SHADER_STAGE_ALL_GRAPHICS = 0x0000001F,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001098
1099 VK_SHADER_STAGE_ALL = 0x7FFFFFFF,
1100}
1101
Jesse Hallfbf97b02015-11-20 14:17:03 -08001102/// Descriptor pool create flags
Jesse Halld8bade02015-11-24 10:24:18 -08001103type VkFlags VkDescriptorPoolCreateFlags
1104bitfield VkDescriptorPoolCreateFlagBits {
Jesse Hallfbf97b02015-11-20 14:17:03 -08001105 VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT = 0x00000001,
1106}
1107
1108/// Descriptor pool reset flags
Jesse Halld8bade02015-11-24 10:24:18 -08001109type VkFlags VkDescriptorPoolResetFlags
Jesse Halla6429252015-11-29 18:59:42 -08001110//bitfield VkDescriptorPoolResetFlagBits {
1111//}
Jesse Hallfbf97b02015-11-20 14:17:03 -08001112
Jesse Halld27f6aa2015-08-15 17:58:48 -07001113/// Image usage flags
Jesse Halld8bade02015-11-24 10:24:18 -08001114type VkFlags VkImageUsageFlags
1115bitfield VkImageUsageFlagBits {
Jesse Hall3fbc8562015-11-29 22:10:52 -08001116 VK_IMAGE_USAGE_TRANSFER_SRC_BIT = 0x00000001, /// Can be used as a source of transfer operations
1117 VK_IMAGE_USAGE_TRANSFER_DST_BIT = 0x00000002, /// Can be used as a destination of transfer operations
Jesse Halld27f6aa2015-08-15 17:58:48 -07001118 VK_IMAGE_USAGE_SAMPLED_BIT = 0x00000004, /// Can be sampled from (SAMPLED_IMAGE and COMBINED_IMAGE_SAMPLER descriptor types)
1119 VK_IMAGE_USAGE_STORAGE_BIT = 0x00000008, /// Can be used as storage image (STORAGE_IMAGE descriptor type)
1120 VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT = 0x00000010, /// Can be used as framebuffer color attachment
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001121 VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000020, /// Can be used as framebuffer depth/stencil attachment
Jesse Halld27f6aa2015-08-15 17:58:48 -07001122 VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT = 0x00000040, /// Image data not needed outside of rendering
1123 VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT = 0x00000080, /// Can be used as framebuffer input attachment
1124}
1125
1126/// Image creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001127type VkFlags VkImageCreateFlags
1128bitfield VkImageCreateFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001129 VK_IMAGE_CREATE_SPARSE_BINDING_BIT = 0x00000001, /// Image should support sparse backing
Jesse Halld27f6aa2015-08-15 17:58:48 -07001130 VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT = 0x00000002, /// Image should support sparse backing with partial residency
1131 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 -07001132 VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT = 0x00000008, /// Allows image views to have different format than the base image
1133 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 -07001134}
1135
Jesse Hallb00daad2015-11-29 19:46:20 -08001136/// Image view creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001137type VkFlags VkImageViewCreateFlags
Jesse Hallb00daad2015-11-29 19:46:20 -08001138//bitfield VkImageViewCreateFlagBits {
1139//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001140
1141/// Pipeline creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001142type VkFlags VkPipelineCreateFlags
1143bitfield VkPipelineCreateFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001144 VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT = 0x00000001,
1145 VK_PIPELINE_CREATE_ALLOW_DERIVATIVES_BIT = 0x00000002,
1146 VK_PIPELINE_CREATE_DERIVATIVE_BIT = 0x00000004,
1147}
1148
Jesse Hall65ab5522015-11-30 00:07:16 -08001149/// Color component flags
1150type VkFlags VkColorComponentFlags
1151bitfield VkColorComponentFlagBits {
1152 VK_COLOR_COMPONENT_R_BIT = 0x00000001,
1153 VK_COLOR_COMPONENT_G_BIT = 0x00000002,
1154 VK_COLOR_COMPONENT_B_BIT = 0x00000004,
1155 VK_COLOR_COMPONENT_A_BIT = 0x00000008,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001156}
1157
1158/// Fence creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001159type VkFlags VkFenceCreateFlags
1160bitfield VkFenceCreateFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001161 VK_FENCE_CREATE_SIGNALED_BIT = 0x00000001,
1162}
1163
1164/// Semaphore creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001165type VkFlags VkSemaphoreCreateFlags
Jesse Halla6429252015-11-29 18:59:42 -08001166//bitfield VkSemaphoreCreateFlagBits {
1167//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001168
1169/// Format capability flags
Jesse Halld8bade02015-11-24 10:24:18 -08001170type VkFlags VkFormatFeatureFlags
1171bitfield VkFormatFeatureFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001172 VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT = 0x00000001, /// Format can be used for sampled images (SAMPLED_IMAGE and COMBINED_IMAGE_SAMPLER descriptor types)
1173 VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT = 0x00000002, /// Format can be used for storage images (STORAGE_IMAGE descriptor type)
1174 VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT = 0x00000004, /// Format supports atomic operations in case it's used for storage images
1175 VK_FORMAT_FEATURE_UNIFORM_TEXEL_BUFFER_BIT = 0x00000008, /// Format can be used for uniform texel buffers (TBOs)
1176 VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_BIT = 0x00000010, /// Format can be used for storage texel buffers (IBOs)
1177 VK_FORMAT_FEATURE_STORAGE_TEXEL_BUFFER_ATOMIC_BIT = 0x00000020, /// Format supports atomic operations in case it's used for storage texel buffers
1178 VK_FORMAT_FEATURE_VERTEX_BUFFER_BIT = 0x00000040, /// Format can be used for vertex buffers (VBOs)
1179 VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT = 0x00000080, /// Format can be used for color attachment images
1180 VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT = 0x00000100, /// Format supports blending in case it's used for color attachment images
1181 VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000200, /// Format can be used for depth/stencil attachment images
Jesse Hall3fbc8562015-11-29 22:10:52 -08001182 VK_FORMAT_FEATURE_BLIT_SRC_BIT = 0x00000400, /// Format can be used as the source image of blits with vkCommandBlitImage
1183 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 -08001184 VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT = 0x00001000,
Jesse Hall26763382016-05-20 07:13:52 -07001185
1186 //@extension("VK_IMG_filter_cubic")
1187 VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG = 0x00002000,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001188}
1189
1190/// Query control flags
Jesse Halld8bade02015-11-24 10:24:18 -08001191type VkFlags VkQueryControlFlags
1192bitfield VkQueryControlFlagBits {
Jesse Hall65ab5522015-11-30 00:07:16 -08001193 VK_QUERY_CONTROL_PRECISE_BIT = 0x00000001,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001194}
1195
1196/// Query result flags
Jesse Halld8bade02015-11-24 10:24:18 -08001197type VkFlags VkQueryResultFlags
1198bitfield VkQueryResultFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001199 VK_QUERY_RESULT_64_BIT = 0x00000001, /// Results of the queries are written to the destination buffer as 64-bit values
1200 VK_QUERY_RESULT_WAIT_BIT = 0x00000002, /// Results of the queries are waited on before proceeding with the result copy
1201 VK_QUERY_RESULT_WITH_AVAILABILITY_BIT = 0x00000004, /// Besides the results of the query, the availability of the results is also written
1202 VK_QUERY_RESULT_PARTIAL_BIT = 0x00000008, /// Copy the partial results of the query even if the final results aren't available
1203}
1204
1205/// Shader module creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001206type VkFlags VkShaderModuleCreateFlags
Jesse Halla6429252015-11-29 18:59:42 -08001207//bitfield VkShaderModuleCreateFlagBits {
1208//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001209
Jesse Halld27f6aa2015-08-15 17:58:48 -07001210/// Event creation flags
Jesse Halld8bade02015-11-24 10:24:18 -08001211type VkFlags VkEventCreateFlags
Jesse Halla6429252015-11-29 18:59:42 -08001212//bitfield VkEventCreateFlagBits {
1213//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001214
Jesse Halla15a4bf2015-11-19 22:48:02 -08001215/// Command buffer usage flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001216type VkFlags VkCommandBufferUsageFlags
1217bitfield VkCommandBufferUsageFlagBits {
1218 VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT = 0x00000001,
1219 VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT = 0x00000002,
1220 VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT = 0x00000004,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001221}
1222
1223/// Pipeline statistics flags
Jesse Halld8bade02015-11-24 10:24:18 -08001224type VkFlags VkQueryPipelineStatisticFlags
1225bitfield VkQueryPipelineStatisticFlagBits {
Jesse Hallae38f732015-11-19 21:32:50 -08001226 VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_BIT = 0x00000001, /// Optional
1227 VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_PRIMITIVES_BIT = 0x00000002, /// Optional
1228 VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT = 0x00000004, /// Optional
1229 VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_INVOCATIONS_BIT = 0x00000008, /// Optional
1230 VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT = 0x00000010, /// Optional
1231 VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT = 0x00000020, /// Optional
1232 VK_QUERY_PIPELINE_STATISTIC_CLIPPING_PRIMITIVES_BIT = 0x00000040, /// Optional
1233 VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT = 0x00000080, /// Optional
1234 VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT = 0x00000100, /// Optional
1235 VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT = 0x00000200, /// Optional
1236 VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT = 0x00000400, /// Optional
Jesse Halld27f6aa2015-08-15 17:58:48 -07001237}
1238
1239/// Memory mapping flags
Jesse Halld8bade02015-11-24 10:24:18 -08001240type VkFlags VkMemoryMapFlags
Jesse Halla6429252015-11-29 18:59:42 -08001241//bitfield VkMemoryMapFlagBits {
1242//}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001243
1244/// Bitfield of image aspects
Jesse Halld8bade02015-11-24 10:24:18 -08001245type VkFlags VkImageAspectFlags
1246bitfield VkImageAspectFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001247 VK_IMAGE_ASPECT_COLOR_BIT = 0x00000001,
1248 VK_IMAGE_ASPECT_DEPTH_BIT = 0x00000002,
1249 VK_IMAGE_ASPECT_STENCIL_BIT = 0x00000004,
1250 VK_IMAGE_ASPECT_METADATA_BIT = 0x00000008,
1251}
1252
1253/// Sparse memory bind flags
Jesse Halld8bade02015-11-24 10:24:18 -08001254type VkFlags VkSparseMemoryBindFlags
Jesse Hall091ed9e2015-11-30 00:55:29 -08001255bitfield VkSparseMemoryBindFlagBits {
1256 VK_SPARSE_MEMORY_BIND_METADATA_BIT = 0x00000001,
1257}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001258
1259/// Sparse image memory requirements flags
Jesse Halld8bade02015-11-24 10:24:18 -08001260type VkFlags VkSparseImageFormatFlags
1261bitfield VkSparseImageFormatFlagBits {
Jesse Hallb00daad2015-11-29 19:46:20 -08001262 VK_SPARSE_IMAGE_FORMAT_SINGLE_MIPTAIL_BIT = 0x00000001, /// Image uses a single miptail region for all array slices
1263 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.
1264 VK_SPARSE_IMAGE_FORMAT_NONSTANDARD_BLOCK_SIZE_BIT = 0x00000004, /// Image uses a non-standard sparse block size
Jesse Halld27f6aa2015-08-15 17:58:48 -07001265}
1266
1267/// Pipeline stages
Jesse Halld8bade02015-11-24 10:24:18 -08001268type VkFlags VkPipelineStageFlags
1269bitfield VkPipelineStageFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001270 VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT = 0x00000001, /// Before subsequent commands are processed
1271 VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT = 0x00000002, /// Draw/DispatchIndirect command fetch
1272 VK_PIPELINE_STAGE_VERTEX_INPUT_BIT = 0x00000004, /// Vertex/index fetch
1273 VK_PIPELINE_STAGE_VERTEX_SHADER_BIT = 0x00000008, /// Vertex shading
Jesse Hallae38f732015-11-19 21:32:50 -08001274 VK_PIPELINE_STAGE_TESSELLATION_CONTROL_SHADER_BIT = 0x00000010, /// Tessellation control shading
1275 VK_PIPELINE_STAGE_TESSELLATION_EVALUATION_SHADER_BIT = 0x00000020, /// Tessellation evaluation shading
Jesse Halld27f6aa2015-08-15 17:58:48 -07001276 VK_PIPELINE_STAGE_GEOMETRY_SHADER_BIT = 0x00000040, /// Geometry shading
1277 VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT = 0x00000080, /// Fragment shading
1278 VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT = 0x00000100, /// Early fragment (depth/stencil) tests
1279 VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT = 0x00000200, /// Late fragment (depth/stencil) tests
1280 VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT = 0x00000400, /// Color attachment writes
1281 VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT = 0x00000800, /// Compute shading
1282 VK_PIPELINE_STAGE_TRANSFER_BIT = 0x00001000, /// Transfer/copy operations
Jesse Hall543a7ff2016-01-08 16:38:30 -08001283 VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT = 0x00002000,
1284 VK_PIPELINE_STAGE_HOST_BIT = 0x00004000, /// Indicates host (CPU) is a source/sink of the dependency
Jesse Halld27f6aa2015-08-15 17:58:48 -07001285
Jesse Hall543a7ff2016-01-08 16:38:30 -08001286 VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT = 0x00008000, /// All stages of the graphics pipeline
1287 VK_PIPELINE_STAGE_ALL_COMMANDS_BIT = 0x00010000, /// All graphics, compute, copy, and transition commands
Chris Forbes289cb792016-12-30 15:03:55 +13001288
1289 //@extension("VK_NVX_device_generated_commands")
1290 VK_PIPELINE_STAGE_COMMAND_PROCESS_BIT_NVX = 0x00020000,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001291}
1292
1293/// Render pass attachment description flags
Jesse Halld8bade02015-11-24 10:24:18 -08001294type VkFlags VkAttachmentDescriptionFlags
1295bitfield VkAttachmentDescriptionFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001296 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 -07001297}
1298
1299/// Subpass description flags
Jesse Halld8bade02015-11-24 10:24:18 -08001300type VkFlags VkSubpassDescriptionFlags
1301bitfield VkSubpassDescriptionFlagBits {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001302}
1303
1304/// Command pool creation flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001305type VkFlags VkCommandPoolCreateFlags
1306bitfield VkCommandPoolCreateFlagBits {
1307 VK_COMMAND_POOL_CREATE_TRANSIENT_BIT = 0x00000001, /// Command buffers have a short lifetime
1308 VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT = 0x00000002, /// Command buffers may release their memory individually
Jesse Halld27f6aa2015-08-15 17:58:48 -07001309}
1310
1311/// Command pool reset flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001312type VkFlags VkCommandPoolResetFlags
1313bitfield VkCommandPoolResetFlagBits {
1314 VK_COMMAND_POOL_RESET_RELEASE_RESOURCES_BIT = 0x00000001, /// Release resources owned by the pool
Jesse Halld27f6aa2015-08-15 17:58:48 -07001315}
1316
Jesse Hall3fbc8562015-11-29 22:10:52 -08001317type VkFlags VkCommandBufferResetFlags
1318bitfield VkCommandBufferResetFlagBits {
1319 VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT = 0x00000001, /// Release resources owned by the buffer
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001320}
1321
Jesse Halld8bade02015-11-24 10:24:18 -08001322type VkFlags VkSampleCountFlags
1323bitfield VkSampleCountFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001324 VK_SAMPLE_COUNT_1_BIT = 0x00000001,
1325 VK_SAMPLE_COUNT_2_BIT = 0x00000002,
1326 VK_SAMPLE_COUNT_4_BIT = 0x00000004,
1327 VK_SAMPLE_COUNT_8_BIT = 0x00000008,
1328 VK_SAMPLE_COUNT_16_BIT = 0x00000010,
1329 VK_SAMPLE_COUNT_32_BIT = 0x00000020,
1330 VK_SAMPLE_COUNT_64_BIT = 0x00000040,
1331}
1332
Jesse Halld8bade02015-11-24 10:24:18 -08001333type VkFlags VkStencilFaceFlags
1334bitfield VkStencilFaceFlagBits {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001335 VK_STENCIL_FACE_FRONT_BIT = 0x00000001, /// Front face
1336 VK_STENCIL_FACE_BACK_BIT = 0x00000002, /// Back face
Jesse Hallc7467b72015-11-29 21:05:26 -08001337 VK_STENCIL_FRONT_AND_BACK = 0x00000003,
Jesse Halld27f6aa2015-08-15 17:58:48 -07001338}
1339
Jesse Halla6429252015-11-29 18:59:42 -08001340/// Instance creation flags
1341type VkFlags VkInstanceCreateFlags
1342//bitfield VkInstanceCreateFlagBits {
1343//}
1344
1345/// Device creation flags
1346type VkFlags VkDeviceCreateFlags
1347//bitfield VkDeviceCreateFlagBits {
1348//}
1349
1350/// Device queue creation flags
1351type VkFlags VkDeviceQueueCreateFlags
1352//bitfield VkDeviceQueueCreateFlagBits {
1353//}
1354
1355/// Query pool creation flags
1356type VkFlags VkQueryPoolCreateFlags
1357//bitfield VkQueryPoolCreateFlagBits {
1358//}
1359
1360/// Buffer view creation flags
1361type VkFlags VkBufferViewCreateFlags
1362//bitfield VkBufferViewCreateFlagBits {
1363//}
1364
1365/// Pipeline cache creation flags
1366type VkFlags VkPipelineCacheCreateFlags
1367//bitfield VkPipelineCacheCreateFlagBits {
1368//}
1369
1370/// Pipeline shader stage creation flags
1371type VkFlags VkPipelineShaderStageCreateFlags
1372//bitfield VkPipelineShaderStageCreateFlagBits {
1373//}
1374
1375/// Descriptor set layout creation flags
1376type VkFlags VkDescriptorSetLayoutCreateFlags
1377//bitfield VkDescriptorSetLayoutCreateFlagBits {
1378//}
1379
1380/// Pipeline vertex input state creation flags
1381type VkFlags VkPipelineVertexInputStateCreateFlags
1382//bitfield VkPipelineVertexInputStateCreateFlagBits {
1383//}
1384
1385/// Pipeline input assembly state creation flags
1386type VkFlags VkPipelineInputAssemblyStateCreateFlags
1387//bitfield VkPipelineInputAssemblyStateCreateFlagBits {
1388//}
1389
1390/// Tessellation state creation flags
1391type VkFlags VkPipelineTessellationStateCreateFlags
1392//bitfield VkPipelineTessellationStateCreateFlagBits {
1393//}
1394
1395/// Viewport state creation flags
1396type VkFlags VkPipelineViewportStateCreateFlags
1397//bitfield VkPipelineViewportStateCreateFlagBits {
1398//}
1399
Jesse Hall3fbc8562015-11-29 22:10:52 -08001400/// Rasterization state creation flags
1401type VkFlags VkPipelineRasterizationStateCreateFlags
1402//bitfield VkPipelineRasterizationStateCreateFlagBits {
Jesse Halla6429252015-11-29 18:59:42 -08001403//}
1404
1405/// Multisample state creation flags
1406type VkFlags VkPipelineMultisampleStateCreateFlags
1407//bitfield VkPipelineMultisampleStateCreateFlagBits {
1408//}
1409
1410/// Color blend state creation flags
1411type VkFlags VkPipelineColorBlendStateCreateFlags
1412//bitfield VkPipelineColorBlendStateCreateFlagBits {
1413//}
1414
1415/// Depth/stencil state creation flags
1416type VkFlags VkPipelineDepthStencilStateCreateFlags
1417//bitfield VkPipelineDepthStencilStateCreateFlagBits {
1418//}
1419
1420/// Dynamic state creation flags
1421type VkFlags VkPipelineDynamicStateCreateFlags
1422//bitfield VkPipelineDynamicStateCreateFlagBits {
1423//}
1424
1425/// Pipeline layout creation flags
1426type VkFlags VkPipelineLayoutCreateFlags
1427//bitfield VkPipelineLayoutCreateFlagBits {
1428//}
1429
1430/// Sampler creation flags
1431type VkFlags VkSamplerCreateFlags
1432//bitfield VkSamplerCreateFlagBits {
1433//}
1434
1435/// Render pass creation flags
1436type VkFlags VkRenderPassCreateFlags
1437//bitfield VkRenderPassCreateFlagBits {
1438//}
1439
1440/// Framebuffer creation flags
1441type VkFlags VkFramebufferCreateFlags
1442//bitfield VkFramebufferCreateFlagBits {
1443//}
1444
Jesse Halldc6d36c2015-11-29 19:12:15 -08001445/// Dependency flags
1446type VkFlags VkDependencyFlags
1447bitfield VkDependencyFlagBits {
1448 VK_DEPENDENCY_BY_REGION_BIT = 0x00000001,
1449}
1450
Jesse Hallc7467b72015-11-29 21:05:26 -08001451/// Cull mode flags
1452type VkFlags VkCullModeFlags
1453bitfield VkCullModeFlagBits {
1454 VK_CULL_MODE_NONE = 0x00000000,
1455 VK_CULL_MODE_FRONT_BIT = 0x00000001,
1456 VK_CULL_MODE_BACK_BIT = 0x00000002,
1457 VK_CULL_MODE_FRONT_AND_BACK = 0x00000003,
1458}
1459
Jesse Hall523db342015-11-30 21:12:55 -08001460@extension("VK_KHR_surface")
Jesse Halld8bade02015-11-24 10:24:18 -08001461type VkFlags VkSurfaceTransformFlagsKHR
Jesse Hall523db342015-11-30 21:12:55 -08001462@extension("VK_KHR_surface")
Jesse Halld8bade02015-11-24 10:24:18 -08001463bitfield VkSurfaceTransformFlagBitsKHR {
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001464 VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR = 0x00000001,
Jesse Hall9ba8bc82015-11-30 16:22:16 -08001465 VK_SURFACE_TRANSFORM_ROTATE_90_BIT_KHR = 0x00000002,
1466 VK_SURFACE_TRANSFORM_ROTATE_180_BIT_KHR = 0x00000004,
1467 VK_SURFACE_TRANSFORM_ROTATE_270_BIT_KHR = 0x00000008,
1468 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_BIT_KHR = 0x00000010,
1469 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_90_BIT_KHR = 0x00000020,
1470 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_180_BIT_KHR = 0x00000040,
1471 VK_SURFACE_TRANSFORM_HORIZONTAL_MIRROR_ROTATE_270_BIT_KHR = 0x00000080,
1472 VK_SURFACE_TRANSFORM_INHERIT_BIT_KHR = 0x00000100,
Michael Lentine88594d72015-11-12 12:49:45 -08001473}
Jesse Halld27f6aa2015-08-15 17:58:48 -07001474
Jesse Hall523db342015-11-30 21:12:55 -08001475@extension("VK_KHR_surface")
Jesse Halla6429252015-11-29 18:59:42 -08001476type VkFlags VkCompositeAlphaFlagsKHR
Jesse Hall523db342015-11-30 21:12:55 -08001477@extension("VK_KHR_surface")
Jesse Halla6429252015-11-29 18:59:42 -08001478bitfield VkCompositeAlphaFlagBitsKHR {
1479 VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR = 0x00000001,
1480 VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR = 0x00000002,
1481 VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR = 0x00000004,
1482 VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR = 0x00000008,
1483}
1484
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001485@extension("VK_KHR_swapchain")
1486type VkFlags VkSwapchainCreateFlagsKHR
1487//@extension("VK_KHR_swapchain")
1488//bitfield VkSwapchainCreateFlagBitsKHR {
1489//}
1490
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001491@extension("VK_KHR_display")
Jesse Halld8bade02015-11-24 10:24:18 -08001492type VkFlags VkDisplayPlaneAlphaFlagsKHR
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001493@extension("VK_KHR_display")
Jesse Halld8bade02015-11-24 10:24:18 -08001494bitfield VkDisplayPlaneAlphaFlagBitsKHR {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001495 VK_DISPLAY_PLANE_ALPHA_OPAQUE_BIT_KHR = 0x00000001,
1496 VK_DISPLAY_PLANE_ALPHA_GLOBAL_BIT_KHR = 0x00000002,
1497 VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_BIT_KHR = 0x00000004,
1498 VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_PREMULTIPLIED_BIT_KHR = 0x00000008,
Jesse Hall1356b0d2015-11-23 17:24:58 -08001499}
1500
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001501@extension("VK_KHR_display")
1502type VkFlags VkDisplaySurfaceCreateFlagsKHR
1503//@extension("VK_KHR_display")
1504//bitfield VkDisplaySurfaceCreateFlagBitsKHR {
1505//}
1506
Jesse Hall9ba8bc82015-11-30 16:22:16 -08001507@extension("VK_KHR_display")
1508type VkFlags VkDisplayModeCreateFlagsKHR
1509//@extension("VK_KHR_display")
1510//bitfield VkDisplayModeCreateFlagBitsKHR {
1511//}
1512
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001513@extension("VK_KHR_xlib_surface")
1514type VkFlags VkXlibSurfaceCreateFlagsKHR
1515//@extension("VK_KHR_xlib_surface")
1516//bitfield VkXlibSurfaceCreateFlagBitsKHR {
1517//}
1518
1519@extension("VK_KHR_xcb_surface")
1520type VkFlags VkXcbSurfaceCreateFlagsKHR
1521//@extension("VK_KHR_xcb_surface")
1522//bitfield VkXcbSurfaceCreateFlagBitsKHR {
1523//}
1524
1525@extension("VK_KHR_wayland_surface")
1526type VkFlags VkWaylandSurfaceCreateFlagsKHR
1527//@extension("VK_KHR_wayland_surface")
1528//bitfield VkWaylandSurfaceCreateFlagBitsKHR {
1529//}
1530
1531@extension("VK_KHR_mir_surface")
1532type VkFlags VkMirSurfaceCreateFlagsKHR
1533//@extension("VK_KHR_mir_surface")
1534//bitfield VkMirSurfaceCreateFlagBitsKHR {
1535//}
1536
1537@extension("VK_KHR_android_surface")
1538type VkFlags VkAndroidSurfaceCreateFlagsKHR
1539//@extension("VK_KHR_android_surface")
1540//bitfield VkAndroidSurfaceCreateFlagBitsKHR {
1541//}
1542
1543@extension("VK_KHR_win32_surface")
1544type VkFlags VkWin32SurfaceCreateFlagsKHR
1545//@extension("VK_KHR_win32_surface")
1546//bitfield VkWin32SurfaceCreateFlagBitsKHR {
1547//}
1548
Jesse Hall715b86a2016-01-16 16:34:29 -08001549@extension("VK_EXT_debug_report")
1550type VkFlags VkDebugReportFlagsEXT
1551@extension("VK_EXT_debug_report")
1552bitfield VkDebugReportFlagBitsEXT {
Jesse Halle2948d82016-02-25 04:19:32 -08001553 VK_DEBUG_REPORT_INFORMATION_BIT_EXT = 0x00000001,
1554 VK_DEBUG_REPORT_WARNING_BIT_EXT = 0x00000002,
1555 VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT = 0x00000004,
Jesse Hall715b86a2016-01-16 16:34:29 -08001556 VK_DEBUG_REPORT_ERROR_BIT_EXT = 0x00000008,
1557 VK_DEBUG_REPORT_DEBUG_BIT_EXT = 0x00000010,
1558}
1559
Chris Forbes8e4438b2016-12-07 16:26:49 +13001560@extension("VK_ANDROID_native_buffer")
1561type VkFlags VkSwapchainImageUsageFlagsANDROID
1562@extension("VK_ANDROID_native_buffer")
1563bitfield VkSwapchainImageUsageFlagBitsANDROID {
1564 VK_SWAPCHAIN_IMAGE_USAGE_FLAGS_FRONT_BUFFER_BIT_ANDROID = 0x00000001,
1565}
1566
Chris Forbes289cb792016-12-30 15:03:55 +13001567@extension("VK_NV_external_memory_capabilities")
1568type VkFlags VkExternalMemoryHandleTypeFlagsNV
1569@extension("VK_NV_external_memory_capabilities")
1570bitfield VkExternalMemoryHandleTypeFlagBitsNV {
1571 VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_NV = 0x00000001,
1572 VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_NV = 0x00000002,
1573 VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_IMAGE_BIT_NV = 0x00000004,
1574 VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_IMAGE_KMT_BIT_NV = 0x00000008,
1575}
1576
1577@extension("VK_NV_external_memory_capabilities")
1578type VkFlags VkExternalMemoryFeatureFlagsNV
1579@extension("VK_NV_external_memory_capabilities")
1580bitfield VkExternalMemoryFeatureFlagBitsNV {
1581 VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT_NV = 0x00000001,
1582 VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT_NV = 0x00000002,
1583 VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT_NV = 0x00000004,
1584}
1585
1586@extension("VK_NVX_device_generated_commands")
1587type VkFlags VkIndirectCommandsLayoutUsageFlagsNVX
1588@extension("VK_NVX_device_generated_commands")
1589bitfield VkIndirectCommandsLayoutUsageFlagBitsNVX {
1590 VK_INDIRECT_COMMANDS_LAYOUT_USAGE_UNORDERED_SEQUENCES_BIT_NVX = 0x00000001,
1591 VK_INDIRECT_COMMANDS_LAYOUT_USAGE_SPARSE_SEQUENCES_BIT_NVX = 0x00000002,
1592 VK_INDIRECT_COMMANDS_LAYOUT_USAGE_EMPTY_EXECUTIONS_BIT_NVX = 0x00000004,
1593 VK_INDIRECT_COMMANDS_LAYOUT_USAGE_INDEXED_SEQUENCES_BIT_NVX = 0x00000008,
1594}
1595
1596@extension("VK_NVX_device_generated_commands")
1597type VkFlags VkObjectEntryUsageFlagsNVX
1598@extension("VK_NVX_device_generated_commands")
1599bitfield VkObjectEntryUsageFlagBitsNVX {
1600 VK_OBJECT_ENTRY_USAGE_GRAPHICS_BIT_NVX = 0x00000001,
1601 VK_OBJECT_ENTRY_USAGE_COMPUTE_BIT_NVX = 0x00000002,
1602}
1603
Jesse Hall1356b0d2015-11-23 17:24:58 -08001604
Jesse Halld27f6aa2015-08-15 17:58:48 -07001605//////////////////
1606// Structures //
1607//////////////////
1608
1609class VkOffset2D {
1610 s32 x
1611 s32 y
1612}
1613
1614class VkOffset3D {
1615 s32 x
1616 s32 y
1617 s32 z
1618}
1619
1620class VkExtent2D {
Jesse Hall3dd678a2016-01-08 21:52:01 -08001621 u32 width
1622 u32 height
Jesse Halld27f6aa2015-08-15 17:58:48 -07001623}
1624
1625class VkExtent3D {
Jesse Hall3dd678a2016-01-08 21:52:01 -08001626 u32 width
1627 u32 height
1628 u32 depth
Jesse Halld27f6aa2015-08-15 17:58:48 -07001629}
1630
1631class VkViewport {
Jesse Hall65ab5522015-11-30 00:07:16 -08001632 f32 x
1633 f32 y
Jesse Halld27f6aa2015-08-15 17:58:48 -07001634 f32 width
1635 f32 height
1636 f32 minDepth
1637 f32 maxDepth
1638}
1639
1640class VkRect2D {
1641 VkOffset2D offset
1642 VkExtent2D extent
1643}
1644
Jesse Halla15a4bf2015-11-19 22:48:02 -08001645class VkClearRect {
1646 VkRect2D rect
1647 u32 baseArrayLayer
Jesse Hall3fbc8562015-11-29 22:10:52 -08001648 u32 layerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001649}
1650
Jesse Hall65ab5522015-11-30 00:07:16 -08001651class VkComponentMapping {
1652 VkComponentSwizzle r
1653 VkComponentSwizzle g
1654 VkComponentSwizzle b
1655 VkComponentSwizzle a
Jesse Halld27f6aa2015-08-15 17:58:48 -07001656}
1657
1658class VkPhysicalDeviceProperties {
1659 u32 apiVersion
1660 u32 driverVersion
Jesse Hall65ab5522015-11-30 00:07:16 -08001661 u32 vendorID
1662 u32 deviceID
Jesse Halld27f6aa2015-08-15 17:58:48 -07001663 VkPhysicalDeviceType deviceType
Jesse Hall65ab5522015-11-30 00:07:16 -08001664 char[VK_MAX_PHYSICAL_DEVICE_NAME_SIZE] deviceName
1665 u8[VK_UUID_SIZE] pipelineCacheUUID
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001666 VkPhysicalDeviceLimits limits
1667 VkPhysicalDeviceSparseProperties sparseProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07001668}
1669
1670class VkExtensionProperties {
Jesse Hall65ab5522015-11-30 00:07:16 -08001671 char[VK_MAX_EXTENSION_NAME_SIZE] extensionName /// extension name
Jesse Halld27f6aa2015-08-15 17:58:48 -07001672 u32 specVersion /// version of the extension specification implemented
1673}
1674
1675class VkLayerProperties {
Jesse Hall65ab5522015-11-30 00:07:16 -08001676 char[VK_MAX_EXTENSION_NAME_SIZE] layerName /// layer name
Jesse Hall3fbc8562015-11-29 22:10:52 -08001677 u32 specVersion /// version of the layer specification implemented
1678 u32 implementationVersion /// build or release version of the layer's library
Jesse Hall65ab5522015-11-30 00:07:16 -08001679 char[VK_MAX_DESCRIPTION_SIZE] description /// Free-form description of the layer
Jesse Halld27f6aa2015-08-15 17:58:48 -07001680}
1681
Jesse Halla366a512015-11-19 22:30:07 -08001682class VkSubmitInfo {
Jesse Hall03b6fe12015-11-24 12:44:21 -08001683 VkStructureType sType /// Type of structure. Should be VK_STRUCTURE_TYPE_SUBMIT_INFO
1684 const void* pNext /// Next structure in chain
1685 u32 waitSemaphoreCount
Jesse Halla366a512015-11-19 22:30:07 -08001686 const VkSemaphore* pWaitSemaphores
Jesse Hall543a7ff2016-01-08 16:38:30 -08001687 const VkPipelineStageFlags* pWaitDstStageMask
Jesse Hall03b6fe12015-11-24 12:44:21 -08001688 u32 commandBufferCount
Jesse Hall3fbc8562015-11-29 22:10:52 -08001689 const VkCommandBuffer* pCommandBuffers
Jesse Hall03b6fe12015-11-24 12:44:21 -08001690 u32 signalSemaphoreCount
Jesse Halla366a512015-11-19 22:30:07 -08001691 const VkSemaphore* pSignalSemaphores
1692}
1693
Jesse Halld27f6aa2015-08-15 17:58:48 -07001694class VkApplicationInfo {
1695 VkStructureType sType /// Type of structure. Should be VK_STRUCTURE_TYPE_APPLICATION_INFO
1696 const void* pNext /// Next structure in chain
Jesse Hall3fbc8562015-11-29 22:10:52 -08001697 const char* pApplicationName
1698 u32 applicationVersion
Jesse Halld27f6aa2015-08-15 17:58:48 -07001699 const char* pEngineName
1700 u32 engineVersion
1701 u32 apiVersion
1702}
1703
Jesse Hall3fbc8562015-11-29 22:10:52 -08001704class VkAllocationCallbacks {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001705 void* pUserData
Jesse Hall3fbc8562015-11-29 22:10:52 -08001706 PFN_vkAllocationFunction pfnAllocation
1707 PFN_vkReallocationFunction pfnReallocation
Jesse Halld27f6aa2015-08-15 17:58:48 -07001708 PFN_vkFreeFunction pfnFree
Jesse Hall3fbc8562015-11-29 22:10:52 -08001709 PFN_vkInternalAllocationNotification pfnInternalAllocation
Jesse Hall03b6fe12015-11-24 12:44:21 -08001710 PFN_vkInternalFreeNotification pfnInternalFree
Jesse Halld27f6aa2015-08-15 17:58:48 -07001711}
1712
1713class VkDeviceQueueCreateInfo {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001714 VkStructureType sStype /// Should be VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO
1715 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001716 VkDeviceQueueCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001717 u32 queueFamilyIndex
Jesse Halldba27f72015-11-30 14:25:46 -08001718 u32 queueCount
Jesse Hallfbf97b02015-11-20 14:17:03 -08001719 const f32* pQueuePriorities
Jesse Halld27f6aa2015-08-15 17:58:48 -07001720}
1721
1722class VkDeviceCreateInfo {
1723 VkStructureType sType /// Should be VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO
1724 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001725 VkDeviceCreateFlags flags
Jesse Halldba27f72015-11-30 14:25:46 -08001726 u32 queueCreateInfoCount
1727 const VkDeviceQueueCreateInfo* pQueueCreateInfos
Jesse Hall3dd678a2016-01-08 21:52:01 -08001728 u32 enabledLayerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001729 const char* const* ppEnabledLayerNames /// Ordered list of layer names to be enabled
Jesse Hall3dd678a2016-01-08 21:52:01 -08001730 u32 enabledExtensionCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001731 const char* const* ppEnabledExtensionNames
1732 const VkPhysicalDeviceFeatures* pEnabledFeatures
Jesse Halld27f6aa2015-08-15 17:58:48 -07001733}
1734
1735class VkInstanceCreateInfo {
1736 VkStructureType sType /// Should be VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO
1737 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001738 VkInstanceCreateFlags flags
Jesse Hall3fbc8562015-11-29 22:10:52 -08001739 const VkApplicationInfo* pApplicationInfo
Jesse Hall3dd678a2016-01-08 21:52:01 -08001740 u32 enabledLayerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001741 const char* const* ppEnabledLayerNames /// Ordered list of layer names to be enabled
Jesse Hall3dd678a2016-01-08 21:52:01 -08001742 u32 enabledExtensionCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001743 const char* const* ppEnabledExtensionNames /// Extension names to be enabled
1744}
1745
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001746class VkQueueFamilyProperties {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001747 VkQueueFlags queueFlags /// Queue flags
1748 u32 queueCount
Jesse Hallacfa5342015-11-19 21:51:33 -08001749 u32 timestampValidBits
Jesse Hall65ab5522015-11-30 00:07:16 -08001750 VkExtent3D minImageTransferGranularity
Jesse Halld27f6aa2015-08-15 17:58:48 -07001751}
1752
1753class VkPhysicalDeviceMemoryProperties {
1754 u32 memoryTypeCount
1755 VkMemoryType[VK_MAX_MEMORY_TYPES] memoryTypes
1756 u32 memoryHeapCount
1757 VkMemoryHeap[VK_MAX_MEMORY_HEAPS] memoryHeaps
1758}
1759
Jesse Hall3fbc8562015-11-29 22:10:52 -08001760class VkMemoryAllocateInfo {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08001761 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07001762 const void* pNext /// Pointer to next structure
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001763 VkDeviceSize allocationSize /// Size of memory allocation
Jesse Halld27f6aa2015-08-15 17:58:48 -07001764 u32 memoryTypeIndex /// Index of the of the memory type to allocate from
1765}
1766
1767class VkMemoryRequirements {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001768 VkDeviceSize size /// Specified in bytes
1769 VkDeviceSize alignment /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001770 u32 memoryTypeBits /// Bitfield of the allowed memory type indices into memoryTypes[] for this object
1771}
1772
1773class VkSparseImageFormatProperties {
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001774 VkImageAspectFlagBits aspectMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001775 VkExtent3D imageGranularity
1776 VkSparseImageFormatFlags flags
1777}
1778
1779class VkSparseImageMemoryRequirements {
Jesse Hallb00daad2015-11-29 19:46:20 -08001780 VkSparseImageFormatProperties formatProperties
Jesse Hallf9fa9a52016-01-08 16:08:51 -08001781 u32 imageMipTailFirstLod
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001782 VkDeviceSize imageMipTailSize /// Specified in bytes, must be a multiple of image block size / alignment
1783 VkDeviceSize imageMipTailOffset /// Specified in bytes, must be a multiple of image block size / alignment
1784 VkDeviceSize imageMipTailStride /// Specified in bytes, must be a multiple of image block size / alignment
Jesse Halld27f6aa2015-08-15 17:58:48 -07001785}
1786
1787class VkMemoryType {
1788 VkMemoryPropertyFlags propertyFlags /// Memory properties of this memory type
1789 u32 heapIndex /// Index of the memory heap allocations of this memory type are taken from
1790}
1791
1792class VkMemoryHeap {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001793 VkDeviceSize size /// Available memory in the heap
Jesse Halld27f6aa2015-08-15 17:58:48 -07001794 VkMemoryHeapFlags flags /// Flags for the heap
1795}
1796
1797class VkMappedMemoryRange {
1798 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MAPPED_MEMORY_RANGE
1799 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08001800 VkDeviceMemory memory /// Mapped memory object
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001801 VkDeviceSize offset /// Offset within the mapped memory the range starts from
1802 VkDeviceSize size /// Size of the range within the mapped memory
Jesse Halld27f6aa2015-08-15 17:58:48 -07001803}
1804
1805class VkFormatProperties {
1806 VkFormatFeatureFlags linearTilingFeatures /// Format features in case of linear tiling
1807 VkFormatFeatureFlags optimalTilingFeatures /// Format features in case of optimal tiling
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001808 VkFormatFeatureFlags bufferFeatures /// Format features supported by buffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07001809}
1810
1811class VkImageFormatProperties {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001812 VkExtent3D maxExtent /// max image dimensions for this resource type
1813 u32 maxMipLevels /// max number of mipmap levels for this resource type
Jesse Halla15a4bf2015-11-19 22:48:02 -08001814 u32 maxArrayLayers /// max array layers for this resource type
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001815 VkSampleCountFlags sampleCounts /// supported sample counts for this resource type
1816 VkDeviceSize maxResourceSize /// max size (in bytes) of this resource type
1817}
1818
Jesse Halla15a4bf2015-11-19 22:48:02 -08001819class VkDescriptorImageInfo {
1820 VkSampler sampler
1821 VkImageView imageView
1822 VkImageLayout imageLayout
1823}
1824
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001825class VkDescriptorBufferInfo {
1826 VkBuffer buffer /// Buffer used for this descriptor when the descriptor is UNIFORM_BUFFER[_DYNAMIC]
1827 VkDeviceSize offset /// Base offset from buffer start in bytes to update in the descriptor set.
1828 VkDeviceSize range /// Size in bytes of the buffer resource for this descriptor update.
Jesse Halld27f6aa2015-08-15 17:58:48 -07001829}
1830
Jesse Halld27f6aa2015-08-15 17:58:48 -07001831class VkWriteDescriptorSet {
1832 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET
1833 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08001834 VkDescriptorSet dstSet /// Destination descriptor set
1835 u32 dstBinding /// Binding within the destination descriptor set to write
1836 u32 dstArrayElement /// Array element within the destination binding to write
Jesse Hall03b6fe12015-11-24 12:44:21 -08001837 u32 descriptorCount /// Number of descriptors to write (determines the size of the array pointed by <pDescriptors>)
Jesse Halld27f6aa2015-08-15 17:58:48 -07001838 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 -08001839 const VkDescriptorImageInfo* pImageInfo
1840 const VkDescriptorBufferInfo* pBufferInfo
1841 const VkBufferView* pTexelBufferView
Jesse Halld27f6aa2015-08-15 17:58:48 -07001842}
1843
1844class VkCopyDescriptorSet {
1845 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COPY_DESCRIPTOR_SET
1846 const void* pNext /// Pointer to next structure
1847 VkDescriptorSet srcSet /// Source descriptor set
1848 u32 srcBinding /// Binding within the source descriptor set to copy from
1849 u32 srcArrayElement /// Array element within the source binding to copy from
Jesse Hall3fbc8562015-11-29 22:10:52 -08001850 VkDescriptorSet dstSet /// Destination descriptor set
1851 u32 dstBinding /// Binding within the destination descriptor set to copy to
1852 u32 dstArrayElement /// Array element within the destination binding to copy to
Jesse Hall03b6fe12015-11-24 12:44:21 -08001853 u32 descriptorCount /// Number of descriptors to copy
Jesse Halld27f6aa2015-08-15 17:58:48 -07001854}
1855
1856class VkBufferCreateInfo {
1857 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO
1858 const void* pNext /// Pointer to next structure.
Jesse Halla6429252015-11-29 18:59:42 -08001859 VkBufferCreateFlags flags /// Buffer creation flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001860 VkDeviceSize size /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001861 VkBufferUsageFlags usage /// Buffer usage flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001862 VkSharingMode sharingMode
Jesse Hall03b6fe12015-11-24 12:44:21 -08001863 u32 queueFamilyIndexCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001864 const u32* pQueueFamilyIndices
1865}
1866
1867class VkBufferViewCreateInfo {
1868 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO
1869 const void* pNext /// Pointer to next structure.
Jesse Halla6429252015-11-29 18:59:42 -08001870 VkBufferViewCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001871 VkBuffer buffer
Jesse Halld27f6aa2015-08-15 17:58:48 -07001872 VkFormat format /// Optionally specifies format of elements
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001873 VkDeviceSize offset /// Specified in bytes
1874 VkDeviceSize range /// View size specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001875}
1876
1877class VkImageSubresource {
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001878 VkImageAspectFlagBits aspectMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001879 u32 mipLevel
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001880 u32 arrayLayer
Jesse Halld27f6aa2015-08-15 17:58:48 -07001881}
1882
1883class VkImageSubresourceRange {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001884 VkImageAspectFlags aspectMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001885 u32 baseMipLevel
Jesse Hall3fbc8562015-11-29 22:10:52 -08001886 u32 levelCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001887 u32 baseArrayLayer
Jesse Hall3fbc8562015-11-29 22:10:52 -08001888 u32 layerCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07001889}
1890
1891class VkMemoryBarrier {
1892 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_MEMORY_BARRIER
1893 const void* pNext /// Pointer to next structure.
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001894 VkAccessFlags srcAccessMask
1895 VkAccessFlags dstAccessMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001896}
1897
1898class VkBufferMemoryBarrier {
1899 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER
1900 const void* pNext /// Pointer to next structure.
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001901 VkAccessFlags srcAccessMask
1902 VkAccessFlags dstAccessMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001903 u32 srcQueueFamilyIndex /// Queue family to transition ownership from
Jesse Hall3fbc8562015-11-29 22:10:52 -08001904 u32 dstQueueFamilyIndex /// Queue family to transition ownership to
Jesse Halld27f6aa2015-08-15 17:58:48 -07001905 VkBuffer buffer /// Buffer to sync
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001906 VkDeviceSize offset /// Offset within the buffer to sync
1907 VkDeviceSize size /// Amount of bytes to sync
Jesse Halld27f6aa2015-08-15 17:58:48 -07001908}
1909
1910class VkImageMemoryBarrier {
1911 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER
1912 const void* pNext /// Pointer to next structure.
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08001913 VkAccessFlags srcAccessMask
1914 VkAccessFlags dstAccessMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07001915 VkImageLayout oldLayout /// Current layout of the image
1916 VkImageLayout newLayout /// New layout to transition the image to
1917 u32 srcQueueFamilyIndex /// Queue family to transition ownership from
Jesse Hall3fbc8562015-11-29 22:10:52 -08001918 u32 dstQueueFamilyIndex /// Queue family to transition ownership to
Jesse Halld27f6aa2015-08-15 17:58:48 -07001919 VkImage image /// Image to sync
1920 VkImageSubresourceRange subresourceRange /// Subresource range to sync
1921}
1922
1923class VkImageCreateInfo {
1924 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO
1925 const void* pNext /// Pointer to next structure.
Jesse Halla6429252015-11-29 18:59:42 -08001926 VkImageCreateFlags flags /// Image creation flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001927 VkImageType imageType
1928 VkFormat format
1929 VkExtent3D extent
1930 u32 mipLevels
Jesse Halla15a4bf2015-11-19 22:48:02 -08001931 u32 arrayLayers
Jesse Hall091ed9e2015-11-30 00:55:29 -08001932 VkSampleCountFlagBits samples
Jesse Halld27f6aa2015-08-15 17:58:48 -07001933 VkImageTiling tiling
1934 VkImageUsageFlags usage /// Image usage flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001935 VkSharingMode sharingMode /// Cross-queue-family sharing mode
Jesse Hall03b6fe12015-11-24 12:44:21 -08001936 u32 queueFamilyIndexCount /// Number of queue families to share across
Jesse Halld27f6aa2015-08-15 17:58:48 -07001937 const u32* pQueueFamilyIndices /// Array of queue family indices to share across
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001938 VkImageLayout initialLayout /// Initial image layout for all subresources
Jesse Halld27f6aa2015-08-15 17:58:48 -07001939}
1940
1941class VkSubresourceLayout {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001942 VkDeviceSize offset /// Specified in bytes
1943 VkDeviceSize size /// Specified in bytes
1944 VkDeviceSize rowPitch /// Specified in bytes
Jesse Hall543a7ff2016-01-08 16:38:30 -08001945 VkDeviceSize arrayPitch /// Specified in bytes
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001946 VkDeviceSize depthPitch /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001947}
1948
1949class VkImageViewCreateInfo {
1950 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO
1951 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08001952 VkImageViewCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07001953 VkImage image
1954 VkImageViewType viewType
1955 VkFormat format
Jesse Hall65ab5522015-11-30 00:07:16 -08001956 VkComponentMapping components
Jesse Halld27f6aa2015-08-15 17:58:48 -07001957 VkImageSubresourceRange subresourceRange
Jesse Halld27f6aa2015-08-15 17:58:48 -07001958}
1959
1960class VkBufferCopy {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07001961 VkDeviceSize srcOffset /// Specified in bytes
Jesse Hall3fbc8562015-11-29 22:10:52 -08001962 VkDeviceSize dstOffset /// Specified in bytes
Jesse Hallb00daad2015-11-29 19:46:20 -08001963 VkDeviceSize size /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001964}
1965
Jesse Halla6429252015-11-29 18:59:42 -08001966class VkSparseMemoryBind {
Jesse Hallb00daad2015-11-29 19:46:20 -08001967 VkDeviceSize resourceOffset /// Specified in bytes
1968 VkDeviceSize size /// Specified in bytes
Jesse Hall3fbc8562015-11-29 22:10:52 -08001969 VkDeviceMemory memory
1970 VkDeviceSize memoryOffset /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001971 VkSparseMemoryBindFlags flags
1972}
1973
Jesse Halla6429252015-11-29 18:59:42 -08001974class VkSparseImageMemoryBind {
Jesse Halld27f6aa2015-08-15 17:58:48 -07001975 VkImageSubresource subresource
1976 VkOffset3D offset
1977 VkExtent3D extent
Jesse Hall3fbc8562015-11-29 22:10:52 -08001978 VkDeviceMemory memory
1979 VkDeviceSize memoryOffset /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07001980 VkSparseMemoryBindFlags flags
1981}
1982
Jesse Halla6429252015-11-29 18:59:42 -08001983class VkSparseBufferMemoryBindInfo {
1984 VkBuffer buffer
1985 u32 bindCount
1986 const VkSparseMemoryBind* pBinds
1987}
1988
1989class VkSparseImageOpaqueMemoryBindInfo {
1990 VkImage image
1991 u32 bindCount
1992 const VkSparseMemoryBind* pBinds
1993}
1994
1995class VkSparseImageMemoryBindInfo {
1996 VkImage image
1997 u32 bindCount
1998 const VkSparseMemoryBind* pBinds
1999}
2000
2001class VkBindSparseInfo {
2002 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_BIND_SPARSE_INFO
2003 const void* pNext
2004 u32 waitSemaphoreCount
2005 const VkSemaphore* pWaitSemaphores
2006 u32 numBufferBinds
2007 const VkSparseBufferMemoryBindInfo* pBufferBinds
2008 u32 numImageOpaqueBinds
2009 const VkSparseImageOpaqueMemoryBindInfo* pImageOpaqueBinds
2010 u32 numImageBinds
2011 const VkSparseImageMemoryBindInfo* pImageBinds
2012 u32 signalSemaphoreCount
2013 const VkSemaphore* pSignalSemaphores
2014}
2015
Jesse Hall65ab5522015-11-30 00:07:16 -08002016class VkImageSubresourceLayers {
2017 VkImageAspectFlags aspectMask
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002018 u32 mipLevel
Jesse Halla15a4bf2015-11-19 22:48:02 -08002019 u32 baseArrayLayer
Jesse Hall3fbc8562015-11-29 22:10:52 -08002020 u32 layerCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002021}
2022
Jesse Halld27f6aa2015-08-15 17:58:48 -07002023class VkImageCopy {
Jesse Hall65ab5522015-11-30 00:07:16 -08002024 VkImageSubresourceLayers srcSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07002025 VkOffset3D srcOffset /// Specified in pixels for both compressed and uncompressed images
Jesse Hall65ab5522015-11-30 00:07:16 -08002026 VkImageSubresourceLayers dstSubresource
Jesse Hall3fbc8562015-11-29 22:10:52 -08002027 VkOffset3D dstOffset /// Specified in pixels for both compressed and uncompressed images
Jesse Halld27f6aa2015-08-15 17:58:48 -07002028 VkExtent3D extent /// Specified in pixels for both compressed and uncompressed images
2029}
2030
2031class VkImageBlit {
Jesse Hall65ab5522015-11-30 00:07:16 -08002032 VkImageSubresourceLayers srcSubresource
Jesse Hall3dd678a2016-01-08 21:52:01 -08002033 VkOffset3D[2] srcOffsets
Jesse Hall65ab5522015-11-30 00:07:16 -08002034 VkImageSubresourceLayers dstSubresource
Jesse Hall3dd678a2016-01-08 21:52:01 -08002035 VkOffset3D[2] dstOffsets
Jesse Halld27f6aa2015-08-15 17:58:48 -07002036}
2037
2038class VkBufferImageCopy {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002039 VkDeviceSize bufferOffset /// Specified in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002040 u32 bufferRowLength /// Specified in texels
2041 u32 bufferImageHeight
Jesse Hall65ab5522015-11-30 00:07:16 -08002042 VkImageSubresourceLayers imageSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07002043 VkOffset3D imageOffset /// Specified in pixels for both compressed and uncompressed images
2044 VkExtent3D imageExtent /// Specified in pixels for both compressed and uncompressed images
2045}
2046
2047class VkImageResolve {
Jesse Hall65ab5522015-11-30 00:07:16 -08002048 VkImageSubresourceLayers srcSubresource
Jesse Halld27f6aa2015-08-15 17:58:48 -07002049 VkOffset3D srcOffset
Jesse Hall65ab5522015-11-30 00:07:16 -08002050 VkImageSubresourceLayers dstSubresource
Jesse Hall3fbc8562015-11-29 22:10:52 -08002051 VkOffset3D dstOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07002052 VkExtent3D extent
2053}
2054
2055class VkShaderModuleCreateInfo {
2056 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO
2057 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002058 VkShaderModuleCreateFlags flags /// Reserved
Jesse Halld27f6aa2015-08-15 17:58:48 -07002059 platform.size_t codeSize /// Specified in bytes
Jesse Halla9bb62b2015-11-21 19:31:56 -08002060 const u32* pCode /// Binary code of size codeSize
Jesse Halld27f6aa2015-08-15 17:58:48 -07002061}
2062
Jesse Halld27f6aa2015-08-15 17:58:48 -07002063class VkDescriptorSetLayoutBinding {
Jesse Hall091ed9e2015-11-30 00:55:29 -08002064 u32 binding
Jesse Halld27f6aa2015-08-15 17:58:48 -07002065 VkDescriptorType descriptorType /// Type of the descriptors in this binding
Jesse Halldba27f72015-11-30 14:25:46 -08002066 u32 descriptorCount /// Number of descriptors in this binding
Jesse Halld27f6aa2015-08-15 17:58:48 -07002067 VkShaderStageFlags stageFlags /// Shader stages this binding is visible to
2068 const VkSampler* pImmutableSamplers /// Immutable samplers (used if descriptor type is SAMPLER or COMBINED_IMAGE_SAMPLER, is either NULL or contains <count> number of elements)
2069}
2070
2071class VkDescriptorSetLayoutCreateInfo {
2072 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO
2073 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002074 VkDescriptorSetLayoutCreateFlags flags
Jesse Hall03b6fe12015-11-24 12:44:21 -08002075 u32 bindingCount /// Number of bindings in the descriptor set layout
Jesse Hall543a7ff2016-01-08 16:38:30 -08002076 const VkDescriptorSetLayoutBinding* pBindings /// Array of descriptor set layout bindings
Jesse Halld27f6aa2015-08-15 17:58:48 -07002077}
2078
Jesse Hall65ab5522015-11-30 00:07:16 -08002079class VkDescriptorPoolSize {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002080 VkDescriptorType type
Jesse Hall03b6fe12015-11-24 12:44:21 -08002081 u32 descriptorCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002082}
2083
2084class VkDescriptorPoolCreateInfo {
2085 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO
2086 const void* pNext /// Pointer to next structure
Jesse Hallfbf97b02015-11-20 14:17:03 -08002087 VkDescriptorPoolCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002088 u32 maxSets
Jesse Hall65ab5522015-11-30 00:07:16 -08002089 u32 poolSizeCount
2090 const VkDescriptorPoolSize* pPoolSizes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002091}
2092
Jesse Hall3fbc8562015-11-29 22:10:52 -08002093class VkDescriptorSetAllocateInfo {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002094 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO
Jesse Hallfbf97b02015-11-20 14:17:03 -08002095 const void* pNext /// Pointer to next structure
2096 VkDescriptorPool descriptorPool
Jesse Hall03b6fe12015-11-24 12:44:21 -08002097 u32 setCount
Jesse Hallfbf97b02015-11-20 14:17:03 -08002098 const VkDescriptorSetLayout* pSetLayouts
2099}
2100
Jesse Halld27f6aa2015-08-15 17:58:48 -07002101class VkSpecializationMapEntry {
Jesse Hall65ab5522015-11-30 00:07:16 -08002102 u32 constantID /// The SpecConstant ID specified in the BIL
Jesse Halld27f6aa2015-08-15 17:58:48 -07002103 u32 offset /// Offset of the value in the data block
Jesse Hallb00daad2015-11-29 19:46:20 -08002104 platform.size_t size /// Size in bytes of the SpecConstant
Jesse Halld27f6aa2015-08-15 17:58:48 -07002105}
2106
2107class VkSpecializationInfo {
2108 u32 mapEntryCount /// Number of entries in the map
Jesse Hallb00daad2015-11-29 19:46:20 -08002109 const VkSpecializationMapEntry* pMapEntries /// Array of map entries
Jesse Halld27f6aa2015-08-15 17:58:48 -07002110 platform.size_t dataSize /// Size in bytes of pData
2111 const void* pData /// Pointer to SpecConstant data
2112}
2113
2114class VkPipelineShaderStageCreateInfo {
2115 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO
2116 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002117 VkPipelineShaderStageCreateFlags flags
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002118 VkShaderStageFlagBits stage
2119 VkShaderModule module
2120 const char* pName
Jesse Halld27f6aa2015-08-15 17:58:48 -07002121 const VkSpecializationInfo* pSpecializationInfo
2122}
2123
2124class VkComputePipelineCreateInfo {
2125 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO
2126 const void* pNext /// Pointer to next structure
Jesse Halld27f6aa2015-08-15 17:58:48 -07002127 VkPipelineCreateFlags flags /// Pipeline creation flags
Jesse Halla6429252015-11-29 18:59:42 -08002128 VkPipelineShaderStageCreateInfo stage
Jesse Halld27f6aa2015-08-15 17:58:48 -07002129 VkPipelineLayout layout /// Interface layout of the pipeline
2130 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
2131 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
2132}
2133
2134class VkVertexInputBindingDescription {
Jesse Hallb00daad2015-11-29 19:46:20 -08002135 u32 binding /// Vertex buffer binding id
2136 u32 stride /// Distance between vertices in bytes (0 = no advancement)
Jesse Hall65ab5522015-11-30 00:07:16 -08002137 VkVertexInputRate inputRate /// Rate at which binding is incremented
Jesse Halld27f6aa2015-08-15 17:58:48 -07002138}
2139
2140class VkVertexInputAttributeDescription {
Jesse Hallb00daad2015-11-29 19:46:20 -08002141 u32 location /// location of the shader vertex attrib
2142 u32 binding /// Vertex buffer binding id
2143 VkFormat format /// format of source data
2144 u32 offset /// Offset of first element in bytes from base of vertex
Jesse Halld27f6aa2015-08-15 17:58:48 -07002145}
2146
2147class VkPipelineVertexInputStateCreateInfo {
Jesse Hall03b6fe12015-11-24 12:44:21 -08002148 VkStructureType sType /// Should be VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO
2149 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002150 VkPipelineVertexInputStateCreateFlags flags
Jesse Hall03b6fe12015-11-24 12:44:21 -08002151 u32 vertexBindingDescriptionCount /// number of bindings
Jesse Halld27f6aa2015-08-15 17:58:48 -07002152 const VkVertexInputBindingDescription* pVertexBindingDescriptions
Jesse Hall03b6fe12015-11-24 12:44:21 -08002153 u32 vertexAttributeDescriptionCount /// number of attributes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002154 const VkVertexInputAttributeDescription* pVertexAttributeDescriptions
2155}
2156
2157class VkPipelineInputAssemblyStateCreateInfo {
2158 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO
2159 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002160 VkPipelineInputAssemblyStateCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002161 VkPrimitiveTopology topology
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002162 VkBool32 primitiveRestartEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002163}
2164
2165class VkPipelineTessellationStateCreateInfo {
2166 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO
2167 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002168 VkPipelineTessellationStateCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002169 u32 patchControlPoints
2170}
2171
2172class VkPipelineViewportStateCreateInfo {
2173 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO
2174 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002175 VkPipelineViewportStateCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002176 u32 viewportCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002177 const VkViewport* pViewports
2178 u32 scissorCount
2179 const VkRect2D* pScissors
Jesse Halld27f6aa2015-08-15 17:58:48 -07002180}
2181
Jesse Hall3fbc8562015-11-29 22:10:52 -08002182class VkPipelineRasterizationStateCreateInfo {
Jesse Hall65ab5522015-11-30 00:07:16 -08002183 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002184 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08002185 VkPipelineRasterizationStateCreateFlags flags
Jesse Hallae38f732015-11-19 21:32:50 -08002186 VkBool32 depthClampEnable
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002187 VkBool32 rasterizerDiscardEnable
Jesse Hall65ab5522015-11-30 00:07:16 -08002188 VkPolygonMode polygonMode /// optional (GL45)
Jesse Hallc7467b72015-11-29 21:05:26 -08002189 VkCullModeFlags cullMode
Jesse Halld27f6aa2015-08-15 17:58:48 -07002190 VkFrontFace frontFace
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002191 VkBool32 depthBiasEnable
Jesse Halla9bb62b2015-11-21 19:31:56 -08002192 f32 depthBiasConstantFactor
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002193 f32 depthBiasClamp
Jesse Halla9bb62b2015-11-21 19:31:56 -08002194 f32 depthBiasSlopeFactor
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002195 f32 lineWidth
Jesse Halld27f6aa2015-08-15 17:58:48 -07002196}
2197
2198class VkPipelineMultisampleStateCreateInfo {
2199 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO
2200 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002201 VkPipelineMultisampleStateCreateFlags flags
Jesse Hall091ed9e2015-11-30 00:55:29 -08002202 VkSampleCountFlagBits rasterizationSamples /// Number of samples used for rasterization
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002203 VkBool32 sampleShadingEnable /// optional (GL45)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002204 f32 minSampleShading /// optional (GL45)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002205 const VkSampleMask* pSampleMask
Jesse Hallacfa5342015-11-19 21:51:33 -08002206 VkBool32 alphaToCoverageEnable
2207 VkBool32 alphaToOneEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002208}
2209
2210class VkPipelineColorBlendAttachmentState {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002211 VkBool32 blendEnable
Jesse Hall65ab5522015-11-30 00:07:16 -08002212 VkBlendFactor srcColorBlendFactor
2213 VkBlendFactor dstColorBlendFactor
2214 VkBlendOp colorBlendOp
2215 VkBlendFactor srcAlphaBlendFactor
2216 VkBlendFactor dstAlphaBlendFactor
2217 VkBlendOp alphaBlendOp
2218 VkColorComponentFlags colorWriteMask
Jesse Halld27f6aa2015-08-15 17:58:48 -07002219}
2220
2221class VkPipelineColorBlendStateCreateInfo {
2222 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO
2223 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002224 VkPipelineColorBlendStateCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002225 VkBool32 logicOpEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002226 VkLogicOp logicOp
2227 u32 attachmentCount /// # of pAttachments
2228 const VkPipelineColorBlendAttachmentState* pAttachments
Jesse Hallb00daad2015-11-29 19:46:20 -08002229 f32[4] blendConstants
Jesse Halld27f6aa2015-08-15 17:58:48 -07002230}
2231
2232class VkStencilOpState {
Jesse Hall65ab5522015-11-30 00:07:16 -08002233 VkStencilOp failOp
2234 VkStencilOp passOp
2235 VkStencilOp depthFailOp
2236 VkCompareOp compareOp
2237 u32 compareMask
2238 u32 writeMask
2239 u32 reference
Jesse Halld27f6aa2015-08-15 17:58:48 -07002240}
2241
2242class VkPipelineDepthStencilStateCreateInfo {
2243 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_DEPTH_STENCIL_STATE_CREATE_INFO
2244 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002245 VkPipelineDepthStencilStateCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002246 VkBool32 depthTestEnable
2247 VkBool32 depthWriteEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002248 VkCompareOp depthCompareOp
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002249 VkBool32 depthBoundsTestEnable /// optional (depth_bounds_test)
2250 VkBool32 stencilTestEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002251 VkStencilOpState front
2252 VkStencilOpState back
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002253 f32 minDepthBounds
2254 f32 maxDepthBounds
2255}
2256
2257class VkPipelineDynamicStateCreateInfo {
2258 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO
2259 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002260 VkPipelineDynamicStateCreateFlags flags
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002261 u32 dynamicStateCount
2262 const VkDynamicState* pDynamicStates
Jesse Halld27f6aa2015-08-15 17:58:48 -07002263}
2264
2265class VkGraphicsPipelineCreateInfo {
Jesse Halla6429252015-11-29 18:59:42 -08002266 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO
2267 const void* pNext /// Pointer to next structure
2268 VkPipelineCreateFlags flags /// Pipeline creation flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002269 u32 stageCount
Jesse Halla6429252015-11-29 18:59:42 -08002270 const VkPipelineShaderStageCreateInfo* pStages /// One entry for each active shader stage
Jesse Halld27f6aa2015-08-15 17:58:48 -07002271 const VkPipelineVertexInputStateCreateInfo* pVertexInputState
2272 const VkPipelineInputAssemblyStateCreateInfo* pInputAssemblyState
2273 const VkPipelineTessellationStateCreateInfo* pTessellationState
2274 const VkPipelineViewportStateCreateInfo* pViewportState
Jesse Hall3fbc8562015-11-29 22:10:52 -08002275 const VkPipelineRasterizationStateCreateInfo* pRasterizationState
Jesse Halld27f6aa2015-08-15 17:58:48 -07002276 const VkPipelineMultisampleStateCreateInfo* pMultisampleState
2277 const VkPipelineDepthStencilStateCreateInfo* pDepthStencilState
2278 const VkPipelineColorBlendStateCreateInfo* pColorBlendState
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002279 const VkPipelineDynamicStateCreateInfo* pDynamicState
Jesse Halla6429252015-11-29 18:59:42 -08002280 VkPipelineLayout layout /// Interface layout of the pipeline
Jesse Halld27f6aa2015-08-15 17:58:48 -07002281 VkRenderPass renderPass
2282 u32 subpass
Jesse Halla6429252015-11-29 18:59:42 -08002283 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
2284 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 -07002285}
2286
2287class VkPipelineCacheCreateInfo {
Jesse Hallb00daad2015-11-29 19:46:20 -08002288 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO
2289 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002290 VkPipelineCacheCreateFlags flags
Jesse Hallb00daad2015-11-29 19:46:20 -08002291 platform.size_t initialDataSize /// Size of initial data to populate cache, in bytes
2292 const void* pInitialData /// Initial data to populate cache
Jesse Halld27f6aa2015-08-15 17:58:48 -07002293}
2294
2295class VkPushConstantRange {
2296 VkShaderStageFlags stageFlags /// Which stages use the range
Jesse Hall03b6fe12015-11-24 12:44:21 -08002297 u32 offset /// Start of the range, in bytes
2298 u32 size /// Length of the range, in bytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07002299}
2300
2301class VkPipelineLayoutCreateInfo {
2302 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO
2303 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002304 VkPipelineLayoutCreateFlags flags
Jesse Hall3dd678a2016-01-08 21:52:01 -08002305 u32 descriptorSetCount /// Number of descriptor sets interfaced by the pipeline
Jesse Halld27f6aa2015-08-15 17:58:48 -07002306 const VkDescriptorSetLayout* pSetLayouts /// Array of <setCount> number of descriptor set layout objects defining the layout of the
2307 u32 pushConstantRangeCount /// Number of push-constant ranges used by the pipeline
2308 const VkPushConstantRange* pPushConstantRanges /// Array of pushConstantRangeCount number of ranges used by various shader stages
2309}
2310
2311class VkSamplerCreateInfo {
2312 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO
2313 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002314 VkSamplerCreateFlags flags
Jesse Hall23ff73f2015-11-29 14:36:39 -08002315 VkFilter magFilter /// Filter mode for magnification
2316 VkFilter minFilter /// Filter mode for minifiation
2317 VkSamplerMipmapMode mipmapMode /// Mipmap selection mode
2318 VkSamplerAddressMode addressModeU
2319 VkSamplerAddressMode addressModeV
2320 VkSamplerAddressMode addressModeW
Jesse Halld27f6aa2015-08-15 17:58:48 -07002321 f32 mipLodBias
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002322 VkBool32 anisotropyEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002323 f32 maxAnisotropy
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002324 VkBool32 compareEnable
Jesse Halld27f6aa2015-08-15 17:58:48 -07002325 VkCompareOp compareOp
2326 f32 minLod
2327 f32 maxLod
2328 VkBorderColor borderColor
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002329 VkBool32 unnormalizedCoordinates
Jesse Halld27f6aa2015-08-15 17:58:48 -07002330}
2331
Jesse Hall3fbc8562015-11-29 22:10:52 -08002332class VkCommandPoolCreateInfo {
2333 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002334 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08002335 VkCommandPoolCreateFlags flags /// Command pool creation flags
Jesse Halla6429252015-11-29 18:59:42 -08002336 u32 queueFamilyIndex
Jesse Halld27f6aa2015-08-15 17:58:48 -07002337}
2338
Jesse Hall3fbc8562015-11-29 22:10:52 -08002339class VkCommandBufferAllocateInfo {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002340 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002341 const void* pNext /// Pointer to next structure
Jesse Hall3fbc8562015-11-29 22:10:52 -08002342 VkCommandPool commandPool
2343 VkCommandBufferLevel level
Jesse Hall3dd678a2016-01-08 21:52:01 -08002344 u32 commandBufferCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002345}
2346
Jesse Hall3dd678a2016-01-08 21:52:01 -08002347class VkCommandBufferInheritanceInfo {
2348 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_INFO
Jesse Halld27f6aa2015-08-15 17:58:48 -07002349 const void* pNext /// Pointer to next structure
Jesse Halld27f6aa2015-08-15 17:58:48 -07002350 VkRenderPass renderPass /// Render pass for secondary command buffers
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002351 u32 subpass
Jesse Halld27f6aa2015-08-15 17:58:48 -07002352 VkFramebuffer framebuffer /// Framebuffer for secondary command buffers
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002353 VkBool32 occlusionQueryEnable
2354 VkQueryControlFlags queryFlags
2355 VkQueryPipelineStatisticFlags pipelineStatistics
Jesse Halld27f6aa2015-08-15 17:58:48 -07002356}
2357
Jesse Hall3dd678a2016-01-08 21:52:01 -08002358class VkCommandBufferBeginInfo {
2359 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO
2360 const void* pNext /// Pointer to next structure
2361 VkCommandBufferUsageFlags flags /// Command buffer usage flags
2362 const VkCommandBufferInheritanceInfo* pInheritanceInfo
2363}
2364
Jesse Halld27f6aa2015-08-15 17:58:48 -07002365class VkRenderPassBeginInfo {
2366 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO
2367 const void* pNext /// Pointer to next structure
2368 VkRenderPass renderPass
2369 VkFramebuffer framebuffer
2370 VkRect2D renderArea
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002371 u32 clearValueCount
2372 const VkClearValue* pClearValues
Jesse Halld27f6aa2015-08-15 17:58:48 -07002373}
2374
2375@union
2376/// Union allowing specification of floating point, integer, or unsigned integer color data. Actual value selected is based on image/attachment being cleared.
2377class VkClearColorValue {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002378 f32[4] float32
2379 s32[4] int32
2380 u32[4] uint32
Jesse Halld27f6aa2015-08-15 17:58:48 -07002381}
2382
2383class VkClearDepthStencilValue {
2384 f32 depth
2385 u32 stencil
2386}
2387
2388@union
2389/// Union allowing specification of color, depth, and stencil color values. Actual value selected is based on attachment being cleared.
2390class VkClearValue {
2391 VkClearColorValue color
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002392 VkClearDepthStencilValue depthStencil
Jesse Halld27f6aa2015-08-15 17:58:48 -07002393}
2394
Jesse Hallae38f732015-11-19 21:32:50 -08002395class VkClearAttachment {
2396 VkImageAspectFlags aspectMask
2397 u32 colorAttachment
2398 VkClearValue clearValue
2399}
2400
Jesse Halld27f6aa2015-08-15 17:58:48 -07002401class VkAttachmentDescription {
Jesse Halla6429252015-11-29 18:59:42 -08002402 VkAttachmentDescriptionFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002403 VkFormat format
Jesse Hall091ed9e2015-11-30 00:55:29 -08002404 VkSampleCountFlagBits samples
Jesse Halld27f6aa2015-08-15 17:58:48 -07002405 VkAttachmentLoadOp loadOp /// Load op for color or depth data
2406 VkAttachmentStoreOp storeOp /// Store op for color or depth data
2407 VkAttachmentLoadOp stencilLoadOp /// Load op for stencil data
2408 VkAttachmentStoreOp stencilStoreOp /// Store op for stencil data
2409 VkImageLayout initialLayout
2410 VkImageLayout finalLayout
2411}
2412
2413class VkAttachmentReference {
2414 u32 attachment
2415 VkImageLayout layout
2416}
2417
2418class VkSubpassDescription {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002419 VkSubpassDescriptionFlags flags
Jesse Halla6429252015-11-29 18:59:42 -08002420 VkPipelineBindPoint pipelineBindPoint /// Must be VK_PIPELINE_BIND_POINT_GRAPHICS for now
Jesse Hall03b6fe12015-11-24 12:44:21 -08002421 u32 inputAttachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002422 const VkAttachmentReference* pInputAttachments
Jesse Hall03b6fe12015-11-24 12:44:21 -08002423 u32 colorAttachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002424 const VkAttachmentReference* pColorAttachments
2425 const VkAttachmentReference* pResolveAttachments
Jesse Hallc7467b72015-11-29 21:05:26 -08002426 const VkAttachmentReference* pDepthStencilAttachment
Jesse Hall03b6fe12015-11-24 12:44:21 -08002427 u32 preserveAttachmentCount
Jesse Hall3dd678a2016-01-08 21:52:01 -08002428 const u32* pPreserveAttachments
Jesse Halld27f6aa2015-08-15 17:58:48 -07002429}
2430
2431class VkSubpassDependency {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002432 u32 srcSubpass
Jesse Hall3fbc8562015-11-29 22:10:52 -08002433 u32 dstSubpass
Jesse Halld27f6aa2015-08-15 17:58:48 -07002434 VkPipelineStageFlags srcStageMask
Jesse Hall3fbc8562015-11-29 22:10:52 -08002435 VkPipelineStageFlags dstStageMask
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002436 VkAccessFlags srcAccessMask
2437 VkAccessFlags dstAccessMask
Jesse Halldc6d36c2015-11-29 19:12:15 -08002438 VkDependencyFlags dependencyFlags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002439}
2440
2441class VkRenderPassCreateInfo {
2442 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO
2443 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002444 VkRenderPassCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002445 u32 attachmentCount
2446 const VkAttachmentDescription* pAttachments
2447 u32 subpassCount
2448 const VkSubpassDescription* pSubpasses
2449 u32 dependencyCount
2450 const VkSubpassDependency* pDependencies
2451}
2452
2453class VkEventCreateInfo {
2454 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_EVENT_CREATE_INFO
2455 const void* pNext /// Pointer to next structure
2456 VkEventCreateFlags flags /// Event creation flags
2457}
2458
2459class VkFenceCreateInfo {
2460 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_FENCE_CREATE_INFO
2461 const void* pNext /// Pointer to next structure
2462 VkFenceCreateFlags flags /// Fence creation flags
2463}
2464
2465class VkPhysicalDeviceFeatures {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002466 VkBool32 robustBufferAccess /// out of bounds buffer accesses are well defined
2467 VkBool32 fullDrawIndexUint32 /// full 32-bit range of indices for indexed draw calls
2468 VkBool32 imageCubeArray /// image views which are arrays of cube maps
2469 VkBool32 independentBlend /// blending operations are controlled per-attachment
2470 VkBool32 geometryShader /// geometry stage
2471 VkBool32 tessellationShader /// tessellation control and evaluation stage
2472 VkBool32 sampleRateShading /// per-sample shading and interpolation
Jesse Hall3fbc8562015-11-29 22:10:52 -08002473 VkBool32 dualSrcBlend /// blend operations which take two sources
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002474 VkBool32 logicOp /// logic operations
2475 VkBool32 multiDrawIndirect /// multi draw indirect
Jesse Hall543a7ff2016-01-08 16:38:30 -08002476 VkBool32 drawIndirectFirstInstance
Jesse Hallae38f732015-11-19 21:32:50 -08002477 VkBool32 depthClamp /// depth clamping
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002478 VkBool32 depthBiasClamp /// depth bias clamping
2479 VkBool32 fillModeNonSolid /// point and wireframe fill modes
2480 VkBool32 depthBounds /// depth bounds test
2481 VkBool32 wideLines /// lines with width greater than 1
2482 VkBool32 largePoints /// points with size greater than 1
Jesse Hallfbf97b02015-11-20 14:17:03 -08002483 VkBool32 alphaToOne /// The fragment alpha channel can be forced to maximum representable alpha value
2484 VkBool32 multiViewport
2485 VkBool32 samplerAnisotropy
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002486 VkBool32 textureCompressionETC2 /// ETC texture compression formats
2487 VkBool32 textureCompressionASTC_LDR /// ASTC LDR texture compression formats
2488 VkBool32 textureCompressionBC /// BC1-7 texture compressed formats
Jesse Hall65ab5522015-11-30 00:07:16 -08002489 VkBool32 occlusionQueryPrecise
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002490 VkBool32 pipelineStatisticsQuery /// pipeline statistics query
Jesse Halldc6d36c2015-11-29 19:12:15 -08002491 VkBool32 vertexPipelineStoresAndAtomics
2492 VkBool32 fragmentStoresAndAtomics
2493 VkBool32 shaderTessellationAndGeometryPointSize
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002494 VkBool32 shaderImageGatherExtended /// texture gather with run-time values and independent offsets
2495 VkBool32 shaderStorageImageExtendedFormats /// the extended set of formats can be used for storage images
2496 VkBool32 shaderStorageImageMultisample /// multisample images can be used for storage images
Jesse Halld1af8122015-11-29 23:50:38 -08002497 VkBool32 shaderStorageImageReadWithoutFormat
2498 VkBool32 shaderStorageImageWriteWithoutFormat
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002499 VkBool32 shaderUniformBufferArrayDynamicIndexing /// arrays of uniform buffers can be accessed with dynamically uniform indices
2500 VkBool32 shaderSampledImageArrayDynamicIndexing /// arrays of sampled images can be accessed with dynamically uniform indices
2501 VkBool32 shaderStorageBufferArrayDynamicIndexing /// arrays of storage buffers can be accessed with dynamically uniform indices
2502 VkBool32 shaderStorageImageArrayDynamicIndexing /// arrays of storage images can be accessed with dynamically uniform indices
2503 VkBool32 shaderClipDistance /// clip distance in shaders
2504 VkBool32 shaderCullDistance /// cull distance in shaders
2505 VkBool32 shaderFloat64 /// 64-bit floats (doubles) in shaders
2506 VkBool32 shaderInt64 /// 64-bit integers in shaders
2507 VkBool32 shaderInt16 /// 16-bit integers in shaders
2508 VkBool32 shaderResourceResidency /// shader can use texture operations that return resource residency information (requires sparseNonResident support)
Jesse Hall65ab5522015-11-30 00:07:16 -08002509 VkBool32 shaderResourceMinLod /// shader can use texture operations that specify minimum resource LOD
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002510 VkBool32 sparseBinding /// Sparse resources support: Resource memory can be managed at opaque page level rather than object level
2511 VkBool32 sparseResidencyBuffer /// Sparse resources support: GPU can access partially resident buffers
2512 VkBool32 sparseResidencyImage2D /// Sparse resources support: GPU can access partially resident 2D (non-MSAA non-DepthStencil) images
2513 VkBool32 sparseResidencyImage3D /// Sparse resources support: GPU can access partially resident 3D images
2514 VkBool32 sparseResidency2Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 2 samples
2515 VkBool32 sparseResidency4Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 4 samples
2516 VkBool32 sparseResidency8Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 8 samples
2517 VkBool32 sparseResidency16Samples /// Sparse resources support: GPU can access partially resident MSAA 2D images with 16 samples
2518 VkBool32 sparseResidencyAliased /// Sparse resources support: GPU can correctly access data aliased into multiple locations (opt-in)
Jesse Halld1af8122015-11-29 23:50:38 -08002519 VkBool32 variableMultisampleRate
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002520 VkBool32 inheritedQueries
Jesse Halld27f6aa2015-08-15 17:58:48 -07002521}
2522
2523class VkPhysicalDeviceLimits {
2524 /// resource maximum sizes
2525 u32 maxImageDimension1D /// max 1D image dimension
2526 u32 maxImageDimension2D /// max 2D image dimension
2527 u32 maxImageDimension3D /// max 3D image dimension
2528 u32 maxImageDimensionCube /// max cubemap image dimension
2529 u32 maxImageArrayLayers /// max layers for image arrays
Jesse Hallb00daad2015-11-29 19:46:20 -08002530 u32 maxTexelBufferElements
Jesse Hallfbf97b02015-11-20 14:17:03 -08002531 u32 maxUniformBufferRange /// max uniform buffer size (bytes)
2532 u32 maxStorageBufferRange /// max storage buffer size (bytes)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002533 u32 maxPushConstantsSize /// max size of the push constants pool (bytes)
2534 /// memory limits
2535 u32 maxMemoryAllocationCount /// max number of device memory allocations supported
Jesse Hall091ed9e2015-11-30 00:55:29 -08002536 u32 maxSamplerAllocationCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002537 VkDeviceSize bufferImageGranularity /// Granularity (in bytes) at which buffers and images can be bound to adjacent memory for simultaneous usage
2538 VkDeviceSize sparseAddressSpaceSize /// Total address space available for sparse allocations (bytes)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002539 /// descriptor set limits
2540 u32 maxBoundDescriptorSets /// max number of descriptors sets that can be bound to a pipeline
Jesse Halld27f6aa2015-08-15 17:58:48 -07002541 u32 maxPerStageDescriptorSamplers /// max num of samplers allowed per-stage in a descriptor set
2542 u32 maxPerStageDescriptorUniformBuffers /// max num of uniform buffers allowed per-stage in a descriptor set
2543 u32 maxPerStageDescriptorStorageBuffers /// max num of storage buffers allowed per-stage in a descriptor set
2544 u32 maxPerStageDescriptorSampledImages /// max num of sampled images allowed per-stage in a descriptor set
2545 u32 maxPerStageDescriptorStorageImages /// max num of storage images allowed per-stage in a descriptor set
Jesse Halle1b12782015-11-30 11:27:32 -08002546 u32 maxPerStageDescriptorInputAttachments
Jesse Halldba27f72015-11-30 14:25:46 -08002547 u32 maxPerStageResources
Jesse Halld27f6aa2015-08-15 17:58:48 -07002548 u32 maxDescriptorSetSamplers /// max num of samplers allowed in all stages in a descriptor set
2549 u32 maxDescriptorSetUniformBuffers /// max num of uniform buffers allowed in all stages in a descriptor set
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002550 u32 maxDescriptorSetUniformBuffersDynamic /// max num of dynamic uniform buffers allowed in all stages in a descriptor set
Jesse Halld27f6aa2015-08-15 17:58:48 -07002551 u32 maxDescriptorSetStorageBuffers /// max num of storage buffers allowed in all stages in a descriptor set
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002552 u32 maxDescriptorSetStorageBuffersDynamic /// max num of dynamic storage buffers allowed in all stages in a descriptor set
Jesse Halld27f6aa2015-08-15 17:58:48 -07002553 u32 maxDescriptorSetSampledImages /// max num of sampled images allowed in all stages in a descriptor set
2554 u32 maxDescriptorSetStorageImages /// max num of storage images allowed in all stages in a descriptor set
Jesse Halle1b12782015-11-30 11:27:32 -08002555 u32 maxDescriptorSetInputAttachments
Jesse Halld27f6aa2015-08-15 17:58:48 -07002556 /// vertex stage limits
2557 u32 maxVertexInputAttributes /// max num of vertex input attribute slots
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002558 u32 maxVertexInputBindings /// max num of vertex input binding slots
Jesse Halld27f6aa2015-08-15 17:58:48 -07002559 u32 maxVertexInputAttributeOffset /// max vertex input attribute offset added to vertex buffer offset
2560 u32 maxVertexInputBindingStride /// max vertex input binding stride
2561 u32 maxVertexOutputComponents /// max num of output components written by vertex shader
2562 /// tessellation control stage limits
Jesse Hall3fbc8562015-11-29 22:10:52 -08002563 u32 maxTessellationGenerationLevel /// max level supported by tess primitive generator
Jesse Hallae38f732015-11-19 21:32:50 -08002564 u32 maxTessellationPatchSize /// max patch size (vertices)
2565 u32 maxTessellationControlPerVertexInputComponents /// max num of input components per-vertex in TCS
2566 u32 maxTessellationControlPerVertexOutputComponents /// max num of output components per-vertex in TCS
2567 u32 maxTessellationControlPerPatchOutputComponents /// max num of output components per-patch in TCS
2568 u32 maxTessellationControlTotalOutputComponents /// max total num of per-vertex and per-patch output components in TCS
2569 u32 maxTessellationEvaluationInputComponents /// max num of input components per vertex in TES
2570 u32 maxTessellationEvaluationOutputComponents /// max num of output components per vertex in TES
Jesse Halld27f6aa2015-08-15 17:58:48 -07002571 /// geometry stage limits
2572 u32 maxGeometryShaderInvocations /// max invocation count supported in geometry shader
2573 u32 maxGeometryInputComponents /// max num of input components read in geometry stage
2574 u32 maxGeometryOutputComponents /// max num of output components written in geometry stage
2575 u32 maxGeometryOutputVertices /// max num of vertices that can be emitted in geometry stage
2576 u32 maxGeometryTotalOutputComponents /// max total num of components (all vertices) written in geometry stage
2577 /// fragment stage limits
2578 u32 maxFragmentInputComponents /// max num of input compontents read in fragment stage
Jesse Hallfbf97b02015-11-20 14:17:03 -08002579 u32 maxFragmentOutputAttachments /// max num of output attachments written in fragment stage
Jesse Hall3fbc8562015-11-29 22:10:52 -08002580 u32 maxFragmentDualSrcAttachments /// max num of output attachments written when using dual source blending
Jesse Halld27f6aa2015-08-15 17:58:48 -07002581 u32 maxFragmentCombinedOutputResources /// max total num of storage buffers, storage images and output buffers
2582 /// compute stage limits
2583 u32 maxComputeSharedMemorySize /// max total storage size of work group local storage (bytes)
2584 u32[3] maxComputeWorkGroupCount /// max num of compute work groups that may be dispatched by a single command (x,y,z)
2585 u32 maxComputeWorkGroupInvocations /// max total compute invocations in a single local work group
2586 u32[3] maxComputeWorkGroupSize /// max local size of a compute work group (x,y,z)
2587
2588 u32 subPixelPrecisionBits /// num bits of subpixel precision in screen x and y
2589 u32 subTexelPrecisionBits /// num bits of subtexel precision
2590 u32 mipmapPrecisionBits /// num bits of mipmap precision
2591
2592 u32 maxDrawIndexedIndexValue /// max index value for indexed draw calls (for 32-bit indices)
Jesse Halldba27f72015-11-30 14:25:46 -08002593 u32 maxDrawIndirectCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002594
2595 f32 maxSamplerLodBias /// max absolute sampler level of detail bias
2596 f32 maxSamplerAnisotropy /// max degree of sampler anisotropy
2597
2598 u32 maxViewports /// max number of active viewports
Jesse Halld27f6aa2015-08-15 17:58:48 -07002599 u32[2] maxViewportDimensions /// max viewport dimensions (x,y)
2600 f32[2] viewportBoundsRange /// viewport bounds range (min,max)
2601 u32 viewportSubPixelBits /// num bits of subpixel precision for viewport
2602
Jesse Halldc6d36c2015-11-29 19:12:15 -08002603 platform.size_t minMemoryMapAlignment /// min required alignment of pointers returned by MapMemory (bytes)
2604 VkDeviceSize minTexelBufferOffsetAlignment /// min required alignment for texel buffer offsets (bytes)
2605 VkDeviceSize minUniformBufferOffsetAlignment /// min required alignment for uniform buffer sizes and offsets (bytes)
2606 VkDeviceSize minStorageBufferOffsetAlignment /// min required alignment for storage buffer offsets (bytes)
Jesse Halld27f6aa2015-08-15 17:58:48 -07002607
Jesse Hallfbf97b02015-11-20 14:17:03 -08002608 s32 minTexelOffset /// min texel offset for OpTextureSampleOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07002609 u32 maxTexelOffset /// max texel offset for OpTextureSampleOffset
Jesse Hallfbf97b02015-11-20 14:17:03 -08002610 s32 minTexelGatherOffset /// min texel offset for OpTextureGatherOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07002611 u32 maxTexelGatherOffset /// max texel offset for OpTextureGatherOffset
2612 f32 minInterpolationOffset /// furthest negative offset for interpolateAtOffset
2613 f32 maxInterpolationOffset /// furthest positive offset for interpolateAtOffset
2614 u32 subPixelInterpolationOffsetBits /// num of subpixel bits for interpolateAtOffset
2615
2616 u32 maxFramebufferWidth /// max width for a framebuffer
2617 u32 maxFramebufferHeight /// max height for a framebuffer
2618 u32 maxFramebufferLayers /// max layer count for a layered framebuffer
Jesse Hall091ed9e2015-11-30 00:55:29 -08002619 VkSampleCountFlags framebufferColorSampleCounts
2620 VkSampleCountFlags framebufferDepthSampleCounts
2621 VkSampleCountFlags framebufferStencilSampleCounts
2622 VkSampleCountFlags framebufferNoAttachmentSampleCounts
Jesse Halld27f6aa2015-08-15 17:58:48 -07002623 u32 maxColorAttachments /// max num of framebuffer color attachments
2624
Jesse Hall091ed9e2015-11-30 00:55:29 -08002625 VkSampleCountFlags sampledImageColorSampleCounts
2626 VkSampleCountFlags sampledImageIntegerSampleCounts
2627 VkSampleCountFlags sampledImageDepthSampleCounts
2628 VkSampleCountFlags sampledImageStencilSampleCounts
2629 VkSampleCountFlags storageImageSampleCounts
Jesse Halld27f6aa2015-08-15 17:58:48 -07002630 u32 maxSampleMaskWords /// max num of sample mask words
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002631 VkBool32 timestampComputeAndGraphics
Jesse Halld27f6aa2015-08-15 17:58:48 -07002632
Jesse Halla9bb62b2015-11-21 19:31:56 -08002633 f32 timestampPeriod
Jesse Halld27f6aa2015-08-15 17:58:48 -07002634
2635 u32 maxClipDistances /// max number of clip distances
2636 u32 maxCullDistances /// max number of cull distances
2637 u32 maxCombinedClipAndCullDistances /// max combined number of user clipping
2638
Jesse Hallfbf97b02015-11-20 14:17:03 -08002639 u32 discreteQueuePriorities
2640
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002641 f32[2] pointSizeRange /// range (min,max) of supported point sizes
2642 f32[2] lineWidthRange /// range (min,max) of supported line widths
Jesse Halld27f6aa2015-08-15 17:58:48 -07002643 f32 pointSizeGranularity /// granularity of supported point sizes
2644 f32 lineWidthGranularity /// granularity of supported line widths
Jesse Hall03b6fe12015-11-24 12:44:21 -08002645 VkBool32 strictLines
Jesse Hall091ed9e2015-11-30 00:55:29 -08002646 VkBool32 standardSampleLocations
Jesse Halla9bb62b2015-11-21 19:31:56 -08002647
Jesse Hall65ab5522015-11-30 00:07:16 -08002648 VkDeviceSize optimalBufferCopyOffsetAlignment
2649 VkDeviceSize optimalBufferCopyRowPitchAlignment
Jesse Halldba27f72015-11-30 14:25:46 -08002650 VkDeviceSize nonCoherentAtomSize
Jesse Halld27f6aa2015-08-15 17:58:48 -07002651}
2652
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002653class VkPhysicalDeviceSparseProperties {
2654 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 -08002655 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 -07002656 VkBool32 residencyStandard3DBlockShape /// Sparse resources support: GPU will access all 3D sparse resources using the standard block shapes (based on pixel format)
2657 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 -07002658 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
2659}
2660
Jesse Halld27f6aa2015-08-15 17:58:48 -07002661class VkSemaphoreCreateInfo {
2662 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO
2663 const void* pNext /// Pointer to next structure
2664 VkSemaphoreCreateFlags flags /// Semaphore creation flags
2665}
2666
2667class VkQueryPoolCreateInfo {
2668 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO
2669 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002670 VkQueryPoolCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002671 VkQueryType queryType
Jesse Hall3dd678a2016-01-08 21:52:01 -08002672 u32 queryCount
Jesse Halld27f6aa2015-08-15 17:58:48 -07002673 VkQueryPipelineStatisticFlags pipelineStatistics /// Optional
2674}
2675
2676class VkFramebufferCreateInfo {
2677 VkStructureType sType /// Must be VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO
2678 const void* pNext /// Pointer to next structure
Jesse Halla6429252015-11-29 18:59:42 -08002679 VkFramebufferCreateFlags flags
Jesse Halld27f6aa2015-08-15 17:58:48 -07002680 VkRenderPass renderPass
2681 u32 attachmentCount
Jesse Hall5ae3abb2015-10-08 14:00:22 -07002682 const VkImageView* pAttachments
Jesse Halld27f6aa2015-08-15 17:58:48 -07002683 u32 width
2684 u32 height
2685 u32 layers
2686}
2687
Jesse Hall3fbc8562015-11-29 22:10:52 -08002688class VkDrawIndirectCommand {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002689 u32 vertexCount
2690 u32 instanceCount
2691 u32 firstVertex
2692 u32 firstInstance
2693}
2694
Jesse Hall3fbc8562015-11-29 22:10:52 -08002695class VkDrawIndexedIndirectCommand {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002696 u32 indexCount
2697 u32 instanceCount
2698 u32 firstIndex
2699 s32 vertexOffset
2700 u32 firstInstance
2701}
2702
Jesse Hall3fbc8562015-11-29 22:10:52 -08002703class VkDispatchIndirectCommand {
Jesse Halld27f6aa2015-08-15 17:58:48 -07002704 u32 x
2705 u32 y
2706 u32 z
2707}
2708
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002709@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08002710class VkSurfaceCapabilitiesKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002711 u32 minImageCount
2712 u32 maxImageCount
2713 VkExtent2D currentExtent
2714 VkExtent2D minImageExtent
2715 VkExtent2D maxImageExtent
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002716 u32 maxImageArrayLayers
Jesse Hall1356b0d2015-11-23 17:24:58 -08002717 VkSurfaceTransformFlagsKHR supportedTransforms
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002718 VkSurfaceTransformFlagBitsKHR currentTransform
Jesse Halla6429252015-11-29 18:59:42 -08002719 VkCompositeAlphaFlagsKHR supportedCompositeAlpha
Jesse Hall1356b0d2015-11-23 17:24:58 -08002720 VkImageUsageFlags supportedUsageFlags
Michael Lentine88594d72015-11-12 12:49:45 -08002721}
2722
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002723@extension("VK_KHR_surface")
Michael Lentine88594d72015-11-12 12:49:45 -08002724class VkSurfaceFormatKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002725 VkFormat format
2726 VkColorSpaceKHR colorSpace
Michael Lentine88594d72015-11-12 12:49:45 -08002727}
2728
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002729@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08002730class VkSwapchainCreateInfoKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002731 VkStructureType sType
2732 const void* pNext
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002733 VkSwapchainCreateFlagsKHR flags
Jesse Hall1356b0d2015-11-23 17:24:58 -08002734 VkSurfaceKHR surface
2735 u32 minImageCount
2736 VkFormat imageFormat
2737 VkColorSpaceKHR imageColorSpace
2738 VkExtent2D imageExtent
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002739 u32 imageArrayLayers
2740 VkImageUsageFlags imageUsage
Jesse Hall1356b0d2015-11-23 17:24:58 -08002741 VkSharingMode sharingMode
Jesse Hall03b6fe12015-11-24 12:44:21 -08002742 u32 queueFamilyIndexCount
Jesse Hall1356b0d2015-11-23 17:24:58 -08002743 const u32* pQueueFamilyIndices
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002744 VkSurfaceTransformFlagBitsKHR preTransform
2745 VkCompositeAlphaFlagBitsKHR compositeAlpha
Jesse Hall1356b0d2015-11-23 17:24:58 -08002746 VkPresentModeKHR presentMode
Jesse Hall1356b0d2015-11-23 17:24:58 -08002747 VkBool32 clipped
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002748 VkSwapchainKHR oldSwapchain
Michael Lentine88594d72015-11-12 12:49:45 -08002749}
2750
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002751@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08002752class VkPresentInfoKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002753 VkStructureType sType
2754 const void* pNext
Jesse Hallb00daad2015-11-29 19:46:20 -08002755 u32 waitSemaphoreCount
2756 const VkSemaphore* pWaitSemaphores
Jesse Hall1356b0d2015-11-23 17:24:58 -08002757 u32 swapchainCount
Jesse Hall03b6fe12015-11-24 12:44:21 -08002758 const VkSwapchainKHR* pSwapchains
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002759 const u32* pImageIndices
Jesse Halle1b12782015-11-30 11:27:32 -08002760 VkResult* pResults
Michael Lentine88594d72015-11-12 12:49:45 -08002761}
2762
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002763@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002764class VkDisplayPropertiesKHR {
2765 VkDisplayKHR display
2766 const char* displayName
2767 VkExtent2D physicalDimensions
2768 VkExtent2D physicalResolution
2769 VkSurfaceTransformFlagsKHR supportedTransforms
Jesse Hall1356b0d2015-11-23 17:24:58 -08002770 VkBool32 planeReorderPossible
Jesse Halla6429252015-11-29 18:59:42 -08002771 VkBool32 persistentContent
Michael Lentine88594d72015-11-12 12:49:45 -08002772}
2773
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002774@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08002775class VkDisplayModeParametersKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002776 VkExtent2D visibleRegion
Jesse Halla6429252015-11-29 18:59:42 -08002777 u32 refreshRate
Michael Lentine88594d72015-11-12 12:49:45 -08002778}
Jesse Halld27f6aa2015-08-15 17:58:48 -07002779
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002780@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002781class VkDisplayModePropertiesKHR {
2782 VkDisplayModeKHR displayMode
Jesse Halla6429252015-11-29 18:59:42 -08002783 VkDisplayModeParametersKHR parameters
Jesse Hall1356b0d2015-11-23 17:24:58 -08002784}
2785
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002786@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002787class VkDisplayModeCreateInfoKHR {
2788 VkStructureType sType
2789 const void* pNext
Jesse Hall9ba8bc82015-11-30 16:22:16 -08002790 VkDisplayModeCreateFlagsKHR flags
Jesse Halla6429252015-11-29 18:59:42 -08002791 VkDisplayModeParametersKHR parameters
Jesse Hall1356b0d2015-11-23 17:24:58 -08002792}
2793
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002794@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002795class VkDisplayPlanePropertiesKHR {
Jesse Halla6429252015-11-29 18:59:42 -08002796 VkDisplayKHR currentDisplay
2797 u32 currentStackIndex
2798}
2799
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002800@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08002801class VkDisplayPlaneCapabilitiesKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002802 VkDisplayPlaneAlphaFlagsKHR supportedAlpha
2803 VkOffset2D minSrcPosition
2804 VkOffset2D maxSrcPosition
2805 VkExtent2D minSrcExtent
2806 VkExtent2D maxSrcExtent
2807 VkOffset2D minDstPosition
2808 VkOffset2D maxDstPosition
2809 VkExtent2D minDstExtent
2810 VkExtent2D maxDstExtent
2811}
2812
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002813@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08002814class VkDisplaySurfaceCreateInfoKHR {
Jesse Hall1356b0d2015-11-23 17:24:58 -08002815 VkStructureType sType
2816 const void* pNext
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002817 VkDisplaySurfaceCreateFlagsKHR flags
Jesse Hall1356b0d2015-11-23 17:24:58 -08002818 VkDisplayModeKHR displayMode
2819 u32 planeIndex
2820 u32 planeStackIndex
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002821 VkSurfaceTransformFlagBitsKHR transform
Jesse Hall1356b0d2015-11-23 17:24:58 -08002822 f32 globalAlpha
Jesse Hallf4ab2b12015-11-30 16:04:55 -08002823 VkDisplayPlaneAlphaFlagBitsKHR alphaMode
2824 VkExtent2D imageExtent
Jesse Hall1356b0d2015-11-23 17:24:58 -08002825}
2826
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08002827@extension("VK_KHR_display_swapchain")
Jesse Hall1356b0d2015-11-23 17:24:58 -08002828class VkDisplayPresentInfoKHR {
2829 VkStructureType sType
2830 const void* pNext
2831 VkRect2D srcRect
2832 VkRect2D dstRect
Jesse Halla6429252015-11-29 18:59:42 -08002833 VkBool32 persistent
Jesse Hall1356b0d2015-11-23 17:24:58 -08002834}
2835
Jesse Hallf9fa9a52016-01-08 16:08:51 -08002836@extension("VK_KHR_xlib_surface")
2837class VkXlibSurfaceCreateInfoKHR {
2838 VkStructureType sType
2839 const void* pNext
2840 VkXlibSurfaceCreateFlagsKHR flags
2841 platform.Display* dpy
2842 platform.Window window
2843}
2844
2845@extension("VK_KHR_xcb_surface")
2846class VkXcbSurfaceCreateInfoKHR {
2847 VkStructureType sType
2848 const void* pNext
2849 VkXcbSurfaceCreateFlagsKHR flags
2850 platform.xcb_connection_t* connection
2851 platform.xcb_window_t window
2852}
2853
2854@extension("VK_KHR_wayland_surface")
2855class VkWaylandSurfaceCreateInfoKHR {
2856 VkStructureType sType
2857 const void* pNext
2858 VkWaylandSurfaceCreateFlagsKHR flags
2859 platform.wl_display* display
2860 platform.wl_surface* surface
2861}
2862
2863@extension("VK_KHR_mir_surface")
2864class VkMirSurfaceCreateInfoKHR {
2865 VkStructureType sType
2866 const void* pNext
2867 VkMirSurfaceCreateFlagsKHR flags
2868 platform.MirConnection* connection
2869 platform.MirSurface* mirSurface
2870}
2871
2872@extension("VK_KHR_android_surface")
2873class VkAndroidSurfaceCreateInfoKHR {
2874 VkStructureType sType
2875 const void* pNext
2876 VkAndroidSurfaceCreateFlagsKHR flags
2877 platform.ANativeWindow* window
2878}
2879
2880@extension("VK_KHR_win32_surface")
2881class VkWin32SurfaceCreateInfoKHR {
2882 VkStructureType sType
2883 const void* pNext
2884 VkWin32SurfaceCreateFlagsKHR flags
2885 platform.HINSTANCE hinstance
2886 platform.HWND hwnd
2887}
2888
Chia-I Wub262ddc2016-03-22 07:38:20 +08002889@extension("VK_ANDROID_native_buffer")
2890class VkNativeBufferANDROID {
2891 VkStructureType sType
2892 const void* pNext
2893 platform.buffer_handle_t handle
2894 int stride
2895 int format
2896 int usage
2897}
2898
Chris Forbes8e4438b2016-12-07 16:26:49 +13002899@extension("VK_ANDROID_native_buffer")
2900class VkSwapchainImageCreateInfoANDROID {
2901 VkStructureType sType
2902 const void* pNext
2903 VkSwapchainImageUsageFlagBitsANDROID flags
Chris Forbes48853712017-01-12 14:09:33 +13002904}
Ian Elliott4c8bb2a2016-12-29 11:07:26 -07002905
2906@extension("VK_GOOGLE_display_timing")
2907class VkRefreshCycleDurationGOOGLE {
Chris Forbes48853712017-01-12 14:09:33 +13002908 u64 minRefreshDuration
2909 u64 maxRefreshDuration
Ian Elliott4c8bb2a2016-12-29 11:07:26 -07002910}
2911
2912@extension("VK_GOOGLE_display_timing")
2913class VkPastPresentationTimingGOOGLE {
Chris Forbes48853712017-01-12 14:09:33 +13002914 u32 presentID
2915 u64 desiredPresentTime
2916 u64 actualPresentTime
2917 u64 earliestPresentTime
2918 u64 presentMargin
Ian Elliott4c8bb2a2016-12-29 11:07:26 -07002919}
2920
2921@extension("VK_GOOGLE_display_timing")
2922class VkPresentTimeGOOGLE {
Chris Forbes48853712017-01-12 14:09:33 +13002923 u32 presentID
2924 u64 desiredPresentTime
Ian Elliott4c8bb2a2016-12-29 11:07:26 -07002925}
2926
2927@extension("VK_GOOGLE_display_timing")
2928class VkPresentTimesInfoGOOGLE {
2929 VkStructureType sType
2930 const void* pNext
Chris Forbes48853712017-01-12 14:09:33 +13002931 u32 swapchainCount
Ian Elliott4c8bb2a2016-12-29 11:07:26 -07002932 const VkPresentTimeGOOGLE* pTimes
Chris Forbes8e4438b2016-12-07 16:26:49 +13002933}
2934
Jesse Hall715b86a2016-01-16 16:34:29 -08002935@extension("VK_EXT_debug_report")
2936class VkDebugReportCallbackCreateInfoEXT {
2937 VkStructureType sType
2938 const void* pNext
2939 VkDebugReportFlagsEXT flags
2940 PFN_vkDebugReportCallbackEXT pfnCallback
2941 void* pUserData
2942}
2943
Jesse Hall26763382016-05-20 07:13:52 -07002944@extension("VK_AMD_rasterization_order")
2945class VkPipelineRasterizationStateRasterizationOrderAMD {
2946 VkStructureType sType
2947 const void* pNext
2948 VkRasterizationOrderAMD rasterizationOrder
2949}
2950
2951@extension("VK_EXT_debug_marker")
2952class VkDebugMarkerObjectNameInfoEXT {
2953 VkStructureType sType
2954 const void* pNext
2955 VkDebugReportObjectTypeEXT objectType
2956 u64 object
2957 const char* pObjectName
2958}
2959
2960@extension("VK_EXT_debug_marker")
2961class VkDebugMarkerObjectTagInfoEXT {
2962 VkStructureType sType
2963 const void* pNext
2964 VkDebugReportObjectTypeEXT objectType
2965 u64 object
2966 u64 tagName
2967 platform.size_t tagSize
2968 const void* pTag
2969}
2970
2971@extension("VK_EXT_debug_marker")
2972class VkDebugMarkerMarkerInfoEXT {
2973 VkStructureType sType
2974 const void* pNext
2975 const char* pMarkerName
2976 f32[4] color
2977}
2978
Jesse Hall56d386a2016-07-26 15:20:40 -07002979@extension("VK_NV_dedicated_allocation")
2980class VkDedicatedAllocationImageCreateInfoNV {
2981 VkStructureType sType
2982 const void* pNext
2983 VkBool32 dedicatedAllocation
2984}
2985
2986@extension("VK_NV_dedicated_allocation")
2987class VkDedicatedAllocationBufferCreateInfoNV {
2988 VkStructureType sType
2989 const void* pNext
2990 VkBool32 dedicatedAllocation
2991}
2992
2993@extension("VK_NV_dedicated_allocation")
2994class VkDedicatedAllocationMemoryAllocateInfoNV {
2995 VkStructureType sType
2996 const void* pNext
2997 VkImage image
2998 VkBuffer buffer
2999}
3000
Chris Forbes1194ede2016-12-30 16:29:25 +13003001@extension("VK_KHR_get_physical_device_properties2")
3002class VkPhysicalDeviceFeatures2KHR {
3003 VkStructureType sType
3004 void* pNext
3005 VkPhysicalDeviceFeatures features
3006}
3007
3008@extension("VK_KHR_get_physical_device_properties2")
3009class VkPhysicalDeviceProperties2KHR {
3010 VkStructureType sType
3011 void* pNext
3012 VkPhysicalDeviceProperties properties
3013}
3014
3015@extension("VK_KHR_get_physical_device_properties2")
3016class VkFormatProperties2KHR {
3017 VkStructureType sType
3018 void* pNext
3019 VkFormatProperties formatProperties
3020}
3021
3022@extension("VK_KHR_get_physical_device_properties2")
3023class VkImageFormatProperties2KHR {
3024 VkStructureType sType
3025 void* pNext
3026 VkImageFormatProperties imageFormatProperties
3027}
3028
3029@extension("VK_KHR_get_physical_device_properties2")
3030class VkPhysicalDeviceImageFormatInfo2KHR {
3031 VkStructureType sType
3032 const void* pNext
3033 VkFormat format
3034 VkImageType type
3035 VkImageTiling tiling
3036 VkImageUsageFlags usage
3037 VkImageCreateFlags flags
3038}
3039
3040@extension("VK_KHR_get_physical_device_properties2")
3041class VkQueueFamilyProperties2KHR {
3042 VkStructureType sType
3043 void* pNext
3044 VkQueueFamilyProperties queueFamilyProperties
3045}
3046
3047@extension("VK_KHR_get_physical_device_properties2")
3048class VkPhysicalDeviceMemoryProperties2KHR {
3049 VkStructureType sType
3050 void* pNext
3051 VkPhysicalDeviceMemoryProperties memoryProperties
3052}
3053
3054@extension("VK_KHR_get_physical_device_properties2")
3055class VkSparseImageFormatProperties2KHR {
3056 VkStructureType sType
3057 void* pNext
3058 VkSparseImageFormatProperties properties
3059}
3060
3061@extension("VK_KHR_get_physical_device_properties2")
3062class VkPhysicalDeviceSparseImageFormatInfo2KHR {
3063 VkStructureType sType
3064 const void* pNext
3065 VkFormat format
3066 VkImageType type
3067 VkSampleCountFlagBits samples
3068 VkImageUsageFlags usage
3069 VkImageTiling tiling
3070}
3071
Chris Forbes289cb792016-12-30 15:03:55 +13003072@extension("VK_KHR_incremental_present")
3073class VkRectLayerKHR {
3074 VkOffset2D offset
3075 VkExtent2D extent
3076 u32 layer
3077}
3078
3079@extension("VK_KHR_incremental_present")
3080class VkPresentRegionKHR {
3081 u32 rectangleCount
3082 const VkRectLayerKHR* pRectangles
3083}
3084
3085@extension("VK_KHR_incremental_present")
3086class VkPresentRegionsKHR {
3087 VkStructureType sType
3088 const void* pNext
3089 u32 swapchainCount
3090 const VkPresentRegionKHR* pRegions
3091}
3092
3093@extension("VK_NV_external_memory_capabilities")
3094class VkExternalImageFormatPropertiesNV {
3095 VkImageFormatProperties imageFormatProperties
3096 VkExternalMemoryFeatureFlagsNV externalMemoryFeatures
3097 VkExternalMemoryHandleTypeFlagsNV exportFromImportedHandleTypes
3098 VkExternalMemoryHandleTypeFlagsNV compatibleHandleTypes
3099}
3100
3101@extension("VK_NV_external_memory")
3102class VkExternalMemoryImageCreateInfoNV {
3103 VkStructureType sType
3104 const void* pNext
3105 VkExternalMemoryHandleTypeFlagsNV handleTypes
3106}
3107
3108@extension("VK_NV_external_memory")
3109class VkExportMemoryAllocateInfoNV {
3110 VkStructureType sType
3111 const void* pNext
3112 VkExternalMemoryHandleTypeFlagsNV handleTypes
3113}
3114
3115@extension("VK_NV_external_memory_win32")
3116class VkImportMemoryWin32HandleInfoNV {
3117 VkStructureType sType
3118 const void* pNext
3119 VkExternalMemoryHandleTypeFlagsNV handleType
3120 platform.HANDLE handle
3121}
3122
3123@extension("VK_NV_external_memory_win32")
3124class VkExportMemoryWin32HandleInfoNV {
3125 VkStructureType sType
3126 const void* pNext
3127 const platform.SECURITY_ATTRIBUTES* pAttributes
3128 u32 dwAccess
3129}
3130
3131@extension("VK_NV_win32_keyed_mutex")
3132class VkWin32KeyedMutexAcquireReleaseInfoNV {
3133 VkStructureType sType
3134 const void* pNext
3135 u32 acquireCount
3136 const VkDeviceMemory* pAcquireSyncs
3137 const u64* pAcquireKeys
3138 const u32* pAcquireTimeoutMilliseconds
3139 u32 releaseCount
3140 const VkDeviceMemory* pReleaseSyncs
3141 const u64* pReleaseKeys
3142}
3143
3144@extension("VK_EXT_validation_flags")
3145class VkValidationFlagsEXT {
3146 VkStructureType sType
3147 const void* pNext
3148 u32 disabledValidationCheckCount
3149 VkValidationCheckEXT* pDisabledValidationChecks
3150}
3151
3152@extension("VK_NVX_device_generated_commands")
3153class VkDeviceGeneratedCommandsFeaturesNVX {
3154 VkStructureType sType
3155 const void* pNext
3156 VkBool32 computeBindingPointSupport
3157}
3158
3159@extension("VK_NVX_device_generated_commands")
3160class VkDeviceGeneratedCommandsLimitsNVX {
3161 VkStructureType sType
3162 const void* pNext
3163 u32 maxIndirectCommandsLayoutTokenCount
3164 u32 maxObjectEntryCounts
3165 u32 minSequenceCountBufferOffsetAlignment
3166 u32 minSequenceIndexBufferOffsetAlignment
3167 u32 minCommandsTokenBufferOffsetAlignment
3168}
3169
3170@extension("VK_NVX_device_generated_commands")
3171class VkIndirectCommandsTokenNVX {
3172 VkIndirectCommandsTokenTypeNVX tokenType
3173 VkBuffer buffer
3174 VkDeviceSize offset
3175}
3176
3177@extension("VK_NVX_device_generated_commands")
3178class VkIndirectCommandsLayoutTokenNVX {
3179 VkIndirectCommandsTokenTypeNVX tokenType
3180 u32 bindingUnit
3181 u32 dynamicCount
3182 u32 divisor
3183}
3184
3185@extension("VK_NVX_device_generated_commands")
3186class VkIndirectCommandsLayoutCreateInfoNVX {
3187 VkStructureType sType
3188 const void* pNext
3189 VkPipelineBindPoint pipelineBindPoint
3190 VkIndirectCommandsLayoutUsageFlagsNVX flags
3191 u32 tokenCount
3192 const VkIndirectCommandsLayoutTokenNVX* pTokens
3193}
3194
3195@extension("VK_NVX_device_generated_commands")
3196class VkCmdProcessCommandsInfoNVX {
3197 VkStructureType sType
3198 const void* pNext
3199 VkObjectTableNVX objectTable
3200 VkIndirectCommandsLayoutNVX indirectCommandsLayout
3201 u32 indirectCommandsTokenCount
3202 const VkIndirectCommandsTokenNVX* pIndirectCommandsTokens
3203 u32 maxSequencesCount
3204 VkCommandBuffer targetCommandBuffer
3205 VkBuffer sequencesCountBuffer
3206 VkDeviceSize sequencesCountOffset
3207 VkBuffer sequencesIndexBuffer
3208 VkDeviceSize sequencesIndexOffset
3209}
3210
3211@extension("VK_NVX_device_generated_commands")
3212class VkCmdReserveSpaceForCommandsInfoNVX {
3213 VkStructureType sType
3214 const void* pNext
3215 VkObjectTableNVX objectTable
3216 VkIndirectCommandsLayoutNVX indirectCommandsLayout
3217 u32 maxSequencesCount
3218}
3219
3220@extension("VK_NVX_device_generated_commands")
3221class VkObjectTableCreateInfoNVX {
3222 VkStructureType sType
3223 const void* pNext
3224 u32 objectCount
3225 const VkObjectEntryTypeNVX* pObjectEntryTypes
3226 const u32* pObjectEntryCounts
3227 const VkObjectEntryUsageFlagsNVX* pObjectEntryUsageFlags
3228 u32 maxUniformBuffersPerDescriptor
3229 u32 maxStorageBuffersPerDescriptor
3230 u32 maxStorageImagesPerDescriptor
3231 u32 maxSampledImagesPerDescriptor
3232 u32 maxPipelineLayouts
3233}
3234
3235@extension("VK_NVX_device_generated_commands")
3236class VkObjectTableEntryNVX {
3237 VkObjectEntryTypeNVX type
3238 VkObjectEntryUsageFlagsNVX flags
3239}
3240
3241@extension("VK_NVX_device_generated_commands")
3242class VkObjectTablePipelineEntryNVX {
3243 VkObjectEntryTypeNVX type
3244 VkObjectEntryUsageFlagsNVX flags
3245 VkPipeline pipeline
3246}
3247
3248@extension("VK_NVX_device_generated_commands")
3249class VkObjectTableDescriptorSetEntryNVX {
3250 VkObjectEntryTypeNVX type
3251 VkObjectEntryUsageFlagsNVX flags
3252 VkPipelineLayout pipelineLayout
3253 VkDescriptorSet descriptorSet
3254}
3255
3256@extension("VK_NVX_device_generated_commands")
3257class VkObjectTableVertexBufferEntryNVX {
3258 VkObjectEntryTypeNVX type
3259 VkObjectEntryUsageFlagsNVX flags
3260 VkBuffer buffer
3261}
3262
3263@extension("VK_NVX_device_generated_commands")
3264class VkObjectTableIndexBufferEntryNVX {
3265 VkObjectEntryTypeNVX type
3266 VkObjectEntryUsageFlagsNVX flags
3267 VkBuffer buffer
3268}
3269
3270@extension("VK_NVX_device_generated_commands")
3271class VkObjectTablePushConstantEntryNVX {
3272 VkObjectEntryTypeNVX type
3273 VkObjectEntryUsageFlagsNVX flags
3274 VkPipelineLayout pipelineLayout
3275 VkShaderStageFlags stageFlags
3276}
3277
3278
Jesse Hall1356b0d2015-11-23 17:24:58 -08003279
Jesse Halld27f6aa2015-08-15 17:58:48 -07003280////////////////
3281// Commands //
3282////////////////
3283
3284// Function pointers. TODO: add support for function pointers.
3285
3286@external type void* PFN_vkVoidFunction
3287@pfn cmd void vkVoidFunction() {
3288}
3289
Jesse Hall3fbc8562015-11-29 22:10:52 -08003290@external type void* PFN_vkAllocationFunction
3291@pfn cmd void* vkAllocationFunction(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003292 void* pUserData,
3293 platform.size_t size,
3294 platform.size_t alignment,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003295 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08003296 return ?
3297}
3298
Jesse Hall3fbc8562015-11-29 22:10:52 -08003299@external type void* PFN_vkReallocationFunction
3300@pfn cmd void* vkReallocationFunction(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003301 void* pUserData,
3302 void* pOriginal,
3303 platform.size_t size,
3304 platform.size_t alignment,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003305 VkSystemAllocationScope allocationScope) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003306 return ?
3307}
3308
3309@external type void* PFN_vkFreeFunction
3310@pfn cmd void vkFreeFunction(
3311 void* pUserData,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003312 void* pMemory) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003313}
3314
Jesse Hall3fbc8562015-11-29 22:10:52 -08003315@external type void* PFN_vkInternalAllocationNotification
3316@pfn cmd void vkInternalAllocationNotification(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003317 void* pUserData,
3318 platform.size_t size,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003319 VkInternalAllocationType allocationType,
3320 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08003321}
3322
3323@external type void* PFN_vkInternalFreeNotification
3324@pfn cmd void vkInternalFreeNotification(
3325 void* pUserData,
3326 platform.size_t size,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003327 VkInternalAllocationType allocationType,
3328 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08003329}
Jesse Halld27f6aa2015-08-15 17:58:48 -07003330
3331// Global functions
3332
3333@threadSafety("system")
3334cmd VkResult vkCreateInstance(
3335 const VkInstanceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003336 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003337 VkInstance* pInstance) {
3338 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO)
3339
3340 instance := ?
3341 pInstance[0] = instance
3342 State.Instances[instance] = new!InstanceObject()
3343
Jesse Hall3dd678a2016-01-08 21:52:01 -08003344 layers := pCreateInfo.ppEnabledLayerNames[0:pCreateInfo.enabledLayerCount]
3345 extensions := pCreateInfo.ppEnabledExtensionNames[0:pCreateInfo.enabledExtensionCount]
Jesse Halld27f6aa2015-08-15 17:58:48 -07003346
3347 return ?
3348}
3349
3350@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003351cmd void vkDestroyInstance(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003352 VkInstance instance,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003353 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003354 instanceObject := GetInstance(instance)
3355
3356 State.Instances[instance] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003357}
3358
3359@threadSafety("system")
3360cmd VkResult vkEnumeratePhysicalDevices(
3361 VkInstance instance,
3362 u32* pPhysicalDeviceCount,
3363 VkPhysicalDevice* pPhysicalDevices) {
3364 instanceObject := GetInstance(instance)
3365
3366 physicalDeviceCount := as!u32(?)
3367 pPhysicalDeviceCount[0] = physicalDeviceCount
3368 physicalDevices := pPhysicalDevices[0:physicalDeviceCount]
3369
3370 for i in (0 .. physicalDeviceCount) {
3371 physicalDevice := ?
3372 physicalDevices[i] = physicalDevice
3373 if !(physicalDevice in State.PhysicalDevices) {
3374 State.PhysicalDevices[physicalDevice] = new!PhysicalDeviceObject(instance: instance)
3375 }
3376 }
3377
3378 return ?
3379}
3380
3381cmd PFN_vkVoidFunction vkGetDeviceProcAddr(
3382 VkDevice device,
3383 const char* pName) {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003384 if device != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003385 device := GetDevice(device)
3386 }
3387
3388 return ?
3389}
3390
3391cmd PFN_vkVoidFunction vkGetInstanceProcAddr(
3392 VkInstance instance,
3393 const char* pName) {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003394 if instance != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003395 instanceObject := GetInstance(instance)
3396 }
3397
3398 return ?
3399}
3400
Jesse Hall606a54e2015-11-19 22:17:28 -08003401cmd void vkGetPhysicalDeviceProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003402 VkPhysicalDevice physicalDevice,
3403 VkPhysicalDeviceProperties* pProperties) {
3404 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3405
3406 properties := ?
3407 pProperties[0] = properties
Jesse Halld27f6aa2015-08-15 17:58:48 -07003408}
3409
Jesse Hall606a54e2015-11-19 22:17:28 -08003410cmd void vkGetPhysicalDeviceQueueFamilyProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003411 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003412 u32* pQueueFamilyPropertyCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003413 VkQueueFamilyProperties* pQueueFamilyProperties) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003414 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003415 // TODO: Figure out how to express fetch-count-or-properties
3416 // This version fails 'apic validate' with 'fence not allowed in
3417 // *semantic.Branch'. Other attempts have failed with the same or other
3418 // errors.
3419 // if pQueueFamilyProperties != null {
3420 // queuesProperties := pQueueFamilyProperties[0:pCount[0]]
3421 // for i in (0 .. pCount[0]) {
3422 // queueProperties := as!VkQueueFamilyProperties(?)
3423 // queuesProperties[i] = queueProperties
3424 // }
3425 // } else {
3426 // count := ?
3427 // pCount[0] = count
3428 // }
Jesse Halld27f6aa2015-08-15 17:58:48 -07003429}
3430
Jesse Hall606a54e2015-11-19 22:17:28 -08003431cmd void vkGetPhysicalDeviceMemoryProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003432 VkPhysicalDevice physicalDevice,
3433 VkPhysicalDeviceMemoryProperties* pMemoryProperties) {
3434 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3435
3436 memoryProperties := ?
3437 pMemoryProperties[0] = memoryProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07003438}
3439
Jesse Hall606a54e2015-11-19 22:17:28 -08003440cmd void vkGetPhysicalDeviceFeatures(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003441 VkPhysicalDevice physicalDevice,
3442 VkPhysicalDeviceFeatures* pFeatures) {
3443 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3444
3445 features := ?
3446 pFeatures[0] = features
Jesse Halld27f6aa2015-08-15 17:58:48 -07003447}
3448
Jesse Hall606a54e2015-11-19 22:17:28 -08003449cmd void vkGetPhysicalDeviceFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003450 VkPhysicalDevice physicalDevice,
3451 VkFormat format,
3452 VkFormatProperties* pFormatProperties) {
3453 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3454
3455 formatProperties := ?
3456 pFormatProperties[0] = formatProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07003457}
3458
Jesse Halla9e57032015-11-30 01:03:10 -08003459cmd VkResult vkGetPhysicalDeviceImageFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003460 VkPhysicalDevice physicalDevice,
3461 VkFormat format,
3462 VkImageType type,
3463 VkImageTiling tiling,
3464 VkImageUsageFlags usage,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003465 VkImageCreateFlags flags,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003466 VkImageFormatProperties* pImageFormatProperties) {
3467 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3468
3469 imageFormatProperties := ?
3470 pImageFormatProperties[0] = imageFormatProperties
Jesse Halla9e57032015-11-30 01:03:10 -08003471
3472 return ?
Jesse Halld27f6aa2015-08-15 17:58:48 -07003473}
3474
Jesse Halld27f6aa2015-08-15 17:58:48 -07003475
3476// Device functions
3477
3478@threadSafety("system")
3479cmd VkResult vkCreateDevice(
3480 VkPhysicalDevice physicalDevice,
3481 const VkDeviceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003482 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003483 VkDevice* pDevice) {
3484 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO)
3485 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3486
3487 device := ?
3488 pDevice[0] = device
3489 State.Devices[device] = new!DeviceObject(physicalDevice: physicalDevice)
3490
3491 return ?
3492}
3493
3494@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003495cmd void vkDestroyDevice(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003496 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003497 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003498 deviceObject := GetDevice(device)
3499
3500 State.Devices[device] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003501}
3502
3503
3504// Extension discovery functions
3505
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003506cmd VkResult vkEnumerateInstanceLayerProperties(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003507 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003508 VkLayerProperties* pProperties) {
3509 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08003510 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07003511
3512 properties := pProperties[0:count]
3513 for i in (0 .. count) {
3514 property := ?
3515 properties[i] = property
3516 }
3517
3518 return ?
3519}
3520
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003521cmd VkResult vkEnumerateInstanceExtensionProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003522 const char* pLayerName,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003523 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003524 VkExtensionProperties* pProperties) {
3525 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08003526 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07003527
3528 properties := pProperties[0:count]
3529 for i in (0 .. count) {
3530 property := ?
3531 properties[i] = property
3532 }
3533
3534 return ?
3535}
3536
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003537cmd VkResult vkEnumerateDeviceLayerProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003538 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003539 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003540 VkLayerProperties* pProperties) {
3541 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3542 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08003543 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07003544
3545 properties := pProperties[0:count]
3546 for i in (0 .. count) {
3547 property := ?
3548 properties[i] = property
3549 }
3550
3551 return ?
3552}
3553
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003554cmd VkResult vkEnumerateDeviceExtensionProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003555 VkPhysicalDevice physicalDevice,
3556 const char* pLayerName,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003557 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003558 VkExtensionProperties* pProperties) {
3559 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3560
3561 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08003562 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07003563
3564 properties := pProperties[0:count]
3565 for i in (0 .. count) {
3566 property := ?
3567 properties[i] = property
3568 }
3569
3570 return ?
3571}
3572
3573
3574// Queue functions
3575
3576@threadSafety("system")
Jesse Hall606a54e2015-11-19 22:17:28 -08003577cmd void vkGetDeviceQueue(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003578 VkDevice device,
3579 u32 queueFamilyIndex,
3580 u32 queueIndex,
3581 VkQueue* pQueue) {
3582 deviceObject := GetDevice(device)
3583
3584 queue := ?
3585 pQueue[0] = queue
3586
3587 if !(queue in State.Queues) {
3588 State.Queues[queue] = new!QueueObject(device: device)
3589 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07003590}
3591
3592@threadSafety("app")
3593cmd VkResult vkQueueSubmit(
3594 VkQueue queue,
Jesse Halla366a512015-11-19 22:30:07 -08003595 u32 submitCount,
Jesse Hallb00daad2015-11-29 19:46:20 -08003596 const VkSubmitInfo* pSubmits,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003597 VkFence fence) {
3598 queueObject := GetQueue(queue)
3599
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003600 if fence != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003601 fenceObject := GetFence(fence)
3602 assert(fenceObject.device == queueObject.device)
3603 }
3604
Jesse Hall3fbc8562015-11-29 22:10:52 -08003605 // commandBuffers := pcommandBuffers[0:commandBufferCount]
3606 // for i in (0 .. commandBufferCount) {
3607 // commandBuffer := commandBuffers[i]
3608 // commandBufferObject := GetCommandBuffer(commandBuffer)
3609 // assert(commandBufferObject.device == queueObject.device)
Jesse Halla366a512015-11-19 22:30:07 -08003610 //
Jesse Hall3fbc8562015-11-29 22:10:52 -08003611 // validate("QueueCheck", commandBufferObject.queueFlags in queueObject.flags,
3612 // "vkQueueSubmit: enqueued commandBuffer requires missing queue capabilities.")
Jesse Halla366a512015-11-19 22:30:07 -08003613 // }
Jesse Halld27f6aa2015-08-15 17:58:48 -07003614
3615 return ?
3616}
3617
3618@threadSafety("system")
3619cmd VkResult vkQueueWaitIdle(
3620 VkQueue queue) {
3621 queueObject := GetQueue(queue)
3622
3623 return ?
3624}
3625
3626@threadSafety("system")
3627cmd VkResult vkDeviceWaitIdle(
3628 VkDevice device) {
3629 deviceObject := GetDevice(device)
3630
3631 return ?
3632}
3633
3634
3635// Memory functions
3636
3637@threadSafety("system")
Jesse Hall3fbc8562015-11-29 22:10:52 -08003638cmd VkResult vkAllocateMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003639 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003640 const VkMemoryAllocateInfo* pAllocateInfo,
3641 const VkAllocationCallbacks* pAllocator,
3642 VkDeviceMemory* pMemory) {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08003643 assert(pAllocateInfo.sType == VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003644 deviceObject := GetDevice(device)
3645
Jesse Hall3fbc8562015-11-29 22:10:52 -08003646 memory := ?
3647 pMemory[0] = memory
3648 State.DeviceMemories[memory] = new!DeviceMemoryObject(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003649 device: device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003650 allocationSize: pAllocateInfo[0].allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003651
3652 return ?
3653}
3654
3655@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003656cmd void vkFreeMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003657 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003658 VkDeviceMemory memory,
3659 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003660 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003661 memoryObject := GetDeviceMemory(memory)
3662 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003663
3664 // Check that no objects are still bound before freeing.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003665 validate("MemoryCheck", len(memoryObject.boundObjects) == 0,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003666 "vkFreeMemory: objects still bound")
Jesse Hall3fbc8562015-11-29 22:10:52 -08003667 validate("MemoryCheck", len(memoryObject.boundCommandBuffers) == 0,
3668 "vkFreeMemory: commandBuffers still bound")
3669 State.DeviceMemories[memory] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003670}
3671
3672@threadSafety("app")
3673cmd VkResult vkMapMemory(
3674 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003675 VkDeviceMemory memory,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003676 VkDeviceSize offset,
3677 VkDeviceSize size,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003678 VkMemoryMapFlags flags,
3679 void** ppData) {
3680 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 assert(flags == as!VkMemoryMapFlags(0))
Jesse Hall3fbc8562015-11-29 22:10:52 -08003685 assert((offset + size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003686
3687 return ?
3688}
3689
3690@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003691cmd void vkUnmapMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003692 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003693 VkDeviceMemory memory) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003694 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003695 memoryObject := GetDeviceMemory(memory)
3696 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003697}
3698
3699cmd VkResult vkFlushMappedMemoryRanges(
3700 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003701 u32 memoryRangeCount
3702 const VkMappedMemoryRange* pMemoryRanges) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003703 deviceObject := GetDevice(device)
3704
Jesse Hall3fbc8562015-11-29 22:10:52 -08003705 memoryRanges := pMemoryRanges[0:memoryRangeCount]
3706 for i in (0 .. memoryRangeCount) {
3707 memoryRange := memoryRanges[i]
3708 memoryObject := GetDeviceMemory(memoryRange.memory)
3709 assert(memoryObject.device == device)
3710 assert((memoryRange.offset + memoryRange.size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003711 }
3712
3713 return ?
3714}
3715
3716cmd VkResult vkInvalidateMappedMemoryRanges(
3717 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003718 u32 memoryRangeCount,
3719 const VkMappedMemoryRange* pMemoryRanges) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003720 deviceObject := GetDevice(device)
3721
Jesse Hall3fbc8562015-11-29 22:10:52 -08003722 memoryRanges := pMemoryRanges[0:memoryRangeCount]
3723 for i in (0 .. memoryRangeCount) {
3724 memoryRange := memoryRanges[i]
3725 memoryObject := GetDeviceMemory(memoryRange.memory)
3726 assert(memoryObject.device == device)
3727 assert((memoryRange.offset + memoryRange.size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003728 }
3729
3730 return ?
3731}
3732
3733
3734// Memory management API functions
3735
Jesse Hall606a54e2015-11-19 22:17:28 -08003736cmd void vkGetDeviceMemoryCommitment(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003737 VkDevice device,
3738 VkDeviceMemory memory,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003739 VkDeviceSize* pCommittedMemoryInBytes) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003740 deviceObject := GetDevice(device)
3741
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003742 if memory != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003743 memoryObject := GetDeviceMemory(memory)
3744 assert(memoryObject.device == device)
3745 }
3746
3747 committedMemoryInBytes := ?
3748 pCommittedMemoryInBytes[0] = committedMemoryInBytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07003749}
3750
Jesse Hall606a54e2015-11-19 22:17:28 -08003751cmd void vkGetBufferMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003752 VkDevice device,
3753 VkBuffer buffer,
3754 VkMemoryRequirements* pMemoryRequirements) {
3755 deviceObject := GetDevice(device)
3756 bufferObject := GetBuffer(buffer)
3757 assert(bufferObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003758}
3759
3760cmd VkResult vkBindBufferMemory(
3761 VkDevice device,
3762 VkBuffer buffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003763 VkDeviceMemory memory,
3764 VkDeviceSize memoryOffset) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003765 deviceObject := GetDevice(device)
3766 bufferObject := GetBuffer(buffer)
3767 assert(bufferObject.device == device)
3768
3769 // Unbind buffer from previous memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003770 if bufferObject.memory != NULL_HANDLE {
3771 memoryObject := GetDeviceMemory(bufferObject.memory)
3772 memoryObject.boundObjects[as!u64(buffer)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003773 }
3774
3775 // Bind buffer to given memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003776 if memory != NULL_HANDLE {
3777 memoryObject := GetDeviceMemory(memory)
3778 assert(memoryObject.device == device)
3779 memoryObject.boundObjects[as!u64(buffer)] = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003780 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08003781 bufferObject.memory = memory
3782 bufferObject.memoryOffset = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003783
3784 return ?
3785}
3786
Jesse Hall606a54e2015-11-19 22:17:28 -08003787cmd void vkGetImageMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003788 VkDevice device,
3789 VkImage image,
3790 VkMemoryRequirements* pMemoryRequirements) {
3791 deviceObject := GetDevice(device)
3792 imageObject := GetImage(image)
3793 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003794}
3795
3796cmd VkResult vkBindImageMemory(
3797 VkDevice device,
3798 VkImage image,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003799 VkDeviceMemory memory,
3800 VkDeviceSize memoryOffset) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003801 deviceObject := GetDevice(device)
3802 imageObject := GetImage(image)
3803 assert(imageObject.device == device)
3804
3805 // Unbind image from previous memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003806 if imageObject.memory != NULL_HANDLE {
3807 memoryObject := GetDeviceMemory(imageObject.memory)
3808 memoryObject.boundObjects[as!u64(image)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003809 }
3810
3811 // Bind image to given memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003812 if memory != NULL_HANDLE {
3813 memoryObject := GetDeviceMemory(memory)
3814 assert(memoryObject.device == device)
3815 memoryObject.boundObjects[as!u64(image)] = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003816 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08003817 imageObject.memory = memory
3818 imageObject.memoryOffset = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003819
3820 return ?
3821}
3822
Jesse Hall606a54e2015-11-19 22:17:28 -08003823cmd void vkGetImageSparseMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003824 VkDevice device,
3825 VkImage image,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003826 u32* pSparseMemoryRequirementCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003827 VkSparseImageMemoryRequirements* pSparseMemoryRequirements) {
3828 deviceObject := GetDevice(device)
3829 imageObject := GetImage(image)
3830 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003831}
3832
Jesse Hall606a54e2015-11-19 22:17:28 -08003833cmd void vkGetPhysicalDeviceSparseImageFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003834 VkPhysicalDevice physicalDevice,
3835 VkFormat format,
3836 VkImageType type,
Jesse Hall091ed9e2015-11-30 00:55:29 -08003837 VkSampleCountFlagBits samples,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003838 VkImageUsageFlags usage,
3839 VkImageTiling tiling,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003840 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003841 VkSparseImageFormatProperties* pProperties) {
3842 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003843}
3844
Jesse Halla6429252015-11-29 18:59:42 -08003845cmd VkResult vkQueueBindSparse(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003846 VkQueue queue,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003847 u32 bindInfoCount,
Jesse Halla6429252015-11-29 18:59:42 -08003848 const VkBindSparseInfo* pBindInfo,
3849 VkFence fence) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003850 queueObject := GetQueue(queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003851
3852 return ?
3853}
3854
3855
3856// Fence functions
3857
3858@threadSafety("system")
3859cmd VkResult vkCreateFence(
3860 VkDevice device,
3861 const VkFenceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003862 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003863 VkFence* pFence) {
3864 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_FENCE_CREATE_INFO)
3865 deviceObject := GetDevice(device)
3866
3867 fence := ?
3868 pFence[0] = fence
3869 State.Fences[fence] = new!FenceObject(
Jesse Halld8bade02015-11-24 10:24:18 -08003870 device: device, signaled: (pCreateInfo.flags == as!VkFenceCreateFlags(VK_FENCE_CREATE_SIGNALED_BIT)))
Jesse Halld27f6aa2015-08-15 17:58:48 -07003871
3872 return ?
3873}
3874
3875@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003876cmd void vkDestroyFence(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003877 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003878 VkFence fence,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003879 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003880 deviceObject := GetDevice(device)
3881 fenceObject := GetFence(fence)
3882 assert(fenceObject.device == device)
3883
3884 State.Fences[fence] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003885}
3886
3887@threadSafety("system")
3888cmd VkResult vkResetFences(
3889 VkDevice device,
3890 u32 fenceCount,
3891 const VkFence* pFences) {
3892 deviceObject := GetDevice(device)
3893
3894 fences := pFences[0:fenceCount]
3895 for i in (0 .. fenceCount) {
3896 fence := fences[i]
3897 fenceObject := GetFence(fence)
3898 assert(fenceObject.device == device)
3899 fenceObject.signaled = false
3900 }
3901
3902 return ?
3903}
3904
3905@threadSafety("system")
3906cmd VkResult vkGetFenceStatus(
3907 VkDevice device,
3908 VkFence fence) {
3909 deviceObject := GetDevice(device)
3910 fenceObject := GetFence(fence)
3911 assert(fenceObject.device == device)
3912
3913 return ?
3914}
3915
3916@threadSafety("system")
3917cmd VkResult vkWaitForFences(
3918 VkDevice device,
3919 u32 fenceCount,
3920 const VkFence* pFences,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003921 VkBool32 waitAll,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003922 u64 timeout) { /// timeout in nanoseconds
3923 deviceObject := GetDevice(device)
3924
3925 fences := pFences[0:fenceCount]
3926 for i in (0 .. fenceCount) {
3927 fence := fences[i]
3928 fenceObject := GetFence(fence)
3929 assert(fenceObject.device == device)
3930 }
3931
3932 return ?
3933}
3934
3935
3936// Queue semaphore functions
3937
3938@threadSafety("system")
3939cmd VkResult vkCreateSemaphore(
3940 VkDevice device,
3941 const VkSemaphoreCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003942 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003943 VkSemaphore* pSemaphore) {
3944 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO)
3945 deviceObject := GetDevice(device)
3946
3947 semaphore := ?
3948 pSemaphore[0] = semaphore
3949 State.Semaphores[semaphore] = new!SemaphoreObject(device: device)
3950
3951 return ?
3952}
3953
3954@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003955cmd void vkDestroySemaphore(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003956 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003957 VkSemaphore semaphore,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003958 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003959 deviceObject := GetDevice(device)
3960 semaphoreObject := GetSemaphore(semaphore)
3961 assert(semaphoreObject.device == device)
3962
3963 State.Semaphores[semaphore] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003964}
3965
Jesse Halld27f6aa2015-08-15 17:58:48 -07003966
3967// Event functions
3968
3969@threadSafety("system")
3970cmd VkResult vkCreateEvent(
3971 VkDevice device,
3972 const VkEventCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003973 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003974 VkEvent* pEvent) {
3975 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_EVENT_CREATE_INFO)
3976 deviceObject := GetDevice(device)
3977
3978 event := ?
3979 pEvent[0] = event
3980 State.Events[event] = new!EventObject(device: device)
3981
3982 return ?
3983}
3984
3985@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003986cmd void vkDestroyEvent(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003987 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003988 VkEvent event,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003989 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003990 deviceObject := GetDevice(device)
3991 eventObject := GetEvent(event)
3992 assert(eventObject.device == device)
3993
3994 State.Events[event] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003995}
3996
3997@threadSafety("system")
3998cmd VkResult vkGetEventStatus(
3999 VkDevice device,
4000 VkEvent event) {
4001 deviceObject := GetDevice(device)
4002 eventObject := GetEvent(event)
4003 assert(eventObject.device == device)
4004
4005 return ?
4006}
4007
4008@threadSafety("system")
4009cmd VkResult vkSetEvent(
4010 VkDevice device,
4011 VkEvent event) {
4012 deviceObject := GetDevice(device)
4013 eventObject := GetEvent(event)
4014 assert(eventObject.device == device)
4015
4016 return ?
4017}
4018
4019@threadSafety("system")
4020cmd VkResult vkResetEvent(
4021 VkDevice device,
4022 VkEvent event) {
4023 deviceObject := GetDevice(device)
4024 eventObject := GetEvent(event)
4025 assert(eventObject.device == device)
4026
4027 return ?
4028}
4029
4030
4031// Query functions
4032
4033@threadSafety("system")
4034cmd VkResult vkCreateQueryPool(
4035 VkDevice device,
4036 const VkQueryPoolCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004037 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004038 VkQueryPool* pQueryPool) {
4039 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO)
4040 deviceObject := GetDevice(device)
4041
4042 queryPool := ?
4043 pQueryPool[0] = queryPool
4044 State.QueryPools[queryPool] = new!QueryPoolObject(device: device)
4045
4046 return ?
4047}
4048
4049@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004050cmd void vkDestroyQueryPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004051 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004052 VkQueryPool queryPool,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004053 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004054 deviceObject := GetDevice(device)
4055 queryPoolObject := GetQueryPool(queryPool)
4056 assert(queryPoolObject.device == device)
4057
4058 State.QueryPools[queryPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004059}
4060
4061@threadSafety("system")
4062cmd VkResult vkGetQueryPoolResults(
4063 VkDevice device,
4064 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004065 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004066 u32 queryCount,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004067 platform.size_t dataSize,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004068 void* pData,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004069 VkDeviceSize stride,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004070 VkQueryResultFlags flags) {
4071 deviceObject := GetDevice(device)
4072 queryPoolObject := GetQueryPool(queryPool)
4073 assert(queryPoolObject.device == device)
4074
Jesse Halld27f6aa2015-08-15 17:58:48 -07004075 data := pData[0:dataSize]
4076
4077 return ?
4078}
4079
4080// Buffer functions
4081
4082@threadSafety("system")
4083cmd VkResult vkCreateBuffer(
4084 VkDevice device,
4085 const VkBufferCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004086 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004087 VkBuffer* pBuffer) {
4088 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO)
4089 deviceObject := GetDevice(device)
4090
4091 buffer := ?
4092 pBuffer[0] = buffer
4093 State.Buffers[buffer] = new!BufferObject(device: device)
4094
4095 return ?
4096}
4097
4098@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004099cmd void vkDestroyBuffer(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004100 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004101 VkBuffer buffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004102 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004103 deviceObject := GetDevice(device)
4104 bufferObject := GetBuffer(buffer)
4105 assert(bufferObject.device == device)
4106
Jesse Hall3fbc8562015-11-29 22:10:52 -08004107 assert(bufferObject.memory == 0)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004108 State.Buffers[buffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004109}
4110
4111
4112// Buffer view functions
4113
4114@threadSafety("system")
4115cmd VkResult vkCreateBufferView(
4116 VkDevice device,
4117 const VkBufferViewCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004118 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004119 VkBufferView* pView) {
4120 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO)
4121 deviceObject := GetDevice(device)
4122
4123 bufferObject := GetBuffer(pCreateInfo.buffer)
4124 assert(bufferObject.device == device)
4125
4126 view := ?
4127 pView[0] = view
4128 State.BufferViews[view] = new!BufferViewObject(device: device, buffer: pCreateInfo.buffer)
4129
4130 return ?
4131}
4132
4133@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004134cmd void vkDestroyBufferView(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004135 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004136 VkBufferView bufferView,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004137 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004138 deviceObject := GetDevice(device)
4139 bufferViewObject := GetBufferView(bufferView)
4140 assert(bufferViewObject.device == device)
4141
4142 State.BufferViews[bufferView] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004143}
4144
4145
4146// Image functions
4147
4148@threadSafety("system")
4149cmd VkResult vkCreateImage(
4150 VkDevice device,
4151 const VkImageCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004152 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004153 VkImage* pImage) {
4154 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO)
4155 deviceObject := GetDevice(device)
4156
4157 image := ?
4158 pImage[0] = image
4159 State.Images[image] = new!ImageObject(device: device)
4160
4161 return ?
4162}
4163
4164@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004165cmd void vkDestroyImage(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004166 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004167 VkImage image,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004168 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004169 deviceObject := GetDevice(device)
4170 imageObject := GetImage(image)
4171 assert(imageObject.device == device)
4172
Jesse Hall3fbc8562015-11-29 22:10:52 -08004173 assert(imageObject.memory == 0)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004174 State.Images[image] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004175}
4176
Jesse Hall606a54e2015-11-19 22:17:28 -08004177cmd void vkGetImageSubresourceLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004178 VkDevice device,
4179 VkImage image,
4180 const VkImageSubresource* pSubresource,
4181 VkSubresourceLayout* pLayout) {
4182 deviceObject := GetDevice(device)
4183 imageObject := GetImage(image)
4184 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004185}
4186
4187
4188// Image view functions
4189
4190@threadSafety("system")
4191cmd VkResult vkCreateImageView(
4192 VkDevice device,
4193 const VkImageViewCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004194 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004195 VkImageView* pView) {
4196 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO)
4197 deviceObject := GetDevice(device)
4198
4199 imageObject := GetImage(pCreateInfo.image)
4200 assert(imageObject.device == device)
4201
4202 view := ?
4203 pView[0] = view
4204 State.ImageViews[view] = new!ImageViewObject(device: device, image: pCreateInfo.image)
4205
4206 return ?
4207}
4208
4209@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004210cmd void vkDestroyImageView(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004211 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004212 VkImageView imageView,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004213 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004214 deviceObject := GetDevice(device)
4215 imageViewObject := GetImageView(imageView)
4216 assert(imageViewObject.device == device)
4217
4218 State.ImageViews[imageView] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004219}
4220
4221
4222// Shader functions
4223
4224cmd VkResult vkCreateShaderModule(
4225 VkDevice device,
4226 const VkShaderModuleCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004227 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004228 VkShaderModule* pShaderModule) {
4229 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO)
4230 deviceObject := GetDevice(device)
4231
4232 shaderModule := ?
4233 pShaderModule[0] = shaderModule
4234 State.ShaderModules[shaderModule] = new!ShaderModuleObject(device: device)
4235
4236 return ?
4237}
4238
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004239cmd void vkDestroyShaderModule(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004240 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004241 VkShaderModule shaderModule,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004242 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004243 deviceObject := GetDevice(device)
4244 shaderModuleObject := GetShaderModule(shaderModule)
4245 assert(shaderModuleObject.device == device)
4246
4247 State.ShaderModules[shaderModule] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004248}
4249
Jesse Halld27f6aa2015-08-15 17:58:48 -07004250
4251// Pipeline functions
4252
4253cmd VkResult vkCreatePipelineCache(
4254 VkDevice device,
4255 const VkPipelineCacheCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004256 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004257 VkPipelineCache* pPipelineCache) {
4258 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO)
4259 deviceObject := GetDevice(device)
4260
4261 pipelineCache := ?
4262 pPipelineCache[0] = pipelineCache
4263 State.PipelineCaches[pipelineCache] = new!PipelineCacheObject(device: device)
4264
4265 return ?
4266}
4267
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004268cmd void vkDestroyPipelineCache(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004269 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004270 VkPipelineCache pipelineCache,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004271 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004272 deviceObject := GetDevice(device)
4273 pipelineCacheObject := GetPipelineCache(pipelineCache)
4274 assert(pipelineCacheObject.device == device)
4275
4276 State.PipelineCaches[pipelineCache] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004277}
4278
Jesse Halld27f6aa2015-08-15 17:58:48 -07004279cmd VkResult vkGetPipelineCacheData(
4280 VkDevice device,
4281 VkPipelineCache pipelineCache,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004282 platform.size_t* pDataSize,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004283 void* pData) {
4284 deviceObject := GetDevice(device)
4285 pipelineCacheObject := GetPipelineCache(pipelineCache)
4286 assert(pipelineCacheObject.device == device)
4287
4288 return ?
4289}
4290
4291cmd VkResult vkMergePipelineCaches(
4292 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004293 VkPipelineCache dstCache,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004294 u32 srcCacheCount,
4295 const VkPipelineCache* pSrcCaches) {
4296 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004297 dstCacheObject := GetPipelineCache(dstCache)
4298 assert(dstCacheObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004299
4300 srcCaches := pSrcCaches[0:srcCacheCount]
4301 for i in (0 .. srcCacheCount) {
4302 srcCache := srcCaches[i]
4303 srcCacheObject := GetPipelineCache(srcCache)
4304 assert(srcCacheObject.device == device)
4305 }
4306
4307 return ?
4308}
4309
4310cmd VkResult vkCreateGraphicsPipelines(
4311 VkDevice device,
4312 VkPipelineCache pipelineCache,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004313 u32 createInfoCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004314 const VkGraphicsPipelineCreateInfo* pCreateInfos,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004315 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004316 VkPipeline* pPipelines) {
4317 deviceObject := GetDevice(device)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004318 if pipelineCache != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004319 pipelineCacheObject := GetPipelineCache(pipelineCache)
4320 assert(pipelineCacheObject.device == device)
4321 }
4322
Jesse Hall03b6fe12015-11-24 12:44:21 -08004323 createInfos := pCreateInfos[0:createInfoCount]
4324 pipelines := pPipelines[0:createInfoCount]
4325 for i in (0 .. createInfoCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004326 pipeline := ?
4327 pipelines[i] = pipeline
4328 State.Pipelines[pipeline] = new!PipelineObject(device: device)
4329 }
4330
4331 return ?
4332}
4333
4334cmd VkResult vkCreateComputePipelines(
4335 VkDevice device,
4336 VkPipelineCache pipelineCache,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004337 u32 createInfoCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004338 const VkComputePipelineCreateInfo* pCreateInfos,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004339 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004340 VkPipeline* pPipelines) {
4341 deviceObject := GetDevice(device)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004342 if pipelineCache != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004343 pipelineCacheObject := GetPipelineCache(pipelineCache)
4344 assert(pipelineCacheObject.device == device)
4345 }
4346
Jesse Hall03b6fe12015-11-24 12:44:21 -08004347 createInfos := pCreateInfos[0:createInfoCount]
4348 pipelines := pPipelines[0:createInfoCount]
4349 for i in (0 .. createInfoCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004350 pipeline := ?
4351 pipelines[i] = pipeline
4352 State.Pipelines[pipeline] = new!PipelineObject(device: device)
4353 }
4354
4355 return ?
4356}
4357
4358@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004359cmd void vkDestroyPipeline(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004360 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004361 VkPipeline pipeline,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004362 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004363 deviceObject := GetDevice(device)
4364 pipelineObjects := GetPipeline(pipeline)
4365 assert(pipelineObjects.device == device)
4366
4367 State.Pipelines[pipeline] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004368}
4369
4370
4371// Pipeline layout functions
4372
4373@threadSafety("system")
4374cmd VkResult vkCreatePipelineLayout(
4375 VkDevice device,
4376 const VkPipelineLayoutCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004377 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004378 VkPipelineLayout* pPipelineLayout) {
4379 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO)
4380 deviceObject := GetDevice(device)
4381
4382 pipelineLayout := ?
4383 pPipelineLayout[0] = pipelineLayout
4384 State.PipelineLayouts[pipelineLayout] = new!PipelineLayoutObject(device: device)
4385
4386 return ?
4387}
4388
4389@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004390cmd void vkDestroyPipelineLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004391 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004392 VkPipelineLayout pipelineLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004393 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004394 deviceObject := GetDevice(device)
4395 pipelineLayoutObjects := GetPipelineLayout(pipelineLayout)
4396 assert(pipelineLayoutObjects.device == device)
4397
4398 State.PipelineLayouts[pipelineLayout] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004399}
4400
4401
4402// Sampler functions
4403
4404@threadSafety("system")
4405cmd VkResult vkCreateSampler(
4406 VkDevice device,
4407 const VkSamplerCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004408 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004409 VkSampler* pSampler) {
4410 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO)
4411 deviceObject := GetDevice(device)
4412
4413 sampler := ?
4414 pSampler[0] = sampler
4415 State.Samplers[sampler] = new!SamplerObject(device: device)
4416
4417 return ?
4418}
4419
4420@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004421cmd void vkDestroySampler(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004422 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004423 VkSampler sampler,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004424 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004425 deviceObject := GetDevice(device)
4426 samplerObject := GetSampler(sampler)
4427 assert(samplerObject.device == device)
4428
4429 State.Samplers[sampler] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004430}
4431
4432
4433// Descriptor set functions
4434
4435@threadSafety("system")
4436cmd VkResult vkCreateDescriptorSetLayout(
4437 VkDevice device,
4438 const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004439 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004440 VkDescriptorSetLayout* pSetLayout) {
4441 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO)
4442 deviceObject := GetDevice(device)
4443
4444 setLayout := ?
4445 pSetLayout[0] = setLayout
4446 State.DescriptorSetLayouts[setLayout] = new!DescriptorSetLayoutObject(device: device)
4447
4448 return ?
4449}
4450
4451@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004452cmd void vkDestroyDescriptorSetLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004453 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004454 VkDescriptorSetLayout descriptorSetLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004455 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004456 deviceObject := GetDevice(device)
4457 descriptorSetLayoutObject := GetDescriptorSetLayout(descriptorSetLayout)
4458 assert(descriptorSetLayoutObject.device == device)
4459
4460 State.DescriptorSetLayouts[descriptorSetLayout] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004461}
4462
4463@threadSafety("system")
4464cmd VkResult vkCreateDescriptorPool(
4465 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004466 const VkDescriptorPoolCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004467 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004468 VkDescriptorPool* pDescriptorPool) {
4469 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO)
4470 deviceObject := GetDevice(device)
4471
4472 descriptorPool := ?
4473 pDescriptorPool[0] = descriptorPool
4474 State.DescriptorPools[descriptorPool] = new!DescriptorPoolObject(device: device)
4475
4476 return ?
4477}
4478
4479@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004480cmd void vkDestroyDescriptorPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004481 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004482 VkDescriptorPool descriptorPool,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004483 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004484 deviceObject := GetDevice(device)
4485 descriptorPoolObject := GetDescriptorPool(descriptorPool)
4486 assert(descriptorPoolObject.device == device)
4487
4488 State.DescriptorPools[descriptorPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004489}
4490
4491@threadSafety("app")
4492cmd VkResult vkResetDescriptorPool(
4493 VkDevice device,
Jesse Hallfbf97b02015-11-20 14:17:03 -08004494 VkDescriptorPool descriptorPool,
4495 VkDescriptorPoolResetFlags flags) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004496 deviceObject := GetDevice(device)
4497 descriptorPoolObject := GetDescriptorPool(descriptorPool)
4498 assert(descriptorPoolObject.device == device)
4499
4500 return ?
4501}
4502
4503@threadSafety("app")
Jesse Hall3fbc8562015-11-29 22:10:52 -08004504cmd VkResult vkAllocateDescriptorSets(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004505 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004506 const VkDescriptorSetAllocateInfo* pAllocateInfo,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004507 VkDescriptorSet* pDescriptorSets) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004508 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004509 allocInfo := pAllocateInfo[0]
Jesse Hallfbf97b02015-11-20 14:17:03 -08004510 descriptorPoolObject := GetDescriptorPool(allocInfo.descriptorPool)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004511
Jesse Hall03b6fe12015-11-24 12:44:21 -08004512 setLayouts := allocInfo.pSetLayouts[0:allocInfo.setCount]
4513 for i in (0 .. allocInfo.setCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004514 setLayout := setLayouts[i]
4515 setLayoutObject := GetDescriptorSetLayout(setLayout)
4516 assert(setLayoutObject.device == device)
4517 }
4518
Jesse Hall03b6fe12015-11-24 12:44:21 -08004519 descriptorSets := pDescriptorSets[0:allocInfo.setCount]
4520 for i in (0 .. allocInfo.setCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004521 descriptorSet := ?
4522 descriptorSets[i] = descriptorSet
4523 State.DescriptorSets[descriptorSet] = new!DescriptorSetObject(device: device)
4524 }
4525
4526 return ?
4527}
4528
Jesse Hallf09c6b12015-08-15 19:54:28 -07004529cmd VkResult vkFreeDescriptorSets(
4530 VkDevice device,
4531 VkDescriptorPool descriptorPool,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004532 u32 descriptorSetCount,
Jesse Hallf09c6b12015-08-15 19:54:28 -07004533 const VkDescriptorSet* pDescriptorSets) {
4534 deviceObject := GetDevice(device)
4535 descriptorPoolObject := GetDescriptorPool(descriptorPool)
4536
Jesse Hall03b6fe12015-11-24 12:44:21 -08004537 descriptorSets := pDescriptorSets[0:descriptorSetCount]
4538 for i in (0 .. descriptorSetCount) {
Jesse Hallf09c6b12015-08-15 19:54:28 -07004539 descriptorSet := descriptorSets[i]
4540 descriptorSetObject := GetDescriptorSet(descriptorSet)
4541 assert(descriptorSetObject.device == device)
4542 State.DescriptorSets[descriptorSet] = null
4543 }
4544
4545 return ?
4546}
4547
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004548cmd void vkUpdateDescriptorSets(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004549 VkDevice device,
Jesse Hallb00daad2015-11-29 19:46:20 -08004550 u32 descriptorWriteCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004551 const VkWriteDescriptorSet* pDescriptorWrites,
Jesse Hallb00daad2015-11-29 19:46:20 -08004552 u32 descriptorCopyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004553 const VkCopyDescriptorSet* pDescriptorCopies) {
4554 deviceObject := GetDevice(device)
4555
Jesse Hallb00daad2015-11-29 19:46:20 -08004556 descriptorWrites := pDescriptorWrites[0:descriptorWriteCount]
4557 for i in (0 .. descriptorWriteCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004558 descriptorWrite := descriptorWrites[i]
Jesse Hall3fbc8562015-11-29 22:10:52 -08004559 descriptorWriteObject := GetDescriptorSet(descriptorWrite.dstSet)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004560 assert(descriptorWriteObject.device == device)
4561 }
4562
Jesse Hallb00daad2015-11-29 19:46:20 -08004563 descriptorCopies := pDescriptorCopies[0:descriptorCopyCount]
4564 for i in (0 .. descriptorCopyCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004565 descriptorCopy := descriptorCopies[i]
Jesse Hall3fbc8562015-11-29 22:10:52 -08004566 descriptorCopyObject := GetDescriptorSet(descriptorCopy.dstSet)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004567 assert(descriptorCopyObject.device == device)
4568 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07004569}
4570
4571
4572// Framebuffer functions
4573
4574@threadSafety("system")
4575cmd VkResult vkCreateFramebuffer(
4576 VkDevice device,
4577 const VkFramebufferCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004578 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004579 VkFramebuffer* pFramebuffer) {
4580 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO)
4581 deviceObject := GetDevice(device)
4582
4583 framebuffer := ?
4584 pFramebuffer[0] = framebuffer
4585 State.Framebuffers[framebuffer] = new!FramebufferObject(device: device)
4586
4587 return ?
4588}
4589
4590@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004591cmd void vkDestroyFramebuffer(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004592 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004593 VkFramebuffer framebuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004594 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004595 deviceObject := GetDevice(device)
4596 framebufferObject := GetFramebuffer(framebuffer)
4597 assert(framebufferObject.device == device)
4598
4599 State.Framebuffers[framebuffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004600}
4601
4602
4603// Renderpass functions
4604
4605@threadSafety("system")
4606cmd VkResult vkCreateRenderPass(
4607 VkDevice device,
4608 const VkRenderPassCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004609 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004610 VkRenderPass* pRenderPass) {
4611 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO)
4612 deviceObject := GetDevice(device)
4613
4614 renderpass := ?
4615 pRenderPass[0] = renderpass
4616 State.RenderPasses[renderpass] = new!RenderPassObject(device: device)
4617
4618 return ?
4619}
4620
4621@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004622cmd void vkDestroyRenderPass(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004623 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004624 VkRenderPass renderPass,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004625 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004626 deviceObject := GetDevice(device)
4627 renderPassObject := GetRenderPass(renderPass)
4628 assert(renderPassObject.device == device)
4629
4630 State.RenderPasses[renderPass] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004631}
4632
Jesse Hall606a54e2015-11-19 22:17:28 -08004633cmd void vkGetRenderAreaGranularity(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004634 VkDevice device,
4635 VkRenderPass renderPass,
4636 VkExtent2D* pGranularity) {
4637 deviceObject := GetDevice(device)
4638 renderPassObject := GetRenderPass(renderPass)
4639
4640 granularity := ?
4641 pGranularity[0] = granularity
Jesse Halld27f6aa2015-08-15 17:58:48 -07004642}
4643
4644// Command pool functions
4645
4646cmd VkResult vkCreateCommandPool(
4647 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004648 const VkCommandPoolCreateInfo* pCreateInfo,
4649 const VkAllocationCallbacks* pAllocator,
4650 VkCommandPool* pCommandPool) {
4651 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004652 deviceObject := GetDevice(device)
4653
Jesse Hall3fbc8562015-11-29 22:10:52 -08004654 commandPool := ?
4655 pCommandPool[0] = commandPool
4656 State.CommandPools[commandPool] = new!CommandPoolObject(device: device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004657
4658 return ?
4659}
4660
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004661cmd void vkDestroyCommandPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004662 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004663 VkCommandPool commandPool,
4664 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004665 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004666 commandPoolObject := GetCommandPool(commandPool)
4667 assert(commandPoolObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004668
Jesse Hall3fbc8562015-11-29 22:10:52 -08004669 State.CommandPools[commandPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004670}
4671
4672cmd VkResult vkResetCommandPool(
4673 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004674 VkCommandPool commandPool,
4675 VkCommandPoolResetFlags flags) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004676 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004677 commandPoolObject := GetCommandPool(commandPool)
4678 assert(commandPoolObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004679
4680 return ?
4681}
4682
4683// Command buffer functions
4684
Jesse Hall3fbc8562015-11-29 22:10:52 -08004685macro void bindCommandBuffer(VkCommandBuffer commandBuffer, any obj, VkDeviceMemory memory) {
4686 memoryObject := GetDeviceMemory(memory)
4687 memoryObject.boundCommandBuffers[commandBuffer] = commandBuffer
Jesse Halld27f6aa2015-08-15 17:58:48 -07004688
Jesse Hall3fbc8562015-11-29 22:10:52 -08004689 commandBufferObject := GetCommandBuffer(commandBuffer)
4690 commandBufferObject.boundObjects[as!u64(obj)] = memory
Jesse Halld27f6aa2015-08-15 17:58:48 -07004691}
4692
Jesse Hall3fbc8562015-11-29 22:10:52 -08004693macro void unbindCommandBuffer(VkCommandBuffer commandBuffer, any obj, VkDeviceMemory memory) {
4694 memoryObject := GetDeviceMemory(memory)
4695 memoryObject.boundCommandBuffers[commandBuffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004696
Jesse Hall3fbc8562015-11-29 22:10:52 -08004697 commandBufferObject := GetCommandBuffer(commandBuffer)
4698 commandBufferObject.boundObjects[as!u64(obj)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004699}
4700
4701@threadSafety("system")
Jesse Hall3fbc8562015-11-29 22:10:52 -08004702cmd VkResult vkAllocateCommandBuffers(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004703 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004704 const VkCommandBufferAllocateInfo* pAllocateInfo,
4705 VkCommandBuffer* pCommandBuffers) {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08004706 assert(pAllocateInfo[0].sType == VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004707
Jesse Hall3dd678a2016-01-08 21:52:01 -08004708 count := pAllocateInfo[0].commandBufferCount
Jesse Hall3fbc8562015-11-29 22:10:52 -08004709 commandBuffers := pCommandBuffers[0:count]
Jesse Hallfbf97b02015-11-20 14:17:03 -08004710 for i in (0 .. count) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004711 commandBuffer := ?
4712 commandBuffers[i] = commandBuffer
4713 State.CommandBuffers[commandBuffer] = new!CommandBufferObject(device: device)
Jesse Hallfbf97b02015-11-20 14:17:03 -08004714 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07004715
4716 return ?
4717}
4718
4719@threadSafety("system")
Jesse Hallfbf97b02015-11-20 14:17:03 -08004720cmd void vkFreeCommandBuffers(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004721 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004722 VkCommandPool commandPool,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004723 u32 commandBufferCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004724 const VkCommandBuffer* pCommandBuffers) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004725 deviceObject := GetDevice(device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004726
Jesse Hall3fbc8562015-11-29 22:10:52 -08004727 commandBuffers := pCommandBuffers[0:commandBufferCount]
Jesse Hall03b6fe12015-11-24 12:44:21 -08004728 for i in (0 .. commandBufferCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004729 commandBufferObject := GetCommandBuffer(commandBuffers[i])
4730 assert(commandBufferObject.device == device)
Jesse Hallfbf97b02015-11-20 14:17:03 -08004731 // TODO: iterate over boundObjects and clear memory bindings
Jesse Hall3fbc8562015-11-29 22:10:52 -08004732 State.CommandBuffers[commandBuffers[i]] = null
Jesse Hallfbf97b02015-11-20 14:17:03 -08004733 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07004734}
4735
4736@threadSafety("app")
4737cmd VkResult vkBeginCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004738 VkCommandBuffer commandBuffer,
4739 const VkCommandBufferBeginInfo* pBeginInfo) {
4740 assert(pBeginInfo.sType == VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO)
4741 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004742
4743 // TODO: iterate over boundObjects and clear memory bindings
4744
4745 return ?
4746}
4747
4748@threadSafety("app")
4749cmd VkResult vkEndCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004750 VkCommandBuffer commandBuffer) {
4751 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004752
4753 return ?
4754}
4755
4756@threadSafety("app")
4757cmd VkResult vkResetCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004758 VkCommandBuffer commandBuffer,
4759 VkCommandBufferResetFlags flags) {
4760 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004761
4762 // TODO: iterate over boundObjects and clear memory bindings
4763
4764 return ?
4765}
4766
4767
4768// Command buffer building functions
4769
4770@threadSafety("app")
4771cmd void vkCmdBindPipeline(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004772 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004773 VkPipelineBindPoint pipelineBindPoint,
4774 VkPipeline pipeline) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004775 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004776 pipelineObject := GetPipeline(pipeline)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004777 assert(commandBufferObject.device == pipelineObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004778
Jesse Halld8bade02015-11-24 10:24:18 -08004779 queue := switch (pipelineBindPoint) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004780 case VK_PIPELINE_BIND_POINT_COMPUTE: VK_QUEUE_COMPUTE_BIT
4781 case VK_PIPELINE_BIND_POINT_GRAPHICS: VK_QUEUE_GRAPHICS_BIT
4782 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08004783 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004784}
4785
4786@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004787cmd void vkCmdSetViewport(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004788 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004789 u32 firstViewport,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004790 u32 viewportCount,
4791 const VkViewport* pViewports) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004792 commandBufferObject := GetCommandBuffer(commandBuffer)
4793 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004794}
4795
4796@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004797cmd void vkCmdSetScissor(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004798 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004799 u32 firstScissor,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004800 u32 scissorCount,
4801 const VkRect2D* pScissors) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004802 commandBufferObject := GetCommandBuffer(commandBuffer)
4803 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004804}
4805
4806@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004807cmd void vkCmdSetLineWidth(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004808 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004809 f32 lineWidth) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004810 commandBufferObject := GetCommandBuffer(commandBuffer)
4811 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004812}
4813
4814@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004815cmd void vkCmdSetDepthBias(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004816 VkCommandBuffer commandBuffer,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004817 f32 depthBiasConstantFactor,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004818 f32 depthBiasClamp,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004819 f32 depthBiasSlopeFactor) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004820 commandBufferObject := GetCommandBuffer(commandBuffer)
4821 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004822}
Jesse Halld27f6aa2015-08-15 17:58:48 -07004823
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004824@threadSafety("app")
4825cmd void vkCmdSetBlendConstants(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004826 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004827 // TODO(jessehall): apic only supports 'const' on pointer types. Using
4828 // an annotation as a quick hack to pass this to the template without
4829 // having to modify the AST and semantic model.
Jesse Hallb00daad2015-11-29 19:46:20 -08004830 @readonly f32[4] blendConstants) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004831 commandBufferObject := GetCommandBuffer(commandBuffer)
4832 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004833}
4834
4835@threadSafety("app")
4836cmd void vkCmdSetDepthBounds(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004837 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004838 f32 minDepthBounds,
4839 f32 maxDepthBounds) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004840 commandBufferObject := GetCommandBuffer(commandBuffer)
4841 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004842}
4843
4844@threadSafety("app")
4845cmd void vkCmdSetStencilCompareMask(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004846 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004847 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08004848 u32 compareMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004849 commandBufferObject := GetCommandBuffer(commandBuffer)
4850 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004851}
4852
4853@threadSafety("app")
4854cmd void vkCmdSetStencilWriteMask(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004855 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004856 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08004857 u32 writeMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004858 commandBufferObject := GetCommandBuffer(commandBuffer)
4859 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004860}
4861
4862@threadSafety("app")
4863cmd void vkCmdSetStencilReference(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004864 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004865 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08004866 u32 reference) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004867 commandBufferObject := GetCommandBuffer(commandBuffer)
4868 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004869}
4870
4871@threadSafety("app")
4872cmd void vkCmdBindDescriptorSets(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004873 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004874 VkPipelineBindPoint pipelineBindPoint,
4875 VkPipelineLayout layout,
4876 u32 firstSet,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004877 u32 descriptorSetCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004878 const VkDescriptorSet* pDescriptorSets,
4879 u32 dynamicOffsetCount,
4880 const u32* pDynamicOffsets) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004881 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004882
Jesse Hall03b6fe12015-11-24 12:44:21 -08004883 descriptorSets := pDescriptorSets[0:descriptorSetCount]
4884 for i in (0 .. descriptorSetCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004885 descriptorSet := descriptorSets[i]
4886 descriptorSetObject := GetDescriptorSet(descriptorSet)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004887 assert(commandBufferObject.device == descriptorSetObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004888 }
4889
4890 dynamicOffsets := pDynamicOffsets[0:dynamicOffsetCount]
4891 for i in (0 .. dynamicOffsetCount) {
4892 dynamicOffset := dynamicOffsets[i]
4893 }
4894
Jesse Halld8bade02015-11-24 10:24:18 -08004895 queue := switch (pipelineBindPoint) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004896 case VK_PIPELINE_BIND_POINT_COMPUTE: VK_QUEUE_COMPUTE_BIT
4897 case VK_PIPELINE_BIND_POINT_GRAPHICS: VK_QUEUE_GRAPHICS_BIT
4898 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08004899 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004900}
4901
4902@threadSafety("app")
4903cmd void vkCmdBindIndexBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004904 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004905 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004906 VkDeviceSize offset,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004907 VkIndexType indexType) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004908 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004909 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004910 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004911
Jesse Hall3fbc8562015-11-29 22:10:52 -08004912 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004913
Jesse Hall3fbc8562015-11-29 22:10:52 -08004914 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004915}
4916
4917@threadSafety("app")
4918cmd void vkCmdBindVertexBuffers(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004919 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004920 u32 firstBinding,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004921 u32 bindingCount,
4922 const VkBuffer* pBuffers,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004923 const VkDeviceSize* pOffsets) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004924 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004925
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004926 // TODO: check if not [firstBinding:firstBinding+bindingCount]
Jesse Halld27f6aa2015-08-15 17:58:48 -07004927 buffers := pBuffers[0:bindingCount]
4928 offsets := pOffsets[0:bindingCount]
4929 for i in (0 .. bindingCount) {
4930 buffer := buffers[i]
4931 offset := offsets[i]
4932 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004933 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004934
Jesse Hall3fbc8562015-11-29 22:10:52 -08004935 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004936 }
4937
Jesse Hall3fbc8562015-11-29 22:10:52 -08004938 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004939}
4940
4941@threadSafety("app")
4942cmd void vkCmdDraw(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004943 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004944 u32 vertexCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004945 u32 instanceCount,
4946 u32 firstVertex,
4947 u32 firstInstance) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004948 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004949
Jesse Hall3fbc8562015-11-29 22:10:52 -08004950 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004951}
4952
4953@threadSafety("app")
4954cmd void vkCmdDrawIndexed(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004955 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004956 u32 indexCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004957 u32 instanceCount,
4958 u32 firstIndex,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004959 s32 vertexOffset,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004960 u32 firstInstance) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004961 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004962
Jesse Hall3fbc8562015-11-29 22:10:52 -08004963 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004964}
4965
4966@threadSafety("app")
4967cmd void vkCmdDrawIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004968 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004969 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004970 VkDeviceSize offset,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004971 u32 drawCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004972 u32 stride) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004973 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004974 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004975 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004976
Jesse Hall3fbc8562015-11-29 22:10:52 -08004977 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004978
Jesse Hall3fbc8562015-11-29 22:10:52 -08004979 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004980}
4981
4982@threadSafety("app")
4983cmd void vkCmdDrawIndexedIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004984 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004985 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004986 VkDeviceSize offset,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004987 u32 drawCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004988 u32 stride) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004989 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004990 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004991 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004992
Jesse Hall3fbc8562015-11-29 22:10:52 -08004993 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004994
Jesse Hall3fbc8562015-11-29 22:10:52 -08004995 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004996}
4997
4998@threadSafety("app")
4999cmd void vkCmdDispatch(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005000 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005001 u32 x,
5002 u32 y,
5003 u32 z) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005004 commandBufferObject := GetCommandBuffer(commandBuffer)
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 vkCmdDispatchIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005011 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005012 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005013 VkDeviceSize offset) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005014 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005015 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005016 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005017
Jesse Hall3fbc8562015-11-29 22:10:52 -08005018 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005019
Jesse Hall3fbc8562015-11-29 22:10:52 -08005020 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_COMPUTE_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005021}
5022
5023@threadSafety("app")
5024cmd void vkCmdCopyBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005025 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005026 VkBuffer srcBuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005027 VkBuffer dstBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005028 u32 regionCount,
5029 const VkBufferCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005030 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005031 srcBufferObject := GetBuffer(srcBuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005032 dstBufferObject := GetBuffer(dstBuffer)
5033 assert(commandBufferObject.device == srcBufferObject.device)
5034 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005035
5036 regions := pRegions[0:regionCount]
5037 for i in (0 .. regionCount) {
5038 region := regions[i]
5039 }
5040
Jesse Hall3fbc8562015-11-29 22:10:52 -08005041 bindCommandBuffer(commandBuffer, srcBuffer, srcBufferObject.memory)
5042 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005043
Jesse Hall65ab5522015-11-30 00:07:16 -08005044 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005045}
5046
5047@threadSafety("app")
5048cmd void vkCmdCopyImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005049 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005050 VkImage srcImage,
5051 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005052 VkImage dstImage,
5053 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005054 u32 regionCount,
5055 const VkImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005056 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005057 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005058 dstImageObject := GetImage(dstImage)
5059 assert(commandBufferObject.device == srcImageObject.device)
5060 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005061
5062 regions := pRegions[0:regionCount]
5063 for i in (0 .. regionCount) {
5064 region := regions[i]
5065 }
5066
Jesse Hall3fbc8562015-11-29 22:10:52 -08005067 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
5068 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005069
Jesse Hall65ab5522015-11-30 00:07:16 -08005070 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005071}
5072
5073@threadSafety("app")
5074cmd void vkCmdBlitImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005075 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005076 VkImage srcImage,
5077 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005078 VkImage dstImage,
5079 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005080 u32 regionCount,
5081 const VkImageBlit* pRegions,
Jesse Hall23ff73f2015-11-29 14:36:39 -08005082 VkFilter filter) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005083 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005084 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005085 dstImageObject := GetImage(dstImage)
5086 assert(commandBufferObject.device == srcImageObject.device)
5087 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005088
5089 regions := pRegions[0:regionCount]
5090 for i in (0 .. regionCount) {
5091 region := regions[i]
5092 }
5093
Jesse Hall3fbc8562015-11-29 22:10:52 -08005094 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
5095 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005096
Jesse Hall3fbc8562015-11-29 22:10:52 -08005097 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005098}
5099
5100@threadSafety("app")
5101cmd void vkCmdCopyBufferToImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005102 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005103 VkBuffer srcBuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005104 VkImage dstImage,
5105 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005106 u32 regionCount,
5107 const VkBufferImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005108 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005109 srcBufferObject := GetBuffer(srcBuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005110 dstImageObject := GetImage(dstImage)
5111 assert(commandBufferObject.device == srcBufferObject.device)
5112 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005113
5114 regions := pRegions[0:regionCount]
5115 for i in (0 .. regionCount) {
5116 region := regions[i]
5117 }
5118
Jesse Hall3fbc8562015-11-29 22:10:52 -08005119 bindCommandBuffer(commandBuffer, srcBuffer, srcBufferObject.memory)
5120 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005121
Jesse Hall65ab5522015-11-30 00:07:16 -08005122 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005123}
5124
5125@threadSafety("app")
5126cmd void vkCmdCopyImageToBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005127 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005128 VkImage srcImage,
5129 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005130 VkBuffer dstBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005131 u32 regionCount,
5132 const VkBufferImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005133 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005134 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005135 dstBufferObject := GetBuffer(dstBuffer)
5136 assert(commandBufferObject.device == srcImageObject.device)
5137 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005138
5139 regions := pRegions[0:regionCount]
5140 for i in (0 .. regionCount) {
5141 region := regions[i]
5142 }
5143
Jesse Hall3fbc8562015-11-29 22:10:52 -08005144 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
5145 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005146
Jesse Hall65ab5522015-11-30 00:07:16 -08005147 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005148}
5149
5150@threadSafety("app")
5151cmd void vkCmdUpdateBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005152 VkCommandBuffer commandBuffer,
5153 VkBuffer dstBuffer,
5154 VkDeviceSize dstOffset,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005155 VkDeviceSize dataSize,
Jesse Hall56d386a2016-07-26 15:20:40 -07005156 const void* pData) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005157 commandBufferObject := GetCommandBuffer(commandBuffer)
5158 dstBufferObject := GetBuffer(dstBuffer)
5159 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005160
5161 data := pData[0:dataSize]
5162
Jesse Hall3fbc8562015-11-29 22:10:52 -08005163 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
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 vkCmdFillBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005170 VkCommandBuffer commandBuffer,
5171 VkBuffer dstBuffer,
5172 VkDeviceSize dstOffset,
Jesse Hallb00daad2015-11-29 19:46:20 -08005173 VkDeviceSize size,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005174 u32 data) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005175 commandBufferObject := GetCommandBuffer(commandBuffer)
5176 dstBufferObject := GetBuffer(dstBuffer)
5177 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005178
Jesse Hall65ab5522015-11-30 00:07:16 -08005179 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005180}
5181
5182@threadSafety("app")
5183cmd void vkCmdClearColorImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005184 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005185 VkImage image,
5186 VkImageLayout imageLayout,
5187 const VkClearColorValue* pColor,
5188 u32 rangeCount,
5189 const VkImageSubresourceRange* pRanges) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005190 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005191 imageObject := GetImage(image)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005192 assert(commandBufferObject.device == imageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005193
5194 ranges := pRanges[0:rangeCount]
5195 for i in (0 .. rangeCount) {
5196 range := ranges[i]
5197 }
5198
Jesse Hall3fbc8562015-11-29 22:10:52 -08005199 bindCommandBuffer(commandBuffer, image, imageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005200
Jesse Hall3fbc8562015-11-29 22:10:52 -08005201 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005202}
5203
5204@threadSafety("app")
5205cmd void vkCmdClearDepthStencilImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005206 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005207 VkImage image,
5208 VkImageLayout imageLayout,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005209 const VkClearDepthStencilValue* pDepthStencil,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005210 u32 rangeCount,
5211 const VkImageSubresourceRange* pRanges) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005212 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005213 imageObject := GetImage(image)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005214 assert(commandBufferObject.device == imageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005215
5216 ranges := pRanges[0:rangeCount]
5217 for i in (0 .. rangeCount) {
5218 range := ranges[i]
5219 }
5220
Jesse Hall3fbc8562015-11-29 22:10:52 -08005221 bindCommandBuffer(commandBuffer, image, imageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005222
Jesse Hall3fbc8562015-11-29 22:10:52 -08005223 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005224}
5225
5226@threadSafety("app")
Jesse Hallae38f732015-11-19 21:32:50 -08005227cmd void vkCmdClearAttachments(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005228 VkCommandBuffer commandBuffer,
Jesse Hallae38f732015-11-19 21:32:50 -08005229 u32 attachmentCount,
5230 const VkClearAttachment* pAttachments,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005231 u32 rectCount,
Jesse Halla15a4bf2015-11-19 22:48:02 -08005232 const VkClearRect* pRects) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005233 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005234
5235 rects := pRects[0:rectCount]
5236 for i in (0 .. rectCount) {
5237 rect := rects[i]
5238 }
5239
Jesse Hall3fbc8562015-11-29 22:10:52 -08005240 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005241}
5242
5243@threadSafety("app")
5244cmd void vkCmdResolveImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005245 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005246 VkImage srcImage,
5247 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005248 VkImage dstImage,
5249 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005250 u32 regionCount,
5251 const VkImageResolve* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005252 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005253 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005254 dstImageObject := GetImage(dstImage)
5255 assert(commandBufferObject.device == srcImageObject.device)
5256 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005257
5258 regions := pRegions[0:regionCount]
5259 for i in (0 .. regionCount) {
5260 region := regions[i]
5261 }
5262
Jesse Hall3fbc8562015-11-29 22:10:52 -08005263 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
5264 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005265
Jesse Hall3fbc8562015-11-29 22:10:52 -08005266 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005267}
5268
5269@threadSafety("app")
5270cmd void vkCmdSetEvent(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005271 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005272 VkEvent event,
5273 VkPipelineStageFlags stageMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005274 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005275 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005276 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005277}
5278
5279@threadSafety("app")
5280cmd void vkCmdResetEvent(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005281 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005282 VkEvent event,
5283 VkPipelineStageFlags stageMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005284 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005285 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005286 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005287}
5288
5289@threadSafety("app")
5290cmd void vkCmdWaitEvents(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005291 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005292 u32 eventCount,
5293 const VkEvent* pEvents,
5294 VkPipelineStageFlags srcStageMask,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005295 VkPipelineStageFlags dstStageMask,
5296 u32 memoryBarrierCount,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005297 const VkMemoryBarrier* pMemoryBarriers,
5298 u32 bufferMemoryBarrierCount,
5299 const VkBufferMemoryBarrier* pBufferMemoryBarriers,
5300 u32 imageMemoryBarrierCount,
5301 const VkImageMemoryBarrier* pImageMemoryBarriers) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005302 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005303
5304 events := pEvents[0:eventCount]
5305 for i in (0 .. eventCount) {
5306 event := events[i]
5307 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005308 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005309 }
5310
Jesse Hall3dd678a2016-01-08 21:52:01 -08005311 memoryBarriers := pMemoryBarriers[0:memoryBarrierCount]
Jesse Hall3fbc8562015-11-29 22:10:52 -08005312 for i in (0 .. memoryBarrierCount) {
Jesse Hall3dd678a2016-01-08 21:52:01 -08005313 memoryBarrier := memoryBarriers[i]
5314 }
5315 bufferMemoryBarriers := pBufferMemoryBarriers[0:bufferMemoryBarrierCount]
5316 for i in (0 .. bufferMemoryBarrierCount) {
5317 bufferMemoryBarrier := bufferMemoryBarriers[i]
5318 bufferObject := GetBuffer(bufferMemoryBarrier.buffer)
5319 assert(bufferObject.device == commandBufferObject.device)
5320 }
5321 imageMemoryBarriers := pImageMemoryBarriers[0:imageMemoryBarrierCount]
5322 for i in (0 .. imageMemoryBarrierCount) {
5323 imageMemoryBarrier := imageMemoryBarriers[i]
5324 imageObject := GetImage(imageMemoryBarrier.image)
5325 assert(imageObject.device == commandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005326 }
5327}
5328
5329@threadSafety("app")
5330cmd void vkCmdPipelineBarrier(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005331 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005332 VkPipelineStageFlags srcStageMask,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005333 VkPipelineStageFlags dstStageMask,
Jesse Halldc6d36c2015-11-29 19:12:15 -08005334 VkDependencyFlags dependencyFlags,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005335 u32 memoryBarrierCount,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005336 const VkMemoryBarrier* pMemoryBarriers,
5337 u32 bufferMemoryBarrierCount,
5338 const VkBufferMemoryBarrier* pBufferMemoryBarriers,
5339 u32 imageMemoryBarrierCount,
5340 const VkImageMemoryBarrier* pImageMemoryBarriers) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005341 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005342
Jesse Hall3dd678a2016-01-08 21:52:01 -08005343 memoryBarriers := pMemoryBarriers[0:memoryBarrierCount]
Jesse Hall3fbc8562015-11-29 22:10:52 -08005344 for i in (0 .. memoryBarrierCount) {
Jesse Hall3dd678a2016-01-08 21:52:01 -08005345 memoryBarrier := memoryBarriers[i]
5346 }
5347 bufferMemoryBarriers := pBufferMemoryBarriers[0:bufferMemoryBarrierCount]
5348 for i in (0 .. bufferMemoryBarrierCount) {
5349 bufferMemoryBarrier := bufferMemoryBarriers[i]
5350 bufferObject := GetBuffer(bufferMemoryBarrier.buffer)
5351 assert(bufferObject.device == commandBufferObject.device)
5352 }
5353 imageMemoryBarriers := pImageMemoryBarriers[0:imageMemoryBarrierCount]
5354 for i in (0 .. imageMemoryBarrierCount) {
5355 imageMemoryBarrier := imageMemoryBarriers[i]
5356 imageObject := GetImage(imageMemoryBarrier.image)
5357 assert(imageObject.device == commandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005358 }
5359}
5360
5361@threadSafety("app")
5362cmd void vkCmdBeginQuery(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005363 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005364 VkQueryPool queryPool,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005365 u32 query,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005366 VkQueryControlFlags flags) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005367 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005368 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005369 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005370}
5371
5372@threadSafety("app")
5373cmd void vkCmdEndQuery(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005374 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005375 VkQueryPool queryPool,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005376 u32 query) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005377 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005378 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005379 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005380}
5381
5382@threadSafety("app")
5383cmd void vkCmdResetQueryPool(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005384 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005385 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005386 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005387 u32 queryCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005388 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005389 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005390 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005391}
5392
5393@threadSafety("app")
5394cmd void vkCmdWriteTimestamp(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005395 VkCommandBuffer commandBuffer,
Jesse Hall6f39a6d2015-11-24 11:08:36 -08005396 VkPipelineStageFlagBits pipelineStage,
Jesse Halla3a7a1d2015-11-24 11:37:23 -08005397 VkQueryPool queryPool,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005398 u32 query) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005399 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halla3a7a1d2015-11-24 11:37:23 -08005400 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005401 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005402}
5403
5404@threadSafety("app")
5405cmd void vkCmdCopyQueryPoolResults(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005406 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005407 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005408 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005409 u32 queryCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005410 VkBuffer dstBuffer,
5411 VkDeviceSize dstOffset,
Jesse Halla9bb62b2015-11-21 19:31:56 -08005412 VkDeviceSize stride,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005413 VkQueryResultFlags flags) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005414 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005415 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005416 dstBufferObject := GetBuffer(dstBuffer)
5417 assert(commandBufferObject.device == queryPoolObject.device)
5418 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005419}
5420
5421cmd void vkCmdPushConstants(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005422 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005423 VkPipelineLayout layout,
5424 VkShaderStageFlags stageFlags,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005425 u32 offset,
5426 u32 size,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08005427 const void* pValues) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005428 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005429 layoutObject := GetPipelineLayout(layout)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005430 assert(commandBufferObject.device == layoutObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005431}
5432
5433@threadSafety("app")
5434cmd void vkCmdBeginRenderPass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005435 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005436 const VkRenderPassBeginInfo* pRenderPassBegin,
Jesse Hall65ab5522015-11-30 00:07:16 -08005437 VkSubpassContents contents) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005438 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005439 renderPassObject := GetRenderPass(pRenderPassBegin.renderPass)
5440 framebufferObject := GetFramebuffer(pRenderPassBegin.framebuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005441 assert(commandBufferObject.device == renderPassObject.device)
5442 assert(commandBufferObject.device == framebufferObject.device)
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 vkCmdNextSubpass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005448 VkCommandBuffer commandBuffer,
Jesse Hall65ab5522015-11-30 00:07:16 -08005449 VkSubpassContents contents) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005450 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005451}
5452
5453@threadSafety("app")
5454cmd void vkCmdEndRenderPass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005455 VkCommandBuffer commandBuffer) {
5456 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005457
Jesse Hall3fbc8562015-11-29 22:10:52 -08005458 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005459}
5460
5461cmd void vkCmdExecuteCommands(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005462 VkCommandBuffer commandBuffer,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005463 u32 commandBufferCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005464 const VkCommandBuffer* pCommandBuffers) {
5465 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005466
Jesse Hall3dd678a2016-01-08 21:52:01 -08005467 commandBuffers := pCommandBuffers[0:commandBufferCount]
5468 for i in (0 .. commandBufferCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005469 secondaryCommandBuffer := commandBuffers[i]
5470 secondaryCommandBufferObject := GetCommandBuffer(secondaryCommandBuffer)
5471 assert(commandBufferObject.device == secondaryCommandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005472 }
5473}
5474
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005475@extension("VK_KHR_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005476cmd void vkDestroySurfaceKHR(
5477 VkInstance instance,
Jesse Hall0e74f002015-11-30 11:37:59 -08005478 VkSurfaceKHR surface,
5479 const VkAllocationCallbacks* pAllocator) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005480 instanceObject := GetInstance(instance)
5481 surfaceObject := GetSurface(surface)
5482 assert(surfaceObject.instance == instance)
Michael Lentine88594d72015-11-12 12:49:45 -08005483
Jesse Hall1356b0d2015-11-23 17:24:58 -08005484 State.Surfaces[surface] = null
Jesse Hall2818f932015-11-19 21:19:17 -08005485}
5486
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005487@extension("VK_KHR_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005488cmd VkResult vkGetPhysicalDeviceSurfaceSupportKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005489 VkPhysicalDevice physicalDevice,
5490 u32 queueFamilyIndex,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005491 VkSurfaceKHR surface,
Jesse Hallb00daad2015-11-29 19:46:20 -08005492 VkBool32* pSupported) {
5493 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08005494
5495 return ?
5496}
5497
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005498@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08005499cmd VkResult vkGetPhysicalDeviceSurfaceCapabilitiesKHR(
5500 VkPhysicalDevice physicalDevice,
5501 VkSurfaceKHR surface,
5502 VkSurfaceCapabilitiesKHR* pSurfaceCapabilities) {
5503 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5504
5505 surfaceCapabilities := ?
5506 pSurfaceCapabilities[0] = surfaceCapabilities
5507
5508 return ?
5509}
5510
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005511@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08005512cmd VkResult vkGetPhysicalDeviceSurfaceFormatsKHR(
5513 VkPhysicalDevice physicalDevice,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005514 VkSurfaceKHR surface,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005515 u32* pSurfaceFormatCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005516 VkSurfaceFormatKHR* pSurfaceFormats) {
Jesse Hallb00daad2015-11-29 19:46:20 -08005517 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08005518
5519 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08005520 pSurfaceFormatCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08005521 surfaceFormats := pSurfaceFormats[0:count]
5522
5523 for i in (0 .. count) {
5524 surfaceFormat := ?
5525 surfaceFormats[i] = surfaceFormat
5526 }
5527
5528 return ?
5529}
5530
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005531@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08005532cmd VkResult vkGetPhysicalDeviceSurfacePresentModesKHR(
5533 VkPhysicalDevice physicalDevice,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005534 VkSurfaceKHR surface,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005535 u32* pPresentModeCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005536 VkPresentModeKHR* pPresentModes) {
Jesse Hallb00daad2015-11-29 19:46:20 -08005537 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08005538
5539 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08005540 pPresentModeCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08005541 presentModes := pPresentModes[0:count]
5542
5543 for i in (0 .. count) {
5544 presentMode := ?
5545 presentModes[i] = presentMode
5546 }
5547
5548 return ?
5549}
5550
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005551@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005552cmd VkResult vkCreateSwapchainKHR(
5553 VkDevice device,
5554 const VkSwapchainCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005555 const VkAllocationCallbacks* pAllocator,
Michael Lentine88594d72015-11-12 12:49:45 -08005556 VkSwapchainKHR* pSwapchain) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005557 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR)
Michael Lentine88594d72015-11-12 12:49:45 -08005558 deviceObject := GetDevice(device)
5559
5560 swapchain := ?
5561 pSwapchain[0] = swapchain
5562 State.Swapchains[swapchain] = new!SwapchainObject(device: device)
5563
5564 return ?
5565}
5566
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005567@extension("VK_KHR_swapchain")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005568cmd void vkDestroySwapchainKHR(
Michael Lentine88594d72015-11-12 12:49:45 -08005569 VkDevice device,
Jesse Hall0e74f002015-11-30 11:37:59 -08005570 VkSwapchainKHR swapchain,
5571 const VkAllocationCallbacks* pAllocator) {
Michael Lentine88594d72015-11-12 12:49:45 -08005572 deviceObject := GetDevice(device)
5573 swapchainObject := GetSwapchain(swapchain)
5574 assert(swapchainObject.device == device)
5575
5576 State.Swapchains[swapchain] = null
Michael Lentine88594d72015-11-12 12:49:45 -08005577}
5578
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005579@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005580cmd VkResult vkGetSwapchainImagesKHR(
5581 VkDevice device,
5582 VkSwapchainKHR swapchain,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005583 u32* pSwapchainImageCount,
Michael Lentine88594d72015-11-12 12:49:45 -08005584 VkImage* pSwapchainImages) {
5585 deviceObject := GetDevice(device)
5586
5587 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08005588 pSwapchainImageCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08005589 swapchainImages := pSwapchainImages[0:count]
5590
5591 for i in (0 .. count) {
5592 swapchainImage := ?
5593 swapchainImages[i] = swapchainImage
Jesse Hall1356b0d2015-11-23 17:24:58 -08005594 State.Images[swapchainImage] = new!ImageObject(device: device)
Michael Lentine88594d72015-11-12 12:49:45 -08005595 }
5596
5597 return ?
5598}
5599
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005600@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005601cmd VkResult vkAcquireNextImageKHR(
5602 VkDevice device,
5603 VkSwapchainKHR swapchain,
5604 u64 timeout,
5605 VkSemaphore semaphore,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005606 VkFence fence,
Michael Lentine88594d72015-11-12 12:49:45 -08005607 u32* pImageIndex) {
5608 deviceObject := GetDevice(device)
5609 swapchainObject := GetSwapchain(swapchain)
5610
5611 imageIndex := ?
5612 pImageIndex[0] = imageIndex
5613
5614 return ?
5615}
5616
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005617@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005618cmd VkResult vkQueuePresentKHR(
5619 VkQueue queue,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08005620 const VkPresentInfoKHR* pPresentInfo) {
Michael Lentine88594d72015-11-12 12:49:45 -08005621 queueObject := GetQueue(queue)
5622
5623 presentInfo := ?
5624 pPresentInfo[0] = presentInfo
5625
5626 return ?
5627}
5628
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005629@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005630cmd VkResult vkGetPhysicalDeviceDisplayPropertiesKHR(
5631 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005632 u32* pPropertyCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005633 VkDisplayPropertiesKHR* pProperties) {
5634 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5635 return ?
5636}
5637
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005638@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005639cmd VkResult vkGetPhysicalDeviceDisplayPlanePropertiesKHR(
5640 VkPhysicalDevice physicalDevice,
5641 u32* pPropertyCount,
5642 VkDisplayPlanePropertiesKHR* pProperties) {
5643 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5644 return ?
5645}
5646
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005647@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005648cmd VkResult vkGetDisplayPlaneSupportedDisplaysKHR(
5649 VkPhysicalDevice physicalDevice,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005650 u32 planeIndex,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08005651 u32* pDisplayCount,
5652 VkDisplayKHR* pDisplays) {
Jesse Halla6429252015-11-29 18:59:42 -08005653 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5654 return ?
5655}
5656
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005657@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005658cmd VkResult vkGetDisplayModePropertiesKHR(
5659 VkPhysicalDevice physicalDevice,
5660 VkDisplayKHR display,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005661 u32* pPropertyCount,
5662 VkDisplayModePropertiesKHR* pProperties) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005663 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5664 return ?
5665}
5666
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005667@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005668cmd VkResult vkCreateDisplayModeKHR(
5669 VkPhysicalDevice physicalDevice,
5670 VkDisplayKHR display,
5671 const VkDisplayModeCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005672 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005673 VkDisplayModeKHR* pMode) {
5674 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5675 return ?
5676}
5677
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005678@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005679cmd VkResult vkGetDisplayPlaneCapabilitiesKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005680 VkPhysicalDevice physicalDevice,
Jesse Hall9ba8bc82015-11-30 16:22:16 -08005681 VkDisplayModeKHR mode,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005682 u32 planeIndex,
Jesse Halla6429252015-11-29 18:59:42 -08005683 VkDisplayPlaneCapabilitiesKHR* pCapabilities) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005684 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5685 return ?
5686}
5687
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005688@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005689cmd VkResult vkCreateDisplayPlaneSurfaceKHR(
5690 VkInstance instance,
5691 const VkDisplaySurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005692 const VkAllocationCallbacks* pAllocator,
Jesse Halla6429252015-11-29 18:59:42 -08005693 VkSurfaceKHR* pSurface) {
5694 return ?
5695}
5696
Jesse Hall9ba8bc82015-11-30 16:22:16 -08005697@extension("VK_KHR_display_swapchain")
5698cmd VkResult vkCreateSharedSwapchainsKHR(
5699 VkDevice device,
5700 u32 swapchainCount,
5701 const VkSwapchainCreateInfoKHR* pCreateInfos,
5702 const VkAllocationCallbacks* pAllocator,
5703 VkSwapchainKHR* pSwapchains) {
5704 return ?
5705}
5706
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005707@extension("VK_KHR_xlib_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005708cmd VkResult vkCreateXlibSurfaceKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005709 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005710 const VkXlibSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005711 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005712 VkSurfaceKHR* pSurface) {
5713 instanceObject := GetInstance(instance)
5714 return ?
5715}
5716
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005717@extension("VK_KHR_xlib_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005718cmd VkBool32 vkGetPhysicalDeviceXlibPresentationSupportKHR(
5719 VkPhysicalDevice physicalDevice,
5720 u32 queueFamilyIndex,
5721 platform.Display* dpy,
Jesse Hall65ab5522015-11-30 00:07:16 -08005722 platform.VisualID visualID) {
Jesse Halla6429252015-11-29 18:59:42 -08005723 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5724 return ?
5725}
5726
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005727@extension("VK_KHR_xcb_surface")
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005728cmd VkResult vkCreateXcbSurfaceKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005729 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005730 const VkXcbSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005731 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005732 VkSurfaceKHR* pSurface) {
5733 instanceObject := GetInstance(instance)
5734 return ?
5735}
5736
Jesse Hall523db342015-11-30 21:12:55 -08005737@extension("VK_KHR_xcb_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005738cmd VkBool32 vkGetPhysicalDeviceXcbPresentationSupportKHR(
5739 VkPhysicalDevice physicalDevice,
5740 u32 queueFamilyIndex,
5741 platform.xcb_connection_t* connection,
5742 platform.xcb_visualid_t visual_id) {
5743 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5744 return ?
5745}
5746
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005747@extension("VK_KHR_wayland_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005748cmd VkResult vkCreateWaylandSurfaceKHR(
5749 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005750 const VkWaylandSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005751 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005752 VkSurfaceKHR* pSurface) {
5753 instanceObject := GetInstance(instance)
5754 return ?
5755}
5756
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005757@extension("VK_KHR_wayland_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005758cmd VkBool32 vkGetPhysicalDeviceWaylandPresentationSupportKHR(
5759 VkPhysicalDevice physicalDevice,
5760 u32 queueFamilyIndex,
5761 platform.wl_display* display) {
5762 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5763 return ?
5764}
5765
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005766@extension("VK_KHR_mir_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005767cmd VkResult vkCreateMirSurfaceKHR(
5768 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005769 const VkMirSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005770 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005771 VkSurfaceKHR* pSurface) {
5772 instanceObject := GetInstance(instance)
5773 return ?
5774}
5775
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005776@extension("VK_KHR_mir_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005777cmd VkBool32 vkGetPhysicalDeviceMirPresentationSupportKHR(
5778 VkPhysicalDevice physicalDevice,
5779 u32 queueFamilyIndex,
5780 platform.MirConnection* connection) {
5781 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5782 return ?
5783}
5784
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005785@extension("VK_KHR_android_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005786cmd VkResult vkCreateAndroidSurfaceKHR(
5787 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005788 const VkAndroidSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005789 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005790 VkSurfaceKHR* pSurface) {
5791 instanceObject := GetInstance(instance)
5792 return ?
5793}
5794
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005795@extension("VK_KHR_win32_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005796cmd VkResult vkCreateWin32SurfaceKHR(
5797 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005798 const VkWin32SurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005799 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005800 VkSurfaceKHR* pSurface) {
5801 instanceObject := GetInstance(instance)
5802 return ?
5803}
5804
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005805@extension("VK_KHR_win32_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005806cmd VkResult vkGetPhysicalDeviceWin32PresentationSupportKHR(
5807 VkPhysicalDevice physicalDevice,
5808 u32 queueFamilyIndex) {
Jesse Halle2948d82016-02-25 04:19:32 -08005809 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Jesse Halla6429252015-11-29 18:59:42 -08005810 return ?
5811}
5812
Chia-I Wub262ddc2016-03-22 07:38:20 +08005813@extension("VK_ANDROID_native_buffer")
5814cmd VkResult vkGetSwapchainGrallocUsageANDROID(
5815 VkDevice device,
5816 VkFormat format,
5817 VkImageUsageFlags imageUsage,
5818 int* grallocUsage) {
5819 return ?
5820}
5821
5822@extension("VK_ANDROID_native_buffer")
Chris Forbes8e4438b2016-12-07 16:26:49 +13005823cmd VkResult vkGetSwapchainGrallocUsage2ANDROID(
5824 VkDevice device,
5825 VkFormat format,
5826 VkImageUsageFlags imageUsage,
5827 VkSwapchainImageUsageFlagsANDROID swapchainImageUsage,
5828 int* grallocUsage) {
5829 return ?
5830}
5831
5832@extension("VK_ANDROID_native_buffer")
Chia-I Wub262ddc2016-03-22 07:38:20 +08005833cmd VkResult vkAcquireImageANDROID(
5834 VkDevice device,
5835 VkImage image,
5836 int nativeFenceFd,
5837 VkSemaphore semaphore,
5838 VkFence fence) {
5839 return ?
5840}
5841
5842@extension("VK_ANDROID_native_buffer")
5843cmd VkResult vkQueueSignalReleaseImageANDROID(
5844 VkQueue queue,
5845 u32 waitSemaphoreCount,
5846 const VkSemaphore* pWaitSemaphores,
5847 VkImage image,
5848 int* pNativeFenceFd) {
5849 return ?
5850}
5851
Ian Elliott4c8bb2a2016-12-29 11:07:26 -07005852@extension("VK_GOOGLE_display_timing")
5853cmd VkResult vkGetRefreshCycleDurationGOOGLE(
5854 VkDevice device,
5855 VkSwapchainKHR swapchain,
5856 VkRefreshCycleDurationGOOGLE* pDisplayTimingProperties) {
5857 deviceObject := GetDevice(device)
5858 swapchainObject := GetSwapchain(swapchain)
5859
5860 displayTimingProperties := ?
5861 pDisplayTimingProperties[0] = displayTimingProperties
5862
5863 return ?
5864}
5865
5866@extension("VK_GOOGLE_display_timing")
5867cmd VkResult vkGetPastPresentationTimingGOOGLE(
5868 VkDevice device,
5869 VkSwapchainKHR swapchain,
5870 u32* pPresentationTimingCount,
5871 VkPastPresentationTimingGOOGLE* pPresentationTimings) {
Ian Elliott4c8bb2a2016-12-29 11:07:26 -07005872 return ?
5873}
5874
Jesse Hall715b86a2016-01-16 16:34:29 -08005875@extension("VK_EXT_debug_report")
5876@external type void* PFN_vkDebugReportCallbackEXT
5877@extension("VK_EXT_debug_report")
5878@pfn cmd VkBool32 vkDebugReportCallbackEXT(
5879 VkDebugReportFlagsEXT flags,
5880 VkDebugReportObjectTypeEXT objectType,
5881 u64 object,
5882 platform.size_t location,
5883 s32 messageCode,
5884 const char* pLayerPrefix,
5885 const char* pMessage,
5886 void* pUserData) {
5887 return ?
5888}
5889
5890@extension("VK_EXT_debug_report")
5891cmd VkResult vkCreateDebugReportCallbackEXT(
5892 VkInstance instance,
5893 const VkDebugReportCallbackCreateInfoEXT* pCreateInfo,
5894 const VkAllocationCallbacks* pAllocator,
5895 VkDebugReportCallbackEXT* pCallback) {
5896 return ?
5897}
5898
5899@extension("VK_EXT_debug_report")
5900cmd void vkDestroyDebugReportCallbackEXT(
5901 VkInstance instance,
5902 VkDebugReportCallbackEXT callback,
5903 const VkAllocationCallbacks* pAllocator) {
5904}
5905
5906@extension("VK_EXT_debug_report")
5907cmd void vkDebugReportMessageEXT(
5908 VkInstance instance,
5909 VkDebugReportFlagsEXT flags,
5910 VkDebugReportObjectTypeEXT objectType,
5911 u64 object,
5912 platform.size_t location,
5913 s32 messageCode,
5914 const char* pLayerPrefix,
5915 const char* pMessage) {
5916}
5917
Jesse Hall26763382016-05-20 07:13:52 -07005918@extension("VK_EXT_debug_marker")
5919cmd VkResult vkDebugMarkerSetObjectTagEXT(
5920 VkDevice device,
5921 VkDebugMarkerObjectTagInfoEXT* pTagInfo) {
5922 return ?
5923}
5924
5925@extension("VK_EXT_debug_marker")
5926cmd VkResult vkDebugMarkerSetObjectNameEXT(
5927 VkDevice device,
5928 VkDebugMarkerObjectNameInfoEXT* pNameInfo) {
5929 return ?
5930}
5931
5932@extension("VK_EXT_debug_marker")
5933cmd void vkCmdDebugMarkerBeginEXT(
5934 VkCommandBuffer commandBuffer,
5935 VkDebugMarkerMarkerInfoEXT* pMarkerInfo) {
5936}
5937
5938@extension("VK_EXT_debug_marker")
5939cmd void vkCmdDebugMarkerEndEXT(
5940 VkCommandBuffer commandBuffer) {
5941}
5942
5943@extension("VK_EXT_debug_marker")
5944cmd void vkCmdDebugMarkerInsertEXT(
5945 VkCommandBuffer commandBuffer,
5946 VkDebugMarkerMarkerInfoEXT* pMarkerInfo) {
5947}
5948
Chris Forbes1194ede2016-12-30 16:29:25 +13005949@extension("VK_KHR_get_physical_device_properties2")
5950cmd void vkGetPhysicalDeviceFeatures2KHR(
5951 VkPhysicalDevice physicalDevice,
5952 VkPhysicalDeviceFeatures2KHR* pFeatures) {
5953}
5954
5955@extension("VK_KHR_get_physical_device_properties2")
5956cmd void vkGetPhysicalDeviceProperties2KHR(
5957 VkPhysicalDevice physicalDevice,
5958 VkPhysicalDeviceProperties2KHR* pProperties) {
5959}
5960
5961@extension("VK_KHR_get_physical_device_properties2")
5962cmd void vkGetPhysicalDeviceFormatProperties2KHR(
5963 VkPhysicalDevice physicalDevice,
5964 VkFormat format,
5965 VkFormatProperties2KHR* pFormatProperties) {
5966}
5967
5968@extension("VK_KHR_get_physical_device_properties2")
5969cmd VkResult vkGetPhysicalDeviceImageFormatProperties2KHR(
5970 VkPhysicalDevice physicalDevice,
5971 const VkPhysicalDeviceImageFormatInfo2KHR* pImageFormatInfo,
5972 VkImageFormatProperties2KHR* pImageFormatProperties) {
5973 return ?
5974}
5975
5976@extension("VK_KHR_get_physical_device_properties2")
5977cmd void vkGetPhysicalDeviceQueueFamilyProperties2KHR(
5978 VkPhysicalDevice physicalDevice,
5979 u32* pQueueFamilyPropertyCount,
5980 VkQueueFamilyProperties2KHR* pQueueFamilyProperties) {
5981}
5982
5983@extension("VK_KHR_get_physical_device_properties2")
5984cmd void vkGetPhysicalDeviceMemoryProperties2KHR(
5985 VkPhysicalDevice physicalDevice,
5986 VkPhysicalDeviceMemoryProperties2KHR* pMemoryProperties) {
5987}
5988
5989@extension("VK_KHR_get_physical_device_properties2")
5990cmd void vkGetPhysicalDeviceSparseImageFormatProperties2KHR(
5991 VkPhysicalDevice physicalDevice,
5992 const VkPhysicalDeviceSparseImageFormatInfo2KHR* pFormatInfo,
5993 u32* pPropertyCount,
5994 VkSparseImageFormatProperties2KHR* pProperties) {
5995}
5996
Chris Forbes289cb792016-12-30 15:03:55 +13005997@extension("VK_AMD_draw_indirect_count")
5998cmd void vkCmdDrawIndirectCountAMD(
5999 VkCommandBuffer commandBuffer,
6000 VkBuffer buffer,
6001 VkDeviceSize offset,
6002 VkBuffer countBuffer,
6003 VkDeviceSize countBufferOffset,
6004 u32 maxDrawCount,
6005 u32 stride) {
6006}
6007
6008@extension("VK_AMD_draw_indirect_count")
6009cmd void vkCmdDrawIndexedIndirectCountAMD(
6010 VkCommandBuffer commandBuffer,
6011 VkBuffer buffer,
6012 VkDeviceSize offset,
6013 VkBuffer countBuffer,
6014 VkDeviceSize countBufferOffset,
6015 u32 maxDrawCount,
6016 u32 stride) {
6017}
6018
6019@extension("VK_NV_external_memory_capabilities")
6020cmd VkResult vkGetPhysicalDeviceExternalImageFormatPropertiesNV(
6021 VkPhysicalDevice physicalDevice,
6022 VkFormat format,
6023 VkImageType type,
6024 VkImageTiling tiling,
6025 VkImageUsageFlags usage,
6026 VkImageCreateFlags flags,
6027 VkExternalMemoryHandleTypeFlagsNV externalHandleType,
6028 VkExternalImageFormatPropertiesNV* pExternalImageFormatProperties) {
6029 return ?
6030}
6031
6032@extension("VK_NV_external_memory_win32")
6033cmd VkResult vkGetMemoryWin32HandleNV(
6034 VkDevice device,
6035 VkDeviceMemory memory,
6036 VkExternalMemoryHandleTypeFlagsNV handleType,
6037 platform.HANDLE* pHandle) {
6038 return ?
6039}
6040
6041@extension("VK_NV_external_memory_win32")
6042cmd void vkCmdProcessCommandsNVX(
6043 VkCommandBuffer commandBuffer,
6044 const VkCmdProcessCommandsInfoNVX* pProcessCommandsInfo) {
6045}
6046
6047@extension("VK_NV_external_memory_win32")
6048cmd void vkCmdReserveSpaceForCommandsNVX(
6049 VkCommandBuffer commandBuffer,
6050 const VkCmdReserveSpaceForCommandsInfoNVX* pReserveSpaceInfo) {
6051}
6052
6053@extension("VK_NV_external_memory_win32")
6054cmd VkResult vkCreateIndirectCommandsLayoutNVX(
6055 VkDevice device,
6056 const VkIndirectCommandsLayoutCreateInfoNVX* pCreateInfo,
6057 const VkAllocationCallbacks* pAllocator,
6058 VkIndirectCommandsLayoutNVX* pIndirectCommandsLayout) {
6059 return ?
6060}
6061
6062@extension("VK_NV_external_memory_win32")
6063cmd void vkDestroyIndirectCommandsLayoutNVX(
6064 VkDevice device,
6065 VkIndirectCommandsLayoutNVX indirectCommandsLayout,
6066 const VkAllocationCallbacks* pAllocator) {
6067}
6068
6069@extension("VK_NV_external_memory_win32")
6070cmd VkResult vkCreateObjectTableNVX(
6071 VkDevice device,
6072 const VkObjectTableCreateInfoNVX* pCreateInfo,
6073 const VkAllocationCallbacks* pAllocator,
6074 VkObjectTableNVX* pObjectTable) {
6075 return ?
6076}
6077
6078@extension("VK_NV_external_memory_win32")
6079cmd void vkDestroyObjectTableNVX(
6080 VkDevice device,
6081 VkObjectTableNVX objectTable,
6082 const VkAllocationCallbacks* pAllocator) {
6083}
6084
6085@extension("VK_NV_external_memory_win32")
6086cmd VkResult vkRegisterObjectsNVX(
6087 VkDevice device,
6088 VkObjectTableNVX objectTable,
6089 u32 objectCount,
6090 const VkObjectTableEntryNVX* const* ppObjectTableEntries,
6091 const u32* pObjectIndices) {
6092 return ?
6093}
6094
6095@extension("VK_NV_external_memory_win32")
6096cmd VkResult vkUnregisterObjectsNVX(
6097 VkDevice device,
6098 VkObjectTableNVX objectTable,
6099 u32 objectCount,
6100 const VkObjectEntryTypeNVX* pObjectEntryTypes,
6101 const u32* pObjectIndices) {
6102 return ?
6103}
6104
6105@extension("VK_NV_external_memory_win32")
6106cmd void vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX(
6107 VkPhysicalDevice physicalDevice,
6108 VkDeviceGeneratedCommandsFeaturesNVX* pFeatures,
6109 VkDeviceGeneratedCommandsLimitsNVX* pLimits) {
6110}
6111
Jesse Halld27f6aa2015-08-15 17:58:48 -07006112
6113////////////////
6114// Validation //
6115////////////////
6116
6117extern void validate(string layerName, bool condition, string message)
6118
6119
6120/////////////////////////////
6121// Internal State Tracking //
6122/////////////////////////////
6123
6124StateObject State
6125
6126@internal class StateObject {
6127 // Dispatchable objects.
6128 map!(VkInstance, ref!InstanceObject) Instances
6129 map!(VkPhysicalDevice, ref!PhysicalDeviceObject) PhysicalDevices
6130 map!(VkDevice, ref!DeviceObject) Devices
6131 map!(VkQueue, ref!QueueObject) Queues
Jesse Hall3fbc8562015-11-29 22:10:52 -08006132 map!(VkCommandBuffer, ref!CommandBufferObject) CommandBuffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07006133
6134 // Non-dispatchable objects.
6135 map!(VkDeviceMemory, ref!DeviceMemoryObject) DeviceMemories
6136 map!(VkBuffer, ref!BufferObject) Buffers
6137 map!(VkBufferView, ref!BufferViewObject) BufferViews
6138 map!(VkImage, ref!ImageObject) Images
6139 map!(VkImageView, ref!ImageViewObject) ImageViews
Jesse Halld27f6aa2015-08-15 17:58:48 -07006140 map!(VkShaderModule, ref!ShaderModuleObject) ShaderModules
Jesse Halld27f6aa2015-08-15 17:58:48 -07006141 map!(VkPipeline, ref!PipelineObject) Pipelines
6142 map!(VkPipelineLayout, ref!PipelineLayoutObject) PipelineLayouts
6143 map!(VkSampler, ref!SamplerObject) Samplers
6144 map!(VkDescriptorSet, ref!DescriptorSetObject) DescriptorSets
6145 map!(VkDescriptorSetLayout, ref!DescriptorSetLayoutObject) DescriptorSetLayouts
6146 map!(VkDescriptorPool, ref!DescriptorPoolObject) DescriptorPools
Jesse Halld27f6aa2015-08-15 17:58:48 -07006147 map!(VkFence, ref!FenceObject) Fences
6148 map!(VkSemaphore, ref!SemaphoreObject) Semaphores
6149 map!(VkEvent, ref!EventObject) Events
6150 map!(VkQueryPool, ref!QueryPoolObject) QueryPools
6151 map!(VkFramebuffer, ref!FramebufferObject) Framebuffers
6152 map!(VkRenderPass, ref!RenderPassObject) RenderPasses
6153 map!(VkPipelineCache, ref!PipelineCacheObject) PipelineCaches
Jesse Hall3fbc8562015-11-29 22:10:52 -08006154 map!(VkCommandPool, ref!CommandPoolObject) CommandPools
Jesse Hall1356b0d2015-11-23 17:24:58 -08006155 map!(VkSurfaceKHR, ref!SurfaceObject) Surfaces
Michael Lentine88594d72015-11-12 12:49:45 -08006156 map!(VkSwapchainKHR, ref!SwapchainObject) Swapchains
Jesse Halld27f6aa2015-08-15 17:58:48 -07006157}
6158
6159@internal class InstanceObject {
6160}
6161
6162@internal class PhysicalDeviceObject {
6163 VkInstance instance
6164}
6165
6166@internal class DeviceObject {
6167 VkPhysicalDevice physicalDevice
6168}
6169
6170@internal class QueueObject {
6171 VkDevice device
6172 VkQueueFlags flags
6173}
6174
Jesse Hall3fbc8562015-11-29 22:10:52 -08006175@internal class CommandBufferObject {
Jesse Halld27f6aa2015-08-15 17:58:48 -07006176 VkDevice device
6177 map!(u64, VkDeviceMemory) boundObjects
6178 VkQueueFlags queueFlags
6179}
6180
6181@internal class DeviceMemoryObject {
Jesse Hall3fbc8562015-11-29 22:10:52 -08006182 VkDevice device
6183 VkDeviceSize allocationSize
6184 map!(u64, VkDeviceSize) boundObjects
6185 map!(VkCommandBuffer, VkCommandBuffer) boundCommandBuffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07006186}
6187
6188@internal class BufferObject {
6189 VkDevice device
Jesse Hall3fbc8562015-11-29 22:10:52 -08006190 VkDeviceMemory memory
6191 VkDeviceSize memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07006192}
6193
6194@internal class BufferViewObject {
6195 VkDevice device
6196 VkBuffer buffer
6197}
6198
6199@internal class ImageObject {
6200 VkDevice device
Jesse Hall3fbc8562015-11-29 22:10:52 -08006201 VkDeviceMemory memory
6202 VkDeviceSize memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07006203}
6204
6205@internal class ImageViewObject {
6206 VkDevice device
6207 VkImage image
6208}
6209
Jesse Halld27f6aa2015-08-15 17:58:48 -07006210@internal class ShaderObject {
6211 VkDevice device
6212}
6213
6214@internal class ShaderModuleObject {
6215 VkDevice device
6216}
6217
6218@internal class PipelineObject {
6219 VkDevice device
6220}
6221
6222@internal class PipelineLayoutObject {
6223 VkDevice device
6224}
6225
6226@internal class SamplerObject {
6227 VkDevice device
6228}
6229
6230@internal class DescriptorSetObject {
6231 VkDevice device
6232}
6233
6234@internal class DescriptorSetLayoutObject {
6235 VkDevice device
6236}
6237
6238@internal class DescriptorPoolObject {
6239 VkDevice device
6240}
6241
Jesse Halld27f6aa2015-08-15 17:58:48 -07006242@internal class FenceObject {
6243 VkDevice device
6244 bool signaled
6245}
6246
6247@internal class SemaphoreObject {
6248 VkDevice device
6249}
6250
6251@internal class EventObject {
6252 VkDevice device
6253}
6254
6255@internal class QueryPoolObject {
6256 VkDevice device
6257}
6258
6259@internal class FramebufferObject {
6260 VkDevice device
6261}
6262
6263@internal class RenderPassObject {
6264 VkDevice device
6265}
6266
6267@internal class PipelineCacheObject {
6268 VkDevice device
6269}
6270
Jesse Hall3fbc8562015-11-29 22:10:52 -08006271@internal class CommandPoolObject {
Jesse Halld27f6aa2015-08-15 17:58:48 -07006272 VkDevice device
6273}
6274
Jesse Hall1356b0d2015-11-23 17:24:58 -08006275@internal class SurfaceObject {
6276 VkInstance instance
6277}
6278
Michael Lentine88594d72015-11-12 12:49:45 -08006279@internal class SwapchainObject {
6280 VkDevice device
6281}
6282
Jesse Halld27f6aa2015-08-15 17:58:48 -07006283macro ref!InstanceObject GetInstance(VkInstance instance) {
6284 assert(instance in State.Instances)
6285 return State.Instances[instance]
6286}
6287
6288macro ref!PhysicalDeviceObject GetPhysicalDevice(VkPhysicalDevice physicalDevice) {
6289 assert(physicalDevice in State.PhysicalDevices)
6290 return State.PhysicalDevices[physicalDevice]
6291}
6292
6293macro ref!DeviceObject GetDevice(VkDevice device) {
6294 assert(device in State.Devices)
6295 return State.Devices[device]
6296}
6297
6298macro ref!QueueObject GetQueue(VkQueue queue) {
6299 assert(queue in State.Queues)
6300 return State.Queues[queue]
6301}
6302
Jesse Hall3fbc8562015-11-29 22:10:52 -08006303macro ref!CommandBufferObject GetCommandBuffer(VkCommandBuffer commandBuffer) {
6304 assert(commandBuffer in State.CommandBuffers)
6305 return State.CommandBuffers[commandBuffer]
Jesse Halld27f6aa2015-08-15 17:58:48 -07006306}
6307
Jesse Hall3fbc8562015-11-29 22:10:52 -08006308macro ref!DeviceMemoryObject GetDeviceMemory(VkDeviceMemory memory) {
6309 assert(memory in State.DeviceMemories)
6310 return State.DeviceMemories[memory]
Jesse Halld27f6aa2015-08-15 17:58:48 -07006311}
6312
6313macro ref!BufferObject GetBuffer(VkBuffer buffer) {
6314 assert(buffer in State.Buffers)
6315 return State.Buffers[buffer]
6316}
6317
6318macro ref!BufferViewObject GetBufferView(VkBufferView bufferView) {
6319 assert(bufferView in State.BufferViews)
6320 return State.BufferViews[bufferView]
6321}
6322
6323macro ref!ImageObject GetImage(VkImage image) {
6324 assert(image in State.Images)
6325 return State.Images[image]
6326}
6327
6328macro ref!ImageViewObject GetImageView(VkImageView imageView) {
6329 assert(imageView in State.ImageViews)
6330 return State.ImageViews[imageView]
6331}
6332
Jesse Halld27f6aa2015-08-15 17:58:48 -07006333macro ref!ShaderModuleObject GetShaderModule(VkShaderModule shaderModule) {
6334 assert(shaderModule in State.ShaderModules)
6335 return State.ShaderModules[shaderModule]
6336}
6337
6338macro ref!PipelineObject GetPipeline(VkPipeline pipeline) {
6339 assert(pipeline in State.Pipelines)
6340 return State.Pipelines[pipeline]
6341}
6342
6343macro ref!PipelineLayoutObject GetPipelineLayout(VkPipelineLayout pipelineLayout) {
6344 assert(pipelineLayout in State.PipelineLayouts)
6345 return State.PipelineLayouts[pipelineLayout]
6346}
6347
6348macro ref!SamplerObject GetSampler(VkSampler sampler) {
6349 assert(sampler in State.Samplers)
6350 return State.Samplers[sampler]
6351}
6352
6353macro ref!DescriptorSetObject GetDescriptorSet(VkDescriptorSet descriptorSet) {
6354 assert(descriptorSet in State.DescriptorSets)
6355 return State.DescriptorSets[descriptorSet]
6356}
6357
6358macro ref!DescriptorSetLayoutObject GetDescriptorSetLayout(VkDescriptorSetLayout descriptorSetLayout) {
6359 assert(descriptorSetLayout in State.DescriptorSetLayouts)
6360 return State.DescriptorSetLayouts[descriptorSetLayout]
6361}
6362
6363macro ref!DescriptorPoolObject GetDescriptorPool(VkDescriptorPool descriptorPool) {
6364 assert(descriptorPool in State.DescriptorPools)
6365 return State.DescriptorPools[descriptorPool]
6366}
6367
Jesse Halld27f6aa2015-08-15 17:58:48 -07006368macro ref!FenceObject GetFence(VkFence fence) {
6369 assert(fence in State.Fences)
6370 return State.Fences[fence]
6371}
6372
6373macro ref!SemaphoreObject GetSemaphore(VkSemaphore semaphore) {
6374 assert(semaphore in State.Semaphores)
6375 return State.Semaphores[semaphore]
6376}
6377
6378macro ref!EventObject GetEvent(VkEvent event) {
6379 assert(event in State.Events)
6380 return State.Events[event]
6381}
6382
6383macro ref!QueryPoolObject GetQueryPool(VkQueryPool queryPool) {
6384 assert(queryPool in State.QueryPools)
6385 return State.QueryPools[queryPool]
6386}
6387
6388macro ref!FramebufferObject GetFramebuffer(VkFramebuffer framebuffer) {
6389 assert(framebuffer in State.Framebuffers)
6390 return State.Framebuffers[framebuffer]
6391}
6392
6393macro ref!RenderPassObject GetRenderPass(VkRenderPass renderPass) {
6394 assert(renderPass in State.RenderPasses)
6395 return State.RenderPasses[renderPass]
6396}
6397
6398macro ref!PipelineCacheObject GetPipelineCache(VkPipelineCache pipelineCache) {
6399 assert(pipelineCache in State.PipelineCaches)
6400 return State.PipelineCaches[pipelineCache]
6401}
6402
Jesse Hall3fbc8562015-11-29 22:10:52 -08006403macro ref!CommandPoolObject GetCommandPool(VkCommandPool commandPool) {
6404 assert(commandPool in State.CommandPools)
6405 return State.CommandPools[commandPool]
Jesse Hallf09c6b12015-08-15 19:54:28 -07006406}
Michael Lentine88594d72015-11-12 12:49:45 -08006407
Jesse Hall1356b0d2015-11-23 17:24:58 -08006408macro ref!SurfaceObject GetSurface(VkSurfaceKHR surface) {
6409 assert(surface in State.Surfaces)
6410 return State.Surfaces[surface]
6411}
6412
Michael Lentine88594d72015-11-12 12:49:45 -08006413macro ref!SwapchainObject GetSwapchain(VkSwapchainKHR swapchain) {
6414 assert(swapchain in State.Swapchains)
6415 return State.Swapchains[swapchain]
6416}
Jesse Halld8bade02015-11-24 10:24:18 -08006417
6418macro VkQueueFlags AddQueueFlag(VkQueueFlags flags, VkQueueFlagBits bit) {
6419 return as!VkQueueFlags(as!u32(flags) | as!u32(bit))
6420}