blob: ed89fc624122770464c9b9f7a27c2b558fad7c8f [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
Ian Elliott948233a2017-01-06 12:13:23 -07002889@extension("VK_KHR_incremental_present")
2890class VkRectLayerKHR {
2891 VkOffset2D offset
2892 VkExtent2D extent
2893 uint32_t layer
2894}
2895
2896@extension("VK_KHR_incremental_present")
2897class VkPresentRegionKHR {
2898 uint32_t rectangleCount
2899 const VkRectLayerKHR* pRectangles
2900}
2901
2902@extension("VK_KHR_incremental_present")
2903class VkPresentRegionsKHR {
2904 VkStructureType sType
2905 const void* pNext
2906 uint32_t swapchainCount
2907 const VkPresentRegionKHR* pRegions
2908}
2909
Chia-I Wub262ddc2016-03-22 07:38:20 +08002910@extension("VK_ANDROID_native_buffer")
2911class VkNativeBufferANDROID {
2912 VkStructureType sType
2913 const void* pNext
2914 platform.buffer_handle_t handle
2915 int stride
2916 int format
2917 int usage
2918}
2919
Chris Forbes8e4438b2016-12-07 16:26:49 +13002920@extension("VK_ANDROID_native_buffer")
2921class VkSwapchainImageCreateInfoANDROID {
2922 VkStructureType sType
2923 const void* pNext
2924 VkSwapchainImageUsageFlagBitsANDROID flags
Ian Elliott4c8bb2a2016-12-29 11:07:26 -07002925
2926@extension("VK_GOOGLE_display_timing")
2927class VkRefreshCycleDurationGOOGLE {
2928 uint64_t minRefreshDuration
2929 uint64_t maxRefreshDuration
2930}
2931
2932@extension("VK_GOOGLE_display_timing")
2933class VkPastPresentationTimingGOOGLE {
2934 uint32_t presentID
2935 uint64_t desiredPresentTime
2936 uint64_t actualPresentTime
2937 uint64_t earliestPresentTime
2938 uint64_t presentMargin
2939}
2940
2941@extension("VK_GOOGLE_display_timing")
2942class VkPresentTimeGOOGLE {
2943 uint32_t presentID
2944 uint64_t desiredPresentTime
2945}
2946
2947@extension("VK_GOOGLE_display_timing")
2948class VkPresentTimesInfoGOOGLE {
2949 VkStructureType sType
2950 const void* pNext
2951 uint32_t swapchainCount
2952 const VkPresentTimeGOOGLE* pTimes
Chris Forbes8e4438b2016-12-07 16:26:49 +13002953}
2954
Jesse Hall715b86a2016-01-16 16:34:29 -08002955@extension("VK_EXT_debug_report")
2956class VkDebugReportCallbackCreateInfoEXT {
2957 VkStructureType sType
2958 const void* pNext
2959 VkDebugReportFlagsEXT flags
2960 PFN_vkDebugReportCallbackEXT pfnCallback
2961 void* pUserData
2962}
2963
Jesse Hall26763382016-05-20 07:13:52 -07002964@extension("VK_AMD_rasterization_order")
2965class VkPipelineRasterizationStateRasterizationOrderAMD {
2966 VkStructureType sType
2967 const void* pNext
2968 VkRasterizationOrderAMD rasterizationOrder
2969}
2970
2971@extension("VK_EXT_debug_marker")
2972class VkDebugMarkerObjectNameInfoEXT {
2973 VkStructureType sType
2974 const void* pNext
2975 VkDebugReportObjectTypeEXT objectType
2976 u64 object
2977 const char* pObjectName
2978}
2979
2980@extension("VK_EXT_debug_marker")
2981class VkDebugMarkerObjectTagInfoEXT {
2982 VkStructureType sType
2983 const void* pNext
2984 VkDebugReportObjectTypeEXT objectType
2985 u64 object
2986 u64 tagName
2987 platform.size_t tagSize
2988 const void* pTag
2989}
2990
2991@extension("VK_EXT_debug_marker")
2992class VkDebugMarkerMarkerInfoEXT {
2993 VkStructureType sType
2994 const void* pNext
2995 const char* pMarkerName
2996 f32[4] color
2997}
2998
Jesse Hall56d386a2016-07-26 15:20:40 -07002999@extension("VK_NV_dedicated_allocation")
3000class VkDedicatedAllocationImageCreateInfoNV {
3001 VkStructureType sType
3002 const void* pNext
3003 VkBool32 dedicatedAllocation
3004}
3005
3006@extension("VK_NV_dedicated_allocation")
3007class VkDedicatedAllocationBufferCreateInfoNV {
3008 VkStructureType sType
3009 const void* pNext
3010 VkBool32 dedicatedAllocation
3011}
3012
3013@extension("VK_NV_dedicated_allocation")
3014class VkDedicatedAllocationMemoryAllocateInfoNV {
3015 VkStructureType sType
3016 const void* pNext
3017 VkImage image
3018 VkBuffer buffer
3019}
3020
Chris Forbes1194ede2016-12-30 16:29:25 +13003021@extension("VK_KHR_get_physical_device_properties2")
3022class VkPhysicalDeviceFeatures2KHR {
3023 VkStructureType sType
3024 void* pNext
3025 VkPhysicalDeviceFeatures features
3026}
3027
3028@extension("VK_KHR_get_physical_device_properties2")
3029class VkPhysicalDeviceProperties2KHR {
3030 VkStructureType sType
3031 void* pNext
3032 VkPhysicalDeviceProperties properties
3033}
3034
3035@extension("VK_KHR_get_physical_device_properties2")
3036class VkFormatProperties2KHR {
3037 VkStructureType sType
3038 void* pNext
3039 VkFormatProperties formatProperties
3040}
3041
3042@extension("VK_KHR_get_physical_device_properties2")
3043class VkImageFormatProperties2KHR {
3044 VkStructureType sType
3045 void* pNext
3046 VkImageFormatProperties imageFormatProperties
3047}
3048
3049@extension("VK_KHR_get_physical_device_properties2")
3050class VkPhysicalDeviceImageFormatInfo2KHR {
3051 VkStructureType sType
3052 const void* pNext
3053 VkFormat format
3054 VkImageType type
3055 VkImageTiling tiling
3056 VkImageUsageFlags usage
3057 VkImageCreateFlags flags
3058}
3059
3060@extension("VK_KHR_get_physical_device_properties2")
3061class VkQueueFamilyProperties2KHR {
3062 VkStructureType sType
3063 void* pNext
3064 VkQueueFamilyProperties queueFamilyProperties
3065}
3066
3067@extension("VK_KHR_get_physical_device_properties2")
3068class VkPhysicalDeviceMemoryProperties2KHR {
3069 VkStructureType sType
3070 void* pNext
3071 VkPhysicalDeviceMemoryProperties memoryProperties
3072}
3073
3074@extension("VK_KHR_get_physical_device_properties2")
3075class VkSparseImageFormatProperties2KHR {
3076 VkStructureType sType
3077 void* pNext
3078 VkSparseImageFormatProperties properties
3079}
3080
3081@extension("VK_KHR_get_physical_device_properties2")
3082class VkPhysicalDeviceSparseImageFormatInfo2KHR {
3083 VkStructureType sType
3084 const void* pNext
3085 VkFormat format
3086 VkImageType type
3087 VkSampleCountFlagBits samples
3088 VkImageUsageFlags usage
3089 VkImageTiling tiling
3090}
3091
Chris Forbes289cb792016-12-30 15:03:55 +13003092@extension("VK_KHR_incremental_present")
3093class VkRectLayerKHR {
3094 VkOffset2D offset
3095 VkExtent2D extent
3096 u32 layer
3097}
3098
3099@extension("VK_KHR_incremental_present")
3100class VkPresentRegionKHR {
3101 u32 rectangleCount
3102 const VkRectLayerKHR* pRectangles
3103}
3104
3105@extension("VK_KHR_incremental_present")
3106class VkPresentRegionsKHR {
3107 VkStructureType sType
3108 const void* pNext
3109 u32 swapchainCount
3110 const VkPresentRegionKHR* pRegions
3111}
3112
3113@extension("VK_NV_external_memory_capabilities")
3114class VkExternalImageFormatPropertiesNV {
3115 VkImageFormatProperties imageFormatProperties
3116 VkExternalMemoryFeatureFlagsNV externalMemoryFeatures
3117 VkExternalMemoryHandleTypeFlagsNV exportFromImportedHandleTypes
3118 VkExternalMemoryHandleTypeFlagsNV compatibleHandleTypes
3119}
3120
3121@extension("VK_NV_external_memory")
3122class VkExternalMemoryImageCreateInfoNV {
3123 VkStructureType sType
3124 const void* pNext
3125 VkExternalMemoryHandleTypeFlagsNV handleTypes
3126}
3127
3128@extension("VK_NV_external_memory")
3129class VkExportMemoryAllocateInfoNV {
3130 VkStructureType sType
3131 const void* pNext
3132 VkExternalMemoryHandleTypeFlagsNV handleTypes
3133}
3134
3135@extension("VK_NV_external_memory_win32")
3136class VkImportMemoryWin32HandleInfoNV {
3137 VkStructureType sType
3138 const void* pNext
3139 VkExternalMemoryHandleTypeFlagsNV handleType
3140 platform.HANDLE handle
3141}
3142
3143@extension("VK_NV_external_memory_win32")
3144class VkExportMemoryWin32HandleInfoNV {
3145 VkStructureType sType
3146 const void* pNext
3147 const platform.SECURITY_ATTRIBUTES* pAttributes
3148 u32 dwAccess
3149}
3150
3151@extension("VK_NV_win32_keyed_mutex")
3152class VkWin32KeyedMutexAcquireReleaseInfoNV {
3153 VkStructureType sType
3154 const void* pNext
3155 u32 acquireCount
3156 const VkDeviceMemory* pAcquireSyncs
3157 const u64* pAcquireKeys
3158 const u32* pAcquireTimeoutMilliseconds
3159 u32 releaseCount
3160 const VkDeviceMemory* pReleaseSyncs
3161 const u64* pReleaseKeys
3162}
3163
3164@extension("VK_EXT_validation_flags")
3165class VkValidationFlagsEXT {
3166 VkStructureType sType
3167 const void* pNext
3168 u32 disabledValidationCheckCount
3169 VkValidationCheckEXT* pDisabledValidationChecks
3170}
3171
3172@extension("VK_NVX_device_generated_commands")
3173class VkDeviceGeneratedCommandsFeaturesNVX {
3174 VkStructureType sType
3175 const void* pNext
3176 VkBool32 computeBindingPointSupport
3177}
3178
3179@extension("VK_NVX_device_generated_commands")
3180class VkDeviceGeneratedCommandsLimitsNVX {
3181 VkStructureType sType
3182 const void* pNext
3183 u32 maxIndirectCommandsLayoutTokenCount
3184 u32 maxObjectEntryCounts
3185 u32 minSequenceCountBufferOffsetAlignment
3186 u32 minSequenceIndexBufferOffsetAlignment
3187 u32 minCommandsTokenBufferOffsetAlignment
3188}
3189
3190@extension("VK_NVX_device_generated_commands")
3191class VkIndirectCommandsTokenNVX {
3192 VkIndirectCommandsTokenTypeNVX tokenType
3193 VkBuffer buffer
3194 VkDeviceSize offset
3195}
3196
3197@extension("VK_NVX_device_generated_commands")
3198class VkIndirectCommandsLayoutTokenNVX {
3199 VkIndirectCommandsTokenTypeNVX tokenType
3200 u32 bindingUnit
3201 u32 dynamicCount
3202 u32 divisor
3203}
3204
3205@extension("VK_NVX_device_generated_commands")
3206class VkIndirectCommandsLayoutCreateInfoNVX {
3207 VkStructureType sType
3208 const void* pNext
3209 VkPipelineBindPoint pipelineBindPoint
3210 VkIndirectCommandsLayoutUsageFlagsNVX flags
3211 u32 tokenCount
3212 const VkIndirectCommandsLayoutTokenNVX* pTokens
3213}
3214
3215@extension("VK_NVX_device_generated_commands")
3216class VkCmdProcessCommandsInfoNVX {
3217 VkStructureType sType
3218 const void* pNext
3219 VkObjectTableNVX objectTable
3220 VkIndirectCommandsLayoutNVX indirectCommandsLayout
3221 u32 indirectCommandsTokenCount
3222 const VkIndirectCommandsTokenNVX* pIndirectCommandsTokens
3223 u32 maxSequencesCount
3224 VkCommandBuffer targetCommandBuffer
3225 VkBuffer sequencesCountBuffer
3226 VkDeviceSize sequencesCountOffset
3227 VkBuffer sequencesIndexBuffer
3228 VkDeviceSize sequencesIndexOffset
3229}
3230
3231@extension("VK_NVX_device_generated_commands")
3232class VkCmdReserveSpaceForCommandsInfoNVX {
3233 VkStructureType sType
3234 const void* pNext
3235 VkObjectTableNVX objectTable
3236 VkIndirectCommandsLayoutNVX indirectCommandsLayout
3237 u32 maxSequencesCount
3238}
3239
3240@extension("VK_NVX_device_generated_commands")
3241class VkObjectTableCreateInfoNVX {
3242 VkStructureType sType
3243 const void* pNext
3244 u32 objectCount
3245 const VkObjectEntryTypeNVX* pObjectEntryTypes
3246 const u32* pObjectEntryCounts
3247 const VkObjectEntryUsageFlagsNVX* pObjectEntryUsageFlags
3248 u32 maxUniformBuffersPerDescriptor
3249 u32 maxStorageBuffersPerDescriptor
3250 u32 maxStorageImagesPerDescriptor
3251 u32 maxSampledImagesPerDescriptor
3252 u32 maxPipelineLayouts
3253}
3254
3255@extension("VK_NVX_device_generated_commands")
3256class VkObjectTableEntryNVX {
3257 VkObjectEntryTypeNVX type
3258 VkObjectEntryUsageFlagsNVX flags
3259}
3260
3261@extension("VK_NVX_device_generated_commands")
3262class VkObjectTablePipelineEntryNVX {
3263 VkObjectEntryTypeNVX type
3264 VkObjectEntryUsageFlagsNVX flags
3265 VkPipeline pipeline
3266}
3267
3268@extension("VK_NVX_device_generated_commands")
3269class VkObjectTableDescriptorSetEntryNVX {
3270 VkObjectEntryTypeNVX type
3271 VkObjectEntryUsageFlagsNVX flags
3272 VkPipelineLayout pipelineLayout
3273 VkDescriptorSet descriptorSet
3274}
3275
3276@extension("VK_NVX_device_generated_commands")
3277class VkObjectTableVertexBufferEntryNVX {
3278 VkObjectEntryTypeNVX type
3279 VkObjectEntryUsageFlagsNVX flags
3280 VkBuffer buffer
3281}
3282
3283@extension("VK_NVX_device_generated_commands")
3284class VkObjectTableIndexBufferEntryNVX {
3285 VkObjectEntryTypeNVX type
3286 VkObjectEntryUsageFlagsNVX flags
3287 VkBuffer buffer
3288}
3289
3290@extension("VK_NVX_device_generated_commands")
3291class VkObjectTablePushConstantEntryNVX {
3292 VkObjectEntryTypeNVX type
3293 VkObjectEntryUsageFlagsNVX flags
3294 VkPipelineLayout pipelineLayout
3295 VkShaderStageFlags stageFlags
3296}
3297
3298
Jesse Hall1356b0d2015-11-23 17:24:58 -08003299
Jesse Halld27f6aa2015-08-15 17:58:48 -07003300////////////////
3301// Commands //
3302////////////////
3303
3304// Function pointers. TODO: add support for function pointers.
3305
3306@external type void* PFN_vkVoidFunction
3307@pfn cmd void vkVoidFunction() {
3308}
3309
Jesse Hall3fbc8562015-11-29 22:10:52 -08003310@external type void* PFN_vkAllocationFunction
3311@pfn cmd void* vkAllocationFunction(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003312 void* pUserData,
3313 platform.size_t size,
3314 platform.size_t alignment,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003315 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08003316 return ?
3317}
3318
Jesse Hall3fbc8562015-11-29 22:10:52 -08003319@external type void* PFN_vkReallocationFunction
3320@pfn cmd void* vkReallocationFunction(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003321 void* pUserData,
3322 void* pOriginal,
3323 platform.size_t size,
3324 platform.size_t alignment,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003325 VkSystemAllocationScope allocationScope) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003326 return ?
3327}
3328
3329@external type void* PFN_vkFreeFunction
3330@pfn cmd void vkFreeFunction(
3331 void* pUserData,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003332 void* pMemory) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003333}
3334
Jesse Hall3fbc8562015-11-29 22:10:52 -08003335@external type void* PFN_vkInternalAllocationNotification
3336@pfn cmd void vkInternalAllocationNotification(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003337 void* pUserData,
3338 platform.size_t size,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003339 VkInternalAllocationType allocationType,
3340 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08003341}
3342
3343@external type void* PFN_vkInternalFreeNotification
3344@pfn cmd void vkInternalFreeNotification(
3345 void* pUserData,
3346 platform.size_t size,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003347 VkInternalAllocationType allocationType,
3348 VkSystemAllocationScope allocationScope) {
Jesse Hall03b6fe12015-11-24 12:44:21 -08003349}
Jesse Halld27f6aa2015-08-15 17:58:48 -07003350
3351// Global functions
3352
3353@threadSafety("system")
3354cmd VkResult vkCreateInstance(
3355 const VkInstanceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003356 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003357 VkInstance* pInstance) {
3358 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO)
3359
3360 instance := ?
3361 pInstance[0] = instance
3362 State.Instances[instance] = new!InstanceObject()
3363
Jesse Hall3dd678a2016-01-08 21:52:01 -08003364 layers := pCreateInfo.ppEnabledLayerNames[0:pCreateInfo.enabledLayerCount]
3365 extensions := pCreateInfo.ppEnabledExtensionNames[0:pCreateInfo.enabledExtensionCount]
Jesse Halld27f6aa2015-08-15 17:58:48 -07003366
3367 return ?
3368}
3369
3370@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003371cmd void vkDestroyInstance(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003372 VkInstance instance,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003373 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003374 instanceObject := GetInstance(instance)
3375
3376 State.Instances[instance] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003377}
3378
3379@threadSafety("system")
3380cmd VkResult vkEnumeratePhysicalDevices(
3381 VkInstance instance,
3382 u32* pPhysicalDeviceCount,
3383 VkPhysicalDevice* pPhysicalDevices) {
3384 instanceObject := GetInstance(instance)
3385
3386 physicalDeviceCount := as!u32(?)
3387 pPhysicalDeviceCount[0] = physicalDeviceCount
3388 physicalDevices := pPhysicalDevices[0:physicalDeviceCount]
3389
3390 for i in (0 .. physicalDeviceCount) {
3391 physicalDevice := ?
3392 physicalDevices[i] = physicalDevice
3393 if !(physicalDevice in State.PhysicalDevices) {
3394 State.PhysicalDevices[physicalDevice] = new!PhysicalDeviceObject(instance: instance)
3395 }
3396 }
3397
3398 return ?
3399}
3400
3401cmd PFN_vkVoidFunction vkGetDeviceProcAddr(
3402 VkDevice device,
3403 const char* pName) {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003404 if device != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003405 device := GetDevice(device)
3406 }
3407
3408 return ?
3409}
3410
3411cmd PFN_vkVoidFunction vkGetInstanceProcAddr(
3412 VkInstance instance,
3413 const char* pName) {
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003414 if instance != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003415 instanceObject := GetInstance(instance)
3416 }
3417
3418 return ?
3419}
3420
Jesse Hall606a54e2015-11-19 22:17:28 -08003421cmd void vkGetPhysicalDeviceProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003422 VkPhysicalDevice physicalDevice,
3423 VkPhysicalDeviceProperties* pProperties) {
3424 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3425
3426 properties := ?
3427 pProperties[0] = properties
Jesse Halld27f6aa2015-08-15 17:58:48 -07003428}
3429
Jesse Hall606a54e2015-11-19 22:17:28 -08003430cmd void vkGetPhysicalDeviceQueueFamilyProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003431 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003432 u32* pQueueFamilyPropertyCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003433 VkQueueFamilyProperties* pQueueFamilyProperties) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003434 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003435 // TODO: Figure out how to express fetch-count-or-properties
3436 // This version fails 'apic validate' with 'fence not allowed in
3437 // *semantic.Branch'. Other attempts have failed with the same or other
3438 // errors.
3439 // if pQueueFamilyProperties != null {
3440 // queuesProperties := pQueueFamilyProperties[0:pCount[0]]
3441 // for i in (0 .. pCount[0]) {
3442 // queueProperties := as!VkQueueFamilyProperties(?)
3443 // queuesProperties[i] = queueProperties
3444 // }
3445 // } else {
3446 // count := ?
3447 // pCount[0] = count
3448 // }
Jesse Halld27f6aa2015-08-15 17:58:48 -07003449}
3450
Jesse Hall606a54e2015-11-19 22:17:28 -08003451cmd void vkGetPhysicalDeviceMemoryProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003452 VkPhysicalDevice physicalDevice,
3453 VkPhysicalDeviceMemoryProperties* pMemoryProperties) {
3454 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3455
3456 memoryProperties := ?
3457 pMemoryProperties[0] = memoryProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07003458}
3459
Jesse Hall606a54e2015-11-19 22:17:28 -08003460cmd void vkGetPhysicalDeviceFeatures(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003461 VkPhysicalDevice physicalDevice,
3462 VkPhysicalDeviceFeatures* pFeatures) {
3463 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3464
3465 features := ?
3466 pFeatures[0] = features
Jesse Halld27f6aa2015-08-15 17:58:48 -07003467}
3468
Jesse Hall606a54e2015-11-19 22:17:28 -08003469cmd void vkGetPhysicalDeviceFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003470 VkPhysicalDevice physicalDevice,
3471 VkFormat format,
3472 VkFormatProperties* pFormatProperties) {
3473 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3474
3475 formatProperties := ?
3476 pFormatProperties[0] = formatProperties
Jesse Halld27f6aa2015-08-15 17:58:48 -07003477}
3478
Jesse Halla9e57032015-11-30 01:03:10 -08003479cmd VkResult vkGetPhysicalDeviceImageFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003480 VkPhysicalDevice physicalDevice,
3481 VkFormat format,
3482 VkImageType type,
3483 VkImageTiling tiling,
3484 VkImageUsageFlags usage,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003485 VkImageCreateFlags flags,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003486 VkImageFormatProperties* pImageFormatProperties) {
3487 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3488
3489 imageFormatProperties := ?
3490 pImageFormatProperties[0] = imageFormatProperties
Jesse Halla9e57032015-11-30 01:03:10 -08003491
3492 return ?
Jesse Halld27f6aa2015-08-15 17:58:48 -07003493}
3494
Jesse Halld27f6aa2015-08-15 17:58:48 -07003495
3496// Device functions
3497
3498@threadSafety("system")
3499cmd VkResult vkCreateDevice(
3500 VkPhysicalDevice physicalDevice,
3501 const VkDeviceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003502 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003503 VkDevice* pDevice) {
3504 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO)
3505 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3506
3507 device := ?
3508 pDevice[0] = device
3509 State.Devices[device] = new!DeviceObject(physicalDevice: physicalDevice)
3510
3511 return ?
3512}
3513
3514@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003515cmd void vkDestroyDevice(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003516 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003517 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003518 deviceObject := GetDevice(device)
3519
3520 State.Devices[device] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003521}
3522
3523
3524// Extension discovery functions
3525
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003526cmd VkResult vkEnumerateInstanceLayerProperties(
Jesse Hall03b6fe12015-11-24 12:44:21 -08003527 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003528 VkLayerProperties* pProperties) {
3529 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08003530 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07003531
3532 properties := pProperties[0:count]
3533 for i in (0 .. count) {
3534 property := ?
3535 properties[i] = property
3536 }
3537
3538 return ?
3539}
3540
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003541cmd VkResult vkEnumerateInstanceExtensionProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003542 const char* pLayerName,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003543 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003544 VkExtensionProperties* pProperties) {
3545 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08003546 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07003547
3548 properties := pProperties[0:count]
3549 for i in (0 .. count) {
3550 property := ?
3551 properties[i] = property
3552 }
3553
3554 return ?
3555}
3556
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003557cmd VkResult vkEnumerateDeviceLayerProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003558 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003559 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003560 VkLayerProperties* pProperties) {
3561 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3562 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08003563 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07003564
3565 properties := pProperties[0:count]
3566 for i in (0 .. count) {
3567 property := ?
3568 properties[i] = property
3569 }
3570
3571 return ?
3572}
3573
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003574cmd VkResult vkEnumerateDeviceExtensionProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003575 VkPhysicalDevice physicalDevice,
3576 const char* pLayerName,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003577 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003578 VkExtensionProperties* pProperties) {
3579 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
3580
3581 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08003582 pPropertyCount[0] = count
Jesse Halld27f6aa2015-08-15 17:58:48 -07003583
3584 properties := pProperties[0:count]
3585 for i in (0 .. count) {
3586 property := ?
3587 properties[i] = property
3588 }
3589
3590 return ?
3591}
3592
3593
3594// Queue functions
3595
3596@threadSafety("system")
Jesse Hall606a54e2015-11-19 22:17:28 -08003597cmd void vkGetDeviceQueue(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003598 VkDevice device,
3599 u32 queueFamilyIndex,
3600 u32 queueIndex,
3601 VkQueue* pQueue) {
3602 deviceObject := GetDevice(device)
3603
3604 queue := ?
3605 pQueue[0] = queue
3606
3607 if !(queue in State.Queues) {
3608 State.Queues[queue] = new!QueueObject(device: device)
3609 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07003610}
3611
3612@threadSafety("app")
3613cmd VkResult vkQueueSubmit(
3614 VkQueue queue,
Jesse Halla366a512015-11-19 22:30:07 -08003615 u32 submitCount,
Jesse Hallb00daad2015-11-29 19:46:20 -08003616 const VkSubmitInfo* pSubmits,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003617 VkFence fence) {
3618 queueObject := GetQueue(queue)
3619
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003620 if fence != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003621 fenceObject := GetFence(fence)
3622 assert(fenceObject.device == queueObject.device)
3623 }
3624
Jesse Hall3fbc8562015-11-29 22:10:52 -08003625 // commandBuffers := pcommandBuffers[0:commandBufferCount]
3626 // for i in (0 .. commandBufferCount) {
3627 // commandBuffer := commandBuffers[i]
3628 // commandBufferObject := GetCommandBuffer(commandBuffer)
3629 // assert(commandBufferObject.device == queueObject.device)
Jesse Halla366a512015-11-19 22:30:07 -08003630 //
Jesse Hall3fbc8562015-11-29 22:10:52 -08003631 // validate("QueueCheck", commandBufferObject.queueFlags in queueObject.flags,
3632 // "vkQueueSubmit: enqueued commandBuffer requires missing queue capabilities.")
Jesse Halla366a512015-11-19 22:30:07 -08003633 // }
Jesse Halld27f6aa2015-08-15 17:58:48 -07003634
3635 return ?
3636}
3637
3638@threadSafety("system")
3639cmd VkResult vkQueueWaitIdle(
3640 VkQueue queue) {
3641 queueObject := GetQueue(queue)
3642
3643 return ?
3644}
3645
3646@threadSafety("system")
3647cmd VkResult vkDeviceWaitIdle(
3648 VkDevice device) {
3649 deviceObject := GetDevice(device)
3650
3651 return ?
3652}
3653
3654
3655// Memory functions
3656
3657@threadSafety("system")
Jesse Hall3fbc8562015-11-29 22:10:52 -08003658cmd VkResult vkAllocateMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003659 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003660 const VkMemoryAllocateInfo* pAllocateInfo,
3661 const VkAllocationCallbacks* pAllocator,
3662 VkDeviceMemory* pMemory) {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08003663 assert(pAllocateInfo.sType == VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003664 deviceObject := GetDevice(device)
3665
Jesse Hall3fbc8562015-11-29 22:10:52 -08003666 memory := ?
3667 pMemory[0] = memory
3668 State.DeviceMemories[memory] = new!DeviceMemoryObject(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003669 device: device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003670 allocationSize: pAllocateInfo[0].allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003671
3672 return ?
3673}
3674
3675@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003676cmd void vkFreeMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003677 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003678 VkDeviceMemory memory,
3679 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003680 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003681 memoryObject := GetDeviceMemory(memory)
3682 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003683
3684 // Check that no objects are still bound before freeing.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003685 validate("MemoryCheck", len(memoryObject.boundObjects) == 0,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003686 "vkFreeMemory: objects still bound")
Jesse Hall3fbc8562015-11-29 22:10:52 -08003687 validate("MemoryCheck", len(memoryObject.boundCommandBuffers) == 0,
3688 "vkFreeMemory: commandBuffers still bound")
3689 State.DeviceMemories[memory] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003690}
3691
3692@threadSafety("app")
3693cmd VkResult vkMapMemory(
3694 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003695 VkDeviceMemory memory,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003696 VkDeviceSize offset,
3697 VkDeviceSize size,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003698 VkMemoryMapFlags flags,
3699 void** ppData) {
3700 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003701 memoryObject := GetDeviceMemory(memory)
3702 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003703
3704 assert(flags == as!VkMemoryMapFlags(0))
Jesse Hall3fbc8562015-11-29 22:10:52 -08003705 assert((offset + size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003706
3707 return ?
3708}
3709
3710@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003711cmd void vkUnmapMemory(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003712 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003713 VkDeviceMemory memory) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003714 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08003715 memoryObject := GetDeviceMemory(memory)
3716 assert(memoryObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003717}
3718
3719cmd VkResult vkFlushMappedMemoryRanges(
3720 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003721 u32 memoryRangeCount
3722 const VkMappedMemoryRange* pMemoryRanges) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003723 deviceObject := GetDevice(device)
3724
Jesse Hall3fbc8562015-11-29 22:10:52 -08003725 memoryRanges := pMemoryRanges[0:memoryRangeCount]
3726 for i in (0 .. memoryRangeCount) {
3727 memoryRange := memoryRanges[i]
3728 memoryObject := GetDeviceMemory(memoryRange.memory)
3729 assert(memoryObject.device == device)
3730 assert((memoryRange.offset + memoryRange.size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003731 }
3732
3733 return ?
3734}
3735
3736cmd VkResult vkInvalidateMappedMemoryRanges(
3737 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003738 u32 memoryRangeCount,
3739 const VkMappedMemoryRange* pMemoryRanges) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003740 deviceObject := GetDevice(device)
3741
Jesse Hall3fbc8562015-11-29 22:10:52 -08003742 memoryRanges := pMemoryRanges[0:memoryRangeCount]
3743 for i in (0 .. memoryRangeCount) {
3744 memoryRange := memoryRanges[i]
3745 memoryObject := GetDeviceMemory(memoryRange.memory)
3746 assert(memoryObject.device == device)
3747 assert((memoryRange.offset + memoryRange.size) <= memoryObject.allocationSize)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003748 }
3749
3750 return ?
3751}
3752
3753
3754// Memory management API functions
3755
Jesse Hall606a54e2015-11-19 22:17:28 -08003756cmd void vkGetDeviceMemoryCommitment(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003757 VkDevice device,
3758 VkDeviceMemory memory,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003759 VkDeviceSize* pCommittedMemoryInBytes) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003760 deviceObject := GetDevice(device)
3761
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003762 if memory != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003763 memoryObject := GetDeviceMemory(memory)
3764 assert(memoryObject.device == device)
3765 }
3766
3767 committedMemoryInBytes := ?
3768 pCommittedMemoryInBytes[0] = committedMemoryInBytes
Jesse Halld27f6aa2015-08-15 17:58:48 -07003769}
3770
Jesse Hall606a54e2015-11-19 22:17:28 -08003771cmd void vkGetBufferMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003772 VkDevice device,
3773 VkBuffer buffer,
3774 VkMemoryRequirements* pMemoryRequirements) {
3775 deviceObject := GetDevice(device)
3776 bufferObject := GetBuffer(buffer)
3777 assert(bufferObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003778}
3779
3780cmd VkResult vkBindBufferMemory(
3781 VkDevice device,
3782 VkBuffer buffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003783 VkDeviceMemory memory,
3784 VkDeviceSize memoryOffset) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003785 deviceObject := GetDevice(device)
3786 bufferObject := GetBuffer(buffer)
3787 assert(bufferObject.device == device)
3788
3789 // Unbind buffer from previous memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003790 if bufferObject.memory != NULL_HANDLE {
3791 memoryObject := GetDeviceMemory(bufferObject.memory)
3792 memoryObject.boundObjects[as!u64(buffer)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003793 }
3794
3795 // Bind buffer to given memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003796 if memory != NULL_HANDLE {
3797 memoryObject := GetDeviceMemory(memory)
3798 assert(memoryObject.device == device)
3799 memoryObject.boundObjects[as!u64(buffer)] = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003800 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08003801 bufferObject.memory = memory
3802 bufferObject.memoryOffset = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003803
3804 return ?
3805}
3806
Jesse Hall606a54e2015-11-19 22:17:28 -08003807cmd void vkGetImageMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003808 VkDevice device,
3809 VkImage image,
3810 VkMemoryRequirements* pMemoryRequirements) {
3811 deviceObject := GetDevice(device)
3812 imageObject := GetImage(image)
3813 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003814}
3815
3816cmd VkResult vkBindImageMemory(
3817 VkDevice device,
3818 VkImage image,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003819 VkDeviceMemory memory,
3820 VkDeviceSize memoryOffset) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003821 deviceObject := GetDevice(device)
3822 imageObject := GetImage(image)
3823 assert(imageObject.device == device)
3824
3825 // Unbind image from previous memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003826 if imageObject.memory != NULL_HANDLE {
3827 memoryObject := GetDeviceMemory(imageObject.memory)
3828 memoryObject.boundObjects[as!u64(image)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003829 }
3830
3831 // Bind image to given memory object, if not VK_NULL_HANDLE.
Jesse Hall3fbc8562015-11-29 22:10:52 -08003832 if memory != NULL_HANDLE {
3833 memoryObject := GetDeviceMemory(memory)
3834 assert(memoryObject.device == device)
3835 memoryObject.boundObjects[as!u64(image)] = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003836 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08003837 imageObject.memory = memory
3838 imageObject.memoryOffset = memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07003839
3840 return ?
3841}
3842
Jesse Hall606a54e2015-11-19 22:17:28 -08003843cmd void vkGetImageSparseMemoryRequirements(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003844 VkDevice device,
3845 VkImage image,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003846 u32* pSparseMemoryRequirementCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003847 VkSparseImageMemoryRequirements* pSparseMemoryRequirements) {
3848 deviceObject := GetDevice(device)
3849 imageObject := GetImage(image)
3850 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003851}
3852
Jesse Hall606a54e2015-11-19 22:17:28 -08003853cmd void vkGetPhysicalDeviceSparseImageFormatProperties(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003854 VkPhysicalDevice physicalDevice,
3855 VkFormat format,
3856 VkImageType type,
Jesse Hall091ed9e2015-11-30 00:55:29 -08003857 VkSampleCountFlagBits samples,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003858 VkImageUsageFlags usage,
3859 VkImageTiling tiling,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003860 u32* pPropertyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003861 VkSparseImageFormatProperties* pProperties) {
3862 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003863}
3864
Jesse Halla6429252015-11-29 18:59:42 -08003865cmd VkResult vkQueueBindSparse(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003866 VkQueue queue,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003867 u32 bindInfoCount,
Jesse Halla6429252015-11-29 18:59:42 -08003868 const VkBindSparseInfo* pBindInfo,
3869 VkFence fence) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003870 queueObject := GetQueue(queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07003871
3872 return ?
3873}
3874
3875
3876// Fence functions
3877
3878@threadSafety("system")
3879cmd VkResult vkCreateFence(
3880 VkDevice device,
3881 const VkFenceCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003882 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003883 VkFence* pFence) {
3884 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_FENCE_CREATE_INFO)
3885 deviceObject := GetDevice(device)
3886
3887 fence := ?
3888 pFence[0] = fence
3889 State.Fences[fence] = new!FenceObject(
Jesse Halld8bade02015-11-24 10:24:18 -08003890 device: device, signaled: (pCreateInfo.flags == as!VkFenceCreateFlags(VK_FENCE_CREATE_SIGNALED_BIT)))
Jesse Halld27f6aa2015-08-15 17:58:48 -07003891
3892 return ?
3893}
3894
3895@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003896cmd void vkDestroyFence(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003897 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003898 VkFence fence,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003899 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003900 deviceObject := GetDevice(device)
3901 fenceObject := GetFence(fence)
3902 assert(fenceObject.device == device)
3903
3904 State.Fences[fence] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003905}
3906
3907@threadSafety("system")
3908cmd VkResult vkResetFences(
3909 VkDevice device,
3910 u32 fenceCount,
3911 const VkFence* pFences) {
3912 deviceObject := GetDevice(device)
3913
3914 fences := pFences[0:fenceCount]
3915 for i in (0 .. fenceCount) {
3916 fence := fences[i]
3917 fenceObject := GetFence(fence)
3918 assert(fenceObject.device == device)
3919 fenceObject.signaled = false
3920 }
3921
3922 return ?
3923}
3924
3925@threadSafety("system")
3926cmd VkResult vkGetFenceStatus(
3927 VkDevice device,
3928 VkFence fence) {
3929 deviceObject := GetDevice(device)
3930 fenceObject := GetFence(fence)
3931 assert(fenceObject.device == device)
3932
3933 return ?
3934}
3935
3936@threadSafety("system")
3937cmd VkResult vkWaitForFences(
3938 VkDevice device,
3939 u32 fenceCount,
3940 const VkFence* pFences,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003941 VkBool32 waitAll,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003942 u64 timeout) { /// timeout in nanoseconds
3943 deviceObject := GetDevice(device)
3944
3945 fences := pFences[0:fenceCount]
3946 for i in (0 .. fenceCount) {
3947 fence := fences[i]
3948 fenceObject := GetFence(fence)
3949 assert(fenceObject.device == device)
3950 }
3951
3952 return ?
3953}
3954
3955
3956// Queue semaphore functions
3957
3958@threadSafety("system")
3959cmd VkResult vkCreateSemaphore(
3960 VkDevice device,
3961 const VkSemaphoreCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003962 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003963 VkSemaphore* pSemaphore) {
3964 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO)
3965 deviceObject := GetDevice(device)
3966
3967 semaphore := ?
3968 pSemaphore[0] = semaphore
3969 State.Semaphores[semaphore] = new!SemaphoreObject(device: device)
3970
3971 return ?
3972}
3973
3974@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07003975cmd void vkDestroySemaphore(
Jesse Halld27f6aa2015-08-15 17:58:48 -07003976 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08003977 VkSemaphore semaphore,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003978 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07003979 deviceObject := GetDevice(device)
3980 semaphoreObject := GetSemaphore(semaphore)
3981 assert(semaphoreObject.device == device)
3982
3983 State.Semaphores[semaphore] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07003984}
3985
Jesse Halld27f6aa2015-08-15 17:58:48 -07003986
3987// Event functions
3988
3989@threadSafety("system")
3990cmd VkResult vkCreateEvent(
3991 VkDevice device,
3992 const VkEventCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08003993 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07003994 VkEvent* pEvent) {
3995 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_EVENT_CREATE_INFO)
3996 deviceObject := GetDevice(device)
3997
3998 event := ?
3999 pEvent[0] = event
4000 State.Events[event] = new!EventObject(device: device)
4001
4002 return ?
4003}
4004
4005@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004006cmd void vkDestroyEvent(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004007 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004008 VkEvent event,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004009 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004010 deviceObject := GetDevice(device)
4011 eventObject := GetEvent(event)
4012 assert(eventObject.device == device)
4013
4014 State.Events[event] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004015}
4016
4017@threadSafety("system")
4018cmd VkResult vkGetEventStatus(
4019 VkDevice device,
4020 VkEvent event) {
4021 deviceObject := GetDevice(device)
4022 eventObject := GetEvent(event)
4023 assert(eventObject.device == device)
4024
4025 return ?
4026}
4027
4028@threadSafety("system")
4029cmd VkResult vkSetEvent(
4030 VkDevice device,
4031 VkEvent event) {
4032 deviceObject := GetDevice(device)
4033 eventObject := GetEvent(event)
4034 assert(eventObject.device == device)
4035
4036 return ?
4037}
4038
4039@threadSafety("system")
4040cmd VkResult vkResetEvent(
4041 VkDevice device,
4042 VkEvent event) {
4043 deviceObject := GetDevice(device)
4044 eventObject := GetEvent(event)
4045 assert(eventObject.device == device)
4046
4047 return ?
4048}
4049
4050
4051// Query functions
4052
4053@threadSafety("system")
4054cmd VkResult vkCreateQueryPool(
4055 VkDevice device,
4056 const VkQueryPoolCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004057 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004058 VkQueryPool* pQueryPool) {
4059 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO)
4060 deviceObject := GetDevice(device)
4061
4062 queryPool := ?
4063 pQueryPool[0] = queryPool
4064 State.QueryPools[queryPool] = new!QueryPoolObject(device: device)
4065
4066 return ?
4067}
4068
4069@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004070cmd void vkDestroyQueryPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004071 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004072 VkQueryPool queryPool,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004073 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004074 deviceObject := GetDevice(device)
4075 queryPoolObject := GetQueryPool(queryPool)
4076 assert(queryPoolObject.device == device)
4077
4078 State.QueryPools[queryPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004079}
4080
4081@threadSafety("system")
4082cmd VkResult vkGetQueryPoolResults(
4083 VkDevice device,
4084 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004085 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004086 u32 queryCount,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004087 platform.size_t dataSize,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004088 void* pData,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004089 VkDeviceSize stride,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004090 VkQueryResultFlags flags) {
4091 deviceObject := GetDevice(device)
4092 queryPoolObject := GetQueryPool(queryPool)
4093 assert(queryPoolObject.device == device)
4094
Jesse Halld27f6aa2015-08-15 17:58:48 -07004095 data := pData[0:dataSize]
4096
4097 return ?
4098}
4099
4100// Buffer functions
4101
4102@threadSafety("system")
4103cmd VkResult vkCreateBuffer(
4104 VkDevice device,
4105 const VkBufferCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004106 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004107 VkBuffer* pBuffer) {
4108 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO)
4109 deviceObject := GetDevice(device)
4110
4111 buffer := ?
4112 pBuffer[0] = buffer
4113 State.Buffers[buffer] = new!BufferObject(device: device)
4114
4115 return ?
4116}
4117
4118@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004119cmd void vkDestroyBuffer(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004120 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004121 VkBuffer buffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004122 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004123 deviceObject := GetDevice(device)
4124 bufferObject := GetBuffer(buffer)
4125 assert(bufferObject.device == device)
4126
Jesse Hall3fbc8562015-11-29 22:10:52 -08004127 assert(bufferObject.memory == 0)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004128 State.Buffers[buffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004129}
4130
4131
4132// Buffer view functions
4133
4134@threadSafety("system")
4135cmd VkResult vkCreateBufferView(
4136 VkDevice device,
4137 const VkBufferViewCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004138 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004139 VkBufferView* pView) {
4140 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_BUFFER_VIEW_CREATE_INFO)
4141 deviceObject := GetDevice(device)
4142
4143 bufferObject := GetBuffer(pCreateInfo.buffer)
4144 assert(bufferObject.device == device)
4145
4146 view := ?
4147 pView[0] = view
4148 State.BufferViews[view] = new!BufferViewObject(device: device, buffer: pCreateInfo.buffer)
4149
4150 return ?
4151}
4152
4153@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004154cmd void vkDestroyBufferView(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004155 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004156 VkBufferView bufferView,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004157 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004158 deviceObject := GetDevice(device)
4159 bufferViewObject := GetBufferView(bufferView)
4160 assert(bufferViewObject.device == device)
4161
4162 State.BufferViews[bufferView] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004163}
4164
4165
4166// Image functions
4167
4168@threadSafety("system")
4169cmd VkResult vkCreateImage(
4170 VkDevice device,
4171 const VkImageCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004172 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004173 VkImage* pImage) {
4174 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO)
4175 deviceObject := GetDevice(device)
4176
4177 image := ?
4178 pImage[0] = image
4179 State.Images[image] = new!ImageObject(device: device)
4180
4181 return ?
4182}
4183
4184@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004185cmd void vkDestroyImage(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004186 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004187 VkImage image,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004188 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004189 deviceObject := GetDevice(device)
4190 imageObject := GetImage(image)
4191 assert(imageObject.device == device)
4192
Jesse Hall3fbc8562015-11-29 22:10:52 -08004193 assert(imageObject.memory == 0)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004194 State.Images[image] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004195}
4196
Jesse Hall606a54e2015-11-19 22:17:28 -08004197cmd void vkGetImageSubresourceLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004198 VkDevice device,
4199 VkImage image,
4200 const VkImageSubresource* pSubresource,
4201 VkSubresourceLayout* pLayout) {
4202 deviceObject := GetDevice(device)
4203 imageObject := GetImage(image)
4204 assert(imageObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004205}
4206
4207
4208// Image view functions
4209
4210@threadSafety("system")
4211cmd VkResult vkCreateImageView(
4212 VkDevice device,
4213 const VkImageViewCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004214 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004215 VkImageView* pView) {
4216 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO)
4217 deviceObject := GetDevice(device)
4218
4219 imageObject := GetImage(pCreateInfo.image)
4220 assert(imageObject.device == device)
4221
4222 view := ?
4223 pView[0] = view
4224 State.ImageViews[view] = new!ImageViewObject(device: device, image: pCreateInfo.image)
4225
4226 return ?
4227}
4228
4229@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004230cmd void vkDestroyImageView(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004231 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004232 VkImageView imageView,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004233 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004234 deviceObject := GetDevice(device)
4235 imageViewObject := GetImageView(imageView)
4236 assert(imageViewObject.device == device)
4237
4238 State.ImageViews[imageView] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004239}
4240
4241
4242// Shader functions
4243
4244cmd VkResult vkCreateShaderModule(
4245 VkDevice device,
4246 const VkShaderModuleCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004247 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004248 VkShaderModule* pShaderModule) {
4249 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO)
4250 deviceObject := GetDevice(device)
4251
4252 shaderModule := ?
4253 pShaderModule[0] = shaderModule
4254 State.ShaderModules[shaderModule] = new!ShaderModuleObject(device: device)
4255
4256 return ?
4257}
4258
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004259cmd void vkDestroyShaderModule(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004260 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004261 VkShaderModule shaderModule,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004262 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004263 deviceObject := GetDevice(device)
4264 shaderModuleObject := GetShaderModule(shaderModule)
4265 assert(shaderModuleObject.device == device)
4266
4267 State.ShaderModules[shaderModule] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004268}
4269
Jesse Halld27f6aa2015-08-15 17:58:48 -07004270
4271// Pipeline functions
4272
4273cmd VkResult vkCreatePipelineCache(
4274 VkDevice device,
4275 const VkPipelineCacheCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004276 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004277 VkPipelineCache* pPipelineCache) {
4278 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_PIPELINE_CACHE_CREATE_INFO)
4279 deviceObject := GetDevice(device)
4280
4281 pipelineCache := ?
4282 pPipelineCache[0] = pipelineCache
4283 State.PipelineCaches[pipelineCache] = new!PipelineCacheObject(device: device)
4284
4285 return ?
4286}
4287
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004288cmd void vkDestroyPipelineCache(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004289 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004290 VkPipelineCache pipelineCache,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004291 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004292 deviceObject := GetDevice(device)
4293 pipelineCacheObject := GetPipelineCache(pipelineCache)
4294 assert(pipelineCacheObject.device == device)
4295
4296 State.PipelineCaches[pipelineCache] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004297}
4298
Jesse Halld27f6aa2015-08-15 17:58:48 -07004299cmd VkResult vkGetPipelineCacheData(
4300 VkDevice device,
4301 VkPipelineCache pipelineCache,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004302 platform.size_t* pDataSize,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004303 void* pData) {
4304 deviceObject := GetDevice(device)
4305 pipelineCacheObject := GetPipelineCache(pipelineCache)
4306 assert(pipelineCacheObject.device == device)
4307
4308 return ?
4309}
4310
4311cmd VkResult vkMergePipelineCaches(
4312 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004313 VkPipelineCache dstCache,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004314 u32 srcCacheCount,
4315 const VkPipelineCache* pSrcCaches) {
4316 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004317 dstCacheObject := GetPipelineCache(dstCache)
4318 assert(dstCacheObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004319
4320 srcCaches := pSrcCaches[0:srcCacheCount]
4321 for i in (0 .. srcCacheCount) {
4322 srcCache := srcCaches[i]
4323 srcCacheObject := GetPipelineCache(srcCache)
4324 assert(srcCacheObject.device == device)
4325 }
4326
4327 return ?
4328}
4329
4330cmd VkResult vkCreateGraphicsPipelines(
4331 VkDevice device,
4332 VkPipelineCache pipelineCache,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004333 u32 createInfoCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004334 const VkGraphicsPipelineCreateInfo* pCreateInfos,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004335 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004336 VkPipeline* pPipelines) {
4337 deviceObject := GetDevice(device)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004338 if pipelineCache != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004339 pipelineCacheObject := GetPipelineCache(pipelineCache)
4340 assert(pipelineCacheObject.device == device)
4341 }
4342
Jesse Hall03b6fe12015-11-24 12:44:21 -08004343 createInfos := pCreateInfos[0:createInfoCount]
4344 pipelines := pPipelines[0:createInfoCount]
4345 for i in (0 .. createInfoCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004346 pipeline := ?
4347 pipelines[i] = pipeline
4348 State.Pipelines[pipeline] = new!PipelineObject(device: device)
4349 }
4350
4351 return ?
4352}
4353
4354cmd VkResult vkCreateComputePipelines(
4355 VkDevice device,
4356 VkPipelineCache pipelineCache,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004357 u32 createInfoCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004358 const VkComputePipelineCreateInfo* pCreateInfos,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004359 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004360 VkPipeline* pPipelines) {
4361 deviceObject := GetDevice(device)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004362 if pipelineCache != NULL_HANDLE {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004363 pipelineCacheObject := GetPipelineCache(pipelineCache)
4364 assert(pipelineCacheObject.device == device)
4365 }
4366
Jesse Hall03b6fe12015-11-24 12:44:21 -08004367 createInfos := pCreateInfos[0:createInfoCount]
4368 pipelines := pPipelines[0:createInfoCount]
4369 for i in (0 .. createInfoCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004370 pipeline := ?
4371 pipelines[i] = pipeline
4372 State.Pipelines[pipeline] = new!PipelineObject(device: device)
4373 }
4374
4375 return ?
4376}
4377
4378@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004379cmd void vkDestroyPipeline(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004380 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004381 VkPipeline pipeline,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004382 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004383 deviceObject := GetDevice(device)
4384 pipelineObjects := GetPipeline(pipeline)
4385 assert(pipelineObjects.device == device)
4386
4387 State.Pipelines[pipeline] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004388}
4389
4390
4391// Pipeline layout functions
4392
4393@threadSafety("system")
4394cmd VkResult vkCreatePipelineLayout(
4395 VkDevice device,
4396 const VkPipelineLayoutCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004397 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004398 VkPipelineLayout* pPipelineLayout) {
4399 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO)
4400 deviceObject := GetDevice(device)
4401
4402 pipelineLayout := ?
4403 pPipelineLayout[0] = pipelineLayout
4404 State.PipelineLayouts[pipelineLayout] = new!PipelineLayoutObject(device: device)
4405
4406 return ?
4407}
4408
4409@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004410cmd void vkDestroyPipelineLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004411 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004412 VkPipelineLayout pipelineLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004413 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004414 deviceObject := GetDevice(device)
4415 pipelineLayoutObjects := GetPipelineLayout(pipelineLayout)
4416 assert(pipelineLayoutObjects.device == device)
4417
4418 State.PipelineLayouts[pipelineLayout] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004419}
4420
4421
4422// Sampler functions
4423
4424@threadSafety("system")
4425cmd VkResult vkCreateSampler(
4426 VkDevice device,
4427 const VkSamplerCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004428 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004429 VkSampler* pSampler) {
4430 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO)
4431 deviceObject := GetDevice(device)
4432
4433 sampler := ?
4434 pSampler[0] = sampler
4435 State.Samplers[sampler] = new!SamplerObject(device: device)
4436
4437 return ?
4438}
4439
4440@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004441cmd void vkDestroySampler(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004442 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004443 VkSampler sampler,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004444 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004445 deviceObject := GetDevice(device)
4446 samplerObject := GetSampler(sampler)
4447 assert(samplerObject.device == device)
4448
4449 State.Samplers[sampler] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004450}
4451
4452
4453// Descriptor set functions
4454
4455@threadSafety("system")
4456cmd VkResult vkCreateDescriptorSetLayout(
4457 VkDevice device,
4458 const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004459 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004460 VkDescriptorSetLayout* pSetLayout) {
4461 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO)
4462 deviceObject := GetDevice(device)
4463
4464 setLayout := ?
4465 pSetLayout[0] = setLayout
4466 State.DescriptorSetLayouts[setLayout] = new!DescriptorSetLayoutObject(device: device)
4467
4468 return ?
4469}
4470
4471@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004472cmd void vkDestroyDescriptorSetLayout(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004473 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004474 VkDescriptorSetLayout descriptorSetLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004475 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004476 deviceObject := GetDevice(device)
4477 descriptorSetLayoutObject := GetDescriptorSetLayout(descriptorSetLayout)
4478 assert(descriptorSetLayoutObject.device == device)
4479
4480 State.DescriptorSetLayouts[descriptorSetLayout] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004481}
4482
4483@threadSafety("system")
4484cmd VkResult vkCreateDescriptorPool(
4485 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004486 const VkDescriptorPoolCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004487 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004488 VkDescriptorPool* pDescriptorPool) {
4489 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO)
4490 deviceObject := GetDevice(device)
4491
4492 descriptorPool := ?
4493 pDescriptorPool[0] = descriptorPool
4494 State.DescriptorPools[descriptorPool] = new!DescriptorPoolObject(device: device)
4495
4496 return ?
4497}
4498
4499@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004500cmd void vkDestroyDescriptorPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004501 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004502 VkDescriptorPool descriptorPool,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004503 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004504 deviceObject := GetDevice(device)
4505 descriptorPoolObject := GetDescriptorPool(descriptorPool)
4506 assert(descriptorPoolObject.device == device)
4507
4508 State.DescriptorPools[descriptorPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004509}
4510
4511@threadSafety("app")
4512cmd VkResult vkResetDescriptorPool(
4513 VkDevice device,
Jesse Hallfbf97b02015-11-20 14:17:03 -08004514 VkDescriptorPool descriptorPool,
4515 VkDescriptorPoolResetFlags flags) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004516 deviceObject := GetDevice(device)
4517 descriptorPoolObject := GetDescriptorPool(descriptorPool)
4518 assert(descriptorPoolObject.device == device)
4519
4520 return ?
4521}
4522
4523@threadSafety("app")
Jesse Hall3fbc8562015-11-29 22:10:52 -08004524cmd VkResult vkAllocateDescriptorSets(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004525 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004526 const VkDescriptorSetAllocateInfo* pAllocateInfo,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004527 VkDescriptorSet* pDescriptorSets) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004528 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004529 allocInfo := pAllocateInfo[0]
Jesse Hallfbf97b02015-11-20 14:17:03 -08004530 descriptorPoolObject := GetDescriptorPool(allocInfo.descriptorPool)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004531
Jesse Hall03b6fe12015-11-24 12:44:21 -08004532 setLayouts := allocInfo.pSetLayouts[0:allocInfo.setCount]
4533 for i in (0 .. allocInfo.setCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004534 setLayout := setLayouts[i]
4535 setLayoutObject := GetDescriptorSetLayout(setLayout)
4536 assert(setLayoutObject.device == device)
4537 }
4538
Jesse Hall03b6fe12015-11-24 12:44:21 -08004539 descriptorSets := pDescriptorSets[0:allocInfo.setCount]
4540 for i in (0 .. allocInfo.setCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004541 descriptorSet := ?
4542 descriptorSets[i] = descriptorSet
4543 State.DescriptorSets[descriptorSet] = new!DescriptorSetObject(device: device)
4544 }
4545
4546 return ?
4547}
4548
Jesse Hallf09c6b12015-08-15 19:54:28 -07004549cmd VkResult vkFreeDescriptorSets(
4550 VkDevice device,
4551 VkDescriptorPool descriptorPool,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004552 u32 descriptorSetCount,
Jesse Hallf09c6b12015-08-15 19:54:28 -07004553 const VkDescriptorSet* pDescriptorSets) {
4554 deviceObject := GetDevice(device)
4555 descriptorPoolObject := GetDescriptorPool(descriptorPool)
4556
Jesse Hall03b6fe12015-11-24 12:44:21 -08004557 descriptorSets := pDescriptorSets[0:descriptorSetCount]
4558 for i in (0 .. descriptorSetCount) {
Jesse Hallf09c6b12015-08-15 19:54:28 -07004559 descriptorSet := descriptorSets[i]
4560 descriptorSetObject := GetDescriptorSet(descriptorSet)
4561 assert(descriptorSetObject.device == device)
4562 State.DescriptorSets[descriptorSet] = null
4563 }
4564
4565 return ?
4566}
4567
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004568cmd void vkUpdateDescriptorSets(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004569 VkDevice device,
Jesse Hallb00daad2015-11-29 19:46:20 -08004570 u32 descriptorWriteCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004571 const VkWriteDescriptorSet* pDescriptorWrites,
Jesse Hallb00daad2015-11-29 19:46:20 -08004572 u32 descriptorCopyCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004573 const VkCopyDescriptorSet* pDescriptorCopies) {
4574 deviceObject := GetDevice(device)
4575
Jesse Hallb00daad2015-11-29 19:46:20 -08004576 descriptorWrites := pDescriptorWrites[0:descriptorWriteCount]
4577 for i in (0 .. descriptorWriteCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004578 descriptorWrite := descriptorWrites[i]
Jesse Hall3fbc8562015-11-29 22:10:52 -08004579 descriptorWriteObject := GetDescriptorSet(descriptorWrite.dstSet)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004580 assert(descriptorWriteObject.device == device)
4581 }
4582
Jesse Hallb00daad2015-11-29 19:46:20 -08004583 descriptorCopies := pDescriptorCopies[0:descriptorCopyCount]
4584 for i in (0 .. descriptorCopyCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004585 descriptorCopy := descriptorCopies[i]
Jesse Hall3fbc8562015-11-29 22:10:52 -08004586 descriptorCopyObject := GetDescriptorSet(descriptorCopy.dstSet)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004587 assert(descriptorCopyObject.device == device)
4588 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07004589}
4590
4591
4592// Framebuffer functions
4593
4594@threadSafety("system")
4595cmd VkResult vkCreateFramebuffer(
4596 VkDevice device,
4597 const VkFramebufferCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004598 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004599 VkFramebuffer* pFramebuffer) {
4600 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO)
4601 deviceObject := GetDevice(device)
4602
4603 framebuffer := ?
4604 pFramebuffer[0] = framebuffer
4605 State.Framebuffers[framebuffer] = new!FramebufferObject(device: device)
4606
4607 return ?
4608}
4609
4610@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004611cmd void vkDestroyFramebuffer(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004612 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004613 VkFramebuffer framebuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004614 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004615 deviceObject := GetDevice(device)
4616 framebufferObject := GetFramebuffer(framebuffer)
4617 assert(framebufferObject.device == device)
4618
4619 State.Framebuffers[framebuffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004620}
4621
4622
4623// Renderpass functions
4624
4625@threadSafety("system")
4626cmd VkResult vkCreateRenderPass(
4627 VkDevice device,
4628 const VkRenderPassCreateInfo* pCreateInfo,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004629 const VkAllocationCallbacks* pAllocator,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004630 VkRenderPass* pRenderPass) {
4631 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO)
4632 deviceObject := GetDevice(device)
4633
4634 renderpass := ?
4635 pRenderPass[0] = renderpass
4636 State.RenderPasses[renderpass] = new!RenderPassObject(device: device)
4637
4638 return ?
4639}
4640
4641@threadSafety("system")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004642cmd void vkDestroyRenderPass(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004643 VkDevice device,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004644 VkRenderPass renderPass,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004645 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004646 deviceObject := GetDevice(device)
4647 renderPassObject := GetRenderPass(renderPass)
4648 assert(renderPassObject.device == device)
4649
4650 State.RenderPasses[renderPass] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004651}
4652
Jesse Hall606a54e2015-11-19 22:17:28 -08004653cmd void vkGetRenderAreaGranularity(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004654 VkDevice device,
4655 VkRenderPass renderPass,
4656 VkExtent2D* pGranularity) {
4657 deviceObject := GetDevice(device)
4658 renderPassObject := GetRenderPass(renderPass)
4659
4660 granularity := ?
4661 pGranularity[0] = granularity
Jesse Halld27f6aa2015-08-15 17:58:48 -07004662}
4663
4664// Command pool functions
4665
4666cmd VkResult vkCreateCommandPool(
4667 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004668 const VkCommandPoolCreateInfo* pCreateInfo,
4669 const VkAllocationCallbacks* pAllocator,
4670 VkCommandPool* pCommandPool) {
4671 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004672 deviceObject := GetDevice(device)
4673
Jesse Hall3fbc8562015-11-29 22:10:52 -08004674 commandPool := ?
4675 pCommandPool[0] = commandPool
4676 State.CommandPools[commandPool] = new!CommandPoolObject(device: device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004677
4678 return ?
4679}
4680
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004681cmd void vkDestroyCommandPool(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004682 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004683 VkCommandPool commandPool,
4684 const VkAllocationCallbacks* pAllocator) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004685 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004686 commandPoolObject := GetCommandPool(commandPool)
4687 assert(commandPoolObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004688
Jesse Hall3fbc8562015-11-29 22:10:52 -08004689 State.CommandPools[commandPool] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004690}
4691
4692cmd VkResult vkResetCommandPool(
4693 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004694 VkCommandPool commandPool,
4695 VkCommandPoolResetFlags flags) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004696 deviceObject := GetDevice(device)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004697 commandPoolObject := GetCommandPool(commandPool)
4698 assert(commandPoolObject.device == device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004699
4700 return ?
4701}
4702
4703// Command buffer functions
4704
Jesse Hall3fbc8562015-11-29 22:10:52 -08004705macro void bindCommandBuffer(VkCommandBuffer commandBuffer, any obj, VkDeviceMemory memory) {
4706 memoryObject := GetDeviceMemory(memory)
4707 memoryObject.boundCommandBuffers[commandBuffer] = commandBuffer
Jesse Halld27f6aa2015-08-15 17:58:48 -07004708
Jesse Hall3fbc8562015-11-29 22:10:52 -08004709 commandBufferObject := GetCommandBuffer(commandBuffer)
4710 commandBufferObject.boundObjects[as!u64(obj)] = memory
Jesse Halld27f6aa2015-08-15 17:58:48 -07004711}
4712
Jesse Hall3fbc8562015-11-29 22:10:52 -08004713macro void unbindCommandBuffer(VkCommandBuffer commandBuffer, any obj, VkDeviceMemory memory) {
4714 memoryObject := GetDeviceMemory(memory)
4715 memoryObject.boundCommandBuffers[commandBuffer] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004716
Jesse Hall3fbc8562015-11-29 22:10:52 -08004717 commandBufferObject := GetCommandBuffer(commandBuffer)
4718 commandBufferObject.boundObjects[as!u64(obj)] = null
Jesse Halld27f6aa2015-08-15 17:58:48 -07004719}
4720
4721@threadSafety("system")
Jesse Hall3fbc8562015-11-29 22:10:52 -08004722cmd VkResult vkAllocateCommandBuffers(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004723 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004724 const VkCommandBufferAllocateInfo* pAllocateInfo,
4725 VkCommandBuffer* pCommandBuffers) {
Jesse Hallf4ab2b12015-11-30 16:04:55 -08004726 assert(pAllocateInfo[0].sType == VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004727
Jesse Hall3dd678a2016-01-08 21:52:01 -08004728 count := pAllocateInfo[0].commandBufferCount
Jesse Hall3fbc8562015-11-29 22:10:52 -08004729 commandBuffers := pCommandBuffers[0:count]
Jesse Hallfbf97b02015-11-20 14:17:03 -08004730 for i in (0 .. count) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004731 commandBuffer := ?
4732 commandBuffers[i] = commandBuffer
4733 State.CommandBuffers[commandBuffer] = new!CommandBufferObject(device: device)
Jesse Hallfbf97b02015-11-20 14:17:03 -08004734 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07004735
4736 return ?
4737}
4738
4739@threadSafety("system")
Jesse Hallfbf97b02015-11-20 14:17:03 -08004740cmd void vkFreeCommandBuffers(
Jesse Halld27f6aa2015-08-15 17:58:48 -07004741 VkDevice device,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004742 VkCommandPool commandPool,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004743 u32 commandBufferCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08004744 const VkCommandBuffer* pCommandBuffers) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004745 deviceObject := GetDevice(device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004746
Jesse Hall3fbc8562015-11-29 22:10:52 -08004747 commandBuffers := pCommandBuffers[0:commandBufferCount]
Jesse Hall03b6fe12015-11-24 12:44:21 -08004748 for i in (0 .. commandBufferCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004749 commandBufferObject := GetCommandBuffer(commandBuffers[i])
4750 assert(commandBufferObject.device == device)
Jesse Hallfbf97b02015-11-20 14:17:03 -08004751 // TODO: iterate over boundObjects and clear memory bindings
Jesse Hall3fbc8562015-11-29 22:10:52 -08004752 State.CommandBuffers[commandBuffers[i]] = null
Jesse Hallfbf97b02015-11-20 14:17:03 -08004753 }
Jesse Halld27f6aa2015-08-15 17:58:48 -07004754}
4755
4756@threadSafety("app")
4757cmd VkResult vkBeginCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004758 VkCommandBuffer commandBuffer,
4759 const VkCommandBufferBeginInfo* pBeginInfo) {
4760 assert(pBeginInfo.sType == VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO)
4761 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004762
4763 // TODO: iterate over boundObjects and clear memory bindings
4764
4765 return ?
4766}
4767
4768@threadSafety("app")
4769cmd VkResult vkEndCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004770 VkCommandBuffer commandBuffer) {
4771 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004772
4773 return ?
4774}
4775
4776@threadSafety("app")
4777cmd VkResult vkResetCommandBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004778 VkCommandBuffer commandBuffer,
4779 VkCommandBufferResetFlags flags) {
4780 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004781
4782 // TODO: iterate over boundObjects and clear memory bindings
4783
4784 return ?
4785}
4786
4787
4788// Command buffer building functions
4789
4790@threadSafety("app")
4791cmd void vkCmdBindPipeline(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004792 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004793 VkPipelineBindPoint pipelineBindPoint,
4794 VkPipeline pipeline) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004795 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004796 pipelineObject := GetPipeline(pipeline)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004797 assert(commandBufferObject.device == pipelineObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004798
Jesse Halld8bade02015-11-24 10:24:18 -08004799 queue := switch (pipelineBindPoint) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004800 case VK_PIPELINE_BIND_POINT_COMPUTE: VK_QUEUE_COMPUTE_BIT
4801 case VK_PIPELINE_BIND_POINT_GRAPHICS: VK_QUEUE_GRAPHICS_BIT
4802 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08004803 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004804}
4805
4806@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004807cmd void vkCmdSetViewport(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004808 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004809 u32 firstViewport,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004810 u32 viewportCount,
4811 const VkViewport* pViewports) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004812 commandBufferObject := GetCommandBuffer(commandBuffer)
4813 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004814}
4815
4816@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004817cmd void vkCmdSetScissor(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004818 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004819 u32 firstScissor,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004820 u32 scissorCount,
4821 const VkRect2D* pScissors) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004822 commandBufferObject := GetCommandBuffer(commandBuffer)
4823 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004824}
4825
4826@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004827cmd void vkCmdSetLineWidth(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004828 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004829 f32 lineWidth) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004830 commandBufferObject := GetCommandBuffer(commandBuffer)
4831 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004832}
4833
4834@threadSafety("app")
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004835cmd void vkCmdSetDepthBias(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004836 VkCommandBuffer commandBuffer,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004837 f32 depthBiasConstantFactor,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004838 f32 depthBiasClamp,
Jesse Halla9bb62b2015-11-21 19:31:56 -08004839 f32 depthBiasSlopeFactor) {
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}
Jesse Halld27f6aa2015-08-15 17:58:48 -07004843
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004844@threadSafety("app")
4845cmd void vkCmdSetBlendConstants(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004846 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004847 // TODO(jessehall): apic only supports 'const' on pointer types. Using
4848 // an annotation as a quick hack to pass this to the template without
4849 // having to modify the AST and semantic model.
Jesse Hallb00daad2015-11-29 19:46:20 -08004850 @readonly f32[4] blendConstants) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004851 commandBufferObject := GetCommandBuffer(commandBuffer)
4852 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004853}
4854
4855@threadSafety("app")
4856cmd void vkCmdSetDepthBounds(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004857 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004858 f32 minDepthBounds,
4859 f32 maxDepthBounds) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004860 commandBufferObject := GetCommandBuffer(commandBuffer)
4861 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004862}
4863
4864@threadSafety("app")
4865cmd void vkCmdSetStencilCompareMask(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004866 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004867 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08004868 u32 compareMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004869 commandBufferObject := GetCommandBuffer(commandBuffer)
4870 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004871}
4872
4873@threadSafety("app")
4874cmd void vkCmdSetStencilWriteMask(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004875 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004876 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08004877 u32 writeMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004878 commandBufferObject := GetCommandBuffer(commandBuffer)
4879 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004880}
4881
4882@threadSafety("app")
4883cmd void vkCmdSetStencilReference(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004884 VkCommandBuffer commandBuffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004885 VkStencilFaceFlags faceMask,
Jesse Hall65ab5522015-11-30 00:07:16 -08004886 u32 reference) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004887 commandBufferObject := GetCommandBuffer(commandBuffer)
4888 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004889}
4890
4891@threadSafety("app")
4892cmd void vkCmdBindDescriptorSets(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004893 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004894 VkPipelineBindPoint pipelineBindPoint,
4895 VkPipelineLayout layout,
4896 u32 firstSet,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004897 u32 descriptorSetCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004898 const VkDescriptorSet* pDescriptorSets,
4899 u32 dynamicOffsetCount,
4900 const u32* pDynamicOffsets) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004901 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004902
Jesse Hall03b6fe12015-11-24 12:44:21 -08004903 descriptorSets := pDescriptorSets[0:descriptorSetCount]
4904 for i in (0 .. descriptorSetCount) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004905 descriptorSet := descriptorSets[i]
4906 descriptorSetObject := GetDescriptorSet(descriptorSet)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004907 assert(commandBufferObject.device == descriptorSetObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004908 }
4909
4910 dynamicOffsets := pDynamicOffsets[0:dynamicOffsetCount]
4911 for i in (0 .. dynamicOffsetCount) {
4912 dynamicOffset := dynamicOffsets[i]
4913 }
4914
Jesse Halld8bade02015-11-24 10:24:18 -08004915 queue := switch (pipelineBindPoint) {
Jesse Halld27f6aa2015-08-15 17:58:48 -07004916 case VK_PIPELINE_BIND_POINT_COMPUTE: VK_QUEUE_COMPUTE_BIT
4917 case VK_PIPELINE_BIND_POINT_GRAPHICS: VK_QUEUE_GRAPHICS_BIT
4918 }
Jesse Hall3fbc8562015-11-29 22:10:52 -08004919 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, queue)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004920}
4921
4922@threadSafety("app")
4923cmd void vkCmdBindIndexBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004924 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004925 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004926 VkDeviceSize offset,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004927 VkIndexType indexType) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004928 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004929 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004930 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004931
Jesse Hall3fbc8562015-11-29 22:10:52 -08004932 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004933
Jesse Hall3fbc8562015-11-29 22:10:52 -08004934 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004935}
4936
4937@threadSafety("app")
4938cmd void vkCmdBindVertexBuffers(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004939 VkCommandBuffer commandBuffer,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004940 u32 firstBinding,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004941 u32 bindingCount,
4942 const VkBuffer* pBuffers,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004943 const VkDeviceSize* pOffsets) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004944 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004945
Jesse Hallf9fa9a52016-01-08 16:08:51 -08004946 // TODO: check if not [firstBinding:firstBinding+bindingCount]
Jesse Halld27f6aa2015-08-15 17:58:48 -07004947 buffers := pBuffers[0:bindingCount]
4948 offsets := pOffsets[0:bindingCount]
4949 for i in (0 .. bindingCount) {
4950 buffer := buffers[i]
4951 offset := offsets[i]
4952 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004953 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004954
Jesse Hall3fbc8562015-11-29 22:10:52 -08004955 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004956 }
4957
Jesse Hall3fbc8562015-11-29 22:10:52 -08004958 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004959}
4960
4961@threadSafety("app")
4962cmd void vkCmdDraw(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004963 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004964 u32 vertexCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004965 u32 instanceCount,
4966 u32 firstVertex,
4967 u32 firstInstance) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004968 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004969
Jesse Hall3fbc8562015-11-29 22:10:52 -08004970 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004971}
4972
4973@threadSafety("app")
4974cmd void vkCmdDrawIndexed(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004975 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004976 u32 indexCount,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004977 u32 instanceCount,
4978 u32 firstIndex,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004979 s32 vertexOffset,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004980 u32 firstInstance) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004981 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004982
Jesse Hall3fbc8562015-11-29 22:10:52 -08004983 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004984}
4985
4986@threadSafety("app")
4987cmd void vkCmdDrawIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08004988 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004989 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07004990 VkDeviceSize offset,
Jesse Hall03b6fe12015-11-24 12:44:21 -08004991 u32 drawCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07004992 u32 stride) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08004993 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004994 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08004995 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004996
Jesse Hall3fbc8562015-11-29 22:10:52 -08004997 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07004998
Jesse Hall3fbc8562015-11-29 22:10:52 -08004999 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005000}
5001
5002@threadSafety("app")
5003cmd void vkCmdDrawIndexedIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005004 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005005 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005006 VkDeviceSize offset,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005007 u32 drawCount,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005008 u32 stride) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005009 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005010 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005011 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005012
Jesse Hall3fbc8562015-11-29 22:10:52 -08005013 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005014
Jesse Hall3fbc8562015-11-29 22:10:52 -08005015 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005016}
5017
5018@threadSafety("app")
5019cmd void vkCmdDispatch(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005020 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005021 u32 x,
5022 u32 y,
5023 u32 z) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005024 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005025
Jesse Hall3fbc8562015-11-29 22:10:52 -08005026 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_COMPUTE_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005027}
5028
5029@threadSafety("app")
5030cmd void vkCmdDispatchIndirect(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005031 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005032 VkBuffer buffer,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005033 VkDeviceSize offset) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005034 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005035 bufferObject := GetBuffer(buffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005036 assert(commandBufferObject.device == bufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005037
Jesse Hall3fbc8562015-11-29 22:10:52 -08005038 bindCommandBuffer(commandBuffer, buffer, bufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005039
Jesse Hall3fbc8562015-11-29 22:10:52 -08005040 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_COMPUTE_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005041}
5042
5043@threadSafety("app")
5044cmd void vkCmdCopyBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005045 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005046 VkBuffer srcBuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005047 VkBuffer dstBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005048 u32 regionCount,
5049 const VkBufferCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005050 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005051 srcBufferObject := GetBuffer(srcBuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005052 dstBufferObject := GetBuffer(dstBuffer)
5053 assert(commandBufferObject.device == srcBufferObject.device)
5054 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005055
5056 regions := pRegions[0:regionCount]
5057 for i in (0 .. regionCount) {
5058 region := regions[i]
5059 }
5060
Jesse Hall3fbc8562015-11-29 22:10:52 -08005061 bindCommandBuffer(commandBuffer, srcBuffer, srcBufferObject.memory)
5062 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005063
Jesse Hall65ab5522015-11-30 00:07:16 -08005064 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005065}
5066
5067@threadSafety("app")
5068cmd void vkCmdCopyImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005069 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005070 VkImage srcImage,
5071 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005072 VkImage dstImage,
5073 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005074 u32 regionCount,
5075 const VkImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005076 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005077 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005078 dstImageObject := GetImage(dstImage)
5079 assert(commandBufferObject.device == srcImageObject.device)
5080 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005081
5082 regions := pRegions[0:regionCount]
5083 for i in (0 .. regionCount) {
5084 region := regions[i]
5085 }
5086
Jesse Hall3fbc8562015-11-29 22:10:52 -08005087 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
5088 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005089
Jesse Hall65ab5522015-11-30 00:07:16 -08005090 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005091}
5092
5093@threadSafety("app")
5094cmd void vkCmdBlitImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005095 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005096 VkImage srcImage,
5097 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005098 VkImage dstImage,
5099 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005100 u32 regionCount,
5101 const VkImageBlit* pRegions,
Jesse Hall23ff73f2015-11-29 14:36:39 -08005102 VkFilter filter) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005103 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005104 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005105 dstImageObject := GetImage(dstImage)
5106 assert(commandBufferObject.device == srcImageObject.device)
5107 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005108
5109 regions := pRegions[0:regionCount]
5110 for i in (0 .. regionCount) {
5111 region := regions[i]
5112 }
5113
Jesse Hall3fbc8562015-11-29 22:10:52 -08005114 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
5115 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005116
Jesse Hall3fbc8562015-11-29 22:10:52 -08005117 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005118}
5119
5120@threadSafety("app")
5121cmd void vkCmdCopyBufferToImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005122 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005123 VkBuffer srcBuffer,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005124 VkImage dstImage,
5125 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005126 u32 regionCount,
5127 const VkBufferImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005128 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005129 srcBufferObject := GetBuffer(srcBuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005130 dstImageObject := GetImage(dstImage)
5131 assert(commandBufferObject.device == srcBufferObject.device)
5132 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005133
5134 regions := pRegions[0:regionCount]
5135 for i in (0 .. regionCount) {
5136 region := regions[i]
5137 }
5138
Jesse Hall3fbc8562015-11-29 22:10:52 -08005139 bindCommandBuffer(commandBuffer, srcBuffer, srcBufferObject.memory)
5140 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005141
Jesse Hall65ab5522015-11-30 00:07:16 -08005142 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005143}
5144
5145@threadSafety("app")
5146cmd void vkCmdCopyImageToBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005147 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005148 VkImage srcImage,
5149 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005150 VkBuffer dstBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005151 u32 regionCount,
5152 const VkBufferImageCopy* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005153 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005154 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005155 dstBufferObject := GetBuffer(dstBuffer)
5156 assert(commandBufferObject.device == srcImageObject.device)
5157 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005158
5159 regions := pRegions[0:regionCount]
5160 for i in (0 .. regionCount) {
5161 region := regions[i]
5162 }
5163
Jesse Hall3fbc8562015-11-29 22:10:52 -08005164 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
5165 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005166
Jesse Hall65ab5522015-11-30 00:07:16 -08005167 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005168}
5169
5170@threadSafety("app")
5171cmd void vkCmdUpdateBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005172 VkCommandBuffer commandBuffer,
5173 VkBuffer dstBuffer,
5174 VkDeviceSize dstOffset,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005175 VkDeviceSize dataSize,
Jesse Hall56d386a2016-07-26 15:20:40 -07005176 const void* pData) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005177 commandBufferObject := GetCommandBuffer(commandBuffer)
5178 dstBufferObject := GetBuffer(dstBuffer)
5179 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005180
5181 data := pData[0:dataSize]
5182
Jesse Hall3fbc8562015-11-29 22:10:52 -08005183 bindCommandBuffer(commandBuffer, dstBuffer, dstBufferObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005184
Jesse Hall65ab5522015-11-30 00:07:16 -08005185 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005186}
5187
5188@threadSafety("app")
5189cmd void vkCmdFillBuffer(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005190 VkCommandBuffer commandBuffer,
5191 VkBuffer dstBuffer,
5192 VkDeviceSize dstOffset,
Jesse Hallb00daad2015-11-29 19:46:20 -08005193 VkDeviceSize size,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005194 u32 data) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005195 commandBufferObject := GetCommandBuffer(commandBuffer)
5196 dstBufferObject := GetBuffer(dstBuffer)
5197 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005198
Jesse Hall65ab5522015-11-30 00:07:16 -08005199 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_TRANSFER_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005200}
5201
5202@threadSafety("app")
5203cmd void vkCmdClearColorImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005204 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005205 VkImage image,
5206 VkImageLayout imageLayout,
5207 const VkClearColorValue* pColor,
5208 u32 rangeCount,
5209 const VkImageSubresourceRange* pRanges) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005210 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005211 imageObject := GetImage(image)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005212 assert(commandBufferObject.device == imageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005213
5214 ranges := pRanges[0:rangeCount]
5215 for i in (0 .. rangeCount) {
5216 range := ranges[i]
5217 }
5218
Jesse Hall3fbc8562015-11-29 22:10:52 -08005219 bindCommandBuffer(commandBuffer, image, imageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005220
Jesse Hall3fbc8562015-11-29 22:10:52 -08005221 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005222}
5223
5224@threadSafety("app")
5225cmd void vkCmdClearDepthStencilImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005226 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005227 VkImage image,
5228 VkImageLayout imageLayout,
Jesse Hall5ae3abb2015-10-08 14:00:22 -07005229 const VkClearDepthStencilValue* pDepthStencil,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005230 u32 rangeCount,
5231 const VkImageSubresourceRange* pRanges) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005232 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005233 imageObject := GetImage(image)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005234 assert(commandBufferObject.device == imageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005235
5236 ranges := pRanges[0:rangeCount]
5237 for i in (0 .. rangeCount) {
5238 range := ranges[i]
5239 }
5240
Jesse Hall3fbc8562015-11-29 22:10:52 -08005241 bindCommandBuffer(commandBuffer, image, imageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005242
Jesse Hall3fbc8562015-11-29 22:10:52 -08005243 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005244}
5245
5246@threadSafety("app")
Jesse Hallae38f732015-11-19 21:32:50 -08005247cmd void vkCmdClearAttachments(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005248 VkCommandBuffer commandBuffer,
Jesse Hallae38f732015-11-19 21:32:50 -08005249 u32 attachmentCount,
5250 const VkClearAttachment* pAttachments,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005251 u32 rectCount,
Jesse Halla15a4bf2015-11-19 22:48:02 -08005252 const VkClearRect* pRects) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005253 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005254
5255 rects := pRects[0:rectCount]
5256 for i in (0 .. rectCount) {
5257 rect := rects[i]
5258 }
5259
Jesse Hall3fbc8562015-11-29 22:10:52 -08005260 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005261}
5262
5263@threadSafety("app")
5264cmd void vkCmdResolveImage(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005265 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005266 VkImage srcImage,
5267 VkImageLayout srcImageLayout,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005268 VkImage dstImage,
5269 VkImageLayout dstImageLayout,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005270 u32 regionCount,
5271 const VkImageResolve* pRegions) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005272 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005273 srcImageObject := GetImage(srcImage)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005274 dstImageObject := GetImage(dstImage)
5275 assert(commandBufferObject.device == srcImageObject.device)
5276 assert(commandBufferObject.device == dstImageObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005277
5278 regions := pRegions[0:regionCount]
5279 for i in (0 .. regionCount) {
5280 region := regions[i]
5281 }
5282
Jesse Hall3fbc8562015-11-29 22:10:52 -08005283 bindCommandBuffer(commandBuffer, srcImage, srcImageObject.memory)
5284 bindCommandBuffer(commandBuffer, dstImage, dstImageObject.memory)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005285
Jesse Hall3fbc8562015-11-29 22:10:52 -08005286 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005287}
5288
5289@threadSafety("app")
5290cmd void vkCmdSetEvent(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005291 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005292 VkEvent event,
5293 VkPipelineStageFlags stageMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005294 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005295 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005296 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005297}
5298
5299@threadSafety("app")
5300cmd void vkCmdResetEvent(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005301 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005302 VkEvent event,
5303 VkPipelineStageFlags stageMask) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005304 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005305 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005306 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005307}
5308
5309@threadSafety("app")
5310cmd void vkCmdWaitEvents(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005311 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005312 u32 eventCount,
5313 const VkEvent* pEvents,
5314 VkPipelineStageFlags srcStageMask,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005315 VkPipelineStageFlags dstStageMask,
5316 u32 memoryBarrierCount,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005317 const VkMemoryBarrier* pMemoryBarriers,
5318 u32 bufferMemoryBarrierCount,
5319 const VkBufferMemoryBarrier* pBufferMemoryBarriers,
5320 u32 imageMemoryBarrierCount,
5321 const VkImageMemoryBarrier* pImageMemoryBarriers) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005322 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005323
5324 events := pEvents[0:eventCount]
5325 for i in (0 .. eventCount) {
5326 event := events[i]
5327 eventObject := GetEvent(event)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005328 assert(commandBufferObject.device == eventObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005329 }
5330
Jesse Hall3dd678a2016-01-08 21:52:01 -08005331 memoryBarriers := pMemoryBarriers[0:memoryBarrierCount]
Jesse Hall3fbc8562015-11-29 22:10:52 -08005332 for i in (0 .. memoryBarrierCount) {
Jesse Hall3dd678a2016-01-08 21:52:01 -08005333 memoryBarrier := memoryBarriers[i]
5334 }
5335 bufferMemoryBarriers := pBufferMemoryBarriers[0:bufferMemoryBarrierCount]
5336 for i in (0 .. bufferMemoryBarrierCount) {
5337 bufferMemoryBarrier := bufferMemoryBarriers[i]
5338 bufferObject := GetBuffer(bufferMemoryBarrier.buffer)
5339 assert(bufferObject.device == commandBufferObject.device)
5340 }
5341 imageMemoryBarriers := pImageMemoryBarriers[0:imageMemoryBarrierCount]
5342 for i in (0 .. imageMemoryBarrierCount) {
5343 imageMemoryBarrier := imageMemoryBarriers[i]
5344 imageObject := GetImage(imageMemoryBarrier.image)
5345 assert(imageObject.device == commandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005346 }
5347}
5348
5349@threadSafety("app")
5350cmd void vkCmdPipelineBarrier(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005351 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005352 VkPipelineStageFlags srcStageMask,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005353 VkPipelineStageFlags dstStageMask,
Jesse Halldc6d36c2015-11-29 19:12:15 -08005354 VkDependencyFlags dependencyFlags,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005355 u32 memoryBarrierCount,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005356 const VkMemoryBarrier* pMemoryBarriers,
5357 u32 bufferMemoryBarrierCount,
5358 const VkBufferMemoryBarrier* pBufferMemoryBarriers,
5359 u32 imageMemoryBarrierCount,
5360 const VkImageMemoryBarrier* pImageMemoryBarriers) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005361 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005362
Jesse Hall3dd678a2016-01-08 21:52:01 -08005363 memoryBarriers := pMemoryBarriers[0:memoryBarrierCount]
Jesse Hall3fbc8562015-11-29 22:10:52 -08005364 for i in (0 .. memoryBarrierCount) {
Jesse Hall3dd678a2016-01-08 21:52:01 -08005365 memoryBarrier := memoryBarriers[i]
5366 }
5367 bufferMemoryBarriers := pBufferMemoryBarriers[0:bufferMemoryBarrierCount]
5368 for i in (0 .. bufferMemoryBarrierCount) {
5369 bufferMemoryBarrier := bufferMemoryBarriers[i]
5370 bufferObject := GetBuffer(bufferMemoryBarrier.buffer)
5371 assert(bufferObject.device == commandBufferObject.device)
5372 }
5373 imageMemoryBarriers := pImageMemoryBarriers[0:imageMemoryBarrierCount]
5374 for i in (0 .. imageMemoryBarrierCount) {
5375 imageMemoryBarrier := imageMemoryBarriers[i]
5376 imageObject := GetImage(imageMemoryBarrier.image)
5377 assert(imageObject.device == commandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005378 }
5379}
5380
5381@threadSafety("app")
5382cmd void vkCmdBeginQuery(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005383 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005384 VkQueryPool queryPool,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005385 u32 query,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005386 VkQueryControlFlags flags) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005387 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005388 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005389 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005390}
5391
5392@threadSafety("app")
5393cmd void vkCmdEndQuery(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005394 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005395 VkQueryPool queryPool,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005396 u32 query) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005397 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005398 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005399 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005400}
5401
5402@threadSafety("app")
5403cmd void vkCmdResetQueryPool(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005404 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005405 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005406 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005407 u32 queryCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005408 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005409 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005410 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005411}
5412
5413@threadSafety("app")
5414cmd void vkCmdWriteTimestamp(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005415 VkCommandBuffer commandBuffer,
Jesse Hall6f39a6d2015-11-24 11:08:36 -08005416 VkPipelineStageFlagBits pipelineStage,
Jesse Halla3a7a1d2015-11-24 11:37:23 -08005417 VkQueryPool queryPool,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005418 u32 query) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005419 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halla3a7a1d2015-11-24 11:37:23 -08005420 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005421 assert(commandBufferObject.device == queryPoolObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005422}
5423
5424@threadSafety("app")
5425cmd void vkCmdCopyQueryPoolResults(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005426 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005427 VkQueryPool queryPool,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005428 u32 firstQuery,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005429 u32 queryCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005430 VkBuffer dstBuffer,
5431 VkDeviceSize dstOffset,
Jesse Halla9bb62b2015-11-21 19:31:56 -08005432 VkDeviceSize stride,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005433 VkQueryResultFlags flags) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005434 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005435 queryPoolObject := GetQueryPool(queryPool)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005436 dstBufferObject := GetBuffer(dstBuffer)
5437 assert(commandBufferObject.device == queryPoolObject.device)
5438 assert(commandBufferObject.device == dstBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005439}
5440
5441cmd void vkCmdPushConstants(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005442 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005443 VkPipelineLayout layout,
5444 VkShaderStageFlags stageFlags,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005445 u32 offset,
5446 u32 size,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08005447 const void* pValues) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005448 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005449 layoutObject := GetPipelineLayout(layout)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005450 assert(commandBufferObject.device == layoutObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005451}
5452
5453@threadSafety("app")
5454cmd void vkCmdBeginRenderPass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005455 VkCommandBuffer commandBuffer,
Jesse Halld27f6aa2015-08-15 17:58:48 -07005456 const VkRenderPassBeginInfo* pRenderPassBegin,
Jesse Hall65ab5522015-11-30 00:07:16 -08005457 VkSubpassContents contents) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005458 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005459 renderPassObject := GetRenderPass(pRenderPassBegin.renderPass)
5460 framebufferObject := GetFramebuffer(pRenderPassBegin.framebuffer)
Jesse Hall3fbc8562015-11-29 22:10:52 -08005461 assert(commandBufferObject.device == renderPassObject.device)
5462 assert(commandBufferObject.device == framebufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005463
Jesse Hall3fbc8562015-11-29 22:10:52 -08005464 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005465}
5466
5467cmd void vkCmdNextSubpass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005468 VkCommandBuffer commandBuffer,
Jesse Hall65ab5522015-11-30 00:07:16 -08005469 VkSubpassContents contents) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005470 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005471}
5472
5473@threadSafety("app")
5474cmd void vkCmdEndRenderPass(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005475 VkCommandBuffer commandBuffer) {
5476 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005477
Jesse Hall3fbc8562015-11-29 22:10:52 -08005478 commandBufferObject.queueFlags = AddQueueFlag(commandBufferObject.queueFlags, VK_QUEUE_GRAPHICS_BIT)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005479}
5480
5481cmd void vkCmdExecuteCommands(
Jesse Hall3fbc8562015-11-29 22:10:52 -08005482 VkCommandBuffer commandBuffer,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005483 u32 commandBufferCount,
Jesse Hall3fbc8562015-11-29 22:10:52 -08005484 const VkCommandBuffer* pCommandBuffers) {
5485 commandBufferObject := GetCommandBuffer(commandBuffer)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005486
Jesse Hall3dd678a2016-01-08 21:52:01 -08005487 commandBuffers := pCommandBuffers[0:commandBufferCount]
5488 for i in (0 .. commandBufferCount) {
Jesse Hall3fbc8562015-11-29 22:10:52 -08005489 secondaryCommandBuffer := commandBuffers[i]
5490 secondaryCommandBufferObject := GetCommandBuffer(secondaryCommandBuffer)
5491 assert(commandBufferObject.device == secondaryCommandBufferObject.device)
Jesse Halld27f6aa2015-08-15 17:58:48 -07005492 }
5493}
5494
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005495@extension("VK_KHR_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005496cmd void vkDestroySurfaceKHR(
5497 VkInstance instance,
Jesse Hall0e74f002015-11-30 11:37:59 -08005498 VkSurfaceKHR surface,
5499 const VkAllocationCallbacks* pAllocator) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005500 instanceObject := GetInstance(instance)
5501 surfaceObject := GetSurface(surface)
5502 assert(surfaceObject.instance == instance)
Michael Lentine88594d72015-11-12 12:49:45 -08005503
Jesse Hall1356b0d2015-11-23 17:24:58 -08005504 State.Surfaces[surface] = null
Jesse Hall2818f932015-11-19 21:19:17 -08005505}
5506
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005507@extension("VK_KHR_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005508cmd VkResult vkGetPhysicalDeviceSurfaceSupportKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005509 VkPhysicalDevice physicalDevice,
5510 u32 queueFamilyIndex,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005511 VkSurfaceKHR surface,
Jesse Hallb00daad2015-11-29 19:46:20 -08005512 VkBool32* pSupported) {
5513 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08005514
5515 return ?
5516}
5517
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005518@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08005519cmd VkResult vkGetPhysicalDeviceSurfaceCapabilitiesKHR(
5520 VkPhysicalDevice physicalDevice,
5521 VkSurfaceKHR surface,
5522 VkSurfaceCapabilitiesKHR* pSurfaceCapabilities) {
5523 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5524
5525 surfaceCapabilities := ?
5526 pSurfaceCapabilities[0] = surfaceCapabilities
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 vkGetPhysicalDeviceSurfaceFormatsKHR(
5533 VkPhysicalDevice physicalDevice,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005534 VkSurfaceKHR surface,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005535 u32* pSurfaceFormatCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005536 VkSurfaceFormatKHR* pSurfaceFormats) {
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 pSurfaceFormatCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08005541 surfaceFormats := pSurfaceFormats[0:count]
5542
5543 for i in (0 .. count) {
5544 surfaceFormat := ?
5545 surfaceFormats[i] = surfaceFormat
5546 }
5547
5548 return ?
5549}
5550
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005551@extension("VK_KHR_surface")
Jesse Hallb00daad2015-11-29 19:46:20 -08005552cmd VkResult vkGetPhysicalDeviceSurfacePresentModesKHR(
5553 VkPhysicalDevice physicalDevice,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005554 VkSurfaceKHR surface,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005555 u32* pPresentModeCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005556 VkPresentModeKHR* pPresentModes) {
Jesse Hallb00daad2015-11-29 19:46:20 -08005557 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Michael Lentine88594d72015-11-12 12:49:45 -08005558
5559 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08005560 pPresentModeCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08005561 presentModes := pPresentModes[0:count]
5562
5563 for i in (0 .. count) {
5564 presentMode := ?
5565 presentModes[i] = presentMode
5566 }
5567
5568 return ?
5569}
5570
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005571@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005572cmd VkResult vkCreateSwapchainKHR(
5573 VkDevice device,
5574 const VkSwapchainCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005575 const VkAllocationCallbacks* pAllocator,
Michael Lentine88594d72015-11-12 12:49:45 -08005576 VkSwapchainKHR* pSwapchain) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005577 assert(pCreateInfo.sType == VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR)
Michael Lentine88594d72015-11-12 12:49:45 -08005578 deviceObject := GetDevice(device)
5579
5580 swapchain := ?
5581 pSwapchain[0] = swapchain
5582 State.Swapchains[swapchain] = new!SwapchainObject(device: device)
5583
5584 return ?
5585}
5586
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005587@extension("VK_KHR_swapchain")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005588cmd void vkDestroySwapchainKHR(
Michael Lentine88594d72015-11-12 12:49:45 -08005589 VkDevice device,
Jesse Hall0e74f002015-11-30 11:37:59 -08005590 VkSwapchainKHR swapchain,
5591 const VkAllocationCallbacks* pAllocator) {
Michael Lentine88594d72015-11-12 12:49:45 -08005592 deviceObject := GetDevice(device)
5593 swapchainObject := GetSwapchain(swapchain)
5594 assert(swapchainObject.device == device)
5595
5596 State.Swapchains[swapchain] = null
Michael Lentine88594d72015-11-12 12:49:45 -08005597}
5598
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005599@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005600cmd VkResult vkGetSwapchainImagesKHR(
5601 VkDevice device,
5602 VkSwapchainKHR swapchain,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005603 u32* pSwapchainImageCount,
Michael Lentine88594d72015-11-12 12:49:45 -08005604 VkImage* pSwapchainImages) {
5605 deviceObject := GetDevice(device)
5606
5607 count := as!u32(?)
Jesse Hall03b6fe12015-11-24 12:44:21 -08005608 pSwapchainImageCount[0] = count
Michael Lentine88594d72015-11-12 12:49:45 -08005609 swapchainImages := pSwapchainImages[0:count]
5610
5611 for i in (0 .. count) {
5612 swapchainImage := ?
5613 swapchainImages[i] = swapchainImage
Jesse Hall1356b0d2015-11-23 17:24:58 -08005614 State.Images[swapchainImage] = new!ImageObject(device: device)
Michael Lentine88594d72015-11-12 12:49:45 -08005615 }
5616
5617 return ?
5618}
5619
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005620@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005621cmd VkResult vkAcquireNextImageKHR(
5622 VkDevice device,
5623 VkSwapchainKHR swapchain,
5624 u64 timeout,
5625 VkSemaphore semaphore,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005626 VkFence fence,
Michael Lentine88594d72015-11-12 12:49:45 -08005627 u32* pImageIndex) {
5628 deviceObject := GetDevice(device)
5629 swapchainObject := GetSwapchain(swapchain)
5630
5631 imageIndex := ?
5632 pImageIndex[0] = imageIndex
5633
5634 return ?
5635}
5636
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005637@extension("VK_KHR_swapchain")
Michael Lentine88594d72015-11-12 12:49:45 -08005638cmd VkResult vkQueuePresentKHR(
5639 VkQueue queue,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08005640 const VkPresentInfoKHR* pPresentInfo) {
Michael Lentine88594d72015-11-12 12:49:45 -08005641 queueObject := GetQueue(queue)
5642
5643 presentInfo := ?
5644 pPresentInfo[0] = presentInfo
5645
5646 return ?
5647}
5648
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005649@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005650cmd VkResult vkGetPhysicalDeviceDisplayPropertiesKHR(
5651 VkPhysicalDevice physicalDevice,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005652 u32* pPropertyCount,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005653 VkDisplayPropertiesKHR* pProperties) {
5654 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5655 return ?
5656}
5657
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005658@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005659cmd VkResult vkGetPhysicalDeviceDisplayPlanePropertiesKHR(
5660 VkPhysicalDevice physicalDevice,
5661 u32* pPropertyCount,
5662 VkDisplayPlanePropertiesKHR* pProperties) {
5663 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5664 return ?
5665}
5666
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005667@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005668cmd VkResult vkGetDisplayPlaneSupportedDisplaysKHR(
5669 VkPhysicalDevice physicalDevice,
Jesse Hall3dd678a2016-01-08 21:52:01 -08005670 u32 planeIndex,
Jesse Hallf4ab2b12015-11-30 16:04:55 -08005671 u32* pDisplayCount,
5672 VkDisplayKHR* pDisplays) {
Jesse Halla6429252015-11-29 18:59:42 -08005673 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5674 return ?
5675}
5676
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005677@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005678cmd VkResult vkGetDisplayModePropertiesKHR(
5679 VkPhysicalDevice physicalDevice,
5680 VkDisplayKHR display,
Jesse Hall03b6fe12015-11-24 12:44:21 -08005681 u32* pPropertyCount,
5682 VkDisplayModePropertiesKHR* pProperties) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005683 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5684 return ?
5685}
5686
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005687@extension("VK_KHR_display")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005688cmd VkResult vkCreateDisplayModeKHR(
5689 VkPhysicalDevice physicalDevice,
5690 VkDisplayKHR display,
5691 const VkDisplayModeCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005692 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005693 VkDisplayModeKHR* pMode) {
5694 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5695 return ?
5696}
5697
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005698@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005699cmd VkResult vkGetDisplayPlaneCapabilitiesKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005700 VkPhysicalDevice physicalDevice,
Jesse Hall9ba8bc82015-11-30 16:22:16 -08005701 VkDisplayModeKHR mode,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005702 u32 planeIndex,
Jesse Halla6429252015-11-29 18:59:42 -08005703 VkDisplayPlaneCapabilitiesKHR* pCapabilities) {
Jesse Hall1356b0d2015-11-23 17:24:58 -08005704 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5705 return ?
5706}
5707
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005708@extension("VK_KHR_display")
Jesse Halla6429252015-11-29 18:59:42 -08005709cmd VkResult vkCreateDisplayPlaneSurfaceKHR(
5710 VkInstance instance,
5711 const VkDisplaySurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005712 const VkAllocationCallbacks* pAllocator,
Jesse Halla6429252015-11-29 18:59:42 -08005713 VkSurfaceKHR* pSurface) {
5714 return ?
5715}
5716
Jesse Hall9ba8bc82015-11-30 16:22:16 -08005717@extension("VK_KHR_display_swapchain")
5718cmd VkResult vkCreateSharedSwapchainsKHR(
5719 VkDevice device,
5720 u32 swapchainCount,
5721 const VkSwapchainCreateInfoKHR* pCreateInfos,
5722 const VkAllocationCallbacks* pAllocator,
5723 VkSwapchainKHR* pSwapchains) {
5724 return ?
5725}
5726
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005727@extension("VK_KHR_xlib_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005728cmd VkResult vkCreateXlibSurfaceKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005729 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005730 const VkXlibSurfaceCreateInfoKHR* 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 Hall3e0dc8f2015-11-30 00:42:57 -08005737@extension("VK_KHR_xlib_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005738cmd VkBool32 vkGetPhysicalDeviceXlibPresentationSupportKHR(
5739 VkPhysicalDevice physicalDevice,
5740 u32 queueFamilyIndex,
5741 platform.Display* dpy,
Jesse Hall65ab5522015-11-30 00:07:16 -08005742 platform.VisualID visualID) {
Jesse Halla6429252015-11-29 18:59:42 -08005743 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5744 return ?
5745}
5746
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005747@extension("VK_KHR_xcb_surface")
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005748cmd VkResult vkCreateXcbSurfaceKHR(
Jesse Hall1356b0d2015-11-23 17:24:58 -08005749 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005750 const VkXcbSurfaceCreateInfoKHR* 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 Hall523db342015-11-30 21:12:55 -08005757@extension("VK_KHR_xcb_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005758cmd VkBool32 vkGetPhysicalDeviceXcbPresentationSupportKHR(
5759 VkPhysicalDevice physicalDevice,
5760 u32 queueFamilyIndex,
5761 platform.xcb_connection_t* connection,
5762 platform.xcb_visualid_t visual_id) {
5763 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5764 return ?
5765}
5766
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005767@extension("VK_KHR_wayland_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005768cmd VkResult vkCreateWaylandSurfaceKHR(
5769 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005770 const VkWaylandSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005771 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005772 VkSurfaceKHR* pSurface) {
5773 instanceObject := GetInstance(instance)
5774 return ?
5775}
5776
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005777@extension("VK_KHR_wayland_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005778cmd VkBool32 vkGetPhysicalDeviceWaylandPresentationSupportKHR(
5779 VkPhysicalDevice physicalDevice,
5780 u32 queueFamilyIndex,
5781 platform.wl_display* display) {
5782 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5783 return ?
5784}
5785
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005786@extension("VK_KHR_mir_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005787cmd VkResult vkCreateMirSurfaceKHR(
5788 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005789 const VkMirSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005790 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005791 VkSurfaceKHR* pSurface) {
5792 instanceObject := GetInstance(instance)
5793 return ?
5794}
5795
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005796@extension("VK_KHR_mir_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005797cmd VkBool32 vkGetPhysicalDeviceMirPresentationSupportKHR(
5798 VkPhysicalDevice physicalDevice,
5799 u32 queueFamilyIndex,
5800 platform.MirConnection* connection) {
5801 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
5802 return ?
5803}
5804
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005805@extension("VK_KHR_android_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005806cmd VkResult vkCreateAndroidSurfaceKHR(
5807 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005808 const VkAndroidSurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005809 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005810 VkSurfaceKHR* pSurface) {
5811 instanceObject := GetInstance(instance)
5812 return ?
5813}
5814
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005815@extension("VK_KHR_win32_surface")
Jesse Hall1356b0d2015-11-23 17:24:58 -08005816cmd VkResult vkCreateWin32SurfaceKHR(
5817 VkInstance instance,
Jesse Hallf9fa9a52016-01-08 16:08:51 -08005818 const VkWin32SurfaceCreateInfoKHR* pCreateInfo,
Jesse Hall0e74f002015-11-30 11:37:59 -08005819 const VkAllocationCallbacks* pAllocator,
Jesse Hall1356b0d2015-11-23 17:24:58 -08005820 VkSurfaceKHR* pSurface) {
5821 instanceObject := GetInstance(instance)
5822 return ?
5823}
5824
Jesse Hall3e0dc8f2015-11-30 00:42:57 -08005825@extension("VK_KHR_win32_surface")
Jesse Halla6429252015-11-29 18:59:42 -08005826cmd VkResult vkGetPhysicalDeviceWin32PresentationSupportKHR(
5827 VkPhysicalDevice physicalDevice,
5828 u32 queueFamilyIndex) {
Jesse Halle2948d82016-02-25 04:19:32 -08005829 physicalDeviceObject := GetPhysicalDevice(physicalDevice)
Jesse Halla6429252015-11-29 18:59:42 -08005830 return ?
5831}
5832
Chia-I Wub262ddc2016-03-22 07:38:20 +08005833@extension("VK_ANDROID_native_buffer")
5834cmd VkResult vkGetSwapchainGrallocUsageANDROID(
5835 VkDevice device,
5836 VkFormat format,
5837 VkImageUsageFlags imageUsage,
5838 int* grallocUsage) {
5839 return ?
5840}
5841
5842@extension("VK_ANDROID_native_buffer")
Chris Forbes8e4438b2016-12-07 16:26:49 +13005843cmd VkResult vkGetSwapchainGrallocUsage2ANDROID(
5844 VkDevice device,
5845 VkFormat format,
5846 VkImageUsageFlags imageUsage,
5847 VkSwapchainImageUsageFlagsANDROID swapchainImageUsage,
5848 int* grallocUsage) {
5849 return ?
5850}
5851
5852@extension("VK_ANDROID_native_buffer")
Chia-I Wub262ddc2016-03-22 07:38:20 +08005853cmd VkResult vkAcquireImageANDROID(
5854 VkDevice device,
5855 VkImage image,
5856 int nativeFenceFd,
5857 VkSemaphore semaphore,
5858 VkFence fence) {
5859 return ?
5860}
5861
5862@extension("VK_ANDROID_native_buffer")
5863cmd VkResult vkQueueSignalReleaseImageANDROID(
5864 VkQueue queue,
5865 u32 waitSemaphoreCount,
5866 const VkSemaphore* pWaitSemaphores,
5867 VkImage image,
5868 int* pNativeFenceFd) {
5869 return ?
5870}
5871
Ian Elliott4c8bb2a2016-12-29 11:07:26 -07005872@extension("VK_GOOGLE_display_timing")
5873cmd VkResult vkGetRefreshCycleDurationGOOGLE(
5874 VkDevice device,
5875 VkSwapchainKHR swapchain,
5876 VkRefreshCycleDurationGOOGLE* pDisplayTimingProperties) {
5877 deviceObject := GetDevice(device)
5878 swapchainObject := GetSwapchain(swapchain)
5879
5880 displayTimingProperties := ?
5881 pDisplayTimingProperties[0] = displayTimingProperties
5882
5883 return ?
5884}
5885
5886@extension("VK_GOOGLE_display_timing")
5887cmd VkResult vkGetPastPresentationTimingGOOGLE(
5888 VkDevice device,
5889 VkSwapchainKHR swapchain,
5890 u32* pPresentationTimingCount,
5891 VkPastPresentationTimingGOOGLE* pPresentationTimings) {
5892 deviceObject := GetDevice(device)
5893
5894 count := as!u32(?)
5895 pPresentationTimingCount[0] = count
5896 presentationTimings := pPresentationTimings[0:count]
5897
5898 for i in (0 .. count) {
5899 presentationTiming := ?
5900 presentationTimings[i] = presentationTiming
5901 State.Timings[presentationTiming] = new!PresentationTiming(device: device)
5902 }
5903
5904 return ?
5905}
5906
Jesse Hall715b86a2016-01-16 16:34:29 -08005907@extension("VK_EXT_debug_report")
5908@external type void* PFN_vkDebugReportCallbackEXT
5909@extension("VK_EXT_debug_report")
5910@pfn cmd VkBool32 vkDebugReportCallbackEXT(
5911 VkDebugReportFlagsEXT flags,
5912 VkDebugReportObjectTypeEXT objectType,
5913 u64 object,
5914 platform.size_t location,
5915 s32 messageCode,
5916 const char* pLayerPrefix,
5917 const char* pMessage,
5918 void* pUserData) {
5919 return ?
5920}
5921
5922@extension("VK_EXT_debug_report")
5923cmd VkResult vkCreateDebugReportCallbackEXT(
5924 VkInstance instance,
5925 const VkDebugReportCallbackCreateInfoEXT* pCreateInfo,
5926 const VkAllocationCallbacks* pAllocator,
5927 VkDebugReportCallbackEXT* pCallback) {
5928 return ?
5929}
5930
5931@extension("VK_EXT_debug_report")
5932cmd void vkDestroyDebugReportCallbackEXT(
5933 VkInstance instance,
5934 VkDebugReportCallbackEXT callback,
5935 const VkAllocationCallbacks* pAllocator) {
5936}
5937
5938@extension("VK_EXT_debug_report")
5939cmd void vkDebugReportMessageEXT(
5940 VkInstance instance,
5941 VkDebugReportFlagsEXT flags,
5942 VkDebugReportObjectTypeEXT objectType,
5943 u64 object,
5944 platform.size_t location,
5945 s32 messageCode,
5946 const char* pLayerPrefix,
5947 const char* pMessage) {
5948}
5949
Jesse Hall26763382016-05-20 07:13:52 -07005950@extension("VK_EXT_debug_marker")
5951cmd VkResult vkDebugMarkerSetObjectTagEXT(
5952 VkDevice device,
5953 VkDebugMarkerObjectTagInfoEXT* pTagInfo) {
5954 return ?
5955}
5956
5957@extension("VK_EXT_debug_marker")
5958cmd VkResult vkDebugMarkerSetObjectNameEXT(
5959 VkDevice device,
5960 VkDebugMarkerObjectNameInfoEXT* pNameInfo) {
5961 return ?
5962}
5963
5964@extension("VK_EXT_debug_marker")
5965cmd void vkCmdDebugMarkerBeginEXT(
5966 VkCommandBuffer commandBuffer,
5967 VkDebugMarkerMarkerInfoEXT* pMarkerInfo) {
5968}
5969
5970@extension("VK_EXT_debug_marker")
5971cmd void vkCmdDebugMarkerEndEXT(
5972 VkCommandBuffer commandBuffer) {
5973}
5974
5975@extension("VK_EXT_debug_marker")
5976cmd void vkCmdDebugMarkerInsertEXT(
5977 VkCommandBuffer commandBuffer,
5978 VkDebugMarkerMarkerInfoEXT* pMarkerInfo) {
5979}
5980
Chris Forbes1194ede2016-12-30 16:29:25 +13005981@extension("VK_KHR_get_physical_device_properties2")
5982cmd void vkGetPhysicalDeviceFeatures2KHR(
5983 VkPhysicalDevice physicalDevice,
5984 VkPhysicalDeviceFeatures2KHR* pFeatures) {
5985}
5986
5987@extension("VK_KHR_get_physical_device_properties2")
5988cmd void vkGetPhysicalDeviceProperties2KHR(
5989 VkPhysicalDevice physicalDevice,
5990 VkPhysicalDeviceProperties2KHR* pProperties) {
5991}
5992
5993@extension("VK_KHR_get_physical_device_properties2")
5994cmd void vkGetPhysicalDeviceFormatProperties2KHR(
5995 VkPhysicalDevice physicalDevice,
5996 VkFormat format,
5997 VkFormatProperties2KHR* pFormatProperties) {
5998}
5999
6000@extension("VK_KHR_get_physical_device_properties2")
6001cmd VkResult vkGetPhysicalDeviceImageFormatProperties2KHR(
6002 VkPhysicalDevice physicalDevice,
6003 const VkPhysicalDeviceImageFormatInfo2KHR* pImageFormatInfo,
6004 VkImageFormatProperties2KHR* pImageFormatProperties) {
6005 return ?
6006}
6007
6008@extension("VK_KHR_get_physical_device_properties2")
6009cmd void vkGetPhysicalDeviceQueueFamilyProperties2KHR(
6010 VkPhysicalDevice physicalDevice,
6011 u32* pQueueFamilyPropertyCount,
6012 VkQueueFamilyProperties2KHR* pQueueFamilyProperties) {
6013}
6014
6015@extension("VK_KHR_get_physical_device_properties2")
6016cmd void vkGetPhysicalDeviceMemoryProperties2KHR(
6017 VkPhysicalDevice physicalDevice,
6018 VkPhysicalDeviceMemoryProperties2KHR* pMemoryProperties) {
6019}
6020
6021@extension("VK_KHR_get_physical_device_properties2")
6022cmd void vkGetPhysicalDeviceSparseImageFormatProperties2KHR(
6023 VkPhysicalDevice physicalDevice,
6024 const VkPhysicalDeviceSparseImageFormatInfo2KHR* pFormatInfo,
6025 u32* pPropertyCount,
6026 VkSparseImageFormatProperties2KHR* pProperties) {
6027}
6028
Chris Forbes289cb792016-12-30 15:03:55 +13006029@extension("VK_AMD_draw_indirect_count")
6030cmd void vkCmdDrawIndirectCountAMD(
6031 VkCommandBuffer commandBuffer,
6032 VkBuffer buffer,
6033 VkDeviceSize offset,
6034 VkBuffer countBuffer,
6035 VkDeviceSize countBufferOffset,
6036 u32 maxDrawCount,
6037 u32 stride) {
6038}
6039
6040@extension("VK_AMD_draw_indirect_count")
6041cmd void vkCmdDrawIndexedIndirectCountAMD(
6042 VkCommandBuffer commandBuffer,
6043 VkBuffer buffer,
6044 VkDeviceSize offset,
6045 VkBuffer countBuffer,
6046 VkDeviceSize countBufferOffset,
6047 u32 maxDrawCount,
6048 u32 stride) {
6049}
6050
6051@extension("VK_NV_external_memory_capabilities")
6052cmd VkResult vkGetPhysicalDeviceExternalImageFormatPropertiesNV(
6053 VkPhysicalDevice physicalDevice,
6054 VkFormat format,
6055 VkImageType type,
6056 VkImageTiling tiling,
6057 VkImageUsageFlags usage,
6058 VkImageCreateFlags flags,
6059 VkExternalMemoryHandleTypeFlagsNV externalHandleType,
6060 VkExternalImageFormatPropertiesNV* pExternalImageFormatProperties) {
6061 return ?
6062}
6063
6064@extension("VK_NV_external_memory_win32")
6065cmd VkResult vkGetMemoryWin32HandleNV(
6066 VkDevice device,
6067 VkDeviceMemory memory,
6068 VkExternalMemoryHandleTypeFlagsNV handleType,
6069 platform.HANDLE* pHandle) {
6070 return ?
6071}
6072
6073@extension("VK_NV_external_memory_win32")
6074cmd void vkCmdProcessCommandsNVX(
6075 VkCommandBuffer commandBuffer,
6076 const VkCmdProcessCommandsInfoNVX* pProcessCommandsInfo) {
6077}
6078
6079@extension("VK_NV_external_memory_win32")
6080cmd void vkCmdReserveSpaceForCommandsNVX(
6081 VkCommandBuffer commandBuffer,
6082 const VkCmdReserveSpaceForCommandsInfoNVX* pReserveSpaceInfo) {
6083}
6084
6085@extension("VK_NV_external_memory_win32")
6086cmd VkResult vkCreateIndirectCommandsLayoutNVX(
6087 VkDevice device,
6088 const VkIndirectCommandsLayoutCreateInfoNVX* pCreateInfo,
6089 const VkAllocationCallbacks* pAllocator,
6090 VkIndirectCommandsLayoutNVX* pIndirectCommandsLayout) {
6091 return ?
6092}
6093
6094@extension("VK_NV_external_memory_win32")
6095cmd void vkDestroyIndirectCommandsLayoutNVX(
6096 VkDevice device,
6097 VkIndirectCommandsLayoutNVX indirectCommandsLayout,
6098 const VkAllocationCallbacks* pAllocator) {
6099}
6100
6101@extension("VK_NV_external_memory_win32")
6102cmd VkResult vkCreateObjectTableNVX(
6103 VkDevice device,
6104 const VkObjectTableCreateInfoNVX* pCreateInfo,
6105 const VkAllocationCallbacks* pAllocator,
6106 VkObjectTableNVX* pObjectTable) {
6107 return ?
6108}
6109
6110@extension("VK_NV_external_memory_win32")
6111cmd void vkDestroyObjectTableNVX(
6112 VkDevice device,
6113 VkObjectTableNVX objectTable,
6114 const VkAllocationCallbacks* pAllocator) {
6115}
6116
6117@extension("VK_NV_external_memory_win32")
6118cmd VkResult vkRegisterObjectsNVX(
6119 VkDevice device,
6120 VkObjectTableNVX objectTable,
6121 u32 objectCount,
6122 const VkObjectTableEntryNVX* const* ppObjectTableEntries,
6123 const u32* pObjectIndices) {
6124 return ?
6125}
6126
6127@extension("VK_NV_external_memory_win32")
6128cmd VkResult vkUnregisterObjectsNVX(
6129 VkDevice device,
6130 VkObjectTableNVX objectTable,
6131 u32 objectCount,
6132 const VkObjectEntryTypeNVX* pObjectEntryTypes,
6133 const u32* pObjectIndices) {
6134 return ?
6135}
6136
6137@extension("VK_NV_external_memory_win32")
6138cmd void vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX(
6139 VkPhysicalDevice physicalDevice,
6140 VkDeviceGeneratedCommandsFeaturesNVX* pFeatures,
6141 VkDeviceGeneratedCommandsLimitsNVX* pLimits) {
6142}
6143
Jesse Halld27f6aa2015-08-15 17:58:48 -07006144
6145////////////////
6146// Validation //
6147////////////////
6148
6149extern void validate(string layerName, bool condition, string message)
6150
6151
6152/////////////////////////////
6153// Internal State Tracking //
6154/////////////////////////////
6155
6156StateObject State
6157
6158@internal class StateObject {
6159 // Dispatchable objects.
6160 map!(VkInstance, ref!InstanceObject) Instances
6161 map!(VkPhysicalDevice, ref!PhysicalDeviceObject) PhysicalDevices
6162 map!(VkDevice, ref!DeviceObject) Devices
6163 map!(VkQueue, ref!QueueObject) Queues
Jesse Hall3fbc8562015-11-29 22:10:52 -08006164 map!(VkCommandBuffer, ref!CommandBufferObject) CommandBuffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07006165
6166 // Non-dispatchable objects.
6167 map!(VkDeviceMemory, ref!DeviceMemoryObject) DeviceMemories
6168 map!(VkBuffer, ref!BufferObject) Buffers
6169 map!(VkBufferView, ref!BufferViewObject) BufferViews
6170 map!(VkImage, ref!ImageObject) Images
6171 map!(VkImageView, ref!ImageViewObject) ImageViews
Jesse Halld27f6aa2015-08-15 17:58:48 -07006172 map!(VkShaderModule, ref!ShaderModuleObject) ShaderModules
Jesse Halld27f6aa2015-08-15 17:58:48 -07006173 map!(VkPipeline, ref!PipelineObject) Pipelines
6174 map!(VkPipelineLayout, ref!PipelineLayoutObject) PipelineLayouts
6175 map!(VkSampler, ref!SamplerObject) Samplers
6176 map!(VkDescriptorSet, ref!DescriptorSetObject) DescriptorSets
6177 map!(VkDescriptorSetLayout, ref!DescriptorSetLayoutObject) DescriptorSetLayouts
6178 map!(VkDescriptorPool, ref!DescriptorPoolObject) DescriptorPools
Jesse Halld27f6aa2015-08-15 17:58:48 -07006179 map!(VkFence, ref!FenceObject) Fences
6180 map!(VkSemaphore, ref!SemaphoreObject) Semaphores
6181 map!(VkEvent, ref!EventObject) Events
6182 map!(VkQueryPool, ref!QueryPoolObject) QueryPools
6183 map!(VkFramebuffer, ref!FramebufferObject) Framebuffers
6184 map!(VkRenderPass, ref!RenderPassObject) RenderPasses
6185 map!(VkPipelineCache, ref!PipelineCacheObject) PipelineCaches
Jesse Hall3fbc8562015-11-29 22:10:52 -08006186 map!(VkCommandPool, ref!CommandPoolObject) CommandPools
Jesse Hall1356b0d2015-11-23 17:24:58 -08006187 map!(VkSurfaceKHR, ref!SurfaceObject) Surfaces
Michael Lentine88594d72015-11-12 12:49:45 -08006188 map!(VkSwapchainKHR, ref!SwapchainObject) Swapchains
Jesse Halld27f6aa2015-08-15 17:58:48 -07006189}
6190
6191@internal class InstanceObject {
6192}
6193
6194@internal class PhysicalDeviceObject {
6195 VkInstance instance
6196}
6197
6198@internal class DeviceObject {
6199 VkPhysicalDevice physicalDevice
6200}
6201
6202@internal class QueueObject {
6203 VkDevice device
6204 VkQueueFlags flags
6205}
6206
Jesse Hall3fbc8562015-11-29 22:10:52 -08006207@internal class CommandBufferObject {
Jesse Halld27f6aa2015-08-15 17:58:48 -07006208 VkDevice device
6209 map!(u64, VkDeviceMemory) boundObjects
6210 VkQueueFlags queueFlags
6211}
6212
6213@internal class DeviceMemoryObject {
Jesse Hall3fbc8562015-11-29 22:10:52 -08006214 VkDevice device
6215 VkDeviceSize allocationSize
6216 map!(u64, VkDeviceSize) boundObjects
6217 map!(VkCommandBuffer, VkCommandBuffer) boundCommandBuffers
Jesse Halld27f6aa2015-08-15 17:58:48 -07006218}
6219
6220@internal class BufferObject {
6221 VkDevice device
Jesse Hall3fbc8562015-11-29 22:10:52 -08006222 VkDeviceMemory memory
6223 VkDeviceSize memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07006224}
6225
6226@internal class BufferViewObject {
6227 VkDevice device
6228 VkBuffer buffer
6229}
6230
6231@internal class ImageObject {
6232 VkDevice device
Jesse Hall3fbc8562015-11-29 22:10:52 -08006233 VkDeviceMemory memory
6234 VkDeviceSize memoryOffset
Jesse Halld27f6aa2015-08-15 17:58:48 -07006235}
6236
6237@internal class ImageViewObject {
6238 VkDevice device
6239 VkImage image
6240}
6241
Jesse Halld27f6aa2015-08-15 17:58:48 -07006242@internal class ShaderObject {
6243 VkDevice device
6244}
6245
6246@internal class ShaderModuleObject {
6247 VkDevice device
6248}
6249
6250@internal class PipelineObject {
6251 VkDevice device
6252}
6253
6254@internal class PipelineLayoutObject {
6255 VkDevice device
6256}
6257
6258@internal class SamplerObject {
6259 VkDevice device
6260}
6261
6262@internal class DescriptorSetObject {
6263 VkDevice device
6264}
6265
6266@internal class DescriptorSetLayoutObject {
6267 VkDevice device
6268}
6269
6270@internal class DescriptorPoolObject {
6271 VkDevice device
6272}
6273
Jesse Halld27f6aa2015-08-15 17:58:48 -07006274@internal class FenceObject {
6275 VkDevice device
6276 bool signaled
6277}
6278
6279@internal class SemaphoreObject {
6280 VkDevice device
6281}
6282
6283@internal class EventObject {
6284 VkDevice device
6285}
6286
6287@internal class QueryPoolObject {
6288 VkDevice device
6289}
6290
6291@internal class FramebufferObject {
6292 VkDevice device
6293}
6294
6295@internal class RenderPassObject {
6296 VkDevice device
6297}
6298
6299@internal class PipelineCacheObject {
6300 VkDevice device
6301}
6302
Jesse Hall3fbc8562015-11-29 22:10:52 -08006303@internal class CommandPoolObject {
Jesse Halld27f6aa2015-08-15 17:58:48 -07006304 VkDevice device
6305}
6306
Jesse Hall1356b0d2015-11-23 17:24:58 -08006307@internal class SurfaceObject {
6308 VkInstance instance
6309}
6310
Michael Lentine88594d72015-11-12 12:49:45 -08006311@internal class SwapchainObject {
6312 VkDevice device
6313}
6314
Jesse Halld27f6aa2015-08-15 17:58:48 -07006315macro ref!InstanceObject GetInstance(VkInstance instance) {
6316 assert(instance in State.Instances)
6317 return State.Instances[instance]
6318}
6319
6320macro ref!PhysicalDeviceObject GetPhysicalDevice(VkPhysicalDevice physicalDevice) {
6321 assert(physicalDevice in State.PhysicalDevices)
6322 return State.PhysicalDevices[physicalDevice]
6323}
6324
6325macro ref!DeviceObject GetDevice(VkDevice device) {
6326 assert(device in State.Devices)
6327 return State.Devices[device]
6328}
6329
6330macro ref!QueueObject GetQueue(VkQueue queue) {
6331 assert(queue in State.Queues)
6332 return State.Queues[queue]
6333}
6334
Jesse Hall3fbc8562015-11-29 22:10:52 -08006335macro ref!CommandBufferObject GetCommandBuffer(VkCommandBuffer commandBuffer) {
6336 assert(commandBuffer in State.CommandBuffers)
6337 return State.CommandBuffers[commandBuffer]
Jesse Halld27f6aa2015-08-15 17:58:48 -07006338}
6339
Jesse Hall3fbc8562015-11-29 22:10:52 -08006340macro ref!DeviceMemoryObject GetDeviceMemory(VkDeviceMemory memory) {
6341 assert(memory in State.DeviceMemories)
6342 return State.DeviceMemories[memory]
Jesse Halld27f6aa2015-08-15 17:58:48 -07006343}
6344
6345macro ref!BufferObject GetBuffer(VkBuffer buffer) {
6346 assert(buffer in State.Buffers)
6347 return State.Buffers[buffer]
6348}
6349
6350macro ref!BufferViewObject GetBufferView(VkBufferView bufferView) {
6351 assert(bufferView in State.BufferViews)
6352 return State.BufferViews[bufferView]
6353}
6354
6355macro ref!ImageObject GetImage(VkImage image) {
6356 assert(image in State.Images)
6357 return State.Images[image]
6358}
6359
6360macro ref!ImageViewObject GetImageView(VkImageView imageView) {
6361 assert(imageView in State.ImageViews)
6362 return State.ImageViews[imageView]
6363}
6364
Jesse Halld27f6aa2015-08-15 17:58:48 -07006365macro ref!ShaderModuleObject GetShaderModule(VkShaderModule shaderModule) {
6366 assert(shaderModule in State.ShaderModules)
6367 return State.ShaderModules[shaderModule]
6368}
6369
6370macro ref!PipelineObject GetPipeline(VkPipeline pipeline) {
6371 assert(pipeline in State.Pipelines)
6372 return State.Pipelines[pipeline]
6373}
6374
6375macro ref!PipelineLayoutObject GetPipelineLayout(VkPipelineLayout pipelineLayout) {
6376 assert(pipelineLayout in State.PipelineLayouts)
6377 return State.PipelineLayouts[pipelineLayout]
6378}
6379
6380macro ref!SamplerObject GetSampler(VkSampler sampler) {
6381 assert(sampler in State.Samplers)
6382 return State.Samplers[sampler]
6383}
6384
6385macro ref!DescriptorSetObject GetDescriptorSet(VkDescriptorSet descriptorSet) {
6386 assert(descriptorSet in State.DescriptorSets)
6387 return State.DescriptorSets[descriptorSet]
6388}
6389
6390macro ref!DescriptorSetLayoutObject GetDescriptorSetLayout(VkDescriptorSetLayout descriptorSetLayout) {
6391 assert(descriptorSetLayout in State.DescriptorSetLayouts)
6392 return State.DescriptorSetLayouts[descriptorSetLayout]
6393}
6394
6395macro ref!DescriptorPoolObject GetDescriptorPool(VkDescriptorPool descriptorPool) {
6396 assert(descriptorPool in State.DescriptorPools)
6397 return State.DescriptorPools[descriptorPool]
6398}
6399
Jesse Halld27f6aa2015-08-15 17:58:48 -07006400macro ref!FenceObject GetFence(VkFence fence) {
6401 assert(fence in State.Fences)
6402 return State.Fences[fence]
6403}
6404
6405macro ref!SemaphoreObject GetSemaphore(VkSemaphore semaphore) {
6406 assert(semaphore in State.Semaphores)
6407 return State.Semaphores[semaphore]
6408}
6409
6410macro ref!EventObject GetEvent(VkEvent event) {
6411 assert(event in State.Events)
6412 return State.Events[event]
6413}
6414
6415macro ref!QueryPoolObject GetQueryPool(VkQueryPool queryPool) {
6416 assert(queryPool in State.QueryPools)
6417 return State.QueryPools[queryPool]
6418}
6419
6420macro ref!FramebufferObject GetFramebuffer(VkFramebuffer framebuffer) {
6421 assert(framebuffer in State.Framebuffers)
6422 return State.Framebuffers[framebuffer]
6423}
6424
6425macro ref!RenderPassObject GetRenderPass(VkRenderPass renderPass) {
6426 assert(renderPass in State.RenderPasses)
6427 return State.RenderPasses[renderPass]
6428}
6429
6430macro ref!PipelineCacheObject GetPipelineCache(VkPipelineCache pipelineCache) {
6431 assert(pipelineCache in State.PipelineCaches)
6432 return State.PipelineCaches[pipelineCache]
6433}
6434
Jesse Hall3fbc8562015-11-29 22:10:52 -08006435macro ref!CommandPoolObject GetCommandPool(VkCommandPool commandPool) {
6436 assert(commandPool in State.CommandPools)
6437 return State.CommandPools[commandPool]
Jesse Hallf09c6b12015-08-15 19:54:28 -07006438}
Michael Lentine88594d72015-11-12 12:49:45 -08006439
Jesse Hall1356b0d2015-11-23 17:24:58 -08006440macro ref!SurfaceObject GetSurface(VkSurfaceKHR surface) {
6441 assert(surface in State.Surfaces)
6442 return State.Surfaces[surface]
6443}
6444
Michael Lentine88594d72015-11-12 12:49:45 -08006445macro ref!SwapchainObject GetSwapchain(VkSwapchainKHR swapchain) {
6446 assert(swapchain in State.Swapchains)
6447 return State.Swapchains[swapchain]
6448}
Jesse Halld8bade02015-11-24 10:24:18 -08006449
6450macro VkQueueFlags AddQueueFlag(VkQueueFlags flags, VkQueueFlagBits bit) {
6451 return as!VkQueueFlags(as!u32(flags) | as!u32(bit))
6452}